@useinsider/guido 2.1.0-beta.7ae6573 → 2.1.0-beta.7bbedc6
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/README.md +36 -0
- package/dist/@types/config/schemas.js +70 -65
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +69 -58
- package/dist/components/organisms/base/Toaster.vue.js +4 -4
- package/dist/components/organisms/base/Toaster.vue2.js +12 -9
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +5 -5
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue2.js +2 -2
- package/dist/composables/useBlocksConfig.js +26 -16
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +22 -17
- package/dist/config/migrator/itemsBlockMigrator.js +101 -97
- package/dist/enums/defaults.js +8 -4
- package/dist/extensions/Blocks/Recommendation/block.js +24 -23
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +27 -26
- package/dist/extensions/Blocks/Recommendation/constants/layout.js +6 -4
- package/dist/extensions/Blocks/Recommendation/constants/selectors.js +12 -10
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +11 -10
- package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +87 -37
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +138 -117
- package/dist/extensions/Blocks/Recommendation/controls/mobileLayout/cssRules.js +21 -0
- package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +25 -30
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +27 -30
- package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +20 -25
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +31 -15
- package/dist/extensions/ModulesTabIcons/extension.js +17 -0
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +257 -187
- package/dist/services/stripoApi.js +20 -17
- package/dist/src/@types/config/schemas.d.ts +8 -0
- package/dist/src/composables/useConfig.d.ts +4 -0
- package/dist/src/enums/defaults.d.ts +4 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +2 -2
- package/dist/src/extensions/Blocks/Recommendation/constants/layout.d.ts +6 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +4 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/productLayout.d.ts +22 -4
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +9 -2
- package/dist/src/extensions/Blocks/Recommendation/controls/mobileLayout/cssRules.d.ts +29 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/grid/template.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/templates/index.d.ts +2 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +11 -2
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +6 -0
- package/dist/src/extensions/ModulesTabIcons/extension.d.ts +2 -0
- package/dist/src/stores/config.d.ts +36 -0
- package/dist/static/styles/customEditorStyle.css.js +10 -9
- package/dist/static/templates/empty/index.html.js +74 -0
- package/dist/static/templates/empty/style.css.js +779 -0
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { DEFAULT_ROW_SPACING as
|
|
2
|
-
import { ATTR_PRODUCT_IMAGE as t, ATTR_PRODUCT_NAME as e, ATTR_PRODUCT_OLD_PRICE as o, ATTR_PRODUCT_PRICE as
|
|
3
|
-
const
|
|
1
|
+
import { DEFAULT_ROW_SPACING as U, DEFAULT_COLUMN_SPACING as I, DEFAULT_MOBILE_CARDS_IN_ROW as n, DEFAULT_CARDS_IN_ROW as s } from "./layout.js";
|
|
2
|
+
import { ATTR_PRODUCT_IMAGE as t, ATTR_PRODUCT_NAME as e, ATTR_PRODUCT_OLD_PRICE as o, ATTR_PRODUCT_PRICE as _, ATTR_PRODUCT_OMNIBUS_PRICE as T, ATTR_PRODUCT_OMNIBUS_DISCOUNT as r, ATTR_PRODUCT_BUTTON as R } from "./selectors.js";
|
|
3
|
+
const O = {
|
|
4
4
|
code: "USD",
|
|
5
5
|
symbol: "USD",
|
|
6
6
|
alignment: "after",
|
|
@@ -10,56 +10,57 @@ const I = {
|
|
|
10
10
|
}, i = {
|
|
11
11
|
textBefore: "",
|
|
12
12
|
textAfter: ""
|
|
13
|
-
},
|
|
13
|
+
}, C = {
|
|
14
14
|
textBefore: "",
|
|
15
15
|
textAfter: ""
|
|
16
|
-
},
|
|
16
|
+
}, D = [
|
|
17
17
|
t,
|
|
18
18
|
e,
|
|
19
19
|
o,
|
|
20
|
-
T,
|
|
21
20
|
_,
|
|
21
|
+
T,
|
|
22
22
|
r,
|
|
23
|
-
|
|
24
|
-
],
|
|
23
|
+
R
|
|
24
|
+
], A = {
|
|
25
25
|
[t]: !0,
|
|
26
26
|
[e]: !0,
|
|
27
|
-
[
|
|
27
|
+
[_]: !0,
|
|
28
28
|
[o]: !0,
|
|
29
|
-
[
|
|
29
|
+
[T]: !1,
|
|
30
30
|
[r]: !1,
|
|
31
|
-
[
|
|
32
|
-
},
|
|
31
|
+
[R]: !0
|
|
32
|
+
}, E = {
|
|
33
33
|
// Settings
|
|
34
34
|
strategy: "mostPopular",
|
|
35
35
|
productIds: [],
|
|
36
36
|
size: "6",
|
|
37
37
|
shuffleProducts: !1,
|
|
38
38
|
language: "en_US",
|
|
39
|
-
currency:
|
|
39
|
+
currency: O,
|
|
40
40
|
filters: [],
|
|
41
41
|
// Layout
|
|
42
42
|
layout: "grid",
|
|
43
|
-
cardsInRow:
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
cardsInRow: s,
|
|
44
|
+
mobileCardsInRow: n,
|
|
45
|
+
columnSpacing: I,
|
|
46
|
+
rowSpacing: U,
|
|
46
47
|
// Composition
|
|
47
|
-
composition:
|
|
48
|
-
visibility:
|
|
48
|
+
composition: D,
|
|
49
|
+
visibility: A,
|
|
49
50
|
// Element settings
|
|
50
51
|
omnibusPrice: i,
|
|
51
|
-
omnibusDiscount:
|
|
52
|
+
omnibusDiscount: C,
|
|
52
53
|
textTrimming: !1,
|
|
53
54
|
// Meta
|
|
54
55
|
configVersion: 1,
|
|
55
56
|
recommendationId: 0
|
|
56
|
-
},
|
|
57
|
+
}, N = 1;
|
|
57
58
|
export {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
N as CURRENT_CONFIG_VERSION,
|
|
60
|
+
D as DEFAULT_COMPOSITION,
|
|
61
|
+
O as DEFAULT_CURRENCY,
|
|
62
|
+
E as DEFAULT_NODE_CONFIG,
|
|
63
|
+
C as DEFAULT_OMNIBUS_DISCOUNT,
|
|
63
64
|
i as DEFAULT_OMNIBUS_PRICE,
|
|
64
|
-
|
|
65
|
+
A as DEFAULT_VISIBILITY
|
|
65
66
|
};
|
|
@@ -4,17 +4,19 @@ const _ = {
|
|
|
4
4
|
}, o = [
|
|
5
5
|
{ icon: "grid-orientation", value: _.GRID },
|
|
6
6
|
{ icon: "list-orientation", value: _.LIST }
|
|
7
|
-
], t = 3, n = 3, A = 9,
|
|
7
|
+
], t = 3, n = 3, A = 9, O = 4, R = 1, T = 2, c = 10, s = 20, I = 0, S = 50, P = 5;
|
|
8
8
|
export {
|
|
9
9
|
n as DEFAULT_CARDS_IN_ROW,
|
|
10
10
|
c as DEFAULT_COLUMN_SPACING,
|
|
11
|
+
R as DEFAULT_MOBILE_CARDS_IN_ROW,
|
|
11
12
|
t as DEFAULT_PRODUCTS_PER_ROW,
|
|
12
13
|
s as DEFAULT_ROW_SPACING,
|
|
13
14
|
o as LAYOUT_OPTIONS,
|
|
14
15
|
_ as LAYOUT_VALUES,
|
|
15
|
-
T as
|
|
16
|
+
T as MAX_MOBILE_PRODUCTS_PER_ROW,
|
|
17
|
+
O as MAX_PRODUCTS_PER_ROW,
|
|
16
18
|
A as MAX_PRODUCT_COUNT,
|
|
17
19
|
S as MAX_SPACING,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
I as MIN_SPACING,
|
|
21
|
+
P as SPACING_STEP
|
|
20
22
|
};
|
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
const c = ".ins-recommendation-product-container", T = {
|
|
1
|
+
const c = ".ins-recommendation-product-container", n = ".ins-recommendation-desktop-container", o = ".ins-recommendation-mobile-container", T = {
|
|
2
2
|
CURRENCY: "currency",
|
|
3
3
|
SYMBOL: "currency-symbol",
|
|
4
4
|
ALIGNMENT: "currency-alignment",
|
|
5
5
|
THOUSAND_SEPARATOR: "currency-thousand-separator",
|
|
6
6
|
DECIMAL_SEPARATOR: "currency-decimal-separator",
|
|
7
7
|
DECIMAL_COUNT: "currency-decimal-count"
|
|
8
|
-
},
|
|
8
|
+
}, t = "productImage", r = "productName", R = "productPrice", e = "productOldPrice", O = "productOmnibusPrice", _ = "productOmnibusDiscount", C = "productButton";
|
|
9
9
|
export {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
C as ATTR_PRODUCT_BUTTON,
|
|
11
|
+
t as ATTR_PRODUCT_IMAGE,
|
|
12
|
+
r as ATTR_PRODUCT_NAME,
|
|
13
|
+
e as ATTR_PRODUCT_OLD_PRICE,
|
|
14
|
+
_ as ATTR_PRODUCT_OMNIBUS_DISCOUNT,
|
|
15
|
+
O as ATTR_PRODUCT_OMNIBUS_PRICE,
|
|
16
|
+
R as ATTR_PRODUCT_PRICE,
|
|
17
17
|
c as CONTAINER_SELECTOR,
|
|
18
|
-
T as CURRENCY_ATTR
|
|
18
|
+
T as CURRENCY_ATTR,
|
|
19
|
+
n as DESKTOP_CONTAINER_SELECTOR,
|
|
20
|
+
o as MOBILE_CONTAINER_SELECTOR
|
|
19
21
|
};
|
|
@@ -8,16 +8,16 @@ import { AlgorithmControl as p } from "./algorithm.js";
|
|
|
8
8
|
import { ALGORITHM_CONTROL_ID as W } from "./algorithm.js";
|
|
9
9
|
import { CurrencyControl as g } from "./currency.js";
|
|
10
10
|
import { CURRENCY_CONTROL_ID as H } from "./currency.js";
|
|
11
|
-
import { FiltersControl as
|
|
11
|
+
import { FiltersControl as R } from "./filters.js";
|
|
12
12
|
import { FILTERS_CONTROL_ID as j } from "./filters.js";
|
|
13
|
-
import { LocaleControl as
|
|
13
|
+
import { LocaleControl as y } from "./locale.js";
|
|
14
14
|
import { LOCALE_CONTROL_ID as K } from "./locale.js";
|
|
15
15
|
import { ProductLayoutControl as _ } from "./productLayout.js";
|
|
16
16
|
import { PRODUCT_LAYOUT_CONTROL_ID as J } from "./productLayout.js";
|
|
17
17
|
import { ShuffleControl as N } from "./shuffle.js";
|
|
18
18
|
import { SHUFFLE_CONTROL_ID as X } from "./shuffle.js";
|
|
19
19
|
import { regenerateProductRowsWithStyles as b, getBlockElement as P, updateProductContentInPlace as I } from "./utils.js";
|
|
20
|
-
import { formatProductPrice as tt, getCardComposition as et, getCurrentLayout as ot, reapplySpacing as rt,
|
|
20
|
+
import { formatProductPrice as tt, getCardComposition as et, getCurrentLayout as ot, reapplySpacing as rt, regenerateMobileProductRows as nt, regenerateProductRows as it, setCurrencyAttributes as st, updatePricesInPlace as ct, updateSingleProductContent as at } from "./utils.js";
|
|
21
21
|
import { useDebounceFn as l } from "../../../../../node_modules/@vueuse/shared/index.js";
|
|
22
22
|
const T = "recommendation-id", S = "ui-elements-recommendation-block";
|
|
23
23
|
class $ extends h {
|
|
@@ -59,7 +59,7 @@ class $ extends h {
|
|
|
59
59
|
return S;
|
|
60
60
|
}
|
|
61
61
|
getTemplate() {
|
|
62
|
-
return this.algorithmControl = new p(), this.localeControl = new
|
|
62
|
+
return this.algorithmControl = new p(), this.localeControl = new y(), this.currencyControl = new g(), this.productLayoutControl = new _(), this.filtersControl = new R(), this.shuffleControl = new N(), `
|
|
63
63
|
<div class="recommendation-controls-container">
|
|
64
64
|
${this.algorithmControl.getTemplate()}
|
|
65
65
|
${this.localeControl.getTemplate()}
|
|
@@ -227,9 +227,9 @@ export {
|
|
|
227
227
|
H as CURRENCY_CONTROL_ID,
|
|
228
228
|
g as CurrencyControl,
|
|
229
229
|
j as FILTERS_CONTROL_ID,
|
|
230
|
-
|
|
230
|
+
R as FiltersControl,
|
|
231
231
|
K as LOCALE_CONTROL_ID,
|
|
232
|
-
|
|
232
|
+
y as LocaleControl,
|
|
233
233
|
J as PRODUCT_LAYOUT_CONTROL_ID,
|
|
234
234
|
_ as ProductLayoutControl,
|
|
235
235
|
$ as RecommendationBlockControl,
|
|
@@ -240,10 +240,11 @@ export {
|
|
|
240
240
|
et as getCardComposition,
|
|
241
241
|
ot as getCurrentLayout,
|
|
242
242
|
rt as reapplySpacing,
|
|
243
|
-
nt as
|
|
243
|
+
nt as regenerateMobileProductRows,
|
|
244
|
+
it as regenerateProductRows,
|
|
244
245
|
b as regenerateProductRowsWithStyles,
|
|
245
|
-
|
|
246
|
-
|
|
246
|
+
st as setCurrencyAttributes,
|
|
247
|
+
ct as updatePricesInPlace,
|
|
247
248
|
I as updateProductContentInPlace,
|
|
248
|
-
|
|
249
|
+
at as updateSingleProductContent
|
|
249
250
|
};
|
|
@@ -1,45 +1,60 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
1
|
+
var _ = Object.defineProperty;
|
|
2
|
+
var c = (i, o, t) => o in i ? _(i, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[o] = t;
|
|
3
|
+
var d = (i, o, t) => c(i, typeof o != "symbol" ? o + "" : o, t);
|
|
4
|
+
import { EditorStatePropertyType as u, PreviewDeviceMode as R } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
5
|
+
import { CommonControl as h } from "../../../common-control.js";
|
|
6
|
+
import { MAX_PRODUCT_COUNT as C, MAX_PRODUCTS_PER_ROW as p, MAX_MOBILE_PRODUCTS_PER_ROW as m } from "../../constants/layout.js";
|
|
7
|
+
import { RecommendationConfigService as s } from "../../services/configService.js";
|
|
8
|
+
import { useRecommendationExtensionStore as l } from "../../store/recommendation.js";
|
|
9
|
+
import { ensureMobileCssRulesExist as O } from "../mobileLayout/cssRules.js";
|
|
10
|
+
import { getCurrentLayout as I, regenerateMobileProductRows as g, regenerateProductRowsWithStyles as b } from "./utils.js";
|
|
11
|
+
import { useDebounceFn as N } from "../../../../../node_modules/@vueuse/shared/index.js";
|
|
12
|
+
const P = "recommendation-product-layout-control", e = {
|
|
11
13
|
PRODUCT_COUNT: "size",
|
|
12
14
|
PRODUCT_IN_ROW: "cardsInRow",
|
|
13
|
-
PRODUCT_IN_ROW_LABEL: "cardsInRowLabel"
|
|
15
|
+
PRODUCT_IN_ROW_LABEL: "cardsInRowLabel",
|
|
16
|
+
MOBILE_CARDS_IN_ROW: "mobileCardsInRow",
|
|
17
|
+
MOBILE_CARDS_IN_ROW_LABEL: "mobileCardsInRowLabel"
|
|
14
18
|
};
|
|
15
|
-
class
|
|
19
|
+
class S extends h {
|
|
16
20
|
constructor() {
|
|
17
21
|
super(...arguments);
|
|
18
22
|
// Store is used for backward compatibility with product fetching and regeneration
|
|
19
|
-
|
|
20
|
-
|
|
23
|
+
d(this, "store", l());
|
|
24
|
+
d(this, "storeUnsubscription", () => {
|
|
21
25
|
});
|
|
22
|
-
|
|
26
|
+
d(this, "_debouncedRegenerateProductRows", N(() => {
|
|
23
27
|
this._regenerateProductRows();
|
|
24
28
|
}, 500));
|
|
25
29
|
}
|
|
26
30
|
getId() {
|
|
27
|
-
return
|
|
31
|
+
return P;
|
|
28
32
|
}
|
|
29
33
|
getTemplate() {
|
|
30
34
|
return `
|
|
31
35
|
<div class="product-layout-control-container">
|
|
32
36
|
${this._GuTwoColumns([
|
|
33
37
|
this._GuLabel({ text: "Number of Products" }),
|
|
34
|
-
this._GuCounter({ name:
|
|
35
|
-
this._GuLabel({
|
|
36
|
-
|
|
38
|
+
this._GuCounter({ name: e.PRODUCT_COUNT, maxValue: C }),
|
|
39
|
+
this._GuLabel({
|
|
40
|
+
text: "Products in One Row on Desktop",
|
|
41
|
+
name: e.PRODUCT_IN_ROW_LABEL
|
|
42
|
+
}),
|
|
43
|
+
this._GuCounter({ name: e.PRODUCT_IN_ROW, maxValue: p }),
|
|
44
|
+
this._GuLabel({
|
|
45
|
+
text: "Products in One Row on Mobile",
|
|
46
|
+
name: e.MOBILE_CARDS_IN_ROW_LABEL
|
|
47
|
+
}),
|
|
48
|
+
this._GuCounter({
|
|
49
|
+
name: e.MOBILE_CARDS_IN_ROW,
|
|
50
|
+
maxValue: m
|
|
51
|
+
})
|
|
37
52
|
])}
|
|
38
53
|
</div>
|
|
39
54
|
`;
|
|
40
55
|
}
|
|
41
56
|
onRender() {
|
|
42
|
-
this._setFormValues(), this._updateProductsInRowVisibility(), this._listenToFormUpdates(), this._listenStateUpdates();
|
|
57
|
+
this._setFormValues(), this._updateProductsInRowVisibility(), this._listenToFormUpdates(), this._listenStateUpdates(), this._subscribeToEditorModeChanges();
|
|
43
58
|
}
|
|
44
59
|
onTemplateNodeUpdated(t) {
|
|
45
60
|
super.onTemplateNodeUpdated(t), this._setFormValues(), this._updateProductsInRowVisibility();
|
|
@@ -48,23 +63,45 @@ class I extends c {
|
|
|
48
63
|
this.storeUnsubscription();
|
|
49
64
|
}
|
|
50
65
|
_setFormValues() {
|
|
51
|
-
const t =
|
|
66
|
+
const t = s.getConfig(this.currentNode);
|
|
52
67
|
this.api.updateValues({
|
|
53
|
-
[
|
|
54
|
-
[
|
|
68
|
+
[e.PRODUCT_COUNT]: t.size,
|
|
69
|
+
[e.PRODUCT_IN_ROW]: t.cardsInRow,
|
|
70
|
+
[e.MOBILE_CARDS_IN_ROW]: t.mobileCardsInRow
|
|
55
71
|
});
|
|
56
72
|
}
|
|
57
73
|
/**
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
|
|
74
|
+
* Checks if the editor is currently in mobile preview mode
|
|
75
|
+
* using Stripo's EditorStatePropertyType API.
|
|
76
|
+
*/
|
|
77
|
+
_isMobileMode() {
|
|
78
|
+
return this.api.getEditorState()[u.previewDeviceMode] === R.MOBILE;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Updates counter visibility based on layout orientation and editor mode.
|
|
82
|
+
* - List layout: hide both counters (products always full-width)
|
|
83
|
+
* - Grid + desktop mode: show desktop counter, hide mobile counter
|
|
84
|
+
* - Grid + mobile mode: show mobile counter, hide desktop counter
|
|
61
85
|
*/
|
|
62
86
|
_updateProductsInRowVisibility() {
|
|
63
|
-
const
|
|
64
|
-
this.api.setVisibility(
|
|
87
|
+
const r = (s.getConfig(this.currentNode).layout || I(this.currentNode)) === "grid", n = this._isMobileMode();
|
|
88
|
+
this.api.setVisibility(e.PRODUCT_IN_ROW, r && !n), this.api.setVisibility(e.PRODUCT_IN_ROW_LABEL, r && !n), this.api.setVisibility(e.MOBILE_CARDS_IN_ROW, r && n), this.api.setVisibility(e.MOBILE_CARDS_IN_ROW_LABEL, r && n);
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Subscribes to editor preview mode changes via Stripo API.
|
|
92
|
+
* When the user switches between desktop/mobile preview, toggles
|
|
93
|
+
* which "Products in One Row" counter is visible.
|
|
94
|
+
*/
|
|
95
|
+
_subscribeToEditorModeChanges() {
|
|
96
|
+
this.api.onEditorStatePropUpdated(
|
|
97
|
+
u.previewDeviceMode,
|
|
98
|
+
() => {
|
|
99
|
+
this._updateProductsInRowVisibility();
|
|
100
|
+
}
|
|
101
|
+
);
|
|
65
102
|
}
|
|
66
103
|
_onProductCountChange(t) {
|
|
67
|
-
this.currentNode && (
|
|
104
|
+
this.currentNode && (s.updateConfig(
|
|
68
105
|
this.api,
|
|
69
106
|
this.currentNode,
|
|
70
107
|
{ size: t },
|
|
@@ -72,24 +109,37 @@ class I extends c {
|
|
|
72
109
|
), this.store.patchCurrentBlockConfig({ size: t }), this._debouncedRegenerateProductRows());
|
|
73
110
|
}
|
|
74
111
|
_onProductsInRowChange(t) {
|
|
75
|
-
this.currentNode && (
|
|
112
|
+
this.currentNode && (s.updateConfig(
|
|
76
113
|
this.api,
|
|
77
114
|
this.currentNode,
|
|
78
115
|
{ cardsInRow: t },
|
|
79
116
|
`Changed products per row to ${t}`
|
|
80
117
|
), this.store.patchCurrentBlockConfig({ cardsInRow: t }), this._debouncedRegenerateProductRows());
|
|
81
118
|
}
|
|
119
|
+
_onMobileCardsInRowChange(t) {
|
|
120
|
+
this.currentNode && (s.updateConfig(
|
|
121
|
+
this.api,
|
|
122
|
+
this.currentNode,
|
|
123
|
+
{ mobileCardsInRow: t },
|
|
124
|
+
`Changed mobile products per row to ${t}`
|
|
125
|
+
), O(this.api), g({
|
|
126
|
+
currentNode: this.currentNode,
|
|
127
|
+
documentModifier: this.api.getDocumentModifier()
|
|
128
|
+
}));
|
|
129
|
+
}
|
|
82
130
|
_regenerateProductRows() {
|
|
83
|
-
|
|
131
|
+
b({
|
|
84
132
|
currentNode: this.currentNode,
|
|
85
133
|
documentModifier: this.api.getDocumentModifier()
|
|
86
134
|
});
|
|
87
135
|
}
|
|
88
136
|
_listenToFormUpdates() {
|
|
89
|
-
this.api.onValueChanged(
|
|
137
|
+
this.api.onValueChanged(e.PRODUCT_COUNT, (t) => {
|
|
90
138
|
this._onProductCountChange(t.toString());
|
|
91
|
-
}), this.api.onValueChanged(
|
|
139
|
+
}), this.api.onValueChanged(e.PRODUCT_IN_ROW, (t) => {
|
|
92
140
|
this._onProductsInRowChange(Number(t));
|
|
141
|
+
}), this.api.onValueChanged(e.MOBILE_CARDS_IN_ROW, (t) => {
|
|
142
|
+
this._onMobileCardsInRowChange(Number(t));
|
|
93
143
|
});
|
|
94
144
|
}
|
|
95
145
|
/**
|
|
@@ -99,12 +149,12 @@ class I extends c {
|
|
|
99
149
|
_listenStateUpdates() {
|
|
100
150
|
let t = this.store.recommendationConfigs.orientation;
|
|
101
151
|
this.storeUnsubscription = this.store.$subscribe(() => {
|
|
102
|
-
const
|
|
103
|
-
|
|
152
|
+
const a = this.store.recommendationConfigs.orientation;
|
|
153
|
+
a !== t && (t = a, this._updateProductsInRowVisibility());
|
|
104
154
|
});
|
|
105
155
|
}
|
|
106
156
|
}
|
|
107
157
|
export {
|
|
108
|
-
|
|
109
|
-
|
|
158
|
+
P as PRODUCT_LAYOUT_CONTROL_ID,
|
|
159
|
+
S as ProductLayoutControl
|
|
110
160
|
};
|