@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.
Files changed (67) hide show
  1. package/dist/@types/config/schemas.js +70 -66
  2. package/dist/composables/useCustomInterfaceAppearance.js +16 -18
  3. package/dist/composables/usePreviewMode.js +15 -14
  4. package/dist/composables/useRecommendationPreview.js +111 -0
  5. package/dist/composables/useStripo.js +39 -37
  6. package/dist/composables/useStripoNotifications.js +26 -0
  7. package/dist/config/compiler/recommendationCompilerRules.js +1 -1
  8. package/dist/config/compiler/utils/recommendationCompilerUtils.js +88 -80
  9. package/dist/config/migrator/recommendation/htmlBuilder.js +53 -52
  10. package/dist/config/migrator/recommendation/settingsMapper.js +38 -33
  11. package/dist/enums/toaster.js +2 -2
  12. package/dist/extensions/Blocks/Items/block.js +48 -29
  13. package/dist/extensions/Blocks/Items/utils/nodeConfigUtils.js +62 -45
  14. package/dist/extensions/Blocks/Recommendation/block.js +64 -42
  15. package/dist/extensions/Blocks/Recommendation/canvasPreview.css.js +16 -0
  16. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +41 -32
  17. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +461 -363
  18. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +99 -87
  19. package/dist/extensions/Blocks/Recommendation/controls/main/pricePlacement.js +133 -0
  20. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +162 -160
  21. package/dist/extensions/Blocks/Recommendation/extension.js +30 -29
  22. package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +21 -7
  23. package/dist/extensions/Blocks/Recommendation/recommendation.css.js +64 -4
  24. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +3 -1
  25. package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +130 -96
  26. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +43 -54
  27. package/dist/extensions/Blocks/Recommendation/templates/index.js +17 -14
  28. package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +86 -80
  29. package/dist/extensions/Blocks/Recommendation/templates/list/template.js +31 -40
  30. package/dist/extensions/Blocks/Recommendation/templates/utils.js +155 -102
  31. package/dist/extensions/Blocks/Recommendation/useRecommendationBlockWarning.js +7 -7
  32. package/dist/extensions/Blocks/controlFactories.js +76 -57
  33. package/dist/services/templateLibraryApi.js +9 -8
  34. package/dist/src/@types/config/schemas.d.ts +16 -0
  35. package/dist/src/composables/useConfig.d.ts +4 -0
  36. package/dist/src/composables/useRecommendationPreview.d.ts +10 -0
  37. package/dist/src/composables/useStripoNotifications.d.ts +10 -0
  38. package/dist/src/config/migrator/recommendation/settingsMapper.d.ts +1 -1
  39. package/dist/src/enums/toaster.d.ts +2 -2
  40. package/dist/src/extensions/Blocks/CouponBlock/controls/index.d.ts +1 -1
  41. package/dist/src/extensions/Blocks/Items/block.d.ts +8 -0
  42. package/dist/src/extensions/Blocks/Items/controls/index.d.ts +3 -3
  43. package/dist/src/extensions/Blocks/Items/utils/nodeConfigUtils.d.ts +1 -1
  44. package/dist/src/extensions/Blocks/Recommendation/block.d.ts +10 -0
  45. package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +29 -3
  46. package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +1 -1
  47. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +3 -1
  48. package/dist/src/extensions/Blocks/Recommendation/controls/main/pricePlacement.d.ts +59 -0
  49. package/dist/src/extensions/Blocks/Recommendation/controls/name/index.d.ts +1 -1
  50. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/index.d.ts +1 -1
  51. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscount/index.d.ts +1 -1
  52. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPrice/index.d.ts +1 -1
  53. package/dist/src/extensions/Blocks/Recommendation/controls/price/index.d.ts +1 -1
  54. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +2 -0
  55. package/dist/src/extensions/Blocks/Recommendation/templates/grid/elementRenderer.d.ts +13 -1
  56. package/dist/src/extensions/Blocks/Recommendation/templates/grid/template.d.ts +4 -4
  57. package/dist/src/extensions/Blocks/Recommendation/templates/index.d.ts +1 -1
  58. package/dist/src/extensions/Blocks/Recommendation/templates/list/elementRenderer.d.ts +10 -1
  59. package/dist/src/extensions/Blocks/Recommendation/templates/list/template.d.ts +3 -3
  60. package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +51 -1
  61. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +15 -0
  62. package/dist/src/extensions/Blocks/controlFactories.d.ts +10 -1
  63. package/dist/src/stores/config.d.ts +36 -0
  64. package/dist/src/stores/toaster.d.ts +2 -3
  65. package/dist/stores/toaster.js +10 -10
  66. package/package.json +2 -2
  67. 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 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 = {}) {
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: s,
8
- rowSpacingPx: i,
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: s,
18
- rowSpacingPx: i,
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 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);
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
- O as prepareProductRows
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 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
- });
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 V = {
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
- [f]: (r, e) => {
31
- var a;
32
- const l = ((a = e == null ? void 0 : e.styleTemplate) == null ? void 0 : a.imgStyle) ?? M;
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="${f}"
50
+ data-attribute-type="${R}"
39
51
  data-visibility="1"
40
52
  align="center"
41
53
  valign="middle">
42
- <a target="_blank" href="${r.url}" class="${_}">
54
+ <a target="_blank" href="${a.url}" class="${y}">
43
55
  <img
44
- src="${w(r.image_url)}"
45
- alt="${r.name}"
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
- [E]: (r, e) => {
56
- const l = u(
57
- r.name,
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}"${d(e == null ? void 0 : e.cellBackgroundColor)}
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
- [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
- },
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}"${d(e == null ? void 0 : e.cellBackgroundColor)}
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
- [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
+ [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}"${d(e == null ? void 0 : e.cellBackgroundColor)}
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
- [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: ");
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="${a}"
138
+ data-text-before="${r}"
134
139
  data-text-after="${c}"
135
- esd-extension-block-id="${t.OMNIBUS_PRICE}"${d(e == null ? void 0 : e.cellBackgroundColor)}
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">${a}</span>
139
- <span class="omnibus-price-value">${T(r, "original_price")}</span>
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
- [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);
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="${m}"
157
- data-text-after="${$}"
158
- esd-extension-block-id="${t.OMNIBUS_DISCOUNT}"${d(e == null ? void 0 : e.cellBackgroundColor)}
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">${m}</span>
162
- <span class="omnibus-discount-value">${O}</span>
163
- <span class="omnibus-text-after">${$}</span>
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
- [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);
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="${C}"
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="${v(l)}" style="${a}">
189
+ <span class="${M(l)}" style="${r}">
185
190
  <a
186
- href="${r.url}"
191
+ href="${a.url}"
187
192
  target="_blank"
188
- class="es-button ${_}"
193
+ class="es-button ${y}"
189
194
  style="${c}">
190
- ${s}
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
- [h]: (r, e, l) => {
203
- const a = u(
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
- ${R}="${r}"
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}"${d(l == null ? void 0 : l.cellBackgroundColor)}
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
- ${a}
220
+ ${r}
216
221
  </td>
217
222
  </tr>
218
223
  `;
219
224
  }
220
225
  };
221
226
  export {
222
- V as listElementRenderer
227
+ J as listElementRenderer,
228
+ q as renderInlineListPriceRow
223
229
  };
@@ -1,15 +1,15 @@
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 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="${e ? "1" : "0"}"${l}>${a}</tr>`;
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 x(n, r = O, e = {}, l = {}) {
30
+ function $(l, r = g, n = {}, e = {}) {
31
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 = `
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 !== 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);
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
- `, 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);
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 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;
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
- x as getListProductCard,
74
- B as prepareProductRows
64
+ $ as getListProductCard,
65
+ W as prepareProductRows
75
66
  };