@useinsider/guido 3.17.0-beta.db80c84 → 3.17.0-beta.dc7f4d2
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/components/Guido.vue.js +8 -8
- package/dist/components/Guido.vue2.js +78 -76
- package/dist/components/organisms/AutoSaveController.vue2.js +9 -8
- package/dist/components/organisms/header/EditorActions.vue.js +2 -2
- package/dist/components/organisms/header/EditorActions.vue2.js +74 -43
- package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
- package/dist/components/organisms/header/LeftSlot.vue2.js +46 -23
- package/dist/components/organisms/validation/ValidationErrorDrawer.vue.js +20 -0
- package/dist/components/organisms/validation/ValidationErrorDrawer.vue2.js +48 -0
- package/dist/components/wrappers/WpDrawer.vue.js +9 -7
- package/dist/components/wrappers/WpDrawer.vue2.js +1 -1
- package/dist/composables/useHtmlCompiler.js +37 -26
- package/dist/composables/useHtmlValidator.js +2 -0
- package/dist/composables/useSave.js +84 -41
- package/dist/composables/useSaveValidation.js +279 -0
- package/dist/composables/useSaveValidationRollout.js +9 -0
- package/dist/composables/useStripo.js +14 -14
- package/dist/composables/validators/useCouponBlockValidator.js +24 -21
- package/dist/composables/validators/useUnsubscribeBlockValidator.js +34 -27
- package/dist/config/migrator/index.js +8 -9
- package/dist/config/migrator/recommendation/compositionMapper.js +20 -20
- package/dist/config/migrator/recommendation/extractors.js +24 -29
- package/dist/config/migrator/recommendation/htmlBuilder.js +130 -116
- package/dist/config/migrator/recommendationMigrator.js +15 -18
- package/dist/enums/save-validation.js +4 -0
- package/dist/extensions/Blocks/Recommendation/constants/blockIds.js +1 -1
- package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +22 -23
- package/dist/extensions/Blocks/Recommendation/constants/selectors.js +28 -34
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +238 -306
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +8 -9
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +0 -1
- package/dist/extensions/Blocks/Recommendation/extension.js +29 -31
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +4 -23
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +33 -26
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +3 -3
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +107 -85
- package/dist/guido.css +1 -1
- package/dist/src/@types/save-validation.d.ts +19 -0
- package/dist/src/components/Guido.vue.d.ts +17 -1
- package/dist/src/components/organisms/header/EditorActions.vue.d.ts +17 -1
- package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +17 -1
- package/dist/src/components/organisms/header/RightSlot.vue.d.ts +17 -1
- package/dist/src/components/organisms/validation/ValidationErrorDrawer.vue.d.ts +2 -0
- package/dist/src/components/wrappers/WpDrawer.vue.d.ts +4 -3
- package/dist/src/composables/useHtmlValidator.d.ts +21 -0
- package/dist/src/composables/useSave.d.ts +6 -1
- package/dist/src/composables/useSaveValidation.d.ts +6 -0
- package/dist/src/composables/useSaveValidationRollout.d.ts +3 -0
- package/dist/src/composables/validators/useCouponBlockValidator.d.ts +3 -0
- package/dist/src/composables/validators/useUnsubscribeBlockValidator.d.ts +10 -0
- package/dist/src/config/migrator/recommendation/extractors.d.ts +0 -8
- package/dist/src/enums/save-validation.d.ts +27 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/blockIds.d.ts +1 -2
- package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +0 -7
- package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +0 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +0 -10
- package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +0 -10
- package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +0 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +0 -1
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +5 -0
- package/dist/src/stores/config.d.ts +5 -0
- package/dist/src/stores/save-validation.d.ts +22 -0
- package/dist/src/utils/templatePreparation.d.ts +30 -0
- package/dist/static/styles/customEditorStyle.css.js +1 -3
- package/dist/stores/config.js +13 -6
- package/dist/stores/save-validation.js +30 -0
- package/dist/utils/templatePreparation.js +28 -25
- package/package.json +1 -1
- package/dist/config/migrator/recommendationTitleMigrator.js +0 -119
- package/dist/extensions/Blocks/Recommendation/controls/title/index.js +0 -44
- package/dist/extensions/Blocks/Recommendation/templates/titleRows.js +0 -33
- package/dist/src/config/migrator/recommendationTitleMigrator.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/title/index.d.ts +0 -86
- package/dist/src/extensions/Blocks/Recommendation/templates/titleRows.d.ts +0 -13
|
@@ -11,9 +11,9 @@ import { CurrencyControl as R } from "./currency.js";
|
|
|
11
11
|
import { CURRENCY_CONTROL_ID as ot } from "./currency.js";
|
|
12
12
|
import { FiltersControl as I } from "./filters.js";
|
|
13
13
|
import { FILTERS_CONTROL_ID as nt } from "./filters.js";
|
|
14
|
-
import { LayoutOrientationControl as
|
|
14
|
+
import { LayoutOrientationControl as _ } from "./layoutOrientation.js";
|
|
15
15
|
import { LAYOUT_ORIENTATION_CONTROL_ID as st } from "./layoutOrientation.js";
|
|
16
|
-
import { LocaleControl as
|
|
16
|
+
import { LocaleControl as b } from "./locale.js";
|
|
17
17
|
import { LOCALE_CONTROL_ID as lt } from "./locale.js";
|
|
18
18
|
import { PricePlacementControl as T } from "./pricePlacement.js";
|
|
19
19
|
import { PRICE_PLACEMENT_CONTROL_ID as ut } from "./pricePlacement.js";
|
|
@@ -24,7 +24,7 @@ import { PRODUCT_LAYOUT_CONTROL_ID as Ct } from "./productLayout.js";
|
|
|
24
24
|
import { ShuffleControl as S } from "./shuffle.js";
|
|
25
25
|
import { SHUFFLE_CONTROL_ID as pt } from "./shuffle.js";
|
|
26
26
|
import { setCurrencyAttributes as L, getBlockElement as k, isPartnerManagedBlock as D, updateProductContentInPlace as E, regenerateProductRowsWithStyles as A } from "./utils.js";
|
|
27
|
-
import { adjustProductsToSize as yt, formatProductPrice as Nt, getCardComposition as Rt, getCurrentLayout as It,
|
|
27
|
+
import { adjustProductsToSize as yt, formatProductPrice as Nt, getCardComposition as Rt, getCurrentLayout as It, regenerateMobileProductRows as _t, updatePricesInPlace as bt, updateSingleProductContent as Tt } from "./utils.js";
|
|
28
28
|
import { useDebounceFn as m } from "../../../../../node_modules/@vueuse/shared/index.js";
|
|
29
29
|
const v = "recommendation-id", w = "ui-elements-recommendation-block";
|
|
30
30
|
class Q extends g {
|
|
@@ -81,7 +81,7 @@ class Q extends g {
|
|
|
81
81
|
return w;
|
|
82
82
|
}
|
|
83
83
|
getTemplate() {
|
|
84
|
-
return this.algorithmControl = new N(), this.localeControl = new
|
|
84
|
+
return this.algorithmControl = new N(), this.localeControl = new b(), this.currencyControl = new R(), this.productCountControl = new O(), this.productLayoutControl = new P(), this.filtersControl = new I(), this.shuffleControl = new S(), this.pricePlacementControl = new T(), this.layoutOrientationControl = new _(), [
|
|
85
85
|
this.algorithmControl,
|
|
86
86
|
this.localeControl,
|
|
87
87
|
this.currencyControl,
|
|
@@ -365,8 +365,8 @@ export {
|
|
|
365
365
|
I as FiltersControl,
|
|
366
366
|
st as LAYOUT_ORIENTATION_CONTROL_ID,
|
|
367
367
|
lt as LOCALE_CONTROL_ID,
|
|
368
|
-
|
|
369
|
-
|
|
368
|
+
_ as LayoutOrientationControl,
|
|
369
|
+
b as LocaleControl,
|
|
370
370
|
ut as PRICE_PLACEMENT_CONTROL_ID,
|
|
371
371
|
ht as PRODUCT_COUNT_CONTROL_ID,
|
|
372
372
|
Ct as PRODUCT_LAYOUT_CONTROL_ID,
|
|
@@ -381,12 +381,11 @@ export {
|
|
|
381
381
|
k as getBlockElement,
|
|
382
382
|
Rt as getCardComposition,
|
|
383
383
|
It as getCurrentLayout,
|
|
384
|
-
bt as getMainContainerTbody,
|
|
385
384
|
D as isPartnerManagedBlock,
|
|
386
385
|
_t as regenerateMobileProductRows,
|
|
387
386
|
A as regenerateProductRowsWithStyles,
|
|
388
387
|
L as setCurrencyAttributes,
|
|
389
|
-
|
|
388
|
+
bt as updatePricesInPlace,
|
|
390
389
|
E as updateProductContentInPlace,
|
|
391
|
-
|
|
390
|
+
Tt as updateSingleProductContent
|
|
392
391
|
};
|
|
@@ -5,24 +5,23 @@ import { RecommendationBlockControl as i } from "./controls/main/index.js";
|
|
|
5
5
|
import "./constants/selectors.js";
|
|
6
6
|
import "./store/recommendation.js";
|
|
7
7
|
import "./utils/captureStyleTemplates.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import
|
|
23
|
-
import S from "./
|
|
24
|
-
|
|
25
|
-
const w = [
|
|
8
|
+
import { NameControls as e } from "./controls/name/index.js";
|
|
9
|
+
import { PriceControls as l } from "./controls/price/index.js";
|
|
10
|
+
import { OldPriceControls as s } from "./controls/oldPrice/index.js";
|
|
11
|
+
import { OmnibusPriceControls as p } from "./controls/omnibusPrice/index.js";
|
|
12
|
+
import { OmnibusDiscountControls as a } from "./controls/omnibusDiscount/index.js";
|
|
13
|
+
import { ButtonControls as c } from "./controls/button/index.js";
|
|
14
|
+
import { ImageControls as C } from "./controls/image/index.js";
|
|
15
|
+
import { CustomAttributeControls as f } from "./controls/customAttribute/index.js";
|
|
16
|
+
import { SpacingControl as d } from "./controls/spacing/index.js";
|
|
17
|
+
import { BlockBackgroundColorControl as u } from "./controls/blockBackground/index.js";
|
|
18
|
+
import { CardBackgroundColorControl as g } from "./controls/cardBackground/index.js";
|
|
19
|
+
import { RecommendationCardCompositionControl as y } from "./controls/cardComposition/index.js";
|
|
20
|
+
import { SyncInfoMessageControl as B } from "./controls/syncInfoMessage.js";
|
|
21
|
+
import { RecommendationIconsRegistry as P } from "./iconsRegistry.js";
|
|
22
|
+
import R from "./recommendation.css.js";
|
|
23
|
+
import { SettingsPanel as S } from "./settingsPanel.js";
|
|
24
|
+
const k = [
|
|
26
25
|
e,
|
|
27
26
|
l,
|
|
28
27
|
s,
|
|
@@ -30,22 +29,21 @@ const w = [
|
|
|
30
29
|
a,
|
|
31
30
|
c,
|
|
32
31
|
C,
|
|
33
|
-
f
|
|
34
|
-
|
|
35
|
-
], b = [
|
|
32
|
+
f
|
|
33
|
+
], w = [
|
|
36
34
|
i,
|
|
35
|
+
u,
|
|
37
36
|
g,
|
|
37
|
+
d,
|
|
38
38
|
y,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
...w.flatMap((o) => Object.values(o))
|
|
45
|
-
], Y = v.reduce(
|
|
39
|
+
B
|
|
40
|
+
], b = [
|
|
41
|
+
...w,
|
|
42
|
+
...k.flatMap((o) => Object.values(o))
|
|
43
|
+
], W = b.reduce(
|
|
46
44
|
(o, r) => o.addControl(r),
|
|
47
|
-
new t().addBlock(m).withSettingsPanelRegistry(
|
|
48
|
-
).addStyles(
|
|
45
|
+
new t().addBlock(m).withSettingsPanelRegistry(S)
|
|
46
|
+
).addStyles(R).withPreviewStyles(n).withIconsRegistry(P).build();
|
|
49
47
|
export {
|
|
50
|
-
|
|
48
|
+
W as default
|
|
51
49
|
};
|
|
@@ -3,10 +3,9 @@ import { BLOCK_ID as R } from "./block.js";
|
|
|
3
3
|
import { RecommendationBlockId as S } from "./constants/blockIds.js";
|
|
4
4
|
import { RecommendationControlId as T } from "./constants/controlIds.js";
|
|
5
5
|
import "./constants/selectors.js";
|
|
6
|
-
import { CONTROL_BLOCK_ID as
|
|
6
|
+
import { CONTROL_BLOCK_ID as U } from "./controls/main/index.js";
|
|
7
7
|
import "./store/recommendation.js";
|
|
8
8
|
import "./utils/captureStyleTemplates.js";
|
|
9
|
-
import "./controls/title/index.js";
|
|
10
9
|
import "./controls/name/index.js";
|
|
11
10
|
import "./controls/price/index.js";
|
|
12
11
|
import "./controls/oldPrice/index.js";
|
|
@@ -16,7 +15,7 @@ import "./controls/button/index.js";
|
|
|
16
15
|
import "./controls/image/index.js";
|
|
17
16
|
import { SPACING_CONTROL_ID as A } from "./controls/spacing/index.js";
|
|
18
17
|
import "./controls/blockBackground/index.js";
|
|
19
|
-
import { CARD_BACKGROUND_COLOR_CONTROL_ID as
|
|
18
|
+
import { CARD_BACKGROUND_COLOR_CONTROL_ID as L } from "./controls/cardBackground/index.js";
|
|
20
19
|
import { COMPOSITION_CONTROL_BLOCK_ID as D } from "./controls/cardComposition/index.js";
|
|
21
20
|
import { SYNC_INFO_MESSAGE_CONTROL_ID as N } from "./controls/syncInfoMessage.js";
|
|
22
21
|
class s extends E {
|
|
@@ -25,7 +24,7 @@ class s extends E {
|
|
|
25
24
|
new _(
|
|
26
25
|
I.SETTINGS,
|
|
27
26
|
[
|
|
28
|
-
|
|
27
|
+
U,
|
|
29
28
|
C.EXTERNAL_INDENTS
|
|
30
29
|
]
|
|
31
30
|
),
|
|
@@ -33,7 +32,7 @@ class s extends E {
|
|
|
33
32
|
I.STYLES,
|
|
34
33
|
[
|
|
35
34
|
T.BLOCK_BACKGROUND,
|
|
36
|
-
|
|
35
|
+
L,
|
|
37
36
|
A
|
|
38
37
|
]
|
|
39
38
|
),
|
|
@@ -43,24 +42,6 @@ class s extends E {
|
|
|
43
42
|
D
|
|
44
43
|
]
|
|
45
44
|
).withLabel(this.api.translate("Card Composition"))
|
|
46
|
-
], O[S.TITLE] = [
|
|
47
|
-
new _(
|
|
48
|
-
I.SETTINGS,
|
|
49
|
-
[
|
|
50
|
-
T.TITLE_STYLE,
|
|
51
|
-
T.TITLE_ALIGN,
|
|
52
|
-
T.TITLE_PADDINGS
|
|
53
|
-
]
|
|
54
|
-
),
|
|
55
|
-
new _(
|
|
56
|
-
I.STYLES,
|
|
57
|
-
[
|
|
58
|
-
T.TITLE_BACKGROUND,
|
|
59
|
-
T.TITLE_FONT_FAMILY,
|
|
60
|
-
T.TITLE_SIZE,
|
|
61
|
-
T.TITLE_COLOR
|
|
62
|
-
]
|
|
63
|
-
)
|
|
64
45
|
], O[S.NAME] = [
|
|
65
46
|
new _(
|
|
66
47
|
I.SETTINGS,
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { getRecommendationFeedSourceMaps as g, getOperatorOptions as
|
|
2
|
-
import { useRecommendationApi as
|
|
3
|
-
import { useConfigStore as
|
|
4
|
-
import { defineStore as
|
|
1
|
+
import { getRecommendationFeedSourceMaps as g, getOperatorOptions as C, PriceAttributes as y } from "../../../../enums/extensions/recommendationBlock.js";
|
|
2
|
+
import { useRecommendationApi as G } from "../../../../services/recommendationApi.js";
|
|
3
|
+
import { useConfigStore as P } from "../../../../stores/config.js";
|
|
4
|
+
import { defineStore as F } from "pinia";
|
|
5
5
|
import "../constants/selectors.js";
|
|
6
|
-
import { DEFAULT_MOBILE_CARDS_IN_ROW as
|
|
6
|
+
import { DEFAULT_MOBILE_CARDS_IN_ROW as D, DEFAULT_CARDS_IN_ROW as v } from "../constants/layout.js";
|
|
7
7
|
import { EXCLUDED_ALGORITHM_IDS as w } from "../constants/defaultConfig.js";
|
|
8
8
|
import { getDefaultProducts as S } from "../templates/utils.js";
|
|
9
9
|
import { generateCompleteFilterQuery as b } from "../utils/filterUtil.js";
|
|
10
|
-
import { getPartnerRecommendationParams as
|
|
11
|
-
import { sanitizeProductIds as
|
|
12
|
-
import { isFilterValid as
|
|
13
|
-
import { isConfigValid as
|
|
14
|
-
const h =
|
|
10
|
+
import { getPartnerRecommendationParams as N } from "../utils/partnerCustomizations.js";
|
|
11
|
+
import { sanitizeProductIds as x } from "../utils/productIds.js";
|
|
12
|
+
import { isFilterValid as L } from "../validation/filterSchema.js";
|
|
13
|
+
import { isConfigValid as I } from "../validation/requiredFields.js";
|
|
14
|
+
const h = G();
|
|
15
15
|
let m = null, u = null, d = null;
|
|
16
|
-
function
|
|
16
|
+
function R() {
|
|
17
17
|
return {
|
|
18
|
-
cardsInRow:
|
|
18
|
+
cardsInRow: v,
|
|
19
19
|
currencySettings: {
|
|
20
20
|
name: "USD",
|
|
21
21
|
value: "USD",
|
|
@@ -29,7 +29,7 @@ function k() {
|
|
|
29
29
|
productIds: [],
|
|
30
30
|
id: 1,
|
|
31
31
|
language: "en_US",
|
|
32
|
-
mobileCardsInRow:
|
|
32
|
+
mobileCardsInRow: D,
|
|
33
33
|
mobileLayoutEnabled: !1,
|
|
34
34
|
orientation: "grid",
|
|
35
35
|
recommendedProducts: [],
|
|
@@ -44,9 +44,9 @@ function k() {
|
|
|
44
44
|
priceHideIfSameAsDiscounted: !1
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function k() {
|
|
48
48
|
return {
|
|
49
|
-
recommendationConfigs:
|
|
49
|
+
recommendationConfigs: R(),
|
|
50
50
|
recommendationProducts: [],
|
|
51
51
|
filterStatus: !1,
|
|
52
52
|
filterSelectionDrawerStatus: !1,
|
|
@@ -64,7 +64,7 @@ const U = () => ({
|
|
|
64
64
|
blockStates: {},
|
|
65
65
|
currentRecommendationId: null,
|
|
66
66
|
configVersion: 0
|
|
67
|
-
}), H =
|
|
67
|
+
}), H = F("guidoRecommendationExtension", {
|
|
68
68
|
state: () => U(),
|
|
69
69
|
getters: {
|
|
70
70
|
// ====================================================================
|
|
@@ -75,7 +75,7 @@ const U = () => ({
|
|
|
75
75
|
* This allows all existing code that reads `store.recommendationConfigs` to work unchanged.
|
|
76
76
|
*/
|
|
77
77
|
recommendationConfigs(t) {
|
|
78
|
-
return t.currentRecommendationId !== null && t.blockStates[t.currentRecommendationId] ? t.blockStates[t.currentRecommendationId].recommendationConfigs :
|
|
78
|
+
return t.currentRecommendationId !== null && t.blockStates[t.currentRecommendationId] ? t.blockStates[t.currentRecommendationId].recommendationConfigs : R();
|
|
79
79
|
},
|
|
80
80
|
/**
|
|
81
81
|
* Proxy getter: delegates to blockStates[currentRecommendationId].recommendationProducts
|
|
@@ -139,7 +139,7 @@ const U = () => ({
|
|
|
139
139
|
getFilterList() {
|
|
140
140
|
return Object.values(this.filterList).filter((t) => t.isFilterable !== 0 && t.isFilterable !== !1).map((t) => {
|
|
141
141
|
let e;
|
|
142
|
-
return t.type === "productAttribute" ? e = `product_attributes.${t.attributeName}` :
|
|
142
|
+
return t.type === "productAttribute" ? e = `product_attributes.${t.attributeName}` : y.includes(t.attributeName) ? e = `${t.attributeName}.${this.recommendationConfigs.currencySettings.value}` : e = t.attributeName, {
|
|
143
143
|
text: t.displayName,
|
|
144
144
|
value: e,
|
|
145
145
|
type: t.attributeType
|
|
@@ -161,7 +161,7 @@ const U = () => ({
|
|
|
161
161
|
setCurrentBlock(t) {
|
|
162
162
|
this.blockStates[t] || (this.blockStates = {
|
|
163
163
|
...this.blockStates,
|
|
164
|
-
[t]:
|
|
164
|
+
[t]: k()
|
|
165
165
|
}), this.currentRecommendationId = t;
|
|
166
166
|
},
|
|
167
167
|
/**
|
|
@@ -229,7 +229,7 @@ const U = () => ({
|
|
|
229
229
|
decimalCount: String(e.currencyDecimalCount),
|
|
230
230
|
decimalSeparator: r(e.currencyDecimalSeparator, ","),
|
|
231
231
|
thousandSeparator: r(e.currencyThousandSeparator, ".")
|
|
232
|
-
}, c = !this.blockStates[t], i = c ?
|
|
232
|
+
}, c = !this.blockStates[t], i = c ? k() : this.blockStates[t];
|
|
233
233
|
i.recommendationConfigs = {
|
|
234
234
|
...i.recommendationConfigs,
|
|
235
235
|
strategy: e.strategy,
|
|
@@ -267,7 +267,7 @@ const U = () => ({
|
|
|
267
267
|
* Creates a filter with the first available attribute and operator pre-selected.
|
|
268
268
|
*/
|
|
269
269
|
createDefaultFilter(t, e) {
|
|
270
|
-
const [r] = this.getFilterList, [n] =
|
|
270
|
+
const [r] = this.getFilterList, [n] = C(r == null ? void 0 : r.type);
|
|
271
271
|
return {
|
|
272
272
|
type: "standardFilter",
|
|
273
273
|
attribute: (r == null ? void 0 : r.value) ?? "",
|
|
@@ -384,7 +384,7 @@ const U = () => ({
|
|
|
384
384
|
const n = [...e.recommendationConfigs.filters];
|
|
385
385
|
n[r] = {
|
|
386
386
|
...t,
|
|
387
|
-
isValid:
|
|
387
|
+
isValid: L(t)
|
|
388
388
|
}, e.recommendationConfigs.filters = n;
|
|
389
389
|
}
|
|
390
390
|
},
|
|
@@ -430,7 +430,14 @@ const U = () => ({
|
|
|
430
430
|
* every block's recommendationConfigs across user edits.
|
|
431
431
|
*/
|
|
432
432
|
hasInvalidBlock() {
|
|
433
|
-
return Object.values(this.blockStates).some((t) => !
|
|
433
|
+
return Object.values(this.blockStates).some((t) => !I(t.recommendationConfigs, this));
|
|
434
|
+
},
|
|
435
|
+
/**
|
|
436
|
+
* Per-instance counterpart to `hasInvalidBlock`: the ids of every block
|
|
437
|
+
* that fails required-field validation, one drawer row each (SD-147430).
|
|
438
|
+
*/
|
|
439
|
+
invalidBlockIds() {
|
|
440
|
+
return Object.entries(this.blockStates).filter(([, t]) => !I(t.recommendationConfigs, this)).map(([t]) => t);
|
|
434
441
|
},
|
|
435
442
|
// ====================================================================
|
|
436
443
|
// Per-Block Product Fetching
|
|
@@ -451,7 +458,7 @@ const U = () => ({
|
|
|
451
458
|
},
|
|
452
459
|
async _doFetchProducts() {
|
|
453
460
|
var p;
|
|
454
|
-
const t = this.currentRecommendationId, e = this.blockStates[t], { recommendationConfigs: r } = e, n = r.filters.filter((l) => l.isValid), c = b(n), i = ((p = g().find((l) => l.key === r.strategy)) == null ? void 0 : p.path) || "", o =
|
|
461
|
+
const t = this.currentRecommendationId, e = this.blockStates[t], { recommendationConfigs: r } = e, n = r.filters.filter((l) => l.isValid), c = b(n), i = ((p = g().find((l) => l.key === r.strategy)) == null ? void 0 : p.path) || "", o = P(), s = parseInt(r.size) || 6, a = {
|
|
455
462
|
locale: r.language,
|
|
456
463
|
currency: r.currencySettings.value,
|
|
457
464
|
partnerName: o.partnerName,
|
|
@@ -459,9 +466,9 @@ const U = () => ({
|
|
|
459
466
|
details: !0,
|
|
460
467
|
campaignId: o.variationId
|
|
461
468
|
};
|
|
462
|
-
r.strategy === "manualMerchandising" ? a.productId =
|
|
469
|
+
r.strategy === "manualMerchandising" ? a.productId = x(r.productIds) : r.strategy === "similarViewed" && (a.productId = "{itemId}"), r.strategy === "userBased" && (a.userId = "{user_id}"), c && (a.filter = c), r.shuffleProducts && (a.shuffle = !0), Object.assign(
|
|
463
470
|
a,
|
|
464
|
-
|
|
471
|
+
N(o.partnerName, r.strategy)
|
|
465
472
|
);
|
|
466
473
|
let f;
|
|
467
474
|
try {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ATTR_PRODUCT_PRICE as f, ATTR_PRODUCT_OLD_PRICE as O } from "../../constants/selectors.js";
|
|
2
2
|
import { DEFAULT_PRODUCTS_PER_ROW as w } from "../../constants/layout.js";
|
|
3
|
-
import {
|
|
3
|
+
import { getDefaultProducts as A, DEFAULTS as g, createBlockTemplate as U, buildSpacer as h, DEFAULT_CARD_COMPOSITION as Y, buildElementRenderer as B, resolveInlinePriceOrder as F, buildCellOptions as I, DEFAULT_CARD_VISIBILITY as W } from "../utils.js";
|
|
4
4
|
import { DEFAULT_CELL_PADDING as k, renderInlineGridPriceCell as H, buildFillerCell as x, gridElementRenderer as y } from "./elementRenderer.js";
|
|
5
5
|
const G = `
|
|
6
6
|
<tr class="recommendation-product-row">
|
|
@@ -69,8 +69,8 @@ function M(t, r, o, e = {}, c = {}) {
|
|
|
69
69
|
);
|
|
70
70
|
}
|
|
71
71
|
function Q(t) {
|
|
72
|
-
const r = t ? `ins-recommendation-v3-block-${t}` : void 0, o =
|
|
73
|
-
return o.replace("{-{-TITLE-}-}",
|
|
72
|
+
const r = t ? `ins-recommendation-v3-block-${t}` : void 0, o = U("grid", r), e = A(), c = M(e, w);
|
|
73
|
+
return o.replace("{-{-TITLE-}-}", g.TITLE).replace("{-{-PRODUCT_ROWS-}-}", c).replace("{-{-MOBILE_PRODUCT_ROWS-}-}", "");
|
|
74
74
|
}
|
|
75
75
|
export {
|
|
76
76
|
Q as getDefaultTemplate,
|