@useinsider/guido 3.20.1 → 3.21.0-beta.0df5409

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 (90) hide show
  1. package/dist/components/Guido.vue.js +1 -1
  2. package/dist/components/Guido.vue2.js +65 -64
  3. package/dist/components/organisms/AutoSaveController.vue2.js +10 -9
  4. package/dist/components/organisms/header/EditorActions.vue.js +4 -4
  5. package/dist/components/organisms/header/EditorActions.vue2.js +53 -51
  6. package/dist/components/organisms/validation/ValidationErrorDrawer.vue.js +3 -3
  7. package/dist/components/organisms/validation/ValidationErrorDrawer.vue2.js +23 -22
  8. package/dist/composables/useActionsApi.js +80 -63
  9. package/dist/composables/useAutoSave.js +46 -44
  10. package/dist/composables/useGuidoStateBridge.js +3 -3
  11. package/dist/composables/useLegacyStrategyConversion.js +16 -16
  12. package/dist/composables/useSave.js +26 -23
  13. package/dist/composables/useSaveValidation.js +113 -114
  14. package/dist/composables/useSaveValidationRollout.js +17 -6
  15. package/dist/composables/useStripo.js +11 -10
  16. package/dist/extensions/Blocks/Items/block.js +43 -42
  17. package/dist/extensions/Blocks/Recommendation/block.js +33 -29
  18. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +78 -83
  19. package/dist/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.js +1 -2
  20. package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +2 -12
  21. package/dist/extensions/Blocks/Recommendation/controls/main/currency.js +104 -86
  22. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +348 -263
  23. package/dist/extensions/Blocks/Recommendation/controls/main/layoutOrientation.js +48 -50
  24. package/dist/extensions/Blocks/Recommendation/controls/main/locale.js +16 -21
  25. package/dist/extensions/Blocks/Recommendation/controls/main/pricePlacement.js +44 -40
  26. package/dist/extensions/Blocks/Recommendation/controls/main/productCount.js +14 -19
  27. package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +104 -102
  28. package/dist/extensions/Blocks/Recommendation/controls/main/shuffle.js +18 -23
  29. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +312 -286
  30. package/dist/extensions/Blocks/Recommendation/controls/mobileLayout/cssRules.js +24 -20
  31. package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +6 -7
  32. package/dist/extensions/Blocks/Recommendation/controls/shared/textTrimCssRules.js +8 -8
  33. package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +113 -151
  34. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +221 -203
  35. package/dist/extensions/Blocks/Recommendation/utils/blockRefresh.js +28 -0
  36. package/dist/extensions/Blocks/Recommendation/utils/captureStyleTemplates.js +1 -1
  37. package/dist/extensions/Blocks/Recommendation/utils/currencySettings.js +25 -0
  38. package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +111 -40
  39. package/dist/extensions/Blocks/Recommendation/utils/strategyCommit.js +31 -35
  40. package/dist/extensions/Blocks/Unsubscribe/block.js +70 -75
  41. package/dist/guido.css +1 -1
  42. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +271 -192
  43. package/dist/package.json.js +1 -1
  44. package/dist/services/settingsApi.js +11 -0
  45. package/dist/src/components/Guido.vue.d.ts +1 -1
  46. package/dist/src/components/organisms/header/EditorActions.vue.d.ts +1 -1
  47. package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -1
  48. package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -1
  49. package/dist/src/composables/useActionsApi.d.ts +5 -1
  50. package/dist/src/composables/useAutoSave.d.ts +4 -1
  51. package/dist/src/composables/useSaveValidationRollout.d.ts +1 -0
  52. package/dist/src/extensions/Blocks/Checkbox/controls/blockBackground/index.d.ts +1 -0
  53. package/dist/src/extensions/Blocks/CouponBlock/controls/index.d.ts +8 -0
  54. package/dist/src/extensions/Blocks/Items/controls/index.d.ts +40 -0
  55. package/dist/src/extensions/Blocks/RadioButton/controls/blockBackground/index.d.ts +1 -0
  56. package/dist/src/extensions/Blocks/Recommendation/block.d.ts +1 -0
  57. package/dist/src/extensions/Blocks/Recommendation/controls/blockBackground/index.d.ts +1 -0
  58. package/dist/src/extensions/Blocks/Recommendation/controls/button/index.d.ts +11 -0
  59. package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +3 -6
  60. package/dist/src/extensions/Blocks/Recommendation/controls/customAttribute/index.d.ts +7 -0
  61. package/dist/src/extensions/Blocks/Recommendation/controls/image/index.d.ts +2 -0
  62. package/dist/src/extensions/Blocks/Recommendation/controls/main/currency.d.ts +5 -5
  63. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +21 -12
  64. package/dist/src/extensions/Blocks/Recommendation/controls/main/layoutOrientation.d.ts +6 -3
  65. package/dist/src/extensions/Blocks/Recommendation/controls/main/pricePlacement.d.ts +6 -5
  66. package/dist/src/extensions/Blocks/Recommendation/controls/main/productLayout.d.ts +6 -3
  67. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +21 -9
  68. package/dist/src/extensions/Blocks/Recommendation/controls/mobileLayout/cssRules.d.ts +19 -13
  69. package/dist/src/extensions/Blocks/Recommendation/controls/name/index.d.ts +7 -0
  70. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/index.d.ts +7 -0
  71. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscount/index.d.ts +7 -0
  72. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPrice/index.d.ts +7 -0
  73. package/dist/src/extensions/Blocks/Recommendation/controls/price/index.d.ts +7 -0
  74. package/dist/src/extensions/Blocks/Recommendation/controls/shared/textTrimCssRules.d.ts +10 -8
  75. package/dist/src/extensions/Blocks/Recommendation/controls/spacing/index.d.ts +9 -5
  76. package/dist/src/extensions/Blocks/Recommendation/controls/title/index.d.ts +7 -0
  77. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +9 -1
  78. package/dist/src/extensions/Blocks/Recommendation/utils/blockRefresh.d.ts +17 -0
  79. package/dist/src/extensions/Blocks/Recommendation/utils/currencySettings.d.ts +6 -0
  80. package/dist/src/extensions/Blocks/Recommendation/utils/nodeConfigWriter.d.ts +18 -11
  81. package/dist/src/extensions/Blocks/Unsubscribe/block.d.ts +1 -6
  82. package/dist/src/extensions/Blocks/_Boilerplate/controls/blockBackground/index.d.ts +1 -0
  83. package/dist/src/extensions/Blocks/controlFactories.d.ts +22 -0
  84. package/dist/src/services/settingsApi.d.ts +6 -0
  85. package/dist/src/stores/editor.d.ts +3 -1
  86. package/dist/src/stores/setup-settings.d.ts +4 -0
  87. package/dist/static/styles/components/button.css.js +5 -0
  88. package/dist/stores/editor.js +5 -0
  89. package/dist/stores/setup-settings.js +10 -0
  90. package/package.json +4 -4
@@ -1,38 +1,42 @@
1
- import { ModificationDescription as a } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
- const r = "ins-recommendation-desktop-container", l = "ins-recommendation-mobile-container", i = "ins-recommendation-list-layout", s = "ins-recommendation-no-mobile-layout", u = `.${l} { display: none; }`, m = `@media only screen and (max-width: 480px) { .${r} { display: none !important; } .${l} { display: table !important; } .${i} .${r} { display: table !important; } .${i} .${l}, .${i} .ins-recommendation-mobile-row { display: none !important; } .${i} .product-image-cell { width: 80px !important; } .${i} .product-image-cell img { max-width: 80px !important; } .${i} .button-cell { width: 80px !important; } .${i} .product-info-cell { padding: 5px 8px !important; } }`, d = `@media only screen and (max-width: 480px) { .${s} .${r} { display: table !important; } .${s} .${l}, .${s} .ins-recommendation-mobile-row { display: none !important; } }`, p = `.${l}`;
3
- function c(t, e) {
4
- return !!t.querySelector(e);
1
+ import { ModificationDescription as u } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
+ const r = "ins-recommendation-desktop-container", a = "ins-recommendation-mobile-container", i = "ins-recommendation-list-layout", s = "ins-recommendation-no-mobile-layout", m = `.${a} { display: none; }`, p = `@media only screen and (max-width: 480px) { .${r} { display: none !important; } .${a} { display: table !important; } .${i} .${r} { display: table !important; } .${i} .${a}, .${i} .ins-recommendation-mobile-row { display: none !important; } .${i} .product-image-cell { width: 80px !important; } .${i} .product-image-cell img { max-width: 80px !important; } .${i} .button-cell { width: 80px !important; } .${i} .product-info-cell { padding: 5px 8px !important; } }`, d = `@media only screen and (max-width: 480px) { .${s} .${r} { display: table !important; } .${s} .${a}, .${s} .ins-recommendation-mobile-row { display: none !important; } }`, c = `.${a}`;
3
+ function f(t, o) {
4
+ return !!t.querySelector(o);
5
5
  }
6
- function f(t) {
6
+ function y(t) {
7
7
  return t.querySelectorAll(`*${r}`).length > 0;
8
8
  }
9
- function y(t) {
9
+ function _(t) {
10
10
  return t.querySelectorAll(`*${s}`).length > 0;
11
11
  }
12
- function S(t) {
12
+ function C(t, o) {
13
13
  const e = t.getDocumentRootCssNode();
14
14
  if (!e)
15
- return;
16
- const o = t.getDocumentModifier();
17
- let n = !1;
18
- c(e, p) || (o.modifyCss(e).appendRule(u), n = !0), f(e) || (o.modifyCss(e).appendRule(m), n = !0), y(e) || (o.modifyCss(e).appendRule(d), n = !0), n && o.apply(new a("Add mobile layout CSS rules"));
15
+ return !1;
16
+ const n = o ?? t.getDocumentModifier();
17
+ let l = !1;
18
+ return f(e, c) || (n.modifyCss(e).appendRule(m), l = !0), y(e) || (n.modifyCss(e).appendRule(p), l = !0), _(e) || (n.modifyCss(e).appendRule(d), l = !0), l && !o && n.apply(new u("Add mobile layout CSS rules")), l;
19
19
  }
20
- function C(t) {
20
+ function L(t) {
21
21
  return "hasClass" in t ? t.hasClass(s) : !1;
22
22
  }
23
- function O(t, e, o) {
23
+ function O(t, o, e) {
24
+ e ? t.modifyHtml(o).setClass(s) : t.modifyHtml(o).removeClass(s);
25
+ }
26
+ function $(t, o, e) {
24
27
  const n = t.getDocumentModifier();
25
- o ? n.modifyHtml(e).setClass(s) : n.modifyHtml(e).removeClass(s), n.apply(
26
- new a(
27
- o ? "Opt out of mobile layout" : "Opt in to mobile layout"
28
+ O(n, o, e), n.apply(
29
+ new u(
30
+ e ? "Opt out of mobile layout" : "Opt in to mobile layout"
28
31
  )
29
32
  );
30
33
  }
31
34
  export {
32
35
  r as CSS_CLASS_DESKTOP_CONTAINER,
33
- l as CSS_CLASS_MOBILE_CONTAINER,
36
+ a as CSS_CLASS_MOBILE_CONTAINER,
34
37
  s as CSS_CLASS_NO_MOBILE_LAYOUT,
35
- S as ensureMobileCssRulesExist,
36
- C as hasMobileLayoutOptOut,
37
- O as setMobileLayoutOptOut
38
+ C as ensureMobileCssRulesExist,
39
+ L as hasMobileLayoutOptOut,
40
+ $ as setMobileLayoutOptOut,
41
+ O as stageMobileLayoutOptOut
38
42
  };
@@ -3,7 +3,7 @@ import { CommonControl as u } from "../../../common-control.js";
3
3
  import { RecommendationBlockId as a } from "../../constants/blockIds.js";
4
4
  import { RecommendationControlId as d } from "../../constants/controlIds.js";
5
5
  import { BLOCK_ROOT_SELECTOR as m } from "../../constants/selectors.js";
6
- import { CSS_CLASS_TEXT_TRIM as r, ensureTextTrimCssRulesExist as T } from "../shared/textTrimCssRules.js";
6
+ import { CSS_CLASS_TEXT_TRIM as o, ensureTextTrimCssRulesExist as T } from "../shared/textTrimCssRules.js";
7
7
  const s = {
8
8
  TEXT_TRIM_ENABLED: "textTrimEnabled"
9
9
  };
@@ -37,7 +37,7 @@ class N extends u {
37
37
  _getCurrentTrimState() {
38
38
  if (!this.currentNode || !("hasClass" in this.currentNode))
39
39
  return !1;
40
- if (this.currentNode.hasClass(r))
40
+ if (this.currentNode.hasClass(o))
41
41
  return !0;
42
42
  const e = this.currentNode.closest(m);
43
43
  if (!e)
@@ -45,7 +45,7 @@ class N extends u {
45
45
  const t = e.querySelector(
46
46
  `[esd-extension-block-id="${a.NAME}"]`
47
47
  );
48
- return t && "hasClass" in t ? t.hasClass(r) : !1;
48
+ return t && "hasClass" in t ? t.hasClass(o) : !1;
49
49
  }
50
50
  _onTextTrimChange(e) {
51
51
  if (!this.currentNode || !("closest" in this.currentNode))
@@ -58,11 +58,10 @@ class N extends u {
58
58
  );
59
59
  if (!i.length)
60
60
  return;
61
- e && T(this.api);
62
- const o = this.api.getDocumentModifier();
61
+ const r = this.api.getDocumentModifier();
63
62
  i.forEach((n) => {
64
- e ? o.modifyHtml(n).setClass(r) : o.modifyHtml(n).removeClass(r);
65
- }), o.apply(
63
+ e ? r.modifyHtml(n).setClass(o) : r.modifyHtml(n).removeClass(o);
64
+ }), e && T(this.api, r), r.apply(
66
65
  new l(
67
66
  e ? "Enable product name text trimming" : "Disable product name text trimming"
68
67
  )
@@ -1,14 +1,14 @@
1
- import { ModificationDescription as r } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
- const t = "text-trim-enabled", l = `.${t}`, c = `.${t} p`, S = `.${t} { max-width: 0; }`, T = `.${t} p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 0; display: block; }`;
3
- function f(n) {
1
+ import { ModificationDescription as l } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
+ const t = "text-trim-enabled", c = `.${t}`, S = `.${t} p`, T = `.${t} { max-width: 0; }`, d = `.${t} p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 0; display: block; }`;
3
+ function R(n, r) {
4
4
  const e = n.getDocumentRootCssNode();
5
5
  if (!e)
6
- return;
7
- const o = n.getDocumentModifier();
8
- let i = !1;
9
- e.querySelector(l) || (o.modifyCss(e).appendRule(S), i = !0), e.querySelectorAll(`*${t}`).some((s) => "getSelector" in s && typeof s.getSelector == "function" && s.getSelector() === c) || (o.modifyCss(e).appendRule(T), i = !0), i && o.apply(new r("Add text trim CSS rules"));
6
+ return !1;
7
+ const s = r ?? n.getDocumentModifier();
8
+ let o = !1;
9
+ return e.querySelector(c) || (s.modifyCss(e).appendRule(T), o = !0), e.querySelectorAll(`*${t}`).some((i) => "getSelector" in i && typeof i.getSelector == "function" && i.getSelector() === S) || (s.modifyCss(e).appendRule(d), o = !0), o && !r && s.apply(new l("Add text trim CSS rules")), o;
10
10
  }
11
11
  export {
12
12
  t as CSS_CLASS_TEXT_TRIM,
13
- f as ensureTextTrimCssRulesExist
13
+ R as ensureTextTrimCssRulesExist
14
14
  };
@@ -1,16 +1,16 @@
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";
1
+ var M = Object.defineProperty;
2
+ var P = (s, r, t) => r in s ? M(s, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[r] = t;
3
+ var l = (s, r, t) => P(s, typeof r != "symbol" ? r + "" : r, t);
4
+ import { ModificationDescription as _ } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
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
- import { RecommendationConfigService as p } from "../../services/configService.js";
6
+ import { DESKTOP_CONTAINER_SELECTOR as S, MOBILE_CONTAINER_SELECTOR as I } from "../../constants/selectors.js";
7
+ import { SPACING_STEP as G, MAX_SPACING as R, MIN_SPACING as y, DEFAULT_COLUMN_SPACING as p, DEFAULT_ROW_SPACING as f } from "../../constants/layout.js";
8
+ import { RecommendationConfigService as u } from "../../services/configService.js";
9
9
  import { useRecommendationExtensionStore as w } from "../../store/recommendation.js";
10
- import { safeGetStyle as f, safeGetParent as B } from "../../utils/tagName.js";
11
- import { getCurrentLayout as _, getBlockElement as U } from "../main/utils.js";
10
+ import { safeGetStyle as O, safeGetParent as B } from "../../utils/tagName.js";
11
+ import { getCurrentLayout as b, getBlockElement as U } from "../main/utils.js";
12
12
  import { useDebounceFn as N } from "../../../../../node_modules/@vueuse/shared/index.js";
13
- const V = "recommendation-spacing-control", o = {
13
+ const V = "recommendation-spacing-control", e = {
14
14
  COLUMN_SPACING: "columnSpacing",
15
15
  COLUMN_SPACING_LABEL: "columnSpacingLabel",
16
16
  ROW_SPACING: "rowSpacing",
@@ -19,46 +19,46 @@ const V = "recommendation-spacing-control", o = {
19
19
  MOBILE_COLUMN_SPACING_LABEL: "mobileColumnSpacingLabel",
20
20
  MOBILE_ROW_SPACING: "mobileRowSpacing",
21
21
  MOBILE_ROW_SPACING_LABEL: "mobileRowSpacingLabel"
22
- }, b = {
22
+ }, m = {
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 O(u, s) {
29
- if (!u)
30
- return s;
31
- const t = parseFloat(u);
32
- return Number.isNaN(t) ? s : t;
28
+ function L(s, r) {
29
+ if (!s)
30
+ return r;
31
+ const t = parseFloat(s);
32
+ return Number.isNaN(t) ? r : t;
33
33
  }
34
- class j extends E {
34
+ class k extends E {
35
35
  constructor() {
36
36
  super(...arguments);
37
- g(this, "store", w());
38
- g(this, "unsubscribeOrientation", null);
37
+ l(this, "store", w());
38
+ l(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
- g(this, "_debouncedOnColumnSpacingChange", N((t) => {
43
+ l(this, "_debouncedOnColumnSpacingChange", N((t) => {
44
44
  this._onColumnSpacingChange(t);
45
45
  }, 300));
46
46
  /**
47
47
  * Debounced version of _onRowSpacingChange
48
48
  */
49
- g(this, "_debouncedOnRowSpacingChange", N((t) => {
49
+ l(this, "_debouncedOnRowSpacingChange", N((t) => {
50
50
  this._onRowSpacingChange(t);
51
51
  }, 300));
52
52
  /**
53
53
  * Debounced version of _onMobileColumnSpacingChange
54
54
  */
55
- g(this, "_debouncedOnMobileColumnSpacingChange", N((t) => {
55
+ l(this, "_debouncedOnMobileColumnSpacingChange", N((t) => {
56
56
  this._onMobileColumnSpacingChange(t);
57
57
  }, 300));
58
58
  /**
59
59
  * Debounced version of _onMobileRowSpacingChange
60
60
  */
61
- g(this, "_debouncedOnMobileRowSpacingChange", N((t) => {
61
+ l(this, "_debouncedOnMobileRowSpacingChange", N((t) => {
62
62
  this._onMobileRowSpacingChange(t);
63
63
  }, 300));
64
64
  }
@@ -68,17 +68,17 @@ class j extends E {
68
68
  getTemplate() {
69
69
  return `
70
70
  <div class="spacing-control-container">
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)}
71
+ ${this._spacingRow("Column Spacing (px)", e.COLUMN_SPACING_LABEL, e.COLUMN_SPACING)}
72
+ ${this._spacingRow("Row Spacing (px)", e.ROW_SPACING_LABEL, e.ROW_SPACING)}
73
73
  ${this._spacingRow(
74
74
  "Column Spacing on Mobile (px)",
75
- o.MOBILE_COLUMN_SPACING_LABEL,
76
- o.MOBILE_COLUMN_SPACING
75
+ e.MOBILE_COLUMN_SPACING_LABEL,
76
+ e.MOBILE_COLUMN_SPACING
77
77
  )}
78
78
  ${this._spacingRow(
79
79
  "Row Spacing on Mobile (px)",
80
- o.MOBILE_ROW_SPACING_LABEL,
81
- o.MOBILE_ROW_SPACING
80
+ e.MOBILE_ROW_SPACING_LABEL,
81
+ e.MOBILE_ROW_SPACING
82
82
  )}
83
83
  </div>
84
84
  `;
@@ -96,14 +96,14 @@ class j extends E {
96
96
  * One label + counter per two-column row, so every spacing field gets the same
97
97
  * 16px-padded row the color controls already render instead of sharing one grid.
98
98
  */
99
- _spacingRow(t, e, n) {
99
+ _spacingRow(t, i, o) {
100
100
  return this._GuTwoColumns([
101
- this._GuLabel({ text: this.api.translate(t), name: e }),
101
+ this._GuLabel({ text: this.api.translate(t), name: i }),
102
102
  this._GuCounter({
103
- name: n,
104
- minValue: R,
105
- maxValue: G,
106
- step: P
103
+ name: o,
104
+ minValue: y,
105
+ maxValue: R,
106
+ step: G
107
107
  })
108
108
  ]);
109
109
  }
@@ -117,14 +117,14 @@ class j extends E {
117
117
  _updateSpacingVisibility() {
118
118
  if (!this.api)
119
119
  return;
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,
123
- i && a && c
120
+ const t = u.getConfig(this.currentNode), i = this.store.recommendationConfigs.orientation, n = (t.layout || i || b(this.currentNode)) === "grid", { mobileLayoutEnabled: a } = t, c = t.cardsInRow > 1, g = t.mobileCardsInRow > 1;
121
+ this.api.setVisibility(e.COLUMN_SPACING, n && c), this.api.setVisibility(e.COLUMN_SPACING_LABEL, n && c), this.api.setVisibility(e.ROW_SPACING, !0), this.api.setVisibility(e.ROW_SPACING_LABEL, !0), this.api.setVisibility(
122
+ e.MOBILE_COLUMN_SPACING,
123
+ n && a && g
124
124
  ), this.api.setVisibility(
125
- o.MOBILE_COLUMN_SPACING_LABEL,
126
- i && a && c
127
- ), this.api.setVisibility(o.MOBILE_ROW_SPACING, i && a), this.api.setVisibility(o.MOBILE_ROW_SPACING_LABEL, i && a);
125
+ e.MOBILE_COLUMN_SPACING_LABEL,
126
+ n && a && g
127
+ ), this.api.setVisibility(e.MOBILE_ROW_SPACING, n && a), this.api.setVisibility(e.MOBILE_ROW_SPACING_LABEL, n && a);
128
128
  }
129
129
  /**
130
130
  * Reads spacing values from node config first, falls back to DOM styles.
@@ -133,12 +133,12 @@ class j extends E {
133
133
  _setFormValues() {
134
134
  if (!this.api)
135
135
  return;
136
- const t = p.hasConfig(this.currentNode), e = p.getConfig(this.currentNode), n = t ? e.columnSpacing : this._getStoredColumnSpacing(), i = t ? e.rowSpacing : this._getStoredRowSpacing();
136
+ const t = u.hasConfig(this.currentNode), i = u.getConfig(this.currentNode), o = t ? i.columnSpacing : this._getStoredColumnSpacing(), n = t ? i.rowSpacing : this._getStoredRowSpacing();
137
137
  this.api.updateValues({
138
- [o.COLUMN_SPACING]: n,
139
- [o.ROW_SPACING]: i,
140
- [o.MOBILE_COLUMN_SPACING]: e.mobileColumnSpacing,
141
- [o.MOBILE_ROW_SPACING]: e.mobileRowSpacing
138
+ [e.COLUMN_SPACING]: o,
139
+ [e.ROW_SPACING]: n,
140
+ [e.MOBILE_COLUMN_SPACING]: i.mobileColumnSpacing,
141
+ [e.MOBILE_ROW_SPACING]: i.mobileRowSpacing
142
142
  });
143
143
  }
144
144
  /**
@@ -150,20 +150,20 @@ class j extends E {
150
150
  */
151
151
  _getStoredColumnSpacing() {
152
152
  if (!this.currentNode)
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");
157
- if (!d)
158
- return C;
159
- const A = d.trim().split(/\s+/);
160
- return A.length < 2 ? C : O(A[1], C / 2) * 2;
153
+ return p;
154
+ const t = this.currentNode.querySelector(S) ?? this.currentNode;
155
+ if (b(this.currentNode) === "grid") {
156
+ const d = t.querySelector(".recommendation-attribute-row"), C = (d == null ? void 0 : d.querySelector("td")) ?? null, h = O(C, "padding");
157
+ if (!h)
158
+ return p;
159
+ const A = h.trim().split(/\s+/);
160
+ return A.length < 2 ? p : L(A[1], p / 2) * 2;
161
161
  }
162
- const n = t.querySelector(".product-card-wrapper") ?? null, i = B(n), a = f(i, "padding");
162
+ const o = t.querySelector(".product-card-wrapper") ?? null, n = B(o), a = O(n, "padding");
163
163
  if (!a)
164
- return C;
165
- const r = a.trim().split(/\s+/);
166
- return r.length < 2 ? C : O(r[1], C / 2) * 2;
164
+ return p;
165
+ const c = a.trim().split(/\s+/);
166
+ return c.length < 2 ? p : L(c[1], p / 2) * 2;
167
167
  }
168
168
  /**
169
169
  * Gets stored row spacing from the first spacer element's height style
@@ -171,9 +171,9 @@ class j extends E {
171
171
  */
172
172
  _getStoredRowSpacing() {
173
173
  if (!this.currentNode)
174
- return I;
175
- const e = (this.currentNode.querySelector(m) ?? this.currentNode).querySelector(".spacer") ?? null, n = f(e, "height");
176
- return O(n, I);
174
+ return f;
175
+ const i = (this.currentNode.querySelector(S) ?? this.currentNode).querySelector(".spacer") ?? null, o = O(i, "height");
176
+ return L(o, f);
177
177
  }
178
178
  // ========================================================================
179
179
  // Desktop Spacing Handlers
@@ -185,23 +185,8 @@ class j extends E {
185
185
  _onColumnSpacingChange(t) {
186
186
  if (!this.currentNode)
187
187
  return;
188
- p.updateConfig(
189
- this.api,
190
- this.currentNode,
191
- { columnSpacing: t },
192
- `Changed column spacing to ${t}px`
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(
196
- c.querySelectorAll(".attribute-cell")
197
- ).forEach((l) => {
198
- i.modifyHtml(l).setStyle("padding", r);
199
- }) : Array.from(
200
- c.querySelectorAll(".product-card-wrapper")
201
- ).forEach((l) => {
202
- const d = "parent" in l ? l.parent() : void 0;
203
- d && i.modifyHtml(d).setStyle("padding", r);
204
- }), i.apply(new S(`Update column spacing to ${t}px`)));
188
+ const i = this.api.getDocumentModifier();
189
+ u.stageConfig(i, this.currentNode, { columnSpacing: t }), this._stageDataAttribute(i, m.COLUMN_SPACING, t), this._stageColumnPadding(i, S, t), i.apply(new _(`Changed column spacing to ${t}px`));
205
190
  }
206
191
  /**
207
192
  * Handles row spacing changes for desktop.
@@ -210,24 +195,8 @@ class j extends E {
210
195
  _onRowSpacingChange(t) {
211
196
  if (!this.currentNode)
212
197
  return;
213
- p.updateConfig(
214
- this.api,
215
- this.currentNode,
216
- { rowSpacing: t },
217
- `Changed row spacing to ${t}px`
218
- ), this._storeDataAttribute(b.ROW_SPACING, t);
219
- const e = this.currentNode.querySelector(m);
220
- if (!e)
221
- return;
222
- const n = Array.from(
223
- e.querySelectorAll(".spacer")
224
- );
225
- if (!n.length)
226
- return;
227
- const i = this.api.getDocumentModifier(), a = `${t}px`;
228
- n.forEach((r) => {
229
- i.modifyHtml(r).setStyle("height", a);
230
- }), i.apply(new S(`Update row spacing to ${t}px`));
198
+ const i = this.api.getDocumentModifier();
199
+ u.stageConfig(i, this.currentNode, { rowSpacing: t }), this._stageDataAttribute(i, m.ROW_SPACING, t), this._stageSpacerHeight(i, S, t), i.apply(new _(`Changed row spacing to ${t}px`));
231
200
  }
232
201
  // ========================================================================
233
202
  // Mobile Spacing Handlers
@@ -239,23 +208,8 @@ class j extends E {
239
208
  _onMobileColumnSpacingChange(t) {
240
209
  if (!this.currentNode)
241
210
  return;
242
- p.updateConfig(
243
- this.api,
244
- this.currentNode,
245
- { mobileColumnSpacing: t },
246
- `Changed mobile column spacing to ${t}px`
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(
250
- c.querySelectorAll(".attribute-cell")
251
- ).forEach((l) => {
252
- i.modifyHtml(l).setStyle("padding", r);
253
- }) : Array.from(
254
- c.querySelectorAll(".product-card-wrapper")
255
- ).forEach((l) => {
256
- const d = "parent" in l ? l.parent() : void 0;
257
- d && i.modifyHtml(d).setStyle("padding", r);
258
- }), i.apply(new S(`Update mobile column spacing to ${t}px`)));
211
+ const i = this.api.getDocumentModifier();
212
+ u.stageConfig(i, this.currentNode, { mobileColumnSpacing: t }), this._stageDataAttribute(i, m.MOBILE_COLUMN_SPACING, t), this._stageColumnPadding(i, I, t), i.apply(new _(`Changed mobile column spacing to ${t}px`));
259
213
  }
260
214
  /**
261
215
  * Handles row spacing changes for mobile.
@@ -264,51 +218,59 @@ class j extends E {
264
218
  _onMobileRowSpacingChange(t) {
265
219
  if (!this.currentNode)
266
220
  return;
267
- p.updateConfig(
268
- this.api,
269
- this.currentNode,
270
- { mobileRowSpacing: t },
271
- `Changed mobile row spacing to ${t}px`
272
- ), this._storeDataAttribute(b.MOBILE_ROW_SPACING, t);
273
- const e = this.currentNode.querySelector(L);
274
- if (!e)
275
- return;
276
- const n = Array.from(
277
- e.querySelectorAll(".spacer")
278
- );
279
- if (!n.length)
280
- return;
281
- const i = this.api.getDocumentModifier(), a = `${t}px`;
282
- n.forEach((r) => {
283
- i.modifyHtml(r).setStyle("height", a);
284
- }), i.apply(new S(`Update mobile row spacing to ${t}px`));
221
+ const i = this.api.getDocumentModifier();
222
+ u.stageConfig(i, this.currentNode, { mobileRowSpacing: t }), this._stageDataAttribute(i, m.MOBILE_ROW_SPACING, t), this._stageSpacerHeight(i, I, t), i.apply(new _(`Changed mobile row spacing to ${t}px`));
285
223
  }
286
224
  // ========================================================================
287
- // Data Attribute Storage
225
+ // Staging helpers (the handlers apply once)
288
226
  // ========================================================================
289
- /**
290
- * Stores a spacing value as a data attribute on the block root element
291
- */
292
- _storeDataAttribute(t, e) {
227
+ /** Horizontal padding on every card cell inside the container the selector finds. */
228
+ _stageColumnPadding(t, i, o) {
229
+ var d;
230
+ const n = (d = this.currentNode) == null ? void 0 : d.querySelector(i);
231
+ if (!this.currentNode || !n)
232
+ return;
233
+ const c = u.getConfig(this.currentNode).layout || b(this.currentNode), g = `0 ${o / 2}px`;
234
+ if (c === "grid") {
235
+ Array.from(n.querySelectorAll(".attribute-cell")).forEach((C) => {
236
+ t.modifyHtml(C).setStyle("padding", g);
237
+ });
238
+ return;
239
+ }
240
+ Array.from(n.querySelectorAll(".product-card-wrapper")).forEach((C) => {
241
+ const h = "parent" in C ? C.parent() : void 0;
242
+ h && t.modifyHtml(h).setStyle("padding", g);
243
+ });
244
+ }
245
+ /** Height on every spacer row inside the container the selector finds. */
246
+ _stageSpacerHeight(t, i, o) {
247
+ var a;
248
+ const n = (a = this.currentNode) == null ? void 0 : a.querySelector(i);
249
+ n && Array.from(n.querySelectorAll(".spacer")).forEach((c) => {
250
+ t.modifyHtml(c).setStyle("height", `${o}px`);
251
+ });
252
+ }
253
+ /** Mirrors a spacing value onto the block root as a data attribute (regeneration reads it back). */
254
+ _stageDataAttribute(t, i, o) {
293
255
  const n = U(this.currentNode);
294
- n && this.api.getDocumentModifier().modifyHtml(n).setAttribute(t, e.toString()).apply(new S(`Store ${t}`));
256
+ n && t.modifyHtml(n).setAttribute(i, o.toString());
295
257
  }
296
258
  // ========================================================================
297
259
  // Event Listeners
298
260
  // ========================================================================
299
261
  _listenToFormUpdates() {
300
- this.api.onValueChanged(o.COLUMN_SPACING, (t) => {
301
- const e = parseInt(t);
302
- Number.isNaN(e) || this._debouncedOnColumnSpacingChange(e);
303
- }), this.api.onValueChanged(o.ROW_SPACING, (t) => {
304
- const e = parseInt(t);
305
- Number.isNaN(e) || this._debouncedOnRowSpacingChange(e);
306
- }), this.api.onValueChanged(o.MOBILE_COLUMN_SPACING, (t) => {
307
- const e = parseInt(t);
308
- Number.isNaN(e) || this._debouncedOnMobileColumnSpacingChange(e);
309
- }), this.api.onValueChanged(o.MOBILE_ROW_SPACING, (t) => {
310
- const e = parseInt(t);
311
- Number.isNaN(e) || this._debouncedOnMobileRowSpacingChange(e);
262
+ this.api.onValueChanged(e.COLUMN_SPACING, (t) => {
263
+ const i = parseInt(t);
264
+ Number.isNaN(i) || this._debouncedOnColumnSpacingChange(i);
265
+ }), this.api.onValueChanged(e.ROW_SPACING, (t) => {
266
+ const i = parseInt(t);
267
+ Number.isNaN(i) || this._debouncedOnRowSpacingChange(i);
268
+ }), this.api.onValueChanged(e.MOBILE_COLUMN_SPACING, (t) => {
269
+ const i = parseInt(t);
270
+ Number.isNaN(i) || this._debouncedOnMobileColumnSpacingChange(i);
271
+ }), this.api.onValueChanged(e.MOBILE_ROW_SPACING, (t) => {
272
+ const i = parseInt(t);
273
+ Number.isNaN(i) || this._debouncedOnMobileRowSpacingChange(i);
312
274
  });
313
275
  }
314
276
  /**
@@ -323,5 +285,5 @@ class j extends E {
323
285
  }
324
286
  export {
325
287
  V as SPACING_CONTROL_ID,
326
- j as SpacingControl
288
+ k as SpacingControl
327
289
  };