@useinsider/guido 3.21.0-beta.9f9407d → 3.21.0-beta.a403249
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/config/compiler/htmlCompilerRules.js +1 -1
- package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +6 -1
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +132 -150
- package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +56 -53
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +248 -249
- package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +43 -58
- package/dist/package.json.js +1 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +0 -3
- package/dist/src/extensions/Blocks/Recommendation/controls/main/productLayout.d.ts +3 -2
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +2 -4
- package/dist/src/extensions/Blocks/Recommendation/utils/nodeConfigWriter.d.ts +0 -3
- package/dist/static/styles/components/tabs.css.js +5 -0
- package/package.json +2 -2
|
@@ -88,7 +88,7 @@ const d = [
|
|
|
88
88
|
/<!--\[if\s\(mso 16\)\]>\s*<style\s*\S*>\s*a\s*\{\s*text-decoration\s*:\s*none\s*;*\s*\}\s*<\/style>\s*<!\[endif\]-->/g,
|
|
89
89
|
/<!--\[if\sgte mso 9\]>\s*<style\s*\S*>\s*sup\s*\{\s*font-size\s*:\s*100%\s*!important\s*;*\s*\}\s*<\/style>\s*<!\[endif\]-->/g,
|
|
90
90
|
/<!--\[if\sgte mso 9\]>\s*<noscript>\s*<xml>\s*<o:OfficeDocumentSettings>\s*<o:AllowPNG>\s*<\/o:AllowPNG>\s*<o:PixelsPerInch>\d+<\/o:PixelsPerInch>\s*<\/o:OfficeDocumentSettings>\s*<\/xml>\s*<\/noscript>\s*<!\[endif\]-->/g,
|
|
91
|
-
/<!--\[if mso\]>\s*<xml>\s*<w:WordDocument\s+xmlns:w="urn:schemas-microsoft-com:office:word">\s*<w:DontUseAdvancedTypographyReadingMail
|
|
91
|
+
/<!--\[if mso\]>\s*<xml>\s*<w:WordDocument\s+xmlns:w="urn:schemas-microsoft-com:office:word">\s*<w:DontUseAdvancedTypographyReadingMail\s*(?:\/>|><\/w:DontUseAdvancedTypographyReadingMail>)\s*<\/w:WordDocument>\s*<\/xml>\s*<!\[endif\]-->/g,
|
|
92
92
|
/<\!--\[if \!mso\]><\!--\s*\d*\s*-->\s*<\!--\[if \!mso\]><\!--\s*\d*\s*-->\s*<\!--<!\[endif\]-->/g,
|
|
93
93
|
/<!--\[if\s\!mso\]>\s*<!-- \d -->/g
|
|
94
94
|
],
|
|
@@ -93,7 +93,12 @@ class R extends g {
|
|
|
93
93
|
return;
|
|
94
94
|
}
|
|
95
95
|
const o = t === "" ? [] : t.split(",");
|
|
96
|
-
|
|
96
|
+
n.updateConfig(
|
|
97
|
+
this.api,
|
|
98
|
+
this.currentNode,
|
|
99
|
+
{ productIds: o },
|
|
100
|
+
"Updated product IDs"
|
|
101
|
+
), this.store.patchCurrentBlockConfig({ productIds: o });
|
|
97
102
|
}
|
|
98
103
|
_listenToFormUpdates() {
|
|
99
104
|
this.api.onValueChanged(i.ALGORITHM, (t) => {
|
|
@@ -1,72 +1,72 @@
|
|
|
1
1
|
var _ = Object.defineProperty;
|
|
2
|
-
var y = (
|
|
3
|
-
var
|
|
2
|
+
var y = (h, c, e) => c in h ? _(h, c, { enumerable: !0, configurable: !0, writable: !0, value: e }) : h[c] = e;
|
|
3
|
+
var i = (h, c, e) => y(h, typeof c != "symbol" ? c + "" : c, e);
|
|
4
4
|
import { useConfig as g } from "../../../../../composables/useConfig.js";
|
|
5
5
|
import { ModificationDescription as N } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
6
6
|
import { CommonControl as P } from "../../../common-control.js";
|
|
7
7
|
import { RRS_CONFIG_VERSION as R, DEFAULT_NODE_CONFIG as a } from "../../constants/defaultConfig.js";
|
|
8
|
-
import { RECOMMENDATION_ID_ATTR as
|
|
9
|
-
import { RecommendationConfigService as
|
|
10
|
-
import { useRecommendationExtensionStore as
|
|
8
|
+
import { RECOMMENDATION_ID_ATTR as k } from "../../constants/selectors.js";
|
|
9
|
+
import { RecommendationConfigService as l } from "../../services/configService.js";
|
|
10
|
+
import { useRecommendationExtensionStore as I } from "../../store/recommendation.js";
|
|
11
11
|
import { refreshBlockOutsidePanel as S } from "../../utils/blockRefresh.js";
|
|
12
|
-
import { registerNodeConfigWriter as T, writeBlockConfigOutsidePanel as m, hasEditedConfigChange as
|
|
13
|
-
import { AlgorithmControl as
|
|
14
|
-
import { ALGORITHM_CONTROL_ID as
|
|
15
|
-
import { CurrencyControl as
|
|
16
|
-
import { CURRENCY_CONTROL_ID as
|
|
17
|
-
import { FiltersControl as
|
|
18
|
-
import { FILTERS_CONTROL_ID as
|
|
19
|
-
import { LayoutOrientationControl as
|
|
20
|
-
import { LAYOUT_ORIENTATION_CONTROL_ID as
|
|
21
|
-
import { LocaleControl as
|
|
22
|
-
import { LOCALE_CONTROL_ID as
|
|
23
|
-
import { PricePlacementControl as
|
|
24
|
-
import { PRICE_PLACEMENT_CONTROL_ID as
|
|
25
|
-
import { ProductCountControl as
|
|
26
|
-
import { PRODUCT_COUNT_CONTROL_ID as
|
|
27
|
-
import { ProductLayoutControl as
|
|
28
|
-
import { PRODUCT_LAYOUT_CONTROL_ID as
|
|
29
|
-
import { ShuffleControl as
|
|
30
|
-
import { SHUFFLE_CONTROL_ID as
|
|
31
|
-
import { StrategyControl as
|
|
32
|
-
import { STRATEGY_CONTROL_ID as
|
|
33
|
-
import { setCurrencyAttributes as
|
|
34
|
-
import { adjustProductsToSize as
|
|
12
|
+
import { registerNodeConfigWriter as T, writeBlockConfigOutsidePanel as m, hasEditedConfigChange as b } from "../../utils/nodeConfigWriter.js";
|
|
13
|
+
import { AlgorithmControl as O } from "./algorithm.js";
|
|
14
|
+
import { ALGORITHM_CONTROL_ID as me } from "./algorithm.js";
|
|
15
|
+
import { CurrencyControl as B } from "./currency.js";
|
|
16
|
+
import { CURRENCY_CONTROL_ID as pe } from "./currency.js";
|
|
17
|
+
import { FiltersControl as L } from "./filters.js";
|
|
18
|
+
import { FILTERS_CONTROL_ID as ye } from "./filters.js";
|
|
19
|
+
import { LayoutOrientationControl as E } from "./layoutOrientation.js";
|
|
20
|
+
import { LAYOUT_ORIENTATION_CONTROL_ID as Pe } from "./layoutOrientation.js";
|
|
21
|
+
import { LocaleControl as F } from "./locale.js";
|
|
22
|
+
import { LOCALE_CONTROL_ID as ke } from "./locale.js";
|
|
23
|
+
import { PricePlacementControl as D } from "./pricePlacement.js";
|
|
24
|
+
import { PRICE_PLACEMENT_CONTROL_ID as Se } from "./pricePlacement.js";
|
|
25
|
+
import { ProductCountControl as U } from "./productCount.js";
|
|
26
|
+
import { PRODUCT_COUNT_CONTROL_ID as be } from "./productCount.js";
|
|
27
|
+
import { ProductLayoutControl as v } from "./productLayout.js";
|
|
28
|
+
import { PRODUCT_LAYOUT_CONTROL_ID as Be } from "./productLayout.js";
|
|
29
|
+
import { ShuffleControl as w } from "./shuffle.js";
|
|
30
|
+
import { SHUFFLE_CONTROL_ID as Ee } from "./shuffle.js";
|
|
31
|
+
import { StrategyControl as A } from "./strategy.js";
|
|
32
|
+
import { STRATEGY_CONTROL_ID as De } from "./strategy.js";
|
|
33
|
+
import { setCurrencyAttributes as V, getBlockElement as x, isPartnerManagedBlock as W, updateProductContentInPlace as M, regenerateProductRowsWithStyles as G } from "./utils.js";
|
|
34
|
+
import { adjustProductsToSize as ve, formatProductPrice as we, getCardComposition as Ae, getCurrentLayout as Ve, getMainContainerTbody as xe, regenerateMobileProductRows as We, updatePricesInPlace as Me, updateSingleProductContent as Ge } from "./utils.js";
|
|
35
35
|
import { useDebounceFn as C } from "../../../../../node_modules/@vueuse/shared/index.js";
|
|
36
|
-
const f = "Update recommendation filters",
|
|
37
|
-
class
|
|
36
|
+
const f = "Update recommendation filters", z = "ui-elements-recommendation-block";
|
|
37
|
+
class he extends P {
|
|
38
38
|
constructor() {
|
|
39
39
|
super(...arguments);
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
i(this, "store", I());
|
|
41
|
+
i(this, "storeUnsubscription", () => {
|
|
42
42
|
});
|
|
43
43
|
// A config change waiting to reach the node config. Deferred so it can ride the
|
|
44
44
|
// re-render's single apply() — one user action must cost one undo press.
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
i(this, "pendingNodeConfigWrite", null);
|
|
46
|
+
i(this, "pendingConfigFlushTimer", null);
|
|
47
47
|
// What the panel still owes the block it watches — finished outside the panel on teardown
|
|
48
48
|
// and block switch. A new generation tells debounced work queued for the old one to stand down.
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
i(this, "trackedBlockId", null);
|
|
50
|
+
i(this, "fetchedConfigVersion", 0);
|
|
51
|
+
i(this, "hasUnrenderedProducts", !1);
|
|
52
|
+
i(this, "panelGeneration", 0);
|
|
53
|
+
i(this, "isPanelAlive", !0);
|
|
54
54
|
// Sub-control instances for lifecycle management
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
55
|
+
i(this, "algorithmControl", null);
|
|
56
|
+
i(this, "localeControl", null);
|
|
57
|
+
i(this, "currencyControl", null);
|
|
58
|
+
i(this, "productCountControl", null);
|
|
59
|
+
i(this, "productLayoutControl", null);
|
|
60
|
+
i(this, "filtersControl", null);
|
|
61
|
+
i(this, "shuffleControl", null);
|
|
62
|
+
i(this, "pricePlacementControl", null);
|
|
63
|
+
i(this, "layoutOrientationControl", null);
|
|
64
|
+
i(this, "strategyControl", null);
|
|
65
|
+
i(this, "rrsEnabled", !1);
|
|
66
66
|
/**
|
|
67
67
|
* Debounced product fetch to prevent rapid API calls during config changes
|
|
68
68
|
*/
|
|
69
|
-
|
|
69
|
+
i(this, "_debouncedFetchProducts", C(async (e, t) => {
|
|
70
70
|
if (t !== this.panelGeneration)
|
|
71
71
|
return;
|
|
72
72
|
const o = this._getBlockConfigVersion(e);
|
|
@@ -87,7 +87,7 @@ class ge extends P {
|
|
|
87
87
|
* count. The store pads products to the configured size, so in-place only
|
|
88
88
|
* fails when the size actually changed.
|
|
89
89
|
*/
|
|
90
|
-
|
|
90
|
+
i(this, "_debouncedRegenerateWithProducts", C((e) => {
|
|
91
91
|
if (e !== this.panelGeneration || !this.currentNode || !this.api)
|
|
92
92
|
return;
|
|
93
93
|
const t = this._getRecommendationIdFromNode(this.currentNode), o = this.store.currentRecommendationId;
|
|
@@ -106,7 +106,7 @@ class ge extends P {
|
|
|
106
106
|
}, 100));
|
|
107
107
|
}
|
|
108
108
|
getId() {
|
|
109
|
-
return
|
|
109
|
+
return z;
|
|
110
110
|
}
|
|
111
111
|
get _subControls() {
|
|
112
112
|
return [
|
|
@@ -127,7 +127,7 @@ class ge extends P {
|
|
|
127
127
|
return this.rrsEnabled = g().isFeatureEnabled("reusableRecommendationStrategy"), this._subControls.forEach((t) => {
|
|
128
128
|
var o;
|
|
129
129
|
return (o = t == null ? void 0 : t.onDestroy) == null ? void 0 : o.call(t);
|
|
130
|
-
}), this.algorithmControl = new
|
|
130
|
+
}), this.algorithmControl = new O(), this.localeControl = new F(), this.currencyControl = new B(), this.productCountControl = new U(), this.productLayoutControl = new v(), this.filtersControl = new L(), this.shuffleControl = new w(), this.pricePlacementControl = new D(), this.layoutOrientationControl = new E(), this.strategyControl = this.rrsEnabled ? new A() : null, this._subControls.forEach((t) => {
|
|
131
131
|
t && (t.api = this.api);
|
|
132
132
|
}), `
|
|
133
133
|
<div class="recommendation-controls-container">
|
|
@@ -149,8 +149,8 @@ class ge extends P {
|
|
|
149
149
|
const t = (s = this.getContainer()) == null ? void 0 : s.querySelector(".recommendation-controls-container");
|
|
150
150
|
if (!t)
|
|
151
151
|
return;
|
|
152
|
-
const o = this._getRecommendationIdFromNode(e) === null ? null :
|
|
153
|
-
t.classList.toggle("strategy-block", n), t.classList.toggle("legacy-strategy-block",
|
|
152
|
+
const o = this._getRecommendationIdFromNode(e) === null ? null : l.getConfig(e), n = this.rrsEnabled && !!o && (!!(o != null && o.strategyId) || ((o == null ? void 0 : o.configVersion) ?? 0) >= R), r = this.rrsEnabled && !!o && !n;
|
|
153
|
+
t.classList.toggle("strategy-block", n), t.classList.toggle("legacy-strategy-block", r);
|
|
154
154
|
}
|
|
155
155
|
async onRender() {
|
|
156
156
|
var o;
|
|
@@ -169,8 +169,8 @@ class ge extends P {
|
|
|
169
169
|
t !== null && t !== this.store.currentRecommendationId && this.store.setCurrentBlock(t), t !== null && this._syncNodeConfigIfChanged(t), this._showControlsForBlock(e), t !== null && !((o = this.store.blockStates[t]) != null && o.isInitialized) && this._fetchBlockData(t).then(() => {
|
|
170
170
|
this._initializeSubControls();
|
|
171
171
|
}), this._subControls.forEach((n) => {
|
|
172
|
-
var
|
|
173
|
-
n != null && n.api && (n.currentNode = e, (
|
|
172
|
+
var r;
|
|
173
|
+
n != null && n.api && (n.currentNode = e, (r = n.onTemplateNodeUpdated) == null || r.call(n, e));
|
|
174
174
|
});
|
|
175
175
|
}
|
|
176
176
|
onDestroy() {
|
|
@@ -214,18 +214,18 @@ class ge extends P {
|
|
|
214
214
|
* state was rebuilt with (SD-150347).
|
|
215
215
|
*/
|
|
216
216
|
_syncNodeConfigIfChanged(e) {
|
|
217
|
-
var
|
|
217
|
+
var r;
|
|
218
218
|
this.pendingNodeConfigWrite && this.pendingNodeConfigWrite.blockId !== e && this._flushPendingNodeConfig();
|
|
219
219
|
const t = this.store.blockStates[e];
|
|
220
220
|
if (!t)
|
|
221
221
|
return;
|
|
222
|
-
const o = JSON.stringify(
|
|
223
|
-
t.syncedConfigFingerprint = o, n !== o && ((
|
|
222
|
+
const o = JSON.stringify(l.getConfig(this.currentNode)), n = t.syncedConfigFingerprint;
|
|
223
|
+
t.syncedConfigFingerprint = o, n !== o && ((r = this.pendingNodeConfigWrite) == null ? void 0 : r.blockId) !== e && this._syncNodeConfigToStore();
|
|
224
224
|
}
|
|
225
225
|
/** Whether the deferred write would move the node's strategyId — see the caller (SD-149916). */
|
|
226
226
|
_isPendingStrategyIdChange() {
|
|
227
227
|
const e = this.pendingNodeConfigWrite;
|
|
228
|
-
return e ?
|
|
228
|
+
return e ? l.getConfig(this.currentNode).strategyId !== e.updates.strategyId : !1;
|
|
229
229
|
}
|
|
230
230
|
_capturePendingNodeConfigWrite() {
|
|
231
231
|
const e = this.store.currentRecommendationId, t = e === null ? void 0 : this.store.blockStates[e];
|
|
@@ -235,15 +235,14 @@ class ge extends P {
|
|
|
235
235
|
});
|
|
236
236
|
}
|
|
237
237
|
_getNodeConfigUpdates(e) {
|
|
238
|
-
const { filters: t, strategy: o, strategyId: n, size:
|
|
238
|
+
const { filters: t, strategy: o, strategyId: n, size: r, nodeConfigVersion: s } = e, { partnerName: d } = g();
|
|
239
239
|
return {
|
|
240
240
|
filters: t,
|
|
241
241
|
strategy: o,
|
|
242
242
|
strategyId: n,
|
|
243
|
-
size:
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
...c.value ? { partnerName: c.value } : {}
|
|
243
|
+
size: r,
|
|
244
|
+
configVersion: s,
|
|
245
|
+
...d.value ? { partnerName: d.value } : {}
|
|
247
246
|
};
|
|
248
247
|
}
|
|
249
248
|
/**
|
|
@@ -258,7 +257,7 @@ class ge extends P {
|
|
|
258
257
|
*/
|
|
259
258
|
_stagePendingNodeConfig(e) {
|
|
260
259
|
const t = this.pendingNodeConfigWrite;
|
|
261
|
-
return !t || !this.currentNode ? !1 : (
|
|
260
|
+
return !t || !this.currentNode ? !1 : (l.stageConfig(e, this.currentNode, t.updates), !0);
|
|
262
261
|
}
|
|
263
262
|
/**
|
|
264
263
|
* Arms the guaranteed fallback write, once the product fetch has settled. The
|
|
@@ -286,26 +285,17 @@ class ge extends P {
|
|
|
286
285
|
!m(t, o, f) && this.store.blockStates[t] && console.error("[recommendation] pending config write did not reach a node", { blockId: t });
|
|
287
286
|
return;
|
|
288
287
|
}
|
|
289
|
-
|
|
288
|
+
b(this.currentNode, e.updates) && l.updateConfig(
|
|
290
289
|
this.api,
|
|
291
290
|
this.currentNode,
|
|
292
291
|
e.updates,
|
|
293
|
-
|
|
292
|
+
f
|
|
294
293
|
);
|
|
295
294
|
}
|
|
296
295
|
}
|
|
297
|
-
_cardsPredatePendingWrite() {
|
|
298
|
-
const e = this.pendingNodeConfigWrite;
|
|
299
|
-
return e !== null && this.fetchedConfigVersion < this._getBlockConfigVersion(e.blockId);
|
|
300
|
-
}
|
|
301
|
-
/** The Product Ids label when the pending write moves the node's ids; the caller's default otherwise. */
|
|
302
|
-
_pendingDescription(e = ((t) => (t = this.pendingNodeConfigWrite) == null ? void 0 : t.updates)()) {
|
|
303
|
-
if (!(!e || !this.currentNode || !b(this.currentNode, e)))
|
|
304
|
-
return B;
|
|
305
|
-
}
|
|
306
296
|
_syncNodeConfigToStore() {
|
|
307
297
|
var n;
|
|
308
|
-
const e =
|
|
298
|
+
const e = l.getConfig(this.currentNode), t = this.store.currentRecommendationId, o = t !== null && ((n = this.store.blockStates[t]) == null ? void 0 : n.isInitialized);
|
|
309
299
|
this.store.patchCurrentBlockConfig({
|
|
310
300
|
strategy: e.strategy,
|
|
311
301
|
strategyId: e.strategyId,
|
|
@@ -348,8 +338,8 @@ class ge extends P {
|
|
|
348
338
|
if (e !== null && this.store.markBlockInitialized(e), (await Promise.allSettled([
|
|
349
339
|
this.store.fetchRecommendationCreateData(),
|
|
350
340
|
this.store.fetchRecommendationFilters()
|
|
351
|
-
])).forEach((n,
|
|
352
|
-
n.status === "rejected" && console.warn(`Recommendation block: ${["fetchRecommendationCreateData", "fetchRecommendationFilters"][
|
|
341
|
+
])).forEach((n, r) => {
|
|
342
|
+
n.status === "rejected" && console.warn(`Recommendation block: ${["fetchRecommendationCreateData", "fetchRecommendationFilters"][r]} failed`, n.reason);
|
|
353
343
|
}), e !== null && this.store.currentRecommendationId !== e) {
|
|
354
344
|
this._refreshOutsidePanel(e, !0);
|
|
355
345
|
return;
|
|
@@ -379,12 +369,12 @@ class ge extends P {
|
|
|
379
369
|
_applySmartDefaults() {
|
|
380
370
|
if (!this.currentNode || !this.api)
|
|
381
371
|
return;
|
|
382
|
-
const e =
|
|
383
|
-
let o = null, n = null,
|
|
372
|
+
const e = l.getConfig(this.currentNode), t = {};
|
|
373
|
+
let o = null, n = null, r = null;
|
|
384
374
|
if (e.currency.code === a.currency.code) {
|
|
385
375
|
const { currencyList: s } = this.store;
|
|
386
376
|
s.length > 0 && (s.some(
|
|
387
|
-
(
|
|
377
|
+
(u) => u.value === `price.${a.currency.code}`
|
|
388
378
|
) || (o = s[0].value.replace("price.", ""), t.currency = {
|
|
389
379
|
...a.currency,
|
|
390
380
|
code: o,
|
|
@@ -394,21 +384,21 @@ class ge extends P {
|
|
|
394
384
|
if (e.strategy === a.strategy) {
|
|
395
385
|
const s = this.store.getActivePredictiveAlgorithms;
|
|
396
386
|
s.length > 0 && (s.some(
|
|
397
|
-
(
|
|
387
|
+
(u) => u.value === a.strategy
|
|
398
388
|
) || (n = s[0].value, t.strategy = n));
|
|
399
389
|
}
|
|
400
390
|
if (e.language === a.language) {
|
|
401
391
|
const s = this.store.getLanguages;
|
|
402
392
|
s.length > 0 && (s.some(
|
|
403
|
-
(
|
|
404
|
-
) || (
|
|
393
|
+
(u) => u.value === a.language
|
|
394
|
+
) || (r = s[0].value, t.language = r));
|
|
405
395
|
}
|
|
406
|
-
!o && !n && !
|
|
396
|
+
!o && !n && !r || (l.updateConfig(
|
|
407
397
|
this.api,
|
|
408
398
|
this.currentNode,
|
|
409
399
|
t,
|
|
410
400
|
"Applied smart defaults"
|
|
411
|
-
), o && t.currency &&
|
|
401
|
+
), o && t.currency && V({
|
|
412
402
|
currentNode: this.currentNode,
|
|
413
403
|
documentModifier: this.api.getDocumentModifier(),
|
|
414
404
|
currency: t.currency
|
|
@@ -425,17 +415,17 @@ class ge extends P {
|
|
|
425
415
|
}
|
|
426
416
|
} : {},
|
|
427
417
|
...n ? { strategy: n } : {},
|
|
428
|
-
...
|
|
418
|
+
...r ? { language: r } : {}
|
|
429
419
|
}, { triggerRefetch: !1 }));
|
|
430
420
|
}
|
|
431
421
|
/**
|
|
432
422
|
* Reads the recommendation-id attribute from the block element within the node
|
|
433
423
|
*/
|
|
434
424
|
_getRecommendationIdFromNode(e) {
|
|
435
|
-
const t =
|
|
425
|
+
const t = x(e);
|
|
436
426
|
if (!t || !("getAttribute" in t))
|
|
437
427
|
return null;
|
|
438
|
-
const o = t.getAttribute(
|
|
428
|
+
const o = t.getAttribute(k);
|
|
439
429
|
if (!o)
|
|
440
430
|
return null;
|
|
441
431
|
const n = parseInt(o);
|
|
@@ -451,12 +441,12 @@ class ge extends P {
|
|
|
451
441
|
const n = e === null ? void 0 : this.store.blockStates[e];
|
|
452
442
|
if (e === null || !n)
|
|
453
443
|
return;
|
|
454
|
-
const
|
|
455
|
-
|
|
444
|
+
const r = t !== n.configVersion;
|
|
445
|
+
r && !m(
|
|
456
446
|
e,
|
|
457
447
|
this._getNodeConfigUpdates(n.recommendationConfigs),
|
|
458
448
|
f
|
|
459
|
-
) && console.error("[recommendation] config write outside the panel did not reach a node", { blockId: e }), (
|
|
449
|
+
) && console.error("[recommendation] config write outside the panel did not reach a node", { blockId: e }), (r || o) && this._refreshOutsidePanel(e, r);
|
|
460
450
|
} catch (n) {
|
|
461
451
|
console.error("[recommendation] finishing the block outside the panel failed", n);
|
|
462
452
|
}
|
|
@@ -487,27 +477,19 @@ class ge extends P {
|
|
|
487
477
|
_regenerateWithProducts() {
|
|
488
478
|
if (!this.currentNode || !this.api)
|
|
489
479
|
return;
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
}
|
|
494
|
-
const e = this.store.recommendationProducts, t = this.api.getDocumentModifier(), o = this._pendingDescription(), n = this._stagePendingNodeConfig(t);
|
|
495
|
-
if (G(this.currentNode)) {
|
|
496
|
-
n && (t.apply(
|
|
497
|
-
new N(o ?? "Update recommendation configuration")
|
|
498
|
-
), this.pendingNodeConfigWrite = null, this._clearConfigFlush());
|
|
480
|
+
const e = this.store.recommendationProducts, t = this.api.getDocumentModifier(), o = this._stagePendingNodeConfig(t);
|
|
481
|
+
if (W(this.currentNode)) {
|
|
482
|
+
o && (t.apply(new N("Update recommendation configuration")), this.pendingNodeConfigWrite = null, this._clearConfigFlush());
|
|
499
483
|
return;
|
|
500
484
|
}
|
|
501
|
-
|
|
485
|
+
M({
|
|
502
486
|
currentNode: this.currentNode,
|
|
503
487
|
documentModifier: t,
|
|
504
|
-
products: e
|
|
505
|
-
|
|
506
|
-
}) || $({
|
|
488
|
+
products: e
|
|
489
|
+
}) || G({
|
|
507
490
|
currentNode: this.currentNode,
|
|
508
491
|
documentModifier: t,
|
|
509
|
-
products: e
|
|
510
|
-
description: o
|
|
492
|
+
products: e
|
|
511
493
|
});
|
|
512
494
|
}
|
|
513
495
|
/**
|
|
@@ -533,47 +515,47 @@ class ge extends P {
|
|
|
533
515
|
this.panelGeneration++, this.trackedBlockId = n, t = e.recommendationProducts, o = this._getBlockConfigVersion(n), this.fetchedConfigVersion = o, this.hasUnrenderedProducts = !1, this._finishBlockOutsidePanel(p);
|
|
534
516
|
return;
|
|
535
517
|
}
|
|
536
|
-
const
|
|
537
|
-
|
|
538
|
-
const s = e.recommendationProducts,
|
|
539
|
-
|
|
518
|
+
const r = this._getBlockConfigVersion(n);
|
|
519
|
+
r !== o && (o = r, this._capturePendingNodeConfigWrite(), this._isPendingStrategyIdChange() && this._flushPendingNodeConfig(), this._debouncedFetchProducts(n, this.panelGeneration));
|
|
520
|
+
const s = e.recommendationProducts, d = s !== t, u = Array.isArray(s) && s.length > 0;
|
|
521
|
+
d && u && (t = s, this.hasUnrenderedProducts = !0, this._debouncedRegenerateWithProducts(this.panelGeneration));
|
|
540
522
|
});
|
|
541
523
|
}
|
|
542
524
|
}
|
|
543
525
|
export {
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
526
|
+
me as ALGORITHM_CONTROL_ID,
|
|
527
|
+
O as AlgorithmControl,
|
|
528
|
+
z as CONTROL_BLOCK_ID,
|
|
529
|
+
pe as CURRENCY_CONTROL_ID,
|
|
530
|
+
B as CurrencyControl,
|
|
531
|
+
ye as FILTERS_CONTROL_ID,
|
|
532
|
+
L as FiltersControl,
|
|
533
|
+
Pe as LAYOUT_ORIENTATION_CONTROL_ID,
|
|
534
|
+
ke as LOCALE_CONTROL_ID,
|
|
535
|
+
E as LayoutOrientationControl,
|
|
536
|
+
F as LocaleControl,
|
|
537
|
+
Se as PRICE_PLACEMENT_CONTROL_ID,
|
|
538
|
+
be as PRODUCT_COUNT_CONTROL_ID,
|
|
539
|
+
Be as PRODUCT_LAYOUT_CONTROL_ID,
|
|
540
|
+
D as PricePlacementControl,
|
|
541
|
+
U as ProductCountControl,
|
|
542
|
+
v as ProductLayoutControl,
|
|
543
|
+
he as RecommendationBlockControl,
|
|
544
|
+
Ee as SHUFFLE_CONTROL_ID,
|
|
545
|
+
De as STRATEGY_CONTROL_ID,
|
|
546
|
+
w as ShuffleControl,
|
|
547
|
+
A as StrategyControl,
|
|
548
|
+
ve as adjustProductsToSize,
|
|
549
|
+
we as formatProductPrice,
|
|
550
|
+
x as getBlockElement,
|
|
551
|
+
Ae as getCardComposition,
|
|
552
|
+
Ve as getCurrentLayout,
|
|
553
|
+
xe as getMainContainerTbody,
|
|
554
|
+
W as isPartnerManagedBlock,
|
|
555
|
+
We as regenerateMobileProductRows,
|
|
556
|
+
G as regenerateProductRowsWithStyles,
|
|
557
|
+
V as setCurrencyAttributes,
|
|
558
|
+
Me as updatePricesInPlace,
|
|
559
|
+
M as updateProductContentInPlace,
|
|
560
|
+
Ge as updateSingleProductContent
|
|
579
561
|
};
|