@useinsider/guido 3.7.0-beta.b2980d8 → 3.7.0-beta.d579d2a
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 +10 -12
- package/dist/extensions/Blocks/Recommendation/controls/main/layoutOrientation.js +24 -33
- package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +34 -40
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +287 -330
- package/dist/extensions/Blocks/Recommendation/extension.js +6 -5
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +3 -2
- package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +142 -173
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +56 -30
- package/dist/extensions/Blocks/Recommendation/templates/index.js +29 -8
- package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +132 -105
- package/dist/extensions/Blocks/Recommendation/templates/list/template.js +44 -23
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +96 -53
- package/dist/extensions/Blocks/Recommendation/utils/captureStyleTemplates.js +207 -0
- package/dist/extensions/Blocks/Recommendation/utils/preserveTextStyles.js +24 -19
- package/dist/extensions/Blocks/Recommendation/utils/tagName.js +20 -16
- package/dist/extensions/Blocks/Unsubscribe/block.js +72 -122
- package/dist/extensions/Blocks/Unsubscribe/template.js +4 -4
- package/dist/extensions/Blocks/controlFactories.js +159 -133
- 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 +20 -47
- 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 +3 -2
- package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +158 -11
- package/dist/src/extensions/Blocks/Recommendation/utils/captureStyleTemplates.d.ts +85 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/preserveTextStyles.d.ts +15 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/tagName.d.ts +20 -9
- package/dist/src/extensions/Blocks/Unsubscribe/block.d.ts +0 -9
- package/dist/src/extensions/Blocks/controlFactories.d.ts +11 -1
- package/package.json +1 -1
- package/dist/src/extensions/Blocks/Recommendation/utils/stylePreserver.d.ts +0 -113
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var C = Object.defineProperty;
|
|
2
|
-
var p = (d,
|
|
3
|
-
var s = (d,
|
|
2
|
+
var p = (d, l, t) => l in d ? C(d, l, { enumerable: !0, configurable: !0, writable: !0, value: t }) : d[l] = t;
|
|
3
|
+
var s = (d, l, t) => p(d, typeof l != "symbol" ? l + "" : l, 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 ct } 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, regenerateMobileProductRows as gt, updatePricesInPlace as yt, updateSingleProductContent as Nt } 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 c = t.recommendationProducts, u = c !== e, f = Array.isArray(c) && c.length > 0;
|
|
324
|
+
u && f && (e = c, 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
|
+
ct as PRODUCT_LAYOUT_CONTROL_ID,
|
|
357
357
|
I as ProductCountControl,
|
|
358
358
|
T as ProductLayoutControl,
|
|
359
359
|
K as RecommendationBlockControl,
|
|
@@ -364,12 +364,10 @@ export {
|
|
|
364
364
|
P as getBlockElement,
|
|
365
365
|
Ct as getCardComposition,
|
|
366
366
|
pt as getCurrentLayout,
|
|
367
|
-
gt as
|
|
368
|
-
yt as regenerateMobileProductRows,
|
|
369
|
-
Nt as regenerateProductRows,
|
|
367
|
+
gt as regenerateMobileProductRows,
|
|
370
368
|
k as regenerateProductRowsWithStyles,
|
|
371
369
|
L as setCurrencyAttributes,
|
|
372
|
-
|
|
370
|
+
yt as updatePricesInPlace,
|
|
373
371
|
D as updateProductContentInPlace,
|
|
374
|
-
|
|
372
|
+
Nt as updateSingleProductContent
|
|
375
373
|
};
|
|
@@ -1,62 +1,53 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
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 A = Object.defineProperty;
|
|
2
|
+
var p = (e, o, t) => o in e ? A(e, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[o] = t;
|
|
3
|
+
var r = (e, o, t) => p(e, typeof o != "symbol" ? o + "" : o, t);
|
|
4
|
+
import { ModificationDescription as O } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
5
|
+
import { CommonControl as L } from "../../../common-control.js";
|
|
6
|
+
import { ATTR_DATA_CUSTOM_ATTRIBUTES as T } from "../../constants/selectors.js";
|
|
7
|
+
import { LAYOUT_OPTIONS as h, DEFAULT_MOBILE_ROW_SPACING as m, DEFAULT_MOBILE_COLUMN_SPACING as d, DEFAULT_ROW_SPACING as l, DEFAULT_COLUMN_SPACING as C } 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 N } from "../../store/recommendation.js";
|
|
11
|
+
import { getCurrentLayout as g, getBlockElement as f, regenerateProductRowsWithStyles as S } from "./utils.js";
|
|
12
|
+
const I = "recommendation-layout-orientation-control", a = {
|
|
13
13
|
LAYOUT: "layout"
|
|
14
|
-
},
|
|
14
|
+
}, U = "data-card-composition", n = {
|
|
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 w extends L {
|
|
22
22
|
constructor() {
|
|
23
23
|
super(...arguments);
|
|
24
|
-
r(this, "store",
|
|
24
|
+
r(this, "store", N());
|
|
25
25
|
r(this, "isChangingLayout", !1);
|
|
26
26
|
}
|
|
27
27
|
getId() {
|
|
28
|
-
return
|
|
28
|
+
return I;
|
|
29
29
|
}
|
|
30
30
|
getTemplate() {
|
|
31
31
|
return `
|
|
32
32
|
<div class="layout-control-container">
|
|
33
|
-
${this._GuOnPageMessage({ name: O })}
|
|
34
|
-
|
|
35
33
|
${this._GuTwoColumns([
|
|
36
34
|
this._GuLabel({ text: this.api.translate("Layout Orientation") }),
|
|
37
35
|
this._GuRadioButton({
|
|
38
36
|
name: a.LAYOUT,
|
|
39
|
-
buttons:
|
|
37
|
+
buttons: h
|
|
40
38
|
})
|
|
41
39
|
])}
|
|
42
40
|
</div>
|
|
43
41
|
`;
|
|
44
42
|
}
|
|
45
43
|
onRender() {
|
|
46
|
-
this.
|
|
47
|
-
O,
|
|
48
|
-
this.api.translate(
|
|
49
|
-
`Note that updating the Layout Orientation, Number of Products,
|
|
50
|
-
Products in One Row and Mobile Layout Optimization settings
|
|
51
|
-
resets the style of your Recommendation block.`
|
|
52
|
-
)
|
|
53
|
-
), this._setFormValues(), this._listenToFormUpdates();
|
|
44
|
+
this._setFormValues(), this._listenToFormUpdates();
|
|
54
45
|
}
|
|
55
46
|
onTemplateNodeUpdated(t) {
|
|
56
47
|
super.onTemplateNodeUpdated(t), this._setFormValues();
|
|
57
48
|
}
|
|
58
49
|
_setFormValues() {
|
|
59
|
-
const u = s.getConfig(this.currentNode).layout ||
|
|
50
|
+
const u = s.getConfig(this.currentNode).layout || g(this.currentNode);
|
|
60
51
|
this.api.updateValues({
|
|
61
52
|
[a.LAYOUT]: u
|
|
62
53
|
});
|
|
@@ -66,9 +57,9 @@ class Y extends N {
|
|
|
66
57
|
* Updates node config, data attribute and regenerates product rows
|
|
67
58
|
*/
|
|
68
59
|
_onLayoutChange(t) {
|
|
69
|
-
if (this.isChangingLayout || !this.currentNode || (s.getConfig(this.currentNode).layout ||
|
|
60
|
+
if (this.isChangingLayout || !this.currentNode || (s.getConfig(this.currentNode).layout || g(this.currentNode)) === t)
|
|
70
61
|
return;
|
|
71
|
-
const c =
|
|
62
|
+
const c = f(this.currentNode);
|
|
72
63
|
if (c) {
|
|
73
64
|
this.isChangingLayout = !0;
|
|
74
65
|
try {
|
|
@@ -77,15 +68,15 @@ class Y extends N {
|
|
|
77
68
|
this.currentNode,
|
|
78
69
|
{
|
|
79
70
|
layout: t,
|
|
80
|
-
columnSpacing:
|
|
71
|
+
columnSpacing: C,
|
|
81
72
|
rowSpacing: l,
|
|
82
73
|
mobileColumnSpacing: d,
|
|
83
74
|
mobileRowSpacing: m
|
|
84
75
|
},
|
|
85
76
|
`Changed layout to ${t}`
|
|
86
77
|
), this.store.patchCurrentBlockConfig({ orientation: t });
|
|
87
|
-
const i = this.api.getDocumentModifier().modifyHtml(c).setAttribute(n.LAYOUT, t).setAttribute(n.COLUMN_SPACING,
|
|
88
|
-
t === "list" ? (i.setClass("es-m-p0"), i.setClass("ins-recommendation-list-layout")) : (i.removeClass("es-m-p0"), i.removeClass("ins-recommendation-list-layout")), i.setAttribute(
|
|
78
|
+
const i = this.api.getDocumentModifier().modifyHtml(c).setAttribute(n.LAYOUT, t).setAttribute(n.COLUMN_SPACING, C.toString()).setAttribute(n.ROW_SPACING, l.toString()).setAttribute(n.MOBILE_COLUMN_SPACING, d.toString()).setAttribute(n.MOBILE_ROW_SPACING, m.toString());
|
|
79
|
+
t === "list" ? (i.setClass("es-m-p0"), i.setClass("ins-recommendation-list-layout")) : (i.removeClass("es-m-p0"), i.removeClass("ins-recommendation-list-layout")), i.setAttribute(U, _.join(",")).setAttribute(T, "[]"), i.apply(new O(`Update layout to ${t}`)), this._regenerateProductRows(t);
|
|
89
80
|
} finally {
|
|
90
81
|
this.isChangingLayout = !1;
|
|
91
82
|
}
|
|
@@ -111,6 +102,6 @@ class Y extends N {
|
|
|
111
102
|
}
|
|
112
103
|
}
|
|
113
104
|
export {
|
|
114
|
-
|
|
115
|
-
|
|
105
|
+
I as LAYOUT_ORIENTATION_CONTROL_ID,
|
|
106
|
+
w as LayoutOrientationControl
|
|
116
107
|
};
|
|
@@ -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 p, PreviewDeviceMode as f, UEAttr as T } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
5
|
+
import { CommonControl as N } from "../../../common-control.js";
|
|
6
|
+
import { MAX_PRODUCTS_PER_ROW as O, MAX_MOBILE_PRODUCTS_PER_ROW as M, DEFAULT_MOBILE_CARDS_IN_ROW as m } 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 P } from "../../store/recommendation.js";
|
|
9
|
+
import { setMobileLayoutOptOut as L, ensureMobileCssRulesExist as C } from "../mobileLayout/cssRules.js";
|
|
10
|
+
import { getCurrentLayout as y, getBlockElement as D, regenerateProductRowsWithStyles as b, regenerateMobileProductRows as g, adjustProductsToSize as w } from "./utils.js";
|
|
11
|
+
import { useDebounceFn as U } from "../../../../../node_modules/@vueuse/shared/index.js";
|
|
12
|
+
const B = "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 S = "recommendation-product-layout-control", e = {
|
|
|
23
23
|
MOBILE_LAYOUT_TOGGLE: "mobileLayoutEnabled",
|
|
24
24
|
MOBILE_LAYOUT_LABEL: "mobileLayoutLabel"
|
|
25
25
|
};
|
|
26
|
-
class
|
|
26
|
+
class Y extends N {
|
|
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", P());
|
|
31
31
|
u(this, "storeUnsubscription", () => {
|
|
32
32
|
});
|
|
33
|
-
u(this, "_debouncedRegenerateProductRows",
|
|
33
|
+
u(this, "_debouncedRegenerateProductRows", U(() => {
|
|
34
34
|
this._regenerateProductRows();
|
|
35
35
|
}, 500));
|
|
36
36
|
}
|
|
37
37
|
getId() {
|
|
38
|
-
return
|
|
38
|
+
return B;
|
|
39
39
|
}
|
|
40
40
|
getTemplate() {
|
|
41
41
|
return `
|
|
@@ -45,12 +45,12 @@ 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:
|
|
48
|
+
this._GuCounter({ name: e.PRODUCT_IN_ROW, maxValue: O }),
|
|
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: O }),
|
|
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 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()[
|
|
98
|
+
return this.api.getEditorState()[p.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 v extends T {
|
|
|
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 || y(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, l = o && r && !d, _ = 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, l), this.api.setVisibility(e.PRODUCT_IN_ROW_DESKTOP_LABEL, l), this.api.setVisibility(e.MOBILE_CARDS_IN_ROW, _), this.api.setVisibility(e.MOBILE_CARDS_IN_ROW_LABEL, _);
|
|
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 v extends T {
|
|
|
125
125
|
const t = i.getConfig(this.currentNode);
|
|
126
126
|
this.api.setUIEAttribute(
|
|
127
127
|
e.MOBILE_LAYOUT_TOGGLE,
|
|
128
|
-
|
|
128
|
+
T.SELECTPICKER.items,
|
|
129
129
|
t.mobileLayoutEnabled
|
|
130
130
|
);
|
|
131
131
|
}
|
|
@@ -140,9 +140,9 @@ class v extends T {
|
|
|
140
140
|
const s = i.getConfig(this.currentNode);
|
|
141
141
|
if (s.mobileLayoutEnabled === t)
|
|
142
142
|
return;
|
|
143
|
-
const o =
|
|
143
|
+
const o = D(this.currentNode);
|
|
144
144
|
if (t) {
|
|
145
|
-
const r = s.previousMobileCardsInRow ||
|
|
145
|
+
const r = s.previousMobileCardsInRow || m;
|
|
146
146
|
i.updateConfig(
|
|
147
147
|
this.api,
|
|
148
148
|
this.currentNode,
|
|
@@ -154,7 +154,7 @@ class v extends T {
|
|
|
154
154
|
), this.store.patchCurrentBlockConfig(
|
|
155
155
|
{ mobileLayoutEnabled: !0 },
|
|
156
156
|
{ triggerRefetch: !1 }
|
|
157
|
-
), o &&
|
|
157
|
+
), o && L(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 v extends T {
|
|
|
166
166
|
{
|
|
167
167
|
mobileLayoutEnabled: !1,
|
|
168
168
|
previousMobileCardsInRow: r,
|
|
169
|
-
mobileCardsInRow:
|
|
169
|
+
mobileCardsInRow: m
|
|
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 && L(this.api, o, !0), g({
|
|
176
176
|
currentNode: this.currentNode,
|
|
177
177
|
documentModifier: this.api.getDocumentModifier()
|
|
178
178
|
});
|
|
@@ -180,32 +180,26 @@ class v extends T {
|
|
|
180
180
|
this._setFormValues(), this._updateProductsInRowVisibility();
|
|
181
181
|
}
|
|
182
182
|
_onProductsInRowChange(t) {
|
|
183
|
-
|
|
184
|
-
return;
|
|
185
|
-
const o = t === 1 ? 0 : P;
|
|
186
|
-
i.updateConfig(
|
|
183
|
+
!this.currentNode || i.getConfig(this.currentNode).cardsInRow === t || (i.updateConfig(
|
|
187
184
|
this.api,
|
|
188
185
|
this.currentNode,
|
|
189
|
-
{ cardsInRow: t
|
|
186
|
+
{ cardsInRow: t },
|
|
190
187
|
`Changed products per row to ${t}`
|
|
191
|
-
), this.store.patchCurrentBlockConfig({ cardsInRow: t }, { triggerRefetch: !1 }), this._debouncedRegenerateProductRows();
|
|
188
|
+
), this.store.patchCurrentBlockConfig({ cardsInRow: t }, { triggerRefetch: !1 }), this._debouncedRegenerateProductRows());
|
|
192
189
|
}
|
|
193
190
|
_onMobileCardsInRowChange(t) {
|
|
194
|
-
|
|
195
|
-
return;
|
|
196
|
-
const o = t === 1 ? 0 : y;
|
|
197
|
-
i.updateConfig(
|
|
191
|
+
!this.currentNode || i.getConfig(this.currentNode).mobileCardsInRow === t || (i.updateConfig(
|
|
198
192
|
this.api,
|
|
199
193
|
this.currentNode,
|
|
200
|
-
{ mobileCardsInRow: t
|
|
194
|
+
{ mobileCardsInRow: t },
|
|
201
195
|
`Changed mobile products per row to ${t}`
|
|
202
196
|
), C(this.api), g({
|
|
203
197
|
currentNode: this.currentNode,
|
|
204
198
|
documentModifier: this.api.getDocumentModifier()
|
|
205
|
-
});
|
|
199
|
+
}));
|
|
206
200
|
}
|
|
207
201
|
_regenerateProductRows() {
|
|
208
|
-
const t = i.getConfig(this.currentNode), s = parseInt(t.size) || 6, o =
|
|
202
|
+
const t = i.getConfig(this.currentNode), s = parseInt(t.size) || 6, o = w(this.store.recommendationProducts, s);
|
|
209
203
|
b({
|
|
210
204
|
currentNode: this.currentNode,
|
|
211
205
|
documentModifier: this.api.getDocumentModifier(),
|
|
@@ -241,7 +235,7 @@ class v extends T {
|
|
|
241
235
|
*/
|
|
242
236
|
_listenEditorModeChanges() {
|
|
243
237
|
this.api.onEditorStatePropUpdated(
|
|
244
|
-
|
|
238
|
+
p.previewDeviceMode,
|
|
245
239
|
() => {
|
|
246
240
|
i.getConfig(this.currentNode).mobileLayoutEnabled && this._updateProductsInRowVisibility();
|
|
247
241
|
}
|
|
@@ -249,6 +243,6 @@ class v extends T {
|
|
|
249
243
|
}
|
|
250
244
|
}
|
|
251
245
|
export {
|
|
252
|
-
|
|
253
|
-
|
|
246
|
+
B as PRODUCT_LAYOUT_CONTROL_ID,
|
|
247
|
+
Y as ProductLayoutControl
|
|
254
248
|
};
|