@useinsider/guido 3.14.0-beta.1e474dd → 3.14.0-beta.38ec3aa
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/useEmailTemplateApplier.js +46 -32
- package/dist/composables/useHtmlValidator.js +50 -50
- package/dist/config/i18n/en/labels.json.js +3 -7
- package/dist/config/migrator/recommendation/compositionMapper.js +23 -26
- package/dist/config/migrator/recommendation/htmlBuilder.js +155 -156
- package/dist/extensions/Blocks/Recommendation/constants/selectors.js +13 -15
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +314 -346
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +43 -44
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +16 -16
- package/dist/extensions/Blocks/Recommendation/templates/list/template.js +16 -16
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +120 -120
- package/dist/extensions/Blocks/Recommendation/utils/captureStyleTemplates.js +54 -55
- package/dist/extensions/Blocks/common-control.js +35 -42
- package/dist/src/composables/useHtmlValidator.d.ts +2 -3
- package/dist/src/config/migrator/recommendation/types.d.ts +0 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +0 -4
- package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +5 -22
- package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +11 -12
- package/dist/src/extensions/Blocks/common-control.d.ts +1 -3
- package/dist/src/stores/dynamic-content.d.ts +8 -0
- package/dist/src/utils/registerUsedDynamicContent.d.ts +8 -0
- package/dist/stores/dynamic-content.js +12 -2
- package/dist/utils/registerUsedDynamicContent.js +23 -0
- package/package.json +1 -1
- package/dist/extensions/Blocks/Recommendation/utils/compositionKeys.js +0 -89
- package/dist/src/extensions/Blocks/Recommendation/utils/compositionKeys.d.ts +0 -52
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { ModificationDescription as g } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
2
|
import { RecommendationBlockId as m } from "../../constants/blockIds.js";
|
|
3
|
-
import { CURRENCY_ATTR as y, CSS_CLASS_SKIP_COMPILE as F, MOBILE_CONTAINER_SELECTOR as O, DESKTOP_CONTAINER_SELECTOR as N, CONTAINER_SELECTOR as
|
|
3
|
+
import { CURRENCY_ATTR as y, CSS_CLASS_SKIP_COMPILE as F, MOBILE_CONTAINER_SELECTOR as O, DESKTOP_CONTAINER_SELECTOR as N, CONTAINER_SELECTOR as G, MOBILE_ROW_SELECTOR as w, ATTR_PRODUCT_ATTR as K, PRODUCT_ATTRIBUTE_PREFIX as T } from "../../constants/selectors.js";
|
|
4
4
|
import { RecommendationConfigService as S } from "../../services/configService.js";
|
|
5
5
|
import { useRecommendationExtensionStore as P } from "../../store/recommendation.js";
|
|
6
6
|
import { prepareProductRows as L } from "../../templates/index.js";
|
|
7
7
|
import { captureStyles as _ } from "../../utils/captureStyleTemplates.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { getDefaultProducts as k, DEFAULT_CARD_COMPOSITION as R, sanitizeImageUrl as Y, isSamePrice as z, toDisplayableAttributeValue as X } from "../../templates/utils.js";
|
|
8
|
+
import { formatPrice as V } from "../../utils/priceFormatter.js";
|
|
9
|
+
import { getDefaultProducts as k, DEFAULT_CARD_COMPOSITION as R, sanitizeImageUrl as W, isSamePrice as Y, toDisplayableAttributeValue as X } from "../../templates/utils.js";
|
|
11
10
|
const M = "recommendation-block-v2";
|
|
12
11
|
function A(t) {
|
|
13
12
|
if (!t)
|
|
@@ -19,7 +18,7 @@ function A(t) {
|
|
|
19
18
|
}
|
|
20
19
|
return "querySelector" in t ? t.querySelector(`.${M}`) ?? null : null;
|
|
21
20
|
}
|
|
22
|
-
function
|
|
21
|
+
function z(t) {
|
|
23
22
|
const e = A(t);
|
|
24
23
|
return !e || !("getAttribute" in e) ? !1 : (e.getAttribute("class") ?? "").split(/\s+/).includes(F);
|
|
25
24
|
}
|
|
@@ -35,7 +34,7 @@ function x(t) {
|
|
|
35
34
|
if (!e || !("getAttribute" in e))
|
|
36
35
|
return R;
|
|
37
36
|
const n = e.getAttribute("data-card-composition");
|
|
38
|
-
return n ?
|
|
37
|
+
return n ? n.split(",").filter(Boolean) : R;
|
|
39
38
|
}
|
|
40
39
|
function D(t) {
|
|
41
40
|
if (!t || !("childNodes" in t))
|
|
@@ -56,25 +55,25 @@ function U(t) {
|
|
|
56
55
|
if (typeof t == "number")
|
|
57
56
|
return `0 ${t / 2}px`;
|
|
58
57
|
}
|
|
59
|
-
function
|
|
58
|
+
function J(t) {
|
|
60
59
|
const { currentNode: e, documentModifier: n } = t;
|
|
61
60
|
if (!e || !("querySelector" in e))
|
|
62
61
|
return !1;
|
|
63
62
|
const o = e.querySelector(w);
|
|
64
63
|
return o ? (n.modifyHtml(o).setInnerHtml(""), !0) : !1;
|
|
65
64
|
}
|
|
66
|
-
function
|
|
65
|
+
function Q(t) {
|
|
67
66
|
return "getOuterHTML" in t && typeof t.getOuterHTML == "function" ? t.getOuterHTML() : "";
|
|
68
67
|
}
|
|
69
|
-
function
|
|
68
|
+
function Z(t) {
|
|
70
69
|
const e = t.querySelector(".container");
|
|
71
70
|
return !e || !("childNodes" in e) ? null : e.childNodes().find((o) => "getTagName" in o && o.getTagName() === "tbody") ?? e.querySelector("tbody") ?? null;
|
|
72
71
|
}
|
|
73
|
-
function
|
|
74
|
-
const o =
|
|
72
|
+
function ee(t, e, n) {
|
|
73
|
+
const o = Z(t);
|
|
75
74
|
if (!o || !("childNodes" in o))
|
|
76
75
|
return;
|
|
77
|
-
const r = o.childNodes().map(
|
|
76
|
+
const r = o.childNodes().map(Q).join(""), s = `<tr class="ins-recommendation-mobile-row">${n}</tr>`;
|
|
78
77
|
e.modifyHtml(o).setInnerHtml(r + s), e.apply(new g("Added mobile product row"));
|
|
79
78
|
}
|
|
80
79
|
function $(t, e = {}) {
|
|
@@ -89,7 +88,7 @@ function $(t, e = {}) {
|
|
|
89
88
|
return !1;
|
|
90
89
|
const u = s ?? C(n), c = S.getConfig(n);
|
|
91
90
|
if (u === "list" || !c.mobileLayoutEnabled)
|
|
92
|
-
return
|
|
91
|
+
return J({ currentNode: n, documentModifier: o });
|
|
93
92
|
const l = P(), a = H(r, l.recommendationProducts), d = i ?? x(n), p = `<td><table class="ins-recommendation-product-container ins-recommendation-mobile-container" width="100%" cellpadding="0" cellspacing="0" border="0">${L(a, u, {
|
|
94
93
|
productsPerRow: c.mobileCardsInRow,
|
|
95
94
|
composition: d,
|
|
@@ -100,12 +99,12 @@ function $(t, e = {}) {
|
|
|
100
99
|
rowSpacingPx: c.mobileRowSpacing,
|
|
101
100
|
...e
|
|
102
101
|
})}</table></td>`, E = n.querySelector(w);
|
|
103
|
-
return E ? (o.modifyHtml(E).setInnerHtml(p), !0) : (
|
|
102
|
+
return E ? (o.modifyHtml(E).setInnerHtml(p), !0) : (ee(n, o, p), !1);
|
|
104
103
|
}
|
|
105
|
-
function
|
|
104
|
+
function ye(t) {
|
|
106
105
|
$(t, _(t.currentNode)) && t.documentModifier.apply(new g("Updated mobile product rows"));
|
|
107
106
|
}
|
|
108
|
-
function
|
|
107
|
+
function te(t, e = {}) {
|
|
109
108
|
const {
|
|
110
109
|
currentNode: n,
|
|
111
110
|
documentModifier: o,
|
|
@@ -115,7 +114,7 @@ function ne(t, e = {}) {
|
|
|
115
114
|
} = t;
|
|
116
115
|
if (!n || !("querySelector" in n))
|
|
117
116
|
return !1;
|
|
118
|
-
const u = n.querySelector(N) ?? n.querySelector(
|
|
117
|
+
const u = n.querySelector(N) ?? n.querySelector(G);
|
|
119
118
|
if (!u)
|
|
120
119
|
return !1;
|
|
121
120
|
const c = P(), l = H(r, c.recommendationProducts), { cardsInRow: a } = S.getConfig(n), d = i ?? x(n), f = s ?? C(n), p = S.getConfig(n), E = L(l, f, {
|
|
@@ -130,7 +129,7 @@ function ne(t, e = {}) {
|
|
|
130
129
|
});
|
|
131
130
|
return o.modifyHtml(u).setInnerHtml(E), !0;
|
|
132
131
|
}
|
|
133
|
-
function
|
|
132
|
+
function be(t) {
|
|
134
133
|
const {
|
|
135
134
|
currentNode: e,
|
|
136
135
|
documentModifier: n,
|
|
@@ -149,10 +148,10 @@ function Se(t) {
|
|
|
149
148
|
layout: s,
|
|
150
149
|
composition: i
|
|
151
150
|
};
|
|
152
|
-
let a =
|
|
151
|
+
let a = te(l, c);
|
|
153
152
|
a = $(l, c) || a, a && n.apply(new g("Regenerate products with styles")), o == null || o();
|
|
154
153
|
}
|
|
155
|
-
function
|
|
154
|
+
function ge(t, e) {
|
|
156
155
|
return t.length === e ? t : t.length > e ? t.slice(0, e) : [...t, ...k(e - t.length)];
|
|
157
156
|
}
|
|
158
157
|
function B() {
|
|
@@ -168,12 +167,12 @@ function B() {
|
|
|
168
167
|
}
|
|
169
168
|
function q(t, e = "price") {
|
|
170
169
|
const n = B(), o = t[e], r = (o == null ? void 0 : o[n.code]) ?? Object.values(o ?? {})[0] ?? 0;
|
|
171
|
-
return
|
|
170
|
+
return V({
|
|
172
171
|
price: r,
|
|
173
172
|
currency: n
|
|
174
173
|
});
|
|
175
174
|
}
|
|
176
|
-
function
|
|
175
|
+
function ne(t) {
|
|
177
176
|
var s, i;
|
|
178
177
|
const e = B(), n = ((s = t.original_price) == null ? void 0 : s[e.code]) ?? Object.values(t.original_price ?? {})[0] ?? 0, o = ((i = t.price) == null ? void 0 : i[e.code]) ?? Object.values(t.price ?? {})[0] ?? 0, r = n > 0 ? Math.round((n - o) / n * 100) : 0;
|
|
179
178
|
return r > 0 ? `-${r}%` : "0%";
|
|
@@ -187,19 +186,19 @@ function v(t) {
|
|
|
187
186
|
}
|
|
188
187
|
if (r && "querySelector" in r) {
|
|
189
188
|
const c = r.querySelector("strong") ?? r.querySelector("p"), l = q(n, "original_price");
|
|
190
|
-
b(e, c ?? null, l) && (u = !0), e.modifyHtml(r).setAttribute("data-same-price", String(
|
|
189
|
+
b(e, c ?? null, l) && (u = !0), e.modifyHtml(r).setAttribute("data-same-price", String(Y(n))), u = !0;
|
|
191
190
|
}
|
|
192
191
|
if (s && "querySelector" in s) {
|
|
193
192
|
const c = s.querySelector(".omnibus-price-value") ?? null, l = q(n, "original_price");
|
|
194
193
|
b(e, c, l) && (u = !0);
|
|
195
194
|
}
|
|
196
195
|
if (i && "querySelector" in i) {
|
|
197
|
-
const c = i.querySelector(".omnibus-discount-value") ?? null, l =
|
|
196
|
+
const c = i.querySelector(".omnibus-discount-value") ?? null, l = ne(n);
|
|
198
197
|
b(e, c, l) && (u = !0);
|
|
199
198
|
}
|
|
200
199
|
return u;
|
|
201
200
|
}
|
|
202
|
-
function
|
|
201
|
+
function oe(t) {
|
|
203
202
|
const {
|
|
204
203
|
documentModifier: e,
|
|
205
204
|
product: n,
|
|
@@ -214,7 +213,7 @@ function re(t) {
|
|
|
214
213
|
let a = !1;
|
|
215
214
|
if (o && "querySelector" in o) {
|
|
216
215
|
const d = o.querySelector("img");
|
|
217
|
-
d && (e.modifyHtml(d).setAttribute("src",
|
|
216
|
+
d && (e.modifyHtml(d).setAttribute("src", W(n.image_url)).setAttribute("alt", n.name), a = !0);
|
|
218
217
|
const f = o.querySelector("a");
|
|
219
218
|
f && (e.modifyHtml(f).setAttribute("href", n.url), a = !0);
|
|
220
219
|
}
|
|
@@ -238,7 +237,7 @@ function re(t) {
|
|
|
238
237
|
function j(t) {
|
|
239
238
|
return "querySelector" in t ? t.querySelector(N) ?? t : t;
|
|
240
239
|
}
|
|
241
|
-
function
|
|
240
|
+
function re(t, e) {
|
|
242
241
|
var o;
|
|
243
242
|
let n;
|
|
244
243
|
if (t.startsWith(T)) {
|
|
@@ -248,7 +247,7 @@ function ie(t, e) {
|
|
|
248
247
|
n = e[t];
|
|
249
248
|
return X(n) || null;
|
|
250
249
|
}
|
|
251
|
-
function
|
|
250
|
+
function ie(t, e, n) {
|
|
252
251
|
if (!("querySelectorAll" in t))
|
|
253
252
|
return !1;
|
|
254
253
|
const o = t.querySelectorAll(
|
|
@@ -260,7 +259,7 @@ function le(t, e, n) {
|
|
|
260
259
|
o.forEach((i) => {
|
|
261
260
|
if (!("getAttribute" in i))
|
|
262
261
|
return;
|
|
263
|
-
const u = i.getAttribute(
|
|
262
|
+
const u = i.getAttribute(K);
|
|
264
263
|
if (!u)
|
|
265
264
|
return;
|
|
266
265
|
const c = r.get(u) ?? [];
|
|
@@ -272,7 +271,7 @@ function le(t, e, n) {
|
|
|
272
271
|
i.slice(0, c).forEach((l, a) => {
|
|
273
272
|
if (!("querySelector" in l))
|
|
274
273
|
return;
|
|
275
|
-
const d =
|
|
274
|
+
const d = re(u, n[a]);
|
|
276
275
|
if (d === null)
|
|
277
276
|
return;
|
|
278
277
|
const f = l.querySelector("p") ?? null;
|
|
@@ -300,7 +299,7 @@ function I(t, e, n) {
|
|
|
300
299
|
), a = Math.min(o.length, n.length);
|
|
301
300
|
let d = !1;
|
|
302
301
|
for (let f = 0; f < a; f++) {
|
|
303
|
-
const p =
|
|
302
|
+
const p = oe({
|
|
304
303
|
documentModifier: e,
|
|
305
304
|
product: n[f],
|
|
306
305
|
imageEl: o[f] ?? null,
|
|
@@ -313,9 +312,9 @@ function I(t, e, n) {
|
|
|
313
312
|
});
|
|
314
313
|
d = d || p;
|
|
315
314
|
}
|
|
316
|
-
return
|
|
315
|
+
return ie(t, e, n) && (d = !0), d;
|
|
317
316
|
}
|
|
318
|
-
function
|
|
317
|
+
function Se(t) {
|
|
319
318
|
const { currentNode: e, documentModifier: n, products: o } = t;
|
|
320
319
|
if (!e || !("querySelectorAll" in e))
|
|
321
320
|
return !1;
|
|
@@ -363,11 +362,11 @@ function h(t, e, n) {
|
|
|
363
362
|
}) && (c = !0);
|
|
364
363
|
return c;
|
|
365
364
|
}
|
|
366
|
-
function
|
|
365
|
+
function Ee(t) {
|
|
367
366
|
const { currentNode: e, documentModifier: n } = t;
|
|
368
367
|
if (!e || !("querySelectorAll" in e))
|
|
369
368
|
return !1;
|
|
370
|
-
if (
|
|
369
|
+
if (z(e))
|
|
371
370
|
return !0;
|
|
372
371
|
const r = P().recommendationProducts;
|
|
373
372
|
if (r.length === 0)
|
|
@@ -384,7 +383,7 @@ function Ae(t) {
|
|
|
384
383
|
}
|
|
385
384
|
return i && n.apply(new g("Updated price formatting in-place")), i;
|
|
386
385
|
}
|
|
387
|
-
function
|
|
386
|
+
function Pe(t) {
|
|
388
387
|
const { currentNode: e, documentModifier: n, currency: o } = t, r = A(e);
|
|
389
388
|
if (!r)
|
|
390
389
|
return;
|
|
@@ -394,16 +393,16 @@ function Ce(t) {
|
|
|
394
393
|
i(y.CURRENCY, o.code), i(y.SYMBOL, o.symbol), i(y.ALIGNMENT, s), i(y.THOUSAND_SEPARATOR, o.thousandSeparator), i(y.DECIMAL_SEPARATOR, o.decimalSeparator), i(y.DECIMAL_COUNT, o.decimalCount.toString()), n.apply(new g("Update currency attributes"));
|
|
395
394
|
}
|
|
396
395
|
export {
|
|
397
|
-
|
|
396
|
+
ge as adjustProductsToSize,
|
|
398
397
|
q as formatProductPrice,
|
|
399
398
|
A as getBlockElement,
|
|
400
399
|
x as getCardComposition,
|
|
401
400
|
C as getCurrentLayout,
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
401
|
+
z as isPartnerManagedBlock,
|
|
402
|
+
ye as regenerateMobileProductRows,
|
|
403
|
+
be as regenerateProductRowsWithStyles,
|
|
404
|
+
Pe as setCurrencyAttributes,
|
|
405
|
+
Ee as updatePricesInPlace,
|
|
406
|
+
Se as updateProductContentInPlace,
|
|
407
|
+
oe as updateSingleProductContent
|
|
409
408
|
};
|
|
@@ -28,10 +28,10 @@ const G = `
|
|
|
28
28
|
{-{-CELLS-}-}
|
|
29
29
|
</tr>
|
|
30
30
|
`;
|
|
31
|
-
function j(
|
|
32
|
-
const { cellPadding: s = k, cardBackgroundColor: u, visibility: a, priceInline:
|
|
31
|
+
function j(e, t, n, r = Y, c = {}, i = {}) {
|
|
32
|
+
const { cellPadding: s = k, cardBackgroundColor: u, visibility: a, priceInline: o = !1 } = i, d = (100 / t).toFixed(2), p = t - e.length, T = p > 0 ? x(d, s).repeat(p) : "", m = B(n, r, c), R = F(r), L = o ? r.filter((l) => l !== R.skip) : r, C = I(f, i), P = I(O, i);
|
|
33
33
|
return L.filter((l) => m[l]).map((l) => {
|
|
34
|
-
const _ = (a == null ? void 0 : a[l]) ?? W[l] ?? !0, b = _ ? "" : 'style="display: none;"', S = I(l, i
|
|
34
|
+
const _ = (a == null ? void 0 : a[l]) ?? W[l] ?? !0, b = _ ? "" : 'style="display: none;"', S = I(l, i), D = e.map((E) => (o && l === R.anchor ? H(
|
|
35
35
|
E,
|
|
36
36
|
R.originalFirst,
|
|
37
37
|
C,
|
|
@@ -41,36 +41,36 @@ function j(t, r, o, e = Y, c = {}, i = {}) {
|
|
|
41
41
|
return V.replace("{-{-ATTR_TYPE-}-}", l).replace("{-{-VISIBILITY-}-}", _ ? "1" : "0").replace("{-{-DISPLAY_STYLE-}-}", b).replace("{-{-CELLS-}-}", D + T);
|
|
42
42
|
}).join("");
|
|
43
43
|
}
|
|
44
|
-
function v(
|
|
44
|
+
function v(e, t, n, r, c = {}, i = {}) {
|
|
45
45
|
const s = [];
|
|
46
|
-
for (let
|
|
47
|
-
s.push(
|
|
46
|
+
for (let o = 0; o < e.length; o += t)
|
|
47
|
+
s.push(e.slice(o, o + t));
|
|
48
48
|
const u = h(i.rowSpacingPx);
|
|
49
|
-
return s.map((
|
|
49
|
+
return s.map((o, d) => {
|
|
50
50
|
const p = j(
|
|
51
|
+
o,
|
|
52
|
+
t,
|
|
51
53
|
n,
|
|
52
54
|
r,
|
|
53
|
-
o,
|
|
54
|
-
e,
|
|
55
55
|
c,
|
|
56
56
|
i
|
|
57
57
|
), T = G.replace("{-{-ATTRIBUTE_ROWS-}-}", p);
|
|
58
58
|
return d > 0 ? u + T : T;
|
|
59
59
|
}).join("");
|
|
60
60
|
}
|
|
61
|
-
function M(
|
|
61
|
+
function M(e, t, n, r = {}, c = {}) {
|
|
62
62
|
return v(
|
|
63
|
+
e,
|
|
63
64
|
t,
|
|
64
|
-
r,
|
|
65
65
|
y,
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
n,
|
|
67
|
+
r,
|
|
68
68
|
c
|
|
69
69
|
);
|
|
70
70
|
}
|
|
71
|
-
function Q(
|
|
72
|
-
const
|
|
73
|
-
return
|
|
71
|
+
function Q(e) {
|
|
72
|
+
const t = e ? `ins-recommendation-v3-block-${e}` : void 0, n = U("grid", t), r = A(), c = M(r, w);
|
|
73
|
+
return n.replace("{-{-TITLE-}-}", g.TITLE).replace("{-{-PRODUCT_ROWS-}-}", c).replace("{-{-MOBILE_PRODUCT_ROWS-}-}", "");
|
|
74
74
|
}
|
|
75
75
|
export {
|
|
76
76
|
Q as getDefaultTemplate,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { ATTR_PRODUCT_IMAGE as p, ATTR_PRODUCT_BUTTON as C, ATTR_PRODUCT_OLD_PRICE as A, ATTR_PRODUCT_PRICE as
|
|
2
|
-
import { buildSpacer as
|
|
1
|
+
import { ATTR_PRODUCT_IMAGE as p, ATTR_PRODUCT_BUTTON as C, ATTR_PRODUCT_OLD_PRICE as A, ATTR_PRODUCT_PRICE as m } from "../../constants/selectors.js";
|
|
2
|
+
import { buildSpacer as I, DEFAULT_CARD_COMPOSITION as g, buildElementRenderer as E, buildCellOptions as i, resolveInlinePriceOrder as w, DEFAULT_CARD_VISIBILITY as y } from "../utils.js";
|
|
3
3
|
import { listElementRenderer as L, renderInlineListPriceRow as O } from "./elementRenderer.js";
|
|
4
4
|
const S = "0 5px";
|
|
5
5
|
function U(l, r, n) {
|
|
6
|
-
const
|
|
6
|
+
const e = n ? "" : ' style="display: none;"', o = l.replace(/<tr>/, "").replace(/<\/tr>/, "");
|
|
7
7
|
return `<tr
|
|
8
8
|
class="recommendation-attribute-row"
|
|
9
9
|
data-attribute-type="${r}"
|
|
10
|
-
data-visibility="${n ? "1" : "0"}"${
|
|
10
|
+
data-visibility="${n ? "1" : "0"}"${e}>${o}</tr>`;
|
|
11
11
|
}
|
|
12
12
|
const N = `
|
|
13
13
|
<tr class="recommendation-product-row">
|
|
@@ -27,36 +27,36 @@ const N = `
|
|
|
27
27
|
</td>
|
|
28
28
|
</tr>
|
|
29
29
|
`;
|
|
30
|
-
function x(l, r = g, n = {},
|
|
30
|
+
function x(l, r = g, n = {}, e = {}) {
|
|
31
31
|
const {
|
|
32
32
|
cellPadding: o = S,
|
|
33
33
|
cardBackgroundColor: d,
|
|
34
34
|
visibility: c,
|
|
35
35
|
priceInline: a = !1
|
|
36
|
-
} =
|
|
36
|
+
} = e, u = d ? ` style="table-layout: fixed; background-color: ${d};"` : ' style="table-layout: fixed;"', s = E(L, r, n), P = s[p](l, i(p, e)), R = w(r), T = `
|
|
37
37
|
<td class="product-info-cell" valign="middle" style="padding: 15px;">
|
|
38
38
|
<table cellpadding="0" cellspacing="0" role="presentation" width="100%" style="table-layout: fixed;">
|
|
39
39
|
<tbody>
|
|
40
|
-
${r.filter((
|
|
41
|
-
const b = (c == null ? void 0 : c[
|
|
40
|
+
${r.filter((t) => t !== p && t !== C).filter((t) => !(a && t === R.skip)).filter((t) => s[t]).map((t) => {
|
|
41
|
+
const b = (c == null ? void 0 : c[t]) ?? y[t] ?? !0, f = a && t === R.anchor ? O(
|
|
42
42
|
l,
|
|
43
43
|
R.originalFirst,
|
|
44
|
-
i(
|
|
45
|
-
i(A,
|
|
46
|
-
) : s[
|
|
47
|
-
return U(f,
|
|
44
|
+
i(m, e),
|
|
45
|
+
i(A, e)
|
|
46
|
+
) : s[t](l, i(t, e));
|
|
47
|
+
return U(f, t, b);
|
|
48
48
|
}).join(`
|
|
49
49
|
`)}
|
|
50
50
|
</tbody>
|
|
51
51
|
</table>
|
|
52
52
|
</td>
|
|
53
|
-
`, _ = s[C](l, i(C,
|
|
53
|
+
`, _ = s[C](l, i(C, e)), D = P + T + _;
|
|
54
54
|
return N.replace("{-{-CARD_PADDING-}-}", o).replace("{-{-WRAPPER_STYLE-}-}", u).replace("{-{-PRODUCT_CONTENT-}-}", D);
|
|
55
55
|
}
|
|
56
|
-
function W(l, r, n = {},
|
|
57
|
-
const o =
|
|
56
|
+
function W(l, r, n = {}, e = {}) {
|
|
57
|
+
const o = I(e.rowSpacingPx);
|
|
58
58
|
return l.map((d, c) => {
|
|
59
|
-
const a = x(d, r, n,
|
|
59
|
+
const a = x(d, r, n, e);
|
|
60
60
|
return c > 0 ? o + a : a;
|
|
61
61
|
}).join("");
|
|
62
62
|
}
|