@useinsider/guido 3.8.2-beta.189e91c → 3.8.2
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 +66 -70
- package/dist/composables/usePreviewMode.js +14 -15
- package/dist/config/compiler/recommendationCompilerRules.js +1 -1
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +80 -88
- package/dist/config/migrator/recommendation/htmlBuilder.js +52 -53
- package/dist/config/migrator/recommendation/settingsMapper.js +33 -38
- package/dist/extensions/Blocks/Recommendation/block.js +41 -60
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +32 -41
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +264 -345
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +87 -99
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +160 -162
- package/dist/extensions/Blocks/Recommendation/extension.js +29 -30
- package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +7 -21
- package/dist/extensions/Blocks/Recommendation/recommendation.css.js +4 -64
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +1 -3
- package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +96 -130
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +54 -43
- package/dist/extensions/Blocks/Recommendation/templates/index.js +14 -17
- package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +80 -86
- package/dist/extensions/Blocks/Recommendation/templates/list/template.js +40 -31
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +102 -155
- package/dist/src/@types/config/schemas.d.ts +0 -16
- package/dist/src/composables/useConfig.d.ts +0 -4
- package/dist/src/config/migrator/recommendation/settingsMapper.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/block.d.ts +0 -10
- package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +3 -29
- package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +1 -3
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +0 -2
- package/dist/src/extensions/Blocks/Recommendation/templates/grid/elementRenderer.d.ts +1 -13
- 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 +1 -10
- package/dist/src/extensions/Blocks/Recommendation/templates/list/template.d.ts +3 -3
- package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +1 -51
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +0 -15
- package/dist/src/stores/config.d.ts +0 -36
- package/package.json +1 -1
- package/dist/composables/useRecommendationPreview.js +0 -111
- package/dist/extensions/Blocks/Recommendation/canvasPreview.css.js +0 -16
- package/dist/extensions/Blocks/Recommendation/controls/main/pricePlacement.js +0 -133
- package/dist/src/composables/useRecommendationPreview.d.ts +0 -10
- package/dist/src/extensions/Blocks/Recommendation/controls/main/pricePlacement.d.ts +0 -59
|
@@ -1,37 +1,34 @@
|
|
|
1
1
|
import "../constants/selectors.js";
|
|
2
|
-
import { DEFAULT_PRODUCTS_PER_ROW as
|
|
3
|
-
import { prepareProductRows as
|
|
4
|
-
import { prepareProductRows as
|
|
5
|
-
|
|
6
|
-
function b(o, t, r = {}) {
|
|
2
|
+
import { DEFAULT_PRODUCTS_PER_ROW as f } from "../constants/layout.js";
|
|
3
|
+
import { prepareProductRows as w } from "./grid/template.js";
|
|
4
|
+
import { prepareProductRows as g } from "./list/template.js";
|
|
5
|
+
function O(o, t, r = {}) {
|
|
7
6
|
const {
|
|
8
|
-
cellPadding:
|
|
9
|
-
rowSpacingPx:
|
|
7
|
+
cellPadding: s,
|
|
8
|
+
rowSpacingPx: i,
|
|
10
9
|
styleTemplates: c,
|
|
11
10
|
cardBackgroundColor: l,
|
|
12
11
|
cellBackgroundColors: p,
|
|
13
12
|
cellAlignments: n,
|
|
14
13
|
cellClasses: a,
|
|
15
14
|
omnibusTexts: m,
|
|
16
|
-
visibility: d
|
|
17
|
-
priceInline: u
|
|
15
|
+
visibility: d
|
|
18
16
|
} = r, e = {
|
|
19
|
-
cellPadding:
|
|
20
|
-
rowSpacingPx:
|
|
17
|
+
cellPadding: s,
|
|
18
|
+
rowSpacingPx: i,
|
|
21
19
|
styleTemplates: c,
|
|
22
20
|
cardBackgroundColor: l,
|
|
23
21
|
cellBackgroundColors: p,
|
|
24
22
|
cellAlignments: n,
|
|
25
23
|
cellClasses: a,
|
|
26
24
|
omnibusTexts: m,
|
|
27
|
-
visibility: d
|
|
28
|
-
priceInline: u
|
|
25
|
+
visibility: d
|
|
29
26
|
};
|
|
30
27
|
if (t === "list")
|
|
31
|
-
return
|
|
32
|
-
const { productsPerRow:
|
|
33
|
-
return
|
|
28
|
+
return g(o, r.composition, r.filterList, e);
|
|
29
|
+
const { productsPerRow: u = f, composition: P, filterList: R } = r;
|
|
30
|
+
return w(o, u, P, R, e);
|
|
34
31
|
}
|
|
35
32
|
export {
|
|
36
|
-
|
|
33
|
+
O as prepareProductRows
|
|
37
34
|
};
|
|
@@ -1,60 +1,48 @@
|
|
|
1
1
|
import { RecommendationBlockId as t } from "../../constants/blockIds.js";
|
|
2
|
-
import { ATTR_PRODUCT_ATTR as
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
data-same-price="${b}"
|
|
25
|
-
align="${(r == null ? void 0 : r.cellAlignment) ?? "left"}"
|
|
26
|
-
valign="middle"
|
|
27
|
-
style="width: auto;${g}${f(r == null ? void 0 : r.cellBackgroundColor)}">
|
|
28
|
-
${T(d, n, r == null ? void 0 : r.styleTemplate)}
|
|
29
|
-
</td>`, C = e ? u(" padding-right: 8px;") : s(" padding-right: 8px;"), _ = e ? s("") : u("");
|
|
30
|
-
return `
|
|
31
|
-
<tr>
|
|
32
|
-
${C}
|
|
33
|
-
${_}
|
|
34
|
-
</tr>
|
|
35
|
-
`;
|
|
2
|
+
import { ATTR_PRODUCT_ATTR as R, ATTR_PRODUCT_BUTTON as C, CSS_CLASS_RECO_BUTTON as _, ATTR_PRODUCT_OMNIBUS_DISCOUNT as A, ATTR_PRODUCT_OMNIBUS_PRICE as U, ATTR_PRODUCT_OLD_PRICE as k, ATTR_PRODUCT_PRICE as B, ATTR_PRODUCT_NAME as E, ATTR_PRODUCT_IMAGE as f } from "../../constants/selectors.js";
|
|
3
|
+
import { useRecommendationExtensionStore as P } from "../../store/recommendation.js";
|
|
4
|
+
import { formatPrice as I } from "../../utils/priceFormatter.js";
|
|
5
|
+
import { CUSTOM_CELL_HTML as h, renderStyledParagraph as u, cellBgStyleAttr as d, DEFAULT_BUTTON_BORDER_STYLE as L, renderButtonLabel as N, DEFAULT_BUTTON_ANCHOR_STYLE as D, resolveButtonBorderClass as v, resolvePStyle as y, resolveOmnibusText as S, DEFAULT_IMG_STYLE as M, sanitizeImageUrl as w } from "../utils.js";
|
|
6
|
+
const z = `${D} padding: 5px 30px;`;
|
|
7
|
+
function x() {
|
|
8
|
+
const r = P(), { currencySettings: e } = r.recommendationConfigs;
|
|
9
|
+
return {
|
|
10
|
+
code: e.value,
|
|
11
|
+
symbol: e.symbol,
|
|
12
|
+
alignment: e.alignment === "0" ? "before" : "after",
|
|
13
|
+
decimalCount: parseInt(e.decimalCount) || 2,
|
|
14
|
+
decimalSeparator: e.decimalSeparator,
|
|
15
|
+
thousandSeparator: e.thousandSeparator
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
function T(r, e = "price") {
|
|
19
|
+
const l = x(), a = r[e], c = (a == null ? void 0 : a[l.code]) ?? Object.values(a ?? {})[0] ?? 0;
|
|
20
|
+
return I({
|
|
21
|
+
price: c,
|
|
22
|
+
currency: l
|
|
23
|
+
});
|
|
36
24
|
}
|
|
37
|
-
const
|
|
25
|
+
const V = {
|
|
38
26
|
/**
|
|
39
27
|
* Image cell - left column (120px fixed width)
|
|
40
28
|
* Has recommendation-attribute-row class and data attributes for Card Composition control
|
|
41
29
|
*/
|
|
42
|
-
[
|
|
43
|
-
var
|
|
44
|
-
const l = ((
|
|
30
|
+
[f]: (r, e) => {
|
|
31
|
+
var a;
|
|
32
|
+
const l = ((a = e == null ? void 0 : e.styleTemplate) == null ? void 0 : a.imgStyle) ?? M;
|
|
45
33
|
return `
|
|
46
34
|
<td
|
|
47
35
|
width="120"
|
|
48
36
|
class="esd-block-image product-image-cell recommendation-attribute-row es-p5"
|
|
49
37
|
esd-extension-block-id="${t.IMAGE}"
|
|
50
|
-
data-attribute-type="${
|
|
38
|
+
data-attribute-type="${f}"
|
|
51
39
|
data-visibility="1"
|
|
52
40
|
align="center"
|
|
53
41
|
valign="middle">
|
|
54
|
-
<a target="_blank" href="${
|
|
42
|
+
<a target="_blank" href="${r.url}" class="${_}">
|
|
55
43
|
<img
|
|
56
|
-
src="${
|
|
57
|
-
alt="${
|
|
44
|
+
src="${w(r.image_url)}"
|
|
45
|
+
alt="${r.name}"
|
|
58
46
|
style="${l}"
|
|
59
47
|
class="adapt-img product-image">
|
|
60
48
|
</a>
|
|
@@ -64,9 +52,9 @@ const J = {
|
|
|
64
52
|
/**
|
|
65
53
|
* Name element - row for info cell table
|
|
66
54
|
*/
|
|
67
|
-
[
|
|
68
|
-
const l =
|
|
69
|
-
|
|
55
|
+
[E]: (r, e) => {
|
|
56
|
+
const l = u(
|
|
57
|
+
r.name,
|
|
70
58
|
{
|
|
71
59
|
pStyle: "font-size: 16px; color: #333333; font-weight: 600; margin: 0;",
|
|
72
60
|
openTags: "<strong>",
|
|
@@ -78,7 +66,7 @@ const J = {
|
|
|
78
66
|
<tr>
|
|
79
67
|
<td
|
|
80
68
|
class="esd-block-text product-name${e != null && e.cellClasses ? ` ${e.cellClasses}` : ""}"
|
|
81
|
-
esd-extension-block-id="${t.NAME}"${
|
|
69
|
+
esd-extension-block-id="${t.NAME}"${d(e == null ? void 0 : e.cellBackgroundColor)}
|
|
82
70
|
align="${(e == null ? void 0 : e.cellAlignment) ?? "left"}">
|
|
83
71
|
${l}
|
|
84
72
|
</td>
|
|
@@ -88,17 +76,21 @@ const J = {
|
|
|
88
76
|
/**
|
|
89
77
|
* Price element - row for info cell table
|
|
90
78
|
*/
|
|
91
|
-
[
|
|
92
|
-
const l =
|
|
93
|
-
|
|
94
|
-
|
|
79
|
+
[B]: (r, e) => {
|
|
80
|
+
const l = u(
|
|
81
|
+
T(r, "price"),
|
|
82
|
+
{
|
|
83
|
+
pStyle: "font-size: 16px; color: #333333; font-weight: bold; margin: 0;",
|
|
84
|
+
openTags: "<strong>",
|
|
85
|
+
closeTags: "</strong>"
|
|
86
|
+
},
|
|
95
87
|
e == null ? void 0 : e.styleTemplate
|
|
96
88
|
);
|
|
97
89
|
return `
|
|
98
90
|
<tr>
|
|
99
91
|
<td
|
|
100
92
|
class="esd-block-text product-price${e != null && e.cellClasses ? ` ${e.cellClasses}` : ""}"
|
|
101
|
-
esd-extension-block-id="${t.PRICE}"${
|
|
93
|
+
esd-extension-block-id="${t.PRICE}"${d(e == null ? void 0 : e.cellBackgroundColor)}
|
|
102
94
|
align="${(e == null ? void 0 : e.cellAlignment) ?? "left"}">
|
|
103
95
|
${l}
|
|
104
96
|
</td>
|
|
@@ -108,18 +100,21 @@ const J = {
|
|
|
108
100
|
/**
|
|
109
101
|
* Old price element - row for info cell table
|
|
110
102
|
*/
|
|
111
|
-
[
|
|
112
|
-
const l =
|
|
113
|
-
|
|
114
|
-
|
|
103
|
+
[k]: (r, e) => {
|
|
104
|
+
const l = u(
|
|
105
|
+
T(r, "original_price"),
|
|
106
|
+
{
|
|
107
|
+
pStyle: "font-size: 14px; color: #999999; margin: 0;",
|
|
108
|
+
openTags: "<s><strong>",
|
|
109
|
+
closeTags: "</strong></s>"
|
|
110
|
+
},
|
|
115
111
|
e == null ? void 0 : e.styleTemplate
|
|
116
112
|
);
|
|
117
113
|
return `
|
|
118
114
|
<tr>
|
|
119
115
|
<td
|
|
120
116
|
class="esd-block-text product-old-price${e != null && e.cellClasses ? ` ${e.cellClasses}` : ""}"
|
|
121
|
-
esd-extension-block-id="${t.OLD_PRICE}"
|
|
122
|
-
data-same-price="${z(a)}"${$(e == null ? void 0 : e.cellBackgroundColor)}
|
|
117
|
+
esd-extension-block-id="${t.OLD_PRICE}"${d(e == null ? void 0 : e.cellBackgroundColor)}
|
|
123
118
|
align="${(e == null ? void 0 : e.cellAlignment) ?? "left"}">
|
|
124
119
|
${l}
|
|
125
120
|
</td>
|
|
@@ -129,19 +124,19 @@ const J = {
|
|
|
129
124
|
/**
|
|
130
125
|
* Omnibus price element - row for info cell table
|
|
131
126
|
*/
|
|
132
|
-
[
|
|
133
|
-
const l =
|
|
127
|
+
[U]: (r, e) => {
|
|
128
|
+
const l = y("font-size: 12px; color: #666666; margin: 0;", e == null ? void 0 : e.styleTemplate), { before: a, after: c } = S(e == null ? void 0 : e.omnibusText, "Lowest 30-day price: ");
|
|
134
129
|
return `
|
|
135
130
|
<tr>
|
|
136
131
|
<td
|
|
137
132
|
class="esd-block-text product-omnibus-price${e != null && e.cellClasses ? ` ${e.cellClasses}` : ""}"
|
|
138
|
-
data-text-before="${
|
|
133
|
+
data-text-before="${a}"
|
|
139
134
|
data-text-after="${c}"
|
|
140
|
-
esd-extension-block-id="${t.OMNIBUS_PRICE}"${
|
|
135
|
+
esd-extension-block-id="${t.OMNIBUS_PRICE}"${d(e == null ? void 0 : e.cellBackgroundColor)}
|
|
141
136
|
align="${(e == null ? void 0 : e.cellAlignment) ?? "left"}">
|
|
142
137
|
<p contenteditable="false" style="${l}">
|
|
143
|
-
<span class="omnibus-text-before">${
|
|
144
|
-
<span class="omnibus-price-value">${
|
|
138
|
+
<span class="omnibus-text-before">${a}</span>
|
|
139
|
+
<span class="omnibus-price-value">${T(r, "original_price")}</span>
|
|
145
140
|
<span class="omnibus-text-after">${c}</span>
|
|
146
141
|
</p>
|
|
147
142
|
</td>
|
|
@@ -151,21 +146,21 @@ const J = {
|
|
|
151
146
|
/**
|
|
152
147
|
* Omnibus discount element - row for info cell table
|
|
153
148
|
*/
|
|
154
|
-
[
|
|
155
|
-
var
|
|
156
|
-
const l =
|
|
149
|
+
[A]: (r, e) => {
|
|
150
|
+
var b, n;
|
|
151
|
+
const l = y("font-size: 12px; color: #666666; margin: 0;", e == null ? void 0 : e.styleTemplate), a = x(), c = ((b = r.original_price) == null ? void 0 : b[a.code]) ?? Object.values(r.original_price ?? {})[0] ?? 0, s = ((n = r.price) == null ? void 0 : n[a.code]) ?? Object.values(r.price ?? {})[0] ?? 0, g = c > 0 ? Math.round((c - s) / c * 100) : 0, O = g > 0 ? `-${g}%` : "0%", { before: m, after: $ } = S(e == null ? void 0 : e.omnibusText);
|
|
157
152
|
return `
|
|
158
153
|
<tr>
|
|
159
154
|
<td
|
|
160
155
|
class="esd-block-text product-omnibus-discount${e != null && e.cellClasses ? ` ${e.cellClasses}` : ""}"
|
|
161
|
-
data-text-before="${
|
|
162
|
-
data-text-after="${
|
|
163
|
-
esd-extension-block-id="${t.OMNIBUS_DISCOUNT}"${
|
|
156
|
+
data-text-before="${m}"
|
|
157
|
+
data-text-after="${$}"
|
|
158
|
+
esd-extension-block-id="${t.OMNIBUS_DISCOUNT}"${d(e == null ? void 0 : e.cellBackgroundColor)}
|
|
164
159
|
align="${(e == null ? void 0 : e.cellAlignment) ?? "left"}">
|
|
165
160
|
<p contenteditable="false" style="${l}">
|
|
166
|
-
<span class="omnibus-text-before">${
|
|
167
|
-
<span class="omnibus-discount-value">${
|
|
168
|
-
<span class="omnibus-text-after">${
|
|
161
|
+
<span class="omnibus-text-before">${m}</span>
|
|
162
|
+
<span class="omnibus-discount-value">${O}</span>
|
|
163
|
+
<span class="omnibus-text-after">${$}</span>
|
|
169
164
|
</p>
|
|
170
165
|
</td>
|
|
171
166
|
</tr>
|
|
@@ -175,24 +170,24 @@ const J = {
|
|
|
175
170
|
* Button cell - right column (100px fixed width)
|
|
176
171
|
* Has recommendation-attribute-row class and data attributes for Card Composition control
|
|
177
172
|
*/
|
|
178
|
-
[
|
|
179
|
-
const l = e == null ? void 0 : e.styleTemplate,
|
|
173
|
+
[C]: (r, e) => {
|
|
174
|
+
const l = e == null ? void 0 : e.styleTemplate, a = (l == null ? void 0 : l.buttonBorderStyle) ?? L, c = (l == null ? void 0 : l.buttonAnchorStyle) ?? z, s = N((l == null ? void 0 : l.buttonText) ?? "Buy", l);
|
|
180
175
|
return `
|
|
181
176
|
<td
|
|
182
177
|
width="100"
|
|
183
178
|
class="esd-block-button button-cell recommendation-attribute-row product-button ${(e == null ? void 0 : e.cellClasses) ?? "es-p5l es-p5r"}"
|
|
184
179
|
esd-extension-block-id="${t.BUTTON}"
|
|
185
|
-
data-attribute-type="${
|
|
180
|
+
data-attribute-type="${C}"
|
|
186
181
|
data-visibility="1"
|
|
187
182
|
align="${(e == null ? void 0 : e.cellAlignment) ?? "center"}"
|
|
188
183
|
valign="middle">
|
|
189
|
-
<span class="${
|
|
184
|
+
<span class="${v(l)}" style="${a}">
|
|
190
185
|
<a
|
|
191
|
-
href="${
|
|
186
|
+
href="${r.url}"
|
|
192
187
|
target="_blank"
|
|
193
|
-
class="es-button ${
|
|
188
|
+
class="es-button ${_}"
|
|
194
189
|
style="${c}">
|
|
195
|
-
${
|
|
190
|
+
${s}
|
|
196
191
|
</a>
|
|
197
192
|
</span>
|
|
198
193
|
</td>
|
|
@@ -204,8 +199,8 @@ const J = {
|
|
|
204
199
|
* @param productAttrValue - Resolved product-attr value (e.g., "brand" for default, "product_attribute.rating_star" for custom)
|
|
205
200
|
* @param content - Display content for the cell
|
|
206
201
|
*/
|
|
207
|
-
[
|
|
208
|
-
const
|
|
202
|
+
[h]: (r, e, l) => {
|
|
203
|
+
const a = u(
|
|
209
204
|
e,
|
|
210
205
|
{ pStyle: "font-size: 12px; color: #666666; margin: 0;", openTags: "", closeTags: "" },
|
|
211
206
|
l == null ? void 0 : l.styleTemplate
|
|
@@ -213,17 +208,16 @@ const J = {
|
|
|
213
208
|
return `
|
|
214
209
|
<tr>
|
|
215
210
|
<td
|
|
216
|
-
${
|
|
211
|
+
${R}="${r}"
|
|
217
212
|
class="esd-block-text product-custom-attribute${l != null && l.cellClasses ? ` ${l.cellClasses}` : ""}"
|
|
218
|
-
esd-extension-block-id="${t.CUSTOM_ATTRIBUTE}"${
|
|
213
|
+
esd-extension-block-id="${t.CUSTOM_ATTRIBUTE}"${d(l == null ? void 0 : l.cellBackgroundColor)}
|
|
219
214
|
align="${(l == null ? void 0 : l.cellAlignment) ?? "left"}">
|
|
220
|
-
${
|
|
215
|
+
${a}
|
|
221
216
|
</td>
|
|
222
217
|
</tr>
|
|
223
218
|
`;
|
|
224
219
|
}
|
|
225
220
|
};
|
|
226
221
|
export {
|
|
227
|
-
|
|
228
|
-
q as renderInlineListPriceRow
|
|
222
|
+
V as listElementRenderer
|
|
229
223
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { ATTR_PRODUCT_IMAGE as
|
|
2
|
-
import { buildSpacer as I, DEFAULT_CARD_COMPOSITION as
|
|
3
|
-
import { listElementRenderer as
|
|
4
|
-
const
|
|
5
|
-
function U(
|
|
6
|
-
const
|
|
1
|
+
import { ATTR_PRODUCT_IMAGE as b, ATTR_PRODUCT_BUTTON as s } from "../../constants/selectors.js";
|
|
2
|
+
import { buildSpacer as I, DEFAULT_CARD_COMPOSITION as O, buildElementRenderer as T, DEFAULT_CARD_VISIBILITY as S } from "../utils.js";
|
|
3
|
+
import { listElementRenderer as N } from "./elementRenderer.js";
|
|
4
|
+
const L = "0 5px";
|
|
5
|
+
function U(n, r, e) {
|
|
6
|
+
const l = e ? "" : ' style="display: none;"', a = n.replace(/<tr>/, "").replace(/<\/tr>/, "");
|
|
7
7
|
return `<tr
|
|
8
8
|
class="recommendation-attribute-row"
|
|
9
9
|
data-attribute-type="${r}"
|
|
10
|
-
data-visibility="${
|
|
10
|
+
data-visibility="${e ? "1" : "0"}"${l}>${a}</tr>`;
|
|
11
11
|
}
|
|
12
|
-
const
|
|
12
|
+
const $ = `
|
|
13
13
|
<tr class="recommendation-product-row">
|
|
14
14
|
<td style="padding: {-{-CARD_PADDING-}-};">
|
|
15
15
|
<table
|
|
@@ -27,40 +27,49 @@ const N = `
|
|
|
27
27
|
</td>
|
|
28
28
|
</tr>
|
|
29
29
|
`;
|
|
30
|
-
function
|
|
30
|
+
function x(n, r = O, e = {}, l = {}) {
|
|
31
31
|
const {
|
|
32
|
-
cellPadding:
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
cellPadding: a = L,
|
|
33
|
+
styleTemplates: o,
|
|
34
|
+
cardBackgroundColor: p,
|
|
35
|
+
cellBackgroundColors: c,
|
|
36
|
+
cellAlignments: d,
|
|
37
|
+
cellClasses: i,
|
|
38
|
+
omnibusTexts: R,
|
|
39
|
+
visibility: C
|
|
40
|
+
} = l, D = p ? ` style="background-color: ${p};"` : "", u = T(N, r, e), _ = { styleTemplate: o == null ? void 0 : o[b] }, P = u[b](n, _), m = `
|
|
37
41
|
<td class="product-info-cell" valign="middle" style="padding: 15px;">
|
|
38
42
|
<table cellpadding="0" cellspacing="0" role="presentation" width="100%" style="table-layout: fixed;">
|
|
39
43
|
<tbody>
|
|
40
|
-
${r.filter((t) => t !==
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
${r.filter((t) => t !== b && t !== s).filter((t) => u[t]).map((t) => {
|
|
45
|
+
const w = (C == null ? void 0 : C[t]) ?? S[t] ?? !0, E = u[t](n, {
|
|
46
|
+
styleTemplate: o == null ? void 0 : o[t],
|
|
47
|
+
cellBackgroundColor: c == null ? void 0 : c[t],
|
|
48
|
+
cellAlignment: d == null ? void 0 : d[t],
|
|
49
|
+
cellClasses: i == null ? void 0 : i[t],
|
|
50
|
+
omnibusText: R == null ? void 0 : R[t]
|
|
51
|
+
});
|
|
52
|
+
return U(E, t, w);
|
|
48
53
|
}).join(`
|
|
49
54
|
`)}
|
|
50
55
|
</tbody>
|
|
51
56
|
</table>
|
|
52
57
|
</td>
|
|
53
|
-
`,
|
|
54
|
-
|
|
58
|
+
`, A = {
|
|
59
|
+
styleTemplate: o == null ? void 0 : o[s],
|
|
60
|
+
cellAlignment: d == null ? void 0 : d[s],
|
|
61
|
+
cellClasses: i == null ? void 0 : i[s]
|
|
62
|
+
}, f = u[s](n, A), g = P + m + f;
|
|
63
|
+
return $.replace("{-{-CARD_PADDING-}-}", a).replace("{-{-WRAPPER_STYLE-}-}", D).replace("{-{-PRODUCT_CONTENT-}-}", g);
|
|
55
64
|
}
|
|
56
|
-
function
|
|
57
|
-
const
|
|
58
|
-
return
|
|
59
|
-
const
|
|
60
|
-
return
|
|
65
|
+
function B(n, r, e = {}, l = {}) {
|
|
66
|
+
const a = I(l.rowSpacingPx);
|
|
67
|
+
return n.map((o, p) => {
|
|
68
|
+
const c = x(o, r, e, l);
|
|
69
|
+
return p > 0 ? a + c : c;
|
|
61
70
|
}).join("");
|
|
62
71
|
}
|
|
63
72
|
export {
|
|
64
|
-
|
|
65
|
-
|
|
73
|
+
x as getListProductCard,
|
|
74
|
+
B as prepareProductRows
|
|
66
75
|
};
|