@useinsider/guido 3.6.0-beta.596b70e → 3.6.0-beta.5cbaa8f
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.
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +12 -10
- package/dist/extensions/Blocks/Recommendation/controls/main/layoutOrientation.js +32 -24
- package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +40 -34
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +338 -310
- package/dist/extensions/Blocks/Recommendation/extension.js +5 -6
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +2 -3
- package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +146 -117
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +30 -49
- package/dist/extensions/Blocks/Recommendation/templates/index.js +8 -9
- package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +83 -110
- package/dist/extensions/Blocks/Recommendation/templates/list/template.js +21 -31
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +54 -90
- package/dist/extensions/Blocks/Recommendation/utils/preserveTextStyles.js +19 -24
- package/dist/extensions/Blocks/Recommendation/utils/tagName.js +16 -20
- package/dist/extensions/Blocks/Unsubscribe/block.js +122 -72
- package/dist/extensions/Blocks/controlFactories.js +133 -159
- package/dist/src/extensions/Blocks/Items/controls/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/button/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +47 -20
- package/dist/src/extensions/Blocks/Recommendation/templates/grid/template.d.ts +4 -4
- package/dist/src/extensions/Blocks/Recommendation/templates/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/templates/list/template.d.ts +2 -3
- package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +11 -127
- package/dist/src/extensions/Blocks/Recommendation/utils/preserveTextStyles.d.ts +0 -15
- package/dist/src/extensions/Blocks/Recommendation/utils/stylePreserver.d.ts +113 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/tagName.d.ts +9 -20
- package/dist/src/extensions/Blocks/Unsubscribe/block.d.ts +9 -0
- package/dist/src/extensions/Blocks/controlFactories.d.ts +1 -11
- package/package.json +1 -1
- package/dist/extensions/Blocks/Recommendation/utils/captureStyleTemplates.js +0 -139
- package/dist/src/extensions/Blocks/Recommendation/templates/grid/elementRenderer.test.d.ts +0 -1
- package/dist/src/extensions/Blocks/Recommendation/templates/list/elementRenderer.test.d.ts +0 -1
- package/dist/src/extensions/Blocks/Recommendation/templates/utils.test.d.ts +0 -1
- package/dist/src/extensions/Blocks/Recommendation/utils/captureStyleTemplates.d.ts +0 -44
- package/dist/src/extensions/Blocks/Recommendation/utils/captureStyleTemplates.test.d.ts +0 -1
- package/dist/src/extensions/Blocks/Recommendation/utils/preserveTextStyles.test.d.ts +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var C = Object.defineProperty;
|
|
2
|
-
var p = (d,
|
|
3
|
-
var s = (d,
|
|
2
|
+
var p = (d, c, t) => c in d ? C(d, c, { enumerable: !0, configurable: !0, writable: !0, value: t }) : d[c] = t;
|
|
3
|
+
var s = (d, c, t) => p(d, typeof c != "symbol" ? c + "" : c, t);
|
|
4
4
|
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";
|
|
@@ -18,11 +18,11 @@ import { LOCALE_CONTROL_ID as it } from "./locale.js";
|
|
|
18
18
|
import { ProductCountControl as I } 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
|
-
import { PRODUCT_LAYOUT_CONTROL_ID as
|
|
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
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,
|
|
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";
|
|
26
26
|
import { useDebounceFn as m } from "../../../../../node_modules/@vueuse/shared/index.js";
|
|
27
27
|
const E = "recommendation-id", v = "ui-elements-recommendation-block";
|
|
28
28
|
class K extends g {
|
|
@@ -320,8 +320,8 @@ class K extends g {
|
|
|
320
320
|
}
|
|
321
321
|
const i = t.$state.configVersion;
|
|
322
322
|
i !== o && (o = i, this._persistFiltersToNodeConfig(), this._debouncedFetchProducts());
|
|
323
|
-
const
|
|
324
|
-
u && f && (e =
|
|
323
|
+
const l = t.recommendationProducts, u = l !== e, f = Array.isArray(l) && l.length > 0;
|
|
324
|
+
u && f && (e = l, this._debouncedRegenerateWithProducts());
|
|
325
325
|
});
|
|
326
326
|
}
|
|
327
327
|
/**
|
|
@@ -353,7 +353,7 @@ export {
|
|
|
353
353
|
b as LayoutOrientationControl,
|
|
354
354
|
O as LocaleControl,
|
|
355
355
|
at as PRODUCT_COUNT_CONTROL_ID,
|
|
356
|
-
|
|
356
|
+
lt as PRODUCT_LAYOUT_CONTROL_ID,
|
|
357
357
|
I as ProductCountControl,
|
|
358
358
|
T as ProductLayoutControl,
|
|
359
359
|
K as RecommendationBlockControl,
|
|
@@ -364,10 +364,12 @@ export {
|
|
|
364
364
|
P as getBlockElement,
|
|
365
365
|
Ct as getCardComposition,
|
|
366
366
|
pt as getCurrentLayout,
|
|
367
|
-
gt as
|
|
367
|
+
gt as reapplySpacing,
|
|
368
|
+
yt as regenerateMobileProductRows,
|
|
369
|
+
Nt as regenerateProductRows,
|
|
368
370
|
k as regenerateProductRowsWithStyles,
|
|
369
371
|
L as setCurrencyAttributes,
|
|
370
|
-
|
|
372
|
+
Rt as updatePricesInPlace,
|
|
371
373
|
D as updateProductContentInPlace,
|
|
372
|
-
|
|
374
|
+
_t as updateSingleProductContent
|
|
373
375
|
};
|
|
@@ -1,53 +1,61 @@
|
|
|
1
|
-
var
|
|
2
|
-
var p = (
|
|
3
|
-
var r = (
|
|
4
|
-
import { ModificationDescription as
|
|
5
|
-
import { CommonControl as
|
|
6
|
-
import { ATTR_DATA_CUSTOM_ATTRIBUTES as
|
|
7
|
-
import { LAYOUT_OPTIONS as
|
|
1
|
+
var O = Object.defineProperty;
|
|
2
|
+
var p = (o, e, t) => e in o ? O(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
|
|
3
|
+
var r = (o, e, t) => p(o, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { ModificationDescription as h } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
5
|
+
import { CommonControl as N } from "../../../common-control.js";
|
|
6
|
+
import { ATTR_DATA_CUSTOM_ATTRIBUTES as L } from "../../constants/selectors.js";
|
|
7
|
+
import { LAYOUT_OPTIONS as T, DEFAULT_MOBILE_ROW_SPACING as m, DEFAULT_MOBILE_COLUMN_SPACING as d, DEFAULT_ROW_SPACING as l, DEFAULT_COLUMN_SPACING as g } from "../../constants/layout.js";
|
|
8
8
|
import { DEFAULT_COMPOSITION as _ } from "../../constants/defaultConfig.js";
|
|
9
9
|
import { RecommendationConfigService as s } from "../../services/configService.js";
|
|
10
|
-
import { useRecommendationExtensionStore as
|
|
11
|
-
import { getCurrentLayout as
|
|
12
|
-
const
|
|
10
|
+
import { useRecommendationExtensionStore as f } from "../../store/recommendation.js";
|
|
11
|
+
import { getCurrentLayout as C, getBlockElement as I, regenerateProductRowsWithStyles as S } from "./utils.js";
|
|
12
|
+
const U = "recommendation-layout-orientation-control", A = "recommendationInfoBannerTest", a = {
|
|
13
13
|
LAYOUT: "layout"
|
|
14
|
-
},
|
|
14
|
+
}, y = "data-card-composition", i = {
|
|
15
15
|
LAYOUT: "data-layout",
|
|
16
16
|
COLUMN_SPACING: "data-column-spacing",
|
|
17
17
|
ROW_SPACING: "data-row-spacing",
|
|
18
18
|
MOBILE_COLUMN_SPACING: "data-mobile-column-spacing",
|
|
19
19
|
MOBILE_ROW_SPACING: "data-mobile-row-spacing"
|
|
20
20
|
};
|
|
21
|
-
class
|
|
21
|
+
class Y extends N {
|
|
22
22
|
constructor() {
|
|
23
23
|
super(...arguments);
|
|
24
|
-
r(this, "store",
|
|
24
|
+
r(this, "store", f());
|
|
25
25
|
r(this, "isChangingLayout", !1);
|
|
26
26
|
}
|
|
27
27
|
getId() {
|
|
28
|
-
return
|
|
28
|
+
return U;
|
|
29
29
|
}
|
|
30
30
|
getTemplate() {
|
|
31
31
|
return `
|
|
32
32
|
<div class="layout-control-container">
|
|
33
|
+
${this._GuOnPageMessage({ name: A })}
|
|
34
|
+
|
|
33
35
|
${this._GuTwoColumns([
|
|
34
36
|
this._GuLabel({ text: this.api.translate("Layout Orientation") }),
|
|
35
37
|
this._GuRadioButton({
|
|
36
38
|
name: a.LAYOUT,
|
|
37
|
-
buttons:
|
|
39
|
+
buttons: T
|
|
38
40
|
})
|
|
39
41
|
])}
|
|
40
42
|
</div>
|
|
41
43
|
`;
|
|
42
44
|
}
|
|
43
45
|
onRender() {
|
|
44
|
-
this.
|
|
46
|
+
this._setInfoMessageValue(
|
|
47
|
+
A,
|
|
48
|
+
this.api.translate(
|
|
49
|
+
`Note that updating the Layout Orientation, Number of Products and
|
|
50
|
+
Products in One Row settings resets the style of your Recommendation block.`
|
|
51
|
+
)
|
|
52
|
+
), this._setFormValues(), this._listenToFormUpdates();
|
|
45
53
|
}
|
|
46
54
|
onTemplateNodeUpdated(t) {
|
|
47
55
|
super.onTemplateNodeUpdated(t), this._setFormValues();
|
|
48
56
|
}
|
|
49
57
|
_setFormValues() {
|
|
50
|
-
const u = s.getConfig(this.currentNode).layout ||
|
|
58
|
+
const u = s.getConfig(this.currentNode).layout || C(this.currentNode);
|
|
51
59
|
this.api.updateValues({
|
|
52
60
|
[a.LAYOUT]: u
|
|
53
61
|
});
|
|
@@ -57,9 +65,9 @@ class w extends L {
|
|
|
57
65
|
* Updates node config, data attribute and regenerates product rows
|
|
58
66
|
*/
|
|
59
67
|
_onLayoutChange(t) {
|
|
60
|
-
if (this.isChangingLayout || !this.currentNode || (s.getConfig(this.currentNode).layout ||
|
|
68
|
+
if (this.isChangingLayout || !this.currentNode || (s.getConfig(this.currentNode).layout || C(this.currentNode)) === t)
|
|
61
69
|
return;
|
|
62
|
-
const c =
|
|
70
|
+
const c = I(this.currentNode);
|
|
63
71
|
if (c) {
|
|
64
72
|
this.isChangingLayout = !0;
|
|
65
73
|
try {
|
|
@@ -68,15 +76,15 @@ class w extends L {
|
|
|
68
76
|
this.currentNode,
|
|
69
77
|
{
|
|
70
78
|
layout: t,
|
|
71
|
-
columnSpacing:
|
|
79
|
+
columnSpacing: g,
|
|
72
80
|
rowSpacing: l,
|
|
73
81
|
mobileColumnSpacing: d,
|
|
74
82
|
mobileRowSpacing: m
|
|
75
83
|
},
|
|
76
84
|
`Changed layout to ${t}`
|
|
77
85
|
), this.store.patchCurrentBlockConfig({ orientation: t });
|
|
78
|
-
const
|
|
79
|
-
t === "list" ? (
|
|
86
|
+
const n = this.api.getDocumentModifier().modifyHtml(c).setAttribute(i.LAYOUT, t).setAttribute(i.COLUMN_SPACING, g.toString()).setAttribute(i.ROW_SPACING, l.toString()).setAttribute(i.MOBILE_COLUMN_SPACING, d.toString()).setAttribute(i.MOBILE_ROW_SPACING, m.toString());
|
|
87
|
+
t === "list" ? (n.setClass("es-m-p0"), n.setClass("ins-recommendation-list-layout")) : (n.removeClass("es-m-p0"), n.removeClass("ins-recommendation-list-layout")), n.setAttribute(y, _.join(",")).setAttribute(L, "[]"), n.apply(new h(`Update layout to ${t}`)), this._regenerateProductRows(t);
|
|
80
88
|
} finally {
|
|
81
89
|
this.isChangingLayout = !1;
|
|
82
90
|
}
|
|
@@ -102,6 +110,6 @@ class w extends L {
|
|
|
102
110
|
}
|
|
103
111
|
}
|
|
104
112
|
export {
|
|
105
|
-
|
|
106
|
-
|
|
113
|
+
U as LAYOUT_ORIENTATION_CONTROL_ID,
|
|
114
|
+
Y as LayoutOrientationControl
|
|
107
115
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
var I = Object.defineProperty;
|
|
2
2
|
var E = (a, n, t) => n in a ? I(a, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[n] = t;
|
|
3
3
|
var u = (a, n, t) => E(a, typeof n != "symbol" ? n + "" : n, t);
|
|
4
|
-
import { EditorStatePropertyType as
|
|
5
|
-
import { CommonControl as
|
|
6
|
-
import { MAX_PRODUCTS_PER_ROW as
|
|
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
7
|
import { RecommendationConfigService as i } from "../../services/configService.js";
|
|
8
|
-
import { useRecommendationExtensionStore as
|
|
9
|
-
import { setMobileLayoutOptOut as
|
|
10
|
-
import { getCurrentLayout as
|
|
11
|
-
import { useDebounceFn as
|
|
12
|
-
const
|
|
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";
|
|
11
|
+
import { useDebounceFn as B } from "../../../../../node_modules/@vueuse/shared/index.js";
|
|
12
|
+
const S = "recommendation-product-layout-control", e = {
|
|
13
13
|
// "Products in One Row" — shown when toggle is OFF
|
|
14
14
|
PRODUCT_IN_ROW: "cardsInRow",
|
|
15
15
|
PRODUCT_IN_ROW_LABEL: "cardsInRowLabel",
|
|
@@ -23,19 +23,19 @@ const B = "recommendation-product-layout-control", e = {
|
|
|
23
23
|
MOBILE_LAYOUT_TOGGLE: "mobileLayoutEnabled",
|
|
24
24
|
MOBILE_LAYOUT_LABEL: "mobileLayoutLabel"
|
|
25
25
|
};
|
|
26
|
-
class
|
|
26
|
+
class v extends T {
|
|
27
27
|
constructor() {
|
|
28
28
|
super(...arguments);
|
|
29
29
|
// Store is used for backward compatibility with product fetching and regeneration
|
|
30
|
-
u(this, "store",
|
|
30
|
+
u(this, "store", D());
|
|
31
31
|
u(this, "storeUnsubscription", () => {
|
|
32
32
|
});
|
|
33
|
-
u(this, "_debouncedRegenerateProductRows",
|
|
33
|
+
u(this, "_debouncedRegenerateProductRows", B(() => {
|
|
34
34
|
this._regenerateProductRows();
|
|
35
35
|
}, 500));
|
|
36
36
|
}
|
|
37
37
|
getId() {
|
|
38
|
-
return
|
|
38
|
+
return S;
|
|
39
39
|
}
|
|
40
40
|
getTemplate() {
|
|
41
41
|
return `
|
|
@@ -45,12 +45,12 @@ class Y extends N {
|
|
|
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:
|
|
48
|
+
this._GuCounter({ name: e.PRODUCT_IN_ROW, maxValue: p }),
|
|
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:
|
|
53
|
+
this._GuCounter({ name: e.PRODUCT_IN_ROW_DESKTOP, maxValue: p }),
|
|
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
|
|
@@ -95,7 +95,7 @@ class Y extends N {
|
|
|
95
95
|
* Returns true when the editor preview is in mobile mode.
|
|
96
96
|
*/
|
|
97
97
|
_isMobilePreview() {
|
|
98
|
-
return this.api.getEditorState()[
|
|
98
|
+
return this.api.getEditorState()[O.previewDeviceMode] === f.MOBILE;
|
|
99
99
|
}
|
|
100
100
|
/**
|
|
101
101
|
* Updates counter visibility based on layout, mobileLayoutEnabled, and editor preview mode.
|
|
@@ -110,10 +110,10 @@ class Y extends N {
|
|
|
110
110
|
*/
|
|
111
111
|
_updateProductsInRowVisibility() {
|
|
112
112
|
var R;
|
|
113
|
-
const t = i.getConfig(this.currentNode), o = (t.layout ||
|
|
113
|
+
const t = i.getConfig(this.currentNode), o = (t.layout || w(this.currentNode)) === "grid", { mobileLayoutEnabled: r } = t, d = 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,
|
|
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,
|
|
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
117
|
const h = (R = this.getContainer()) == null ? void 0 : R.querySelector("[data-product-layout-control]");
|
|
118
118
|
h && (h.style.display = o ? "" : "none");
|
|
119
119
|
}
|
|
@@ -125,7 +125,7 @@ class Y extends N {
|
|
|
125
125
|
const t = i.getConfig(this.currentNode);
|
|
126
126
|
this.api.setUIEAttribute(
|
|
127
127
|
e.MOBILE_LAYOUT_TOGGLE,
|
|
128
|
-
|
|
128
|
+
N.SELECTPICKER.items,
|
|
129
129
|
t.mobileLayoutEnabled
|
|
130
130
|
);
|
|
131
131
|
}
|
|
@@ -140,9 +140,9 @@ class Y extends N {
|
|
|
140
140
|
const s = i.getConfig(this.currentNode);
|
|
141
141
|
if (s.mobileLayoutEnabled === t)
|
|
142
142
|
return;
|
|
143
|
-
const o =
|
|
143
|
+
const o = U(this.currentNode);
|
|
144
144
|
if (t) {
|
|
145
|
-
const r = s.previousMobileCardsInRow ||
|
|
145
|
+
const r = s.previousMobileCardsInRow || L;
|
|
146
146
|
i.updateConfig(
|
|
147
147
|
this.api,
|
|
148
148
|
this.currentNode,
|
|
@@ -154,7 +154,7 @@ class Y extends N {
|
|
|
154
154
|
), this.store.patchCurrentBlockConfig(
|
|
155
155
|
{ mobileLayoutEnabled: !0 },
|
|
156
156
|
{ triggerRefetch: !1 }
|
|
157
|
-
), o &&
|
|
157
|
+
), o && m(this.api, o, !1), C(this.api), b({
|
|
158
158
|
currentNode: this.currentNode,
|
|
159
159
|
documentModifier: this.api.getDocumentModifier()
|
|
160
160
|
});
|
|
@@ -166,13 +166,13 @@ class Y extends N {
|
|
|
166
166
|
{
|
|
167
167
|
mobileLayoutEnabled: !1,
|
|
168
168
|
previousMobileCardsInRow: r,
|
|
169
|
-
mobileCardsInRow:
|
|
169
|
+
mobileCardsInRow: L
|
|
170
170
|
},
|
|
171
171
|
"Disabled mobile layout optimization"
|
|
172
172
|
), this.store.patchCurrentBlockConfig(
|
|
173
173
|
{ mobileLayoutEnabled: !1 },
|
|
174
174
|
{ triggerRefetch: !1 }
|
|
175
|
-
), o &&
|
|
175
|
+
), o && m(this.api, o, !0), g({
|
|
176
176
|
currentNode: this.currentNode,
|
|
177
177
|
documentModifier: this.api.getDocumentModifier()
|
|
178
178
|
});
|
|
@@ -180,26 +180,32 @@ class Y extends N {
|
|
|
180
180
|
this._setFormValues(), this._updateProductsInRowVisibility();
|
|
181
181
|
}
|
|
182
182
|
_onProductsInRowChange(t) {
|
|
183
|
-
!this.currentNode || i.getConfig(this.currentNode).cardsInRow === t
|
|
183
|
+
if (!this.currentNode || i.getConfig(this.currentNode).cardsInRow === t)
|
|
184
|
+
return;
|
|
185
|
+
const o = t === 1 ? 0 : P;
|
|
186
|
+
i.updateConfig(
|
|
184
187
|
this.api,
|
|
185
188
|
this.currentNode,
|
|
186
|
-
{ cardsInRow: t },
|
|
189
|
+
{ cardsInRow: t, columnSpacing: o },
|
|
187
190
|
`Changed products per row to ${t}`
|
|
188
|
-
), this.store.patchCurrentBlockConfig({ cardsInRow: t }, { triggerRefetch: !1 }), this._debouncedRegenerateProductRows()
|
|
191
|
+
), this.store.patchCurrentBlockConfig({ cardsInRow: t }, { triggerRefetch: !1 }), this._debouncedRegenerateProductRows();
|
|
189
192
|
}
|
|
190
193
|
_onMobileCardsInRowChange(t) {
|
|
191
|
-
!this.currentNode || i.getConfig(this.currentNode).mobileCardsInRow === t
|
|
194
|
+
if (!this.currentNode || i.getConfig(this.currentNode).mobileCardsInRow === t)
|
|
195
|
+
return;
|
|
196
|
+
const o = t === 1 ? 0 : y;
|
|
197
|
+
i.updateConfig(
|
|
192
198
|
this.api,
|
|
193
199
|
this.currentNode,
|
|
194
|
-
{ mobileCardsInRow: t },
|
|
200
|
+
{ mobileCardsInRow: t, mobileColumnSpacing: o },
|
|
195
201
|
`Changed mobile products per row to ${t}`
|
|
196
202
|
), C(this.api), g({
|
|
197
203
|
currentNode: this.currentNode,
|
|
198
204
|
documentModifier: this.api.getDocumentModifier()
|
|
199
|
-
})
|
|
205
|
+
});
|
|
200
206
|
}
|
|
201
207
|
_regenerateProductRows() {
|
|
202
|
-
const t = i.getConfig(this.currentNode), s = parseInt(t.size) || 6, o =
|
|
208
|
+
const t = i.getConfig(this.currentNode), s = parseInt(t.size) || 6, o = A(this.store.recommendationProducts, s);
|
|
203
209
|
b({
|
|
204
210
|
currentNode: this.currentNode,
|
|
205
211
|
documentModifier: this.api.getDocumentModifier(),
|
|
@@ -235,7 +241,7 @@ class Y extends N {
|
|
|
235
241
|
*/
|
|
236
242
|
_listenEditorModeChanges() {
|
|
237
243
|
this.api.onEditorStatePropUpdated(
|
|
238
|
-
|
|
244
|
+
O.previewDeviceMode,
|
|
239
245
|
() => {
|
|
240
246
|
i.getConfig(this.currentNode).mobileLayoutEnabled && this._updateProductsInRowVisibility();
|
|
241
247
|
}
|
|
@@ -243,6 +249,6 @@ class Y extends N {
|
|
|
243
249
|
}
|
|
244
250
|
}
|
|
245
251
|
export {
|
|
246
|
-
|
|
247
|
-
|
|
252
|
+
S as PRODUCT_LAYOUT_CONTROL_ID,
|
|
253
|
+
v as ProductLayoutControl
|
|
248
254
|
};
|