@useinsider/guido 3.1.1-beta.f3b45b9 → 3.1.1-beta.f9482a3

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 (43) hide show
  1. package/dist/@types/config/schemas.js +61 -69
  2. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +7 -7
  3. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue2.js +20 -12
  4. package/dist/composables/useHtmlCompiler.js +20 -20
  5. package/dist/composables/usePreviewMode.js +16 -20
  6. package/dist/composables/useSave.js +13 -15
  7. package/dist/config/compiler/recommendationCompilerRules.js +152 -44
  8. package/dist/config/compiler/utils/recommendationCompilerUtils.js +59 -58
  9. package/dist/config/migrator/checkboxMigrator.js +3 -5
  10. package/dist/config/migrator/radioButtonMigrator.js +12 -14
  11. package/dist/extensions/Blocks/Recommendation/block.js +1 -1
  12. package/dist/extensions/Blocks/Recommendation/constants/selectors.js +11 -27
  13. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +172 -185
  14. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +93 -95
  15. package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +73 -75
  16. package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +5 -7
  17. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +29 -30
  18. package/dist/extensions/Blocks/Recommendation/templates/index.js +7 -7
  19. package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +1 -3
  20. package/dist/extensions/Blocks/Recommendation/templates/list/template.js +20 -20
  21. package/dist/extensions/Blocks/Recommendation/templates/utils.js +50 -57
  22. package/dist/extensions/Blocks/Recommendation/utils/tagName.js +6 -6
  23. package/dist/extensions/Blocks/Unsubscribe/settingsPanel.js +17 -16
  24. package/dist/guido.css +1 -1
  25. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +218 -324
  26. package/dist/package.json.js +1 -1
  27. package/dist/src/@types/config/index.d.ts +1 -1
  28. package/dist/src/@types/config/schemas.d.ts +0 -20
  29. package/dist/src/@types/config/types.d.ts +1 -3
  30. package/dist/src/composables/useConfig.d.ts +0 -8
  31. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
  32. package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +0 -5
  33. package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +0 -5
  34. package/dist/src/extensions/Blocks/Recommendation/templates/grid/template.d.ts +4 -4
  35. package/dist/src/extensions/Blocks/Recommendation/templates/list/template.d.ts +3 -3
  36. package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +3 -20
  37. package/dist/src/stores/config.d.ts +0 -72
  38. package/dist/src/stores/preview.d.ts +0 -3
  39. package/dist/src/utils/htmlCompiler.d.ts +1 -2
  40. package/dist/stores/preview.js +3 -4
  41. package/dist/utils/htmlCompiler.js +41 -48
  42. package/dist/utils/templatePreparation.js +20 -20
  43. package/package.json +3 -3
@@ -1,15 +1,15 @@
1
1
  var G = Object.defineProperty;
2
- var P = (u, s, t) => s in u ? G(u, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : u[s] = t;
3
- var C = (u, s, t) => P(u, typeof s != "symbol" ? s + "" : s, t);
4
- import { ModificationDescription as m } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
+ var P = (u, c, t) => c in u ? G(u, c, { enumerable: !0, configurable: !0, writable: !0, value: t }) : u[c] = t;
3
+ var h = (u, c, t) => P(u, typeof c != "symbol" ? c + "" : c, t);
4
+ import { ModificationDescription as g } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
5
  import { CommonControl as R } from "../../../common-control.js";
6
- import { DESKTOP_CONTAINER_SELECTOR as S, MOBILE_CONTAINER_SELECTOR as M } from "../../constants/selectors.js";
7
- import { SPACING_STEP as _, MAX_SPACING as N, MIN_SPACING as b, DEFAULT_COLUMN_SPACING as g, DEFAULT_ROW_SPACING as E } from "../../constants/layout.js";
6
+ import { DESKTOP_CONTAINER_SELECTOR as m, MOBILE_CONTAINER_SELECTOR as M } from "../../constants/selectors.js";
7
+ import { SPACING_STEP as S, MAX_SPACING as _, MIN_SPACING as N, DEFAULT_COLUMN_SPACING as C, DEFAULT_ROW_SPACING as E } from "../../constants/layout.js";
8
8
  import { RecommendationConfigService as p } from "../../services/configService.js";
9
- import { useRecommendationExtensionStore as w } from "../../store/recommendation.js";
10
- import { safeGetStyle as L, safeGetParent as V } from "../../utils/tagName.js";
11
- import { getCurrentLayout as f, getBlockElement as B } from "../main/utils.js";
12
- import { useDebounceFn as O } from "../../../../../node_modules/@vueuse/shared/index.js";
9
+ import { useRecommendationExtensionStore as V } from "../../store/recommendation.js";
10
+ import { safeGetStyle as A, safeGetParent as w } from "../../utils/tagName.js";
11
+ import { getCurrentLayout as b, getBlockElement as B } from "../main/utils.js";
12
+ import { useDebounceFn as f } from "../../../../../node_modules/@vueuse/shared/index.js";
13
13
  const U = "recommendation-spacing-control", n = {
14
14
  COLUMN_SPACING: "columnSpacing",
15
15
  COLUMN_SPACING_LABEL: "columnSpacingLabel",
@@ -19,46 +19,46 @@ const U = "recommendation-spacing-control", n = {
19
19
  MOBILE_COLUMN_SPACING_LABEL: "mobileColumnSpacingLabel",
20
20
  MOBILE_ROW_SPACING: "mobileRowSpacing",
21
21
  MOBILE_ROW_SPACING_LABEL: "mobileRowSpacingLabel"
22
- }, A = {
22
+ }, O = {
23
23
  COLUMN_SPACING: "data-column-spacing",
24
24
  ROW_SPACING: "data-row-spacing",
25
25
  MOBILE_COLUMN_SPACING: "data-mobile-column-spacing",
26
26
  MOBILE_ROW_SPACING: "data-mobile-row-spacing"
27
27
  };
28
- function I(u, s) {
28
+ function L(u, c) {
29
29
  if (!u)
30
- return s;
30
+ return c;
31
31
  const t = parseFloat(u);
32
- return Number.isNaN(t) ? s : t;
32
+ return Number.isNaN(t) ? c : t;
33
33
  }
34
34
  class j extends R {
35
35
  constructor() {
36
36
  super(...arguments);
37
- C(this, "store", w());
38
- C(this, "unsubscribeOrientation", null);
37
+ h(this, "store", V());
38
+ h(this, "unsubscribeOrientation", null);
39
39
  /**
40
40
  * Debounced version of _onColumnSpacingChange
41
41
  * Prevents excessive DOM updates when user rapidly adjusts the counter
42
42
  */
43
- C(this, "_debouncedOnColumnSpacingChange", O((t) => {
43
+ h(this, "_debouncedOnColumnSpacingChange", f((t) => {
44
44
  this._onColumnSpacingChange(t);
45
45
  }, 300));
46
46
  /**
47
47
  * Debounced version of _onRowSpacingChange
48
48
  */
49
- C(this, "_debouncedOnRowSpacingChange", O((t) => {
49
+ h(this, "_debouncedOnRowSpacingChange", f((t) => {
50
50
  this._onRowSpacingChange(t);
51
51
  }, 300));
52
52
  /**
53
53
  * Debounced version of _onMobileColumnSpacingChange
54
54
  */
55
- C(this, "_debouncedOnMobileColumnSpacingChange", O((t) => {
55
+ h(this, "_debouncedOnMobileColumnSpacingChange", f((t) => {
56
56
  this._onMobileColumnSpacingChange(t);
57
57
  }, 300));
58
58
  /**
59
59
  * Debounced version of _onMobileRowSpacingChange
60
60
  */
61
- C(this, "_debouncedOnMobileRowSpacingChange", O((t) => {
61
+ h(this, "_debouncedOnMobileRowSpacingChange", f((t) => {
62
62
  this._onMobileRowSpacingChange(t);
63
63
  }, 300));
64
64
  }
@@ -75,9 +75,9 @@ class j extends R {
75
75
  }),
76
76
  this._GuCounter({
77
77
  name: n.COLUMN_SPACING,
78
- minValue: b,
79
- maxValue: N,
80
- step: _
78
+ minValue: N,
79
+ maxValue: _,
80
+ step: S
81
81
  }),
82
82
  this._GuLabel({
83
83
  text: this.api.translate("Row Spacing (px)"),
@@ -85,9 +85,9 @@ class j extends R {
85
85
  }),
86
86
  this._GuCounter({
87
87
  name: n.ROW_SPACING,
88
- minValue: b,
89
- maxValue: N,
90
- step: _
88
+ minValue: N,
89
+ maxValue: _,
90
+ step: S
91
91
  }),
92
92
  this._GuLabel({
93
93
  text: this.api.translate("Column Spacing on Mobile (px)"),
@@ -95,9 +95,9 @@ class j extends R {
95
95
  }),
96
96
  this._GuCounter({
97
97
  name: n.MOBILE_COLUMN_SPACING,
98
- minValue: b,
99
- maxValue: N,
100
- step: _
98
+ minValue: N,
99
+ maxValue: _,
100
+ step: S
101
101
  }),
102
102
  this._GuLabel({
103
103
  text: this.api.translate("Row Spacing on Mobile (px)"),
@@ -105,9 +105,9 @@ class j extends R {
105
105
  }),
106
106
  this._GuCounter({
107
107
  name: n.MOBILE_ROW_SPACING,
108
- minValue: b,
109
- maxValue: N,
110
- step: _
108
+ minValue: N,
109
+ maxValue: _,
110
+ step: S
111
111
  })
112
112
  ])}
113
113
  </div>
@@ -132,13 +132,13 @@ class j extends R {
132
132
  _updateSpacingVisibility() {
133
133
  if (!this.api)
134
134
  return;
135
- const t = p.getConfig(this.currentNode), e = this.store.recommendationConfigs.orientation, i = (t.layout || e || f(this.currentNode)) === "grid", { mobileLayoutEnabled: a } = t, r = t.cardsInRow > 1, c = t.mobileCardsInRow > 1;
135
+ const t = p.getConfig(this.currentNode), e = this.store.recommendationConfigs.orientation, i = (t.layout || e || b(this.currentNode)) === "grid", { mobileLayoutEnabled: a } = t, r = t.cardsInRow > 1, l = t.mobileCardsInRow > 1;
136
136
  this.api.setVisibility(n.COLUMN_SPACING, i && r), this.api.setVisibility(n.COLUMN_SPACING_LABEL, i && r), this.api.setVisibility(n.ROW_SPACING, !0), this.api.setVisibility(n.ROW_SPACING_LABEL, !0), this.api.setVisibility(
137
137
  n.MOBILE_COLUMN_SPACING,
138
- i && a && c
138
+ i && a && l
139
139
  ), this.api.setVisibility(
140
140
  n.MOBILE_COLUMN_SPACING_LABEL,
141
- i && a && c
141
+ i && a && l
142
142
  ), this.api.setVisibility(n.MOBILE_ROW_SPACING, i && a), this.api.setVisibility(n.MOBILE_ROW_SPACING_LABEL, i && a);
143
143
  }
144
144
  /**
@@ -165,20 +165,20 @@ class j extends R {
165
165
  */
166
166
  _getStoredColumnSpacing() {
167
167
  if (!this.currentNode)
168
- return g;
169
- const t = this.currentNode.querySelector(S) ?? this.currentNode;
170
- if (f(this.currentNode) === "grid") {
171
- const h = t.querySelector(".recommendation-attribute-row"), l = (h == null ? void 0 : h.querySelector("td")) ?? null, d = L(l, "padding");
172
- if (!d)
173
- return g;
174
- const y = d.trim().split(/\s+/);
175
- return y.length < 2 ? g : I(y[1], g / 2) * 2;
168
+ return C;
169
+ const t = this.currentNode.querySelector(m) ?? this.currentNode;
170
+ if (b(this.currentNode) === "grid") {
171
+ const d = t.querySelector(".recommendation-attribute-row"), s = d == null ? void 0 : d.querySelector("td"), I = A(s, "padding");
172
+ if (!I)
173
+ return C;
174
+ const y = I.trim().split(/\s+/);
175
+ return y.length < 2 ? C : L(y[1], C / 2) * 2;
176
176
  }
177
- const o = t.querySelector(".product-card-wrapper") ?? null, i = V(o), a = L(i, "padding");
177
+ const o = t.querySelector(".product-card-wrapper"), i = w(o), a = A(i, "padding");
178
178
  if (!a)
179
- return g;
179
+ return C;
180
180
  const r = a.trim().split(/\s+/);
181
- return r.length < 2 ? g : I(r[1], g / 2) * 2;
181
+ return r.length < 2 ? C : L(r[1], C / 2) * 2;
182
182
  }
183
183
  /**
184
184
  * Gets stored row spacing from the first spacer element's height style
@@ -187,8 +187,8 @@ class j extends R {
187
187
  _getStoredRowSpacing() {
188
188
  if (!this.currentNode)
189
189
  return E;
190
- const e = (this.currentNode.querySelector(S) ?? this.currentNode).querySelector(".spacer") ?? null, o = L(e, "height");
191
- return I(o, E);
190
+ const e = (this.currentNode.querySelector(m) ?? this.currentNode).querySelector(".spacer"), o = A(e, "height");
191
+ return L(o, E);
192
192
  }
193
193
  // ========================================================================
194
194
  // Desktop Spacing Handlers
@@ -205,18 +205,17 @@ class j extends R {
205
205
  this.currentNode,
206
206
  { columnSpacing: t },
207
207
  `Changed column spacing to ${t}px`
208
- ), this._storeDataAttribute(A.COLUMN_SPACING, t);
209
- const o = p.getConfig(this.currentNode).layout || f(this.currentNode), i = this.api.getDocumentModifier(), r = `0 ${t / 2}px`, c = this.currentNode.querySelector(S);
210
- c && (o === "grid" ? Array.from(
211
- c.querySelectorAll(".attribute-cell")
212
- ).forEach((l) => {
213
- i.modifyHtml(l).setStyle("padding", r);
208
+ ), this._storeDataAttribute(O.COLUMN_SPACING, t);
209
+ const o = p.getConfig(this.currentNode).layout || b(this.currentNode), i = this.api.getDocumentModifier(), r = `0 ${t / 2}px`, l = this.currentNode.querySelector(m);
210
+ l && (o === "grid" ? Array.from(
211
+ l.querySelectorAll(".attribute-cell")
212
+ ).forEach((s) => {
213
+ i.modifyHtml(s).setStyle("padding", r);
214
214
  }) : Array.from(
215
- c.querySelectorAll(".product-card-wrapper")
216
- ).forEach((l) => {
217
- const d = "parent" in l ? l.parent() : void 0;
218
- d && i.modifyHtml(d).setStyle("padding", r);
219
- }), i.apply(new m(`Update column spacing to ${t}px`)));
215
+ l.querySelectorAll(".product-card-wrapper")
216
+ ).forEach((s) => {
217
+ "parent" in s && s.parent() && i.modifyHtml(s.parent()).setStyle("padding", r);
218
+ }), i.apply(new g(`Update column spacing to ${t}px`)));
220
219
  }
221
220
  /**
222
221
  * Handles row spacing changes for desktop.
@@ -230,8 +229,8 @@ class j extends R {
230
229
  this.currentNode,
231
230
  { rowSpacing: t },
232
231
  `Changed row spacing to ${t}px`
233
- ), this._storeDataAttribute(A.ROW_SPACING, t);
234
- const e = this.currentNode.querySelector(S);
232
+ ), this._storeDataAttribute(O.ROW_SPACING, t);
233
+ const e = this.currentNode.querySelector(m);
235
234
  if (!e)
236
235
  return;
237
236
  const o = Array.from(
@@ -242,7 +241,7 @@ class j extends R {
242
241
  const i = this.api.getDocumentModifier(), a = `${t}px`;
243
242
  o.forEach((r) => {
244
243
  i.modifyHtml(r).setStyle("height", a);
245
- }), i.apply(new m(`Update row spacing to ${t}px`));
244
+ }), i.apply(new g(`Update row spacing to ${t}px`));
246
245
  }
247
246
  // ========================================================================
248
247
  // Mobile Spacing Handlers
@@ -259,18 +258,17 @@ class j extends R {
259
258
  this.currentNode,
260
259
  { mobileColumnSpacing: t },
261
260
  `Changed mobile column spacing to ${t}px`
262
- ), this._storeDataAttribute(A.MOBILE_COLUMN_SPACING, t);
263
- const o = p.getConfig(this.currentNode).layout || f(this.currentNode), i = this.api.getDocumentModifier(), r = `0 ${t / 2}px`, c = this.currentNode.querySelector(M);
264
- c && (o === "grid" ? Array.from(
265
- c.querySelectorAll(".attribute-cell")
266
- ).forEach((l) => {
267
- i.modifyHtml(l).setStyle("padding", r);
261
+ ), this._storeDataAttribute(O.MOBILE_COLUMN_SPACING, t);
262
+ const o = p.getConfig(this.currentNode).layout || b(this.currentNode), i = this.api.getDocumentModifier(), r = `0 ${t / 2}px`, l = this.currentNode.querySelector(M);
263
+ l && (o === "grid" ? Array.from(
264
+ l.querySelectorAll(".attribute-cell")
265
+ ).forEach((s) => {
266
+ i.modifyHtml(s).setStyle("padding", r);
268
267
  }) : Array.from(
269
- c.querySelectorAll(".product-card-wrapper")
270
- ).forEach((l) => {
271
- const d = "parent" in l ? l.parent() : void 0;
272
- d && i.modifyHtml(d).setStyle("padding", r);
273
- }), i.apply(new m(`Update mobile column spacing to ${t}px`)));
268
+ l.querySelectorAll(".product-card-wrapper")
269
+ ).forEach((s) => {
270
+ "parent" in s && s.parent() && i.modifyHtml(s.parent()).setStyle("padding", r);
271
+ }), i.apply(new g(`Update mobile column spacing to ${t}px`)));
274
272
  }
275
273
  /**
276
274
  * Handles row spacing changes for mobile.
@@ -284,7 +282,7 @@ class j extends R {
284
282
  this.currentNode,
285
283
  { mobileRowSpacing: t },
286
284
  `Changed mobile row spacing to ${t}px`
287
- ), this._storeDataAttribute(A.MOBILE_ROW_SPACING, t);
285
+ ), this._storeDataAttribute(O.MOBILE_ROW_SPACING, t);
288
286
  const e = this.currentNode.querySelector(M);
289
287
  if (!e)
290
288
  return;
@@ -296,7 +294,7 @@ class j extends R {
296
294
  const i = this.api.getDocumentModifier(), a = `${t}px`;
297
295
  o.forEach((r) => {
298
296
  i.modifyHtml(r).setStyle("height", a);
299
- }), i.apply(new m(`Update mobile row spacing to ${t}px`));
297
+ }), i.apply(new g(`Update mobile row spacing to ${t}px`));
300
298
  }
301
299
  // ========================================================================
302
300
  // Data Attribute Storage
@@ -306,7 +304,7 @@ class j extends R {
306
304
  */
307
305
  _storeDataAttribute(t, e) {
308
306
  const o = B(this.currentNode);
309
- o && this.api.getDocumentModifier().modifyHtml(o).setAttribute(t, e.toString()).apply(new m(`Store ${t}`));
307
+ o && this.api.getDocumentModifier().modifyHtml(o).setAttribute(t, e.toString()).apply(new g(`Store ${t}`));
310
308
  }
311
309
  // ========================================================================
312
310
  // Event Listeners
@@ -1,11 +1,11 @@
1
1
  import { RecommendationBlockId as s } from "../../constants/blockIds.js";
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 x } from "../../constants/selectors.js";
3
- import { useRecommendationExtensionStore as _ } from "../../store/recommendation.js";
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
4
  import { formatPrice as $ } from "../../utils/priceFormatter.js";
5
5
  import { sanitizeImageUrl as C, CUSTOM_CELL_HTML as R } from "../utils.js";
6
6
  const a = "0 5px", l = "attribute-cell";
7
7
  function p() {
8
- const 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,
@@ -23,7 +23,7 @@ function r(t, e = "price") {
23
23
  });
24
24
  }
25
25
  const I = {
26
- [x]: (t) => `
26
+ [_]: (t) => `
27
27
  <td class="${l}" style="padding: ${a}; height: 100%;" valign="top">
28
28
  <table
29
29
  class="product-card-segment"
@@ -224,8 +224,6 @@ const I = {
224
224
  * Custom attribute cell template — same structure as built-in entries
225
225
  * (outer td → inner product-card-segment table).
226
226
  * Used by `buildElementRenderer` for `customAttr:*` composition entries.
227
- * @param productAttrValue - Resolved product-attr value (e.g., "brand" for default, "product_attribute.rating_star" for custom)
228
- * @param content - Display content for the cell
229
227
  */
230
228
  [R]: (t, e) => `
231
229
  <td class="${l}" style="padding: ${a}; height: 100%;" valign="middle">
@@ -240,7 +238,7 @@ const I = {
240
238
  <tbody>
241
239
  <tr valign="top">
242
240
  <td
243
- ${g}="${t}"
241
+ ${g}="product_attribute.${t}"
244
242
  class="esd-block-text product-custom-attribute es-p0t es-p0b es-p15l es-p15r"
245
243
  align="center"
246
244
  esd-extension-block-id="${s.CUSTOM_ATTRIBUTE}">
@@ -1,7 +1,7 @@
1
- import { DEFAULT_PRODUCTS_PER_ROW as L } from "../../constants/layout.js";
2
- import { DEFAULT_CARD_COMPOSITION as E, spacer as I, getDefaultProducts as _, createBlockTemplate as S, DEFAULTS as b, buildElementRenderer as A, DEFAULT_CARD_VISIBILITY as f } from "../utils.js";
3
- import { gridElementRenderer as w, ATTRIBUTE_CELL_CLASS as D, DEFAULT_CELL_PADDING as C } from "./elementRenderer.js";
4
- const O = `
1
+ import { DEFAULT_PRODUCTS_PER_ROW as m } from "../../constants/layout.js";
2
+ import { DEFAULT_CARD_COMPOSITION as L, spacer as E, getDefaultProducts as I, createBlockTemplate as _, DEFAULTS as S, buildElementRenderer as b, DEFAULT_CARD_VISIBILITY as A } from "../utils.js";
3
+ import { gridElementRenderer as f, ATTRIBUTE_CELL_CLASS as w, DEFAULT_CELL_PADDING as D } from "./elementRenderer.js";
4
+ const C = `
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
- `, g = `
21
+ `, O = `
22
22
  <tr
23
23
  class="recommendation-attribute-row"
24
24
  data-attribute-type="{-{-ATTR_TYPE-}-}"
@@ -27,38 +27,37 @@ const O = `
27
27
  {-{-CELLS-}-}
28
28
  </tr>
29
29
  `;
30
- function P(t, e, o, r = E, n = {}) {
31
- const c = (100 / e).toFixed(2), i = e - t.length, l = `<td class="${D}" style="padding: ${C};" width="${c}%"></td>`, d = i > 0 ? l.repeat(i) : "", a = A(o, r, n);
32
- return r.filter((s) => a[s]).map((s) => {
33
- const T = f[s] ?? !0, u = T ? "" : 'style="display: none;"', R = t.map((m) => a[s](m).replace("<td", `<td width="${c}%"`)).join("");
34
- return g.replace("{-{-ATTR_TYPE-}-}", s).replace("{-{-VISIBILITY-}-}", T ? "1" : "0").replace("{-{-DISPLAY_STYLE-}-}", u).replace("{-{-CELLS-}-}", R + d);
30
+ function g(t, e, l, n = L) {
31
+ const o = (100 / e).toFixed(2), a = e - t.length, r = `<td class="${w}" style="padding: ${D};" width="${o}%"></td>`, i = a > 0 ? r.repeat(a) : "", s = b(l, n);
32
+ return n.filter((c) => s[c]).map((c) => {
33
+ const p = A[c] ?? !0, T = p ? "" : 'style="display: none;"', u = t.map((R) => s[c](R).replace("<td", `<td width="${o}%"`)).join("");
34
+ return O.replace("{-{-ATTR_TYPE-}-}", c).replace("{-{-VISIBILITY-}-}", p ? "1" : "0").replace("{-{-DISPLAY_STYLE-}-}", T).replace("{-{-CELLS-}-}", u + i);
35
35
  }).join("");
36
36
  }
37
- function U(t, e, o, r, n = {}) {
38
- const c = [];
39
- for (let l = 0; l < t.length; l += e)
40
- c.push(t.slice(l, l + e));
41
- return c.map((l, d) => {
42
- const a = P(
43
- l,
44
- e,
45
- o,
37
+ function P(t, e, l, n) {
38
+ const o = [];
39
+ for (let r = 0; r < t.length; r += e)
40
+ o.push(t.slice(r, r + e));
41
+ return o.map((r, i) => {
42
+ const s = g(
46
43
  r,
44
+ e,
45
+ l,
47
46
  n
48
- ), p = O.replace("{-{-ATTRIBUTE_ROWS-}-}", a);
49
- return d > 0 ? I + p : p;
47
+ ), d = C.replace("{-{-ATTRIBUTE_ROWS-}-}", s);
48
+ return i > 0 ? E + d : d;
50
49
  }).join("");
51
50
  }
52
- function h(t, e, o, r = {}) {
53
- return U(t, e, w, o, r);
51
+ function U(t, e, l) {
52
+ return P(t, e, f, l);
54
53
  }
55
- function F(t) {
56
- const e = t ? `ins-recommendation-v3-block-${t}` : void 0, o = S("grid", e), r = _(), n = h(r, L);
57
- return o.replace("{-{-TITLE-}-}", b.TITLE).replace("{-{-PRODUCT_ROWS-}-}", n).replace("{-{-MOBILE_PRODUCT_ROWS-}-}", "");
54
+ function W(t) {
55
+ const e = t ? `ins-recommendation-v3-block-${t}` : void 0, l = _("grid", e), n = I(), o = U(n, m);
56
+ return l.replace("{-{-TITLE-}-}", S.TITLE).replace("{-{-PRODUCT_ROWS-}-}", o).replace("{-{-MOBILE_PRODUCT_ROWS-}-}", "");
58
57
  }
59
58
  export {
60
- F as getDefaultTemplate,
61
- P as prepareGridAttributeRows,
62
- U as prepareGridProductRows,
63
- h as prepareProductRows
59
+ W as getDefaultTemplate,
60
+ g as prepareGridAttributeRows,
61
+ P as prepareGridProductRows,
62
+ U as prepareProductRows
64
63
  };
@@ -1,12 +1,12 @@
1
1
  import { DEFAULT_PRODUCTS_PER_ROW as s } from "../constants/layout.js";
2
2
  import { prepareProductRows as c } from "./grid/template.js";
3
- import { prepareProductRows as R } from "./list/template.js";
4
- function a(o, t, r = {}) {
5
- if (t === "list")
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);
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
  };
@@ -166,13 +166,11 @@ const I = {
166
166
  /**
167
167
  * Custom attribute row template — same tr-td structure as Name, Price, etc.
168
168
  * Used by `buildElementRenderer` for `customAttr:*` composition entries.
169
- * @param productAttrValue - Resolved product-attr value (e.g., "brand" for default, "product_attribute.rating_star" for custom)
170
- * @param content - Display content for the cell
171
169
  */
172
170
  [y]: (t, e) => `
173
171
  <tr>
174
172
  <td
175
- ${u}="${t}"
173
+ ${u}="product_attribute.${t}"
176
174
  class="esd-block-text product-custom-attribute"
177
175
  esd-extension-block-id="${o.CUSTOM_ATTRIBUTE}"
178
176
  align="left">
@@ -1,14 +1,14 @@
1
- import { ATTR_PRODUCT_IMAGE as d, ATTR_PRODUCT_BUTTON as a } from "../../constants/selectors.js";
2
- import { DEFAULT_CARD_COMPOSITION as m, spacer as C, buildElementRenderer as b, DEFAULT_CARD_VISIBILITY as T } from "../utils.js";
3
- import { listElementRenderer as R } from "./elementRenderer.js";
4
- function f(r, n, l) {
5
- const t = l ? "" : ' style="display: none;"', o = r.replace(/<tr>/, "").replace(/<\/tr>/, "");
1
+ import { ATTR_PRODUCT_IMAGE as i, ATTR_PRODUCT_BUTTON as d } from "../../constants/selectors.js";
2
+ import { DEFAULT_CARD_COMPOSITION as u, spacer as m, buildElementRenderer as C, DEFAULT_CARD_VISIBILITY as b } from "../utils.js";
3
+ import { listElementRenderer as T } from "./elementRenderer.js";
4
+ function R(r, n, t) {
5
+ const l = t ? "" : ' style="display: none;"', o = r.replace(/<tr>/, "").replace(/<\/tr>/, "");
6
6
  return `<tr
7
7
  class="recommendation-attribute-row"
8
8
  data-attribute-type="${n}"
9
- data-visibility="${l ? "1" : "0"}"${t}>${o}</tr>`;
9
+ data-visibility="${t ? "1" : "0"}"${l}>${o}</tr>`;
10
10
  }
11
- const y = `
11
+ const f = `
12
12
  <tr class="recommendation-product-row">
13
13
  <td style="padding: 0 5px;">
14
14
  <table
@@ -26,29 +26,29 @@ const y = `
26
26
  </td>
27
27
  </tr>
28
28
  `;
29
- function O(r, n = m, l = {}) {
30
- const t = b(R, n, l), o = t[d](r), c = `
29
+ function y(r, n = u) {
30
+ const t = C(T, n), l = t[i](r), a = `
31
31
  <td class="product-info-cell" valign="middle" style="padding: 15px;">
32
32
  <table cellpadding="0" cellspacing="0" role="presentation" width="100%">
33
33
  <tbody>
34
- ${n.filter((e) => e !== d && e !== a).filter((e) => t[e]).map((e) => {
35
- const u = T[e] ?? !0;
36
- return f(t[e](r), e, u);
34
+ ${n.filter((e) => e !== i && e !== d).filter((e) => t[e]).map((e) => {
35
+ const p = b[e] ?? !0;
36
+ return R(t[e](r), e, p);
37
37
  }).join(`
38
38
  `)}
39
39
  </tbody>
40
40
  </table>
41
41
  </td>
42
- `, s = t[a](r), p = o + c + s;
43
- return y.replace("{-{-PRODUCT_CONTENT-}-}", p);
42
+ `, c = t[d](r), s = l + a + c;
43
+ return f.replace("{-{-PRODUCT_CONTENT-}-}", s);
44
44
  }
45
- function D(r, n, l = {}) {
46
- return r.map((t, o) => {
47
- const i = O(t, n, l);
48
- return o > 0 ? C + i : i;
45
+ function w(r, n) {
46
+ return r.map((t, l) => {
47
+ const o = y(t, n);
48
+ return l > 0 ? m + o : o;
49
49
  }).join("");
50
50
  }
51
51
  export {
52
- O as getListProductCard,
53
- D as prepareProductRows
52
+ y as getListProductCard,
53
+ w as prepareProductRows
54
54
  };