builder-settings-types 0.0.223 → 0.0.227
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/builder-settings-types.cjs.js +44 -54
- package/dist/builder-settings-types.es.js +516 -622
- package/dist/index.d.ts +96 -121
- package/package.json +1 -1
|
@@ -1,29 +1,131 @@
|
|
|
1
|
-
const
|
|
2
|
-
let
|
|
3
|
-
let t = "", e = crypto.getRandomValues(new Uint8Array(
|
|
4
|
-
for (;
|
|
5
|
-
t +=
|
|
1
|
+
const T = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
2
|
+
let N = (c = 21) => {
|
|
3
|
+
let t = "", e = crypto.getRandomValues(new Uint8Array(c |= 0));
|
|
4
|
+
for (; c--; )
|
|
5
|
+
t += T[e[c] & 63];
|
|
6
6
|
return t;
|
|
7
7
|
};
|
|
8
|
-
function
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
8
|
+
function A(c) {
|
|
9
|
+
let t = 0, e = c.parentElement;
|
|
10
|
+
for (; e; )
|
|
11
|
+
e.classList.contains("setting-group") && e !== c && t++, e = e.parentElement;
|
|
12
|
+
return t;
|
|
13
|
+
}
|
|
14
|
+
function b(c, t) {
|
|
15
|
+
const e = Math.min(Math.max(t, 0), 5);
|
|
16
|
+
c.setAttribute("data-nesting-level", e.toString()), e > 0 ? c.style.setProperty("--visual-indent", `${e * 2}px`) : (c.style.removeProperty("--visual-indent"), c.style.marginLeft = "");
|
|
17
|
+
}
|
|
18
|
+
function V(c, t = 0) {
|
|
19
|
+
c.querySelectorAll(":scope > .setting-group-content > .setting-group").forEach((i) => {
|
|
20
|
+
const s = i, n = t + 1;
|
|
21
|
+
b(s, n), V(s, n);
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
const B = {
|
|
25
|
+
maxLevel: 5,
|
|
26
|
+
spacingMultiplier: 1,
|
|
27
|
+
visualIndentMultiplier: 2,
|
|
28
|
+
enableAutoDetection: !0
|
|
29
|
+
};
|
|
30
|
+
class $ {
|
|
31
|
+
constructor(t = {}) {
|
|
32
|
+
this.observedElements = /* @__PURE__ */ new Set(), this.config = { ...B, ...t }, this.config.enableAutoDetection && this.setupAutoDetection();
|
|
18
33
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
34
|
+
/**
|
|
35
|
+
* Setup automatic detection using MutationObserver
|
|
36
|
+
*/
|
|
37
|
+
setupAutoDetection() {
|
|
38
|
+
this.observer = new MutationObserver((t) => {
|
|
39
|
+
let e = !1;
|
|
40
|
+
t.forEach((i) => {
|
|
41
|
+
i.type === "childList" && i.addedNodes.forEach((s) => {
|
|
42
|
+
s instanceof HTMLElement && (s.classList.contains("setting-group") ? [s] : Array.from(s.querySelectorAll(".setting-group"))).length > 0 && (e = !0);
|
|
43
|
+
});
|
|
44
|
+
}), e && this.updateAllNesting();
|
|
45
|
+
}), this.observer.observe(document.body, {
|
|
46
|
+
childList: !0,
|
|
47
|
+
subtree: !0
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Add element to be tracked for nesting updates
|
|
52
|
+
*/
|
|
53
|
+
trackElement(t) {
|
|
54
|
+
this.observedElements.add(t), this.updateElementNesting(t);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Remove element from tracking
|
|
58
|
+
*/
|
|
59
|
+
untrackElement(t) {
|
|
60
|
+
this.observedElements.delete(t);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Update nesting for a specific element
|
|
64
|
+
*/
|
|
65
|
+
updateElementNesting(t) {
|
|
66
|
+
const e = A(t);
|
|
67
|
+
this.applyNestingWithConfig(t, e);
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Update nesting for all tracked elements
|
|
71
|
+
*/
|
|
72
|
+
updateAllNesting() {
|
|
73
|
+
this.observedElements.forEach((t) => {
|
|
74
|
+
t.isConnected ? this.updateElementNesting(t) : this.observedElements.delete(t);
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Apply nesting with configuration
|
|
79
|
+
*/
|
|
80
|
+
applyNestingWithConfig(t, e) {
|
|
81
|
+
const i = Math.min(Math.max(e, 0), this.config.maxLevel);
|
|
82
|
+
if (t.setAttribute("data-nesting-level", i.toString()), i > 0) {
|
|
83
|
+
const s = i * this.config.visualIndentMultiplier;
|
|
84
|
+
t.style.setProperty("--visual-indent", `${s}px`);
|
|
85
|
+
} else
|
|
86
|
+
t.style.removeProperty("--visual-indent"), t.style.marginLeft = "";
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Force recalculate all nesting in a container
|
|
90
|
+
*/
|
|
91
|
+
recalculateNesting(t = document.body) {
|
|
92
|
+
t.querySelectorAll(".setting-group").forEach((i) => {
|
|
93
|
+
const s = i;
|
|
94
|
+
this.updateElementNesting(s), this.trackElement(s);
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Get nesting statistics for debugging
|
|
99
|
+
*/
|
|
100
|
+
getNestingStats() {
|
|
101
|
+
const t = {};
|
|
102
|
+
return this.observedElements.forEach((e) => {
|
|
103
|
+
const i = parseInt(e.getAttribute("data-nesting-level") || "0", 10);
|
|
104
|
+
t[i] = (t[i] || 0) + 1;
|
|
105
|
+
}), t;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Cleanup observer and tracked elements
|
|
109
|
+
*/
|
|
110
|
+
destroy() {
|
|
111
|
+
this.observer && (this.observer.disconnect(), this.observer = void 0), this.observedElements.clear();
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
const S = new $();
|
|
115
|
+
function x(c) {
|
|
116
|
+
if (c === null || typeof c != "object") return c;
|
|
117
|
+
if (c instanceof Date) return new Date(c.getTime());
|
|
118
|
+
if (c instanceof Array) return c.map((t) => x(t));
|
|
119
|
+
if (typeof c == "object") {
|
|
120
|
+
const t = {};
|
|
121
|
+
for (const e in c)
|
|
122
|
+
Object.prototype.hasOwnProperty.call(c, e) && (t[e] = x(c[e]));
|
|
123
|
+
return t;
|
|
124
|
+
}
|
|
125
|
+
return c;
|
|
24
126
|
}
|
|
25
|
-
function
|
|
26
|
-
switch (
|
|
127
|
+
function R(c) {
|
|
128
|
+
switch (c) {
|
|
27
129
|
case "number":
|
|
28
130
|
return 0;
|
|
29
131
|
case "text":
|
|
@@ -42,10 +144,10 @@ function T(h) {
|
|
|
42
144
|
}
|
|
43
145
|
class g {
|
|
44
146
|
constructor(t = {}) {
|
|
45
|
-
this.props = t, this.id = t.id ||
|
|
147
|
+
this.props = t, this.id = t.id || N(), this.value = this.props.default, this.desktop = this.props.default, this.title = t.title || "", this.includeGetJson = t.includeGetJson !== void 0 ? t.includeGetJson : !0;
|
|
46
148
|
}
|
|
47
149
|
static SetUploadUrl(t) {
|
|
48
|
-
|
|
150
|
+
globalThis.DefaultUploadUrl = t, g.DefaultUploadUrl = t;
|
|
49
151
|
}
|
|
50
152
|
destroy() {
|
|
51
153
|
throw new Error("Method not implemented.");
|
|
@@ -60,8 +162,8 @@ class g {
|
|
|
60
162
|
this.value = t, this.inputEl && (this.inputEl.value = String(t)), this.onChange && this.onChange(t), this.props.detectChange && this.props.detectChange(t);
|
|
61
163
|
}
|
|
62
164
|
clone() {
|
|
63
|
-
const t = this.constructor, e =
|
|
64
|
-
return i.value =
|
|
165
|
+
const t = this.constructor, e = x(this.props), i = new t(e);
|
|
166
|
+
return i.value = x(this.value), i;
|
|
65
167
|
}
|
|
66
168
|
createInput(t) {
|
|
67
169
|
t = { ...this.props.inputProps, ...t };
|
|
@@ -81,7 +183,7 @@ class g {
|
|
|
81
183
|
const i = document.createElement("div");
|
|
82
184
|
i.className = t.wrapperClassName || "";
|
|
83
185
|
const s = document.createElement("input");
|
|
84
|
-
this.inputEl = s, s.value = String(t.value ||
|
|
186
|
+
this.inputEl = s, s.value = String(t.value || R(t.inputType)), s.type = t.inputType, s.placeholder = t.placeholder || "", s.className = t.inputClassName || "";
|
|
85
187
|
const n = (o) => {
|
|
86
188
|
const l = o.target;
|
|
87
189
|
let r = l.value;
|
|
@@ -122,129 +224,31 @@ class g {
|
|
|
122
224
|
return i.className = "input-icon " + (e || ""), i.innerHTML = t, i;
|
|
123
225
|
}
|
|
124
226
|
}
|
|
125
|
-
function
|
|
126
|
-
|
|
127
|
-
for (; e; )
|
|
128
|
-
e.classList.contains("setting-group") && e !== h && t++, e = e.parentElement;
|
|
129
|
-
return t;
|
|
227
|
+
function w(c) {
|
|
228
|
+
return c instanceof g;
|
|
130
229
|
}
|
|
131
|
-
function
|
|
132
|
-
|
|
133
|
-
h.setAttribute("data-nesting-level", e.toString()), e > 0 ? h.style.setProperty("--visual-indent", `${e * 2}px`) : (h.style.removeProperty("--visual-indent"), h.style.marginLeft = "");
|
|
230
|
+
function p(c) {
|
|
231
|
+
return c instanceof v;
|
|
134
232
|
}
|
|
135
|
-
function
|
|
136
|
-
|
|
137
|
-
const s = i, n = t + 1;
|
|
138
|
-
L(s, n), I(s, n);
|
|
139
|
-
});
|
|
233
|
+
function ft(c) {
|
|
234
|
+
return w(c) || p(c);
|
|
140
235
|
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
enableAutoDetection: !0
|
|
146
|
-
};
|
|
147
|
-
class R {
|
|
148
|
-
constructor(t = {}) {
|
|
149
|
-
this.observedElements = /* @__PURE__ */ new Set(), this.config = { ...A, ...t }, this.config.enableAutoDetection && this.setupAutoDetection();
|
|
150
|
-
}
|
|
151
|
-
/**
|
|
152
|
-
* Setup automatic detection using MutationObserver
|
|
153
|
-
*/
|
|
154
|
-
setupAutoDetection() {
|
|
155
|
-
this.observer = new MutationObserver((t) => {
|
|
156
|
-
let e = !1;
|
|
157
|
-
t.forEach((i) => {
|
|
158
|
-
i.type === "childList" && i.addedNodes.forEach((s) => {
|
|
159
|
-
s instanceof HTMLElement && (s.classList.contains("setting-group") ? [s] : Array.from(s.querySelectorAll(".setting-group"))).length > 0 && (e = !0);
|
|
160
|
-
});
|
|
161
|
-
}), e && this.updateAllNesting();
|
|
162
|
-
}), this.observer.observe(document.body, {
|
|
163
|
-
childList: !0,
|
|
164
|
-
subtree: !0
|
|
165
|
-
});
|
|
166
|
-
}
|
|
167
|
-
/**
|
|
168
|
-
* Add element to be tracked for nesting updates
|
|
169
|
-
*/
|
|
170
|
-
trackElement(t) {
|
|
171
|
-
this.observedElements.add(t), this.updateElementNesting(t);
|
|
172
|
-
}
|
|
173
|
-
/**
|
|
174
|
-
* Remove element from tracking
|
|
175
|
-
*/
|
|
176
|
-
untrackElement(t) {
|
|
177
|
-
this.observedElements.delete(t);
|
|
178
|
-
}
|
|
179
|
-
/**
|
|
180
|
-
* Update nesting for a specific element
|
|
181
|
-
*/
|
|
182
|
-
updateElementNesting(t) {
|
|
183
|
-
const e = B(t);
|
|
184
|
-
this.applyNestingWithConfig(t, e);
|
|
185
|
-
}
|
|
186
|
-
/**
|
|
187
|
-
* Update nesting for all tracked elements
|
|
188
|
-
*/
|
|
189
|
-
updateAllNesting() {
|
|
190
|
-
this.observedElements.forEach((t) => {
|
|
191
|
-
t.isConnected ? this.updateElementNesting(t) : this.observedElements.delete(t);
|
|
192
|
-
});
|
|
193
|
-
}
|
|
194
|
-
/**
|
|
195
|
-
* Apply nesting with configuration
|
|
196
|
-
*/
|
|
197
|
-
applyNestingWithConfig(t, e) {
|
|
198
|
-
const i = Math.min(Math.max(e, 0), this.config.maxLevel);
|
|
199
|
-
if (t.setAttribute("data-nesting-level", i.toString()), i > 0) {
|
|
200
|
-
const s = i * this.config.visualIndentMultiplier;
|
|
201
|
-
t.style.setProperty("--visual-indent", `${s}px`);
|
|
202
|
-
} else
|
|
203
|
-
t.style.removeProperty("--visual-indent"), t.style.marginLeft = "";
|
|
204
|
-
}
|
|
205
|
-
/**
|
|
206
|
-
* Force recalculate all nesting in a container
|
|
207
|
-
*/
|
|
208
|
-
recalculateNesting(t = document.body) {
|
|
209
|
-
t.querySelectorAll(".setting-group").forEach((i) => {
|
|
210
|
-
const s = i;
|
|
211
|
-
this.updateElementNesting(s), this.trackElement(s);
|
|
212
|
-
});
|
|
213
|
-
}
|
|
214
|
-
/**
|
|
215
|
-
* Get nesting statistics for debugging
|
|
216
|
-
*/
|
|
217
|
-
getNestingStats() {
|
|
218
|
-
const t = {};
|
|
219
|
-
return this.observedElements.forEach((e) => {
|
|
220
|
-
const i = parseInt(e.getAttribute("data-nesting-level") || "0", 10);
|
|
221
|
-
t[i] = (t[i] || 0) + 1;
|
|
222
|
-
}), t;
|
|
223
|
-
}
|
|
224
|
-
/**
|
|
225
|
-
* Cleanup observer and tracked elements
|
|
226
|
-
*/
|
|
227
|
-
destroy() {
|
|
228
|
-
this.observer && (this.observer.disconnect(), this.observer = void 0), this.observedElements.clear();
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
const S = new R();
|
|
232
|
-
function x(h, t) {
|
|
233
|
-
for (const e in h)
|
|
234
|
-
if (Object.prototype.hasOwnProperty.call(h, e)) {
|
|
235
|
-
const i = h[e];
|
|
236
|
+
function k(c, t) {
|
|
237
|
+
for (const e in c)
|
|
238
|
+
if (Object.prototype.hasOwnProperty.call(c, e)) {
|
|
239
|
+
const i = c[e];
|
|
236
240
|
t(e, i);
|
|
237
241
|
}
|
|
238
242
|
}
|
|
239
|
-
const
|
|
243
|
+
const L = class L {
|
|
240
244
|
constructor(t) {
|
|
241
245
|
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 = () => {
|
|
242
|
-
}, this.pendingBlurHandler = null, this.originalDefaultValues = {}, this.nestingLevel = 0, this.
|
|
246
|
+
}, this.pendingBlurHandler = null, this.originalDefaultValues = {}, this.nestingLevel = 0, this.id = t.id || N(), 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, Object.assign(this, t.settings), this.initialValues = this.getValues(), this.originalDefaultValues = this.getDefaultValues(), this.propagateNestingLevel();
|
|
243
247
|
}
|
|
244
248
|
propagateNestingLevel() {
|
|
245
249
|
const t = this.nestingLevel + 1;
|
|
246
|
-
|
|
247
|
-
i
|
|
250
|
+
k(this.settings, (e, i) => {
|
|
251
|
+
p(i) && (i.nestingLevel = t, i.propagateNestingLevel());
|
|
248
252
|
});
|
|
249
253
|
}
|
|
250
254
|
getNestingLevel() {
|
|
@@ -254,17 +258,104 @@ const p = class p {
|
|
|
254
258
|
this.nestingLevel = t, this.propagateNestingLevel(), this.elementRef && this.updateNestingStyles();
|
|
255
259
|
}
|
|
256
260
|
updateNestingStyles() {
|
|
257
|
-
this.elementRef && (
|
|
261
|
+
this.elementRef && (b(this.elementRef, this.nestingLevel), V(this.elementRef, this.nestingLevel));
|
|
258
262
|
}
|
|
259
|
-
|
|
260
|
-
this.
|
|
261
|
-
|
|
263
|
+
forceChildUIRefresh() {
|
|
264
|
+
Object.entries(this.settings).forEach(([t, e]) => {
|
|
265
|
+
try {
|
|
266
|
+
if (p(e)) {
|
|
267
|
+
const i = e.getValues();
|
|
268
|
+
e.setValue(i);
|
|
269
|
+
} else if (typeof e.setValue == "function") {
|
|
270
|
+
const i = e.value;
|
|
271
|
+
i !== void 0 && e.setValue(
|
|
272
|
+
i
|
|
273
|
+
);
|
|
274
|
+
}
|
|
275
|
+
} catch (i) {
|
|
276
|
+
console.warn(`Error refreshing UI for setting ${t}:`, i);
|
|
277
|
+
}
|
|
262
278
|
});
|
|
263
279
|
}
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
280
|
+
removeSetting(t) {
|
|
281
|
+
var s;
|
|
282
|
+
const e = this.settings[t];
|
|
283
|
+
if (!e) return;
|
|
284
|
+
if (delete this.settings[t], this.elementRef) {
|
|
285
|
+
const n = this.elementRef.querySelector(
|
|
286
|
+
".setting-group-content"
|
|
287
|
+
);
|
|
288
|
+
if (n) {
|
|
289
|
+
const a = Array.from(
|
|
290
|
+
n.querySelectorAll(".setting-group, .setting")
|
|
291
|
+
);
|
|
292
|
+
for (const o of a) {
|
|
293
|
+
const l = o.id;
|
|
294
|
+
if (l && l.includes(e.id)) {
|
|
295
|
+
o.remove();
|
|
296
|
+
break;
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
typeof e.cleanup == "function" && e.cleanup(), this.updateNestingStyles();
|
|
302
|
+
const i = this.getValues();
|
|
303
|
+
this.initialValues = i, (s = this.onChange) == null || s.call(this, i);
|
|
304
|
+
}
|
|
305
|
+
updateVisibility() {
|
|
306
|
+
this.elementRef;
|
|
307
|
+
}
|
|
308
|
+
clone() {
|
|
309
|
+
const t = {};
|
|
310
|
+
k(this.settings, (s, n) => {
|
|
311
|
+
const a = String(s);
|
|
312
|
+
typeof n.clone == "function" ? t[a] = n.clone() : (console.warn(
|
|
313
|
+
`Setting with key '${a}' does not have a clone method. Copying reference.`
|
|
314
|
+
), t[a] = n);
|
|
267
315
|
});
|
|
316
|
+
const e = {
|
|
317
|
+
title: this.title,
|
|
318
|
+
settings: t,
|
|
319
|
+
collapsed: this.isCollapsed,
|
|
320
|
+
main: this.isMain,
|
|
321
|
+
custom: this.custom,
|
|
322
|
+
includeGetJson: this.includeGetJson,
|
|
323
|
+
addItem: this.addItemCfg,
|
|
324
|
+
deleteItem: this.deleteItemCfg
|
|
325
|
+
}, i = z(e);
|
|
326
|
+
return i.initialValues = this.getValues(), i;
|
|
327
|
+
}
|
|
328
|
+
resetDefault() {
|
|
329
|
+
const t = this.originalDefaultValues;
|
|
330
|
+
this.setValue(t), this.onChange && this.onChange(this.getValues());
|
|
331
|
+
}
|
|
332
|
+
setMobileValues(t) {
|
|
333
|
+
!t || typeof t != "object" || (Object.entries(t).forEach(([e, i]) => {
|
|
334
|
+
const s = this.settings[e];
|
|
335
|
+
s && (p(s) || w(s)) && typeof s.setMobileValue == "function" && s.setMobileValue(i);
|
|
336
|
+
}), this.setValue(t), this.onChange && this.onChange(this.getValues()));
|
|
337
|
+
}
|
|
338
|
+
getMobileValues(t) {
|
|
339
|
+
if (t === void 0) {
|
|
340
|
+
const e = {};
|
|
341
|
+
for (const i in this.settings)
|
|
342
|
+
if (Object.prototype.hasOwnProperty.call(this.settings, i)) {
|
|
343
|
+
const s = this.settings[i];
|
|
344
|
+
if (p(s))
|
|
345
|
+
e[i] = s.getMobileValues();
|
|
346
|
+
else {
|
|
347
|
+
const n = s;
|
|
348
|
+
e[i] = n.mobileValue !== void 0 ? n.mobileValue : n.value;
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
return e;
|
|
352
|
+
} else {
|
|
353
|
+
const e = this.settings[t];
|
|
354
|
+
if (!e) return;
|
|
355
|
+
if (p(e)) return e.getMobileValues();
|
|
356
|
+
const i = e;
|
|
357
|
+
return i.mobileValue !== void 0 ? i.mobileValue : i.value;
|
|
358
|
+
}
|
|
268
359
|
}
|
|
269
360
|
setOnChange(t) {
|
|
270
361
|
this.onChange = t;
|
|
@@ -277,14 +368,14 @@ const p = class p {
|
|
|
277
368
|
Object.keys(s).length > 0 && (this.lastChangeTime = Date.now(), this.initialValues = i, t(i), this.updateVisibility()), this.isHandlingChange = !1;
|
|
278
369
|
}, 50));
|
|
279
370
|
};
|
|
280
|
-
return this.changeHandlers.clear(),
|
|
371
|
+
return this.changeHandlers.clear(), k(this.settings, (i, s) => {
|
|
281
372
|
var n;
|
|
282
|
-
if (s
|
|
373
|
+
if (p(s))
|
|
283
374
|
s.setOnChange(() => {
|
|
284
375
|
const a = this.getValues();
|
|
285
376
|
this.initialValues = a, t(a);
|
|
286
377
|
}), this.changeHandlers.add(() => t(this.getValues()));
|
|
287
|
-
else if (s
|
|
378
|
+
else if (w(s)) {
|
|
288
379
|
const a = () => e();
|
|
289
380
|
this.changeHandlers.add(a), s.setOnChange(a);
|
|
290
381
|
} else {
|
|
@@ -293,54 +384,12 @@ const p = class p {
|
|
|
293
384
|
}
|
|
294
385
|
}), this;
|
|
295
386
|
}
|
|
296
|
-
setOnBlur(t) {
|
|
297
|
-
return this.onBlur = t, this.pendingBlurHandler = t, this.handleBlur = (e) => {
|
|
298
|
-
(e == null ? void 0 : e.target) instanceof HTMLElement && e.target.closest(".setting-group") !== this.elementRef || (this.blurTimeout && clearTimeout(this.blurTimeout), this.blurTimeout = setTimeout(() => t(), 100));
|
|
299
|
-
}, this.elementRef && this.setupBlurHandlers(), this;
|
|
300
|
-
}
|
|
301
|
-
setupBlurHandlers() {
|
|
302
|
-
this.elementRef && (this.elementRef.removeEventListener(
|
|
303
|
-
"focusout",
|
|
304
|
-
this.handleBlur
|
|
305
|
-
), this.elementRef.addEventListener(
|
|
306
|
-
"focusout",
|
|
307
|
-
this.handleBlur,
|
|
308
|
-
!0
|
|
309
|
-
)), x(this.settings, (t, e) => {
|
|
310
|
-
e instanceof p && e.setOnBlur(() => {
|
|
311
|
-
this.onBlur && this.onBlur();
|
|
312
|
-
});
|
|
313
|
-
});
|
|
314
|
-
}
|
|
315
387
|
cleanup() {
|
|
316
388
|
this.changeTimeout && (clearTimeout(this.changeTimeout), this.changeTimeout = null), this.blurTimeout && (clearTimeout(this.blurTimeout), this.blurTimeout = null), this.elementRef && this.elementRef.removeEventListener(
|
|
317
389
|
"focusout",
|
|
318
390
|
this.handleBlur
|
|
319
391
|
), this.changeHandlers.clear();
|
|
320
392
|
}
|
|
321
|
-
clone() {
|
|
322
|
-
const t = {};
|
|
323
|
-
x(this.settings, (s, n) => {
|
|
324
|
-
typeof n.clone == "function" ? t[s] = n.clone() : (console.warn(
|
|
325
|
-
`Setting with key '${s}' does not have a clone method. Copying reference.`
|
|
326
|
-
), t[s] = n);
|
|
327
|
-
});
|
|
328
|
-
const e = {
|
|
329
|
-
title: this.title,
|
|
330
|
-
settings: t,
|
|
331
|
-
description: this.description,
|
|
332
|
-
icon: this.icon,
|
|
333
|
-
collapsed: this.isCollapsed,
|
|
334
|
-
main: this.isMain,
|
|
335
|
-
custom: this.custom,
|
|
336
|
-
hideCondition: this.hideCondition,
|
|
337
|
-
parentNestingLevel: this.parentNestingLevel,
|
|
338
|
-
includeGetJson: this.includeGetJson,
|
|
339
|
-
addItem: this.addItemCfg,
|
|
340
|
-
deleteItem: this.deleteItemCfg
|
|
341
|
-
}, i = $(e);
|
|
342
|
-
return i.initialValues = this.getValues(), i;
|
|
343
|
-
}
|
|
344
393
|
setValue(t) {
|
|
345
394
|
if (!t || typeof t != "object") return;
|
|
346
395
|
Object.entries(t).forEach(([i, s]) => {
|
|
@@ -352,44 +401,21 @@ const p = class p {
|
|
|
352
401
|
this.addSetting(i, l), n = l;
|
|
353
402
|
}
|
|
354
403
|
}
|
|
355
|
-
n && (n
|
|
404
|
+
n && (p(n) || w(n)) && typeof n.setValue == "function" && n.setValue(s);
|
|
356
405
|
}), setTimeout(() => {
|
|
357
406
|
this.forceChildUIRefresh();
|
|
358
407
|
}, 0);
|
|
359
408
|
const e = this.getValues();
|
|
360
409
|
this.initialValues = e, this.onChange && this.onChange(e);
|
|
361
410
|
}
|
|
362
|
-
/** Force UI refresh for all child settings */
|
|
363
|
-
forceChildUIRefresh() {
|
|
364
|
-
Object.entries(this.settings).forEach(([t, e]) => {
|
|
365
|
-
try {
|
|
366
|
-
if (e instanceof p) {
|
|
367
|
-
const i = e.getValues();
|
|
368
|
-
e.setValue(i);
|
|
369
|
-
} else if (typeof e.setValue == "function") {
|
|
370
|
-
const i = e.value;
|
|
371
|
-
i !== void 0 && e.setValue(i);
|
|
372
|
-
}
|
|
373
|
-
} catch (i) {
|
|
374
|
-
console.warn(`Error refreshing UI for setting ${t}:`, i);
|
|
375
|
-
}
|
|
376
|
-
});
|
|
377
|
-
}
|
|
378
|
-
/** Attach change/blur bubbling for a newly added child */
|
|
379
411
|
wireChild(t) {
|
|
380
|
-
var i
|
|
412
|
+
var i;
|
|
381
413
|
const e = () => {
|
|
382
|
-
var
|
|
383
|
-
const
|
|
384
|
-
this.initialValues =
|
|
414
|
+
var n;
|
|
415
|
+
const s = this.getValues();
|
|
416
|
+
this.initialValues = s, (n = this.onChange) == null || n.call(this, s), this.updateVisibility();
|
|
385
417
|
};
|
|
386
|
-
t
|
|
387
|
-
var a;
|
|
388
|
-
return (a = this.onBlur) == null ? void 0 : a.call(this);
|
|
389
|
-
})) : t instanceof g ? (t.setOnChange(() => e()), (s = t.setOnBlur) == null || s.call(t, () => {
|
|
390
|
-
var a;
|
|
391
|
-
return (a = this.onBlur) == null ? void 0 : a.call(this);
|
|
392
|
-
})) : (n = t.setOnChange) == null || n.call(t, () => e());
|
|
418
|
+
p(t) ? t.setOnChange(() => e()) : w(t) ? t.setOnChange(() => e()) : (i = t.setOnChange) == null || i.call(t, () => e());
|
|
393
419
|
}
|
|
394
420
|
addSetting(t, e) {
|
|
395
421
|
var s, n;
|
|
@@ -398,71 +424,44 @@ const p = class p {
|
|
|
398
424
|
".setting-group-content"
|
|
399
425
|
);
|
|
400
426
|
if (a) {
|
|
401
|
-
e
|
|
427
|
+
p(e) && typeof e.setNestingLevel == "function" && e.setNestingLevel(this.nestingLevel + 1);
|
|
402
428
|
const o = e.draw(), l = this.deleteItemCfg ?? this.addItemCfg;
|
|
403
|
-
if (l
|
|
404
|
-
const
|
|
405
|
-
|
|
429
|
+
if (l) {
|
|
430
|
+
const d = l.keyPrefix ?? ((s = this.addItemCfg) == null ? void 0 : s.keyPrefix);
|
|
431
|
+
d && t.startsWith(d) && this.addDeleteButtonToElement(o, t);
|
|
406
432
|
}
|
|
407
433
|
const r = a.querySelector(".sg-add-button-bottom");
|
|
408
|
-
r ? a.insertBefore(o, r) : a.appendChild(o), S.trackElement(o),
|
|
409
|
-
const
|
|
410
|
-
o.style.display = "none", o.offsetHeight, o.style.display =
|
|
434
|
+
r ? a.insertBefore(o, r) : a.appendChild(o), S.trackElement(o), b(o, this.nestingLevel + 1), V(o, this.nestingLevel + 1);
|
|
435
|
+
const h = o.style.display;
|
|
436
|
+
o.style.display = "none", o.offsetHeight, o.style.display = h, this.updateNestingStyles();
|
|
411
437
|
}
|
|
412
438
|
}
|
|
413
439
|
const i = this.getValues();
|
|
414
440
|
this.initialValues = i, (n = this.onChange) == null || n.call(this, i);
|
|
415
441
|
}
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
const e = this.settings[t];
|
|
419
|
-
if (!e) return;
|
|
420
|
-
if (delete this.settings[t], this.elementRef) {
|
|
421
|
-
const n = this.elementRef.querySelector(
|
|
422
|
-
".setting-group-content"
|
|
423
|
-
);
|
|
424
|
-
if (n) {
|
|
425
|
-
const a = Array.from(
|
|
426
|
-
n.querySelectorAll(".setting-group, .setting")
|
|
427
|
-
);
|
|
428
|
-
for (const o of a) {
|
|
429
|
-
const l = o.id;
|
|
430
|
-
if (l && l.includes(e.id)) {
|
|
431
|
-
o.remove();
|
|
432
|
-
break;
|
|
433
|
-
}
|
|
434
|
-
}
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
typeof e.cleanup == "function" && e.cleanup(), this.updateNestingStyles();
|
|
438
|
-
const i = this.getValues();
|
|
439
|
-
this.initialValues = i, (s = this.onChange) == null || s.call(this, i);
|
|
440
|
-
}
|
|
441
|
-
addDeleteButtonToElement(t, e) {
|
|
442
|
-
let i = null;
|
|
442
|
+
addDeleteButtonToElement(t, e, i) {
|
|
443
|
+
let s = null;
|
|
443
444
|
try {
|
|
444
|
-
|
|
445
|
+
s = t.querySelector(":scope > .setting-group-title");
|
|
445
446
|
} catch {
|
|
446
|
-
|
|
447
|
+
s = null;
|
|
447
448
|
}
|
|
448
|
-
if (!
|
|
449
|
+
if (!s) {
|
|
449
450
|
const r = Array.from(
|
|
450
451
|
t.querySelectorAll(".setting-group-title")
|
|
451
452
|
);
|
|
452
|
-
for (const
|
|
453
|
-
if (
|
|
454
|
-
|
|
453
|
+
for (const h of r)
|
|
454
|
+
if (h.closest(".setting-group") === t) {
|
|
455
|
+
s = h;
|
|
455
456
|
break;
|
|
456
457
|
}
|
|
457
|
-
|
|
458
|
+
s || (s = r[0] ?? null);
|
|
458
459
|
}
|
|
459
|
-
if (!i) return;
|
|
460
|
-
const s = i.querySelector(".actions-section");
|
|
461
460
|
if (!s) return;
|
|
462
|
-
const n =
|
|
463
|
-
|
|
464
|
-
const a =
|
|
465
|
-
|
|
461
|
+
const n = s.querySelector(".actions-section");
|
|
462
|
+
if (!n) return;
|
|
463
|
+
const a = document.createElement("button");
|
|
464
|
+
a.type = "button", a.className = "sg-delete-button", i ? i.deleteItemCfg : this.deleteItemCfg ?? this.addItemCfg, a.title = "Delete", a.style.cssText = `
|
|
466
465
|
background: none;
|
|
467
466
|
border: none;
|
|
468
467
|
cursor: pointer;
|
|
@@ -475,23 +474,23 @@ const p = class p {
|
|
|
475
474
|
border-radius: 4px;
|
|
476
475
|
transition: background-color 0.2s;
|
|
477
476
|
`;
|
|
478
|
-
const o =
|
|
477
|
+
const o = `
|
|
479
478
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
480
479
|
<path d="M2 4h12M5.333 4V2.667a1.333 1.333 0 0 1 1.334-1.334h2.666a1.333 1.333 0 0 1 1.334 1.334V4m2 0v9.333a1.333 1.333 0 0 1-1.334 1.334H4.667a1.333 1.333 0 0 1-1.334-1.334V4h8.667Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
481
480
|
<path d="M6.667 7.333v4M9.333 7.333v4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
482
481
|
</svg>
|
|
483
482
|
`;
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
}),
|
|
487
|
-
|
|
488
|
-
}),
|
|
489
|
-
r.stopPropagation(), r.preventDefault(), this.showDeleteConfirmation().then((
|
|
490
|
-
|
|
483
|
+
a.innerHTML = o, a.addEventListener("mouseenter", () => {
|
|
484
|
+
a.style.backgroundColor = "#fef2f2";
|
|
485
|
+
}), a.addEventListener("mouseleave", () => {
|
|
486
|
+
a.style.backgroundColor = "transparent";
|
|
487
|
+
}), a.addEventListener("click", (r) => {
|
|
488
|
+
r.stopPropagation(), r.preventDefault(), this.showDeleteConfirmation().then((h) => {
|
|
489
|
+
h && (i && i.deleteItemCfg ? this.removeSetting(e) : this.removeSetting(e));
|
|
491
490
|
});
|
|
492
491
|
});
|
|
493
|
-
const l =
|
|
494
|
-
l ?
|
|
492
|
+
const l = n.querySelector(".setting-group-arrow");
|
|
493
|
+
l ? n.insertBefore(a, l) : n.appendChild(a);
|
|
495
494
|
}
|
|
496
495
|
showDeleteConfirmation() {
|
|
497
496
|
return new Promise((t) => {
|
|
@@ -581,13 +580,13 @@ const p = class p {
|
|
|
581
580
|
r(), t(!1);
|
|
582
581
|
}), l.addEventListener("click", () => {
|
|
583
582
|
r(), t(!0);
|
|
584
|
-
}), e.addEventListener("click", (
|
|
585
|
-
|
|
583
|
+
}), e.addEventListener("click", (d) => {
|
|
584
|
+
d.target === e && (r(), t(!1));
|
|
586
585
|
});
|
|
587
|
-
const
|
|
588
|
-
|
|
586
|
+
const h = (d) => {
|
|
587
|
+
d.key === "Escape" && (r(), t(!1), document.removeEventListener("keydown", h));
|
|
589
588
|
};
|
|
590
|
-
document.addEventListener("keydown",
|
|
589
|
+
document.addEventListener("keydown", h), a.appendChild(o), a.appendChild(l), i.appendChild(s), i.appendChild(n), i.appendChild(a), e.appendChild(i), document.body.appendChild(e), requestAnimationFrame(() => {
|
|
591
590
|
e.style.opacity = "1", i.style.transform = "scale(1)";
|
|
592
591
|
}), setTimeout(() => l.focus(), 100);
|
|
593
592
|
});
|
|
@@ -609,24 +608,18 @@ const p = class p {
|
|
|
609
608
|
JSON.stringify(a) !== JSON.stringify(o) && (i[n] = { from: a, to: o });
|
|
610
609
|
}), i;
|
|
611
610
|
}
|
|
612
|
-
hide() {
|
|
613
|
-
this.elementRef && (this.elementRef.style.display = "none", this.isHidden = !0);
|
|
614
|
-
}
|
|
615
|
-
show() {
|
|
616
|
-
this.elementRef && (this.elementRef.style.display = "", this.isHidden = !1);
|
|
617
|
-
}
|
|
618
611
|
getValues(t) {
|
|
619
612
|
if (t === void 0) {
|
|
620
613
|
const e = {};
|
|
621
614
|
for (const i in this.settings)
|
|
622
615
|
if (Object.prototype.hasOwnProperty.call(this.settings, i)) {
|
|
623
616
|
const s = this.settings[i];
|
|
624
|
-
s
|
|
617
|
+
p(s) ? e[i] = s.getValues() : e[i] = s.value;
|
|
625
618
|
}
|
|
626
619
|
return e;
|
|
627
620
|
} else {
|
|
628
621
|
const e = this.settings[t];
|
|
629
|
-
return e ? e
|
|
622
|
+
return e ? p(e) ? e.getValues() : e.value : void 0;
|
|
630
623
|
}
|
|
631
624
|
}
|
|
632
625
|
getValuesForJson(t) {
|
|
@@ -636,12 +629,23 @@ const p = class p {
|
|
|
636
629
|
for (const i in this.settings)
|
|
637
630
|
if (Object.prototype.hasOwnProperty.call(this.settings, i)) {
|
|
638
631
|
const s = this.settings[i];
|
|
639
|
-
|
|
632
|
+
if (p(s))
|
|
633
|
+
e[i] = s.getValuesForJson();
|
|
634
|
+
else {
|
|
635
|
+
const n = s;
|
|
636
|
+
n.includeGetJson === !1 ? e[i] = null : e[i] = n.value;
|
|
637
|
+
}
|
|
640
638
|
}
|
|
641
639
|
return e;
|
|
642
640
|
} else {
|
|
643
641
|
const e = this.settings[t];
|
|
644
|
-
|
|
642
|
+
if (!e) return;
|
|
643
|
+
if (p(e))
|
|
644
|
+
return e.includeGetJson === !1 ? null : e.getValuesForJson();
|
|
645
|
+
{
|
|
646
|
+
const i = e;
|
|
647
|
+
return i.includeGetJson === !1 ? null : i.value;
|
|
648
|
+
}
|
|
645
649
|
}
|
|
646
650
|
}
|
|
647
651
|
getDefaultValues(t) {
|
|
@@ -650,82 +654,36 @@ const p = class p {
|
|
|
650
654
|
for (const i in this.settings)
|
|
651
655
|
if (Object.prototype.hasOwnProperty.call(this.settings, i)) {
|
|
652
656
|
const s = this.settings[i];
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
}
|
|
660
|
-
}
|
|
661
|
-
getMobileValues(t) {
|
|
662
|
-
if (t === void 0) {
|
|
663
|
-
const e = {};
|
|
664
|
-
for (const i in this.settings)
|
|
665
|
-
if (Object.prototype.hasOwnProperty.call(this.settings, i)) {
|
|
666
|
-
const s = this.settings[i];
|
|
667
|
-
if (s instanceof p)
|
|
668
|
-
e[i] = s.getMobileValues();
|
|
669
|
-
else if (typeof s.getMobileValue == "function") {
|
|
670
|
-
const n = s.getMobileValue();
|
|
671
|
-
e[i] = n !== void 0 ? n : s.value;
|
|
672
|
-
} else
|
|
673
|
-
e[i] = s.value;
|
|
657
|
+
if (p(s))
|
|
658
|
+
e[i] = s.getDefaultValues();
|
|
659
|
+
else {
|
|
660
|
+
const n = s;
|
|
661
|
+
e[i] = n.default !== void 0 ? n.default : n.value;
|
|
662
|
+
}
|
|
674
663
|
}
|
|
675
664
|
return e;
|
|
676
665
|
} else {
|
|
677
666
|
const e = this.settings[t];
|
|
678
667
|
if (!e) return;
|
|
679
|
-
if (e
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
return i !== void 0 ? i : e.value;
|
|
683
|
-
}
|
|
684
|
-
return e.value;
|
|
685
|
-
}
|
|
686
|
-
}
|
|
687
|
-
setMobileValues(t) {
|
|
688
|
-
if (!(!t || typeof t != "object") && (Object.entries(t).forEach(([e, i]) => {
|
|
689
|
-
const s = this.settings[e];
|
|
690
|
-
s && (s instanceof p ? typeof i == "object" && i !== null && s.setMobileValues(i) : typeof s.setMobileValue == "function" && s.setMobileValue(i));
|
|
691
|
-
}), this.setValue(t), this.onChange)) {
|
|
692
|
-
const e = this.getValues();
|
|
693
|
-
this.onChange(e);
|
|
694
|
-
}
|
|
695
|
-
}
|
|
696
|
-
resetDefault() {
|
|
697
|
-
const t = this.originalDefaultValues;
|
|
698
|
-
if (this.setValue(t), this.onChange) {
|
|
699
|
-
const e = this.getValues();
|
|
700
|
-
this.onChange(e);
|
|
668
|
+
if (p(e)) return e.getDefaultValues();
|
|
669
|
+
const i = e;
|
|
670
|
+
return i.default !== void 0 ? i.default : i.value;
|
|
701
671
|
}
|
|
702
672
|
}
|
|
703
673
|
draw() {
|
|
704
|
-
var d;
|
|
705
674
|
const t = document.createElement("div");
|
|
706
|
-
t.className = "setting-group", t.id = `setting-group-${this.id}`,
|
|
675
|
+
t.className = "setting-group", t.id = `setting-group-${this.id}`, L.hiddenElements.add(t), this.isMain && t.classList.add("main-group"), this.custom && t.classList.add("custom_class"), b(t, this.nestingLevel);
|
|
707
676
|
const e = document.createElement("div");
|
|
708
677
|
e.className = "setting-group-title", this.isCollapsed && e.classList.add("collapsed-view"), e.setAttribute("role", "button"), e.setAttribute(
|
|
709
678
|
"aria-expanded",
|
|
710
679
|
(!this.isCollapsed).toString()
|
|
711
680
|
), e.setAttribute("tabindex", "0");
|
|
712
681
|
const i = document.createElement("div");
|
|
713
|
-
|
|
714
|
-
const c = document.createElement("span");
|
|
715
|
-
c.className = "group-icon", c.innerHTML = this.icon, i.appendChild(c);
|
|
716
|
-
}
|
|
682
|
+
i.className = "title-section";
|
|
717
683
|
const s = document.createElement("h3");
|
|
718
684
|
s.textContent = this.title, i.appendChild(s);
|
|
719
685
|
const n = document.createElement("div");
|
|
720
|
-
|
|
721
|
-
const c = document.createElement("span");
|
|
722
|
-
c.className = "info-marker", c.innerHTML = `
|
|
723
|
-
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
724
|
-
<path d="M8 5.33333V8M8 10.6667H8.00667M14 8C14 11.3137 11.3137 14 8 14C4.68629 14 2 11.3137 2 8C2 4.68629 4.68629 2 8 2C11.3137 2 14 4.68629 14 8Z"
|
|
725
|
-
stroke="currentColor" stroke-width="1.33333" stroke-linecap="round" stroke-linejoin="round"/>
|
|
726
|
-
</svg>
|
|
727
|
-
`, c.title = this.description, n.appendChild(c);
|
|
728
|
-
}
|
|
686
|
+
n.className = "actions-section";
|
|
729
687
|
const a = document.createElement("span");
|
|
730
688
|
a.className = "setting-group-arrow", a.innerHTML = `
|
|
731
689
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
@@ -733,81 +691,49 @@ const p = class p {
|
|
|
733
691
|
</svg>
|
|
734
692
|
`, this.isCollapsed && a.classList.add("rotated"), n.appendChild(a);
|
|
735
693
|
const o = document.createElement("div");
|
|
736
|
-
|
|
737
|
-
const c = document.createElement("div");
|
|
738
|
-
c.className = "setting-group-description", c.textContent = this.description, o.appendChild(c);
|
|
739
|
-
}
|
|
694
|
+
o.className = "setting-group-content", this.isCollapsed && (o.classList.add("collapsed"), e.classList.add("collapsed-view"), a.classList.add("rotated"), t.classList.add("collapsed")), this.isMain && o.classList.add("main-content");
|
|
740
695
|
const l = () => {
|
|
741
696
|
this.isCollapsed = !this.isCollapsed, o.classList.toggle("collapsed"), e.classList.toggle("collapsed-view"), a.classList.toggle("rotated"), t.classList.toggle("collapsed", this.isCollapsed), e.setAttribute(
|
|
742
697
|
"aria-expanded",
|
|
743
698
|
(!this.isCollapsed).toString()
|
|
744
699
|
);
|
|
745
|
-
const c = o.querySelector(
|
|
746
|
-
".setting-group-description"
|
|
747
|
-
), u = n.querySelector(".info-marker");
|
|
748
|
-
if (this.description)
|
|
749
|
-
if (this.isCollapsed) {
|
|
750
|
-
if (c && c.remove(), !u) {
|
|
751
|
-
const m = document.createElement("span");
|
|
752
|
-
m.className = "info-marker", m.innerHTML = `
|
|
753
|
-
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
754
|
-
<path d="M8 5.33333V8M8 10.6667H8.00667M14 8C14 11.3137 11.3137 14 8 14C4.68629 14 2 11.3137 2 8C2 4.68629 4.68629 2 8 2C11.3137 2 14 4.68629 14 8Z"
|
|
755
|
-
stroke="currentColor" stroke-width="1.33333" stroke-linecap="round" stroke-linejoin="round"/>
|
|
756
|
-
</svg>
|
|
757
|
-
`, m.title = this.description, n.insertBefore(m, a);
|
|
758
|
-
}
|
|
759
|
-
} else {
|
|
760
|
-
if (!c) {
|
|
761
|
-
const m = document.createElement("div");
|
|
762
|
-
m.className = "setting-group-description", m.textContent = this.description, o.insertBefore(
|
|
763
|
-
m,
|
|
764
|
-
o.firstChild
|
|
765
|
-
);
|
|
766
|
-
}
|
|
767
|
-
u && u.remove();
|
|
768
|
-
}
|
|
769
700
|
};
|
|
770
|
-
if (e.onclick = l, e.onkeydown = (
|
|
771
|
-
(
|
|
701
|
+
if (e.onclick = l, e.onkeydown = (h) => {
|
|
702
|
+
(h.key === "Enter" || h.key === " ") && (h.preventDefault(), l());
|
|
772
703
|
}, Object.keys(this.settings).length > 0) {
|
|
773
|
-
for (const
|
|
774
|
-
if (Object.prototype.hasOwnProperty.call(this.settings,
|
|
775
|
-
const
|
|
776
|
-
|
|
777
|
-
const
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
const b = E.keyPrefix ?? ((d = this.addItemCfg) == null ? void 0 : d.keyPrefix);
|
|
784
|
-
b && c.startsWith(b) && this.addDeleteButtonToElement(m, c);
|
|
785
|
-
}
|
|
786
|
-
}
|
|
787
|
-
o.appendChild(m);
|
|
704
|
+
for (const h in this.settings)
|
|
705
|
+
if (Object.prototype.hasOwnProperty.call(this.settings, h)) {
|
|
706
|
+
const d = this.settings[h];
|
|
707
|
+
p(d) && typeof d.setNestingLevel == "function" && d.setNestingLevel(this.nestingLevel + 1);
|
|
708
|
+
const u = d.draw();
|
|
709
|
+
p(d) && d.deleteItemCfg && this.addDeleteButtonToElement(
|
|
710
|
+
u,
|
|
711
|
+
h,
|
|
712
|
+
d
|
|
713
|
+
), o.appendChild(u);
|
|
788
714
|
}
|
|
789
715
|
} else {
|
|
790
|
-
const
|
|
791
|
-
|
|
716
|
+
const h = document.createElement("div");
|
|
717
|
+
h.className = "setting-group-empty", h.textContent = "No settings in this group", o.appendChild(h);
|
|
792
718
|
}
|
|
793
719
|
if (this.addItemCfg) {
|
|
794
|
-
const
|
|
795
|
-
|
|
796
|
-
const
|
|
720
|
+
const h = document.createElement("button");
|
|
721
|
+
h.type = "button", h.className = "sg-add-button-bottom", h.style.marginTop = "8px";
|
|
722
|
+
const d = `
|
|
797
723
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none"
|
|
798
724
|
xmlns="http://www.w3.org/2000/svg">
|
|
799
725
|
<path d="M8 3.333v9.334M3.333 8h9.334" stroke="currentColor"
|
|
800
726
|
stroke-width="1.5" stroke-linecap="round"/>
|
|
801
727
|
</svg>`;
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
const
|
|
805
|
-
this.addSetting(
|
|
806
|
-
}), o.appendChild(
|
|
728
|
+
h.innerHTML = `${d}<span style="margin-left:4px;">${this.addItemCfg.buttonLabel ?? "Add"}</span>`, h.addEventListener("click", (u) => {
|
|
729
|
+
u.stopPropagation(), u.preventDefault();
|
|
730
|
+
const y = this.getNextIndexFromPrefix(this.addItemCfg.keyPrefix), O = this.addItemCfg.createItem(y), H = `${this.addItemCfg.keyPrefix}${y}`;
|
|
731
|
+
this.addSetting(H, O);
|
|
732
|
+
}), o.appendChild(h);
|
|
807
733
|
}
|
|
808
734
|
return e.appendChild(i), e.appendChild(n), t.appendChild(e), t.appendChild(o), this.elementRef = t, S.trackElement(t), setTimeout(() => {
|
|
809
735
|
this.updateNestingStyles();
|
|
810
|
-
}, 0), this.pendingBlurHandler && (this.
|
|
736
|
+
}, 0), this.pendingBlurHandler && (this.pendingBlurHandler = null), t;
|
|
811
737
|
}
|
|
812
738
|
collapse() {
|
|
813
739
|
if (!this.elementRef || this.isCollapsed) return;
|
|
@@ -827,12 +753,6 @@ const p = class p {
|
|
|
827
753
|
);
|
|
828
754
|
t && e && i && (this.isCollapsed = !1, t.classList.remove("collapsed"), e.classList.remove("rotated"), i.setAttribute("aria-expanded", "true"));
|
|
829
755
|
}
|
|
830
|
-
updateVisibility() {
|
|
831
|
-
this.elementRef && this.hideCondition && (this.elementRef.style.display = this.hideCondition() ? "none" : "");
|
|
832
|
-
}
|
|
833
|
-
toggle() {
|
|
834
|
-
this.isHidden ? this.show() : this.hide();
|
|
835
|
-
}
|
|
836
756
|
getJson() {
|
|
837
757
|
return JSON.stringify(this.getValuesForJson(), null, 2);
|
|
838
758
|
}
|
|
@@ -853,9 +773,12 @@ const p = class p {
|
|
|
853
773
|
}
|
|
854
774
|
}
|
|
855
775
|
};
|
|
856
|
-
|
|
857
|
-
let v =
|
|
858
|
-
|
|
776
|
+
L.hiddenElements = /* @__PURE__ */ new Set();
|
|
777
|
+
let v = L;
|
|
778
|
+
function vt(c) {
|
|
779
|
+
return new F(c);
|
|
780
|
+
}
|
|
781
|
+
class F extends v {
|
|
859
782
|
constructor(t) {
|
|
860
783
|
super(t);
|
|
861
784
|
const e = Object.keys(this.settings)[0];
|
|
@@ -893,10 +816,12 @@ class gt extends v {
|
|
|
893
816
|
if (a.className = "tab-content", this.contentContainers = {}, Object.keys(this.settings).forEach((o, l) => {
|
|
894
817
|
const r = document.createElement("button");
|
|
895
818
|
r.className = "tab-button", r.type = "button", r.setAttribute("data-tab-id", o), r.textContent = o, r.addEventListener("click", () => this.switchToTab(o)), n.appendChild(r);
|
|
896
|
-
const
|
|
897
|
-
|
|
898
|
-
const
|
|
899
|
-
|
|
819
|
+
const h = document.createElement("div");
|
|
820
|
+
h.className = "tab-panel", this.contentContainers[o] = h;
|
|
821
|
+
const d = this.settings[o];
|
|
822
|
+
d && (p(d) && typeof d.setNestingLevel == "function" && d.setNestingLevel(this.getNestingLevel() + 1), h.appendChild(
|
|
823
|
+
d.draw()
|
|
824
|
+
)), a.appendChild(h), l === 0 && !this.activeTabId && (this.activeTabId = o);
|
|
900
825
|
}), e.appendChild(i), e.appendChild(n), e.appendChild(a), !this.activeTabId) {
|
|
901
826
|
const o = Object.keys(this.settings)[0];
|
|
902
827
|
this.activeTabId = o || "";
|
|
@@ -904,13 +829,13 @@ class gt extends v {
|
|
|
904
829
|
return this.updateTabUI(), t;
|
|
905
830
|
}
|
|
906
831
|
}
|
|
907
|
-
function
|
|
908
|
-
return new v(
|
|
832
|
+
function z(c) {
|
|
833
|
+
return new v(c);
|
|
909
834
|
}
|
|
910
|
-
function
|
|
911
|
-
return
|
|
835
|
+
function Ct(c) {
|
|
836
|
+
return c;
|
|
912
837
|
}
|
|
913
|
-
class
|
|
838
|
+
class G extends g {
|
|
914
839
|
constructor(t = {}) {
|
|
915
840
|
super(t), this.inputType = "text", t.onChange && this.setOnChange(t.onChange);
|
|
916
841
|
}
|
|
@@ -930,29 +855,29 @@ class F extends g {
|
|
|
930
855
|
});
|
|
931
856
|
}
|
|
932
857
|
}
|
|
933
|
-
const
|
|
934
|
-
class
|
|
858
|
+
const P = "<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>";
|
|
859
|
+
class m extends G {
|
|
935
860
|
constructor(t) {
|
|
936
861
|
super({
|
|
937
862
|
...t,
|
|
938
|
-
icon: t.icon ||
|
|
863
|
+
icon: t.icon || P,
|
|
939
864
|
title: t.title || "Color",
|
|
940
|
-
default: t.default ?
|
|
865
|
+
default: t.default ? m.normalizeColorValue(t.default) : "#000000"
|
|
941
866
|
}), this.inputType = "color", this.element = null, this.colorInputEl = null, this.textInputEl = null, this.detectChange = t.detectChange;
|
|
942
867
|
}
|
|
943
868
|
static normalizeColorValue(t) {
|
|
944
|
-
return t.startsWith("#") ?
|
|
869
|
+
return t.startsWith("#") ? m.normalizeHexValue(t) : t.includes(",") ? m.rgbToHexStatic(t) : m.normalizeHexValue(t);
|
|
945
870
|
}
|
|
946
871
|
static normalizeHexValue(t) {
|
|
947
872
|
return t = t.replace("#", ""), t.length === 3 && (t = t.split("").map((e) => e + e).join("")), t.length !== 6 ? (console.warn(`Invalid hex value "${t}", using default "#000000"`), "#000000") : /^[0-9A-Fa-f]{6}$/.test(t) ? `#${t.toLowerCase()}` : (console.warn(`Invalid hex value "${t}", using default "#000000"`), "#000000");
|
|
948
873
|
}
|
|
949
874
|
static rgbToHexStatic(t) {
|
|
950
|
-
const e = t.split(",").map((
|
|
875
|
+
const e = t.split(",").map((h) => parseInt(h.trim()));
|
|
951
876
|
if (e.length !== 3 || e.some(isNaN))
|
|
952
877
|
return console.warn(`Invalid RGB value "${t}", using default "#000000"`), "#000000";
|
|
953
|
-
const [i, s, n] = e, a = Math.max(0, Math.min(255, i)), o = Math.max(0, Math.min(255, s)), l = Math.max(0, Math.min(255, n)), r = (
|
|
954
|
-
const
|
|
955
|
-
return
|
|
878
|
+
const [i, s, n] = e, a = Math.max(0, Math.min(255, i)), o = Math.max(0, Math.min(255, s)), l = Math.max(0, Math.min(255, n)), r = (h) => {
|
|
879
|
+
const d = h.toString(16);
|
|
880
|
+
return d.length === 1 ? "0" + d : d;
|
|
956
881
|
};
|
|
957
882
|
return `#${r(a)}${r(o)}${r(l)}`;
|
|
958
883
|
}
|
|
@@ -962,7 +887,7 @@ class f extends F {
|
|
|
962
887
|
return;
|
|
963
888
|
}
|
|
964
889
|
if (typeof t == "string") {
|
|
965
|
-
const e =
|
|
890
|
+
const e = m.normalizeColorValue(t);
|
|
966
891
|
this.value = e, this.colorInputEl && (this.colorInputEl.value = e), this.textInputEl && (this.textInputEl.value = e), this.onChange && this.onChange(e), this.props.detectChange && this.props.detectChange(e);
|
|
967
892
|
} else
|
|
968
893
|
this.value = "#000000", this.colorInputEl && (this.colorInputEl.value = "#000000"), this.textInputEl && (this.textInputEl.value = "#000000"), this.onChange && this.onChange("#000000"), this.props.detectChange && this.props.detectChange("#000000");
|
|
@@ -992,8 +917,8 @@ class f extends F {
|
|
|
992
917
|
const r = l.value.trim();
|
|
993
918
|
if (!r)
|
|
994
919
|
return e.classList.remove("error"), !0;
|
|
995
|
-
const
|
|
996
|
-
return
|
|
920
|
+
const d = /^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/.test(r);
|
|
921
|
+
return d ? e.classList.remove("error") : e.classList.add("error"), d;
|
|
997
922
|
}, s = document.createElement("input");
|
|
998
923
|
s.type = "color", s.className = "color-picker", s.value = this.value || "#000000", s.setAttribute("aria-label", "Choose color"), s.setAttribute("title", "Click to open color picker"), this.colorInputEl = s;
|
|
999
924
|
const n = document.createElement("div");
|
|
@@ -1002,20 +927,20 @@ class f extends F {
|
|
|
1002
927
|
n.style.backgroundColor = a;
|
|
1003
928
|
const o = document.createElement("input");
|
|
1004
929
|
return o.type = "text", o.className = "color-text-input", o.value = this.value || "", o.placeholder = "#000000", o.setAttribute("pattern", "#[0-9A-Fa-f]{6}"), o.setAttribute("title", "Enter a hex color value (e.g., #ff0000)"), o.setAttribute("aria-label", "Hex color value"), o.setAttribute("maxlength", "7"), this.textInputEl = o, this.textInputEl.addEventListener("input", (l) => {
|
|
1005
|
-
var
|
|
930
|
+
var h, d;
|
|
1006
931
|
let r = l.target.value.trim();
|
|
1007
932
|
if (this.textInputEl && i(this.textInputEl)) {
|
|
1008
|
-
const u =
|
|
1009
|
-
this.value = u, (
|
|
933
|
+
const u = m.normalizeColorValue(r);
|
|
934
|
+
this.value = u, (h = this.onChange) == null || h.call(this, u), (d = this.detectChange) == null || d.call(this, u), this.colorInputEl && (this.colorInputEl.value = u), n.style.backgroundColor = u;
|
|
1010
935
|
}
|
|
1011
936
|
}), this.colorInputEl.addEventListener("input", (l) => {
|
|
1012
|
-
var
|
|
1013
|
-
const r = l.target.value,
|
|
1014
|
-
this.value =
|
|
937
|
+
var d, u;
|
|
938
|
+
const r = l.target.value, h = m.normalizeColorValue(r);
|
|
939
|
+
this.value = h, (d = this.onChange) == null || d.call(this, h), (u = this.detectChange) == null || u.call(this, h), this.textInputEl && (this.textInputEl.value = h), n.style.backgroundColor = h, e.classList.remove("error");
|
|
1015
940
|
}), this.colorInputEl.addEventListener("change", (l) => {
|
|
1016
|
-
var
|
|
1017
|
-
const r = l.target.value,
|
|
1018
|
-
this.value =
|
|
941
|
+
var d, u;
|
|
942
|
+
const r = l.target.value, h = m.normalizeColorValue(r);
|
|
943
|
+
this.value = h, (d = this.onChange) == null || d.call(this, h), (u = this.detectChange) == null || u.call(this, h), this.textInputEl && (this.textInputEl.value = h), n.style.backgroundColor = h;
|
|
1019
944
|
}), e.appendChild(s), e.appendChild(n), e.appendChild(o), t.appendChild(e), this.element = t, t;
|
|
1020
945
|
}
|
|
1021
946
|
getElement() {
|
|
@@ -1023,7 +948,7 @@ class f extends F {
|
|
|
1023
948
|
}
|
|
1024
949
|
// Helper method to get normalized hex value
|
|
1025
950
|
getNormalizedValue() {
|
|
1026
|
-
return this.value ?
|
|
951
|
+
return this.value ? m.normalizeColorValue(this.value) : "#000000";
|
|
1027
952
|
}
|
|
1028
953
|
// Helper method to check if current value is valid hex
|
|
1029
954
|
isValidHex() {
|
|
@@ -1040,14 +965,14 @@ const j = `
|
|
|
1040
965
|
<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"/>
|
|
1041
966
|
<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"/>
|
|
1042
967
|
</svg>`;
|
|
1043
|
-
class
|
|
968
|
+
class C extends g {
|
|
1044
969
|
constructor(t = {}) {
|
|
1045
970
|
super({
|
|
1046
971
|
...t,
|
|
1047
972
|
icon: t.icon || j,
|
|
1048
973
|
title: t.title || "Color & Opacity",
|
|
1049
974
|
default: t.default || "#000000FF"
|
|
1050
|
-
}), 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 =
|
|
975
|
+
}), 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 = C.normalizeHexWithOpacity(this.value));
|
|
1051
976
|
}
|
|
1052
977
|
static normalizeHexWithOpacity(t) {
|
|
1053
978
|
return t = t.replace("#", ""), t.length === 3 && (t = t.split("").map((e) => e + e).join("")), t.length === 6 && (t = t + "FF"), t.length === 8 && /^[0-9A-Fa-f]{8}$/.test(t) ? `#${t.toUpperCase()}` : (console.warn(`Invalid hex value "${t}", using default "#000000FF"`), "#000000FF");
|
|
@@ -1065,7 +990,7 @@ class w extends g {
|
|
|
1065
990
|
return `#${i}${n}`;
|
|
1066
991
|
}
|
|
1067
992
|
setValue(t) {
|
|
1068
|
-
t === void 0 || t === "" ? this.value = "#000000FF" : this.value =
|
|
993
|
+
t === void 0 || t === "" ? this.value = "#000000FF" : this.value = C.normalizeHexWithOpacity(t), this.updateInputElements(), this.updateColorPreview(), this.onChange && this.onChange(this.value), this.detectChange && this.detectChange(this.value);
|
|
1069
994
|
}
|
|
1070
995
|
updateInputElements() {
|
|
1071
996
|
this.value && (this.colorInputEl && (this.colorInputEl.value = this.getRgbColor()), this.textInputEl && (this.textInputEl.value = this.value), this.opacityInputEl && (this.opacityInputEl.value = this.getOpacityPercent().toString()));
|
|
@@ -1076,7 +1001,7 @@ class w extends g {
|
|
|
1076
1001
|
this.colorPreviewEl.style.backgroundColor = `rgba(${s}, ${n}, ${a}, ${e})`;
|
|
1077
1002
|
}
|
|
1078
1003
|
handleColorChange(t) {
|
|
1079
|
-
const e = this.getOpacityPercent(), i =
|
|
1004
|
+
const e = this.getOpacityPercent(), i = C.combineColorOpacity(t, e);
|
|
1080
1005
|
this.setValue(i);
|
|
1081
1006
|
}
|
|
1082
1007
|
handleTextInput(t) {
|
|
@@ -1084,7 +1009,7 @@ class w extends g {
|
|
|
1084
1009
|
return e || i ? (this.setValue(t), !0) : !1;
|
|
1085
1010
|
}
|
|
1086
1011
|
handleOpacityChange(t) {
|
|
1087
|
-
const e = this.getRgbColor(), i = Math.max(0, Math.min(100, t)), s =
|
|
1012
|
+
const e = this.getRgbColor(), i = Math.max(0, Math.min(100, t)), s = C.combineColorOpacity(e, i);
|
|
1088
1013
|
this.setValue(s);
|
|
1089
1014
|
}
|
|
1090
1015
|
draw() {
|
|
@@ -1147,7 +1072,7 @@ class w extends g {
|
|
|
1147
1072
|
};
|
|
1148
1073
|
}
|
|
1149
1074
|
}
|
|
1150
|
-
class
|
|
1075
|
+
class wt extends g {
|
|
1151
1076
|
constructor(t = {}) {
|
|
1152
1077
|
super(t), this.inputType = "text", t.onChange && this.setOnChange(t.onChange);
|
|
1153
1078
|
}
|
|
@@ -1179,7 +1104,7 @@ class ft extends g {
|
|
|
1179
1104
|
return e.addEventListener("input", i), e.addEventListener("change", i), e.addEventListener("blur", s), t.appendChild(e), t;
|
|
1180
1105
|
}
|
|
1181
1106
|
}
|
|
1182
|
-
class
|
|
1107
|
+
class f extends g {
|
|
1183
1108
|
constructor(t) {
|
|
1184
1109
|
super(t), this.inputType = "number", this.inputElement = null, this.mobileValue = t.mobile, this.validateProps(), this.value = this.validateValue(this.value);
|
|
1185
1110
|
}
|
|
@@ -1238,12 +1163,12 @@ class C extends g {
|
|
|
1238
1163
|
);
|
|
1239
1164
|
}
|
|
1240
1165
|
}
|
|
1241
|
-
const
|
|
1166
|
+
const W = `
|
|
1242
1167
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1243
1168
|
<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"/>
|
|
1244
1169
|
<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"/>
|
|
1245
1170
|
</svg>`;
|
|
1246
|
-
class
|
|
1171
|
+
class D extends f {
|
|
1247
1172
|
constructor(t = {}) {
|
|
1248
1173
|
const e = {
|
|
1249
1174
|
title: "Opacity",
|
|
@@ -1252,7 +1177,7 @@ class G extends C {
|
|
|
1252
1177
|
maxValue: 100,
|
|
1253
1178
|
step: 1,
|
|
1254
1179
|
default: t.default ?? 100,
|
|
1255
|
-
icon:
|
|
1180
|
+
icon: W,
|
|
1256
1181
|
...t
|
|
1257
1182
|
};
|
|
1258
1183
|
super(e), this.inputType = "number", this.mobileValue = t.mobile;
|
|
@@ -1264,12 +1189,12 @@ class G extends C {
|
|
|
1264
1189
|
this.mobileValue = t, t !== void 0 && this.setValue(t);
|
|
1265
1190
|
}
|
|
1266
1191
|
}
|
|
1267
|
-
const
|
|
1192
|
+
const _ = `
|
|
1268
1193
|
<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">
|
|
1269
1194
|
<polyline points="6 9 12 15 18 9"></polyline>
|
|
1270
1195
|
</svg>
|
|
1271
1196
|
`;
|
|
1272
|
-
class
|
|
1197
|
+
class I extends g {
|
|
1273
1198
|
constructor(t = {}) {
|
|
1274
1199
|
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) {
|
|
1275
1200
|
const e = this._options.findIndex((i) => i.value === this.value);
|
|
@@ -1313,7 +1238,7 @@ class N extends g {
|
|
|
1313
1238
|
o.onclick = (l) => this.selectOption(l, a, e), i.appendChild(o);
|
|
1314
1239
|
}), document.body.appendChild(i);
|
|
1315
1240
|
const s = document.createElement("div");
|
|
1316
|
-
return s.classList.add("svg-container"), s.innerHTML =
|
|
1241
|
+
return s.classList.add("svg-container"), s.innerHTML = _, t.appendChild(s), this.optionsListEl = i, this.svgContainer = s, this.props.getOptionsAsync && (this.isLoading = !0, this.updateButtonText(), this.props.getOptionsAsync().then((n) => {
|
|
1317
1242
|
this._options.push(...n), this.isLoading = !1, this.updateOptionsList(), this.updateButtonText();
|
|
1318
1243
|
}).catch((n) => {
|
|
1319
1244
|
console.error("Failed to fetch async options:", n), this.isLoading = !1, this.updateButtonText("Failed to load options");
|
|
@@ -1343,8 +1268,8 @@ class N extends g {
|
|
|
1343
1268
|
selectOption(t, e, i) {
|
|
1344
1269
|
var n, a, o;
|
|
1345
1270
|
const s = this._options[e];
|
|
1346
|
-
s && (this.value = s.value, (n = this.onChange) == null || n.call(this, this.value), this.selectedOptionIndex = e, this.isOpen = !1, i.textContent = s.name, (a = this.optionsListEl) == null || a.classList.remove("open"), (o = this.svgContainer) == null || o.classList.remove("open"), this.cleanupDropdownPosition(), this.optionsListEl && this.optionsListEl.querySelectorAll(".select-option").forEach((r,
|
|
1347
|
-
|
|
1271
|
+
s && (this.value = s.value, (n = this.onChange) == null || n.call(this, this.value), this.selectedOptionIndex = e, this.isOpen = !1, i.textContent = s.name, (a = this.optionsListEl) == null || a.classList.remove("open"), (o = this.svgContainer) == null || o.classList.remove("open"), this.cleanupDropdownPosition(), this.optionsListEl && this.optionsListEl.querySelectorAll(".select-option").forEach((r, h) => {
|
|
1272
|
+
h === e ? r.classList.add("selected") : r.classList.remove("selected");
|
|
1348
1273
|
}));
|
|
1349
1274
|
}
|
|
1350
1275
|
/**
|
|
@@ -1382,7 +1307,7 @@ class N extends g {
|
|
|
1382
1307
|
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();
|
|
1383
1308
|
}
|
|
1384
1309
|
}
|
|
1385
|
-
class
|
|
1310
|
+
class J extends g {
|
|
1386
1311
|
constructor(t = {}) {
|
|
1387
1312
|
super(t), this.inputType = "button", this.value || (this.value = "center");
|
|
1388
1313
|
}
|
|
@@ -1435,7 +1360,7 @@ class W extends g {
|
|
|
1435
1360
|
}), t.appendChild(i), t;
|
|
1436
1361
|
}
|
|
1437
1362
|
}
|
|
1438
|
-
class
|
|
1363
|
+
class Et extends g {
|
|
1439
1364
|
constructor(t) {
|
|
1440
1365
|
super(t), this.inputType = "button", this.bgWithAlpha = "rgba(145, 158, 171, 0.08)";
|
|
1441
1366
|
}
|
|
@@ -1449,8 +1374,8 @@ class vt extends g {
|
|
|
1449
1374
|
/^rgba\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)$/i
|
|
1450
1375
|
);
|
|
1451
1376
|
if (n) {
|
|
1452
|
-
let o = +n[1], l = +n[2], r = +n[3],
|
|
1453
|
-
|
|
1377
|
+
let o = +n[1], l = +n[2], r = +n[3], h = +n[4];
|
|
1378
|
+
h >= 1 ? (o = Math.round(o * 0.9), l = Math.round(l * 0.9), r = Math.round(r * 0.9)) : h = Math.min(1, h + 0.12), s = `rgba(${o},${l},${r},${h})`;
|
|
1454
1379
|
}
|
|
1455
1380
|
t.addEventListener("mouseenter", () => {
|
|
1456
1381
|
console.log("hoverBg", s), t.style.setProperty("background-color", s, "important");
|
|
@@ -1464,27 +1389,27 @@ class vt extends g {
|
|
|
1464
1389
|
return a.className = "button-setting-wrapper " + (this.props.wrapperClassName || ""), a.appendChild(t), a;
|
|
1465
1390
|
}
|
|
1466
1391
|
}
|
|
1467
|
-
class
|
|
1392
|
+
class bt extends g {
|
|
1468
1393
|
constructor(t = {}) {
|
|
1469
1394
|
super(t), this.inputType = { width: "number", height: "number" }, this.aspectRatio = 1, this.isUpdating = !1;
|
|
1470
1395
|
const e = t.width || 0, i = t.height || 0;
|
|
1471
1396
|
this.value || (this.value = {
|
|
1472
1397
|
width: e,
|
|
1473
1398
|
height: i
|
|
1474
|
-
}), 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
|
|
1399
|
+
}), 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 f({
|
|
1475
1400
|
title: "Width",
|
|
1476
1401
|
default: this.value.width,
|
|
1477
1402
|
suffix: "px",
|
|
1478
1403
|
minValue: this.minWidth,
|
|
1479
1404
|
maxValue: this.maxWidth,
|
|
1480
|
-
icon:
|
|
1481
|
-
}), this.heightSetting = new
|
|
1405
|
+
icon: U
|
|
1406
|
+
}), this.heightSetting = new f({
|
|
1482
1407
|
title: "Height",
|
|
1483
1408
|
default: this.value.height,
|
|
1484
1409
|
suffix: "px",
|
|
1485
1410
|
minValue: this.minHeight,
|
|
1486
1411
|
maxValue: this.maxHeight,
|
|
1487
|
-
icon:
|
|
1412
|
+
icon: q
|
|
1488
1413
|
}), this.widthSetting.setOnChange(this.handleWidthChange.bind(this)), this.heightSetting.setOnChange(this.handleHeightChange.bind(this));
|
|
1489
1414
|
}
|
|
1490
1415
|
handleWidthChange(t) {
|
|
@@ -1578,24 +1503,24 @@ class Ct extends g {
|
|
|
1578
1503
|
}
|
|
1579
1504
|
}
|
|
1580
1505
|
}
|
|
1581
|
-
const
|
|
1506
|
+
const U = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1582
1507
|
<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"/>
|
|
1583
|
-
</svg>`,
|
|
1508
|
+
</svg>`, q = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1584
1509
|
<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"/>
|
|
1585
|
-
</svg>`,
|
|
1510
|
+
</svg>`, M = `
|
|
1586
1511
|
<svg xmlns="http://www.w3.org/2000/svg" width="15" height="16" viewBox="0 0 15 16" fill="none">
|
|
1587
1512
|
<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"/>
|
|
1588
1513
|
</svg>
|
|
1589
|
-
`,
|
|
1514
|
+
`, Z = `
|
|
1590
1515
|
<svg width="91" height="71" viewBox="0 0 91 71" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1591
1516
|
<rect width="91" height="71" rx="4" fill="#F2F4F7"/>
|
|
1592
1517
|
<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"/>
|
|
1593
1518
|
</svg>
|
|
1594
|
-
`,
|
|
1519
|
+
`, K = `
|
|
1595
1520
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 12 12" fill="none">
|
|
1596
1521
|
<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"/>
|
|
1597
1522
|
</svg>
|
|
1598
|
-
`,
|
|
1523
|
+
`, X = `
|
|
1599
1524
|
<svg xmlns="http://www.w3.org/2000/svg" width="29" height="29" viewBox="0 0 29 29" fill="none">
|
|
1600
1525
|
<!-- Top dot -->
|
|
1601
1526
|
<circle cx="14.5" cy="3" r="1.5" fill="#02CC59" opacity="1"/>
|
|
@@ -1615,7 +1540,7 @@ const J = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBo
|
|
|
1615
1540
|
<circle cx="6.7" cy="6.7" r="1.5" fill="#02CC59" opacity="0.3"/>
|
|
1616
1541
|
</svg>
|
|
1617
1542
|
`;
|
|
1618
|
-
class
|
|
1543
|
+
class Q extends g {
|
|
1619
1544
|
constructor(t = {}) {
|
|
1620
1545
|
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();
|
|
1621
1546
|
}
|
|
@@ -1665,7 +1590,7 @@ class K extends g {
|
|
|
1665
1590
|
);
|
|
1666
1591
|
if (t && t !== "") {
|
|
1667
1592
|
this.showLoading(), s && s instanceof HTMLElement && (s.style.display = "none"), e && e.classList.remove("no-image"), i && (i.innerHTML = `
|
|
1668
|
-
<span class="upload-icon">${
|
|
1593
|
+
<span class="upload-icon">${M}</span>
|
|
1669
1594
|
<span class="upload-label">Replace</span>
|
|
1670
1595
|
`);
|
|
1671
1596
|
const n = () => {
|
|
@@ -1676,7 +1601,7 @@ class K extends g {
|
|
|
1676
1601
|
this.previewEl.addEventListener("load", n), this.previewEl.addEventListener("error", a), this.previewEl.src = t;
|
|
1677
1602
|
} else
|
|
1678
1603
|
this.hideLoading(), this.previewWrapper.classList.remove("has-image"), this.previewEl.src = "", this.previewEl.style.display = "none", this.previewWrapper.style.display = "none", s && s instanceof HTMLElement && (s.style.display = "block"), e && e.classList.add("no-image"), i && (i.innerHTML = `
|
|
1679
|
-
<span class="upload-icon">${
|
|
1604
|
+
<span class="upload-icon">${M}</span>
|
|
1680
1605
|
<span class="upload-label">Upload</span>
|
|
1681
1606
|
`);
|
|
1682
1607
|
}
|
|
@@ -1709,9 +1634,9 @@ class K extends g {
|
|
|
1709
1634
|
const s = this.value && this.value !== "";
|
|
1710
1635
|
s || i.classList.add("no-image");
|
|
1711
1636
|
const n = document.createElement("div");
|
|
1712
|
-
if (n.className = "preview-placeholder", n.innerHTML =
|
|
1637
|
+
if (n.className = "preview-placeholder", n.innerHTML = Z, this.previewWrapper = document.createElement("div"), this.previewWrapper.className = "preview-wrapper", this.loadingSpinner = document.createElement("div"), this.loadingSpinner.className = "loading-spinner", this.loadingSpinner.innerHTML = X, this.loadingSpinner.style.display = "none", this.previewWrapper.appendChild(this.loadingSpinner), this.previewEl = document.createElement("img"), this.previewEl.className = "upload-preview", this.props.delete) {
|
|
1713
1638
|
const o = document.createElement("button");
|
|
1714
|
-
o.className = "delete-button", o.type = "button", o.title = "Delete image", o.innerHTML =
|
|
1639
|
+
o.className = "delete-button", o.type = "button", o.title = "Delete image", o.innerHTML = K, this.previewWrapper.appendChild(o), o.onclick = (l) => {
|
|
1715
1640
|
var r;
|
|
1716
1641
|
l.stopPropagation(), this.value = "", this.updatePreviewState(null), (r = this.onChange) == null || r.call(this, ""), this.hideError();
|
|
1717
1642
|
};
|
|
@@ -1719,7 +1644,7 @@ class K extends g {
|
|
|
1719
1644
|
this.previewWrapper.appendChild(this.previewEl);
|
|
1720
1645
|
const a = document.createElement("button");
|
|
1721
1646
|
return a.className = "upload-button", a.innerHTML = `
|
|
1722
|
-
<span class="upload-icon">${
|
|
1647
|
+
<span class="upload-icon">${M}</span>
|
|
1723
1648
|
<span class="upload-label">Upload</span>
|
|
1724
1649
|
`, i.appendChild(n), i.appendChild(this.previewWrapper), i.appendChild(a), t.appendChild(i), s ? this.updatePreviewState(this.value) : this.updatePreviewState(null), a.onclick = () => {
|
|
1725
1650
|
window.postMessage(
|
|
@@ -1732,14 +1657,14 @@ class K extends g {
|
|
|
1732
1657
|
}, t;
|
|
1733
1658
|
}
|
|
1734
1659
|
}
|
|
1735
|
-
class
|
|
1660
|
+
class xt extends f {
|
|
1736
1661
|
constructor(t = {}) {
|
|
1737
1662
|
super({
|
|
1738
1663
|
...t,
|
|
1739
1664
|
title: t.title || "Height",
|
|
1740
1665
|
suffix: t.suffix || "px",
|
|
1741
1666
|
minValue: t.minValue ?? 0,
|
|
1742
|
-
icon: t.icon ||
|
|
1667
|
+
icon: t.icon || Y,
|
|
1743
1668
|
default: t.default ?? 100
|
|
1744
1669
|
}), this.inputType = "number", this.mobileValue = t.mobile;
|
|
1745
1670
|
}
|
|
@@ -1750,17 +1675,17 @@ class wt extends C {
|
|
|
1750
1675
|
this.mobileValue = t, t !== void 0 && this.setValue(t);
|
|
1751
1676
|
}
|
|
1752
1677
|
}
|
|
1753
|
-
const
|
|
1678
|
+
const Y = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1754
1679
|
<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"/>
|
|
1755
1680
|
</svg>`;
|
|
1756
|
-
class
|
|
1681
|
+
class Lt extends f {
|
|
1757
1682
|
constructor(t = {}) {
|
|
1758
1683
|
super({
|
|
1759
1684
|
...t,
|
|
1760
1685
|
title: t.title || "Width",
|
|
1761
1686
|
suffix: t.suffix || "px",
|
|
1762
1687
|
minValue: t.minValue ?? 0,
|
|
1763
|
-
icon: t.icon ||
|
|
1688
|
+
icon: t.icon || tt,
|
|
1764
1689
|
default: t.default ?? 100
|
|
1765
1690
|
}), this.inputType = "number", this.mobileValue = t.mobile;
|
|
1766
1691
|
}
|
|
@@ -1771,14 +1696,14 @@ class Et extends C {
|
|
|
1771
1696
|
this.mobileValue = t, t !== void 0 && this.setValue(t);
|
|
1772
1697
|
}
|
|
1773
1698
|
}
|
|
1774
|
-
const
|
|
1699
|
+
const tt = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1775
1700
|
<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"/>
|
|
1776
|
-
</svg>`,
|
|
1701
|
+
</svg>`, et = `
|
|
1777
1702
|
<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">
|
|
1778
1703
|
<polyline points="6 9 12 15 18 9"></polyline>
|
|
1779
1704
|
</svg>
|
|
1780
1705
|
`;
|
|
1781
|
-
class
|
|
1706
|
+
class yt extends g {
|
|
1782
1707
|
constructor(t = {}) {
|
|
1783
1708
|
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) {
|
|
1784
1709
|
const e = this._options.findIndex(
|
|
@@ -1833,7 +1758,7 @@ class bt extends g {
|
|
|
1833
1758
|
o.onclick = (l) => this.selectApiOption(l, a, e), i.appendChild(o);
|
|
1834
1759
|
}), t.appendChild(i);
|
|
1835
1760
|
const s = document.createElement("div");
|
|
1836
|
-
return s.classList.add("svg-container"), s.innerHTML =
|
|
1761
|
+
return s.classList.add("svg-container"), s.innerHTML = et, t.appendChild(s), s.onclick = () => {
|
|
1837
1762
|
var n, a;
|
|
1838
1763
|
this.isLoading || (this.isOpen = !this.isOpen, (n = this.optionsListEl) == null || n.classList.toggle("open", this.isOpen), (a = this.svgContainer) == null || a.classList.toggle("open", this.isOpen));
|
|
1839
1764
|
}, this.optionsListEl = i, this.svgContainer = s, this.props.getOptionsAsync && !this.hasInitializedOptions ? (this.isLoading = !0, this.updateButtonText(), this.props.getOptionsAsync().then((n) => {
|
|
@@ -1880,7 +1805,7 @@ class bt extends g {
|
|
|
1880
1805
|
return JSON.stringify(t ? {} : { value: this.value }, null, 2);
|
|
1881
1806
|
}
|
|
1882
1807
|
selectApiOption(t, e, i) {
|
|
1883
|
-
var l, r,
|
|
1808
|
+
var l, r, h, d;
|
|
1884
1809
|
const s = t.target, n = s.querySelector(".select-api-radio") || ((l = s.closest(".select-api-option")) == null ? void 0 : l.querySelector(".select-api-radio"));
|
|
1885
1810
|
n && (n.checked = !0), this.selectedOptionIndex = e;
|
|
1886
1811
|
const a = this._options[e].value;
|
|
@@ -1892,7 +1817,7 @@ class bt extends g {
|
|
|
1892
1817
|
const u = i.firstChild;
|
|
1893
1818
|
u && u.tagName === "SPAN" && (u.textContent = this._options[e].name);
|
|
1894
1819
|
}
|
|
1895
|
-
this.isOpen = !1, (r = this.optionsListEl) == null || r.classList.remove("open"), (
|
|
1820
|
+
this.isOpen = !1, (r = this.optionsListEl) == null || r.classList.remove("open"), (h = this.svgContainer) == null || h.classList.remove("open"), (d = this.onChange) == null || d.call(this, a), this.detectChangeCallback && this.detectChangeCallback(a);
|
|
1896
1821
|
}
|
|
1897
1822
|
updateOptionsList() {
|
|
1898
1823
|
!this.optionsListEl || !this.buttonEl || (this.optionsListEl.innerHTML = "", this._options.forEach((t, e) => {
|
|
@@ -1925,7 +1850,7 @@ class bt extends g {
|
|
|
1925
1850
|
), this.updateButtonText();
|
|
1926
1851
|
}
|
|
1927
1852
|
}
|
|
1928
|
-
class
|
|
1853
|
+
class kt extends g {
|
|
1929
1854
|
constructor(t) {
|
|
1930
1855
|
var e, i;
|
|
1931
1856
|
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;
|
|
@@ -1948,19 +1873,19 @@ class xt extends g {
|
|
|
1948
1873
|
i.className = "toggle-switch";
|
|
1949
1874
|
const s = document.createElement("input");
|
|
1950
1875
|
s.type = "checkbox", s.checked = ((o = (a = this.props.options) == null ? void 0 : a.find((l) => l.value === this.value)) == null ? void 0 : o.status) ?? !1, s.addEventListener("change", () => {
|
|
1951
|
-
var r,
|
|
1952
|
-
const l = ((
|
|
1876
|
+
var r, h;
|
|
1877
|
+
const l = ((h = (r = this.props.options) == null ? void 0 : r.find((d) => d.status === s.checked)) == null ? void 0 : h.value) ?? "";
|
|
1953
1878
|
this.value = l, this.onChange && this.onChange(this.value), this.detectChangeCallback && this.detectChangeCallback(this.value);
|
|
1954
1879
|
});
|
|
1955
1880
|
const n = document.createElement("span");
|
|
1956
1881
|
if (n.className = "toggle-slider", this.props.activeColor || this.props.inactiveColor) {
|
|
1957
|
-
const l = document.createElement("style"), r = this.props.activeColor || "#4CAF50",
|
|
1882
|
+
const l = document.createElement("style"), r = this.props.activeColor || "#4CAF50", h = this.props.inactiveColor || "#ccc";
|
|
1958
1883
|
l.textContent = `
|
|
1959
1884
|
.toggle-switch input:checked + .toggle-slider {
|
|
1960
1885
|
background-color: ${r};
|
|
1961
1886
|
}
|
|
1962
1887
|
.toggle-switch .toggle-slider {
|
|
1963
|
-
background-color: ${
|
|
1888
|
+
background-color: ${h};
|
|
1964
1889
|
}
|
|
1965
1890
|
`, document.head.appendChild(l);
|
|
1966
1891
|
}
|
|
@@ -1970,13 +1895,13 @@ class xt extends g {
|
|
|
1970
1895
|
this.detectChangeCallback = t;
|
|
1971
1896
|
}
|
|
1972
1897
|
}
|
|
1973
|
-
const
|
|
1898
|
+
const it = `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1974
1899
|
<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"/>
|
|
1975
1900
|
</svg>`;
|
|
1976
|
-
class
|
|
1901
|
+
class Mt extends g {
|
|
1977
1902
|
// Store mobile value
|
|
1978
1903
|
constructor(t = {}) {
|
|
1979
|
-
t.rowGap = t.rowGap ?? !0, t.columnGap = t.columnGap ?? !0, t.title = t.title ?? "Gap", t.icon = t.icon ??
|
|
1904
|
+
t.rowGap = t.rowGap ?? !0, t.columnGap = t.columnGap ?? !0, t.title = t.title ?? "Gap", t.icon = t.icon ?? it, 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);
|
|
1980
1905
|
}
|
|
1981
1906
|
draw() {
|
|
1982
1907
|
const t = document.createElement("div");
|
|
@@ -2027,53 +1952,53 @@ class yt extends g {
|
|
|
2027
1952
|
this.mobileValue = t, t !== void 0 && this.setValue(t);
|
|
2028
1953
|
}
|
|
2029
1954
|
}
|
|
2030
|
-
const
|
|
1955
|
+
const st = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2031
1956
|
<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"/>
|
|
2032
1957
|
</svg>`;
|
|
2033
|
-
class
|
|
1958
|
+
class Vt extends f {
|
|
2034
1959
|
constructor(t = {}) {
|
|
2035
1960
|
super({
|
|
2036
1961
|
...t,
|
|
2037
1962
|
minValue: t.minValue ?? 0,
|
|
2038
1963
|
maxValue: t.maxValue ?? 1e3,
|
|
2039
|
-
icon: t.icon ||
|
|
1964
|
+
icon: t.icon || st,
|
|
2040
1965
|
title: t.title || "Margin Bottom",
|
|
2041
1966
|
default: t.default ?? 20,
|
|
2042
1967
|
wrapperClassName: "margin-bottom-wrapper " + (t.wrapperClassName || "")
|
|
2043
1968
|
}), this.inputType = "number";
|
|
2044
1969
|
}
|
|
2045
1970
|
}
|
|
2046
|
-
const
|
|
1971
|
+
const nt = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2047
1972
|
<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"
|
|
2048
1973
|
stroke="#667085" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2049
1974
|
</svg>`;
|
|
2050
|
-
class
|
|
1975
|
+
class It extends f {
|
|
2051
1976
|
constructor(t = {}) {
|
|
2052
1977
|
super({
|
|
2053
1978
|
...t,
|
|
2054
1979
|
minValue: t.minValue ?? 0,
|
|
2055
1980
|
maxValue: t.maxValue ?? 1e3,
|
|
2056
|
-
icon: t.icon ||
|
|
1981
|
+
icon: t.icon || nt,
|
|
2057
1982
|
title: t.title || "Margin Top",
|
|
2058
1983
|
default: t.default ?? 20,
|
|
2059
1984
|
wrapperClassName: "margin-top-wrapper " + (t.wrapperClassName || "")
|
|
2060
1985
|
}), this.inputType = "number";
|
|
2061
1986
|
}
|
|
2062
1987
|
}
|
|
2063
|
-
const
|
|
1988
|
+
const at = `
|
|
2064
1989
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
2065
1990
|
<polyline points="3,6 5,6 21,6"></polyline>
|
|
2066
1991
|
<path d="m19,6v14a2,2 0 0,1-2,2H7a2,2 0 0,1-2-2V6m3,0V4a2,2 0 0,1,2-2h4a2,2 0 0,1,2,2v2"></path>
|
|
2067
1992
|
<line x1="10" y1="11" x2="10" y2="17"></line>
|
|
2068
1993
|
<line x1="14" y1="11" x2="14" y2="17"></line>
|
|
2069
1994
|
</svg>
|
|
2070
|
-
`,
|
|
1995
|
+
`, ot = `
|
|
2071
1996
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
2072
1997
|
<line x1="12" y1="5" x2="12" y2="19"></line>
|
|
2073
1998
|
<line x1="5" y1="12" x2="19" y2="12"></line>
|
|
2074
1999
|
</svg>
|
|
2075
2000
|
`;
|
|
2076
|
-
class
|
|
2001
|
+
class St extends g {
|
|
2077
2002
|
constructor(t = {}) {
|
|
2078
2003
|
super(t), this.inputType = {}, this.container = null, this.languagesContainer = null, this.addLanguageSelect = null, this.addButton = null, this.defaultLanguages = [
|
|
2079
2004
|
{ code: "en", name: "English" },
|
|
@@ -2121,7 +2046,7 @@ class Mt extends g {
|
|
|
2121
2046
|
this.updateLanguageValue(t, r.value);
|
|
2122
2047
|
});
|
|
2123
2048
|
const o = document.createElement("button");
|
|
2124
|
-
return o.type = "button", o.classList.add("delete-language-btn"), o.innerHTML =
|
|
2049
|
+
return o.type = "button", o.classList.add("delete-language-btn"), o.innerHTML = at, o.title = `Delete ${t.toUpperCase()}`, o.addEventListener("click", () => {
|
|
2125
2050
|
this.removeLanguage(t);
|
|
2126
2051
|
}), n.appendChild(a), n.appendChild(o), i.appendChild(s), i.appendChild(n), i;
|
|
2127
2052
|
}
|
|
@@ -2154,7 +2079,7 @@ class Mt extends g {
|
|
|
2154
2079
|
const s = document.createElement("select");
|
|
2155
2080
|
s.classList.add("add-language-select"), this.addLanguageSelect = s;
|
|
2156
2081
|
const n = document.createElement("button");
|
|
2157
|
-
return n.type = "button", n.classList.add("add-language-btn"), n.innerHTML = `${
|
|
2082
|
+
return n.type = "button", n.classList.add("add-language-btn"), n.innerHTML = `${ot} Add`, this.addButton = n, n.addEventListener("click", () => {
|
|
2158
2083
|
const a = s.value;
|
|
2159
2084
|
a && this.addLanguage(a);
|
|
2160
2085
|
}), i.appendChild(s), i.appendChild(n), t.appendChild(e), t.appendChild(i), t;
|
|
@@ -2182,7 +2107,7 @@ class Mt extends g {
|
|
|
2182
2107
|
}), this.updateAddLanguageSelect());
|
|
2183
2108
|
}
|
|
2184
2109
|
}
|
|
2185
|
-
class
|
|
2110
|
+
class Nt extends g {
|
|
2186
2111
|
constructor(t = {}) {
|
|
2187
2112
|
super(t), this.inputType = "select";
|
|
2188
2113
|
const e = [
|
|
@@ -2193,7 +2118,7 @@ class Vt extends g {
|
|
|
2193
2118
|
{ name: "Bounce", value: "bounce 1.5s ease-in-out infinite" },
|
|
2194
2119
|
{ name: "Pulse", value: "pulse 1.5s ease-in-out infinite" }
|
|
2195
2120
|
];
|
|
2196
|
-
this.selectSetting = new
|
|
2121
|
+
this.selectSetting = new I({
|
|
2197
2122
|
title: this.title || "Animation",
|
|
2198
2123
|
options: e,
|
|
2199
2124
|
default: this.props.default || "none"
|
|
@@ -2209,34 +2134,33 @@ class Vt extends g {
|
|
|
2209
2134
|
this.selectSetting.destroy(), super.destroy();
|
|
2210
2135
|
}
|
|
2211
2136
|
}
|
|
2212
|
-
const
|
|
2137
|
+
const lt = `
|
|
2213
2138
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2214
2139
|
<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"/>
|
|
2215
2140
|
</svg>
|
|
2216
|
-
`,
|
|
2141
|
+
`, rt = `
|
|
2217
2142
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2218
2143
|
<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"/>
|
|
2219
2144
|
</svg>
|
|
2220
2145
|
`;
|
|
2221
|
-
class
|
|
2146
|
+
class Ot extends v {
|
|
2222
2147
|
constructor(t) {
|
|
2223
2148
|
super({
|
|
2224
2149
|
title: "Border",
|
|
2225
2150
|
collapsed: t == null ? void 0 : t.collapsed,
|
|
2226
|
-
hideCondition: t == null ? void 0 : t.hideCondition,
|
|
2227
2151
|
settings: {
|
|
2228
|
-
size: new
|
|
2152
|
+
size: new f({
|
|
2229
2153
|
title: "Size",
|
|
2230
|
-
icon:
|
|
2154
|
+
icon: rt,
|
|
2231
2155
|
default: (t == null ? void 0 : t.size) ?? 0,
|
|
2232
2156
|
suffix: "px"
|
|
2233
2157
|
}),
|
|
2234
|
-
color: new
|
|
2158
|
+
color: new C({
|
|
2235
2159
|
default: (t == null ? void 0 : t.color) ?? "0, 0, 30"
|
|
2236
2160
|
}),
|
|
2237
|
-
radius: new
|
|
2161
|
+
radius: new f({
|
|
2238
2162
|
title: "Radius",
|
|
2239
|
-
icon:
|
|
2163
|
+
icon: lt,
|
|
2240
2164
|
default: (t == null ? void 0 : t.radius) ?? 12,
|
|
2241
2165
|
suffix: "px"
|
|
2242
2166
|
})
|
|
@@ -2255,34 +2179,33 @@ class It extends v {
|
|
|
2255
2179
|
`;
|
|
2256
2180
|
}
|
|
2257
2181
|
}
|
|
2258
|
-
const
|
|
2182
|
+
const ct = `
|
|
2259
2183
|
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="13" viewBox="0 0 14 13" fill="none">
|
|
2260
2184
|
<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"/>
|
|
2261
2185
|
</svg>
|
|
2262
|
-
`,
|
|
2186
|
+
`, ht = `
|
|
2263
2187
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2264
2188
|
<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"/>
|
|
2265
2189
|
</svg>
|
|
2266
|
-
`,
|
|
2190
|
+
`, dt = `
|
|
2267
2191
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2268
2192
|
<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"/>
|
|
2269
2193
|
</svg>
|
|
2270
2194
|
`;
|
|
2271
|
-
class
|
|
2195
|
+
class Ht extends v {
|
|
2272
2196
|
constructor(t = {}) {
|
|
2273
2197
|
const { showAlign: e = t.showAlign ?? !0, ...i } = t;
|
|
2274
2198
|
super({
|
|
2275
2199
|
title: i.title || "Typography",
|
|
2276
2200
|
collapsed: i.collapsed,
|
|
2277
|
-
hideCondition: i.hideCondition,
|
|
2278
2201
|
settings: (() => {
|
|
2279
2202
|
const s = {
|
|
2280
|
-
color: new
|
|
2203
|
+
color: new C({
|
|
2281
2204
|
default: i.colorDefault ?? "0, 0, 30"
|
|
2282
2205
|
}),
|
|
2283
|
-
fontFamily: new
|
|
2206
|
+
fontFamily: new I({
|
|
2284
2207
|
title: "Font",
|
|
2285
|
-
icon:
|
|
2208
|
+
icon: ct,
|
|
2286
2209
|
default: i.fontFamilyDefault ?? "Satoshi",
|
|
2287
2210
|
options: i.fontFamilyOptions ?? [
|
|
2288
2211
|
{ name: "Alt", value: "Croco Sans Black Caps Alt" },
|
|
@@ -2293,9 +2216,9 @@ class Nt extends v {
|
|
|
2293
2216
|
getOptions: i.fontFamilyGetOptions,
|
|
2294
2217
|
getOptionsAsync: i.fontFamilyGetOptionsAsync
|
|
2295
2218
|
}),
|
|
2296
|
-
fontWeight: new
|
|
2219
|
+
fontWeight: new I({
|
|
2297
2220
|
title: "Weight",
|
|
2298
|
-
icon:
|
|
2221
|
+
icon: ht,
|
|
2299
2222
|
default: i.fontWeightDefault ?? "400",
|
|
2300
2223
|
options: i.fontWeightOptions ?? [
|
|
2301
2224
|
{ name: "Regular", value: "400" },
|
|
@@ -2305,9 +2228,9 @@ class Nt extends v {
|
|
|
2305
2228
|
getOptions: i.fontWeightGetOptions,
|
|
2306
2229
|
getOptionsAsync: i.fontWeightGetOptionsAsync
|
|
2307
2230
|
}),
|
|
2308
|
-
fontSize: new
|
|
2231
|
+
fontSize: new f({
|
|
2309
2232
|
title: "Size",
|
|
2310
|
-
icon:
|
|
2233
|
+
icon: dt,
|
|
2311
2234
|
default: i.fontSizeDefault ?? 12,
|
|
2312
2235
|
suffix: "px",
|
|
2313
2236
|
mobile: i.fontSizeMobileDefault
|
|
@@ -2315,7 +2238,7 @@ class Nt extends v {
|
|
|
2315
2238
|
};
|
|
2316
2239
|
return e ? {
|
|
2317
2240
|
...s,
|
|
2318
|
-
align: new
|
|
2241
|
+
align: new J({
|
|
2319
2242
|
title: "Align",
|
|
2320
2243
|
default: i.alignDefault ?? "center"
|
|
2321
2244
|
})
|
|
@@ -2335,7 +2258,7 @@ class Nt extends v {
|
|
|
2335
2258
|
`;
|
|
2336
2259
|
}
|
|
2337
2260
|
}
|
|
2338
|
-
class
|
|
2261
|
+
class E extends g {
|
|
2339
2262
|
constructor(t) {
|
|
2340
2263
|
super({
|
|
2341
2264
|
...t,
|
|
@@ -2346,8 +2269,8 @@ class y extends g {
|
|
|
2346
2269
|
const t = this.value === "auto" ? "text" : "number", e = (o) => {
|
|
2347
2270
|
this.value !== "auto" && (this.props.minValue !== void 0 && (o.min = String(this.props.minValue)), this.props.maxValue !== void 0 && (o.max = String(this.props.maxValue)), this.props.className && o.classList.add(this.props.className), o.addEventListener("input", () => {
|
|
2348
2271
|
const l = this.props.minValue ?? Number.MIN_SAFE_INTEGER, r = this.props.maxValue ?? Number.MAX_SAFE_INTEGER;
|
|
2349
|
-
let
|
|
2350
|
-
|
|
2272
|
+
let h = Number(o.value);
|
|
2273
|
+
h < l && (h = l), h > r && (h = r), o.value = String(h);
|
|
2351
2274
|
}));
|
|
2352
2275
|
}, i = this.createInput({
|
|
2353
2276
|
value: this.value,
|
|
@@ -2381,34 +2304,33 @@ class y extends g {
|
|
|
2381
2304
|
}), i;
|
|
2382
2305
|
}
|
|
2383
2306
|
}
|
|
2384
|
-
class
|
|
2307
|
+
class Tt extends v {
|
|
2385
2308
|
constructor(t) {
|
|
2386
2309
|
super({
|
|
2387
2310
|
title: "Margins",
|
|
2388
2311
|
collapsed: t == null ? void 0 : t.collapsed,
|
|
2389
|
-
hideCondition: t == null ? void 0 : t.hideCondition,
|
|
2390
2312
|
settings: {
|
|
2391
|
-
marginTop: new
|
|
2313
|
+
marginTop: new E({
|
|
2392
2314
|
title: "Top",
|
|
2393
|
-
icon:
|
|
2315
|
+
icon: ut,
|
|
2394
2316
|
suffix: "px",
|
|
2395
2317
|
default: (t == null ? void 0 : t.marginTop) ?? "auto"
|
|
2396
2318
|
}),
|
|
2397
|
-
marginRight: new
|
|
2319
|
+
marginRight: new E({
|
|
2398
2320
|
title: "Right",
|
|
2399
|
-
icon:
|
|
2321
|
+
icon: pt,
|
|
2400
2322
|
suffix: "px",
|
|
2401
2323
|
default: (t == null ? void 0 : t.marginRight) ?? 0
|
|
2402
2324
|
}),
|
|
2403
|
-
marginBottom: new
|
|
2325
|
+
marginBottom: new E({
|
|
2404
2326
|
title: "Bottom",
|
|
2405
|
-
icon:
|
|
2327
|
+
icon: gt,
|
|
2406
2328
|
suffix: "px",
|
|
2407
2329
|
default: (t == null ? void 0 : t.marginBottom) ?? 0
|
|
2408
2330
|
}),
|
|
2409
|
-
marginLeft: new
|
|
2331
|
+
marginLeft: new E({
|
|
2410
2332
|
title: "Left",
|
|
2411
|
-
icon:
|
|
2333
|
+
icon: mt,
|
|
2412
2334
|
suffix: "px",
|
|
2413
2335
|
default: (t == null ? void 0 : t.marginLeft) ?? 0
|
|
2414
2336
|
})
|
|
@@ -2425,61 +2347,34 @@ class St extends v {
|
|
|
2425
2347
|
`;
|
|
2426
2348
|
}
|
|
2427
2349
|
}
|
|
2428
|
-
const
|
|
2350
|
+
const ut = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2429
2351
|
<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"/>
|
|
2430
|
-
</svg>`,
|
|
2352
|
+
</svg>`, pt = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2431
2353
|
<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"/>
|
|
2432
|
-
</svg>`,
|
|
2354
|
+
</svg>`, gt = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2433
2355
|
<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"/>
|
|
2434
|
-
</svg>`,
|
|
2356
|
+
</svg>`, mt = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2435
2357
|
<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"/>
|
|
2436
2358
|
</svg>`;
|
|
2437
|
-
class
|
|
2438
|
-
/**
|
|
2439
|
-
* Constructs a new BackgroundSettingSet.
|
|
2440
|
-
*
|
|
2441
|
-
* @param props An object that may include default values for each setting and additional
|
|
2442
|
-
* properties for the UploadSetting via `uploadProps`.
|
|
2443
|
-
*
|
|
2444
|
-
* Example:
|
|
2445
|
-
* {
|
|
2446
|
-
* backgroundImage: 'https://example.com/myimage.png',
|
|
2447
|
-
* opacity: 80,
|
|
2448
|
-
* backgroundColor: "0, 0, 30",
|
|
2449
|
-
* uploadProps: {
|
|
2450
|
-
* uploadUrl: 'https://st-admapi.onaim.io/api/File/UploadImage',
|
|
2451
|
-
* requestMethod: 'POST',
|
|
2452
|
-
* requestHeaders: {
|
|
2453
|
-
* accept: 'text/plain',
|
|
2454
|
-
* Authorization: 'bearer <your-token-here>',
|
|
2455
|
-
* },
|
|
2456
|
-
* formFieldName: 'File',
|
|
2457
|
-
* parseResponse: (data) => data.data.url,
|
|
2458
|
-
* }
|
|
2459
|
-
* }
|
|
2460
|
-
*/
|
|
2359
|
+
class At extends v {
|
|
2461
2360
|
constructor(t) {
|
|
2462
2361
|
super({
|
|
2463
2362
|
title: "Background Image",
|
|
2464
2363
|
collapsed: t == null ? void 0 : t.collapsed,
|
|
2465
|
-
hideCondition: t == null ? void 0 : t.hideCondition,
|
|
2466
2364
|
settings: {
|
|
2467
|
-
backgroundImage: new
|
|
2365
|
+
backgroundImage: new Q({
|
|
2468
2366
|
...t == null ? void 0 : t.uploadProps,
|
|
2469
2367
|
default: (t == null ? void 0 : t.backgroundImage) ?? ""
|
|
2470
2368
|
}),
|
|
2471
|
-
opacity: new
|
|
2369
|
+
opacity: new D({
|
|
2472
2370
|
default: (t == null ? void 0 : t.opacity) ?? 100
|
|
2473
2371
|
}),
|
|
2474
|
-
backgroundColor: new
|
|
2372
|
+
backgroundColor: new C({
|
|
2475
2373
|
default: (t == null ? void 0 : t.backgroundColor) ?? "0, 0, 30"
|
|
2476
2374
|
})
|
|
2477
2375
|
}
|
|
2478
2376
|
});
|
|
2479
2377
|
}
|
|
2480
|
-
/**
|
|
2481
|
-
* Override draw() to reorder the child settings and insert an "OR" label between the two sections.
|
|
2482
|
-
*/
|
|
2483
2378
|
draw() {
|
|
2484
2379
|
const t = super.draw(), e = t.querySelector(".setting-group-content");
|
|
2485
2380
|
if (!e) return t;
|
|
@@ -2488,9 +2383,6 @@ class Ot extends v {
|
|
|
2488
2383
|
const o = document.createElement("div");
|
|
2489
2384
|
return o.className = "bgset-or-label", o.textContent = "OR", e.appendChild(o), e.appendChild(a), t;
|
|
2490
2385
|
}
|
|
2491
|
-
/**
|
|
2492
|
-
* Helper method to generate CSS based on the current settings.
|
|
2493
|
-
*/
|
|
2494
2386
|
getCssCode() {
|
|
2495
2387
|
const t = this.settings.backgroundImage.value || "", e = this.settings.opacity.value ?? 100, i = this.settings.backgroundColor.value || "#000000";
|
|
2496
2388
|
return t ? `
|
|
@@ -2503,44 +2395,46 @@ class Ot extends v {
|
|
|
2503
2395
|
`;
|
|
2504
2396
|
}
|
|
2505
2397
|
}
|
|
2506
|
-
function
|
|
2507
|
-
return
|
|
2398
|
+
function Bt(c) {
|
|
2399
|
+
return p(c);
|
|
2508
2400
|
}
|
|
2509
|
-
function
|
|
2510
|
-
return
|
|
2401
|
+
function $t(c) {
|
|
2402
|
+
return w(c);
|
|
2511
2403
|
}
|
|
2512
2404
|
export {
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2405
|
+
J as AlignSetting,
|
|
2406
|
+
Nt as AnimationSetting,
|
|
2407
|
+
At as BackgroundSettingSet,
|
|
2408
|
+
Ot as BorderSettingSet,
|
|
2409
|
+
Et as ButtonSetting,
|
|
2410
|
+
m as ColorSetting,
|
|
2411
|
+
C as ColorWithOpacitySetting,
|
|
2412
|
+
bt as DimensionSetting,
|
|
2413
|
+
Mt as GapSetting,
|
|
2414
|
+
Ht as HeaderTypographySettingSet,
|
|
2415
|
+
xt as HeightSetting,
|
|
2416
|
+
wt as HtmlSetting,
|
|
2417
|
+
Vt as MarginBottomSetting,
|
|
2418
|
+
Tt as MarginSettingGroup,
|
|
2419
|
+
It as MarginTopSetting,
|
|
2420
|
+
St as MultiLanguageSetting,
|
|
2421
|
+
f as NumberSetting,
|
|
2422
|
+
D as OpacitySetting,
|
|
2423
|
+
yt as SelectApiSettings,
|
|
2424
|
+
I as SelectSetting,
|
|
2533
2425
|
g as Setting,
|
|
2534
2426
|
v as SettingGroup,
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2427
|
+
G as StringSetting,
|
|
2428
|
+
F as TabSettingGroup,
|
|
2429
|
+
F as TabsSettingGroup,
|
|
2430
|
+
kt as Toggle,
|
|
2431
|
+
Q as UploadSetting,
|
|
2432
|
+
Lt as WidthSetting,
|
|
2433
|
+
Ct as asSettingGroupWithSettings,
|
|
2434
|
+
z as createSettingGroup,
|
|
2435
|
+
vt as createTabSettingGroup,
|
|
2436
|
+
$t as isSetting,
|
|
2437
|
+
ft as isSettingChild,
|
|
2438
|
+
Bt as isSettingGroup,
|
|
2439
|
+
k as iterateSettings
|
|
2546
2440
|
};
|