@useinsider/guido 3.8.0-beta.84f6c0a → 3.8.0-beta.910d4af

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 (52) hide show
  1. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +8 -8
  2. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +15 -12
  3. package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +5 -5
  4. package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue2.js +16 -15
  5. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.js +5 -5
  6. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +42 -37
  7. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +3 -3
  8. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +40 -37
  9. package/dist/composables/usePreviewInteractionGuard.js +17 -0
  10. package/dist/composables/useSave.js +14 -14
  11. package/dist/composables/validators/useUnsubscribeBlockValidator.js +26 -17
  12. package/dist/config/compiler/utils/recommendationCompilerUtils.js +25 -19
  13. package/dist/extensions/Blocks/Recommendation/constants/selectors.js +10 -11
  14. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +26 -24
  15. package/dist/extensions/Blocks/Recommendation/controls/main/layoutOrientation.js +39 -30
  16. package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +34 -28
  17. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +333 -285
  18. package/dist/extensions/Blocks/Recommendation/extension.js +5 -6
  19. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +2 -3
  20. package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +173 -142
  21. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +30 -56
  22. package/dist/extensions/Blocks/Recommendation/templates/index.js +8 -29
  23. package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +105 -132
  24. package/dist/extensions/Blocks/Recommendation/templates/list/template.js +23 -44
  25. package/dist/extensions/Blocks/Recommendation/templates/utils.js +64 -112
  26. package/dist/extensions/Blocks/Recommendation/utils/preserveTextStyles.js +19 -24
  27. package/dist/extensions/Blocks/Recommendation/utils/tagName.js +22 -30
  28. package/dist/extensions/Blocks/Unsubscribe/block.js +40 -37
  29. package/dist/extensions/Blocks/Unsubscribe/control.js +19 -16
  30. package/dist/extensions/Blocks/controlFactories.js +133 -159
  31. package/dist/guido.css +1 -1
  32. package/dist/src/composables/usePreviewInteractionGuard.d.ts +3 -0
  33. package/dist/src/composables/validators/useUnsubscribeBlockValidator.d.ts +1 -0
  34. package/dist/src/extensions/Blocks/Items/controls/index.d.ts +1 -1
  35. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
  36. package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +0 -2
  37. package/dist/src/extensions/Blocks/Recommendation/controls/button/index.d.ts +1 -1
  38. package/dist/src/extensions/Blocks/Recommendation/controls/main/layoutOrientation.d.ts +1 -2
  39. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +47 -20
  40. package/dist/src/extensions/Blocks/Recommendation/templates/grid/template.d.ts +4 -4
  41. package/dist/src/extensions/Blocks/Recommendation/templates/index.d.ts +1 -1
  42. package/dist/src/extensions/Blocks/Recommendation/templates/list/template.d.ts +2 -3
  43. package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +11 -165
  44. package/dist/src/extensions/Blocks/Recommendation/utils/preserveTextStyles.d.ts +0 -15
  45. package/dist/src/extensions/Blocks/Recommendation/utils/stylePreserver.d.ts +113 -0
  46. package/dist/src/extensions/Blocks/Recommendation/utils/tagName.d.ts +9 -29
  47. package/dist/src/extensions/Blocks/controlFactories.d.ts +1 -11
  48. package/dist/src/stores/unsubscribe.d.ts +11 -1
  49. package/dist/stores/unsubscribe.js +8 -7
  50. package/package.json +1 -1
  51. package/dist/extensions/Blocks/Recommendation/utils/captureStyleTemplates.js +0 -219
  52. package/dist/src/extensions/Blocks/Recommendation/utils/captureStyleTemplates.d.ts +0 -78
@@ -2,13 +2,12 @@ import { ExtensionBuilder as r } from "../../../node_modules/@stripoinc/ui-edito
2
2
  import { RecommendationBlock as m } from "./block.js";
3
3
  import { RecommendationBlockControl as n } from "./controls/main/index.js";
4
4
  import "./store/recommendation.js";
5
- import "./utils/captureStyleTemplates.js";
6
5
  import { NameControls as i } from "./controls/name/index.js";
7
6
  import { PriceControls as e } from "./controls/price/index.js";
8
7
  import { OldPriceControls as s } from "./controls/oldPrice/index.js";
9
8
  import { OmnibusPriceControls as l } from "./controls/omnibusPrice/index.js";
10
- import { OmnibusDiscountControls as p } from "./controls/omnibusDiscount/index.js";
11
- import { ButtonControls as a } from "./controls/button/index.js";
9
+ import { OmnibusDiscountControls as a } from "./controls/omnibusDiscount/index.js";
10
+ import { ButtonControls as p } from "./controls/button/index.js";
12
11
  import { ImageControls as c } from "./controls/image/index.js";
13
12
  import { CustomAttributeControls as C } from "./controls/customAttribute/index.js";
14
13
  import { SpacingControl as f } from "./controls/spacing/index.js";
@@ -23,8 +22,8 @@ const b = [
23
22
  e,
24
23
  s,
25
24
  l,
26
- p,
27
25
  a,
26
+ p,
28
27
  c,
29
28
  C
30
29
  ], P = [
@@ -36,10 +35,10 @@ const b = [
36
35
  ], S = [
37
36
  ...P,
38
37
  ...b.flatMap((o) => Object.values(o))
39
- ], L = S.reduce(
38
+ ], K = S.reduce(
40
39
  (o, t) => o.addControl(t),
41
40
  new r().addBlock(m).withSettingsPanelRegistry(B)
42
41
  ).addStyles(y).withIconsRegistry(R).build();
43
42
  export {
44
- L as default
43
+ K as default
45
44
  };
@@ -4,7 +4,6 @@ import { RecommendationBlockId as S } from "./constants/blockIds.js";
4
4
  import { RecommendationControlId as T } from "./constants/controlIds.js";
5
5
  import { CONTROL_BLOCK_ID as A } from "./controls/main/index.js";
6
6
  import "./store/recommendation.js";
7
- import "./utils/captureStyleTemplates.js";
8
7
  import "./controls/name/index.js";
9
8
  import "./controls/price/index.js";
10
9
  import "./controls/oldPrice/index.js";
@@ -16,7 +15,7 @@ import { SPACING_CONTROL_ID as L } from "./controls/spacing/index.js";
16
15
  import { CARD_BACKGROUND_COLOR_CONTROL_ID as D } from "./controls/cardBackground/index.js";
17
16
  import { COMPOSITION_CONTROL_BLOCK_ID as B } from "./controls/cardComposition/index.js";
18
17
  import { SYNC_INFO_MESSAGE_CONTROL_ID as N } from "./controls/syncInfoMessage.js";
19
- class a extends E {
18
+ class Z extends E {
20
19
  registerBlockControls(I) {
21
20
  I[U] = [
22
21
  new _(
@@ -195,5 +194,5 @@ class a extends E {
195
194
  }
196
195
  }
197
196
  export {
198
- a as SettingsPanel
197
+ Z as SettingsPanel
199
198
  };
@@ -1,18 +1,14 @@
1
- import { RecommendationBlockId as b } from "../../constants/blockIds.js";
2
- import { ATTR_PRODUCT_ATTR as k, ATTR_PRODUCT_BUTTON as h, CSS_CLASS_RECO_BUTTON as f, ATTR_PRODUCT_OMNIBUS_DISCOUNT as R, ATTR_PRODUCT_OMNIBUS_PRICE as O, ATTR_PRODUCT_OLD_PRICE as U, ATTR_PRODUCT_PRICE as v, ATTR_PRODUCT_NAME as E, ATTR_PRODUCT_IMAGE as I } from "../../constants/selectors.js";
3
- import { useRecommendationExtensionStore as L } from "../../store/recommendation.js";
4
- import { formatPrice as D } from "../../utils/priceFormatter.js";
5
- import { CUSTOM_CELL_HTML as N, renderStyledParagraph as T, cellBgStyleAttr as $, DEFAULT_BUTTON_BORDER_STYLE as M, DEFAULT_BUTTON_ANCHOR_STYLE as z, renderButtonLabel as F, resolveButtonBorderClass as G, resolvePStyle as P, resolveOmnibusText as x, DEFAULT_IMG_STYLE as j, sanitizeImageUrl as w, resolveSegmentBgStyle as Y } from "../utils.js";
6
- const d = "0 5px", t = "attribute-cell";
7
- function Q(r, e = d) {
8
- return `<td class="${t}" style="padding: ${e};" width="${r}%"></td>`;
1
+ import { RecommendationBlockId as l } from "../../constants/blockIds.js";
2
+ import { ATTR_PRODUCT_ATTR as u, CSS_CLASS_RECO_BUTTON as p, ATTR_PRODUCT_BUTTON as m, ATTR_PRODUCT_OMNIBUS_DISCOUNT as h, ATTR_PRODUCT_OMNIBUS_PRICE as y, ATTR_PRODUCT_OLD_PRICE as T, ATTR_PRODUCT_PRICE as f, ATTR_PRODUCT_NAME as $, ATTR_PRODUCT_IMAGE as _ } from "../../constants/selectors.js";
3
+ import { useRecommendationExtensionStore as x } from "../../store/recommendation.js";
4
+ import { formatPrice as C } from "../../utils/priceFormatter.js";
5
+ import { CUSTOM_CELL_HTML as R, sanitizeImageUrl as O } from "../utils.js";
6
+ const s = "0 5px", a = "attribute-cell";
7
+ function S(t, e = s) {
8
+ return `<td class="${a}" style="padding: ${e};" width="${t}%"></td>`;
9
9
  }
10
- function u(r, e = "") {
11
- const l = Y(e, r);
12
- return `<table class="product-card-segment" width="100%" height="100%" cellpadding="0" cellspacing="0" border="0"${l ? ` style="${l}"` : ""}>`;
13
- }
14
- function A() {
15
- const r = L(), { currencySettings: e } = r.recommendationConfigs;
10
+ function g() {
11
+ const t = x(), { currencySettings: e } = t.recommendationConfigs;
16
12
  return {
17
13
  code: e.value,
18
14
  symbol: e.symbol,
@@ -22,31 +18,34 @@ function A() {
22
18
  thousandSeparator: e.thousandSeparator
23
19
  };
24
20
  }
25
- function m(r, e = "price") {
26
- const l = A(), a = r[e], c = (a == null ? void 0 : a[l.code]) ?? Object.values(a ?? {})[0] ?? 0;
27
- return D({
28
- price: c,
29
- currency: l
21
+ function i(t, e = "price") {
22
+ const o = g(), n = t[e], d = (n == null ? void 0 : n[o.code]) ?? Object.values(n ?? {})[0] ?? 0;
23
+ return C({
24
+ price: d,
25
+ currency: o
30
26
  });
31
27
  }
32
- const W = {
33
- [I]: (r, e) => {
34
- var c;
35
- const l = (e == null ? void 0 : e.cellPadding) ?? d, a = ((c = e == null ? void 0 : e.styleTemplate) == null ? void 0 : c.imgStyle) ?? j;
36
- return `
37
- <td class="${t}" style="padding: ${l}; height: 100%;" valign="top">
38
- ${u(e == null ? void 0 : e.cardBackgroundColor)}
28
+ const A = {
29
+ [_]: (t) => `
30
+ <td class="${a}" style="padding: ${s}; height: 100%;" valign="top">
31
+ <table
32
+ class="product-card-segment"
33
+ width="100%"
34
+ height="100%"
35
+ cellpadding="0"
36
+ cellspacing="0"
37
+ border="0">
39
38
  <tbody>
40
39
  <tr valign="top">
41
40
  <td
42
41
  class="esd-block-image product-image"
43
42
  align="center"
44
- esd-extension-block-id="${b.IMAGE}">
45
- <a target="_blank" href="${r.url}" class="${f}">
43
+ esd-extension-block-id="${l.IMAGE}">
44
+ <a target="_blank" href="${t.url}" class="${p}">
46
45
  <img
47
- src="${w(r.image_url)}"
48
- alt="${r.name}"
49
- style="${a}"
46
+ src="${O(t.image_url)}"
47
+ alt="${t.name}"
48
+ style="display: block; max-width: 100%; height: auto;"
50
49
  class="adapt-img">
51
50
  </a>
52
51
  </td>
@@ -54,120 +53,134 @@ const W = {
54
53
  </tbody>
55
54
  </table>
56
55
  </td>
57
- `;
58
- },
59
- [E]: (r, e) => {
60
- const l = (e == null ? void 0 : e.cellPadding) ?? d, a = T(
61
- r.name,
62
- { pStyle: "font-size: 16px; color: #333333;", openTags: "<strong>", closeTags: "</strong>" },
63
- e == null ? void 0 : e.styleTemplate
64
- );
65
- return `
66
- <td class="${t}" style="padding: ${l}; height: 100%;" valign="middle">
67
- ${u(e == null ? void 0 : e.cardBackgroundColor, "table-layout: fixed;")}
56
+ `,
57
+ [$]: (t) => `
58
+ <td class="${a}" style="padding: ${s}; height: 100%;" valign="middle">
59
+ <table
60
+ class="product-card-segment"
61
+ width="100%"
62
+ height="100%"
63
+ cellpadding="0"
64
+ cellspacing="0"
65
+ border="0"
66
+ style="table-layout: fixed;">
68
67
  <tbody>
69
68
  <tr valign="top">
70
69
  <td
71
- class="esd-block-text product-name ${(e == null ? void 0 : e.cellClasses) ?? "es-p10t es-p10b es-p15l es-p15r"}"
72
- align="${(e == null ? void 0 : e.cellAlignment) ?? "center"}"
73
- esd-extension-block-id="${b.NAME}"${$(e == null ? void 0 : e.cellBackgroundColor)}>
74
- ${a}
70
+ class="esd-block-text product-name es-p10t es-p10b es-p15l es-p15r"
71
+ align="center"
72
+ esd-extension-block-id="${l.NAME}">
73
+ <p contenteditable="false" style="font-size: 16px; color: #333333;">
74
+ <strong>${t.name}</strong>
75
+ </p>
75
76
  </td>
76
77
  </tr>
77
78
  </tbody>
78
79
  </table>
79
80
  </td>
80
- `;
81
- },
82
- [v]: (r, e) => {
83
- const l = (e == null ? void 0 : e.cellPadding) ?? d, a = T(
84
- m(r, "price"),
85
- { pStyle: "font-size: 16px; color: #333333;", openTags: "<strong>", closeTags: "</strong>" },
86
- e == null ? void 0 : e.styleTemplate
87
- );
88
- return `
89
- <td class="${t}" style="padding: ${l}; height: 100%;" valign="top">
90
- ${u(e == null ? void 0 : e.cardBackgroundColor)}
81
+ `,
82
+ [f]: (t) => `
83
+ <td class="${a}" style="padding: ${s}; height: 100%;" valign="top">
84
+ <table
85
+ class="product-card-segment"
86
+ width="100%"
87
+ height="100%"
88
+ cellpadding="0"
89
+ cellspacing="0"
90
+ border="0">
91
91
  <tbody>
92
92
  <tr valign="top">
93
93
  <td
94
- class="esd-block-text product-price ${(e == null ? void 0 : e.cellClasses) ?? "es-p15l es-p15r"}"
95
- align="${(e == null ? void 0 : e.cellAlignment) ?? "center"}"
96
- esd-extension-block-id="${b.PRICE}"${$(e == null ? void 0 : e.cellBackgroundColor)}>
97
- ${a}
94
+ class="esd-block-text product-price es-p15l es-p15r"
95
+ align="center"
96
+ esd-extension-block-id="${l.PRICE}">
97
+ <p contenteditable="false" style="font-size: 16px; color: #333333;">
98
+ <strong>${i(t, "price")}</strong>
99
+ </p>
98
100
  </td>
99
101
  </tr>
100
102
  </tbody>
101
103
  </table>
102
104
  </td>
103
- `;
104
- },
105
- [U]: (r, e) => {
106
- const l = (e == null ? void 0 : e.cellPadding) ?? d, a = T(
107
- m(r, "original_price"),
108
- { pStyle: "font-size: 14px; color: #999999;", openTags: "<s><strong>", closeTags: "</strong></s>" },
109
- e == null ? void 0 : e.styleTemplate
110
- );
111
- return `
112
- <td class="${t}" style="padding: ${l}; height: 100%;" valign="top">
113
- ${u(e == null ? void 0 : e.cardBackgroundColor)}
105
+ `,
106
+ [T]: (t) => `
107
+ <td class="${a}" style="padding: ${s}; height: 100%;" valign="top">
108
+ <table
109
+ class="product-card-segment"
110
+ width="100%"
111
+ height="100%"
112
+ cellpadding="0"
113
+ cellspacing="0"
114
+ border="0">
114
115
  <tbody>
115
116
  <tr valign="top">
116
117
  <td
117
- class="esd-block-text product-old-price ${(e == null ? void 0 : e.cellClasses) ?? "es-p15l es-p15r"}"
118
- align="${(e == null ? void 0 : e.cellAlignment) ?? "center"}"
119
- esd-extension-block-id="${b.OLD_PRICE}"${$(e == null ? void 0 : e.cellBackgroundColor)}>
120
- ${a}
118
+ class="esd-block-text product-old-price es-p15l es-p15r"
119
+ align="center"
120
+ esd-extension-block-id="${l.OLD_PRICE}">
121
+ <p
122
+ contenteditable="false"
123
+ style="font-size: 14px; color: #999999;">
124
+ <s><strong>${i(t, "original_price")}</strong></s>
125
+ </p>
121
126
  </td>
122
127
  </tr>
123
128
  </tbody>
124
129
  </table>
125
130
  </td>
126
- `;
127
- },
128
- [O]: (r, e) => {
129
- const l = (e == null ? void 0 : e.cellPadding) ?? d, a = P("font-size: 12px; color: #666666;", e == null ? void 0 : e.styleTemplate), { before: c, after: g } = x(e == null ? void 0 : e.omnibusText, "Lowest 30-day price: ");
130
- return `
131
- <td class="${t}" style="padding: ${l}; height: 100%;" valign="top">
132
- ${u(e == null ? void 0 : e.cardBackgroundColor)}
131
+ `,
132
+ [y]: (t) => `
133
+ <td class="${a}" style="padding: ${s}; height: 100%;" valign="top">
134
+ <table
135
+ class="product-card-segment"
136
+ width="100%"
137
+ height="100%"
138
+ cellpadding="0"
139
+ cellspacing="0"
140
+ border="0">
133
141
  <tbody>
134
142
  <tr valign="top">
135
143
  <td
136
- class="esd-block-text product-omnibus-price ${(e == null ? void 0 : e.cellClasses) ?? "es-p15l es-p15r"}"
137
- align="${(e == null ? void 0 : e.cellAlignment) ?? "center"}"
138
- data-text-before="${c}"
139
- data-text-after="${g}"
140
- esd-extension-block-id="${b.OMNIBUS_PRICE}"${$(e == null ? void 0 : e.cellBackgroundColor)}>
141
- <p contenteditable="false" style="${a}">
142
- <span class="omnibus-text-before">${c}</span>
143
- <span class="omnibus-price-value">${m(r, "original_price")}</span>
144
- <span class="omnibus-text-after">${g}</span>
144
+ class="esd-block-text product-omnibus-price es-p15l es-p15r"
145
+ align="center"
146
+ data-text-before="Lowest 30-day price: "
147
+ data-text-after=""
148
+ esd-extension-block-id="${l.OMNIBUS_PRICE}">
149
+ <p contenteditable="false" style="font-size: 12px; color: #666666;">
150
+ <span class="omnibus-text-before">Lowest 30-day price: </span>
151
+ <span class="omnibus-price-value">${i(t, "original_price")}</span>
152
+ <span class="omnibus-text-after"></span>
145
153
  </p>
146
154
  </td>
147
155
  </tr>
148
156
  </tbody>
149
157
  </table>
150
158
  </td>
151
- `;
152
- },
153
- [R]: (r, e) => {
154
- var s, S;
155
- const l = (e == null ? void 0 : e.cellPadding) ?? d, a = P("font-size: 12px; color: #666666;", e == null ? void 0 : e.styleTemplate), c = A(), g = ((s = r.original_price) == null ? void 0 : s[c.code]) ?? Object.values(r.original_price ?? {})[0] ?? 0, y = ((S = r.price) == null ? void 0 : S[c.code]) ?? Object.values(r.price ?? {})[0] ?? 0, C = g > 0 ? Math.round((g - y) / g * 100) : 0, B = C > 0 ? `-${C}%` : "0%", { before: _, after: n } = x(e == null ? void 0 : e.omnibusText);
159
+ `,
160
+ [h]: (t) => {
161
+ var r, c;
162
+ const e = g(), o = ((r = t.original_price) == null ? void 0 : r[e.code]) ?? Object.values(t.original_price ?? {})[0] ?? 0, n = ((c = t.price) == null ? void 0 : c[e.code]) ?? Object.values(t.price ?? {})[0] ?? 0, d = o > 0 ? Math.round((o - n) / o * 100) : 0, b = d > 0 ? `-${d}%` : "0%";
156
163
  return `
157
- <td class="${t}" style="padding: ${l}; height: 100%;" valign="top">
158
- ${u(e == null ? void 0 : e.cardBackgroundColor)}
164
+ <td class="${a}" style="padding: ${s}; height: 100%;" valign="top">
165
+ <table
166
+ class="product-card-segment"
167
+ width="100%"
168
+ height="100%"
169
+ cellpadding="0"
170
+ cellspacing="0"
171
+ border="0">
159
172
  <tbody>
160
173
  <tr valign="top">
161
174
  <td
162
- class="esd-block-text product-omnibus-discount ${(e == null ? void 0 : e.cellClasses) ?? "es-p15l es-p15r"}"
163
- align="${(e == null ? void 0 : e.cellAlignment) ?? "center"}"
164
- data-text-before="${_}"
165
- data-text-after="${n}"
166
- esd-extension-block-id="${b.OMNIBUS_DISCOUNT}"${$(e == null ? void 0 : e.cellBackgroundColor)}>
167
- <p contenteditable="false" style="${a}">
168
- <span class="omnibus-text-before">${_}</span>
169
- <span class="omnibus-discount-value">${B}</span>
170
- <span class="omnibus-text-after">${n}</span>
175
+ class="esd-block-text product-omnibus-discount es-p15l es-p15r"
176
+ align="center"
177
+ data-text-before=""
178
+ data-text-after=""
179
+ esd-extension-block-id="${l.OMNIBUS_DISCOUNT}">
180
+ <p contenteditable="false" style="font-size: 12px; color: #666666;">
181
+ <span class="omnibus-text-before"></span>
182
+ <span class="omnibus-discount-value">${b}</span>
183
+ <span class="omnibus-text-after"></span>
171
184
  </p>
172
185
  </td>
173
186
  </tr>
@@ -176,24 +189,43 @@ const W = {
176
189
  </td>
177
190
  `;
178
191
  },
179
- [h]: (r, e) => {
180
- const l = (e == null ? void 0 : e.cellPadding) ?? d, a = e == null ? void 0 : e.styleTemplate, c = (a == null ? void 0 : a.buttonBorderStyle) ?? M, g = (a == null ? void 0 : a.buttonAnchorStyle) ?? z, y = F((a == null ? void 0 : a.buttonText) ?? "Buy", a);
181
- return `
182
- <td class="${t}" style="padding: ${l}; height: 100%;" valign="top">
183
- ${u(e == null ? void 0 : e.cardBackgroundColor)}
192
+ [m]: () => `
193
+ <td class="${a}" style="padding: ${s}; height: 100%;" valign="top">
194
+ <table
195
+ class="product-card-segment"
196
+ width="100%"
197
+ height="100%"
198
+ cellpadding="0"
199
+ cellspacing="0"
200
+ border="0">
184
201
  <tbody>
185
202
  <tr valign="top">
186
203
  <td
187
- class="esd-block-button product-button ${(e == null ? void 0 : e.cellClasses) ?? "es-p10t es-p10b"}"
188
- align="${(e == null ? void 0 : e.cellAlignment) ?? "center"}"
189
- esd-extension-block-id="${b.BUTTON}">
190
- <span class="${G(a)}" style="${c}">
204
+ class="esd-block-button product-button es-p10t es-p10b"
205
+ align="center"
206
+ esd-extension-block-id="${l.BUTTON}">
207
+ <span
208
+ class="es-button-border"
209
+ style="
210
+ border-width: 1px;
211
+ background: rgb(217, 234, 211);
212
+ border-color: rgb(106, 168, 79);
213
+ ">
191
214
  <a
192
215
  href="#"
193
- class="es-button ${f}"
216
+ class="es-button ${p}"
194
217
  target="_blank"
195
- style="${g}">
196
- ${y}
218
+ style="
219
+ color: rgb(56, 118, 29);
220
+ background: rgb(217, 234, 211);
221
+ font-family: arial, 'helvetica neue', helvetica, sans-serif;
222
+ font-size: 16px;
223
+ font-weight: normal;
224
+ line-height: 120%;
225
+ mso-border-alt: 10px solid rgb(217, 234, 211);
226
+ mso-padding-alt: 0;
227
+ ">
228
+ Buy
197
229
  </a>
198
230
  </span>
199
231
  </td>
@@ -201,8 +233,7 @@ const W = {
201
233
  </tbody>
202
234
  </table>
203
235
  </td>
204
- `;
205
- },
236
+ `,
206
237
  /**
207
238
  * Custom attribute cell template — same structure as built-in entries
208
239
  * (outer td → inner product-card-segment table).
@@ -210,34 +241,34 @@ const W = {
210
241
  * @param productAttrValue - Resolved product-attr value (e.g., "brand" for default, "product_attribute.rating_star" for custom)
211
242
  * @param content - Display content for the cell
212
243
  */
213
- [N]: (r, e, l) => {
214
- const a = (l == null ? void 0 : l.cellPadding) ?? d, c = T(
215
- e,
216
- { pStyle: "font-size: 12px; color: #666666;", openTags: "", closeTags: "" },
217
- l == null ? void 0 : l.styleTemplate
218
- );
219
- return `
220
- <td class="${t}" style="padding: ${a}; height: 100%;" valign="middle">
221
- ${u(l == null ? void 0 : l.cardBackgroundColor, "table-layout: fixed;")}
244
+ [R]: (t, e) => `
245
+ <td class="${a}" style="padding: ${s}; height: 100%;" valign="middle">
246
+ <table
247
+ class="product-card-segment"
248
+ width="100%"
249
+ height="100%"
250
+ cellpadding="0"
251
+ cellspacing="0"
252
+ border="0"
253
+ style="table-layout: fixed;">
222
254
  <tbody>
223
255
  <tr valign="top">
224
256
  <td
225
- ${k}="${r}"
226
- class="esd-block-text product-custom-attribute ${(l == null ? void 0 : l.cellClasses) ?? "es-p0t es-p0b es-p15l es-p15r"}"
227
- align="${(l == null ? void 0 : l.cellAlignment) ?? "center"}"
228
- esd-extension-block-id="${b.CUSTOM_ATTRIBUTE}"${$(l == null ? void 0 : l.cellBackgroundColor)}>
229
- ${c}
257
+ ${u}="${t}"
258
+ class="esd-block-text product-custom-attribute es-p0t es-p0b es-p15l es-p15r"
259
+ align="center"
260
+ esd-extension-block-id="${l.CUSTOM_ATTRIBUTE}">
261
+ <p contenteditable="false" style="font-size: 12px; color: #666666;">${e}</p>
230
262
  </td>
231
263
  </tr>
232
264
  </tbody>
233
265
  </table>
234
266
  </td>
235
- `;
236
- }
267
+ `
237
268
  };
238
269
  export {
239
- t as ATTRIBUTE_CELL_CLASS,
240
- d as DEFAULT_CELL_PADDING,
241
- Q as buildFillerCell,
242
- W as gridElementRenderer
270
+ a as ATTRIBUTE_CELL_CLASS,
271
+ s as DEFAULT_CELL_PADDING,
272
+ S as buildFillerCell,
273
+ A as gridElementRenderer
243
274
  };
@@ -1,7 +1,7 @@
1
- import { DEFAULT_PRODUCTS_PER_ROW as f } from "../../constants/layout.js";
2
- import { getDefaultProducts as A, DEFAULTS as C, createBlockTemplate as g, buildSpacer as P, DEFAULT_CARD_COMPOSITION as O, buildElementRenderer as U, DEFAULT_CARD_VISIBILITY as Y } from "../utils.js";
3
- import { DEFAULT_CELL_PADDING as h, buildFillerCell as B, gridElementRenderer as F } from "./elementRenderer.js";
4
- const W = `
1
+ import { DEFAULT_PRODUCTS_PER_ROW as m } from "../../constants/layout.js";
2
+ import { getDefaultProducts as I, DEFAULTS as b, createBlockTemplate as E, DEFAULT_CARD_COMPOSITION as L, spacer as S, buildElementRenderer as _, DEFAULT_CARD_VISIBILITY as f } from "../utils.js";
3
+ import { buildFillerCell as w, gridElementRenderer as A } from "./elementRenderer.js";
4
+ const D = `
5
5
  <tr class="recommendation-product-row">
6
6
  <td>
7
7
  <table
@@ -18,7 +18,7 @@ const W = `
18
18
  </table>
19
19
  </td>
20
20
  </tr>
21
- `, k = `
21
+ `, C = `
22
22
  <tr
23
23
  class="recommendation-attribute-row"
24
24
  data-attribute-type="{-{-ATTR_TYPE-}-}"
@@ -27,64 +27,38 @@ const W = `
27
27
  {-{-CELLS-}-}
28
28
  </tr>
29
29
  `;
30
- function H(e, r, c, o = O, n = {}, p = {}) {
31
- const {
32
- cellPadding: i = h,
33
- styleTemplates: s,
34
- cardBackgroundColor: T,
35
- cellBackgroundColors: l,
36
- cellAlignments: d,
37
- cellClasses: u,
38
- omnibusTexts: a,
39
- visibility: R
40
- } = p, m = (100 / r).toFixed(2), I = r - e.length, S = I > 0 ? B(m, i).repeat(I) : "", L = U(c, o, n);
41
- return o.filter((t) => L[t]).map((t) => {
42
- const E = (R == null ? void 0 : R[t]) ?? Y[t] ?? !0, b = E ? "" : 'style="display: none;"', _ = {
43
- cellPadding: i,
44
- cardBackgroundColor: T,
45
- cellBackgroundColor: l == null ? void 0 : l[t],
46
- cellAlignment: d == null ? void 0 : d[t],
47
- cellClasses: u == null ? void 0 : u[t],
48
- omnibusText: a == null ? void 0 : a[t],
49
- styleTemplate: s == null ? void 0 : s[t]
50
- }, w = e.map((D) => L[t](D, _).replace("<td", `<td width="${m}%"`)).join("");
51
- return k.replace("{-{-ATTR_TYPE-}-}", t).replace("{-{-VISIBILITY-}-}", E ? "1" : "0").replace("{-{-DISPLAY_STYLE-}-}", b).replace("{-{-CELLS-}-}", w + S);
30
+ function O(t, e, n, r = L, c = {}) {
31
+ const a = (100 / e).toFixed(2), s = e - t.length, l = s > 0 ? w(a).repeat(s) : "", i = _(n, r, c);
32
+ return r.filter((o) => i[o]).map((o) => {
33
+ const p = f[o] ?? !0, u = p ? "" : 'style="display: none;"', T = t.map((R) => i[o](R).replace("<td", `<td width="${a}%"`)).join("");
34
+ return C.replace("{-{-ATTR_TYPE-}-}", o).replace("{-{-VISIBILITY-}-}", p ? "1" : "0").replace("{-{-DISPLAY_STYLE-}-}", u).replace("{-{-CELLS-}-}", T + l);
52
35
  }).join("");
53
36
  }
54
- function x(e, r, c, o, n = {}, p = {}) {
55
- const i = [];
56
- for (let l = 0; l < e.length; l += r)
57
- i.push(e.slice(l, l + r));
58
- const s = P(p.rowSpacingPx);
59
- return i.map((l, d) => {
60
- const u = H(
37
+ function g(t, e, n, r, c = {}) {
38
+ const a = [];
39
+ for (let l = 0; l < t.length; l += e)
40
+ a.push(t.slice(l, l + e));
41
+ return a.map((l, i) => {
42
+ const d = O(
61
43
  l,
62
- r,
63
- c,
64
- o,
44
+ e,
65
45
  n,
66
- p
67
- ), a = W.replace("{-{-ATTRIBUTE_ROWS-}-}", u);
68
- return d > 0 ? s + a : a;
46
+ r,
47
+ c
48
+ ), o = D.replace("{-{-ATTRIBUTE_ROWS-}-}", d);
49
+ return i > 0 ? S + o : o;
69
50
  }).join("");
70
51
  }
71
- function V(e, r, c, o = {}, n = {}) {
72
- return x(
73
- e,
74
- r,
75
- F,
76
- c,
77
- o,
78
- n
79
- );
52
+ function P(t, e, n, r = {}) {
53
+ return g(t, e, A, n, r);
80
54
  }
81
- function $(e) {
82
- const r = e ? `ins-recommendation-v3-block-${e}` : void 0, c = g("grid", r), o = A(), n = V(o, f);
83
- return c.replace("{-{-TITLE-}-}", C.TITLE).replace("{-{-PRODUCT_ROWS-}-}", n).replace("{-{-MOBILE_PRODUCT_ROWS-}-}", "");
55
+ function B(t) {
56
+ const e = t ? `ins-recommendation-v3-block-${t}` : void 0, n = E("grid", e), r = I(), c = P(r, m);
57
+ return n.replace("{-{-TITLE-}-}", b.TITLE).replace("{-{-PRODUCT_ROWS-}-}", c).replace("{-{-MOBILE_PRODUCT_ROWS-}-}", "");
84
58
  }
85
59
  export {
86
- $ as getDefaultTemplate,
87
- H as prepareGridAttributeRows,
88
- x as prepareGridProductRows,
89
- V as prepareProductRows
60
+ B as getDefaultTemplate,
61
+ O as prepareGridAttributeRows,
62
+ g as prepareGridProductRows,
63
+ P as prepareProductRows
90
64
  };
@@ -1,33 +1,12 @@
1
- import { DEFAULT_PRODUCTS_PER_ROW as f } from "../constants/layout.js";
2
- import { prepareProductRows as w } from "./grid/template.js";
3
- import { prepareProductRows as g } from "./list/template.js";
4
- function L(o, t, r = {}) {
5
- const {
6
- cellPadding: s,
7
- rowSpacingPx: i,
8
- styleTemplates: c,
9
- cardBackgroundColor: l,
10
- cellBackgroundColors: p,
11
- cellAlignments: n,
12
- cellClasses: a,
13
- omnibusTexts: d,
14
- visibility: m
15
- } = r, e = {
16
- cellPadding: s,
17
- rowSpacingPx: i,
18
- styleTemplates: c,
19
- cardBackgroundColor: l,
20
- cellBackgroundColors: p,
21
- cellAlignments: n,
22
- cellClasses: a,
23
- omnibusTexts: d,
24
- visibility: m
25
- };
1
+ import { DEFAULT_PRODUCTS_PER_ROW as s } from "../constants/layout.js";
2
+ import { prepareProductRows as c } from "./grid/template.js";
3
+ import { prepareProductRows as R } from "./list/template.js";
4
+ function a(o, t, r = {}) {
26
5
  if (t === "list")
27
- return g(o, r.composition, r.filterList, e);
28
- const { productsPerRow: u = f, composition: P, filterList: R } = r;
29
- return w(o, u, P, R, e);
6
+ return R(o, r.composition, r.filterList);
7
+ const { productsPerRow: e = s, composition: p, filterList: i } = r;
8
+ return c(o, e, p, i);
30
9
  }
31
10
  export {
32
- L as prepareProductRows
11
+ a as prepareProductRows
33
12
  };