@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/abstractions/IBlock.d.ts +0 -2
- package/dist/abstractions/Variable.d.ts +13 -1
- package/dist/builder.cjs.js +3 -3
- package/dist/builder.es.js +787 -747
- package/dist/{index-D4KlodOJ.cjs → index-C2h2e3d1.cjs} +1 -1
- package/dist/{index-BS_tTsUw.js → index-nLNDQXYl.js} +3 -0
- package/dist/store/useSubmodalStore.d.ts +1 -0
- package/dist/ui/ItemsSettings/index.d.ts +1 -1
- package/dist/ui/ListingSelector/index.d.ts +49 -0
- package/dist/ui/ListingSelector/popup.d.ts +12 -0
- package/dist/ui/index.d.ts +1 -0
- package/dist/ui.cjs.js +1 -1
- package/dist/ui.es.js +786 -493
- package/package.json +1 -1
package/dist/ui.es.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { j as t, I as
|
|
2
|
-
import { h as
|
|
3
|
-
import
|
|
4
|
-
const
|
|
5
|
-
wrapper:
|
|
6
|
-
alignmentBlock:
|
|
7
|
-
title:
|
|
8
|
-
subtitle:
|
|
9
|
-
alignmentContent:
|
|
10
|
-
alignments:
|
|
11
|
-
alignment:
|
|
12
|
-
circle:
|
|
13
|
-
paddings:
|
|
14
|
-
padding:
|
|
15
|
-
input:
|
|
16
|
-
},
|
|
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
|
-
],
|
|
27
|
-
const { alignment: s, padding:
|
|
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:
|
|
47
|
-
/* @__PURE__ */ t.jsx("h3", { className:
|
|
48
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
49
|
-
/* @__PURE__ */ t.jsx("h5", { className:
|
|
50
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
51
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
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
|
-
|
|
55
|
+
a(o);
|
|
56
56
|
},
|
|
57
|
-
className:
|
|
57
|
+
className: A.alignment,
|
|
58
58
|
children: [
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
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
|
-
|
|
71
|
+
o
|
|
72
72
|
)) }),
|
|
73
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
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
|
-
|
|
75
|
+
m,
|
|
76
76
|
{
|
|
77
|
-
name: `align-${
|
|
77
|
+
name: `align-${o}`,
|
|
78
78
|
width: 20,
|
|
79
79
|
height: 20
|
|
80
80
|
}
|
|
81
81
|
) }),
|
|
82
82
|
/* @__PURE__ */ t.jsx(
|
|
83
|
-
|
|
83
|
+
R,
|
|
84
84
|
{
|
|
85
85
|
type: "text",
|
|
86
|
-
value: String(o
|
|
87
|
-
onChange: (
|
|
88
|
-
...
|
|
89
|
-
[
|
|
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
|
-
},
|
|
100
|
-
subtitle:
|
|
101
|
-
header:
|
|
102
|
-
text:
|
|
103
|
-
top:
|
|
104
|
-
itemsBlock:
|
|
105
|
-
},
|
|
106
|
-
typeTexts:
|
|
107
|
-
block:
|
|
108
|
-
active:
|
|
109
|
-
},
|
|
110
|
-
const { typesText: s, setTypesText:
|
|
111
|
-
return /* @__PURE__ */ t.jsx("div", { className:
|
|
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:
|
|
115
|
-
[
|
|
114
|
+
className: Z(Q.block, {
|
|
115
|
+
[Q.active]: s.includes(n)
|
|
116
116
|
}),
|
|
117
117
|
onClick: () => {
|
|
118
|
-
const
|
|
119
|
-
if (
|
|
120
|
-
const e =
|
|
121
|
-
|
|
118
|
+
const a = [...s];
|
|
119
|
+
if (a.includes(n)) {
|
|
120
|
+
const e = a.filter((o) => o !== n);
|
|
121
|
+
c(e);
|
|
122
122
|
} else
|
|
123
|
-
|
|
123
|
+
a.push(n), c(a);
|
|
124
124
|
},
|
|
125
125
|
children: /* @__PURE__ */ t.jsx(
|
|
126
|
-
|
|
126
|
+
m,
|
|
127
127
|
{
|
|
128
|
-
name: `text-${
|
|
129
|
-
fill: s.includes(
|
|
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(
|
|
135
|
+
String(n)
|
|
136
136
|
)) });
|
|
137
|
-
},
|
|
137
|
+
}, Pt = (d) => {
|
|
138
138
|
const {
|
|
139
139
|
typesText: s,
|
|
140
|
-
isActiveText:
|
|
141
|
-
setIsActiveText:
|
|
142
|
-
text:
|
|
140
|
+
isActiveText: c,
|
|
141
|
+
setIsActiveText: n,
|
|
142
|
+
text: a,
|
|
143
143
|
setText: e,
|
|
144
|
-
setTypesText:
|
|
145
|
-
title:
|
|
146
|
-
subtitle:
|
|
144
|
+
setTypesText: o,
|
|
145
|
+
title: i,
|
|
146
|
+
subtitle: v = "Items"
|
|
147
147
|
} = d;
|
|
148
|
-
return /* @__PURE__ */ t.jsxs("div", { className:
|
|
149
|
-
(
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
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:
|
|
155
|
-
onChange: (j) =>
|
|
154
|
+
current: c,
|
|
155
|
+
onChange: (j) => n(j)
|
|
156
156
|
}
|
|
157
157
|
)
|
|
158
158
|
] }),
|
|
159
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
160
|
-
/* @__PURE__ */ t.jsx("h5", { className:
|
|
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
|
-
|
|
162
|
+
tt,
|
|
163
163
|
{
|
|
164
164
|
onChange: (j) => e(j),
|
|
165
|
-
value:
|
|
165
|
+
value: a,
|
|
166
166
|
maxLength: 150
|
|
167
167
|
}
|
|
168
168
|
),
|
|
169
169
|
/* @__PURE__ */ t.jsx(
|
|
170
|
-
|
|
170
|
+
ct,
|
|
171
171
|
{
|
|
172
172
|
typesText: s,
|
|
173
|
-
setTypesText:
|
|
173
|
+
setTypesText: o
|
|
174
174
|
}
|
|
175
175
|
)
|
|
176
176
|
] })
|
|
177
177
|
] });
|
|
178
|
-
},
|
|
179
|
-
subtitle:
|
|
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:
|
|
182
|
-
productsBlock:
|
|
183
|
-
top:
|
|
184
|
-
itemsBlock:
|
|
185
|
-
typeTexts:
|
|
186
|
-
block:
|
|
187
|
-
active:
|
|
188
|
-
products:
|
|
189
|
-
product:
|
|
190
|
-
button:
|
|
191
|
-
image:
|
|
192
|
-
info:
|
|
193
|
-
name:
|
|
194
|
-
buttons:
|
|
195
|
-
modal:
|
|
196
|
-
link:
|
|
197
|
-
modalOptions:
|
|
198
|
-
},
|
|
199
|
-
const { activeItem: s, setActiveItem:
|
|
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:
|
|
203
|
+
className: N.modal,
|
|
204
204
|
onClick: (e) => {
|
|
205
205
|
e.stopPropagation();
|
|
206
206
|
},
|
|
207
207
|
style: {
|
|
208
|
-
top: `${
|
|
209
|
-
left: `${
|
|
208
|
+
top: `${n.top}px`,
|
|
209
|
+
left: `${n.left}px`
|
|
210
210
|
},
|
|
211
211
|
children: [
|
|
212
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
212
|
+
/* @__PURE__ */ t.jsxs("div", { className: N.top, children: [
|
|
213
213
|
/* @__PURE__ */ t.jsx("h3", { children: s.name }),
|
|
214
214
|
/* @__PURE__ */ t.jsx(
|
|
215
|
-
|
|
215
|
+
m,
|
|
216
216
|
{
|
|
217
217
|
name: "x",
|
|
218
218
|
height: 20,
|
|
219
219
|
width: 20,
|
|
220
220
|
hoverable: !0,
|
|
221
|
-
onClick: () =>
|
|
221
|
+
onClick: () => c(null)
|
|
222
222
|
}
|
|
223
223
|
)
|
|
224
224
|
] }),
|
|
225
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
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
|
-
|
|
228
|
+
W,
|
|
229
229
|
{
|
|
230
230
|
label: "Put up an attractive image",
|
|
231
|
-
onChange: (
|
|
232
|
-
const
|
|
231
|
+
onChange: (o) => {
|
|
232
|
+
const i = {
|
|
233
233
|
...s,
|
|
234
|
-
[e.field]:
|
|
234
|
+
[e.field]: o
|
|
235
235
|
};
|
|
236
|
-
|
|
236
|
+
c(i);
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
239
|
);
|
|
240
240
|
if (e.type === "text")
|
|
241
241
|
return /* @__PURE__ */ t.jsx(
|
|
242
|
-
|
|
242
|
+
Pt,
|
|
243
243
|
{
|
|
244
244
|
typesText: s[e.field.type],
|
|
245
|
-
setTypesText: (
|
|
246
|
-
const
|
|
245
|
+
setTypesText: (o) => {
|
|
246
|
+
const i = {
|
|
247
247
|
...s,
|
|
248
|
-
[e.field.type]:
|
|
248
|
+
[e.field.type]: o
|
|
249
249
|
};
|
|
250
|
-
|
|
250
|
+
c(i);
|
|
251
251
|
},
|
|
252
252
|
text: s[e.field.text] || "",
|
|
253
|
-
setText: (
|
|
254
|
-
const
|
|
253
|
+
setText: (o) => {
|
|
254
|
+
const i = {
|
|
255
255
|
...s,
|
|
256
|
-
[e.field.text]:
|
|
256
|
+
[e.field.text]: o
|
|
257
257
|
};
|
|
258
|
-
|
|
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
|
-
|
|
265
|
+
R,
|
|
266
266
|
{
|
|
267
|
-
onChange: (
|
|
268
|
-
const
|
|
267
|
+
onChange: (o) => {
|
|
268
|
+
const i = {
|
|
269
269
|
...s,
|
|
270
|
-
[e.field]:
|
|
270
|
+
[e.field]: o
|
|
271
271
|
};
|
|
272
|
-
|
|
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:
|
|
280
|
+
return /* @__PURE__ */ t.jsxs("div", { className: N.link, children: [
|
|
281
281
|
/* @__PURE__ */ t.jsx(
|
|
282
|
-
|
|
282
|
+
R,
|
|
283
283
|
{
|
|
284
|
-
onChange: (
|
|
285
|
-
const
|
|
284
|
+
onChange: (o) => {
|
|
285
|
+
const i = {
|
|
286
286
|
...s,
|
|
287
|
-
[e.field.text]:
|
|
287
|
+
[e.field.text]: o
|
|
288
288
|
};
|
|
289
|
-
|
|
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
|
-
|
|
297
|
+
L,
|
|
298
298
|
{
|
|
299
299
|
current: !!s[e.field.switch] || !1,
|
|
300
300
|
label: e.switchLabel,
|
|
301
|
-
onChange: (
|
|
302
|
-
const
|
|
301
|
+
onChange: (o) => {
|
|
302
|
+
const i = {
|
|
303
303
|
...s,
|
|
304
|
-
[e.field.switch]:
|
|
304
|
+
[e.field.switch]: o
|
|
305
305
|
};
|
|
306
|
-
|
|
306
|
+
c(i);
|
|
307
307
|
}
|
|
308
308
|
}
|
|
309
309
|
)
|
|
310
310
|
] });
|
|
311
311
|
if (e.type === "list")
|
|
312
312
|
return /* @__PURE__ */ t.jsx(
|
|
313
|
-
|
|
313
|
+
te,
|
|
314
314
|
{
|
|
315
315
|
items: s[e.field] || [],
|
|
316
|
-
setItems: (
|
|
317
|
-
const
|
|
316
|
+
setItems: (o) => {
|
|
317
|
+
const i = {
|
|
318
318
|
...s,
|
|
319
|
-
[e.field]:
|
|
319
|
+
[e.field]: o
|
|
320
320
|
};
|
|
321
|
-
|
|
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
|
-
|
|
333
|
+
H,
|
|
334
334
|
{
|
|
335
335
|
options: e.itemsOptions,
|
|
336
|
-
onChange: (
|
|
337
|
-
const
|
|
336
|
+
onChange: (o) => {
|
|
337
|
+
const i = {
|
|
338
338
|
...s,
|
|
339
|
-
[e.field]:
|
|
339
|
+
[e.field]: o
|
|
340
340
|
};
|
|
341
|
-
|
|
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
|
-
},
|
|
352
|
-
other:
|
|
353
|
-
subtitle:
|
|
354
|
-
items:
|
|
355
|
-
},
|
|
356
|
-
const { items: s, title:
|
|
357
|
-
return /* @__PURE__ */ t.jsxs("div", { className:
|
|
358
|
-
/* @__PURE__ */ t.jsx("h5", { className:
|
|
359
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
360
|
-
|
|
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:
|
|
363
|
-
onChange: (
|
|
364
|
-
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
|
-
},
|
|
371
|
-
const { index: s, moveProduct:
|
|
370
|
+
}, Zt = (d) => {
|
|
371
|
+
const { index: s, moveProduct: c, children: n } = d, [, a] = nt({
|
|
372
372
|
accept: "product",
|
|
373
|
-
hover(
|
|
374
|
-
|
|
373
|
+
hover(i) {
|
|
374
|
+
i.index !== s && (c(i.index, s), i.index = s);
|
|
375
375
|
}
|
|
376
|
-
}), [{ isDragging: e },
|
|
376
|
+
}), [{ isDragging: e }, o] = ot({
|
|
377
377
|
type: "product",
|
|
378
378
|
item: { index: s },
|
|
379
|
-
collect: (
|
|
380
|
-
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: (
|
|
387
|
-
className: `${
|
|
388
|
-
children:
|
|
386
|
+
ref: (i) => o(a(i)),
|
|
387
|
+
className: `${N.product} ${e ? N.dragging : ""}`,
|
|
388
|
+
children: n
|
|
389
389
|
}
|
|
390
390
|
);
|
|
391
|
-
},
|
|
391
|
+
}, te = (d) => {
|
|
392
392
|
const {
|
|
393
393
|
isActiveItems: s,
|
|
394
|
-
setIsActiveItems:
|
|
395
|
-
items:
|
|
396
|
-
setItems:
|
|
394
|
+
setIsActiveItems: c,
|
|
395
|
+
items: n,
|
|
396
|
+
setItems: a,
|
|
397
397
|
other: e,
|
|
398
|
-
title:
|
|
399
|
-
subtitle:
|
|
400
|
-
editable:
|
|
398
|
+
title: o,
|
|
399
|
+
subtitle: i,
|
|
400
|
+
editable: v = !0,
|
|
401
401
|
draggable: j = !1,
|
|
402
|
-
withImage:
|
|
403
|
-
deletable:
|
|
404
|
-
addable:
|
|
405
|
-
itemsType:
|
|
406
|
-
itemsPlaceholder:
|
|
402
|
+
withImage: u = !1,
|
|
403
|
+
deletable: b = !0,
|
|
404
|
+
addable: h = !0,
|
|
405
|
+
itemsType: w,
|
|
406
|
+
itemsPlaceholder: p = "",
|
|
407
407
|
itemsOptions: _,
|
|
408
|
-
hasRangeSelector:
|
|
409
|
-
rangeSelectorOptions:
|
|
410
|
-
modalOptions:
|
|
408
|
+
hasRangeSelector: I = !1,
|
|
409
|
+
rangeSelectorOptions: Y,
|
|
410
|
+
modalOptions: U,
|
|
411
411
|
addableOptions: z = {}
|
|
412
|
-
} = d, [
|
|
412
|
+
} = d, [S, O] = g.useState(null), [J, K] = g.useState({
|
|
413
413
|
top: 0,
|
|
414
414
|
left: 0
|
|
415
|
-
}),
|
|
416
|
-
const
|
|
417
|
-
|
|
415
|
+
}), q = (l, $) => {
|
|
416
|
+
const f = [...n], [x] = f.splice(l, 1);
|
|
417
|
+
f.splice($, 0, x), a(f);
|
|
418
418
|
};
|
|
419
|
-
|
|
419
|
+
g.useEffect(() => {
|
|
420
420
|
const l = () => {
|
|
421
|
-
|
|
421
|
+
O(null);
|
|
422
422
|
};
|
|
423
|
-
return document.body.addEventListener("click", l),
|
|
424
|
-
|
|
423
|
+
return document.body.addEventListener("click", l), O(null), () => {
|
|
424
|
+
O(null), document.body.removeEventListener("click", l);
|
|
425
425
|
};
|
|
426
|
-
}, []),
|
|
427
|
-
if (
|
|
428
|
-
const l = [...
|
|
429
|
-
|
|
426
|
+
}, []), g.useEffect(() => {
|
|
427
|
+
if (S) {
|
|
428
|
+
const l = [...n].map(($) => $.id === S.id ? S : $);
|
|
429
|
+
a(l);
|
|
430
430
|
}
|
|
431
|
-
}, [
|
|
432
|
-
const
|
|
431
|
+
}, [S]);
|
|
432
|
+
const r = (l, $) => {
|
|
433
433
|
l.stopPropagation();
|
|
434
|
-
const
|
|
435
|
-
let
|
|
436
|
-
|
|
437
|
-
top:
|
|
438
|
-
left:
|
|
439
|
-
}),
|
|
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
|
-
|
|
442
|
-
|
|
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
|
-
|
|
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
|
|
462
|
-
const
|
|
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
|
-
|
|
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
|
-
|
|
473
|
-
|
|
473
|
+
w === "select" && /* @__PURE__ */ t.jsx(
|
|
474
|
+
H,
|
|
474
475
|
{
|
|
475
|
-
onChange: (
|
|
476
|
-
const
|
|
476
|
+
onChange: (x) => {
|
|
477
|
+
const T = [...n].map((B) => B.id === l.id ? {
|
|
477
478
|
...l,
|
|
478
|
-
name:
|
|
479
|
-
} :
|
|
480
|
-
|
|
479
|
+
name: x
|
|
480
|
+
} : B);
|
|
481
|
+
O({
|
|
481
482
|
...l,
|
|
482
|
-
name:
|
|
483
|
-
}),
|
|
483
|
+
name: x
|
|
484
|
+
}), a([...T]);
|
|
484
485
|
},
|
|
485
486
|
value: l.name,
|
|
486
487
|
options: _,
|
|
487
|
-
leftAddon:
|
|
488
|
+
leftAddon: k(l.images)
|
|
488
489
|
}
|
|
489
490
|
),
|
|
490
|
-
|
|
491
|
-
|
|
491
|
+
w === "input" && /* @__PURE__ */ t.jsx(
|
|
492
|
+
R,
|
|
492
493
|
{
|
|
493
|
-
onChange: (
|
|
494
|
-
const
|
|
494
|
+
onChange: (x) => {
|
|
495
|
+
const T = [...n].map((B) => B.id === l.id ? {
|
|
495
496
|
...l,
|
|
496
|
-
name:
|
|
497
|
-
} :
|
|
498
|
-
|
|
497
|
+
name: x
|
|
498
|
+
} : B);
|
|
499
|
+
a([...T]);
|
|
499
500
|
},
|
|
500
501
|
value: l.name,
|
|
501
|
-
placeholder:
|
|
502
|
+
placeholder: p
|
|
502
503
|
}
|
|
503
504
|
),
|
|
504
|
-
|
|
505
|
-
|
|
505
|
+
w === "image" && /* @__PURE__ */ t.jsx(
|
|
506
|
+
W,
|
|
506
507
|
{
|
|
507
|
-
onChange: (
|
|
508
|
-
const
|
|
508
|
+
onChange: (x) => {
|
|
509
|
+
const T = [...n].map((B) => B.id === l.id ? {
|
|
509
510
|
...l,
|
|
510
|
-
image:
|
|
511
|
-
} :
|
|
512
|
-
|
|
511
|
+
image: x[0]
|
|
512
|
+
} : B);
|
|
513
|
+
a([...T]);
|
|
513
514
|
}
|
|
514
515
|
}
|
|
515
516
|
),
|
|
516
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
517
|
-
|
|
518
|
-
|
|
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: (
|
|
525
|
+
onClick: (x) => r(x, l)
|
|
525
526
|
}
|
|
526
527
|
),
|
|
527
|
-
|
|
528
|
-
|
|
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: () =>
|
|
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
|
-
|
|
542
|
+
Zt,
|
|
542
543
|
{
|
|
543
544
|
product: l,
|
|
544
|
-
index:
|
|
545
|
-
moveProduct:
|
|
546
|
-
children:
|
|
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:
|
|
553
|
-
children:
|
|
553
|
+
className: N.product,
|
|
554
|
+
children: f
|
|
554
555
|
},
|
|
555
556
|
l.id
|
|
556
557
|
);
|
|
557
558
|
};
|
|
558
|
-
return /* @__PURE__ */ t.jsxs("div", { className:
|
|
559
|
-
(
|
|
560
|
-
|
|
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
|
-
|
|
563
|
+
L,
|
|
563
564
|
{
|
|
564
565
|
current: s,
|
|
565
|
-
onChange: (l) =>
|
|
566
|
+
onChange: (l) => c == null ? void 0 : c(l)
|
|
566
567
|
}
|
|
567
568
|
)
|
|
568
569
|
] }),
|
|
569
|
-
|
|
570
|
-
|
|
570
|
+
S && v && U && /* @__PURE__ */ t.jsx(
|
|
571
|
+
Qt,
|
|
571
572
|
{
|
|
572
|
-
activeItem:
|
|
573
|
-
setActiveItem:
|
|
574
|
-
popupPosition:
|
|
575
|
-
modalOptions:
|
|
573
|
+
activeItem: S,
|
|
574
|
+
setActiveItem: O,
|
|
575
|
+
popupPosition: J,
|
|
576
|
+
modalOptions: U
|
|
576
577
|
}
|
|
577
578
|
),
|
|
578
|
-
|
|
579
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
580
|
-
|
|
581
|
-
j ? /* @__PURE__ */ t.jsx(et, { backend: st, children:
|
|
582
|
-
|
|
583
|
-
|
|
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:
|
|
586
|
+
className: N.button,
|
|
586
587
|
size: "s",
|
|
587
588
|
onClick: () => {
|
|
588
|
-
const l = [...
|
|
589
|
-
|
|
590
|
-
name: _[0] || `Product ${
|
|
591
|
-
id:
|
|
589
|
+
const l = [...n];
|
|
590
|
+
w === "select" ? l.push({
|
|
591
|
+
name: _[0] || `Product ${n.length + 1}`,
|
|
592
|
+
id: G(),
|
|
592
593
|
...z
|
|
593
|
-
}) :
|
|
594
|
+
}) : w === "input" ? l.push({
|
|
594
595
|
name: "",
|
|
595
|
-
id:
|
|
596
|
+
id: G(),
|
|
596
597
|
...z
|
|
597
598
|
}) : l.push({
|
|
598
|
-
name: `Image ${
|
|
599
|
-
id:
|
|
599
|
+
name: `Image ${n.length + 1}`,
|
|
600
|
+
id: G(),
|
|
600
601
|
...z
|
|
601
|
-
}),
|
|
602
|
+
}), a(l);
|
|
602
603
|
},
|
|
603
604
|
children: [
|
|
604
605
|
/* @__PURE__ */ t.jsx("span", { children: "Add Option" }),
|
|
605
606
|
/* @__PURE__ */ t.jsx(
|
|
606
|
-
|
|
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(
|
|
618
|
+
e !== void 0 && /* @__PURE__ */ t.jsx(lt, { items: e })
|
|
618
619
|
] });
|
|
619
|
-
},
|
|
620
|
-
subtitle:
|
|
621
|
-
header:
|
|
622
|
-
text:
|
|
623
|
-
productsBlock:
|
|
624
|
-
buttonsBlock:
|
|
625
|
-
top:
|
|
626
|
-
itemsBlock:
|
|
627
|
-
typeTexts:
|
|
628
|
-
block:
|
|
629
|
-
active:
|
|
630
|
-
products:
|
|
631
|
-
product:
|
|
632
|
-
button:
|
|
633
|
-
image:
|
|
634
|
-
info:
|
|
635
|
-
name:
|
|
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:
|
|
638
|
-
other:
|
|
639
|
-
options:
|
|
640
|
-
},
|
|
641
|
-
const { activeButton: s, setActiveButton:
|
|
642
|
-
return
|
|
643
|
-
|
|
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:
|
|
647
|
-
link:
|
|
648
|
-
destination:
|
|
649
|
-
typesText:
|
|
647
|
+
text: u,
|
|
648
|
+
link: v,
|
|
649
|
+
destination: o,
|
|
650
|
+
typesText: a
|
|
650
651
|
}
|
|
651
652
|
});
|
|
652
|
-
}, [
|
|
653
|
+
}, [a, o, v, u]), /* @__PURE__ */ t.jsxs(
|
|
653
654
|
"div",
|
|
654
655
|
{
|
|
655
|
-
className:
|
|
656
|
-
onClick: (
|
|
657
|
-
|
|
656
|
+
className: E.modal,
|
|
657
|
+
onClick: (h) => {
|
|
658
|
+
h.stopPropagation();
|
|
658
659
|
},
|
|
659
660
|
style: {
|
|
660
|
-
top: `${
|
|
661
|
-
left: `${
|
|
661
|
+
top: `${n.top}px`,
|
|
662
|
+
left: `${n.left}px`
|
|
662
663
|
},
|
|
663
664
|
children: [
|
|
664
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
665
|
+
/* @__PURE__ */ t.jsxs("div", { className: E.top, children: [
|
|
665
666
|
/* @__PURE__ */ t.jsx("h3", { children: s.type }),
|
|
666
667
|
/* @__PURE__ */ t.jsx(
|
|
667
|
-
|
|
668
|
+
m,
|
|
668
669
|
{
|
|
669
670
|
name: "x",
|
|
670
671
|
height: 20,
|
|
671
672
|
width: 20,
|
|
672
673
|
hoverable: !0,
|
|
673
|
-
onClick: () =>
|
|
674
|
+
onClick: () => c(null)
|
|
674
675
|
}
|
|
675
676
|
)
|
|
676
677
|
] }),
|
|
677
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
678
|
+
/* @__PURE__ */ t.jsxs("div", { className: E.options, children: [
|
|
678
679
|
/* @__PURE__ */ t.jsx(
|
|
679
|
-
|
|
680
|
+
H,
|
|
680
681
|
{
|
|
681
682
|
label: "Destination",
|
|
682
|
-
onChange: (
|
|
683
|
+
onChange: (h) => i(h),
|
|
683
684
|
options: ["Go to Page", "Open Link"],
|
|
684
|
-
value:
|
|
685
|
+
value: o
|
|
685
686
|
}
|
|
686
687
|
),
|
|
687
|
-
|
|
688
|
-
|
|
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
|
-
|
|
698
|
+
R,
|
|
698
699
|
{
|
|
699
|
-
onChange: (
|
|
700
|
-
value:
|
|
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
|
-
|
|
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
|
-
|
|
714
|
+
tt,
|
|
714
715
|
{
|
|
715
|
-
onChange: (
|
|
716
|
-
value:
|
|
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
|
-
|
|
723
|
+
ct,
|
|
723
724
|
{
|
|
724
|
-
typesText:
|
|
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
|
-
},
|
|
733
|
-
subtitle:
|
|
734
|
-
header:
|
|
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:
|
|
737
|
-
buttonsBlock:
|
|
737
|
+
productsBlock: we,
|
|
738
|
+
buttonsBlock: Ne,
|
|
738
739
|
top: Be,
|
|
739
|
-
itemsBlock:
|
|
740
|
-
typeTexts:
|
|
741
|
-
block:
|
|
742
|
-
active:
|
|
743
|
-
products:
|
|
740
|
+
itemsBlock: Ce,
|
|
741
|
+
typeTexts: Pe,
|
|
742
|
+
block: Ie,
|
|
743
|
+
active: Te,
|
|
744
|
+
products: Ae,
|
|
744
745
|
product: Se,
|
|
745
|
-
button:
|
|
746
|
-
image:
|
|
746
|
+
button: Oe,
|
|
747
|
+
image: De,
|
|
747
748
|
info: Le,
|
|
748
|
-
name:
|
|
749
|
+
name: Ee,
|
|
749
750
|
buttons: Re,
|
|
750
|
-
modal:
|
|
751
|
+
modal: He,
|
|
751
752
|
other: ze,
|
|
752
|
-
options:
|
|
753
|
-
},
|
|
754
|
-
const { buttons: s, setButtons:
|
|
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
|
-
|
|
759
|
-
const
|
|
760
|
-
|
|
759
|
+
g.useEffect(() => {
|
|
760
|
+
const u = () => {
|
|
761
|
+
o(null);
|
|
761
762
|
};
|
|
762
|
-
return document.body.addEventListener("click",
|
|
763
|
-
|
|
763
|
+
return document.body.addEventListener("click", u), o(null), () => {
|
|
764
|
+
o(null), document.body.removeEventListener("click", u);
|
|
764
765
|
};
|
|
765
|
-
}, []),
|
|
766
|
+
}, []), g.useEffect(() => {
|
|
766
767
|
if (e) {
|
|
767
|
-
const
|
|
768
|
-
|
|
768
|
+
const u = [...s].map((b) => b.id === e.id ? e : b);
|
|
769
|
+
c(u);
|
|
769
770
|
}
|
|
770
771
|
}, [e]);
|
|
771
|
-
const j = (
|
|
772
|
-
|
|
773
|
-
const
|
|
774
|
-
let _ =
|
|
775
|
-
_ +
|
|
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:
|
|
778
|
-
}),
|
|
778
|
+
left: h.left - 30
|
|
779
|
+
}), o(b);
|
|
779
780
|
};
|
|
780
|
-
return /* @__PURE__ */ t.jsxs("div", { className:
|
|
781
|
-
/* @__PURE__ */ t.jsx("h5", { className:
|
|
782
|
-
s.map((
|
|
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:
|
|
786
|
+
className: F.product,
|
|
786
787
|
children: [
|
|
787
788
|
/* @__PURE__ */ t.jsx(
|
|
788
|
-
|
|
789
|
+
H,
|
|
789
790
|
{
|
|
790
|
-
onChange: (
|
|
791
|
-
const
|
|
792
|
-
...
|
|
793
|
-
type:
|
|
794
|
-
} :
|
|
795
|
-
|
|
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:
|
|
798
|
+
value: u.type,
|
|
798
799
|
options: ["Primary", "Secondary", "Tertiary"]
|
|
799
800
|
}
|
|
800
801
|
),
|
|
801
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
802
|
+
/* @__PURE__ */ t.jsxs("div", { className: F.buttons, children: [
|
|
802
803
|
/* @__PURE__ */ t.jsx(
|
|
803
|
-
|
|
804
|
+
m,
|
|
804
805
|
{
|
|
805
806
|
name: "sliders",
|
|
806
807
|
hoverable: !0,
|
|
807
808
|
width: 20,
|
|
808
809
|
height: 20,
|
|
809
|
-
onClick: (
|
|
810
|
-
j(
|
|
810
|
+
onClick: (b) => {
|
|
811
|
+
j(b, u);
|
|
811
812
|
}
|
|
812
813
|
}
|
|
813
814
|
),
|
|
814
|
-
|
|
815
|
-
|
|
815
|
+
n && /* @__PURE__ */ t.jsx(
|
|
816
|
+
m,
|
|
816
817
|
{
|
|
817
818
|
name: "trash",
|
|
818
819
|
hoverable: !0,
|
|
819
820
|
onClick: () => {
|
|
820
|
-
const
|
|
821
|
-
|
|
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
|
-
|
|
832
|
+
u.id
|
|
832
833
|
)),
|
|
833
834
|
e && /* @__PURE__ */ t.jsx(
|
|
834
|
-
|
|
835
|
+
je,
|
|
835
836
|
{
|
|
836
837
|
activeButton: e,
|
|
837
|
-
setActiveButton:
|
|
838
|
-
popupPosition:
|
|
838
|
+
setActiveButton: o,
|
|
839
|
+
popupPosition: i
|
|
839
840
|
}
|
|
840
841
|
),
|
|
841
|
-
|
|
842
|
-
|
|
842
|
+
a && /* @__PURE__ */ t.jsxs(
|
|
843
|
+
X,
|
|
843
844
|
{
|
|
844
|
-
className:
|
|
845
|
+
className: F.button,
|
|
845
846
|
size: "s",
|
|
846
847
|
onClick: () => {
|
|
847
|
-
const
|
|
848
|
-
|
|
848
|
+
const u = [...s];
|
|
849
|
+
u.push({
|
|
849
850
|
type: "Primary",
|
|
850
|
-
id:
|
|
851
|
+
id: G(),
|
|
851
852
|
typesText: [],
|
|
852
853
|
destination: "Go to Page",
|
|
853
854
|
text: ""
|
|
854
|
-
}),
|
|
855
|
+
}), c(u);
|
|
855
856
|
},
|
|
856
857
|
children: [
|
|
857
858
|
/* @__PURE__ */ t.jsx("span", { children: "Add Option" }),
|
|
858
859
|
/* @__PURE__ */ t.jsx(
|
|
859
|
-
|
|
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
|
-
},
|
|
871
|
-
const { isActiveButtons: s, setIsActiveButtons:
|
|
872
|
-
return /* @__PURE__ */ t.jsx(t.Fragment, { children: /* @__PURE__ */ t.jsxs("div", { className:
|
|
873
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
874
|
-
/* @__PURE__ */ t.jsx("h3", { className:
|
|
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
|
-
|
|
877
|
+
L,
|
|
877
878
|
{
|
|
878
879
|
current: s,
|
|
879
|
-
onChange: (e) =>
|
|
880
|
+
onChange: (e) => c(e)
|
|
880
881
|
}
|
|
881
882
|
)
|
|
882
883
|
] }),
|
|
883
884
|
/* @__PURE__ */ t.jsx(
|
|
884
|
-
|
|
885
|
+
Fe,
|
|
885
886
|
{
|
|
886
|
-
buttons:
|
|
887
|
-
setButtons:
|
|
887
|
+
buttons: n,
|
|
888
|
+
setButtons: a
|
|
888
889
|
}
|
|
889
890
|
)
|
|
890
891
|
] }) });
|
|
891
|
-
},
|
|
892
|
-
wrapper:
|
|
893
|
-
subtitle:
|
|
894
|
-
content:
|
|
895
|
-
range:
|
|
896
|
-
track:
|
|
897
|
-
progress:
|
|
898
|
-
dots:
|
|
899
|
-
dot:
|
|
900
|
-
active:
|
|
901
|
-
input:
|
|
902
|
-
countBlock:
|
|
903
|
-
count:
|
|
904
|
-
controls:
|
|
905
|
-
button:
|
|
906
|
-
},
|
|
907
|
-
const { label: s, min:
|
|
908
|
-
e <
|
|
909
|
-
},
|
|
910
|
-
e >
|
|
911
|
-
},
|
|
912
|
-
const _ =
|
|
913
|
-
|
|
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:
|
|
916
|
-
s && /* @__PURE__ */ t.jsx("h5", { className:
|
|
917
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
918
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
919
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
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:
|
|
924
|
-
style: { width: `${
|
|
924
|
+
className: y.progress,
|
|
925
|
+
style: { width: `${u}%` }
|
|
925
926
|
}
|
|
926
927
|
),
|
|
927
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
928
|
-
const
|
|
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: () =>
|
|
933
|
-
className:
|
|
934
|
-
[
|
|
935
|
-
[
|
|
936
|
-
[
|
|
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 ${
|
|
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:
|
|
948
|
-
max:
|
|
949
|
-
step:
|
|
948
|
+
min: c,
|
|
949
|
+
max: n,
|
|
950
|
+
step: a,
|
|
950
951
|
value: e,
|
|
951
|
-
onChange: (
|
|
952
|
-
onMouseDown: () =>
|
|
953
|
-
onMouseUp: () =>
|
|
954
|
-
onTouchStart: () =>
|
|
955
|
-
onTouchEnd: () =>
|
|
956
|
-
className:
|
|
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:
|
|
961
|
+
/* @__PURE__ */ t.jsxs("div", { className: y.countBlock, children: [
|
|
961
962
|
/* @__PURE__ */ t.jsx(
|
|
962
|
-
|
|
963
|
+
R,
|
|
963
964
|
{
|
|
964
965
|
type: "number",
|
|
965
|
-
min:
|
|
966
|
-
max:
|
|
966
|
+
min: c,
|
|
967
|
+
max: n,
|
|
967
968
|
paddingless: !0,
|
|
968
|
-
onChange: (
|
|
969
|
-
const _ = Number(
|
|
970
|
-
_ >
|
|
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:
|
|
976
|
+
/* @__PURE__ */ t.jsxs("div", { className: y.controls, children: [
|
|
976
977
|
/* @__PURE__ */ t.jsx(
|
|
977
978
|
"button",
|
|
978
979
|
{
|
|
979
|
-
onClick:
|
|
980
|
-
disabled: e >=
|
|
981
|
-
className:
|
|
980
|
+
onClick: b,
|
|
981
|
+
disabled: e >= n,
|
|
982
|
+
className: y.button,
|
|
982
983
|
"aria-label": "Increment count",
|
|
983
984
|
children: /* @__PURE__ */ t.jsx(
|
|
984
|
-
|
|
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:
|
|
998
|
-
disabled: e <=
|
|
999
|
-
className:
|
|
998
|
+
onClick: h,
|
|
999
|
+
disabled: e <= c,
|
|
1000
|
+
className: y.button,
|
|
1000
1001
|
"aria-label": "Decrement count",
|
|
1001
1002
|
children: /* @__PURE__ */ t.jsx(
|
|
1002
|
-
|
|
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
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
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
|
};
|