@useinsider/guido 3.17.0-beta.ab974c6 → 3.17.0-beta.b16151a
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/useSave.js +30 -29
- package/dist/composables/useSyncModuleExtractor.js +15 -13
- package/dist/composables/validators/useSyncModuleBlockValidator.js +24 -0
- package/dist/extensions/Blocks/Items/block.js +49 -105
- package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +24 -25
- package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +11 -12
- package/dist/extensions/Blocks/Items/template.js +152 -153
- package/dist/extensions/Blocks/Items/utils/constants.js +4 -0
- package/dist/extensions/Blocks/Recommendation/utils/recommendationBlockCount.js +10 -6
- package/dist/src/composables/useSyncModuleExtractor.d.ts +2 -0
- package/dist/src/composables/validators/useSyncModuleBlockValidator.d.ts +3 -0
- package/dist/src/extensions/Blocks/Items/block.d.ts +0 -29
- package/dist/src/extensions/Blocks/Items/utils/constants.d.ts +6 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/recommendationBlockCount.d.ts +6 -2
- package/dist/utils/pairProductVariables.js +58 -58
- package/package.json +1 -1
- package/dist/extensions/Blocks/Items/constants/currency.js +0 -17
- package/dist/src/extensions/Blocks/Items/constants/currency.d.ts +0 -26
|
@@ -1,25 +1,24 @@
|
|
|
1
1
|
import { escapeHtml as m } from "../../../utils/htmlEscape.js";
|
|
2
|
-
import { BlockType as R, BlockAttr as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return N(`
|
|
2
|
+
import { BlockType as R, BlockAttr as S } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
3
|
+
import { ItemsBlockId as O } from "./enums/controlEnums.js";
|
|
4
|
+
import { productPairs as h, templateFirstLine as q } from "./enums/productEnums.js";
|
|
5
|
+
import { ItemInCartOptions as j, SETTINGS_ENUMS as N, DefaultConfigValues as M } from "./enums/settingsEnums.js";
|
|
6
|
+
import C from "./layouts/horizontal.html.js";
|
|
7
|
+
import J from "./layouts/vertical.html.js";
|
|
8
|
+
import { deriveItemNumber as Z, escapeReplacement as g } from "./utils/nodeConfigUtils.js";
|
|
9
|
+
let [v] = h.PAIRS_FOR_EXTENSION.imageSrc.CART_ITEMS.DEFAULT, [F] = h.PAIRS_FOR_EXTENSION.name.CART_ITEMS.DEFAULT, [x] = h.PAIRS_FOR_EXTENSION.price.CART_ITEMS.DEFAULT_PRICE_FORMATTED, [L] = h.PAIRS_FOR_EXTENSION.originalPrice.CART_ITEMS.DEFAULT_PRICE_FORMATTED, [X] = h.PAIRS_FOR_EXTENSION.quantity.CART_ITEMS.DEFAULT;
|
|
10
|
+
const U = (s, e) => s.split(";").map((r) => r.trim()).filter((r) => !r.toLowerCase().startsWith(e.toLowerCase())).join("; ").replace(/;\s*$/, ""), k = (s) => U(s, "text-align"), y = (s, e) => {
|
|
11
|
+
const r = new RegExp(`${e}\\s*:\\s*([^;]+)`, "i"), a = s.match(r);
|
|
12
|
+
return a ? a[1].trim() : null;
|
|
13
|
+
}, w = (s) => `<tr>${s}</tr>`, f = (s, e, r, a) => {
|
|
14
|
+
const i = r || M.productImageHeight, d = (a == null ? void 0 : a.imageVisible) === !1 ? "display: none; " : "";
|
|
15
|
+
return w(`
|
|
17
16
|
<td class="esd-block-image document-node-component default-block-component selectable ng-star-inserted"
|
|
18
17
|
align="center"
|
|
19
|
-
esd-extension-block-id="${
|
|
18
|
+
esd-extension-block-id="${O.IMAGE}"
|
|
20
19
|
data-slot-1=""
|
|
21
20
|
product-attr="imageSrc"
|
|
22
|
-
data-type="${
|
|
21
|
+
data-type="${s}"
|
|
23
22
|
data-number="${e}"
|
|
24
23
|
style="${d}font-size: 0px;">
|
|
25
24
|
<a class="document-node-component ng-star-inserted"
|
|
@@ -27,27 +26,27 @@ const M = (a, e) => a.split(";").map((r) => r.trim()).filter((r) => !r.toLowerCa
|
|
|
27
26
|
href="#!">
|
|
28
27
|
<img class="adapt-img document-node-component ng-star-inserted"
|
|
29
28
|
style="object-fit: contain;"
|
|
30
|
-
src="${
|
|
29
|
+
src="${v}"
|
|
31
30
|
alt="${F}"
|
|
32
31
|
width="${i}"
|
|
33
32
|
height="${i}">
|
|
34
33
|
</a>
|
|
35
34
|
</td>
|
|
36
35
|
`);
|
|
37
|
-
},
|
|
36
|
+
}, tt = (s, e) => `
|
|
38
37
|
<${R.BLOCK_IMAGE}
|
|
39
|
-
${
|
|
40
|
-
${
|
|
41
|
-
${
|
|
42
|
-
${
|
|
43
|
-
${
|
|
44
|
-
esd-extension-block-id="${
|
|
38
|
+
${S.BLOCK_IMAGE.src}="${v}"
|
|
39
|
+
${S.BLOCK_IMAGE.alt}="${F}"
|
|
40
|
+
${S.BLOCK_IMAGE.href}="#!"
|
|
41
|
+
${S.BLOCK_IMAGE.width}="${M.productImageWidth}"
|
|
42
|
+
${S.BLOCK_IMAGE.height}="${M.productImageWidth}"
|
|
43
|
+
esd-extension-block-id="${O.IMAGE}"
|
|
45
44
|
data-slot-1
|
|
46
45
|
product-attr="imageSrc"
|
|
47
|
-
data-type="${
|
|
46
|
+
data-type="${s}"
|
|
48
47
|
data-number="${e}"
|
|
49
48
|
/>
|
|
50
|
-
`,
|
|
49
|
+
`, et = (s, e, r, a) => {
|
|
51
50
|
const i = `
|
|
52
51
|
word-wrap: break-word;
|
|
53
52
|
white-space: nowrap;
|
|
@@ -57,27 +56,27 @@ const M = (a, e) => a.split(";").map((r) => r.trim()).filter((r) => !r.toLowerCa
|
|
|
57
56
|
max-width: 100%;
|
|
58
57
|
`;
|
|
59
58
|
if (e) {
|
|
60
|
-
const d =
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
const d = y(r || "", "text-align") || "center", n = k(r || i), c = y(n, "font-weight"), l = y(n, "font-style"), o = c === "bold" || c === "700", t = l === "italic", p = U(
|
|
60
|
+
U(
|
|
61
|
+
U(n, "font-weight"),
|
|
63
62
|
"font-style"
|
|
64
63
|
),
|
|
65
64
|
"text-decoration"
|
|
66
|
-
), T = (
|
|
67
|
-
let
|
|
68
|
-
return o && (
|
|
65
|
+
), T = (a == null ? void 0 : a.nameVisible) === !1 ? "display: none;" : "display: table-cell;", _ = p ? ` style="${m(p)}"` : "";
|
|
66
|
+
let E = F;
|
|
67
|
+
return o && (E = `<strong>${E}</strong>`), t && (E = `<em>${E}</em>`), w(`
|
|
69
68
|
<td class="esd-block-text es-p10"
|
|
70
69
|
align="${d}"
|
|
71
70
|
width="100%"
|
|
72
71
|
colspan="2"
|
|
73
|
-
data-type="${
|
|
74
|
-
esd-extension-block-id="${
|
|
72
|
+
data-type="${s}"
|
|
73
|
+
esd-extension-block-id="${O.NAME}"
|
|
75
74
|
style="${T}">
|
|
76
75
|
<p contenteditable="false"
|
|
77
76
|
path="1"
|
|
78
77
|
product-attr="name"
|
|
79
|
-
data-slot-2${
|
|
80
|
-
${
|
|
78
|
+
data-slot-2${_}>
|
|
79
|
+
${E}
|
|
81
80
|
</p>
|
|
82
81
|
</td>
|
|
83
82
|
`);
|
|
@@ -87,8 +86,8 @@ const M = (a, e) => a.split(";").map((r) => r.trim()).filter((r) => !r.toLowerCa
|
|
|
87
86
|
align="center"
|
|
88
87
|
colspan="2"
|
|
89
88
|
class="es-p10"
|
|
90
|
-
data-type="${
|
|
91
|
-
esd-extension-block-id="${
|
|
89
|
+
data-type="${s}"
|
|
90
|
+
esd-extension-block-id="${O.NAME}"
|
|
92
91
|
>
|
|
93
92
|
<p contenteditable="false"
|
|
94
93
|
product-attr="name"
|
|
@@ -98,31 +97,31 @@ const M = (a, e) => a.split(";").map((r) => r.trim()).filter((r) => !r.toLowerCa
|
|
|
98
97
|
</p>
|
|
99
98
|
</${R.BLOCK_TEXT}>
|
|
100
99
|
`;
|
|
101
|
-
},
|
|
102
|
-
let t =
|
|
103
|
-
if (
|
|
104
|
-
const
|
|
105
|
-
t = (i || "0") === "1" ? `${
|
|
100
|
+
}, at = (s, e, r, a, i, d, n, c, l, o) => {
|
|
101
|
+
let t = x;
|
|
102
|
+
if (a && a.trim()) {
|
|
103
|
+
const $ = `${a.trim()}`;
|
|
104
|
+
t = (i || "0") === "1" ? `${x} ${$}` : `${$} ${x}`;
|
|
106
105
|
}
|
|
107
|
-
const p =
|
|
106
|
+
const p = i === "1" ? "after" : "before", T = `data-formated="${r ? "true" : "false"}"`, _ = `data-curency="${p}"`, E = a ? `data-currency_symbol="${a}"` : "", u = `data-single_price="${c ? "true" : "false"}"`, I = l === N.ORIENTATION.VERTICAL ? " es-p10b es-p10t" : "";
|
|
108
107
|
if (d) {
|
|
109
|
-
const
|
|
110
|
-
return
|
|
111
|
-
<td class="esd-block-text items-block-price${
|
|
108
|
+
const b = k(n || "color: #060606; white-space: nowrap; font-size: 20px;"), A = o ? "" : ' style="display: none;"';
|
|
109
|
+
return w(`
|
|
110
|
+
<td class="esd-block-text items-block-price${I}"
|
|
112
111
|
align="center"
|
|
113
|
-
esd-extension-block-id="${
|
|
112
|
+
esd-extension-block-id="${O.PRICE}"
|
|
114
113
|
width="100%"
|
|
115
|
-
${
|
|
114
|
+
${A}>
|
|
116
115
|
<p product-attr="price"
|
|
117
116
|
contenteditable="false"
|
|
118
117
|
data-slot-4
|
|
119
|
-
data-type="${
|
|
118
|
+
data-type="${s}"
|
|
120
119
|
data-number="${e}"
|
|
121
120
|
${T}
|
|
121
|
+
${_}
|
|
122
|
+
${E}
|
|
122
123
|
${u}
|
|
123
|
-
${
|
|
124
|
-
${O}
|
|
125
|
-
style="${m(I)}">
|
|
124
|
+
style="${m(b)}">
|
|
126
125
|
${t}
|
|
127
126
|
</p>
|
|
128
127
|
</td>
|
|
@@ -130,8 +129,8 @@ const M = (a, e) => a.split(";").map((r) => r.trim()).filter((r) => !r.toLowerCa
|
|
|
130
129
|
}
|
|
131
130
|
return `
|
|
132
131
|
<${R.BLOCK_TEXT}
|
|
133
|
-
esd-extension-block-id="${
|
|
134
|
-
class="items-block-price ${
|
|
132
|
+
esd-extension-block-id="${O.PRICE}"
|
|
133
|
+
class="items-block-price ${I}"
|
|
135
134
|
width="100%"
|
|
136
135
|
align="center"
|
|
137
136
|
>
|
|
@@ -139,42 +138,42 @@ const M = (a, e) => a.split(";").map((r) => r.trim()).filter((r) => !r.toLowerCa
|
|
|
139
138
|
product-attr="price"
|
|
140
139
|
contenteditable="false"
|
|
141
140
|
data-slot-4
|
|
142
|
-
data-type="${
|
|
141
|
+
data-type="${s}"
|
|
143
142
|
data-number="${e}"
|
|
144
143
|
${T}
|
|
144
|
+
${_}
|
|
145
|
+
${a ? `data-currency_symbol="${a}"` : ""}
|
|
145
146
|
${u}
|
|
146
|
-
${$}
|
|
147
|
-
${O}
|
|
148
147
|
>
|
|
149
148
|
${t}
|
|
150
149
|
</p>
|
|
151
150
|
</${R.BLOCK_TEXT}>
|
|
152
151
|
`;
|
|
153
|
-
},
|
|
154
|
-
let t =
|
|
155
|
-
if (
|
|
156
|
-
const
|
|
157
|
-
t = (i || "0") === "1" ? `${
|
|
152
|
+
}, st = (s, e, r, a, i, d, n = !0, c, l, o) => {
|
|
153
|
+
let t = L;
|
|
154
|
+
if (a && a.trim()) {
|
|
155
|
+
const $ = `${a.trim()}`;
|
|
156
|
+
t = (i || "0") === "1" ? `${L} ${$}` : `${$} ${L}`;
|
|
158
157
|
}
|
|
159
|
-
const p =
|
|
158
|
+
const p = i === "1" ? "after" : "before", T = `data-formated="${r ? "true" : "false"}"`, _ = `data-curency="${p}"`, E = n ? "" : ' style="display: none;"', u = `data-single_price="${l ? "true" : "false"}"`, I = o === N.ORIENTATION.VERTICAL ? " es-p10b es-p10t" : "";
|
|
160
159
|
if (d) {
|
|
161
|
-
const
|
|
162
|
-
return
|
|
163
|
-
<td class="esd-block-text items-block-price${
|
|
164
|
-
esd-extension-block-id="${
|
|
160
|
+
const b = k(c || "color: #cc0000; white-space: nowrap; font-size: 19px;");
|
|
161
|
+
return w(`
|
|
162
|
+
<td class="esd-block-text items-block-price${I}"
|
|
163
|
+
esd-extension-block-id="${O.ORIGINAL_PRICE}"
|
|
165
164
|
width="100%"
|
|
166
|
-
align="center"${
|
|
165
|
+
align="center"${E}>
|
|
167
166
|
<p
|
|
168
167
|
product-attr="originalPrice"
|
|
169
168
|
contenteditable="false"
|
|
170
169
|
data-slot-5
|
|
171
|
-
data-type="${
|
|
170
|
+
data-type="${s}"
|
|
172
171
|
data-number="${e}"
|
|
173
172
|
${T}
|
|
173
|
+
${_}
|
|
174
|
+
${a ? `data-currency_symbol="${a}"` : ""}
|
|
174
175
|
${u}
|
|
175
|
-
${
|
|
176
|
-
${A}
|
|
177
|
-
style="${m(P)}">
|
|
176
|
+
style="${m(b)}">
|
|
178
177
|
<s>${t}</s>
|
|
179
178
|
</p>
|
|
180
179
|
</td>
|
|
@@ -182,8 +181,8 @@ const M = (a, e) => a.split(";").map((r) => r.trim()).filter((r) => !r.toLowerCa
|
|
|
182
181
|
}
|
|
183
182
|
return `
|
|
184
183
|
<${R.BLOCK_TEXT}
|
|
185
|
-
class="items-block-price ${
|
|
186
|
-
esd-extension-block-id="${
|
|
184
|
+
class="items-block-price ${I}"
|
|
185
|
+
esd-extension-block-id="${O.ORIGINAL_PRICE}"
|
|
187
186
|
width="100%"
|
|
188
187
|
align="center"
|
|
189
188
|
${n ? "" : 'style="display: none;"'}
|
|
@@ -193,33 +192,33 @@ const M = (a, e) => a.split(";").map((r) => r.trim()).filter((r) => !r.toLowerCa
|
|
|
193
192
|
contenteditable="false"
|
|
194
193
|
data-slot-5
|
|
195
194
|
style="color: #cc0000"
|
|
196
|
-
data-type="${
|
|
195
|
+
data-type="${s}"
|
|
197
196
|
data-number="${e}"
|
|
198
197
|
${T}
|
|
198
|
+
${_}
|
|
199
|
+
${a ? `data-currency_symbol="${a}"` : ""}
|
|
199
200
|
${u}
|
|
200
|
-
${$}
|
|
201
|
-
${A}
|
|
202
201
|
>
|
|
203
202
|
<s>${t}</s>
|
|
204
203
|
</p>
|
|
205
204
|
</${R.BLOCK_TEXT}>
|
|
206
205
|
`;
|
|
207
|
-
},
|
|
208
|
-
const
|
|
206
|
+
}, lt = (s = !0, e, r) => {
|
|
207
|
+
const a = s ? "" : 'style="display: none;"';
|
|
209
208
|
if (e) {
|
|
210
|
-
const i = "font-size: 14px;", d =
|
|
211
|
-
return
|
|
209
|
+
const i = "font-size: 14px;", d = y(r || "", "text-align") || "center", n = k(r || i);
|
|
210
|
+
return w(`
|
|
212
211
|
<td class="esd-block-text es-p10 document-node-component default-block-component selectable"
|
|
213
212
|
width="100%" align="${d}"
|
|
214
|
-
esd-extension-block-id="${
|
|
215
|
-
${
|
|
213
|
+
esd-extension-block-id="${O.QUANTITY}"
|
|
214
|
+
${a}>
|
|
216
215
|
<p product-attr="quantity"
|
|
217
216
|
data-slot-3=""
|
|
218
217
|
contenteditable="false"
|
|
219
218
|
width="100%"
|
|
220
219
|
path="1"
|
|
221
220
|
style="${m(n)}">
|
|
222
|
-
${
|
|
221
|
+
${X}
|
|
223
222
|
</p>
|
|
224
223
|
</td>
|
|
225
224
|
`);
|
|
@@ -229,26 +228,26 @@ const M = (a, e) => a.split(";").map((r) => r.trim()).filter((r) => !r.toLowerCa
|
|
|
229
228
|
width="100%"
|
|
230
229
|
align="center"
|
|
231
230
|
class="es-p10"
|
|
232
|
-
esd-extension-block-id="${
|
|
233
|
-
${
|
|
231
|
+
esd-extension-block-id="${O.QUANTITY}"
|
|
232
|
+
${s ? "" : 'style="display: none;"'}
|
|
234
233
|
>
|
|
235
234
|
<p
|
|
236
235
|
product-attr="quantity"
|
|
237
236
|
data-slot-3
|
|
238
237
|
contenteditable="false"
|
|
239
238
|
width="100%">
|
|
240
|
-
${
|
|
239
|
+
${X}
|
|
241
240
|
</p>
|
|
242
241
|
</${R.BLOCK_TEXT}>
|
|
243
242
|
`;
|
|
244
|
-
},
|
|
245
|
-
if (
|
|
246
|
-
const c =
|
|
247
|
-
return
|
|
243
|
+
}, rt = (s, e, r = "Buy", a, i, d = !0, n = !0) => {
|
|
244
|
+
if (a) {
|
|
245
|
+
const c = y(i || "", "background") || y(i || "", "background-color"), l = c ? `border-width: 0px; background: ${c};` : "border-width: 0px;", o = d ? "es-fw" : "es-il", t = (i || "").replace("border-width: 0;", "");
|
|
246
|
+
return w(`
|
|
248
247
|
<td class="esd-block-button ins-button default-block-component selectable"
|
|
249
248
|
align="center" width="100%" name="buy-button" caption="${r}"
|
|
250
|
-
esd-extension-block-id="${
|
|
251
|
-
product-attr="button" data-slot-6="" data-type="${
|
|
249
|
+
esd-extension-block-id="${O.BUTTON}"
|
|
250
|
+
product-attr="button" data-slot-6="" data-type="${s}" data-number="${e}"
|
|
252
251
|
${n ? "" : ' style="display: none;"'}>
|
|
253
252
|
<span class="es-button-border ${o}" style="${m(l)}">
|
|
254
253
|
<a
|
|
@@ -269,19 +268,19 @@ const M = (a, e) => a.split(";").map((r) => r.trim()).filter((r) => !r.toLowerCa
|
|
|
269
268
|
name="buy-button"
|
|
270
269
|
caption="${r}"
|
|
271
270
|
align="center"
|
|
272
|
-
esd-extension-block-id="${
|
|
271
|
+
esd-extension-block-id="${O.BUTTON}"
|
|
273
272
|
product-attr="button"
|
|
274
273
|
data-slot-6
|
|
275
|
-
data-type="${
|
|
274
|
+
data-type="${s}"
|
|
276
275
|
data-number="${e}"
|
|
277
276
|
>${r}
|
|
278
277
|
</${R.BLOCK_BUTTON}>
|
|
279
278
|
`;
|
|
280
|
-
},
|
|
281
|
-
const d = e ===
|
|
279
|
+
}, ct = (s, e, r, a = !0, i = !0) => {
|
|
280
|
+
const d = e === N.ORIENTATION.VERTICAL, n = r === "horizontal";
|
|
282
281
|
if (d) {
|
|
283
|
-
const c = !n, l = c || !i ? "100%" : "50%", o = c || !
|
|
284
|
-
let t =
|
|
282
|
+
const c = !n, l = c || !i ? "100%" : "50%", o = c || !a ? "100%" : "50%";
|
|
283
|
+
let t = s.replace(
|
|
285
284
|
/<td\s+[^>]*class="([^"]*product-price-class[^"]*)"[^>]*>/gi,
|
|
286
285
|
(p) => p.replace(/width="[^"]*"/gi, `width="${l}"`).replace(/width:\s*[^;]+;/gi, `width: ${l};`)
|
|
287
286
|
);
|
|
@@ -290,64 +289,64 @@ const M = (a, e) => a.split(";").map((r) => r.trim()).filter((r) => !r.toLowerCa
|
|
|
290
289
|
(p) => p.replace(/width="[^"]*"/gi, `width="${o}"`).replace(/width:\s*[^;]+;/gi, `width: ${o};`)
|
|
291
290
|
), t;
|
|
292
291
|
}
|
|
293
|
-
return n ?
|
|
292
|
+
return n ? s : s.replace(
|
|
294
293
|
/<td\s+[^>]*class="[^"]*horizontal-price[^"]*"[^>]*>/gi,
|
|
295
294
|
(c) => /style\s*=\s*"/i.test(c) ? c.replace(/style\s*=\s*"([^"]*)"/i, 'style="display: none; $1"') : c.replace(/>$/, ' style="display: none;">')
|
|
296
295
|
).replace(
|
|
297
296
|
/<td\s+[^>]*class="[^"]*vertical-price[^"]*"[^>]*>/gi,
|
|
298
297
|
(c) => c.replace(/display:\s*none;?/gi, "display: table-cell;")
|
|
299
298
|
);
|
|
300
|
-
},
|
|
299
|
+
}, it = (s) => s ? `<td align="center"
|
|
301
300
|
esd-extension-block-id="items-block"
|
|
302
|
-
class="ins-product-td items-block items-block-v2 esd-items-block esd-extension-block esd-container-frame">` :
|
|
303
|
-
const
|
|
301
|
+
class="ins-product-td items-block items-block-v2 esd-items-block esd-extension-block esd-container-frame">` : q, B = (s, e, r, a, i, d, n, c, l, o, t, p, T, _ = "horizontal", E, u, P, I) => {
|
|
302
|
+
const $ = o !== void 0 ? ` data-nodup="${o}"` : "", A = `${`data-type="${e}" data-number="${r}"`} data-orientation="${a}"${$}`, D = l == null ? void 0 : l["data-product_image_control_image-height"], V = d ? f(e, r, D, t) : tt(e, r), W = (t == null ? void 0 : t.buttonLabel) || "Buy", z = (t == null ? void 0 : t.buttonFullWidth) !== void 0 ? t.buttonFullWidth : !0, H = e === N.ITEMS_TYPE.BROWSED_ITEMS ? !1 : t == null ? void 0 : t.quantityControlEnabled, Q = (t == null ? void 0 : t.buttonVisible) !== void 0 ? t.buttonVisible : (l == null ? void 0 : l["data-product_button_control_enabled"]) !== "false", G = (t == null ? void 0 : t.priceVisible) !== void 0 ? t.priceVisible : (l == null ? void 0 : l["data-product_price_control_enabled"]) !== "false", K = (t == null ? void 0 : t.originalPriceVisible) !== void 0 ? t.originalPriceVisible : (l == null ? void 0 : l["data-product_original_price_control_enabled"]) !== "false", Y = s.replace("{-{-TEMPLATE_FIRST_LINE-}-}", it(d)).replace("{-{-PRODUCT_IMAGE-}-}", V).replace("{-{-PRODUCT_NAME-}-}", et(e, d, p, t)).replaceAll(
|
|
304
303
|
"{-{-PRODUCT_PRICE-}-}",
|
|
305
|
-
g(
|
|
304
|
+
g(at(
|
|
306
305
|
e,
|
|
307
306
|
r,
|
|
308
307
|
i,
|
|
309
308
|
n,
|
|
310
309
|
c,
|
|
311
310
|
d,
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
311
|
+
E,
|
|
312
|
+
I,
|
|
313
|
+
a,
|
|
314
|
+
G
|
|
316
315
|
))
|
|
317
316
|
).replaceAll(
|
|
318
317
|
"{-{-PRODUCT_ORIGINAL_PRICE-}-}",
|
|
319
|
-
g(
|
|
318
|
+
g(st(
|
|
320
319
|
e,
|
|
321
320
|
r,
|
|
322
321
|
i,
|
|
323
322
|
n,
|
|
324
323
|
c,
|
|
325
324
|
d,
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
325
|
+
K,
|
|
326
|
+
u,
|
|
327
|
+
I,
|
|
328
|
+
a
|
|
330
329
|
))
|
|
331
|
-
).replace("{-{-PRODUCT_QUANTITY-}-}",
|
|
330
|
+
).replace("{-{-PRODUCT_QUANTITY-}-}", lt(H, d, P)).replace(
|
|
332
331
|
"{-{-PRODUCT_BUTTON-}-}",
|
|
333
|
-
|
|
332
|
+
rt(e, r, W, d, T, z, Q)
|
|
334
333
|
).replace(
|
|
335
334
|
/<td([^>]*class="[^"]*ins-product-td[^"]*"[^>]*)>/,
|
|
336
|
-
`<td$1 ${
|
|
335
|
+
`<td$1 ${A}>`
|
|
337
336
|
);
|
|
338
|
-
return
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
337
|
+
return ct(
|
|
338
|
+
Y,
|
|
339
|
+
a,
|
|
340
|
+
_,
|
|
341
|
+
G,
|
|
342
|
+
K
|
|
344
343
|
);
|
|
345
344
|
};
|
|
346
|
-
function
|
|
347
|
-
orientation:
|
|
348
|
-
itemsType: e =
|
|
345
|
+
function It({
|
|
346
|
+
orientation: s,
|
|
347
|
+
itemsType: e = N.ITEMS_TYPE.CART_ITEMS,
|
|
349
348
|
itemId: r,
|
|
350
|
-
currencySymbol:
|
|
349
|
+
currencySymbol: a,
|
|
351
350
|
currencyLocation: i,
|
|
352
351
|
migrate: d = !1,
|
|
353
352
|
formattedPrice: n = !0,
|
|
@@ -357,22 +356,22 @@ function bt({
|
|
|
357
356
|
buttonStyles: t,
|
|
358
357
|
priceStyles: p,
|
|
359
358
|
originalPriceStyles: T,
|
|
360
|
-
quantityStyles:
|
|
361
|
-
priceOrientation:
|
|
359
|
+
quantityStyles: _,
|
|
360
|
+
priceOrientation: E
|
|
362
361
|
}) {
|
|
363
|
-
const
|
|
364
|
-
|
|
365
|
-
const
|
|
366
|
-
|
|
367
|
-
const
|
|
368
|
-
return
|
|
369
|
-
|
|
362
|
+
const u = j[e].findIndex((V) => V.value === r), P = Z(r, e), I = (l == null ? void 0 : l.priceSinglePrice) ?? (c == null ? void 0 : c["data-product_price_control_single_price"]) === "1" ?? !1;
|
|
363
|
+
v = h.PAIRS_FOR_EXTENSION.imageSrc[e].DEFAULT[u >= 0 ? u : 0], F = h.PAIRS_FOR_EXTENSION.name[e].DEFAULT[u >= 0 ? u : 0];
|
|
364
|
+
const $ = h.PAIRS_FOR_EXTENSION.price[e], b = h.PAIRS_FOR_EXTENSION.originalPrice[e];
|
|
365
|
+
I ? (x = n ? $.DEFAULT_SINGLE_PRICE_FORMATTED : $.DEFAULT_SINGLE_PRICE, L = n ? b.DEFAULT_SINGLE_PRICE_FORMATTED : b.DEFAULT_SINGLE_PRICE) : (x = n ? $.DEFAULT_PRICE_FORMATTED : $.DEFAULT_PRICE, L = n ? b.DEFAULT_PRICE_FORMATTED : b.DEFAULT_PRICE), X = h.PAIRS_FOR_EXTENSION.quantity[e].DEFAULT;
|
|
366
|
+
const A = E || (l == null ? void 0 : l.priceOrientation) || "horizontal", D = (l == null ? void 0 : l.priceHideDiscount) ?? M.productPriceHideDiscountControlValue === "1";
|
|
367
|
+
return s === N.ORIENTATION.VERTICAL ? B(
|
|
368
|
+
J,
|
|
370
369
|
e,
|
|
371
|
-
|
|
372
|
-
|
|
370
|
+
P,
|
|
371
|
+
s,
|
|
373
372
|
n,
|
|
374
373
|
d,
|
|
375
|
-
|
|
374
|
+
a,
|
|
376
375
|
i,
|
|
377
376
|
c,
|
|
378
377
|
String(D),
|
|
@@ -380,19 +379,19 @@ function bt({
|
|
|
380
379
|
l,
|
|
381
380
|
o,
|
|
382
381
|
t,
|
|
383
|
-
|
|
382
|
+
A,
|
|
384
383
|
p,
|
|
385
384
|
T,
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
) :
|
|
389
|
-
|
|
385
|
+
_,
|
|
386
|
+
I
|
|
387
|
+
) : B(
|
|
388
|
+
C,
|
|
390
389
|
e,
|
|
391
|
-
|
|
392
|
-
|
|
390
|
+
P,
|
|
391
|
+
s,
|
|
393
392
|
n,
|
|
394
393
|
d,
|
|
395
|
-
|
|
394
|
+
a,
|
|
396
395
|
i,
|
|
397
396
|
c,
|
|
398
397
|
String(D),
|
|
@@ -400,14 +399,14 @@ function bt({
|
|
|
400
399
|
l,
|
|
401
400
|
o,
|
|
402
401
|
t,
|
|
403
|
-
|
|
402
|
+
A,
|
|
404
403
|
p,
|
|
405
404
|
T,
|
|
406
|
-
|
|
407
|
-
|
|
405
|
+
_,
|
|
406
|
+
I
|
|
408
407
|
);
|
|
409
408
|
}
|
|
410
409
|
export {
|
|
411
|
-
|
|
412
|
-
|
|
410
|
+
It as getDefaultTemplate,
|
|
411
|
+
w as wrapInTableRow
|
|
413
412
|
};
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
const
|
|
2
|
-
function
|
|
3
|
-
return
|
|
1
|
+
const e = ".recommendation-block-v2", n = ".recommendation-product-row";
|
|
2
|
+
function r(o) {
|
|
3
|
+
return !!o.querySelector(n);
|
|
4
|
+
}
|
|
5
|
+
function t(o) {
|
|
6
|
+
return Array.from(o.querySelectorAll(e)).filter(r).length;
|
|
4
7
|
}
|
|
5
8
|
export {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
+
e as RECOMMENDATION_BLOCK_SELECTOR,
|
|
10
|
+
n as RECOMMENDATION_PRODUCT_ROW_SELECTOR,
|
|
11
|
+
t as countLiveRecommendationBlocks,
|
|
12
|
+
r as isLiveRecommendationBlock
|
|
9
13
|
};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { SyncModuleExtractResult } from '@@/Types/events';
|
|
2
|
+
export declare const SYNC_MODULE_CLASS = "esd-synchronizable-module";
|
|
3
|
+
export declare const SYNC_MODULE_SELECTOR = ".esd-synchronizable-module";
|
|
2
4
|
export declare const useSyncModuleExtractor: () => {
|
|
3
5
|
extractSyncModuleData: (html: string) => SyncModuleExtractResult;
|
|
4
6
|
};
|
|
@@ -16,8 +16,6 @@ export declare const BLOCK_ID: BlockId;
|
|
|
16
16
|
* - Onboarding support
|
|
17
17
|
*/
|
|
18
18
|
export declare class ItemsBlock extends Block {
|
|
19
|
-
/** Block instances whose currency attrs were already self-healed this session (SD-147588 — undo-safe). */
|
|
20
|
-
private _currencyHealed;
|
|
21
19
|
getId(): string;
|
|
22
20
|
getIcon(): string;
|
|
23
21
|
getBlockCompositionType(): BlockCompositionType;
|
|
@@ -44,31 +42,4 @@ export declare class ItemsBlock extends Block {
|
|
|
44
42
|
* relies on this td-level fallback in pairProductVariables.
|
|
45
43
|
*/
|
|
46
44
|
private _stampProductTdDomAttributes;
|
|
47
|
-
/**
|
|
48
|
-
* Whether a currency self-heal pass should run for this block (SD-147588). The only gate here is
|
|
49
|
-
* once-per-session: heal each instance at most once, so the auto-fix can't fight undo (undo
|
|
50
|
-
* re-drifts the attr, which would otherwise re-trigger the heal forever). The position-vs-symbol
|
|
51
|
-
* authority split lives in `_reconcileCurrencyDomAttributes` — position is always authoritative,
|
|
52
|
-
* the symbol write alone is skipped for the 'USD' sentinel — so we must NOT gate the whole pass
|
|
53
|
-
* on symbol customization here, or a default-symbol block with a toggled location never heals.
|
|
54
|
-
*/
|
|
55
|
-
private _shouldReconcileCurrency;
|
|
56
|
-
/** Marks a block instance's currency as reconciled so it is not healed again (undo-safe). */
|
|
57
|
-
private _markCurrencyHealed;
|
|
58
|
-
/**
|
|
59
|
-
* Stamps the export-read currency attrs onto every price `<p>` from config, so a template whose
|
|
60
|
-
* attrs drifted (e.g. a location toggle before the sync fix) self-heals to match the editor.
|
|
61
|
-
* Config is the source of truth — never derive from visible text.
|
|
62
|
-
*
|
|
63
|
-
* Position and symbol differ in authority (SD-147588):
|
|
64
|
-
* - `data-curency` (position) comes from `priceCurrencyLocation`, captured independently of the
|
|
65
|
-
* symbol, so it is ALWAYS authoritative and healed whenever it drifts — even with a default
|
|
66
|
-
* symbol (otherwise the default-symbol + toggled-location case stays broken on export).
|
|
67
|
-
* - `data-currency_symbol` is stamped only for a customized symbol; the 'USD' sentinel may be a
|
|
68
|
-
* migrator default, so we trust the DOM's real value over it and never overwrite.
|
|
69
|
-
*
|
|
70
|
-
* Returns true only when an attr actually changed, so the caller can skip an empty apply that
|
|
71
|
-
* would otherwise re-trigger onDocumentChanged and loop.
|
|
72
|
-
*/
|
|
73
|
-
private _reconcileCurrencyDomAttributes;
|
|
74
45
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Block root selector — the container Stripo stamps on every v2 Items block.
|
|
3
|
+
* Legacy (`.esd-cart-items-block` &co.) is deliberately out of scope: it is
|
|
4
|
+
* normalized to v2 by `itemsBlockMigrator` at template load.
|
|
5
|
+
*/
|
|
6
|
+
export declare const ITEMS_BLOCK_SELECTOR = ".items-block-v2";
|