@useinsider/guido 3.0.0-beta.7a5aecd → 3.0.0-beta.7d3a300

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 (50) hide show
  1. package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +1 -1
  2. package/dist/components/organisms/onboarding/GenericOnboarding.vue2.js +1 -1
  3. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.js +1 -1
  4. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue2.js +2 -2
  5. package/dist/config/compiler/unsubscribeCompilerRules.js +14 -14
  6. package/dist/config/compiler/utils/recommendationCompilerUtils.js +29 -18
  7. package/dist/config/i18n/en/tooltips.json.js +2 -1
  8. package/dist/extensions/Blocks/Recommendation/block.js +4 -1
  9. package/dist/extensions/Blocks/Recommendation/constants/blockIds.js +1 -1
  10. package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
  11. package/dist/extensions/Blocks/Recommendation/constants/selectors.js +15 -12
  12. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +693 -144
  13. package/dist/extensions/Blocks/Recommendation/controls/customAttribute/index.js +78 -0
  14. package/dist/extensions/Blocks/Recommendation/controls/layout/index.js +27 -24
  15. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +96 -88
  16. package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +83 -81
  17. package/dist/extensions/Blocks/Recommendation/extension.js +18 -16
  18. package/dist/extensions/Blocks/Recommendation/recommendation.css.js +126 -2
  19. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +124 -106
  20. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +8 -7
  21. package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +63 -34
  22. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +30 -33
  23. package/dist/extensions/Blocks/Recommendation/templates/index.js +8 -8
  24. package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +28 -13
  25. package/dist/extensions/Blocks/Recommendation/templates/list/template.js +25 -44
  26. package/dist/extensions/Blocks/Recommendation/templates/utils.js +62 -38
  27. package/dist/extensions/Blocks/Recommendation/utils/tagName.js +6 -6
  28. package/dist/extensions/Blocks/Unsubscribe/settingsPanel.js +16 -17
  29. package/dist/guido.css +1 -1
  30. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +324 -218
  31. package/dist/package.json.js +1 -1
  32. package/dist/src/extensions/Blocks/Recommendation/block.d.ts +1 -0
  33. package/dist/src/extensions/Blocks/Recommendation/constants/blockIds.d.ts +2 -1
  34. package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +8 -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 +10 -0
  37. package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +134 -44
  38. package/dist/src/extensions/Blocks/Recommendation/controls/customAttribute/index.d.ts +105 -0
  39. package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +1 -0
  40. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +2 -0
  41. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +1 -0
  42. package/dist/src/extensions/Blocks/Recommendation/templates/grid/elementRenderer.d.ts +1 -1
  43. package/dist/src/extensions/Blocks/Recommendation/templates/list/elementRenderer.d.ts +1 -1
  44. package/dist/src/extensions/Blocks/Recommendation/templates/list/template.d.ts +10 -4
  45. package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +37 -2
  46. package/dist/src/extensions/Blocks/Recommendation/utils/tagName.d.ts +3 -3
  47. package/dist/static/styles/components/button.css.js +13 -7
  48. package/dist/static/styles/components/narrow-panel.css.js +52 -0
  49. package/dist/static/styles/variables.css.js +3 -0
  50. package/package.json +3 -3
@@ -1,8 +1,8 @@
1
- import { SettingsPanelRegistry as S, SettingsPanelTab as I, SettingsTab as T, ContainerControls as E, TextControls as C } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
1
+ import { SettingsPanelRegistry as S, SettingsPanelTab as _, SettingsTab as O, ContainerControls as E, TextControls as C } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
2
  import { BLOCK_ID as R } from "./block.js";
3
3
  import { RecommendationBlockId as N } from "./constants/blockIds.js";
4
- import { RecommendationControlId as _ } from "./constants/controlIds.js";
5
- import { CONTROL_BLOCK_ID as L } from "./controls/main/index.js";
4
+ import { RecommendationControlId as T } from "./constants/controlIds.js";
5
+ import { CONTROL_BLOCK_ID as U } from "./controls/main/index.js";
6
6
  import "./store/recommendation.js";
7
7
  import "./controls/name/index.js";
8
8
  import "./controls/price/index.js";
@@ -11,163 +11,181 @@ import "./controls/omnibusPrice/index.js";
11
11
  import "./controls/omnibusDiscount/index.js";
12
12
  import "./controls/button/index.js";
13
13
  import "./controls/image/index.js";
14
- import { SPACING_CONTROL_ID as U } from "./controls/spacing/index.js";
15
- import { CARD_BACKGROUND_COLOR_CONTROL_ID as B } from "./controls/cardBackground/index.js";
14
+ import { SPACING_CONTROL_ID as A } from "./controls/spacing/index.js";
15
+ import { CARD_BACKGROUND_COLOR_CONTROL_ID as L } from "./controls/cardBackground/index.js";
16
16
  import { LAYOUT_CONTROL_ID as D } from "./controls/layout/index.js";
17
- import { COMPOSITION_CONTROL_BLOCK_ID as A } from "./controls/cardComposition/index.js";
18
- class s extends S {
19
- registerBlockControls(O) {
20
- O[R] = [
21
- new I(
22
- T.SETTINGS,
23
- [
24
- L,
17
+ import { COMPOSITION_CONTROL_BLOCK_ID as B } from "./controls/cardComposition/index.js";
18
+ class d extends S {
19
+ registerBlockControls(I) {
20
+ I[R] = [
21
+ new _(
22
+ O.SETTINGS,
23
+ [
24
+ U,
25
25
  E.EXTERNAL_INDENTS
26
26
  ]
27
27
  ),
28
- new I(
29
- T.STYLES,
28
+ new _(
29
+ O.STYLES,
30
30
  [
31
31
  C.TEXT_BLOCK_BACKGROUND_COLOR,
32
- B,
32
+ L,
33
33
  D,
34
- U
34
+ A
35
35
  ]
36
36
  ),
37
- new I(
37
+ new _(
38
38
  "Card Composition",
39
39
  [
40
- A
40
+ B
41
41
  ]
42
42
  ).withLabel("Card Composition")
43
- ], O[N.NAME] = [
44
- new I(
45
- T.SETTINGS,
43
+ ], I[N.NAME] = [
44
+ new _(
45
+ O.SETTINGS,
46
+ [
47
+ T.NAME_STYLE,
48
+ T.NAME_ALIGN,
49
+ T.NAME_TEXT_TRIM,
50
+ T.NAME_PADDINGS
51
+ ]
52
+ ),
53
+ new _(
54
+ O.STYLES,
55
+ [
56
+ T.NAME_BACKGROUND,
57
+ T.NAME_FONT_FAMILY,
58
+ T.NAME_SIZE,
59
+ T.NAME_COLOR
60
+ ]
61
+ )
62
+ ], I[N.PRICE] = [
63
+ new _(
64
+ O.SETTINGS,
46
65
  [
47
- _.NAME_STYLE,
48
- _.NAME_ALIGN,
49
- _.NAME_TEXT_TRIM,
50
- _.NAME_PADDINGS
66
+ T.PRICE_STYLE,
67
+ T.PRICE_ALIGN,
68
+ T.PRICE_PADDINGS
51
69
  ]
52
70
  ),
53
- new I(
54
- T.STYLES,
71
+ new _(
72
+ O.STYLES,
55
73
  [
56
- _.NAME_BACKGROUND,
57
- _.NAME_FONT_FAMILY,
58
- _.NAME_SIZE,
59
- _.NAME_COLOR
74
+ T.PRICE_BACKGROUND,
75
+ T.PRICE_FONT_FAMILY,
76
+ T.PRICE_SIZE,
77
+ T.PRICE_COLOR
60
78
  ]
61
79
  )
62
- ], O[N.PRICE] = [
63
- new I(
64
- T.SETTINGS,
80
+ ], I[N.OLD_PRICE] = [
81
+ new _(
82
+ O.SETTINGS,
65
83
  [
66
- _.PRICE_STYLE,
67
- _.PRICE_ALIGN,
68
- _.PRICE_PADDINGS
84
+ T.OLD_PRICE_STYLE,
85
+ T.OLD_PRICE_ALIGN,
86
+ T.OLD_PRICE_PADDINGS
69
87
  ]
70
88
  ),
71
- new I(
72
- T.STYLES,
89
+ new _(
90
+ O.STYLES,
73
91
  [
74
- _.PRICE_BACKGROUND,
75
- _.PRICE_FONT_FAMILY,
76
- _.PRICE_SIZE,
77
- _.PRICE_COLOR
92
+ T.OLD_PRICE_BACKGROUND,
93
+ T.OLD_PRICE_FONT_FAMILY,
94
+ T.OLD_PRICE_SIZE,
95
+ T.OLD_PRICE_COLOR
78
96
  ]
79
97
  )
80
- ], O[N.OLD_PRICE] = [
81
- new I(
82
- T.SETTINGS,
98
+ ], I[N.OMNIBUS_PRICE] = [
99
+ new _(
100
+ O.SETTINGS,
83
101
  [
84
- _.OLD_PRICE_STYLE,
85
- _.OLD_PRICE_ALIGN,
86
- _.OLD_PRICE_PADDINGS
102
+ T.OMNIBUS_PRICE_TEXT_BEFORE,
103
+ T.OMNIBUS_PRICE_TEXT_AFTER,
104
+ T.OMNIBUS_PRICE_STYLE,
105
+ T.OMNIBUS_PRICE_ALIGN,
106
+ T.OMNIBUS_PRICE_PADDINGS
87
107
  ]
88
108
  ),
89
- new I(
90
- T.STYLES,
109
+ new _(
110
+ O.STYLES,
91
111
  [
92
- _.OLD_PRICE_BACKGROUND,
93
- _.OLD_PRICE_FONT_FAMILY,
94
- _.OLD_PRICE_SIZE,
95
- _.OLD_PRICE_COLOR
112
+ T.OMNIBUS_PRICE_BACKGROUND,
113
+ T.OMNIBUS_PRICE_FONT_FAMILY,
114
+ T.OMNIBUS_PRICE_SIZE,
115
+ T.OMNIBUS_PRICE_COLOR
96
116
  ]
97
117
  )
98
- ], O[N.OMNIBUS_PRICE] = [
99
- new I(
100
- T.SETTINGS,
118
+ ], I[N.OMNIBUS_DISCOUNT] = [
119
+ new _(
120
+ O.SETTINGS,
101
121
  [
102
- _.OMNIBUS_PRICE_TEXT_BEFORE,
103
- _.OMNIBUS_PRICE_TEXT_AFTER,
104
- _.OMNIBUS_PRICE_STYLE,
105
- _.OMNIBUS_PRICE_ALIGN,
106
- _.OMNIBUS_PRICE_PADDINGS
122
+ T.OMNIBUS_DISCOUNT_TEXT_BEFORE,
123
+ T.OMNIBUS_DISCOUNT_TEXT_AFTER,
124
+ T.OMNIBUS_DISCOUNT_STYLE,
125
+ T.OMNIBUS_DISCOUNT_ALIGN,
126
+ T.OMNIBUS_DISCOUNT_PADDINGS
107
127
  ]
108
128
  ),
109
- new I(
110
- T.STYLES,
129
+ new _(
130
+ O.STYLES,
111
131
  [
112
- _.OMNIBUS_PRICE_BACKGROUND,
113
- _.OMNIBUS_PRICE_FONT_FAMILY,
114
- _.OMNIBUS_PRICE_SIZE,
115
- _.OMNIBUS_PRICE_COLOR
132
+ T.OMNIBUS_DISCOUNT_BACKGROUND,
133
+ T.OMNIBUS_DISCOUNT_FONT_FAMILY,
134
+ T.OMNIBUS_DISCOUNT_SIZE,
135
+ T.OMNIBUS_DISCOUNT_COLOR
116
136
  ]
117
137
  )
118
- ], O[N.OMNIBUS_DISCOUNT] = [
119
- new I(
120
- T.SETTINGS,
138
+ ], I[N.BUTTON] = [
139
+ new _(
140
+ O.SETTINGS,
121
141
  [
122
- _.OMNIBUS_DISCOUNT_TEXT_BEFORE,
123
- _.OMNIBUS_DISCOUNT_TEXT_AFTER,
124
- _.OMNIBUS_DISCOUNT_STYLE,
125
- _.OMNIBUS_DISCOUNT_ALIGN,
126
- _.OMNIBUS_DISCOUNT_PADDINGS
142
+ T.BUTTON_TEXT,
143
+ T.BUTTON_ALIGN,
144
+ T.BUTTON_PADDINGS,
145
+ T.BUTTON_MARGINS
127
146
  ]
128
147
  ),
129
- new I(
130
- T.STYLES,
148
+ new _(
149
+ O.STYLES,
131
150
  [
132
- _.OMNIBUS_DISCOUNT_BACKGROUND,
133
- _.OMNIBUS_DISCOUNT_FONT_FAMILY,
134
- _.OMNIBUS_DISCOUNT_SIZE,
135
- _.OMNIBUS_DISCOUNT_COLOR
151
+ T.BUTTON_COLOR,
152
+ T.BUTTON_FONT_FAMILY,
153
+ T.BUTTON_TEXT_SIZE,
154
+ T.BUTTON_TEXT_STYLE_AND_FONT_COLOR,
155
+ T.BUTTON_FIT_TO_CONTENT,
156
+ T.BUTTON_BORDER_RADIUS,
157
+ T.BUTTON_BORDER
136
158
  ]
137
159
  )
138
- ], O[N.BUTTON] = [
139
- new I(
140
- T.SETTINGS,
160
+ ], I[N.CUSTOM_ATTRIBUTE] = [
161
+ new _(
162
+ O.SETTINGS,
141
163
  [
142
- _.BUTTON_TEXT,
143
- _.BUTTON_ALIGN,
144
- _.BUTTON_PADDINGS,
145
- _.BUTTON_MARGINS
164
+ T.CUSTOM_ATTR_STYLE,
165
+ T.CUSTOM_ATTR_ALIGN,
166
+ T.CUSTOM_ATTR_PADDINGS
146
167
  ]
147
168
  ),
148
- new I(
149
- T.STYLES,
169
+ new _(
170
+ O.STYLES,
150
171
  [
151
- _.BUTTON_COLOR,
152
- _.BUTTON_FONT_FAMILY,
153
- _.BUTTON_TEXT_SIZE,
154
- _.BUTTON_TEXT_STYLE_AND_FONT_COLOR,
155
- _.BUTTON_FIT_TO_CONTENT,
156
- _.BUTTON_BORDER_RADIUS,
157
- _.BUTTON_BORDER
172
+ T.CUSTOM_ATTR_BACKGROUND,
173
+ T.CUSTOM_ATTR_FONT_FAMILY,
174
+ T.CUSTOM_ATTR_SIZE,
175
+ T.CUSTOM_ATTR_COLOR
158
176
  ]
159
177
  )
160
- ], O[N.IMAGE] = [
161
- new I(
162
- T.SETTINGS,
178
+ ], I[N.IMAGE] = [
179
+ new _(
180
+ O.SETTINGS,
163
181
  [
164
- _.IMAGE_SIZE,
165
- _.IMAGE_MARGINS
182
+ T.IMAGE_SIZE,
183
+ T.IMAGE_MARGINS
166
184
  ]
167
185
  )
168
186
  ];
169
187
  }
170
188
  }
171
189
  export {
172
- s as SettingsPanel
190
+ d as SettingsPanel
173
191
  };
@@ -5,11 +5,11 @@ import { defineStore as G } from "pinia";
5
5
  import { DEFAULT_CARDS_IN_ROW as F } from "../constants/layout.js";
6
6
  import { EXCLUDED_ALGORITHM_IDS as w } from "../constants/defaultConfig.js";
7
7
  import { getDefaultProducts as S } from "../templates/utils.js";
8
- import { generateCompleteFilterQuery as I } from "../utils/filterUtil.js";
8
+ import { generateCompleteFilterQuery as b } from "../utils/filterUtil.js";
9
9
  import { isFilterValid as D } from "../validation/filterSchema.js";
10
10
  const h = y();
11
11
  let u = null, m = null, d = null;
12
- function b() {
12
+ function I() {
13
13
  return {
14
14
  cardsInRow: F,
15
15
  currencySettings: {
@@ -32,12 +32,13 @@ function b() {
32
32
  strategy: "mostPopular",
33
33
  textTrimming: !0,
34
34
  unresponsive: !1,
35
- size: "6"
35
+ size: "6",
36
+ customAttributes: []
36
37
  };
37
38
  }
38
39
  function P() {
39
40
  return {
40
- recommendationConfigs: b(),
41
+ recommendationConfigs: I(),
41
42
  recommendationProducts: [],
42
43
  filterStatus: !1,
43
44
  filterSelectionDrawerStatus: !1,
@@ -66,7 +67,7 @@ const v = () => ({
66
67
  * This allows all existing code that reads `store.recommendationConfigs` to work unchanged.
67
68
  */
68
69
  recommendationConfigs(t) {
69
- return t.currentRecommendationId !== null && t.blockStates[t.currentRecommendationId] ? t.blockStates[t.currentRecommendationId].recommendationConfigs : b();
70
+ return t.currentRecommendationId !== null && t.blockStates[t.currentRecommendationId] ? t.blockStates[t.currentRecommendationId].recommendationConfigs : I();
70
71
  },
71
72
  /**
72
73
  * Proxy getter: delegates to blockStates[currentRecommendationId].recommendationProducts
@@ -352,7 +353,7 @@ const v = () => ({
352
353
  }), r.recommendationConfigs.filters = e;
353
354
  },
354
355
  generateFilterQuery() {
355
- return I(this.recommendationConfigs.filters);
356
+ return b(this.recommendationConfigs.filters);
356
357
  },
357
358
  // ====================================================================
358
359
  // Per-Block Product Fetching
@@ -373,7 +374,7 @@ const v = () => ({
373
374
  },
374
375
  async _doFetchProducts() {
375
376
  var p;
376
- const t = this.currentRecommendationId, r = this.blockStates[t], { recommendationConfigs: e } = r, n = e.filters.filter((a) => a.isValid), c = I(n), i = ((p = g.find((a) => a.key === e.strategy)) == null ? void 0 : p.path) || "", o = C(), s = {
377
+ const t = this.currentRecommendationId, r = this.blockStates[t], { recommendationConfigs: e } = r, n = e.filters.filter((a) => a.isValid), c = b(n), i = ((p = g.find((a) => a.key === e.strategy)) == null ? void 0 : p.path) || "", o = C(), s = {
377
378
  locale: e.language,
378
379
  currency: e.currencySettings.value,
379
380
  partnerName: o.partnerName,
@@ -1,11 +1,11 @@
1
1
  import { RecommendationBlockId as s } from "../../constants/blockIds.js";
2
- import { ATTR_PRODUCT_BUTTON as b, ATTR_PRODUCT_OMNIBUS_DISCOUNT as u, ATTR_PRODUCT_OMNIBUS_PRICE as m, ATTR_PRODUCT_OLD_PRICE as h, ATTR_PRODUCT_PRICE as y, ATTR_PRODUCT_NAME as f, ATTR_PRODUCT_IMAGE as x } from "../../constants/selectors.js";
3
- import { useRecommendationExtensionStore as T } from "../../store/recommendation.js";
4
- import { formatPrice as _ } from "../../utils/priceFormatter.js";
5
- import { sanitizeImageUrl as $ } from "../utils.js";
6
- const a = "0 5px", o = "attribute-cell";
2
+ import { ATTR_PRODUCT_ATTR as g, ATTR_PRODUCT_BUTTON as u, ATTR_PRODUCT_OMNIBUS_DISCOUNT as m, ATTR_PRODUCT_OMNIBUS_PRICE as h, ATTR_PRODUCT_OLD_PRICE as y, ATTR_PRODUCT_PRICE as T, ATTR_PRODUCT_NAME as f, ATTR_PRODUCT_IMAGE as _ } from "../../constants/selectors.js";
3
+ import { useRecommendationExtensionStore as x } from "../../store/recommendation.js";
4
+ import { formatPrice as $ } from "../../utils/priceFormatter.js";
5
+ import { sanitizeImageUrl as C, CUSTOM_CELL_HTML as R } from "../utils.js";
6
+ const a = "0 5px", l = "attribute-cell";
7
7
  function p() {
8
- const t = T(), { currencySettings: e } = t.recommendationConfigs;
8
+ const t = x(), { currencySettings: e } = t.recommendationConfigs;
9
9
  return {
10
10
  code: e.value,
11
11
  symbol: e.symbol,
@@ -15,16 +15,16 @@ function p() {
15
15
  thousandSeparator: e.thousandSeparator
16
16
  };
17
17
  }
18
- function c(t, e = "price") {
19
- const n = p(), l = t[e], r = (l == null ? void 0 : l[n.code]) ?? Object.values(l ?? {})[0] ?? 0;
20
- return _({
21
- price: r,
22
- currency: n
18
+ function r(t, e = "price") {
19
+ const o = p(), n = t[e], d = (n == null ? void 0 : n[o.code]) ?? Object.values(n ?? {})[0] ?? 0;
20
+ return $({
21
+ price: d,
22
+ currency: o
23
23
  });
24
24
  }
25
- const P = {
26
- [x]: (t) => `
27
- <td class="${o}" style="padding: ${a}; height: 100%;" valign="top">
25
+ const I = {
26
+ [_]: (t) => `
27
+ <td class="${l}" style="padding: ${a}; height: 100%;" valign="top">
28
28
  <table
29
29
  class="product-card-segment"
30
30
  width="100%"
@@ -40,7 +40,7 @@ const P = {
40
40
  esd-extension-block-id="${s.IMAGE}">
41
41
  <a target="_blank" href="${t.url}">
42
42
  <img
43
- src="${$(t.image_url)}"
43
+ src="${C(t.image_url)}"
44
44
  alt="${t.name}"
45
45
  style="display: block; max-width: 100%; height: auto;"
46
46
  class="adapt-img">
@@ -52,7 +52,7 @@ const P = {
52
52
  </td>
53
53
  `,
54
54
  [f]: (t) => `
55
- <td class="${o}" style="padding: ${a}; height: 100%;" valign="middle">
55
+ <td class="${l}" style="padding: ${a}; height: 100%;" valign="middle">
56
56
  <table
57
57
  class="product-card-segment"
58
58
  width="100%"
@@ -76,8 +76,8 @@ const P = {
76
76
  </table>
77
77
  </td>
78
78
  `,
79
- [y]: (t) => `
80
- <td class="${o}" style="padding: ${a}; height: 100%;" valign="top">
79
+ [T]: (t) => `
80
+ <td class="${l}" style="padding: ${a}; height: 100%;" valign="top">
81
81
  <table
82
82
  class="product-card-segment"
83
83
  width="100%"
@@ -92,7 +92,7 @@ const P = {
92
92
  align="center"
93
93
  esd-extension-block-id="${s.PRICE}">
94
94
  <p contenteditable="false" style="font-size: 16px; color: #333333;">
95
- <strong>${c(t, "price")}</strong>
95
+ <strong>${r(t, "price")}</strong>
96
96
  </p>
97
97
  </td>
98
98
  </tr>
@@ -100,8 +100,8 @@ const P = {
100
100
  </table>
101
101
  </td>
102
102
  `,
103
- [h]: (t) => `
104
- <td class="${o}" style="padding: ${a}; height: 100%;" valign="top">
103
+ [y]: (t) => `
104
+ <td class="${l}" style="padding: ${a}; height: 100%;" valign="top">
105
105
  <table
106
106
  class="product-card-segment"
107
107
  width="100%"
@@ -116,7 +116,7 @@ const P = {
116
116
  align="center"
117
117
  esd-extension-block-id="${s.OLD_PRICE}">
118
118
  <p contenteditable="false" style="font-size: 14px; color: #999999;">
119
- <strong>${c(t, "original_price")}</strong>
119
+ <strong>${r(t, "original_price")}</strong>
120
120
  </p>
121
121
  </td>
122
122
  </tr>
@@ -124,8 +124,8 @@ const P = {
124
124
  </table>
125
125
  </td>
126
126
  `,
127
- [m]: (t) => `
128
- <td class="${o}" style="padding: ${a}; height: 100%;" valign="top">
127
+ [h]: (t) => `
128
+ <td class="${l}" style="padding: ${a}; height: 100%;" valign="top">
129
129
  <table
130
130
  class="product-card-segment"
131
131
  width="100%"
@@ -143,7 +143,7 @@ const P = {
143
143
  esd-extension-block-id="${s.OMNIBUS_PRICE}">
144
144
  <p contenteditable="false" style="font-size: 12px; color: #666666;">
145
145
  <span class="omnibus-text-before">Lowest 30-day price: </span>
146
- <span class="omnibus-price-value">${c(t, "original_price")}</span>
146
+ <span class="omnibus-price-value">${r(t, "original_price")}</span>
147
147
  <span class="omnibus-text-after"></span>
148
148
  </p>
149
149
  </td>
@@ -152,11 +152,11 @@ const P = {
152
152
  </table>
153
153
  </td>
154
154
  `,
155
- [u]: (t) => {
156
- var d, i;
157
- const e = p(), n = ((d = t.original_price) == null ? void 0 : d[e.code]) ?? Object.values(t.original_price ?? {})[0] ?? 0, l = ((i = t.price) == null ? void 0 : i[e.code]) ?? Object.values(t.price ?? {})[0] ?? 0, r = n > 0 ? Math.round((n - l) / n * 100) : 0, g = r > 0 ? `-${r}%` : "0%";
155
+ [m]: (t) => {
156
+ var c, i;
157
+ const e = p(), o = ((c = t.original_price) == null ? void 0 : c[e.code]) ?? Object.values(t.original_price ?? {})[0] ?? 0, n = ((i = t.price) == null ? void 0 : i[e.code]) ?? Object.values(t.price ?? {})[0] ?? 0, d = o > 0 ? Math.round((o - n) / o * 100) : 0, b = d > 0 ? `-${d}%` : "0%";
158
158
  return `
159
- <td class="${o}" style="padding: ${a}; height: 100%;" valign="top">
159
+ <td class="${l}" style="padding: ${a}; height: 100%;" valign="top">
160
160
  <table
161
161
  class="product-card-segment"
162
162
  width="100%"
@@ -174,7 +174,7 @@ const P = {
174
174
  esd-extension-block-id="${s.OMNIBUS_DISCOUNT}">
175
175
  <p contenteditable="false" style="font-size: 12px; color: #666666;">
176
176
  <span class="omnibus-text-before"></span>
177
- <span class="omnibus-discount-value">${g}</span>
177
+ <span class="omnibus-discount-value">${b}</span>
178
178
  <span class="omnibus-text-after"></span>
179
179
  </p>
180
180
  </td>
@@ -184,8 +184,8 @@ const P = {
184
184
  </td>
185
185
  `;
186
186
  },
187
- [b]: () => `
188
- <td class="${o}" style="padding: ${a}; height: 100%;" valign="top">
187
+ [u]: () => `
188
+ <td class="${l}" style="padding: ${a}; height: 100%;" valign="top">
189
189
  <table
190
190
  class="product-card-segment"
191
191
  width="100%"
@@ -219,10 +219,39 @@ const P = {
219
219
  </tbody>
220
220
  </table>
221
221
  </td>
222
+ `,
223
+ /**
224
+ * Custom attribute cell template — same structure as built-in entries
225
+ * (outer td → inner product-card-segment table).
226
+ * Used by `buildElementRenderer` for `customAttr:*` composition entries.
227
+ */
228
+ [R]: (t, e) => `
229
+ <td class="${l}" style="padding: ${a}; height: 100%;" valign="middle">
230
+ <table
231
+ class="product-card-segment"
232
+ width="100%"
233
+ height="100%"
234
+ cellpadding="0"
235
+ cellspacing="0"
236
+ border="0"
237
+ style="table-layout: fixed;">
238
+ <tbody>
239
+ <tr valign="top">
240
+ <td
241
+ ${g}="product_attribute.${t}"
242
+ class="esd-block-text product-custom-attribute es-p0t es-p0b es-p15l es-p15r"
243
+ align="center"
244
+ esd-extension-block-id="${s.CUSTOM_ATTRIBUTE}">
245
+ <p contenteditable="false" style="font-size: 12px; color: #666666;">${e}</p>
246
+ </td>
247
+ </tr>
248
+ </tbody>
249
+ </table>
250
+ </td>
222
251
  `
223
252
  };
224
253
  export {
225
- o as ATTRIBUTE_CELL_CLASS,
254
+ l as ATTRIBUTE_CELL_CLASS,
226
255
  a as DEFAULT_CELL_PADDING,
227
- P as gridElementRenderer
256
+ I as gridElementRenderer
228
257
  };
@@ -1,7 +1,7 @@
1
- import { DEFAULT_PRODUCTS_PER_ROW as m, DEFAULT_MOBILE_CARDS_IN_ROW as I } from "../../constants/layout.js";
2
- import { DEFAULT_CARD_COMPOSITION as _, spacer as E, getDefaultProducts as S, createBlockTemplate as A, DEFAULTS as b, DEFAULT_CARD_VISIBILITY as D } from "../utils.js";
3
- import { gridElementRenderer as w, ATTRIBUTE_CELL_CLASS as C, DEFAULT_CELL_PADDING as f } from "./elementRenderer.js";
4
- const O = `
1
+ import { DEFAULT_PRODUCTS_PER_ROW as m, DEFAULT_MOBILE_CARDS_IN_ROW as E } from "../../constants/layout.js";
2
+ import { DEFAULT_CARD_COMPOSITION as I, spacer as _, getDefaultProducts as S, createBlockTemplate as b, DEFAULTS as A, buildElementRenderer as D, DEFAULT_CARD_VISIBILITY as w } from "../utils.js";
3
+ import { gridElementRenderer as f, ATTRIBUTE_CELL_CLASS as C, DEFAULT_CELL_PADDING as O } from "./elementRenderer.js";
4
+ const U = `
5
5
  <tr class="recommendation-product-row">
6
6
  <td>
7
7
  <table
@@ -18,7 +18,7 @@ const O = `
18
18
  </table>
19
19
  </td>
20
20
  </tr>
21
- `, U = `
21
+ `, g = `
22
22
  <tr
23
23
  class="recommendation-attribute-row"
24
24
  data-attribute-type="{-{-ATTR_TYPE-}-}"
@@ -27,40 +27,37 @@ const O = `
27
27
  {-{-CELLS-}-}
28
28
  </tr>
29
29
  `;
30
- function g(t, e, r, n = _) {
31
- const c = (100 / e).toFixed(2), s = e - t.length, o = `<td class="${C}" style="padding: ${f};" width="${c}%"></td>`, i = s > 0 ? o.repeat(s) : "";
32
- return n.filter((l) => r[l]).map((l) => {
33
- const p = D[l] ?? !0, T = p ? "" : 'style="display: none;"', u = t.map((R) => {
34
- const L = r[l];
35
- return L(R).replace("<td", `<td width="${c}%"`);
36
- }).join("");
37
- return U.replace("{-{-ATTR_TYPE-}-}", l).replace("{-{-VISIBILITY-}-}", p ? "1" : "0").replace("{-{-DISPLAY_STYLE-}-}", T).replace("{-{-CELLS-}-}", u + i);
30
+ function P(t, e, l, o = I) {
31
+ const n = (100 / e).toFixed(2), c = e - t.length, r = `<td class="${C}" style="padding: ${O};" width="${n}%"></td>`, i = c > 0 ? r.repeat(c) : "", a = D(l, o);
32
+ return o.filter((s) => a[s]).map((s) => {
33
+ const p = w[s] ?? !0, u = p ? "" : 'style="display: none;"', R = t.map((L) => a[s](L).replace("<td", `<td width="${n}%"`)).join("");
34
+ return g.replace("{-{-ATTR_TYPE-}-}", s).replace("{-{-VISIBILITY-}-}", p ? "1" : "0").replace("{-{-DISPLAY_STYLE-}-}", u).replace("{-{-CELLS-}-}", R + i);
38
35
  }).join("");
39
36
  }
40
- function P(t, e, r, n) {
41
- const c = [];
42
- for (let o = 0; o < t.length; o += e)
43
- c.push(t.slice(o, o + e));
44
- return c.map((o, i) => {
45
- const a = g(
46
- o,
47
- e,
37
+ function h(t, e, l, o) {
38
+ const n = [];
39
+ for (let r = 0; r < t.length; r += e)
40
+ n.push(t.slice(r, r + e));
41
+ return n.map((r, i) => {
42
+ const a = P(
48
43
  r,
49
- n
50
- ), l = O.replace("{-{-ATTRIBUTE_ROWS-}-}", a);
51
- return i > 0 ? E + l : l;
44
+ e,
45
+ l,
46
+ o
47
+ ), d = U.replace("{-{-ATTRIBUTE_ROWS-}-}", a);
48
+ return i > 0 ? _ + d : d;
52
49
  }).join("");
53
50
  }
54
- function d(t, e, r) {
55
- return P(t, e, w, r);
51
+ function T(t, e, l) {
52
+ return h(t, e, f, l);
56
53
  }
57
- function W(t) {
58
- const e = t ? `ins-recommendation-v3-block-${t}` : void 0, r = A("grid", e), n = S(), c = d(n, m), s = d(n, I);
59
- return r.replace("{-{-TITLE-}-}", b.TITLE).replace("{-{-PRODUCT_ROWS-}-}", c).replace("{-{-MOBILE_PRODUCT_ROWS-}-}", s);
54
+ function F(t) {
55
+ const e = t ? `ins-recommendation-v3-block-${t}` : void 0, l = b("grid", e), o = S(), n = T(o, m), c = T(o, E);
56
+ return l.replace("{-{-TITLE-}-}", A.TITLE).replace("{-{-PRODUCT_ROWS-}-}", n).replace("{-{-MOBILE_PRODUCT_ROWS-}-}", c);
60
57
  }
61
58
  export {
62
- W as getDefaultTemplate,
63
- g as prepareGridAttributeRows,
64
- P as prepareGridProductRows,
65
- d as prepareProductRows
59
+ F as getDefaultTemplate,
60
+ P as prepareGridAttributeRows,
61
+ h as prepareGridProductRows,
62
+ T as prepareProductRows
66
63
  };
@@ -1,12 +1,12 @@
1
1
  import { DEFAULT_PRODUCTS_PER_ROW as s } from "../constants/layout.js";
2
- import { prepareProductRows as R } from "./grid/template.js";
3
- import { prepareProductRows as c } from "./list/template.js";
4
- function a(r, o, p = {}) {
5
- if (o === "list")
6
- return c(r);
7
- const { productsPerRow: t = s, composition: e } = p;
8
- return R(r, t, e);
2
+ import { prepareProductRows as c } from "./grid/template.js";
3
+ import { prepareProductRows as i } from "./list/template.js";
4
+ function P(r, p, o = {}) {
5
+ if (p === "list")
6
+ return i(r, o.composition);
7
+ const { productsPerRow: t = s, composition: e } = o;
8
+ return c(r, t, e);
9
9
  }
10
10
  export {
11
- a as prepareProductRows
11
+ P as prepareProductRows
12
12
  };