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