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