@useinsider/guido 3.7.2-beta.1e8f93e → 3.7.2-beta.2220fb0
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/@types/config/schemas.js +70 -66
- package/dist/composables/usePreviewMode.js +15 -14
- package/dist/composables/useRecommendationPreview.js +100 -0
- package/dist/config/compiler/recommendationCompilerRules.js +1 -1
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +90 -82
- package/dist/config/migrator/recommendation/htmlBuilder.js +59 -58
- package/dist/config/migrator/recommendation/settingsMapper.js +38 -33
- package/dist/extensions/Blocks/Items/block.js +29 -48
- package/dist/extensions/Blocks/Items/utils/nodeConfigUtils.js +45 -62
- package/dist/extensions/Blocks/Recommendation/block.js +60 -41
- package/dist/extensions/Blocks/Recommendation/canvasPreview.css.js +16 -0
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +41 -32
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +369 -288
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +96 -84
- package/dist/extensions/Blocks/Recommendation/controls/main/pricePlacement.js +133 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +83 -81
- package/dist/extensions/Blocks/Recommendation/extension.js +30 -29
- package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +21 -7
- package/dist/extensions/Blocks/Recommendation/recommendation.css.js +64 -4
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +7 -5
- package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +109 -78
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +31 -30
- package/dist/extensions/Blocks/Recommendation/templates/index.js +9 -7
- package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +78 -61
- package/dist/extensions/Blocks/Recommendation/templates/list/template.js +21 -21
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +90 -55
- package/dist/src/@types/config/schemas.d.ts +16 -0
- package/dist/src/composables/useConfig.d.ts +4 -0
- package/dist/src/composables/useRecommendationPreview.d.ts +10 -0
- package/dist/src/config/migrator/recommendation/settingsMapper.d.ts +1 -1
- package/dist/src/extensions/Blocks/Items/block.d.ts +0 -8
- package/dist/src/extensions/Blocks/Items/utils/nodeConfigUtils.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/block.d.ts +10 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +29 -3
- package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +3 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/main/pricePlacement.d.ts +59 -0
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +2 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/grid/elementRenderer.d.ts +16 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/grid/template.d.ts +4 -4
- package/dist/src/extensions/Blocks/Recommendation/templates/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/templates/list/elementRenderer.d.ts +13 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/list/template.d.ts +3 -2
- package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +39 -1
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +15 -0
- package/dist/src/stores/config.d.ts +36 -0
- package/package.json +1 -1
|
@@ -3,10 +3,10 @@ import { useRecommendationApi as y } from "../../../../services/recommendationAp
|
|
|
3
3
|
import { useConfigStore as G } from "../../../../stores/config.js";
|
|
4
4
|
import { defineStore as P } from "pinia";
|
|
5
5
|
import { DEFAULT_MOBILE_CARDS_IN_ROW as D, DEFAULT_CARDS_IN_ROW as F } from "../constants/layout.js";
|
|
6
|
-
import { EXCLUDED_ALGORITHM_IDS as
|
|
6
|
+
import { EXCLUDED_ALGORITHM_IDS as v } from "../constants/defaultConfig.js";
|
|
7
7
|
import { getDefaultProducts as S } from "../templates/utils.js";
|
|
8
8
|
import { generateCompleteFilterQuery as b } from "../utils/filterUtil.js";
|
|
9
|
-
import { getPartnerRecommendationParams as
|
|
9
|
+
import { getPartnerRecommendationParams as w } from "../utils/partnerCustomizations.js";
|
|
10
10
|
import { isFilterValid as N } from "../validation/filterSchema.js";
|
|
11
11
|
import { isConfigValid as x } from "../validation/requiredFields.js";
|
|
12
12
|
const h = y();
|
|
@@ -37,7 +37,9 @@ function k() {
|
|
|
37
37
|
textTrimming: !0,
|
|
38
38
|
unresponsive: !1,
|
|
39
39
|
size: "6",
|
|
40
|
-
customAttributes: []
|
|
40
|
+
customAttributes: [],
|
|
41
|
+
priceMovedToNextLine: !0,
|
|
42
|
+
priceHideIfSameAsDiscounted: !1
|
|
41
43
|
};
|
|
42
44
|
}
|
|
43
45
|
function I() {
|
|
@@ -117,7 +119,7 @@ const L = () => ({
|
|
|
117
119
|
},
|
|
118
120
|
getActivePredictiveAlgorithms: (t) => {
|
|
119
121
|
const e = g(), r = [];
|
|
120
|
-
return t.activePredictiveAlgorithms.filter((n) => !
|
|
122
|
+
return t.activePredictiveAlgorithms.filter((n) => !v.includes(n)).forEach((n) => {
|
|
121
123
|
r.push(...e.filter((c) => c.id === n));
|
|
122
124
|
}), r.map((n) => ({
|
|
123
125
|
text: n.name,
|
|
@@ -457,7 +459,7 @@ const L = () => ({
|
|
|
457
459
|
};
|
|
458
460
|
r.strategy === "manualMerchandising" ? a.productId = r.productIds.join(",") : r.strategy === "similarViewed" && (a.productId = "{itemId}"), r.strategy === "userBased" && (a.userId = "{user_id}"), c && (a.filter = c), r.shuffleProducts && (a.shuffle = !0), Object.assign(
|
|
459
461
|
a,
|
|
460
|
-
|
|
462
|
+
w(o.partnerName, r.strategy)
|
|
461
463
|
);
|
|
462
464
|
let f;
|
|
463
465
|
try {
|
|
@@ -1,33 +1,60 @@
|
|
|
1
1
|
import { RecommendationBlockId as l } from "../../constants/blockIds.js";
|
|
2
|
-
import { ATTR_PRODUCT_ATTR as u, CSS_CLASS_RECO_BUTTON as
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
function S(t, e = s) {
|
|
8
|
-
return `<td class="${a}" style="padding: ${e};" width="${t}%"></td>`;
|
|
2
|
+
import { ATTR_PRODUCT_ATTR as u, CSS_CLASS_RECO_BUTTON as g, ATTR_PRODUCT_BUTTON as h, ATTR_PRODUCT_OMNIBUS_DISCOUNT as $, ATTR_PRODUCT_OMNIBUS_PRICE as y, ATTR_PRODUCT_OLD_PRICE as m, ATTR_PRODUCT_PRICE as T, ATTR_PRODUCT_NAME as x, ATTR_PRODUCT_IMAGE as f } from "../../constants/selectors.js";
|
|
3
|
+
import { formatProductPrice as o, isSamePrice as b, CUSTOM_CELL_HTML as _, getCurrentCurrencyConfig as C, sanitizeImageUrl as R } from "../utils.js";
|
|
4
|
+
const s = "0 5px", d = "attribute-cell";
|
|
5
|
+
function U(e, t = s) {
|
|
6
|
+
return `<td class="${d}" style="padding: ${t};" width="${e}%"></td>`;
|
|
9
7
|
}
|
|
10
|
-
function
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
8
|
+
function I(e, t = !0) {
|
|
9
|
+
const n = `<s><strong>${o(e, "original_price")}</strong></s>`, r = (a) => `<td
|
|
10
|
+
class="esd-block-text product-price ${a}"
|
|
11
|
+
align="center"
|
|
12
|
+
valign="middle"
|
|
13
|
+
esd-extension-block-id="${l.PRICE}">
|
|
14
|
+
<p contenteditable="false" style="font-size: 16px; color: #333333;">
|
|
15
|
+
<strong>${o(e, "price")}</strong>
|
|
16
|
+
</p>
|
|
17
|
+
</td>`, i = (a) => `<td
|
|
18
|
+
class="esd-block-text product-old-price ${a}"
|
|
19
|
+
align="center"
|
|
20
|
+
valign="middle"
|
|
21
|
+
data-same-price="${b(e)}"
|
|
22
|
+
esd-extension-block-id="${l.OLD_PRICE}">
|
|
23
|
+
<p contenteditable="false" style="font-size: 14px; color: #999999;">
|
|
24
|
+
${n}
|
|
25
|
+
</p>
|
|
26
|
+
</td>`, p = t ? i("es-p15l es-p5r") : r("es-p15l es-p5r"), c = t ? r("es-p5l es-p15r") : i("es-p5l es-p15r");
|
|
27
|
+
return `
|
|
28
|
+
<td class="${d}" style="padding: ${s}; height: 100%;" valign="top">
|
|
29
|
+
<table
|
|
30
|
+
class="product-card-segment"
|
|
31
|
+
width="100%"
|
|
32
|
+
height="100%"
|
|
33
|
+
cellpadding="0"
|
|
34
|
+
cellspacing="0"
|
|
35
|
+
border="0">
|
|
36
|
+
<tbody>
|
|
37
|
+
<tr valign="top">
|
|
38
|
+
<td align="center">
|
|
39
|
+
<table cellpadding="0" cellspacing="0" border="0" align="center" style="margin: 0 auto;">
|
|
40
|
+
<tbody>
|
|
41
|
+
<tr valign="middle">
|
|
42
|
+
${p}
|
|
43
|
+
${c}
|
|
44
|
+
</tr>
|
|
45
|
+
</tbody>
|
|
46
|
+
</table>
|
|
47
|
+
</td>
|
|
48
|
+
</tr>
|
|
49
|
+
</tbody>
|
|
50
|
+
</table>
|
|
51
|
+
</td>
|
|
52
|
+
`;
|
|
27
53
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
54
|
+
function P(e) {
|
|
55
|
+
const t = `<s><strong>${o(e, "original_price")}</strong></s>`;
|
|
56
|
+
return `
|
|
57
|
+
<td class="${d}" style="padding: ${s}; height: 100%;" valign="top">
|
|
31
58
|
<table
|
|
32
59
|
class="product-card-segment"
|
|
33
60
|
width="100%"
|
|
@@ -38,64 +65,67 @@ const A = {
|
|
|
38
65
|
<tbody>
|
|
39
66
|
<tr valign="top">
|
|
40
67
|
<td
|
|
41
|
-
class="esd-block-
|
|
68
|
+
class="esd-block-text product-old-price es-p15l es-p15r"
|
|
42
69
|
align="center"
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
style="display: block; max-width: 100%; height: auto;"
|
|
49
|
-
class="adapt-img">
|
|
50
|
-
</a>
|
|
70
|
+
data-same-price="${b(e)}"
|
|
71
|
+
esd-extension-block-id="${l.OLD_PRICE}">
|
|
72
|
+
<p contenteditable="false" style="font-size: 14px; color: #999999;">
|
|
73
|
+
${t}
|
|
74
|
+
</p>
|
|
51
75
|
</td>
|
|
52
76
|
</tr>
|
|
53
77
|
</tbody>
|
|
54
78
|
</table>
|
|
55
79
|
</td>
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
80
|
+
`;
|
|
81
|
+
}
|
|
82
|
+
const E = {
|
|
83
|
+
[f]: (e) => `
|
|
84
|
+
<td class="${d}" style="padding: ${s}; height: 100%;" valign="top">
|
|
59
85
|
<table
|
|
60
86
|
class="product-card-segment"
|
|
61
87
|
width="100%"
|
|
62
88
|
height="100%"
|
|
63
89
|
cellpadding="0"
|
|
64
90
|
cellspacing="0"
|
|
65
|
-
border="0"
|
|
66
|
-
style="table-layout: fixed;">
|
|
91
|
+
border="0">
|
|
67
92
|
<tbody>
|
|
68
93
|
<tr valign="top">
|
|
69
94
|
<td
|
|
70
|
-
class="esd-block-
|
|
95
|
+
class="esd-block-image product-image"
|
|
71
96
|
align="center"
|
|
72
|
-
esd-extension-block-id="${l.
|
|
73
|
-
<
|
|
74
|
-
<
|
|
75
|
-
|
|
97
|
+
esd-extension-block-id="${l.IMAGE}">
|
|
98
|
+
<a target="_blank" href="${e.url}" class="${g}">
|
|
99
|
+
<img
|
|
100
|
+
src="${R(e.image_url)}"
|
|
101
|
+
alt="${e.name}"
|
|
102
|
+
style="display: block; max-width: 100%; height: auto;"
|
|
103
|
+
class="adapt-img">
|
|
104
|
+
</a>
|
|
76
105
|
</td>
|
|
77
106
|
</tr>
|
|
78
107
|
</tbody>
|
|
79
108
|
</table>
|
|
80
109
|
</td>
|
|
81
110
|
`,
|
|
82
|
-
[
|
|
83
|
-
<td class="${
|
|
111
|
+
[x]: (e) => `
|
|
112
|
+
<td class="${d}" style="padding: ${s}; height: 100%;" valign="middle">
|
|
84
113
|
<table
|
|
85
114
|
class="product-card-segment"
|
|
86
115
|
width="100%"
|
|
87
116
|
height="100%"
|
|
88
117
|
cellpadding="0"
|
|
89
118
|
cellspacing="0"
|
|
90
|
-
border="0"
|
|
119
|
+
border="0"
|
|
120
|
+
style="table-layout: fixed;">
|
|
91
121
|
<tbody>
|
|
92
122
|
<tr valign="top">
|
|
93
123
|
<td
|
|
94
|
-
class="esd-block-text product-
|
|
124
|
+
class="esd-block-text product-name es-p10t es-p10b es-p15l es-p15r"
|
|
95
125
|
align="center"
|
|
96
|
-
esd-extension-block-id="${l.
|
|
126
|
+
esd-extension-block-id="${l.NAME}">
|
|
97
127
|
<p contenteditable="false" style="font-size: 16px; color: #333333;">
|
|
98
|
-
<strong>${
|
|
128
|
+
<strong>${e.name}</strong>
|
|
99
129
|
</p>
|
|
100
130
|
</td>
|
|
101
131
|
</tr>
|
|
@@ -103,8 +133,8 @@ const A = {
|
|
|
103
133
|
</table>
|
|
104
134
|
</td>
|
|
105
135
|
`,
|
|
106
|
-
[T]: (
|
|
107
|
-
<td class="${
|
|
136
|
+
[T]: (e) => `
|
|
137
|
+
<td class="${d}" style="padding: ${s}; height: 100%;" valign="top">
|
|
108
138
|
<table
|
|
109
139
|
class="product-card-segment"
|
|
110
140
|
width="100%"
|
|
@@ -115,13 +145,11 @@ const A = {
|
|
|
115
145
|
<tbody>
|
|
116
146
|
<tr valign="top">
|
|
117
147
|
<td
|
|
118
|
-
class="esd-block-text product-
|
|
148
|
+
class="esd-block-text product-price es-p15l es-p15r"
|
|
119
149
|
align="center"
|
|
120
|
-
esd-extension-block-id="${l.
|
|
121
|
-
<p
|
|
122
|
-
|
|
123
|
-
style="font-size: 14px; color: #999999;">
|
|
124
|
-
<s><strong>${i(t, "original_price")}</strong></s>
|
|
150
|
+
esd-extension-block-id="${l.PRICE}">
|
|
151
|
+
<p contenteditable="false" style="font-size: 16px; color: #333333;">
|
|
152
|
+
<strong>${o(e, "price")}</strong>
|
|
125
153
|
</p>
|
|
126
154
|
</td>
|
|
127
155
|
</tr>
|
|
@@ -129,8 +157,9 @@ const A = {
|
|
|
129
157
|
</table>
|
|
130
158
|
</td>
|
|
131
159
|
`,
|
|
132
|
-
[
|
|
133
|
-
|
|
160
|
+
[m]: (e) => P(e),
|
|
161
|
+
[y]: (e) => `
|
|
162
|
+
<td class="${d}" style="padding: ${s}; height: 100%;" valign="top">
|
|
134
163
|
<table
|
|
135
164
|
class="product-card-segment"
|
|
136
165
|
width="100%"
|
|
@@ -148,7 +177,7 @@ const A = {
|
|
|
148
177
|
esd-extension-block-id="${l.OMNIBUS_PRICE}">
|
|
149
178
|
<p contenteditable="false" style="font-size: 12px; color: #666666;">
|
|
150
179
|
<span class="omnibus-text-before">Lowest 30-day price: </span>
|
|
151
|
-
<span class="omnibus-price-value">${
|
|
180
|
+
<span class="omnibus-price-value">${o(e, "original_price")}</span>
|
|
152
181
|
<span class="omnibus-text-after"></span>
|
|
153
182
|
</p>
|
|
154
183
|
</td>
|
|
@@ -157,11 +186,11 @@ const A = {
|
|
|
157
186
|
</table>
|
|
158
187
|
</td>
|
|
159
188
|
`,
|
|
160
|
-
[
|
|
161
|
-
var
|
|
162
|
-
const
|
|
189
|
+
[$]: (e) => {
|
|
190
|
+
var c, a;
|
|
191
|
+
const t = C(), n = ((c = e.original_price) == null ? void 0 : c[t.code]) ?? Object.values(e.original_price ?? {})[0] ?? 0, r = ((a = e.price) == null ? void 0 : a[t.code]) ?? Object.values(e.price ?? {})[0] ?? 0, i = n > 0 ? Math.round((n - r) / n * 100) : 0, p = i > 0 ? `-${i}%` : "0%";
|
|
163
192
|
return `
|
|
164
|
-
<td class="${
|
|
193
|
+
<td class="${d}" style="padding: ${s}; height: 100%;" valign="top">
|
|
165
194
|
<table
|
|
166
195
|
class="product-card-segment"
|
|
167
196
|
width="100%"
|
|
@@ -179,7 +208,7 @@ const A = {
|
|
|
179
208
|
esd-extension-block-id="${l.OMNIBUS_DISCOUNT}">
|
|
180
209
|
<p contenteditable="false" style="font-size: 12px; color: #666666;">
|
|
181
210
|
<span class="omnibus-text-before"></span>
|
|
182
|
-
<span class="omnibus-discount-value">${
|
|
211
|
+
<span class="omnibus-discount-value">${p}</span>
|
|
183
212
|
<span class="omnibus-text-after"></span>
|
|
184
213
|
</p>
|
|
185
214
|
</td>
|
|
@@ -189,8 +218,8 @@ const A = {
|
|
|
189
218
|
</td>
|
|
190
219
|
`;
|
|
191
220
|
},
|
|
192
|
-
[
|
|
193
|
-
<td class="${
|
|
221
|
+
[h]: () => `
|
|
222
|
+
<td class="${d}" style="padding: ${s}; height: 100%;" valign="top">
|
|
194
223
|
<table
|
|
195
224
|
class="product-card-segment"
|
|
196
225
|
width="100%"
|
|
@@ -213,7 +242,7 @@ const A = {
|
|
|
213
242
|
">
|
|
214
243
|
<a
|
|
215
244
|
href="#"
|
|
216
|
-
class="es-button ${
|
|
245
|
+
class="es-button ${g}"
|
|
217
246
|
target="_blank"
|
|
218
247
|
style="
|
|
219
248
|
color: rgb(56, 118, 29);
|
|
@@ -241,8 +270,8 @@ const A = {
|
|
|
241
270
|
* @param productAttrValue - Resolved product-attr value (e.g., "brand" for default, "product_attribute.rating_star" for custom)
|
|
242
271
|
* @param content - Display content for the cell
|
|
243
272
|
*/
|
|
244
|
-
[
|
|
245
|
-
<td class="${
|
|
273
|
+
[_]: (e, t) => `
|
|
274
|
+
<td class="${d}" style="padding: ${s}; height: 100%;" valign="middle">
|
|
246
275
|
<table
|
|
247
276
|
class="product-card-segment"
|
|
248
277
|
width="100%"
|
|
@@ -254,11 +283,11 @@ const A = {
|
|
|
254
283
|
<tbody>
|
|
255
284
|
<tr valign="top">
|
|
256
285
|
<td
|
|
257
|
-
${u}="${
|
|
286
|
+
${u}="${e}"
|
|
258
287
|
class="esd-block-text product-custom-attribute es-p0t es-p0b es-p15l es-p15r"
|
|
259
288
|
align="center"
|
|
260
289
|
esd-extension-block-id="${l.CUSTOM_ATTRIBUTE}">
|
|
261
|
-
<p contenteditable="false" style="font-size: 12px; color: #666666;">${
|
|
290
|
+
<p contenteditable="false" style="font-size: 12px; color: #666666;">${t}</p>
|
|
262
291
|
</td>
|
|
263
292
|
</tr>
|
|
264
293
|
</tbody>
|
|
@@ -267,8 +296,10 @@ const A = {
|
|
|
267
296
|
`
|
|
268
297
|
};
|
|
269
298
|
export {
|
|
270
|
-
|
|
299
|
+
d as ATTRIBUTE_CELL_CLASS,
|
|
271
300
|
s as DEFAULT_CELL_PADDING,
|
|
272
|
-
|
|
273
|
-
|
|
301
|
+
U as buildFillerCell,
|
|
302
|
+
E as gridElementRenderer,
|
|
303
|
+
P as renderGridOldPriceCell,
|
|
304
|
+
I as renderInlineGridPriceCell
|
|
274
305
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { DEFAULT_PRODUCTS_PER_ROW as
|
|
2
|
-
import { getDefaultProducts as
|
|
3
|
-
import { buildFillerCell as
|
|
4
|
-
const
|
|
1
|
+
import { DEFAULT_PRODUCTS_PER_ROW as E } from "../../constants/layout.js";
|
|
2
|
+
import { getDefaultProducts as L, DEFAULTS as S, createBlockTemplate as _, DEFAULT_CARD_COMPOSITION as w, spacer as C, buildElementRenderer as O, resolveInlinePriceOrder as A, DEFAULT_CARD_VISIBILITY as D } from "../utils.js";
|
|
3
|
+
import { renderInlineGridPriceCell as P, buildFillerCell as g, gridElementRenderer as h } from "./elementRenderer.js";
|
|
4
|
+
const U = `
|
|
5
5
|
<tr class="recommendation-product-row">
|
|
6
6
|
<td>
|
|
7
7
|
<table
|
|
@@ -18,7 +18,7 @@ const D = `
|
|
|
18
18
|
</table>
|
|
19
19
|
</td>
|
|
20
20
|
</tr>
|
|
21
|
-
`,
|
|
21
|
+
`, Y = `
|
|
22
22
|
<tr
|
|
23
23
|
class="recommendation-attribute-row"
|
|
24
24
|
data-attribute-type="{-{-ATTR_TYPE-}-}"
|
|
@@ -27,38 +27,39 @@ const D = `
|
|
|
27
27
|
{-{-CELLS-}-}
|
|
28
28
|
</tr>
|
|
29
29
|
`;
|
|
30
|
-
function
|
|
31
|
-
const
|
|
32
|
-
return
|
|
33
|
-
const
|
|
34
|
-
return
|
|
30
|
+
function y(e, t, o, r = w, i = {}, p = {}) {
|
|
31
|
+
const { priceInline: s = !1 } = p, u = (100 / t).toFixed(2), n = t - e.length, T = n > 0 ? g(u).repeat(n) : "", d = O(o, r, i), c = A(r), R = s ? r.filter((l) => l !== c.skip) : r, I = (l, a) => s && l === c.anchor ? P(a, c.originalFirst) : d[l](a);
|
|
32
|
+
return R.filter((l) => d[l]).map((l) => {
|
|
33
|
+
const a = D[l] ?? !0, m = a ? "" : 'style="display: none;"', b = e.map((f) => I(l, f).replace("<td", `<td width="${u}%"`)).join("");
|
|
34
|
+
return Y.replace("{-{-ATTR_TYPE-}-}", l).replace("{-{-VISIBILITY-}-}", a ? "1" : "0").replace("{-{-DISPLAY_STYLE-}-}", m).replace("{-{-CELLS-}-}", b + T);
|
|
35
35
|
}).join("");
|
|
36
36
|
}
|
|
37
|
-
function
|
|
38
|
-
const
|
|
39
|
-
for (let
|
|
40
|
-
|
|
41
|
-
return
|
|
42
|
-
const d =
|
|
43
|
-
l,
|
|
44
|
-
e,
|
|
37
|
+
function B(e, t, o, r, i = {}, p = {}) {
|
|
38
|
+
const s = [];
|
|
39
|
+
for (let n = 0; n < e.length; n += t)
|
|
40
|
+
s.push(e.slice(n, n + t));
|
|
41
|
+
return s.map((n, T) => {
|
|
42
|
+
const d = y(
|
|
45
43
|
n,
|
|
44
|
+
t,
|
|
45
|
+
o,
|
|
46
46
|
r,
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
i,
|
|
48
|
+
p
|
|
49
|
+
), c = U.replace("{-{-ATTRIBUTE_ROWS-}-}", d);
|
|
50
|
+
return T > 0 ? C + c : c;
|
|
50
51
|
}).join("");
|
|
51
52
|
}
|
|
52
|
-
function
|
|
53
|
-
return
|
|
53
|
+
function F(e, t, o, r = {}, i = {}) {
|
|
54
|
+
return B(e, t, h, o, r, i);
|
|
54
55
|
}
|
|
55
|
-
function
|
|
56
|
-
const
|
|
57
|
-
return
|
|
56
|
+
function j(e) {
|
|
57
|
+
const t = e ? `ins-recommendation-v3-block-${e}` : void 0, o = _("grid", t), r = L(), i = F(r, E);
|
|
58
|
+
return o.replace("{-{-TITLE-}-}", S.TITLE).replace("{-{-PRODUCT_ROWS-}-}", i).replace("{-{-MOBILE_PRODUCT_ROWS-}-}", "");
|
|
58
59
|
}
|
|
59
60
|
export {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
j as getDefaultTemplate,
|
|
62
|
+
y as prepareGridAttributeRows,
|
|
63
|
+
B as prepareGridProductRows,
|
|
64
|
+
F as prepareProductRows
|
|
64
65
|
};
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { DEFAULT_PRODUCTS_PER_ROW as s } from "../constants/layout.js";
|
|
2
|
-
import { prepareProductRows as
|
|
3
|
-
import { prepareProductRows as
|
|
4
|
-
|
|
2
|
+
import { prepareProductRows as m } from "./grid/template.js";
|
|
3
|
+
import { prepareProductRows as n } from "./list/template.js";
|
|
4
|
+
import "../store/recommendation.js";
|
|
5
|
+
function P(o, t, r = {}) {
|
|
6
|
+
const e = { priceInline: r.priceInline };
|
|
5
7
|
if (t === "list")
|
|
6
|
-
return
|
|
7
|
-
const { productsPerRow:
|
|
8
|
-
return
|
|
8
|
+
return n(o, r.composition, r.filterList, e);
|
|
9
|
+
const { productsPerRow: i = s, composition: p, filterList: c } = r;
|
|
10
|
+
return m(o, i, p, c, e);
|
|
9
11
|
}
|
|
10
12
|
export {
|
|
11
|
-
|
|
13
|
+
P as prepareProductRows
|
|
12
14
|
};
|