@useinsider/guido 3.17.0-beta.3e9d6e7 → 3.17.0-beta.3ff6ea0
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 +0 -1
- package/dist/@types/config/schemas.js +6 -12
- package/dist/components/Guido.vue.js +6 -6
- package/dist/components/Guido.vue2.js +61 -63
- package/dist/composables/useCustomInterfaceAppearance.js +16 -19
- package/dist/composables/useRecommendation.js +34 -41
- package/dist/composables/useStripo.js +14 -14
- package/dist/config/migrator/index.js +9 -8
- package/dist/config/migrator/recommendation/compositionMapper.js +20 -20
- package/dist/config/migrator/recommendation/extractors.js +29 -24
- package/dist/config/migrator/recommendation/htmlBuilder.js +116 -130
- package/dist/config/migrator/recommendationMigrator.js +16 -15
- package/dist/config/migrator/recommendationTitleMigrator.js +119 -0
- package/dist/enums/date.js +3 -4
- package/dist/enums/extensions/recommendationBlock.js +23 -25
- 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 +20 -21
- package/dist/extensions/Blocks/Recommendation/constants/selectors.js +34 -28
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +306 -238
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +95 -122
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +1 -0
- package/dist/extensions/Blocks/Recommendation/controls/title/index.js +44 -0
- package/dist/extensions/Blocks/Recommendation/extension.js +31 -29
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +23 -4
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +53 -199
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +3 -3
- package/dist/extensions/Blocks/Recommendation/templates/titleRows.js +33 -0
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +85 -107
- package/dist/extensions/Blocks/common-control.js +19 -22
- package/dist/guido.css +1 -1
- package/dist/services/recommendationApi.js +28 -77
- package/dist/src/@types/config/schemas.d.ts +0 -12
- package/dist/src/composables/useConfig.d.ts +0 -2
- package/dist/src/composables/useRecommendation.d.ts +0 -1
- package/dist/src/config/migrator/recommendation/extractors.d.ts +8 -0
- package/dist/src/config/migrator/recommendationTitleMigrator.d.ts +5 -0
- package/dist/src/enums/extensions/recommendationBlock.d.ts +0 -2
- package/dist/src/extensions/Blocks/Recommendation/constants/blockIds.d.ts +2 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +10 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +10 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +3 -12
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/title/index.d.ts +86 -0
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +10 -210
- package/dist/src/extensions/Blocks/Recommendation/templates/titleRows.d.ts +13 -0
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +0 -6
- package/dist/src/extensions/Blocks/common-control.d.ts +1 -4
- package/dist/src/services/recommendationApi.d.ts +1 -4
- package/dist/src/stores/config.d.ts +0 -18
- package/dist/static/styles/customEditorStyle.css.js +3 -1
- package/dist/utils/dateUtil.js +10 -23
- package/dist/utils/templatePreparation.js +34 -37
- package/package.json +1 -2
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +0 -18
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +0 -67
- package/dist/components/organisms/extensions/recommendation/StrategyInfoBox.vue.js +0 -20
- package/dist/components/organisms/extensions/recommendation/StrategyInfoBox.vue2.js +0 -55
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +0 -132
- package/dist/node_modules/@useinsider/design-system-organisms/dist/index-Dc9AygoZ.js +0 -526
- package/dist/node_modules/@useinsider/design-system-organisms/dist/index.js +0 -9345
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InAccordion.js +0 -174
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InBasicTextInput.js +0 -381
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InBox.js +0 -236
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InBulkActions.js +0 -70
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InButton.js +0 -350
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InButtonV2.js +0 -371
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InCheckBox.js +0 -152
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InChips.js +0 -141
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InCustomDropDown.js +0 -1047
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InDataTableV2.js +0 -96050
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InDatePicker.js +0 -2042
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InDrawer.js +0 -166
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InDropDown.js +0 -1098
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InIcons.js +0 -55
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InInfoBox.js +0 -265
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InLinks.js +0 -184
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InLoading.js +0 -50
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InModals.js +0 -453
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InNoData.js +0 -145
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InOnPageMessage.js +0 -176
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InProgress.js +0 -266
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InRadioButton.js +0 -114
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InSegments.js +0 -200
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InSelect.js +0 -451
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InSkeleton.js +0 -49
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InStatusText.js +0 -119
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InTabs.js +0 -4309
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InTagsText.js +0 -129
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InTextInput.js +0 -503
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InToasts.js +0 -253
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InToggle.js +0 -107
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InTooltip.js +0 -134
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InTooltipV2.js +0 -464
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/_commonjsHelpers.BItOPCY9.js +0 -28
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/_plugin-vue2_normalizer.WQT2Fc8L.js +0 -23
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/clickOutside.qP9M0QCm.js +0 -29
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/helpers.CgHNyjAJ.js +0 -109
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/index.Bw_06igr.js +0 -2339
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/localLocalesMixin.DYMhydo2.js +0 -16
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/useLocalLocales.Ckuhy7d-.js +0 -17
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/vue-property-decorator.BtlM7Epa.js +0 -188
- package/dist/src/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.d.ts +0 -3
- package/dist/src/components/organisms/extensions/recommendation/StrategyInfoBox.vue.d.ts +0 -24
- package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +0 -37
- package/dist/src/mock/api/recommendation-strategies.d.ts +0 -43
- package/dist/static/styles/components/recommendation-strategy.css.js +0 -171
|
@@ -1,39 +1,36 @@
|
|
|
1
1
|
var f = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var s = (d,
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { ALGORITHM_CONTROL_ID as nt } from "./algorithm.js";
|
|
2
|
+
var p = (d, l, t) => l in d ? f(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
|
+
import { CommonControl as g } from "../../../common-control.js";
|
|
5
|
+
import { DEFAULT_NODE_CONFIG as c } from "../../constants/defaultConfig.js";
|
|
6
|
+
import { RecommendationConfigService as h } from "../../services/configService.js";
|
|
7
|
+
import { useRecommendationExtensionStore as y } from "../../store/recommendation.js";
|
|
8
|
+
import { AlgorithmControl as N } from "./algorithm.js";
|
|
9
|
+
import { ALGORITHM_CONTROL_ID as tt } from "./algorithm.js";
|
|
11
10
|
import { CurrencyControl as R } from "./currency.js";
|
|
12
|
-
import { CURRENCY_CONTROL_ID as
|
|
13
|
-
import { FiltersControl as
|
|
14
|
-
import { FILTERS_CONTROL_ID as
|
|
11
|
+
import { CURRENCY_CONTROL_ID as ot } from "./currency.js";
|
|
12
|
+
import { FiltersControl as I } from "./filters.js";
|
|
13
|
+
import { FILTERS_CONTROL_ID as nt } from "./filters.js";
|
|
15
14
|
import { LayoutOrientationControl as b } from "./layoutOrientation.js";
|
|
16
|
-
import { LAYOUT_ORIENTATION_CONTROL_ID as
|
|
15
|
+
import { LAYOUT_ORIENTATION_CONTROL_ID as st } from "./layoutOrientation.js";
|
|
17
16
|
import { LocaleControl as _ } from "./locale.js";
|
|
18
|
-
import { LOCALE_CONTROL_ID as
|
|
19
|
-
import { PricePlacementControl as
|
|
20
|
-
import { PRICE_PLACEMENT_CONTROL_ID as
|
|
21
|
-
import { ProductCountControl as
|
|
22
|
-
import { PRODUCT_COUNT_CONTROL_ID as
|
|
23
|
-
import { ProductLayoutControl as
|
|
24
|
-
import { PRODUCT_LAYOUT_CONTROL_ID as
|
|
25
|
-
import { ShuffleControl as
|
|
26
|
-
import { SHUFFLE_CONTROL_ID as
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
const x = "recommendation-id", B = "ui-elements-recommendation-block";
|
|
33
|
-
class et extends y {
|
|
17
|
+
import { LOCALE_CONTROL_ID as lt } from "./locale.js";
|
|
18
|
+
import { PricePlacementControl as T } from "./pricePlacement.js";
|
|
19
|
+
import { PRICE_PLACEMENT_CONTROL_ID as ut } from "./pricePlacement.js";
|
|
20
|
+
import { ProductCountControl as O } from "./productCount.js";
|
|
21
|
+
import { PRODUCT_COUNT_CONTROL_ID as ht } from "./productCount.js";
|
|
22
|
+
import { ProductLayoutControl as P } from "./productLayout.js";
|
|
23
|
+
import { PRODUCT_LAYOUT_CONTROL_ID as Ct } from "./productLayout.js";
|
|
24
|
+
import { ShuffleControl as S } from "./shuffle.js";
|
|
25
|
+
import { SHUFFLE_CONTROL_ID as pt } from "./shuffle.js";
|
|
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, getMainContainerTbody as bt, regenerateMobileProductRows as _t, updatePricesInPlace as Tt, updateSingleProductContent as Ot } from "./utils.js";
|
|
28
|
+
import { useDebounceFn as m } from "../../../../../node_modules/@vueuse/shared/index.js";
|
|
29
|
+
const v = "recommendation-id", w = "ui-elements-recommendation-block";
|
|
30
|
+
class Q extends g {
|
|
34
31
|
constructor() {
|
|
35
32
|
super(...arguments);
|
|
36
|
-
s(this, "store",
|
|
33
|
+
s(this, "store", y());
|
|
37
34
|
s(this, "storeUnsubscription", () => {
|
|
38
35
|
});
|
|
39
36
|
s(this, "syncedBlockIds", /* @__PURE__ */ new Set());
|
|
@@ -47,11 +44,10 @@ class et extends y {
|
|
|
47
44
|
s(this, "shuffleControl", null);
|
|
48
45
|
s(this, "pricePlacementControl", null);
|
|
49
46
|
s(this, "layoutOrientationControl", null);
|
|
50
|
-
s(this, "strategyControl", null);
|
|
51
47
|
/**
|
|
52
48
|
* Debounced product fetch to prevent rapid API calls during config changes
|
|
53
49
|
*/
|
|
54
|
-
s(this, "_debouncedFetchProducts",
|
|
50
|
+
s(this, "_debouncedFetchProducts", m(() => {
|
|
55
51
|
this.store.fetchRecommendationProducts();
|
|
56
52
|
}, 500));
|
|
57
53
|
/**
|
|
@@ -65,16 +61,16 @@ class et extends y {
|
|
|
65
61
|
* count. The store pads products to the configured size, so in-place only
|
|
66
62
|
* fails when the size actually changed.
|
|
67
63
|
*/
|
|
68
|
-
s(this, "_debouncedRegenerateWithProducts",
|
|
64
|
+
s(this, "_debouncedRegenerateWithProducts", m(() => {
|
|
69
65
|
const t = this.store.recommendationProducts;
|
|
70
|
-
if (!this.currentNode || !this.api ||
|
|
66
|
+
if (!this.currentNode || !this.api || D(this.currentNode))
|
|
71
67
|
return;
|
|
72
68
|
const e = this.api.getDocumentModifier();
|
|
73
|
-
|
|
69
|
+
E({
|
|
74
70
|
currentNode: this.currentNode,
|
|
75
71
|
documentModifier: e,
|
|
76
72
|
products: t
|
|
77
|
-
}) ||
|
|
73
|
+
}) || A({
|
|
78
74
|
currentNode: this.currentNode,
|
|
79
75
|
documentModifier: e,
|
|
80
76
|
products: t
|
|
@@ -82,11 +78,10 @@ class et extends y {
|
|
|
82
78
|
}, 100));
|
|
83
79
|
}
|
|
84
80
|
getId() {
|
|
85
|
-
return
|
|
81
|
+
return w;
|
|
86
82
|
}
|
|
87
83
|
getTemplate() {
|
|
88
|
-
|
|
89
|
-
return this.algorithmControl = t ? null : new I(), this.localeControl = new _(), this.currencyControl = new R(), this.productCountControl = t ? null : new P(), this.productLayoutControl = new S(), this.filtersControl = t ? null : new T(), this.shuffleControl = t ? null : new L(), this.pricePlacementControl = new O(), this.layoutOrientationControl = new b(), this.strategyControl = t ? new k() : null, [
|
|
84
|
+
return this.algorithmControl = new N(), this.localeControl = new _(), 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 b(), [
|
|
90
85
|
this.algorithmControl,
|
|
91
86
|
this.localeControl,
|
|
92
87
|
this.currencyControl,
|
|
@@ -95,20 +90,10 @@ class et extends y {
|
|
|
95
90
|
this.filtersControl,
|
|
96
91
|
this.shuffleControl,
|
|
97
92
|
this.pricePlacementControl,
|
|
98
|
-
this.layoutOrientationControl
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}), t ? `
|
|
103
|
-
<div class="recommendation-controls-container">
|
|
104
|
-
${this.strategyControl.getTemplate()}
|
|
105
|
-
${this.layoutOrientationControl.getTemplate()}
|
|
106
|
-
${this.localeControl.getTemplate()}
|
|
107
|
-
${this.currencyControl.getTemplate()}
|
|
108
|
-
${this.pricePlacementControl.getTemplate()}
|
|
109
|
-
${this.productLayoutControl.getTemplate()}
|
|
110
|
-
</div>
|
|
111
|
-
` : `
|
|
93
|
+
this.layoutOrientationControl
|
|
94
|
+
].forEach((e) => {
|
|
95
|
+
e.api = this.api;
|
|
96
|
+
}), `
|
|
112
97
|
<div class="recommendation-controls-container">
|
|
113
98
|
${this.layoutOrientationControl.getTemplate()}
|
|
114
99
|
${this.productCountControl.getTemplate()}
|
|
@@ -146,8 +131,7 @@ class et extends y {
|
|
|
146
131
|
this.productLayoutControl,
|
|
147
132
|
this.filtersControl,
|
|
148
133
|
this.shuffleControl,
|
|
149
|
-
this.pricePlacementControl
|
|
150
|
-
this.strategyControl
|
|
134
|
+
this.pricePlacementControl
|
|
151
135
|
].forEach((n) => {
|
|
152
136
|
var i;
|
|
153
137
|
n != null && n.api && (n.currentNode = t, (i = n.onTemplateNodeUpdated) == null || i.call(n, t));
|
|
@@ -163,8 +147,7 @@ class et extends y {
|
|
|
163
147
|
this.productLayoutControl,
|
|
164
148
|
this.filtersControl,
|
|
165
149
|
this.shuffleControl,
|
|
166
|
-
this.pricePlacementControl
|
|
167
|
-
this.strategyControl
|
|
150
|
+
this.pricePlacementControl
|
|
168
151
|
].forEach((e) => {
|
|
169
152
|
var o;
|
|
170
153
|
return (o = e == null ? void 0 : e.onDestroy) == null ? void 0 : o.call(e);
|
|
@@ -184,8 +167,7 @@ class et extends y {
|
|
|
184
167
|
this.productLayoutControl,
|
|
185
168
|
this.filtersControl,
|
|
186
169
|
this.shuffleControl,
|
|
187
|
-
this.pricePlacementControl
|
|
188
|
-
this.strategyControl
|
|
170
|
+
this.pricePlacementControl
|
|
189
171
|
].forEach((e) => {
|
|
190
172
|
var o;
|
|
191
173
|
e && (e.api = this.api, e.currentNode = this.currentNode, (o = e.onRender) == null || o.call(e));
|
|
@@ -204,10 +186,9 @@ class et extends y {
|
|
|
204
186
|
*/
|
|
205
187
|
_syncNodeConfigToStore() {
|
|
206
188
|
var r;
|
|
207
|
-
const t =
|
|
189
|
+
const t = h.getConfig(this.currentNode), e = this.store.currentRecommendationId, o = e !== null && ((r = this.store.blockStates[e]) == null ? void 0 : r.isInitialized);
|
|
208
190
|
this.store.patchCurrentBlockConfig({
|
|
209
191
|
strategy: t.strategy,
|
|
210
|
-
strategyId: t.strategyId,
|
|
211
192
|
language: t.language,
|
|
212
193
|
size: t.size,
|
|
213
194
|
productIds: t.productIds,
|
|
@@ -268,36 +249,36 @@ class et extends y {
|
|
|
268
249
|
_applySmartDefaults() {
|
|
269
250
|
if (!this.currentNode || !this.api)
|
|
270
251
|
return;
|
|
271
|
-
const t =
|
|
252
|
+
const t = h.getConfig(this.currentNode), e = {};
|
|
272
253
|
let o = null, r = null, n = null;
|
|
273
|
-
if (t.currency.code ===
|
|
254
|
+
if (t.currency.code === c.currency.code) {
|
|
274
255
|
const { currencyList: i } = this.store;
|
|
275
256
|
i.length > 0 && (i.some(
|
|
276
|
-
(u) => u.value === `price.${
|
|
257
|
+
(u) => u.value === `price.${c.currency.code}`
|
|
277
258
|
) || (o = i[0].value.replace("price.", ""), e.currency = {
|
|
278
|
-
...
|
|
259
|
+
...c.currency,
|
|
279
260
|
code: o,
|
|
280
261
|
symbol: o
|
|
281
262
|
}));
|
|
282
263
|
}
|
|
283
|
-
if (t.strategy ===
|
|
264
|
+
if (t.strategy === c.strategy) {
|
|
284
265
|
const i = this.store.getActivePredictiveAlgorithms;
|
|
285
266
|
i.length > 0 && (i.some(
|
|
286
|
-
(u) => u.value ===
|
|
267
|
+
(u) => u.value === c.strategy
|
|
287
268
|
) || (r = i[0].value, e.strategy = r));
|
|
288
269
|
}
|
|
289
|
-
if (t.language ===
|
|
270
|
+
if (t.language === c.language) {
|
|
290
271
|
const i = this.store.getLanguages;
|
|
291
272
|
i.length > 0 && (i.some(
|
|
292
|
-
(u) => u.value ===
|
|
273
|
+
(u) => u.value === c.language
|
|
293
274
|
) || (n = i[0].value, e.language = n));
|
|
294
275
|
}
|
|
295
|
-
!o && !r && !n || (
|
|
276
|
+
!o && !r && !n || (h.updateConfig(
|
|
296
277
|
this.api,
|
|
297
278
|
this.currentNode,
|
|
298
279
|
e,
|
|
299
280
|
"Applied smart defaults"
|
|
300
|
-
), o && e.currency &&
|
|
281
|
+
), o && e.currency && L({
|
|
301
282
|
currentNode: this.currentNode,
|
|
302
283
|
documentModifier: this.api.getDocumentModifier(),
|
|
303
284
|
currency: e.currency
|
|
@@ -307,10 +288,10 @@ class et extends y {
|
|
|
307
288
|
name: o,
|
|
308
289
|
value: o,
|
|
309
290
|
symbol: o,
|
|
310
|
-
alignment:
|
|
311
|
-
decimalCount:
|
|
312
|
-
decimalSeparator:
|
|
313
|
-
thousandSeparator:
|
|
291
|
+
alignment: c.currency.alignment === "before" ? "0" : "1",
|
|
292
|
+
decimalCount: c.currency.decimalCount.toString(),
|
|
293
|
+
decimalSeparator: c.currency.decimalSeparator,
|
|
294
|
+
thousandSeparator: c.currency.thousandSeparator
|
|
314
295
|
}
|
|
315
296
|
} : {},
|
|
316
297
|
...r ? { strategy: r } : {},
|
|
@@ -321,10 +302,10 @@ class et extends y {
|
|
|
321
302
|
* Reads the recommendation-id attribute from the block element within the node
|
|
322
303
|
*/
|
|
323
304
|
_getRecommendationIdFromNode(t) {
|
|
324
|
-
const e =
|
|
305
|
+
const e = k(t);
|
|
325
306
|
if (!e || !("getAttribute" in e))
|
|
326
307
|
return null;
|
|
327
|
-
const o = e.getAttribute(
|
|
308
|
+
const o = e.getAttribute(v);
|
|
328
309
|
if (!o)
|
|
329
310
|
return null;
|
|
330
311
|
const r = parseInt(o);
|
|
@@ -354,66 +335,58 @@ class et extends y {
|
|
|
354
335
|
}
|
|
355
336
|
const i = t.$state.configVersion;
|
|
356
337
|
i !== o && (o = i, this._persistFiltersToNodeConfig(), this._debouncedFetchProducts());
|
|
357
|
-
const
|
|
358
|
-
u && C && (e =
|
|
338
|
+
const a = t.recommendationProducts, u = a !== e, C = Array.isArray(a) && a.length > 0;
|
|
339
|
+
u && C && (e = a, this._debouncedRegenerateWithProducts());
|
|
359
340
|
});
|
|
360
341
|
}
|
|
361
342
|
/**
|
|
362
|
-
* Persists the current filter
|
|
363
|
-
*
|
|
364
|
-
* (strategyId must be in esd-ext-config before any save — SD-149105).
|
|
365
|
-
*
|
|
366
|
-
* `size` rides along because assigning a strategy overwrites it in the
|
|
367
|
-
* store only. Without this write, `_syncNodeConfigToStore` re-seeds the
|
|
368
|
-
* store from the stale node config on the next panel open, and a block
|
|
369
|
-
* whose saved HTML has the strategy's slot count gets rebuilt against the
|
|
370
|
-
* old one — resetting migrator-applied per-element styles.
|
|
343
|
+
* Persists the current filter state from Pinia store to the Stripo node config.
|
|
344
|
+
* This ensures filters survive template save/reload cycles.
|
|
371
345
|
*/
|
|
372
346
|
_persistFiltersToNodeConfig() {
|
|
373
347
|
if (!this.currentNode || !this.api)
|
|
374
348
|
return;
|
|
375
|
-
const { filters: t
|
|
376
|
-
JSON.stringify(
|
|
349
|
+
const { filters: t } = this.store.recommendationConfigs, e = h.getConfig(this.currentNode).filters;
|
|
350
|
+
JSON.stringify(e) !== JSON.stringify(t) && h.updateConfig(
|
|
377
351
|
this.api,
|
|
378
352
|
this.currentNode,
|
|
379
|
-
{ filters: t
|
|
353
|
+
{ filters: t },
|
|
380
354
|
"Update recommendation filters"
|
|
381
355
|
);
|
|
382
356
|
}
|
|
383
357
|
}
|
|
384
358
|
export {
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
359
|
+
tt as ALGORITHM_CONTROL_ID,
|
|
360
|
+
N as AlgorithmControl,
|
|
361
|
+
w as CONTROL_BLOCK_ID,
|
|
362
|
+
ot as CURRENCY_CONTROL_ID,
|
|
389
363
|
R as CurrencyControl,
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
364
|
+
nt as FILTERS_CONTROL_ID,
|
|
365
|
+
I as FiltersControl,
|
|
366
|
+
st as LAYOUT_ORIENTATION_CONTROL_ID,
|
|
367
|
+
lt as LOCALE_CONTROL_ID,
|
|
394
368
|
b as LayoutOrientationControl,
|
|
395
369
|
_ as LocaleControl,
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
Dt as updateSingleProductContent
|
|
370
|
+
ut as PRICE_PLACEMENT_CONTROL_ID,
|
|
371
|
+
ht as PRODUCT_COUNT_CONTROL_ID,
|
|
372
|
+
Ct as PRODUCT_LAYOUT_CONTROL_ID,
|
|
373
|
+
T as PricePlacementControl,
|
|
374
|
+
O as ProductCountControl,
|
|
375
|
+
P as ProductLayoutControl,
|
|
376
|
+
Q as RecommendationBlockControl,
|
|
377
|
+
pt as SHUFFLE_CONTROL_ID,
|
|
378
|
+
S as ShuffleControl,
|
|
379
|
+
yt as adjustProductsToSize,
|
|
380
|
+
Nt as formatProductPrice,
|
|
381
|
+
k as getBlockElement,
|
|
382
|
+
Rt as getCardComposition,
|
|
383
|
+
It as getCurrentLayout,
|
|
384
|
+
bt as getMainContainerTbody,
|
|
385
|
+
D as isPartnerManagedBlock,
|
|
386
|
+
_t as regenerateMobileProductRows,
|
|
387
|
+
A as regenerateProductRowsWithStyles,
|
|
388
|
+
L as setCurrencyAttributes,
|
|
389
|
+
Tt as updatePricesInPlace,
|
|
390
|
+
E as updateProductContentInPlace,
|
|
391
|
+
Ot as updateSingleProductContent
|
|
419
392
|
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { createPaddingsControl as r, createTextBackgroundColorControl as T, createTextFontFamilyControl as e, createTextStyleControl as l, createTextSizeControl as C, createTextColorControl as c, createTextAlignControl as I } from "../../../controlFactories.js";
|
|
2
|
+
import { RecommendationBlockId as o } from "../../constants/blockIds.js";
|
|
3
|
+
import { RecommendationControlId as t } from "../../constants/controlIds.js";
|
|
4
|
+
import { BLOCK_ROOT_SELECTOR as n } from "../../constants/selectors.js";
|
|
5
|
+
const L = I(
|
|
6
|
+
t.TITLE_ALIGN,
|
|
7
|
+
o.TITLE,
|
|
8
|
+
n
|
|
9
|
+
), a = c(
|
|
10
|
+
t.TITLE_COLOR,
|
|
11
|
+
o.TITLE,
|
|
12
|
+
n
|
|
13
|
+
), i = C(
|
|
14
|
+
t.TITLE_SIZE,
|
|
15
|
+
o.TITLE,
|
|
16
|
+
n
|
|
17
|
+
), E = l(
|
|
18
|
+
t.TITLE_STYLE,
|
|
19
|
+
o.TITLE,
|
|
20
|
+
n
|
|
21
|
+
), m = e(
|
|
22
|
+
t.TITLE_FONT_FAMILY,
|
|
23
|
+
o.TITLE,
|
|
24
|
+
n
|
|
25
|
+
), s = T(
|
|
26
|
+
t.TITLE_BACKGROUND,
|
|
27
|
+
o.TITLE,
|
|
28
|
+
n
|
|
29
|
+
), d = r(
|
|
30
|
+
t.TITLE_PADDINGS,
|
|
31
|
+
o.TITLE,
|
|
32
|
+
n
|
|
33
|
+
), x = {
|
|
34
|
+
align: L,
|
|
35
|
+
color: a,
|
|
36
|
+
size: i,
|
|
37
|
+
style: E,
|
|
38
|
+
fontFamily: m,
|
|
39
|
+
background: s,
|
|
40
|
+
paddings: d
|
|
41
|
+
};
|
|
42
|
+
export {
|
|
43
|
+
x as TitleControls
|
|
44
|
+
};
|
|
@@ -5,23 +5,24 @@ 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 R from "./
|
|
23
|
-
import
|
|
24
|
-
|
|
8
|
+
import { TitleControls as e } from "./controls/title/index.js";
|
|
9
|
+
import { NameControls as l } from "./controls/name/index.js";
|
|
10
|
+
import { PriceControls as s } from "./controls/price/index.js";
|
|
11
|
+
import { OldPriceControls as p } from "./controls/oldPrice/index.js";
|
|
12
|
+
import { OmnibusPriceControls as a } from "./controls/omnibusPrice/index.js";
|
|
13
|
+
import { OmnibusDiscountControls as c } from "./controls/omnibusDiscount/index.js";
|
|
14
|
+
import { ButtonControls as C } from "./controls/button/index.js";
|
|
15
|
+
import { ImageControls as f } from "./controls/image/index.js";
|
|
16
|
+
import { CustomAttributeControls as d } from "./controls/customAttribute/index.js";
|
|
17
|
+
import { SpacingControl as u } from "./controls/spacing/index.js";
|
|
18
|
+
import { BlockBackgroundColorControl as g } from "./controls/blockBackground/index.js";
|
|
19
|
+
import { CardBackgroundColorControl as y } from "./controls/cardBackground/index.js";
|
|
20
|
+
import { RecommendationCardCompositionControl as B } from "./controls/cardComposition/index.js";
|
|
21
|
+
import { SyncInfoMessageControl as P } from "./controls/syncInfoMessage.js";
|
|
22
|
+
import { RecommendationIconsRegistry as R } from "./iconsRegistry.js";
|
|
23
|
+
import S from "./recommendation.css.js";
|
|
24
|
+
import { SettingsPanel as k } from "./settingsPanel.js";
|
|
25
|
+
const w = [
|
|
25
26
|
e,
|
|
26
27
|
l,
|
|
27
28
|
s,
|
|
@@ -29,21 +30,22 @@ const k = [
|
|
|
29
30
|
a,
|
|
30
31
|
c,
|
|
31
32
|
C,
|
|
32
|
-
f
|
|
33
|
-
|
|
33
|
+
f,
|
|
34
|
+
d
|
|
35
|
+
], b = [
|
|
34
36
|
i,
|
|
35
|
-
u,
|
|
36
37
|
g,
|
|
37
|
-
d,
|
|
38
38
|
y,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
u,
|
|
40
|
+
B,
|
|
41
|
+
P
|
|
42
|
+
], v = [
|
|
43
|
+
...b,
|
|
44
|
+
...w.flatMap((o) => Object.values(o))
|
|
45
|
+
], Y = v.reduce(
|
|
44
46
|
(o, r) => o.addControl(r),
|
|
45
|
-
new t().addBlock(m).withSettingsPanelRegistry(
|
|
46
|
-
).addStyles(
|
|
47
|
+
new t().addBlock(m).withSettingsPanelRegistry(k)
|
|
48
|
+
).addStyles(S).withPreviewStyles(n).withIconsRegistry(R).build();
|
|
47
49
|
export {
|
|
48
|
-
|
|
50
|
+
Y as default
|
|
49
51
|
};
|
|
@@ -3,9 +3,10 @@ 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 L } from "./controls/main/index.js";
|
|
7
7
|
import "./store/recommendation.js";
|
|
8
8
|
import "./utils/captureStyleTemplates.js";
|
|
9
|
+
import "./controls/title/index.js";
|
|
9
10
|
import "./controls/name/index.js";
|
|
10
11
|
import "./controls/price/index.js";
|
|
11
12
|
import "./controls/oldPrice/index.js";
|
|
@@ -15,7 +16,7 @@ import "./controls/button/index.js";
|
|
|
15
16
|
import "./controls/image/index.js";
|
|
16
17
|
import { SPACING_CONTROL_ID as A } from "./controls/spacing/index.js";
|
|
17
18
|
import "./controls/blockBackground/index.js";
|
|
18
|
-
import { CARD_BACKGROUND_COLOR_CONTROL_ID as
|
|
19
|
+
import { CARD_BACKGROUND_COLOR_CONTROL_ID as U } from "./controls/cardBackground/index.js";
|
|
19
20
|
import { COMPOSITION_CONTROL_BLOCK_ID as D } from "./controls/cardComposition/index.js";
|
|
20
21
|
import { SYNC_INFO_MESSAGE_CONTROL_ID as N } from "./controls/syncInfoMessage.js";
|
|
21
22
|
class s extends E {
|
|
@@ -24,7 +25,7 @@ class s extends E {
|
|
|
24
25
|
new _(
|
|
25
26
|
I.SETTINGS,
|
|
26
27
|
[
|
|
27
|
-
|
|
28
|
+
L,
|
|
28
29
|
C.EXTERNAL_INDENTS
|
|
29
30
|
]
|
|
30
31
|
),
|
|
@@ -32,7 +33,7 @@ class s extends E {
|
|
|
32
33
|
I.STYLES,
|
|
33
34
|
[
|
|
34
35
|
T.BLOCK_BACKGROUND,
|
|
35
|
-
|
|
36
|
+
U,
|
|
36
37
|
A
|
|
37
38
|
]
|
|
38
39
|
),
|
|
@@ -42,6 +43,24 @@ class s extends E {
|
|
|
42
43
|
D
|
|
43
44
|
]
|
|
44
45
|
).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
|
+
)
|
|
45
64
|
], O[S.NAME] = [
|
|
46
65
|
new _(
|
|
47
66
|
I.SETTINGS,
|