@billgangcom/theme-lib 1.8.2 → 1.9.0

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 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 = [
1
+ import { j as t, I as m, a as R, c as Z, S as L, T as tt, C as W, b as H, D as et, H as st, B as X, v as G, u as nt, d as ot } from "./index-nLNDQXYl.js";
2
+ import { h as As, i as Ss, f as Os, M as Ds, P as Ls, R as Es, e as Rs, g as Hs } from "./index-nLNDQXYl.js";
3
+ import g from "react";
4
+ const it = "_wrapper_1g82c_2", at = "_alignmentBlock_1g82c_8", rt = "_title_1g82c_15", dt = "_subtitle_1g82c_22", ut = "_alignmentContent_1g82c_29", _t = "_alignments_1g82c_35", pt = "_alignment_1g82c_8", mt = "_circle_1g82c_54", ht = "_paddings_1g82c_61", xt = "_padding_1g82c_61", gt = "_input_1g82c_79", A = {
5
+ wrapper: it,
6
+ alignmentBlock: at,
7
+ title: rt,
8
+ subtitle: dt,
9
+ alignmentContent: ut,
10
+ alignments: _t,
11
+ alignment: pt,
12
+ circle: mt,
13
+ paddings: ht,
14
+ padding: xt,
15
+ input: gt
16
+ }, bt = [
17
17
  "topLeft",
18
18
  "top",
19
19
  "topRight",
@@ -23,8 +23,8 @@ const ct = "_wrapper_1g82c_2", lt = "_alignmentBlock_1g82c_8", it = "_title_1g82
23
23
  "bottomLeft",
24
24
  "bottom",
25
25
  "bottomRight"
26
- ], xt = ["left", "top", "right", "bottom"], cs = (d) => {
27
- const { alignment: s, padding: o, setPadding: c, setAlignment: i } = d;
26
+ ], ft = ["left", "top", "right", "bottom"], Bs = (d) => {
27
+ const { alignment: s, padding: c, setPadding: n, setAlignment: a } = d;
28
28
  function e() {
29
29
  switch (s) {
30
30
  case "left":
@@ -43,22 +43,22 @@ const ct = "_wrapper_1g82c_2", lt = "_alignmentBlock_1g82c_8", it = "_title_1g82
43
43
  return "center";
44
44
  }
45
45
  }
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(
46
+ return /* @__PURE__ */ t.jsxs("div", { className: A.layout, children: [
47
+ /* @__PURE__ */ t.jsx("h3", { className: A.title, children: "Layout" }),
48
+ /* @__PURE__ */ t.jsxs("div", { className: A.alignmentBlock, children: [
49
+ /* @__PURE__ */ t.jsx("h5", { className: A.subtitle, children: "Alignment" }),
50
+ /* @__PURE__ */ t.jsxs("div", { className: A.alignmentContent, children: [
51
+ /* @__PURE__ */ t.jsx("div", { className: A.alignments, children: bt.map((o) => /* @__PURE__ */ t.jsxs(
52
52
  "div",
53
53
  {
54
54
  onClick: () => {
55
- i(n);
55
+ a(o);
56
56
  },
57
- className: $.alignment,
57
+ className: A.alignment,
58
58
  children: [
59
- n !== s && /* @__PURE__ */ t.jsx("div", { className: $.circle }),
60
- n === s && /* @__PURE__ */ t.jsx(
61
- x,
59
+ o !== s && /* @__PURE__ */ t.jsx("div", { className: A.circle }),
60
+ o === s && /* @__PURE__ */ t.jsx(
61
+ m,
62
62
  {
63
63
  name: `text-align-${e()}`,
64
64
  fill: "#FF3F19",
@@ -68,25 +68,25 @@ const ct = "_wrapper_1g82c_2", lt = "_alignmentBlock_1g82c_8", it = "_title_1g82
68
68
  )
69
69
  ]
70
70
  },
71
- n
71
+ o
72
72
  )) }),
73
- /* @__PURE__ */ t.jsx("div", { className: $.paddings, children: xt.map((n) => /* @__PURE__ */ t.jsxs("label", { className: $.padding, children: [
73
+ /* @__PURE__ */ t.jsx("div", { className: A.paddings, children: ft.map((o) => /* @__PURE__ */ t.jsxs("label", { className: A.padding, children: [
74
74
  /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
75
- x,
75
+ m,
76
76
  {
77
- name: `align-${n}`,
77
+ name: `align-${o}`,
78
78
  width: 20,
79
79
  height: 20
80
80
  }
81
81
  ) }),
82
82
  /* @__PURE__ */ t.jsx(
83
- P,
83
+ R,
84
84
  {
85
85
  type: "text",
86
- value: String(o[n]),
87
- onChange: (a) => c({
88
- ...o,
89
- [n]: Number(a)
86
+ value: String(c[o]),
87
+ onChange: (i) => n({
88
+ ...c,
89
+ [o]: Number(i)
90
90
  }),
91
91
  paddingless: !0,
92
92
  borderless: !0
@@ -96,180 +96,180 @@ const ct = "_wrapper_1g82c_2", lt = "_alignmentBlock_1g82c_8", it = "_title_1g82
96
96
  ] })
97
97
  ] })
98
98
  ] });
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(
99
+ }, vt = "_subtitle_2zbxx_1", jt = "_header_2zbxx_8", kt = "_text_2zbxx_9", $t = "_top_2zbxx_16", yt = "_itemsBlock_2zbxx_23", M = {
100
+ subtitle: vt,
101
+ header: jt,
102
+ text: kt,
103
+ top: $t,
104
+ itemsBlock: yt
105
+ }, wt = "_typeTexts_3zlec_1", Nt = "_block_3zlec_7", Bt = "_active_3zlec_18", Q = {
106
+ typeTexts: wt,
107
+ block: Nt,
108
+ active: Bt
109
+ }, Ct = ["bold", "italic", "underline", "strike-through", "code"], ct = (d) => {
110
+ const { typesText: s, setTypesText: c } = d;
111
+ return /* @__PURE__ */ t.jsx("div", { className: Q.typeTexts, children: Ct.map((n) => /* @__PURE__ */ t.jsx(
112
112
  "div",
113
113
  {
114
- className: U(H.block, {
115
- [H.active]: s.includes(c)
114
+ className: Z(Q.block, {
115
+ [Q.active]: s.includes(n)
116
116
  }),
117
117
  onClick: () => {
118
- const i = [...s];
119
- if (i.includes(c)) {
120
- const e = i.filter((n) => n !== c);
121
- o(e);
118
+ const a = [...s];
119
+ if (a.includes(n)) {
120
+ const e = a.filter((o) => o !== n);
121
+ c(e);
122
122
  } else
123
- i.push(c), o(i);
123
+ a.push(n), c(a);
124
124
  },
125
125
  children: /* @__PURE__ */ t.jsx(
126
- x,
126
+ m,
127
127
  {
128
- name: `text-${c}`,
129
- fill: s.includes(c) ? "#252525" : "#757575",
128
+ name: `text-${n}`,
129
+ fill: s.includes(n) ? "#252525" : "#757575",
130
130
  width: 20,
131
131
  height: 20
132
132
  }
133
133
  )
134
134
  },
135
- String(c)
135
+ String(n)
136
136
  )) });
137
- }, Nt = (d) => {
137
+ }, Pt = (d) => {
138
138
  const {
139
139
  typesText: s,
140
- isActiveText: o,
141
- setIsActiveText: c,
142
- text: i,
140
+ isActiveText: c,
141
+ setIsActiveText: n,
142
+ text: a,
143
143
  setText: e,
144
- setTypesText: n,
145
- title: a,
146
- subtitle: h = "Items"
144
+ setTypesText: o,
145
+ title: i,
146
+ subtitle: v = "Items"
147
147
  } = d;
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,
148
+ return /* @__PURE__ */ t.jsxs("div", { className: M.text, children: [
149
+ (i || c !== void 0) && /* @__PURE__ */ t.jsxs("div", { className: M.top, children: [
150
+ i && /* @__PURE__ */ t.jsx("h3", { className: M.title, children: i }),
151
+ c !== void 0 && n && /* @__PURE__ */ t.jsx(
152
+ L,
153
153
  {
154
- current: o,
155
- onChange: (j) => c(j)
154
+ current: c,
155
+ onChange: (j) => n(j)
156
156
  }
157
157
  )
158
158
  ] }),
159
- /* @__PURE__ */ t.jsxs("div", { className: O.itemsBlock, children: [
160
- /* @__PURE__ */ t.jsx("h5", { className: O.subtitle, children: h }),
159
+ /* @__PURE__ */ t.jsxs("div", { className: M.itemsBlock, children: [
160
+ /* @__PURE__ */ t.jsx("h5", { className: M.subtitle, children: v }),
161
161
  /* @__PURE__ */ t.jsx(
162
- q,
162
+ tt,
163
163
  {
164
164
  onChange: (j) => e(j),
165
- value: i,
165
+ value: a,
166
166
  maxLength: 150
167
167
  }
168
168
  ),
169
169
  /* @__PURE__ */ t.jsx(
170
- Q,
170
+ ct,
171
171
  {
172
172
  typesText: s,
173
- setTypesText: n
173
+ setTypesText: o
174
174
  }
175
175
  )
176
176
  ] })
177
177
  ] });
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,
178
+ }, It = "_subtitle_1nl8x_1", Tt = "_header_1nl8x_8", At = "_text_1nl8x_9", St = "_productsBlock_1nl8x_10", Ot = "_top_1nl8x_22", Dt = "_itemsBlock_1nl8x_29", Lt = "_typeTexts_1nl8x_35", Et = "_block_1nl8x_41", Rt = "_active_1nl8x_52", Ht = "_products_1nl8x_10", zt = "_product_1nl8x_10", Mt = "_button_1nl8x_70", Ft = "_image_1nl8x_80", Gt = "_info_1nl8x_87", Yt = "_name_1nl8x_98", Ut = "_buttons_1nl8x_102", qt = "_modal_1nl8x_108", Jt = "_link_1nl8x_126", Kt = "_modalOptions_1nl8x_132", N = {
179
+ subtitle: It,
180
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;
181
+ text: At,
182
+ productsBlock: St,
183
+ top: Ot,
184
+ itemsBlock: Dt,
185
+ typeTexts: Lt,
186
+ block: Et,
187
+ active: Rt,
188
+ products: Ht,
189
+ product: zt,
190
+ button: Mt,
191
+ image: Ft,
192
+ info: Gt,
193
+ name: Yt,
194
+ buttons: Ut,
195
+ modal: qt,
196
+ link: Jt,
197
+ modalOptions: Kt
198
+ }, Qt = (d) => {
199
+ const { activeItem: s, setActiveItem: c, popupPosition: n, modalOptions: a } = d;
200
200
  return /* @__PURE__ */ t.jsxs(
201
201
  "div",
202
202
  {
203
- className: f.modal,
203
+ className: N.modal,
204
204
  onClick: (e) => {
205
205
  e.stopPropagation();
206
206
  },
207
207
  style: {
208
- top: `${c.top}px`,
209
- left: `${c.left}px`
208
+ top: `${n.top}px`,
209
+ left: `${n.left}px`
210
210
  },
211
211
  children: [
212
- /* @__PURE__ */ t.jsxs("div", { className: f.top, children: [
212
+ /* @__PURE__ */ t.jsxs("div", { className: N.top, children: [
213
213
  /* @__PURE__ */ t.jsx("h3", { children: s.name }),
214
214
  /* @__PURE__ */ t.jsx(
215
- x,
215
+ m,
216
216
  {
217
217
  name: "x",
218
218
  height: 20,
219
219
  width: 20,
220
220
  hoverable: !0,
221
- onClick: () => o(null)
221
+ onClick: () => c(null)
222
222
  }
223
223
  )
224
224
  ] }),
225
- /* @__PURE__ */ t.jsx("div", { className: f.modalOptions, children: i.map((e) => {
225
+ /* @__PURE__ */ t.jsx("div", { className: N.modalOptions, children: a.map((e) => {
226
226
  if (e.type === "image")
227
227
  return /* @__PURE__ */ t.jsx(
228
- J,
228
+ W,
229
229
  {
230
230
  label: "Put up an attractive image",
231
- onChange: (n) => {
232
- const a = {
231
+ onChange: (o) => {
232
+ const i = {
233
233
  ...s,
234
- [e.field]: n[0]
234
+ [e.field]: o
235
235
  };
236
- o(a);
236
+ c(i);
237
237
  }
238
238
  }
239
239
  );
240
240
  if (e.type === "text")
241
241
  return /* @__PURE__ */ t.jsx(
242
- Nt,
242
+ Pt,
243
243
  {
244
244
  typesText: s[e.field.type],
245
- setTypesText: (n) => {
246
- const a = {
245
+ setTypesText: (o) => {
246
+ const i = {
247
247
  ...s,
248
- [e.field.type]: n
248
+ [e.field.type]: o
249
249
  };
250
- o(a);
250
+ c(i);
251
251
  },
252
252
  text: s[e.field.text] || "",
253
- setText: (n) => {
254
- const a = {
253
+ setText: (o) => {
254
+ const i = {
255
255
  ...s,
256
- [e.field.text]: n
256
+ [e.field.text]: o
257
257
  };
258
- o(a);
258
+ c(i);
259
259
  },
260
260
  subtitle: e.label
261
261
  }
262
262
  );
263
263
  if (e.type === "input")
264
264
  return /* @__PURE__ */ t.jsx(
265
- P,
265
+ R,
266
266
  {
267
- onChange: (n) => {
268
- const a = {
267
+ onChange: (o) => {
268
+ const i = {
269
269
  ...s,
270
- [e.field]: n
270
+ [e.field]: o
271
271
  };
272
- o(a);
272
+ c(i);
273
273
  },
274
274
  value: s[e.field] || "",
275
275
  label: e.label,
@@ -277,16 +277,16 @@ const ct = "_wrapper_1g82c_2", lt = "_alignmentBlock_1g82c_8", it = "_title_1g82
277
277
  }
278
278
  );
279
279
  if (e.type === "inputSwitch")
280
- return /* @__PURE__ */ t.jsxs("div", { className: f.link, children: [
280
+ return /* @__PURE__ */ t.jsxs("div", { className: N.link, children: [
281
281
  /* @__PURE__ */ t.jsx(
282
- P,
282
+ R,
283
283
  {
284
- onChange: (n) => {
285
- const a = {
284
+ onChange: (o) => {
285
+ const i = {
286
286
  ...s,
287
- [e.field.text]: n
287
+ [e.field.text]: o
288
288
  };
289
- o(a);
289
+ c(i);
290
290
  },
291
291
  value: s[e.field.text] || "",
292
292
  label: e.inputLabel,
@@ -294,31 +294,31 @@ const ct = "_wrapper_1g82c_2", lt = "_alignmentBlock_1g82c_8", it = "_title_1g82
294
294
  }
295
295
  ),
296
296
  /* @__PURE__ */ t.jsx(
297
- S,
297
+ L,
298
298
  {
299
299
  current: !!s[e.field.switch] || !1,
300
300
  label: e.switchLabel,
301
- onChange: (n) => {
302
- const a = {
301
+ onChange: (o) => {
302
+ const i = {
303
303
  ...s,
304
- [e.field.switch]: n
304
+ [e.field.switch]: o
305
305
  };
306
- o(a);
306
+ c(i);
307
307
  }
308
308
  }
309
309
  )
310
310
  ] });
311
311
  if (e.type === "list")
312
312
  return /* @__PURE__ */ t.jsx(
313
- Zt,
313
+ te,
314
314
  {
315
315
  items: s[e.field] || [],
316
- setItems: (n) => {
317
- const a = {
316
+ setItems: (o) => {
317
+ const i = {
318
318
  ...s,
319
- [e.field]: n
319
+ [e.field]: o
320
320
  };
321
- o(a);
321
+ c(i);
322
322
  },
323
323
  itemsType: "select",
324
324
  draggable: e.draggable || !1,
@@ -330,15 +330,15 @@ const ct = "_wrapper_1g82c_2", lt = "_alignmentBlock_1g82c_8", it = "_title_1g82
330
330
  );
331
331
  if (e.type === "select")
332
332
  return /* @__PURE__ */ t.jsx(
333
- D,
333
+ H,
334
334
  {
335
335
  options: e.itemsOptions,
336
- onChange: (n) => {
337
- const a = {
336
+ onChange: (o) => {
337
+ const i = {
338
338
  ...s,
339
- [e.field]: n
339
+ [e.field]: o
340
340
  };
341
- o(a);
341
+ c(i);
342
342
  },
343
343
  label: e.label,
344
344
  value: s[e.field] || "String"
@@ -348,108 +348,109 @@ const ct = "_wrapper_1g82c_2", lt = "_alignmentBlock_1g82c_8", it = "_title_1g82
348
348
  ]
349
349
  }
350
350
  );
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) => {
356
- const { items: s, title: o = "Other" } = d;
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,
351
+ }, Vt = "_other_1wtgi_1", Wt = "_subtitle_1wtgi_7", Xt = "_items_1wtgi_14", V = {
352
+ other: Vt,
353
+ subtitle: Wt,
354
+ items: Xt
355
+ }, lt = (d) => {
356
+ const { items: s, title: c = "Other" } = d;
357
+ return /* @__PURE__ */ t.jsxs("div", { className: V.other, children: [
358
+ /* @__PURE__ */ t.jsx("h5", { className: V.subtitle, children: c }),
359
+ /* @__PURE__ */ t.jsx("div", { className: V.items, children: s.map((n) => /* @__PURE__ */ t.jsx(
360
+ L,
361
361
  {
362
- current: c.isItem,
363
- onChange: (i) => c.setIsItem(i),
364
- label: c.label,
362
+ current: n.isItem,
363
+ onChange: (a) => n.setIsItem(a),
364
+ label: n.label,
365
365
  hasBackground: !0,
366
366
  paddingless: !1
367
367
  }
368
368
  )) })
369
369
  ] });
370
- }, Xt = (d) => {
371
- const { index: s, moveProduct: o, children: c } = d, [, i] = nt({
370
+ }, Zt = (d) => {
371
+ const { index: s, moveProduct: c, children: n } = d, [, a] = nt({
372
372
  accept: "product",
373
- hover(a) {
374
- a.index !== s && (o(a.index, s), a.index = s);
373
+ hover(i) {
374
+ i.index !== s && (c(i.index, s), i.index = s);
375
375
  }
376
- }), [{ isDragging: e }, n] = ot({
376
+ }), [{ isDragging: e }, o] = ot({
377
377
  type: "product",
378
378
  item: { index: s },
379
- collect: (a) => ({
380
- isDragging: a.isDragging()
379
+ collect: (i) => ({
380
+ isDragging: i.isDragging()
381
381
  })
382
382
  });
383
383
  return /* @__PURE__ */ t.jsx(
384
384
  "div",
385
385
  {
386
- ref: (a) => n(i(a)),
387
- className: `${f.product} ${e ? f.dragging : ""}`,
388
- children: c
386
+ ref: (i) => o(a(i)),
387
+ className: `${N.product} ${e ? N.dragging : ""}`,
388
+ children: n
389
389
  }
390
390
  );
391
- }, Zt = (d) => {
391
+ }, te = (d) => {
392
392
  const {
393
393
  isActiveItems: s,
394
- setIsActiveItems: o,
395
- items: c,
396
- setItems: i,
394
+ setIsActiveItems: c,
395
+ items: n,
396
+ setItems: a,
397
397
  other: e,
398
- title: n,
399
- subtitle: a,
400
- editable: h = !0,
398
+ title: o,
399
+ subtitle: i,
400
+ editable: v = !0,
401
401
  draggable: j = !1,
402
- withImage: r = !1,
403
- deletable: p = !0,
404
- addable: u = !0,
405
- itemsType: k,
406
- itemsPlaceholder: b = "",
402
+ withImage: u = !1,
403
+ deletable: b = !0,
404
+ addable: h = !0,
405
+ itemsType: w,
406
+ itemsPlaceholder: p = "",
407
407
  itemsOptions: _,
408
- hasRangeSelector: R = !1,
409
- rangeSelectorOptions: F,
410
- modalOptions: G,
408
+ hasRangeSelector: I = !1,
409
+ rangeSelectorOptions: Y,
410
+ modalOptions: U,
411
411
  addableOptions: z = {}
412
- } = d, [C, T] = v.useState(null), [V, W] = v.useState({
412
+ } = d, [S, O] = g.useState(null), [J, K] = g.useState({
413
413
  top: 0,
414
414
  left: 0
415
- }), X = (l, y) => {
416
- const w = [...c], [g] = w.splice(l, 1);
417
- w.splice(y, 0, g), i(w);
415
+ }), q = (l, $) => {
416
+ const f = [...n], [x] = f.splice(l, 1);
417
+ f.splice($, 0, x), a(f);
418
418
  };
419
- v.useEffect(() => {
419
+ g.useEffect(() => {
420
420
  const l = () => {
421
- T(null);
421
+ O(null);
422
422
  };
423
- return document.body.addEventListener("click", l), T(null), () => {
424
- T(null), document.body.removeEventListener("click", l);
423
+ return document.body.addEventListener("click", l), O(null), () => {
424
+ O(null), document.body.removeEventListener("click", l);
425
425
  };
426
- }, []), v.useEffect(() => {
427
- if (C) {
428
- const l = [...c].map((y) => y.id === C.id ? C : y);
429
- i(l);
426
+ }, []), g.useEffect(() => {
427
+ if (S) {
428
+ const l = [...n].map(($) => $.id === S.id ? S : $);
429
+ a(l);
430
430
  }
431
- }, [C]);
432
- const Z = (l, y) => {
431
+ }, [S]);
432
+ const r = (l, $) => {
433
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);
434
+ const f = l.target.getBoundingClientRect(), x = 100, D = window.innerHeight;
435
+ let T = f.top + window.scrollY;
436
+ T + x > D && (T = D - x - 20), K({
437
+ top: T - 80,
438
+ left: f.left - 30
439
+ }), O($);
440
440
  };
441
- function tt(l) {
442
- if (r)
441
+ console.log(n);
442
+ function k(l) {
443
+ if (u)
443
444
  return l ? /* @__PURE__ */ t.jsx(
444
445
  "img",
445
446
  {
446
- src: `https://imagedelivery.net/${l}/w=1000`,
447
+ src: `https://imagedelivery.net/${l[0]}/w=1000`,
447
448
  alt: "image",
448
449
  width: 16,
449
450
  height: 16
450
451
  }
451
452
  ) : /* @__PURE__ */ t.jsx(
452
- x,
453
+ m,
453
454
  {
454
455
  name: "image",
455
456
  width: 16,
@@ -458,10 +459,10 @@ const ct = "_wrapper_1g82c_2", lt = "_alignmentBlock_1g82c_8", it = "_title_1g82
458
459
  }
459
460
  );
460
461
  }
461
- const Y = (l, y) => {
462
- const w = /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
462
+ const P = (l, $) => {
463
+ const f = /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
463
464
  j && /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
464
- x,
465
+ m,
465
466
  {
466
467
  name: "drag",
467
468
  hoverable: !0,
@@ -469,141 +470,141 @@ const ct = "_wrapper_1g82c_2", lt = "_alignmentBlock_1g82c_8", it = "_title_1g82
469
470
  height: 20
470
471
  }
471
472
  ) }),
472
- k === "select" && /* @__PURE__ */ t.jsx(
473
- D,
473
+ w === "select" && /* @__PURE__ */ t.jsx(
474
+ H,
474
475
  {
475
- onChange: (g) => {
476
- const B = [...c].map((N) => N.id === l.id ? {
476
+ onChange: (x) => {
477
+ const T = [...n].map((B) => B.id === l.id ? {
477
478
  ...l,
478
- name: g
479
- } : N);
480
- T({
479
+ name: x
480
+ } : B);
481
+ O({
481
482
  ...l,
482
- name: g
483
- }), i([...B]);
483
+ name: x
484
+ }), a([...T]);
484
485
  },
485
486
  value: l.name,
486
487
  options: _,
487
- leftAddon: tt(l.image)
488
+ leftAddon: k(l.images)
488
489
  }
489
490
  ),
490
- k === "input" && /* @__PURE__ */ t.jsx(
491
- P,
491
+ w === "input" && /* @__PURE__ */ t.jsx(
492
+ R,
492
493
  {
493
- onChange: (g) => {
494
- const B = [...c].map((N) => N.id === l.id ? {
494
+ onChange: (x) => {
495
+ const T = [...n].map((B) => B.id === l.id ? {
495
496
  ...l,
496
- name: g
497
- } : N);
498
- i([...B]);
497
+ name: x
498
+ } : B);
499
+ a([...T]);
499
500
  },
500
501
  value: l.name,
501
- placeholder: b
502
+ placeholder: p
502
503
  }
503
504
  ),
504
- k === "image" && /* @__PURE__ */ t.jsx(
505
- J,
505
+ w === "image" && /* @__PURE__ */ t.jsx(
506
+ W,
506
507
  {
507
- onChange: (g) => {
508
- const B = [...c].map((N) => N.id === l.id ? {
508
+ onChange: (x) => {
509
+ const T = [...n].map((B) => B.id === l.id ? {
509
510
  ...l,
510
- image: g[0]
511
- } : N);
512
- i([...B]);
511
+ image: x[0]
512
+ } : B);
513
+ a([...T]);
513
514
  }
514
515
  }
515
516
  ),
516
- /* @__PURE__ */ t.jsxs("div", { className: f.buttons, children: [
517
- h && /* @__PURE__ */ t.jsx(
518
- x,
517
+ /* @__PURE__ */ t.jsxs("div", { className: N.buttons, children: [
518
+ v && /* @__PURE__ */ t.jsx(
519
+ m,
519
520
  {
520
521
  name: "sliders",
521
522
  hoverable: !0,
522
523
  width: 20,
523
524
  height: 20,
524
- onClick: (g) => Z(g, l)
525
+ onClick: (x) => r(x, l)
525
526
  }
526
527
  ),
527
- p && /* @__PURE__ */ t.jsx(
528
- x,
528
+ b && /* @__PURE__ */ t.jsx(
529
+ m,
529
530
  {
530
531
  name: "trash",
531
532
  hoverable: !0,
532
533
  width: 20,
533
534
  height: 20,
534
535
  fill: "#C12A2A",
535
- onClick: () => i(c.filter((g) => g.id !== l.id))
536
+ onClick: () => a(n.filter((x) => x.id !== l.id))
536
537
  }
537
538
  )
538
539
  ] })
539
540
  ] });
540
541
  return j ? /* @__PURE__ */ t.jsx(
541
- Xt,
542
+ Zt,
542
543
  {
543
544
  product: l,
544
- index: y,
545
- moveProduct: X,
546
- children: w
545
+ index: $,
546
+ moveProduct: q,
547
+ children: f
547
548
  },
548
549
  l.id
549
550
  ) : /* @__PURE__ */ t.jsx(
550
551
  "div",
551
552
  {
552
- className: f.product,
553
- children: w
553
+ className: N.product,
554
+ children: f
554
555
  },
555
556
  l.id
556
557
  );
557
558
  };
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 }),
559
+ return /* @__PURE__ */ t.jsxs("div", { className: N.productsBlock, children: [
560
+ (o || s !== void 0) && /* @__PURE__ */ t.jsxs("div", { className: N.top, children: [
561
+ o && /* @__PURE__ */ t.jsx("h3", { className: N.title, children: o }),
561
562
  s !== void 0 && /* @__PURE__ */ t.jsx(
562
- S,
563
+ L,
563
564
  {
564
565
  current: s,
565
- onChange: (l) => o == null ? void 0 : o(l)
566
+ onChange: (l) => c == null ? void 0 : c(l)
566
567
  }
567
568
  )
568
569
  ] }),
569
- C && h && G && /* @__PURE__ */ t.jsx(
570
- Jt,
570
+ S && v && U && /* @__PURE__ */ t.jsx(
571
+ Qt,
571
572
  {
572
- activeItem: C,
573
- setActiveItem: T,
574
- popupPosition: V,
575
- modalOptions: G
573
+ activeItem: S,
574
+ setActiveItem: O,
575
+ popupPosition: J,
576
+ modalOptions: U
576
577
  }
577
578
  ),
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,
579
+ I && Y && /* @__PURE__ */ t.jsx(ns, { ...Y }),
580
+ /* @__PURE__ */ t.jsxs("div", { className: N.products, children: [
581
+ i && /* @__PURE__ */ t.jsx("h5", { className: N.subtitle, children: i }),
582
+ j ? /* @__PURE__ */ t.jsx(et, { backend: st, children: n.map((l, $) => P(l, $)) }) : n.map((l, $) => P(l, $)),
583
+ h && /* @__PURE__ */ t.jsxs(
584
+ X,
584
585
  {
585
- className: f.button,
586
+ className: N.button,
586
587
  size: "s",
587
588
  onClick: () => {
588
- const l = [...c];
589
- k === "select" ? l.push({
590
- name: _[0] || `Product ${c.length + 1}`,
591
- id: E(),
589
+ const l = [...n];
590
+ w === "select" ? l.push({
591
+ name: _[0] || `Product ${n.length + 1}`,
592
+ id: G(),
592
593
  ...z
593
- }) : k === "input" ? l.push({
594
+ }) : w === "input" ? l.push({
594
595
  name: "",
595
- id: E(),
596
+ id: G(),
596
597
  ...z
597
598
  }) : l.push({
598
- name: `Image ${c.length + 1}`,
599
- id: E(),
599
+ name: `Image ${n.length + 1}`,
600
+ id: G(),
600
601
  ...z
601
- }), i(l);
602
+ }), a(l);
602
603
  },
603
604
  children: [
604
605
  /* @__PURE__ */ t.jsx("span", { children: "Add Option" }),
605
606
  /* @__PURE__ */ t.jsx(
606
- x,
607
+ m,
607
608
  {
608
609
  name: "plus",
609
610
  width: 16,
@@ -614,78 +615,78 @@ const ct = "_wrapper_1g82c_2", lt = "_alignmentBlock_1g82c_8", it = "_title_1g82
614
615
  }
615
616
  )
616
617
  ] }),
617
- e !== void 0 && /* @__PURE__ */ t.jsx(Wt, { items: e })
618
+ e !== void 0 && /* @__PURE__ */ t.jsx(lt, { items: e })
618
619
  ] });
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,
620
+ }, ee = "_subtitle_41klp_1", se = "_header_41klp_8", ne = "_text_41klp_9", oe = "_productsBlock_41klp_10", ce = "_buttonsBlock_41klp_11", le = "_top_41klp_21", ie = "_itemsBlock_41klp_28", ae = "_typeTexts_41klp_34", re = "_block_41klp_40", de = "_active_41klp_51", ue = "_products_41klp_10", _e = "_product_41klp_10", pe = "_button_41klp_11", me = "_image_41klp_79", he = "_info_41klp_86", xe = "_name_41klp_97", ge = "_buttons_41klp_11", be = "_modal_41klp_107", fe = "_other_41klp_124", ve = "_options_41klp_130", E = {
621
+ subtitle: ee,
622
+ header: se,
623
+ text: ne,
624
+ productsBlock: oe,
625
+ buttonsBlock: ce,
626
+ top: le,
627
+ itemsBlock: ie,
628
+ typeTexts: ae,
629
+ block: re,
630
+ active: de,
631
+ products: ue,
632
+ product: _e,
633
+ button: pe,
634
+ image: me,
635
+ info: he,
636
+ name: xe,
636
637
  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({
638
+ modal: be,
639
+ other: fe,
640
+ options: ve
641
+ }, je = (d) => {
642
+ const { activeButton: s, setActiveButton: c, popupPosition: n } = d, [a, e] = g.useState(s.typesText), [o, i] = g.useState(s.destination), [v, j] = g.useState(s.link || ""), [u, b] = g.useState(s.text || "");
643
+ return g.useEffect(() => {
644
+ c({
644
645
  ...s,
645
646
  ...{
646
- text: r,
647
- link: h,
648
- destination: n,
649
- typesText: i
647
+ text: u,
648
+ link: v,
649
+ destination: o,
650
+ typesText: a
650
651
  }
651
652
  });
652
- }, [i, n, h, r]), /* @__PURE__ */ t.jsxs(
653
+ }, [a, o, v, u]), /* @__PURE__ */ t.jsxs(
653
654
  "div",
654
655
  {
655
- className: I.modal,
656
- onClick: (u) => {
657
- u.stopPropagation();
656
+ className: E.modal,
657
+ onClick: (h) => {
658
+ h.stopPropagation();
658
659
  },
659
660
  style: {
660
- top: `${c.top}px`,
661
- left: `${c.left}px`
661
+ top: `${n.top}px`,
662
+ left: `${n.left}px`
662
663
  },
663
664
  children: [
664
- /* @__PURE__ */ t.jsxs("div", { className: I.top, children: [
665
+ /* @__PURE__ */ t.jsxs("div", { className: E.top, children: [
665
666
  /* @__PURE__ */ t.jsx("h3", { children: s.type }),
666
667
  /* @__PURE__ */ t.jsx(
667
- x,
668
+ m,
668
669
  {
669
670
  name: "x",
670
671
  height: 20,
671
672
  width: 20,
672
673
  hoverable: !0,
673
- onClick: () => o(null)
674
+ onClick: () => c(null)
674
675
  }
675
676
  )
676
677
  ] }),
677
- /* @__PURE__ */ t.jsxs("div", { className: I.options, children: [
678
+ /* @__PURE__ */ t.jsxs("div", { className: E.options, children: [
678
679
  /* @__PURE__ */ t.jsx(
679
- D,
680
+ H,
680
681
  {
681
682
  label: "Destination",
682
- onChange: (u) => a(u),
683
+ onChange: (h) => i(h),
683
684
  options: ["Go to Page", "Open Link"],
684
- value: n
685
+ value: o
685
686
  }
686
687
  ),
687
- n === "Go to Page" ? /* @__PURE__ */ t.jsx(
688
- D,
688
+ o === "Go to Page" ? /* @__PURE__ */ t.jsx(
689
+ H,
689
690
  {
690
691
  label: "Go to",
691
692
  onChange: () => {
@@ -694,34 +695,34 @@ const ct = "_wrapper_1g82c_2", lt = "_alignmentBlock_1g82c_8", it = "_title_1g82
694
695
  value: "Homepage"
695
696
  }
696
697
  ) : /* @__PURE__ */ t.jsx(
697
- P,
698
+ R,
698
699
  {
699
- onChange: (u) => j(u),
700
- value: h,
700
+ onChange: (h) => j(h),
701
+ value: v,
701
702
  placeholder: "https://",
702
703
  label: "Link"
703
704
  }
704
705
  ),
705
706
  /* @__PURE__ */ t.jsx(
706
- S,
707
+ L,
707
708
  {
708
709
  current: !1,
709
710
  label: "Open in new tab"
710
711
  }
711
712
  ),
712
713
  /* @__PURE__ */ t.jsx(
713
- q,
714
+ tt,
714
715
  {
715
- onChange: (u) => p(u),
716
- value: r,
716
+ onChange: (h) => b(h),
717
+ value: u,
717
718
  label: "Text",
718
719
  maxLength: 150
719
720
  }
720
721
  ),
721
722
  /* @__PURE__ */ t.jsx(
722
- Q,
723
+ ct,
723
724
  {
724
- typesText: i,
725
+ typesText: a,
725
726
  setTypesText: e
726
727
  }
727
728
  )
@@ -729,96 +730,96 @@ const ct = "_wrapper_1g82c_2", lt = "_alignmentBlock_1g82c_8", it = "_title_1g82
729
730
  ]
730
731
  }
731
732
  );
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,
733
+ }, ke = "_subtitle_1y5sw_1", $e = "_header_1y5sw_8", ye = "_text_1y5sw_9", we = "_productsBlock_1y5sw_10", Ne = "_buttonsBlock_1y5sw_11", Be = "_top_1y5sw_22", Ce = "_itemsBlock_1y5sw_29", Pe = "_typeTexts_1y5sw_35", Ie = "_block_1y5sw_41", Te = "_active_1y5sw_52", Ae = "_products_1y5sw_10", Se = "_product_1y5sw_10", Oe = "_button_1y5sw_11", De = "_image_1y5sw_80", Le = "_info_1y5sw_87", Ee = "_name_1y5sw_98", Re = "_buttons_1y5sw_11", He = "_modal_1y5sw_108", ze = "_other_1y5sw_125", Me = "_options_1y5sw_131", F = {
734
+ subtitle: ke,
735
+ header: $e,
735
736
  text: ye,
736
- productsBlock: $e,
737
- buttonsBlock: we,
737
+ productsBlock: we,
738
+ buttonsBlock: Ne,
738
739
  top: Be,
739
- itemsBlock: Ne,
740
- typeTexts: Ce,
741
- block: Te,
742
- active: Ie,
743
- products: Pe,
740
+ itemsBlock: Ce,
741
+ typeTexts: Pe,
742
+ block: Ie,
743
+ active: Te,
744
+ products: Ae,
744
745
  product: Se,
745
- button: Ae,
746
- image: Oe,
746
+ button: Oe,
747
+ image: De,
747
748
  info: Le,
748
- name: De,
749
+ name: Ee,
749
750
  buttons: Re,
750
- modal: Ee,
751
+ modal: He,
751
752
  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({
753
+ options: Me
754
+ }, Fe = (d) => {
755
+ const { buttons: s, setButtons: c, deletable: n = !0, addable: a = !0 } = d, [e, o] = g.useState(null), [i, v] = g.useState({
755
756
  top: 0,
756
757
  left: 0
757
758
  });
758
- v.useEffect(() => {
759
- const r = () => {
760
- n(null);
759
+ g.useEffect(() => {
760
+ const u = () => {
761
+ o(null);
761
762
  };
762
- return document.body.addEventListener("click", r), n(null), () => {
763
- n(null), document.body.removeEventListener("click", r);
763
+ return document.body.addEventListener("click", u), o(null), () => {
764
+ o(null), document.body.removeEventListener("click", u);
764
765
  };
765
- }, []), v.useEffect(() => {
766
+ }, []), g.useEffect(() => {
766
767
  if (e) {
767
- const r = [...s].map((p) => p.id === e.id ? e : p);
768
- o(r);
768
+ const u = [...s].map((b) => b.id === e.id ? e : b);
769
+ c(u);
769
770
  }
770
771
  }, [e]);
771
- const j = (r, p) => {
772
- r.stopPropagation();
773
- const u = r.target.getBoundingClientRect(), k = 490, b = window.innerHeight;
774
- let _ = u.top + window.scrollY;
775
- _ + k > b && (_ = b - k - 20), h({
772
+ const j = (u, b) => {
773
+ u.stopPropagation();
774
+ const h = u.target.getBoundingClientRect(), w = 490, p = window.innerHeight;
775
+ let _ = h.top + window.scrollY;
776
+ _ + w > p && (_ = p - w - 20), v({
776
777
  top: _,
777
- left: u.left - 30
778
- }), n(p);
778
+ left: h.left - 30
779
+ }), o(b);
779
780
  };
780
- return /* @__PURE__ */ t.jsxs("div", { className: L.products, children: [
781
- /* @__PURE__ */ t.jsx("h5", { className: L.subtitle, children: "Button Type" }),
782
- s.map((r) => /* @__PURE__ */ t.jsxs(
781
+ return /* @__PURE__ */ t.jsxs("div", { className: F.products, children: [
782
+ /* @__PURE__ */ t.jsx("h5", { className: F.subtitle, children: "Button Type" }),
783
+ s.map((u) => /* @__PURE__ */ t.jsxs(
783
784
  "div",
784
785
  {
785
- className: L.product,
786
+ className: F.product,
786
787
  children: [
787
788
  /* @__PURE__ */ t.jsx(
788
- D,
789
+ H,
789
790
  {
790
- onChange: (p) => {
791
- const k = [...s].map((b) => b.id === r.id ? {
792
- ...r,
793
- type: p
794
- } : b);
795
- o(k);
791
+ onChange: (b) => {
792
+ const w = [...s].map((p) => p.id === u.id ? {
793
+ ...u,
794
+ type: b
795
+ } : p);
796
+ c(w);
796
797
  },
797
- value: r.type,
798
+ value: u.type,
798
799
  options: ["Primary", "Secondary", "Tertiary"]
799
800
  }
800
801
  ),
801
- /* @__PURE__ */ t.jsxs("div", { className: L.buttons, children: [
802
+ /* @__PURE__ */ t.jsxs("div", { className: F.buttons, children: [
802
803
  /* @__PURE__ */ t.jsx(
803
- x,
804
+ m,
804
805
  {
805
806
  name: "sliders",
806
807
  hoverable: !0,
807
808
  width: 20,
808
809
  height: 20,
809
- onClick: (p) => {
810
- j(p, r);
810
+ onClick: (b) => {
811
+ j(b, u);
811
812
  }
812
813
  }
813
814
  ),
814
- c && /* @__PURE__ */ t.jsx(
815
- x,
815
+ n && /* @__PURE__ */ t.jsx(
816
+ m,
816
817
  {
817
818
  name: "trash",
818
819
  hoverable: !0,
819
820
  onClick: () => {
820
- const p = s.filter((u) => u.id !== r.id);
821
- o(p);
821
+ const b = s.filter((h) => h.id !== u.id);
822
+ c(b);
822
823
  },
823
824
  width: 20,
824
825
  height: 20,
@@ -828,35 +829,35 @@ const ct = "_wrapper_1g82c_2", lt = "_alignmentBlock_1g82c_8", it = "_title_1g82
828
829
  ] })
829
830
  ]
830
831
  },
831
- r.id
832
+ u.id
832
833
  )),
833
834
  e && /* @__PURE__ */ t.jsx(
834
- ve,
835
+ je,
835
836
  {
836
837
  activeButton: e,
837
- setActiveButton: n,
838
- popupPosition: a
838
+ setActiveButton: o,
839
+ popupPosition: i
839
840
  }
840
841
  ),
841
- i && /* @__PURE__ */ t.jsxs(
842
- K,
842
+ a && /* @__PURE__ */ t.jsxs(
843
+ X,
843
844
  {
844
- className: L.button,
845
+ className: F.button,
845
846
  size: "s",
846
847
  onClick: () => {
847
- const r = [...s];
848
- r.push({
848
+ const u = [...s];
849
+ u.push({
849
850
  type: "Primary",
850
- id: E(),
851
+ id: G(),
851
852
  typesText: [],
852
853
  destination: "Go to Page",
853
854
  text: ""
854
- }), o(r);
855
+ }), c(u);
855
856
  },
856
857
  children: [
857
858
  /* @__PURE__ */ t.jsx("span", { children: "Add Option" }),
858
859
  /* @__PURE__ */ t.jsx(
859
- x,
860
+ m,
860
861
  {
861
862
  name: "plus",
862
863
  width: 16,
@@ -867,75 +868,75 @@ const ct = "_wrapper_1g82c_2", lt = "_alignmentBlock_1g82c_8", it = "_title_1g82
867
868
  }
868
869
  )
869
870
  ] });
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" }),
871
+ }, Cs = (d) => {
872
+ const { isActiveButtons: s, setIsActiveButtons: c, buttons: n, setButtons: a } = d;
873
+ return /* @__PURE__ */ t.jsx(t.Fragment, { children: /* @__PURE__ */ t.jsxs("div", { className: E.buttonsBlock, children: [
874
+ /* @__PURE__ */ t.jsxs("div", { className: E.top, children: [
875
+ /* @__PURE__ */ t.jsx("h3", { className: E.title, children: "Buttons" }),
875
876
  /* @__PURE__ */ t.jsx(
876
- S,
877
+ L,
877
878
  {
878
879
  current: s,
879
- onChange: (e) => o(e)
880
+ onChange: (e) => c(e)
880
881
  }
881
882
  )
882
883
  ] }),
883
884
  /* @__PURE__ */ t.jsx(
884
- Me,
885
+ Fe,
885
886
  {
886
- buttons: c,
887
- setButtons: i
887
+ buttons: n,
888
+ setButtons: a
888
889
  }
889
890
  )
890
891
  ] }) });
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(_);
892
+ }, Ge = "_wrapper_tn7gb_1", Ye = "_subtitle_tn7gb_7", Ue = "_content_tn7gb_14", qe = "_range_tn7gb_21", Je = "_track_tn7gb_26", Ke = "_progress_tn7gb_35", Qe = "_dots_tn7gb_45", Ve = "_dot_tn7gb_45", We = "_active_tn7gb_62", Xe = "_input_tn7gb_74", Ze = "_countBlock_tn7gb_88", ts = "_count_tn7gb_88", es = "_controls_tn7gb_103", ss = "_button_tn7gb_108", y = {
893
+ wrapper: Ge,
894
+ subtitle: Ye,
895
+ content: Ue,
896
+ range: qe,
897
+ track: Je,
898
+ progress: Ke,
899
+ dots: Qe,
900
+ dot: Ve,
901
+ active: We,
902
+ input: Xe,
903
+ countBlock: Ze,
904
+ count: ts,
905
+ controls: es,
906
+ button: ss
907
+ }, ns = (d) => {
908
+ const { label: s, min: c = 1, max: n = 4, step: a = 1, count: e, setCount: o } = d, [i, v] = g.useState(!1), j = Array.from({ length: (n - c) / a + 1 }), u = (e - c) / (n - c) * 100, b = () => {
909
+ e < n && o(e + a);
910
+ }, h = () => {
911
+ e > c && o(e - a);
912
+ }, w = (p) => {
913
+ const _ = c + p * a;
914
+ o(_);
914
915
  };
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 }),
916
+ return /* @__PURE__ */ t.jsxs("div", { className: y.wrapper, children: [
917
+ s && /* @__PURE__ */ t.jsx("h5", { className: y.subtitle, children: s }),
918
+ /* @__PURE__ */ t.jsxs("div", { className: y.content, children: [
919
+ /* @__PURE__ */ t.jsxs("div", { className: y.range, children: [
920
+ /* @__PURE__ */ t.jsx("div", { className: y.track }),
920
921
  /* @__PURE__ */ t.jsx(
921
922
  "div",
922
923
  {
923
- className: m.progress,
924
- style: { width: `${r}%` }
924
+ className: y.progress,
925
+ style: { width: `${u}%` }
925
926
  }
926
927
  ),
927
- /* @__PURE__ */ t.jsx("div", { className: m.dots, children: j.map((b, _) => {
928
- const R = _ <= (e - o) / i;
928
+ /* @__PURE__ */ t.jsx("div", { className: y.dots, children: j.map((p, _) => {
929
+ const I = _ <= (e - c) / a;
929
930
  return /* @__PURE__ */ t.jsx(
930
931
  "button",
931
932
  {
932
- onClick: () => k(_),
933
- className: U(m.dot, {
934
- [m.active]: R,
935
- [m.inactive]: !R,
936
- [m.dragging]: a
933
+ onClick: () => w(_),
934
+ className: Z(y.dot, {
935
+ [y.active]: I,
936
+ [y.inactive]: !I,
937
+ [y.dragging]: i
937
938
  }),
938
- "aria-label": `Set value to ${o + _ * i}`
939
+ "aria-label": `Set value to ${c + _ * a}`
939
940
  },
940
941
  _
941
942
  );
@@ -944,44 +945,44 @@ const ct = "_wrapper_1g82c_2", lt = "_alignmentBlock_1g82c_8", it = "_title_1g82
944
945
  "input",
945
946
  {
946
947
  type: "range",
947
- min: o,
948
- max: c,
949
- step: i,
948
+ min: c,
949
+ max: n,
950
+ step: a,
950
951
  value: e,
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
952
+ onChange: (p) => o(Number(p.target.value)),
953
+ onMouseDown: () => v(!0),
954
+ onMouseUp: () => v(!1),
955
+ onTouchStart: () => v(!0),
956
+ onTouchEnd: () => v(!1),
957
+ className: y.input
957
958
  }
958
959
  )
959
960
  ] }),
960
- /* @__PURE__ */ t.jsxs("div", { className: m.countBlock, children: [
961
+ /* @__PURE__ */ t.jsxs("div", { className: y.countBlock, children: [
961
962
  /* @__PURE__ */ t.jsx(
962
- P,
963
+ R,
963
964
  {
964
965
  type: "number",
965
- min: o,
966
- max: c,
966
+ min: c,
967
+ max: n,
967
968
  paddingless: !0,
968
- onChange: (b) => {
969
- const _ = Number(b);
970
- _ > c ? n(c) : _ < o ? n(o) : n(_);
969
+ onChange: (p) => {
970
+ const _ = Number(p);
971
+ _ > n ? o(n) : _ < c ? o(c) : o(_);
971
972
  },
972
973
  value: String(e)
973
974
  }
974
975
  ),
975
- /* @__PURE__ */ t.jsxs("div", { className: m.controls, children: [
976
+ /* @__PURE__ */ t.jsxs("div", { className: y.controls, children: [
976
977
  /* @__PURE__ */ t.jsx(
977
978
  "button",
978
979
  {
979
- onClick: p,
980
- disabled: e >= c,
981
- className: m.button,
980
+ onClick: b,
981
+ disabled: e >= n,
982
+ className: y.button,
982
983
  "aria-label": "Increment count",
983
984
  children: /* @__PURE__ */ t.jsx(
984
- x,
985
+ m,
985
986
  {
986
987
  name: "arrow-down",
987
988
  width: 15,
@@ -994,12 +995,12 @@ const ct = "_wrapper_1g82c_2", lt = "_alignmentBlock_1g82c_8", it = "_title_1g82
994
995
  /* @__PURE__ */ t.jsx(
995
996
  "button",
996
997
  {
997
- onClick: u,
998
- disabled: e <= o,
999
- className: m.button,
998
+ onClick: h,
999
+ disabled: e <= c,
1000
+ className: y.button,
1000
1001
  "aria-label": "Decrement count",
1001
1002
  children: /* @__PURE__ */ t.jsx(
1002
- x,
1003
+ m,
1003
1004
  {
1004
1005
  name: "arrow-down",
1005
1006
  width: 15,
@@ -1012,28 +1013,320 @@ const ct = "_wrapper_1g82c_2", lt = "_alignmentBlock_1g82c_8", it = "_title_1g82
1012
1013
  ] })
1013
1014
  ] })
1014
1015
  ] });
1016
+ }, os = "_subtitle_1nl8x_1", cs = "_header_1nl8x_8", ls = "_text_1nl8x_9", is = "_productsBlock_1nl8x_10", as = "_top_1nl8x_22", rs = "_itemsBlock_1nl8x_29", ds = "_typeTexts_1nl8x_35", us = "_block_1nl8x_41", _s = "_active_1nl8x_52", ps = "_products_1nl8x_10", ms = "_product_1nl8x_10", hs = "_button_1nl8x_70", xs = "_image_1nl8x_80", gs = "_info_1nl8x_87", bs = "_name_1nl8x_98", fs = "_buttons_1nl8x_102", vs = "_modal_1nl8x_108", js = "_link_1nl8x_126", ks = "_modalOptions_1nl8x_132", C = {
1017
+ subtitle: os,
1018
+ header: cs,
1019
+ text: ls,
1020
+ productsBlock: is,
1021
+ top: as,
1022
+ itemsBlock: rs,
1023
+ typeTexts: ds,
1024
+ block: us,
1025
+ active: _s,
1026
+ products: ps,
1027
+ product: ms,
1028
+ button: hs,
1029
+ image: xs,
1030
+ info: gs,
1031
+ name: bs,
1032
+ buttons: fs,
1033
+ modal: vs,
1034
+ link: js,
1035
+ modalOptions: ks
1036
+ }, $s = (d) => {
1037
+ const { activeItem: s, setActiveItem: c, popupPosition: n, setIsOpenModal: a } = d;
1038
+ return /* @__PURE__ */ t.jsxs(
1039
+ "div",
1040
+ {
1041
+ className: C.modal,
1042
+ onClick: (e) => {
1043
+ e.stopPropagation();
1044
+ },
1045
+ style: {
1046
+ top: `${n.top}px`,
1047
+ left: `${n.left}px`
1048
+ },
1049
+ children: [
1050
+ /* @__PURE__ */ t.jsxs("div", { className: C.top, children: [
1051
+ /* @__PURE__ */ t.jsx("h3", { children: s.name }),
1052
+ /* @__PURE__ */ t.jsx(
1053
+ m,
1054
+ {
1055
+ name: "x",
1056
+ height: 20,
1057
+ width: 20,
1058
+ hoverable: !0,
1059
+ onClick: () => {
1060
+ a(!1), c(null);
1061
+ }
1062
+ }
1063
+ )
1064
+ ] }),
1065
+ /* @__PURE__ */ t.jsx("div", { className: C.modalOptions, children: /* @__PURE__ */ t.jsx(
1066
+ W,
1067
+ {
1068
+ label: "Put up an attractive image",
1069
+ onChange: (e) => {
1070
+ const o = {
1071
+ ...s,
1072
+ images: e,
1073
+ imagePath: e[0]
1074
+ };
1075
+ c(o);
1076
+ }
1077
+ }
1078
+ ) })
1079
+ ]
1080
+ }
1081
+ );
1082
+ }, ys = (d) => {
1083
+ const { index: s, moveProduct: c, children: n } = d, [, a] = nt({
1084
+ accept: "product",
1085
+ hover(i) {
1086
+ i.index !== s && (c(i.index, s), i.index = s);
1087
+ }
1088
+ }), [{ isDragging: e }, o] = ot({
1089
+ type: "product",
1090
+ item: { index: s },
1091
+ collect: (i) => ({
1092
+ isDragging: i.isDragging()
1093
+ })
1094
+ });
1095
+ return /* @__PURE__ */ t.jsx(
1096
+ "div",
1097
+ {
1098
+ ref: (i) => o(a(i)),
1099
+ className: `${C.product} ${e ? C.dragging : ""}`,
1100
+ children: n
1101
+ }
1102
+ );
1103
+ }, Ps = (d) => {
1104
+ const {
1105
+ isActiveItems: s,
1106
+ setIsActiveItems: c,
1107
+ items: n,
1108
+ setItems: a,
1109
+ other: e,
1110
+ title: o,
1111
+ subtitle: i,
1112
+ editable: v = !0,
1113
+ draggable: j = !1,
1114
+ withImage: u = !1,
1115
+ deletable: b = !0,
1116
+ addable: h = !0,
1117
+ itemsType: w,
1118
+ itemsOptions: p
1119
+ } = d, [_, I] = g.useState(null), [Y, U] = g.useState({
1120
+ top: 0,
1121
+ left: 0
1122
+ }), [z, S] = g.useState(!1), O = (r, k) => {
1123
+ const P = [...n], [l] = P.splice(r, 1);
1124
+ P.splice(k, 0, l), a(P);
1125
+ };
1126
+ g.useEffect(() => {
1127
+ const r = () => {
1128
+ I(null);
1129
+ };
1130
+ return document.body.addEventListener("click", r), I(null), () => {
1131
+ I(null), document.body.removeEventListener("click", r);
1132
+ };
1133
+ }, []), g.useEffect(() => {
1134
+ if (_) {
1135
+ const r = [...n].map((k) => k.id === _.id ? _ : k);
1136
+ a(r);
1137
+ }
1138
+ }, [_]);
1139
+ const J = (r, k) => {
1140
+ r.stopPropagation();
1141
+ const P = r.target.getBoundingClientRect(), l = 100, $ = window.innerHeight;
1142
+ let f = P.top + window.scrollY;
1143
+ f + l > $ && (f = $ - l - 20), S(!0), U({
1144
+ top: f - 80,
1145
+ left: P.left - 30
1146
+ }), I(k);
1147
+ };
1148
+ function K(r) {
1149
+ if (u)
1150
+ return r ? /* @__PURE__ */ t.jsx(
1151
+ "img",
1152
+ {
1153
+ src: `https://imagedelivery.net/${r}/w=1000`,
1154
+ alt: "image",
1155
+ width: 16,
1156
+ height: 16
1157
+ }
1158
+ ) : /* @__PURE__ */ t.jsx(
1159
+ m,
1160
+ {
1161
+ name: "image",
1162
+ width: 16,
1163
+ height: 16,
1164
+ fill: "#757575"
1165
+ }
1166
+ );
1167
+ }
1168
+ const q = (r, k) => {
1169
+ const P = /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
1170
+ j && /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
1171
+ m,
1172
+ {
1173
+ name: "drag",
1174
+ hoverable: !0,
1175
+ width: 20,
1176
+ height: 20
1177
+ }
1178
+ ) }),
1179
+ w === "select" && /* @__PURE__ */ t.jsx(
1180
+ H,
1181
+ {
1182
+ onChange: (l) => {
1183
+ const $ = [...n], f = Number(l.split(" ")[1]), x = p.find((B) => B.id === f);
1184
+ if (!x) return;
1185
+ const D = {
1186
+ ...x.productData.stats,
1187
+ newPrice: x.productData.minPrice.amount,
1188
+ oldPrice: x.productData.compareAtPrice.amount
1189
+ }, T = $.map((B) => (console.log(l, f), B.id === r.id ? {
1190
+ ...r,
1191
+ name: l,
1192
+ listingId: f,
1193
+ stats: D
1194
+ } : B));
1195
+ I({
1196
+ ...r,
1197
+ name: l,
1198
+ listingId: f
1199
+ }), a([...T]);
1200
+ },
1201
+ value: r.name,
1202
+ options: [...p.map((l) => `Product ${l.id}`)],
1203
+ leftAddon: K(r.images[0])
1204
+ }
1205
+ ),
1206
+ /* @__PURE__ */ t.jsxs("div", { className: C.buttons, children: [
1207
+ v && /* @__PURE__ */ t.jsx(
1208
+ m,
1209
+ {
1210
+ name: "sliders",
1211
+ hoverable: !0,
1212
+ width: 20,
1213
+ height: 20,
1214
+ onClick: (l) => J(l, r)
1215
+ }
1216
+ ),
1217
+ b && /* @__PURE__ */ t.jsx(
1218
+ m,
1219
+ {
1220
+ name: "trash",
1221
+ hoverable: !0,
1222
+ width: 20,
1223
+ height: 20,
1224
+ fill: "#C12A2A",
1225
+ onClick: () => a(n.filter((l) => l.id !== r.id))
1226
+ }
1227
+ )
1228
+ ] })
1229
+ ] });
1230
+ return j ? /* @__PURE__ */ t.jsx(
1231
+ ys,
1232
+ {
1233
+ product: r,
1234
+ index: k,
1235
+ moveProduct: O,
1236
+ children: P
1237
+ },
1238
+ r.id
1239
+ ) : /* @__PURE__ */ t.jsx(
1240
+ "div",
1241
+ {
1242
+ className: C.product,
1243
+ children: P
1244
+ },
1245
+ r.id
1246
+ );
1247
+ };
1248
+ return /* @__PURE__ */ t.jsxs("div", { className: C.productsBlock, children: [
1249
+ (o || s !== void 0) && /* @__PURE__ */ t.jsxs("div", { className: C.top, children: [
1250
+ o && /* @__PURE__ */ t.jsx("h3", { className: C.title, children: o }),
1251
+ s !== void 0 && /* @__PURE__ */ t.jsx(
1252
+ L,
1253
+ {
1254
+ current: s,
1255
+ onChange: (r) => c == null ? void 0 : c(r)
1256
+ }
1257
+ )
1258
+ ] }),
1259
+ z && _ && /* @__PURE__ */ t.jsx(
1260
+ $s,
1261
+ {
1262
+ activeItem: _,
1263
+ setActiveItem: I,
1264
+ setIsOpenModal: S,
1265
+ popupPosition: Y
1266
+ }
1267
+ ),
1268
+ /* @__PURE__ */ t.jsxs("div", { className: C.products, children: [
1269
+ i && /* @__PURE__ */ t.jsx("h5", { className: C.subtitle, children: i }),
1270
+ j ? /* @__PURE__ */ t.jsx(et, { backend: st, children: n.map((r, k) => q(r, k)) }) : n.map((r, k) => q(r, k)),
1271
+ h && /* @__PURE__ */ t.jsxs(
1272
+ X,
1273
+ {
1274
+ className: C.button,
1275
+ size: "s",
1276
+ onClick: () => {
1277
+ const r = [...n], k = p[0].id;
1278
+ r.push({
1279
+ name: `Product ${k}`,
1280
+ id: G(),
1281
+ listingId: k,
1282
+ imagePath: "",
1283
+ images: [],
1284
+ stats: {
1285
+ ...p[0].productData.stats,
1286
+ newPrice: p[0].productData.minPrice.amount,
1287
+ oldPrice: p[0].productData.compareAtPrice.amount
1288
+ }
1289
+ }), a(r);
1290
+ },
1291
+ children: [
1292
+ /* @__PURE__ */ t.jsx("span", { children: "Add Option" }),
1293
+ /* @__PURE__ */ t.jsx(
1294
+ m,
1295
+ {
1296
+ name: "plus",
1297
+ width: 16,
1298
+ height: 16
1299
+ }
1300
+ )
1301
+ ]
1302
+ }
1303
+ )
1304
+ ] }),
1305
+ e !== void 0 && /* @__PURE__ */ t.jsx(lt, { items: e })
1306
+ ] });
1015
1307
  };
1016
1308
  export {
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
1309
+ X as Button,
1310
+ Fe as ButtonTypeSettings,
1311
+ Cs as ButtonsSettings,
1312
+ As as Checkbox,
1313
+ W as ChooseImage,
1314
+ Ss as ChooseImageModal,
1315
+ Os as ColorPicker,
1316
+ m as Icon,
1317
+ R as Input,
1318
+ te as ItemsSettings,
1319
+ Bs as LayoutSettings,
1320
+ Ps as ListingSelector,
1321
+ Ds as Modal,
1322
+ Ls as Picker,
1323
+ Es as Radio,
1324
+ ns as RangeSelector,
1325
+ H as Select,
1326
+ Rs as Submodal,
1327
+ L as Switch,
1328
+ Pt as TextSettings,
1329
+ tt as Textarea,
1330
+ Hs as Tip,
1331
+ ct as TypesText
1039
1332
  };