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