@billgangcom/theme-lib 1.4.0 → 1.6.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 r, a as T, c as I, S as k, T as A, B as S, v as L, b as C } from "./index-ohEJxZVF.js";
2
- import { C as Xt, M as Zt, P as te, R as ee, d as se, e as ne } from "./index-ohEJxZVF.js";
3
- import b from "react";
4
- const R = "_wrapper_o1bnv_2", E = "_alignmentBlock_o1bnv_8", H = "_title_o1bnv_16", O = "_subtitle_o1bnv_23", F = "_alignmentContent_o1bnv_30", G = "_alignments_o1bnv_37", D = "_alignment_o1bnv_8", M = "_circle_o1bnv_56", Y = "_paddings_o1bnv_63", q = "_padding_o1bnv_63", J = "_input_o1bnv_81", x = {
5
- wrapper: R,
6
- alignmentBlock: E,
7
- title: H,
8
- subtitle: O,
9
- alignmentContent: F,
10
- alignments: G,
11
- alignment: D,
12
- circle: M,
13
- paddings: Y,
14
- padding: q,
15
- input: J
16
- }, K = [
1
+ import { j as t, I as p, a as S, c as D, S as C, T as O, b as I, C as Y, B as R, v as P } from "./index-2iAZ7WmX.js";
2
+ import { g as Ne, h as Te, e as Pe, M as Ie, P as Ae, R as Se, d as Le, f as ze } from "./index-2iAZ7WmX.js";
3
+ import y from "react";
4
+ const q = "_wrapper_o1bnv_2", J = "_alignmentBlock_o1bnv_8", K = "_title_o1bnv_16", Q = "_subtitle_o1bnv_23", U = "_alignmentContent_o1bnv_30", V = "_alignments_o1bnv_37", W = "_alignment_o1bnv_8", X = "_circle_o1bnv_56", Z = "_paddings_o1bnv_63", tt = "_padding_o1bnv_63", et = "_input_o1bnv_81", x = {
5
+ wrapper: q,
6
+ alignmentBlock: J,
7
+ title: K,
8
+ subtitle: Q,
9
+ alignmentContent: U,
10
+ alignments: V,
11
+ alignment: W,
12
+ circle: X,
13
+ paddings: Z,
14
+ padding: tt,
15
+ input: et
16
+ }, st = [
17
17
  "topLeft",
18
18
  "top",
19
19
  "topRight",
@@ -23,24 +23,24 @@ const R = "_wrapper_o1bnv_2", E = "_alignmentBlock_o1bnv_8", H = "_title_o1bnv_1
23
23
  "bottomLeft",
24
24
  "bottom",
25
25
  "bottomRight"
26
- ], Q = ["left", "top", "right", "bottom"], Jt = (_) => {
27
- const { alignment: o, padding: u, setPadding: n, setAlignment: a } = _;
26
+ ], nt = ["left", "top", "right", "bottom"], ke = (_) => {
27
+ const { alignment: i, padding: a, setPadding: s, setAlignment: n } = _;
28
28
  return /* @__PURE__ */ t.jsxs("div", { className: x.layout, children: [
29
29
  /* @__PURE__ */ t.jsx("h3", { className: x.title, children: "Layout" }),
30
30
  /* @__PURE__ */ t.jsxs("div", { className: x.alignmentBlock, children: [
31
31
  /* @__PURE__ */ t.jsx("h5", { className: x.subtitle, children: "Alignment" }),
32
32
  /* @__PURE__ */ t.jsxs("div", { className: x.alignmentContent, children: [
33
- /* @__PURE__ */ t.jsx("div", { className: x.alignments, children: K.map((i) => /* @__PURE__ */ t.jsxs(
33
+ /* @__PURE__ */ t.jsx("div", { className: x.alignments, children: st.map((c) => /* @__PURE__ */ t.jsxs(
34
34
  "div",
35
35
  {
36
36
  onClick: () => {
37
- a((c) => i);
37
+ n((u) => c);
38
38
  },
39
39
  className: x.alignment,
40
40
  children: [
41
- i !== o && /* @__PURE__ */ t.jsx("div", { className: x.circle }),
42
- i === o && /* @__PURE__ */ t.jsx(
43
- r,
41
+ c !== i && /* @__PURE__ */ t.jsx("div", { className: x.circle }),
42
+ c === i && /* @__PURE__ */ t.jsx(
43
+ p,
44
44
  {
45
45
  name: "text-align-left",
46
46
  fill: "#FF3F19"
@@ -48,25 +48,25 @@ const R = "_wrapper_o1bnv_2", E = "_alignmentBlock_o1bnv_8", H = "_title_o1bnv_1
48
48
  )
49
49
  ]
50
50
  },
51
- i
51
+ c
52
52
  )) }),
53
- /* @__PURE__ */ t.jsx("div", { className: x.paddings, children: Q.map((i) => /* @__PURE__ */ t.jsxs("label", { className: x.padding, children: [
53
+ /* @__PURE__ */ t.jsx("div", { className: x.paddings, children: nt.map((c) => /* @__PURE__ */ t.jsxs("label", { className: x.padding, children: [
54
54
  /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
55
- r,
55
+ p,
56
56
  {
57
- name: `align-${i}`,
57
+ name: `align-${c}`,
58
58
  width: 20,
59
59
  height: 20
60
60
  }
61
61
  ) }),
62
62
  /* @__PURE__ */ t.jsx(
63
- T,
63
+ S,
64
64
  {
65
65
  type: "text",
66
- value: String(u[i]),
67
- onChange: (c) => n((g) => ({
68
- ...g,
69
- [i]: Number(c)
66
+ value: String(a[c]),
67
+ onChange: (u) => s((h) => ({
68
+ ...h,
69
+ [c]: Number(u)
70
70
  })),
71
71
  paddingless: !0
72
72
  }
@@ -75,121 +75,121 @@ const R = "_wrapper_o1bnv_2", E = "_alignmentBlock_o1bnv_8", H = "_title_o1bnv_1
75
75
  ] })
76
76
  ] })
77
77
  ] });
78
- }, U = "_subtitle_2zbxx_1", V = "_header_2zbxx_8", W = "_text_2zbxx_9", X = "_top_2zbxx_16", Z = "_itemsBlock_2zbxx_23", y = {
79
- subtitle: U,
80
- header: V,
81
- text: W,
82
- top: X,
83
- itemsBlock: Z
84
- }, tt = "_typeTexts_3zlec_1", et = "_block_3zlec_7", st = "_active_3zlec_18", B = {
85
- typeTexts: tt,
86
- block: et,
87
- active: st
88
- }, nt = ["bold", "italic", "underline", "strike-through", "code"], z = (_) => {
89
- const { typeText: o, setTypeText: u } = _;
90
- return /* @__PURE__ */ t.jsx("div", { className: B.typeTexts, children: nt.map((n) => /* @__PURE__ */ t.jsx(
78
+ }, ot = "_subtitle_2zbxx_1", it = "_header_2zbxx_8", ct = "_text_2zbxx_9", lt = "_top_2zbxx_16", at = "_itemsBlock_2zbxx_23", $ = {
79
+ subtitle: ot,
80
+ header: it,
81
+ text: ct,
82
+ top: lt,
83
+ itemsBlock: at
84
+ }, rt = "_typeTexts_3zlec_1", dt = "_block_3zlec_7", _t = "_active_3zlec_18", A = {
85
+ typeTexts: rt,
86
+ block: dt,
87
+ active: _t
88
+ }, ut = ["bold", "italic", "underline", "strike-through", "code"], E = (_) => {
89
+ const { typeText: i, setTypeText: a } = _;
90
+ return /* @__PURE__ */ t.jsx("div", { className: A.typeTexts, children: ut.map((s) => /* @__PURE__ */ t.jsx(
91
91
  "div",
92
92
  {
93
- className: I(B.block, {
94
- [B.active]: o === n
93
+ className: D(A.block, {
94
+ [A.active]: i === s
95
95
  }),
96
- onClick: () => u((a) => n),
96
+ onClick: () => a((n) => s),
97
97
  children: /* @__PURE__ */ t.jsx(
98
- r,
98
+ p,
99
99
  {
100
- name: `text-${n}`,
101
- fill: o === n ? "#252525" : "#757575",
100
+ name: `text-${s}`,
101
+ fill: i === s ? "#252525" : "#757575",
102
102
  width: 20,
103
103
  height: 20
104
104
  }
105
105
  )
106
106
  },
107
- String(n)
107
+ String(s)
108
108
  )) });
109
- }, Kt = (_) => {
109
+ }, fe = (_) => {
110
110
  const {
111
- typeText: o,
112
- isActiveText: u,
113
- setIsActiveText: n,
114
- text: a,
115
- setText: i,
116
- setTypeText: c,
117
- title: g,
118
- subtitle: v = "Items"
111
+ typeText: i,
112
+ isActiveText: a,
113
+ setIsActiveText: s,
114
+ text: n,
115
+ setText: c,
116
+ setTypeText: u,
117
+ title: h,
118
+ subtitle: o = "Items"
119
119
  } = _;
120
- return /* @__PURE__ */ t.jsxs("div", { className: y.text, children: [
121
- /* @__PURE__ */ t.jsxs("div", { className: y.top, children: [
122
- /* @__PURE__ */ t.jsx("h3", { className: y.title, children: g }),
120
+ return /* @__PURE__ */ t.jsxs("div", { className: $.text, children: [
121
+ /* @__PURE__ */ t.jsxs("div", { className: $.top, children: [
122
+ /* @__PURE__ */ t.jsx("h3", { className: $.title, children: h }),
123
123
  /* @__PURE__ */ t.jsx(
124
- k,
124
+ C,
125
125
  {
126
- current: u,
127
- onChange: (m) => n((e) => m)
126
+ current: a,
127
+ onChange: (l) => s((r) => l)
128
128
  }
129
129
  )
130
130
  ] }),
131
- /* @__PURE__ */ t.jsxs("div", { className: y.itemsBlock, children: [
132
- /* @__PURE__ */ t.jsx("h5", { className: y.subtitle, children: v }),
131
+ /* @__PURE__ */ t.jsxs("div", { className: $.itemsBlock, children: [
132
+ /* @__PURE__ */ t.jsx("h5", { className: $.subtitle, children: o }),
133
133
  /* @__PURE__ */ t.jsx(
134
- A,
134
+ O,
135
135
  {
136
- onChange: (m) => i((e) => m),
137
- value: a,
136
+ onChange: (l) => c((r) => l),
137
+ value: n,
138
138
  maxLength: 150
139
139
  }
140
140
  ),
141
141
  /* @__PURE__ */ t.jsx(
142
- z,
142
+ E,
143
143
  {
144
- typeText: o,
145
- setTypeText: c
144
+ typeText: i,
145
+ setTypeText: u
146
146
  }
147
147
  )
148
148
  ] })
149
149
  ] });
150
- }, ot = "_subtitle_2l7ty_1", it = "_header_2l7ty_8", ct = "_text_2l7ty_9", lt = "_productsBlock_2l7ty_10", at = "_top_2l7ty_22", dt = "_itemsBlock_2l7ty_29", rt = "_typeTexts_2l7ty_35", _t = "_block_2l7ty_41", ut = "_active_2l7ty_52", pt = "_products_2l7ty_10", ht = "_product_2l7ty_10", mt = "_button_2l7ty_70", xt = "_image_2l7ty_80", gt = "_info_2l7ty_87", bt = "_name_2l7ty_98", vt = "_buttons_2l7ty_102", jt = "_modal_2l7ty_108", yt = "_other_2l7ty_125", l = {
151
- subtitle: ot,
152
- header: it,
153
- text: ct,
154
- productsBlock: lt,
155
- top: at,
156
- itemsBlock: dt,
157
- typeTexts: rt,
158
- block: _t,
159
- active: ut,
160
- products: pt,
161
- product: ht,
162
- button: mt,
163
- image: xt,
164
- info: gt,
165
- name: bt,
166
- buttons: vt,
167
- modal: jt,
168
- other: yt
169
- }, kt = (_) => {
170
- const { activeProduct: o, setActiveProduct: u, popupPosition: n } = _;
150
+ }, pt = "_subtitle_2l7ty_1", mt = "_header_2l7ty_8", ht = "_text_2l7ty_9", xt = "_productsBlock_2l7ty_10", bt = "_top_2l7ty_22", gt = "_itemsBlock_2l7ty_29", yt = "_typeTexts_2l7ty_35", vt = "_block_2l7ty_41", jt = "_active_2l7ty_52", kt = "_products_2l7ty_10", ft = "_product_2l7ty_10", wt = "_button_2l7ty_70", $t = "_image_2l7ty_80", Bt = "_info_2l7ty_87", Ct = "_name_2l7ty_98", Nt = "_buttons_2l7ty_102", Tt = "_modal_2l7ty_108", Pt = "_other_2l7ty_125", m = {
151
+ subtitle: pt,
152
+ header: mt,
153
+ text: ht,
154
+ productsBlock: xt,
155
+ top: bt,
156
+ itemsBlock: gt,
157
+ typeTexts: yt,
158
+ block: vt,
159
+ active: jt,
160
+ products: kt,
161
+ product: ft,
162
+ button: wt,
163
+ image: $t,
164
+ info: Bt,
165
+ name: Ct,
166
+ buttons: Nt,
167
+ modal: Tt,
168
+ other: Pt
169
+ }, It = (_) => {
170
+ const { activeItem: i, setActiveItem: a, popupPosition: s } = _;
171
171
  return /* @__PURE__ */ t.jsxs(
172
172
  "div",
173
173
  {
174
- className: l.modal,
175
- onClick: (a) => {
176
- a.stopPropagation();
174
+ className: m.modal,
175
+ onClick: (n) => {
176
+ n.stopPropagation();
177
177
  },
178
178
  style: {
179
- top: `${n.top}px`,
180
- left: `${n.left}px`
179
+ top: `${s.top}px`,
180
+ left: `${s.left}px`
181
181
  },
182
182
  children: [
183
- /* @__PURE__ */ t.jsxs("div", { className: l.top, children: [
184
- /* @__PURE__ */ t.jsx("h3", { children: o.name }),
183
+ /* @__PURE__ */ t.jsxs("div", { className: m.top, children: [
184
+ /* @__PURE__ */ t.jsx("h3", { children: i.name }),
185
185
  /* @__PURE__ */ t.jsx(
186
- r,
186
+ p,
187
187
  {
188
188
  name: "x",
189
189
  height: 20,
190
190
  width: 20,
191
191
  hoverable: !0,
192
- onClick: () => u(null)
192
+ onClick: () => a(null)
193
193
  }
194
194
  )
195
195
  ] }),
@@ -200,95 +200,137 @@ const R = "_wrapper_o1bnv_2", E = "_alignmentBlock_o1bnv_8", H = "_title_o1bnv_1
200
200
  ]
201
201
  }
202
202
  );
203
- }, Qt = (_) => {
203
+ }, we = (_) => {
204
204
  const {
205
- isActiveProducts: o,
206
- setIsActiveProducts: u,
207
- products: n,
208
- setProducts: a,
209
- isProductStats: i,
210
- setIsProductStats: c,
211
- title: g = "Product",
212
- subtitle: v = "Products will appear in this section"
213
- } = _, [m, e] = b.useState(null), [h, j] = b.useState({
205
+ isActiveItems: i,
206
+ setIsActiveItems: a,
207
+ items: s,
208
+ setItems: n,
209
+ isProductStats: c,
210
+ setIsProductStats: u,
211
+ title: h,
212
+ subtitle: o,
213
+ editable: l = !0,
214
+ draggable: r = !1,
215
+ withImage: f = !0,
216
+ itemsType: b,
217
+ itemsPlaceholder: v = "",
218
+ itemsOptions: L
219
+ } = _, [z, w] = y.useState(null), [H, F] = y.useState({
214
220
  top: 0,
215
221
  left: 0
216
222
  });
217
- b.useEffect(() => {
218
- const s = () => {
219
- e(null);
223
+ y.useEffect(() => {
224
+ const e = () => {
225
+ w(null);
220
226
  };
221
- return document.body.addEventListener("click", s), e(null), () => {
222
- e(null), document.body.removeEventListener("click", s);
227
+ return document.body.addEventListener("click", e), w(null), () => {
228
+ w(null), document.body.removeEventListener("click", e);
223
229
  };
224
230
  }, []);
225
- const w = (s, d) => {
226
- s.stopPropagation();
227
- const f = s.target.getBoundingClientRect(), P = 100, $ = window.innerHeight;
228
- let N = f.top + window.scrollY;
229
- N + P > $ && (N = $ - P - 20), j({
230
- top: N - 80,
231
- left: f.left - 30
232
- }), e(d);
231
+ const G = (e, d) => {
232
+ e.stopPropagation();
233
+ const j = e.target.getBoundingClientRect(), N = 100, T = window.innerHeight;
234
+ let g = j.top + window.scrollY;
235
+ g + N > T && (g = T - N - 20), F({
236
+ top: g - 80,
237
+ left: j.left - 30
238
+ }), w(d);
233
239
  };
234
- return /* @__PURE__ */ t.jsxs("div", { className: l.productsBlock, children: [
235
- /* @__PURE__ */ t.jsxs("div", { className: l.top, children: [
236
- /* @__PURE__ */ t.jsx("h3", { className: l.title, children: g }),
240
+ function M(e) {
241
+ if (f && !e)
242
+ return /* @__PURE__ */ t.jsx(
243
+ p,
244
+ {
245
+ name: "image",
246
+ width: 16,
247
+ height: 16,
248
+ fill: "#757575"
249
+ }
250
+ );
251
+ }
252
+ return /* @__PURE__ */ t.jsxs("div", { className: m.productsBlock, children: [
253
+ /* @__PURE__ */ t.jsxs("div", { className: m.top, children: [
254
+ h && /* @__PURE__ */ t.jsx("h3", { className: m.title, children: h }),
237
255
  /* @__PURE__ */ t.jsx(
238
- k,
256
+ C,
239
257
  {
240
- current: o,
241
- onChange: (s) => u((d) => s)
258
+ current: i,
259
+ onChange: (e) => a((d) => e)
242
260
  }
243
261
  )
244
262
  ] }),
245
- m && /* @__PURE__ */ t.jsx(
246
- kt,
263
+ z && l && /* @__PURE__ */ t.jsx(
264
+ It,
247
265
  {
248
- activeProduct: m,
249
- setActiveProduct: e,
250
- popupPosition: h
266
+ activeItem: z,
267
+ setActiveItem: w,
268
+ popupPosition: H
251
269
  }
252
270
  ),
253
- /* @__PURE__ */ t.jsxs("div", { className: l.products, children: [
254
- /* @__PURE__ */ t.jsx("h5", { className: l.subtitle, children: v }),
255
- n.map((s) => /* @__PURE__ */ t.jsxs(
271
+ /* @__PURE__ */ t.jsxs("div", { className: m.products, children: [
272
+ o && /* @__PURE__ */ t.jsx("h5", { className: m.subtitle, children: o }),
273
+ s.map((e) => /* @__PURE__ */ t.jsxs(
256
274
  "div",
257
275
  {
258
- className: l.product,
276
+ className: m.product,
259
277
  children: [
260
- /* @__PURE__ */ t.jsxs("div", { className: l.info, children: [
261
- /* @__PURE__ */ t.jsx("div", { className: l.image, children: s.image ? /* @__PURE__ */ t.jsx("img", { src: s.image }) : /* @__PURE__ */ t.jsx(
262
- r,
263
- {
264
- name: "image",
265
- width: 16,
266
- height: 16,
267
- fill: "#757575"
268
- }
269
- ) }),
270
- /* @__PURE__ */ t.jsx("span", { className: l.name, children: s.name }),
271
- /* @__PURE__ */ t.jsx(r, { name: "arrow-down" })
272
- ] }),
273
- /* @__PURE__ */ t.jsxs("div", { className: l.buttons, children: [
274
- /* @__PURE__ */ t.jsx(
275
- r,
278
+ r && /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
279
+ p,
280
+ {
281
+ name: "drag",
282
+ hoverable: !0,
283
+ width: 20,
284
+ height: 20
285
+ }
286
+ ) }),
287
+ b === "select" && /* @__PURE__ */ t.jsx(
288
+ I,
289
+ {
290
+ onChange: (d) => {
291
+ n((j) => [...j].map((g) => g.id === e.id ? {
292
+ ...e,
293
+ name: d
294
+ } : g));
295
+ },
296
+ value: e.name,
297
+ options: L,
298
+ leftAddon: M(e.image)
299
+ }
300
+ ),
301
+ b === "input" && /* @__PURE__ */ t.jsx(
302
+ S,
303
+ {
304
+ onChange: (d) => {
305
+ n((j) => [...j].map((g) => g.id === e.id ? {
306
+ ...e,
307
+ name: d
308
+ } : g));
309
+ },
310
+ value: e.name,
311
+ placeholder: v
312
+ }
313
+ ),
314
+ b === "image" && /* @__PURE__ */ t.jsx(Y, {}),
315
+ /* @__PURE__ */ t.jsxs("div", { className: m.buttons, children: [
316
+ l && /* @__PURE__ */ t.jsx(
317
+ p,
276
318
  {
277
319
  name: "sliders",
278
320
  hoverable: !0,
279
321
  width: 20,
280
322
  height: 20,
281
323
  onClick: (d) => {
282
- w(d, s);
324
+ G(d, e);
283
325
  }
284
326
  }
285
327
  ),
286
328
  /* @__PURE__ */ t.jsx(
287
- r,
329
+ p,
288
330
  {
289
331
  name: "trash",
290
332
  hoverable: !0,
291
- onClick: () => a((d) => d.filter((f) => f.id !== s.id)),
333
+ onClick: () => n((d) => d.filter((j) => j.id !== e.id)),
292
334
  width: 20,
293
335
  height: 20,
294
336
  fill: "#C12A2A"
@@ -297,24 +339,29 @@ const R = "_wrapper_o1bnv_2", E = "_alignmentBlock_o1bnv_8", H = "_title_o1bnv_1
297
339
  ] })
298
340
  ]
299
341
  },
300
- s.id
342
+ e.id
301
343
  )),
302
344
  /* @__PURE__ */ t.jsxs(
303
- S,
345
+ R,
304
346
  {
305
- className: l.button,
347
+ className: m.button,
306
348
  size: "s",
307
- onClick: () => a((s) => {
308
- const d = [...s];
309
- return d.push({
310
- name: "Product 1",
311
- id: L()
349
+ onClick: () => n((e) => {
350
+ const d = [...e];
351
+ return b === "select" ? d.push({
352
+ name: L[0] || "",
353
+ id: P()
354
+ }) : b === "input" ? d.push({
355
+ name: "",
356
+ id: P()
357
+ }) : d.push({
358
+ id: P()
312
359
  }), d;
313
360
  }),
314
361
  children: [
315
362
  /* @__PURE__ */ t.jsx("span", { children: "Add Option" }),
316
363
  /* @__PURE__ */ t.jsx(
317
- r,
364
+ p,
318
365
  {
319
366
  name: "plus",
320
367
  width: 16,
@@ -325,13 +372,13 @@ const R = "_wrapper_o1bnv_2", E = "_alignmentBlock_o1bnv_8", H = "_title_o1bnv_1
325
372
  }
326
373
  )
327
374
  ] }),
328
- i !== void 0 && /* @__PURE__ */ t.jsxs("div", { className: l.other, children: [
329
- /* @__PURE__ */ t.jsx("h5", { className: l.subtitle, children: "Other" }),
375
+ c !== void 0 && /* @__PURE__ */ t.jsxs("div", { className: m.other, children: [
376
+ /* @__PURE__ */ t.jsx("h5", { className: m.subtitle, children: "Other" }),
330
377
  /* @__PURE__ */ t.jsx(
331
- k,
378
+ C,
332
379
  {
333
- current: i,
334
- onChange: (s) => c == null ? void 0 : c((d) => s),
380
+ current: c,
381
+ onChange: (e) => u == null ? void 0 : u((d) => e),
335
382
  label: "Product Stats",
336
383
  hasBackground: !0,
337
384
  paddingless: !1
@@ -339,66 +386,66 @@ const R = "_wrapper_o1bnv_2", E = "_alignmentBlock_o1bnv_8", H = "_title_o1bnv_1
339
386
  )
340
387
  ] })
341
388
  ] });
342
- }, wt = "_subtitle_1y5sw_1", ft = "_header_1y5sw_8", Nt = "_text_1y5sw_9", Bt = "_productsBlock_1y5sw_10", Pt = "_buttonsBlock_1y5sw_11", $t = "_top_1y5sw_22", Ct = "_itemsBlock_1y5sw_29", Tt = "_typeTexts_1y5sw_35", At = "_block_1y5sw_41", St = "_active_1y5sw_52", Lt = "_products_1y5sw_10", zt = "_product_1y5sw_10", It = "_button_1y5sw_11", Rt = "_image_1y5sw_80", Et = "_info_1y5sw_87", Ht = "_name_1y5sw_98", Ot = "_buttons_1y5sw_11", Ft = "_modal_1y5sw_108", Gt = "_other_1y5sw_125", Dt = "_options_1y5sw_131", p = {
343
- subtitle: wt,
344
- header: ft,
345
- text: Nt,
346
- productsBlock: Bt,
347
- buttonsBlock: Pt,
348
- top: $t,
349
- itemsBlock: Ct,
350
- typeTexts: Tt,
351
- block: At,
352
- active: St,
353
- products: Lt,
354
- product: zt,
355
- button: It,
356
- image: Rt,
357
- info: Et,
358
- name: Ht,
359
- buttons: Ot,
360
- modal: Ft,
361
- other: Gt,
362
- options: Dt
363
- }, Mt = (_) => {
364
- const { activeButton: o, setActiveButton: u, popupPosition: n } = _, [a, i] = b.useState(o.typeText), [c, g] = b.useState(o.destination), [v, m] = b.useState(o.link || "");
389
+ }, At = "_subtitle_1y5sw_1", St = "_header_1y5sw_8", Lt = "_text_1y5sw_9", zt = "_productsBlock_1y5sw_10", Ot = "_buttonsBlock_1y5sw_11", Rt = "_top_1y5sw_22", Et = "_itemsBlock_1y5sw_29", Ht = "_typeTexts_1y5sw_35", Ft = "_block_1y5sw_41", Gt = "_active_1y5sw_52", Mt = "_products_1y5sw_10", Dt = "_product_1y5sw_10", Yt = "_button_1y5sw_11", qt = "_image_1y5sw_80", Jt = "_info_1y5sw_87", Kt = "_name_1y5sw_98", Qt = "_buttons_1y5sw_11", Ut = "_modal_1y5sw_108", Vt = "_other_1y5sw_125", Wt = "_options_1y5sw_131", k = {
390
+ subtitle: At,
391
+ header: St,
392
+ text: Lt,
393
+ productsBlock: zt,
394
+ buttonsBlock: Ot,
395
+ top: Rt,
396
+ itemsBlock: Et,
397
+ typeTexts: Ht,
398
+ block: Ft,
399
+ active: Gt,
400
+ products: Mt,
401
+ product: Dt,
402
+ button: Yt,
403
+ image: qt,
404
+ info: Jt,
405
+ name: Kt,
406
+ buttons: Qt,
407
+ modal: Ut,
408
+ other: Vt,
409
+ options: Wt
410
+ }, Xt = (_) => {
411
+ const { activeButton: i, setActiveButton: a, popupPosition: s } = _, [n, c] = y.useState(i.typeText), [u, h] = y.useState(i.destination), [o, l] = y.useState(i.link || "");
365
412
  return /* @__PURE__ */ t.jsxs(
366
413
  "div",
367
414
  {
368
- className: p.modal,
369
- onClick: (e) => {
370
- e.stopPropagation();
415
+ className: k.modal,
416
+ onClick: (r) => {
417
+ r.stopPropagation();
371
418
  },
372
419
  style: {
373
- top: `${n.top}px`,
374
- left: `${n.left}px`
420
+ top: `${s.top}px`,
421
+ left: `${s.left}px`
375
422
  },
376
423
  children: [
377
- /* @__PURE__ */ t.jsxs("div", { className: p.top, children: [
378
- /* @__PURE__ */ t.jsx("h3", { children: o.type }),
424
+ /* @__PURE__ */ t.jsxs("div", { className: k.top, children: [
425
+ /* @__PURE__ */ t.jsx("h3", { children: i.type }),
379
426
  /* @__PURE__ */ t.jsx(
380
- r,
427
+ p,
381
428
  {
382
429
  name: "x",
383
430
  height: 20,
384
431
  width: 20,
385
432
  hoverable: !0,
386
- onClick: () => u(null)
433
+ onClick: () => a(null)
387
434
  }
388
435
  )
389
436
  ] }),
390
- /* @__PURE__ */ t.jsxs("div", { className: p.options, children: [
437
+ /* @__PURE__ */ t.jsxs("div", { className: k.options, children: [
391
438
  /* @__PURE__ */ t.jsx(
392
- C,
439
+ I,
393
440
  {
394
441
  label: "Destination",
395
- onChange: (e) => g(e),
442
+ onChange: (r) => h(r),
396
443
  options: ["Go to Page", "Open Link"],
397
- value: c
444
+ value: u
398
445
  }
399
446
  ),
400
- c === "Go to Page" ? /* @__PURE__ */ t.jsx(
401
- C,
447
+ u === "Go to Page" ? /* @__PURE__ */ t.jsx(
448
+ I,
402
449
  {
403
450
  label: "Go to",
404
451
  onChange: () => {
@@ -407,23 +454,23 @@ const R = "_wrapper_o1bnv_2", E = "_alignmentBlock_o1bnv_8", H = "_title_o1bnv_1
407
454
  value: "Homepage"
408
455
  }
409
456
  ) : /* @__PURE__ */ t.jsx(
410
- T,
457
+ S,
411
458
  {
412
- onChange: (e) => m(e),
413
- value: v,
459
+ onChange: (r) => l(r),
460
+ value: o,
414
461
  placeholder: "https://",
415
462
  label: "Link"
416
463
  }
417
464
  ),
418
465
  /* @__PURE__ */ t.jsx(
419
- k,
466
+ C,
420
467
  {
421
468
  current: !1,
422
469
  label: "Open in new tab"
423
470
  }
424
471
  ),
425
472
  /* @__PURE__ */ t.jsx(
426
- A,
473
+ O,
427
474
  {
428
475
  onChange: () => {
429
476
  },
@@ -433,143 +480,186 @@ const R = "_wrapper_o1bnv_2", E = "_alignmentBlock_o1bnv_8", H = "_title_o1bnv_1
433
480
  }
434
481
  ),
435
482
  /* @__PURE__ */ t.jsx(
436
- z,
483
+ E,
437
484
  {
438
- typeText: a,
439
- setTypeText: i
485
+ typeText: n,
486
+ setTypeText: c
440
487
  }
441
488
  )
442
489
  ] })
443
490
  ]
444
491
  }
445
492
  );
446
- }, Ut = (_) => {
447
- const { isActiveButtons: o, setIsActiveButtons: u, buttons: n, setButtons: a } = _, [i, c] = b.useState(null), [g, v] = b.useState({
493
+ }, Zt = "_subtitle_1y5sw_1", te = "_header_1y5sw_8", ee = "_text_1y5sw_9", se = "_productsBlock_1y5sw_10", ne = "_buttonsBlock_1y5sw_11", oe = "_top_1y5sw_22", ie = "_itemsBlock_1y5sw_29", ce = "_typeTexts_1y5sw_35", le = "_block_1y5sw_41", ae = "_active_1y5sw_52", re = "_products_1y5sw_10", de = "_product_1y5sw_10", _e = "_button_1y5sw_11", ue = "_image_1y5sw_80", pe = "_info_1y5sw_87", me = "_name_1y5sw_98", he = "_buttons_1y5sw_11", xe = "_modal_1y5sw_108", be = "_other_1y5sw_125", ge = "_options_1y5sw_131", B = {
494
+ subtitle: Zt,
495
+ header: te,
496
+ text: ee,
497
+ productsBlock: se,
498
+ buttonsBlock: ne,
499
+ top: oe,
500
+ itemsBlock: ie,
501
+ typeTexts: ce,
502
+ block: le,
503
+ active: ae,
504
+ products: re,
505
+ product: de,
506
+ button: _e,
507
+ image: ue,
508
+ info: pe,
509
+ name: me,
510
+ buttons: he,
511
+ modal: xe,
512
+ other: be,
513
+ options: ge
514
+ }, ye = (_) => {
515
+ const { buttons: i, setButtons: a } = _, [s, n] = y.useState(null), [c, u] = y.useState({
448
516
  top: 0,
449
517
  left: 0
450
518
  });
451
- b.useEffect(() => {
452
- const e = () => {
453
- c(null);
519
+ y.useEffect(() => {
520
+ const o = () => {
521
+ n(null);
454
522
  };
455
- return document.body.addEventListener("click", e), c(null), () => {
456
- c(null), document.body.removeEventListener("click", e);
523
+ return document.body.addEventListener("click", o), n(null), () => {
524
+ n(null), document.body.removeEventListener("click", o);
457
525
  };
458
526
  }, []);
459
- const m = (e, h) => {
460
- e.stopPropagation();
461
- const j = e.target.getBoundingClientRect(), w = 490, s = window.innerHeight;
462
- let d = j.top + window.scrollY;
463
- d + w > s && (d = s - w - 20), v({
464
- top: d,
465
- left: j.left - 30
466
- }), c(h);
527
+ const h = (o, l) => {
528
+ o.stopPropagation();
529
+ const r = o.target.getBoundingClientRect(), f = 490, b = window.innerHeight;
530
+ let v = r.top + window.scrollY;
531
+ v + f > b && (v = b - f - 20), u({
532
+ top: v,
533
+ left: r.left - 30
534
+ }), n(l);
467
535
  };
468
- return /* @__PURE__ */ t.jsx(t.Fragment, { children: /* @__PURE__ */ t.jsxs("div", { className: p.buttonsBlock, children: [
469
- /* @__PURE__ */ t.jsxs("div", { className: p.top, children: [
470
- /* @__PURE__ */ t.jsx("h3", { className: p.title, children: "Buttons" }),
471
- /* @__PURE__ */ t.jsx(
472
- k,
473
- {
474
- current: o,
475
- onChange: (e) => u((h) => e)
476
- }
477
- )
478
- ] }),
479
- /* @__PURE__ */ t.jsxs("div", { className: p.products, children: [
480
- /* @__PURE__ */ t.jsx("h5", { className: p.subtitle, children: "Button Type" }),
481
- n.map((e) => /* @__PURE__ */ t.jsxs(
482
- "div",
483
- {
484
- className: p.product,
485
- children: [
486
- /* @__PURE__ */ t.jsxs("div", { className: p.info, children: [
487
- /* @__PURE__ */ t.jsx("span", { className: p.name, children: e.type }),
488
- /* @__PURE__ */ t.jsx(r, { name: "arrow-down" })
489
- ] }),
490
- /* @__PURE__ */ t.jsxs("div", { className: p.buttons, children: [
491
- /* @__PURE__ */ t.jsx(
492
- r,
493
- {
494
- name: "sliders",
495
- hoverable: !0,
496
- width: 20,
497
- height: 20,
498
- onClick: (h) => {
499
- m(h, e);
500
- }
501
- }
502
- ),
503
- /* @__PURE__ */ t.jsx(
504
- r,
505
- {
506
- name: "trash",
507
- hoverable: !0,
508
- onClick: () => a((h) => h.filter((j) => j.id !== e.id)),
509
- width: 20,
510
- height: 20,
511
- fill: "#C12A2A"
536
+ return /* @__PURE__ */ t.jsxs("div", { className: B.products, children: [
537
+ /* @__PURE__ */ t.jsx("h5", { className: B.subtitle, children: "Button Type" }),
538
+ i.map((o) => /* @__PURE__ */ t.jsxs(
539
+ "div",
540
+ {
541
+ className: B.product,
542
+ children: [
543
+ /* @__PURE__ */ t.jsx(
544
+ I,
545
+ {
546
+ onChange: (l) => {
547
+ a((r) => [...r].map((v) => v.id === o.id ? {
548
+ ...o,
549
+ type: l
550
+ } : v));
551
+ },
552
+ value: o.type,
553
+ options: ["Primary", "Secondary"]
554
+ }
555
+ ),
556
+ /* @__PURE__ */ t.jsxs("div", { className: B.buttons, children: [
557
+ /* @__PURE__ */ t.jsx(
558
+ p,
559
+ {
560
+ name: "sliders",
561
+ hoverable: !0,
562
+ width: 20,
563
+ height: 20,
564
+ onClick: (l) => {
565
+ h(l, o);
512
566
  }
513
- )
514
- ] })
515
- ]
516
- },
517
- e.id
518
- )),
519
- i && /* @__PURE__ */ t.jsx(
520
- Mt,
521
- {
522
- activeButton: i,
523
- setActiveButton: c,
524
- popupPosition: g
525
- }
526
- ),
527
- /* @__PURE__ */ t.jsxs(
528
- S,
529
- {
530
- className: p.button,
531
- size: "s",
532
- onClick: () => a((e) => {
533
- const h = [...e];
534
- return h.push({
535
- type: "Primary",
536
- id: L(),
537
- typeText: "bold",
538
- destination: "Go to Page"
539
- }), h;
540
- }),
541
- children: [
542
- /* @__PURE__ */ t.jsx("span", { children: "Add Option" }),
567
+ }
568
+ ),
543
569
  /* @__PURE__ */ t.jsx(
544
- r,
570
+ p,
545
571
  {
546
- name: "plus",
547
- width: 16,
548
- height: 16
572
+ name: "trash",
573
+ hoverable: !0,
574
+ onClick: () => a((l) => l.filter((r) => r.id !== o.id)),
575
+ width: 20,
576
+ height: 20,
577
+ fill: "#C12A2A"
549
578
  }
550
579
  )
551
- ]
580
+ ] })
581
+ ]
582
+ },
583
+ o.id
584
+ )),
585
+ s && /* @__PURE__ */ t.jsx(
586
+ Xt,
587
+ {
588
+ activeButton: s,
589
+ setActiveButton: n,
590
+ popupPosition: c
591
+ }
592
+ ),
593
+ /* @__PURE__ */ t.jsxs(
594
+ R,
595
+ {
596
+ className: B.button,
597
+ size: "s",
598
+ onClick: () => a((o) => {
599
+ const l = [...o];
600
+ return l.push({
601
+ type: "Primary",
602
+ id: P(),
603
+ typeText: "bold",
604
+ destination: "Go to Page"
605
+ }), l;
606
+ }),
607
+ children: [
608
+ /* @__PURE__ */ t.jsx("span", { children: "Add Option" }),
609
+ /* @__PURE__ */ t.jsx(
610
+ p,
611
+ {
612
+ name: "plus",
613
+ width: 16,
614
+ height: 16
615
+ }
616
+ )
617
+ ]
618
+ }
619
+ )
620
+ ] });
621
+ }, $e = (_) => {
622
+ const { isActiveButtons: i, setIsActiveButtons: a, buttons: s, setButtons: n } = _;
623
+ return /* @__PURE__ */ t.jsx(t.Fragment, { children: /* @__PURE__ */ t.jsxs("div", { className: k.buttonsBlock, children: [
624
+ /* @__PURE__ */ t.jsxs("div", { className: k.top, children: [
625
+ /* @__PURE__ */ t.jsx("h3", { className: k.title, children: "Buttons" }),
626
+ /* @__PURE__ */ t.jsx(
627
+ C,
628
+ {
629
+ current: i,
630
+ onChange: (c) => a((u) => c)
552
631
  }
553
632
  )
554
- ] })
633
+ ] }),
634
+ /* @__PURE__ */ t.jsx(
635
+ ye,
636
+ {
637
+ buttons: s,
638
+ setButtons: n
639
+ }
640
+ )
555
641
  ] }) });
556
642
  };
557
643
  export {
558
- S as Button,
559
- Ut as ButtonsSettings,
560
- Xt as ColorPicker,
561
- r as Icon,
562
- T as Input,
563
- Jt as LayoutSettings,
564
- Zt as Modal,
565
- te as Picker,
566
- Qt as ProductSettings,
567
- ee as Radio,
568
- C as Select,
569
- se as Submodal,
570
- k as Switch,
571
- Kt as TextSettings,
572
- A as Textarea,
573
- ne as Tip,
574
- z as TypeTexts
644
+ R as Button,
645
+ ye as ButtonTypeSettings,
646
+ $e as ButtonsSettings,
647
+ Ne as Checkbox,
648
+ Y as ChooseImage,
649
+ Te as ChooseImageModal,
650
+ Pe as ColorPicker,
651
+ p as Icon,
652
+ S as Input,
653
+ we as ItemsSettings,
654
+ ke as LayoutSettings,
655
+ Ie as Modal,
656
+ Ae as Picker,
657
+ Se as Radio,
658
+ I as Select,
659
+ Le as Submodal,
660
+ C as Switch,
661
+ fe as TextSettings,
662
+ O as Textarea,
663
+ ze as Tip,
664
+ E as TypeTexts
575
665
  };