builder-settings-types 0.0.58 → 0.0.59

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,24 +1,24 @@
1
- const E = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
2
- let y = (l = 21) => {
1
+ const N = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
2
+ let E = (l = 21) => {
3
3
  let t = "", e = crypto.getRandomValues(new Uint8Array(l |= 0));
4
4
  for (; l--; )
5
- t += E[e[l] & 63];
5
+ t += N[e[l] & 63];
6
6
  return t;
7
7
  };
8
- function N(l, t) {
8
+ function L(l, t) {
9
9
  for (const e in l)
10
10
  if (l.hasOwnProperty(e)) {
11
- const i = l[e];
12
- t(e, i);
11
+ const n = l[e];
12
+ t(e, n);
13
13
  }
14
14
  }
15
- class d {
15
+ class g {
16
16
  constructor(t) {
17
- this.id = t.id || y(), this.title = t.title, this.settings = t.settings, Object.assign(this, t.settings);
17
+ this.id = t.id || E(), this.title = t.title, this.settings = t.settings, Object.assign(this, t.settings);
18
18
  }
19
19
  setOnChange(t) {
20
- return this.onChange = t, N(this.settings, (e, i) => {
21
- i.setOnChange(t);
20
+ return this.onChange = t, L(this.settings, (e, n) => {
21
+ n.setOnChange(t);
22
22
  }), this;
23
23
  }
24
24
  /**
@@ -28,15 +28,15 @@ class d {
28
28
  getValues(t) {
29
29
  if (t === void 0) {
30
30
  const e = {};
31
- for (const i in this.settings)
32
- if (this.settings.hasOwnProperty(i)) {
33
- const n = this.settings[i];
34
- n instanceof d ? e[i] = n.getValues() : e[i] = n.value;
31
+ for (const n in this.settings)
32
+ if (this.settings.hasOwnProperty(n)) {
33
+ const i = this.settings[n];
34
+ i instanceof g ? e[n] = i.getValues() : e[n] = i.value;
35
35
  }
36
36
  return e;
37
37
  } else {
38
38
  const e = this.settings[t];
39
- return e ? e instanceof d ? e.getValues() : e.value : void 0;
39
+ return e ? e instanceof g ? e.getValues() : e.value : void 0;
40
40
  }
41
41
  }
42
42
  draw() {
@@ -44,17 +44,17 @@ class d {
44
44
  t.className = "setting-group";
45
45
  const e = document.createElement("div");
46
46
  e.className = "setting-group-title";
47
- const i = document.createElement("h3");
48
- i.textContent = this.title;
49
- const n = document.createElement("span");
50
- n.className = "setting-group-arrow", n.innerHTML = `
47
+ const n = document.createElement("h3");
48
+ n.textContent = this.title;
49
+ const i = document.createElement("span");
50
+ i.className = "setting-group-arrow", i.innerHTML = `
51
51
  <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none">
52
52
  <path d="M5 7.5L10 12.5L15 7.5" stroke="#344054" stroke-width="1.66667" stroke-linecap="round" stroke-linejoin="round"/>
53
53
  </svg>
54
54
  `, e.onclick = () => {
55
55
  const o = t.querySelector(".setting-group-content");
56
- o && (o.classList.toggle("collapsed"), n.classList.toggle("rotated"));
57
- }, e.appendChild(i), e.appendChild(n);
56
+ o && (o.classList.toggle("collapsed"), i.classList.toggle("rotated"));
57
+ }, e.appendChild(n), e.appendChild(i);
58
58
  const s = document.createElement("div");
59
59
  s.className = "setting-group-content";
60
60
  for (const o in this.settings)
@@ -65,7 +65,7 @@ class d {
65
65
  return t.appendChild(e), t.appendChild(s), t;
66
66
  }
67
67
  }
68
- function L(l) {
68
+ function S(l) {
69
69
  switch (l) {
70
70
  case "number":
71
71
  return 0;
@@ -83,9 +83,9 @@ function L(l) {
83
83
  return "";
84
84
  }
85
85
  }
86
- class g {
86
+ class C {
87
87
  constructor(t = {}) {
88
- this.props = t, this.id = t.id || y(), this.value = this.props.default, this.title = t.title || "";
88
+ this.props = t, this.id = t.id || E(), this.value = this.props.default, this.title = t.title || "";
89
89
  }
90
90
  setOnChange(t) {
91
91
  return this.onChange = t, this;
@@ -108,25 +108,25 @@ class g {
108
108
  }
109
109
  e.appendChild(s);
110
110
  }
111
- const i = document.createElement("div");
112
- i.className = t.wrapperClassName || "";
113
- const n = document.createElement("input");
114
- return this.inputEl = n, n.value = String(t.value || L(t.inputType)), n.type = t.inputType, n.placeholder = t.placeholder || "", n.className = t.inputClassName || "", n.oninput = (s) => {
111
+ const n = document.createElement("div");
112
+ n.className = t.wrapperClassName || "";
113
+ const i = document.createElement("input");
114
+ return this.inputEl = i, i.value = String(t.value || S(t.inputType)), i.type = t.inputType, i.placeholder = t.placeholder || "", i.className = t.inputClassName || "", i.oninput = (s) => {
115
115
  const o = s.target;
116
116
  let a = o.value;
117
117
  t.inputType === "number" ? a = Number(o.value) : (t.inputType === "color" || t.inputType === "date") && (a = o.value), this.value = a, this.onChange && this.onChange(this.value);
118
- }, t.inputCustomizer && t.inputCustomizer(n), i.appendChild(n), e.appendChild(i), e;
118
+ }, t.inputCustomizer && t.inputCustomizer(i), n.appendChild(i), e.appendChild(n), e;
119
119
  }
120
120
  createLabel(t, e) {
121
- const i = document.createElement("span");
122
- return i.textContent = t, i.className = "input-label " + (e || ""), i;
121
+ const n = document.createElement("span");
122
+ return n.textContent = t, n.className = "input-label " + (e || ""), n;
123
123
  }
124
124
  createIcon(t, e) {
125
- const i = document.createElement("span");
126
- return i.className = "input-icon " + (e || ""), i.innerHTML = t, i;
125
+ const n = document.createElement("span");
126
+ return n.className = "input-icon " + (e || ""), n.innerHTML = t, n;
127
127
  }
128
128
  }
129
- class x extends g {
129
+ class b extends C {
130
130
  constructor(t = {}) {
131
131
  super(t), this.inputType = "text";
132
132
  }
@@ -146,12 +146,12 @@ class x extends g {
146
146
  });
147
147
  }
148
148
  }
149
- const k = "<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>";
150
- class b extends x {
149
+ const H = "<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>";
150
+ class k extends b {
151
151
  constructor(t) {
152
152
  super({
153
153
  ...t,
154
- icon: t.icon || k,
154
+ icon: t.icon || H,
155
155
  title: t.title || "Color"
156
156
  }), this.inputType = "color";
157
157
  }
@@ -160,40 +160,40 @@ class b extends x {
160
160
  t.className = "color-setting-wrapper";
161
161
  const e = document.createElement("div");
162
162
  e.className = "icon-container";
163
- const i = this.createIcon(this.props.icon || k), n = this.createLabel(this.title || "Color");
164
- e.appendChild(i), e.appendChild(n);
163
+ const n = this.createIcon(this.props.icon || H), i = this.createLabel(this.title || "Color");
164
+ e.appendChild(n), e.appendChild(i);
165
165
  const s = document.createElement("div");
166
166
  s.className = "color-input-wrapper";
167
- const o = /^([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/, a = (p) => {
168
- const c = p.value.startsWith("#") ? p.value.slice(1) : p.value;
169
- return o.test(c) ? (p.style.border = "", !0) : (p.style.border = "1px solid red", !1);
167
+ const o = /^([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/, a = (d) => {
168
+ const c = d.value.startsWith("#") ? d.value.slice(1) : d.value;
169
+ return o.test(c) ? (d.style.border = "", !0) : (d.style.border = "1px solid red", !1);
170
170
  }, r = document.createElement("div");
171
171
  r.className = "color-preview", r.style.backgroundColor = this.value || "";
172
- const u = this.createInput({
172
+ const h = this.createInput({
173
173
  value: this.value,
174
174
  inputType: "text",
175
175
  inputClassName: "color-text-input"
176
- }), h = u.querySelector(
176
+ }), u = h.querySelector(
177
177
  "input"
178
- ), m = this.createInput({
178
+ ), w = this.createInput({
179
179
  value: this.value,
180
180
  inputType: this.inputType,
181
181
  inputClassName: "color-picker"
182
- }), C = m.querySelector(
182
+ }), f = w.querySelector(
183
183
  "input"
184
184
  );
185
- return h.oninput = (p) => {
186
- var w;
187
- let c = p.target.value.trim();
188
- c.charAt(0) !== "#" && (c = "#" + c, h.value = c), a(h) && (this.value = c, (w = this.onChange) == null || w.call(this, c), C.value = c, r.style.backgroundColor = c);
189
- }, C.oninput = (p) => {
190
- var w;
191
- let c = p.target.value;
192
- c.charAt(0) !== "#" && (c = "#" + c, C.value = c), this.value = c, (w = this.onChange) == null || w.call(this, c), h.value = c, r.style.backgroundColor = c, a(h);
193
- }, s.appendChild(r), s.appendChild(m), s.appendChild(u), t.appendChild(e), t.appendChild(s), t;
185
+ return u.oninput = (d) => {
186
+ var p;
187
+ let c = d.target.value.trim();
188
+ c.charAt(0) !== "#" && (c = "#" + c, u.value = c), a(u) && (this.value = c, (p = this.onChange) == null || p.call(this, c), f.value = c, r.style.backgroundColor = c);
189
+ }, f.oninput = (d) => {
190
+ var p;
191
+ let c = d.target.value;
192
+ c.charAt(0) !== "#" && (c = "#" + c, f.value = c), this.value = c, (p = this.onChange) == null || p.call(this, c), u.value = c, r.style.backgroundColor = c, a(u);
193
+ }, s.appendChild(r), s.appendChild(w), s.appendChild(h), t.appendChild(e), t.appendChild(s), t;
194
194
  }
195
195
  }
196
- class v extends g {
196
+ class v extends C {
197
197
  constructor(t = {}) {
198
198
  super(t), this.inputType = "number";
199
199
  }
@@ -216,15 +216,15 @@ class v extends g {
216
216
  if (!this.props.suffix || this.props.suffix === "none")
217
217
  return e;
218
218
  e.classList.add("suffix-wrapper");
219
- const i = e.querySelector(
219
+ const n = e.querySelector(
220
220
  "input.number-setting-input"
221
221
  );
222
- i && (i.style.paddingRight = "35px");
223
- const n = document.createElement("span");
224
- return n.className = "suffix-label", n.textContent = this.props.suffix, e.appendChild(n), e;
222
+ n && (n.style.paddingRight = "35px");
223
+ const i = document.createElement("span");
224
+ return i.className = "suffix-label", i.textContent = this.props.suffix, e.appendChild(i), e;
225
225
  }
226
226
  }
227
- class M extends v {
227
+ class x extends v {
228
228
  constructor(t) {
229
229
  super({
230
230
  ...t,
@@ -244,51 +244,51 @@ const V = `
244
244
  <path d="M15.84 12.6648C15.6975 12.6648 15.555 12.6123 15.4425 12.4998L10.725 7.78234C10.5075 7.56484 10.5075 7.20484 10.725 6.98734C10.9425 6.76984 11.3025 6.76984 11.52 6.98734L16.2375 11.7048C16.455 11.9223 16.455 12.2823 16.2375 12.4998C16.1325 12.6048 15.99 12.6648 15.84 12.6648Z" fill="#667085"/>
245
245
  </svg>
246
246
  `;
247
- class H extends g {
247
+ class y extends C {
248
248
  constructor(t = {}) {
249
249
  super(t), this.inputType = "select", this._options = [], t.options && (this._options = [...t.options]), t.getOptions && this._options.push(...t.getOptions()), t.getOptionsAsync && t.getOptionsAsync().then((e) => {
250
- this._options.push(...e), this.selectNode && e.forEach((i, n) => {
251
- const s = this._options.length - e.length + n;
252
- this.selectNode.appendChild(this.createOption(i, s));
250
+ this._options.push(...e), this.selectNode && e.forEach((n, i) => {
251
+ const s = this._options.length - e.length + i;
252
+ this.selectNode.appendChild(this.createOption(n, s));
253
253
  });
254
254
  }).catch((e) => {
255
255
  console.error("Failed to fetch async options:", e);
256
256
  });
257
257
  }
258
258
  createOption(t, e) {
259
- const i = document.createElement("option");
260
- return i.value = String(e), i.textContent = t.name, i;
259
+ const n = document.createElement("option");
260
+ return n.value = String(e), n.textContent = t.name, n;
261
261
  }
262
262
  draw() {
263
263
  const t = document.createElement("div");
264
264
  if (t.classList.add("select-container"), this.props.icon || this.props.title) {
265
- const i = document.createElement("div");
266
- if (i.className = "icon-container", this.props.icon) {
267
- const n = this.createIcon(this.props.icon);
268
- i.appendChild(n);
265
+ const n = document.createElement("div");
266
+ if (n.className = "icon-container", this.props.icon) {
267
+ const i = this.createIcon(this.props.icon);
268
+ n.appendChild(i);
269
269
  }
270
270
  if (this.props.title) {
271
- const n = this.createLabel(this.props.title);
272
- i.appendChild(n);
271
+ const i = this.createLabel(this.props.title);
272
+ n.appendChild(i);
273
273
  }
274
- t.appendChild(i);
274
+ t.appendChild(n);
275
275
  }
276
276
  const e = document.createElement("select");
277
- if (this.selectNode = e, e.classList.add("select"), this._options.forEach((i, n) => {
278
- const s = this.createOption(i, n);
277
+ if (this.selectNode = e, e.classList.add("select"), this._options.forEach((n, i) => {
278
+ const s = this.createOption(n, i);
279
279
  e.appendChild(s);
280
280
  }), this.value !== void 0) {
281
- const i = this._options.findIndex((n) => n.value === this.value);
282
- i >= 0 && (e.value = String(i));
281
+ const n = this._options.findIndex((i) => i.value === this.value);
282
+ n >= 0 && (e.value = String(n));
283
283
  }
284
- return e.onchange = (i) => {
284
+ return e.onchange = (n) => {
285
285
  var o;
286
- const n = Number(i.target.value), s = this._options[n];
286
+ const i = Number(n.target.value), s = this._options[i];
287
287
  s && (this.value = s.value, (o = this.onChange) == null || o.call(this, this.value));
288
288
  }, t.appendChild(e), t;
289
289
  }
290
290
  }
291
- class S extends g {
291
+ class T extends C {
292
292
  constructor(t = {}) {
293
293
  super(t), this.inputType = "button", this.value || (this.value = "center");
294
294
  }
@@ -297,8 +297,8 @@ class S extends g {
297
297
  t.className = "align-setting-wrapper";
298
298
  const e = document.createElement("label");
299
299
  e.className = "align-setting-label", e.textContent = this.title || "Align", t.appendChild(e);
300
- const i = document.createElement("div");
301
- return i.className = "align-options-container", [
300
+ const n = document.createElement("div");
301
+ return n.className = "align-options-container", [
302
302
  {
303
303
  name: "left",
304
304
  icon: `
@@ -336,12 +336,12 @@ class S extends g {
336
336
  const o = document.createElement("button");
337
337
  o.className = "align-option-button", o.innerHTML = s.icon, this.value === s.name && o.classList.add("selected"), o.addEventListener("click", () => {
338
338
  var a;
339
- i.querySelectorAll(".align-option-button").forEach((r) => r.classList.remove("selected")), o.classList.add("selected"), this.value = s.name, (a = this.onChange) == null || a.call(this, this.value);
340
- }), i.appendChild(o);
341
- }), t.appendChild(i), t;
339
+ n.querySelectorAll(".align-option-button").forEach((r) => r.classList.remove("selected")), o.classList.add("selected"), this.value = s.name, (a = this.onChange) == null || a.call(this, this.value);
340
+ }), n.appendChild(o);
341
+ }), t.appendChild(n), t;
342
342
  }
343
343
  }
344
- class D extends g {
344
+ class q extends C {
345
345
  constructor(t) {
346
346
  super(t), this.inputType = "button";
347
347
  }
@@ -354,7 +354,7 @@ class D extends g {
354
354
  return e.className = "button-setting-wrapper " + (this.props.wrapperClassName || ""), e.appendChild(t), e;
355
355
  }
356
356
  }
357
- class U extends g {
357
+ class D extends C {
358
358
  constructor(t = {}) {
359
359
  super(t), this.inputType = { width: "number", height: "number" }, this.isUpdating = !1, this.value || (this.value = { width: 100, height: 100 }), this.locked = t.locked ?? !1, this.value.height === 0 && (this.value.height = 1), this.aspectRatio = this.value.width / this.value.height, this.widthSetting = new v({
360
360
  title: "Width",
@@ -363,7 +363,7 @@ class U extends g {
363
363
  // Display "px" as the unit.
364
364
  minValue: t.minWidth ?? 1,
365
365
  maxValue: t.maxWidth,
366
- icon: T
366
+ icon: I
367
367
  // SVG icon defined at the bottom.
368
368
  }), this.heightSetting = new v({
369
369
  title: "Height",
@@ -371,19 +371,19 @@ class U extends g {
371
371
  suffix: "px",
372
372
  minValue: t.minHeight ?? 1,
373
373
  maxValue: t.maxHeight,
374
- icon: I
374
+ icon: B
375
375
  }), this.widthSetting.setOnChange((e) => {
376
376
  var s;
377
377
  if (this.isUpdating || isNaN(e) || e < 1) return;
378
378
  this.isUpdating = !0;
379
- let i = e, n = this.value.height;
380
- this.locked && isFinite(this.aspectRatio) && !isNaN(this.aspectRatio) && (n = Math.round(i / this.aspectRatio), n < 1 && (n = 1)), this.value = { width: i, height: n }, n !== 0 && (this.aspectRatio = i / n), (s = this.onChange) == null || s.call(this, this.value), this.heightSetting.setValue(n), this.isUpdating = !1;
379
+ let n = e, i = this.value.height;
380
+ this.locked && isFinite(this.aspectRatio) && !isNaN(this.aspectRatio) && (i = Math.round(n / this.aspectRatio), i < 1 && (i = 1)), this.value = { width: n, height: i }, i !== 0 && (this.aspectRatio = n / i), (s = this.onChange) == null || s.call(this, this.value), this.heightSetting.setValue(i), this.isUpdating = !1;
381
381
  }), this.heightSetting.setOnChange((e) => {
382
382
  var s;
383
383
  if (this.isUpdating || isNaN(e) || e < 1) return;
384
384
  this.isUpdating = !0;
385
- let i = e, n = this.value.width;
386
- this.locked && isFinite(this.aspectRatio) && !isNaN(this.aspectRatio) && (n = Math.round(i * this.aspectRatio), n < 1 && (n = 1)), this.value = { width: n, height: i }, i !== 0 && (this.aspectRatio = n / i), (s = this.onChange) == null || s.call(this, this.value), this.widthSetting.setValue(n), this.isUpdating = !1;
385
+ let n = e, i = this.value.width;
386
+ this.locked && isFinite(this.aspectRatio) && !isNaN(this.aspectRatio) && (i = Math.round(n * this.aspectRatio), i < 1 && (i = 1)), this.value = { width: i, height: n }, n !== 0 && (this.aspectRatio = i / n), (s = this.onChange) == null || s.call(this, this.value), this.widthSetting.setValue(i), this.isUpdating = !1;
387
387
  });
388
388
  }
389
389
  /**
@@ -393,8 +393,8 @@ class U extends g {
393
393
  */
394
394
  toggleLock(t) {
395
395
  if (this.locked = !this.locked, this.locked) {
396
- const e = this.value.width, i = this.value.height;
397
- i !== 0 && (this.aspectRatio = e / i);
396
+ const e = this.value.width, n = this.value.height;
397
+ n !== 0 && (this.aspectRatio = e / n);
398
398
  }
399
399
  t.innerHTML = this.getLockSVG(this.locked);
400
400
  }
@@ -421,22 +421,22 @@ class U extends g {
421
421
  draw() {
422
422
  const t = document.createElement("div");
423
423
  t.className = "dimension-setting-container";
424
- const e = this.widthSetting.draw(), i = this.heightSetting.draw(), n = document.createElement("div");
425
- n.className = "dimension-bracket";
424
+ const e = this.widthSetting.draw(), n = this.heightSetting.draw(), i = document.createElement("div");
425
+ i.className = "dimension-bracket";
426
426
  const s = document.createElement("span");
427
- return s.className = "dimension-lock-icon", s.innerHTML = this.getLockSVG(this.locked), s.onclick = () => this.toggleLock(s), n.appendChild(s), t.appendChild(e), t.appendChild(n), t.appendChild(i), t;
427
+ return s.className = "dimension-lock-icon", s.innerHTML = this.getLockSVG(this.locked), s.onclick = () => this.toggleLock(s), i.appendChild(s), t.appendChild(e), t.appendChild(i), t.appendChild(n), t;
428
428
  }
429
429
  }
430
- const T = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
430
+ const I = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
431
431
  <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"/>
432
- </svg>`, I = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
432
+ </svg>`, B = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
433
433
  <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"/>
434
434
  </svg>`, O = `
435
435
  <svg xmlns="http://www.w3.org/2000/svg" width="15" height="16" viewBox="0 0 15 16" fill="none">
436
436
  <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"/>
437
437
  </svg>
438
438
  `;
439
- class B extends g {
439
+ class R extends C {
440
440
  constructor(t = {}) {
441
441
  super(t), this.inputType = "button", !this.value && t.defaultUrl && (this.value = t.defaultUrl);
442
442
  }
@@ -445,44 +445,44 @@ class B extends g {
445
445
  t.className = "upload-setting-wrapper";
446
446
  const e = document.createElement("img");
447
447
  e.className = "upload-preview", e.src = this.value || this.props.defaultUrl || "";
448
- const i = document.createElement("button");
449
- i.className = "upload-button", i.innerHTML = `
448
+ const n = document.createElement("button");
449
+ n.className = "upload-button", n.innerHTML = `
450
450
  <span class="upload-icon">${O}</span>
451
451
  <span class="upload-label">Upload</span>
452
452
  `;
453
- const n = document.createElement("input");
454
- return n.type = "file", n.accept = "image/*", n.style.display = "none", i.onclick = () => {
455
- n.click();
456
- }, n.onchange = async () => {
457
- var o, a;
458
- const s = (o = n.files) == null ? void 0 : o[0];
453
+ const i = document.createElement("input");
454
+ return i.type = "file", i.accept = "image/*", i.style.display = "none", n.onclick = () => {
455
+ i.click();
456
+ }, i.onchange = async () => {
457
+ var o, a, r;
458
+ const s = (o = i.files) == null ? void 0 : o[0];
459
459
  if (s)
460
460
  try {
461
- const r = new FormData();
462
- r.append("File", s, s.name);
463
- const u = this.props.token || "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxIiwiZW1haWwiOiJzdXBlcmFkbWluQHRlc3QuY29tIiwianRpIjoiMjI1MzFmZDUtN2QyMy00OGFiLWI4MDItZTBiZmJhNTEyYjNkIiwiaWF0IjoxNzQxMTg2MDMxLCJodHRwOi8vc2NoZW1hcy5taWNyb3NvZnQuY29tL3dzLzIwMDgvMDYvaWRlbnRpdHkvY2xhaW1zL3JvbGUiOiJTdXBlclJvbGUiLCJuYmYiOjE3NDExODYwMzAsImV4cCI6MTc0MTI3MjQzMCwiaXNzIjoib25haW0tYWRtaW4tYXBpIiwiYXVkIjoiKiJ9.RtHb41tUgQpunHy1-zceiSdYhlDKL1bxuPrun4yOtF4", m = await (await fetch(
464
- "https://st-admapi.onaim.io/api/File/UploadImage",
465
- {
466
- method: "POST",
467
- body: r,
468
- headers: {
469
- Authorization: `Bearer ${u}`,
470
- accept: "text/plain"
471
- }
472
- }
473
- )).json();
474
- if (m.succeeded) {
475
- const C = m.data.url;
476
- this.value = C, e.src = C, (a = this.onChange) == null || a.call(this, C);
477
- } else
478
- console.error("Upload failed:", m);
479
- } catch (r) {
480
- console.error("Error uploading file:", r);
461
+ const h = new FormData(), u = this.props.formFieldName || "file";
462
+ h.append(u, s, s.name);
463
+ const w = this.props.uploadUrl;
464
+ if (!w)
465
+ throw new Error("No uploadUrl provided to UploadSetting.");
466
+ const f = this.props.requestMethod || "POST", d = { ...this.props.requestHeaders || {} }, p = await (await fetch(w, {
467
+ method: f,
468
+ body: h,
469
+ headers: d
470
+ })).json();
471
+ let m;
472
+ if (this.props.parseResponse)
473
+ m = this.props.parseResponse(p);
474
+ else if (m = (a = p == null ? void 0 : p.data) == null ? void 0 : a.url, !m)
475
+ throw new Error(
476
+ "No URL found in response. Provide a parseResponse if needed."
477
+ );
478
+ this.value = m, e.src = m, (r = this.onChange) == null || r.call(this, m);
479
+ } catch (h) {
480
+ console.error("Error uploading file:", h);
481
481
  }
482
- }, t.appendChild(e), t.appendChild(i), t.appendChild(n), t;
482
+ }, t.appendChild(e), t.appendChild(n), t.appendChild(i), t;
483
483
  }
484
484
  }
485
- const R = `
485
+ const $ = `
486
486
  <svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
487
487
  <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"/>
488
488
  </svg>
@@ -491,22 +491,22 @@ const R = `
491
491
  <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"/>
492
492
  </svg>
493
493
  `;
494
- class q extends d {
494
+ class P extends g {
495
495
  constructor(t) {
496
496
  super({
497
497
  title: "Border",
498
498
  settings: {
499
- color: new b({
499
+ color: new k({
500
500
  default: (t == null ? void 0 : t.color) ?? "#00141E"
501
501
  }),
502
- opacity: new M({
502
+ opacity: new x({
503
503
  default: (t == null ? void 0 : t.opacity) ?? 100,
504
504
  minValue: 0,
505
505
  maxValue: 100
506
506
  }),
507
507
  radius: new v({
508
508
  title: "Radius",
509
- icon: R,
509
+ icon: $,
510
510
  default: (t == null ? void 0 : t.radius) ?? 12,
511
511
  suffix: "px"
512
512
  }),
@@ -523,11 +523,11 @@ class q extends d {
523
523
  * Optional helper to generate CSS from the current settings.
524
524
  */
525
525
  getCssCode() {
526
- const t = this.settings.color.value ?? "#000000", e = this.settings.opacity.value ?? 100, i = this.settings.radius.value ?? 0, n = this.settings.size.value ?? 0;
526
+ const t = this.settings.color.value ?? "#000000", e = this.settings.opacity.value ?? 100, n = this.settings.radius.value ?? 0, i = this.settings.size.value ?? 0;
527
527
  return `
528
528
  border-color: ${t};
529
- border-width: ${n}px;
530
- border-radius: ${i}px;
529
+ border-width: ${i}px;
530
+ border-radius: ${n}px;
531
531
  opacity: ${e / 100};
532
532
  `;
533
533
  }
@@ -536,27 +536,27 @@ const A = `
536
536
  <svg xmlns="http://www.w3.org/2000/svg" width="14" height="13" viewBox="0 0 14 13" fill="none">
537
537
  <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"/>
538
538
  </svg>
539
- `, W = `
539
+ `, _ = `
540
540
  <svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
541
541
  <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"/>
542
542
  </svg>
543
- `, $ = `
543
+ `, G = `
544
544
  <svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
545
545
  <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"/>
546
546
  </svg>
547
547
  `;
548
- class J extends d {
548
+ class X extends g {
549
549
  constructor(t = {}) {
550
550
  super({
551
551
  title: "Header Typography",
552
552
  settings: {
553
- color: new b({
553
+ color: new k({
554
554
  default: t.colorDefault ?? "#00141E"
555
555
  }),
556
- opacity: new M({
556
+ opacity: new x({
557
557
  default: t.colorOpacityDefault ?? 100
558
558
  }),
559
- fontFamily: new H({
559
+ fontFamily: new y({
560
560
  title: "Font",
561
561
  icon: A,
562
562
  default: t.fontFamilyDefault ?? "Satoshi",
@@ -568,9 +568,9 @@ class J extends d {
568
568
  getOptions: t.fontFamilyGetOptions,
569
569
  getOptionsAsync: t.fontFamilyGetOptionsAsync
570
570
  }),
571
- fontWeight: new H({
571
+ fontWeight: new y({
572
572
  title: "Weight",
573
- icon: W,
573
+ icon: _,
574
574
  default: t.fontWeightDefault ?? "bold",
575
575
  options: t.fontWeightOptions ?? [
576
576
  { name: "Regular", value: "regular" },
@@ -582,11 +582,11 @@ class J extends d {
582
582
  }),
583
583
  fontSize: new v({
584
584
  title: "Size",
585
- icon: $,
585
+ icon: G,
586
586
  default: t.fontSizeDefault ?? 12,
587
587
  suffix: "px"
588
588
  }),
589
- align: new S({
589
+ align: new T({
590
590
  title: "Align",
591
591
  default: t.alignDefault ?? "center"
592
592
  })
@@ -594,18 +594,18 @@ class J extends d {
594
594
  });
595
595
  }
596
596
  getCssCode() {
597
- const t = this.settings.color.value ?? "#000000", e = this.settings.opacity.value ?? 100, i = this.settings.fontFamily.value ?? "Satoshi", n = this.settings.fontWeight.value ?? "bold", s = this.settings.fontSize.value ?? 12, o = this.settings.align.value ?? "left";
597
+ const t = this.settings.color.value ?? "#000000", e = this.settings.opacity.value ?? 100, n = this.settings.fontFamily.value ?? "Satoshi", i = this.settings.fontWeight.value ?? "bold", s = this.settings.fontSize.value ?? 12, o = this.settings.align.value ?? "left";
598
598
  return `
599
599
  color: ${t};
600
600
  opacity: ${e / 100};
601
- font-family: ${i};
602
- font-weight: ${n};
601
+ font-family: ${n};
602
+ font-weight: ${i};
603
603
  font-size: ${s}px;
604
604
  text-align: ${o};
605
605
  `;
606
606
  }
607
607
  }
608
- class f extends g {
608
+ class M extends C {
609
609
  constructor(t) {
610
610
  super({
611
611
  ...t,
@@ -615,11 +615,11 @@ class f extends g {
615
615
  draw() {
616
616
  const t = this.value === "auto" ? "text" : "number", e = (a) => {
617
617
  this.value !== "auto" && (this.props.minValue !== void 0 && (a.min = String(this.props.minValue)), this.props.maxValue !== void 0 && (a.max = String(this.props.maxValue)), this.props.className && a.classList.add(this.props.className), a.addEventListener("input", () => {
618
- const r = this.props.minValue ?? Number.MIN_SAFE_INTEGER, u = this.props.maxValue ?? Number.MAX_SAFE_INTEGER;
619
- let h = Number(a.value);
620
- h < r && (h = r), h > u && (h = u), a.value = String(h);
618
+ const r = this.props.minValue ?? Number.MIN_SAFE_INTEGER, h = this.props.maxValue ?? Number.MAX_SAFE_INTEGER;
619
+ let u = Number(a.value);
620
+ u < r && (u = r), u > h && (u = h), a.value = String(u);
621
621
  }));
622
- }, i = this.createInput({
622
+ }, n = this.createInput({
623
623
  value: this.value,
624
624
  inputType: t,
625
625
  title: this.props.title,
@@ -630,51 +630,51 @@ class f extends g {
630
630
  placeholder: this.value === "auto" ? "auto" : ""
631
631
  });
632
632
  if (!this.props.suffix || this.props.suffix === "none")
633
- return i;
634
- i.classList.add("suffix-wrapper");
635
- const n = i.querySelector(
633
+ return n;
634
+ n.classList.add("suffix-wrapper");
635
+ const i = n.querySelector(
636
636
  "input.number-setting-input"
637
637
  );
638
- n && (n.style.paddingRight = "35px");
638
+ i && (i.style.paddingRight = "35px");
639
639
  const s = document.createElement("span");
640
- s.className = "suffix-label", s.textContent = this.props.suffix, i.appendChild(s);
641
- const o = i.querySelector("input");
640
+ s.className = "suffix-label", s.textContent = this.props.suffix, n.appendChild(s);
641
+ const o = n.querySelector("input");
642
642
  return o && (o.oninput = (a) => {
643
643
  const r = a.target.value.trim();
644
644
  if (r.toLowerCase() === "auto")
645
645
  this.value = "auto";
646
646
  else {
647
- const u = Number(r);
648
- isNaN(u) || (this.value = u);
647
+ const h = Number(r);
648
+ isNaN(h) || (this.value = h);
649
649
  }
650
650
  this.onChange && this.onChange(this.value);
651
- }), i;
651
+ }), n;
652
652
  }
653
653
  }
654
- class Y extends d {
654
+ class J extends g {
655
655
  constructor(t) {
656
656
  super({
657
657
  title: "Margins",
658
658
  settings: {
659
- marginTop: new f({
659
+ marginTop: new M({
660
660
  title: "Top",
661
- icon: z,
661
+ icon: F,
662
662
  suffix: "px",
663
663
  default: (t == null ? void 0 : t.marginTop) ?? "auto"
664
664
  }),
665
- marginRight: new f({
665
+ marginRight: new M({
666
666
  title: "Right",
667
- icon: F,
667
+ icon: U,
668
668
  suffix: "px",
669
669
  default: (t == null ? void 0 : t.marginRight) ?? 0
670
670
  }),
671
- marginBottom: new f({
671
+ marginBottom: new M({
672
672
  title: "Bottom",
673
- icon: G,
673
+ icon: W,
674
674
  suffix: "px",
675
675
  default: (t == null ? void 0 : t.marginBottom) ?? 0
676
676
  }),
677
- marginLeft: new f({
677
+ marginLeft: new M({
678
678
  title: "Left",
679
679
  icon: Z,
680
680
  suffix: "px",
@@ -684,34 +684,34 @@ class Y extends d {
684
684
  });
685
685
  }
686
686
  getCssCode() {
687
- const t = typeof this.settings.marginTop.value == "number" ? `${this.settings.marginTop.value}px` : this.settings.marginTop.value, e = typeof this.settings.marginRight.value == "number" ? `${this.settings.marginRight.value}px` : this.settings.marginRight.value, i = typeof this.settings.marginBottom.value == "number" ? `${this.settings.marginBottom.value}px` : this.settings.marginBottom.value, n = typeof this.settings.marginLeft.value == "number" ? `${this.settings.marginLeft.value}px` : this.settings.marginLeft.value;
687
+ const t = typeof this.settings.marginTop.value == "number" ? `${this.settings.marginTop.value}px` : this.settings.marginTop.value, e = typeof this.settings.marginRight.value == "number" ? `${this.settings.marginRight.value}px` : this.settings.marginRight.value, n = typeof this.settings.marginBottom.value == "number" ? `${this.settings.marginBottom.value}px` : this.settings.marginBottom.value, i = typeof this.settings.marginLeft.value == "number" ? `${this.settings.marginLeft.value}px` : this.settings.marginLeft.value;
688
688
  return `
689
689
  margin-top: ${t};
690
690
  margin-right: ${e};
691
- margin-bottom: ${i};
692
- margin-left: ${n};
691
+ margin-bottom: ${n};
692
+ margin-left: ${i};
693
693
  `;
694
694
  }
695
695
  }
696
- const z = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
696
+ const F = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
697
697
  <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"/>
698
- </svg>`, F = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
698
+ </svg>`, U = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
699
699
  <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"/>
700
- </svg>`, G = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
700
+ </svg>`, W = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
701
701
  <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"/>
702
702
  </svg>`, Z = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
703
703
  <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"/>
704
704
  </svg>`;
705
- class _ extends d {
705
+ class z extends g {
706
706
  constructor(t, e) {
707
707
  super({
708
708
  title: `Tab ${t + 1}`,
709
709
  settings: {
710
- name: new x({
710
+ name: new b({
711
711
  title: "Tab Name",
712
712
  default: `Tab ${t + 1}`
713
713
  }),
714
- content: new x({
714
+ content: new b({
715
715
  title: "Content",
716
716
  default: ""
717
717
  })
@@ -721,10 +721,10 @@ class _ extends d {
721
721
  draw() {
722
722
  const t = super.draw(), e = t.querySelector(".setting-group-arrow");
723
723
  e && e.parentElement && e.parentElement.removeChild(e);
724
- const i = t.querySelector(".setting-group-title");
725
- if (i) {
726
- const n = document.createElement("div");
727
- n.className = "tab-delete-container";
724
+ const n = t.querySelector(".setting-group-title");
725
+ if (n) {
726
+ const i = document.createElement("div");
727
+ i.className = "tab-delete-container";
728
728
  const s = document.createElement("button");
729
729
  s.className = "tab-delete-button", s.innerHTML = `
730
730
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#f87171" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="trash-icon">
@@ -737,21 +737,21 @@ class _ extends d {
737
737
  `, s.onclick = () => {
738
738
  var a;
739
739
  return (a = this.onDeleteCallback) == null ? void 0 : a.call(this);
740
- }, n.appendChild(s);
741
- const o = i.querySelector("h3");
742
- o ? o.insertAdjacentElement("afterend", n) : i.appendChild(n);
740
+ }, i.appendChild(s);
741
+ const o = n.querySelector("h3");
742
+ o ? o.insertAdjacentElement("afterend", i) : n.appendChild(i);
743
743
  }
744
744
  return t;
745
745
  }
746
746
  }
747
- class X extends d {
747
+ class Q extends g {
748
748
  // Store the rendered element
749
749
  constructor() {
750
750
  super({ title: "Tabs", settings: {} }), this.tabs = [], this._el = null, this.addTab();
751
751
  }
752
752
  /** Adds a new tab. */
753
753
  addTab() {
754
- const t = this.tabs.length, e = new _(t, () => this.removeTab(e));
754
+ const t = this.tabs.length, e = new z(t, () => this.removeTab(e));
755
755
  this.tabs.push(e), this.settings[`Tab ${t + 1}`] = e;
756
756
  }
757
757
  /** Removes a specific tab. */
@@ -774,8 +774,8 @@ class X extends d {
774
774
  this._el = t;
775
775
  const e = document.createElement("div");
776
776
  e.className = "tabs-add-btn-container";
777
- const i = document.createElement("button");
778
- return i.className = "tabs-add-button", i.innerHTML = `
777
+ const n = document.createElement("button");
778
+ return n.className = "tabs-add-button", n.innerHTML = `
779
779
  <span class="add-icon">
780
780
  <svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" stroke="#667085">
781
781
  <g id="SVGRepo_bgCarrier" stroke-width="0"></g>
@@ -788,9 +788,9 @@ class X extends d {
788
788
  </svg>
789
789
  </span>
790
790
  <span class="add-label">Add Tab</span>
791
- `, i.onclick = () => {
791
+ `, n.onclick = () => {
792
792
  this.addTab(), this.rerender();
793
- }, e.appendChild(i), t.appendChild(e), t;
793
+ }, e.appendChild(n), t.appendChild(e), t;
794
794
  }
795
795
  /**
796
796
  * Re-renders the inner settings content based on the current tabs.
@@ -799,71 +799,99 @@ class X extends d {
799
799
  if (!this._el) return;
800
800
  const t = this._el.querySelector(".setting-group-content");
801
801
  t && (t.innerHTML = "", Object.keys(this.settings).forEach((e) => {
802
- const i = this.settings[e];
803
- t.appendChild(i.draw());
802
+ const n = this.settings[e];
803
+ t.appendChild(n.draw());
804
804
  }));
805
805
  }
806
806
  }
807
- class Q extends d {
807
+ class Y extends g {
808
+ /**
809
+ * Constructs a new BackgroundSettingSet.
810
+ *
811
+ * @param props An object that may include default values for each setting and additional
812
+ * properties for the UploadSetting via `uploadProps`.
813
+ *
814
+ * Example:
815
+ * {
816
+ * backgroundImage: 'https://example.com/myimage.png',
817
+ * opacity: 80,
818
+ * backgroundColor: '#00141E',
819
+ * opacityBG: 90,
820
+ * uploadProps: {
821
+ * uploadUrl: 'https://st-admapi.onaim.io/api/File/UploadImage',
822
+ * requestMethod: 'POST',
823
+ * requestHeaders: {
824
+ * accept: 'text/plain',
825
+ * Authorization: 'bearer <your-token-here>',
826
+ * },
827
+ * formFieldName: 'File',
828
+ * parseResponse: (data) => data.data.url,
829
+ * }
830
+ * }
831
+ */
808
832
  constructor(t) {
809
833
  super({
810
834
  title: "Background Image",
811
835
  settings: {
812
- backgroundImage: new B({
836
+ backgroundImage: new R({
837
+ ...t == null ? void 0 : t.uploadProps,
813
838
  default: (t == null ? void 0 : t.backgroundImage) ?? ""
814
839
  }),
815
- opacity: new M({
840
+ opacity: new x({
816
841
  default: (t == null ? void 0 : t.opacity) ?? 100
817
842
  }),
818
- backgroundColor: new b({
843
+ backgroundColor: new k({
819
844
  default: (t == null ? void 0 : t.backgroundColor) ?? "#00141E"
820
845
  }),
821
- opacityBG: new M({
846
+ opacityBG: new x({
822
847
  default: (t == null ? void 0 : t.opacityBG) ?? 100
823
848
  })
824
849
  }
825
850
  });
826
851
  }
827
852
  /**
828
- * Override draw() to reorder the child settings and insert an "OR" label in between.
853
+ * Override draw() to reorder the child settings and insert an "OR" label between the two sections.
829
854
  */
830
855
  draw() {
831
856
  const t = super.draw(), e = t.querySelector(".setting-group-content");
832
857
  if (!e) return t;
833
- const i = Array.from(e.children), [n, s, o, a] = i;
834
- e.innerHTML = "", e.appendChild(n), e.appendChild(s);
858
+ const n = Array.from(e.children), [i, s, o, a] = n;
859
+ e.innerHTML = "", e.appendChild(i), e.appendChild(s);
835
860
  const r = document.createElement("div");
836
861
  return r.className = "bgset-or-label", r.textContent = "OR", e.appendChild(r), e.appendChild(o), e.appendChild(a), t;
837
862
  }
863
+ /**
864
+ * Helper method to generate CSS based on the current settings.
865
+ */
838
866
  getCssCode() {
839
- const t = this.settings.backgroundImage.value || "", e = this.settings.opacity.value ?? 100, i = this.settings.backgroundColor.value || "#00141E", n = this.settings.opacityBG.value ?? 100;
867
+ const t = this.settings.backgroundImage.value || "", e = this.settings.opacity.value ?? 100, n = this.settings.backgroundColor.value || "#00141E", i = this.settings.opacityBG.value ?? 100;
840
868
  return t ? `
841
- background-image: url("${t}");
842
- background-size: cover;
843
- background-position: center;
844
- opacity: ${e / 100};
845
- ` : `
846
- background-color: ${i};
847
- opacity: ${n / 100};
848
- `;
869
+ background-image: url("${t}");
870
+ background-size: cover;
871
+ background-position: center;
872
+ opacity: ${e / 100};
873
+ ` : `
874
+ background-color: ${n};
875
+ opacity: ${i / 100};
876
+ `;
849
877
  }
850
878
  }
851
879
  export {
852
- S as AlignSetting,
853
- Q as BackgroundSettingSet,
854
- q as BorderSettingSet,
855
- D as ButtonSetting,
856
- b as ColorSetting,
857
- U as DimensionSetting,
858
- J as HeaderTypographySettingSet,
859
- Y as MarginSettingGroup,
880
+ T as AlignSetting,
881
+ Y as BackgroundSettingSet,
882
+ P as BorderSettingSet,
883
+ q as ButtonSetting,
884
+ k as ColorSetting,
885
+ D as DimensionSetting,
886
+ X as HeaderTypographySettingSet,
887
+ J as MarginSettingGroup,
860
888
  v as NumberSetting,
861
- M as OpacitySetting,
862
- H as SelectSetting,
863
- g as Setting,
864
- d as SettingGroup,
865
- x as StringSetting,
866
- X as TabsContainerGroup,
867
- B as UploadSetting,
868
- N as iterateSettings
889
+ x as OpacitySetting,
890
+ y as SelectSetting,
891
+ C as Setting,
892
+ g as SettingGroup,
893
+ b as StringSetting,
894
+ Q as TabsContainerGroup,
895
+ R as UploadSetting,
896
+ L as iterateSettings
869
897
  };