@useinsider/guido 3.7.0 → 3.7.1-beta.05a2232

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 (56) hide show
  1. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.js +2 -2
  2. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +24 -22
  3. package/dist/composables/useHtmlValidator.js +79 -73
  4. package/dist/composables/useSave.js +17 -16
  5. package/dist/composables/validators/useUnsubscribeBlockValidator.js +32 -0
  6. package/dist/enums/html-validator.js +13 -5
  7. package/dist/enums/toaster.js +1 -1
  8. package/dist/extensions/Blocks/Recommendation/block.js +35 -16
  9. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +35 -30
  10. package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +62 -50
  11. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +208 -193
  12. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +18 -17
  13. package/dist/extensions/Blocks/Recommendation/useRecommendationBlockWarning.js +16 -0
  14. package/dist/extensions/Blocks/Recommendation/utils/recommendationBlockCount.js +9 -0
  15. package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +9 -9
  16. package/dist/extensions/Blocks/Unsubscribe/block.js +123 -73
  17. package/dist/extensions/Blocks/Unsubscribe/control.js +33 -26
  18. package/dist/extensions/Blocks/Unsubscribe/template.js +4 -4
  19. package/dist/extensions/Blocks/Unsubscribe/utils/constants.js +4 -3
  20. package/dist/guido.css +1 -1
  21. package/dist/src/composables/validators/useUnsubscribeBlockValidator.d.ts +3 -0
  22. package/dist/src/enums/html-validator.d.ts +4 -0
  23. package/dist/src/enums/toaster.d.ts +2 -1
  24. package/dist/src/extensions/Blocks/Recommendation/block.d.ts +13 -0
  25. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +1 -0
  26. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +1 -0
  27. package/dist/src/extensions/Blocks/Recommendation/useRecommendationBlockWarning.d.ts +12 -0
  28. package/dist/src/extensions/Blocks/Recommendation/utils/recommendationBlockCount.d.ts +28 -0
  29. package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +2 -3
  30. package/dist/src/extensions/Blocks/Unsubscribe/block.d.ts +9 -0
  31. package/dist/src/extensions/Blocks/Unsubscribe/control.d.ts +1 -0
  32. package/dist/src/extensions/Blocks/Unsubscribe/utils/constants.d.ts +1 -0
  33. package/dist/static/styles/components/base-input.css.js +5 -0
  34. package/dist/stores/autosave.js +6 -6
  35. package/dist/stores/dynamic-content.js +1 -1
  36. package/package.json +1 -1
  37. package/dist/src/composables/useApiExample.d.ts +0 -63
  38. package/dist/src/config/migrator/recommendation/parseLegacyConfig.test.d.ts +0 -1
  39. package/dist/src/config/migrator/recommendation/settingsMapper.test.d.ts +0 -1
  40. package/dist/src/config/migrator/recommendation/themeMapper.test.d.ts +0 -1
  41. package/dist/src/config/migrator/recommendationMigrator.test.d.ts +0 -1
  42. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.test.d.ts +0 -1
  43. package/dist/src/extensions/Blocks/Recommendation/services/configService.test.d.ts +0 -1
  44. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.test.d.ts +0 -1
  45. package/dist/src/extensions/Blocks/Recommendation/templates/utils.test.d.ts +0 -1
  46. package/dist/src/extensions/Blocks/Recommendation/utils/filterUtil.test.d.ts +0 -1
  47. package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMap.test.d.ts +0 -1
  48. package/dist/src/extensions/Blocks/Recommendation/utils/priceFormatter.test.d.ts +0 -1
  49. package/dist/src/stores/config.test.d.ts +0 -1
  50. package/dist/src/utils/ampErrorFilter.test.d.ts +0 -1
  51. package/dist/src/utils/htmlEscape.test.d.ts +0 -1
  52. package/dist/src/utils/templatePreparation.test.d.ts +0 -1
  53. package/dist/src/vitest.setup.d.ts +0 -0
  54. /package/dist/src/composables/{useRecommendation.test.d.ts → validators/useUnsubscribeBlockValidator.test.d.ts} +0 -0
  55. /package/dist/src/{config/migrator/recommendation/compositionMapper.test.d.ts → extensions/Blocks/Recommendation/block.test.d.ts} +0 -0
  56. /package/dist/src/{config/migrator/recommendation/extractors.test.d.ts → extensions/Blocks/Recommendation/utils/recommendationBlockCount.test.d.ts} +0 -0
@@ -5,32 +5,33 @@ import { CommonControl as g } from "../../../common-control.js";
5
5
  import { DEFAULT_NODE_CONFIG as a } from "../../constants/defaultConfig.js";
6
6
  import { RecommendationConfigService as h } from "../../services/configService.js";
7
7
  import { useRecommendationExtensionStore as y } from "../../store/recommendation.js";
8
- import { AlgorithmControl as N } from "./algorithm.js";
8
+ import { AlgorithmControl as R } from "./algorithm.js";
9
9
  import { ALGORITHM_CONTROL_ID as Q } from "./algorithm.js";
10
- import { CurrencyControl as R } from "./currency.js";
10
+ import { CurrencyControl as b } from "./currency.js";
11
11
  import { CURRENCY_CONTROL_ID as Z } from "./currency.js";
12
- import { FiltersControl as _ } from "./filters.js";
12
+ import { FiltersControl as N } from "./filters.js";
13
13
  import { FILTERS_CONTROL_ID as et } from "./filters.js";
14
- import { LayoutOrientationControl as b } from "./layoutOrientation.js";
14
+ import { LayoutOrientationControl as I } from "./layoutOrientation.js";
15
15
  import { LAYOUT_ORIENTATION_CONTROL_ID as rt } from "./layoutOrientation.js";
16
- import { LocaleControl as O } from "./locale.js";
16
+ import { LocaleControl as _ } from "./locale.js";
17
17
  import { LOCALE_CONTROL_ID as it } from "./locale.js";
18
- import { ProductCountControl as I } from "./productCount.js";
18
+ import { ProductCountControl as O } from "./productCount.js";
19
19
  import { PRODUCT_COUNT_CONTROL_ID as at } from "./productCount.js";
20
20
  import { ProductLayoutControl as T } from "./productLayout.js";
21
21
  import { PRODUCT_LAYOUT_CONTROL_ID as lt } from "./productLayout.js";
22
22
  import { ShuffleControl as S } from "./shuffle.js";
23
23
  import { SHUFFLE_CONTROL_ID as dt } from "./shuffle.js";
24
- import { setCurrencyAttributes as L, getBlockElement as P, updateProductContentInPlace as D, regenerateProductRowsWithStyles as k } from "./utils.js";
25
- import { adjustProductsToSize as mt, formatProductPrice as ft, getCardComposition as Ct, getCurrentLayout as pt, reapplySpacing as gt, regenerateMobileProductRows as yt, regenerateProductRows as Nt, updatePricesInPlace as Rt, updateSingleProductContent as _t } from "./utils.js";
24
+ import { setCurrencyAttributes as L, getBlockElement as P, updateProductContentInPlace as k, regenerateProductRowsWithStyles as D } from "./utils.js";
25
+ import { adjustProductsToSize as mt, formatProductPrice as ft, getCardComposition as Ct, getCurrentLayout as pt, reapplySpacing as gt, regenerateMobileProductRows as yt, regenerateProductRows as Rt, updatePricesInPlace as bt, updateSingleProductContent as Nt } from "./utils.js";
26
26
  import { useDebounceFn as m } from "../../../../../node_modules/@vueuse/shared/index.js";
27
- const E = "recommendation-id", v = "ui-elements-recommendation-block";
27
+ const E = "recommendation-id", w = "ui-elements-recommendation-block";
28
28
  class K extends g {
29
29
  constructor() {
30
30
  super(...arguments);
31
31
  s(this, "store", y());
32
32
  s(this, "storeUnsubscription", () => {
33
33
  });
34
+ s(this, "syncedBlockIds", /* @__PURE__ */ new Set());
34
35
  // Sub-control instances for lifecycle management
35
36
  s(this, "algorithmControl", null);
36
37
  s(this, "localeControl", null);
@@ -62,11 +63,11 @@ class K extends g {
62
63
  if (!this.currentNode || !this.api)
63
64
  return;
64
65
  const e = this.api.getDocumentModifier();
65
- D({
66
+ k({
66
67
  currentNode: this.currentNode,
67
68
  documentModifier: e,
68
69
  products: t
69
- }) || k({
70
+ }) || D({
70
71
  currentNode: this.currentNode,
71
72
  documentModifier: e,
72
73
  products: t
@@ -74,10 +75,10 @@ class K extends g {
74
75
  }, 100));
75
76
  }
76
77
  getId() {
77
- return v;
78
+ return w;
78
79
  }
79
80
  getTemplate() {
80
- return this.algorithmControl = new N(), this.localeControl = new O(), this.currencyControl = new R(), this.productCountControl = new I(), this.productLayoutControl = new T(), this.filtersControl = new _(), this.shuffleControl = new S(), this.layoutOrientationControl = new b(), [
81
+ return this.algorithmControl = new R(), this.localeControl = new _(), this.currencyControl = new b(), this.productCountControl = new O(), this.productLayoutControl = new T(), this.filtersControl = new N(), this.shuffleControl = new S(), this.layoutOrientationControl = new I(), [
81
82
  this.algorithmControl,
82
83
  this.localeControl,
83
84
  this.currencyControl,
@@ -102,19 +103,19 @@ class K extends g {
102
103
  `;
103
104
  }
104
105
  async onRender() {
105
- var e;
106
- const t = this._getRecommendationIdFromNode(this.currentNode) ?? this.store.currentRecommendationId;
107
- if (t !== null && this.store.setCurrentBlock(t), this._listenStateUpdates(), t !== null && ((e = this.store.blockStates[t]) != null && e.isInitialized)) {
106
+ var o;
107
+ const t = this._getRecommendationIdFromNode(this.currentNode), e = t ?? this.store.currentRecommendationId;
108
+ if (e !== null && this.store.setCurrentBlock(e), t !== null && !this.syncedBlockIds.has(t) && (this.syncedBlockIds.add(t), this._syncNodeConfigToStore()), this._listenStateUpdates(), e !== null && ((o = this.store.blockStates[e]) != null && o.isInitialized)) {
108
109
  this._initializeSubControls();
109
110
  return;
110
111
  }
111
- await this._fetchBlockData(t), this._initializeSubControls();
112
+ await this._fetchBlockData(e), this._initializeSubControls();
112
113
  }
113
114
  onTemplateNodeUpdated(t) {
114
115
  var r;
115
116
  super.onTemplateNodeUpdated(t);
116
117
  const e = this._getRecommendationIdFromNode(t);
117
- e !== null && e !== this.store.currentRecommendationId && this.store.setCurrentBlock(e), e !== null && this._syncNodeConfigToStore(), e !== null && !((r = this.store.blockStates[e]) != null && r.isInitialized) && this._fetchBlockData(e).then(() => {
118
+ e !== null && e !== this.store.currentRecommendationId && this.store.setCurrentBlock(e), e !== null && !this.syncedBlockIds.has(e) && (this.syncedBlockIds.add(e), this._syncNodeConfigToStore()), e !== null && !((r = this.store.blockStates[e]) != null && r.isInitialized) && this._fetchBlockData(e).then(() => {
118
119
  this._initializeSubControls();
119
120
  }), [
120
121
  this.layoutOrientationControl,
@@ -183,6 +184,10 @@ class K extends g {
183
184
  language: t.language,
184
185
  size: t.size,
185
186
  productIds: t.productIds,
187
+ cardsInRow: t.cardsInRow,
188
+ mobileCardsInRow: t.mobileCardsInRow,
189
+ mobileLayoutEnabled: t.mobileLayoutEnabled,
190
+ orientation: t.layout,
186
191
  // Only sync filters from node config during initial load.
187
192
  // After initialization, the Pinia store is the source of truth
188
193
  // for filters (edited via the filter drawer).
@@ -342,19 +347,19 @@ class K extends g {
342
347
  }
343
348
  export {
344
349
  Q as ALGORITHM_CONTROL_ID,
345
- N as AlgorithmControl,
346
- v as CONTROL_BLOCK_ID,
350
+ R as AlgorithmControl,
351
+ w as CONTROL_BLOCK_ID,
347
352
  Z as CURRENCY_CONTROL_ID,
348
- R as CurrencyControl,
353
+ b as CurrencyControl,
349
354
  et as FILTERS_CONTROL_ID,
350
- _ as FiltersControl,
355
+ N as FiltersControl,
351
356
  rt as LAYOUT_ORIENTATION_CONTROL_ID,
352
357
  it as LOCALE_CONTROL_ID,
353
- b as LayoutOrientationControl,
354
- O as LocaleControl,
358
+ I as LayoutOrientationControl,
359
+ _ as LocaleControl,
355
360
  at as PRODUCT_COUNT_CONTROL_ID,
356
361
  lt as PRODUCT_LAYOUT_CONTROL_ID,
357
- I as ProductCountControl,
362
+ O as ProductCountControl,
358
363
  T as ProductLayoutControl,
359
364
  K as RecommendationBlockControl,
360
365
  dt as SHUFFLE_CONTROL_ID,
@@ -366,10 +371,10 @@ export {
366
371
  pt as getCurrentLayout,
367
372
  gt as reapplySpacing,
368
373
  yt as regenerateMobileProductRows,
369
- Nt as regenerateProductRows,
370
- k as regenerateProductRowsWithStyles,
374
+ Rt as regenerateProductRows,
375
+ D as regenerateProductRowsWithStyles,
371
376
  L as setCurrencyAttributes,
372
- Rt as updatePricesInPlace,
373
- D as updateProductContentInPlace,
374
- _t as updateSingleProductContent
377
+ bt as updatePricesInPlace,
378
+ k as updateProductContentInPlace,
379
+ Nt as updateSingleProductContent
375
380
  };
@@ -1,13 +1,13 @@
1
- var I = Object.defineProperty;
2
- var E = (a, n, t) => n in a ? I(a, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[n] = t;
3
- var u = (a, n, t) => E(a, typeof n != "symbol" ? n + "" : n, t);
4
- import { EditorStatePropertyType as O, PreviewDeviceMode as f, UEAttr as N } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
- import { CommonControl as T } from "../../../common-control.js";
6
- import { MAX_PRODUCTS_PER_ROW as p, MAX_MOBILE_PRODUCTS_PER_ROW as M, DEFAULT_MOBILE_CARDS_IN_ROW as L, DEFAULT_COLUMN_SPACING as P, DEFAULT_MOBILE_COLUMN_SPACING as y } from "../../constants/layout.js";
7
- import { RecommendationConfigService as i } from "../../services/configService.js";
1
+ var E = Object.defineProperty;
2
+ var f = (a, n, t) => n in a ? E(a, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[n] = t;
3
+ var c = (a, n, t) => f(a, typeof n != "symbol" ? n + "" : n, t);
4
+ import { EditorStatePropertyType as O, PreviewDeviceMode as N, UEAttr as T } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
+ import { CommonControl as M } from "../../../common-control.js";
6
+ import { MAX_PRODUCTS_PER_ROW as m, MAX_MOBILE_PRODUCTS_PER_ROW as P, DEFAULT_MOBILE_CARDS_IN_ROW as l, DEFAULT_COLUMN_SPACING as w, DEFAULT_MOBILE_COLUMN_SPACING as y } from "../../constants/layout.js";
7
+ import { RecommendationConfigService as s } from "../../services/configService.js";
8
8
  import { useRecommendationExtensionStore as D } from "../../store/recommendation.js";
9
- import { setMobileLayoutOptOut as m, ensureMobileCssRulesExist as C } from "../mobileLayout/cssRules.js";
10
- import { getCurrentLayout as w, getBlockElement as U, regenerateProductRowsWithStyles as b, regenerateMobileProductRows as g, adjustProductsToSize as A } from "./utils.js";
9
+ import { setMobileLayoutOptOut as C, ensureMobileCssRulesExist as L } from "../mobileLayout/cssRules.js";
10
+ import { getCurrentLayout as U, getBlockElement as A, adjustProductsToSize as b, regenerateProductRowsWithStyles as g, regenerateMobileProductRows as I } from "./utils.js";
11
11
  import { useDebounceFn as B } from "../../../../../node_modules/@vueuse/shared/index.js";
12
12
  const S = "recommendation-product-layout-control", e = {
13
13
  // "Products in One Row" — shown when toggle is OFF
@@ -23,14 +23,14 @@ const S = "recommendation-product-layout-control", e = {
23
23
  MOBILE_LAYOUT_TOGGLE: "mobileLayoutEnabled",
24
24
  MOBILE_LAYOUT_LABEL: "mobileLayoutLabel"
25
25
  };
26
- class v extends T {
26
+ class v extends M {
27
27
  constructor() {
28
28
  super(...arguments);
29
29
  // Store is used for backward compatibility with product fetching and regeneration
30
- u(this, "store", D());
31
- u(this, "storeUnsubscription", () => {
30
+ c(this, "store", D());
31
+ c(this, "storeUnsubscription", () => {
32
32
  });
33
- u(this, "_debouncedRegenerateProductRows", B(() => {
33
+ c(this, "_debouncedRegenerateProductRows", B(() => {
34
34
  this._regenerateProductRows();
35
35
  }, 500));
36
36
  }
@@ -45,19 +45,19 @@ class v extends T {
45
45
  text: this.api.translate("Products in One Row"),
46
46
  name: e.PRODUCT_IN_ROW_LABEL
47
47
  }),
48
- this._GuCounter({ name: e.PRODUCT_IN_ROW, maxValue: p }),
48
+ this._GuCounter({ name: e.PRODUCT_IN_ROW, maxValue: m }),
49
49
  this._GuLabel({
50
50
  text: this.api.translate("Products in One Row on Desktop"),
51
51
  name: e.PRODUCT_IN_ROW_DESKTOP_LABEL
52
52
  }),
53
- this._GuCounter({ name: e.PRODUCT_IN_ROW_DESKTOP, maxValue: p }),
53
+ this._GuCounter({ name: e.PRODUCT_IN_ROW_DESKTOP, maxValue: m }),
54
54
  this._GuLabel({
55
55
  text: this.api.translate("Products in One Row on Mobile"),
56
56
  name: e.MOBILE_CARDS_IN_ROW_LABEL
57
57
  }),
58
58
  this._GuCounter({
59
59
  name: e.MOBILE_CARDS_IN_ROW,
60
- maxValue: M
60
+ maxValue: P
61
61
  }),
62
62
  this._GuLabel({
63
63
  text: this.api.translate("Mobile Layout Optimization"),
@@ -83,7 +83,7 @@ class v extends T {
83
83
  this.storeUnsubscription();
84
84
  }
85
85
  _setFormValues() {
86
- const t = i.getConfig(this.currentNode);
86
+ const t = s.getConfig(this.currentNode);
87
87
  this.api.updateValues({
88
88
  [e.PRODUCT_IN_ROW]: t.cardsInRow,
89
89
  [e.PRODUCT_IN_ROW_DESKTOP]: t.cardsInRow,
@@ -95,7 +95,7 @@ class v extends T {
95
95
  * Returns true when the editor preview is in mobile mode.
96
96
  */
97
97
  _isMobilePreview() {
98
- return this.api.getEditorState()[O.previewDeviceMode] === f.MOBILE;
98
+ return this.api.getEditorState()[O.previewDeviceMode] === N.MOBILE;
99
99
  }
100
100
  /**
101
101
  * Updates counter visibility based on layout, mobileLayoutEnabled, and editor preview mode.
@@ -109,23 +109,23 @@ class v extends T {
109
109
  * elements, which Stripo does not apply reliably.
110
110
  */
111
111
  _updateProductsInRowVisibility() {
112
- var R;
113
- const t = i.getConfig(this.currentNode), o = (t.layout || w(this.currentNode)) === "grid", { mobileLayoutEnabled: r } = t, d = this._isMobilePreview();
112
+ var p;
113
+ const t = s.getConfig(this.currentNode), o = (t.layout || U(this.currentNode)) === "grid", { mobileLayoutEnabled: r } = t, u = this._isMobilePreview();
114
114
  this.api.setVisibility(e.MOBILE_LAYOUT_TOGGLE, o), this.api.setVisibility(e.MOBILE_LAYOUT_LABEL, o);
115
- const c = o && !r, _ = o && r && !d, l = o && r && d;
116
- this.api.setVisibility(e.PRODUCT_IN_ROW, c), this.api.setVisibility(e.PRODUCT_IN_ROW_LABEL, c), this.api.setVisibility(e.PRODUCT_IN_ROW_DESKTOP, _), this.api.setVisibility(e.PRODUCT_IN_ROW_DESKTOP_LABEL, _), this.api.setVisibility(e.MOBILE_CARDS_IN_ROW, l), this.api.setVisibility(e.MOBILE_CARDS_IN_ROW_LABEL, l);
117
- const h = (R = this.getContainer()) == null ? void 0 : R.querySelector("[data-product-layout-control]");
118
- h && (h.style.display = o ? "" : "none");
115
+ const d = o && !r, _ = o && r && !u, h = o && r && u;
116
+ this.api.setVisibility(e.PRODUCT_IN_ROW, d), this.api.setVisibility(e.PRODUCT_IN_ROW_LABEL, d), this.api.setVisibility(e.PRODUCT_IN_ROW_DESKTOP, _), this.api.setVisibility(e.PRODUCT_IN_ROW_DESKTOP_LABEL, _), this.api.setVisibility(e.MOBILE_CARDS_IN_ROW, h), this.api.setVisibility(e.MOBILE_CARDS_IN_ROW_LABEL, h);
117
+ const R = (p = this.getContainer()) == null ? void 0 : p.querySelector("[data-product-layout-control]");
118
+ R && (R.style.display = o ? "" : "none");
119
119
  }
120
120
  /**
121
121
  * Initializes the mobile layout toggle using the same pattern as shuffle.ts.
122
122
  * Sets the initial UI attribute value from the node config.
123
123
  */
124
124
  _initializeMobileLayoutToggle() {
125
- const t = i.getConfig(this.currentNode);
125
+ const t = s.getConfig(this.currentNode);
126
126
  this.api.setUIEAttribute(
127
127
  e.MOBILE_LAYOUT_TOGGLE,
128
- N.SELECTPICKER.items,
128
+ T.SELECTPICKER.items,
129
129
  t.mobileLayoutEnabled
130
130
  );
131
131
  }
@@ -137,13 +137,13 @@ class v extends T {
137
137
  _onMobileLayoutToggleChange(t) {
138
138
  if (!this.currentNode)
139
139
  return;
140
- const s = i.getConfig(this.currentNode);
141
- if (s.mobileLayoutEnabled === t)
140
+ const i = s.getConfig(this.currentNode);
141
+ if (i.mobileLayoutEnabled === t)
142
142
  return;
143
- const o = U(this.currentNode);
143
+ const o = A(this.currentNode);
144
144
  if (t) {
145
- const r = s.previousMobileCardsInRow || L;
146
- i.updateConfig(
145
+ const r = i.previousMobileCardsInRow || l;
146
+ s.updateConfig(
147
147
  this.api,
148
148
  this.currentNode,
149
149
  {
@@ -152,27 +152,36 @@ class v extends T {
152
152
  },
153
153
  "Enabled mobile layout optimization"
154
154
  ), this.store.patchCurrentBlockConfig(
155
- { mobileLayoutEnabled: !0 },
155
+ {
156
+ mobileLayoutEnabled: !0,
157
+ mobileCardsInRow: r
158
+ },
156
159
  { triggerRefetch: !1 }
157
- ), o && m(this.api, o, !1), C(this.api), b({
160
+ ), o && C(this.api, o, !1), L(this.api);
161
+ const u = parseInt(i.size) || 6, d = b(this.store.recommendationProducts, u);
162
+ g({
158
163
  currentNode: this.currentNode,
159
- documentModifier: this.api.getDocumentModifier()
164
+ documentModifier: this.api.getDocumentModifier(),
165
+ products: d
160
166
  });
161
167
  } else {
162
- const r = s.mobileCardsInRow;
163
- i.updateConfig(
168
+ const r = i.mobileCardsInRow;
169
+ s.updateConfig(
164
170
  this.api,
165
171
  this.currentNode,
166
172
  {
167
173
  mobileLayoutEnabled: !1,
168
174
  previousMobileCardsInRow: r,
169
- mobileCardsInRow: L
175
+ mobileCardsInRow: l
170
176
  },
171
177
  "Disabled mobile layout optimization"
172
178
  ), this.store.patchCurrentBlockConfig(
173
- { mobileLayoutEnabled: !1 },
179
+ {
180
+ mobileLayoutEnabled: !1,
181
+ mobileCardsInRow: l
182
+ },
174
183
  { triggerRefetch: !1 }
175
- ), o && m(this.api, o, !0), g({
184
+ ), o && C(this.api, o, !0), I({
176
185
  currentNode: this.currentNode,
177
186
  documentModifier: this.api.getDocumentModifier()
178
187
  });
@@ -180,10 +189,10 @@ class v extends T {
180
189
  this._setFormValues(), this._updateProductsInRowVisibility();
181
190
  }
182
191
  _onProductsInRowChange(t) {
183
- if (!this.currentNode || i.getConfig(this.currentNode).cardsInRow === t)
192
+ if (!this.currentNode || s.getConfig(this.currentNode).cardsInRow === t)
184
193
  return;
185
- const o = t === 1 ? 0 : P;
186
- i.updateConfig(
194
+ const o = t === 1 ? 0 : w;
195
+ s.updateConfig(
187
196
  this.api,
188
197
  this.currentNode,
189
198
  { cardsInRow: t, columnSpacing: o },
@@ -191,22 +200,25 @@ class v extends T {
191
200
  ), this.store.patchCurrentBlockConfig({ cardsInRow: t }, { triggerRefetch: !1 }), this._debouncedRegenerateProductRows();
192
201
  }
193
202
  _onMobileCardsInRowChange(t) {
194
- if (!this.currentNode || i.getConfig(this.currentNode).mobileCardsInRow === t)
203
+ if (!this.currentNode || s.getConfig(this.currentNode).mobileCardsInRow === t)
195
204
  return;
196
205
  const o = t === 1 ? 0 : y;
197
- i.updateConfig(
206
+ s.updateConfig(
198
207
  this.api,
199
208
  this.currentNode,
200
209
  { mobileCardsInRow: t, mobileColumnSpacing: o },
201
210
  `Changed mobile products per row to ${t}`
202
- ), C(this.api), g({
211
+ ), L(this.api), this.store.patchCurrentBlockConfig(
212
+ { mobileCardsInRow: t },
213
+ { triggerRefetch: !1 }
214
+ ), I({
203
215
  currentNode: this.currentNode,
204
216
  documentModifier: this.api.getDocumentModifier()
205
217
  });
206
218
  }
207
219
  _regenerateProductRows() {
208
- const t = i.getConfig(this.currentNode), s = parseInt(t.size) || 6, o = A(this.store.recommendationProducts, s);
209
- b({
220
+ const t = s.getConfig(this.currentNode), i = parseInt(t.size) || 6, o = b(this.store.recommendationProducts, i);
221
+ g({
210
222
  currentNode: this.currentNode,
211
223
  documentModifier: this.api.getDocumentModifier(),
212
224
  products: o
@@ -230,8 +242,8 @@ class v extends T {
230
242
  _listenStateUpdates() {
231
243
  let t = this.store.recommendationConfigs.orientation;
232
244
  this.storeUnsubscription = this.store.$subscribe(() => {
233
- const s = this.store.recommendationConfigs.orientation;
234
- s !== t && (t = s, this._updateProductsInRowVisibility());
245
+ const i = this.store.recommendationConfigs.orientation;
246
+ i !== t && (t = i, this._updateProductsInRowVisibility());
235
247
  });
236
248
  }
237
249
  /**
@@ -243,7 +255,7 @@ class v extends T {
243
255
  this.api.onEditorStatePropUpdated(
244
256
  O.previewDeviceMode,
245
257
  () => {
246
- i.getConfig(this.currentNode).mobileLayoutEnabled && this._updateProductsInRowVisibility();
258
+ s.getConfig(this.currentNode).mobileLayoutEnabled && this._updateProductsInRowVisibility();
247
259
  }
248
260
  );
249
261
  }