@billgangcom/theme-lib 1.8.0 → 1.8.2

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 x, a as P, c as U, S, 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-BS_tTsUw.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-BS_tTsUw.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: i } = 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
+ i(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
+ x,
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
+ x,
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
+ P,
84
84
  {
85
85
  type: "text",
86
- value: String(o[c]),
87
- onChange: (a) => n({
86
+ value: String(o[n]),
87
+ onChange: (a) => c({
88
88
  ...o,
89
- [c]: Number(a)
89
+ [n]: Number(a)
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 i = [...s];
119
+ if (i.includes(c)) {
120
+ const e = i.filter((n) => n !== c);
121
+ o(e);
122
+ } else
123
+ i.push(c), o(i);
124
+ },
118
125
  children: /* @__PURE__ */ t.jsx(
119
- m,
126
+ x,
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,
135
- text: l,
141
+ setIsActiveText: c,
142
+ text: i,
136
143
  setText: e,
137
- setTypeText: c,
144
+ setTypesText: n,
138
145
  title: a,
139
- subtitle: r = "Items"
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
+ (a || o) && /* @__PURE__ */ t.jsxs("div", { className: O.top, children: [
150
+ a && /* @__PURE__ */ t.jsx("h3", { className: O.title, children: a }),
151
+ o && c && /* @__PURE__ */ t.jsx(
152
+ S,
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),
158
- value: l,
164
+ onChange: (j) => e(j),
165
+ value: i,
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: i } = 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
+ x,
209
216
  {
210
217
  name: "x",
211
218
  height: 20,
@@ -215,16 +222,16 @@ 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: i.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) => {
231
+ onChange: (n) => {
225
232
  const a = {
226
233
  ...s,
227
- [e.field]: c[0]
234
+ [e.field]: n[0]
228
235
  };
229
236
  o(a);
230
237
  }
@@ -232,21 +239,21 @@ const W = "_wrapper_1g82c_2", X = "_alignmentBlock_1g82c_8", Z = "_title_1g82c_1
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) => {
244
+ typesText: s[e.field.type],
245
+ setTypesText: (n) => {
239
246
  const a = {
240
247
  ...s,
241
- [e.field.type]: c
248
+ [e.field.type]: n
242
249
  };
243
250
  o(a);
244
251
  },
245
252
  text: s[e.field.text] || "",
246
- setText: (c) => {
253
+ setText: (n) => {
247
254
  const a = {
248
255
  ...s,
249
- [e.field.text]: c
256
+ [e.field.text]: n
250
257
  };
251
258
  o(a);
252
259
  },
@@ -255,12 +262,12 @@ const W = "_wrapper_1g82c_2", X = "_alignmentBlock_1g82c_8", Z = "_title_1g82c_1
255
262
  );
256
263
  if (e.type === "input")
257
264
  return /* @__PURE__ */ t.jsx(
258
- T,
265
+ P,
259
266
  {
260
- onChange: (c) => {
267
+ onChange: (n) => {
261
268
  const a = {
262
269
  ...s,
263
- [e.field]: c
270
+ [e.field]: n
264
271
  };
265
272
  o(a);
266
273
  },
@@ -270,14 +277,14 @@ 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
+ P,
276
283
  {
277
- onChange: (c) => {
284
+ onChange: (n) => {
278
285
  const a = {
279
286
  ...s,
280
- [e.field.text]: c
287
+ [e.field.text]: n
281
288
  };
282
289
  o(a);
283
290
  },
@@ -287,22 +294,29 @@ 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
+ S,
291
298
  {
292
299
  current: !!s[e.field.switch] || !1,
293
- label: e.switchLabel
300
+ label: e.switchLabel,
301
+ onChange: (n) => {
302
+ const a = {
303
+ ...s,
304
+ [e.field.switch]: n
305
+ };
306
+ o(a);
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) => {
316
+ setItems: (n) => {
303
317
  const a = {
304
318
  ...s,
305
- [e.field]: c
319
+ [e.field]: n
306
320
  };
307
321
  o(a);
308
322
  },
@@ -316,13 +330,13 @@ 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) => {
336
+ onChange: (n) => {
323
337
  const a = {
324
338
  ...s,
325
- [e.field]: c
339
+ [e.field]: n
326
340
  };
327
341
  o(a);
328
342
  },
@@ -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
+ S,
347
361
  {
348
- current: n.isItem,
349
- onChange: (l) => n.setIsItem(l),
350
- label: n.label,
362
+ current: c.isItem,
363
+ onChange: (i) => c.setIsItem(i),
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, [, i] = nt({
372
+ accept: "product",
373
+ hover(a) {
374
+ a.index !== s && (o(a.index, s), a.index = s);
375
+ }
376
+ }), [{ isDragging: e }, n] = ot({
377
+ type: "product",
378
+ item: { index: s },
379
+ collect: (a) => ({
380
+ isDragging: a.isDragging()
381
+ })
382
+ });
383
+ return /* @__PURE__ */ t.jsx(
384
+ "div",
385
+ {
386
+ ref: (a) => n(i(a)),
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,
361
- setItems: l,
395
+ items: c,
396
+ setItems: i,
362
397
  other: e,
363
- title: c,
398
+ title: n,
364
399
  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({
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: b = "",
407
+ itemsOptions: _,
408
+ hasRangeSelector: R = !1,
409
+ rangeSelectorOptions: F,
410
+ modalOptions: G,
411
+ addableOptions: z = {}
412
+ } = d, [C, T] = 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 = (l, y) => {
416
+ const w = [...c], [g] = w.splice(l, 1);
417
+ w.splice(y, 0, g), i(w);
418
+ };
419
+ v.useEffect(() => {
420
+ const l = () => {
421
+ T(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", l), T(null), () => {
424
+ T(null), document.body.removeEventListener("click", l);
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 l = [...c].map((y) => y.id === C.id ? C : y);
429
+ i(l);
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 = (l, y) => {
433
+ l.stopPropagation();
434
+ const w = l.target.getBoundingClientRect(), g = 100, A = window.innerHeight;
435
+ let B = w.top + window.scrollY;
436
+ B + g > A && (B = A - g - 20), W({
437
+ top: B - 80,
438
+ left: w.left - 30
439
+ }), T(y);
401
440
  };
402
- function V(i) {
403
- if (p)
404
- return i ? /* @__PURE__ */ t.jsx(
441
+ function tt(l) {
442
+ if (r)
443
+ return l ? /* @__PURE__ */ t.jsx(
405
444
  "img",
406
445
  {
407
- src: `https://imagedelivery.net/${i}/w=1000`,
446
+ src: `https://imagedelivery.net/${l}/w=1000`,
408
447
  alt: "image",
409
448
  width: 16,
410
449
  height: 16
411
450
  }
412
451
  ) : /* @__PURE__ */ t.jsx(
413
- m,
452
+ x,
414
453
  {
415
454
  name: "image",
416
455
  width: 16,
@@ -419,138 +458,152 @@ 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(
426
- I,
461
+ const Y = (l, y) => {
462
+ const w = /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
463
+ j && /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
464
+ x,
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: (g) => {
476
+ const B = [...c].map((N) => N.id === l.id ? {
477
+ ...l,
478
+ name: g
479
+ } : N);
480
+ T({
481
+ ...l,
482
+ name: g
483
+ }), i([...B]);
484
+ },
485
+ value: l.name,
486
+ options: _,
487
+ leftAddon: tt(l.image)
488
+ }
489
+ ),
490
+ k === "input" && /* @__PURE__ */ t.jsx(
491
+ P,
492
+ {
493
+ onChange: (g) => {
494
+ const B = [...c].map((N) => N.id === l.id ? {
495
+ ...l,
496
+ name: g
497
+ } : N);
498
+ i([...B]);
499
+ },
500
+ value: l.name,
501
+ placeholder: b
502
+ }
503
+ ),
504
+ k === "image" && /* @__PURE__ */ t.jsx(
505
+ J,
506
+ {
507
+ onChange: (g) => {
508
+ const B = [...c].map((N) => N.id === l.id ? {
509
+ ...l,
510
+ image: g[0]
511
+ } : N);
512
+ i([...B]);
513
+ }
514
+ }
515
+ ),
516
+ /* @__PURE__ */ t.jsxs("div", { className: f.buttons, children: [
517
+ h && /* @__PURE__ */ t.jsx(
518
+ x,
519
+ {
520
+ name: "sliders",
521
+ hoverable: !0,
522
+ width: 20,
523
+ height: 20,
524
+ onClick: (g) => Z(g, l)
525
+ }
526
+ ),
527
+ p && /* @__PURE__ */ t.jsx(
528
+ x,
529
+ {
530
+ name: "trash",
531
+ hoverable: !0,
532
+ width: 20,
533
+ height: 20,
534
+ fill: "#C12A2A",
535
+ onClick: () => i(c.filter((g) => g.id !== l.id))
536
+ }
537
+ )
538
+ ] })
539
+ ] });
540
+ return j ? /* @__PURE__ */ t.jsx(
541
+ Xt,
542
+ {
543
+ product: l,
544
+ index: y,
545
+ moveProduct: X,
546
+ children: w
547
+ },
548
+ l.id
549
+ ) : /* @__PURE__ */ t.jsx(
550
+ "div",
551
+ {
552
+ className: f.product,
553
+ children: w
554
+ },
555
+ l.id
556
+ );
557
+ };
558
+ return /* @__PURE__ */ t.jsxs("div", { className: f.productsBlock, children: [
559
+ (n || s !== void 0) && /* @__PURE__ */ t.jsxs("div", { className: f.top, children: [
560
+ n && /* @__PURE__ */ t.jsx("h3", { className: f.title, children: n }),
561
+ s !== void 0 && /* @__PURE__ */ t.jsx(
562
+ S,
427
563
  {
428
564
  current: s,
429
- onChange: (i) => o == null ? void 0 : o(i)
565
+ onChange: (l) => o == null ? void 0 : o(l)
430
566
  }
431
567
  )
432
568
  ] }),
433
- B && r && M && /* @__PURE__ */ t.jsx(
434
- Dt,
569
+ C && h && G && /* @__PURE__ */ t.jsx(
570
+ Jt,
435
571
  {
436
- activeItem: B,
437
- setActiveItem: P,
438
- popupPosition: J,
439
- modalOptions: M
572
+ activeItem: C,
573
+ setActiveItem: T,
574
+ popupPosition: V,
575
+ modalOptions: G
440
576
  }
441
577
  ),
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,
578
+ R && F && /* @__PURE__ */ t.jsx(ss, { ...F }),
579
+ /* @__PURE__ */ t.jsxs("div", { className: f.products, children: [
580
+ a && /* @__PURE__ */ t.jsx("h5", { className: f.subtitle, children: a }),
581
+ j ? /* @__PURE__ */ t.jsx(et, { backend: st, children: c.map((l, y) => Y(l, y)) }) : c.map((l, y) => Y(l, y)),
582
+ u && /* @__PURE__ */ t.jsxs(
583
+ K,
534
584
  {
535
- className: b.button,
585
+ className: f.button,
536
586
  size: "s",
537
587
  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({
588
+ const l = [...c];
589
+ k === "select" ? l.push({
590
+ name: _[0] || `Product ${c.length + 1}`,
591
+ id: E(),
592
+ ...z
593
+ }) : k === "input" ? l.push({
543
594
  name: "",
544
- id: R()
545
- }) : i.push({
546
- name: `Image ${n.length + 1}`,
547
- id: R()
548
- }), l(i);
595
+ id: E(),
596
+ ...z
597
+ }) : l.push({
598
+ name: `Image ${c.length + 1}`,
599
+ id: E(),
600
+ ...z
601
+ }), i(l);
549
602
  },
550
603
  children: [
551
604
  /* @__PURE__ */ t.jsx("span", { children: "Add Option" }),
552
605
  /* @__PURE__ */ t.jsx(
553
- m,
606
+ x,
554
607
  {
555
608
  name: "plus",
556
609
  width: 16,
@@ -561,47 +614,57 @@ const W = "_wrapper_1g82c_2", X = "_alignmentBlock_1g82c_8", Z = "_title_1g82c_1
561
614
  }
562
615
  )
563
616
  ] }),
564
- e !== void 0 && /* @__PURE__ */ t.jsx(Gt, { items: e })
617
+ e !== void 0 && /* @__PURE__ */ t.jsx(Wt, { items: e })
565
618
  ] });
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(
619
+ }, 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", I = {
620
+ subtitle: te,
621
+ header: ee,
622
+ text: se,
623
+ productsBlock: ne,
624
+ buttonsBlock: oe,
625
+ top: ce,
626
+ itemsBlock: le,
627
+ typeTexts: ie,
628
+ block: ae,
629
+ active: re,
630
+ products: de,
631
+ product: ue,
632
+ button: _e,
633
+ image: pe,
634
+ info: me,
635
+ name: he,
636
+ buttons: ge,
637
+ modal: xe,
638
+ other: be,
639
+ options: fe
640
+ }, ve = (d) => {
641
+ const { activeButton: s, setActiveButton: o, popupPosition: c } = d, [i, e] = v.useState(s.typesText), [n, a] = v.useState(s.destination), [h, j] = v.useState(s.link || ""), [r, p] = v.useState(s.text || "");
642
+ return v.useEffect(() => {
643
+ o({
644
+ ...s,
645
+ ...{
646
+ text: r,
647
+ link: h,
648
+ destination: n,
649
+ typesText: i
650
+ }
651
+ });
652
+ }, [i, n, h, r]), /* @__PURE__ */ t.jsxs(
590
653
  "div",
591
654
  {
592
- className: C.modal,
593
- onClick: (p) => {
594
- p.stopPropagation();
655
+ className: I.modal,
656
+ onClick: (u) => {
657
+ u.stopPropagation();
595
658
  },
596
659
  style: {
597
- top: `${n.top}px`,
598
- left: `${n.left}px`
660
+ top: `${c.top}px`,
661
+ left: `${c.left}px`
599
662
  },
600
663
  children: [
601
- /* @__PURE__ */ t.jsxs("div", { className: C.top, children: [
664
+ /* @__PURE__ */ t.jsxs("div", { className: I.top, children: [
602
665
  /* @__PURE__ */ t.jsx("h3", { children: s.type }),
603
666
  /* @__PURE__ */ t.jsx(
604
- m,
667
+ x,
605
668
  {
606
669
  name: "x",
607
670
  height: 20,
@@ -611,18 +674,18 @@ const W = "_wrapper_1g82c_2", X = "_alignmentBlock_1g82c_8", Z = "_title_1g82c_1
611
674
  }
612
675
  )
613
676
  ] }),
614
- /* @__PURE__ */ t.jsxs("div", { className: C.options, children: [
677
+ /* @__PURE__ */ t.jsxs("div", { className: I.options, children: [
615
678
  /* @__PURE__ */ t.jsx(
616
- O,
679
+ D,
617
680
  {
618
681
  label: "Destination",
619
- onChange: (p) => a(p),
682
+ onChange: (u) => a(u),
620
683
  options: ["Go to Page", "Open Link"],
621
- value: c
684
+ value: n
622
685
  }
623
686
  ),
624
- c === "Go to Page" ? /* @__PURE__ */ t.jsx(
625
- O,
687
+ n === "Go to Page" ? /* @__PURE__ */ t.jsx(
688
+ D,
626
689
  {
627
690
  label: "Go to",
628
691
  onChange: () => {
@@ -631,127 +694,131 @@ const W = "_wrapper_1g82c_2", X = "_alignmentBlock_1g82c_8", Z = "_title_1g82c_1
631
694
  value: "Homepage"
632
695
  }
633
696
  ) : /* @__PURE__ */ t.jsx(
634
- T,
697
+ P,
635
698
  {
636
- onChange: (p) => u(p),
637
- value: r,
699
+ onChange: (u) => j(u),
700
+ value: h,
638
701
  placeholder: "https://",
639
702
  label: "Link"
640
703
  }
641
704
  ),
642
705
  /* @__PURE__ */ t.jsx(
643
- I,
706
+ S,
644
707
  {
645
708
  current: !1,
646
709
  label: "Open in new tab"
647
710
  }
648
711
  ),
649
712
  /* @__PURE__ */ t.jsx(
650
- G,
713
+ q,
651
714
  {
652
- onChange: () => {
653
- },
654
- value: "Lorem ipsum dolor sit amet com",
715
+ onChange: (u) => p(u),
716
+ value: r,
655
717
  label: "Text",
656
718
  maxLength: 150
657
719
  }
658
720
  ),
659
721
  /* @__PURE__ */ t.jsx(
660
- q,
722
+ Q,
661
723
  {
662
- typeText: l,
663
- setTypeText: e
724
+ typesText: i,
725
+ setTypesText: e
664
726
  }
665
727
  )
666
728
  ] })
667
729
  ]
668
730
  }
669
731
  );
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({
732
+ }, 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 = {
733
+ subtitle: je,
734
+ header: ke,
735
+ text: ye,
736
+ productsBlock: $e,
737
+ buttonsBlock: we,
738
+ top: Be,
739
+ itemsBlock: Ne,
740
+ typeTexts: Ce,
741
+ block: Te,
742
+ active: Ie,
743
+ products: Pe,
744
+ product: Se,
745
+ button: Ae,
746
+ image: Oe,
747
+ info: Le,
748
+ name: De,
749
+ buttons: Re,
750
+ modal: Ee,
751
+ other: ze,
752
+ options: He
753
+ }, Me = (d) => {
754
+ const { buttons: s, setButtons: o, deletable: c = !0, addable: i = !0 } = d, [e, n] = v.useState(null), [a, h] = v.useState({
693
755
  top: 0,
694
756
  left: 0
695
757
  });
696
- j.useEffect(() => {
758
+ v.useEffect(() => {
697
759
  const r = () => {
698
- l(null);
760
+ n(null);
699
761
  };
700
- return document.body.addEventListener("click", r), l(null), () => {
701
- l(null), document.body.removeEventListener("click", r);
762
+ return document.body.addEventListener("click", r), n(null), () => {
763
+ n(null), document.body.removeEventListener("click", r);
702
764
  };
703
- }, []);
704
- const a = (r, u) => {
765
+ }, []), v.useEffect(() => {
766
+ if (e) {
767
+ const r = [...s].map((p) => p.id === e.id ? e : p);
768
+ o(r);
769
+ }
770
+ }, [e]);
771
+ const j = (r, p) => {
705
772
  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);
773
+ const u = r.target.getBoundingClientRect(), k = 490, b = window.innerHeight;
774
+ let _ = u.top + window.scrollY;
775
+ _ + k > b && (_ = b - k - 20), h({
776
+ top: _,
777
+ left: u.left - 30
778
+ }), n(p);
712
779
  };
713
- return /* @__PURE__ */ t.jsxs("div", { className: A.products, children: [
714
- /* @__PURE__ */ t.jsx("h5", { className: A.subtitle, children: "Button Type" }),
780
+ return /* @__PURE__ */ t.jsxs("div", { className: L.products, children: [
781
+ /* @__PURE__ */ t.jsx("h5", { className: L.subtitle, children: "Button Type" }),
715
782
  s.map((r) => /* @__PURE__ */ t.jsxs(
716
783
  "div",
717
784
  {
718
- className: A.product,
785
+ className: L.product,
719
786
  children: [
720
787
  /* @__PURE__ */ t.jsx(
721
- O,
788
+ D,
722
789
  {
723
- onChange: (u) => {
724
- const y = [...s].map((k) => k.id === r.id ? {
790
+ onChange: (p) => {
791
+ const k = [...s].map((b) => b.id === r.id ? {
725
792
  ...r,
726
- type: u
727
- } : k);
728
- o(y);
793
+ type: p
794
+ } : b);
795
+ o(k);
729
796
  },
730
797
  value: r.type,
731
798
  options: ["Primary", "Secondary", "Tertiary"]
732
799
  }
733
800
  ),
734
- /* @__PURE__ */ t.jsxs("div", { className: A.buttons, children: [
801
+ /* @__PURE__ */ t.jsxs("div", { className: L.buttons, children: [
735
802
  /* @__PURE__ */ t.jsx(
736
- m,
803
+ x,
737
804
  {
738
805
  name: "sliders",
739
806
  hoverable: !0,
740
807
  width: 20,
741
808
  height: 20,
742
- onClick: (u) => {
743
- a(u, r);
809
+ onClick: (p) => {
810
+ j(p, r);
744
811
  }
745
812
  }
746
813
  ),
747
- /* @__PURE__ */ t.jsx(
748
- m,
814
+ c && /* @__PURE__ */ t.jsx(
815
+ x,
749
816
  {
750
817
  name: "trash",
751
818
  hoverable: !0,
752
819
  onClick: () => {
753
- const u = s.filter((p) => p.id !== r.id);
754
- o(u);
820
+ const p = s.filter((u) => u.id !== r.id);
821
+ o(p);
755
822
  },
756
823
  width: 20,
757
824
  height: 20,
@@ -763,32 +830,33 @@ const W = "_wrapper_1g82c_2", X = "_alignmentBlock_1g82c_8", Z = "_title_1g82c_1
763
830
  },
764
831
  r.id
765
832
  )),
766
- n && /* @__PURE__ */ t.jsx(
767
- ue,
833
+ e && /* @__PURE__ */ t.jsx(
834
+ ve,
768
835
  {
769
- activeButton: n,
770
- setActiveButton: l,
771
- popupPosition: e
836
+ activeButton: e,
837
+ setActiveButton: n,
838
+ popupPosition: a
772
839
  }
773
840
  ),
774
- /* @__PURE__ */ t.jsxs(
775
- U,
841
+ i && /* @__PURE__ */ t.jsxs(
842
+ K,
776
843
  {
777
- className: A.button,
844
+ className: L.button,
778
845
  size: "s",
779
846
  onClick: () => {
780
847
  const r = [...s];
781
848
  r.push({
782
849
  type: "Primary",
783
- id: R(),
784
- typeText: "bold",
785
- destination: "Go to Page"
850
+ id: E(),
851
+ typesText: [],
852
+ destination: "Go to Page",
853
+ text: ""
786
854
  }), o(r);
787
855
  },
788
856
  children: [
789
857
  /* @__PURE__ */ t.jsx("span", { children: "Add Option" }),
790
858
  /* @__PURE__ */ t.jsx(
791
- m,
859
+ x,
792
860
  {
793
861
  name: "plus",
794
862
  width: 16,
@@ -799,13 +867,13 @@ const W = "_wrapper_1g82c_2", X = "_alignmentBlock_1g82c_8", Z = "_title_1g82c_1
799
867
  }
800
868
  )
801
869
  ] });
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" }),
870
+ }, ls = (d) => {
871
+ const { isActiveButtons: s, setIsActiveButtons: o, buttons: c, setButtons: i } = d;
872
+ return /* @__PURE__ */ t.jsx(t.Fragment, { children: /* @__PURE__ */ t.jsxs("div", { className: I.buttonsBlock, children: [
873
+ /* @__PURE__ */ t.jsxs("div", { className: I.top, children: [
874
+ /* @__PURE__ */ t.jsx("h3", { className: I.title, children: "Buttons" }),
807
875
  /* @__PURE__ */ t.jsx(
808
- I,
876
+ S,
809
877
  {
810
878
  current: s,
811
879
  onChange: (e) => o(e)
@@ -813,63 +881,63 @@ const W = "_wrapper_1g82c_2", X = "_alignmentBlock_1g82c_8", Z = "_title_1g82c_1
813
881
  )
814
882
  ] }),
815
883
  /* @__PURE__ */ t.jsx(
816
- Se,
884
+ Me,
817
885
  {
818
- buttons: n,
819
- setButtons: l
886
+ buttons: c,
887
+ setButtons: i
820
888
  }
821
889
  )
822
890
  ] }) });
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);
891
+ }, 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 = {
892
+ wrapper: Fe,
893
+ subtitle: Ge,
894
+ content: Ye,
895
+ range: Ue,
896
+ track: qe,
897
+ progress: Je,
898
+ dots: Ke,
899
+ dot: Qe,
900
+ active: Ve,
901
+ input: We,
902
+ countBlock: Xe,
903
+ count: Ze,
904
+ controls: ts,
905
+ button: es
906
+ }, ss = (d) => {
907
+ const { label: s, min: o = 1, max: c = 4, step: i = 1, count: e, setCount: n } = d, [a, h] = v.useState(!1), j = Array.from({ length: (c - o) / i + 1 }), r = (e - o) / (c - o) * 100, p = () => {
908
+ e < c && n(e + i);
909
+ }, u = () => {
910
+ e > o && n(e - i);
911
+ }, k = (b) => {
912
+ const _ = o + b * i;
913
+ n(_);
846
914
  };
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 }),
915
+ return /* @__PURE__ */ t.jsxs("div", { className: m.wrapper, children: [
916
+ s && /* @__PURE__ */ t.jsx("h5", { className: m.subtitle, children: s }),
917
+ /* @__PURE__ */ t.jsxs("div", { className: m.content, children: [
918
+ /* @__PURE__ */ t.jsxs("div", { className: m.range, children: [
919
+ /* @__PURE__ */ t.jsx("div", { className: m.track }),
852
920
  /* @__PURE__ */ t.jsx(
853
921
  "div",
854
922
  {
855
- className: _.progress,
856
- style: { width: `${p}%` }
923
+ className: m.progress,
924
+ style: { width: `${r}%` }
857
925
  }
858
926
  ),
859
- /* @__PURE__ */ t.jsx("div", { className: _.dots, children: u.map(($, g) => {
860
- const L = g <= (e - o) / l;
927
+ /* @__PURE__ */ t.jsx("div", { className: m.dots, children: j.map((b, _) => {
928
+ const R = _ <= (e - o) / i;
861
929
  return /* @__PURE__ */ t.jsx(
862
930
  "button",
863
931
  {
864
- onClick: () => x(g),
865
- className: F(_.dot, {
866
- [_.active]: L,
867
- [_.inactive]: !L,
868
- [_.dragging]: a
932
+ onClick: () => k(_),
933
+ className: U(m.dot, {
934
+ [m.active]: R,
935
+ [m.inactive]: !R,
936
+ [m.dragging]: a
869
937
  }),
870
- "aria-label": `Set value to ${o + g * l}`
938
+ "aria-label": `Set value to ${o + _ * i}`
871
939
  },
872
- g
940
+ _
873
941
  );
874
942
  }) }),
875
943
  /* @__PURE__ */ t.jsx(
@@ -877,43 +945,43 @@ const W = "_wrapper_1g82c_2", X = "_alignmentBlock_1g82c_8", Z = "_title_1g82c_1
877
945
  {
878
946
  type: "range",
879
947
  min: o,
880
- max: n,
881
- step: l,
948
+ max: c,
949
+ step: i,
882
950
  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
951
+ onChange: (b) => n(Number(b.target.value)),
952
+ onMouseDown: () => h(!0),
953
+ onMouseUp: () => h(!1),
954
+ onTouchStart: () => h(!0),
955
+ onTouchEnd: () => h(!1),
956
+ className: m.input
889
957
  }
890
958
  )
891
959
  ] }),
892
- /* @__PURE__ */ t.jsxs("div", { className: _.countBlock, children: [
960
+ /* @__PURE__ */ t.jsxs("div", { className: m.countBlock, children: [
893
961
  /* @__PURE__ */ t.jsx(
894
- T,
962
+ P,
895
963
  {
896
964
  type: "number",
897
965
  min: o,
898
- max: n,
966
+ max: c,
899
967
  paddingless: !0,
900
- onChange: ($) => {
901
- const g = Number($);
902
- g > n ? c(n) : g < o ? c(o) : c(g);
968
+ onChange: (b) => {
969
+ const _ = Number(b);
970
+ _ > c ? n(c) : _ < o ? n(o) : n(_);
903
971
  },
904
972
  value: String(e)
905
973
  }
906
974
  ),
907
- /* @__PURE__ */ t.jsxs("div", { className: _.controls, children: [
975
+ /* @__PURE__ */ t.jsxs("div", { className: m.controls, children: [
908
976
  /* @__PURE__ */ t.jsx(
909
977
  "button",
910
978
  {
911
- onClick: y,
912
- disabled: e >= n,
913
- className: _.button,
979
+ onClick: p,
980
+ disabled: e >= c,
981
+ className: m.button,
914
982
  "aria-label": "Increment count",
915
983
  children: /* @__PURE__ */ t.jsx(
916
- m,
984
+ x,
917
985
  {
918
986
  name: "arrow-down",
919
987
  width: 15,
@@ -926,12 +994,12 @@ const W = "_wrapper_1g82c_2", X = "_alignmentBlock_1g82c_8", Z = "_title_1g82c_1
926
994
  /* @__PURE__ */ t.jsx(
927
995
  "button",
928
996
  {
929
- onClick: k,
997
+ onClick: u,
930
998
  disabled: e <= o,
931
- className: _.button,
999
+ className: m.button,
932
1000
  "aria-label": "Decrement count",
933
1001
  children: /* @__PURE__ */ t.jsx(
934
- m,
1002
+ x,
935
1003
  {
936
1004
  name: "arrow-down",
937
1005
  width: 15,
@@ -946,26 +1014,26 @@ const W = "_wrapper_1g82c_2", X = "_alignmentBlock_1g82c_8", Z = "_title_1g82c_1
946
1014
  ] });
947
1015
  };
948
1016
  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
1017
+ K as Button,
1018
+ Me as ButtonTypeSettings,
1019
+ ls as ButtonsSettings,
1020
+ rs as Checkbox,
1021
+ J as ChooseImage,
1022
+ ds as ChooseImageModal,
1023
+ us as ColorPicker,
1024
+ x as Icon,
1025
+ P as Input,
1026
+ Zt as ItemsSettings,
1027
+ cs as LayoutSettings,
1028
+ _s as Modal,
1029
+ ps as Picker,
1030
+ ms as Radio,
1031
+ ss as RangeSelector,
1032
+ D as Select,
1033
+ hs as Submodal,
1034
+ S as Switch,
1035
+ Nt as TextSettings,
1036
+ q as Textarea,
1037
+ gs as Tip,
1038
+ Q as TypesText
971
1039
  };