builder-settings-types 0.0.316 → 0.0.318
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/base/settings.d.ts +8 -0
- package/dist/builder-settings-types.cjs.js +82 -21
- package/dist/builder-settings-types.es.js +462 -360
- package/dist/index.css +1 -1
- package/dist/settings/gradient-settings/GradientSetting.d.ts +2 -0
- package/dist/settings/multi-language-settings/multiLanguageSettings.d.ts +6 -0
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const
|
|
2
|
-
let
|
|
1
|
+
const Et = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
2
|
+
let mt = (p = 21) => {
|
|
3
3
|
let t = "", e = crypto.getRandomValues(new Uint8Array(p |= 0));
|
|
4
4
|
for (; p--; )
|
|
5
|
-
t +=
|
|
5
|
+
t += Et[e[p] & 63];
|
|
6
6
|
return t;
|
|
7
7
|
};
|
|
8
8
|
function wt(p) {
|
|
@@ -142,18 +142,26 @@ function kt(p) {
|
|
|
142
142
|
return "";
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
|
-
const
|
|
145
|
+
const N = class N {
|
|
146
146
|
constructor(t = {}) {
|
|
147
|
-
this.props = t, this.dataPropsPath = "", this.id = t.id ||
|
|
147
|
+
this.props = t, this.dataPropsPath = "", this.id = t.id || mt(), 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, N.DefaultUploadUrl = t;
|
|
151
151
|
}
|
|
152
152
|
static SetDefaultLanguage(t) {
|
|
153
|
-
globalThis.DefaultLanguage = t,
|
|
153
|
+
globalThis.DefaultLanguage = t, N.DefaultLanguage = t;
|
|
154
|
+
}
|
|
155
|
+
static CurrentLanguage(t) {
|
|
156
|
+
return t !== void 0 && (N.currentLanguage = t, N.languageChangeCallbacks.forEach((e) => e(t))), N.currentLanguage || N.DefaultLanguage;
|
|
157
|
+
}
|
|
158
|
+
static onLanguageChange(t) {
|
|
159
|
+
return N.languageChangeCallbacks.add(t), () => {
|
|
160
|
+
N.languageChangeCallbacks.delete(t);
|
|
161
|
+
};
|
|
154
162
|
}
|
|
155
163
|
static SetGlobalVariables(t) {
|
|
156
|
-
|
|
164
|
+
N.GlobalVariables = { ...N.GlobalVariables, ...t };
|
|
157
165
|
}
|
|
158
166
|
destroy() {
|
|
159
167
|
throw new Error("Method not implemented.");
|
|
@@ -236,25 +244,29 @@ const G = class G {
|
|
|
236
244
|
return i.className = "input-icon " + (e || ""), i.innerHTML = t, i;
|
|
237
245
|
}
|
|
238
246
|
};
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
accent: "#00141E",
|
|
245
|
-
// Text Color
|
|
247
|
+
N.languageChangeCallbacks = /* @__PURE__ */ new Set(), N.GlobalVariables = {
|
|
248
|
+
primary: "#1B1958",
|
|
249
|
+
secondary: "#0D0938",
|
|
250
|
+
tertiary: "#2A1560",
|
|
251
|
+
accent: "#189541",
|
|
246
252
|
"text-dark": "#00141E",
|
|
247
|
-
"text-light": "#
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
|
|
253
|
+
"text-light": "#FFFFFF"
|
|
254
|
+
}, N.GlobalVariableGroups = [
|
|
255
|
+
{
|
|
256
|
+
title: "Global Colors",
|
|
257
|
+
keys: ["primary", "secondary", "tertiary", "accent"]
|
|
258
|
+
},
|
|
259
|
+
{ title: "Text Color", keys: ["text-dark", "text-light"] }
|
|
260
|
+
];
|
|
261
|
+
let x = N;
|
|
262
|
+
function G(p) {
|
|
251
263
|
return p instanceof x;
|
|
252
264
|
}
|
|
253
265
|
function k(p) {
|
|
254
|
-
return p instanceof
|
|
266
|
+
return p instanceof $;
|
|
255
267
|
}
|
|
256
268
|
function ct(p) {
|
|
257
|
-
return
|
|
269
|
+
return G(p) || k(p);
|
|
258
270
|
}
|
|
259
271
|
const ot = (p, t, e) => {
|
|
260
272
|
let i = !1, s = 0, n = 0, o = 0, a = 0;
|
|
@@ -265,9 +277,9 @@ const ot = (p, t, e) => {
|
|
|
265
277
|
o = d.left, a = d.top, document.addEventListener("mousemove", r), document.addEventListener("mouseup", c), document.body.style.userSelect = "none";
|
|
266
278
|
}, r = (h) => {
|
|
267
279
|
if (!i) return;
|
|
268
|
-
const d = h.clientX - s, u = h.clientY - n, f = window.innerWidth,
|
|
280
|
+
const d = h.clientX - s, u = h.clientY - n, f = window.innerWidth, m = window.innerHeight, g = t.offsetWidth, v = t.offsetHeight;
|
|
269
281
|
let C = o + d, y = a + u;
|
|
270
|
-
C = Math.max(8, Math.min(f -
|
|
282
|
+
C = Math.max(8, Math.min(f - g - 8, C)), y = Math.max(8, Math.min(m - v - 8, y)), t.style.left = `${C}px`, t.style.top = `${y}px`, e == null || e(C, y);
|
|
271
283
|
}, c = () => {
|
|
272
284
|
i = !1, document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", c), document.body.style.userSelect = "";
|
|
273
285
|
};
|
|
@@ -276,7 +288,7 @@ const ot = (p, t, e) => {
|
|
|
276
288
|
if (!p) return null;
|
|
277
289
|
let t = p.trim();
|
|
278
290
|
return !t.startsWith("#") || (t = t.slice(1), t.length === 3 && (t = t.split("").map((e) => e + e).join("")), !/^[0-9a-fA-F]{6}$/.test(t)) ? null : `#${t.toUpperCase()}`;
|
|
279
|
-
}, X = (p, t, e) => `#${[p, t, e].map((i) => Math.max(0, Math.min(255, i)).toString(16).padStart(2, "0")).join("")}`,
|
|
291
|
+
}, X = (p, t, e) => `#${[p, t, e].map((i) => Math.max(0, Math.min(255, i)).toString(16).padStart(2, "0")).join("")}`, P = (p) => {
|
|
280
292
|
const t = p.replace("#", ""), e = t.length === 3 ? t.split("").map((i) => i + i).join("") : t;
|
|
281
293
|
return {
|
|
282
294
|
r: parseInt(e.slice(0, 2), 16),
|
|
@@ -284,7 +296,7 @@ const ot = (p, t, e) => {
|
|
|
284
296
|
b: parseInt(e.slice(4, 6), 16)
|
|
285
297
|
};
|
|
286
298
|
}, z = (p) => {
|
|
287
|
-
const { r: t, g: e, b: i } =
|
|
299
|
+
const { r: t, g: e, b: i } = P(p), s = t / 255, n = e / 255, o = i / 255, a = Math.max(s, n, o), l = Math.min(s, n, o), r = a - l;
|
|
288
300
|
let c = 0;
|
|
289
301
|
r !== 0 && (a === s ? c = (n - o) / r % 6 : a === n ? c = (o - s) / r + 2 : c = (s - n) / r + 4), c < 0 && (c += 6);
|
|
290
302
|
const h = a === 0 ? 0 : r / a, d = a;
|
|
@@ -311,7 +323,7 @@ const ot = (p, t, e) => {
|
|
|
311
323
|
}, st = (p, t) => {
|
|
312
324
|
const e = Math.max(0, Math.min(100, t)) / 100;
|
|
313
325
|
if (p.startsWith("#")) {
|
|
314
|
-
const { r: s, g: n, b: o } =
|
|
326
|
+
const { r: s, g: n, b: o } = P(p);
|
|
315
327
|
return `rgba(${s}, ${n}, ${o}, ${e})`;
|
|
316
328
|
}
|
|
317
329
|
if (p.startsWith("rgba("))
|
|
@@ -342,7 +354,7 @@ const ot = (p, t, e) => {
|
|
|
342
354
|
}
|
|
343
355
|
const i = W(p);
|
|
344
356
|
if (i) {
|
|
345
|
-
const { r: s, g: n, b: o } =
|
|
357
|
+
const { r: s, g: n, b: o } = P(i);
|
|
346
358
|
return `rgba(${s}, ${n}, ${o}, ${e})`;
|
|
347
359
|
}
|
|
348
360
|
return p;
|
|
@@ -463,7 +475,7 @@ const ot = (p, t, e) => {
|
|
|
463
475
|
const l = Ct(n);
|
|
464
476
|
l.position = Math.max(0, Math.min(100, Math.round(o))), t.push(l);
|
|
465
477
|
}), t;
|
|
466
|
-
},
|
|
478
|
+
}, A = (p) => {
|
|
467
479
|
const t = p.stops && p.stops.length ? p.stops : [{ color: "#000000", position: 0, opacity: 100 }];
|
|
468
480
|
return {
|
|
469
481
|
type: p.type && ["linear", "radial", "solid"].includes(p.type) ? p.type : "linear",
|
|
@@ -474,11 +486,11 @@ const ot = (p, t, e) => {
|
|
|
474
486
|
opacity: e.opacity === void 0 || Number.isNaN(e.opacity) ? 100 : e.opacity
|
|
475
487
|
}))
|
|
476
488
|
};
|
|
477
|
-
},
|
|
489
|
+
}, T = (p) => {
|
|
478
490
|
const t = p.replace(/;$/, "").trim();
|
|
479
491
|
if (Nt(t)) {
|
|
480
492
|
const s = Ct(t);
|
|
481
|
-
return
|
|
493
|
+
return A({ type: "solid", angle: 0, stops: [s] });
|
|
482
494
|
}
|
|
483
495
|
const e = dt(t, "linear-gradient");
|
|
484
496
|
if (e) {
|
|
@@ -499,15 +511,15 @@ const ot = (p, t, e) => {
|
|
|
499
511
|
"to top left": 315
|
|
500
512
|
}[a] ?? 90, o = s.slice(1));
|
|
501
513
|
const l = pt(o);
|
|
502
|
-
return l.length ?
|
|
514
|
+
return l.length ? A({ type: "linear", angle: n, stops: l }) : null;
|
|
503
515
|
}
|
|
504
516
|
const i = dt(t, "radial-gradient");
|
|
505
517
|
if (i) {
|
|
506
518
|
const s = ht(i), n = s[0] && !It(s[0]) ? s.slice(1) : s, o = pt(n);
|
|
507
|
-
return o.length ?
|
|
519
|
+
return o.length ? A({ type: "radial", angle: 0, stops: o }) : null;
|
|
508
520
|
}
|
|
509
521
|
return null;
|
|
510
|
-
},
|
|
522
|
+
}, S = (p) => {
|
|
511
523
|
if (p.type === "solid") {
|
|
512
524
|
const e = p.stops[0], i = e.color;
|
|
513
525
|
if (i.startsWith("var(--"))
|
|
@@ -549,7 +561,7 @@ const ot = (p, t, e) => {
|
|
|
549
561
|
const e = /* @__PURE__ */ new Set(), i = [];
|
|
550
562
|
return t.forEach((s) => {
|
|
551
563
|
let n = W(s);
|
|
552
|
-
n ||
|
|
564
|
+
n || T(s) && (n = s), n && (e.has(n) || (e.add(n), i.push(n)));
|
|
553
565
|
}), i.slice(0, this.MAX_COLORS);
|
|
554
566
|
}
|
|
555
567
|
static ensureLoaded() {
|
|
@@ -598,7 +610,7 @@ const ot = (p, t, e) => {
|
|
|
598
610
|
if (i)
|
|
599
611
|
s = "solid";
|
|
600
612
|
else {
|
|
601
|
-
const l =
|
|
613
|
+
const l = T(t);
|
|
602
614
|
l && (i = t, s = l.type === "solid" ? "solid" : "gradient");
|
|
603
615
|
}
|
|
604
616
|
if (!i) return;
|
|
@@ -637,8 +649,8 @@ const at = (p, t) => {
|
|
|
637
649
|
const u = Vt(h);
|
|
638
650
|
if (d.title = u, d.setAttribute("aria-label", `Use color: ${u}`), h.includes("gradient(")) {
|
|
639
651
|
d.style.backgroundImage = h, d.style.backgroundColor = "transparent";
|
|
640
|
-
const
|
|
641
|
-
|
|
652
|
+
const m = T(h);
|
|
653
|
+
m && m.stops && m.stops.length > 0 && (d.style.borderColor = m.stops[0].color);
|
|
642
654
|
} else
|
|
643
655
|
d.style.backgroundColor = h, d.style.borderColor = h;
|
|
644
656
|
d.addEventListener("mouseenter", () => o(d, u)), d.addEventListener("mouseleave", () => {
|
|
@@ -656,12 +668,12 @@ const at = (p, t) => {
|
|
|
656
668
|
};
|
|
657
669
|
return r(), { container: e, refresh: r };
|
|
658
670
|
}, Vt = (p) => {
|
|
659
|
-
const t =
|
|
671
|
+
const t = T(p);
|
|
660
672
|
if (t)
|
|
661
673
|
return K(t);
|
|
662
674
|
const e = W(p);
|
|
663
675
|
if (e) {
|
|
664
|
-
const i =
|
|
676
|
+
const i = P(e);
|
|
665
677
|
return `${e} (RGB: ${i.r}, ${i.g}, ${i.b})`;
|
|
666
678
|
}
|
|
667
679
|
return p;
|
|
@@ -669,11 +681,11 @@ const at = (p, t) => {
|
|
|
669
681
|
<path fill-rule="evenodd" clip-rule="evenodd"
|
|
670
682
|
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"
|
|
671
683
|
fill="#919EAB"/>
|
|
672
|
-
</svg>`,
|
|
684
|
+
</svg>`, bt = `<svg width="23" height="23" viewBox="0 0 23 23" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
673
685
|
<path fill-rule="evenodd" clip-rule="evenodd" 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.29156ZM5.16281 16.0012L11.2425 9.92062L12.5681 11.2462L6.48844 17.3269C6.31266 17.5027 6.07424 17.6015 5.82562 17.6016H4.88812V16.6641C4.88818 16.4154 4.98698 16.177 5.16281 16.0012Z" fill="#353C47"/>
|
|
674
|
-
</svg>`,
|
|
686
|
+
</svg>`, Tt = `<svg width="15" height="17" viewBox="0 0 15 17" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
675
687
|
<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"/>
|
|
676
|
-
</svg>`,
|
|
688
|
+
</svg>`, Pt = `<svg width="14" height="2" viewBox="0 0 14 2" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
677
689
|
<path d="M0.8 0.800003H12.4667" stroke="#919EAB" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>
|
|
678
690
|
</svg>`, Ot = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
679
691
|
<rect x="21.25" y="21.333" width="18" height="18" rx="1" transform="rotate(-180 21.25 21.333)" stroke="#637381"/>
|
|
@@ -740,7 +752,7 @@ class ut {
|
|
|
740
752
|
const a = document.createElement("div");
|
|
741
753
|
a.className = "color-picker-sliders-container";
|
|
742
754
|
const l = document.createElement("button");
|
|
743
|
-
l.className = "color-picker-eyedropper", l.type = "button", l.innerHTML =
|
|
755
|
+
l.className = "color-picker-eyedropper", l.type = "button", l.innerHTML = bt;
|
|
744
756
|
const r = document.createElement("div");
|
|
745
757
|
r.className = "color-picker-sliders-group";
|
|
746
758
|
const c = document.createElement("div");
|
|
@@ -751,27 +763,27 @@ class ut {
|
|
|
751
763
|
d.className = "color-picker-opacity", this.opacitySlider = d;
|
|
752
764
|
const u = document.createElement("div");
|
|
753
765
|
u.className = "color-picker-opacity-marker", this.opacityMarker = u, d.appendChild(u), r.appendChild(c), r.appendChild(d), a.appendChild(l), a.appendChild(r);
|
|
754
|
-
const f = at((
|
|
766
|
+
const f = at((b) => {
|
|
755
767
|
var w;
|
|
756
|
-
this.setColor(
|
|
768
|
+
this.setColor(b), (w = this.onChange) == null || w.call(this, b, this.currentOpacity);
|
|
757
769
|
}, this.recentScope);
|
|
758
770
|
this.recentSectionRefresh = f.refresh;
|
|
759
|
-
const
|
|
760
|
-
|
|
761
|
-
const
|
|
762
|
-
|
|
771
|
+
const m = document.createElement("div");
|
|
772
|
+
m.className = "color-picker-format-section";
|
|
773
|
+
const g = document.createElement("select");
|
|
774
|
+
g.className = "color-picker-format-select", this.select = g;
|
|
763
775
|
const v = document.createElement("option");
|
|
764
776
|
v.value = "hex", v.textContent = "HEX";
|
|
765
777
|
const C = document.createElement("option");
|
|
766
778
|
C.value = "rgb", C.textContent = "RGB";
|
|
767
779
|
const y = document.createElement("option");
|
|
768
|
-
y.value = "hsl", y.textContent = "HSL",
|
|
769
|
-
const
|
|
770
|
-
|
|
780
|
+
y.value = "hsl", y.textContent = "HSL", g.appendChild(v), g.appendChild(C), g.appendChild(y);
|
|
781
|
+
const E = document.createElement("input");
|
|
782
|
+
E.type = "text", E.className = "color-picker-color-input", E.value = this.currentColor, this.input = E;
|
|
771
783
|
const L = document.createElement("div");
|
|
772
784
|
L.className = "color-picker-input-container";
|
|
773
|
-
const
|
|
774
|
-
return
|
|
785
|
+
const I = document.createElement("button");
|
|
786
|
+
return I.className = "color-picker-copy-inside", I.textContent = "Copy", L.appendChild(E), L.appendChild(I), m.appendChild(g), m.appendChild(L), t.appendChild(e), t.appendChild(n), t.appendChild(a), t.appendChild(f.container), t.appendChild(m), t.addEventListener("click", (b) => b.stopPropagation()), this.bind(n, c, d, E, g, I, l), t;
|
|
775
787
|
}
|
|
776
788
|
createBackdrop() {
|
|
777
789
|
const t = document.createElement("div");
|
|
@@ -782,14 +794,14 @@ class ut {
|
|
|
782
794
|
var C;
|
|
783
795
|
const d = t.getBoundingClientRect(), u = Math.max(0, Math.min(1, (h.clientX - d.left) / d.width)), f = Math.max(0, Math.min(1, (h.clientY - d.top) / d.height));
|
|
784
796
|
this.colorMarker.style.left = `${u * 100}%`, this.colorMarker.style.top = `${f * 100}%`;
|
|
785
|
-
const
|
|
797
|
+
const g = this.parsePercentage(this.hueMarker.style.left || "0%") * 360, v = U(g, u, 1 - f);
|
|
786
798
|
this.currentColor = v, this.syncInput(), this.updateOpacityBg(), (C = this.onChange) == null || C.call(this, v, this.currentOpacity);
|
|
787
799
|
}, r = (h) => {
|
|
788
800
|
var C;
|
|
789
801
|
const d = e.getBoundingClientRect();
|
|
790
802
|
let u = Math.max(0, Math.min(1, (h.clientX - d.left) / d.width));
|
|
791
803
|
this.hueMarker.style.left = `${u * 100}%`;
|
|
792
|
-
const f = u * 360,
|
|
804
|
+
const f = u * 360, m = this.parsePercentage(this.colorMarker.style.left || "0%"), g = this.parsePercentage(this.colorMarker.style.top || "0%"), v = U(f, m, 1 - g);
|
|
793
805
|
this.currentColor = v, this.colorArea.style.background = `linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${f}, 100%, 50%))`, this.syncInput(), this.updateOpacityBg(), (C = this.onChange) == null || C.call(this, v, this.currentOpacity);
|
|
794
806
|
}, c = (h) => {
|
|
795
807
|
var f;
|
|
@@ -848,7 +860,7 @@ class ut {
|
|
|
848
860
|
const t = this.select.value, { h: e, s: i, v: s } = z(this.currentColor);
|
|
849
861
|
if (t === "hex") this.input.value = this.currentColor;
|
|
850
862
|
else if (t === "rgb") {
|
|
851
|
-
const { r: n, g: o, b: a } =
|
|
863
|
+
const { r: n, g: o, b: a } = P(this.currentColor);
|
|
852
864
|
this.input.value = `rgb(${n}, ${o}, ${a})`;
|
|
853
865
|
} else {
|
|
854
866
|
const { hue: n, sat: o, lightness: a } = vt(e, i, s);
|
|
@@ -877,7 +889,7 @@ class ut {
|
|
|
877
889
|
e && this.setColor(e);
|
|
878
890
|
}
|
|
879
891
|
updateOpacityBg() {
|
|
880
|
-
const { r: t, g: e, b: i } =
|
|
892
|
+
const { r: t, g: e, b: i } = P(this.currentColor);
|
|
881
893
|
this.opacitySlider.style.setProperty(
|
|
882
894
|
"--base-color",
|
|
883
895
|
`rgb(${t}, ${e}, ${i})`
|
|
@@ -890,8 +902,8 @@ class ut {
|
|
|
890
902
|
this.hueMarker.style.left = `${s / 360 * 100}%`, this.colorMarker.style.left = `${n * 100}%`, this.colorMarker.style.top = `${(1 - o) * 100}%`, this.colorArea.style.background = `linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${s}, 100%, 50%))`, this.updateOpacityBg(), this.opacityMarker.style.left = `${this.currentOpacity}%`, (y = this.recentSectionRefresh) == null || y.call(this), this.isOpen = !0, this.backdrop.style.display = "block", this.backdrop.parentElement || document.body.appendChild(this.backdrop), this.element.style.display = "block", this.element.style.position = "fixed", this.element.style.zIndex = "10002", this.element.style.left = "-9999px", this.element.style.top = "0px", this.element.parentElement || document.body.appendChild(this.element);
|
|
891
903
|
const a = this.element.offsetWidth, l = this.element.offsetHeight, r = e.getBoundingClientRect(), c = window.innerWidth, h = window.innerHeight, d = 16;
|
|
892
904
|
let u = r.right + 8, f = r.top;
|
|
893
|
-
const
|
|
894
|
-
|
|
905
|
+
const m = c - r.right, g = r.left;
|
|
906
|
+
m >= a + d ? u = r.right + 8 : g >= a + d ? u = r.left - a - 8 : u = Math.max(d, (c - a) / 2);
|
|
895
907
|
const v = h - r.bottom, C = r.top;
|
|
896
908
|
v >= l + d ? f = r.bottom + 8 : C >= l + d ? f = r.top - l - 8 : v > C ? (f = r.bottom + 8, f + l > h - d && (f = h - l - d)) : (f = r.top - l - 8, f < d && (f = d)), this.element.style.left = `${u}px`, this.element.style.top = `${f}px`;
|
|
897
909
|
}
|
|
@@ -921,7 +933,7 @@ class Bt {
|
|
|
921
933
|
const s = document.createElement("div");
|
|
922
934
|
s.className = "color-picker-sliders-container embedded";
|
|
923
935
|
const n = document.createElement("button");
|
|
924
|
-
n.className = "color-picker-eyedropper", n.type = "button", n.innerHTML =
|
|
936
|
+
n.className = "color-picker-eyedropper", n.type = "button", n.innerHTML = bt;
|
|
925
937
|
const o = document.createElement("div");
|
|
926
938
|
o.className = "color-picker-sliders-group";
|
|
927
939
|
const a = document.createElement("div");
|
|
@@ -932,9 +944,9 @@ class Bt {
|
|
|
932
944
|
r.className = "color-picker-opacity embedded", this.opacitySlider = r;
|
|
933
945
|
const c = document.createElement("div");
|
|
934
946
|
c.className = "color-picker-opacity-marker", this.opacityMarker = c, r.appendChild(c), o.appendChild(a), o.appendChild(r), s.appendChild(n), s.appendChild(o);
|
|
935
|
-
const h = at((
|
|
936
|
-
const L =
|
|
937
|
-
L && L.type !== "solid" ? this.onColorChange(
|
|
947
|
+
const h = at((E) => {
|
|
948
|
+
const L = T(E);
|
|
949
|
+
L && L.type !== "solid" ? this.onColorChange(E, this.currentOpacity) : (this.setColor(E), this.onColorChange(this.currentColor, this.currentOpacity));
|
|
938
950
|
}, "all");
|
|
939
951
|
this.recentSectionRefresh = h.refresh;
|
|
940
952
|
const d = document.createElement("div");
|
|
@@ -943,10 +955,10 @@ class Bt {
|
|
|
943
955
|
u.className = "color-picker-format-select", this.select = u;
|
|
944
956
|
const f = document.createElement("option");
|
|
945
957
|
f.value = "hex", f.textContent = "HEX";
|
|
946
|
-
const g = document.createElement("option");
|
|
947
|
-
g.value = "rgb", g.textContent = "RGB";
|
|
948
958
|
const m = document.createElement("option");
|
|
949
|
-
m.value = "
|
|
959
|
+
m.value = "rgb", m.textContent = "RGB";
|
|
960
|
+
const g = document.createElement("option");
|
|
961
|
+
g.value = "hsl", g.textContent = "HSL", u.appendChild(f), u.appendChild(m), u.appendChild(g);
|
|
950
962
|
const v = document.createElement("input");
|
|
951
963
|
v.type = "text", v.className = "color-picker-color-input", this.input = v;
|
|
952
964
|
const C = document.createElement("div");
|
|
@@ -958,12 +970,12 @@ class Bt {
|
|
|
958
970
|
const l = (h) => {
|
|
959
971
|
const d = t.getBoundingClientRect(), u = Math.max(0, Math.min(1, (h.clientX - d.left) / d.width)), f = Math.max(0, Math.min(1, (h.clientY - d.top) / d.height));
|
|
960
972
|
this.colorMarker.style.left = `${u * 100}%`, this.colorMarker.style.top = `${f * 100}%`;
|
|
961
|
-
const
|
|
973
|
+
const g = this.parsePercentage(this.hueMarker.style.left || "0%") * 360, v = U(g, u, 1 - f);
|
|
962
974
|
this.currentColor = v, this.syncInput(), this.updateOpacityBg(), this.queueChange();
|
|
963
975
|
}, r = (h) => {
|
|
964
976
|
const d = e.getBoundingClientRect(), u = Math.max(0, Math.min(1, (h.clientX - d.left) / d.width));
|
|
965
977
|
this.hueMarker.style.left = `${u * 100}%`;
|
|
966
|
-
const f = u * 360,
|
|
978
|
+
const f = u * 360, m = this.parsePercentage(this.colorMarker.style.left || "0%"), g = this.parsePercentage(this.colorMarker.style.top || "0%"), v = U(f, m, 1 - g);
|
|
967
979
|
this.currentColor = v, this.colorArea.style.background = `linear-gradient(to top, #000, transparent),
|
|
968
980
|
linear-gradient(to right, #fff, hsl(${f}, 100%, 50%))`, this.syncInput(), this.updateOpacityBg(), this.queueChange();
|
|
969
981
|
}, c = (h) => {
|
|
@@ -1025,7 +1037,7 @@ class Bt {
|
|
|
1025
1037
|
if (t === "hex")
|
|
1026
1038
|
this.input.value = this.currentColor;
|
|
1027
1039
|
else if (t === "rgb") {
|
|
1028
|
-
const { r: n, g: o, b: a } =
|
|
1040
|
+
const { r: n, g: o, b: a } = P(this.currentColor);
|
|
1029
1041
|
this.input.value = `rgb(${n}, ${o}, ${a})`;
|
|
1030
1042
|
} else {
|
|
1031
1043
|
const { hue: n, sat: o, lightness: a } = vt(e, i, s);
|
|
@@ -1055,7 +1067,7 @@ class Bt {
|
|
|
1055
1067
|
e && (this.setColor(e), this.onColorChange(this.currentColor, this.currentOpacity));
|
|
1056
1068
|
}
|
|
1057
1069
|
updateOpacityBg() {
|
|
1058
|
-
const { r: t, g: e, b: i } =
|
|
1070
|
+
const { r: t, g: e, b: i } = P(this.currentColor);
|
|
1059
1071
|
this.opacitySlider.style.setProperty(
|
|
1060
1072
|
"--base-color",
|
|
1061
1073
|
`rgb(${t}, ${e}, ${i})`
|
|
@@ -1096,7 +1108,7 @@ class Bt {
|
|
|
1096
1108
|
this.initFromColor(t, e);
|
|
1097
1109
|
}
|
|
1098
1110
|
}
|
|
1099
|
-
const
|
|
1111
|
+
const V = class V extends x {
|
|
1100
1112
|
constructor(t = {}) {
|
|
1101
1113
|
const e = typeof t.default == "string" ? void 0 : t.default;
|
|
1102
1114
|
super({
|
|
@@ -1107,16 +1119,10 @@ const $ = class $ extends x {
|
|
|
1107
1119
|
type: "text",
|
|
1108
1120
|
angle: "number",
|
|
1109
1121
|
stops: "text"
|
|
1110
|
-
}, this.element = null, this.previewEl = null, this.inputEl = void 0, this.popoverEl = null, this.backdropEl = null, this.isPopoverOpen = !1, this.isEditing = !1, this.popoverPosition = null, this.previewUpdateTimeout = null, this.solidPicker = null, this.pendingSolidColor = null, this.variant = "default", this.globalLayoutMode = "list", this.globalSearchQuery = "", this.currentMode = "custom", this.linkedGlobalVariable = null, this.unlinkButton = null, this.onBackgroundClick = (i) => {
|
|
1122
|
+
}, this.element = null, this.previewEl = null, this.inputEl = void 0, this.popoverEl = null, this.backdropEl = null, this.isPopoverOpen = !1, this.isEditing = !1, this.popoverPosition = null, this.previewUpdateTimeout = null, this.changeDebounceTimeout = null, this.solidPicker = null, this.pendingSolidColor = null, this.variant = "default", this.globalLayoutMode = "list", this.globalSearchQuery = "", this.currentMode = "custom", this.linkedGlobalVariable = null, this.unlinkButton = null, this.onBackgroundClick = (i) => {
|
|
1111
1123
|
var d;
|
|
1112
1124
|
if (!this.popoverEl || !this.isPopoverOpen) return;
|
|
1113
|
-
const s = i.target, n = this.popoverEl.contains(s), o = (d = this.element) == null ? void 0 : d.contains(s), a = document.querySelectorAll(".custom-color-picker"), l = Array.from(a).some((u) => u.contains(s)), r = s.closest(
|
|
1114
|
-
".gstop-color-input, .gradient-mini-preview, .gstop-color-preview"
|
|
1115
|
-
), c = s.classList.contains(
|
|
1116
|
-
"color-picker-backdrop"
|
|
1117
|
-
), h = s.classList.contains(
|
|
1118
|
-
"gradient-popover-backdrop"
|
|
1119
|
-
);
|
|
1125
|
+
const s = i.target, n = this.popoverEl.contains(s), o = (d = this.element) == null ? void 0 : d.contains(s), a = document.querySelectorAll(".custom-color-picker"), l = Array.from(a).some((u) => u.contains(s)), r = s.closest(".gstop-color-input, .gradient-mini-preview, .gstop-color-preview"), c = s.classList.contains("color-picker-backdrop"), h = s.classList.contains("gradient-popover-backdrop");
|
|
1120
1126
|
!n && !o && !l && !r && !c && !h && this.closePopover();
|
|
1121
1127
|
}, this.handlePopoverKeydown = (i) => {
|
|
1122
1128
|
if (this.isPopoverOpen) {
|
|
@@ -1126,8 +1132,7 @@ const $ = class $ extends x {
|
|
|
1126
1132
|
}
|
|
1127
1133
|
if (i.key === "Enter") {
|
|
1128
1134
|
const s = i.target;
|
|
1129
|
-
if (s && (s.tagName === "INPUT" || s.tagName === "TEXTAREA"))
|
|
1130
|
-
return;
|
|
1135
|
+
if (s && (s.tagName === "INPUT" || s.tagName === "TEXTAREA")) return;
|
|
1131
1136
|
i.preventDefault(), this.closePopover();
|
|
1132
1137
|
}
|
|
1133
1138
|
}
|
|
@@ -1170,16 +1175,16 @@ const $ = class $ extends x {
|
|
|
1170
1175
|
const t = this.originalDefault;
|
|
1171
1176
|
if (typeof t == "string") {
|
|
1172
1177
|
if (t.startsWith("var(--"))
|
|
1173
|
-
return
|
|
1178
|
+
return A({
|
|
1174
1179
|
type: "solid",
|
|
1175
1180
|
angle: 0,
|
|
1176
1181
|
stops: [{ color: t, position: 0, opacity: 100 }]
|
|
1177
1182
|
});
|
|
1178
|
-
const i =
|
|
1183
|
+
const i = T(t);
|
|
1179
1184
|
if (i)
|
|
1180
|
-
return
|
|
1185
|
+
return A(i);
|
|
1181
1186
|
}
|
|
1182
|
-
return
|
|
1187
|
+
return A(t && typeof t == "object" ? t : {
|
|
1183
1188
|
type: "linear",
|
|
1184
1189
|
angle: 90,
|
|
1185
1190
|
stops: [
|
|
@@ -1190,11 +1195,11 @@ const $ = class $ extends x {
|
|
|
1190
1195
|
}
|
|
1191
1196
|
setValue(t) {
|
|
1192
1197
|
let e = null;
|
|
1193
|
-
typeof t == "string" ? t.startsWith("var(--") ? e =
|
|
1198
|
+
typeof t == "string" ? t.startsWith("var(--") ? e = A({
|
|
1194
1199
|
type: "solid",
|
|
1195
1200
|
angle: 0,
|
|
1196
1201
|
stops: [{ color: t, position: 0, opacity: 100 }]
|
|
1197
|
-
}) : e =
|
|
1202
|
+
}) : e = T(t) : t && typeof t == "object" && (e = A(t)), e || (e = this.defaultValue()), this.value = e, this.setLinkedGlobalVariableFrom(t ?? e), this.updateUI(), this.isPopoverOpen && this.refreshPopoverContent(), this.triggerChange(), this.pendingSolidColor = null, this.updateUnlinkButtonVisibility();
|
|
1198
1203
|
}
|
|
1199
1204
|
updateUI() {
|
|
1200
1205
|
if (this.previewEl && this.value)
|
|
@@ -1203,7 +1208,7 @@ const $ = class $ extends x {
|
|
|
1203
1208
|
this.previewEl.style.background = st(i, e);
|
|
1204
1209
|
} else {
|
|
1205
1210
|
const t = this.resolveGradientGlobalVars(this.value);
|
|
1206
|
-
this.previewEl.style.background =
|
|
1211
|
+
this.previewEl.style.background = S(t);
|
|
1207
1212
|
}
|
|
1208
1213
|
if (this.inputEl && this.value && !this.isEditing)
|
|
1209
1214
|
if (this.isBoundToGlobal() && this.linkedGlobalVariable) {
|
|
@@ -1224,11 +1229,12 @@ const $ = class $ extends x {
|
|
|
1224
1229
|
}
|
|
1225
1230
|
updateUnlinkButtonVisibility() {
|
|
1226
1231
|
if (!this.unlinkButton) return;
|
|
1227
|
-
|
|
1232
|
+
const t = this.isBoundToGlobal();
|
|
1233
|
+
t ? this.unlinkButton.classList.add("visible") : this.unlinkButton.classList.remove("visible"), this.previewEl && (t ? this.previewEl.classList.add("bound") : this.previewEl.classList.remove("bound"));
|
|
1228
1234
|
}
|
|
1229
1235
|
cssForTextValue() {
|
|
1230
1236
|
return this.value ? {
|
|
1231
|
-
background:
|
|
1237
|
+
background: S(this.value),
|
|
1232
1238
|
"-webkit-background-clip": "text",
|
|
1233
1239
|
"background-clip": "text",
|
|
1234
1240
|
color: "transparent",
|
|
@@ -1244,7 +1250,7 @@ const $ = class $ extends x {
|
|
|
1244
1250
|
s.className = "input-label", s.textContent = this.props.title, i.appendChild(s), t.appendChild(i);
|
|
1245
1251
|
}
|
|
1246
1252
|
const e = document.createElement("div");
|
|
1247
|
-
return e.className = "gradient-input-wrapper", this.previewEl = document.createElement("div"), this.previewEl.className = "gradient-mini-preview", this.previewEl.style.background = this.value ?
|
|
1253
|
+
return e.className = "gradient-input-wrapper", this.previewEl = document.createElement("div"), this.previewEl.className = "gradient-mini-preview", this.previewEl.style.background = this.value ? S(this.value) : "linear-gradient(90deg, #a84b4b 0%, #786666 100%)", this.previewEl.addEventListener("click", (i) => {
|
|
1248
1254
|
i.preventDefault(), i.stopPropagation(), this.openPopover();
|
|
1249
1255
|
}), 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 ? K(this.value) : "", this.inputEl.readOnly = !1, this.inputEl.addEventListener("focus", () => {
|
|
1250
1256
|
if (this.isEditing = !0, this.value)
|
|
@@ -1260,14 +1266,11 @@ const $ = class $ extends x {
|
|
|
1260
1266
|
}
|
|
1261
1267
|
}
|
|
1262
1268
|
} else
|
|
1263
|
-
this.inputEl.value =
|
|
1269
|
+
this.inputEl.value = S(this.value);
|
|
1264
1270
|
}), this.inputEl.addEventListener("blur", () => {
|
|
1265
1271
|
this.isEditing = !1, this.value && (this.inputEl.value = K(this.value));
|
|
1266
|
-
}), this.inputEl.addEventListener(
|
|
1267
|
-
"
|
|
1268
|
-
(i) => this.handlePaste(i)
|
|
1269
|
-
), this.inputEl.addEventListener("input", (i) => this.handleTextInput(i)), this.inputEl.addEventListener("keydown", (i) => {
|
|
1270
|
-
i.key === "Enter" && (this.handleTextInput(i), this.inputEl.blur()), i.key === "Escape" && (this.value && (this.inputEl.value = I(this.value)), this.inputEl.blur());
|
|
1272
|
+
}), this.inputEl.addEventListener("paste", (i) => this.handlePaste(i)), this.inputEl.addEventListener("input", (i) => this.handleTextInput(i)), this.inputEl.addEventListener("keydown", (i) => {
|
|
1273
|
+
i.key === "Enter" && (this.handleTextInput(i), this.inputEl.blur()), i.key === "Escape" && (this.value && (this.inputEl.value = S(this.value)), this.inputEl.blur());
|
|
1271
1274
|
}), e.appendChild(this.previewEl), this.unlinkButton = document.createElement("button"), this.unlinkButton.type = "button", this.unlinkButton.className = "gradient-unlink-button", this.unlinkButton.innerHTML = Ht, this.unlinkButton.title = "Break global color binding", this.unlinkButton.addEventListener("click", (i) => {
|
|
1272
1275
|
i.preventDefault(), i.stopPropagation(), this.breakGlobalBinding();
|
|
1273
1276
|
}), e.appendChild(this.unlinkButton), e.appendChild(this.inputEl), t.appendChild(e), this.createPopover(), this.element = t, this.updateUnlinkButtonVisibility(), t;
|
|
@@ -1322,18 +1325,18 @@ const $ = class $ extends x {
|
|
|
1322
1325
|
this.switchType(o);
|
|
1323
1326
|
}), t.appendChild(e), t.appendChild(i), t;
|
|
1324
1327
|
}
|
|
1325
|
-
switchType(t) {
|
|
1326
|
-
var
|
|
1328
|
+
switchType(t, e = !1) {
|
|
1329
|
+
var o;
|
|
1327
1330
|
if (!this.value) return;
|
|
1328
|
-
const
|
|
1331
|
+
const i = this.isBoundToGlobal(), s = this.linkedGlobalVariable;
|
|
1329
1332
|
if (this.value.type = t, t !== "solid" && (this.pendingSolidColor = null), t !== "solid" && (!this.value.stops || this.value.stops.length === 0) && (this.value.stops = [
|
|
1330
1333
|
{ color: "#a84b4b", position: 0, opacity: 100 },
|
|
1331
1334
|
{ color: "#786666", position: 100, opacity: 100 }
|
|
1332
1335
|
]), t !== "solid" && this.value.stops.length === 1) {
|
|
1333
|
-
const
|
|
1334
|
-
if (
|
|
1335
|
-
const
|
|
1336
|
-
|
|
1336
|
+
const l = this.value.stops[0].color;
|
|
1337
|
+
if (l.startsWith("var(--")) {
|
|
1338
|
+
const r = this.resolveGlobalVarColor(l), c = T(r);
|
|
1339
|
+
c && c.type !== "solid" && c.stops.length >= 2 ? (this.value.stops = c.stops, this.value.angle = c.angle, this.value.type = c.type) : (this.value.stops.push({
|
|
1337
1340
|
color: "#786666",
|
|
1338
1341
|
position: 100,
|
|
1339
1342
|
opacity: 100
|
|
@@ -1346,20 +1349,18 @@ const $ = class $ extends x {
|
|
|
1346
1349
|
}), this.value.angle = 90;
|
|
1347
1350
|
} else if (t !== "solid" && this.value.stops.length >= 2)
|
|
1348
1351
|
this.value.angle || (this.value.angle = 90);
|
|
1349
|
-
else if (t === "solid" &&
|
|
1350
|
-
const
|
|
1351
|
-
this.value.stops = [
|
|
1352
|
-
{ color: i, position: 0, opacity: o }
|
|
1353
|
-
], this.value.angle = 0;
|
|
1352
|
+
else if (t === "solid" && i && s) {
|
|
1353
|
+
const a = this.value.stops && this.value.stops[0] ? this.value.stops[0].opacity ?? 100 : 100;
|
|
1354
|
+
this.value.stops = [{ color: s, position: 0, opacity: a }], this.value.angle = 0;
|
|
1354
1355
|
}
|
|
1355
1356
|
if (this.popoverEl) {
|
|
1356
|
-
const
|
|
1357
|
-
|
|
1358
|
-
const
|
|
1359
|
-
t === "solid" ?
|
|
1357
|
+
const a = this.popoverEl.querySelectorAll(".gradient-type-tab");
|
|
1358
|
+
a.forEach((c) => c.classList.remove("active"));
|
|
1359
|
+
const l = a[0], r = a[1];
|
|
1360
|
+
t === "solid" ? l == null || l.classList.add("active") : r == null || r.classList.add("active");
|
|
1360
1361
|
}
|
|
1361
|
-
const
|
|
1362
|
-
|
|
1362
|
+
const n = (o = this.popoverEl) == null ? void 0 : o.querySelector(".gradient-editor-content");
|
|
1363
|
+
n && this.updatePopoverContent(n), this.updateUI(), e && this.triggerChange();
|
|
1363
1364
|
}
|
|
1364
1365
|
updatePopoverContent(t) {
|
|
1365
1366
|
if (t.innerHTML = "", !!this.value) {
|
|
@@ -1377,50 +1378,44 @@ const $ = class $ extends x {
|
|
|
1377
1378
|
let d = {};
|
|
1378
1379
|
try {
|
|
1379
1380
|
d = x.GlobalVariables || {};
|
|
1380
|
-
} catch (
|
|
1381
|
-
console.warn("Could not access Setting.GlobalVariables",
|
|
1381
|
+
} catch (g) {
|
|
1382
|
+
console.warn("Could not access Setting.GlobalVariables", g);
|
|
1382
1383
|
}
|
|
1383
1384
|
if (!d || Object.keys(d).length === 0) {
|
|
1384
|
-
const
|
|
1385
|
-
|
|
1385
|
+
const g = document.createElement("div");
|
|
1386
|
+
g.textContent = "No global colors defined", g.style.fontSize = "12px", g.style.color = "#666", g.style.padding = "8px", h.appendChild(g);
|
|
1386
1387
|
return;
|
|
1387
1388
|
}
|
|
1388
|
-
const u = [
|
|
1389
|
-
{
|
|
1390
|
-
|
|
1391
|
-
keys: ["primary", "secondary", "tertiary", "accent", "background"]
|
|
1392
|
-
},
|
|
1393
|
-
{
|
|
1394
|
-
title: "Text Color",
|
|
1395
|
-
keys: ["text-dark", "text-light"]
|
|
1396
|
-
}
|
|
1389
|
+
const u = x.GlobalVariableGroups || [
|
|
1390
|
+
{ title: "Global Colors", keys: ["primary", "secondary", "tertiary", "accent"] },
|
|
1391
|
+
{ title: "Text Color", keys: ["text-dark", "text-light"] }
|
|
1397
1392
|
], f = this.globalSearchQuery.toLowerCase();
|
|
1398
|
-
let
|
|
1399
|
-
this.globalLayoutMode === "list" ? (
|
|
1400
|
-
const v = Object.entries(d).filter(([C]) => !
|
|
1393
|
+
let m;
|
|
1394
|
+
this.globalLayoutMode === "list" ? (m = document.createElement("div"), m.className = "global-colors-list") : (m = document.createElement("div"), m.className = "global-colors-grid"), h.appendChild(m), u.forEach((g) => {
|
|
1395
|
+
const v = Object.entries(d).filter(([C]) => !g.keys.includes(C) && g.title !== "Global Colors" ? !1 : g.keys.includes(C) && C.toLowerCase().includes(f));
|
|
1401
1396
|
v.length !== 0 && v.forEach(([C, y]) => {
|
|
1402
1397
|
if (this.globalLayoutMode === "list") {
|
|
1403
|
-
const
|
|
1404
|
-
|
|
1398
|
+
const E = document.createElement("div");
|
|
1399
|
+
E.className = "global-color-row";
|
|
1405
1400
|
const L = document.createElement("div");
|
|
1406
1401
|
L.className = "global-color-circle";
|
|
1407
|
-
const
|
|
1408
|
-
L.style.background =
|
|
1402
|
+
const I = this.resolveGlobalVarColor(y);
|
|
1403
|
+
L.style.background = I, (this.linkedGlobalVariable === `var(--${C})` || e.color === `var(--${C})`) && L.classList.add("selected");
|
|
1409
1404
|
const w = document.createElement("span");
|
|
1410
|
-
w.className = "global-color-label", w.textContent = C.split("-").map((M) => M.charAt(0).toUpperCase() + M.slice(1)).join(" "),
|
|
1405
|
+
w.className = "global-color-label", w.textContent = C.split("-").map((M) => M.charAt(0).toUpperCase() + M.slice(1)).join(" "), E.appendChild(L), E.appendChild(w), E.addEventListener("click", (M) => {
|
|
1411
1406
|
M.preventDefault();
|
|
1412
|
-
const
|
|
1413
|
-
this.setValue(
|
|
1414
|
-
}),
|
|
1407
|
+
const D = `var(--${C})`;
|
|
1408
|
+
this.setValue(D), this.pendingSolidColor = D, i(h);
|
|
1409
|
+
}), m.appendChild(E);
|
|
1415
1410
|
} else {
|
|
1416
|
-
const
|
|
1417
|
-
|
|
1411
|
+
const E = document.createElement("div");
|
|
1412
|
+
E.className = "global-color-circle";
|
|
1418
1413
|
const L = this.resolveGlobalVarColor(y);
|
|
1419
|
-
|
|
1420
|
-
|
|
1414
|
+
E.style.background = L, E.title = C.split("-").map((b) => b.charAt(0).toUpperCase() + b.slice(1)).join(" "), (this.linkedGlobalVariable === `var(--${C})` || e.color === `var(--${C})`) && E.classList.add("selected"), E.addEventListener("click", (b) => {
|
|
1415
|
+
b.preventDefault();
|
|
1421
1416
|
const w = `var(--${C})`;
|
|
1422
1417
|
this.setValue(w), this.pendingSolidColor = w, i(h);
|
|
1423
|
-
}),
|
|
1418
|
+
}), m.appendChild(E);
|
|
1424
1419
|
}
|
|
1425
1420
|
});
|
|
1426
1421
|
});
|
|
@@ -1452,9 +1447,9 @@ const $ = class $ extends x {
|
|
|
1452
1447
|
initialOpacity: e.opacity ?? 100,
|
|
1453
1448
|
onColorChange: (s, n) => {
|
|
1454
1449
|
if (this.clearGlobalBindingForCustomChange(), this.value) {
|
|
1455
|
-
const o =
|
|
1450
|
+
const o = T(s);
|
|
1456
1451
|
if (o && o.type !== "solid") {
|
|
1457
|
-
this.value = o, this.switchType(o.type);
|
|
1452
|
+
this.value = o, this.switchType(o.type, !0);
|
|
1458
1453
|
return;
|
|
1459
1454
|
}
|
|
1460
1455
|
this.value.stops[0].color = s, this.value.stops[0].opacity = n, this.updateUI(), this.triggerChange(), this.pendingSolidColor = s;
|
|
@@ -1476,25 +1471,25 @@ const $ = class $ extends x {
|
|
|
1476
1471
|
const u = document.createElement("option");
|
|
1477
1472
|
u.value = "radial", u.textContent = "Radial", h.appendChild(d), h.appendChild(u), h.value = this.value.type === "radial" ? "radial" : "linear", e = document.createElement("input"), e.type = "text", e.inputMode = "numeric", e.className = "gradient-degree-input", e.value = `${this.value.angle ?? 90}°`, e.style.width = "75px", e.style.textAlign = "center", (!this.value.angle || this.value.stops.length < 2) && (this.value.angle = 90, e.value = "90°");
|
|
1478
1473
|
const f = document.createElement("button");
|
|
1479
|
-
f.type = "button", f.className = "gradient-flip-btn", f.innerHTML =
|
|
1480
|
-
this.clearGlobalBindingForCustomChange(), this.switchType(h.value === "radial" ? "radial" : "linear"), e && this.updateDegreeVisibility(e);
|
|
1481
|
-
}), e.addEventListener("focus", (
|
|
1482
|
-
const
|
|
1483
|
-
|
|
1484
|
-
}), e.addEventListener("input", (
|
|
1474
|
+
f.type = "button", f.className = "gradient-flip-btn", f.innerHTML = Tt, h.addEventListener("change", () => {
|
|
1475
|
+
this.clearGlobalBindingForCustomChange(), this.switchType(h.value === "radial" ? "radial" : "linear", !0), e && this.updateDegreeVisibility(e);
|
|
1476
|
+
}), e.addEventListener("focus", (m) => {
|
|
1477
|
+
const g = m.target;
|
|
1478
|
+
g.value = g.value.replace(/[^0-9-]/g, ""), setTimeout(() => g.select(), 0);
|
|
1479
|
+
}), e.addEventListener("input", (m) => {
|
|
1485
1480
|
this.clearGlobalBindingForCustomChange();
|
|
1486
|
-
const
|
|
1487
|
-
!Number.isNaN(
|
|
1488
|
-
}), e.addEventListener("blur", (
|
|
1481
|
+
const g = parseInt(m.target.value);
|
|
1482
|
+
!Number.isNaN(g) && this.value && (this.value.angle = Math.max(0, Math.min(360, g)), this.debouncedPreviewUpdate());
|
|
1483
|
+
}), e.addEventListener("blur", (m) => {
|
|
1489
1484
|
var C;
|
|
1490
1485
|
this.previewUpdateTimeout && (clearTimeout(this.previewUpdateTimeout), this.previewUpdateTimeout = null);
|
|
1491
|
-
const
|
|
1492
|
-
let v = parseInt(
|
|
1493
|
-
Number.isNaN(v) && (v = ((C = this.value) == null ? void 0 : C.angle) ?? 0), v = Math.max(0, Math.min(360, v)), this.value && (this.value.angle = v),
|
|
1486
|
+
const g = m.target;
|
|
1487
|
+
let v = parseInt(g.value);
|
|
1488
|
+
Number.isNaN(v) && (v = ((C = this.value) == null ? void 0 : C.angle) ?? 0), v = Math.max(0, Math.min(360, v)), this.value && (this.value.angle = v), g.value = `${v}°`, this.updateGradientPreview(), this.updateUI(), this.triggerChange();
|
|
1494
1489
|
}), f.addEventListener("click", () => {
|
|
1495
|
-
this.clearGlobalBindingForCustomChange(), !(!this.value || !this.value.stops) && (this.value.stops.forEach((
|
|
1496
|
-
|
|
1497
|
-
}), this.value.stops.sort((
|
|
1490
|
+
this.clearGlobalBindingForCustomChange(), !(!this.value || !this.value.stops) && (this.value.stops.forEach((m) => {
|
|
1491
|
+
m.position = 100 - m.position;
|
|
1492
|
+
}), this.value.stops.sort((m, g) => m.position - g.position), this.updateGradientPreview(i), this.createHandles(s, i), this.updateStopsList(l), this.updateUI(), this.triggerChange());
|
|
1498
1493
|
}), c.appendChild(h), c.appendChild(e), c.appendChild(f), t.appendChild(c), this.updateDegreeVisibility(e);
|
|
1499
1494
|
}
|
|
1500
1495
|
const i = document.createElement("div");
|
|
@@ -1510,8 +1505,8 @@ const $ = class $ extends x {
|
|
|
1510
1505
|
const l = document.createElement("div");
|
|
1511
1506
|
l.className = "gradient-stops", t.appendChild(n), t.appendChild(l), this.updateStopsList(l);
|
|
1512
1507
|
const r = at((c) => {
|
|
1513
|
-
const h =
|
|
1514
|
-
h && (this.clearGlobalBindingForCustomChange(), this.value = h, this.switchType(h.type), this.updateUI(), this.triggerChange());
|
|
1508
|
+
const h = T(c);
|
|
1509
|
+
h && (this.clearGlobalBindingForCustomChange(), this.value = h, this.switchType(h.type, !0), this.updateUI(), this.triggerChange());
|
|
1515
1510
|
}, "all");
|
|
1516
1511
|
this.recentGradientRefresh = r.refresh, t.appendChild(r.container), a.addEventListener("click", () => {
|
|
1517
1512
|
var c;
|
|
@@ -1527,11 +1522,9 @@ const $ = class $ extends x {
|
|
|
1527
1522
|
const e = t || ((i = this.popoverEl) == null ? void 0 : i.querySelector(".gradient-preview"));
|
|
1528
1523
|
if (e && this.value)
|
|
1529
1524
|
if (this.value.type === "solid")
|
|
1530
|
-
e.style.background =
|
|
1525
|
+
e.style.background = S(this.value);
|
|
1531
1526
|
else {
|
|
1532
|
-
const s = this.value.stops.map(
|
|
1533
|
-
(n) => `${st(n.color, n.opacity ?? 100)} ${n.position}%`
|
|
1534
|
-
).join(", ");
|
|
1527
|
+
const s = this.value.stops.map((n) => `${st(n.color, n.opacity ?? 100)} ${n.position}%`).join(", ");
|
|
1535
1528
|
e.style.background = `linear-gradient(90deg, ${s})`;
|
|
1536
1529
|
}
|
|
1537
1530
|
}
|
|
@@ -1548,28 +1541,28 @@ const $ = class $ extends x {
|
|
|
1548
1541
|
o.className = "gstop-chip";
|
|
1549
1542
|
const a = this.resolveGlobalVarColor(i.color);
|
|
1550
1543
|
o.style.backgroundColor = a, n.appendChild(o);
|
|
1551
|
-
const l = new ut((
|
|
1552
|
-
this.clearGlobalBindingForCustomChange(), this.value && this.value.stops[s] && (this.value.stops[s].color =
|
|
1544
|
+
const l = new ut((g, v) => {
|
|
1545
|
+
this.clearGlobalBindingForCustomChange(), this.value && this.value.stops[s] && (this.value.stops[s].color = g, v !== void 0 && (this.value.stops[s].opacity = v), o.style.backgroundColor = g, this.updateGradientPreview(), this.updateStopsList(), this.updateUI(), this.triggerChange());
|
|
1553
1546
|
}, "solid");
|
|
1554
1547
|
let r = !1, c = !1, h = 0, d = 0;
|
|
1555
|
-
const u = (
|
|
1556
|
-
r = !0, c = !1, h =
|
|
1557
|
-
}, f = (
|
|
1548
|
+
const u = (g) => {
|
|
1549
|
+
r = !0, c = !1, h = g.clientX, d = this.value.stops[s].position, n.classList.add("selected"), document.addEventListener("mousemove", f), document.addEventListener("mouseup", m), g.preventDefault(), g.stopPropagation();
|
|
1550
|
+
}, f = (g) => {
|
|
1558
1551
|
if (!r || !this.value) return;
|
|
1559
|
-
const v =
|
|
1552
|
+
const v = g.clientX - h;
|
|
1560
1553
|
if (Math.abs(v) > 3 && (c = !0), c) {
|
|
1561
1554
|
this.clearGlobalBindingForCustomChange();
|
|
1562
1555
|
const C = e.getBoundingClientRect();
|
|
1563
1556
|
let y = d + v / C.width * 100;
|
|
1564
1557
|
y = Math.max(0, Math.min(100, y)), this.value.stops[s].position = Math.round(y), n.style.left = `${y}%`, this.updateGradientPreview();
|
|
1565
1558
|
}
|
|
1566
|
-
},
|
|
1559
|
+
}, m = (g) => {
|
|
1567
1560
|
var v;
|
|
1568
1561
|
if (r)
|
|
1569
|
-
if (r = !1, n.classList.remove("selected"), document.removeEventListener("mousemove", f), document.removeEventListener("mouseup",
|
|
1562
|
+
if (r = !1, n.classList.remove("selected"), document.removeEventListener("mousemove", f), document.removeEventListener("mouseup", m), c)
|
|
1570
1563
|
this.value && (this.value.stops.sort((C, y) => C.position - y.position), this.createHandles(t, e), this.updateStopsList()), this.updateUI(), this.triggerChange();
|
|
1571
1564
|
else {
|
|
1572
|
-
|
|
1565
|
+
g.stopPropagation();
|
|
1573
1566
|
const C = (v = this.value) == null ? void 0 : v.stops[s];
|
|
1574
1567
|
C && setTimeout(() => {
|
|
1575
1568
|
const y = this.resolveGlobalVarColor(C.color);
|
|
@@ -1584,7 +1577,7 @@ const $ = class $ extends x {
|
|
|
1584
1577
|
var i;
|
|
1585
1578
|
const e = t || ((i = this.popoverEl) == null ? void 0 : i.querySelector(".gradient-stops"));
|
|
1586
1579
|
!e || !this.value || this.value.type === "solid" || !this.value.stops || (e.innerHTML = "", this.value.stops.forEach((s, n) => {
|
|
1587
|
-
var L,
|
|
1580
|
+
var L, I;
|
|
1588
1581
|
const o = document.createElement("div");
|
|
1589
1582
|
o.className = "gstop-row";
|
|
1590
1583
|
const a = document.createElement("div");
|
|
@@ -1600,87 +1593,78 @@ const $ = class $ extends x {
|
|
|
1600
1593
|
const u = document.createElement("button");
|
|
1601
1594
|
u.type = "button", u.className = "gstop-color-copy", u.textContent = "Copy", r.appendChild(h), r.appendChild(d), r.appendChild(u);
|
|
1602
1595
|
const f = document.createElement("button");
|
|
1603
|
-
f.type = "button", f.className = "gstop-del", f.innerHTML =
|
|
1604
|
-
const
|
|
1605
|
-
|
|
1606
|
-
const
|
|
1607
|
-
|
|
1596
|
+
f.type = "button", f.className = "gstop-del", f.innerHTML = Pt, f.disabled = (((I = (L = this.value) == null ? void 0 : L.stops) == null ? void 0 : I.length) || 0) <= 2, o.appendChild(a), o.appendChild(r), o.appendChild(f), e.appendChild(o);
|
|
1597
|
+
const m = document.createElement("span");
|
|
1598
|
+
m.className = "gstop-opacity-label", m.textContent = "Opacity";
|
|
1599
|
+
const g = document.createElement("div");
|
|
1600
|
+
g.className = "gstop-opacity-group";
|
|
1608
1601
|
const v = document.createElement("input");
|
|
1609
1602
|
v.type = "range", v.className = "gstop-opacity-slider", v.min = "0", v.max = "100", v.value = String(s.opacity ?? 100);
|
|
1610
|
-
const C =
|
|
1611
|
-
v.style.setProperty(
|
|
1612
|
-
"--slider-color",
|
|
1613
|
-
`rgb(${C.r}, ${C.g}, ${C.b})`
|
|
1614
|
-
);
|
|
1603
|
+
const C = P(c);
|
|
1604
|
+
v.style.setProperty("--slider-color", `rgb(${C.r}, ${C.g}, ${C.b})`);
|
|
1615
1605
|
const y = document.createElement("span");
|
|
1616
|
-
y.className = "gstop-opacity-value", y.textContent = `${s.opacity ?? 100}%`,
|
|
1617
|
-
const
|
|
1618
|
-
this.clearGlobalBindingForCustomChange(), d.value =
|
|
1619
|
-
const M =
|
|
1620
|
-
v.style.setProperty(
|
|
1621
|
-
"--slider-color",
|
|
1622
|
-
`rgb(${M.r}, ${M.g}, ${M.b})`
|
|
1623
|
-
), this.updateGradientPreview(), this.createHandles(
|
|
1606
|
+
y.className = "gstop-opacity-value", y.textContent = `${s.opacity ?? 100}%`, g.appendChild(v), g.appendChild(y);
|
|
1607
|
+
const E = new ut((b, w) => {
|
|
1608
|
+
this.clearGlobalBindingForCustomChange(), d.value = b.replace("#", "").toUpperCase(), h.style.backgroundColor = b, this.value.stops[n].color = b, w !== void 0 && (this.value.stops[n].opacity = w, v.value = String(w), y.textContent = `${w}%`);
|
|
1609
|
+
const M = P(b);
|
|
1610
|
+
v.style.setProperty("--slider-color", `rgb(${M.r}, ${M.g}, ${M.b})`), this.updateGradientPreview(), this.createHandles(
|
|
1624
1611
|
this.popoverEl.querySelector(".gradient-handles"),
|
|
1625
1612
|
this.popoverEl.querySelector(".gradient-preview")
|
|
1626
1613
|
), this.updateUI(), this.triggerChange();
|
|
1627
1614
|
}, "solid");
|
|
1628
|
-
d.addEventListener("click", (
|
|
1629
|
-
|
|
1615
|
+
d.addEventListener("click", (b) => {
|
|
1616
|
+
b.preventDefault(), b.stopPropagation();
|
|
1630
1617
|
const w = this.resolveGlobalVarColor(s.color);
|
|
1631
|
-
|
|
1618
|
+
E.open(w, d, s.opacity ?? 100);
|
|
1632
1619
|
}), d.addEventListener("input", () => {
|
|
1633
1620
|
this.clearGlobalBindingForCustomChange();
|
|
1634
|
-
const
|
|
1621
|
+
const b = d.value.trim(), w = b.startsWith("#") ? b : `#${b}`;
|
|
1635
1622
|
if (/^#[0-9A-Fa-f]{6}$/.test(w)) {
|
|
1636
1623
|
this.value.stops[n].color = w, h.style.backgroundColor = w;
|
|
1637
|
-
const M =
|
|
1638
|
-
v.style.setProperty(
|
|
1639
|
-
"--slider-color",
|
|
1640
|
-
`rgb(${M.r}, ${M.g}, ${M.b})`
|
|
1641
|
-
), this.debouncedPreviewUpdate();
|
|
1624
|
+
const M = P(w);
|
|
1625
|
+
v.style.setProperty("--slider-color", `rgb(${M.r}, ${M.g}, ${M.b})`), this.debouncedPreviewUpdate();
|
|
1642
1626
|
}
|
|
1643
1627
|
}), d.addEventListener("blur", () => {
|
|
1644
1628
|
this.previewUpdateTimeout && (clearTimeout(this.previewUpdateTimeout), this.previewUpdateTimeout = null), this.updateGradientPreview(), this.updateUI(), this.triggerChange();
|
|
1645
|
-
}), u.addEventListener("click", async (
|
|
1646
|
-
|
|
1629
|
+
}), u.addEventListener("click", async (b) => {
|
|
1630
|
+
b.stopPropagation();
|
|
1647
1631
|
try {
|
|
1648
1632
|
await navigator.clipboard.writeText(`#${d.value}`);
|
|
1649
1633
|
} catch {
|
|
1650
1634
|
}
|
|
1651
|
-
}), l.addEventListener("focus", (
|
|
1652
|
-
const w =
|
|
1635
|
+
}), l.addEventListener("focus", (b) => {
|
|
1636
|
+
const w = b.target;
|
|
1653
1637
|
w.value = w.value.replace("%", ""), w.select();
|
|
1654
|
-
}), l.addEventListener("input", (
|
|
1638
|
+
}), l.addEventListener("input", (b) => {
|
|
1655
1639
|
this.clearGlobalBindingForCustomChange();
|
|
1656
|
-
const w =
|
|
1640
|
+
const w = b.target, M = parseInt(w.value.replace(/[^\d]/g, ""), 10);
|
|
1657
1641
|
if (!Number.isNaN(M)) {
|
|
1658
|
-
const
|
|
1659
|
-
this.value.stops[n].position =
|
|
1642
|
+
const D = Math.max(0, Math.min(100, M));
|
|
1643
|
+
this.value.stops[n].position = D, w.value = `${D}%`, this.debouncedPreviewUpdate();
|
|
1660
1644
|
}
|
|
1661
|
-
}), l.addEventListener("blur", (
|
|
1645
|
+
}), l.addEventListener("blur", (b) => {
|
|
1662
1646
|
this.previewUpdateTimeout && (clearTimeout(this.previewUpdateTimeout), this.previewUpdateTimeout = null);
|
|
1663
|
-
const w =
|
|
1647
|
+
const w = b.target, M = parseInt(w.value.replace(/[^\d]/g, ""), 10);
|
|
1664
1648
|
if (Number.isNaN(M))
|
|
1665
1649
|
w.value = `${this.value.stops[n].position}%`;
|
|
1666
1650
|
else {
|
|
1667
|
-
const
|
|
1668
|
-
this.value.stops[n].position =
|
|
1651
|
+
const D = Math.max(0, Math.min(100, M));
|
|
1652
|
+
this.value.stops[n].position = D, w.value = `${D}%`;
|
|
1669
1653
|
}
|
|
1670
1654
|
this.updateGradientPreview(), this.createHandles(
|
|
1671
1655
|
this.popoverEl.querySelector(".gradient-handles"),
|
|
1672
1656
|
this.popoverEl.querySelector(".gradient-preview")
|
|
1673
1657
|
), this.updateStopsList(), this.updateUI(), this.triggerChange();
|
|
1674
1658
|
}), f.addEventListener("click", () => {
|
|
1675
|
-
var
|
|
1659
|
+
var b;
|
|
1676
1660
|
(this.value.stops.length || 0) <= 2 || (this.clearGlobalBindingForCustomChange(), this.value.stops.splice(n, 1), this.createHandles(
|
|
1677
1661
|
this.popoverEl.querySelector(".gradient-handles"),
|
|
1678
1662
|
this.popoverEl.querySelector(".gradient-preview")
|
|
1679
|
-
), this.updateStopsList(), this.updateGradientPreview(), this.updateUI(), ((
|
|
1663
|
+
), this.updateStopsList(), this.updateGradientPreview(), this.updateUI(), ((b = document.activeElement) == null ? void 0 : b.tagName) !== "INPUT" && this.repositionPopover(), this.triggerChange());
|
|
1680
1664
|
}), v.addEventListener("input", () => {
|
|
1681
1665
|
this.clearGlobalBindingForCustomChange();
|
|
1682
|
-
const
|
|
1683
|
-
this.value.stops[n].opacity = Math.max(0, Math.min(100,
|
|
1666
|
+
const b = parseInt(v.value, 10);
|
|
1667
|
+
this.value.stops[n].opacity = Math.max(0, Math.min(100, b)), y.textContent = `${this.value.stops[n].opacity}%`, this.debouncedPreviewUpdate();
|
|
1684
1668
|
}), v.addEventListener("change", () => {
|
|
1685
1669
|
this.clearGlobalBindingForCustomChange(), this.previewUpdateTimeout && (clearTimeout(this.previewUpdateTimeout), this.previewUpdateTimeout = null), this.updateGradientPreview(), this.updateUI(), this.triggerChange();
|
|
1686
1670
|
});
|
|
@@ -1704,8 +1688,8 @@ const $ = class $ extends x {
|
|
|
1704
1688
|
this.value.stops.push(n), this.value.stops.sort((o, a) => o.position - a.position);
|
|
1705
1689
|
}
|
|
1706
1690
|
openPopover() {
|
|
1707
|
-
if (this.popoverEl && (
|
|
1708
|
-
if (this.isPopoverOpen = !0,
|
|
1691
|
+
if (this.popoverEl && (V.openInstance && V.openInstance !== this && V.openInstance.closePopover(), !this.isPopoverOpen)) {
|
|
1692
|
+
if (this.isPopoverOpen = !0, V.openInstance = this, this.backdropEl && (this.backdropEl.style.display = "block", this.backdropEl.parentElement || document.body.appendChild(this.backdropEl)), this.popoverEl.style.display = "flex", this.refreshPopoverContent(), this.element) {
|
|
1709
1693
|
const t = this.element.getBoundingClientRect(), e = 306, i = window.innerWidth, s = window.innerHeight, n = 16;
|
|
1710
1694
|
this.popoverEl.style.position = "fixed", this.popoverEl.style.zIndex = "10000", this.popoverEl.style.left = "-9999px", this.popoverEl.style.top = "0px";
|
|
1711
1695
|
const o = this.popoverEl.offsetHeight;
|
|
@@ -1715,10 +1699,7 @@ const $ = class $ extends x {
|
|
|
1715
1699
|
const d = s - t.bottom, u = t.top;
|
|
1716
1700
|
u >= o + n ? l = t.top - o - 8 : d >= o + n ? l = t.bottom + 8 : u > d ? (l = t.top - o - 8, l < n && (l = n)) : (l = t.bottom + 8, l + o > s - n && (l = s - o - n)), this.popoverEl.style.left = `${a}px`, this.popoverEl.style.top = `${l}px`, this.popoverPosition = { left: a, top: l };
|
|
1717
1701
|
}
|
|
1718
|
-
setTimeout(
|
|
1719
|
-
() => document.addEventListener("click", this.onBackgroundClick, !0),
|
|
1720
|
-
200
|
|
1721
|
-
), document.addEventListener("keydown", this.handlePopoverKeydown, !0);
|
|
1702
|
+
setTimeout(() => document.addEventListener("click", this.onBackgroundClick, !0), 200), document.addEventListener("keydown", this.handlePopoverKeydown, !0);
|
|
1722
1703
|
}
|
|
1723
1704
|
}
|
|
1724
1705
|
repositionPopover() {
|
|
@@ -1755,10 +1736,10 @@ const $ = class $ extends x {
|
|
|
1755
1736
|
var t;
|
|
1756
1737
|
if (!(!this.popoverEl || !this.isPopoverOpen)) {
|
|
1757
1738
|
if (this.isPopoverOpen = !1, this.popoverPosition = null, this.backdropEl && (this.backdropEl.style.display = "none"), this.popoverEl.style.display = "none", document.removeEventListener("click", this.onBackgroundClick, !0), document.removeEventListener("keydown", this.handlePopoverKeydown, !0), this.commitPendingSolidColor(), this.value && this.value.type !== "solid") {
|
|
1758
|
-
const e =
|
|
1739
|
+
const e = S(this.value);
|
|
1759
1740
|
R.addColor(e, "gradient"), (t = this.recentGradientRefresh) == null || t.call(this);
|
|
1760
1741
|
}
|
|
1761
|
-
this.previewUpdateTimeout && (clearTimeout(this.previewUpdateTimeout), this.previewUpdateTimeout = null),
|
|
1742
|
+
this.previewUpdateTimeout && (clearTimeout(this.previewUpdateTimeout), this.previewUpdateTimeout = null), V.openInstance === this && (V.openInstance = null);
|
|
1762
1743
|
}
|
|
1763
1744
|
}
|
|
1764
1745
|
commitPendingSolidColor() {
|
|
@@ -1777,31 +1758,31 @@ const $ = class $ extends x {
|
|
|
1777
1758
|
parseAndSet(t) {
|
|
1778
1759
|
let e = t.trim();
|
|
1779
1760
|
e && !e.startsWith("#") && !e.startsWith("var(") && !e.startsWith("rgb") && !e.startsWith("hsl") && !e.includes("gradient") && /^[0-9A-Fa-f]{3}$|^[0-9A-Fa-f]{6}$|^[0-9A-Fa-f]{8}$/.test(e) && (e = "#" + e, this.inputEl && (this.inputEl.value = e));
|
|
1780
|
-
const i =
|
|
1761
|
+
const i = T(e);
|
|
1781
1762
|
i && this.setValue(i);
|
|
1782
1763
|
}
|
|
1783
1764
|
getChangePayload() {
|
|
1784
1765
|
var t;
|
|
1785
1766
|
if (this.value)
|
|
1786
|
-
return this.isBoundToGlobal() ? ((t = this.value.stops) == null ? void 0 : t.some(
|
|
1787
|
-
(i) => i.opacity !== void 0 && i.opacity !== 100
|
|
1788
|
-
)) ? this.resolveGradientGlobalVars(this.value) : this.linkedGlobalVariable || void 0 : this.value;
|
|
1767
|
+
return this.isBoundToGlobal() ? ((t = this.value.stops) == null ? void 0 : t.some((i) => i.opacity !== void 0 && i.opacity !== 100)) ? this.resolveGradientGlobalVars(this.value) : this.linkedGlobalVariable || void 0 : this.value;
|
|
1789
1768
|
}
|
|
1790
1769
|
triggerChange() {
|
|
1791
|
-
var e, i;
|
|
1792
1770
|
const t = this.getChangePayload();
|
|
1793
|
-
t !== void 0 && (
|
|
1771
|
+
t !== void 0 && (this.changeDebounceTimeout && clearTimeout(this.changeDebounceTimeout), this.changeDebounceTimeout = setTimeout(() => {
|
|
1772
|
+
var e, i;
|
|
1773
|
+
(e = this.onChange) == null || e.call(this, t), (i = this.detectChange) == null || i.call(this, t), this.changeDebounceTimeout = null;
|
|
1774
|
+
}, V.CHANGE_DEBOUNCE_DELAY));
|
|
1794
1775
|
}
|
|
1795
1776
|
getElement() {
|
|
1796
1777
|
return this.element;
|
|
1797
1778
|
}
|
|
1798
1779
|
getValue() {
|
|
1799
1780
|
const t = this.getChangePayload();
|
|
1800
|
-
return t ? typeof t == "string" ? t :
|
|
1781
|
+
return t ? typeof t == "string" ? t : S(t) : "";
|
|
1801
1782
|
}
|
|
1802
1783
|
getCSSValue() {
|
|
1803
1784
|
const t = this.getChangePayload();
|
|
1804
|
-
return t ? typeof t == "string" ? t :
|
|
1785
|
+
return t ? typeof t == "string" ? t : S(t) : "";
|
|
1805
1786
|
}
|
|
1806
1787
|
getCSSForText() {
|
|
1807
1788
|
return this.value ? this.cssForTextValue() : {};
|
|
@@ -1810,8 +1791,8 @@ const $ = class $ extends x {
|
|
|
1810
1791
|
return this.value;
|
|
1811
1792
|
}
|
|
1812
1793
|
};
|
|
1813
|
-
|
|
1814
|
-
let j =
|
|
1794
|
+
V.openInstance = null, V.CHANGE_DEBOUNCE_DELAY = 150;
|
|
1795
|
+
let j = V;
|
|
1815
1796
|
function J(p, t) {
|
|
1816
1797
|
for (const e in p)
|
|
1817
1798
|
if (Object.prototype.hasOwnProperty.call(p, e)) {
|
|
@@ -1822,7 +1803,7 @@ function J(p, t) {
|
|
|
1822
1803
|
const Q = class Q {
|
|
1823
1804
|
constructor(t) {
|
|
1824
1805
|
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 = () => {
|
|
1825
|
-
}, this.pendingBlurHandler = null, this.originalDefaultValues = {}, this.nestingLevel = 0, this.dataPropsPath = "", this.hide = !1, this.id = t.id ||
|
|
1806
|
+
}, this.pendingBlurHandler = null, this.originalDefaultValues = {}, this.nestingLevel = 0, this.dataPropsPath = "", this.hide = !1, this.id = t.id || mt(), 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();
|
|
1826
1807
|
}
|
|
1827
1808
|
propagateNestingLevel() {
|
|
1828
1809
|
const t = this.nestingLevel + 1;
|
|
@@ -1845,7 +1826,7 @@ const Q = class Q {
|
|
|
1845
1826
|
propagateDataPropsPath() {
|
|
1846
1827
|
J(this.settings, (t, e) => {
|
|
1847
1828
|
const i = String(t), s = this.dataPropsPath ? `${this.dataPropsPath}_${i}` : i;
|
|
1848
|
-
(k(e) ||
|
|
1829
|
+
(k(e) || G(e) && typeof e.setDataPropsPath == "function") && e.setDataPropsPath(s);
|
|
1849
1830
|
});
|
|
1850
1831
|
}
|
|
1851
1832
|
updateNestingStyles() {
|
|
@@ -1909,7 +1890,7 @@ const Q = class Q {
|
|
|
1909
1890
|
const i = (e == null ? void 0 : e.preserveValues) ?? !0, s = new Set(Object.keys(this.settings)), n = Object.keys(t), o = {};
|
|
1910
1891
|
i && n.forEach((r) => {
|
|
1911
1892
|
const c = this.settings[r];
|
|
1912
|
-
c && (k(c) ? o[r] = c.getValues() :
|
|
1893
|
+
c && (k(c) ? o[r] = c.getValues() : G(c) ? o[r] = c.value : typeof c.getValues == "function" ? o[r] = c.getValues() : c.value !== void 0 && (o[r] = c.value));
|
|
1913
1894
|
}), s.forEach((r) => {
|
|
1914
1895
|
n.includes(r) || this.removeSetting(r);
|
|
1915
1896
|
}), n.forEach((r) => {
|
|
@@ -1920,7 +1901,7 @@ const Q = class Q {
|
|
|
1920
1901
|
try {
|
|
1921
1902
|
k(c) ? c.setValue(
|
|
1922
1903
|
u
|
|
1923
|
-
) :
|
|
1904
|
+
) : G(c) ? (d = c.setValue) == null || d.call(c, u) : c.setValue && c.setValue(u);
|
|
1924
1905
|
} catch (f) {
|
|
1925
1906
|
console.warn(`Could not preserve value for setting ${r}:`, f);
|
|
1926
1907
|
}
|
|
@@ -1958,7 +1939,7 @@ const Q = class Q {
|
|
|
1958
1939
|
setMobileValues(t) {
|
|
1959
1940
|
!t || typeof t != "object" || (Object.entries(t).forEach(([e, i]) => {
|
|
1960
1941
|
const s = this.settings[e];
|
|
1961
|
-
s && (k(s) ||
|
|
1942
|
+
s && (k(s) || G(s)) && typeof s.setMobileValue == "function" && s.setMobileValue(i);
|
|
1962
1943
|
}), this.setValue(t), this.onChange && this.onChange(this.getValues()));
|
|
1963
1944
|
}
|
|
1964
1945
|
getMobileValues(t) {
|
|
@@ -2001,7 +1982,7 @@ const Q = class Q {
|
|
|
2001
1982
|
const o = this.getValues();
|
|
2002
1983
|
this.initialValues = o, t(o);
|
|
2003
1984
|
}), this.changeHandlers.add(() => t(this.getValues()));
|
|
2004
|
-
else if (
|
|
1985
|
+
else if (G(s)) {
|
|
2005
1986
|
const o = () => e();
|
|
2006
1987
|
this.changeHandlers.add(o), s.setOnChange(o);
|
|
2007
1988
|
} else {
|
|
@@ -2027,7 +2008,7 @@ const Q = class Q {
|
|
|
2027
2008
|
ct(l) && (this.addSetting(i, l), n = l);
|
|
2028
2009
|
}
|
|
2029
2010
|
}
|
|
2030
|
-
n && (k(n) ||
|
|
2011
|
+
n && (k(n) || G(n)) && typeof n.setValue == "function" && n.setValue(s);
|
|
2031
2012
|
}), setTimeout(() => {
|
|
2032
2013
|
this.forceChildUIRefresh();
|
|
2033
2014
|
}, 0);
|
|
@@ -2041,7 +2022,7 @@ const Q = class Q {
|
|
|
2041
2022
|
const s = this.getValues();
|
|
2042
2023
|
this.initialValues = s, (n = this.onChange) == null || n.call(this, s), this.updateVisibility();
|
|
2043
2024
|
};
|
|
2044
|
-
k(t) ? t.setOnChange(() => e()) :
|
|
2025
|
+
k(t) ? t.setOnChange(() => e()) : G(t) ? t.setOnChange(() => e()) : (i = t.setOnChange) == null || i.call(t, () => e());
|
|
2045
2026
|
}
|
|
2046
2027
|
addSetting(t, e) {
|
|
2047
2028
|
var s, n;
|
|
@@ -2272,7 +2253,7 @@ const Q = class Q {
|
|
|
2272
2253
|
if (o.includeGetJson !== !1)
|
|
2273
2254
|
if (n instanceof j) {
|
|
2274
2255
|
const a = n.getRawValue();
|
|
2275
|
-
i[s] = a ?
|
|
2256
|
+
i[s] = a ? S(a) : null;
|
|
2276
2257
|
} else
|
|
2277
2258
|
i[s] = o.value;
|
|
2278
2259
|
}
|
|
@@ -2288,7 +2269,7 @@ const Q = class Q {
|
|
|
2288
2269
|
if (s.includeGetJson === !1) return null;
|
|
2289
2270
|
if (i instanceof j) {
|
|
2290
2271
|
const n = i.getRawValue();
|
|
2291
|
-
return n ?
|
|
2272
|
+
return n ? S(n) : null;
|
|
2292
2273
|
}
|
|
2293
2274
|
return s.value;
|
|
2294
2275
|
}
|
|
@@ -2375,8 +2356,8 @@ const Q = class Q {
|
|
|
2375
2356
|
d.stopPropagation(), d.preventDefault();
|
|
2376
2357
|
const u = this.getNextIndexFromPrefix(this.addItemCfg.keyPrefix), f = this.addItemCfg.createItem(u);
|
|
2377
2358
|
if (ct(f)) {
|
|
2378
|
-
const
|
|
2379
|
-
this.addSetting(
|
|
2359
|
+
const m = `${this.addItemCfg.keyPrefix}${u}`;
|
|
2360
|
+
this.addSetting(m, f);
|
|
2380
2361
|
}
|
|
2381
2362
|
}), a.appendChild(c);
|
|
2382
2363
|
}
|
|
@@ -2423,11 +2404,11 @@ const Q = class Q {
|
|
|
2423
2404
|
}
|
|
2424
2405
|
};
|
|
2425
2406
|
Q.hiddenElements = /* @__PURE__ */ new Set();
|
|
2426
|
-
let
|
|
2427
|
-
function
|
|
2407
|
+
let $ = Q;
|
|
2408
|
+
function Ee(p) {
|
|
2428
2409
|
return new At(p);
|
|
2429
2410
|
}
|
|
2430
|
-
class At extends
|
|
2411
|
+
class At extends $ {
|
|
2431
2412
|
constructor(t) {
|
|
2432
2413
|
super(t);
|
|
2433
2414
|
const e = Object.keys(this.settings)[0];
|
|
@@ -2489,7 +2470,7 @@ class At extends T {
|
|
|
2489
2470
|
}
|
|
2490
2471
|
}
|
|
2491
2472
|
function Dt(p) {
|
|
2492
|
-
return new
|
|
2473
|
+
return new $(p);
|
|
2493
2474
|
}
|
|
2494
2475
|
function we(p) {
|
|
2495
2476
|
return p;
|
|
@@ -2515,17 +2496,17 @@ class Gt extends x {
|
|
|
2515
2496
|
}
|
|
2516
2497
|
}
|
|
2517
2498
|
const Rt = "<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>";
|
|
2518
|
-
class
|
|
2499
|
+
class O extends Gt {
|
|
2519
2500
|
constructor(t) {
|
|
2520
2501
|
super({
|
|
2521
2502
|
...t,
|
|
2522
2503
|
icon: t.icon || Rt,
|
|
2523
2504
|
title: t.title || "Color",
|
|
2524
|
-
default: t.default ?
|
|
2505
|
+
default: t.default ? O.normalizeColorValue(t.default) : "#000000"
|
|
2525
2506
|
}), this.inputType = "color", this.element = null, this.colorInputEl = null, this.textInputEl = null, this.detectChange = t.detectChange;
|
|
2526
2507
|
}
|
|
2527
2508
|
static normalizeColorValue(t) {
|
|
2528
|
-
return t.startsWith("var(--") ? t : t.startsWith("#") ?
|
|
2509
|
+
return t.startsWith("var(--") ? t : t.startsWith("#") ? O.normalizeHexValue(t) : t.includes(",") ? O.rgbToHexStatic(t) : O.normalizeHexValue(t);
|
|
2529
2510
|
}
|
|
2530
2511
|
static normalizeHexValue(t) {
|
|
2531
2512
|
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");
|
|
@@ -2546,7 +2527,7 @@ class P extends Gt {
|
|
|
2546
2527
|
return;
|
|
2547
2528
|
}
|
|
2548
2529
|
if (typeof t == "string") {
|
|
2549
|
-
const e =
|
|
2530
|
+
const e = O.normalizeColorValue(t);
|
|
2550
2531
|
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);
|
|
2551
2532
|
} else
|
|
2552
2533
|
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");
|
|
@@ -2559,16 +2540,16 @@ class P extends Gt {
|
|
|
2559
2540
|
draw() {
|
|
2560
2541
|
const t = document.createElement("div");
|
|
2561
2542
|
if (t.className = "color-setting-wrapper " + (this.props.wrapperClassName || ""), this.props.title || this.props.icon) {
|
|
2562
|
-
const
|
|
2563
|
-
if (
|
|
2564
|
-
const
|
|
2565
|
-
|
|
2543
|
+
const m = document.createElement("div");
|
|
2544
|
+
if (m.className = "icon-container", this.props.icon) {
|
|
2545
|
+
const g = document.createElement("span");
|
|
2546
|
+
g.className = "input-icon", g.innerHTML = this.props.icon, m.appendChild(g);
|
|
2566
2547
|
}
|
|
2567
2548
|
if (this.props.title) {
|
|
2568
|
-
const
|
|
2569
|
-
|
|
2549
|
+
const g = document.createElement("span");
|
|
2550
|
+
g.className = "input-label", g.textContent = this.props.title, m.appendChild(g);
|
|
2570
2551
|
}
|
|
2571
|
-
t.appendChild(
|
|
2552
|
+
t.appendChild(m);
|
|
2572
2553
|
}
|
|
2573
2554
|
const e = document.createElement("div");
|
|
2574
2555
|
e.className = "color-input-wrapper";
|
|
@@ -2586,41 +2567,41 @@ class P extends Gt {
|
|
|
2586
2567
|
try {
|
|
2587
2568
|
if (console.log("ColorSetting: renderGlobalOptions called"), a.innerHTML = "", !x) {
|
|
2588
2569
|
console.error("ColorSetting: Setting class is undefined");
|
|
2589
|
-
const
|
|
2590
|
-
|
|
2570
|
+
const g = document.createElement("div");
|
|
2571
|
+
g.textContent = "Error: System error (Setting undefined)", a.appendChild(g);
|
|
2591
2572
|
return;
|
|
2592
2573
|
}
|
|
2593
|
-
const
|
|
2594
|
-
if (console.log("ColorSetting: GlobalVariables:",
|
|
2595
|
-
const
|
|
2596
|
-
|
|
2574
|
+
const m = x.GlobalVariables || {};
|
|
2575
|
+
if (console.log("ColorSetting: GlobalVariables:", m), !m || Object.keys(m).length === 0) {
|
|
2576
|
+
const g = document.createElement("div");
|
|
2577
|
+
g.textContent = "No global colors defined", g.style.gridColumn = "1 / -1", g.style.fontSize = "12px", g.style.color = "#666", a.appendChild(g);
|
|
2597
2578
|
return;
|
|
2598
2579
|
}
|
|
2599
|
-
Object.entries(
|
|
2580
|
+
Object.entries(m).forEach(([g, v]) => {
|
|
2600
2581
|
const C = document.createElement("button");
|
|
2601
|
-
C.className = "global-color-btn", C.title =
|
|
2602
|
-
var L,
|
|
2582
|
+
C.className = "global-color-btn", C.title = g, C.style.width = "30px", C.style.height = "30px", C.style.borderRadius = "50%", C.style.border = "1px solid #ddd", C.style.backgroundColor = v, C.style.cursor = "pointer", this.value === `var(--${g})` && (C.style.border = "2px solid #2196f3"), C.addEventListener("click", (y) => {
|
|
2583
|
+
var L, I;
|
|
2603
2584
|
y.preventDefault();
|
|
2604
|
-
const
|
|
2605
|
-
this.value =
|
|
2606
|
-
|
|
2585
|
+
const E = `var(--${g})`;
|
|
2586
|
+
this.value = E, (L = this.onChange) == null || L.call(this, E), (I = this.detectChange) == null || I.call(this, E), Array.from(a.children).forEach((b) => {
|
|
2587
|
+
b.style.border = "1px solid #ddd";
|
|
2607
2588
|
}), C.style.border = "2px solid #2196f3", h.style.backgroundColor = v;
|
|
2608
2589
|
}), a.appendChild(C);
|
|
2609
2590
|
});
|
|
2610
|
-
} catch (
|
|
2611
|
-
console.error("ColorSetting: Error in renderGlobalOptions",
|
|
2591
|
+
} catch (m) {
|
|
2592
|
+
console.error("ColorSetting: Error in renderGlobalOptions", m), a.innerHTML = "Error loading global options";
|
|
2612
2593
|
}
|
|
2613
2594
|
};
|
|
2614
|
-
l(), s.addEventListener("click", (
|
|
2615
|
-
|
|
2616
|
-
}), n.addEventListener("click", (
|
|
2617
|
-
|
|
2595
|
+
l(), s.addEventListener("click", (m) => {
|
|
2596
|
+
m.preventDefault(), s.classList.add("active"), n.classList.remove("active"), o.style.display = "flex", a.style.display = "none", this.value && this.value.startsWith("var(--");
|
|
2597
|
+
}), n.addEventListener("click", (m) => {
|
|
2598
|
+
m.preventDefault(), n.classList.add("active"), s.classList.remove("active"), o.style.display = "none", a.style.display = "grid", l();
|
|
2618
2599
|
}), this.value && this.value.startsWith("var(--") ? n.click() : s.click();
|
|
2619
|
-
const r = (
|
|
2620
|
-
const
|
|
2621
|
-
if (!
|
|
2600
|
+
const r = (m) => {
|
|
2601
|
+
const g = m.value.trim();
|
|
2602
|
+
if (!g)
|
|
2622
2603
|
return e.classList.remove("error"), !0;
|
|
2623
|
-
const C = /^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/.test(
|
|
2604
|
+
const C = /^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/.test(g);
|
|
2624
2605
|
return C ? e.classList.remove("error") : e.classList.add("error"), C;
|
|
2625
2606
|
}, c = document.createElement("input");
|
|
2626
2607
|
c.type = "color", c.className = "color-picker", c.value = this.value && !this.value.startsWith("var(--") ? this.value : "#000000", c.setAttribute("aria-label", "Choose color"), c.setAttribute("title", "Click to open color picker"), this.getDataPropsPath() && c.setAttribute("data-test-id", this.getDataPropsPath()), this.colorInputEl = c;
|
|
@@ -2628,38 +2609,38 @@ class P extends Gt {
|
|
|
2628
2609
|
h.className = "color-preview";
|
|
2629
2610
|
let d = this.value || "#000000";
|
|
2630
2611
|
if (d.startsWith("var(--")) {
|
|
2631
|
-
const
|
|
2632
|
-
d = (x.GlobalVariables || {})[
|
|
2612
|
+
const m = d.replace("var(--", "").replace(")", "");
|
|
2613
|
+
d = (x.GlobalVariables || {})[m] || "#000000";
|
|
2633
2614
|
}
|
|
2634
2615
|
h.style.backgroundColor = d;
|
|
2635
2616
|
const u = document.createElement("input");
|
|
2636
2617
|
u.type = "text", u.className = "color-text-input", u.value = this.value || "", u.placeholder = "#000000", u.setAttribute("pattern", "#[0-9A-Fa-f]{6}"), u.setAttribute("title", "Enter a hex color value (e.g., #ff0000)"), u.setAttribute("aria-label", "Hex color value"), u.setAttribute("maxlength", "7"), this.getDataPropsPath() && u.setAttribute("data-test-id", `${this.getDataPropsPath()}_text`), this.textInputEl = u;
|
|
2637
|
-
const f = (
|
|
2618
|
+
const f = (m) => {
|
|
2638
2619
|
var v, C;
|
|
2639
|
-
let
|
|
2640
|
-
if (
|
|
2641
|
-
const y =
|
|
2620
|
+
let g = m.trim();
|
|
2621
|
+
if (g && !g.startsWith("#") && !g.startsWith("var(") && /^[0-9A-Fa-f]{3}$|^[0-9A-Fa-f]{6}$/.test(g) && (g = "#" + g, this.textInputEl && (this.textInputEl.value = g)), this.textInputEl && r(this.textInputEl)) {
|
|
2622
|
+
const y = O.normalizeColorValue(g);
|
|
2642
2623
|
this.value = y, (v = this.onChange) == null || v.call(this, y), (C = this.detectChange) == null || C.call(this, y), this.colorInputEl && (this.colorInputEl.value = y), h.style.backgroundColor = y;
|
|
2643
2624
|
}
|
|
2644
2625
|
};
|
|
2645
|
-
return this.textInputEl.addEventListener("input", (
|
|
2646
|
-
const
|
|
2647
|
-
f(
|
|
2648
|
-
}), this.textInputEl.addEventListener("paste", (
|
|
2626
|
+
return this.textInputEl.addEventListener("input", (m) => {
|
|
2627
|
+
const g = m.target.value;
|
|
2628
|
+
f(g);
|
|
2629
|
+
}), this.textInputEl.addEventListener("paste", (m) => {
|
|
2649
2630
|
var v;
|
|
2650
|
-
|
|
2651
|
-
const
|
|
2652
|
-
this.textInputEl && (this.textInputEl.value =
|
|
2653
|
-
}), this.textInputEl.addEventListener("keydown", (
|
|
2654
|
-
var
|
|
2655
|
-
|
|
2656
|
-
}), this.colorInputEl.addEventListener("input", (
|
|
2631
|
+
m.preventDefault();
|
|
2632
|
+
const g = ((v = m.clipboardData) == null ? void 0 : v.getData("text")) || "";
|
|
2633
|
+
this.textInputEl && (this.textInputEl.value = g.trim(), f(g));
|
|
2634
|
+
}), this.textInputEl.addEventListener("keydown", (m) => {
|
|
2635
|
+
var g, v, C;
|
|
2636
|
+
m.key === "Enter" && (m.preventDefault(), f(((g = this.textInputEl) == null ? void 0 : g.value) || ""), (v = this.textInputEl) == null || v.blur()), m.key === "Escape" && (this.textInputEl && this.value && (this.textInputEl.value = this.value), (C = this.textInputEl) == null || C.blur(), e.classList.remove("error"));
|
|
2637
|
+
}), this.colorInputEl.addEventListener("input", (m) => {
|
|
2657
2638
|
var C, y;
|
|
2658
|
-
const
|
|
2639
|
+
const g = m.target.value, v = O.normalizeColorValue(g);
|
|
2659
2640
|
this.value = v, (C = this.onChange) == null || C.call(this, v), (y = this.detectChange) == null || y.call(this, v), this.textInputEl && (this.textInputEl.value = v), h.style.backgroundColor = v, e.classList.remove("error");
|
|
2660
|
-
}), this.colorInputEl.addEventListener("change", (
|
|
2641
|
+
}), this.colorInputEl.addEventListener("change", (m) => {
|
|
2661
2642
|
var C, y;
|
|
2662
|
-
const
|
|
2643
|
+
const g = m.target.value, v = O.normalizeColorValue(g);
|
|
2663
2644
|
this.value = v, (C = this.onChange) == null || C.call(this, v), (y = this.detectChange) == null || y.call(this, v), this.textInputEl && (this.textInputEl.value = v), h.style.backgroundColor = v;
|
|
2664
2645
|
}), o.appendChild(c), o.appendChild(h), o.appendChild(u), e.appendChild(i), e.appendChild(o), e.appendChild(a), t.appendChild(e), this.element = t, t;
|
|
2665
2646
|
}
|
|
@@ -2668,7 +2649,7 @@ class P extends Gt {
|
|
|
2668
2649
|
}
|
|
2669
2650
|
// Helper method to get normalized hex value
|
|
2670
2651
|
getNormalizedValue() {
|
|
2671
|
-
return this.value ?
|
|
2652
|
+
return this.value ? O.normalizeColorValue(this.value) : "#000000";
|
|
2672
2653
|
}
|
|
2673
2654
|
// Helper method to check if current value is valid hex
|
|
2674
2655
|
isValidHex() {
|
|
@@ -2854,7 +2835,7 @@ class xe extends x {
|
|
|
2854
2835
|
return e.addEventListener("input", i), e.addEventListener("change", i), e.addEventListener("blur", s), t.appendChild(e), t;
|
|
2855
2836
|
}
|
|
2856
2837
|
}
|
|
2857
|
-
class
|
|
2838
|
+
class H extends x {
|
|
2858
2839
|
constructor(t) {
|
|
2859
2840
|
super(t), this.inputType = "number", this.inputElement = null, this.mobileValue = t.mobile, this.validateProps(), this.value = this.validateValue(this.value);
|
|
2860
2841
|
}
|
|
@@ -2918,7 +2899,7 @@ const zt = `
|
|
|
2918
2899
|
<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"/>
|
|
2919
2900
|
<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"/>
|
|
2920
2901
|
</svg>`;
|
|
2921
|
-
class Ut extends
|
|
2902
|
+
class Ut extends H {
|
|
2922
2903
|
constructor(t = {}) {
|
|
2923
2904
|
const e = {
|
|
2924
2905
|
title: "Opacity",
|
|
@@ -3143,14 +3124,14 @@ class ke extends x {
|
|
|
3143
3124
|
this.value || (this.value = {
|
|
3144
3125
|
width: e,
|
|
3145
3126
|
height: i
|
|
3146
|
-
}), 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
|
|
3127
|
+
}), 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 H({
|
|
3147
3128
|
title: "Width",
|
|
3148
3129
|
default: this.value.width,
|
|
3149
3130
|
suffix: "px",
|
|
3150
3131
|
minValue: this.minWidth,
|
|
3151
3132
|
maxValue: this.maxWidth,
|
|
3152
3133
|
icon: qt
|
|
3153
|
-
}), this.heightSetting = new
|
|
3134
|
+
}), this.heightSetting = new H({
|
|
3154
3135
|
title: "Height",
|
|
3155
3136
|
default: this.value.height,
|
|
3156
3137
|
suffix: "px",
|
|
@@ -3437,7 +3418,7 @@ const Kt = `
|
|
|
3437
3418
|
<path d="M7 1.5C3.96243 1.5 1.5 3.96243 1.5 7C1.5 10.0376 3.96243 12.5 7 12.5C10.0376 12.5 12.5 10.0376 12.5 7C12.5 3.96243 10.0376 1.5 7 1.5Z" stroke="#F04438" stroke-width="1.2"/>
|
|
3438
3419
|
<path d="M8.25 5.75L5.75 8.25M5.75 5.75L8.25 8.25" stroke="#F04438" stroke-width="1.2" stroke-linecap="round"/>
|
|
3439
3420
|
</svg>
|
|
3440
|
-
`,
|
|
3421
|
+
`, B = class B extends x {
|
|
3441
3422
|
constructor(t = {}) {
|
|
3442
3423
|
super(t), this.inputType = {
|
|
3443
3424
|
imageUrl: "text",
|
|
@@ -3487,7 +3468,7 @@ const Kt = `
|
|
|
3487
3468
|
s.className = "image-map-content", this.popoverEl.appendChild(s), document.body.appendChild(this.backdropEl), document.body.appendChild(this.popoverEl);
|
|
3488
3469
|
}
|
|
3489
3470
|
openPopover() {
|
|
3490
|
-
|
|
3471
|
+
B.openInstance && B.openInstance !== this && B.openInstance.closePopover(), this.isPopoverOpen = !0, B.openInstance = this, this.value ? this.initialValue = JSON.parse(JSON.stringify(this.value)) : this.initialValue = { imageUrl: "", markers: [] }, this.value && (this.history = [JSON.parse(JSON.stringify(this.value.markers))], this.historyIndex = 0), this.backdropEl && (this.backdropEl.style.display = "block"), this.popoverEl && (this.popoverEl.style.display = "flex"), this.positionPopover(), this.refreshPopoverContent(), setTimeout(() => {
|
|
3491
3472
|
document.addEventListener("click", this.onBackgroundClick, !0);
|
|
3492
3473
|
}, 200), document.addEventListener("keydown", this.handlePopoverKeydown, !0);
|
|
3493
3474
|
}
|
|
@@ -3509,7 +3490,7 @@ const Kt = `
|
|
|
3509
3490
|
return;
|
|
3510
3491
|
this.initialValue && (this.value = JSON.parse(JSON.stringify(this.initialValue)), this.updateButtonDisplay(), this.triggerChange());
|
|
3511
3492
|
}
|
|
3512
|
-
this.isPopoverOpen = !1, this.draggingMarkerId = null, this.backdropEl && (this.backdropEl.style.display = "none"), this.popoverEl && (this.popoverEl.style.display = "none"), document.removeEventListener("click", this.onBackgroundClick, !0), document.removeEventListener("keydown", this.handlePopoverKeydown, !0),
|
|
3493
|
+
this.isPopoverOpen = !1, this.draggingMarkerId = null, this.backdropEl && (this.backdropEl.style.display = "none"), this.popoverEl && (this.popoverEl.style.display = "none"), document.removeEventListener("click", this.onBackgroundClick, !0), document.removeEventListener("keydown", this.handlePopoverKeydown, !0), B.openInstance === this && (B.openInstance = null);
|
|
3513
3494
|
}
|
|
3514
3495
|
}
|
|
3515
3496
|
positionPopover() {
|
|
@@ -3594,18 +3575,18 @@ const Kt = `
|
|
|
3594
3575
|
const a = ((h = this.value) == null ? void 0 : h.markers) || [], l = /* @__PURE__ */ new Map();
|
|
3595
3576
|
a.forEach((d) => l.set(d.index, d));
|
|
3596
3577
|
for (let d = 1; d <= i; d++) {
|
|
3597
|
-
const u = l.get(d), f = !!u,
|
|
3598
|
-
|
|
3578
|
+
const u = l.get(d), f = !!u, m = (u == null ? void 0 : u.prizeName) || this.props.prizeMap && this.props.prizeMap[d - 1] || `Prize #${d}`, g = document.createElement("div");
|
|
3579
|
+
g.className = `prize-item ${f ? "placed" : "missing"}`;
|
|
3599
3580
|
const v = document.createElement("div");
|
|
3600
3581
|
v.className = "prize-index", v.textContent = String(d);
|
|
3601
3582
|
const C = document.createElement("div");
|
|
3602
3583
|
C.className = "prize-label";
|
|
3603
3584
|
const y = document.createElement("div");
|
|
3604
3585
|
y.className = "prize-title", y.textContent = `Prize #${d}`;
|
|
3605
|
-
const
|
|
3606
|
-
|
|
3586
|
+
const E = document.createElement("div");
|
|
3587
|
+
E.className = "prize-subtitle", E.textContent = f ? m : "Not Placed", C.appendChild(y), C.appendChild(E);
|
|
3607
3588
|
const L = document.createElement("div");
|
|
3608
|
-
L.className = `prize-status ${f ? "placed" : "missing"}`, L.innerHTML = f ? ie : se,
|
|
3589
|
+
L.className = `prize-status ${f ? "placed" : "missing"}`, L.innerHTML = f ? ie : se, g.appendChild(v), g.appendChild(C), g.appendChild(L), o.appendChild(g);
|
|
3609
3590
|
}
|
|
3610
3591
|
t.appendChild(o);
|
|
3611
3592
|
const r = document.createElement("button");
|
|
@@ -3859,9 +3840,9 @@ const Kt = `
|
|
|
3859
3840
|
this.closePopover(), (t = this.backdropEl) != null && t.parentElement && this.backdropEl.parentElement.removeChild(this.backdropEl), (e = this.popoverEl) != null && e.parentElement && this.popoverEl.parentElement.removeChild(this.popoverEl), document.removeEventListener("click", this.onBackgroundClick, !0), document.removeEventListener("keydown", this.handlePopoverKeydown, !0);
|
|
3860
3841
|
}
|
|
3861
3842
|
};
|
|
3862
|
-
|
|
3863
|
-
let
|
|
3864
|
-
class ne extends
|
|
3843
|
+
B.openInstance = null;
|
|
3844
|
+
let gt = B;
|
|
3845
|
+
class ne extends H {
|
|
3865
3846
|
constructor(t = {}) {
|
|
3866
3847
|
super({
|
|
3867
3848
|
...t,
|
|
@@ -3882,7 +3863,7 @@ class ne extends O {
|
|
|
3882
3863
|
const oe = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
3883
3864
|
<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"/>
|
|
3884
3865
|
</svg>`;
|
|
3885
|
-
class ae extends
|
|
3866
|
+
class ae extends H {
|
|
3886
3867
|
constructor(t = {}) {
|
|
3887
3868
|
super({
|
|
3888
3869
|
...t,
|
|
@@ -4166,7 +4147,7 @@ class Ie extends x {
|
|
|
4166
4147
|
const he = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
4167
4148
|
<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"/>
|
|
4168
4149
|
</svg>`;
|
|
4169
|
-
class Se extends
|
|
4150
|
+
class Se extends H {
|
|
4170
4151
|
constructor(t = {}) {
|
|
4171
4152
|
super({
|
|
4172
4153
|
...t,
|
|
@@ -4183,7 +4164,7 @@ const de = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewB
|
|
|
4183
4164
|
<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"
|
|
4184
4165
|
stroke="#667085" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
4185
4166
|
</svg>`;
|
|
4186
|
-
class Ve extends
|
|
4167
|
+
class Ve extends H {
|
|
4187
4168
|
constructor(t = {}) {
|
|
4188
4169
|
super({
|
|
4189
4170
|
...t,
|
|
@@ -4196,9 +4177,9 @@ class Ve extends O {
|
|
|
4196
4177
|
}), this.inputType = "number";
|
|
4197
4178
|
}
|
|
4198
4179
|
}
|
|
4199
|
-
class
|
|
4180
|
+
class Te extends x {
|
|
4200
4181
|
constructor(t) {
|
|
4201
|
-
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(x.DefaultLanguage) ? x.DefaultLanguage : t.languages[0];
|
|
4182
|
+
super(t), this.inputType = {}, this.container = null, this.defaultLanguage = "", this.uploadSettings = /* @__PURE__ */ new Map(), this.popup = null, t.default ? this.value = { ...t.default } : this.value || (this.value = {}), this.defaultLanguage = t.languages.includes(x.DefaultLanguage) ? x.DefaultLanguage : t.languages[0];
|
|
4202
4183
|
const e = t.defaultValue || `Enter text in ${this.capitalizeFirstLetter(this.defaultLanguage)}`;
|
|
4203
4184
|
t.languages.forEach((i) => {
|
|
4204
4185
|
var s, n;
|
|
@@ -4231,8 +4212,8 @@ class Pe extends x {
|
|
|
4231
4212
|
const c = "...";
|
|
4232
4213
|
let h = 0, d = e.length, u = 0;
|
|
4233
4214
|
for (; h <= d; ) {
|
|
4234
|
-
const
|
|
4235
|
-
this.measureTextWidth(
|
|
4215
|
+
const m = Math.floor((h + d) / 2), g = e.slice(0, m).trimEnd() + c;
|
|
4216
|
+
this.measureTextWidth(g, i) <= l ? (u = m, h = m + 1) : d = m - 1;
|
|
4236
4217
|
}
|
|
4237
4218
|
const f = e.slice(0, u).trimEnd() + c;
|
|
4238
4219
|
t.placeholder = f;
|
|
@@ -4301,18 +4282,139 @@ class Pe extends x {
|
|
|
4301
4282
|
}
|
|
4302
4283
|
});
|
|
4303
4284
|
}
|
|
4285
|
+
renderContent(t) {
|
|
4286
|
+
var s;
|
|
4287
|
+
const e = t.querySelector(
|
|
4288
|
+
".simple-multi-language-content"
|
|
4289
|
+
);
|
|
4290
|
+
if (!e) return;
|
|
4291
|
+
e.innerHTML = "";
|
|
4292
|
+
const i = x.CurrentLanguage();
|
|
4293
|
+
if (!i || !this.props.languages.includes(i))
|
|
4294
|
+
this.props.languages.forEach((n) => {
|
|
4295
|
+
var l;
|
|
4296
|
+
const o = ((l = this.value) == null ? void 0 : l[n]) || "", a = this.createTextareaRow(n, o);
|
|
4297
|
+
e.appendChild(a);
|
|
4298
|
+
});
|
|
4299
|
+
else {
|
|
4300
|
+
const n = ((s = this.value) == null ? void 0 : s[i]) || "", o = this.createTextareaRow(i, n);
|
|
4301
|
+
e.appendChild(o);
|
|
4302
|
+
const a = e.querySelector(
|
|
4303
|
+
".simple-language-textarea"
|
|
4304
|
+
);
|
|
4305
|
+
if (a) {
|
|
4306
|
+
const l = a.getAttribute("data-full-placeholder") || "";
|
|
4307
|
+
l && this.adaptPlaceholderToSingleLine(a, l);
|
|
4308
|
+
}
|
|
4309
|
+
}
|
|
4310
|
+
}
|
|
4311
|
+
createPopup() {
|
|
4312
|
+
const t = document.createElement("div");
|
|
4313
|
+
t.classList.add("multi-language-popup-overlay"), t.style.cssText = `
|
|
4314
|
+
position: fixed;
|
|
4315
|
+
top: 0;
|
|
4316
|
+
left: 0;
|
|
4317
|
+
right: 0;
|
|
4318
|
+
bottom: 0;
|
|
4319
|
+
background: rgba(0, 0, 0, 0.5);
|
|
4320
|
+
display: flex;
|
|
4321
|
+
align-items: center;
|
|
4322
|
+
justify-content: center;
|
|
4323
|
+
z-index: 9999;
|
|
4324
|
+
`;
|
|
4325
|
+
const e = document.createElement("div");
|
|
4326
|
+
e.classList.add("multi-language-popup"), e.style.cssText = `
|
|
4327
|
+
background: white;
|
|
4328
|
+
border-radius: 8px;
|
|
4329
|
+
padding: 24px;
|
|
4330
|
+
max-width: 600px;
|
|
4331
|
+
width: 90%;
|
|
4332
|
+
max-height: 80vh;
|
|
4333
|
+
overflow-y: auto;
|
|
4334
|
+
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
|
|
4335
|
+
`;
|
|
4336
|
+
const i = document.createElement("div");
|
|
4337
|
+
i.style.cssText = `
|
|
4338
|
+
display: flex;
|
|
4339
|
+
justify-content: space-between;
|
|
4340
|
+
align-items: center;
|
|
4341
|
+
margin-bottom: 20px;
|
|
4342
|
+
`;
|
|
4343
|
+
const s = document.createElement("h3");
|
|
4344
|
+
s.textContent = "All Languages", s.style.cssText = `
|
|
4345
|
+
margin: 0;
|
|
4346
|
+
font-size: 18px;
|
|
4347
|
+
font-weight: 600;
|
|
4348
|
+
`;
|
|
4349
|
+
const n = document.createElement("button");
|
|
4350
|
+
n.textContent = "×", n.style.cssText = `
|
|
4351
|
+
background: none;
|
|
4352
|
+
border: none;
|
|
4353
|
+
font-size: 28px;
|
|
4354
|
+
cursor: pointer;
|
|
4355
|
+
color: #666;
|
|
4356
|
+
padding: 0;
|
|
4357
|
+
width: 32px;
|
|
4358
|
+
height: 32px;
|
|
4359
|
+
display: flex;
|
|
4360
|
+
align-items: center;
|
|
4361
|
+
justify-content: center;
|
|
4362
|
+
line-height: 1;
|
|
4363
|
+
`, n.addEventListener("click", () => this.closePopup()), i.appendChild(s), i.appendChild(n), e.appendChild(i);
|
|
4364
|
+
const o = document.createElement("div");
|
|
4365
|
+
return o.classList.add("multi-language-popup-content"), this.props.languages.forEach((a) => {
|
|
4366
|
+
var c;
|
|
4367
|
+
const l = ((c = this.value) == null ? void 0 : c[a]) || "", r = this.createTextareaRow(a, l);
|
|
4368
|
+
o.appendChild(r);
|
|
4369
|
+
}), e.appendChild(o), t.appendChild(e), t.addEventListener("click", (a) => {
|
|
4370
|
+
a.target === t && this.closePopup();
|
|
4371
|
+
}), t;
|
|
4372
|
+
}
|
|
4373
|
+
showPopup() {
|
|
4374
|
+
this.popup || (this.popup = this.createPopup(), document.body.appendChild(this.popup));
|
|
4375
|
+
}
|
|
4376
|
+
closePopup() {
|
|
4377
|
+
this.popup && (document.body.removeChild(this.popup), this.popup = null);
|
|
4378
|
+
}
|
|
4304
4379
|
draw() {
|
|
4305
4380
|
const t = document.createElement("div");
|
|
4306
4381
|
if (t.classList.add("simple-multi-language-wrapper"), this.props.title) {
|
|
4307
4382
|
const s = document.createElement("div");
|
|
4308
|
-
s.classList.add("simple-multi-language-title"), s.
|
|
4383
|
+
s.classList.add("simple-multi-language-title"), s.style.cssText = `
|
|
4384
|
+
display: flex;
|
|
4385
|
+
justify-content: space-between;
|
|
4386
|
+
align-items: center;
|
|
4387
|
+
`;
|
|
4388
|
+
const n = document.createElement("span");
|
|
4389
|
+
n.textContent = this.props.title;
|
|
4390
|
+
const o = document.createElement("button");
|
|
4391
|
+
o.classList.add("multi-language-eye-icon"), o.innerHTML = `
|
|
4392
|
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
4393
|
+
<path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"></path>
|
|
4394
|
+
<circle cx="12" cy="12" r="3"></circle>
|
|
4395
|
+
</svg>
|
|
4396
|
+
`, o.style.cssText = `
|
|
4397
|
+
background: none;
|
|
4398
|
+
border: none;
|
|
4399
|
+
cursor: pointer;
|
|
4400
|
+
padding: 4px;
|
|
4401
|
+
display: flex;
|
|
4402
|
+
align-items: center;
|
|
4403
|
+
justify-content: center;
|
|
4404
|
+
color: #666;
|
|
4405
|
+
transition: color 0.2s;
|
|
4406
|
+
`, o.addEventListener("mouseenter", () => {
|
|
4407
|
+
o.style.color = "#000";
|
|
4408
|
+
}), o.addEventListener("mouseleave", () => {
|
|
4409
|
+
o.style.color = "#666";
|
|
4410
|
+
}), o.addEventListener("click", (a) => {
|
|
4411
|
+
a.preventDefault(), this.showPopup();
|
|
4412
|
+
}), s.appendChild(n), s.appendChild(o), t.appendChild(s);
|
|
4309
4413
|
}
|
|
4310
4414
|
const e = document.createElement("div");
|
|
4311
|
-
e.classList.add("simple-multi-language-content"), this.
|
|
4312
|
-
|
|
4313
|
-
|
|
4314
|
-
e.appendChild(o);
|
|
4315
|
-
}), t.appendChild(e), this.container = t;
|
|
4415
|
+
e.classList.add("simple-multi-language-content"), t.appendChild(e), this.container = t, this.renderContent(t), this.languageChangeUnsubscribe = x.onLanguageChange(() => {
|
|
4416
|
+
this.container && this.renderContent(this.container);
|
|
4417
|
+
});
|
|
4316
4418
|
const i = () => {
|
|
4317
4419
|
if (!this.container) return;
|
|
4318
4420
|
this.container.querySelectorAll(
|
|
@@ -4343,7 +4445,7 @@ class Pe extends x {
|
|
|
4343
4445
|
});
|
|
4344
4446
|
}
|
|
4345
4447
|
}
|
|
4346
|
-
class
|
|
4448
|
+
class Pe extends x {
|
|
4347
4449
|
constructor(t = {}) {
|
|
4348
4450
|
super(t), this.inputType = "select";
|
|
4349
4451
|
const e = [
|
|
@@ -4379,13 +4481,13 @@ const pe = `
|
|
|
4379
4481
|
<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"/>
|
|
4380
4482
|
</svg>
|
|
4381
4483
|
`;
|
|
4382
|
-
class Oe extends
|
|
4484
|
+
class Oe extends $ {
|
|
4383
4485
|
constructor(t) {
|
|
4384
4486
|
super({
|
|
4385
4487
|
title: "Border",
|
|
4386
4488
|
collapsed: t == null ? void 0 : t.collapsed,
|
|
4387
4489
|
settings: {
|
|
4388
|
-
size: new
|
|
4490
|
+
size: new H({
|
|
4389
4491
|
title: "Size",
|
|
4390
4492
|
icon: ue,
|
|
4391
4493
|
default: (t == null ? void 0 : t.size) ?? 0,
|
|
@@ -4395,7 +4497,7 @@ class Oe extends T {
|
|
|
4395
4497
|
title: "Border Color",
|
|
4396
4498
|
default: (t == null ? void 0 : t.color) || "#000000"
|
|
4397
4499
|
}),
|
|
4398
|
-
radius: new
|
|
4500
|
+
radius: new H({
|
|
4399
4501
|
title: "Radius",
|
|
4400
4502
|
icon: pe,
|
|
4401
4503
|
default: (t == null ? void 0 : t.radius) ?? 12,
|
|
@@ -4421,11 +4523,11 @@ class Oe extends T {
|
|
|
4421
4523
|
`;
|
|
4422
4524
|
}
|
|
4423
4525
|
}
|
|
4424
|
-
const
|
|
4526
|
+
const ge = `
|
|
4425
4527
|
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="13" viewBox="0 0 14 13" fill="none">
|
|
4426
4528
|
<path d="M1 2.75C1 2.05109 1 1.70163 1.11418 1.42597C1.26642 1.05843 1.55843 0.766422 1.92597 0.614181C2.20163 0.5 2.55109 0.5 3.25 0.5H10.75C11.4489 0.5 11.7984 0.5 12.074 0.614181C12.4416 0.766422 12.7336 1.05843 12.8858 1.42597C13 1.70163 13 2.05109 13 2.75M4.75 12.5H9.25M7 0.5V12.5" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
|
|
4427
4529
|
</svg>
|
|
4428
|
-
`,
|
|
4530
|
+
`, me = `
|
|
4429
4531
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
4430
4532
|
<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"/>
|
|
4431
4533
|
</svg>
|
|
@@ -4434,7 +4536,7 @@ const me = `
|
|
|
4434
4536
|
<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"/>
|
|
4435
4537
|
</svg>
|
|
4436
4538
|
`;
|
|
4437
|
-
class $e extends
|
|
4539
|
+
class $e extends $ {
|
|
4438
4540
|
constructor(t = {}) {
|
|
4439
4541
|
const { showAlign: e = t.showAlign ?? !0, ...i } = t;
|
|
4440
4542
|
super({
|
|
@@ -4448,7 +4550,7 @@ class $e extends T {
|
|
|
4448
4550
|
}),
|
|
4449
4551
|
fontFamily: new nt({
|
|
4450
4552
|
title: "Font",
|
|
4451
|
-
icon:
|
|
4553
|
+
icon: ge,
|
|
4452
4554
|
default: i.fontFamilyDefault ?? "Satoshi",
|
|
4453
4555
|
options: i.fontFamilyOptions ?? [
|
|
4454
4556
|
{ name: "Alt", value: "Croco Sans Black Caps Alt" },
|
|
@@ -4461,7 +4563,7 @@ class $e extends T {
|
|
|
4461
4563
|
}),
|
|
4462
4564
|
fontWeight: new nt({
|
|
4463
4565
|
title: "Weight",
|
|
4464
|
-
icon:
|
|
4566
|
+
icon: me,
|
|
4465
4567
|
default: i.fontWeightDefault ?? "400",
|
|
4466
4568
|
options: i.fontWeightOptions ?? [
|
|
4467
4569
|
{ name: "Regular", value: "400" },
|
|
@@ -4471,7 +4573,7 @@ class $e extends T {
|
|
|
4471
4573
|
getOptions: i.fontWeightGetOptions,
|
|
4472
4574
|
getOptionsAsync: i.fontWeightGetOptionsAsync
|
|
4473
4575
|
}),
|
|
4474
|
-
fontSize: new
|
|
4576
|
+
fontSize: new H({
|
|
4475
4577
|
title: "Size",
|
|
4476
4578
|
icon: ve,
|
|
4477
4579
|
default: i.fontSizeDefault ?? 12,
|
|
@@ -4559,7 +4661,7 @@ class _ extends x {
|
|
|
4559
4661
|
}), i;
|
|
4560
4662
|
}
|
|
4561
4663
|
}
|
|
4562
|
-
class He extends
|
|
4664
|
+
class He extends $ {
|
|
4563
4665
|
constructor(t) {
|
|
4564
4666
|
super({
|
|
4565
4667
|
title: "Margins",
|
|
@@ -4585,7 +4687,7 @@ class He extends T {
|
|
|
4585
4687
|
}),
|
|
4586
4688
|
marginLeft: new _({
|
|
4587
4689
|
title: "Left",
|
|
4588
|
-
icon:
|
|
4690
|
+
icon: be,
|
|
4589
4691
|
suffix: "px",
|
|
4590
4692
|
default: (t == null ? void 0 : t.marginLeft) ?? 0
|
|
4591
4693
|
})
|
|
@@ -4608,10 +4710,10 @@ const fe = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewB
|
|
|
4608
4710
|
<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"/>
|
|
4609
4711
|
</svg>`, ye = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
4610
4712
|
<path d="M2.25 2.75H2.2575M2.25 9.5H2.2575M2.25 12.875H2.2575M2.25 6.125H2.2575M5.625 2.75H5.6325M5.625 9.5H5.6325M12.375 2.75H12.3825M12.375 9.5H12.3825M9 2.75H9.0075M9 9.5H9.0075M9 12.875H9.0075M9 6.125H9.0075M15.75 2.75H15.7575M15.75 9.5H15.7575M15.75 12.875H15.7575M15.75 6.125H15.7575M15.75 16.25H2.25" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
|
|
4611
|
-
</svg>`,
|
|
4713
|
+
</svg>`, be = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
4612
4714
|
<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"/>
|
|
4613
4715
|
</svg>`;
|
|
4614
|
-
class Be extends
|
|
4716
|
+
class Be extends $ {
|
|
4615
4717
|
constructor(t) {
|
|
4616
4718
|
super({
|
|
4617
4719
|
title: "Background Image",
|
|
@@ -4650,7 +4752,7 @@ class Be extends T {
|
|
|
4650
4752
|
`;
|
|
4651
4753
|
}
|
|
4652
4754
|
}
|
|
4653
|
-
class Ae extends
|
|
4755
|
+
class Ae extends $ {
|
|
4654
4756
|
constructor(t) {
|
|
4655
4757
|
super({
|
|
4656
4758
|
title: (t == null ? void 0 : t.title) ?? "Image",
|
|
@@ -4674,11 +4776,11 @@ class Ae extends T {
|
|
|
4674
4776
|
}
|
|
4675
4777
|
export {
|
|
4676
4778
|
jt as AlignSetting,
|
|
4677
|
-
|
|
4779
|
+
Pe as AnimationSetting,
|
|
4678
4780
|
Be as BackgroundSettingSet,
|
|
4679
4781
|
Oe as BorderSettingSet,
|
|
4680
4782
|
Le as ButtonSetting,
|
|
4681
|
-
|
|
4783
|
+
O as ColorSetting,
|
|
4682
4784
|
F as ColorWithOpacitySetting,
|
|
4683
4785
|
ke as DimensionSetting,
|
|
4684
4786
|
Ie as GapSetting,
|
|
@@ -4686,18 +4788,18 @@ export {
|
|
|
4686
4788
|
$e as HeaderTypographySettingSet,
|
|
4687
4789
|
ne as HeightSetting,
|
|
4688
4790
|
xe as HtmlSetting,
|
|
4689
|
-
|
|
4791
|
+
gt as ImageMapSetting,
|
|
4690
4792
|
Ae as ImageSettingSet,
|
|
4691
4793
|
Se as MarginBottomSetting,
|
|
4692
4794
|
He as MarginSettingGroup,
|
|
4693
4795
|
Ve as MarginTopSetting,
|
|
4694
|
-
|
|
4695
|
-
|
|
4796
|
+
Te as MultiLanguageSetting,
|
|
4797
|
+
H as NumberSetting,
|
|
4696
4798
|
Ut as OpacitySetting,
|
|
4697
4799
|
Me as SelectApiSettings,
|
|
4698
4800
|
nt as SelectSetting,
|
|
4699
4801
|
x as Setting,
|
|
4700
|
-
|
|
4802
|
+
$ as SettingGroup,
|
|
4701
4803
|
Gt as StringSetting,
|
|
4702
4804
|
At as TabSettingGroup,
|
|
4703
4805
|
At as TabsSettingGroup,
|
|
@@ -4706,8 +4808,8 @@ export {
|
|
|
4706
4808
|
ae as WidthSetting,
|
|
4707
4809
|
we as asSettingGroupWithSettings,
|
|
4708
4810
|
Dt as createSettingGroup,
|
|
4709
|
-
|
|
4710
|
-
|
|
4811
|
+
Ee as createTabSettingGroup,
|
|
4812
|
+
G as isSetting,
|
|
4711
4813
|
ct as isSettingChild,
|
|
4712
4814
|
k as isSettingGroup,
|
|
4713
4815
|
J as iterateSettings
|