@useinsider/guido 3.15.0 → 3.16.0-beta.0faee0c

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 (81) hide show
  1. package/dist/@types/config/schemas.js +108 -92
  2. package/dist/components/Guido.vue.js +1 -1
  3. package/dist/components/Guido.vue2.js +78 -75
  4. package/dist/composables/useActionsApi.js +30 -22
  5. package/dist/composables/useEmailTemplateApplier.js +25 -23
  6. package/dist/composables/useHtmlValidator.js +108 -106
  7. package/dist/composables/useStripo.js +30 -29
  8. package/dist/composables/useTimerClone.js +21 -19
  9. package/dist/config/i18n/en/labels.json.js +7 -3
  10. package/dist/config/migrator/checkboxMigrator.js +20 -19
  11. package/dist/config/migrator/radioButtonMigrator.js +26 -25
  12. package/dist/config/migrator/recommendation/compositionMapper.js +26 -23
  13. package/dist/config/migrator/recommendation/htmlBuilder.js +156 -155
  14. package/dist/extensions/Blocks/Checkbox/constants/controlIds.js +4 -0
  15. package/dist/extensions/Blocks/Checkbox/constants/selectors.js +6 -0
  16. package/dist/extensions/Blocks/Checkbox/controls/blockBackground/index.js +10 -0
  17. package/dist/extensions/Blocks/Checkbox/extension.js +6 -5
  18. package/dist/extensions/Blocks/Checkbox/settingsPanel.js +15 -14
  19. package/dist/extensions/Blocks/Checkbox/template.js +10 -9
  20. package/dist/extensions/Blocks/Items/block.js +44 -42
  21. package/dist/extensions/Blocks/Items/template.js +86 -86
  22. package/dist/extensions/Blocks/RadioButton/constants/controlIds.js +4 -0
  23. package/dist/extensions/Blocks/RadioButton/constants/selectors.js +6 -0
  24. package/dist/extensions/Blocks/RadioButton/controls/blockBackground/index.js +10 -0
  25. package/dist/extensions/Blocks/RadioButton/extension.js +5 -4
  26. package/dist/extensions/Blocks/RadioButton/settingsPanel.js +12 -11
  27. package/dist/extensions/Blocks/RadioButton/template.js +16 -9
  28. package/dist/extensions/Blocks/Recommendation/constants/selectors.js +18 -15
  29. package/dist/extensions/Blocks/Recommendation/controls/cardBackground/index.js +5 -9
  30. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +363 -322
  31. package/dist/extensions/Blocks/Recommendation/controls/main/layoutOrientation.js +8 -8
  32. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +271 -231
  33. package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +98 -113
  34. package/dist/extensions/Blocks/Recommendation/recommendation.css.js +21 -0
  35. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +16 -16
  36. package/dist/extensions/Blocks/Recommendation/templates/list/template.js +16 -16
  37. package/dist/extensions/Blocks/Recommendation/templates/utils.js +120 -120
  38. package/dist/extensions/Blocks/Recommendation/utils/captureStyleTemplates.js +55 -54
  39. package/dist/extensions/Blocks/Recommendation/utils/compositionKeys.js +89 -0
  40. package/dist/extensions/Blocks/common-control.js +42 -35
  41. package/dist/extensions/Blocks/controlFactories.js +117 -115
  42. package/dist/guido.css +1 -1
  43. package/dist/library.js +11 -7
  44. package/dist/node_modules/valibot/dist/index.js +230 -216
  45. package/dist/public/trackingIds.js +8 -0
  46. package/dist/src/@types/config/schemas.d.ts +20 -0
  47. package/dist/src/composables/useActionsApi.d.ts +1 -1
  48. package/dist/src/composables/useConfig.d.ts +4 -0
  49. package/dist/src/composables/useHtmlValidator.d.ts +3 -2
  50. package/dist/src/config/migrator/recommendation/types.d.ts +1 -0
  51. package/dist/src/extensions/Blocks/Checkbox/constants/controlIds.d.ts +7 -0
  52. package/dist/src/extensions/Blocks/Checkbox/constants/index.d.ts +10 -0
  53. package/dist/src/extensions/Blocks/Checkbox/constants/selectors.d.ts +16 -0
  54. package/dist/src/extensions/Blocks/Checkbox/controls/blockBackground/index.d.ts +14 -0
  55. package/dist/src/extensions/Blocks/RadioButton/constants/controlIds.d.ts +7 -0
  56. package/dist/src/extensions/Blocks/RadioButton/constants/index.d.ts +10 -0
  57. package/dist/src/extensions/Blocks/RadioButton/constants/selectors.d.ts +16 -0
  58. package/dist/src/extensions/Blocks/RadioButton/controls/blockBackground/index.d.ts +14 -0
  59. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
  60. package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +6 -0
  61. package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +27 -5
  62. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +4 -2
  63. package/dist/src/extensions/Blocks/Recommendation/controls/spacing/index.d.ts +5 -0
  64. package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +12 -11
  65. package/dist/src/extensions/Blocks/Recommendation/utils/compositionKeys.d.ts +47 -0
  66. package/dist/src/extensions/Blocks/_Boilerplate/constants/controlIds.d.ts +7 -0
  67. package/dist/src/extensions/Blocks/_Boilerplate/constants/index.d.ts +10 -0
  68. package/dist/src/extensions/Blocks/_Boilerplate/constants/selectors.d.ts +16 -0
  69. package/dist/src/extensions/Blocks/_Boilerplate/controls/blockBackground/index.d.ts +14 -0
  70. package/dist/src/extensions/Blocks/common-control.d.ts +3 -1
  71. package/dist/src/library.d.ts +1 -0
  72. package/dist/src/public/trackingIds.d.ts +9 -0
  73. package/dist/src/stores/config.d.ts +36 -0
  74. package/dist/src/stores/editor.d.ts +25 -0
  75. package/dist/src/utils/linkTrackingIds.d.ts +30 -0
  76. package/dist/stores/editor.js +4 -1
  77. package/dist/stores/onboarding.js +11 -7
  78. package/dist/utils/linkTrackingIds.js +56 -0
  79. package/dist/utils/pairProductVariables.js +105 -99
  80. package/dist/utils/templatePreparation.js +72 -61
  81. package/package.json +5 -1
@@ -1,16 +1,16 @@
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";
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";
1
+ var y = Object.defineProperty;
2
+ var M = (u, s, t) => s in u ? y(u, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : u[s] = t;
3
+ var g = (u, s, t) => M(u, typeof s != "symbol" ? s + "" : s, t);
4
+ import { ModificationDescription as S } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
+ import { CommonControl as E } from "../../../common-control.js";
6
+ import { DESKTOP_CONTAINER_SELECTOR as m, MOBILE_CONTAINER_SELECTOR as L } from "../../constants/selectors.js";
7
+ import { SPACING_STEP as P, MAX_SPACING as G, MIN_SPACING as R, DEFAULT_COLUMN_SPACING as C, DEFAULT_ROW_SPACING as I } from "../../constants/layout.js";
8
8
  import { RecommendationConfigService as p } from "../../services/configService.js";
9
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";
13
- const U = "recommendation-spacing-control", n = {
10
+ import { safeGetStyle as f, safeGetParent as B } from "../../utils/tagName.js";
11
+ import { getCurrentLayout as _, getBlockElement as U } from "../main/utils.js";
12
+ import { useDebounceFn as N } from "../../../../../node_modules/@vueuse/shared/index.js";
13
+ const V = "recommendation-spacing-control", o = {
14
14
  COLUMN_SPACING: "columnSpacing",
15
15
  COLUMN_SPACING_LABEL: "columnSpacingLabel",
16
16
  ROW_SPACING: "rowSpacing",
@@ -19,97 +19,67 @@ 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
+ }, b = {
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 O(u, s) {
29
29
  if (!u)
30
30
  return s;
31
31
  const t = parseFloat(u);
32
32
  return Number.isNaN(t) ? s : t;
33
33
  }
34
- class j extends R {
34
+ class j extends E {
35
35
  constructor() {
36
36
  super(...arguments);
37
- C(this, "store", w());
38
- C(this, "unsubscribeOrientation", null);
37
+ g(this, "store", w());
38
+ g(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
+ g(this, "_debouncedOnColumnSpacingChange", N((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
+ g(this, "_debouncedOnRowSpacingChange", N((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
+ g(this, "_debouncedOnMobileColumnSpacingChange", N((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
+ g(this, "_debouncedOnMobileRowSpacingChange", N((t) => {
62
62
  this._onMobileRowSpacingChange(t);
63
63
  }, 300));
64
64
  }
65
65
  getId() {
66
- return U;
66
+ return V;
67
67
  }
68
68
  getTemplate() {
69
69
  return `
70
70
  <div class="spacing-control-container">
71
- ${this._GuTwoColumns([
72
- this._GuLabel({
73
- text: this.api.translate("Column Spacing (px)"),
74
- name: n.COLUMN_SPACING_LABEL
75
- }),
76
- this._GuCounter({
77
- name: n.COLUMN_SPACING,
78
- minValue: b,
79
- maxValue: N,
80
- step: _
81
- }),
82
- this._GuLabel({
83
- text: this.api.translate("Row Spacing (px)"),
84
- name: n.ROW_SPACING_LABEL
85
- }),
86
- this._GuCounter({
87
- name: n.ROW_SPACING,
88
- minValue: b,
89
- maxValue: N,
90
- step: _
91
- }),
92
- this._GuLabel({
93
- text: this.api.translate("Column Spacing on Mobile (px)"),
94
- name: n.MOBILE_COLUMN_SPACING_LABEL
95
- }),
96
- this._GuCounter({
97
- name: n.MOBILE_COLUMN_SPACING,
98
- minValue: b,
99
- maxValue: N,
100
- step: _
101
- }),
102
- this._GuLabel({
103
- text: this.api.translate("Row Spacing on Mobile (px)"),
104
- name: n.MOBILE_ROW_SPACING_LABEL
105
- }),
106
- this._GuCounter({
107
- name: n.MOBILE_ROW_SPACING,
108
- minValue: b,
109
- maxValue: N,
110
- step: _
111
- })
112
- ])}
71
+ ${this._spacingRow("Column Spacing (px)", o.COLUMN_SPACING_LABEL, o.COLUMN_SPACING)}
72
+ ${this._spacingRow("Row Spacing (px)", o.ROW_SPACING_LABEL, o.ROW_SPACING)}
73
+ ${this._spacingRow(
74
+ "Column Spacing on Mobile (px)",
75
+ o.MOBILE_COLUMN_SPACING_LABEL,
76
+ o.MOBILE_COLUMN_SPACING
77
+ )}
78
+ ${this._spacingRow(
79
+ "Row Spacing on Mobile (px)",
80
+ o.MOBILE_ROW_SPACING_LABEL,
81
+ o.MOBILE_ROW_SPACING
82
+ )}
113
83
  </div>
114
84
  `;
115
85
  }
@@ -122,6 +92,21 @@ class j extends R {
122
92
  onDestroy() {
123
93
  this.unsubscribeOrientation && (this.unsubscribeOrientation(), this.unsubscribeOrientation = null);
124
94
  }
95
+ /**
96
+ * One label + counter per two-column row, so every spacing field gets the same
97
+ * 16px-padded row the color controls already render instead of sharing one grid.
98
+ */
99
+ _spacingRow(t, e, n) {
100
+ return this._GuTwoColumns([
101
+ this._GuLabel({ text: this.api.translate(t), name: e }),
102
+ this._GuCounter({
103
+ name: n,
104
+ minValue: R,
105
+ maxValue: G,
106
+ step: P
107
+ })
108
+ ]);
109
+ }
125
110
  /**
126
111
  * Updates spacing control visibility based on layout orientation and mobileLayoutEnabled.
127
112
  * - List layout: hide column spacing (products are full-width), hide ALL mobile
@@ -132,14 +117,14 @@ class j extends R {
132
117
  _updateSpacingVisibility() {
133
118
  if (!this.api)
134
119
  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;
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
- n.MOBILE_COLUMN_SPACING,
120
+ const t = p.getConfig(this.currentNode), e = this.store.recommendationConfigs.orientation, i = (t.layout || e || _(this.currentNode)) === "grid", { mobileLayoutEnabled: a } = t, r = t.cardsInRow > 1, c = t.mobileCardsInRow > 1;
121
+ this.api.setVisibility(o.COLUMN_SPACING, i && r), this.api.setVisibility(o.COLUMN_SPACING_LABEL, i && r), this.api.setVisibility(o.ROW_SPACING, !0), this.api.setVisibility(o.ROW_SPACING_LABEL, !0), this.api.setVisibility(
122
+ o.MOBILE_COLUMN_SPACING,
138
123
  i && a && c
139
124
  ), this.api.setVisibility(
140
- n.MOBILE_COLUMN_SPACING_LABEL,
125
+ o.MOBILE_COLUMN_SPACING_LABEL,
141
126
  i && a && c
142
- ), this.api.setVisibility(n.MOBILE_ROW_SPACING, i && a), this.api.setVisibility(n.MOBILE_ROW_SPACING_LABEL, i && a);
127
+ ), this.api.setVisibility(o.MOBILE_ROW_SPACING, i && a), this.api.setVisibility(o.MOBILE_ROW_SPACING_LABEL, i && a);
143
128
  }
144
129
  /**
145
130
  * Reads spacing values from node config first, falls back to DOM styles.
@@ -148,12 +133,12 @@ class j extends R {
148
133
  _setFormValues() {
149
134
  if (!this.api)
150
135
  return;
151
- const t = p.hasConfig(this.currentNode), e = p.getConfig(this.currentNode), o = t ? e.columnSpacing : this._getStoredColumnSpacing(), i = t ? e.rowSpacing : this._getStoredRowSpacing();
136
+ const t = p.hasConfig(this.currentNode), e = p.getConfig(this.currentNode), n = t ? e.columnSpacing : this._getStoredColumnSpacing(), i = t ? e.rowSpacing : this._getStoredRowSpacing();
152
137
  this.api.updateValues({
153
- [n.COLUMN_SPACING]: o,
154
- [n.ROW_SPACING]: i,
155
- [n.MOBILE_COLUMN_SPACING]: e.mobileColumnSpacing,
156
- [n.MOBILE_ROW_SPACING]: e.mobileRowSpacing
138
+ [o.COLUMN_SPACING]: n,
139
+ [o.ROW_SPACING]: i,
140
+ [o.MOBILE_COLUMN_SPACING]: e.mobileColumnSpacing,
141
+ [o.MOBILE_ROW_SPACING]: e.mobileRowSpacing
157
142
  });
158
143
  }
159
144
  /**
@@ -165,20 +150,20 @@ class j extends R {
165
150
  */
166
151
  _getStoredColumnSpacing() {
167
152
  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");
153
+ return C;
154
+ const t = this.currentNode.querySelector(m) ?? this.currentNode;
155
+ if (_(this.currentNode) === "grid") {
156
+ const h = t.querySelector(".recommendation-attribute-row"), l = (h == null ? void 0 : h.querySelector("td")) ?? null, d = f(l, "padding");
172
157
  if (!d)
173
- return g;
174
- const y = d.trim().split(/\s+/);
175
- return y.length < 2 ? g : I(y[1], g / 2) * 2;
158
+ return C;
159
+ const A = d.trim().split(/\s+/);
160
+ return A.length < 2 ? C : O(A[1], C / 2) * 2;
176
161
  }
177
- const o = t.querySelector(".product-card-wrapper") ?? null, i = V(o), a = L(i, "padding");
162
+ const n = t.querySelector(".product-card-wrapper") ?? null, i = B(n), a = f(i, "padding");
178
163
  if (!a)
179
- return g;
164
+ return C;
180
165
  const r = a.trim().split(/\s+/);
181
- return r.length < 2 ? g : I(r[1], g / 2) * 2;
166
+ return r.length < 2 ? C : O(r[1], C / 2) * 2;
182
167
  }
183
168
  /**
184
169
  * Gets stored row spacing from the first spacer element's height style
@@ -186,9 +171,9 @@ class j extends R {
186
171
  */
187
172
  _getStoredRowSpacing() {
188
173
  if (!this.currentNode)
189
- return E;
190
- const e = (this.currentNode.querySelector(S) ?? this.currentNode).querySelector(".spacer") ?? null, o = L(e, "height");
191
- return I(o, E);
174
+ return I;
175
+ const e = (this.currentNode.querySelector(m) ?? this.currentNode).querySelector(".spacer") ?? null, n = f(e, "height");
176
+ return O(n, I);
192
177
  }
193
178
  // ========================================================================
194
179
  // Desktop Spacing Handlers
@@ -205,9 +190,9 @@ class j extends R {
205
190
  this.currentNode,
206
191
  { columnSpacing: t },
207
192
  `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(
193
+ ), this._storeDataAttribute(b.COLUMN_SPACING, t);
194
+ const n = p.getConfig(this.currentNode).layout || _(this.currentNode), i = this.api.getDocumentModifier(), r = `0 ${t / 2}px`, c = this.currentNode.querySelector(m);
195
+ c && (n === "grid" ? Array.from(
211
196
  c.querySelectorAll(".attribute-cell")
212
197
  ).forEach((l) => {
213
198
  i.modifyHtml(l).setStyle("padding", r);
@@ -216,7 +201,7 @@ class j extends R {
216
201
  ).forEach((l) => {
217
202
  const d = "parent" in l ? l.parent() : void 0;
218
203
  d && i.modifyHtml(d).setStyle("padding", r);
219
- }), i.apply(new m(`Update column spacing to ${t}px`)));
204
+ }), i.apply(new S(`Update column spacing to ${t}px`)));
220
205
  }
221
206
  /**
222
207
  * Handles row spacing changes for desktop.
@@ -230,19 +215,19 @@ class j extends R {
230
215
  this.currentNode,
231
216
  { rowSpacing: t },
232
217
  `Changed row spacing to ${t}px`
233
- ), this._storeDataAttribute(A.ROW_SPACING, t);
234
- const e = this.currentNode.querySelector(S);
218
+ ), this._storeDataAttribute(b.ROW_SPACING, t);
219
+ const e = this.currentNode.querySelector(m);
235
220
  if (!e)
236
221
  return;
237
- const o = Array.from(
222
+ const n = Array.from(
238
223
  e.querySelectorAll(".spacer")
239
224
  );
240
- if (!o.length)
225
+ if (!n.length)
241
226
  return;
242
227
  const i = this.api.getDocumentModifier(), a = `${t}px`;
243
- o.forEach((r) => {
228
+ n.forEach((r) => {
244
229
  i.modifyHtml(r).setStyle("height", a);
245
- }), i.apply(new m(`Update row spacing to ${t}px`));
230
+ }), i.apply(new S(`Update row spacing to ${t}px`));
246
231
  }
247
232
  // ========================================================================
248
233
  // Mobile Spacing Handlers
@@ -259,9 +244,9 @@ class j extends R {
259
244
  this.currentNode,
260
245
  { mobileColumnSpacing: t },
261
246
  `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(
247
+ ), this._storeDataAttribute(b.MOBILE_COLUMN_SPACING, t);
248
+ const n = p.getConfig(this.currentNode).layout || _(this.currentNode), i = this.api.getDocumentModifier(), r = `0 ${t / 2}px`, c = this.currentNode.querySelector(L);
249
+ c && (n === "grid" ? Array.from(
265
250
  c.querySelectorAll(".attribute-cell")
266
251
  ).forEach((l) => {
267
252
  i.modifyHtml(l).setStyle("padding", r);
@@ -270,7 +255,7 @@ class j extends R {
270
255
  ).forEach((l) => {
271
256
  const d = "parent" in l ? l.parent() : void 0;
272
257
  d && i.modifyHtml(d).setStyle("padding", r);
273
- }), i.apply(new m(`Update mobile column spacing to ${t}px`)));
258
+ }), i.apply(new S(`Update mobile column spacing to ${t}px`)));
274
259
  }
275
260
  /**
276
261
  * Handles row spacing changes for mobile.
@@ -284,19 +269,19 @@ class j extends R {
284
269
  this.currentNode,
285
270
  { mobileRowSpacing: t },
286
271
  `Changed mobile row spacing to ${t}px`
287
- ), this._storeDataAttribute(A.MOBILE_ROW_SPACING, t);
288
- const e = this.currentNode.querySelector(M);
272
+ ), this._storeDataAttribute(b.MOBILE_ROW_SPACING, t);
273
+ const e = this.currentNode.querySelector(L);
289
274
  if (!e)
290
275
  return;
291
- const o = Array.from(
276
+ const n = Array.from(
292
277
  e.querySelectorAll(".spacer")
293
278
  );
294
- if (!o.length)
279
+ if (!n.length)
295
280
  return;
296
281
  const i = this.api.getDocumentModifier(), a = `${t}px`;
297
- o.forEach((r) => {
282
+ n.forEach((r) => {
298
283
  i.modifyHtml(r).setStyle("height", a);
299
- }), i.apply(new m(`Update mobile row spacing to ${t}px`));
284
+ }), i.apply(new S(`Update mobile row spacing to ${t}px`));
300
285
  }
301
286
  // ========================================================================
302
287
  // Data Attribute Storage
@@ -305,23 +290,23 @@ class j extends R {
305
290
  * Stores a spacing value as a data attribute on the block root element
306
291
  */
307
292
  _storeDataAttribute(t, e) {
308
- const o = B(this.currentNode);
309
- o && this.api.getDocumentModifier().modifyHtml(o).setAttribute(t, e.toString()).apply(new m(`Store ${t}`));
293
+ const n = U(this.currentNode);
294
+ n && this.api.getDocumentModifier().modifyHtml(n).setAttribute(t, e.toString()).apply(new S(`Store ${t}`));
310
295
  }
311
296
  // ========================================================================
312
297
  // Event Listeners
313
298
  // ========================================================================
314
299
  _listenToFormUpdates() {
315
- this.api.onValueChanged(n.COLUMN_SPACING, (t) => {
300
+ this.api.onValueChanged(o.COLUMN_SPACING, (t) => {
316
301
  const e = parseInt(t);
317
302
  Number.isNaN(e) || this._debouncedOnColumnSpacingChange(e);
318
- }), this.api.onValueChanged(n.ROW_SPACING, (t) => {
303
+ }), this.api.onValueChanged(o.ROW_SPACING, (t) => {
319
304
  const e = parseInt(t);
320
305
  Number.isNaN(e) || this._debouncedOnRowSpacingChange(e);
321
- }), this.api.onValueChanged(n.MOBILE_COLUMN_SPACING, (t) => {
306
+ }), this.api.onValueChanged(o.MOBILE_COLUMN_SPACING, (t) => {
322
307
  const e = parseInt(t);
323
308
  Number.isNaN(e) || this._debouncedOnMobileColumnSpacingChange(e);
324
- }), this.api.onValueChanged(n.MOBILE_ROW_SPACING, (t) => {
309
+ }), this.api.onValueChanged(o.MOBILE_ROW_SPACING, (t) => {
325
310
  const e = parseInt(t);
326
311
  Number.isNaN(e) || this._debouncedOnMobileRowSpacingChange(e);
327
312
  });
@@ -337,6 +322,6 @@ class j extends R {
337
322
  }
338
323
  }
339
324
  export {
340
- U as SPACING_CONTROL_ID,
325
+ V as SPACING_CONTROL_ID,
341
326
  j as SpacingControl
342
327
  };
@@ -25,6 +25,27 @@ const n = `/* Utils */
25
25
  border-top: none;
26
26
  }
27
27
 
28
+ /* The editor's row-separator rule only reaches \`.container\`s that are direct
29
+ children of \`.container-wrapper\`; the spacing rows sit one level deeper, so the
30
+ first one loses its line. Restore it with the editor's own border token. */
31
+ .spacing-control-container > .container {
32
+ border-top: var(--ue-border-width-1, 1px) solid var(--ue-panels-border-color, rgba(0, 0, 0, 0.07));
33
+ }
34
+
35
+ /* A spacing field that doesn't apply (mobile rows, column spacing in list layout) is
36
+ removed from its row and leaves the wrapper behind — collapse it so it can't
37
+ render as an empty separator-topped strip. */
38
+ .spacing-control-container > .container:not(:has(ue-counter)) {
39
+ display: none;
40
+ }
41
+
42
+ /* The block background row stacks the editor's "inherits background color" banner
43
+ above its field, separated by the editor's default 10px gap — match the tab's 16px.
44
+ Scoped via the spacing control so other blocks keep the default. */
45
+ .ue-scrollable-content:has(.spacing-control-container) .e2e-block-bg-color {
46
+ row-gap: 16px;
47
+ }
48
+
28
49
  /* Right-align the mobile layout toggle within the two-column grid */
29
50
  .product-layout-control-container ue-switcher {
30
51
  justify-self: end;
@@ -28,10 +28,10 @@ const G = `
28
28
  {-{-CELLS-}-}
29
29
  </tr>
30
30
  `;
31
- function j(e, t, n, r = Y, c = {}, i = {}) {
32
- const { cellPadding: s = k, cardBackgroundColor: u, visibility: a, priceInline: o = !1 } = i, d = (100 / t).toFixed(2), p = t - e.length, T = p > 0 ? x(d, s).repeat(p) : "", m = B(n, r, c), R = F(r), L = o ? r.filter((l) => l !== R.skip) : r, C = I(f, i), P = I(O, i);
31
+ function j(t, r, o, e = Y, c = {}, i = {}) {
32
+ const { cellPadding: s = k, cardBackgroundColor: u, visibility: a, priceInline: n = !1 } = i, d = (100 / r).toFixed(2), p = r - t.length, T = p > 0 ? x(d, s).repeat(p) : "", m = B(o, e, c), R = F(e), L = n ? e.filter((l) => l !== R.skip) : e, C = I(f, i), P = I(O, i);
33
33
  return L.filter((l) => m[l]).map((l) => {
34
- const _ = (a == null ? void 0 : a[l]) ?? W[l] ?? !0, b = _ ? "" : 'style="display: none;"', S = I(l, i), D = e.map((E) => (o && l === R.anchor ? H(
34
+ const _ = (a == null ? void 0 : a[l]) ?? W[l] ?? !0, b = _ ? "" : 'style="display: none;"', S = I(l, i, e), D = t.map((E) => (n && l === R.anchor ? H(
35
35
  E,
36
36
  R.originalFirst,
37
37
  C,
@@ -41,36 +41,36 @@ function j(e, t, n, r = Y, c = {}, i = {}) {
41
41
  return V.replace("{-{-ATTR_TYPE-}-}", l).replace("{-{-VISIBILITY-}-}", _ ? "1" : "0").replace("{-{-DISPLAY_STYLE-}-}", b).replace("{-{-CELLS-}-}", D + T);
42
42
  }).join("");
43
43
  }
44
- function v(e, t, n, r, c = {}, i = {}) {
44
+ function v(t, r, o, e, c = {}, i = {}) {
45
45
  const s = [];
46
- for (let o = 0; o < e.length; o += t)
47
- s.push(e.slice(o, o + t));
46
+ for (let n = 0; n < t.length; n += r)
47
+ s.push(t.slice(n, n + r));
48
48
  const u = h(i.rowSpacingPx);
49
- return s.map((o, d) => {
49
+ return s.map((n, d) => {
50
50
  const p = j(
51
- o,
52
- t,
53
51
  n,
54
52
  r,
53
+ o,
54
+ e,
55
55
  c,
56
56
  i
57
57
  ), T = G.replace("{-{-ATTRIBUTE_ROWS-}-}", p);
58
58
  return d > 0 ? u + T : T;
59
59
  }).join("");
60
60
  }
61
- function M(e, t, n, r = {}, c = {}) {
61
+ function M(t, r, o, e = {}, c = {}) {
62
62
  return v(
63
- e,
64
63
  t,
65
- y,
66
- n,
67
64
  r,
65
+ y,
66
+ o,
67
+ e,
68
68
  c
69
69
  );
70
70
  }
71
- function Q(e) {
72
- const t = e ? `ins-recommendation-v3-block-${e}` : void 0, n = U("grid", t), r = A(), c = M(r, w);
73
- return n.replace("{-{-TITLE-}-}", g.TITLE).replace("{-{-PRODUCT_ROWS-}-}", c).replace("{-{-MOBILE_PRODUCT_ROWS-}-}", "");
71
+ function Q(t) {
72
+ const r = t ? `ins-recommendation-v3-block-${t}` : void 0, o = U("grid", r), e = A(), c = M(e, w);
73
+ return o.replace("{-{-TITLE-}-}", g.TITLE).replace("{-{-PRODUCT_ROWS-}-}", c).replace("{-{-MOBILE_PRODUCT_ROWS-}-}", "");
74
74
  }
75
75
  export {
76
76
  Q as getDefaultTemplate,
@@ -1,13 +1,13 @@
1
- import { ATTR_PRODUCT_IMAGE as p, ATTR_PRODUCT_BUTTON as C, ATTR_PRODUCT_OLD_PRICE as A, ATTR_PRODUCT_PRICE as m } from "../../constants/selectors.js";
2
- import { buildSpacer as I, DEFAULT_CARD_COMPOSITION as g, buildElementRenderer as E, buildCellOptions as i, resolveInlinePriceOrder as w, DEFAULT_CARD_VISIBILITY as y } from "../utils.js";
1
+ import { ATTR_PRODUCT_IMAGE as p, ATTR_PRODUCT_BUTTON as C, ATTR_PRODUCT_OLD_PRICE as A, ATTR_PRODUCT_PRICE as I } from "../../constants/selectors.js";
2
+ import { buildSpacer as m, DEFAULT_CARD_COMPOSITION as g, buildElementRenderer as E, buildCellOptions as i, resolveInlinePriceOrder as w, DEFAULT_CARD_VISIBILITY as y } from "../utils.js";
3
3
  import { listElementRenderer as L, renderInlineListPriceRow as O } from "./elementRenderer.js";
4
4
  const S = "0 5px";
5
5
  function U(l, r, n) {
6
- const e = n ? "" : ' style="display: none;"', o = l.replace(/<tr>/, "").replace(/<\/tr>/, "");
6
+ const t = 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="${n ? "1" : "0"}"${e}>${o}</tr>`;
10
+ data-visibility="${n ? "1" : "0"}"${t}>${o}</tr>`;
11
11
  }
12
12
  const N = `
13
13
  <tr class="recommendation-product-row">
@@ -27,36 +27,36 @@ const N = `
27
27
  </td>
28
28
  </tr>
29
29
  `;
30
- function x(l, r = g, n = {}, e = {}) {
30
+ function x(l, r = g, n = {}, t = {}) {
31
31
  const {
32
32
  cellPadding: o = S,
33
33
  cardBackgroundColor: d,
34
34
  visibility: c,
35
35
  priceInline: a = !1
36
- } = e, u = d ? ` style="table-layout: fixed; background-color: ${d};"` : ' style="table-layout: fixed;"', s = E(L, r, n), P = s[p](l, i(p, e)), R = w(r), T = `
36
+ } = t, u = d ? ` style="table-layout: fixed; background-color: ${d};"` : ' style="table-layout: fixed;"', s = E(L, r, n), P = s[p](l, i(p, t)), R = w(r), T = `
37
37
  <td class="product-info-cell" valign="middle" style="padding: 15px;">
38
38
  <table cellpadding="0" cellspacing="0" role="presentation" width="100%" style="table-layout: fixed;">
39
39
  <tbody>
40
- ${r.filter((t) => t !== p && t !== C).filter((t) => !(a && t === R.skip)).filter((t) => s[t]).map((t) => {
41
- const b = (c == null ? void 0 : c[t]) ?? y[t] ?? !0, f = a && t === R.anchor ? O(
40
+ ${r.filter((e) => e !== p && e !== C).filter((e) => !(a && e === R.skip)).filter((e) => s[e]).map((e) => {
41
+ const b = (c == null ? void 0 : c[e]) ?? y[e] ?? !0, f = a && e === R.anchor ? O(
42
42
  l,
43
43
  R.originalFirst,
44
- i(m, e),
45
- i(A, e)
46
- ) : s[t](l, i(t, e));
47
- return U(f, t, b);
44
+ i(I, t),
45
+ i(A, t)
46
+ ) : s[e](l, i(e, t, r));
47
+ return U(f, e, b);
48
48
  }).join(`
49
49
  `)}
50
50
  </tbody>
51
51
  </table>
52
52
  </td>
53
- `, _ = s[C](l, i(C, e)), D = P + T + _;
53
+ `, _ = s[C](l, i(C, t)), D = P + T + _;
54
54
  return N.replace("{-{-CARD_PADDING-}-}", o).replace("{-{-WRAPPER_STYLE-}-}", u).replace("{-{-PRODUCT_CONTENT-}-}", D);
55
55
  }
56
- function W(l, r, n = {}, e = {}) {
57
- const o = I(e.rowSpacingPx);
56
+ function W(l, r, n = {}, t = {}) {
57
+ const o = m(t.rowSpacingPx);
58
58
  return l.map((d, c) => {
59
- const a = x(d, r, n, e);
59
+ const a = x(d, r, n, t);
60
60
  return c > 0 ? o + a : a;
61
61
  }).join("");
62
62
  }