@useinsider/guido 3.18.1-beta.8d3bf29 → 3.18.1
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/@types/config/schemas.js +1 -3
- package/dist/components/Guido.vue.js +4 -4
- package/dist/components/Guido.vue2.js +53 -55
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +7 -7
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +57 -82
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +24 -28
- package/dist/composables/useCustomInterfaceAppearance.js +42 -46
- package/dist/enums/extensions/recommendationBlock.js +1 -2
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +69 -70
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +28 -67
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +56 -98
- package/dist/guido.css +1 -1
- package/dist/services/recommendationApi.js +52 -61
- package/dist/src/@types/config/schemas.d.ts +0 -4
- package/dist/src/composables/useConfig.d.ts +0 -2
- package/dist/src/enums/extensions/recommendationBlock.d.ts +0 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +0 -2
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +1 -54
- package/dist/src/services/recommendationApi.d.ts +1 -2
- package/dist/src/stores/config.d.ts +0 -160
- package/dist/src/stores/onboarding.d.ts +10 -808
- package/dist/static/styles/components/recommendation-strategy.css.js +5 -70
- package/dist/stores/config.js +59 -66
- package/dist/stores/onboarding.js +36 -46
- package/package.json +1 -1
- package/dist/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js +0 -18
- package/dist/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue2.js +0 -25
- package/dist/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue.js +0 -21
- package/dist/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue2.js +0 -46
- package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.js +0 -21
- package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue2.js +0 -46
- package/dist/composables/useLegacyStrategyConversion.js +0 -54
- package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.js +0 -58
- package/dist/src/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.d.ts +0 -2
- package/dist/src/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue.d.ts +0 -2
- package/dist/src/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.d.ts +0 -2
- package/dist/src/composables/useLegacyStrategyConversion.d.ts +0 -3
- package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.d.ts +0 -39
- package/dist/static/assets/icons/filled-arrow-rising.svg.js +0 -5
- package/dist/static/assets/icons/line-info.svg.js +0 -5
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
import { getRecommendationFeedSourceMaps as b, getOperatorOptions as
|
|
2
|
-
import { useRecommendationApi as
|
|
3
|
-
import { useConfigStore as
|
|
4
|
-
import { defineStore as
|
|
1
|
+
import { getRecommendationFeedSourceMaps as b, getOperatorOptions as G, PriceAttributes as v } from "../../../../enums/extensions/recommendationBlock.js";
|
|
2
|
+
import { useRecommendationApi as D } 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
|
|
7
|
-
import { DEFAULT_NODE_CONFIG as N,
|
|
8
|
-
import { getDefaultProducts as
|
|
9
|
-
import { generateCompleteFilterQuery as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
let f = null, g = null, h = null, S = null;
|
|
6
|
+
import { DEFAULT_MOBILE_CARDS_IN_ROW as _, DEFAULT_CARDS_IN_ROW as U } from "../constants/layout.js";
|
|
7
|
+
import { DEFAULT_NODE_CONFIG as N, EXCLUDED_ALGORITHM_IDS as L } from "../constants/defaultConfig.js";
|
|
8
|
+
import { getDefaultProducts as R } from "../templates/utils.js";
|
|
9
|
+
import { generateCompleteFilterQuery as k } from "../utils/filterUtil.js";
|
|
10
|
+
import { getPartnerRecommendationParams as x } from "../utils/partnerCustomizations.js";
|
|
11
|
+
import { sanitizeProductIds as A } from "../utils/productIds.js";
|
|
12
|
+
import { isFilterValid as B } from "../validation/filterSchema.js";
|
|
13
|
+
import { isConfigValid as M } from "../validation/requiredFields.js";
|
|
14
|
+
const u = D();
|
|
15
|
+
let f = null, h = null, g = null, S = null;
|
|
17
16
|
const p = /* @__PURE__ */ new Map();
|
|
18
|
-
function
|
|
17
|
+
function w() {
|
|
19
18
|
return {
|
|
20
|
-
cardsInRow:
|
|
19
|
+
cardsInRow: U,
|
|
21
20
|
currencySettings: {
|
|
22
21
|
name: "USD",
|
|
23
22
|
value: "USD",
|
|
@@ -31,7 +30,7 @@ function G() {
|
|
|
31
30
|
productIds: [],
|
|
32
31
|
id: 1,
|
|
33
32
|
language: "en_US",
|
|
34
|
-
mobileCardsInRow:
|
|
33
|
+
mobileCardsInRow: _,
|
|
35
34
|
mobileLayoutEnabled: !1,
|
|
36
35
|
orientation: "grid",
|
|
37
36
|
recommendedProducts: [],
|
|
@@ -39,7 +38,6 @@ function G() {
|
|
|
39
38
|
shuffleProducts: !1,
|
|
40
39
|
strategy: "mostPopular",
|
|
41
40
|
strategyId: "",
|
|
42
|
-
nodeConfigVersion: w,
|
|
43
41
|
textTrimming: !0,
|
|
44
42
|
unresponsive: !1,
|
|
45
43
|
size: "6",
|
|
@@ -48,22 +46,20 @@ function G() {
|
|
|
48
46
|
priceHideIfSameAsDiscounted: !1
|
|
49
47
|
};
|
|
50
48
|
}
|
|
51
|
-
function
|
|
49
|
+
function C() {
|
|
52
50
|
return {
|
|
53
|
-
recommendationConfigs:
|
|
51
|
+
recommendationConfigs: w(),
|
|
54
52
|
recommendationProducts: [],
|
|
55
53
|
filterStatus: !1,
|
|
56
54
|
filterSelectionDrawerStatus: !1,
|
|
57
55
|
assignStrategyDrawerStatus: !1,
|
|
58
56
|
removeStrategyModalStatus: !1,
|
|
59
|
-
legacyStrategyUpdatedModalStatus: !1,
|
|
60
57
|
filterGroup: 1,
|
|
61
58
|
isInitialized: !1,
|
|
62
|
-
filterSnapshot: null
|
|
63
|
-
legacyConversionLoading: !1
|
|
59
|
+
filterSnapshot: null
|
|
64
60
|
};
|
|
65
61
|
}
|
|
66
|
-
const
|
|
62
|
+
const z = () => ({
|
|
67
63
|
recommendationCampaignUrls: {},
|
|
68
64
|
activePredictiveAlgorithms: [],
|
|
69
65
|
languages: {},
|
|
@@ -75,8 +71,8 @@ const E = () => ({
|
|
|
75
71
|
blockStates: {},
|
|
76
72
|
currentRecommendationId: null,
|
|
77
73
|
configVersion: 0
|
|
78
|
-
}),
|
|
79
|
-
state: () =>
|
|
74
|
+
}), Y = F("guidoRecommendationExtension", {
|
|
75
|
+
state: () => z(),
|
|
80
76
|
getters: {
|
|
81
77
|
// ====================================================================
|
|
82
78
|
// Proxy Getters — Backward Compatible Access to Current Block State
|
|
@@ -86,7 +82,7 @@ const E = () => ({
|
|
|
86
82
|
* This allows all existing code that reads `store.recommendationConfigs` to work unchanged.
|
|
87
83
|
*/
|
|
88
84
|
recommendationConfigs(t) {
|
|
89
|
-
return t.currentRecommendationId !== null && t.blockStates[t.currentRecommendationId] ? t.blockStates[t.currentRecommendationId].recommendationConfigs :
|
|
85
|
+
return t.currentRecommendationId !== null && t.blockStates[t.currentRecommendationId] ? t.blockStates[t.currentRecommendationId].recommendationConfigs : w();
|
|
90
86
|
},
|
|
91
87
|
/**
|
|
92
88
|
* Proxy getter: delegates to blockStates[currentRecommendationId].recommendationProducts
|
|
@@ -106,15 +102,6 @@ const E = () => ({
|
|
|
106
102
|
removeStrategyModalStatus(t) {
|
|
107
103
|
return t.currentRecommendationId !== null && t.blockStates[t.currentRecommendationId] ? t.blockStates[t.currentRecommendationId].removeStrategyModalStatus : !1;
|
|
108
104
|
},
|
|
109
|
-
isLegacyStrategyBlock() {
|
|
110
|
-
return R().isFeatureEnabled("reusableRecommendationStrategy") && x(this.recommendationConfigs);
|
|
111
|
-
},
|
|
112
|
-
legacyConversionLoading(t) {
|
|
113
|
-
return t.currentRecommendationId !== null && t.blockStates[t.currentRecommendationId] ? t.blockStates[t.currentRecommendationId].legacyConversionLoading : !1;
|
|
114
|
-
},
|
|
115
|
-
legacyStrategyUpdatedModalStatus(t) {
|
|
116
|
-
return t.currentRecommendationId !== null && t.blockStates[t.currentRecommendationId] ? t.blockStates[t.currentRecommendationId].legacyStrategyUpdatedModalStatus : !1;
|
|
117
|
-
},
|
|
118
105
|
assignedStrategy(t) {
|
|
119
106
|
const { strategyId: e } = this.recommendationConfigs;
|
|
120
107
|
return e ? t.strategies.find((r) => String(r.strategy_id) === e) ?? null : null;
|
|
@@ -151,7 +138,7 @@ const E = () => ({
|
|
|
151
138
|
},
|
|
152
139
|
getActivePredictiveAlgorithms: (t) => {
|
|
153
140
|
const e = b(), r = [];
|
|
154
|
-
return t.activePredictiveAlgorithms.filter((n) => !
|
|
141
|
+
return t.activePredictiveAlgorithms.filter((n) => !L.includes(n)).forEach((n) => {
|
|
155
142
|
r.push(...e.filter((s) => s.id === n));
|
|
156
143
|
}), r.map((n) => ({
|
|
157
144
|
text: n.name,
|
|
@@ -169,7 +156,7 @@ const E = () => ({
|
|
|
169
156
|
getFilterList() {
|
|
170
157
|
return Object.values(this.filterList).filter((t) => t.isFilterable !== 0 && t.isFilterable !== !1).map((t) => {
|
|
171
158
|
let e;
|
|
172
|
-
return t.type === "productAttribute" ? e = `product_attributes.${t.attributeName}` :
|
|
159
|
+
return t.type === "productAttribute" ? e = `product_attributes.${t.attributeName}` : v.includes(t.attributeName) ? e = `${t.attributeName}.${this.recommendationConfigs.currencySettings.value}` : e = t.attributeName, {
|
|
173
160
|
text: t.displayName,
|
|
174
161
|
value: e,
|
|
175
162
|
type: t.attributeType
|
|
@@ -191,7 +178,7 @@ const E = () => ({
|
|
|
191
178
|
setCurrentBlock(t) {
|
|
192
179
|
this.blockStates[t] || (this.blockStates = {
|
|
193
180
|
...this.blockStates,
|
|
194
|
-
[t]:
|
|
181
|
+
[t]: C()
|
|
195
182
|
}), this.currentRecommendationId = t;
|
|
196
183
|
},
|
|
197
184
|
/**
|
|
@@ -259,7 +246,7 @@ const E = () => ({
|
|
|
259
246
|
decimalCount: String(e.currencyDecimalCount),
|
|
260
247
|
decimalSeparator: r(e.currencyDecimalSeparator, ","),
|
|
261
248
|
thousandSeparator: r(e.currencyThousandSeparator, ".")
|
|
262
|
-
}, s = !this.blockStates[t], i = s ?
|
|
249
|
+
}, s = !this.blockStates[t], i = s ? C() : this.blockStates[t];
|
|
263
250
|
i.recommendationConfigs = {
|
|
264
251
|
...i.recommendationConfigs,
|
|
265
252
|
strategy: e.strategy,
|
|
@@ -298,7 +285,7 @@ const E = () => ({
|
|
|
298
285
|
* Creates a filter with the first available attribute and operator pre-selected.
|
|
299
286
|
*/
|
|
300
287
|
createDefaultFilter(t, e) {
|
|
301
|
-
const [r] = this.getFilterList, [n] =
|
|
288
|
+
const [r] = this.getFilterList, [n] = G(r == null ? void 0 : r.type);
|
|
302
289
|
return {
|
|
303
290
|
type: "standardFilter",
|
|
304
291
|
attribute: (r == null ? void 0 : r.value) ?? "",
|
|
@@ -351,12 +338,6 @@ const E = () => ({
|
|
|
351
338
|
closeAssignStrategyDrawer() {
|
|
352
339
|
this.currentRecommendationId === null || !this.blockStates[this.currentRecommendationId] || (this.blockStates[this.currentRecommendationId].assignStrategyDrawerStatus = !1);
|
|
353
340
|
},
|
|
354
|
-
openLegacyStrategyUpdatedModal() {
|
|
355
|
-
this.currentRecommendationId === null || !this.blockStates[this.currentRecommendationId] || (this.blockStates[this.currentRecommendationId].legacyStrategyUpdatedModalStatus = !0);
|
|
356
|
-
},
|
|
357
|
-
closeLegacyStrategyUpdatedModal() {
|
|
358
|
-
this.currentRecommendationId === null || !this.blockStates[this.currentRecommendationId] || (this.blockStates[this.currentRecommendationId].legacyStrategyUpdatedModalStatus = !1);
|
|
359
|
-
},
|
|
360
341
|
openRemoveStrategyModal() {
|
|
361
342
|
this.currentRecommendationId === null || !this.blockStates[this.currentRecommendationId] || (this.blockStates[this.currentRecommendationId].removeStrategyModalStatus = !0);
|
|
362
343
|
},
|
|
@@ -371,7 +352,7 @@ const E = () => ({
|
|
|
371
352
|
S = (async () => {
|
|
372
353
|
this.strategiesLoading = !0;
|
|
373
354
|
try {
|
|
374
|
-
this.strategies = await
|
|
355
|
+
this.strategies = await u.fetchRecommendationStrategies();
|
|
375
356
|
} finally {
|
|
376
357
|
this.strategiesLoading = !1;
|
|
377
358
|
}
|
|
@@ -386,7 +367,7 @@ const E = () => ({
|
|
|
386
367
|
const r = typeof t.updated_at == "string" ? t.updated_at : "", n = r ? `${t.strategy_id}:${r}:${e}` : "", s = n ? this.strategyUrlTemplates[n] : void 0;
|
|
387
368
|
if (s)
|
|
388
369
|
return s;
|
|
389
|
-
const { full_path: i = "" } = await
|
|
370
|
+
const { full_path: i = "" } = await u.generateStrategyEndpoint(t, e) ?? {};
|
|
390
371
|
return n && i && (this.strategyUrlTemplates = {
|
|
391
372
|
...this.strategyUrlTemplates,
|
|
392
373
|
[n]: i
|
|
@@ -398,29 +379,6 @@ const E = () => ({
|
|
|
398
379
|
...t.size !== void 0 ? { size: String(t.size) } : {}
|
|
399
380
|
});
|
|
400
381
|
},
|
|
401
|
-
async convertLegacyStrategy(t) {
|
|
402
|
-
const e = this.currentRecommendationId;
|
|
403
|
-
if (e === null || !this.blockStates[e])
|
|
404
|
-
throw new Error("[Guido] convertLegacyStrategy called without an active block");
|
|
405
|
-
this.blockStates[e].legacyConversionLoading = !0;
|
|
406
|
-
try {
|
|
407
|
-
const r = await m.migrateLegacyStrategy(t);
|
|
408
|
-
try {
|
|
409
|
-
await this.fetchStrategies();
|
|
410
|
-
} catch (i) {
|
|
411
|
-
console.error("[Guido] strategy listing refresh after conversion failed", i);
|
|
412
|
-
}
|
|
413
|
-
const n = this.strategies.find((i) => String(i.strategy_id) === r), s = this.blockStates[e];
|
|
414
|
-
return s.recommendationConfigs = {
|
|
415
|
-
...s.recommendationConfigs,
|
|
416
|
-
strategyId: r,
|
|
417
|
-
nodeConfigVersion: w,
|
|
418
|
-
...(n == null ? void 0 : n.size) !== void 0 ? { size: String(n.size) } : {}
|
|
419
|
-
}, this.currentRecommendationId === e && this.configVersion++, r;
|
|
420
|
-
} finally {
|
|
421
|
-
this.blockStates[e].legacyConversionLoading = !1;
|
|
422
|
-
}
|
|
423
|
-
},
|
|
424
382
|
removeStrategy() {
|
|
425
383
|
this.patchCurrentBlockConfig({ strategyId: "", size: N.size });
|
|
426
384
|
},
|
|
@@ -438,7 +396,7 @@ const E = () => ({
|
|
|
438
396
|
activePredictiveAlgorithms: t,
|
|
439
397
|
languages: e,
|
|
440
398
|
currencies: r
|
|
441
|
-
} = await
|
|
399
|
+
} = await u.fetchRecommendationCreateData();
|
|
442
400
|
if (this.activePredictiveAlgorithms = t, this.languages = e, this.currentRecommendationId !== null && this.blockStates[this.currentRecommendationId]) {
|
|
443
401
|
const n = this.blockStates[this.currentRecommendationId];
|
|
444
402
|
n.filterStatus = !!n.recommendationConfigs.filters.length;
|
|
@@ -454,18 +412,18 @@ const E = () => ({
|
|
|
454
412
|
},
|
|
455
413
|
async fetchRecommendationFilters() {
|
|
456
414
|
if (!Object.keys(this.filterList).length) {
|
|
457
|
-
if (
|
|
458
|
-
await
|
|
415
|
+
if (h) {
|
|
416
|
+
await h;
|
|
459
417
|
return;
|
|
460
418
|
}
|
|
461
|
-
|
|
462
|
-
const t = await
|
|
419
|
+
h = (async () => {
|
|
420
|
+
const t = await u.fetchRecommendationFilters();
|
|
463
421
|
this.filterList = t;
|
|
464
422
|
})();
|
|
465
423
|
try {
|
|
466
|
-
await
|
|
424
|
+
await h;
|
|
467
425
|
} finally {
|
|
468
|
-
|
|
426
|
+
h = null;
|
|
469
427
|
}
|
|
470
428
|
}
|
|
471
429
|
},
|
|
@@ -494,7 +452,7 @@ const E = () => ({
|
|
|
494
452
|
const n = [...e.recommendationConfigs.filters];
|
|
495
453
|
n[r] = {
|
|
496
454
|
...t,
|
|
497
|
-
isValid:
|
|
455
|
+
isValid: B(t)
|
|
498
456
|
}, e.recommendationConfigs.filters = n;
|
|
499
457
|
}
|
|
500
458
|
},
|
|
@@ -532,7 +490,7 @@ const E = () => ({
|
|
|
532
490
|
}), e.recommendationConfigs.filters = r;
|
|
533
491
|
},
|
|
534
492
|
generateFilterQuery() {
|
|
535
|
-
return
|
|
493
|
+
return k(this.recommendationConfigs.filters);
|
|
536
494
|
},
|
|
537
495
|
/**
|
|
538
496
|
* Validation-only check invoked at save-CTA time. Defined as an action
|
|
@@ -540,33 +498,33 @@ const E = () => ({
|
|
|
540
498
|
* every block's recommendationConfigs across user edits.
|
|
541
499
|
*/
|
|
542
500
|
hasInvalidBlock() {
|
|
543
|
-
return Object.values(this.blockStates).some((t) => !
|
|
501
|
+
return Object.values(this.blockStates).some((t) => !M(t.recommendationConfigs, this));
|
|
544
502
|
},
|
|
545
503
|
// ====================================================================
|
|
546
504
|
// Per-Block Product Fetching
|
|
547
505
|
// ====================================================================
|
|
548
506
|
async fetchRecommendationProducts() {
|
|
549
507
|
if (!(this.currentRecommendationId === null || !this.blockStates[this.currentRecommendationId])) {
|
|
550
|
-
if (
|
|
551
|
-
await
|
|
508
|
+
if (g) {
|
|
509
|
+
await g;
|
|
552
510
|
return;
|
|
553
511
|
}
|
|
554
|
-
|
|
512
|
+
g = this._doFetchProducts();
|
|
555
513
|
try {
|
|
556
|
-
await
|
|
514
|
+
await g;
|
|
557
515
|
} finally {
|
|
558
|
-
|
|
516
|
+
g = null;
|
|
559
517
|
}
|
|
560
518
|
}
|
|
561
519
|
},
|
|
562
520
|
async _doFetchProducts() {
|
|
563
521
|
var d;
|
|
564
|
-
const t = this.currentRecommendationId, e = this.blockStates[t], { recommendationConfigs: r } = e, n =
|
|
522
|
+
const t = this.currentRecommendationId, e = this.blockStates[t], { recommendationConfigs: r } = e, n = P();
|
|
565
523
|
if (r.strategyId && n.isFeatureEnabled("reusableRecommendationStrategy")) {
|
|
566
524
|
await this._doFetchStrategyProducts(t);
|
|
567
525
|
return;
|
|
568
526
|
}
|
|
569
|
-
const s = r.filters.filter((
|
|
527
|
+
const s = r.filters.filter((m) => m.isValid), i = k(s), o = ((d = b().find((m) => m.key === r.strategy)) == null ? void 0 : d.path) || "", c = parseInt(r.size) || 6, a = {
|
|
570
528
|
locale: r.language,
|
|
571
529
|
currency: r.currencySettings.value,
|
|
572
530
|
partnerName: n.partnerName,
|
|
@@ -574,13 +532,13 @@ const E = () => ({
|
|
|
574
532
|
details: !0,
|
|
575
533
|
campaignId: n.variationId
|
|
576
534
|
};
|
|
577
|
-
r.strategy === "manualMerchandising" ? a.productId =
|
|
535
|
+
r.strategy === "manualMerchandising" ? a.productId = A(r.productIds) : r.strategy === "similarViewed" && (a.productId = "{itemId}"), r.strategy === "userBased" && (a.userId = "{user_id}"), i && (a.filter = i), r.shuffleProducts && (a.shuffle = !0), Object.assign(
|
|
578
536
|
a,
|
|
579
|
-
|
|
537
|
+
x(n.partnerName, r.strategy)
|
|
580
538
|
);
|
|
581
539
|
let l;
|
|
582
540
|
try {
|
|
583
|
-
l = await
|
|
541
|
+
l = await u.fetchRecommendationProducts(o, a);
|
|
584
542
|
} catch {
|
|
585
543
|
l = [];
|
|
586
544
|
}
|
|
@@ -598,8 +556,8 @@ const E = () => ({
|
|
|
598
556
|
);
|
|
599
557
|
if (i) {
|
|
600
558
|
s = parseInt(String(i.size ?? "")) || s;
|
|
601
|
-
const o = r.currencySettings.value, a = (await this.resolveStrategyUrlTemplate(i, o)).replaceAll("{locale}", r.language).replaceAll("{currency}", o), l = a.indexOf("?"), d = l === -1 ? a : a.slice(0, l),
|
|
602
|
-
y && (n = await
|
|
559
|
+
const o = r.currencySettings.value, a = (await this.resolveStrategyUrlTemplate(i, o)).replaceAll("{locale}", r.language).replaceAll("{currency}", o), l = a.indexOf("?"), d = l === -1 ? a : a.slice(0, l), m = (l === -1 ? "" : a.slice(l + 1)).split("&").filter((I) => I && !I.startsWith("user_id=")), y = m.length ? `${d}?${m.join("&")}` : d;
|
|
560
|
+
y && (n = await u.fetchRecommendationProductsByUrl(y));
|
|
603
561
|
}
|
|
604
562
|
} catch {
|
|
605
563
|
n = [];
|
|
@@ -609,14 +567,14 @@ const E = () => ({
|
|
|
609
567
|
_setBlockProducts(t, e, r) {
|
|
610
568
|
if (!this.blockStates[t])
|
|
611
569
|
return;
|
|
612
|
-
const n = e.length > 0 ? e :
|
|
570
|
+
const n = e.length > 0 ? e : R(r);
|
|
613
571
|
this.blockStates[t].recommendationProducts = [
|
|
614
572
|
...n.slice(0, r),
|
|
615
|
-
...
|
|
573
|
+
...R(Math.max(0, r - n.length))
|
|
616
574
|
];
|
|
617
575
|
}
|
|
618
576
|
}
|
|
619
577
|
});
|
|
620
578
|
export {
|
|
621
|
-
|
|
579
|
+
Y as useRecommendationExtensionStore
|
|
622
580
|
};
|
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-73199fa4] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.view-options-wrapper[data-v-87033101]{position:relative;display:inline-block}.new-tag[data-v-87033101]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-87033101] .guido__view-option-selection-desktop svg,[data-v-87033101] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-87033101] .in-segments-wrapper__button_selected,[data-v-87033101] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-87033101] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-fad98586]{gap:8px}.version-history__toolbar[data-v-fad98586]{gap:4px}.view-options-wrapper[data-v-6ebabfe4]{position:relative;display:inline-block}.new-tag[data-v-6ebabfe4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-6ebabfe4] .guido__verion-history-view-option-selection-desktop svg,[data-v-6ebabfe4] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6ebabfe4] .in-segments-wrapper__button_selected,[data-v-6ebabfe4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-6ebabfe4] .in-tooltip-wrapper-v2__icon{cursor:pointer}.auto-save-toggle[data-v-2c964af4]{position:relative}.auto-save-toggle__info-box[data-v-2c964af4]{position:absolute;top:100%;left:0;z-index:10;width:280px}.editor-actions[data-v-1ca6baf0]{gap:4px}.header-wrapper[data-v-d11dd577]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-
|
|
1
|
+
@charset "UTF-8";.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-73199fa4] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.view-options-wrapper[data-v-87033101]{position:relative;display:inline-block}.new-tag[data-v-87033101]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-87033101] .guido__view-option-selection-desktop svg,[data-v-87033101] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-87033101] .in-segments-wrapper__button_selected,[data-v-87033101] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-87033101] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-fad98586]{gap:8px}.version-history__toolbar[data-v-fad98586]{gap:4px}.view-options-wrapper[data-v-6ebabfe4]{position:relative;display:inline-block}.new-tag[data-v-6ebabfe4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-6ebabfe4] .guido__verion-history-view-option-selection-desktop svg,[data-v-6ebabfe4] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6ebabfe4] .in-segments-wrapper__button_selected,[data-v-6ebabfe4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-6ebabfe4] .in-tooltip-wrapper-v2__icon{cursor:pointer}.auto-save-toggle[data-v-2c964af4]{position:relative}.auto-save-toggle__info-box[data-v-2c964af4]{position:absolute;top:100%;left:0;z-index:10;width:280px}.editor-actions[data-v-1ca6baf0]{gap:4px}.header-wrapper[data-v-d11dd577]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-050dfa52]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-050dfa52]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-050dfa52]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-91a26acd]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-91a26acd]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-91a26acd]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-91a26acd]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-91a26acd]{object-fit:cover;transform:scale(1)}[data-v-b9a93c6e] .guido__verion-history-view-option-selection-desktop svg,[data-v-b9a93c6e] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-b9a93c6e] .in-segments-wrapper__button_selected,[data-v-b9a93c6e] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-c3fd5d4b]{gap:16px}.desktop-browser-header[data-v-d86c5af5]{height:79px;min-height:79px}.desktop-browser-header__left[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:378px}.desktop-browser-header__center[data-v-d86c5af5]{height:79px;background-repeat:repeat-x;background-size:auto 100%;background-position:left top}.desktop-browser-header__right[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:112px}.desktop-preview[data-v-cf946232]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-cf946232]{min-height:504px}.iframe-wrapper[data-v-f255b2bb]{width:258px}.iframe-scaled[data-v-f255b2bb]{width:320px;height:124.0310077519%;transform:scale(.80625);transform-origin:top left}.cropped-text[data-v-eb3d05d7]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mobile-preview-wrapper__phone[data-v-3f472f96]{width:282px}.mobile-preview-wrapper__phone img[data-v-3f472f96]{object-fit:cover;border-radius:44px}.mobile-preview-wrapper__content[data-v-3f472f96]{width:258px;height:450px;left:12px}[data-v-6bcaca8a] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-f16f20f8] .vueperslides__bullets{pointer-events:none!important}[data-v-f16f20f8] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-bb3cca55] .vueperslides__bullets{pointer-events:none!important}[data-v-bb3cca55] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-b09e80c4] .vueperslides__bullets{pointer-events:none!important}[data-v-b09e80c4] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-9bdef600] .vueperslides__parallax-wrapper{padding-bottom:110px!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-2580a7d9]{width:100%;max-width:none}.assign-strategy-drawer-content .assign-strategy-select[data-v-2580a7d9] .in-dropdown-box__container{width:413px}.assign-strategy-drawer .spaced-dot-sep{background-image:linear-gradient(90deg,#91949f 20%,#fff0 0);background-position:center bottom;background-repeat:repeat-x;background-size:5px 1px}.assign-strategy-drawer .spaced-dot-sep--top{background-position:center top}.assign-strategy-drawer .spaced-dot-sep--fc-n:first-child{background:none}
|
|
@@ -1,97 +1,88 @@
|
|
|
1
|
-
import { useHttp as
|
|
2
|
-
import { URLS as
|
|
3
|
-
const
|
|
4
|
-
(
|
|
5
|
-
attributeName:
|
|
6
|
-
attributeJs:
|
|
7
|
-
attributeType:
|
|
8
|
-
type:
|
|
9
|
-
displayName:
|
|
10
|
-
isFilterable:
|
|
11
|
-
},
|
|
1
|
+
import { useHttp as l } from "../composables/useHttp.js";
|
|
2
|
+
import { URLS as m, QUERY_PARAMS as u } from "../enums/extensions/recommendationBlock.js";
|
|
3
|
+
const y = "[sr_strategies.status][=][active]*[sr_strategies.suitable_channels][~][EMAIL]", R = (c) => c.reduce(
|
|
4
|
+
(s, r, i) => (s[i] = {
|
|
5
|
+
attributeName: r.attributeName,
|
|
6
|
+
attributeJs: r.attributeJs,
|
|
7
|
+
attributeType: r.attributeType,
|
|
8
|
+
type: r.type,
|
|
9
|
+
displayName: r.displayName,
|
|
10
|
+
isFilterable: r.isFilterable
|
|
11
|
+
}, s),
|
|
12
12
|
{}
|
|
13
13
|
), _ = () => {
|
|
14
|
-
const { get:
|
|
14
|
+
const { get: c, post: s } = l(), { get: r } = l({ headers: {} }), i = "6KcLM9TwheVB1mgK";
|
|
15
15
|
return {
|
|
16
16
|
fetchRecommendationCreateData: async () => {
|
|
17
17
|
try {
|
|
18
|
-
return (await
|
|
19
|
-
} catch (
|
|
20
|
-
throw console.error("fetchUserModalState error:",
|
|
18
|
+
return (await c("/newsletter/recommendations/create-data")).data;
|
|
19
|
+
} catch (e) {
|
|
20
|
+
throw console.error("fetchUserModalState error:", e), e;
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
23
|
fetchRecommendationFilters: async () => {
|
|
24
24
|
try {
|
|
25
|
-
const { data:
|
|
26
|
-
|
|
27
|
-
),
|
|
28
|
-
return
|
|
29
|
-
} catch (
|
|
30
|
-
throw console.error("fetchRecommendationFilters error:",
|
|
25
|
+
const { data: e } = await c(
|
|
26
|
+
m.PRODUCT_ATTRIBUTES_PATH
|
|
27
|
+
), o = Array.isArray(e) ? e : (e == null ? void 0 : e.data) ?? [];
|
|
28
|
+
return R(o);
|
|
29
|
+
} catch (e) {
|
|
30
|
+
throw console.error("fetchRecommendationFilters error:", e), e;
|
|
31
31
|
}
|
|
32
32
|
},
|
|
33
|
-
fetchRecommendationProducts: async (
|
|
34
|
-
var
|
|
33
|
+
fetchRecommendationProducts: async (e, o) => {
|
|
34
|
+
var t;
|
|
35
35
|
try {
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
const
|
|
39
|
-
console.debug("🏁 Recommendation API Query:",
|
|
40
|
-
const
|
|
41
|
-
`${
|
|
36
|
+
const n = new URLSearchParams(Object.entries(o));
|
|
37
|
+
n.set(u.CLIENT_ID, i);
|
|
38
|
+
const d = decodeURIComponent(n.toString());
|
|
39
|
+
console.debug("🏁 Recommendation API Query:", d);
|
|
40
|
+
const a = await r(
|
|
41
|
+
`${m.RECOMMENDATION_API_URL}/v2/${e}?${d}`
|
|
42
42
|
);
|
|
43
|
-
return ((
|
|
44
|
-
} catch (
|
|
45
|
-
throw console.error("fetchRecommendationProducts error:",
|
|
43
|
+
return ((t = a == null ? void 0 : a.data) == null ? void 0 : t.data) ?? [];
|
|
44
|
+
} catch (n) {
|
|
45
|
+
throw console.error("fetchRecommendationProducts error:", n), n;
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
|
-
fetchRecommendationProductsByUrl: async (
|
|
49
|
-
var
|
|
48
|
+
fetchRecommendationProductsByUrl: async (e) => {
|
|
49
|
+
var o;
|
|
50
50
|
try {
|
|
51
|
-
const
|
|
52
|
-
|
|
51
|
+
const t = new RegExp(`[?&]${u.CLIENT_ID}=`).test(e), n = e.includes("?") ? "&" : "?", d = t ? e : `${e}${n}${u.CLIENT_ID}=${i}`, a = await r(
|
|
52
|
+
d
|
|
53
53
|
);
|
|
54
|
-
return ((
|
|
55
|
-
} catch (
|
|
56
|
-
return console.error("fetchRecommendationProductsByUrl error:",
|
|
54
|
+
return ((o = a == null ? void 0 : a.data) == null ? void 0 : o.data) ?? [];
|
|
55
|
+
} catch (t) {
|
|
56
|
+
return console.error("fetchRecommendationProductsByUrl error:", t), [];
|
|
57
57
|
}
|
|
58
58
|
},
|
|
59
59
|
fetchRecommendationStrategies: async () => {
|
|
60
60
|
try {
|
|
61
|
-
const { data:
|
|
62
|
-
`${
|
|
61
|
+
const { data: e } = await c(
|
|
62
|
+
`${m.RECOMMENDATION_STRATEGIES_PATH}?filters=${encodeURIComponent(y)}`
|
|
63
63
|
);
|
|
64
|
-
return Array.isArray(
|
|
65
|
-
} catch (
|
|
66
|
-
throw console.error("fetchRecommendationStrategies error:",
|
|
64
|
+
return Array.isArray(e) ? e : (e == null ? void 0 : e.data) ?? [];
|
|
65
|
+
} catch (e) {
|
|
66
|
+
throw console.error("fetchRecommendationStrategies error:", e), e;
|
|
67
67
|
}
|
|
68
68
|
},
|
|
69
|
-
generateStrategyEndpoint: async (
|
|
69
|
+
generateStrategyEndpoint: async (e, o) => {
|
|
70
70
|
try {
|
|
71
|
-
const { data:
|
|
72
|
-
`${
|
|
71
|
+
const { data: t } = await s(
|
|
72
|
+
`${m.RECOMMENDATION_STRATEGIES_PATH}/endpoint-generate`,
|
|
73
73
|
{
|
|
74
74
|
campaignId: 0,
|
|
75
75
|
pageTypes: [],
|
|
76
76
|
isPreviewer: !1,
|
|
77
|
-
strategy:
|
|
77
|
+
strategy: e,
|
|
78
78
|
userId: "",
|
|
79
|
-
currency:
|
|
79
|
+
currency: o
|
|
80
80
|
}
|
|
81
81
|
);
|
|
82
|
-
return !
|
|
83
|
-
} catch (
|
|
84
|
-
return console.error("generateStrategyEndpoint error:",
|
|
82
|
+
return !t || typeof t != "object" || !("full_path" in t || "data" in t) ? (console.error("generateStrategyEndpoint unexpected response shape:", t), null) : "full_path" in t ? t : t.data;
|
|
83
|
+
} catch (t) {
|
|
84
|
+
return console.error("generateStrategyEndpoint error:", t), null;
|
|
85
85
|
}
|
|
86
|
-
},
|
|
87
|
-
migrateLegacyStrategy: async (t) => {
|
|
88
|
-
const { data: r } = await i(
|
|
89
|
-
`${c.NEWSLETTER_RECOMMENDATIONS_PATH}/migrate-strategies`,
|
|
90
|
-
t
|
|
91
|
-
), e = r && typeof r == "object" && "data" in r ? r.data : r, a = e == null ? void 0 : e.strategyId;
|
|
92
|
-
if (a == null || a === "")
|
|
93
|
-
throw new Error("[Guido] migrate-strategies returned no strategyId");
|
|
94
|
-
return String(a);
|
|
95
86
|
}
|
|
96
87
|
};
|
|
97
88
|
};
|
|
@@ -50,8 +50,6 @@ export declare const IdentitySchema: v.ObjectSchema<{
|
|
|
50
50
|
readonly userId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "userId is required">]>;
|
|
51
51
|
/** Optional variation ID for A/B testing */
|
|
52
52
|
readonly variationId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
53
|
-
/** Optional numeric campaign ID of the host campaign; absent for templates and modules */
|
|
54
|
-
readonly campaignId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
55
53
|
}, undefined>;
|
|
56
54
|
/**
|
|
57
55
|
* Partner configuration - organization and product context
|
|
@@ -627,8 +625,6 @@ export declare const GuidoConfigSchema: v.ObjectSchema<{
|
|
|
627
625
|
readonly userId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "userId is required">]>;
|
|
628
626
|
/** Optional variation ID for A/B testing */
|
|
629
627
|
readonly variationId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
630
|
-
/** Optional numeric campaign ID of the host campaign; absent for templates and modules */
|
|
631
|
-
readonly campaignId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
632
628
|
}, undefined>;
|
|
633
629
|
/** Partner configuration (required) */
|
|
634
630
|
readonly partner: v.ObjectSchema<{
|
|
@@ -11,7 +11,6 @@ export declare const useConfig: () => {
|
|
|
11
11
|
templateId: string;
|
|
12
12
|
userId: string;
|
|
13
13
|
variationId?: string | undefined;
|
|
14
|
-
campaignId?: string | undefined;
|
|
15
14
|
};
|
|
16
15
|
partner: {
|
|
17
16
|
name: string;
|
|
@@ -147,7 +146,6 @@ export declare const useConfig: () => {
|
|
|
147
146
|
templateId: string;
|
|
148
147
|
userId: string;
|
|
149
148
|
variationId?: string | undefined;
|
|
150
|
-
campaignId?: string | undefined;
|
|
151
149
|
} | null>;
|
|
152
150
|
partner: import("vue").ComputedRef<{
|
|
153
151
|
name: string;
|
|
@@ -2,8 +2,6 @@ import { CommonControl } from '../../../common-control';
|
|
|
2
2
|
export declare const STRATEGY_CONTROL_ID = "recommendation-strategy-control";
|
|
3
3
|
export declare class StrategyControl extends CommonControl {
|
|
4
4
|
private store;
|
|
5
|
-
private onboardingStore;
|
|
6
|
-
private legacyConversion;
|
|
7
5
|
private storeUnsubscription;
|
|
8
6
|
private listeners;
|
|
9
7
|
private lastPaintedState;
|