@billgangcom/theme-lib 1.8.0 → 1.8.1

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/ui.es.js CHANGED
@@ -1,19 +1,19 @@
1
- import { j as t, I as m, a as T, c as F, S as I, T as G, C as Y, b as O, B as U, v as R } from "./index-D2fsOZUo.js";
2
- import { g as ts, h as es, e as ss, M as ns, P as os, R as cs, d as ls, f as is } from "./index-D2fsOZUo.js";
3
- import j from "react";
4
- const W = "_wrapper_1g82c_2", X = "_alignmentBlock_1g82c_8", Z = "_title_1g82c_15", tt = "_subtitle_1g82c_22", et = "_alignmentContent_1g82c_29", st = "_alignments_1g82c_35", nt = "_alignment_1g82c_8", ot = "_circle_1g82c_54", ct = "_paddings_1g82c_61", lt = "_padding_1g82c_61", it = "_input_1g82c_79", v = {
5
- wrapper: W,
6
- alignmentBlock: X,
7
- title: Z,
8
- subtitle: tt,
9
- alignmentContent: et,
10
- alignments: st,
11
- alignment: nt,
12
- circle: ot,
13
- paddings: ct,
14
- padding: lt,
15
- input: it
16
- }, at = [
1
+ import { j as t, I as g, a as I, c as U, S as P, T as q, C as J, b as D, D as et, H as st, B as K, v as E, u as nt, d as ot } from "./index-C6aV8YdJ.js";
2
+ import { h as rs, i as ds, f as us, M as _s, P as ps, R as ms, e as hs, g as gs } from "./index-C6aV8YdJ.js";
3
+ import v from "react";
4
+ const ct = "_wrapper_1g82c_2", lt = "_alignmentBlock_1g82c_8", it = "_title_1g82c_15", at = "_subtitle_1g82c_22", rt = "_alignmentContent_1g82c_29", dt = "_alignments_1g82c_35", ut = "_alignment_1g82c_8", _t = "_circle_1g82c_54", pt = "_paddings_1g82c_61", mt = "_padding_1g82c_61", ht = "_input_1g82c_79", $ = {
5
+ wrapper: ct,
6
+ alignmentBlock: lt,
7
+ title: it,
8
+ subtitle: at,
9
+ alignmentContent: rt,
10
+ alignments: dt,
11
+ alignment: ut,
12
+ circle: _t,
13
+ paddings: pt,
14
+ padding: mt,
15
+ input: ht
16
+ }, gt = [
17
17
  "topLeft",
18
18
  "top",
19
19
  "topRight",
@@ -23,8 +23,8 @@ const W = "_wrapper_1g82c_2", X = "_alignmentBlock_1g82c_8", Z = "_title_1g82c_1
23
23
  "bottomLeft",
24
24
  "bottom",
25
25
  "bottomRight"
26
- ], rt = ["left", "top", "right", "bottom"], Ve = (d) => {
27
- const { alignment: s, padding: o, setPadding: n, setAlignment: l } = d;
26
+ ], xt = ["left", "top", "right", "bottom"], cs = (d) => {
27
+ const { alignment: s, padding: o, setPadding: c, setAlignment: l } = d;
28
28
  function e() {
29
29
  switch (s) {
30
30
  case "left":
@@ -43,22 +43,22 @@ const W = "_wrapper_1g82c_2", X = "_alignmentBlock_1g82c_8", Z = "_title_1g82c_1
43
43
  return "center";
44
44
  }
45
45
  }
46
- return /* @__PURE__ */ t.jsxs("div", { className: v.layout, children: [
47
- /* @__PURE__ */ t.jsx("h3", { className: v.title, children: "Layout" }),
48
- /* @__PURE__ */ t.jsxs("div", { className: v.alignmentBlock, children: [
49
- /* @__PURE__ */ t.jsx("h5", { className: v.subtitle, children: "Alignment" }),
50
- /* @__PURE__ */ t.jsxs("div", { className: v.alignmentContent, children: [
51
- /* @__PURE__ */ t.jsx("div", { className: v.alignments, children: at.map((c) => /* @__PURE__ */ t.jsxs(
46
+ return /* @__PURE__ */ t.jsxs("div", { className: $.layout, children: [
47
+ /* @__PURE__ */ t.jsx("h3", { className: $.title, children: "Layout" }),
48
+ /* @__PURE__ */ t.jsxs("div", { className: $.alignmentBlock, children: [
49
+ /* @__PURE__ */ t.jsx("h5", { className: $.subtitle, children: "Alignment" }),
50
+ /* @__PURE__ */ t.jsxs("div", { className: $.alignmentContent, children: [
51
+ /* @__PURE__ */ t.jsx("div", { className: $.alignments, children: gt.map((n) => /* @__PURE__ */ t.jsxs(
52
52
  "div",
53
53
  {
54
54
  onClick: () => {
55
- l(c);
55
+ l(n);
56
56
  },
57
- className: v.alignment,
57
+ className: $.alignment,
58
58
  children: [
59
- c !== s && /* @__PURE__ */ t.jsx("div", { className: v.circle }),
60
- c === s && /* @__PURE__ */ t.jsx(
61
- m,
59
+ n !== s && /* @__PURE__ */ t.jsx("div", { className: $.circle }),
60
+ n === s && /* @__PURE__ */ t.jsx(
61
+ g,
62
62
  {
63
63
  name: `text-align-${e()}`,
64
64
  fill: "#FF3F19",
@@ -68,25 +68,25 @@ const W = "_wrapper_1g82c_2", X = "_alignmentBlock_1g82c_8", Z = "_title_1g82c_1
68
68
  )
69
69
  ]
70
70
  },
71
- c
71
+ n
72
72
  )) }),
73
- /* @__PURE__ */ t.jsx("div", { className: v.paddings, children: rt.map((c) => /* @__PURE__ */ t.jsxs("label", { className: v.padding, children: [
73
+ /* @__PURE__ */ t.jsx("div", { className: $.paddings, children: xt.map((n) => /* @__PURE__ */ t.jsxs("label", { className: $.padding, children: [
74
74
  /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
75
- m,
75
+ g,
76
76
  {
77
- name: `align-${c}`,
77
+ name: `align-${n}`,
78
78
  width: 20,
79
79
  height: 20
80
80
  }
81
81
  ) }),
82
82
  /* @__PURE__ */ t.jsx(
83
- T,
83
+ I,
84
84
  {
85
85
  type: "text",
86
- value: String(o[c]),
87
- onChange: (a) => n({
86
+ value: String(o[n]),
87
+ onChange: (i) => c({
88
88
  ...o,
89
- [c]: Number(a)
89
+ [n]: Number(i)
90
90
  }),
91
91
  paddingless: !0,
92
92
  borderless: !0
@@ -96,116 +96,123 @@ const W = "_wrapper_1g82c_2", X = "_alignmentBlock_1g82c_8", Z = "_title_1g82c_1
96
96
  ] })
97
97
  ] })
98
98
  ] });
99
- }, dt = "_subtitle_2zbxx_1", ut = "_header_2zbxx_8", _t = "_text_2zbxx_9", pt = "_top_2zbxx_16", mt = "_itemsBlock_2zbxx_23", S = {
100
- subtitle: dt,
101
- header: ut,
102
- text: _t,
103
- top: pt,
104
- itemsBlock: mt
105
- }, ht = "_typeTexts_3zlec_1", gt = "_block_3zlec_7", bt = "_active_3zlec_18", E = {
106
- typeTexts: ht,
107
- block: gt,
108
- active: bt
109
- }, xt = ["bold", "italic", "underline", "strike-through", "code"], q = (d) => {
110
- const { typeText: s, setTypeText: o } = d;
111
- return /* @__PURE__ */ t.jsx("div", { className: E.typeTexts, children: xt.map((n) => /* @__PURE__ */ t.jsx(
99
+ }, bt = "_subtitle_2zbxx_1", ft = "_header_2zbxx_8", vt = "_text_2zbxx_9", jt = "_top_2zbxx_16", kt = "_itemsBlock_2zbxx_23", O = {
100
+ subtitle: bt,
101
+ header: ft,
102
+ text: vt,
103
+ top: jt,
104
+ itemsBlock: kt
105
+ }, yt = "_typeTexts_3zlec_1", $t = "_block_3zlec_7", wt = "_active_3zlec_18", H = {
106
+ typeTexts: yt,
107
+ block: $t,
108
+ active: wt
109
+ }, Bt = ["bold", "italic", "underline", "strike-through", "code"], Q = (d) => {
110
+ const { typesText: s, setTypesText: o } = d;
111
+ return /* @__PURE__ */ t.jsx("div", { className: H.typeTexts, children: Bt.map((c) => /* @__PURE__ */ t.jsx(
112
112
  "div",
113
113
  {
114
- className: F(E.block, {
115
- [E.active]: s === n
114
+ className: U(H.block, {
115
+ [H.active]: s.includes(c)
116
116
  }),
117
- onClick: () => o(n),
117
+ onClick: () => {
118
+ const l = [...s];
119
+ if (l.includes(c)) {
120
+ const e = l.filter((n) => n !== c);
121
+ o(e);
122
+ } else
123
+ l.push(c), o(l);
124
+ },
118
125
  children: /* @__PURE__ */ t.jsx(
119
- m,
126
+ g,
120
127
  {
121
- name: `text-${n}`,
122
- fill: s === n ? "#252525" : "#757575",
128
+ name: `text-${c}`,
129
+ fill: s.includes(c) ? "#252525" : "#757575",
123
130
  width: 20,
124
131
  height: 20
125
132
  }
126
133
  )
127
134
  },
128
- String(n)
135
+ String(c)
129
136
  )) });
130
- }, ft = (d) => {
137
+ }, Nt = (d) => {
131
138
  const {
132
- typeText: s,
139
+ typesText: s,
133
140
  isActiveText: o,
134
- setIsActiveText: n,
141
+ setIsActiveText: c,
135
142
  text: l,
136
143
  setText: e,
137
- setTypeText: c,
138
- title: a,
139
- subtitle: r = "Items"
144
+ setTypesText: n,
145
+ title: i,
146
+ subtitle: h = "Items"
140
147
  } = d;
141
- return /* @__PURE__ */ t.jsxs("div", { className: S.text, children: [
142
- (a || o) && /* @__PURE__ */ t.jsxs("div", { className: S.top, children: [
143
- a && /* @__PURE__ */ t.jsx("h3", { className: S.title, children: a }),
144
- o && n && /* @__PURE__ */ t.jsx(
145
- I,
148
+ return /* @__PURE__ */ t.jsxs("div", { className: O.text, children: [
149
+ (i || o) && /* @__PURE__ */ t.jsxs("div", { className: O.top, children: [
150
+ i && /* @__PURE__ */ t.jsx("h3", { className: O.title, children: i }),
151
+ o && c && /* @__PURE__ */ t.jsx(
152
+ P,
146
153
  {
147
154
  current: o,
148
- onChange: (u) => n(u)
155
+ onChange: (j) => c(j)
149
156
  }
150
157
  )
151
158
  ] }),
152
- /* @__PURE__ */ t.jsxs("div", { className: S.itemsBlock, children: [
153
- /* @__PURE__ */ t.jsx("h5", { className: S.subtitle, children: r }),
159
+ /* @__PURE__ */ t.jsxs("div", { className: O.itemsBlock, children: [
160
+ /* @__PURE__ */ t.jsx("h5", { className: O.subtitle, children: h }),
154
161
  /* @__PURE__ */ t.jsx(
155
- G,
162
+ q,
156
163
  {
157
- onChange: (u) => e(u),
164
+ onChange: (j) => e(j),
158
165
  value: l,
159
166
  maxLength: 150
160
167
  }
161
168
  ),
162
169
  /* @__PURE__ */ t.jsx(
163
- q,
170
+ Q,
164
171
  {
165
- typeText: s,
166
- setTypeText: c
172
+ typesText: s,
173
+ setTypesText: n
167
174
  }
168
175
  )
169
176
  ] })
170
177
  ] });
171
- }, jt = "_subtitle_14b87_1", vt = "_header_14b87_8", kt = "_text_14b87_9", yt = "_productsBlock_14b87_10", $t = "_top_14b87_22", wt = "_itemsBlock_14b87_29", Nt = "_typeTexts_14b87_35", Bt = "_block_14b87_41", Ct = "_active_14b87_52", Tt = "_products_14b87_10", It = "_product_14b87_10", Pt = "_button_14b87_70", St = "_image_14b87_80", At = "_info_14b87_87", Ot = "_name_14b87_98", Lt = "_buttons_14b87_102", Rt = "_modal_14b87_108", zt = "_link_14b87_125", Et = "_modalOptions_14b87_131", b = {
172
- subtitle: jt,
173
- header: vt,
174
- text: kt,
175
- productsBlock: yt,
176
- top: $t,
177
- itemsBlock: wt,
178
- typeTexts: Nt,
179
- block: Bt,
180
- active: Ct,
181
- products: Tt,
182
- product: It,
183
- button: Pt,
184
- image: St,
185
- info: At,
186
- name: Ot,
187
- buttons: Lt,
188
- modal: Rt,
189
- link: zt,
190
- modalOptions: Et
191
- }, Dt = (d) => {
192
- const { activeItem: s, setActiveItem: o, popupPosition: n, modalOptions: l } = d;
193
- return console.log(s, l), /* @__PURE__ */ t.jsxs(
178
+ }, Ct = "_subtitle_1nl8x_1", Tt = "_header_1nl8x_8", It = "_text_1nl8x_9", Pt = "_productsBlock_1nl8x_10", St = "_top_1nl8x_22", At = "_itemsBlock_1nl8x_29", Ot = "_typeTexts_1nl8x_35", Lt = "_block_1nl8x_41", Dt = "_active_1nl8x_52", Rt = "_products_1nl8x_10", Et = "_product_1nl8x_10", zt = "_button_1nl8x_70", Ht = "_image_1nl8x_80", Mt = "_info_1nl8x_87", Ft = "_name_1nl8x_98", Gt = "_buttons_1nl8x_102", Yt = "_modal_1nl8x_108", Ut = "_link_1nl8x_126", qt = "_modalOptions_1nl8x_132", f = {
179
+ subtitle: Ct,
180
+ header: Tt,
181
+ text: It,
182
+ productsBlock: Pt,
183
+ top: St,
184
+ itemsBlock: At,
185
+ typeTexts: Ot,
186
+ block: Lt,
187
+ active: Dt,
188
+ products: Rt,
189
+ product: Et,
190
+ button: zt,
191
+ image: Ht,
192
+ info: Mt,
193
+ name: Ft,
194
+ buttons: Gt,
195
+ modal: Yt,
196
+ link: Ut,
197
+ modalOptions: qt
198
+ }, Jt = (d) => {
199
+ const { activeItem: s, setActiveItem: o, popupPosition: c, modalOptions: l } = d;
200
+ return /* @__PURE__ */ t.jsxs(
194
201
  "div",
195
202
  {
196
- className: b.modal,
203
+ className: f.modal,
197
204
  onClick: (e) => {
198
205
  e.stopPropagation();
199
206
  },
200
207
  style: {
201
- top: `${n.top}px`,
202
- left: `${n.left}px`
208
+ top: `${c.top}px`,
209
+ left: `${c.left}px`
203
210
  },
204
211
  children: [
205
- /* @__PURE__ */ t.jsxs("div", { className: b.top, children: [
212
+ /* @__PURE__ */ t.jsxs("div", { className: f.top, children: [
206
213
  /* @__PURE__ */ t.jsx("h3", { children: s.name }),
207
214
  /* @__PURE__ */ t.jsx(
208
- m,
215
+ g,
209
216
  {
210
217
  name: "x",
211
218
  height: 20,
@@ -215,54 +222,54 @@ const W = "_wrapper_1g82c_2", X = "_alignmentBlock_1g82c_8", Z = "_title_1g82c_1
215
222
  }
216
223
  )
217
224
  ] }),
218
- /* @__PURE__ */ t.jsx("div", { className: b.modalOptions, children: l.map((e) => {
225
+ /* @__PURE__ */ t.jsx("div", { className: f.modalOptions, children: l.map((e) => {
219
226
  if (e.type === "image")
220
227
  return /* @__PURE__ */ t.jsx(
221
- Y,
228
+ J,
222
229
  {
223
230
  label: "Put up an attractive image",
224
- onChange: (c) => {
225
- const a = {
231
+ onChange: (n) => {
232
+ const i = {
226
233
  ...s,
227
- [e.field]: c[0]
234
+ [e.field]: n[0]
228
235
  };
229
- o(a);
236
+ o(i);
230
237
  }
231
238
  }
232
239
  );
233
240
  if (e.type === "text")
234
241
  return /* @__PURE__ */ t.jsx(
235
- ft,
242
+ Nt,
236
243
  {
237
- typeText: s[e.field.type] || "bold",
238
- setTypeText: (c) => {
239
- const a = {
244
+ typesText: s[e.field.type],
245
+ setTypesText: (n) => {
246
+ const i = {
240
247
  ...s,
241
- [e.field.type]: c
248
+ [e.field.type]: n
242
249
  };
243
- o(a);
250
+ o(i);
244
251
  },
245
252
  text: s[e.field.text] || "",
246
- setText: (c) => {
247
- const a = {
253
+ setText: (n) => {
254
+ const i = {
248
255
  ...s,
249
- [e.field.text]: c
256
+ [e.field.text]: n
250
257
  };
251
- o(a);
258
+ o(i);
252
259
  },
253
260
  subtitle: e.label
254
261
  }
255
262
  );
256
263
  if (e.type === "input")
257
264
  return /* @__PURE__ */ t.jsx(
258
- T,
265
+ I,
259
266
  {
260
- onChange: (c) => {
261
- const a = {
267
+ onChange: (n) => {
268
+ const i = {
262
269
  ...s,
263
- [e.field]: c
270
+ [e.field]: n
264
271
  };
265
- o(a);
272
+ o(i);
266
273
  },
267
274
  value: s[e.field] || "",
268
275
  label: e.label,
@@ -270,16 +277,16 @@ const W = "_wrapper_1g82c_2", X = "_alignmentBlock_1g82c_8", Z = "_title_1g82c_1
270
277
  }
271
278
  );
272
279
  if (e.type === "inputSwitch")
273
- return /* @__PURE__ */ t.jsxs("div", { className: b.link, children: [
280
+ return /* @__PURE__ */ t.jsxs("div", { className: f.link, children: [
274
281
  /* @__PURE__ */ t.jsx(
275
- T,
282
+ I,
276
283
  {
277
- onChange: (c) => {
278
- const a = {
284
+ onChange: (n) => {
285
+ const i = {
279
286
  ...s,
280
- [e.field.text]: c
287
+ [e.field.text]: n
281
288
  };
282
- o(a);
289
+ o(i);
283
290
  },
284
291
  value: s[e.field.text] || "",
285
292
  label: e.inputLabel,
@@ -287,24 +294,31 @@ const W = "_wrapper_1g82c_2", X = "_alignmentBlock_1g82c_8", Z = "_title_1g82c_1
287
294
  }
288
295
  ),
289
296
  /* @__PURE__ */ t.jsx(
290
- I,
297
+ P,
291
298
  {
292
299
  current: !!s[e.field.switch] || !1,
293
- label: e.switchLabel
300
+ label: e.switchLabel,
301
+ onChange: (n) => {
302
+ const i = {
303
+ ...s,
304
+ [e.field.switch]: n
305
+ };
306
+ o(i);
307
+ }
294
308
  }
295
309
  )
296
310
  ] });
297
311
  if (e.type === "list")
298
312
  return /* @__PURE__ */ t.jsx(
299
- Yt,
313
+ Zt,
300
314
  {
301
315
  items: s[e.field] || [],
302
- setItems: (c) => {
303
- const a = {
316
+ setItems: (n) => {
317
+ const i = {
304
318
  ...s,
305
- [e.field]: c
319
+ [e.field]: n
306
320
  };
307
- o(a);
321
+ o(i);
308
322
  },
309
323
  itemsType: "select",
310
324
  draggable: e.draggable || !1,
@@ -316,15 +330,15 @@ const W = "_wrapper_1g82c_2", X = "_alignmentBlock_1g82c_8", Z = "_title_1g82c_1
316
330
  );
317
331
  if (e.type === "select")
318
332
  return /* @__PURE__ */ t.jsx(
319
- O,
333
+ D,
320
334
  {
321
335
  options: e.itemsOptions,
322
- onChange: (c) => {
323
- const a = {
336
+ onChange: (n) => {
337
+ const i = {
324
338
  ...s,
325
- [e.field]: c
339
+ [e.field]: n
326
340
  };
327
- o(a);
341
+ o(i);
328
342
  },
329
343
  label: e.label,
330
344
  value: s[e.field] || "String"
@@ -334,83 +348,108 @@ const W = "_wrapper_1g82c_2", X = "_alignmentBlock_1g82c_8", Z = "_title_1g82c_1
334
348
  ]
335
349
  }
336
350
  );
337
- }, Ht = "_other_1wtgi_1", Mt = "_subtitle_1wtgi_7", Ft = "_items_1wtgi_14", D = {
338
- other: Ht,
339
- subtitle: Mt,
340
- items: Ft
341
- }, Gt = (d) => {
351
+ }, Kt = "_other_1wtgi_1", Qt = "_subtitle_1wtgi_7", Vt = "_items_1wtgi_14", M = {
352
+ other: Kt,
353
+ subtitle: Qt,
354
+ items: Vt
355
+ }, Wt = (d) => {
342
356
  const { items: s, title: o = "Other" } = d;
343
- return /* @__PURE__ */ t.jsxs("div", { className: D.other, children: [
344
- /* @__PURE__ */ t.jsx("h5", { className: D.subtitle, children: o }),
345
- /* @__PURE__ */ t.jsx("div", { className: D.items, children: s.map((n) => /* @__PURE__ */ t.jsx(
346
- I,
357
+ return /* @__PURE__ */ t.jsxs("div", { className: M.other, children: [
358
+ /* @__PURE__ */ t.jsx("h5", { className: M.subtitle, children: o }),
359
+ /* @__PURE__ */ t.jsx("div", { className: M.items, children: s.map((c) => /* @__PURE__ */ t.jsx(
360
+ P,
347
361
  {
348
- current: n.isItem,
349
- onChange: (l) => n.setIsItem(l),
350
- label: n.label,
362
+ current: c.isItem,
363
+ onChange: (l) => c.setIsItem(l),
364
+ label: c.label,
351
365
  hasBackground: !0,
352
366
  paddingless: !1
353
367
  }
354
368
  )) })
355
369
  ] });
356
- }, Yt = (d) => {
370
+ }, Xt = (d) => {
371
+ const { index: s, moveProduct: o, children: c } = d, [, l] = nt({
372
+ accept: "product",
373
+ hover(i) {
374
+ i.index !== s && (o(i.index, s), i.index = s);
375
+ }
376
+ }), [{ isDragging: e }, n] = ot({
377
+ type: "product",
378
+ item: { index: s },
379
+ collect: (i) => ({
380
+ isDragging: i.isDragging()
381
+ })
382
+ });
383
+ return /* @__PURE__ */ t.jsx(
384
+ "div",
385
+ {
386
+ ref: (i) => n(l(i)),
387
+ className: `${f.product} ${e ? f.dragging : ""}`,
388
+ children: c
389
+ }
390
+ );
391
+ }, Zt = (d) => {
357
392
  const {
358
393
  isActiveItems: s,
359
394
  setIsActiveItems: o,
360
- items: n,
395
+ items: c,
361
396
  setItems: l,
362
397
  other: e,
363
- title: c,
364
- subtitle: a,
365
- editable: r = !0,
366
- draggable: u = !1,
367
- withImage: p = !1,
368
- deletable: y = !0,
369
- addable: k = !0,
370
- itemsType: x,
371
- itemsPlaceholder: $ = "",
372
- itemsOptions: g,
373
- hasRangeSelector: L = !1,
374
- rangeSelectorOptions: H,
375
- modalOptions: M
376
- } = d, [B, P] = j.useState(null), [J, K] = j.useState({
398
+ title: n,
399
+ subtitle: i,
400
+ editable: h = !0,
401
+ draggable: j = !1,
402
+ withImage: r = !1,
403
+ deletable: p = !0,
404
+ addable: u = !0,
405
+ itemsType: k,
406
+ itemsPlaceholder: x = "",
407
+ itemsOptions: _,
408
+ hasRangeSelector: R = !1,
409
+ rangeSelectorOptions: F,
410
+ modalOptions: G,
411
+ addableOptions: z = {}
412
+ } = d, [C, S] = v.useState(null), [V, W] = v.useState({
377
413
  top: 0,
378
414
  left: 0
379
- });
380
- j.useEffect(() => {
381
- const i = () => {
382
- P(null);
415
+ }), X = (a, y) => {
416
+ const w = [...c], [b] = w.splice(a, 1);
417
+ w.splice(y, 0, b), l(w);
418
+ };
419
+ v.useEffect(() => {
420
+ const a = () => {
421
+ S(null);
383
422
  };
384
- return document.body.addEventListener("click", i), P(null), () => {
385
- P(null), document.body.removeEventListener("click", i);
423
+ return document.body.addEventListener("click", a), S(null), () => {
424
+ S(null), document.body.removeEventListener("click", a);
386
425
  };
387
- }, []), j.useEffect(() => {
388
- if (B) {
389
- const i = [...n].map((h) => h.id === B.id ? B : h);
390
- l(i);
426
+ }, []), v.useEffect(() => {
427
+ if (C) {
428
+ const a = [...c].map((y) => y.id === C.id ? C : y);
429
+ l(a);
391
430
  }
392
- }, [B]), console.log(n);
393
- const Q = (i, h) => {
394
- i.stopPropagation();
395
- const N = i.target.getBoundingClientRect(), w = 100, f = window.innerHeight;
396
- let z = N.top + window.scrollY;
397
- z + w > f && (z = f - w - 20), K({
398
- top: z - 80,
399
- left: N.left - 30
400
- }), P(h);
431
+ }, [C]);
432
+ const Z = (a, y) => {
433
+ a.stopPropagation();
434
+ const w = a.target.getBoundingClientRect(), b = 100, A = window.innerHeight;
435
+ let B = w.top + window.scrollY;
436
+ B + b > A && (B = A - b - 20), W({
437
+ top: B - 80,
438
+ left: w.left - 30
439
+ }), S(y);
401
440
  };
402
- function V(i) {
403
- if (p)
404
- return i ? /* @__PURE__ */ t.jsx(
441
+ function tt(a) {
442
+ if (r)
443
+ return a ? /* @__PURE__ */ t.jsx(
405
444
  "img",
406
445
  {
407
- src: `https://imagedelivery.net/${i}/w=1000`,
446
+ src: `https://imagedelivery.net/${a}/w=1000`,
408
447
  alt: "image",
409
448
  width: 16,
410
449
  height: 16
411
450
  }
412
451
  ) : /* @__PURE__ */ t.jsx(
413
- m,
452
+ g,
414
453
  {
415
454
  name: "image",
416
455
  width: 16,
@@ -419,138 +458,149 @@ const W = "_wrapper_1g82c_2", X = "_alignmentBlock_1g82c_8", Z = "_title_1g82c_1
419
458
  }
420
459
  );
421
460
  }
422
- return /* @__PURE__ */ t.jsxs("div", { className: b.productsBlock, children: [
423
- (c || s) && /* @__PURE__ */ t.jsxs("div", { className: b.top, children: [
424
- c && /* @__PURE__ */ t.jsx("h3", { className: b.title, children: c }),
425
- s && /* @__PURE__ */ t.jsx(
461
+ const Y = (a, y) => {
462
+ const w = /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
463
+ j && /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
464
+ g,
465
+ {
466
+ name: "drag",
467
+ hoverable: !0,
468
+ width: 20,
469
+ height: 20
470
+ }
471
+ ) }),
472
+ k === "select" && /* @__PURE__ */ t.jsx(
473
+ D,
474
+ {
475
+ onChange: (b) => {
476
+ const B = [...c].map((N) => N.id === a.id ? {
477
+ ...a,
478
+ name: b
479
+ } : N);
480
+ l(B);
481
+ },
482
+ value: a.name,
483
+ options: _,
484
+ leftAddon: tt(a.image)
485
+ }
486
+ ),
487
+ k === "input" && /* @__PURE__ */ t.jsx(
426
488
  I,
489
+ {
490
+ onChange: (b) => {
491
+ const B = [...c].map((N) => N.id === a.id ? {
492
+ ...a,
493
+ name: b
494
+ } : N);
495
+ l(B);
496
+ },
497
+ value: a.name,
498
+ placeholder: x
499
+ }
500
+ ),
501
+ k === "image" && /* @__PURE__ */ t.jsx(
502
+ J,
503
+ {
504
+ onChange: (b) => {
505
+ const B = [...c].map((N) => N.id === a.id ? {
506
+ ...a,
507
+ image: b[0]
508
+ } : N);
509
+ l(B);
510
+ }
511
+ }
512
+ ),
513
+ /* @__PURE__ */ t.jsxs("div", { className: f.buttons, children: [
514
+ h && /* @__PURE__ */ t.jsx(
515
+ g,
516
+ {
517
+ name: "sliders",
518
+ hoverable: !0,
519
+ width: 20,
520
+ height: 20,
521
+ onClick: (b) => Z(b, a)
522
+ }
523
+ ),
524
+ p && /* @__PURE__ */ t.jsx(
525
+ g,
526
+ {
527
+ name: "trash",
528
+ hoverable: !0,
529
+ width: 20,
530
+ height: 20,
531
+ fill: "#C12A2A",
532
+ onClick: () => l(c.filter((b) => b.id !== a.id))
533
+ }
534
+ )
535
+ ] })
536
+ ] });
537
+ return j ? /* @__PURE__ */ t.jsx(
538
+ Xt,
539
+ {
540
+ product: a,
541
+ index: y,
542
+ moveProduct: X,
543
+ children: w
544
+ },
545
+ a.id
546
+ ) : /* @__PURE__ */ t.jsx(
547
+ "div",
548
+ {
549
+ className: f.product,
550
+ children: w
551
+ },
552
+ a.id
553
+ );
554
+ };
555
+ return /* @__PURE__ */ t.jsxs("div", { className: f.productsBlock, children: [
556
+ (n || s !== void 0) && /* @__PURE__ */ t.jsxs("div", { className: f.top, children: [
557
+ n && /* @__PURE__ */ t.jsx("h3", { className: f.title, children: n }),
558
+ s !== void 0 && /* @__PURE__ */ t.jsx(
559
+ P,
427
560
  {
428
561
  current: s,
429
- onChange: (i) => o == null ? void 0 : o(i)
562
+ onChange: (a) => o == null ? void 0 : o(a)
430
563
  }
431
564
  )
432
565
  ] }),
433
- B && r && M && /* @__PURE__ */ t.jsx(
434
- Dt,
566
+ C && h && G && /* @__PURE__ */ t.jsx(
567
+ Jt,
435
568
  {
436
- activeItem: B,
437
- setActiveItem: P,
438
- popupPosition: J,
439
- modalOptions: M
569
+ activeItem: C,
570
+ setActiveItem: S,
571
+ popupPosition: V,
572
+ modalOptions: G
440
573
  }
441
574
  ),
442
- L && H && /* @__PURE__ */ t.jsx(Je, { ...H }),
443
- /* @__PURE__ */ t.jsxs("div", { className: b.products, children: [
444
- a && /* @__PURE__ */ t.jsx("h5", { className: b.subtitle, children: a }),
445
- n.map((i) => /* @__PURE__ */ t.jsxs(
446
- "div",
447
- {
448
- className: b.product,
449
- children: [
450
- u && /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
451
- m,
452
- {
453
- name: "drag",
454
- hoverable: !0,
455
- width: 20,
456
- height: 20
457
- }
458
- ) }),
459
- x === "select" && /* @__PURE__ */ t.jsx(
460
- O,
461
- {
462
- onChange: (h) => {
463
- const w = [...n].map((f) => f.id === i.id ? {
464
- ...i,
465
- name: h
466
- } : f);
467
- l(w);
468
- },
469
- value: i.name,
470
- options: g,
471
- leftAddon: V(i.image)
472
- }
473
- ),
474
- x === "input" && /* @__PURE__ */ t.jsx(
475
- T,
476
- {
477
- onChange: (h) => {
478
- const w = [...n].map((f) => f.id === i.id ? {
479
- ...i,
480
- name: h
481
- } : f);
482
- l(w);
483
- },
484
- value: i.name,
485
- placeholder: $
486
- }
487
- ),
488
- x === "image" && /* @__PURE__ */ t.jsx(
489
- Y,
490
- {
491
- onChange: (h) => {
492
- const w = [...n].map((f) => f.id === i.id ? {
493
- ...i,
494
- image: h[0]
495
- } : f);
496
- l(w);
497
- }
498
- }
499
- ),
500
- /* @__PURE__ */ t.jsxs("div", { className: b.buttons, children: [
501
- r && /* @__PURE__ */ t.jsx(
502
- m,
503
- {
504
- name: "sliders",
505
- hoverable: !0,
506
- width: 20,
507
- height: 20,
508
- onClick: (h) => {
509
- Q(h, i);
510
- }
511
- }
512
- ),
513
- y && /* @__PURE__ */ t.jsx(
514
- m,
515
- {
516
- name: "trash",
517
- hoverable: !0,
518
- onClick: () => {
519
- const h = n.filter((N) => N.id !== i.id);
520
- l(h);
521
- },
522
- width: 20,
523
- height: 20,
524
- fill: "#C12A2A"
525
- }
526
- )
527
- ] })
528
- ]
529
- },
530
- i.id
531
- )),
532
- k && /* @__PURE__ */ t.jsxs(
533
- U,
575
+ R && F && /* @__PURE__ */ t.jsx(ss, { ...F }),
576
+ /* @__PURE__ */ t.jsxs("div", { className: f.products, children: [
577
+ i && /* @__PURE__ */ t.jsx("h5", { className: f.subtitle, children: i }),
578
+ j ? /* @__PURE__ */ t.jsx(et, { backend: st, children: c.map((a, y) => Y(a, y)) }) : c.map((a, y) => Y(a, y)),
579
+ u && /* @__PURE__ */ t.jsxs(
580
+ K,
534
581
  {
535
- className: b.button,
582
+ className: f.button,
536
583
  size: "s",
537
584
  onClick: () => {
538
- const i = [...n];
539
- x === "select" ? i.push({
540
- name: g[0] || `Product ${n.length + 1}`,
541
- id: R()
542
- }) : x === "input" ? i.push({
585
+ const a = [...c];
586
+ k === "select" ? a.push({
587
+ name: _[0] || `Product ${c.length + 1}`,
588
+ id: E(),
589
+ ...z
590
+ }) : k === "input" ? a.push({
543
591
  name: "",
544
- id: R()
545
- }) : i.push({
546
- name: `Image ${n.length + 1}`,
547
- id: R()
548
- }), l(i);
592
+ id: E(),
593
+ ...z
594
+ }) : a.push({
595
+ name: `Image ${c.length + 1}`,
596
+ id: E(),
597
+ ...z
598
+ }), l(a);
549
599
  },
550
600
  children: [
551
601
  /* @__PURE__ */ t.jsx("span", { children: "Add Option" }),
552
602
  /* @__PURE__ */ t.jsx(
553
- m,
603
+ g,
554
604
  {
555
605
  name: "plus",
556
606
  width: 16,
@@ -561,47 +611,57 @@ const W = "_wrapper_1g82c_2", X = "_alignmentBlock_1g82c_8", Z = "_title_1g82c_1
561
611
  }
562
612
  )
563
613
  ] }),
564
- e !== void 0 && /* @__PURE__ */ t.jsx(Gt, { items: e })
614
+ e !== void 0 && /* @__PURE__ */ t.jsx(Wt, { items: e })
565
615
  ] });
566
- }, Ut = "_subtitle_41klp_1", qt = "_header_41klp_8", Jt = "_text_41klp_9", Kt = "_productsBlock_41klp_10", Qt = "_buttonsBlock_41klp_11", Vt = "_top_41klp_21", Wt = "_itemsBlock_41klp_28", Xt = "_typeTexts_41klp_34", Zt = "_block_41klp_40", te = "_active_41klp_51", ee = "_products_41klp_10", se = "_product_41klp_10", ne = "_button_41klp_11", oe = "_image_41klp_79", ce = "_info_41klp_86", le = "_name_41klp_97", ie = "_buttons_41klp_11", ae = "_modal_41klp_107", re = "_other_41klp_124", de = "_options_41klp_130", C = {
567
- subtitle: Ut,
568
- header: qt,
569
- text: Jt,
570
- productsBlock: Kt,
571
- buttonsBlock: Qt,
572
- top: Vt,
573
- itemsBlock: Wt,
574
- typeTexts: Xt,
575
- block: Zt,
576
- active: te,
577
- products: ee,
578
- product: se,
579
- button: ne,
580
- image: oe,
581
- info: ce,
582
- name: le,
583
- buttons: ie,
584
- modal: ae,
585
- other: re,
586
- options: de
587
- }, ue = (d) => {
588
- const { activeButton: s, setActiveButton: o, popupPosition: n } = d, [l, e] = j.useState(s.typeText), [c, a] = j.useState(s.destination), [r, u] = j.useState(s.link || "");
589
- return /* @__PURE__ */ t.jsxs(
616
+ }, te = "_subtitle_41klp_1", ee = "_header_41klp_8", se = "_text_41klp_9", ne = "_productsBlock_41klp_10", oe = "_buttonsBlock_41klp_11", ce = "_top_41klp_21", le = "_itemsBlock_41klp_28", ie = "_typeTexts_41klp_34", ae = "_block_41klp_40", re = "_active_41klp_51", de = "_products_41klp_10", ue = "_product_41klp_10", _e = "_button_41klp_11", pe = "_image_41klp_79", me = "_info_41klp_86", he = "_name_41klp_97", ge = "_buttons_41klp_11", xe = "_modal_41klp_107", be = "_other_41klp_124", fe = "_options_41klp_130", T = {
617
+ subtitle: te,
618
+ header: ee,
619
+ text: se,
620
+ productsBlock: ne,
621
+ buttonsBlock: oe,
622
+ top: ce,
623
+ itemsBlock: le,
624
+ typeTexts: ie,
625
+ block: ae,
626
+ active: re,
627
+ products: de,
628
+ product: ue,
629
+ button: _e,
630
+ image: pe,
631
+ info: me,
632
+ name: he,
633
+ buttons: ge,
634
+ modal: xe,
635
+ other: be,
636
+ options: fe
637
+ }, ve = (d) => {
638
+ const { activeButton: s, setActiveButton: o, popupPosition: c } = d, [l, e] = v.useState(s.typesText), [n, i] = v.useState(s.destination), [h, j] = v.useState(s.link || ""), [r, p] = v.useState(s.text || "");
639
+ return v.useEffect(() => {
640
+ o({
641
+ ...s,
642
+ ...{
643
+ text: r,
644
+ link: h,
645
+ destination: n,
646
+ typesText: l
647
+ }
648
+ });
649
+ }, [l, n, h, r]), /* @__PURE__ */ t.jsxs(
590
650
  "div",
591
651
  {
592
- className: C.modal,
593
- onClick: (p) => {
594
- p.stopPropagation();
652
+ className: T.modal,
653
+ onClick: (u) => {
654
+ u.stopPropagation();
595
655
  },
596
656
  style: {
597
- top: `${n.top}px`,
598
- left: `${n.left}px`
657
+ top: `${c.top}px`,
658
+ left: `${c.left}px`
599
659
  },
600
660
  children: [
601
- /* @__PURE__ */ t.jsxs("div", { className: C.top, children: [
661
+ /* @__PURE__ */ t.jsxs("div", { className: T.top, children: [
602
662
  /* @__PURE__ */ t.jsx("h3", { children: s.type }),
603
663
  /* @__PURE__ */ t.jsx(
604
- m,
664
+ g,
605
665
  {
606
666
  name: "x",
607
667
  height: 20,
@@ -611,18 +671,18 @@ const W = "_wrapper_1g82c_2", X = "_alignmentBlock_1g82c_8", Z = "_title_1g82c_1
611
671
  }
612
672
  )
613
673
  ] }),
614
- /* @__PURE__ */ t.jsxs("div", { className: C.options, children: [
674
+ /* @__PURE__ */ t.jsxs("div", { className: T.options, children: [
615
675
  /* @__PURE__ */ t.jsx(
616
- O,
676
+ D,
617
677
  {
618
678
  label: "Destination",
619
- onChange: (p) => a(p),
679
+ onChange: (u) => i(u),
620
680
  options: ["Go to Page", "Open Link"],
621
- value: c
681
+ value: n
622
682
  }
623
683
  ),
624
- c === "Go to Page" ? /* @__PURE__ */ t.jsx(
625
- O,
684
+ n === "Go to Page" ? /* @__PURE__ */ t.jsx(
685
+ D,
626
686
  {
627
687
  label: "Go to",
628
688
  onChange: () => {
@@ -631,127 +691,131 @@ const W = "_wrapper_1g82c_2", X = "_alignmentBlock_1g82c_8", Z = "_title_1g82c_1
631
691
  value: "Homepage"
632
692
  }
633
693
  ) : /* @__PURE__ */ t.jsx(
634
- T,
694
+ I,
635
695
  {
636
- onChange: (p) => u(p),
637
- value: r,
696
+ onChange: (u) => j(u),
697
+ value: h,
638
698
  placeholder: "https://",
639
699
  label: "Link"
640
700
  }
641
701
  ),
642
702
  /* @__PURE__ */ t.jsx(
643
- I,
703
+ P,
644
704
  {
645
705
  current: !1,
646
706
  label: "Open in new tab"
647
707
  }
648
708
  ),
649
709
  /* @__PURE__ */ t.jsx(
650
- G,
710
+ q,
651
711
  {
652
- onChange: () => {
653
- },
654
- value: "Lorem ipsum dolor sit amet com",
712
+ onChange: (u) => p(u),
713
+ value: r,
655
714
  label: "Text",
656
715
  maxLength: 150
657
716
  }
658
717
  ),
659
718
  /* @__PURE__ */ t.jsx(
660
- q,
719
+ Q,
661
720
  {
662
- typeText: l,
663
- setTypeText: e
721
+ typesText: l,
722
+ setTypesText: e
664
723
  }
665
724
  )
666
725
  ] })
667
726
  ]
668
727
  }
669
728
  );
670
- }, _e = "_subtitle_1y5sw_1", pe = "_header_1y5sw_8", me = "_text_1y5sw_9", he = "_productsBlock_1y5sw_10", ge = "_buttonsBlock_1y5sw_11", be = "_top_1y5sw_22", xe = "_itemsBlock_1y5sw_29", fe = "_typeTexts_1y5sw_35", je = "_block_1y5sw_41", ve = "_active_1y5sw_52", ke = "_products_1y5sw_10", ye = "_product_1y5sw_10", $e = "_button_1y5sw_11", we = "_image_1y5sw_80", Ne = "_info_1y5sw_87", Be = "_name_1y5sw_98", Ce = "_buttons_1y5sw_11", Te = "_modal_1y5sw_108", Ie = "_other_1y5sw_125", Pe = "_options_1y5sw_131", A = {
671
- subtitle: _e,
672
- header: pe,
673
- text: me,
674
- productsBlock: he,
675
- buttonsBlock: ge,
676
- top: be,
677
- itemsBlock: xe,
678
- typeTexts: fe,
679
- block: je,
680
- active: ve,
681
- products: ke,
682
- product: ye,
683
- button: $e,
684
- image: we,
685
- info: Ne,
686
- name: Be,
687
- buttons: Ce,
688
- modal: Te,
689
- other: Ie,
690
- options: Pe
691
- }, Se = (d) => {
692
- const { buttons: s, setButtons: o } = d, [n, l] = j.useState(null), [e, c] = j.useState({
729
+ }, je = "_subtitle_1y5sw_1", ke = "_header_1y5sw_8", ye = "_text_1y5sw_9", $e = "_productsBlock_1y5sw_10", we = "_buttonsBlock_1y5sw_11", Be = "_top_1y5sw_22", Ne = "_itemsBlock_1y5sw_29", Ce = "_typeTexts_1y5sw_35", Te = "_block_1y5sw_41", Ie = "_active_1y5sw_52", Pe = "_products_1y5sw_10", Se = "_product_1y5sw_10", Ae = "_button_1y5sw_11", Oe = "_image_1y5sw_80", Le = "_info_1y5sw_87", De = "_name_1y5sw_98", Re = "_buttons_1y5sw_11", Ee = "_modal_1y5sw_108", ze = "_other_1y5sw_125", He = "_options_1y5sw_131", L = {
730
+ subtitle: je,
731
+ header: ke,
732
+ text: ye,
733
+ productsBlock: $e,
734
+ buttonsBlock: we,
735
+ top: Be,
736
+ itemsBlock: Ne,
737
+ typeTexts: Ce,
738
+ block: Te,
739
+ active: Ie,
740
+ products: Pe,
741
+ product: Se,
742
+ button: Ae,
743
+ image: Oe,
744
+ info: Le,
745
+ name: De,
746
+ buttons: Re,
747
+ modal: Ee,
748
+ other: ze,
749
+ options: He
750
+ }, Me = (d) => {
751
+ const { buttons: s, setButtons: o, deletable: c = !0, addable: l = !0 } = d, [e, n] = v.useState(null), [i, h] = v.useState({
693
752
  top: 0,
694
753
  left: 0
695
754
  });
696
- j.useEffect(() => {
755
+ v.useEffect(() => {
697
756
  const r = () => {
698
- l(null);
757
+ n(null);
699
758
  };
700
- return document.body.addEventListener("click", r), l(null), () => {
701
- l(null), document.body.removeEventListener("click", r);
759
+ return document.body.addEventListener("click", r), n(null), () => {
760
+ n(null), document.body.removeEventListener("click", r);
702
761
  };
703
- }, []);
704
- const a = (r, u) => {
762
+ }, []), v.useEffect(() => {
763
+ if (e) {
764
+ const r = [...s].map((p) => p.id === e.id ? e : p);
765
+ o(r);
766
+ }
767
+ }, [e]), console.log(s);
768
+ const j = (r, p) => {
705
769
  r.stopPropagation();
706
- const p = r.target.getBoundingClientRect(), y = 490, k = window.innerHeight;
707
- let x = p.top + window.scrollY;
708
- x + y > k && (x = k - y - 20), c({
709
- top: x,
710
- left: p.left - 30
711
- }), l(u);
770
+ const u = r.target.getBoundingClientRect(), k = 490, x = window.innerHeight;
771
+ let _ = u.top + window.scrollY;
772
+ _ + k > x && (_ = x - k - 20), h({
773
+ top: _,
774
+ left: u.left - 30
775
+ }), n(p);
712
776
  };
713
- return /* @__PURE__ */ t.jsxs("div", { className: A.products, children: [
714
- /* @__PURE__ */ t.jsx("h5", { className: A.subtitle, children: "Button Type" }),
777
+ return /* @__PURE__ */ t.jsxs("div", { className: L.products, children: [
778
+ /* @__PURE__ */ t.jsx("h5", { className: L.subtitle, children: "Button Type" }),
715
779
  s.map((r) => /* @__PURE__ */ t.jsxs(
716
780
  "div",
717
781
  {
718
- className: A.product,
782
+ className: L.product,
719
783
  children: [
720
784
  /* @__PURE__ */ t.jsx(
721
- O,
785
+ D,
722
786
  {
723
- onChange: (u) => {
724
- const y = [...s].map((k) => k.id === r.id ? {
787
+ onChange: (p) => {
788
+ const k = [...s].map((x) => x.id === r.id ? {
725
789
  ...r,
726
- type: u
727
- } : k);
728
- o(y);
790
+ type: p
791
+ } : x);
792
+ o(k);
729
793
  },
730
794
  value: r.type,
731
795
  options: ["Primary", "Secondary", "Tertiary"]
732
796
  }
733
797
  ),
734
- /* @__PURE__ */ t.jsxs("div", { className: A.buttons, children: [
798
+ /* @__PURE__ */ t.jsxs("div", { className: L.buttons, children: [
735
799
  /* @__PURE__ */ t.jsx(
736
- m,
800
+ g,
737
801
  {
738
802
  name: "sliders",
739
803
  hoverable: !0,
740
804
  width: 20,
741
805
  height: 20,
742
- onClick: (u) => {
743
- a(u, r);
806
+ onClick: (p) => {
807
+ j(p, r);
744
808
  }
745
809
  }
746
810
  ),
747
- /* @__PURE__ */ t.jsx(
748
- m,
811
+ c && /* @__PURE__ */ t.jsx(
812
+ g,
749
813
  {
750
814
  name: "trash",
751
815
  hoverable: !0,
752
816
  onClick: () => {
753
- const u = s.filter((p) => p.id !== r.id);
754
- o(u);
817
+ const p = s.filter((u) => u.id !== r.id);
818
+ o(p);
755
819
  },
756
820
  width: 20,
757
821
  height: 20,
@@ -763,32 +827,33 @@ const W = "_wrapper_1g82c_2", X = "_alignmentBlock_1g82c_8", Z = "_title_1g82c_1
763
827
  },
764
828
  r.id
765
829
  )),
766
- n && /* @__PURE__ */ t.jsx(
767
- ue,
830
+ e && /* @__PURE__ */ t.jsx(
831
+ ve,
768
832
  {
769
- activeButton: n,
770
- setActiveButton: l,
771
- popupPosition: e
833
+ activeButton: e,
834
+ setActiveButton: n,
835
+ popupPosition: i
772
836
  }
773
837
  ),
774
- /* @__PURE__ */ t.jsxs(
775
- U,
838
+ l && /* @__PURE__ */ t.jsxs(
839
+ K,
776
840
  {
777
- className: A.button,
841
+ className: L.button,
778
842
  size: "s",
779
843
  onClick: () => {
780
844
  const r = [...s];
781
845
  r.push({
782
846
  type: "Primary",
783
- id: R(),
784
- typeText: "bold",
785
- destination: "Go to Page"
847
+ id: E(),
848
+ typesText: [],
849
+ destination: "Go to Page",
850
+ text: ""
786
851
  }), o(r);
787
852
  },
788
853
  children: [
789
854
  /* @__PURE__ */ t.jsx("span", { children: "Add Option" }),
790
855
  /* @__PURE__ */ t.jsx(
791
- m,
856
+ g,
792
857
  {
793
858
  name: "plus",
794
859
  width: 16,
@@ -799,13 +864,13 @@ const W = "_wrapper_1g82c_2", X = "_alignmentBlock_1g82c_8", Z = "_title_1g82c_1
799
864
  }
800
865
  )
801
866
  ] });
802
- }, We = (d) => {
803
- const { isActiveButtons: s, setIsActiveButtons: o, buttons: n, setButtons: l } = d;
804
- return /* @__PURE__ */ t.jsx(t.Fragment, { children: /* @__PURE__ */ t.jsxs("div", { className: C.buttonsBlock, children: [
805
- /* @__PURE__ */ t.jsxs("div", { className: C.top, children: [
806
- /* @__PURE__ */ t.jsx("h3", { className: C.title, children: "Buttons" }),
867
+ }, ls = (d) => {
868
+ const { isActiveButtons: s, setIsActiveButtons: o, buttons: c, setButtons: l } = d;
869
+ return /* @__PURE__ */ t.jsx(t.Fragment, { children: /* @__PURE__ */ t.jsxs("div", { className: T.buttonsBlock, children: [
870
+ /* @__PURE__ */ t.jsxs("div", { className: T.top, children: [
871
+ /* @__PURE__ */ t.jsx("h3", { className: T.title, children: "Buttons" }),
807
872
  /* @__PURE__ */ t.jsx(
808
- I,
873
+ P,
809
874
  {
810
875
  current: s,
811
876
  onChange: (e) => o(e)
@@ -813,63 +878,63 @@ const W = "_wrapper_1g82c_2", X = "_alignmentBlock_1g82c_8", Z = "_title_1g82c_1
813
878
  )
814
879
  ] }),
815
880
  /* @__PURE__ */ t.jsx(
816
- Se,
881
+ Me,
817
882
  {
818
- buttons: n,
883
+ buttons: c,
819
884
  setButtons: l
820
885
  }
821
886
  )
822
887
  ] }) });
823
- }, Ae = "_wrapper_tn7gb_1", Oe = "_subtitle_tn7gb_7", Le = "_content_tn7gb_14", Re = "_range_tn7gb_21", ze = "_track_tn7gb_26", Ee = "_progress_tn7gb_35", De = "_dots_tn7gb_45", He = "_dot_tn7gb_45", Me = "_active_tn7gb_62", Fe = "_input_tn7gb_74", Ge = "_countBlock_tn7gb_88", Ye = "_count_tn7gb_88", Ue = "_controls_tn7gb_103", qe = "_button_tn7gb_108", _ = {
824
- wrapper: Ae,
825
- subtitle: Oe,
826
- content: Le,
827
- range: Re,
828
- track: ze,
829
- progress: Ee,
830
- dots: De,
831
- dot: He,
832
- active: Me,
833
- input: Fe,
834
- countBlock: Ge,
835
- count: Ye,
836
- controls: Ue,
837
- button: qe
838
- }, Je = (d) => {
839
- const { label: s, min: o = 1, max: n = 4, step: l = 1, count: e, setCount: c } = d, [a, r] = j.useState(!1), u = Array.from({ length: (n - o) / l + 1 }), p = (e - o) / (n - o) * 100, y = () => {
840
- e < n && c(e + l);
841
- }, k = () => {
842
- e > o && c(e - l);
843
- }, x = ($) => {
844
- const g = o + $ * l;
845
- c(g);
888
+ }, Fe = "_wrapper_tn7gb_1", Ge = "_subtitle_tn7gb_7", Ye = "_content_tn7gb_14", Ue = "_range_tn7gb_21", qe = "_track_tn7gb_26", Je = "_progress_tn7gb_35", Ke = "_dots_tn7gb_45", Qe = "_dot_tn7gb_45", Ve = "_active_tn7gb_62", We = "_input_tn7gb_74", Xe = "_countBlock_tn7gb_88", Ze = "_count_tn7gb_88", ts = "_controls_tn7gb_103", es = "_button_tn7gb_108", m = {
889
+ wrapper: Fe,
890
+ subtitle: Ge,
891
+ content: Ye,
892
+ range: Ue,
893
+ track: qe,
894
+ progress: Je,
895
+ dots: Ke,
896
+ dot: Qe,
897
+ active: Ve,
898
+ input: We,
899
+ countBlock: Xe,
900
+ count: Ze,
901
+ controls: ts,
902
+ button: es
903
+ }, ss = (d) => {
904
+ const { label: s, min: o = 1, max: c = 4, step: l = 1, count: e, setCount: n } = d, [i, h] = v.useState(!1), j = Array.from({ length: (c - o) / l + 1 }), r = (e - o) / (c - o) * 100, p = () => {
905
+ e < c && n(e + l);
906
+ }, u = () => {
907
+ e > o && n(e - l);
908
+ }, k = (x) => {
909
+ const _ = o + x * l;
910
+ n(_);
846
911
  };
847
- return /* @__PURE__ */ t.jsxs("div", { className: _.wrapper, children: [
848
- s && /* @__PURE__ */ t.jsx("h5", { className: _.subtitle, children: s }),
849
- /* @__PURE__ */ t.jsxs("div", { className: _.content, children: [
850
- /* @__PURE__ */ t.jsxs("div", { className: _.range, children: [
851
- /* @__PURE__ */ t.jsx("div", { className: _.track }),
912
+ return /* @__PURE__ */ t.jsxs("div", { className: m.wrapper, children: [
913
+ s && /* @__PURE__ */ t.jsx("h5", { className: m.subtitle, children: s }),
914
+ /* @__PURE__ */ t.jsxs("div", { className: m.content, children: [
915
+ /* @__PURE__ */ t.jsxs("div", { className: m.range, children: [
916
+ /* @__PURE__ */ t.jsx("div", { className: m.track }),
852
917
  /* @__PURE__ */ t.jsx(
853
918
  "div",
854
919
  {
855
- className: _.progress,
856
- style: { width: `${p}%` }
920
+ className: m.progress,
921
+ style: { width: `${r}%` }
857
922
  }
858
923
  ),
859
- /* @__PURE__ */ t.jsx("div", { className: _.dots, children: u.map(($, g) => {
860
- const L = g <= (e - o) / l;
924
+ /* @__PURE__ */ t.jsx("div", { className: m.dots, children: j.map((x, _) => {
925
+ const R = _ <= (e - o) / l;
861
926
  return /* @__PURE__ */ t.jsx(
862
927
  "button",
863
928
  {
864
- onClick: () => x(g),
865
- className: F(_.dot, {
866
- [_.active]: L,
867
- [_.inactive]: !L,
868
- [_.dragging]: a
929
+ onClick: () => k(_),
930
+ className: U(m.dot, {
931
+ [m.active]: R,
932
+ [m.inactive]: !R,
933
+ [m.dragging]: i
869
934
  }),
870
- "aria-label": `Set value to ${o + g * l}`
935
+ "aria-label": `Set value to ${o + _ * l}`
871
936
  },
872
- g
937
+ _
873
938
  );
874
939
  }) }),
875
940
  /* @__PURE__ */ t.jsx(
@@ -877,43 +942,43 @@ const W = "_wrapper_1g82c_2", X = "_alignmentBlock_1g82c_8", Z = "_title_1g82c_1
877
942
  {
878
943
  type: "range",
879
944
  min: o,
880
- max: n,
945
+ max: c,
881
946
  step: l,
882
947
  value: e,
883
- onChange: ($) => c(Number($.target.value)),
884
- onMouseDown: () => r(!0),
885
- onMouseUp: () => r(!1),
886
- onTouchStart: () => r(!0),
887
- onTouchEnd: () => r(!1),
888
- className: _.input
948
+ onChange: (x) => n(Number(x.target.value)),
949
+ onMouseDown: () => h(!0),
950
+ onMouseUp: () => h(!1),
951
+ onTouchStart: () => h(!0),
952
+ onTouchEnd: () => h(!1),
953
+ className: m.input
889
954
  }
890
955
  )
891
956
  ] }),
892
- /* @__PURE__ */ t.jsxs("div", { className: _.countBlock, children: [
957
+ /* @__PURE__ */ t.jsxs("div", { className: m.countBlock, children: [
893
958
  /* @__PURE__ */ t.jsx(
894
- T,
959
+ I,
895
960
  {
896
961
  type: "number",
897
962
  min: o,
898
- max: n,
963
+ max: c,
899
964
  paddingless: !0,
900
- onChange: ($) => {
901
- const g = Number($);
902
- g > n ? c(n) : g < o ? c(o) : c(g);
965
+ onChange: (x) => {
966
+ const _ = Number(x);
967
+ _ > c ? n(c) : _ < o ? n(o) : n(_);
903
968
  },
904
969
  value: String(e)
905
970
  }
906
971
  ),
907
- /* @__PURE__ */ t.jsxs("div", { className: _.controls, children: [
972
+ /* @__PURE__ */ t.jsxs("div", { className: m.controls, children: [
908
973
  /* @__PURE__ */ t.jsx(
909
974
  "button",
910
975
  {
911
- onClick: y,
912
- disabled: e >= n,
913
- className: _.button,
976
+ onClick: p,
977
+ disabled: e >= c,
978
+ className: m.button,
914
979
  "aria-label": "Increment count",
915
980
  children: /* @__PURE__ */ t.jsx(
916
- m,
981
+ g,
917
982
  {
918
983
  name: "arrow-down",
919
984
  width: 15,
@@ -926,12 +991,12 @@ const W = "_wrapper_1g82c_2", X = "_alignmentBlock_1g82c_8", Z = "_title_1g82c_1
926
991
  /* @__PURE__ */ t.jsx(
927
992
  "button",
928
993
  {
929
- onClick: k,
994
+ onClick: u,
930
995
  disabled: e <= o,
931
- className: _.button,
996
+ className: m.button,
932
997
  "aria-label": "Decrement count",
933
998
  children: /* @__PURE__ */ t.jsx(
934
- m,
999
+ g,
935
1000
  {
936
1001
  name: "arrow-down",
937
1002
  width: 15,
@@ -946,26 +1011,26 @@ const W = "_wrapper_1g82c_2", X = "_alignmentBlock_1g82c_8", Z = "_title_1g82c_1
946
1011
  ] });
947
1012
  };
948
1013
  export {
949
- U as Button,
950
- Se as ButtonTypeSettings,
951
- We as ButtonsSettings,
952
- ts as Checkbox,
953
- Y as ChooseImage,
954
- es as ChooseImageModal,
955
- ss as ColorPicker,
956
- m as Icon,
957
- T as Input,
958
- Yt as ItemsSettings,
959
- Ve as LayoutSettings,
960
- ns as Modal,
961
- os as Picker,
962
- cs as Radio,
963
- Je as RangeSelector,
964
- O as Select,
965
- ls as Submodal,
966
- I as Switch,
967
- ft as TextSettings,
968
- G as Textarea,
969
- is as Tip,
970
- q as TypeTexts
1014
+ K as Button,
1015
+ Me as ButtonTypeSettings,
1016
+ ls as ButtonsSettings,
1017
+ rs as Checkbox,
1018
+ J as ChooseImage,
1019
+ ds as ChooseImageModal,
1020
+ us as ColorPicker,
1021
+ g as Icon,
1022
+ I as Input,
1023
+ Zt as ItemsSettings,
1024
+ cs as LayoutSettings,
1025
+ _s as Modal,
1026
+ ps as Picker,
1027
+ ms as Radio,
1028
+ ss as RangeSelector,
1029
+ D as Select,
1030
+ hs as Submodal,
1031
+ P as Switch,
1032
+ Nt as TextSettings,
1033
+ q as Textarea,
1034
+ gs as Tip,
1035
+ Q as TypesText
971
1036
  };