builder-settings-types 0.0.326 → 0.0.329
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
const
|
|
2
|
-
let
|
|
3
|
-
let t = "", e = crypto.getRandomValues(new Uint8Array(
|
|
4
|
-
for (;
|
|
5
|
-
t +=
|
|
1
|
+
const xt = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
2
|
+
let ft = (p = 21) => {
|
|
3
|
+
let t = "", e = crypto.getRandomValues(new Uint8Array(p |= 0));
|
|
4
|
+
for (; p--; )
|
|
5
|
+
t += xt[e[p] & 63];
|
|
6
6
|
return t;
|
|
7
7
|
};
|
|
8
|
-
function
|
|
9
|
-
let t = 0, e =
|
|
8
|
+
function Lt(p) {
|
|
9
|
+
let t = 0, e = p.parentElement;
|
|
10
10
|
for (; e; )
|
|
11
|
-
e.classList.contains("setting-group") && e !==
|
|
11
|
+
e.classList.contains("setting-group") && e !== p && t++, e = e.parentElement;
|
|
12
12
|
return t;
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function _(p, t) {
|
|
15
15
|
const e = Math.min(Math.max(t, 0), 5);
|
|
16
|
-
|
|
16
|
+
p.setAttribute("data-nesting-level", e.toString()), e > 0 ? p.style.setProperty("--visual-indent", `${e * 2}px`) : (p.style.removeProperty("--visual-indent"), p.style.marginLeft = "");
|
|
17
17
|
}
|
|
18
|
-
function et(
|
|
19
|
-
|
|
18
|
+
function et(p, t = 0) {
|
|
19
|
+
p.querySelectorAll(":scope > .setting-group-content > .setting-group").forEach((i) => {
|
|
20
20
|
const s = i, n = t + 1;
|
|
21
|
-
|
|
21
|
+
_(s, n), et(s, n);
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
|
-
const
|
|
24
|
+
const kt = {
|
|
25
25
|
maxLevel: 5,
|
|
26
26
|
spacingMultiplier: 1,
|
|
27
27
|
visualIndentMultiplier: 2,
|
|
28
28
|
enableAutoDetection: !0
|
|
29
29
|
};
|
|
30
|
-
class
|
|
30
|
+
class Mt {
|
|
31
31
|
constructor(t = {}) {
|
|
32
|
-
this.observedElements = /* @__PURE__ */ new Set(), this.config = { ...
|
|
32
|
+
this.observedElements = /* @__PURE__ */ new Set(), this.config = { ...kt, ...t }, this.config.enableAutoDetection && this.setupAutoDetection();
|
|
33
33
|
}
|
|
34
34
|
/**
|
|
35
35
|
* Setup automatic detection using MutationObserver
|
|
@@ -63,7 +63,7 @@ class Lt {
|
|
|
63
63
|
* Update nesting for a specific element
|
|
64
64
|
*/
|
|
65
65
|
updateElementNesting(t) {
|
|
66
|
-
const e =
|
|
66
|
+
const e = Lt(t);
|
|
67
67
|
this.applyNestingWithConfig(t, e);
|
|
68
68
|
}
|
|
69
69
|
/**
|
|
@@ -111,21 +111,21 @@ class Lt {
|
|
|
111
111
|
this.observer && (this.observer.disconnect(), this.observer = void 0), this.observedElements.clear();
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
|
-
const rt = new
|
|
115
|
-
function Y(
|
|
116
|
-
if (
|
|
117
|
-
if (
|
|
118
|
-
if (
|
|
119
|
-
if (typeof
|
|
114
|
+
const rt = new Mt();
|
|
115
|
+
function Y(p) {
|
|
116
|
+
if (p === null || typeof p != "object") return p;
|
|
117
|
+
if (p instanceof Date) return new Date(p.getTime());
|
|
118
|
+
if (p instanceof Array) return p.map((t) => Y(t));
|
|
119
|
+
if (typeof p == "object") {
|
|
120
120
|
const t = {};
|
|
121
|
-
for (const e in
|
|
122
|
-
Object.prototype.hasOwnProperty.call(
|
|
121
|
+
for (const e in p)
|
|
122
|
+
Object.prototype.hasOwnProperty.call(p, e) && (t[e] = Y(p[e]));
|
|
123
123
|
return t;
|
|
124
124
|
}
|
|
125
|
-
return
|
|
125
|
+
return p;
|
|
126
126
|
}
|
|
127
|
-
function
|
|
128
|
-
switch (
|
|
127
|
+
function It(p) {
|
|
128
|
+
switch (p) {
|
|
129
129
|
case "number":
|
|
130
130
|
return 0;
|
|
131
131
|
case "text":
|
|
@@ -144,7 +144,7 @@ function kt(h) {
|
|
|
144
144
|
}
|
|
145
145
|
const M = class M {
|
|
146
146
|
constructor(t = {}) {
|
|
147
|
-
this.props = t, this.dataPropsPath = "", this.id = t.id ||
|
|
147
|
+
this.props = t, this.dataPropsPath = "", this.id = t.id || ft(), 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
150
|
globalThis.DefaultUploadUrl = t, M.DefaultUploadUrl = t;
|
|
@@ -206,7 +206,7 @@ const M = class M {
|
|
|
206
206
|
const i = document.createElement("div");
|
|
207
207
|
i.className = t.wrapperClassName || "";
|
|
208
208
|
const s = document.createElement("input");
|
|
209
|
-
this.inputEl = s, s.value = String(t.value ||
|
|
209
|
+
this.inputEl = s, s.value = String(t.value || It(t.inputType)), s.type = t.inputType, s.placeholder = t.placeholder || "", s.className = t.inputClassName || "", this.dataPropsPath && s.setAttribute("data-test-id", this.dataPropsPath);
|
|
210
210
|
const n = (a) => {
|
|
211
211
|
const l = a.target;
|
|
212
212
|
let r = l.value;
|
|
@@ -261,80 +261,80 @@ M.currentLanguageExplicitlySet = !1, M.languageChangeCallbacks = /* @__PURE__ */
|
|
|
261
261
|
},
|
|
262
262
|
{ title: "Text Color", keys: ["text-dark", "text-light"] }
|
|
263
263
|
];
|
|
264
|
-
let
|
|
265
|
-
function
|
|
266
|
-
return
|
|
264
|
+
let w = M;
|
|
265
|
+
function F(p) {
|
|
266
|
+
return p instanceof w;
|
|
267
267
|
}
|
|
268
|
-
function
|
|
269
|
-
return
|
|
268
|
+
function L(p) {
|
|
269
|
+
return p instanceof H;
|
|
270
270
|
}
|
|
271
|
-
function ct(
|
|
272
|
-
return
|
|
271
|
+
function ct(p) {
|
|
272
|
+
return F(p) || L(p);
|
|
273
273
|
}
|
|
274
|
-
const ot = (
|
|
274
|
+
const ot = (p, t, e) => {
|
|
275
275
|
let i = !1, s = 0, n = 0, o = 0, a = 0;
|
|
276
|
-
const l = (
|
|
277
|
-
if (
|
|
278
|
-
i = !0, s =
|
|
279
|
-
const
|
|
280
|
-
o =
|
|
281
|
-
}, r = (
|
|
276
|
+
const l = (d) => {
|
|
277
|
+
if (d.target.closest("button")) return;
|
|
278
|
+
i = !0, s = d.clientX, n = d.clientY;
|
|
279
|
+
const h = t.getBoundingClientRect();
|
|
280
|
+
o = h.left, a = h.top, document.addEventListener("mousemove", r), document.addEventListener("mouseup", c), document.body.style.userSelect = "none";
|
|
281
|
+
}, r = (d) => {
|
|
282
282
|
if (!i) return;
|
|
283
|
-
const
|
|
284
|
-
let v = o +
|
|
285
|
-
v = Math.max(8, Math.min(
|
|
283
|
+
const h = d.clientX - s, g = d.clientY - n, f = window.innerWidth, m = window.innerHeight, u = t.offsetWidth, C = t.offsetHeight;
|
|
284
|
+
let v = o + h, y = a + g;
|
|
285
|
+
v = Math.max(8, Math.min(f - u - 8, v)), y = Math.max(8, Math.min(m - C - 8, y)), t.style.left = `${v}px`, t.style.top = `${y}px`, e == null || e(v, y);
|
|
286
286
|
}, c = () => {
|
|
287
287
|
i = !1, document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", c), document.body.style.userSelect = "";
|
|
288
288
|
};
|
|
289
|
-
|
|
290
|
-
},
|
|
291
|
-
if (!
|
|
292
|
-
let t =
|
|
289
|
+
p.addEventListener("mousedown", l);
|
|
290
|
+
}, G = (p) => {
|
|
291
|
+
if (!p) return null;
|
|
292
|
+
let t = p.trim();
|
|
293
293
|
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()}`;
|
|
294
|
-
}, X = (
|
|
295
|
-
const t =
|
|
294
|
+
}, X = (p, t, e) => `#${[p, t, e].map((i) => Math.max(0, Math.min(255, i)).toString(16).padStart(2, "0")).join("")}`, P = (p) => {
|
|
295
|
+
const t = p.replace("#", ""), e = t.length === 3 ? t.split("").map((i) => i + i).join("") : t;
|
|
296
296
|
return {
|
|
297
297
|
r: parseInt(e.slice(0, 2), 16),
|
|
298
298
|
g: parseInt(e.slice(2, 4), 16),
|
|
299
299
|
b: parseInt(e.slice(4, 6), 16)
|
|
300
300
|
};
|
|
301
|
-
}, U = (
|
|
302
|
-
const { r: t, g: e, b: i } = P(
|
|
301
|
+
}, U = (p) => {
|
|
302
|
+
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;
|
|
303
303
|
let c = 0;
|
|
304
304
|
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);
|
|
305
|
-
const
|
|
306
|
-
return { h: c * 60, s:
|
|
307
|
-
}, W = (
|
|
308
|
-
const i = (
|
|
305
|
+
const d = a === 0 ? 0 : r / a, h = a;
|
|
306
|
+
return { h: c * 60, s: d, v: h };
|
|
307
|
+
}, W = (p, t, e) => {
|
|
308
|
+
const i = (p % 360 + 360) % 360, s = e * t, n = s * (1 - Math.abs(i / 60 % 2 - 1)), o = e - s;
|
|
309
309
|
let a = 0, l = 0, r = 0;
|
|
310
310
|
return i < 60 ? (a = s, l = n, r = 0) : i < 120 ? (a = n, l = s, r = 0) : i < 180 ? (a = 0, l = s, r = n) : i < 240 ? (a = 0, l = n, r = s) : i < 300 ? (a = n, l = 0, r = s) : (a = s, l = 0, r = n), X(
|
|
311
311
|
Math.round((a + o) * 255),
|
|
312
312
|
Math.round((l + o) * 255),
|
|
313
313
|
Math.round((r + o) * 255)
|
|
314
314
|
);
|
|
315
|
-
},
|
|
315
|
+
}, Ct = (p, t, e) => {
|
|
316
316
|
const i = e * (1 - t / 2), s = i === 0 || i === 1 ? 0 : (e - i) / Math.min(i, 1 - i);
|
|
317
|
-
return { hue:
|
|
318
|
-
}, it = (
|
|
319
|
-
const i = (1 - Math.abs(2 * e - 1)) * t, s = i * (1 - Math.abs(
|
|
317
|
+
return { hue: p, sat: s, lightness: i };
|
|
318
|
+
}, it = (p, t, e) => {
|
|
319
|
+
const i = (1 - Math.abs(2 * e - 1)) * t, s = i * (1 - Math.abs(p / 60 % 2 - 1)), n = e - i / 2;
|
|
320
320
|
let o = 0, a = 0, l = 0;
|
|
321
|
-
return
|
|
321
|
+
return p < 60 ? (o = i, a = s, l = 0) : p < 120 ? (o = s, a = i, l = 0) : p < 180 ? (o = 0, a = i, l = s) : p < 240 ? (o = 0, a = s, l = i) : p < 300 ? (o = s, a = 0, l = i) : (o = i, a = 0, l = s), {
|
|
322
322
|
r: Math.round((o + n) * 255),
|
|
323
323
|
g: Math.round((a + n) * 255),
|
|
324
324
|
b: Math.round((l + n) * 255)
|
|
325
325
|
};
|
|
326
|
-
}, st = (
|
|
326
|
+
}, st = (p, t) => {
|
|
327
327
|
const e = Math.max(0, Math.min(100, t)) / 100;
|
|
328
|
-
if (
|
|
329
|
-
const { r: s, g: n, b: o } = P(
|
|
328
|
+
if (p.startsWith("#")) {
|
|
329
|
+
const { r: s, g: n, b: o } = P(p);
|
|
330
330
|
return `rgba(${s}, ${n}, ${o}, ${e})`;
|
|
331
331
|
}
|
|
332
|
-
if (
|
|
333
|
-
return
|
|
334
|
-
if (
|
|
335
|
-
return
|
|
336
|
-
if (
|
|
337
|
-
const s =
|
|
332
|
+
if (p.startsWith("rgba("))
|
|
333
|
+
return p.replace(/,\s*[\d.]+\)$/, `, ${e})`);
|
|
334
|
+
if (p.startsWith("rgb("))
|
|
335
|
+
return p.replace("rgb(", "rgba(").replace(")", `, ${e})`);
|
|
336
|
+
if (p.startsWith("hsl(")) {
|
|
337
|
+
const s = p.match(/hsl\((\d+),\s*(\d+)%,\s*(\d+)%\)/);
|
|
338
338
|
if (s) {
|
|
339
339
|
const { r: n, g: o, b: a } = it(
|
|
340
340
|
parseInt(s[1]),
|
|
@@ -344,8 +344,8 @@ const ot = (h, t, e) => {
|
|
|
344
344
|
return `rgba(${n}, ${o}, ${a}, ${e})`;
|
|
345
345
|
}
|
|
346
346
|
}
|
|
347
|
-
if (
|
|
348
|
-
const s =
|
|
347
|
+
if (p.startsWith("hsla(")) {
|
|
348
|
+
const s = p.match(/hsla\((\d+),\s*(\d+)%,\s*(\d+)%,\s*[\d.]+\)/);
|
|
349
349
|
if (s) {
|
|
350
350
|
const { r: n, g: o, b: a } = it(
|
|
351
351
|
parseInt(s[1]),
|
|
@@ -355,13 +355,13 @@ const ot = (h, t, e) => {
|
|
|
355
355
|
return `rgba(${n}, ${o}, ${a}, ${e})`;
|
|
356
356
|
}
|
|
357
357
|
}
|
|
358
|
-
const i =
|
|
358
|
+
const i = G(p);
|
|
359
359
|
if (i) {
|
|
360
360
|
const { r: s, g: n, b: o } = P(i);
|
|
361
361
|
return `rgba(${s}, ${n}, ${o}, ${e})`;
|
|
362
362
|
}
|
|
363
|
-
return
|
|
364
|
-
},
|
|
363
|
+
return p;
|
|
364
|
+
}, Nt = (p) => [
|
|
365
365
|
"red",
|
|
366
366
|
"green",
|
|
367
367
|
"blue",
|
|
@@ -385,18 +385,18 @@ const ot = (h, t, e) => {
|
|
|
385
385
|
"teal",
|
|
386
386
|
"fuchsia",
|
|
387
387
|
"transparent"
|
|
388
|
-
].includes(
|
|
388
|
+
].includes(p.toLowerCase()), yt = (p) => [
|
|
389
389
|
/^#[0-9a-fA-F]{3,8}$/,
|
|
390
390
|
/^rgba?\s*\([^)]+\)$/,
|
|
391
391
|
/^hsla?\s*\([^)]+\)$/,
|
|
392
392
|
/^[a-zA-Z]+$/
|
|
393
|
-
].some((e) => e.test(
|
|
393
|
+
].some((e) => e.test(p.trim())), St = (p) => {
|
|
394
394
|
if (typeof document > "u")
|
|
395
|
-
return
|
|
395
|
+
return yt(p) || !!G(p);
|
|
396
396
|
const t = document.createElement("div");
|
|
397
|
-
return t.style.color =
|
|
398
|
-
},
|
|
399
|
-
const t =
|
|
397
|
+
return t.style.color = p, t.style.color !== "";
|
|
398
|
+
}, Et = (p) => {
|
|
399
|
+
const t = p.trim();
|
|
400
400
|
if (/^#[0-9A-Fa-f]{8}$/.test(t)) {
|
|
401
401
|
const n = t.slice(1), o = parseInt(n.slice(0, 2), 16), a = parseInt(n.slice(2, 4), 16), l = parseInt(n.slice(4, 6), 16), r = parseInt(n.slice(6, 8), 16);
|
|
402
402
|
return {
|
|
@@ -431,12 +431,12 @@ const ot = (h, t, e) => {
|
|
|
431
431
|
opacity: Math.round(l * 100)
|
|
432
432
|
};
|
|
433
433
|
}
|
|
434
|
-
return { color:
|
|
435
|
-
}, ht = (
|
|
434
|
+
return { color: G(t) || t, position: 0, opacity: 100 };
|
|
435
|
+
}, ht = (p) => {
|
|
436
436
|
const t = [];
|
|
437
437
|
let e = "", i = 0;
|
|
438
|
-
for (let s = 0; s <
|
|
439
|
-
const n =
|
|
438
|
+
for (let s = 0; s < p.length; s++) {
|
|
439
|
+
const n = p[s];
|
|
440
440
|
if (n === "(") i++;
|
|
441
441
|
else if (n === ")") i--;
|
|
442
442
|
else if (n === "," && i === 0) {
|
|
@@ -446,16 +446,16 @@ const ot = (h, t, e) => {
|
|
|
446
446
|
e += n;
|
|
447
447
|
}
|
|
448
448
|
return e.trim() && t.push(e.trim()), t;
|
|
449
|
-
}, dt = (
|
|
450
|
-
const e = new RegExp(`${t}\\s*\\(`, "i"), i =
|
|
449
|
+
}, dt = (p, t) => {
|
|
450
|
+
const e = new RegExp(`${t}\\s*\\(`, "i"), i = p.match(e);
|
|
451
451
|
if (!i) return null;
|
|
452
452
|
const s = i.index + i[0].length;
|
|
453
453
|
let n = 1, o = s;
|
|
454
|
-
for (let a = s; a <
|
|
455
|
-
|
|
456
|
-
return n === 0 ?
|
|
457
|
-
},
|
|
458
|
-
const t =
|
|
454
|
+
for (let a = s; a < p.length && n > 0; a++)
|
|
455
|
+
p[a] === "(" ? n++ : p[a] === ")" && n--, o = a;
|
|
456
|
+
return n === 0 ? p.substring(s, o) : null;
|
|
457
|
+
}, Vt = (p) => {
|
|
458
|
+
const t = p.split(" ")[0].toLowerCase();
|
|
459
459
|
return [
|
|
460
460
|
"circle",
|
|
461
461
|
"ellipse",
|
|
@@ -466,33 +466,33 @@ const ot = (h, t, e) => {
|
|
|
466
466
|
"at",
|
|
467
467
|
"contain",
|
|
468
468
|
"cover"
|
|
469
|
-
].includes(t) ? !1 : /^#[0-9a-f]{3,8}$/i.test(t) || /^rgb/i.test(
|
|
470
|
-
}, pt = (
|
|
469
|
+
].includes(t) ? !1 : /^#[0-9a-f]{3,8}$/i.test(t) || /^rgb/i.test(p) || /^hsl/i.test(p) || Nt(t);
|
|
470
|
+
}, pt = (p) => {
|
|
471
471
|
const t = [];
|
|
472
|
-
return
|
|
472
|
+
return p.forEach((e, i) => {
|
|
473
473
|
const s = e.trim();
|
|
474
474
|
if (!s) return;
|
|
475
475
|
let n = "", o = 0;
|
|
476
476
|
const a = s.match(/^(.+?)\s+(\d+(?:\.\d+)?)%?\s*$/);
|
|
477
|
-
a &&
|
|
478
|
-
const l =
|
|
477
|
+
a && yt(a[1].trim()) ? (n = a[1].trim(), o = parseFloat(a[2])) : (n = s, o = p.length === 1 ? 0 : i / (p.length - 1) * 100);
|
|
478
|
+
const l = Et(n);
|
|
479
479
|
l.position = Math.max(0, Math.min(100, Math.round(o))), t.push(l);
|
|
480
480
|
}), t;
|
|
481
|
-
}, A = (
|
|
482
|
-
const t =
|
|
481
|
+
}, A = (p) => {
|
|
482
|
+
const t = p.stops && p.stops.length ? p.stops : [{ color: "#000000", position: 0, opacity: 100 }];
|
|
483
483
|
return {
|
|
484
|
-
type:
|
|
485
|
-
angle: typeof
|
|
484
|
+
type: p.type && ["linear", "radial", "solid"].includes(p.type) ? p.type : "linear",
|
|
485
|
+
angle: typeof p.angle == "number" ? p.angle : 90,
|
|
486
486
|
stops: t.map((e, i) => ({
|
|
487
487
|
color: e.color || "#000000",
|
|
488
488
|
position: typeof e.position == "number" ? e.position : t.length === 1 ? 0 : Math.round(i / (t.length - 1) * 100),
|
|
489
489
|
opacity: e.opacity === void 0 || Number.isNaN(e.opacity) ? 100 : e.opacity
|
|
490
490
|
}))
|
|
491
491
|
};
|
|
492
|
-
}, T = (
|
|
493
|
-
const t =
|
|
494
|
-
if (
|
|
495
|
-
const s =
|
|
492
|
+
}, T = (p) => {
|
|
493
|
+
const t = p.replace(/;$/, "").trim();
|
|
494
|
+
if (St(t)) {
|
|
495
|
+
const s = Et(t);
|
|
496
496
|
return A({ type: "solid", angle: 0, stops: [s] });
|
|
497
497
|
}
|
|
498
498
|
const e = dt(t, "linear-gradient");
|
|
@@ -518,25 +518,25 @@ const ot = (h, t, e) => {
|
|
|
518
518
|
}
|
|
519
519
|
const i = dt(t, "radial-gradient");
|
|
520
520
|
if (i) {
|
|
521
|
-
const s = ht(i), n = s[0] && !
|
|
521
|
+
const s = ht(i), n = s[0] && !Vt(s[0]) ? s.slice(1) : s, o = pt(n);
|
|
522
522
|
return o.length ? A({ type: "radial", angle: 0, stops: o }) : null;
|
|
523
523
|
}
|
|
524
524
|
return null;
|
|
525
|
-
}, S = (
|
|
526
|
-
if (
|
|
527
|
-
const e =
|
|
525
|
+
}, S = (p) => {
|
|
526
|
+
if (p.type === "solid") {
|
|
527
|
+
const e = p.stops[0], i = e.color;
|
|
528
528
|
if (i.startsWith("var(--"))
|
|
529
529
|
return i;
|
|
530
530
|
const s = e.opacity ?? 100, n = i.replace("#", ""), o = Math.round(s / 100 * 255).toString(16).toUpperCase().padStart(2, "0");
|
|
531
531
|
return `#${n}${o}`;
|
|
532
532
|
}
|
|
533
|
-
const t =
|
|
533
|
+
const t = p.stops.map(
|
|
534
534
|
(e) => `${st(e.color, e.opacity ?? 100)} ${e.position}%`
|
|
535
535
|
).join(", ");
|
|
536
|
-
return
|
|
537
|
-
},
|
|
538
|
-
if (
|
|
539
|
-
const t =
|
|
536
|
+
return p.type === "radial" ? `radial-gradient(circle, ${t})` : `linear-gradient(${p.angle}deg, ${t})`;
|
|
537
|
+
}, Tt = (p) => Math.round(p / 100 * 255).toString(16).toUpperCase().padStart(2, "0"), K = (p) => {
|
|
538
|
+
if (p.type === "solid") {
|
|
539
|
+
const t = p.stops[0];
|
|
540
540
|
if (t) {
|
|
541
541
|
const e = t.color;
|
|
542
542
|
if (e.startsWith("var(--"))
|
|
@@ -546,13 +546,13 @@ const ot = (h, t, e) => {
|
|
|
546
546
|
if (i === 100)
|
|
547
547
|
return e;
|
|
548
548
|
{
|
|
549
|
-
const s =
|
|
549
|
+
const s = Tt(i);
|
|
550
550
|
return `${e}${s}`;
|
|
551
551
|
}
|
|
552
552
|
}
|
|
553
553
|
return "#000000";
|
|
554
554
|
}
|
|
555
|
-
return
|
|
555
|
+
return p.type === "linear" ? `Linear ${p.angle}°` : "Radial Gradient";
|
|
556
556
|
}, q = class q {
|
|
557
557
|
static defaults() {
|
|
558
558
|
return {
|
|
@@ -563,7 +563,7 @@ const ot = (h, t, e) => {
|
|
|
563
563
|
static normalizeList(t) {
|
|
564
564
|
const e = /* @__PURE__ */ new Set(), i = [];
|
|
565
565
|
return t.forEach((s) => {
|
|
566
|
-
let n =
|
|
566
|
+
let n = G(s);
|
|
567
567
|
n || T(s) && (n = s), n && (e.has(n) || (e.add(n), i.push(n)));
|
|
568
568
|
}), i.slice(0, this.MAX_COLORS);
|
|
569
569
|
}
|
|
@@ -609,7 +609,7 @@ const ot = (h, t, e) => {
|
|
|
609
609
|
}
|
|
610
610
|
static addColor(t, e) {
|
|
611
611
|
if (!t) return;
|
|
612
|
-
let i =
|
|
612
|
+
let i = G(t), s = "solid";
|
|
613
613
|
if (i)
|
|
614
614
|
s = "solid";
|
|
615
615
|
else {
|
|
@@ -623,7 +623,7 @@ const ot = (h, t, e) => {
|
|
|
623
623
|
};
|
|
624
624
|
q.STORAGE_KEY = "settingsLib_recentColors", q.MAX_COLORS = 12, q.colors = null;
|
|
625
625
|
let R = q;
|
|
626
|
-
const at = (
|
|
626
|
+
const at = (p, t) => {
|
|
627
627
|
const e = document.createElement("div");
|
|
628
628
|
e.className = "color-picker-recent-section";
|
|
629
629
|
const i = document.createElement("div");
|
|
@@ -632,9 +632,9 @@ const at = (h, t) => {
|
|
|
632
632
|
s.className = "color-picker-tooltip", s.style.display = "none", e.appendChild(s);
|
|
633
633
|
const n = () => {
|
|
634
634
|
s.style.display = "none";
|
|
635
|
-
}, o = (c,
|
|
636
|
-
const
|
|
637
|
-
s.textContent =
|
|
635
|
+
}, o = (c, d) => {
|
|
636
|
+
const h = c.getBoundingClientRect();
|
|
637
|
+
s.textContent = d, s.style.left = `${h.left + h.width / 2}px`, s.style.top = `${h.bottom + 8}px`, s.style.display = "block";
|
|
638
638
|
}, a = document.createElement("div");
|
|
639
639
|
a.className = "color-picker-recent-grid";
|
|
640
640
|
const l = document.createElement("div");
|
|
@@ -646,51 +646,51 @@ const at = (h, t) => {
|
|
|
646
646
|
a.style.display = "none", l.style.display = "block";
|
|
647
647
|
return;
|
|
648
648
|
}
|
|
649
|
-
a.style.display = "grid", l.style.display = "none", c.forEach((
|
|
650
|
-
const
|
|
651
|
-
|
|
652
|
-
const g =
|
|
653
|
-
if (
|
|
654
|
-
|
|
655
|
-
const m = T(
|
|
656
|
-
m && m.stops && m.stops.length > 0 && (
|
|
649
|
+
a.style.display = "grid", l.style.display = "none", c.forEach((d) => {
|
|
650
|
+
const h = document.createElement("button");
|
|
651
|
+
h.type = "button", h.className = "color-picker-recent-swatch";
|
|
652
|
+
const g = Pt(d);
|
|
653
|
+
if (h.title = g, h.setAttribute("aria-label", `Use color: ${g}`), d.includes("gradient(")) {
|
|
654
|
+
h.style.backgroundImage = d, h.style.backgroundColor = "transparent";
|
|
655
|
+
const m = T(d);
|
|
656
|
+
m && m.stops && m.stops.length > 0 && (h.style.borderColor = m.stops[0].color);
|
|
657
657
|
} else
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
n(),
|
|
661
|
-
}),
|
|
662
|
-
|
|
663
|
-
}),
|
|
658
|
+
h.style.backgroundColor = d, h.style.borderColor = d;
|
|
659
|
+
h.addEventListener("mouseenter", () => o(h, g)), h.addEventListener("mouseleave", () => {
|
|
660
|
+
n(), h.style.boxShadow = "";
|
|
661
|
+
}), h.addEventListener("mousedown", () => {
|
|
662
|
+
h.style.boxShadow = "0px 0px 0px 2px var(--grey40)";
|
|
663
|
+
}), h.addEventListener("mouseup", () => {
|
|
664
664
|
setTimeout(() => {
|
|
665
|
-
|
|
665
|
+
h.style.boxShadow = "";
|
|
666
666
|
}, 150);
|
|
667
|
-
}),
|
|
668
|
-
n(),
|
|
669
|
-
}), a.appendChild(
|
|
667
|
+
}), h.addEventListener("click", () => {
|
|
668
|
+
n(), p(d);
|
|
669
|
+
}), a.appendChild(h);
|
|
670
670
|
});
|
|
671
671
|
};
|
|
672
672
|
return r(), { container: e, refresh: r };
|
|
673
|
-
},
|
|
674
|
-
const t = T(
|
|
673
|
+
}, Pt = (p) => {
|
|
674
|
+
const t = T(p);
|
|
675
675
|
if (t)
|
|
676
676
|
return K(t);
|
|
677
|
-
const e =
|
|
677
|
+
const e = G(p);
|
|
678
678
|
if (e) {
|
|
679
679
|
const i = P(e);
|
|
680
680
|
return `${e} (RGB: ${i.r}, ${i.g}, ${i.b})`;
|
|
681
681
|
}
|
|
682
|
-
return
|
|
683
|
-
},
|
|
682
|
+
return p;
|
|
683
|
+
}, bt = `<svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
684
684
|
<path fill-rule="evenodd" clip-rule="evenodd"
|
|
685
685
|
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"
|
|
686
686
|
fill="#919EAB"/>
|
|
687
|
-
</svg>`,
|
|
687
|
+
</svg>`, wt = `<svg width="23" height="23" viewBox="0 0 23 23" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
688
688
|
<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"/>
|
|
689
|
-
</svg>`,
|
|
689
|
+
</svg>`, Ot = `<svg width="15" height="17" viewBox="0 0 15 17" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
690
690
|
<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"/>
|
|
691
|
-
</svg>`,
|
|
691
|
+
</svg>`, Ht = `<svg width="14" height="2" viewBox="0 0 14 2" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
692
692
|
<path d="M0.8 0.800003H12.4667" stroke="#919EAB" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>
|
|
693
|
-
</svg>`,
|
|
693
|
+
</svg>`, Bt = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
694
694
|
<rect x="21.25" y="21.333" width="18" height="18" rx="1" transform="rotate(-180 21.25 21.333)" stroke="#637381"/>
|
|
695
695
|
<rect x="18.5835" y="18.667" width="12.6667" height="12.6667" rx="1" transform="rotate(-180 18.5835 18.667)" fill="#637381"/>
|
|
696
696
|
</svg>
|
|
@@ -700,7 +700,7 @@ const at = (h, t) => {
|
|
|
700
700
|
<path d="M13.5 16.5L10.5 16.5L10.5 13.5L13.5 13.5L13.5 16.5ZM13.5 10.5L10.5 10.5L10.5 7.5L13.5 7.5L13.5 10.5ZM10.5 13.5L7.5 13.5L7.5 10.5L10.5 10.5L10.5 13.5Z" fill="#637381"/>
|
|
701
701
|
</svg>
|
|
702
702
|
|
|
703
|
-
`,
|
|
703
|
+
`, At = `<svg width="26" height="26" viewBox="0 0 26 26" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
704
704
|
<path d="M20.6106 19.5062C20.6887 19.5843 20.6887 19.711 20.6106 19.7891L19.7896 20.6101C19.7115 20.6882 19.5848 20.6882 19.5067 20.6101L5.98957 7.09298C5.91146 7.01488 5.91146 6.88825 5.98957 6.81014L6.81063 5.98908C6.88873 5.91097 7.01537 5.91097 7.09347 5.98908L20.6106 19.5062Z" fill="#46525C"/>
|
|
705
705
|
<path d="M9.69583 12.2146C9.81298 12.3318 9.81298 12.5217 9.69583 12.6389L7.80151 14.5332C6.72071 15.614 6.6062 17.4365 7.80151 18.6318C8.99473 19.8267 10.8184 19.7123 11.8992 18.6318L13.7935 16.7366C13.9106 16.6194 14.1006 16.6194 14.2178 16.7366L14.816 17.3348C14.9331 17.4519 14.9332 17.6418 14.816 17.759L12.9216 19.6543C11.2241 21.3536 8.47364 21.3518 6.77417 19.6543C5.07483 17.9568 5.0749 15.2064 6.77417 13.5068L8.66848 11.6116C8.78563 11.4944 8.97562 11.4944 9.0928 11.6116L9.69583 12.2146ZM13.5085 6.77441C15.2061 5.07514 17.9565 5.07509 19.656 6.77441C21.3535 8.47388 21.3533 11.2243 19.656 12.9238L17.7607 14.8182C17.6436 14.9354 17.4536 14.9353 17.3365 14.8182L16.7344 14.2161C16.6172 14.0989 16.6172 13.9089 16.7344 13.7918L18.6296 11.8975C19.7101 10.8167 19.8245 8.99503 18.6296 7.7998C17.4363 6.60449 15.6118 6.719 14.531 7.7998L12.6367 9.69412C12.5195 9.81128 12.3296 9.81128 12.2124 9.69412L11.6123 9.09402C11.4952 8.97684 11.4952 8.78685 11.6124 8.6697L13.5085 6.77441Z" fill="#46525C"/>
|
|
706
706
|
</svg>
|
|
@@ -747,7 +747,7 @@ class ut {
|
|
|
747
747
|
const i = document.createElement("span");
|
|
748
748
|
i.textContent = "Color";
|
|
749
749
|
const s = document.createElement("button");
|
|
750
|
-
s.className = "color-picker-close", s.innerHTML =
|
|
750
|
+
s.className = "color-picker-close", s.innerHTML = bt, s.addEventListener("click", () => this.close(!0)), e.appendChild(i), e.appendChild(s), ot(e, t);
|
|
751
751
|
const n = document.createElement("div");
|
|
752
752
|
n.className = "color-picker-area", this.colorArea = n;
|
|
753
753
|
const o = document.createElement("div");
|
|
@@ -755,82 +755,82 @@ class ut {
|
|
|
755
755
|
const a = document.createElement("div");
|
|
756
756
|
a.className = "color-picker-sliders-container";
|
|
757
757
|
const l = document.createElement("button");
|
|
758
|
-
l.className = "color-picker-eyedropper", l.type = "button", l.innerHTML =
|
|
758
|
+
l.className = "color-picker-eyedropper", l.type = "button", l.innerHTML = wt;
|
|
759
759
|
const r = document.createElement("div");
|
|
760
760
|
r.className = "color-picker-sliders-group";
|
|
761
761
|
const c = document.createElement("div");
|
|
762
762
|
c.className = "color-picker-hue", this.hueSlider = c;
|
|
763
|
-
const p = document.createElement("div");
|
|
764
|
-
p.className = "color-picker-hue-marker", this.hueMarker = p, c.appendChild(p);
|
|
765
763
|
const d = document.createElement("div");
|
|
766
|
-
d.className = "color-picker-
|
|
764
|
+
d.className = "color-picker-hue-marker", this.hueMarker = d, c.appendChild(d);
|
|
765
|
+
const h = document.createElement("div");
|
|
766
|
+
h.className = "color-picker-opacity", this.opacitySlider = h;
|
|
767
767
|
const g = document.createElement("div");
|
|
768
|
-
g.className = "color-picker-opacity-marker", this.opacityMarker = g,
|
|
769
|
-
const
|
|
770
|
-
var
|
|
771
|
-
this.setColor(E), (
|
|
768
|
+
g.className = "color-picker-opacity-marker", this.opacityMarker = g, h.appendChild(g), r.appendChild(c), r.appendChild(h), a.appendChild(l), a.appendChild(r);
|
|
769
|
+
const f = at((E) => {
|
|
770
|
+
var b;
|
|
771
|
+
this.setColor(E), (b = this.onChange) == null || b.call(this, E, this.currentOpacity);
|
|
772
772
|
}, this.recentScope);
|
|
773
|
-
this.recentSectionRefresh =
|
|
773
|
+
this.recentSectionRefresh = f.refresh;
|
|
774
774
|
const m = document.createElement("div");
|
|
775
775
|
m.className = "color-picker-format-section";
|
|
776
776
|
const u = document.createElement("select");
|
|
777
777
|
u.className = "color-picker-format-select", this.select = u;
|
|
778
|
-
const
|
|
779
|
-
|
|
778
|
+
const C = document.createElement("option");
|
|
779
|
+
C.value = "hex", C.textContent = "HEX";
|
|
780
780
|
const v = document.createElement("option");
|
|
781
781
|
v.value = "rgb", v.textContent = "RGB";
|
|
782
782
|
const y = document.createElement("option");
|
|
783
|
-
y.value = "hsl", y.textContent = "HSL", u.appendChild(
|
|
784
|
-
const
|
|
785
|
-
|
|
786
|
-
const
|
|
787
|
-
|
|
783
|
+
y.value = "hsl", y.textContent = "HSL", u.appendChild(C), u.appendChild(v), u.appendChild(y);
|
|
784
|
+
const x = document.createElement("input");
|
|
785
|
+
x.type = "text", x.className = "color-picker-color-input", x.value = this.currentColor, this.input = x;
|
|
786
|
+
const k = document.createElement("div");
|
|
787
|
+
k.className = "color-picker-input-container";
|
|
788
788
|
const N = document.createElement("button");
|
|
789
|
-
return N.className = "color-picker-copy-inside", N.textContent = "Copy",
|
|
789
|
+
return N.className = "color-picker-copy-inside", N.textContent = "Copy", k.appendChild(x), k.appendChild(N), m.appendChild(u), m.appendChild(k), t.appendChild(e), t.appendChild(n), t.appendChild(a), t.appendChild(f.container), t.appendChild(m), t.addEventListener("click", (E) => E.stopPropagation()), this.bind(n, c, h, x, u, N, l), t;
|
|
790
790
|
}
|
|
791
791
|
createBackdrop() {
|
|
792
792
|
const t = document.createElement("div");
|
|
793
793
|
return t.className = "color-picker-backdrop", t.style.display = "none", t.style.pointerEvents = "none", t;
|
|
794
794
|
}
|
|
795
795
|
bind(t, e, i, s, n, o, a) {
|
|
796
|
-
const l = (
|
|
796
|
+
const l = (d) => {
|
|
797
797
|
var v;
|
|
798
|
-
const
|
|
799
|
-
this.colorMarker.style.left = `${g * 100}%`, this.colorMarker.style.top = `${
|
|
800
|
-
const u = this.parsePercentage(this.hueMarker.style.left || "0%") * 360,
|
|
801
|
-
this.currentColor =
|
|
802
|
-
}, r = (
|
|
798
|
+
const h = t.getBoundingClientRect(), g = Math.max(0, Math.min(1, (d.clientX - h.left) / h.width)), f = Math.max(0, Math.min(1, (d.clientY - h.top) / h.height));
|
|
799
|
+
this.colorMarker.style.left = `${g * 100}%`, this.colorMarker.style.top = `${f * 100}%`;
|
|
800
|
+
const u = this.parsePercentage(this.hueMarker.style.left || "0%") * 360, C = W(u, g, 1 - f);
|
|
801
|
+
this.currentColor = C, this.syncInput(), this.updateOpacityBg(), (v = this.onChange) == null || v.call(this, C, this.currentOpacity);
|
|
802
|
+
}, r = (d) => {
|
|
803
803
|
var v;
|
|
804
|
-
const
|
|
805
|
-
let g = Math.max(0, Math.min(1, (
|
|
804
|
+
const h = e.getBoundingClientRect();
|
|
805
|
+
let g = Math.max(0, Math.min(1, (d.clientX - h.left) / h.width));
|
|
806
806
|
this.hueMarker.style.left = `${g * 100}%`;
|
|
807
|
-
const
|
|
808
|
-
this.currentColor =
|
|
809
|
-
}, c = (
|
|
810
|
-
var
|
|
811
|
-
const
|
|
812
|
-
this.opacityMarker.style.left = `${g * 100}%`, this.currentOpacity = Math.round(g * 100), (
|
|
807
|
+
const f = g * 360, m = this.parsePercentage(this.colorMarker.style.left || "0%"), u = this.parsePercentage(this.colorMarker.style.top || "0%"), C = W(f, m, 1 - u);
|
|
808
|
+
this.currentColor = C, this.colorArea.style.background = `linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${f}, 100%, 50%))`, this.syncInput(), this.updateOpacityBg(), (v = this.onChange) == null || v.call(this, C, this.currentOpacity);
|
|
809
|
+
}, c = (d) => {
|
|
810
|
+
var f;
|
|
811
|
+
const h = i.getBoundingClientRect(), g = Math.max(0, Math.min(1, (d.clientX - h.left) / h.width));
|
|
812
|
+
this.opacityMarker.style.left = `${g * 100}%`, this.currentOpacity = Math.round(g * 100), (f = this.onChange) == null || f.call(this, this.currentColor, this.currentOpacity);
|
|
813
813
|
};
|
|
814
|
-
t.addEventListener("mousedown", (
|
|
815
|
-
|
|
816
|
-
const
|
|
817
|
-
document.removeEventListener("mousemove",
|
|
814
|
+
t.addEventListener("mousedown", (d) => {
|
|
815
|
+
d.preventDefault(), l(d);
|
|
816
|
+
const h = (f) => l(f), g = () => {
|
|
817
|
+
document.removeEventListener("mousemove", h), document.removeEventListener("mouseup", g);
|
|
818
818
|
};
|
|
819
|
-
document.addEventListener("mousemove",
|
|
820
|
-
}), e.addEventListener("mousedown", (
|
|
821
|
-
|
|
822
|
-
const
|
|
823
|
-
document.removeEventListener("mousemove",
|
|
819
|
+
document.addEventListener("mousemove", h), document.addEventListener("mouseup", g);
|
|
820
|
+
}), e.addEventListener("mousedown", (d) => {
|
|
821
|
+
d.preventDefault(), r(d);
|
|
822
|
+
const h = (f) => r(f), g = () => {
|
|
823
|
+
document.removeEventListener("mousemove", h), document.removeEventListener("mouseup", g);
|
|
824
824
|
};
|
|
825
|
-
document.addEventListener("mousemove",
|
|
826
|
-
}), i.addEventListener("mousedown", (
|
|
827
|
-
|
|
828
|
-
const
|
|
829
|
-
document.removeEventListener("mousemove",
|
|
825
|
+
document.addEventListener("mousemove", h), document.addEventListener("mouseup", g);
|
|
826
|
+
}), i.addEventListener("mousedown", (d) => {
|
|
827
|
+
d.preventDefault(), c(d);
|
|
828
|
+
const h = (f) => c(f), g = () => {
|
|
829
|
+
document.removeEventListener("mousemove", h), document.removeEventListener("mouseup", g);
|
|
830
830
|
};
|
|
831
|
-
document.addEventListener("mousemove",
|
|
832
|
-
}), n.addEventListener("change", () => this.syncInput()), s.addEventListener("input", () => this.applyFromInput()), s.addEventListener("blur", () => this.syncInput()), s.addEventListener("keydown", (
|
|
833
|
-
|
|
831
|
+
document.addEventListener("mousemove", h), document.addEventListener("mouseup", g);
|
|
832
|
+
}), n.addEventListener("change", () => this.syncInput()), s.addEventListener("input", () => this.applyFromInput()), s.addEventListener("blur", () => this.syncInput()), s.addEventListener("keydown", (d) => {
|
|
833
|
+
d.key === "Enter" && (d.preventDefault(), this.syncInput(), s.blur());
|
|
834
834
|
}), o.addEventListener("click", async () => {
|
|
835
835
|
try {
|
|
836
836
|
await navigator.clipboard.writeText(s.value);
|
|
@@ -838,14 +838,14 @@ class ut {
|
|
|
838
838
|
s.select(), document.execCommand("copy");
|
|
839
839
|
}
|
|
840
840
|
}), a.addEventListener("click", async () => {
|
|
841
|
-
var
|
|
841
|
+
var d;
|
|
842
842
|
if (!("EyeDropper" in window)) {
|
|
843
843
|
alert("EyeDropper API is not supported in this browser.");
|
|
844
844
|
return;
|
|
845
845
|
}
|
|
846
846
|
try {
|
|
847
|
-
const
|
|
848
|
-
this.setColor(g), (
|
|
847
|
+
const h = new window.EyeDropper(), { sRGBHex: g } = await h.open();
|
|
848
|
+
this.setColor(g), (d = this.onChange) == null || d.call(this, g, this.currentOpacity);
|
|
849
849
|
} catch {
|
|
850
850
|
}
|
|
851
851
|
}), document.addEventListener("keydown", this.keyDown, !0), setTimeout(
|
|
@@ -866,7 +866,7 @@ class ut {
|
|
|
866
866
|
const { r: n, g: o, b: a } = P(this.currentColor);
|
|
867
867
|
this.input.value = `rgb(${n}, ${o}, ${a})`;
|
|
868
868
|
} else {
|
|
869
|
-
const { hue: n, sat: o, lightness: a } =
|
|
869
|
+
const { hue: n, sat: o, lightness: a } = Ct(e, i, s);
|
|
870
870
|
this.input.value = `hsl(${Math.round(n)}, ${Math.round(
|
|
871
871
|
o * 100
|
|
872
872
|
)}%, ${Math.round(a * 100)}%)`;
|
|
@@ -903,12 +903,12 @@ class ut {
|
|
|
903
903
|
this.currentColor = t, this.currentOpacity = i ?? 100, this.syncInput();
|
|
904
904
|
const { h: s, s: n, v: o } = U(t);
|
|
905
905
|
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);
|
|
906
|
-
const a = this.element.offsetWidth, l = this.element.offsetHeight, r = e.getBoundingClientRect(), c = window.innerWidth,
|
|
907
|
-
let g = r.right + 8,
|
|
906
|
+
const a = this.element.offsetWidth, l = this.element.offsetHeight, r = e.getBoundingClientRect(), c = window.innerWidth, d = window.innerHeight, h = 16;
|
|
907
|
+
let g = r.right + 8, f = r.top;
|
|
908
908
|
const m = c - r.right, u = r.left;
|
|
909
|
-
m >= a +
|
|
910
|
-
const
|
|
911
|
-
|
|
909
|
+
m >= a + h ? g = r.right + 8 : u >= a + h ? g = r.left - a - 8 : g = Math.max(h, (c - a) / 2);
|
|
910
|
+
const C = d - r.bottom, v = r.top;
|
|
911
|
+
C >= l + h ? f = r.bottom + 8 : v >= l + h ? f = r.top - l - 8 : C > v ? (f = r.bottom + 8, f + l > d - h && (f = d - l - h)) : (f = r.top - l - 8, f < h && (f = h)), this.element.style.left = `${g}px`, this.element.style.top = `${f}px`;
|
|
912
912
|
}
|
|
913
913
|
close(t) {
|
|
914
914
|
var e;
|
|
@@ -918,7 +918,7 @@ class ut {
|
|
|
918
918
|
return this.element;
|
|
919
919
|
}
|
|
920
920
|
}
|
|
921
|
-
class
|
|
921
|
+
class Dt {
|
|
922
922
|
constructor(t) {
|
|
923
923
|
this.isDragging = !1, this.currentColor = "#FFFFFF", this.currentColor = this.sanitizeColor(t.initialColor), this.currentOpacity = this.clampOpacity(t.initialOpacity), this.onColorChange = t.onColorChange, this.recentScope = t.scope ?? "solid", this.element = this.build(), this.initFromColor(this.currentColor, this.currentOpacity);
|
|
924
924
|
}
|
|
@@ -928,7 +928,7 @@ class Bt {
|
|
|
928
928
|
}
|
|
929
929
|
sanitizeColor(t) {
|
|
930
930
|
const e = this.currentColor || "#FFFFFF";
|
|
931
|
-
return
|
|
931
|
+
return G(t) ?? e;
|
|
932
932
|
}
|
|
933
933
|
clampOpacity(t) {
|
|
934
934
|
return Number.isFinite(t) ? Math.min(100, Math.max(0, Math.round(t))) : 100;
|
|
@@ -943,7 +943,7 @@ class Bt {
|
|
|
943
943
|
const s = document.createElement("div");
|
|
944
944
|
s.className = "color-picker-sliders-container embedded";
|
|
945
945
|
const n = document.createElement("button");
|
|
946
|
-
n.className = "color-picker-eyedropper", n.type = "button", n.innerHTML =
|
|
946
|
+
n.className = "color-picker-eyedropper", n.type = "button", n.innerHTML = wt;
|
|
947
947
|
const o = document.createElement("div");
|
|
948
948
|
o.className = "color-picker-sliders-group";
|
|
949
949
|
const a = document.createElement("div");
|
|
@@ -954,47 +954,47 @@ class Bt {
|
|
|
954
954
|
r.className = "color-picker-opacity embedded", this.opacitySlider = r;
|
|
955
955
|
const c = document.createElement("div");
|
|
956
956
|
c.className = "color-picker-opacity-marker", this.opacityMarker = c, r.appendChild(c), o.appendChild(a), o.appendChild(r), s.appendChild(n), s.appendChild(o);
|
|
957
|
-
const
|
|
958
|
-
const
|
|
959
|
-
|
|
957
|
+
const d = at((x) => {
|
|
958
|
+
const k = T(x);
|
|
959
|
+
k && k.type !== "solid" ? this.onColorChange(x, this.currentOpacity) : (this.setColor(x), this.onColorChange(this.currentColor, this.currentOpacity));
|
|
960
960
|
}, "all");
|
|
961
|
-
this.recentSectionRefresh =
|
|
962
|
-
const
|
|
963
|
-
|
|
961
|
+
this.recentSectionRefresh = d.refresh;
|
|
962
|
+
const h = document.createElement("div");
|
|
963
|
+
h.className = "color-picker-format-section embedded";
|
|
964
964
|
const g = document.createElement("select");
|
|
965
965
|
g.className = "color-picker-format-select", this.select = g;
|
|
966
|
-
const
|
|
967
|
-
|
|
966
|
+
const f = document.createElement("option");
|
|
967
|
+
f.value = "hex", f.textContent = "HEX";
|
|
968
968
|
const m = document.createElement("option");
|
|
969
969
|
m.value = "rgb", m.textContent = "RGB";
|
|
970
970
|
const u = document.createElement("option");
|
|
971
|
-
u.value = "hsl", u.textContent = "HSL", g.appendChild(
|
|
972
|
-
const
|
|
973
|
-
|
|
971
|
+
u.value = "hsl", u.textContent = "HSL", g.appendChild(f), g.appendChild(m), g.appendChild(u);
|
|
972
|
+
const C = document.createElement("input");
|
|
973
|
+
C.type = "text", C.className = "color-picker-color-input", this.input = C;
|
|
974
974
|
const v = document.createElement("div");
|
|
975
975
|
v.className = "color-picker-input-container";
|
|
976
976
|
const y = document.createElement("button");
|
|
977
|
-
return y.className = "color-picker-copy-inside", y.textContent = "Copy", v.appendChild(
|
|
977
|
+
return y.className = "color-picker-copy-inside", y.textContent = "Copy", v.appendChild(C), v.appendChild(y), h.appendChild(g), h.appendChild(v), t.appendChild(e), t.appendChild(s), t.appendChild(h), t.appendChild(d.container), this.bind(e, a, r, C, g, y, n), t;
|
|
978
978
|
}
|
|
979
979
|
bind(t, e, i, s, n, o, a) {
|
|
980
|
-
const l = (
|
|
981
|
-
const
|
|
980
|
+
const l = (h, g) => {
|
|
981
|
+
const f = g || t.getBoundingClientRect(), m = Math.max(0, Math.min(1, (h.clientX - f.left) / f.width)), u = Math.max(0, Math.min(1, (h.clientY - f.top) / f.height));
|
|
982
982
|
this.colorMarker.style.left = `${m * 100}%`, this.colorMarker.style.top = `${u * 100}%`;
|
|
983
983
|
const v = this.parsePercentage(this.hueMarker.style.left || "0%") * 360, y = W(v, m, 1 - u);
|
|
984
984
|
this.currentColor = y, this.syncInput(), this.updateOpacityBg(), this.queueChange();
|
|
985
|
-
}, r = (
|
|
986
|
-
const
|
|
985
|
+
}, r = (h, g) => {
|
|
986
|
+
const f = g || e.getBoundingClientRect(), m = Math.max(0, Math.min(1, (h.clientX - f.left) / f.width));
|
|
987
987
|
this.hueMarker.style.left = `${m * 100}%`;
|
|
988
|
-
const u = m * 360,
|
|
988
|
+
const u = m * 360, C = this.parsePercentage(this.colorMarker.style.left || "0%"), v = this.parsePercentage(this.colorMarker.style.top || "0%"), y = W(u, C, 1 - v);
|
|
989
989
|
this.currentColor = y, this.colorArea.style.background = `linear-gradient(to top, #000, transparent),
|
|
990
990
|
linear-gradient(to right, #fff, hsl(${u}, 100%, 50%))`, this.syncInput(), this.updateOpacityBg(), this.queueChange();
|
|
991
|
-
}, c = (
|
|
992
|
-
const
|
|
991
|
+
}, c = (h, g) => {
|
|
992
|
+
const f = g || i.getBoundingClientRect(), m = Math.max(0, Math.min(1, (h.clientX - f.left) / f.width));
|
|
993
993
|
this.opacityMarker.style.left = `${m * 100}%`, this.currentOpacity = this.clampOpacity(m * 100), this.queueChange();
|
|
994
|
-
},
|
|
995
|
-
|
|
994
|
+
}, d = (h, g, f) => {
|
|
995
|
+
h.preventDefault(), this.isDragging = !0, this.cachedRect = f.getBoundingClientRect(), g(h, this.cachedRect);
|
|
996
996
|
let m = null, u;
|
|
997
|
-
const
|
|
997
|
+
const C = () => {
|
|
998
998
|
this.dragRafId === void 0 && (this.dragRafId = window.requestAnimationFrame(() => {
|
|
999
999
|
this.dragRafId = void 0, m && this.cachedRect && g(m, this.cachedRect);
|
|
1000
1000
|
}));
|
|
@@ -1006,23 +1006,23 @@ class Bt {
|
|
|
1006
1006
|
v();
|
|
1007
1007
|
return;
|
|
1008
1008
|
}
|
|
1009
|
-
m = y,
|
|
1009
|
+
m = y, C();
|
|
1010
1010
|
}, document.addEventListener("mousemove", u), document.addEventListener("mouseup", v), window.addEventListener("blur", v);
|
|
1011
1011
|
};
|
|
1012
|
-
t.addEventListener("mousedown", (
|
|
1013
|
-
|
|
1014
|
-
}), e.addEventListener("mousedown", (
|
|
1015
|
-
|
|
1016
|
-
}), i.addEventListener("mousedown", (
|
|
1017
|
-
|
|
1012
|
+
t.addEventListener("mousedown", (h) => {
|
|
1013
|
+
d(h, l, t);
|
|
1014
|
+
}), e.addEventListener("mousedown", (h) => {
|
|
1015
|
+
d(h, r, e);
|
|
1016
|
+
}), i.addEventListener("mousedown", (h) => {
|
|
1017
|
+
d(h, c, i);
|
|
1018
1018
|
}), n.addEventListener("change", () => {
|
|
1019
1019
|
this.syncInput();
|
|
1020
1020
|
}), s.addEventListener("input", () => {
|
|
1021
1021
|
this.applyFromInput();
|
|
1022
1022
|
}), s.addEventListener("blur", () => {
|
|
1023
1023
|
this.syncInput();
|
|
1024
|
-
}), s.addEventListener("keydown", (
|
|
1025
|
-
|
|
1024
|
+
}), s.addEventListener("keydown", (h) => {
|
|
1025
|
+
h.key === "Enter" && (h.preventDefault(), this.syncInput(), s.blur());
|
|
1026
1026
|
}), o.addEventListener("click", async () => {
|
|
1027
1027
|
try {
|
|
1028
1028
|
await navigator.clipboard.writeText(s.value);
|
|
@@ -1035,7 +1035,7 @@ class Bt {
|
|
|
1035
1035
|
return;
|
|
1036
1036
|
}
|
|
1037
1037
|
try {
|
|
1038
|
-
const
|
|
1038
|
+
const h = new window.EyeDropper(), { sRGBHex: g } = await h.open();
|
|
1039
1039
|
this.setColor(g), this.onColorChange(this.currentColor, this.currentOpacity);
|
|
1040
1040
|
} catch {
|
|
1041
1041
|
}
|
|
@@ -1056,7 +1056,7 @@ class Bt {
|
|
|
1056
1056
|
const { r: n, g: o, b: a } = P(this.currentColor);
|
|
1057
1057
|
this.input.value = `rgb(${n}, ${o}, ${a})`;
|
|
1058
1058
|
} else {
|
|
1059
|
-
const { hue: n, sat: o, lightness: a } =
|
|
1059
|
+
const { hue: n, sat: o, lightness: a } = Ct(e, i, s);
|
|
1060
1060
|
this.input.value = `hsl(${Math.round(n)}, ${Math.round(
|
|
1061
1061
|
o * 100
|
|
1062
1062
|
)}%, ${Math.round(a * 100)}%)`;
|
|
@@ -1125,7 +1125,7 @@ class Bt {
|
|
|
1125
1125
|
this.initFromColor(t, e);
|
|
1126
1126
|
}
|
|
1127
1127
|
}
|
|
1128
|
-
const V = class V extends
|
|
1128
|
+
const V = class V extends w {
|
|
1129
1129
|
constructor(t = {}) {
|
|
1130
1130
|
const e = typeof t.default == "string" ? void 0 : t.default;
|
|
1131
1131
|
super({
|
|
@@ -1137,10 +1137,10 @@ const V = class V extends x {
|
|
|
1137
1137
|
angle: "number",
|
|
1138
1138
|
stops: "text"
|
|
1139
1139
|
}, 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) => {
|
|
1140
|
-
var
|
|
1140
|
+
var h;
|
|
1141
1141
|
if (!this.popoverEl || !this.isPopoverOpen) return;
|
|
1142
|
-
const s = i.target, n = this.popoverEl.contains(s), o = (
|
|
1143
|
-
!n && !o && !l && !r && !c && !
|
|
1142
|
+
const s = i.target, n = this.popoverEl.contains(s), o = (h = this.element) == null ? void 0 : h.contains(s), a = document.querySelectorAll(".custom-color-picker"), l = Array.from(a).some((g) => g.contains(s)), r = s.closest(".gstop-color-input, .gradient-mini-preview, .gstop-color-preview"), c = s.classList.contains("color-picker-backdrop"), d = s.classList.contains("gradient-popover-backdrop");
|
|
1143
|
+
!n && !o && !l && !r && !c && !d && this.closePopover();
|
|
1144
1144
|
}, this.handlePopoverKeydown = (i) => {
|
|
1145
1145
|
if (this.isPopoverOpen) {
|
|
1146
1146
|
if (i.key === "Escape") {
|
|
@@ -1158,7 +1158,7 @@ const V = class V extends x {
|
|
|
1158
1158
|
resolveGlobalVarColor(t) {
|
|
1159
1159
|
if (t.startsWith("var(--")) {
|
|
1160
1160
|
const e = t.replace("var(--", "").replace(")", "");
|
|
1161
|
-
return (
|
|
1161
|
+
return (w.GlobalVariables || {})[e] || t;
|
|
1162
1162
|
}
|
|
1163
1163
|
return t;
|
|
1164
1164
|
}
|
|
@@ -1288,7 +1288,7 @@ const V = class V extends x {
|
|
|
1288
1288
|
this.isEditing = !1, this.value && (this.inputEl.value = K(this.value));
|
|
1289
1289
|
}), this.inputEl.addEventListener("paste", (i) => this.handlePaste(i)), this.inputEl.addEventListener("input", (i) => this.handleTextInput(i)), this.inputEl.addEventListener("keydown", (i) => {
|
|
1290
1290
|
i.key === "Enter" && (this.handleTextInput(i), this.inputEl.blur()), i.key === "Escape" && (this.value && (this.inputEl.value = S(this.value)), this.inputEl.blur());
|
|
1291
|
-
}), e.appendChild(this.previewEl), this.unlinkButton = document.createElement("button"), this.unlinkButton.type = "button", this.unlinkButton.className = "gradient-unlink-button", this.unlinkButton.innerHTML =
|
|
1291
|
+
}), e.appendChild(this.previewEl), this.unlinkButton = document.createElement("button"), this.unlinkButton.type = "button", this.unlinkButton.className = "gradient-unlink-button", this.unlinkButton.innerHTML = At, this.unlinkButton.title = "Break global color binding", this.unlinkButton.addEventListener("click", (i) => {
|
|
1292
1292
|
i.preventDefault(), i.stopPropagation(), this.breakGlobalBinding();
|
|
1293
1293
|
}), e.appendChild(this.unlinkButton), e.appendChild(this.inputEl), t.appendChild(e), this.createPopover(), this.element = t, this.updateUnlinkButtonVisibility(), t;
|
|
1294
1294
|
}
|
|
@@ -1311,7 +1311,7 @@ const V = class V extends x {
|
|
|
1311
1311
|
t.appendChild(l);
|
|
1312
1312
|
}
|
|
1313
1313
|
const i = document.createElement("button");
|
|
1314
|
-
i.type = "button", i.className = "gradient-popover-close", i.innerHTML =
|
|
1314
|
+
i.type = "button", i.className = "gradient-popover-close", i.innerHTML = bt, i.addEventListener("click", () => this.closePopover()), t.appendChild(i), ot(t, this.popoverEl, (l, r) => {
|
|
1315
1315
|
this.popoverPosition = { left: l, top: r };
|
|
1316
1316
|
});
|
|
1317
1317
|
const s = document.createElement("div");
|
|
@@ -1322,8 +1322,8 @@ const V = class V extends x {
|
|
|
1322
1322
|
n.appendChild(o), s.appendChild(n);
|
|
1323
1323
|
const a = document.createElement("div");
|
|
1324
1324
|
if (a.className = "gradient-editor-content", this.updatePopoverContent(a), s.appendChild(a), this.variant !== "global" && e) {
|
|
1325
|
-
const l = e.children[0], r = e.children[1], c = (
|
|
1326
|
-
this.currentMode =
|
|
1325
|
+
const l = e.children[0], r = e.children[1], c = (d) => {
|
|
1326
|
+
this.currentMode = d, d === "custom" ? (l.classList.add("active"), r.classList.remove("active"), n.style.display = "block") : (r.classList.add("active"), l.classList.remove("active"), n.style.display = "none"), this.updatePopoverContent(a);
|
|
1327
1327
|
};
|
|
1328
1328
|
l.addEventListener("click", () => c("custom")), r.addEventListener("click", () => c("global")), this.isBoundToGlobal() ? (this.currentMode = "global", c("global")) : (this.currentMode = "custom", c("custom"));
|
|
1329
1329
|
}
|
|
@@ -1334,7 +1334,7 @@ const V = class V extends x {
|
|
|
1334
1334
|
const t = document.createElement("div");
|
|
1335
1335
|
t.className = "gradient-type-tabs";
|
|
1336
1336
|
const e = document.createElement("button");
|
|
1337
|
-
e.type = "button", e.className = `gradient-type-tab ${((s = this.value) == null ? void 0 : s.type) === "solid" ? "active" : ""}`, e.innerHTML =
|
|
1337
|
+
e.type = "button", e.className = `gradient-type-tab ${((s = this.value) == null ? void 0 : s.type) === "solid" ? "active" : ""}`, e.innerHTML = Bt, e.style.minWidth = "32px", e.addEventListener("click", () => this.switchType("solid"));
|
|
1338
1338
|
const i = document.createElement("button");
|
|
1339
1339
|
return i.type = "button", i.className = `gradient-type-tab ${((n = this.value) == null ? void 0 : n.type) !== "solid" ? "active" : ""}`, i.innerHTML = $t, i.style.minWidth = "32px", i.addEventListener("click", () => {
|
|
1340
1340
|
var a, l;
|
|
@@ -1390,49 +1390,49 @@ const V = class V extends x {
|
|
|
1390
1390
|
}
|
|
1391
1391
|
renderGlobalColors(t) {
|
|
1392
1392
|
(!this.value || !this.value.stops || !this.value.stops.length) && (this.value || (this.value = this.defaultValue()), this.value.stops = [{ color: "#000000", position: 0, opacity: 100 }]);
|
|
1393
|
-
const e = this.value.stops[0], i = (
|
|
1394
|
-
|
|
1395
|
-
let
|
|
1393
|
+
const e = this.value.stops[0], i = (d) => {
|
|
1394
|
+
d.innerHTML = "";
|
|
1395
|
+
let h = {};
|
|
1396
1396
|
try {
|
|
1397
|
-
|
|
1397
|
+
h = w.GlobalVariables || {};
|
|
1398
1398
|
} catch (u) {
|
|
1399
1399
|
console.warn("Could not access Setting.GlobalVariables", u);
|
|
1400
1400
|
}
|
|
1401
|
-
if (!
|
|
1401
|
+
if (!h || Object.keys(h).length === 0) {
|
|
1402
1402
|
const u = document.createElement("div");
|
|
1403
|
-
u.textContent = "No global colors defined", u.style.fontSize = "12px", u.style.color = "#666", u.style.padding = "8px",
|
|
1403
|
+
u.textContent = "No global colors defined", u.style.fontSize = "12px", u.style.color = "#666", u.style.padding = "8px", d.appendChild(u);
|
|
1404
1404
|
return;
|
|
1405
1405
|
}
|
|
1406
|
-
const g =
|
|
1406
|
+
const g = w.GlobalVariableGroups || [
|
|
1407
1407
|
{ title: "Global Colors", keys: ["primary", "secondary", "tertiary", "accent"] },
|
|
1408
1408
|
{ title: "Text Color", keys: ["text-dark", "text-light"] }
|
|
1409
|
-
],
|
|
1409
|
+
], f = this.globalSearchQuery.toLowerCase();
|
|
1410
1410
|
let m;
|
|
1411
|
-
this.globalLayoutMode === "list" ? (m = document.createElement("div"), m.className = "global-colors-list") : (m = document.createElement("div"), m.className = "global-colors-grid"),
|
|
1412
|
-
const
|
|
1413
|
-
|
|
1411
|
+
this.globalLayoutMode === "list" ? (m = document.createElement("div"), m.className = "global-colors-list") : (m = document.createElement("div"), m.className = "global-colors-grid"), d.appendChild(m), g.forEach((u) => {
|
|
1412
|
+
const C = Object.entries(h).filter(([v]) => !u.keys.includes(v) && u.title !== "Global Colors" ? !1 : u.keys.includes(v) && v.toLowerCase().includes(f));
|
|
1413
|
+
C.length !== 0 && C.forEach(([v, y]) => {
|
|
1414
1414
|
if (this.globalLayoutMode === "list") {
|
|
1415
|
-
const
|
|
1416
|
-
|
|
1417
|
-
const
|
|
1418
|
-
|
|
1415
|
+
const x = document.createElement("div");
|
|
1416
|
+
x.className = "global-color-row";
|
|
1417
|
+
const k = document.createElement("div");
|
|
1418
|
+
k.className = "global-color-circle";
|
|
1419
1419
|
const N = this.resolveGlobalVarColor(y);
|
|
1420
|
-
|
|
1421
|
-
const
|
|
1422
|
-
|
|
1420
|
+
k.style.background = N, (this.linkedGlobalVariable === `var(--${v})` || e.color === `var(--${v})`) && k.classList.add("selected");
|
|
1421
|
+
const b = document.createElement("span");
|
|
1422
|
+
b.className = "global-color-label", b.textContent = v.split("-").map((I) => I.charAt(0).toUpperCase() + I.slice(1)).join(" "), x.appendChild(k), x.appendChild(b), x.addEventListener("click", (I) => {
|
|
1423
1423
|
I.preventDefault();
|
|
1424
1424
|
const D = `var(--${v})`;
|
|
1425
|
-
this.setValue(D), this.pendingSolidColor = D, i(
|
|
1426
|
-
}), m.appendChild(
|
|
1425
|
+
this.setValue(D), this.pendingSolidColor = D, i(d);
|
|
1426
|
+
}), m.appendChild(x);
|
|
1427
1427
|
} else {
|
|
1428
|
-
const
|
|
1429
|
-
|
|
1430
|
-
const
|
|
1431
|
-
|
|
1428
|
+
const x = document.createElement("div");
|
|
1429
|
+
x.className = "global-color-circle";
|
|
1430
|
+
const k = this.resolveGlobalVarColor(y);
|
|
1431
|
+
x.style.background = k, x.title = v.split("-").map((E) => E.charAt(0).toUpperCase() + E.slice(1)).join(" "), (this.linkedGlobalVariable === `var(--${v})` || e.color === `var(--${v})`) && x.classList.add("selected"), x.addEventListener("click", (E) => {
|
|
1432
1432
|
E.preventDefault();
|
|
1433
|
-
const
|
|
1434
|
-
this.setValue(
|
|
1435
|
-
}), m.appendChild(
|
|
1433
|
+
const b = `var(--${v})`;
|
|
1434
|
+
this.setValue(b), this.pendingSolidColor = b, i(d);
|
|
1435
|
+
}), m.appendChild(x);
|
|
1436
1436
|
}
|
|
1437
1437
|
});
|
|
1438
1438
|
});
|
|
@@ -1445,8 +1445,8 @@ const V = class V extends x {
|
|
|
1445
1445
|
const a = document.createElement("input");
|
|
1446
1446
|
a.type = "text", a.className = "global-search-input", a.placeholder = "Search", a.value = this.globalSearchQuery;
|
|
1447
1447
|
const l = document.createElement("div");
|
|
1448
|
-
a.addEventListener("input", (
|
|
1449
|
-
this.globalSearchQuery =
|
|
1448
|
+
a.addEventListener("input", (d) => {
|
|
1449
|
+
this.globalSearchQuery = d.target.value, i(l);
|
|
1450
1450
|
}), n.appendChild(o), n.appendChild(a);
|
|
1451
1451
|
const r = document.createElement("button");
|
|
1452
1452
|
r.className = "global-layout-toggle", r.type = "button";
|
|
@@ -1459,7 +1459,7 @@ const V = class V extends x {
|
|
|
1459
1459
|
}
|
|
1460
1460
|
renderSolid(t) {
|
|
1461
1461
|
(!this.value || !this.value.stops || !this.value.stops.length) && (this.value || (this.value = this.defaultValue()), this.value.stops = [{ color: "#000000", position: 0, opacity: 100 }]);
|
|
1462
|
-
const e = this.value.stops[0], i = new
|
|
1462
|
+
const e = this.value.stops[0], i = new Dt({
|
|
1463
1463
|
initialColor: e.color.startsWith("var(--") ? this.resolveGlobalVarColor(e.color) : e.color,
|
|
1464
1464
|
initialOpacity: e.opacity ?? 100,
|
|
1465
1465
|
onColorChange: (s, n) => {
|
|
@@ -1481,15 +1481,15 @@ const V = class V extends x {
|
|
|
1481
1481
|
{
|
|
1482
1482
|
const c = document.createElement("div");
|
|
1483
1483
|
c.className = "gradient-subtype-inline";
|
|
1484
|
-
const
|
|
1485
|
-
|
|
1486
|
-
const
|
|
1487
|
-
|
|
1484
|
+
const d = document.createElement("select");
|
|
1485
|
+
d.className = "gradient-subtype-select";
|
|
1486
|
+
const h = document.createElement("option");
|
|
1487
|
+
h.value = "linear", h.textContent = "Linear";
|
|
1488
1488
|
const g = document.createElement("option");
|
|
1489
|
-
g.value = "radial", g.textContent = "Radial",
|
|
1490
|
-
const
|
|
1491
|
-
|
|
1492
|
-
this.clearGlobalBindingForCustomChange(), this.switchType(
|
|
1489
|
+
g.value = "radial", g.textContent = "Radial", d.appendChild(h), d.appendChild(g), d.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°");
|
|
1490
|
+
const f = document.createElement("button");
|
|
1491
|
+
f.type = "button", f.className = "gradient-flip-btn", f.innerHTML = Ot, d.addEventListener("change", () => {
|
|
1492
|
+
this.clearGlobalBindingForCustomChange(), this.switchType(d.value === "radial" ? "radial" : "linear", !0), e && this.updateDegreeVisibility(e);
|
|
1493
1493
|
}), e.addEventListener("focus", (m) => {
|
|
1494
1494
|
const u = m.target;
|
|
1495
1495
|
u.value = u.value.replace(/[^0-9-]/g, ""), setTimeout(() => u.select(), 0);
|
|
@@ -1501,13 +1501,13 @@ const V = class V extends x {
|
|
|
1501
1501
|
var v;
|
|
1502
1502
|
this.previewUpdateTimeout && (clearTimeout(this.previewUpdateTimeout), this.previewUpdateTimeout = null);
|
|
1503
1503
|
const u = m.target;
|
|
1504
|
-
let
|
|
1505
|
-
Number.isNaN(
|
|
1506
|
-
}),
|
|
1504
|
+
let C = parseInt(u.value);
|
|
1505
|
+
Number.isNaN(C) && (C = ((v = this.value) == null ? void 0 : v.angle) ?? 0), C = Math.max(0, Math.min(360, C)), this.value && (this.value.angle = C), u.value = `${C}°`, this.updateGradientPreview(), this.updateUI(), this.triggerChange();
|
|
1506
|
+
}), f.addEventListener("click", () => {
|
|
1507
1507
|
this.clearGlobalBindingForCustomChange(), !(!this.value || !this.value.stops) && (this.value.stops.forEach((m) => {
|
|
1508
1508
|
m.position = 100 - m.position;
|
|
1509
1509
|
}), this.value.stops.sort((m, u) => m.position - u.position), this.updateGradientPreview(i), this.createHandles(s, i), this.updateStopsList(l), this.updateUI(), this.triggerChange());
|
|
1510
|
-
}), c.appendChild(
|
|
1510
|
+
}), c.appendChild(d), c.appendChild(e), c.appendChild(f), t.appendChild(c), this.updateDegreeVisibility(e);
|
|
1511
1511
|
}
|
|
1512
1512
|
const i = document.createElement("div");
|
|
1513
1513
|
i.className = "gradient-preview", this.updateGradientPreview(i);
|
|
@@ -1522,8 +1522,8 @@ const V = class V extends x {
|
|
|
1522
1522
|
const l = document.createElement("div");
|
|
1523
1523
|
l.className = "gradient-stops", t.appendChild(n), t.appendChild(l), this.updateStopsList(l);
|
|
1524
1524
|
const r = at((c) => {
|
|
1525
|
-
const
|
|
1526
|
-
|
|
1525
|
+
const d = T(c);
|
|
1526
|
+
d && (this.clearGlobalBindingForCustomChange(), this.value = d, this.switchType(d.type, !0), this.updateUI(), this.triggerChange());
|
|
1527
1527
|
}, "all");
|
|
1528
1528
|
this.recentGradientRefresh = r.refresh, t.appendChild(r.container), a.addEventListener("click", () => {
|
|
1529
1529
|
var c;
|
|
@@ -1558,29 +1558,29 @@ const V = class V extends x {
|
|
|
1558
1558
|
o.className = "gstop-chip";
|
|
1559
1559
|
const a = this.resolveGlobalVarColor(i.color);
|
|
1560
1560
|
o.style.backgroundColor = a, n.appendChild(o);
|
|
1561
|
-
const l = new ut((u,
|
|
1562
|
-
this.clearGlobalBindingForCustomChange(), this.value && this.value.stops[s] && (this.value.stops[s].color = u,
|
|
1561
|
+
const l = new ut((u, C) => {
|
|
1562
|
+
this.clearGlobalBindingForCustomChange(), this.value && this.value.stops[s] && (this.value.stops[s].color = u, C !== void 0 && (this.value.stops[s].opacity = C), o.style.backgroundColor = u, this.updateGradientPreview(), this.updateStopsList(), this.updateUI(), this.triggerChange());
|
|
1563
1563
|
}, "solid");
|
|
1564
|
-
let r = !1, c = !1,
|
|
1564
|
+
let r = !1, c = !1, d = 0, h = 0;
|
|
1565
1565
|
const g = (u) => {
|
|
1566
|
-
r = !0, c = !1,
|
|
1567
|
-
},
|
|
1566
|
+
r = !0, c = !1, d = u.clientX, h = this.value.stops[s].position, n.classList.add("selected"), document.addEventListener("mousemove", f), document.addEventListener("mouseup", m), u.preventDefault(), u.stopPropagation();
|
|
1567
|
+
}, f = (u) => {
|
|
1568
1568
|
if (!r || !this.value) return;
|
|
1569
|
-
const
|
|
1570
|
-
if (Math.abs(
|
|
1569
|
+
const C = u.clientX - d;
|
|
1570
|
+
if (Math.abs(C) > 3 && (c = !0), c) {
|
|
1571
1571
|
this.clearGlobalBindingForCustomChange();
|
|
1572
1572
|
const v = e.getBoundingClientRect();
|
|
1573
|
-
let y =
|
|
1573
|
+
let y = h + C / v.width * 100;
|
|
1574
1574
|
y = Math.max(0, Math.min(100, y)), this.value.stops[s].position = Math.round(y), n.style.left = `${y}%`, this.updateGradientPreview();
|
|
1575
1575
|
}
|
|
1576
1576
|
}, m = (u) => {
|
|
1577
|
-
var
|
|
1577
|
+
var C;
|
|
1578
1578
|
if (r)
|
|
1579
|
-
if (r = !1, n.classList.remove("selected"), document.removeEventListener("mousemove",
|
|
1579
|
+
if (r = !1, n.classList.remove("selected"), document.removeEventListener("mousemove", f), document.removeEventListener("mouseup", m), c)
|
|
1580
1580
|
this.value && (this.value.stops.sort((v, y) => v.position - y.position), this.createHandles(t, e), this.updateStopsList()), this.updateUI(), this.triggerChange();
|
|
1581
1581
|
else {
|
|
1582
1582
|
u.stopPropagation();
|
|
1583
|
-
const v = (
|
|
1583
|
+
const v = (C = this.value) == null ? void 0 : C.stops[s];
|
|
1584
1584
|
v && setTimeout(() => {
|
|
1585
1585
|
const y = this.resolveGlobalVarColor(v.color);
|
|
1586
1586
|
l.open(y, o, v.opacity ?? 100);
|
|
@@ -1594,7 +1594,7 @@ const V = class V extends x {
|
|
|
1594
1594
|
var i;
|
|
1595
1595
|
const e = t || ((i = this.popoverEl) == null ? void 0 : i.querySelector(".gradient-stops"));
|
|
1596
1596
|
!e || !this.value || this.value.type === "solid" || !this.value.stops || (e.innerHTML = "", this.value.stops.forEach((s, n) => {
|
|
1597
|
-
var
|
|
1597
|
+
var k, N;
|
|
1598
1598
|
const o = document.createElement("div");
|
|
1599
1599
|
o.className = "gstop-row";
|
|
1600
1600
|
const a = document.createElement("div");
|
|
@@ -1603,86 +1603,86 @@ const V = class V extends x {
|
|
|
1603
1603
|
l.type = "text", l.className = "gstop-position-input", l.value = `${s.position}%`, l.style.width = "60px", a.appendChild(l);
|
|
1604
1604
|
const r = document.createElement("div");
|
|
1605
1605
|
r.className = "gstop-color-container";
|
|
1606
|
-
const c = this.resolveGlobalVarColor(s.color),
|
|
1607
|
-
|
|
1608
|
-
const
|
|
1609
|
-
|
|
1606
|
+
const c = this.resolveGlobalVarColor(s.color), d = document.createElement("div");
|
|
1607
|
+
d.className = "gstop-color-preview", d.style.backgroundColor = c;
|
|
1608
|
+
const h = document.createElement("input");
|
|
1609
|
+
h.type = "text", h.className = "gstop-color-input", h.value = c.replace("#", "").toUpperCase();
|
|
1610
1610
|
const g = document.createElement("button");
|
|
1611
|
-
g.type = "button", g.className = "gstop-color-copy", g.textContent = "Copy", r.appendChild(
|
|
1612
|
-
const
|
|
1613
|
-
|
|
1611
|
+
g.type = "button", g.className = "gstop-color-copy", g.textContent = "Copy", r.appendChild(d), r.appendChild(h), r.appendChild(g);
|
|
1612
|
+
const f = document.createElement("button");
|
|
1613
|
+
f.type = "button", f.className = "gstop-del", f.innerHTML = Ht, f.disabled = (((N = (k = this.value) == null ? void 0 : k.stops) == null ? void 0 : N.length) || 0) <= 2, o.appendChild(a), o.appendChild(r), o.appendChild(f), e.appendChild(o);
|
|
1614
1614
|
const m = document.createElement("span");
|
|
1615
1615
|
m.className = "gstop-opacity-label", m.textContent = "Opacity";
|
|
1616
1616
|
const u = document.createElement("div");
|
|
1617
1617
|
u.className = "gstop-opacity-group";
|
|
1618
|
-
const
|
|
1619
|
-
|
|
1618
|
+
const C = document.createElement("input");
|
|
1619
|
+
C.type = "range", C.className = "gstop-opacity-slider", C.min = "0", C.max = "100", C.value = String(s.opacity ?? 100);
|
|
1620
1620
|
const v = P(c);
|
|
1621
|
-
|
|
1621
|
+
C.style.setProperty("--slider-color", `rgb(${v.r}, ${v.g}, ${v.b})`);
|
|
1622
1622
|
const y = document.createElement("span");
|
|
1623
|
-
y.className = "gstop-opacity-value", y.textContent = `${s.opacity ?? 100}%`, u.appendChild(
|
|
1624
|
-
const
|
|
1625
|
-
this.clearGlobalBindingForCustomChange(),
|
|
1623
|
+
y.className = "gstop-opacity-value", y.textContent = `${s.opacity ?? 100}%`, u.appendChild(C), u.appendChild(y);
|
|
1624
|
+
const x = new ut((E, b) => {
|
|
1625
|
+
this.clearGlobalBindingForCustomChange(), h.value = E.replace("#", "").toUpperCase(), d.style.backgroundColor = E, this.value.stops[n].color = E, b !== void 0 && (this.value.stops[n].opacity = b, C.value = String(b), y.textContent = `${b}%`);
|
|
1626
1626
|
const I = P(E);
|
|
1627
|
-
|
|
1627
|
+
C.style.setProperty("--slider-color", `rgb(${I.r}, ${I.g}, ${I.b})`), this.updateGradientPreview(), this.createHandles(
|
|
1628
1628
|
this.popoverEl.querySelector(".gradient-handles"),
|
|
1629
1629
|
this.popoverEl.querySelector(".gradient-preview")
|
|
1630
1630
|
), this.updateUI(), this.triggerChange();
|
|
1631
1631
|
}, "solid");
|
|
1632
|
-
|
|
1632
|
+
h.addEventListener("click", (E) => {
|
|
1633
1633
|
E.preventDefault(), E.stopPropagation();
|
|
1634
|
-
const
|
|
1635
|
-
|
|
1636
|
-
}),
|
|
1634
|
+
const b = this.resolveGlobalVarColor(s.color);
|
|
1635
|
+
x.open(b, h, s.opacity ?? 100);
|
|
1636
|
+
}), h.addEventListener("input", () => {
|
|
1637
1637
|
this.clearGlobalBindingForCustomChange();
|
|
1638
|
-
const E =
|
|
1639
|
-
if (/^#[0-9A-Fa-f]{6}$/.test(
|
|
1640
|
-
this.value.stops[n].color =
|
|
1641
|
-
const I = P(
|
|
1642
|
-
|
|
1638
|
+
const E = h.value.trim(), b = E.startsWith("#") ? E : `#${E}`;
|
|
1639
|
+
if (/^#[0-9A-Fa-f]{6}$/.test(b)) {
|
|
1640
|
+
this.value.stops[n].color = b, d.style.backgroundColor = b;
|
|
1641
|
+
const I = P(b);
|
|
1642
|
+
C.style.setProperty("--slider-color", `rgb(${I.r}, ${I.g}, ${I.b})`), this.debouncedPreviewUpdate();
|
|
1643
1643
|
}
|
|
1644
|
-
}),
|
|
1644
|
+
}), h.addEventListener("blur", () => {
|
|
1645
1645
|
this.previewUpdateTimeout && (clearTimeout(this.previewUpdateTimeout), this.previewUpdateTimeout = null), this.updateGradientPreview(), this.updateUI(), this.triggerChange();
|
|
1646
1646
|
}), g.addEventListener("click", async (E) => {
|
|
1647
1647
|
E.stopPropagation();
|
|
1648
1648
|
try {
|
|
1649
|
-
await navigator.clipboard.writeText(`#${
|
|
1649
|
+
await navigator.clipboard.writeText(`#${h.value}`);
|
|
1650
1650
|
} catch {
|
|
1651
1651
|
}
|
|
1652
1652
|
}), l.addEventListener("focus", (E) => {
|
|
1653
|
-
const
|
|
1654
|
-
|
|
1653
|
+
const b = E.target;
|
|
1654
|
+
b.value = b.value.replace("%", ""), b.select();
|
|
1655
1655
|
}), l.addEventListener("input", (E) => {
|
|
1656
1656
|
this.clearGlobalBindingForCustomChange();
|
|
1657
|
-
const
|
|
1657
|
+
const b = E.target, I = parseInt(b.value.replace(/[^\d]/g, ""), 10);
|
|
1658
1658
|
if (!Number.isNaN(I)) {
|
|
1659
1659
|
const D = Math.max(0, Math.min(100, I));
|
|
1660
|
-
this.value.stops[n].position = D,
|
|
1660
|
+
this.value.stops[n].position = D, b.value = `${D}%`, this.debouncedPreviewUpdate();
|
|
1661
1661
|
}
|
|
1662
1662
|
}), l.addEventListener("blur", (E) => {
|
|
1663
1663
|
this.previewUpdateTimeout && (clearTimeout(this.previewUpdateTimeout), this.previewUpdateTimeout = null);
|
|
1664
|
-
const
|
|
1664
|
+
const b = E.target, I = parseInt(b.value.replace(/[^\d]/g, ""), 10);
|
|
1665
1665
|
if (Number.isNaN(I))
|
|
1666
|
-
|
|
1666
|
+
b.value = `${this.value.stops[n].position}%`;
|
|
1667
1667
|
else {
|
|
1668
1668
|
const D = Math.max(0, Math.min(100, I));
|
|
1669
|
-
this.value.stops[n].position = D,
|
|
1669
|
+
this.value.stops[n].position = D, b.value = `${D}%`;
|
|
1670
1670
|
}
|
|
1671
1671
|
this.updateGradientPreview(), this.createHandles(
|
|
1672
1672
|
this.popoverEl.querySelector(".gradient-handles"),
|
|
1673
1673
|
this.popoverEl.querySelector(".gradient-preview")
|
|
1674
1674
|
), this.updateStopsList(), this.updateUI(), this.triggerChange();
|
|
1675
|
-
}),
|
|
1675
|
+
}), f.addEventListener("click", () => {
|
|
1676
1676
|
var E;
|
|
1677
1677
|
(this.value.stops.length || 0) <= 2 || (this.clearGlobalBindingForCustomChange(), this.value.stops.splice(n, 1), this.createHandles(
|
|
1678
1678
|
this.popoverEl.querySelector(".gradient-handles"),
|
|
1679
1679
|
this.popoverEl.querySelector(".gradient-preview")
|
|
1680
1680
|
), this.updateStopsList(), this.updateGradientPreview(), this.updateUI(), ((E = document.activeElement) == null ? void 0 : E.tagName) !== "INPUT" && this.repositionPopover(), this.triggerChange());
|
|
1681
|
-
}),
|
|
1681
|
+
}), C.addEventListener("input", () => {
|
|
1682
1682
|
this.clearGlobalBindingForCustomChange();
|
|
1683
|
-
const E = parseInt(
|
|
1683
|
+
const E = parseInt(C.value, 10);
|
|
1684
1684
|
this.value.stops[n].opacity = Math.max(0, Math.min(100, E)), y.textContent = `${this.value.stops[n].opacity}%`, this.debouncedPreviewUpdate();
|
|
1685
|
-
}),
|
|
1685
|
+
}), C.addEventListener("change", () => {
|
|
1686
1686
|
this.clearGlobalBindingForCustomChange(), this.previewUpdateTimeout && (clearTimeout(this.previewUpdateTimeout), this.previewUpdateTimeout = null), this.updateGradientPreview(), this.updateUI(), this.triggerChange();
|
|
1687
1687
|
});
|
|
1688
1688
|
}));
|
|
@@ -1711,10 +1711,10 @@ const V = class V extends x {
|
|
|
1711
1711
|
this.popoverEl.style.position = "fixed", this.popoverEl.style.zIndex = "10000", this.popoverEl.style.left = "-9999px", this.popoverEl.style.top = "0px";
|
|
1712
1712
|
const o = this.popoverEl.offsetHeight;
|
|
1713
1713
|
let a = t.right + 8, l = t.top;
|
|
1714
|
-
const r = i - t.right, c = t.left,
|
|
1715
|
-
r <
|
|
1716
|
-
const
|
|
1717
|
-
g >= o + n ? l = t.top - o - 8 :
|
|
1714
|
+
const r = i - t.right, c = t.left, d = e + n;
|
|
1715
|
+
r < d && c > r + 100 && (a = t.left - e - 8);
|
|
1716
|
+
const h = s - t.bottom, g = t.top;
|
|
1717
|
+
g >= o + n ? l = t.top - o - 8 : h >= o + n ? l = t.bottom + 8 : g > h ? (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 };
|
|
1718
1718
|
}
|
|
1719
1719
|
setTimeout(() => document.addEventListener("click", this.onBackgroundClick, !0), 200), document.addEventListener("keydown", this.handlePopoverKeydown, !0);
|
|
1720
1720
|
}
|
|
@@ -1732,10 +1732,10 @@ const V = class V extends x {
|
|
|
1732
1732
|
this.popoverEl.style.left, this.popoverEl.style.top, this.popoverEl.style.left = "-9999px", this.popoverEl.style.top = "0px";
|
|
1733
1733
|
const a = this.popoverEl.offsetHeight;
|
|
1734
1734
|
let l = e.right + 8, r = e.top;
|
|
1735
|
-
const c = s - e.right,
|
|
1736
|
-
c <
|
|
1737
|
-
const g = n - e.bottom,
|
|
1738
|
-
|
|
1735
|
+
const c = s - e.right, d = e.left, h = i + o;
|
|
1736
|
+
c < h && d > c + 100 && (l = e.left - i - 8);
|
|
1737
|
+
const g = n - e.bottom, f = e.top;
|
|
1738
|
+
f >= a + o ? r = e.top - a - 8 : g >= a + o ? r = e.bottom + 8 : f > g ? (r = e.top - a - 8, r < o && (r = o)) : (r = e.bottom + 8, r + a > n - o && (r = n - a - o)), this.popoverEl.style.left = `${l}px`, this.popoverEl.style.top = `${r}px`;
|
|
1739
1739
|
});
|
|
1740
1740
|
}
|
|
1741
1741
|
}
|
|
@@ -1810,22 +1810,22 @@ const V = class V extends x {
|
|
|
1810
1810
|
};
|
|
1811
1811
|
V.openInstance = null, V.CHANGE_DEBOUNCE_DELAY = 150;
|
|
1812
1812
|
let j = V;
|
|
1813
|
-
function J(
|
|
1814
|
-
for (const e in
|
|
1815
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
1816
|
-
const i =
|
|
1813
|
+
function J(p, t) {
|
|
1814
|
+
for (const e in p)
|
|
1815
|
+
if (Object.prototype.hasOwnProperty.call(p, e)) {
|
|
1816
|
+
const i = p[e];
|
|
1817
1817
|
t(e, i);
|
|
1818
1818
|
}
|
|
1819
1819
|
}
|
|
1820
1820
|
const Q = class Q {
|
|
1821
1821
|
constructor(t) {
|
|
1822
1822
|
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 = () => {
|
|
1823
|
-
}, this.pendingBlurHandler = null, this.originalDefaultValues = {}, this.nestingLevel = 0, this.dataPropsPath = "", this.hide = !1, this.id = t.id ||
|
|
1823
|
+
}, this.pendingBlurHandler = null, this.originalDefaultValues = {}, this.nestingLevel = 0, this.dataPropsPath = "", this.hide = !1, this.id = t.id || ft(), 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();
|
|
1824
1824
|
}
|
|
1825
1825
|
propagateNestingLevel() {
|
|
1826
1826
|
const t = this.nestingLevel + 1;
|
|
1827
1827
|
J(this.settings, (e, i) => {
|
|
1828
|
-
|
|
1828
|
+
L(i) && (i.nestingLevel = t, i.propagateNestingLevel());
|
|
1829
1829
|
});
|
|
1830
1830
|
}
|
|
1831
1831
|
getNestingLevel() {
|
|
@@ -1851,16 +1851,16 @@ const Q = class Q {
|
|
|
1851
1851
|
propagateDataPropsPath() {
|
|
1852
1852
|
J(this.settings, (t, e) => {
|
|
1853
1853
|
const i = String(t), s = this.dataPropsPath ? `${this.dataPropsPath}_${i}` : i;
|
|
1854
|
-
(
|
|
1854
|
+
(L(e) || F(e) && typeof e.setDataPropsPath == "function") && e.setDataPropsPath(s);
|
|
1855
1855
|
});
|
|
1856
1856
|
}
|
|
1857
1857
|
updateNestingStyles() {
|
|
1858
|
-
this.elementRef && (
|
|
1858
|
+
this.elementRef && (_(this.elementRef, this.nestingLevel), et(this.elementRef, this.nestingLevel));
|
|
1859
1859
|
}
|
|
1860
1860
|
forceChildUIRefresh() {
|
|
1861
1861
|
Object.entries(this.settings).forEach(([t, e]) => {
|
|
1862
1862
|
try {
|
|
1863
|
-
if (
|
|
1863
|
+
if (L(e)) {
|
|
1864
1864
|
const i = e.getValues();
|
|
1865
1865
|
e.setValue(i);
|
|
1866
1866
|
} else if (typeof e.setValue == "function") {
|
|
@@ -1915,20 +1915,20 @@ const Q = class Q {
|
|
|
1915
1915
|
const i = (e == null ? void 0 : e.preserveValues) ?? !0, s = new Set(Object.keys(this.settings)), n = Object.keys(t), o = {};
|
|
1916
1916
|
i && n.forEach((r) => {
|
|
1917
1917
|
const c = this.settings[r];
|
|
1918
|
-
c && (
|
|
1918
|
+
c && (L(c) ? o[r] = c.getValues() : F(c) ? o[r] = c.value : typeof c.getValues == "function" ? o[r] = c.getValues() : c.value !== void 0 && (o[r] = c.value));
|
|
1919
1919
|
}), s.forEach((r) => {
|
|
1920
1920
|
n.includes(r) || this.removeSetting(r);
|
|
1921
1921
|
}), n.forEach((r) => {
|
|
1922
|
-
var
|
|
1923
|
-
const c = t[r],
|
|
1924
|
-
if (
|
|
1922
|
+
var h;
|
|
1923
|
+
const c = t[r], d = this.settings[r];
|
|
1924
|
+
if (d !== c && (d && this.removeSetting(r), this.addSetting(r, c), i && r in o)) {
|
|
1925
1925
|
const g = o[r];
|
|
1926
1926
|
try {
|
|
1927
|
-
|
|
1927
|
+
L(c) ? c.setValue(
|
|
1928
1928
|
g
|
|
1929
|
-
) :
|
|
1930
|
-
} catch (
|
|
1931
|
-
console.warn(`Could not preserve value for setting ${r}:`,
|
|
1929
|
+
) : F(c) ? (h = c.setValue) == null || h.call(c, g) : c.setValue && c.setValue(g);
|
|
1930
|
+
} catch (f) {
|
|
1931
|
+
console.warn(`Could not preserve value for setting ${r}:`, f);
|
|
1932
1932
|
}
|
|
1933
1933
|
}
|
|
1934
1934
|
}), this.settings = t, this.propagateNestingLevel(), this.propagateDataPropsPath();
|
|
@@ -1954,7 +1954,7 @@ const Q = class Q {
|
|
|
1954
1954
|
deleteItem: this.deleteItemCfg,
|
|
1955
1955
|
dataProps: this.dataProps,
|
|
1956
1956
|
hide: this.hide
|
|
1957
|
-
}, i =
|
|
1957
|
+
}, i = Gt(e);
|
|
1958
1958
|
return i.initialValues = this.getValues(), i;
|
|
1959
1959
|
}
|
|
1960
1960
|
resetDefault() {
|
|
@@ -1964,7 +1964,7 @@ const Q = class Q {
|
|
|
1964
1964
|
setMobileValues(t) {
|
|
1965
1965
|
!t || typeof t != "object" || (Object.entries(t).forEach(([e, i]) => {
|
|
1966
1966
|
const s = this.settings[e];
|
|
1967
|
-
s && (
|
|
1967
|
+
s && (L(s) || F(s)) && typeof s.setMobileValue == "function" && s.setMobileValue(i);
|
|
1968
1968
|
}), this.setValue(t), this.onChange && this.onChange(this.getValues()));
|
|
1969
1969
|
}
|
|
1970
1970
|
getMobileValues(t) {
|
|
@@ -1973,7 +1973,7 @@ const Q = class Q {
|
|
|
1973
1973
|
for (const i in this.settings)
|
|
1974
1974
|
if (Object.prototype.hasOwnProperty.call(this.settings, i)) {
|
|
1975
1975
|
const s = this.settings[i];
|
|
1976
|
-
if (
|
|
1976
|
+
if (L(s))
|
|
1977
1977
|
e[i] = s.getMobileValues();
|
|
1978
1978
|
else {
|
|
1979
1979
|
const n = s;
|
|
@@ -1984,7 +1984,7 @@ const Q = class Q {
|
|
|
1984
1984
|
} else {
|
|
1985
1985
|
const e = this.settings[t];
|
|
1986
1986
|
if (!e) return;
|
|
1987
|
-
if (
|
|
1987
|
+
if (L(e)) return e.getMobileValues();
|
|
1988
1988
|
const i = e;
|
|
1989
1989
|
return i.mobileValue !== void 0 ? i.mobileValue : i.value;
|
|
1990
1990
|
}
|
|
@@ -2002,12 +2002,12 @@ const Q = class Q {
|
|
|
2002
2002
|
};
|
|
2003
2003
|
return this.changeHandlers.clear(), J(this.settings, (i, s) => {
|
|
2004
2004
|
var n;
|
|
2005
|
-
if (
|
|
2005
|
+
if (L(s))
|
|
2006
2006
|
s.setOnChange(() => {
|
|
2007
2007
|
const o = this.getValues();
|
|
2008
2008
|
this.initialValues = o, t(o);
|
|
2009
2009
|
}), this.changeHandlers.add(() => t(this.getValues()));
|
|
2010
|
-
else if (
|
|
2010
|
+
else if (F(s)) {
|
|
2011
2011
|
const o = () => e();
|
|
2012
2012
|
this.changeHandlers.add(o), s.setOnChange(o);
|
|
2013
2013
|
} else {
|
|
@@ -2033,7 +2033,7 @@ const Q = class Q {
|
|
|
2033
2033
|
ct(l) && (this.addSetting(i, l), n = l);
|
|
2034
2034
|
}
|
|
2035
2035
|
}
|
|
2036
|
-
n && (
|
|
2036
|
+
n && (L(n) || F(n)) && typeof n.setValue == "function" && n.setValue(s);
|
|
2037
2037
|
}), setTimeout(() => {
|
|
2038
2038
|
this.forceChildUIRefresh();
|
|
2039
2039
|
}, 0);
|
|
@@ -2047,7 +2047,7 @@ const Q = class Q {
|
|
|
2047
2047
|
const s = this.getValues();
|
|
2048
2048
|
this.initialValues = s, (n = this.onChange) == null || n.call(this, s), this.updateVisibility();
|
|
2049
2049
|
};
|
|
2050
|
-
|
|
2050
|
+
L(t) ? t.setOnChange(() => e()) : F(t) ? t.setOnChange(() => e()) : (i = t.setOnChange) == null || i.call(t, () => e());
|
|
2051
2051
|
}
|
|
2052
2052
|
addSetting(t, e) {
|
|
2053
2053
|
var s, n;
|
|
@@ -2056,14 +2056,14 @@ const Q = class Q {
|
|
|
2056
2056
|
".setting-group-content"
|
|
2057
2057
|
);
|
|
2058
2058
|
if (o) {
|
|
2059
|
-
|
|
2059
|
+
L(e) && typeof e.setNestingLevel == "function" && e.setNestingLevel(this.nestingLevel + 1);
|
|
2060
2060
|
const a = e.draw(), l = this.deleteItemCfg ?? this.addItemCfg;
|
|
2061
2061
|
if (l) {
|
|
2062
|
-
const
|
|
2063
|
-
|
|
2062
|
+
const d = l.keyPrefix ?? ((s = this.addItemCfg) == null ? void 0 : s.keyPrefix);
|
|
2063
|
+
d && t.startsWith(d) && this.addDeleteButtonToElement(a, t);
|
|
2064
2064
|
}
|
|
2065
2065
|
const r = o.querySelector(".sg-add-button-bottom");
|
|
2066
|
-
r ? o.insertBefore(a, r) : o.appendChild(a), rt.trackElement(a),
|
|
2066
|
+
r ? o.insertBefore(a, r) : o.appendChild(a), rt.trackElement(a), _(a, this.nestingLevel + 1), et(a, this.nestingLevel + 1);
|
|
2067
2067
|
const c = a.style.display;
|
|
2068
2068
|
a.style.display = "none", a.offsetHeight, a.style.display = c, this.updateNestingStyles();
|
|
2069
2069
|
}
|
|
@@ -2212,11 +2212,11 @@ const Q = class Q {
|
|
|
2212
2212
|
r(), t(!1);
|
|
2213
2213
|
}), l.addEventListener("click", () => {
|
|
2214
2214
|
r(), t(!0);
|
|
2215
|
-
}), e.addEventListener("click", (
|
|
2216
|
-
|
|
2215
|
+
}), e.addEventListener("click", (d) => {
|
|
2216
|
+
d.target === e && (r(), t(!1));
|
|
2217
2217
|
});
|
|
2218
|
-
const c = (
|
|
2219
|
-
|
|
2218
|
+
const c = (d) => {
|
|
2219
|
+
d.key === "Escape" && (r(), t(!1), document.removeEventListener("keydown", c));
|
|
2220
2220
|
};
|
|
2221
2221
|
document.addEventListener("keydown", c), o.appendChild(a), o.appendChild(l), i.appendChild(s), i.appendChild(n), i.appendChild(o), e.appendChild(i), document.body.appendChild(e), requestAnimationFrame(() => {
|
|
2222
2222
|
e.style.opacity = "1", i.style.transform = "scale(1)";
|
|
@@ -2251,7 +2251,7 @@ const Q = class Q {
|
|
|
2251
2251
|
for (const i in this.settings)
|
|
2252
2252
|
if (Object.prototype.hasOwnProperty.call(this.settings, i)) {
|
|
2253
2253
|
const s = this.settings[i];
|
|
2254
|
-
if (
|
|
2254
|
+
if (L(s))
|
|
2255
2255
|
e[i] = s.getValues();
|
|
2256
2256
|
else {
|
|
2257
2257
|
const n = s;
|
|
@@ -2262,7 +2262,7 @@ const Q = class Q {
|
|
|
2262
2262
|
} else {
|
|
2263
2263
|
const e = this.settings[t];
|
|
2264
2264
|
if (!e) return;
|
|
2265
|
-
if (
|
|
2265
|
+
if (L(e)) return e.getValues();
|
|
2266
2266
|
const i = e;
|
|
2267
2267
|
return i.getValue ? i.getValue() : i.value;
|
|
2268
2268
|
}
|
|
@@ -2275,7 +2275,7 @@ const Q = class Q {
|
|
|
2275
2275
|
for (const s in this.settings)
|
|
2276
2276
|
if (Object.prototype.hasOwnProperty.call(this.settings, s)) {
|
|
2277
2277
|
const n = this.settings[s];
|
|
2278
|
-
if (
|
|
2278
|
+
if (L(n)) {
|
|
2279
2279
|
const o = n.getValuesForJson();
|
|
2280
2280
|
o !== null && (i[s] = o);
|
|
2281
2281
|
} else {
|
|
@@ -2292,7 +2292,7 @@ const Q = class Q {
|
|
|
2292
2292
|
} else {
|
|
2293
2293
|
const i = this.settings[t];
|
|
2294
2294
|
if (!i) return;
|
|
2295
|
-
if (
|
|
2295
|
+
if (L(i))
|
|
2296
2296
|
return i.includeGetJson === !1 ? null : i.getValuesForJson();
|
|
2297
2297
|
{
|
|
2298
2298
|
const s = i;
|
|
@@ -2311,7 +2311,7 @@ const Q = class Q {
|
|
|
2311
2311
|
for (const i in this.settings)
|
|
2312
2312
|
if (Object.prototype.hasOwnProperty.call(this.settings, i)) {
|
|
2313
2313
|
const s = this.settings[i];
|
|
2314
|
-
if (
|
|
2314
|
+
if (L(s))
|
|
2315
2315
|
e[i] = s.getDefaultValues();
|
|
2316
2316
|
else {
|
|
2317
2317
|
const n = s;
|
|
@@ -2322,14 +2322,14 @@ const Q = class Q {
|
|
|
2322
2322
|
} else {
|
|
2323
2323
|
const e = this.settings[t];
|
|
2324
2324
|
if (!e) return;
|
|
2325
|
-
if (
|
|
2325
|
+
if (L(e)) return e.getDefaultValues();
|
|
2326
2326
|
const i = e;
|
|
2327
2327
|
return i.default !== void 0 ? i.default : i.value;
|
|
2328
2328
|
}
|
|
2329
2329
|
}
|
|
2330
2330
|
draw() {
|
|
2331
2331
|
const t = document.createElement("div");
|
|
2332
|
-
t.className = "setting-group", t.id = `setting-group-${this.id}`, Q.hiddenElements.add(t), this.hide && (t.style.display = "none"), this.isMain && t.classList.add("main-group"), this.custom && t.classList.add("custom_class"),
|
|
2332
|
+
t.className = "setting-group", t.id = `setting-group-${this.id}`, Q.hiddenElements.add(t), this.hide && (t.style.display = "none"), this.isMain && t.classList.add("main-group"), this.custom && t.classList.add("custom_class"), _(t, this.nestingLevel);
|
|
2333
2333
|
const e = document.createElement("div");
|
|
2334
2334
|
e.className = "setting-group-title", this.isCollapsed && e.classList.add("collapsed-view"), e.setAttribute("role", "button"), e.setAttribute(
|
|
2335
2335
|
"aria-expanded",
|
|
@@ -2360,14 +2360,14 @@ const Q = class Q {
|
|
|
2360
2360
|
}, Object.keys(this.settings).length > 0) {
|
|
2361
2361
|
for (const c in this.settings)
|
|
2362
2362
|
if (Object.prototype.hasOwnProperty.call(this.settings, c)) {
|
|
2363
|
-
const
|
|
2364
|
-
|
|
2365
|
-
const
|
|
2366
|
-
|
|
2367
|
-
|
|
2363
|
+
const d = this.settings[c];
|
|
2364
|
+
L(d) && typeof d.setNestingLevel == "function" && d.setNestingLevel(this.nestingLevel + 1);
|
|
2365
|
+
const h = d.draw();
|
|
2366
|
+
L(d) && d.deleteItemCfg && this.addDeleteButtonToElement(
|
|
2367
|
+
h,
|
|
2368
2368
|
c,
|
|
2369
|
-
|
|
2370
|
-
), a.appendChild(
|
|
2369
|
+
d
|
|
2370
|
+
), a.appendChild(h);
|
|
2371
2371
|
}
|
|
2372
2372
|
} else {
|
|
2373
2373
|
const c = document.createElement("div");
|
|
@@ -2376,18 +2376,18 @@ const Q = class Q {
|
|
|
2376
2376
|
if (this.addItemCfg) {
|
|
2377
2377
|
const c = document.createElement("button");
|
|
2378
2378
|
c.type = "button", c.className = "sg-add-button-bottom", c.style.marginTop = "8px";
|
|
2379
|
-
const
|
|
2379
|
+
const d = `
|
|
2380
2380
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none"
|
|
2381
2381
|
xmlns="http://www.w3.org/2000/svg">
|
|
2382
2382
|
<path d="M8 3.333v9.334M3.333 8h9.334" stroke="currentColor"
|
|
2383
2383
|
stroke-width="1.5" stroke-linecap="round"/>
|
|
2384
2384
|
</svg>`;
|
|
2385
|
-
c.innerHTML = `${
|
|
2386
|
-
|
|
2387
|
-
const g = this.getNextIndexFromPrefix(this.addItemCfg.keyPrefix),
|
|
2388
|
-
if (ct(
|
|
2385
|
+
c.innerHTML = `${d}<span style="margin-left:4px;">${this.addItemCfg.buttonLabel ?? "Add"}</span>`, c.addEventListener("click", (h) => {
|
|
2386
|
+
h.stopPropagation(), h.preventDefault();
|
|
2387
|
+
const g = this.getNextIndexFromPrefix(this.addItemCfg.keyPrefix), f = this.addItemCfg.createItem(g);
|
|
2388
|
+
if (ct(f)) {
|
|
2389
2389
|
const m = `${this.addItemCfg.keyPrefix}${g}`;
|
|
2390
|
-
this.addSetting(m,
|
|
2390
|
+
this.addSetting(m, f);
|
|
2391
2391
|
}
|
|
2392
2392
|
}), a.appendChild(c);
|
|
2393
2393
|
}
|
|
@@ -2434,11 +2434,11 @@ const Q = class Q {
|
|
|
2434
2434
|
}
|
|
2435
2435
|
};
|
|
2436
2436
|
Q.hiddenElements = /* @__PURE__ */ new Set();
|
|
2437
|
-
let
|
|
2438
|
-
function
|
|
2439
|
-
return new
|
|
2437
|
+
let H = Q;
|
|
2438
|
+
function Me(p) {
|
|
2439
|
+
return new Ft(p);
|
|
2440
2440
|
}
|
|
2441
|
-
class
|
|
2441
|
+
class Ft extends H {
|
|
2442
2442
|
constructor(t) {
|
|
2443
2443
|
super(t);
|
|
2444
2444
|
const e = Object.keys(this.settings)[0];
|
|
@@ -2488,9 +2488,9 @@ class At extends $ {
|
|
|
2488
2488
|
r.className = "tab-button", r.type = "button", r.setAttribute("data-tab-id", a), r.textContent = a, r.addEventListener("click", () => this.switchToTab(a)), n.appendChild(r);
|
|
2489
2489
|
const c = document.createElement("div");
|
|
2490
2490
|
c.className = "tab-panel", this.contentContainers[a] = c;
|
|
2491
|
-
const
|
|
2492
|
-
|
|
2493
|
-
|
|
2491
|
+
const d = this.settings[a];
|
|
2492
|
+
d && (L(d) && typeof d.setNestingLevel == "function" && d.setNestingLevel(this.getNestingLevel() + 1), c.appendChild(
|
|
2493
|
+
d.draw()
|
|
2494
2494
|
)), o.appendChild(c), l === 0 && !this.activeTabId && (this.activeTabId = a);
|
|
2495
2495
|
}), e.appendChild(i), e.appendChild(n), e.appendChild(o), !this.activeTabId) {
|
|
2496
2496
|
const a = Object.keys(this.settings)[0];
|
|
@@ -2499,13 +2499,13 @@ class At extends $ {
|
|
|
2499
2499
|
return this.updateTabUI(), t;
|
|
2500
2500
|
}
|
|
2501
2501
|
}
|
|
2502
|
-
function
|
|
2503
|
-
return new
|
|
2502
|
+
function Gt(p) {
|
|
2503
|
+
return new H(p);
|
|
2504
2504
|
}
|
|
2505
|
-
function
|
|
2506
|
-
return
|
|
2505
|
+
function Ie(p) {
|
|
2506
|
+
return p;
|
|
2507
2507
|
}
|
|
2508
|
-
class
|
|
2508
|
+
class Rt extends w {
|
|
2509
2509
|
constructor(t = {}) {
|
|
2510
2510
|
super(t), this.inputType = "text", t.onChange && this.setOnChange(t.onChange);
|
|
2511
2511
|
}
|
|
@@ -2525,12 +2525,12 @@ class Gt extends x {
|
|
|
2525
2525
|
});
|
|
2526
2526
|
}
|
|
2527
2527
|
}
|
|
2528
|
-
const
|
|
2529
|
-
class O extends
|
|
2528
|
+
const zt = "<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>";
|
|
2529
|
+
class O extends Rt {
|
|
2530
2530
|
constructor(t) {
|
|
2531
2531
|
super({
|
|
2532
2532
|
...t,
|
|
2533
|
-
icon: t.icon ||
|
|
2533
|
+
icon: t.icon || zt,
|
|
2534
2534
|
title: t.title || "Color",
|
|
2535
2535
|
default: t.default ? O.normalizeColorValue(t.default) : "#000000"
|
|
2536
2536
|
}), this.inputType = "color", this.element = null, this.colorInputEl = null, this.textInputEl = null, this.detectChange = t.detectChange;
|
|
@@ -2546,8 +2546,8 @@ class O extends Gt {
|
|
|
2546
2546
|
if (e.length !== 3 || e.some(isNaN))
|
|
2547
2547
|
return console.warn(`Invalid RGB value "${t}", using default "#000000"`), "#000000";
|
|
2548
2548
|
const [i, s, n] = e, o = Math.max(0, Math.min(255, i)), a = Math.max(0, Math.min(255, s)), l = Math.max(0, Math.min(255, n)), r = (c) => {
|
|
2549
|
-
const
|
|
2550
|
-
return
|
|
2549
|
+
const d = c.toString(16);
|
|
2550
|
+
return d.length === 1 ? "0" + d : d;
|
|
2551
2551
|
};
|
|
2552
2552
|
return `#${r(o)}${r(a)}${r(l)}`;
|
|
2553
2553
|
}
|
|
@@ -2595,27 +2595,27 @@ class O extends Gt {
|
|
|
2595
2595
|
a.className = "color-content-global", a.style.display = "none", a.style.display = "grid", a.style.gridTemplateColumns = "repeat(auto-fill, minmax(30px, 1fr))", a.style.gap = "8px";
|
|
2596
2596
|
const l = () => {
|
|
2597
2597
|
try {
|
|
2598
|
-
if (console.log("ColorSetting: renderGlobalOptions called"), a.innerHTML = "", !
|
|
2598
|
+
if (console.log("ColorSetting: renderGlobalOptions called"), a.innerHTML = "", !w) {
|
|
2599
2599
|
console.error("ColorSetting: Setting class is undefined");
|
|
2600
2600
|
const u = document.createElement("div");
|
|
2601
2601
|
u.textContent = "Error: System error (Setting undefined)", a.appendChild(u);
|
|
2602
2602
|
return;
|
|
2603
2603
|
}
|
|
2604
|
-
const m =
|
|
2604
|
+
const m = w.GlobalVariables || {};
|
|
2605
2605
|
if (console.log("ColorSetting: GlobalVariables:", m), !m || Object.keys(m).length === 0) {
|
|
2606
2606
|
const u = document.createElement("div");
|
|
2607
2607
|
u.textContent = "No global colors defined", u.style.gridColumn = "1 / -1", u.style.fontSize = "12px", u.style.color = "#666", a.appendChild(u);
|
|
2608
2608
|
return;
|
|
2609
2609
|
}
|
|
2610
|
-
Object.entries(m).forEach(([u,
|
|
2610
|
+
Object.entries(m).forEach(([u, C]) => {
|
|
2611
2611
|
const v = document.createElement("button");
|
|
2612
|
-
v.className = "global-color-btn", v.title = u, v.style.width = "30px", v.style.height = "30px", v.style.borderRadius = "50%", v.style.border = "1px solid #ddd", v.style.backgroundColor =
|
|
2613
|
-
var
|
|
2612
|
+
v.className = "global-color-btn", v.title = u, v.style.width = "30px", v.style.height = "30px", v.style.borderRadius = "50%", v.style.border = "1px solid #ddd", v.style.backgroundColor = C, v.style.cursor = "pointer", this.value === `var(--${u})` && (v.style.border = "2px solid #2196f3"), v.addEventListener("click", (y) => {
|
|
2613
|
+
var k, N;
|
|
2614
2614
|
y.preventDefault();
|
|
2615
|
-
const
|
|
2616
|
-
this.value =
|
|
2615
|
+
const x = `var(--${u})`;
|
|
2616
|
+
this.value = x, (k = this.onChange) == null || k.call(this, x), (N = this.detectChange) == null || N.call(this, x), Array.from(a.children).forEach((E) => {
|
|
2617
2617
|
E.style.border = "1px solid #ddd";
|
|
2618
|
-
}), v.style.border = "2px solid #2196f3",
|
|
2618
|
+
}), v.style.border = "2px solid #2196f3", d.style.backgroundColor = C;
|
|
2619
2619
|
}), a.appendChild(v);
|
|
2620
2620
|
});
|
|
2621
2621
|
} catch (m) {
|
|
@@ -2635,44 +2635,44 @@ class O extends Gt {
|
|
|
2635
2635
|
return v ? e.classList.remove("error") : e.classList.add("error"), v;
|
|
2636
2636
|
}, c = document.createElement("input");
|
|
2637
2637
|
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;
|
|
2638
|
-
const
|
|
2639
|
-
|
|
2640
|
-
let
|
|
2641
|
-
if (
|
|
2642
|
-
const m =
|
|
2643
|
-
|
|
2638
|
+
const d = document.createElement("div");
|
|
2639
|
+
d.className = "color-preview";
|
|
2640
|
+
let h = this.value || "#000000";
|
|
2641
|
+
if (h.startsWith("var(--")) {
|
|
2642
|
+
const m = h.replace("var(--", "").replace(")", "");
|
|
2643
|
+
h = (w.GlobalVariables || {})[m] || "#000000";
|
|
2644
2644
|
}
|
|
2645
|
-
|
|
2645
|
+
d.style.backgroundColor = h;
|
|
2646
2646
|
const g = document.createElement("input");
|
|
2647
2647
|
g.type = "text", g.className = "color-text-input", g.value = this.value || "", g.placeholder = "#000000", g.setAttribute("pattern", "#[0-9A-Fa-f]{6}"), g.setAttribute("title", "Enter a hex color value (e.g., #ff0000)"), g.setAttribute("aria-label", "Hex color value"), g.setAttribute("maxlength", "7"), this.getDataPropsPath() && g.setAttribute("data-test-id", `${this.getDataPropsPath()}_text`), this.textInputEl = g;
|
|
2648
|
-
const
|
|
2649
|
-
var
|
|
2648
|
+
const f = (m) => {
|
|
2649
|
+
var C, v;
|
|
2650
2650
|
let u = m.trim();
|
|
2651
2651
|
if (u && !u.startsWith("#") && !u.startsWith("var(") && /^[0-9A-Fa-f]{3}$|^[0-9A-Fa-f]{6}$/.test(u) && (u = "#" + u, this.textInputEl && (this.textInputEl.value = u)), this.textInputEl && r(this.textInputEl)) {
|
|
2652
2652
|
const y = O.normalizeColorValue(u);
|
|
2653
|
-
this.value = y, (
|
|
2653
|
+
this.value = y, (C = this.onChange) == null || C.call(this, y), (v = this.detectChange) == null || v.call(this, y), this.colorInputEl && (this.colorInputEl.value = y), d.style.backgroundColor = y;
|
|
2654
2654
|
}
|
|
2655
2655
|
};
|
|
2656
2656
|
return this.textInputEl.addEventListener("input", (m) => {
|
|
2657
2657
|
const u = m.target.value;
|
|
2658
|
-
|
|
2658
|
+
f(u);
|
|
2659
2659
|
}), this.textInputEl.addEventListener("paste", (m) => {
|
|
2660
|
-
var
|
|
2660
|
+
var C;
|
|
2661
2661
|
m.preventDefault();
|
|
2662
|
-
const u = ((
|
|
2663
|
-
this.textInputEl && (this.textInputEl.value = u.trim(),
|
|
2662
|
+
const u = ((C = m.clipboardData) == null ? void 0 : C.getData("text")) || "";
|
|
2663
|
+
this.textInputEl && (this.textInputEl.value = u.trim(), f(u));
|
|
2664
2664
|
}), this.textInputEl.addEventListener("keydown", (m) => {
|
|
2665
|
-
var u,
|
|
2666
|
-
m.key === "Enter" && (m.preventDefault(),
|
|
2665
|
+
var u, C, v;
|
|
2666
|
+
m.key === "Enter" && (m.preventDefault(), f(((u = this.textInputEl) == null ? void 0 : u.value) || ""), (C = this.textInputEl) == null || C.blur()), m.key === "Escape" && (this.textInputEl && this.value && (this.textInputEl.value = this.value), (v = this.textInputEl) == null || v.blur(), e.classList.remove("error"));
|
|
2667
2667
|
}), this.colorInputEl.addEventListener("input", (m) => {
|
|
2668
2668
|
var v, y;
|
|
2669
|
-
const u = m.target.value,
|
|
2670
|
-
this.value =
|
|
2669
|
+
const u = m.target.value, C = O.normalizeColorValue(u);
|
|
2670
|
+
this.value = C, (v = this.onChange) == null || v.call(this, C), (y = this.detectChange) == null || y.call(this, C), this.textInputEl && (this.textInputEl.value = C), d.style.backgroundColor = C, e.classList.remove("error");
|
|
2671
2671
|
}), this.colorInputEl.addEventListener("change", (m) => {
|
|
2672
2672
|
var v, y;
|
|
2673
|
-
const u = m.target.value,
|
|
2674
|
-
this.value =
|
|
2675
|
-
}), o.appendChild(c), o.appendChild(
|
|
2673
|
+
const u = m.target.value, C = O.normalizeColorValue(u);
|
|
2674
|
+
this.value = C, (v = this.onChange) == null || v.call(this, C), (y = this.detectChange) == null || y.call(this, C), this.textInputEl && (this.textInputEl.value = C), d.style.backgroundColor = C;
|
|
2675
|
+
}), o.appendChild(c), o.appendChild(d), o.appendChild(g), e.appendChild(i), e.appendChild(o), e.appendChild(a), t.appendChild(e), this.element = t, t;
|
|
2676
2676
|
}
|
|
2677
2677
|
getElement() {
|
|
2678
2678
|
return this.element;
|
|
@@ -2690,17 +2690,17 @@ class O extends Gt {
|
|
|
2690
2690
|
return this.isValidHex() ? this.hexToRgb(this.value) : "0, 0, 0";
|
|
2691
2691
|
}
|
|
2692
2692
|
}
|
|
2693
|
-
const
|
|
2693
|
+
const Ut = `
|
|
2694
2694
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2695
2695
|
<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"/>
|
|
2696
2696
|
<path d="M9 17C13.4183 17 17 13.4183 17 9C17 4.58172 13.4183 1 9 1C4.58172 1 1 4.58172 1 9C1 13.4183 4.58172 17 9 17Z" stroke="#667085" stroke-width="0.5" stroke-linecap="round" stroke-linejoin="round" opacity="0.5"/>
|
|
2697
2697
|
<path d="M9 1V17C4.58172 17 1 13.4183 1 9C1 4.58172 4.58172 1 9 1Z" fill="#667085" stroke="#667085" stroke-width="0.5" stroke-linecap="round" stroke-linejoin="round" opacity="0.5"/>
|
|
2698
2698
|
</svg>`;
|
|
2699
|
-
class z extends
|
|
2699
|
+
class z extends w {
|
|
2700
2700
|
constructor(t = {}) {
|
|
2701
2701
|
super({
|
|
2702
2702
|
...t,
|
|
2703
|
-
icon: t.icon ||
|
|
2703
|
+
icon: t.icon || Ut,
|
|
2704
2704
|
title: t.title || "Color & Opacity",
|
|
2705
2705
|
default: t.default || "#000000FF"
|
|
2706
2706
|
}), this.inputType = "color", this.element = null, this.colorInputEl = null, this.textInputEl = null, this.opacityInputEl = null, this.colorPreviewEl = null, this.detectChange = t.detectChange, this.value && (this.value = z.normalizeHexWithOpacity(this.value));
|
|
@@ -2833,7 +2833,7 @@ class z extends x {
|
|
|
2833
2833
|
};
|
|
2834
2834
|
}
|
|
2835
2835
|
}
|
|
2836
|
-
class
|
|
2836
|
+
class Ne extends w {
|
|
2837
2837
|
constructor(t = {}) {
|
|
2838
2838
|
super(t), this.inputType = "text", t.onChange && this.setOnChange(t.onChange);
|
|
2839
2839
|
}
|
|
@@ -2865,7 +2865,7 @@ class xe extends x {
|
|
|
2865
2865
|
return e.addEventListener("input", i), e.addEventListener("change", i), e.addEventListener("blur", s), t.appendChild(e), t;
|
|
2866
2866
|
}
|
|
2867
2867
|
}
|
|
2868
|
-
class
|
|
2868
|
+
class B extends w {
|
|
2869
2869
|
constructor(t) {
|
|
2870
2870
|
super(t), this.inputType = "number", this.inputElement = null, this.mobileValue = t.mobile, this.validateProps(), this.value = this.validateValue(this.value);
|
|
2871
2871
|
}
|
|
@@ -2924,12 +2924,12 @@ class H extends x {
|
|
|
2924
2924
|
);
|
|
2925
2925
|
}
|
|
2926
2926
|
}
|
|
2927
|
-
const
|
|
2927
|
+
const Wt = `
|
|
2928
2928
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2929
2929
|
<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"/>
|
|
2930
2930
|
<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"/>
|
|
2931
2931
|
</svg>`;
|
|
2932
|
-
class
|
|
2932
|
+
class jt extends B {
|
|
2933
2933
|
constructor(t = {}) {
|
|
2934
2934
|
const e = {
|
|
2935
2935
|
title: "Opacity",
|
|
@@ -2938,7 +2938,7 @@ class Ut extends H {
|
|
|
2938
2938
|
maxValue: 100,
|
|
2939
2939
|
step: 1,
|
|
2940
2940
|
default: t.default ?? 100,
|
|
2941
|
-
icon:
|
|
2941
|
+
icon: Wt,
|
|
2942
2942
|
...t
|
|
2943
2943
|
};
|
|
2944
2944
|
super(e), this.inputType = "number", this.mobileValue = t.mobile;
|
|
@@ -2950,12 +2950,12 @@ class Ut extends H {
|
|
|
2950
2950
|
this.mobileValue = t, t !== void 0 && this.setValue(t);
|
|
2951
2951
|
}
|
|
2952
2952
|
}
|
|
2953
|
-
const
|
|
2953
|
+
const qt = `
|
|
2954
2954
|
<svg xmlns="http://www.w3.org/2000/svg" class="svg-select" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-down">
|
|
2955
2955
|
<polyline points="6 9 12 15 18 9"></polyline>
|
|
2956
2956
|
</svg>
|
|
2957
2957
|
`;
|
|
2958
|
-
class nt extends
|
|
2958
|
+
class nt extends w {
|
|
2959
2959
|
constructor(t = {}) {
|
|
2960
2960
|
if (super(t), this.inputType = "select", this._options = [], this.isOpen = !1, this.selectedOptionIndex = null, this.optionsListEl = null, this.svgContainer = null, this.buttonEl = null, this.isLoading = !1, this.container = null, this.clickOutsideListener = null, this.resizeListener = null, t.options && (this._options = [...t.options]), t.getOptions && this._options.push(...t.getOptions()), t.getOptionsAsync && (this.isLoading = !0), this.value !== void 0) {
|
|
2961
2961
|
const e = this._options.findIndex((i) => i.value === this.value);
|
|
@@ -2999,7 +2999,7 @@ class nt extends x {
|
|
|
2999
2999
|
a.onclick = (l) => this.selectOption(l, o, e), i.appendChild(a);
|
|
3000
3000
|
}), document.body.appendChild(i);
|
|
3001
3001
|
const s = document.createElement("div");
|
|
3002
|
-
return s.classList.add("svg-container"), s.innerHTML =
|
|
3002
|
+
return s.classList.add("svg-container"), s.innerHTML = qt, t.appendChild(s), this.optionsListEl = i, this.svgContainer = s, this.props.getOptionsAsync && (this.isLoading = !0, this.updateButtonText(), this.props.getOptionsAsync().then((n) => {
|
|
3003
3003
|
this._options.push(...n), this.isLoading = !1, this.updateOptionsList(), this.updateButtonText();
|
|
3004
3004
|
}).catch((n) => {
|
|
3005
3005
|
console.error("Failed to fetch async options:", n), this.isLoading = !1, this.updateButtonText("Failed to load options");
|
|
@@ -3062,7 +3062,7 @@ class nt extends x {
|
|
|
3062
3062
|
this.clickOutsideListener && (document.removeEventListener("click", this.clickOutsideListener), this.clickOutsideListener = null), this.resizeListener && (window.removeEventListener("resize", this.resizeListener), this.resizeListener = null), this.cleanupDropdownPosition(), this.optionsListEl && this.optionsListEl.parentNode && this.optionsListEl.parentNode.removeChild(this.optionsListEl), super.destroy();
|
|
3063
3063
|
}
|
|
3064
3064
|
}
|
|
3065
|
-
class
|
|
3065
|
+
class Jt extends w {
|
|
3066
3066
|
constructor(t = {}) {
|
|
3067
3067
|
super(t), this.inputType = "button", this.value || (this.value = "center");
|
|
3068
3068
|
}
|
|
@@ -3118,7 +3118,7 @@ class jt extends x {
|
|
|
3118
3118
|
}), t.appendChild(i), t;
|
|
3119
3119
|
}
|
|
3120
3120
|
}
|
|
3121
|
-
class
|
|
3121
|
+
class Se extends w {
|
|
3122
3122
|
constructor(t) {
|
|
3123
3123
|
super(t), this.inputType = "button", this.bgWithAlpha = "rgba(145, 158, 171, 0.08)";
|
|
3124
3124
|
}
|
|
@@ -3147,27 +3147,27 @@ class Le extends x {
|
|
|
3147
3147
|
return o.className = "button-setting-wrapper " + (this.props.wrapperClassName || ""), o.appendChild(t), o;
|
|
3148
3148
|
}
|
|
3149
3149
|
}
|
|
3150
|
-
class
|
|
3150
|
+
class Ve extends w {
|
|
3151
3151
|
constructor(t = {}) {
|
|
3152
3152
|
super(t), this.inputType = { width: "number", height: "number" }, this.aspectRatio = 1, this.isUpdating = !1;
|
|
3153
3153
|
const e = t.width || 0, i = t.height || 0;
|
|
3154
3154
|
this.value || (this.value = {
|
|
3155
3155
|
width: e,
|
|
3156
3156
|
height: i
|
|
3157
|
-
}), 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
|
|
3157
|
+
}), 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 B({
|
|
3158
3158
|
title: "Width",
|
|
3159
3159
|
default: this.value.width,
|
|
3160
3160
|
suffix: "px",
|
|
3161
3161
|
minValue: this.minWidth,
|
|
3162
3162
|
maxValue: this.maxWidth,
|
|
3163
|
-
icon:
|
|
3164
|
-
}), this.heightSetting = new
|
|
3163
|
+
icon: Zt
|
|
3164
|
+
}), this.heightSetting = new B({
|
|
3165
3165
|
title: "Height",
|
|
3166
3166
|
default: this.value.height,
|
|
3167
3167
|
suffix: "px",
|
|
3168
3168
|
minValue: this.minHeight,
|
|
3169
3169
|
maxValue: this.maxHeight,
|
|
3170
|
-
icon:
|
|
3170
|
+
icon: _t
|
|
3171
3171
|
}), this.widthSetting.setOnChange(this.handleWidthChange.bind(this)), this.heightSetting.setOnChange(this.handleHeightChange.bind(this));
|
|
3172
3172
|
}
|
|
3173
3173
|
handleWidthChange(t) {
|
|
@@ -3261,24 +3261,24 @@ class ke extends x {
|
|
|
3261
3261
|
}
|
|
3262
3262
|
}
|
|
3263
3263
|
}
|
|
3264
|
-
const
|
|
3264
|
+
const Zt = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
3265
3265
|
<path d="M4.5 9.5H13.5M4.5 9.5L6 7.25M4.5 9.5L6 11.75M13.5 9.5L12 7.25M13.5 9.5L12 11.75M15.75 16.25V2.75M2.25 16.25V2.75" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3266
|
-
</svg>`,
|
|
3266
|
+
</svg>`, _t = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
3267
3267
|
<path d="M9 14L9 5M9 14L6.75 12.5M9 14L11.25 12.5M9 5L6.75 6.5M9 5L11.25 6.5M15.75 2.75H2.25M15.75 16.25H2.25" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3268
3268
|
</svg>`, tt = `
|
|
3269
3269
|
<svg xmlns="http://www.w3.org/2000/svg" width="15" height="16" viewBox="0 0 15 16" fill="none">
|
|
3270
3270
|
<path d="M5 10.5L7.5 8M7.5 8L10 10.5M7.5 8V13.625M12.5 10.9643C13.2634 10.3338 13.75 9.37996 13.75 8.3125C13.75 6.41402 12.211 4.875 10.3125 4.875C10.1759 4.875 10.0482 4.80375 9.97882 4.68609C9.16379 3.30302 7.65902 2.375 5.9375 2.375C3.34867 2.375 1.25 4.47367 1.25 7.0625C1.25 8.35381 1.77215 9.52317 2.61684 10.371" stroke="#475467" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3271
3271
|
</svg>
|
|
3272
|
-
`,
|
|
3272
|
+
`, Xt = `
|
|
3273
3273
|
<svg width="91" height="71" viewBox="0 0 91 71" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
3274
3274
|
<rect width="91" height="71" rx="4" fill="#F2F4F7"/>
|
|
3275
3275
|
<path d="M37 31.5L39.5 29M39.5 29L42 31.5M39.5 29V34.625M44.5 31.9643C45.2634 31.3338 45.75 30.38 45.75 29.3125C45.75 27.414 44.211 25.875 42.3125 25.875C42.1759 25.875 42.0482 25.8037 41.9788 25.6861C41.1638 24.303 39.659 23.375 37.9375 23.375C35.3487 23.375 33.25 25.4737 33.25 28.0625C33.25 29.3538 33.7721 30.5232 34.6168 31.371" stroke="#475467" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3276
3276
|
</svg>
|
|
3277
|
-
`,
|
|
3277
|
+
`, Kt = `
|
|
3278
3278
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 12 12" fill="none">
|
|
3279
3279
|
<path d="M8 3V2.6C8 2.03995 8 1.75992 7.89101 1.54601C7.79513 1.35785 7.64215 1.20487 7.45399 1.10899C7.24008 1 6.96005 1 6.4 1H5.6C5.03995 1 4.75992 1 4.54601 1.10899C4.35785 1.20487 4.20487 1.35785 4.10899 1.54601C4 1.75992 4 2.03995 4 2.6V3M5 5.75V8.25M7 5.75V8.25M1.5 3H10.5M9.5 3V8.6C9.5 9.44008 9.5 9.86012 9.33651 10.181C9.1927 10.4632 8.96323 10.6927 8.68099 10.8365C8.36012 11 7.94008 11 7.1 11H4.9C4.05992 11 3.63988 11 3.31901 10.8365C3.03677 10.6927 2.8073 10.4632 2.66349 10.181C2.5 9.86012 2.5 9.44008 2.5 8.6V3" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3280
3280
|
</svg>
|
|
3281
|
-
`,
|
|
3281
|
+
`, Yt = `
|
|
3282
3282
|
<svg xmlns="http://www.w3.org/2000/svg" width="29" height="29" viewBox="0 0 29 29" fill="none">
|
|
3283
3283
|
<!-- Top dot -->
|
|
3284
3284
|
<circle cx="14.5" cy="3" r="1.5" fill="#02CC59" opacity="1"/>
|
|
@@ -3298,7 +3298,7 @@ const qt = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewB
|
|
|
3298
3298
|
<circle cx="6.7" cy="6.7" r="1.5" fill="#02CC59" opacity="0.3"/>
|
|
3299
3299
|
</svg>
|
|
3300
3300
|
`;
|
|
3301
|
-
class lt extends
|
|
3301
|
+
class lt extends w {
|
|
3302
3302
|
constructor(t = {}) {
|
|
3303
3303
|
super(t), this.inputType = "button", this.previewWrapper = null, this.previewEl = null, this.emptyStateEl = null, this.errorContainer = null, this.messageListener = null, this.loadingSpinner = null, this.props.delete === void 0 && (this.props.delete = !0), this.props.maxFileSizeMB === void 0 && (this.props.maxFileSizeMB = 5), !this.value && t.defaultUrl && t.defaultUrl !== "" && (this.value = t.defaultUrl), this.setupMessageListener();
|
|
3304
3304
|
}
|
|
@@ -3395,9 +3395,9 @@ class lt extends x {
|
|
|
3395
3395
|
const s = this.value && this.value !== "";
|
|
3396
3396
|
s || i.classList.add("no-image");
|
|
3397
3397
|
const n = document.createElement("div");
|
|
3398
|
-
if (n.className = "preview-placeholder", n.innerHTML =
|
|
3398
|
+
if (n.className = "preview-placeholder", n.innerHTML = Xt, this.previewWrapper = document.createElement("div"), this.previewWrapper.className = "preview-wrapper", this.loadingSpinner = document.createElement("div"), this.loadingSpinner.className = "loading-spinner", this.loadingSpinner.innerHTML = Yt, this.loadingSpinner.style.display = "none", this.previewWrapper.appendChild(this.loadingSpinner), this.previewEl = document.createElement("img"), this.previewEl.className = "upload-preview", this.props.delete) {
|
|
3399
3399
|
const a = document.createElement("button");
|
|
3400
|
-
a.className = "delete-button", a.type = "button", a.title = "Delete image", a.innerHTML =
|
|
3400
|
+
a.className = "delete-button", a.type = "button", a.title = "Delete image", a.innerHTML = Kt, this.previewWrapper.appendChild(a), a.onclick = (l) => {
|
|
3401
3401
|
var r;
|
|
3402
3402
|
l.stopPropagation(), this.value = "", this.updatePreviewState(null), (r = this.onChange) == null || r.call(this, ""), this.hideError();
|
|
3403
3403
|
};
|
|
@@ -3418,51 +3418,77 @@ class lt extends x {
|
|
|
3418
3418
|
}, t;
|
|
3419
3419
|
}
|
|
3420
3420
|
}
|
|
3421
|
-
const
|
|
3421
|
+
const gt = `
|
|
3422
3422
|
<svg xmlns="http://www.w3.org/2000/svg" width="15" height="16" viewBox="0 0 15 16" fill="none">
|
|
3423
3423
|
<path d="M5 10.5L7.5 8M7.5 8L10 10.5M7.5 8V13.625M12.5 10.9643C13.2634 10.3338 13.75 9.37996 13.75 8.3125C13.75 6.41402 12.211 4.875 10.3125 4.875C10.1759 4.875 10.0482 4.80375 9.97882 4.68609C9.16379 3.30302 7.65902 2.375 5.9375 2.375C3.34867 2.375 1.25 4.47367 1.25 7.0625C1.25 8.35381 1.77215 9.52317 2.61684 10.371" stroke="#475467" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3424
3424
|
</svg>
|
|
3425
|
-
`, Yt = `
|
|
3426
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
|
|
3427
|
-
<path d="M12 4L4 12M4 4L12 12" stroke="#667085" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3428
|
-
</svg>
|
|
3429
3425
|
`, Qt = `
|
|
3430
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="
|
|
3431
|
-
<path d="
|
|
3426
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none">
|
|
3427
|
+
<path d="M1.5 7.5C1.5 7.5 3.00374 5.45116 4.22538 4.22868C5.44702 3.0062 7.1352 2.25 9 2.25C12.7279 2.25 15.75 5.27208 15.75 9C15.75 12.7279 12.7279 15.75 9 15.75C5.92268 15.75 3.32633 13.6907 2.51382 10.875M1.5 7.5V3M1.5 7.5H6" stroke="#637381" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3432
3428
|
</svg>
|
|
3433
3429
|
`, te = `
|
|
3434
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="
|
|
3435
|
-
<path d="
|
|
3430
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
3431
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M11.9943 13.4085L17.6486 19.0631C17.8371 19.2452 18.0896 19.346 18.3516 19.3437C18.6137 19.3414 18.8644 19.2363 19.0497 19.051C19.235 18.8656 19.3402 18.6149 19.3424 18.3528C19.3447 18.0908 19.244 17.8383 19.0619 17.6497L13.4076 11.9951L19.0619 6.34039C19.244 6.15187 19.3447 5.89937 19.3424 5.63728C19.3402 5.37519 19.235 5.12448 19.0497 4.93915C18.8644 4.75382 18.6137 4.64869 18.3516 4.64642C18.0896 4.64414 17.8371 4.74489 17.6486 4.92697L11.9943 10.5816L6.34004 4.92697C6.15068 4.74939 5.89967 4.65245 5.64011 4.65667C5.38055 4.66088 5.13282 4.76592 4.94932 4.94956C4.76583 5.1332 4.66097 5.38102 4.65694 5.6406C4.65291 5.90018 4.75002 6.15114 4.92772 6.34039L10.581 11.9951L4.92672 17.6497C4.83126 17.7419 4.75511 17.8522 4.70273 17.9742C4.65035 18.0961 4.62277 18.2273 4.62162 18.36C4.62047 18.4928 4.64576 18.6244 4.69601 18.7472C4.74627 18.8701 4.82049 18.9817 4.91433 19.0755C5.00818 19.1694 5.11978 19.2436 5.24262 19.2939C5.36545 19.3441 5.49707 19.3694 5.62978 19.3683C5.7625 19.3671 5.89366 19.3395 6.0156 19.2872C6.13755 19.2348 6.24784 19.1586 6.34004 19.0631L11.9943 13.4085Z" fill="#637381"/>
|
|
3436
3432
|
</svg>
|
|
3437
3433
|
`, ee = `
|
|
3438
|
-
<svg
|
|
3439
|
-
|
|
3434
|
+
<svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
3435
|
+
<path d="M14 0.5C21.4558 0.5 27.5 6.54416 27.5 14C27.5 21.4558 21.4558 27.5 14 27.5C6.54416 27.5 0.5 21.4558 0.5 14C0.5 6.54416 6.54416 0.5 14 0.5Z" fill="#EFF1F2"/>
|
|
3436
|
+
<path d="M14 0.5C21.4558 0.5 27.5 6.54416 27.5 14C27.5 21.4558 21.4558 27.5 14 27.5C6.54416 27.5 0.5 21.4558 0.5 14C0.5 6.54416 6.54416 0.5 14 0.5Z" stroke="#FF5630"/>
|
|
3437
|
+
<path d="M7.25 9.7895C7.25 9.4265 7.50875 9.13175 7.82825 9.13175L9.827 9.13175C10.2237 9.11975 10.574 8.8325 10.709 8.408L10.7315 8.333L10.8177 8.03975C10.8702 7.85975 10.916 7.70225 10.9805 7.562C11.234 7.00775 11.7035 6.623 12.2458 6.52475C12.3837 6.5 12.5292 6.5 12.6957 6.5L15.3043 6.5C15.4715 6.5 15.617 6.5 15.7542 6.52475C16.2965 6.623 16.7667 7.00775 17.0195 7.562C17.084 7.70225 17.1297 7.859 17.183 8.03975L17.2685 8.333L17.291 8.408C17.426 8.8325 17.846 9.1205 18.2435 9.13175L20.171 9.13175C20.4912 9.13175 20.75 9.4265 20.75 9.7895C20.75 10.1525 20.4912 10.4473 20.1717 10.4473L7.8275 10.4473C7.50875 10.4473 7.25 10.1525 7.25 9.7895Z" fill="#FF5630"/>
|
|
3438
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M13.697 21.5L14.303 21.5C16.3902 21.5 17.4335 21.5 18.113 20.8355C18.791 20.171 18.86 19.0813 18.9987 16.9018L19.199 13.7608C19.274 12.578 19.3115 11.9863 18.9717 11.612C18.6312 11.237 18.0567 11.237 16.907 11.237L11.093 11.237C9.94325 11.237 9.368 11.237 9.02825 11.612C8.68775 11.987 8.72525 12.578 8.801 13.7608L9.00125 16.9018C9.14 19.0813 9.209 20.1718 9.88775 20.8355C10.5665 21.5 11.6097 21.5 13.697 21.5ZM12.6845 14.1418C12.6545 13.8163 12.3785 13.5793 12.0695 13.6115C11.7597 13.6438 11.5347 13.934 11.5655 14.2595L11.9405 18.2068C11.9705 18.5323 12.2465 18.7693 12.5555 18.737C12.8652 18.7048 13.0902 18.4145 13.0595 18.089L12.6845 14.1418ZM15.9312 13.6115C16.2402 13.6438 16.466 13.934 16.4345 14.2595L16.0595 18.2068C16.0295 18.5323 15.7527 18.7693 15.4445 18.737C15.1347 18.7048 14.9097 18.4145 14.9405 18.089L15.3155 14.1418C15.3455 13.8163 15.623 13.5793 15.9312 13.6115Z" fill="#FF5630"/>
|
|
3440
3439
|
</svg>
|
|
3441
3440
|
`, ie = `
|
|
3442
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="
|
|
3443
|
-
<path d="
|
|
3444
|
-
<path d="
|
|
3441
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="11" height="12" viewBox="0 0 11 12" fill="none">
|
|
3442
|
+
<path d="M-4.47342e-07 2.5585C-3.97978e-07 2.27617 0.20125 2.04692 0.44975 2.04692L2.00433 2.04692C2.31292 2.03758 2.58533 1.81417 2.69033 1.484L2.70783 1.42567L2.77492 1.19758C2.81575 1.05758 2.85133 0.935084 2.9015 0.826C3.09867 0.394917 3.46383 0.0956673 3.88558 0.0192507C3.99292 6.93798e-07 4.10608 7.1793e-07 4.23558 7.40573e-07L6.26442 1.09531e-06C6.3945 1.11805e-06 6.50767 1.13349e-06 6.61442 0.0192512C7.03617 0.0956679 7.40192 0.394918 7.5985 0.826001C7.64867 0.935085 7.68425 1.057 7.72567 1.19758L7.79217 1.42567L7.80967 1.484C7.91467 1.81417 8.24133 2.03817 8.5505 2.04692L10.0497 2.04692C10.2987 2.04692 10.5 2.27617 10.5 2.5585C10.5 2.84084 10.2987 3.07009 10.0502 3.07009L0.449166 3.07008C0.201249 3.07008 -4.96707e-07 2.84083 -4.47342e-07 2.5585Z" fill="#F04438"/>
|
|
3443
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M5.01433 11.6667L5.48566 11.6667C7.10908 11.6667 7.9205 11.6667 8.449 11.1498C8.97633 10.633 9.03 9.78542 9.13792 8.09025L9.29366 5.64725C9.352 4.72734 9.38117 4.26709 9.11692 3.976C8.85208 3.68434 8.40525 3.68434 7.511 3.68433L2.989 3.68433C2.09475 3.68433 1.64733 3.68433 1.38308 3.976C1.11825 4.26767 1.14742 4.72733 1.20633 5.64725L1.36208 8.09025C1.47 9.78542 1.52366 10.6336 2.05158 11.1498C2.5795 11.6667 3.39091 11.6667 5.01433 11.6667ZM4.22683 5.94358C4.2035 5.69042 3.98883 5.50608 3.7485 5.53117C3.50758 5.55625 3.33258 5.782 3.3565 6.03517L3.64816 9.10525C3.6715 9.35842 3.88617 9.54275 4.1265 9.51767C4.36742 9.49258 4.54242 9.26683 4.5185 9.01367L4.22683 5.94358ZM6.75208 5.53117C6.99242 5.55625 7.168 5.782 7.1435 6.03517L6.85183 9.10525C6.8285 9.35842 6.61325 9.54275 6.3735 9.51767C6.13258 9.49259 5.95758 9.26683 5.9815 9.01367L6.27317 5.94358C6.2965 5.69042 6.51233 5.50609 6.75208 5.53117Z" fill="#F04438"/>
|
|
3445
3444
|
</svg>
|
|
3446
3445
|
`, se = `
|
|
3447
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="
|
|
3448
|
-
|
|
3449
|
-
|
|
3446
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
3447
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.279 5.55268C10.1384 5.41223 9.94777 5.33334 9.74902 5.33334C9.55027 5.33334 9.35965 5.41223 9.21902 5.55268L4.21902 10.5527C4.07857 10.6933 3.99968 10.8839 3.99968 11.0827C3.99968 11.2814 4.07857 11.4721 4.21902 11.6127L9.21902 16.6127C9.28769 16.6864 9.37049 16.7455 9.46249 16.7865C9.55448 16.8275 9.6538 16.8495 9.7545 16.8513C9.8552 16.8531 9.95523 16.8345 10.0486 16.7968C10.142 16.7591 10.2268 16.7029 10.2981 16.6317C10.3693 16.5605 10.4254 16.4757 10.4631 16.3823C10.5009 16.2889 10.5194 16.1889 10.5176 16.0882C10.5158 15.9875 10.4938 15.8881 10.4528 15.7961C10.4118 15.7041 10.3527 15.6213 10.279 15.5527L6.55902 11.8327H14.749C15.462 11.8327 16.549 12.0527 17.436 12.6917C18.284 13.3017 18.999 14.3267 18.999 16.0827C18.999 16.2816 19.078 16.4724 19.2187 16.613C19.3593 16.7537 19.5501 16.8327 19.749 16.8327C19.9479 16.8327 20.1387 16.7537 20.2794 16.613C20.42 16.4724 20.499 16.2816 20.499 16.0827C20.499 13.8387 19.547 12.3627 18.312 11.4737C17.116 10.6127 15.702 10.3327 14.749 10.3327H6.55902L10.279 6.61268C10.4195 6.47206 10.4984 6.28143 10.4984 6.08268C10.4984 5.88393 10.4195 5.69331 10.279 5.55268Z" fill="#454F5B"/>
|
|
3448
|
+
</svg>
|
|
3449
|
+
`, ne = `
|
|
3450
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
3451
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M14.2198 5.55268C14.3604 5.41223 14.551 5.33334 14.7498 5.33334C14.9485 5.33334 15.1391 5.41223 15.2798 5.55268L20.2798 10.5527C20.4202 10.6933 20.4991 10.8839 20.4991 11.0827C20.4991 11.2814 20.4202 11.4721 20.2798 11.6127L15.2798 16.6127C15.2111 16.6864 15.1283 16.7455 15.0363 16.7865C14.9443 16.8275 14.845 16.8495 14.7443 16.8513C14.6436 16.8531 14.5435 16.8345 14.4502 16.7968C14.3568 16.7591 14.2719 16.7029 14.2007 16.6317C14.1295 16.5605 14.0734 16.4757 14.0356 16.3823C13.9979 16.2889 13.9794 16.1889 13.9812 16.0882C13.9829 15.9875 14.005 15.8881 14.046 15.7961C14.087 15.7041 14.1461 15.6213 14.2198 15.5527L17.9398 11.8327H9.74976C9.03676 11.8327 7.94976 12.0527 7.06276 12.6917C6.21476 13.3017 5.49976 14.3267 5.49976 16.0827C5.49976 16.2816 5.42074 16.4724 5.28009 16.613C5.13943 16.7537 4.94867 16.8327 4.74976 16.8327C4.55084 16.8327 4.36008 16.7537 4.21943 16.613C4.07877 16.4724 3.99976 16.2816 3.99976 16.0827C3.99976 13.8387 4.95176 12.3627 6.18676 11.4737C7.38276 10.6127 8.79676 10.3327 9.74976 10.3327H17.9398L14.2198 6.61268C14.0793 6.47206 14.0004 6.28143 14.0004 6.08268C14.0004 5.88393 14.0793 5.69331 14.2198 5.55268Z" fill="#454F5B"/>
|
|
3452
|
+
</svg>
|
|
3453
|
+
|
|
3454
|
+
`, oe = `
|
|
3455
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 15 15" fill="none">
|
|
3456
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M15 7.5C15 11.6423 11.6423 15 7.5 15C3.35775 15 0 11.6423 0 7.5C0 3.35775 3.35775 0 7.5 0C11.6423 0 15 3.35775 15 7.5ZM10.5225 5.2275C10.6278 5.33297 10.687 5.47594 10.687 5.625C10.687 5.77406 10.6278 5.91703 10.5225 6.0225L6.7725 9.7725C6.66703 9.87784 6.52406 9.93701 6.375 9.93701C6.22594 9.93701 6.08297 9.87784 5.9775 9.7725L4.4775 8.2725C4.42224 8.221 4.37791 8.1589 4.34716 8.0899C4.31642 8.0209 4.29989 7.94642 4.29856 7.87089C4.29722 7.79536 4.31112 7.72034 4.33941 7.6503C4.3677 7.58026 4.40981 7.51664 4.46322 7.46322C4.51664 7.40981 4.58026 7.3677 4.6503 7.33941C4.72034 7.31112 4.79536 7.29722 4.87089 7.29856C4.94642 7.29989 5.0209 7.31642 5.0899 7.34716C5.1589 7.37791 5.221 7.42224 5.2725 7.4775L6.375 8.58L8.05125 6.90375L9.7275 5.2275C9.83297 5.12216 9.97594 5.063 10.125 5.063C10.2741 5.063 10.417 5.12216 10.5225 5.2275Z" fill="#06CD5C"/>
|
|
3457
|
+
</svg>
|
|
3458
|
+
`, mt = `
|
|
3459
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none">
|
|
3460
|
+
<path d="M8.99998 13.5L5.57436 8.6625C5.01365 8.00048 4.65256 7.19277 4.53315 6.33346C4.41373 5.47415 4.54091 4.5986 4.89987 3.80877C5.25883 3.01895 5.83479 2.34736 6.56068 1.87222C7.28657 1.39708 8.13251 1.13795 8.99998 1.125C10.2025 1.13688 11.3512 1.62483 12.1947 2.48198C13.0381 3.33913 13.5075 4.49561 13.5 5.69812C13.5004 6.74715 13.1433 7.765 12.4875 8.58375L8.99998 13.5ZM8.99998 2.25C8.0954 2.26039 7.23191 2.62934 6.59913 3.27583C5.96634 3.92233 5.61598 4.79353 5.62498 5.69812C5.62924 6.52369 5.92623 7.32097 6.46311 7.94812L8.99998 11.5425L11.6044 7.875C12.0994 7.25706 12.371 6.4899 12.375 5.69812C12.384 4.79353 12.0336 3.92233 11.4008 3.27583C10.7681 2.62934 9.90457 2.26039 8.99998 2.25Z" fill="#637381"/>
|
|
3461
|
+
<path d="M9 6.1875C9.62132 6.1875 10.125 5.68382 10.125 5.0625C10.125 4.44118 9.62132 3.9375 9 3.9375C8.37868 3.9375 7.875 4.44118 7.875 5.0625C7.875 5.68382 8.37868 6.1875 9 6.1875Z" fill="#637381"/>
|
|
3462
|
+
<path d="M15.75 6.75H14.625V7.875H15.75V15.75H2.25V7.875H3.375V6.75H2.25C1.95163 6.75 1.66548 6.86853 1.4545 7.07951C1.24353 7.29048 1.125 7.57663 1.125 7.875V15.75C1.125 16.0484 1.24353 16.3345 1.4545 16.5455C1.66548 16.7565 1.95163 16.875 2.25 16.875H15.75C16.0484 16.875 16.3345 16.7565 16.5455 16.5455C16.7565 16.3345 16.875 16.0484 16.875 15.75V7.875C16.875 7.57663 16.7565 7.29048 16.5455 7.07951C16.3345 6.86853 16.0484 6.75 15.75 6.75Z" fill="#637381"/>
|
|
3463
|
+
</svg>
|
|
3464
|
+
`, ae = `
|
|
3465
|
+
<svg width="27" height="34" viewBox="0 0 27 34" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
3466
|
+
<path d="M13.2217 0.25C20.3738 0.25 26.1942 6.06962 26.1943 13.2217V13.2227C26.2179 18.4466 22.9671 23.3445 19.666 26.9609C18.0203 28.7638 16.3726 30.2373 15.1357 31.2598C14.5176 31.7708 14.0026 32.1695 13.6426 32.4395C13.4628 32.5743 13.3215 32.6771 13.2256 32.7461L13.2227 32.7471C12.5085 32.2389 9.52009 30.06 6.58984 26.8271C3.35339 23.2564 0.226466 18.445 0.25 13.2148V13.2139C0.25 6.07018 6.06958 0.25024 13.2217 0.25Z" fill="#F04438" stroke="#A82A21" stroke-width="0.5"/>
|
|
3450
3467
|
</svg>
|
|
3451
|
-
`,
|
|
3468
|
+
`, le = `
|
|
3469
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none">
|
|
3470
|
+
<path d="M14.4132 4.80441C14.7371 4.80441 15 5.06731 15 5.39119C15 5.71507 14.7371 5.97797 14.4132 5.97797H13.7595L13.3736 11.7568C13.3426 12.2221 13.3179 12.6056 13.2722 12.9163C13.2256 13.234 13.1515 13.523 12.9982 13.7921C12.7591 14.2119 12.3978 14.5496 11.963 14.7604C11.6845 14.8953 11.3913 14.9499 11.0714 14.9753C10.7584 15.0002 10.3738 15 9.90749 15H8.09251C7.62617 15 7.24164 15.0002 6.92863 14.9753C6.6087 14.9499 6.31554 14.8953 6.037 14.7604C5.60221 14.5496 5.24093 14.2119 5.00176 13.7921C4.84855 13.523 4.77439 13.234 4.72775 12.9163C4.68215 12.6056 4.65745 12.2221 4.62643 11.7568L4.24053 5.97797H3.58678C3.26291 5.97797 3 5.71507 3 5.39119C3 5.06731 3.26291 4.80441 3.58678 4.80441H14.4132ZM5.79648 11.6793C5.82874 12.1632 5.8517 12.4923 5.88899 12.7463C5.9252 12.9927 5.96948 13.1207 6.02115 13.2115C6.14297 13.4253 6.32656 13.5975 6.54802 13.7048C6.64205 13.7504 6.7733 13.7864 7.02203 13.8062C7.27784 13.8265 7.6077 13.8264 8.09251 13.8264H9.90749C10.3923 13.8264 10.7222 13.8265 10.978 13.8062C11.2267 13.7864 11.358 13.7504 11.452 13.7048C11.6734 13.5975 11.857 13.4253 11.9789 13.2115C12.0305 13.1207 12.0748 12.9927 12.111 12.7463C12.1483 12.4923 12.1713 12.1632 12.2035 11.6793L12.5841 5.97797H5.41586L5.79648 11.6793ZM7.21057 11.1048V8.0978C7.21057 7.77392 7.47348 7.51101 7.79736 7.51101C8.1211 7.51117 8.38326 7.77402 8.38326 8.0978V11.1048C8.38326 11.4286 8.1211 11.6915 7.79736 11.6916C7.47348 11.6916 7.21057 11.4287 7.21057 11.1048ZM9.61674 11.1048V8.0978C9.61674 7.77402 9.8789 7.51117 10.2026 7.51101C10.5265 7.51101 10.7894 7.77392 10.7894 8.0978V11.1048C10.7894 11.4287 10.5265 11.6916 10.2026 11.6916C9.8789 11.6915 9.61674 11.4286 9.61674 11.1048ZM10.8044 3C11.1283 3 11.3912 3.26291 11.3912 3.58678C11.3912 3.91066 11.1283 4.17357 10.8044 4.17357H7.19559C6.87172 4.17357 6.60881 3.91066 6.60881 3.58678C6.60881 3.26291 6.87172 3 7.19559 3H10.8044Z" fill="#46525C"/>
|
|
3471
|
+
</svg>
|
|
3472
|
+
`, re = `
|
|
3473
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="8" height="4" viewBox="0 0 8 4" fill="none">
|
|
3474
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M0 0L2.58579 2.58579C3.36684 3.36684 4.63317 3.36683 5.41421 2.58579L8 0L0 0Z" fill="#1C252E"/>
|
|
3475
|
+
</svg>
|
|
3476
|
+
`, $ = class $ extends w {
|
|
3452
3477
|
constructor(t = {}) {
|
|
3478
|
+
var e;
|
|
3453
3479
|
super(t), this.inputType = {
|
|
3454
3480
|
imageUrl: "text",
|
|
3455
3481
|
markers: "text"
|
|
3456
|
-
}, this.mainButton = null, this.thumbnailEl = null, this.markerCountEl = null, this.popoverEl = null, this.backdropEl = null, this.imageElement = null, this.cursorTooltip = null, this.popoverPosition = null, this.isPopoverOpen = !1, this.confirmOverlayEl = null, this.confirmPromise = null, this.lastImageNaturalSize = null, this.draggingMarkerId = null, this.history = [], this.historyIndex = -1, this.isUndoRedoOperation = !1, this.initialValue = null, this.messageListener = null, this.props.maxMarkers = this.props.maxMarkers ?? 10, this.props.maxFileSizeMB = this.props.maxFileSizeMB ??
|
|
3457
|
-
if (this.isPopoverOpen && this.popoverEl && !this.popoverEl.contains(
|
|
3458
|
-
if (
|
|
3482
|
+
}, this.mainButton = null, this.thumbnailEl = null, this.markerCountEl = null, this.mapIconEl = null, this.popoverEl = null, this.backdropEl = null, this.imageElement = null, this.cursorTooltip = null, this.popoverPosition = null, this.isPopoverOpen = !1, this.confirmOverlayEl = null, this.confirmPromise = null, this.lastImageNaturalSize = null, this.draggingMarkerId = null, this.history = [], this.historyIndex = -1, this.isUndoRedoOperation = !1, this.initialValue = null, this.messageListener = null, this.props.maxMarkers = this.props.maxMarkers ?? ((e = this.props.prizeMap) == null ? void 0 : e.length) ?? 10, this.props.maxFileSizeMB = this.props.maxFileSizeMB ?? 5e3, this.props.markerSize = this.props.markerSize ?? 24, this.value || (this.value = { imageUrl: "", markers: [] }), this.setupMessageListener(), this.onBackgroundClick = (i) => {
|
|
3483
|
+
if (this.isPopoverOpen && this.popoverEl && !this.popoverEl.contains(i.target)) {
|
|
3484
|
+
if (i.target.closest(
|
|
3459
3485
|
'[class*="modal"], [class*="Modal"], [class*="dialog"], [class*="Dialog"], [class*="overlay"], [class*="Overlay"]'
|
|
3460
3486
|
))
|
|
3461
3487
|
return;
|
|
3462
3488
|
this.closePopover();
|
|
3463
3489
|
}
|
|
3464
|
-
}, this.handlePopoverKeydown = (
|
|
3465
|
-
this.isPopoverOpen && (
|
|
3490
|
+
}, this.handlePopoverKeydown = (i) => {
|
|
3491
|
+
this.isPopoverOpen && (i.key === "Escape" ? this.closePopover() : (i.ctrlKey || i.metaKey) && (i.key === "z" || i.key === "Z" ? i.shiftKey ? (i.preventDefault(), this.redo()) : (i.preventDefault(), this.undo()) : (i.key === "y" || i.key === "Y") && (i.preventDefault(), this.redo())));
|
|
3466
3492
|
}, this.boundHandleMarkerDrag = this.handleMarkerDrag.bind(this), this.boundStopDragging = this.stopDragging.bind(this);
|
|
3467
3493
|
}
|
|
3468
3494
|
setupMessageListener() {
|
|
@@ -3488,7 +3514,7 @@ const Kt = `
|
|
|
3488
3514
|
JSON.parse(
|
|
3489
3515
|
JSON.stringify(o)
|
|
3490
3516
|
)
|
|
3491
|
-
], this.historyIndex = 0, this.updateUndoRedoButtons(), this.
|
|
3517
|
+
], this.historyIndex = 0, this.updateUndoRedoButtons(), this.updateMainDisplay(), this.isPopoverOpen && this.refreshPopoverContent(), this.triggerChange();
|
|
3492
3518
|
}, s.onerror = () => {
|
|
3493
3519
|
this.showError("Failed to load image from file manager.");
|
|
3494
3520
|
}, s.src = e;
|
|
@@ -3502,47 +3528,76 @@ const Kt = `
|
|
|
3502
3528
|
draw() {
|
|
3503
3529
|
const t = document.createElement("div");
|
|
3504
3530
|
if (t.className = "image-map-setting-wrapper", this.props.title || this.props.icon) {
|
|
3505
|
-
const
|
|
3506
|
-
if (
|
|
3507
|
-
const
|
|
3508
|
-
|
|
3531
|
+
const h = document.createElement("div");
|
|
3532
|
+
if (h.className = "icon-container", this.props.icon) {
|
|
3533
|
+
const g = this.createIcon(this.props.icon);
|
|
3534
|
+
h.appendChild(g);
|
|
3509
3535
|
}
|
|
3510
3536
|
if (this.props.title) {
|
|
3511
|
-
const
|
|
3512
|
-
|
|
3537
|
+
const g = this.createLabel(this.props.title);
|
|
3538
|
+
h.appendChild(g);
|
|
3513
3539
|
}
|
|
3514
|
-
t.appendChild(
|
|
3540
|
+
t.appendChild(h);
|
|
3515
3541
|
}
|
|
3516
|
-
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
|
|
3542
|
+
const e = document.createElement("div");
|
|
3543
|
+
e.className = "image-map-sections-container";
|
|
3544
|
+
const i = document.createElement("div");
|
|
3545
|
+
i.className = "image-map-section";
|
|
3546
|
+
const s = document.createElement("h4");
|
|
3547
|
+
s.className = "image-map-section-title", s.textContent = "Upload/Replace Map Image", i.appendChild(s);
|
|
3548
|
+
const n = document.createElement("div");
|
|
3549
|
+
n.className = "image-map-upload-box";
|
|
3550
|
+
const o = document.createElement("div");
|
|
3551
|
+
o.className = "image-map-thumbnail-wrapper", this.thumbnailEl = document.createElement("img"), this.thumbnailEl.className = "image-map-thumbnail-main", o.appendChild(this.thumbnailEl);
|
|
3552
|
+
const a = document.createElement("button");
|
|
3553
|
+
a.type = "button", a.className = "image-map-delete-btn", a.innerHTML = ie, a.addEventListener("click", (h) => {
|
|
3554
|
+
h.stopPropagation(), this.value = { imageUrl: "", markers: [] }, this.updateMainDisplay(), this.triggerChange();
|
|
3555
|
+
}), o.appendChild(a), n.appendChild(o);
|
|
3556
|
+
const l = document.createElement("label");
|
|
3557
|
+
l.className = "image-map-upload-label", l.innerHTML = `
|
|
3558
|
+
<div class="upload-icon upload-icon-default">${gt}</div>
|
|
3559
|
+
<div class="upload-icon upload-icon-replace">${Qt}</div>
|
|
3560
|
+
<span class="upload-text">Upload Image</span>
|
|
3561
|
+
`;
|
|
3562
|
+
const r = document.createElement("input");
|
|
3563
|
+
r.type = "file", r.accept = "image/jpeg,image/jpg,image/png,image/gif,image/webp", r.style.display = "none", r.addEventListener("change", (h) => {
|
|
3564
|
+
var f;
|
|
3565
|
+
const g = (f = h.target.files) == null ? void 0 : f[0];
|
|
3566
|
+
g && this.handleImageUpload(g);
|
|
3567
|
+
}), l.appendChild(r), n.appendChild(l), i.appendChild(n), e.appendChild(i);
|
|
3568
|
+
const c = document.createElement("div");
|
|
3569
|
+
c.className = "image-map-section";
|
|
3570
|
+
const d = document.createElement("h4");
|
|
3571
|
+
return d.className = "image-map-section-title", d.textContent = "Map Setup", c.appendChild(d), this.mainButton = document.createElement("button"), this.mainButton.type = "button", this.mainButton.className = "image-map-button", this.mapIconEl = document.createElement("span"), this.mapIconEl.className = "image-map-icon", this.mapIconEl.innerHTML = mt, this.mainButton.appendChild(this.mapIconEl), this.markerCountEl = document.createElement("span"), this.markerCountEl.className = "image-map-marker-count", this.mainButton.appendChild(this.markerCountEl), this.mainButton.addEventListener("click", () => {
|
|
3572
|
+
var h;
|
|
3573
|
+
(h = this.mainButton) != null && h.disabled || this.openPopover();
|
|
3574
|
+
}), c.appendChild(this.mainButton), e.appendChild(c), t.appendChild(e), this.createPopover(), this.updateMainDisplay(), t;
|
|
3575
|
+
}
|
|
3576
|
+
updateMainDisplay() {
|
|
3577
|
+
var s;
|
|
3578
|
+
if (!this.thumbnailEl || !this.markerCountEl) return;
|
|
3579
|
+
const t = this.value && this.value.imageUrl && this.value.imageUrl !== "", e = this.thumbnailEl.parentElement, i = e == null ? void 0 : e.parentElement;
|
|
3580
|
+
i && (t ? (i.classList.add("has-image"), this.thumbnailEl.src = this.value.imageUrl) : (i.classList.remove("has-image"), this.thumbnailEl.src = "")), (s = this.value) != null && s.markers.length, this.markerCountEl.textContent = "Configure Map", this.mainButton && (this.mainButton.disabled = !t);
|
|
3526
3581
|
}
|
|
3527
3582
|
createPopover() {
|
|
3528
3583
|
this.backdropEl = document.createElement("div"), this.backdropEl.className = "image-map-backdrop", this.backdropEl.style.display = "none", this.popoverEl = document.createElement("div"), this.popoverEl.className = "image-map-popover", this.popoverEl.style.display = "none";
|
|
3529
3584
|
const t = document.createElement("div");
|
|
3530
3585
|
t.className = "image-map-header", t.style.cursor = "move";
|
|
3531
3586
|
const e = document.createElement("h3");
|
|
3532
|
-
e.className = "image-map-title", e.textContent = "
|
|
3587
|
+
e.className = "image-map-title", e.textContent = "Prize Map", t.appendChild(e);
|
|
3533
3588
|
const i = document.createElement("button");
|
|
3534
|
-
i.type = "button", i.className = "image-map-close-btn", i.innerHTML =
|
|
3589
|
+
i.type = "button", i.className = "image-map-close-btn", i.innerHTML = te, i.addEventListener("click", () => void this.closePopover()), t.appendChild(i), ot(t, this.popoverEl, (n, o) => {
|
|
3535
3590
|
this.popoverPosition = { left: n, top: o };
|
|
3536
3591
|
}), this.popoverEl.appendChild(t);
|
|
3537
3592
|
const s = document.createElement("div");
|
|
3538
3593
|
s.className = "image-map-content", this.popoverEl.appendChild(s), document.body.appendChild(this.backdropEl), document.body.appendChild(this.popoverEl);
|
|
3539
3594
|
}
|
|
3540
3595
|
openPopover() {
|
|
3541
|
-
|
|
3596
|
+
$.openInstance && $.openInstance !== this && $.openInstance.closePopover(), this.isPopoverOpen = !0, $.openInstance = this, this.value ? this.initialValue = JSON.parse(
|
|
3542
3597
|
JSON.stringify(this.value)
|
|
3543
3598
|
) : this.initialValue = { imageUrl: "", markers: [] }, this.value && (this.history = [
|
|
3544
3599
|
JSON.parse(JSON.stringify(this.value.markers))
|
|
3545
|
-
], this.historyIndex = 0), this.backdropEl && (this.backdropEl.style.display = "block"), this.popoverEl && (this.popoverEl.style.display = "flex"), this.positionPopover(), this.
|
|
3600
|
+
], this.historyIndex = 0), this.backdropEl && (this.backdropEl.style.display = "block"), this.popoverEl && (this.popoverEl.style.display = "flex"), this.positionPopover(), this.refreshPopoverContentAndScrollToBottom(), setTimeout(() => {
|
|
3546
3601
|
document.addEventListener("click", this.onBackgroundClick, !0);
|
|
3547
3602
|
}, 200), document.addEventListener("keydown", this.handlePopoverKeydown, !0);
|
|
3548
3603
|
}
|
|
@@ -3564,9 +3619,9 @@ const Kt = `
|
|
|
3564
3619
|
return;
|
|
3565
3620
|
this.initialValue && (this.value = JSON.parse(
|
|
3566
3621
|
JSON.stringify(this.initialValue)
|
|
3567
|
-
), this.
|
|
3622
|
+
), this.updateMainDisplay(), this.triggerChange());
|
|
3568
3623
|
}
|
|
3569
|
-
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),
|
|
3624
|
+
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), $.openInstance === this && ($.openInstance = null);
|
|
3570
3625
|
}
|
|
3571
3626
|
}
|
|
3572
3627
|
positionPopover() {
|
|
@@ -3584,32 +3639,74 @@ const Kt = `
|
|
|
3584
3639
|
if (!t) return;
|
|
3585
3640
|
const e = t.querySelector(
|
|
3586
3641
|
".image-map-container"
|
|
3587
|
-
), i = (
|
|
3642
|
+
), i = t.querySelector(
|
|
3643
|
+
".simple-prize-list"
|
|
3644
|
+
), s = (e == null ? void 0 : e.scrollTop) || 0, n = (i == null ? void 0 : i.scrollTop) || 0;
|
|
3588
3645
|
if (t.innerHTML = "", this.value && this.value.imageUrl && this.value.imageUrl !== "") {
|
|
3589
|
-
const
|
|
3590
|
-
|
|
3591
|
-
const
|
|
3592
|
-
|
|
3593
|
-
const
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
|
|
3599
|
-
|
|
3646
|
+
const a = this.renderControlsRow();
|
|
3647
|
+
t.appendChild(a);
|
|
3648
|
+
const l = document.createElement("div");
|
|
3649
|
+
l.className = "image-map-main-layout";
|
|
3650
|
+
const r = document.createElement("div");
|
|
3651
|
+
r.className = "image-map-image-section", this.renderImageMapSection(r);
|
|
3652
|
+
const c = document.createElement("div");
|
|
3653
|
+
c.className = "prize-list-section", this.renderPrizeList(c), l.appendChild(r), l.appendChild(c), t.appendChild(l);
|
|
3654
|
+
const d = this.renderBottomButtons();
|
|
3655
|
+
t.appendChild(d);
|
|
3656
|
+
const h = r.querySelector(
|
|
3657
|
+
".image-map-container"
|
|
3658
|
+
), g = c.querySelector(
|
|
3659
|
+
".simple-prize-list"
|
|
3660
|
+
);
|
|
3661
|
+
h && (h.scrollTop = s), g && (g.scrollTop = n);
|
|
3600
3662
|
} else
|
|
3601
3663
|
this.renderUploadSection(t);
|
|
3602
3664
|
}
|
|
3665
|
+
refreshPopoverContentAndScrollToBottom() {
|
|
3666
|
+
this.refreshPopoverContent(), requestAnimationFrame(() => {
|
|
3667
|
+
this.scrollPrizeListToBottom();
|
|
3668
|
+
});
|
|
3669
|
+
}
|
|
3670
|
+
scrollPrizeListToBottom() {
|
|
3671
|
+
if (!this.popoverEl) return;
|
|
3672
|
+
const t = this.popoverEl.querySelector(
|
|
3673
|
+
".simple-prize-list"
|
|
3674
|
+
);
|
|
3675
|
+
t && requestAnimationFrame(() => {
|
|
3676
|
+
t.scrollTop = t.scrollHeight;
|
|
3677
|
+
});
|
|
3678
|
+
}
|
|
3603
3679
|
renderUploadSection(t) {
|
|
3604
3680
|
const e = document.createElement("div");
|
|
3605
|
-
e.className = "upload-section";
|
|
3606
|
-
const i = document.createElement("
|
|
3607
|
-
i.
|
|
3681
|
+
e.className = "upload-section-wrapper";
|
|
3682
|
+
const i = document.createElement("h4");
|
|
3683
|
+
i.className = "upload-section-title", i.textContent = "Upload/Replace Map Image", e.appendChild(i);
|
|
3684
|
+
const s = document.createElement("div");
|
|
3685
|
+
s.className = "upload-section";
|
|
3686
|
+
const n = document.createElement("label");
|
|
3687
|
+
n.className = "upload-label", n.innerHTML = `
|
|
3608
3688
|
<div class="upload-placeholder">
|
|
3609
|
-
${
|
|
3689
|
+
${gt}
|
|
3610
3690
|
<span>Click to upload image</span>
|
|
3611
3691
|
</div>
|
|
3612
|
-
|
|
3692
|
+
`;
|
|
3693
|
+
const o = document.createElement("input");
|
|
3694
|
+
o.type = "file", o.accept = "image/jpeg,image/jpg,image/png,image/gif,image/webp", o.style.display = "none", o.addEventListener("change", (c) => {
|
|
3695
|
+
var h;
|
|
3696
|
+
const d = (h = c.target.files) == null ? void 0 : h[0];
|
|
3697
|
+
d && this.handleImageUpload(d);
|
|
3698
|
+
}), n.appendChild(o), s.appendChild(n), e.appendChild(s);
|
|
3699
|
+
const a = document.createElement("h4");
|
|
3700
|
+
a.className = "upload-section-title", a.textContent = "Map Setup", e.appendChild(a);
|
|
3701
|
+
const l = document.createElement("div");
|
|
3702
|
+
l.className = "upload-section";
|
|
3703
|
+
const r = document.createElement("button");
|
|
3704
|
+
r.type = "button", r.className = "upload-label map-config-btn", r.innerHTML = `
|
|
3705
|
+
<div class="upload-placeholder">
|
|
3706
|
+
${mt}
|
|
3707
|
+
<span>Configure Map</span>
|
|
3708
|
+
</div>
|
|
3709
|
+
`, r.addEventListener("click", () => {
|
|
3613
3710
|
window.postMessage(
|
|
3614
3711
|
{
|
|
3615
3712
|
type: "OPEN_FILE_MANAGER_MODAL",
|
|
@@ -3617,39 +3714,34 @@ const Kt = `
|
|
|
3617
3714
|
},
|
|
3618
3715
|
"*"
|
|
3619
3716
|
);
|
|
3620
|
-
}), e.appendChild(
|
|
3717
|
+
}), l.appendChild(r), e.appendChild(l), t.appendChild(e);
|
|
3621
3718
|
}
|
|
3622
|
-
|
|
3719
|
+
renderControlsRow() {
|
|
3720
|
+
var c;
|
|
3721
|
+
const t = document.createElement("div");
|
|
3722
|
+
t.className = "controls-row";
|
|
3623
3723
|
const e = document.createElement("div");
|
|
3624
|
-
e.className = "
|
|
3724
|
+
e.className = "place-prize-text", e.textContent = "Place Prize", t.appendChild(e);
|
|
3625
3725
|
const i = document.createElement("div");
|
|
3626
3726
|
i.className = "undo-redo-group";
|
|
3627
3727
|
const s = document.createElement("button");
|
|
3628
|
-
s.type = "button", s.className = "undo-btn action-btn", s.innerHTML =
|
|
3728
|
+
s.type = "button", s.className = "undo-btn action-btn", s.innerHTML = se, s.title = "Undo (Ctrl+Z)", s.disabled = !this.canUndo(), s.addEventListener("click", () => this.undo()), i.appendChild(s);
|
|
3629
3729
|
const n = document.createElement("button");
|
|
3630
|
-
n.type = "button", n.className = "redo-btn action-btn", n.innerHTML =
|
|
3631
|
-
const o = document.createElement("
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
);
|
|
3640
|
-
}), e.appendChild(o);
|
|
3641
|
-
const a = document.createElement("button");
|
|
3642
|
-
a.type = "button", a.className = "clear-all-btn", a.textContent = "Clear All Markers", a.addEventListener("click", () => this.handleClearAllMarkers()), e.appendChild(a), t.appendChild(e);
|
|
3643
|
-
const l = document.createElement("div");
|
|
3644
|
-
l.className = "image-map-container";
|
|
3645
|
-
const r = document.createElement("div");
|
|
3646
|
-
r.className = "image-map-wrapper", r.addEventListener("mousemove", this.boundHandleMarkerDrag), r.addEventListener("mouseup", this.boundStopDragging), r.addEventListener("mouseleave", this.boundStopDragging), this.imageElement = document.createElement("img"), this.imageElement.className = "image-map-image", this.imageElement.src = this.value.imageUrl, this.imageElement.addEventListener(
|
|
3730
|
+
n.type = "button", n.className = "redo-btn action-btn", n.innerHTML = ne, n.title = "Redo (Ctrl+Y)", n.disabled = !this.canRedo(), n.addEventListener("click", () => this.redo()), i.appendChild(n), t.appendChild(i);
|
|
3731
|
+
const o = this.props.maxMarkers || 10, a = ((c = this.value) == null ? void 0 : c.markers.length) || 0, l = a === o, r = document.createElement("div");
|
|
3732
|
+
return r.className = "prize-counter-inline", r.textContent = `${a}/${o}`, l && r.classList.add("complete"), t.appendChild(r), t;
|
|
3733
|
+
}
|
|
3734
|
+
renderImageMapSection(t) {
|
|
3735
|
+
const e = document.createElement("div");
|
|
3736
|
+
e.className = "image-map-container";
|
|
3737
|
+
const i = document.createElement("div");
|
|
3738
|
+
i.className = "image-map-wrapper", i.addEventListener("mousemove", this.boundHandleMarkerDrag), i.addEventListener("mouseup", this.boundStopDragging), i.addEventListener("mouseleave", this.boundStopDragging), this.imageElement = document.createElement("img"), this.imageElement.className = "image-map-image", this.imageElement.src = this.value.imageUrl, this.imageElement.addEventListener(
|
|
3647
3739
|
"load",
|
|
3648
3740
|
() => this.recordImageNaturalSize()
|
|
3649
3741
|
), this.imageElement.addEventListener(
|
|
3650
3742
|
"click",
|
|
3651
|
-
(
|
|
3652
|
-
),
|
|
3743
|
+
(s) => this.handleImageClick(s)
|
|
3744
|
+
), i.appendChild(this.imageElement), this.cursorTooltip = document.createElement("div"), this.cursorTooltip.className = "marker-cursor-tooltip", i.appendChild(this.cursorTooltip), this.imageElement.addEventListener(
|
|
3653
3745
|
"mouseenter",
|
|
3654
3746
|
() => this.showCursorTooltip()
|
|
3655
3747
|
), this.imageElement.addEventListener(
|
|
@@ -3657,56 +3749,65 @@ const Kt = `
|
|
|
3657
3749
|
() => this.hideCursorTooltip()
|
|
3658
3750
|
), this.imageElement.addEventListener(
|
|
3659
3751
|
"mousemove",
|
|
3660
|
-
(
|
|
3661
|
-
), this.value && this.value.markers && this.value.markers.forEach((
|
|
3662
|
-
const
|
|
3663
|
-
|
|
3664
|
-
}),
|
|
3665
|
-
}
|
|
3666
|
-
|
|
3667
|
-
var
|
|
3668
|
-
const
|
|
3669
|
-
|
|
3670
|
-
const
|
|
3671
|
-
|
|
3752
|
+
(s) => this.updateCursorTooltip(s)
|
|
3753
|
+
), this.value && this.value.markers && this.value.markers.forEach((s) => {
|
|
3754
|
+
const n = this.createMarkerElement(s);
|
|
3755
|
+
i.appendChild(n);
|
|
3756
|
+
}), e.appendChild(i), t.appendChild(e);
|
|
3757
|
+
}
|
|
3758
|
+
renderBottomButtons() {
|
|
3759
|
+
var l;
|
|
3760
|
+
const t = this.props.maxMarkers || 10, i = (((l = this.value) == null ? void 0 : l.markers.length) || 0) === t, s = document.createElement("div");
|
|
3761
|
+
s.className = "bottom-buttons";
|
|
3762
|
+
const n = document.createElement("button");
|
|
3763
|
+
n.type = "button", n.className = "clear-all-btn", n.innerHTML = le + "<span>Remove All</span>", n.addEventListener("click", () => this.handleClearAllMarkers()), s.appendChild(n);
|
|
3672
3764
|
const o = document.createElement("div");
|
|
3673
|
-
o.className = "
|
|
3674
|
-
const a =
|
|
3675
|
-
a.
|
|
3676
|
-
|
|
3677
|
-
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
|
|
3681
|
-
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
y.className = "prize-title", y.textContent = `Prize #${d}`;
|
|
3685
|
-
const b = document.createElement("div");
|
|
3686
|
-
b.className = "prize-subtitle", b.textContent = C ? m : "Not Placed", v.appendChild(y), v.appendChild(b);
|
|
3687
|
-
const L = document.createElement("div");
|
|
3688
|
-
L.className = `prize-status ${C ? "placed" : "missing"}`, L.innerHTML = C ? ie : se, u.appendChild(f), u.appendChild(v), u.appendChild(L), o.appendChild(u);
|
|
3765
|
+
o.className = "done-btn-wrapper";
|
|
3766
|
+
const a = document.createElement("button");
|
|
3767
|
+
if (a.type = "button", a.className = "done-btn", a.textContent = "Done", i || (a.disabled = !0, o.classList.add("has-tooltip")), a.addEventListener("click", () => {
|
|
3768
|
+
i && (this.triggerChange(), this.closePopover(!0));
|
|
3769
|
+
}), o.appendChild(a), !i) {
|
|
3770
|
+
const r = document.createElement("div");
|
|
3771
|
+
r.className = "done-btn-tooltip";
|
|
3772
|
+
const c = document.createElement("div");
|
|
3773
|
+
c.className = "done-btn-tooltip-content", c.textContent = "Map all prizes";
|
|
3774
|
+
const d = document.createElement("div");
|
|
3775
|
+
d.className = "done-btn-tooltip-tail", d.innerHTML = re, r.appendChild(c), r.appendChild(d), o.appendChild(r);
|
|
3689
3776
|
}
|
|
3690
|
-
|
|
3691
|
-
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
|
|
3777
|
+
return s.appendChild(o), s;
|
|
3778
|
+
}
|
|
3779
|
+
renderPrizeList(t) {
|
|
3780
|
+
var o;
|
|
3781
|
+
const e = this.props.maxMarkers || 10, i = ((o = this.value) == null ? void 0 : o.markers) || [], s = /* @__PURE__ */ new Map();
|
|
3782
|
+
i.forEach((a) => s.set(a.index, a));
|
|
3783
|
+
const n = document.createElement("div");
|
|
3784
|
+
n.className = "simple-prize-list";
|
|
3785
|
+
for (let a = e; a >= 1; a--) {
|
|
3786
|
+
const l = s.get(a), r = !!l, c = (l == null ? void 0 : l.prizeName) || this.props.prizeMap && this.props.prizeMap[a - 1] || "Prize Name", d = document.createElement("div");
|
|
3787
|
+
d.className = `simple-prize-item ${r ? "placed" : ""}`;
|
|
3788
|
+
const h = document.createElement("div");
|
|
3789
|
+
h.className = "simple-prize-number", h.textContent = `#${a}`, d.appendChild(h);
|
|
3790
|
+
const g = document.createElement("div");
|
|
3791
|
+
if (g.className = "simple-prize-text", g.textContent = `${c}`, d.appendChild(g), r) {
|
|
3792
|
+
const f = document.createElement("div");
|
|
3793
|
+
f.className = "simple-prize-check", f.innerHTML = oe, d.appendChild(f);
|
|
3794
|
+
}
|
|
3795
|
+
n.appendChild(d);
|
|
3796
|
+
}
|
|
3797
|
+
t.appendChild(n);
|
|
3695
3798
|
}
|
|
3696
3799
|
createMarkerElement(t) {
|
|
3697
3800
|
const e = document.createElement("div");
|
|
3698
3801
|
e.className = "marker-container", e.style.left = `${t.x}%`, e.style.top = `${t.y}%`, e.setAttribute("data-marker-id", String(t.id));
|
|
3699
3802
|
const i = document.createElement("div");
|
|
3700
|
-
i.className = "image-map-marker";
|
|
3803
|
+
i.className = "image-map-marker", i.innerHTML = ae;
|
|
3701
3804
|
const s = document.createElement("span");
|
|
3702
|
-
s.className = "marker-number", s.textContent = String(t.index), i.appendChild(s);
|
|
3805
|
+
s.className = "marker-number", s.textContent = String(t.index), i.appendChild(s), e.appendChild(i);
|
|
3703
3806
|
const n = document.createElement("button");
|
|
3704
|
-
n.type = "button", n.className = "marker-delete-btn", n.innerHTML =
|
|
3705
|
-
|
|
3706
|
-
}),
|
|
3707
|
-
|
|
3708
|
-
return o.className = "marker-label", t.prizeName ? o.textContent = t.prizeName : o.textContent = `Prize ${t.index}`, e.appendChild(o), e.addEventListener("mousedown", (a) => {
|
|
3709
|
-
a.stopPropagation(), a.preventDefault(), this.draggingMarkerId = t.id, e.classList.add("dragging");
|
|
3807
|
+
return n.type = "button", n.className = "marker-delete-btn", n.innerHTML = ee, n.addEventListener("click", (o) => {
|
|
3808
|
+
o.stopPropagation(), this.handleDeleteMarker(t.id);
|
|
3809
|
+
}), e.appendChild(n), e.addEventListener("mousedown", (o) => {
|
|
3810
|
+
o.stopPropagation(), o.preventDefault(), this.draggingMarkerId = t.id, e.classList.add("dragging");
|
|
3710
3811
|
}), e;
|
|
3711
3812
|
}
|
|
3712
3813
|
handleImageUpload(t) {
|
|
@@ -3738,21 +3839,21 @@ const Kt = `
|
|
|
3738
3839
|
if (typeof a == "string") {
|
|
3739
3840
|
const r = new Image();
|
|
3740
3841
|
r.onload = () => {
|
|
3741
|
-
var
|
|
3842
|
+
var h;
|
|
3742
3843
|
const c = {
|
|
3743
3844
|
width: r.naturalWidth || 0,
|
|
3744
3845
|
height: r.naturalHeight || 0
|
|
3745
|
-
},
|
|
3746
|
-
((
|
|
3846
|
+
}, d = this.scaleMarkersForNewImage(
|
|
3847
|
+
((h = this.value) == null ? void 0 : h.markers) || [],
|
|
3747
3848
|
e,
|
|
3748
3849
|
c
|
|
3749
3850
|
);
|
|
3750
3851
|
this.value = {
|
|
3751
3852
|
imageUrl: a,
|
|
3752
|
-
markers:
|
|
3853
|
+
markers: d
|
|
3753
3854
|
}, this.lastImageNaturalSize = c, this.history = [
|
|
3754
|
-
JSON.parse(JSON.stringify(
|
|
3755
|
-
], this.historyIndex = 0, this.updateUndoRedoButtons(), this.
|
|
3855
|
+
JSON.parse(JSON.stringify(d))
|
|
3856
|
+
], this.historyIndex = 0, this.updateUndoRedoButtons(), this.updateMainDisplay(), this.isPopoverOpen && this.refreshPopoverContent(), this.triggerChange();
|
|
3756
3857
|
}, r.onerror = () => {
|
|
3757
3858
|
this.showError("Failed to read image file.");
|
|
3758
3859
|
}, r.src = a;
|
|
@@ -3769,7 +3870,7 @@ const Kt = `
|
|
|
3769
3870
|
);
|
|
3770
3871
|
return;
|
|
3771
3872
|
}
|
|
3772
|
-
const e = this.imageElement.getBoundingClientRect(), i = (t.clientX - e.left) / e.width * 100, s = (t.clientY - e.top) / e.height * 100, n = this.value.markers.map((c) => c.index).sort((c,
|
|
3873
|
+
const e = this.imageElement.getBoundingClientRect(), i = (t.clientX - e.left) / e.width * 100, s = (t.clientY - e.top) / e.height * 100, n = this.value.markers.map((c) => c.index).sort((c, d) => c - d);
|
|
3773
3874
|
let o = 1;
|
|
3774
3875
|
for (const c of n)
|
|
3775
3876
|
if (c === o)
|
|
@@ -3785,7 +3886,7 @@ const Kt = `
|
|
|
3785
3886
|
y: Math.min(100, Math.max(0, s)),
|
|
3786
3887
|
prizeName: a
|
|
3787
3888
|
}, r = [...this.value.markers, l];
|
|
3788
|
-
this.setMarkers(r), this.saveState(), this.refreshPopoverContent(), this.
|
|
3889
|
+
this.setMarkers(r), this.saveState(), this.refreshPopoverContent(), this.updateMainDisplay(), this.triggerChange();
|
|
3789
3890
|
}
|
|
3790
3891
|
handleMarkerDrag(t) {
|
|
3791
3892
|
var r;
|
|
@@ -3810,10 +3911,10 @@ const Kt = `
|
|
|
3810
3911
|
handleDeleteMarker(t) {
|
|
3811
3912
|
if (!this.value || this.value.markers.findIndex((s) => s.id === t) === -1) return;
|
|
3812
3913
|
const i = this.value.markers.filter((s) => s.id !== t);
|
|
3813
|
-
this.setMarkers(i), this.saveState(), this.refreshPopoverContent(), this.
|
|
3914
|
+
this.setMarkers(i), this.saveState(), this.refreshPopoverContent(), this.updateMainDisplay(), this.triggerChange();
|
|
3814
3915
|
}
|
|
3815
3916
|
handleClearAllMarkers() {
|
|
3816
|
-
this.value && (this.setMarkers([]), this.saveState(), this.refreshPopoverContent(), this.
|
|
3917
|
+
this.value && (this.setMarkers([]), this.saveState(), this.refreshPopoverContent(), this.updateMainDisplay(), this.triggerChange());
|
|
3817
3918
|
}
|
|
3818
3919
|
getNextPrizeInfo() {
|
|
3819
3920
|
if (!this.value) return { index: 1, name: "Prize 1" };
|
|
@@ -3835,7 +3936,7 @@ const Kt = `
|
|
|
3835
3936
|
if (!this.cursorTooltip || !this.value || this.value.markers.length >= (this.props.maxMarkers || 10))
|
|
3836
3937
|
return;
|
|
3837
3938
|
const t = this.getNextPrizeInfo();
|
|
3838
|
-
this.cursorTooltip.textContent =
|
|
3939
|
+
this.cursorTooltip.textContent = String(t.index), this.cursorTooltip.classList.add("visible");
|
|
3839
3940
|
}
|
|
3840
3941
|
hideCursorTooltip() {
|
|
3841
3942
|
this.cursorTooltip && this.cursorTooltip.classList.remove("visible");
|
|
@@ -3869,7 +3970,7 @@ const Kt = `
|
|
|
3869
3970
|
const t = JSON.parse(
|
|
3870
3971
|
JSON.stringify(this.history[this.historyIndex])
|
|
3871
3972
|
);
|
|
3872
|
-
this.setMarkers(t), this.refreshPopoverContent(), this.
|
|
3973
|
+
this.setMarkers(t), this.refreshPopoverContent(), this.updateMainDisplay(), this.triggerChange(), this.isUndoRedoOperation = !1, this.updateUndoRedoButtons();
|
|
3873
3974
|
}
|
|
3874
3975
|
redo() {
|
|
3875
3976
|
if (!this.canRedo() || !this.value) return;
|
|
@@ -3877,7 +3978,7 @@ const Kt = `
|
|
|
3877
3978
|
const t = JSON.parse(
|
|
3878
3979
|
JSON.stringify(this.history[this.historyIndex])
|
|
3879
3980
|
);
|
|
3880
|
-
this.setMarkers(t), this.refreshPopoverContent(), this.
|
|
3981
|
+
this.setMarkers(t), this.refreshPopoverContent(), this.updateMainDisplay(), this.triggerChange(), this.isUndoRedoOperation = !1, this.updateUndoRedoButtons();
|
|
3881
3982
|
}
|
|
3882
3983
|
updateUndoRedoButtons() {
|
|
3883
3984
|
if (!this.popoverEl) return;
|
|
@@ -3977,11 +4078,11 @@ const Kt = `
|
|
|
3977
4078
|
r.type = "button", r.className = "confirm-btn ghost", r.textContent = "Cancel";
|
|
3978
4079
|
const c = document.createElement("button");
|
|
3979
4080
|
c.type = "button", c.className = "confirm-btn danger", c.textContent = "Discard";
|
|
3980
|
-
const
|
|
3981
|
-
s.remove(), this.confirmOverlayEl = null, this.confirmPromise = null, i(
|
|
4081
|
+
const d = (h) => {
|
|
4082
|
+
s.remove(), this.confirmOverlayEl = null, this.confirmPromise = null, i(h);
|
|
3982
4083
|
};
|
|
3983
|
-
r.addEventListener("click", () =>
|
|
3984
|
-
|
|
4084
|
+
r.addEventListener("click", () => d(!1)), c.addEventListener("click", () => d(!0)), s.addEventListener("click", (h) => {
|
|
4085
|
+
h.target === s && d(!1);
|
|
3985
4086
|
}), l.appendChild(r), l.appendChild(c), n.appendChild(o), n.appendChild(a), n.appendChild(l), s.appendChild(n), document.body.appendChild(s), setTimeout(() => {
|
|
3986
4087
|
n.classList.add("visible");
|
|
3987
4088
|
}, 10);
|
|
@@ -3995,16 +4096,16 @@ const Kt = `
|
|
|
3995
4096
|
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), this.cleanupMessageListener();
|
|
3996
4097
|
}
|
|
3997
4098
|
};
|
|
3998
|
-
|
|
3999
|
-
let
|
|
4000
|
-
class
|
|
4099
|
+
$.openInstance = null;
|
|
4100
|
+
let vt = $;
|
|
4101
|
+
class ce extends B {
|
|
4001
4102
|
constructor(t = {}) {
|
|
4002
4103
|
super({
|
|
4003
4104
|
...t,
|
|
4004
4105
|
title: t.title || "Height",
|
|
4005
4106
|
suffix: t.suffix || "px",
|
|
4006
4107
|
minValue: t.minValue ?? 0,
|
|
4007
|
-
icon: t.icon ||
|
|
4108
|
+
icon: t.icon || he,
|
|
4008
4109
|
default: t.default ?? 100
|
|
4009
4110
|
}), this.inputType = "number", this.mobileValue = t.mobile;
|
|
4010
4111
|
}
|
|
@@ -4015,17 +4116,17 @@ class ne extends H {
|
|
|
4015
4116
|
this.mobileValue = t, t !== void 0 && this.setValue(t);
|
|
4016
4117
|
}
|
|
4017
4118
|
}
|
|
4018
|
-
const
|
|
4119
|
+
const he = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
4019
4120
|
<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"/>
|
|
4020
4121
|
</svg>`;
|
|
4021
|
-
class
|
|
4122
|
+
class de extends B {
|
|
4022
4123
|
constructor(t = {}) {
|
|
4023
4124
|
super({
|
|
4024
4125
|
...t,
|
|
4025
4126
|
title: t.title || "Width",
|
|
4026
4127
|
suffix: t.suffix || "px",
|
|
4027
4128
|
minValue: t.minValue ?? 0,
|
|
4028
|
-
icon: t.icon ||
|
|
4129
|
+
icon: t.icon || pe,
|
|
4029
4130
|
default: t.default ?? 100
|
|
4030
4131
|
}), this.inputType = "number", this.mobileValue = t.mobile;
|
|
4031
4132
|
}
|
|
@@ -4036,14 +4137,14 @@ class ae extends H {
|
|
|
4036
4137
|
this.mobileValue = t, t !== void 0 && this.setValue(t);
|
|
4037
4138
|
}
|
|
4038
4139
|
}
|
|
4039
|
-
const
|
|
4140
|
+
const pe = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
4040
4141
|
<path d="M4.5 9.5H13.5M4.5 9.5L6 7.25M4.5 9.5L6 11.75M13.5 9.5L12 7.25M13.5 9.5L12 11.75M15.75 16.25V2.75M2.25 16.25V2.75" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
|
|
4041
|
-
</svg>`,
|
|
4142
|
+
</svg>`, ue = `
|
|
4042
4143
|
<svg xmlns="http://www.w3.org/2000/svg" class="svg-select-api" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-down">
|
|
4043
4144
|
<polyline points="6 9 12 15 18 9"></polyline>
|
|
4044
4145
|
</svg>
|
|
4045
4146
|
`;
|
|
4046
|
-
class
|
|
4147
|
+
class Te extends w {
|
|
4047
4148
|
constructor(t = {}) {
|
|
4048
4149
|
if (super(t), this.inputType = "select", this._options = [], this.isOpen = !1, this.selectedOptionIndex = null, this.optionsListEl = null, this.svgContainer = null, this.buttonEl = null, this.isLoading = !1, this.container = null, this.hasInitializedOptions = !1, this.selectedOptionIndex = null, t.default !== void 0 && (this.value = t.default), this.initializeOptions(t), !t.getOptionsAsync && this.value !== void 0) {
|
|
4049
4150
|
const e = this._options.findIndex(
|
|
@@ -4098,7 +4199,7 @@ class Me extends x {
|
|
|
4098
4199
|
a.onclick = (l) => this.selectApiOption(l, o, e), i.appendChild(a);
|
|
4099
4200
|
}), t.appendChild(i);
|
|
4100
4201
|
const s = document.createElement("div");
|
|
4101
|
-
return s.classList.add("svg-container"), s.innerHTML =
|
|
4202
|
+
return s.classList.add("svg-container"), s.innerHTML = ue, t.appendChild(s), s.onclick = () => {
|
|
4102
4203
|
var n, o;
|
|
4103
4204
|
this.isLoading || (this.isOpen = !this.isOpen, (n = this.optionsListEl) == null || n.classList.toggle("open", this.isOpen), (o = this.svgContainer) == null || o.classList.toggle("open", this.isOpen));
|
|
4104
4205
|
}, this.optionsListEl = i, this.svgContainer = s, this.props.getOptionsAsync && !this.hasInitializedOptions ? (this.isLoading = !0, this.updateButtonText(), this.props.getOptionsAsync().then((n) => {
|
|
@@ -4192,7 +4293,7 @@ class Me extends x {
|
|
|
4192
4293
|
), this.updateButtonText(), this.updateOptionsList(), this.detectChangeCallback && this.detectChangeCallback !== this.props.detectChange && this.detectChangeCallback(t);
|
|
4193
4294
|
}
|
|
4194
4295
|
}
|
|
4195
|
-
class
|
|
4296
|
+
class Pe extends w {
|
|
4196
4297
|
constructor(t) {
|
|
4197
4298
|
var e, i;
|
|
4198
4299
|
super(t), this.inputType = "text", this.value = t.default ?? ((i = (e = t.options) == null ? void 0 : e[0]) == null ? void 0 : i.value) ?? "", this.detectChangeCallback = t.detectChange;
|
|
@@ -4216,7 +4317,7 @@ class Ie extends x {
|
|
|
4216
4317
|
const s = document.createElement("input");
|
|
4217
4318
|
s.type = "checkbox", s.checked = ((a = (o = this.props.options) == null ? void 0 : o.find((l) => l.value === this.value)) == null ? void 0 : a.status) ?? !1, this.getDataPropsPath() && s.setAttribute("data-test-id", this.getDataPropsPath()), s.addEventListener("change", () => {
|
|
4218
4319
|
var r, c;
|
|
4219
|
-
const l = ((c = (r = this.props.options) == null ? void 0 : r.find((
|
|
4320
|
+
const l = ((c = (r = this.props.options) == null ? void 0 : r.find((d) => d.status === s.checked)) == null ? void 0 : c.value) ?? "";
|
|
4220
4321
|
this.value = l, this.onChange && this.onChange(this.value), this.detectChangeCallback && this.detectChangeCallback(this.value);
|
|
4221
4322
|
});
|
|
4222
4323
|
const n = document.createElement("span");
|
|
@@ -4242,13 +4343,13 @@ class Ie extends x {
|
|
|
4242
4343
|
this.detectChangeCallback = t;
|
|
4243
4344
|
}
|
|
4244
4345
|
}
|
|
4245
|
-
const
|
|
4346
|
+
const ge = `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
4246
4347
|
<path d="M13.3334 5.99996H2.66675M13.3334 9.99996H2.66675M5.33341 12.6666V3.33329M10.6667 12.6666V3.33329" stroke="#667085" stroke-width="1.33333" stroke-linecap="round" stroke-linejoin="round"/>
|
|
4247
4348
|
</svg>`;
|
|
4248
|
-
class
|
|
4349
|
+
class Oe extends w {
|
|
4249
4350
|
// Store mobile value
|
|
4250
4351
|
constructor(t = {}) {
|
|
4251
|
-
t.rowGap = t.rowGap ?? !0, t.columnGap = t.columnGap ?? !0, t.title = t.title ?? "Gap", t.icon = t.icon ??
|
|
4352
|
+
t.rowGap = t.rowGap ?? !0, t.columnGap = t.columnGap ?? !0, t.title = t.title ?? "Gap", t.icon = t.icon ?? ge, t.suffix = t.suffix ?? "px", t.minValue = t.minValue ?? 0, super(t), this.inputType = "number", this.inputValues = {}, this.mobileValue = t.mobile, this.value = this.validateValue(t.default ?? 0), t.rowGap && (this.inputValues.row = this.value), t.columnGap && (this.inputValues.column = this.value);
|
|
4252
4353
|
}
|
|
4253
4354
|
draw() {
|
|
4254
4355
|
const t = document.createElement("div");
|
|
@@ -4299,43 +4400,43 @@ class Ne extends x {
|
|
|
4299
4400
|
this.mobileValue = t, t !== void 0 && this.setValue(t);
|
|
4300
4401
|
}
|
|
4301
4402
|
}
|
|
4302
|
-
const
|
|
4403
|
+
const me = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
4303
4404
|
<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"/>
|
|
4304
4405
|
</svg>`;
|
|
4305
|
-
class
|
|
4406
|
+
class He extends B {
|
|
4306
4407
|
constructor(t = {}) {
|
|
4307
4408
|
super({
|
|
4308
4409
|
...t,
|
|
4309
4410
|
minValue: t.minValue ?? 0,
|
|
4310
4411
|
maxValue: t.maxValue ?? 1e3,
|
|
4311
|
-
icon: t.icon ||
|
|
4412
|
+
icon: t.icon || me,
|
|
4312
4413
|
title: t.title || "Margin Bottom",
|
|
4313
4414
|
default: t.default ?? 20,
|
|
4314
4415
|
wrapperClassName: "margin-bottom-wrapper " + (t.wrapperClassName || "")
|
|
4315
4416
|
}), this.inputType = "number";
|
|
4316
4417
|
}
|
|
4317
4418
|
}
|
|
4318
|
-
const
|
|
4419
|
+
const ve = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
4319
4420
|
<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"
|
|
4320
4421
|
stroke="#667085" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
4321
4422
|
</svg>`;
|
|
4322
|
-
class
|
|
4423
|
+
class Be extends B {
|
|
4323
4424
|
constructor(t = {}) {
|
|
4324
4425
|
super({
|
|
4325
4426
|
...t,
|
|
4326
4427
|
minValue: t.minValue ?? 0,
|
|
4327
4428
|
maxValue: t.maxValue ?? 1e3,
|
|
4328
|
-
icon: t.icon ||
|
|
4429
|
+
icon: t.icon || ve,
|
|
4329
4430
|
title: t.title || "Margin Top",
|
|
4330
4431
|
default: t.default ?? 20,
|
|
4331
4432
|
wrapperClassName: "margin-top-wrapper " + (t.wrapperClassName || "")
|
|
4332
4433
|
}), this.inputType = "number";
|
|
4333
4434
|
}
|
|
4334
4435
|
}
|
|
4335
|
-
class
|
|
4436
|
+
class $e extends w {
|
|
4336
4437
|
constructor(t) {
|
|
4337
4438
|
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 = {});
|
|
4338
|
-
const e =
|
|
4439
|
+
const e = w.HasExplicitCurrentLanguage(), i = e ? w.CurrentLanguage() : "", s = w.DefaultLanguage;
|
|
4339
4440
|
this.defaultLanguage = e && i && t.languages.includes(i) ? i : s && t.languages.includes(s) ? s : t.languages[0];
|
|
4340
4441
|
const n = t.defaultValue || `Enter text in ${this.capitalizeFirstLetter(this.defaultLanguage)}`;
|
|
4341
4442
|
t.languages.forEach((o) => {
|
|
@@ -4367,13 +4468,13 @@ class Te extends x {
|
|
|
4367
4468
|
return;
|
|
4368
4469
|
}
|
|
4369
4470
|
const c = "...";
|
|
4370
|
-
let
|
|
4371
|
-
for (;
|
|
4372
|
-
const m = Math.floor((
|
|
4373
|
-
this.measureTextWidth(u, i) <= l ? (g = m,
|
|
4471
|
+
let d = 0, h = e.length, g = 0;
|
|
4472
|
+
for (; d <= h; ) {
|
|
4473
|
+
const m = Math.floor((d + h) / 2), u = e.slice(0, m).trimEnd() + c;
|
|
4474
|
+
this.measureTextWidth(u, i) <= l ? (g = m, d = m + 1) : h = m - 1;
|
|
4374
4475
|
}
|
|
4375
|
-
const
|
|
4376
|
-
t.placeholder =
|
|
4476
|
+
const f = e.slice(0, g).trimEnd() + c;
|
|
4477
|
+
t.placeholder = f;
|
|
4377
4478
|
}
|
|
4378
4479
|
autosizeTextarea(t, e = 3) {
|
|
4379
4480
|
t.style.height = "auto";
|
|
@@ -4446,7 +4547,7 @@ class Te extends x {
|
|
|
4446
4547
|
);
|
|
4447
4548
|
if (!e) return;
|
|
4448
4549
|
e.innerHTML = "";
|
|
4449
|
-
const i =
|
|
4550
|
+
const i = w.HasExplicitCurrentLanguage(), s = w.CurrentLanguage();
|
|
4450
4551
|
if (!i || !s || !this.props.languages.includes(s))
|
|
4451
4552
|
this.props.languages.forEach((o) => {
|
|
4452
4553
|
var r;
|
|
@@ -4568,7 +4669,7 @@ class Te extends x {
|
|
|
4568
4669
|
a.preventDefault(), this.showPopup();
|
|
4569
4670
|
}), e.appendChild(i), e.appendChild(s), t.appendChild(e);
|
|
4570
4671
|
const n = document.createElement("div");
|
|
4571
|
-
n.classList.add("simple-multi-language-content"), t.appendChild(n), this.container = t, this.renderContent(t), this.languageChangeUnsubscribe =
|
|
4672
|
+
n.classList.add("simple-multi-language-content"), t.appendChild(n), this.container = t, this.renderContent(t), this.languageChangeUnsubscribe = w.onLanguageChange((a) => {
|
|
4572
4673
|
a && this.props.languages.includes(a) && (this.defaultLanguage = a), this.container && this.renderContent(this.container);
|
|
4573
4674
|
});
|
|
4574
4675
|
const o = () => {
|
|
@@ -4601,7 +4702,7 @@ class Te extends x {
|
|
|
4601
4702
|
});
|
|
4602
4703
|
}
|
|
4603
4704
|
}
|
|
4604
|
-
class
|
|
4705
|
+
class Ae extends w {
|
|
4605
4706
|
constructor(t = {}) {
|
|
4606
4707
|
super(t), this.inputType = "select";
|
|
4607
4708
|
const e = [
|
|
@@ -4628,24 +4729,24 @@ class Pe extends x {
|
|
|
4628
4729
|
this.selectSetting.destroy(), super.destroy();
|
|
4629
4730
|
}
|
|
4630
4731
|
}
|
|
4631
|
-
const
|
|
4732
|
+
const fe = `
|
|
4632
4733
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
4633
4734
|
<path d="M5.625 9.5H5.6325M12.375 9.5H12.3825M9 9.5H9.0075M9 12.875H9.0075M9 6.125H9.0075M2.25 6.35L2.25 12.65C2.25 13.9101 2.25 14.5402 2.49524 15.0215C2.71095 15.4448 3.05516 15.789 3.47852 16.0048C3.95982 16.25 4.58988 16.25 5.85 16.25H12.15C13.4101 16.25 14.0402 16.25 14.5215 16.0048C14.9448 15.789 15.289 15.4448 15.5048 15.0215C15.75 14.5402 15.75 13.9101 15.75 12.65V6.35C15.75 5.08988 15.75 4.45982 15.5048 3.97852C15.289 3.55516 14.9448 3.21095 14.5215 2.99524C14.0402 2.75 13.4101 2.75 12.15 2.75L5.85 2.75C4.58988 2.75 3.95982 2.75 3.47852 2.99524C3.05516 3.21095 2.71095 3.55516 2.49524 3.97852C2.25 4.45982 2.25 5.08988 2.25 6.35Z" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
|
|
4634
4735
|
</svg>
|
|
4635
|
-
`,
|
|
4736
|
+
`, Ce = `
|
|
4636
4737
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
4637
4738
|
<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"/>
|
|
4638
4739
|
</svg>
|
|
4639
4740
|
`;
|
|
4640
|
-
class
|
|
4741
|
+
class De extends H {
|
|
4641
4742
|
constructor(t) {
|
|
4642
4743
|
super({
|
|
4643
4744
|
title: "Border",
|
|
4644
4745
|
collapsed: t == null ? void 0 : t.collapsed,
|
|
4645
4746
|
settings: {
|
|
4646
|
-
size: new
|
|
4747
|
+
size: new B({
|
|
4647
4748
|
title: "Size",
|
|
4648
|
-
icon:
|
|
4749
|
+
icon: Ce,
|
|
4649
4750
|
default: (t == null ? void 0 : t.size) ?? 0,
|
|
4650
4751
|
suffix: "px"
|
|
4651
4752
|
}),
|
|
@@ -4653,9 +4754,9 @@ class Oe extends $ {
|
|
|
4653
4754
|
title: "Border Color",
|
|
4654
4755
|
default: (t == null ? void 0 : t.color) || "#000000"
|
|
4655
4756
|
}),
|
|
4656
|
-
radius: new
|
|
4757
|
+
radius: new B({
|
|
4657
4758
|
title: "Radius",
|
|
4658
|
-
icon:
|
|
4759
|
+
icon: fe,
|
|
4659
4760
|
default: (t == null ? void 0 : t.radius) ?? 12,
|
|
4660
4761
|
suffix: "px"
|
|
4661
4762
|
})
|
|
@@ -4679,20 +4780,20 @@ class Oe extends $ {
|
|
|
4679
4780
|
`;
|
|
4680
4781
|
}
|
|
4681
4782
|
}
|
|
4682
|
-
const
|
|
4783
|
+
const ye = `
|
|
4683
4784
|
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="13" viewBox="0 0 14 13" fill="none">
|
|
4684
4785
|
<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"/>
|
|
4685
4786
|
</svg>
|
|
4686
|
-
`,
|
|
4787
|
+
`, Ee = `
|
|
4687
4788
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
4688
4789
|
<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"/>
|
|
4689
4790
|
</svg>
|
|
4690
|
-
`,
|
|
4791
|
+
`, be = `
|
|
4691
4792
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
4692
4793
|
<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"/>
|
|
4693
4794
|
</svg>
|
|
4694
4795
|
`;
|
|
4695
|
-
class
|
|
4796
|
+
class Fe extends H {
|
|
4696
4797
|
constructor(t = {}) {
|
|
4697
4798
|
const { showAlign: e = t.showAlign ?? !0, ...i } = t;
|
|
4698
4799
|
super({
|
|
@@ -4706,7 +4807,7 @@ class $e extends $ {
|
|
|
4706
4807
|
}),
|
|
4707
4808
|
fontFamily: new nt({
|
|
4708
4809
|
title: "Font",
|
|
4709
|
-
icon:
|
|
4810
|
+
icon: ye,
|
|
4710
4811
|
default: i.fontFamilyDefault ?? "Satoshi",
|
|
4711
4812
|
options: i.fontFamilyOptions ?? [
|
|
4712
4813
|
{ name: "Alt", value: "Croco Sans Black Caps Alt" },
|
|
@@ -4719,7 +4820,7 @@ class $e extends $ {
|
|
|
4719
4820
|
}),
|
|
4720
4821
|
fontWeight: new nt({
|
|
4721
4822
|
title: "Weight",
|
|
4722
|
-
icon:
|
|
4823
|
+
icon: Ee,
|
|
4723
4824
|
default: i.fontWeightDefault ?? "400",
|
|
4724
4825
|
options: i.fontWeightOptions ?? [
|
|
4725
4826
|
{ name: "Regular", value: "400" },
|
|
@@ -4729,9 +4830,9 @@ class $e extends $ {
|
|
|
4729
4830
|
getOptions: i.fontWeightGetOptions,
|
|
4730
4831
|
getOptionsAsync: i.fontWeightGetOptionsAsync
|
|
4731
4832
|
}),
|
|
4732
|
-
fontSize: new
|
|
4833
|
+
fontSize: new B({
|
|
4733
4834
|
title: "Size",
|
|
4734
|
-
icon:
|
|
4835
|
+
icon: be,
|
|
4735
4836
|
default: i.fontSizeDefault ?? 12,
|
|
4736
4837
|
suffix: "px",
|
|
4737
4838
|
mobile: i.fontSizeMobileDefault
|
|
@@ -4739,7 +4840,7 @@ class $e extends $ {
|
|
|
4739
4840
|
};
|
|
4740
4841
|
return e ? {
|
|
4741
4842
|
...s,
|
|
4742
|
-
align: new
|
|
4843
|
+
align: new Jt({
|
|
4743
4844
|
title: "Align",
|
|
4744
4845
|
default: i.alignDefault ?? "center"
|
|
4745
4846
|
})
|
|
@@ -4771,7 +4872,7 @@ class $e extends $ {
|
|
|
4771
4872
|
`;
|
|
4772
4873
|
}
|
|
4773
4874
|
}
|
|
4774
|
-
class
|
|
4875
|
+
class Z extends w {
|
|
4775
4876
|
constructor(t) {
|
|
4776
4877
|
super({
|
|
4777
4878
|
...t,
|
|
@@ -4817,33 +4918,33 @@ class _ extends x {
|
|
|
4817
4918
|
}), i;
|
|
4818
4919
|
}
|
|
4819
4920
|
}
|
|
4820
|
-
class
|
|
4921
|
+
class Ge extends H {
|
|
4821
4922
|
constructor(t) {
|
|
4822
4923
|
super({
|
|
4823
4924
|
title: "Margins",
|
|
4824
4925
|
collapsed: t == null ? void 0 : t.collapsed,
|
|
4825
4926
|
settings: {
|
|
4826
|
-
marginTop: new
|
|
4927
|
+
marginTop: new Z({
|
|
4827
4928
|
title: "Top",
|
|
4828
|
-
icon:
|
|
4929
|
+
icon: we,
|
|
4829
4930
|
suffix: "px",
|
|
4830
4931
|
default: (t == null ? void 0 : t.marginTop) ?? "auto"
|
|
4831
4932
|
}),
|
|
4832
|
-
marginRight: new
|
|
4933
|
+
marginRight: new Z({
|
|
4833
4934
|
title: "Right",
|
|
4834
|
-
icon:
|
|
4935
|
+
icon: xe,
|
|
4835
4936
|
suffix: "px",
|
|
4836
4937
|
default: (t == null ? void 0 : t.marginRight) ?? 0
|
|
4837
4938
|
}),
|
|
4838
|
-
marginBottom: new
|
|
4939
|
+
marginBottom: new Z({
|
|
4839
4940
|
title: "Bottom",
|
|
4840
|
-
icon:
|
|
4941
|
+
icon: Le,
|
|
4841
4942
|
suffix: "px",
|
|
4842
4943
|
default: (t == null ? void 0 : t.marginBottom) ?? 0
|
|
4843
4944
|
}),
|
|
4844
|
-
marginLeft: new
|
|
4945
|
+
marginLeft: new Z({
|
|
4845
4946
|
title: "Left",
|
|
4846
|
-
icon:
|
|
4947
|
+
icon: ke,
|
|
4847
4948
|
suffix: "px",
|
|
4848
4949
|
default: (t == null ? void 0 : t.marginLeft) ?? 0
|
|
4849
4950
|
})
|
|
@@ -4860,16 +4961,16 @@ class He extends $ {
|
|
|
4860
4961
|
`;
|
|
4861
4962
|
}
|
|
4862
4963
|
}
|
|
4863
|
-
const
|
|
4964
|
+
const we = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
4864
4965
|
<path d="M2.25 16.25H2.2575M2.25 9.5H2.2575M2.25 12.875H2.2575M2.25 6.125H2.2575M5.625 16.25H5.6325M5.625 9.5H5.6325M12.375 16.25H12.3825M12.375 9.5H12.3825M9 16.25H9.0075M9 9.5H9.0075M9 12.875H9.0075M9 6.125H9.0075M15.75 16.25H15.7575M15.75 9.5H15.7575M15.75 12.875H15.7575M15.75 6.125H15.7575M15.75 2.75H2.25" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
|
|
4865
|
-
</svg>`,
|
|
4966
|
+
</svg>`, xe = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
4866
4967
|
<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"/>
|
|
4867
|
-
</svg>`,
|
|
4968
|
+
</svg>`, Le = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
4868
4969
|
<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"/>
|
|
4869
|
-
</svg>`,
|
|
4970
|
+
</svg>`, ke = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
4870
4971
|
<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"/>
|
|
4871
4972
|
</svg>`;
|
|
4872
|
-
class
|
|
4973
|
+
class Re extends H {
|
|
4873
4974
|
constructor(t) {
|
|
4874
4975
|
super({
|
|
4875
4976
|
title: "Background Image",
|
|
@@ -4879,7 +4980,7 @@ class Be extends $ {
|
|
|
4879
4980
|
...t == null ? void 0 : t.uploadProps,
|
|
4880
4981
|
default: (t == null ? void 0 : t.backgroundImage) ?? ""
|
|
4881
4982
|
}),
|
|
4882
|
-
opacity: new
|
|
4983
|
+
opacity: new jt({
|
|
4883
4984
|
default: (t == null ? void 0 : t.opacity) ?? 100
|
|
4884
4985
|
}),
|
|
4885
4986
|
backgroundColor: new z({
|
|
@@ -4908,7 +5009,7 @@ class Be extends $ {
|
|
|
4908
5009
|
`;
|
|
4909
5010
|
}
|
|
4910
5011
|
}
|
|
4911
|
-
class
|
|
5012
|
+
class ze extends H {
|
|
4912
5013
|
constructor(t) {
|
|
4913
5014
|
super({
|
|
4914
5015
|
title: (t == null ? void 0 : t.title) ?? "Image",
|
|
@@ -4918,11 +5019,11 @@ class Ae extends $ {
|
|
|
4918
5019
|
...t == null ? void 0 : t.uploadProps,
|
|
4919
5020
|
default: (t == null ? void 0 : t.image) ?? ""
|
|
4920
5021
|
}),
|
|
4921
|
-
width: new
|
|
5022
|
+
width: new de({
|
|
4922
5023
|
default: (t == null ? void 0 : t.width) ?? 1e3,
|
|
4923
5024
|
mobile: t == null ? void 0 : t.widthMobile
|
|
4924
5025
|
}),
|
|
4925
|
-
height: new
|
|
5026
|
+
height: new ce({
|
|
4926
5027
|
default: (t == null ? void 0 : t.height) ?? 300,
|
|
4927
5028
|
mobile: t == null ? void 0 : t.heightMobile
|
|
4928
5029
|
})
|
|
@@ -4931,42 +5032,42 @@ class Ae extends $ {
|
|
|
4931
5032
|
}
|
|
4932
5033
|
}
|
|
4933
5034
|
export {
|
|
4934
|
-
|
|
4935
|
-
|
|
4936
|
-
|
|
4937
|
-
|
|
4938
|
-
|
|
5035
|
+
Jt as AlignSetting,
|
|
5036
|
+
Ae as AnimationSetting,
|
|
5037
|
+
Re as BackgroundSettingSet,
|
|
5038
|
+
De as BorderSettingSet,
|
|
5039
|
+
Se as ButtonSetting,
|
|
4939
5040
|
O as ColorSetting,
|
|
4940
5041
|
z as ColorWithOpacitySetting,
|
|
4941
|
-
|
|
4942
|
-
|
|
5042
|
+
Ve as DimensionSetting,
|
|
5043
|
+
Oe as GapSetting,
|
|
4943
5044
|
j as GradientSetting,
|
|
4944
|
-
|
|
4945
|
-
|
|
4946
|
-
|
|
4947
|
-
|
|
4948
|
-
|
|
4949
|
-
|
|
4950
|
-
|
|
4951
|
-
|
|
4952
|
-
|
|
4953
|
-
|
|
4954
|
-
|
|
4955
|
-
|
|
5045
|
+
Fe as HeaderTypographySettingSet,
|
|
5046
|
+
ce as HeightSetting,
|
|
5047
|
+
Ne as HtmlSetting,
|
|
5048
|
+
vt as ImageMapSetting,
|
|
5049
|
+
ze as ImageSettingSet,
|
|
5050
|
+
He as MarginBottomSetting,
|
|
5051
|
+
Ge as MarginSettingGroup,
|
|
5052
|
+
Be as MarginTopSetting,
|
|
5053
|
+
$e as MultiLanguageSetting,
|
|
5054
|
+
B as NumberSetting,
|
|
5055
|
+
jt as OpacitySetting,
|
|
5056
|
+
Te as SelectApiSettings,
|
|
4956
5057
|
nt as SelectSetting,
|
|
4957
|
-
|
|
4958
|
-
|
|
4959
|
-
|
|
4960
|
-
|
|
4961
|
-
|
|
4962
|
-
|
|
5058
|
+
w as Setting,
|
|
5059
|
+
H as SettingGroup,
|
|
5060
|
+
Rt as StringSetting,
|
|
5061
|
+
Ft as TabSettingGroup,
|
|
5062
|
+
Ft as TabsSettingGroup,
|
|
5063
|
+
Pe as Toggle,
|
|
4963
5064
|
lt as UploadSetting,
|
|
4964
|
-
|
|
4965
|
-
|
|
4966
|
-
|
|
4967
|
-
|
|
4968
|
-
|
|
5065
|
+
de as WidthSetting,
|
|
5066
|
+
Ie as asSettingGroupWithSettings,
|
|
5067
|
+
Gt as createSettingGroup,
|
|
5068
|
+
Me as createTabSettingGroup,
|
|
5069
|
+
F as isSetting,
|
|
4969
5070
|
ct as isSettingChild,
|
|
4970
|
-
|
|
5071
|
+
L as isSettingGroup,
|
|
4971
5072
|
J as iterateSettings
|
|
4972
5073
|
};
|