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