@useinsider/guido 2.0.0-beta.b46bbf6 → 2.0.0-beta.b889d81
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/composables/useStripo.js +37 -35
- package/dist/config/migrator/index.js +8 -9
- package/dist/extensions/Blocks/CouponBlock/constants.js +4 -0
- package/dist/extensions/Blocks/CouponBlock/controls/index.js +29 -0
- package/dist/extensions/Blocks/CouponBlock/extension.js +5 -4
- package/dist/extensions/Blocks/CouponBlock/settingsPanel.js +20 -14
- package/dist/extensions/Blocks/CouponBlock/template.js +22 -11
- package/dist/extensions/Blocks/Items/block.js +40 -39
- package/dist/extensions/Blocks/Items/controls/cardComposition.js +49 -46
- package/dist/extensions/Blocks/Items/controls/price/priceOrientation.js +26 -28
- package/dist/extensions/Blocks/Items/controls/settingsControl.js +127 -132
- package/dist/extensions/Blocks/Items/enums/settingsEnums.js +2 -2
- package/dist/extensions/Blocks/Items/layouts/horizontal.html.js +48 -58
- package/dist/extensions/Blocks/Items/layouts/vertical.html.js +58 -48
- package/dist/extensions/Blocks/Items/store/items-block.js +2 -2
- package/dist/extensions/Blocks/Items/template.js +123 -296
- package/dist/extensions/Blocks/Items/utils/syncAttributesFromConfigBlock.js +20 -11
- package/dist/extensions/Blocks/Recommendation/control.js +1 -1
- package/dist/extensions/Blocks/common-control.js +53 -64
- package/dist/extensions/Blocks/controlFactories.js +122 -111
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +290 -364
- package/dist/package.json.js +7 -0
- package/dist/src/extensions/Blocks/CouponBlock/constants.d.ts +14 -0
- package/dist/src/extensions/Blocks/CouponBlock/controls/index.d.ts +108 -0
- package/dist/src/extensions/Blocks/CouponBlock/template.d.ts +1 -1
- package/dist/src/extensions/Blocks/Items/controls/price/priceOrientation.d.ts +1 -1
- package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +4 -0
- package/dist/src/extensions/Blocks/Items/template.d.ts +1 -20
- package/dist/src/extensions/Blocks/common-control.d.ts +8 -13
- package/dist/src/extensions/Blocks/controlFactories.d.ts +30 -7
- package/package.json +3 -3
- package/dist/config/migrator/itemsBlockMigrator.js +0 -283
- package/dist/extensions/Blocks/Items/utils/nodeConfigUtils.js +0 -172
- package/dist/src/config/migrator/itemsBlockMigrator.d.ts +0 -6
- package/dist/src/extensions/Blocks/Items/utils/nodeConfigUtils.d.ts +0 -71
|
@@ -1,86 +1,29 @@
|
|
|
1
|
-
import { BlockType as
|
|
2
|
-
import { ItemsBlockId as
|
|
3
|
-
import { productPairs as
|
|
4
|
-
import { ItemInCartOptions as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
let [
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
product-attr="imageSrc"
|
|
16
|
-
data-type="${e}"
|
|
17
|
-
data-number="${t}"
|
|
18
|
-
style="font-size: 0px;">
|
|
19
|
-
<a class="document-node-component ng-star-inserted"
|
|
20
|
-
target="_blank"
|
|
21
|
-
href="#!">
|
|
22
|
-
<img class="adapt-img document-node-component ng-star-inserted"
|
|
23
|
-
src="${N}"
|
|
24
|
-
alt="${A}"
|
|
25
|
-
width="${a}">
|
|
26
|
-
</a>
|
|
27
|
-
</td>
|
|
28
|
-
`;
|
|
29
|
-
}, Q = (e, t) => `
|
|
30
|
-
<${$.BLOCK_IMAGE}
|
|
31
|
-
${R.BLOCK_IMAGE.src}="${N}"
|
|
32
|
-
${R.BLOCK_IMAGE.alt}="${A}"
|
|
33
|
-
${R.BLOCK_IMAGE.href}="#!"
|
|
34
|
-
${R.BLOCK_IMAGE.width}="${P.productImageWidth}"
|
|
35
|
-
${R.BLOCK_IMAGE.height}="${P.productImageWidth}"
|
|
36
|
-
esd-extension-block-id="${b.IMAGE}"
|
|
1
|
+
import { BlockType as l, BlockAttr as _ } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
import { ItemsBlockId as T } from "./enums/controlEnums.js";
|
|
3
|
+
import { productPairs as i, templateFirstLine as N } from "./enums/productEnums.js";
|
|
4
|
+
import { ItemInCartOptions as f, SETTINGS_ENUMS as O, DefaultConfigValues as P } from "./enums/settingsEnums.js";
|
|
5
|
+
import B from "./layouts/horizontal.html.js";
|
|
6
|
+
import g from "./layouts/vertical.html.js";
|
|
7
|
+
let [C] = i.PAIRS_FOR_EXTENSION.imageSrc.CART_ITEMS.DEFAULT, [A] = i.PAIRS_FOR_EXTENSION.name.CART_ITEMS.DEFAULT, [p] = i.PAIRS_FOR_EXTENSION.price.CART_ITEMS.DEFAULT_PRICE_FORMATTED, [I] = i.PAIRS_FOR_EXTENSION.originalPrice.CART_ITEMS.DEFAULT_PRICE_FORMATTED, [u] = i.PAIRS_FOR_EXTENSION.quantity.CART_ITEMS.DEFAULT;
|
|
8
|
+
const h = (a, t) => `
|
|
9
|
+
<${l.BLOCK_IMAGE}
|
|
10
|
+
${_.BLOCK_IMAGE.src}="${C}"
|
|
11
|
+
${_.BLOCK_IMAGE.alt}="${A}"
|
|
12
|
+
${_.BLOCK_IMAGE.href}="#!"
|
|
13
|
+
${_.BLOCK_IMAGE.width}=${P.productImageWidth}
|
|
14
|
+
esd-extension-block-id="${T.IMAGE}"
|
|
37
15
|
data-slot-1
|
|
38
16
|
product-attr="imageSrc"
|
|
39
|
-
data-type="${
|
|
17
|
+
data-type="${a}"
|
|
40
18
|
data-number="${t}"
|
|
41
19
|
/>
|
|
42
|
-
`,
|
|
43
|
-
|
|
44
|
-
text-decoration:none;
|
|
45
|
-
font-size: inherit;
|
|
46
|
-
font-weight: inherit;
|
|
47
|
-
line-height: inherit;
|
|
48
|
-
font-family: inherit;
|
|
49
|
-
color: inherit;
|
|
50
|
-
display: block;
|
|
51
|
-
word-wrap:break-word;
|
|
52
|
-
white-space: nowrap;
|
|
53
|
-
width: ${n === y.ORIENTATION.HORIZONTAL ? "130px" : "520px"};
|
|
54
|
-
overflow: hidden;
|
|
55
|
-
text-overflow: ellipsis;
|
|
56
|
-
`, o = a || l;
|
|
57
|
-
return t ? `
|
|
58
|
-
<td class="esd-block-text es-p10"
|
|
59
|
-
align="center"
|
|
60
|
-
width="100%"
|
|
61
|
-
data-type="${e}"
|
|
62
|
-
esd-extension-block-id="${b.NAME}"
|
|
63
|
-
style="display: table-cell;">
|
|
64
|
-
<div id="renderedContent" class="service-element text-block-input-area text-block-preview-area"
|
|
65
|
-
style="outline: none;" contenteditable="">
|
|
66
|
-
<p contenteditable="false" path="1">
|
|
67
|
-
<a
|
|
68
|
-
href="#!"
|
|
69
|
-
style="${o}"
|
|
70
|
-
product-attr="name"
|
|
71
|
-
data-slot-2
|
|
72
|
-
width="100%">
|
|
73
|
-
${A}
|
|
74
|
-
</a>
|
|
75
|
-
</p>
|
|
76
|
-
</div>
|
|
77
|
-
</td>
|
|
78
|
-
` : `<${$.BLOCK_TEXT}
|
|
20
|
+
`, F = (a) => `
|
|
21
|
+
<${l.BLOCK_TEXT}
|
|
79
22
|
width="100%"
|
|
80
23
|
align="center"
|
|
81
24
|
class="es-p10"
|
|
82
|
-
data-type="${
|
|
83
|
-
esd-extension-block-id="${
|
|
25
|
+
data-type="${a}"
|
|
26
|
+
esd-extension-block-id="${T.NAME}"
|
|
84
27
|
>
|
|
85
28
|
<p contenteditable="false">
|
|
86
29
|
<a
|
|
@@ -105,264 +48,148 @@ const S = (e) => e.split(";").map((t) => t.trim()).filter((t) => !t.toLowerCase(
|
|
|
105
48
|
${A}
|
|
106
49
|
</a>
|
|
107
50
|
</p>
|
|
108
|
-
</${
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
d = (r || "0") === "1" ? `${f}${u}` : `${u}${f}`;
|
|
115
|
-
}
|
|
116
|
-
const s = r === "1" ? "after" : "before", T = `data-formated="${n ? "true" : "false"}"`, i = `data-curency="${s}"`, E = a ? `data-currency_symbol="${a}"` : "";
|
|
117
|
-
if (l) {
|
|
118
|
-
const p = S(o || "color: #060606; white-space: nowrap; font-size: 20px;");
|
|
119
|
-
return `
|
|
120
|
-
<td class="esd-block-text items-block-price"
|
|
121
|
-
align="center"
|
|
122
|
-
esd-extension-block-id="items-block-price"
|
|
123
|
-
width="100%">
|
|
124
|
-
<p product-attr="price"
|
|
125
|
-
contenteditable="false"
|
|
126
|
-
data-slot-4
|
|
127
|
-
data-type="${e}"
|
|
128
|
-
data-number="${t}"
|
|
129
|
-
${T}
|
|
130
|
-
${i}
|
|
131
|
-
${E}
|
|
132
|
-
style="${p}">
|
|
133
|
-
${d}
|
|
134
|
-
</p>
|
|
135
|
-
</td>`;
|
|
51
|
+
</${l.BLOCK_TEXT}>
|
|
52
|
+
`, S = (a, t, o, e, c) => {
|
|
53
|
+
let n = p;
|
|
54
|
+
if (e && e.trim()) {
|
|
55
|
+
const E = ` ${e.trim()} `;
|
|
56
|
+
n = (c || "0") === "1" ? `${p}${E}` : `${E}${p}`;
|
|
136
57
|
}
|
|
58
|
+
const r = c === "1" ? "after" : "before", d = `data-formated="${o ? "true" : "false"}"`, s = `data-curency="${r}"`;
|
|
137
59
|
return `
|
|
138
|
-
<${
|
|
139
|
-
esd-extension-block-id="${
|
|
60
|
+
<${l.BLOCK_TEXT}
|
|
61
|
+
esd-extension-block-id="${T.PRICE}"
|
|
140
62
|
class="items-block-price"
|
|
141
|
-
width="100%"
|
|
142
|
-
align="center"
|
|
63
|
+
width="100%"
|
|
64
|
+
align="center"
|
|
143
65
|
>
|
|
144
|
-
<p
|
|
66
|
+
<p
|
|
145
67
|
product-attr="price"
|
|
146
68
|
contenteditable="false"
|
|
147
69
|
data-slot-4
|
|
148
|
-
data-type="${
|
|
70
|
+
data-type="${a}"
|
|
149
71
|
data-number="${t}"
|
|
150
|
-
${T}
|
|
151
|
-
${i}
|
|
152
|
-
${a ? `data-currency_symbol="${a}"` : ""}
|
|
153
|
-
>
|
|
154
72
|
${d}
|
|
73
|
+
${s}
|
|
74
|
+
${e ? `data-currency_symbol="${e}"` : ""}
|
|
75
|
+
>
|
|
76
|
+
${n}
|
|
155
77
|
</p>
|
|
156
|
-
</${
|
|
78
|
+
</${l.BLOCK_TEXT}>
|
|
157
79
|
`;
|
|
158
|
-
},
|
|
159
|
-
let
|
|
160
|
-
if (
|
|
161
|
-
const
|
|
162
|
-
|
|
163
|
-
}
|
|
164
|
-
const T = r === "1" ? "after" : "before", i = `data-formated="${n ? "true" : "false"}"`, E = `data-curency="${T}"`, u = o ? "" : ' style="display: none;"';
|
|
165
|
-
if (l) {
|
|
166
|
-
const O = S(d || "color: #cc0000; white-space: nowrap; font-size: 19px;");
|
|
167
|
-
return `
|
|
168
|
-
<td class="esd-block-text items-block-price"
|
|
169
|
-
esd-extension-block-id="items-block-original-price"
|
|
170
|
-
width="100%"
|
|
171
|
-
align="center"${u}>
|
|
172
|
-
<p
|
|
173
|
-
product-attr="originalPrice"
|
|
174
|
-
contenteditable="false"
|
|
175
|
-
data-slot-5
|
|
176
|
-
data-type="${e}"
|
|
177
|
-
data-number="${t}"
|
|
178
|
-
${i}
|
|
179
|
-
${E}
|
|
180
|
-
${a ? `data-currency_symbol="${a}"` : ""}
|
|
181
|
-
style="${O}">
|
|
182
|
-
<s>${s}</s>
|
|
183
|
-
</p>
|
|
184
|
-
</td>`;
|
|
80
|
+
}, L = (a, t, o, e, c) => {
|
|
81
|
+
let n = I;
|
|
82
|
+
if (e && e.trim()) {
|
|
83
|
+
const E = ` ${e.trim()} `;
|
|
84
|
+
n = (c || "0") === "1" ? `${I}${E}` : `${E}${I}`;
|
|
185
85
|
}
|
|
86
|
+
const r = c === "1" ? "after" : "before", d = `data-formated="${o ? "true" : "false"}"`, s = `data-curency="${r}"`;
|
|
186
87
|
return `
|
|
187
|
-
<${
|
|
88
|
+
<${l.BLOCK_TEXT}
|
|
188
89
|
class="items-block-price"
|
|
189
|
-
esd-extension-block-id="${
|
|
190
|
-
width="100%"
|
|
191
|
-
align="center"
|
|
192
|
-
${o ? "" : 'style="display: none;"'}
|
|
90
|
+
esd-extension-block-id="${T.ORIGINAL_PRICE}"
|
|
91
|
+
width="100%"
|
|
92
|
+
align="center"
|
|
193
93
|
>
|
|
194
94
|
<p
|
|
195
95
|
product-attr="originalPrice"
|
|
196
|
-
contenteditable="false"
|
|
96
|
+
contenteditable="false"
|
|
197
97
|
data-slot-5
|
|
198
98
|
style="color: #cc0000"
|
|
199
|
-
data-type="${
|
|
99
|
+
data-type="${a}"
|
|
200
100
|
data-number="${t}"
|
|
201
|
-
${
|
|
202
|
-
${
|
|
203
|
-
${
|
|
101
|
+
${d}
|
|
102
|
+
${s}
|
|
103
|
+
${e ? `data-currency_symbol="${e}"` : ""}
|
|
204
104
|
>
|
|
205
|
-
<s>${
|
|
105
|
+
<s>${n}</s>
|
|
206
106
|
</p>
|
|
207
|
-
</${
|
|
107
|
+
</${l.BLOCK_TEXT}>
|
|
208
108
|
`;
|
|
209
|
-
},
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
<span class="es-button-border" style="border-width: 0px;">
|
|
244
|
-
<a class="es-button" href="#!" target="_blank" style="${r || ""}">
|
|
245
|
-
${n}
|
|
246
|
-
</a>
|
|
247
|
-
</span>
|
|
248
|
-
</td>` : `
|
|
249
|
-
<${$.BLOCK_BUTTON}
|
|
250
|
-
width="100%"
|
|
251
|
-
class="ins-button"
|
|
252
|
-
name="buy-button"
|
|
253
|
-
caption="${n}"
|
|
254
|
-
align="center"
|
|
255
|
-
esd-extension-block-id="${b.BUTTON}"
|
|
256
|
-
product-attr="button"
|
|
257
|
-
data-slot-6
|
|
258
|
-
data-type="${e}"
|
|
259
|
-
data-number="${t}"
|
|
260
|
-
>${n}
|
|
261
|
-
</${$.BLOCK_BUTTON}>
|
|
262
|
-
`, Y = (e) => !e || Object.keys(e).length === 0 ? '<esd-config-block style="display: none;"></esd-config-block>' : `<esd-config-block style="display: none;" ${Object.entries(e).map(([n, a]) => `${n}="${a}"`).join(" ")}></esd-config-block>`, Z = (e, t, n) => {
|
|
263
|
-
const a = t === y.ORIENTATION.VERTICAL, r = n === "horizontal";
|
|
264
|
-
return a ? r ? e : e.replace(
|
|
265
|
-
/<td\s+[^>]*class="[^"]*product-(?:original-)?price-class[^"]*"[^>]*>/gi,
|
|
266
|
-
(l) => l.replace(/width="50%"/gi, 'width="100%"').replace(/width:\s*50%;/gi, "width: 100%;")
|
|
267
|
-
) : r ? e : e.replace(
|
|
268
|
-
/<td\s+[^>]*class="[^"]*horizontal-price[^"]*"[^>]*>/gi,
|
|
269
|
-
(l) => /style\s*=\s*"/i.test(l) ? l.replace(/style\s*=\s*"([^"]*)"/i, 'style="display: none; $1"') : l.replace(/>$/, ' style="display: none;">')
|
|
270
|
-
).replace(
|
|
271
|
-
/<td\s+[^>]*class="[^"]*vertical-price[^"]*"[^>]*>/gi,
|
|
272
|
-
(l) => l.replace(/display:\s*none;?/gi, "display: table-cell;")
|
|
273
|
-
);
|
|
274
|
-
}, J = (e) => e ? `<td align="center"
|
|
275
|
-
esd-extension-block-id="items-block" width="560"
|
|
276
|
-
data-number="4"
|
|
277
|
-
class="ins-product-td items-block items-block-v2 esd-items-block esd-extension-block esd-container-frame">` : v, g = (e, t, n, a, r, l, o, d, s, T, i, E, u, p = "horizontal", O, _, I) => {
|
|
278
|
-
const x = `${`data-type="${t}" data-number="${n}"`} data-orientation="${a}"`, L = e.replace(
|
|
109
|
+
}, b = () => `
|
|
110
|
+
<${l.BLOCK_TEXT}
|
|
111
|
+
width="100%"
|
|
112
|
+
align="center"
|
|
113
|
+
class="es-p10"
|
|
114
|
+
esd-extension-block-id="${T.QUANTITY}"
|
|
115
|
+
>
|
|
116
|
+
<p
|
|
117
|
+
product-attr="quantity"
|
|
118
|
+
data-slot-3
|
|
119
|
+
contenteditable="false"
|
|
120
|
+
width="100%">
|
|
121
|
+
${u}
|
|
122
|
+
</p>
|
|
123
|
+
</${l.BLOCK_TEXT}>
|
|
124
|
+
`, U = (a, t) => `
|
|
125
|
+
<${l.BLOCK_BUTTON}
|
|
126
|
+
width="100%"
|
|
127
|
+
class="ins-button"
|
|
128
|
+
name="buy-button"
|
|
129
|
+
caption="Buy"
|
|
130
|
+
align="center"
|
|
131
|
+
esd-extension-block-id="${T.BUTTON}"
|
|
132
|
+
product-attr="button"
|
|
133
|
+
data-slot-6
|
|
134
|
+
data-type="${a}"
|
|
135
|
+
data-number="${t}"
|
|
136
|
+
>Buy
|
|
137
|
+
</${l.BLOCK_BUTTON}>
|
|
138
|
+
`, D = () => `
|
|
139
|
+
<esd-config-block style="display: none;"></esd-config-block>
|
|
140
|
+
`, R = (a, t, o, e, c, n, r, d) => {
|
|
141
|
+
const $ = `${`data-type="${t}" data-number="${o}"`} data-orientation="${e}"`;
|
|
142
|
+
return a.replace(
|
|
279
143
|
/<td([^>]*class="[^"]*ins-product-td[^"]*"[^>]*)>/,
|
|
280
|
-
`<td$1 ${
|
|
281
|
-
)
|
|
144
|
+
`<td$1 ${$}>`
|
|
145
|
+
).replace("{-{-TEMPLATE_FIRST_LINE-}-}", N).replace("{-{-PRODUCT_IMAGE-}-}", h(t, o)).replace("{-{-PRODUCT_NAME-}-}", F(t)).replaceAll(
|
|
282
146
|
"{-{-PRODUCT_PRICE-}-}",
|
|
283
|
-
|
|
147
|
+
S(t, o, c, n, r)
|
|
284
148
|
).replaceAll(
|
|
285
149
|
"{-{-PRODUCT_ORIGINAL_PRICE-}-}",
|
|
286
|
-
|
|
150
|
+
L(
|
|
287
151
|
t,
|
|
288
|
-
n,
|
|
289
|
-
r,
|
|
290
152
|
o,
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
_
|
|
153
|
+
c,
|
|
154
|
+
n,
|
|
155
|
+
r
|
|
295
156
|
)
|
|
296
|
-
).replace("{-{-PRODUCT_QUANTITY-}-}",
|
|
297
|
-
return Z(B, a, p);
|
|
157
|
+
).replace("{-{-PRODUCT_QUANTITY-}-}", b()).replace("{-{-PRODUCT_BUTTON-}-}", U(t, o)).replace("{-{-CONFIG_BLOCK-}-}", D());
|
|
298
158
|
};
|
|
299
|
-
function
|
|
300
|
-
orientation:
|
|
301
|
-
itemsType: t =
|
|
302
|
-
itemId:
|
|
303
|
-
currencySymbol:
|
|
304
|
-
currencyLocation:
|
|
305
|
-
|
|
306
|
-
formattedPrice: o = !0,
|
|
307
|
-
configBlockAttributes: d,
|
|
308
|
-
nodeConfig: s,
|
|
309
|
-
nameStyles: T,
|
|
310
|
-
buttonStyles: i,
|
|
311
|
-
priceStyles: E,
|
|
312
|
-
originalPriceStyles: u,
|
|
313
|
-
quantityStyles: p,
|
|
314
|
-
priceOrientation: O
|
|
159
|
+
function G({
|
|
160
|
+
orientation: a,
|
|
161
|
+
itemsType: t = O.ITEMS_TYPE.CART_ITEMS,
|
|
162
|
+
itemId: o,
|
|
163
|
+
currencySymbol: e,
|
|
164
|
+
currencyLocation: c,
|
|
165
|
+
formattedPrice: n = !0
|
|
315
166
|
}) {
|
|
316
|
-
const
|
|
317
|
-
let
|
|
318
|
-
if (
|
|
319
|
-
|
|
320
|
-
else if (
|
|
321
|
-
const
|
|
322
|
-
|
|
167
|
+
const r = f[t].findIndex((s) => s.value === o);
|
|
168
|
+
let d = "1";
|
|
169
|
+
if (r >= 0)
|
|
170
|
+
d = String(r + 1);
|
|
171
|
+
else if (o) {
|
|
172
|
+
const s = o.match(/\((\d+)\)/);
|
|
173
|
+
s && s[1] && ([, d] = s);
|
|
323
174
|
}
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
return e === y.ORIENTATION.VERTICAL ? g(
|
|
327
|
-
z,
|
|
175
|
+
return C = i.PAIRS_FOR_EXTENSION.imageSrc[t].DEFAULT[r >= 0 ? r : 0], A = i.PAIRS_FOR_EXTENSION.name[t].DEFAULT[r >= 0 ? r : 0], p = n ? i.PAIRS_FOR_EXTENSION.price[t].DEFAULT_PRICE_FORMATTED : i.PAIRS_FOR_EXTENSION.price[t].DEFAULT_PRICE, I = n ? i.PAIRS_FOR_EXTENSION.originalPrice[t].DEFAULT_PRICE_FORMATTED : i.PAIRS_FOR_EXTENSION.originalPrice[t].DEFAULT_PRICE, u = i.PAIRS_FOR_EXTENSION.quantity[t].DEFAULT, a === O.ORIENTATION.VERTICAL ? R(
|
|
176
|
+
g,
|
|
328
177
|
t,
|
|
329
|
-
I,
|
|
330
|
-
e,
|
|
331
|
-
o,
|
|
332
|
-
l,
|
|
333
|
-
a,
|
|
334
|
-
r,
|
|
335
178
|
d,
|
|
336
|
-
void 0,
|
|
337
|
-
// nodup
|
|
338
|
-
s,
|
|
339
|
-
T,
|
|
340
|
-
i,
|
|
341
|
-
w,
|
|
342
|
-
E,
|
|
343
|
-
u,
|
|
344
|
-
p
|
|
345
|
-
) : g(
|
|
346
|
-
K,
|
|
347
|
-
t,
|
|
348
|
-
I,
|
|
349
|
-
e,
|
|
350
|
-
o,
|
|
351
|
-
l,
|
|
352
179
|
a,
|
|
353
|
-
|
|
180
|
+
n,
|
|
181
|
+
e,
|
|
182
|
+
c
|
|
183
|
+
) : R(
|
|
184
|
+
B,
|
|
185
|
+
t,
|
|
354
186
|
d,
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
i,
|
|
360
|
-
w,
|
|
361
|
-
E,
|
|
362
|
-
u,
|
|
363
|
-
p
|
|
187
|
+
a,
|
|
188
|
+
n,
|
|
189
|
+
e,
|
|
190
|
+
c
|
|
364
191
|
);
|
|
365
192
|
}
|
|
366
193
|
export {
|
|
367
|
-
|
|
194
|
+
G as getDefaultTemplate
|
|
368
195
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useItemsBlockStore as e } from "../store/items-block.js";
|
|
2
2
|
import { syncAttributeFromConfigBlock as r, createBooleanSyncConfig as i, createStringSyncConfig as s } from "./syncAttributeFromConfigBlock.js";
|
|
3
|
-
function
|
|
3
|
+
function m(t) {
|
|
4
4
|
const o = e(), n = i(
|
|
5
5
|
"PRODUCT_NAME_TRIMMING",
|
|
6
6
|
(c) => o.setNameTrimming(c),
|
|
@@ -12,7 +12,7 @@ function f(t) {
|
|
|
12
12
|
const o = e(), n = i(
|
|
13
13
|
"PRODUCT_PRICE_HIDE_DISCOUNT",
|
|
14
14
|
(c) => o.setHideDiscount(c),
|
|
15
|
-
!
|
|
15
|
+
!1
|
|
16
16
|
);
|
|
17
17
|
r(t, n);
|
|
18
18
|
}
|
|
@@ -24,7 +24,7 @@ function R(t) {
|
|
|
24
24
|
);
|
|
25
25
|
r(t, n);
|
|
26
26
|
}
|
|
27
|
-
function
|
|
27
|
+
function O(t) {
|
|
28
28
|
const o = e(), n = s(
|
|
29
29
|
"PRODUCT_PRICE_CURRENCY_SYMBOL",
|
|
30
30
|
(c) => o.setCurrencySymbol(c),
|
|
@@ -32,7 +32,7 @@ function _(t) {
|
|
|
32
32
|
);
|
|
33
33
|
r(t, n);
|
|
34
34
|
}
|
|
35
|
-
function
|
|
35
|
+
function _(t) {
|
|
36
36
|
const o = e(), n = s(
|
|
37
37
|
"PRODUCT_PRICE_CURRENCY_LOCATION",
|
|
38
38
|
(c) => o.setCurrencyLocation(c),
|
|
@@ -40,7 +40,7 @@ function y(t) {
|
|
|
40
40
|
);
|
|
41
41
|
r(t, n);
|
|
42
42
|
}
|
|
43
|
-
function
|
|
43
|
+
function I(t) {
|
|
44
44
|
const o = e(), n = s(
|
|
45
45
|
"PRODUCT_BUTTON_LINK",
|
|
46
46
|
(c) => o.setButtonLink(c),
|
|
@@ -48,7 +48,7 @@ function T(t) {
|
|
|
48
48
|
);
|
|
49
49
|
r(t, n);
|
|
50
50
|
}
|
|
51
|
-
function
|
|
51
|
+
function T(t) {
|
|
52
52
|
const o = e(), n = s(
|
|
53
53
|
"PRODUCT_IMAGE_LINK",
|
|
54
54
|
(c) => o.setImageLink(c),
|
|
@@ -56,12 +56,21 @@ function g(t) {
|
|
|
56
56
|
);
|
|
57
57
|
r(t, n);
|
|
58
58
|
}
|
|
59
|
+
function y(t) {
|
|
60
|
+
const o = e(), n = s(
|
|
61
|
+
"PRODUCT_ORIGINAL_PRICE_CONTROL_ORIENTATION",
|
|
62
|
+
(c) => o.setPriceOrientation(c),
|
|
63
|
+
"horizontal"
|
|
64
|
+
);
|
|
65
|
+
r(t, n);
|
|
66
|
+
}
|
|
59
67
|
export {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
68
|
+
I as syncButtonLinkFromAttributes,
|
|
69
|
+
_ as syncCurrencyLocationFromAttributes,
|
|
70
|
+
O as syncCurrencySymbolFromAttributes,
|
|
63
71
|
R as syncFormattedPriceFromAttributes,
|
|
64
72
|
f as syncHideDiscountFromAttributes,
|
|
65
|
-
|
|
66
|
-
|
|
73
|
+
T as syncImageLinkFromAttributes,
|
|
74
|
+
m as syncNameTrimmingFromAttributes,
|
|
75
|
+
y as syncPriceOrientationFromAttributes
|
|
67
76
|
};
|
|
@@ -289,7 +289,7 @@ class b extends g {
|
|
|
289
289
|
t.CURRENCY_DECIMAL_COUNT
|
|
290
290
|
].forEach((i) => {
|
|
291
291
|
this.api.onValueChanged(i, (a) => this._onCurrencyConfigChange(i, a));
|
|
292
|
-
}), this.api.onValueChanged(t.PRODUCT_COUNT, (i) => this._onDataChange(t.PRODUCT_COUNT,
|
|
292
|
+
}), this.api.onValueChanged(t.PRODUCT_COUNT, (i) => this._onDataChange(t.PRODUCT_COUNT, i.toString())), this.api.onValueChanged(t.PRODUCT_IN_ROW, (i) => this._onDataChange(t.PRODUCT_IN_ROW, i)), this.api.onValueChanged(t.SHUFFLE_PRODUCTS, (i) => this._onDataChange(t.SHUFFLE_PRODUCTS, i)), this.api.onValueChanged(t.RESPONSIVE, (i) => this._onDataChange(t.RESPONSIVE, i)), this.addFilterListener = this._onFilterSelectClick.bind(this), this.addFilterButton = this.getContainer().querySelector("#guido__btn-add-filter"), (o = this.addFilterButton) == null || o.addEventListener("click", this.addFilterListener);
|
|
293
293
|
}
|
|
294
294
|
_listenStateUpdates() {
|
|
295
295
|
this.storeUnsubscription = this.store.$subscribe((e) => {
|