@useinsider/guido 3.18.1-beta.fefef3c → 3.18.2-beta.3e1d9ab
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 +3 -21
- package/dist/@types/config/schemas.js +51 -59
- 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/extensions/recommendation/RemoveStrategyModal.vue2.js +22 -24
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +24 -28
- package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue2.js +34 -34
- package/dist/composables/useCustomInterfaceAppearance.js +42 -46
- package/dist/composables/useHttp.js +24 -22
- package/dist/enums/extensions/recommendationBlock.js +14 -17
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +85 -80
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +28 -72
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +44 -45
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +48 -93
- package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +7 -7
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +29 -28
- package/dist/package.json.js +1 -1
- package/dist/services/recommendationApi.js +84 -93
- package/dist/services/templateLibraryApi.js +17 -14
- package/dist/src/@types/config/schemas.d.ts +0 -16
- package/dist/src/composables/useConfig.d.ts +0 -4
- package/dist/src/enums/extensions/recommendationBlock.d.ts +0 -3
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +5 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +0 -2
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +0 -4
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +13 -54
- package/dist/src/services/recommendationApi.d.ts +1 -2
- package/dist/src/stores/config.d.ts +0 -322
- package/dist/src/stores/onboarding.d.ts +10 -808
- package/dist/src/utils/genericUtil.d.ts +6 -0
- package/dist/src/utils/liquidDynamicContent.d.ts +20 -0
- package/dist/static/styles/components/recommendation-strategy.css.js +5 -70
- package/dist/stores/config.js +60 -74
- package/dist/stores/onboarding.js +36 -46
- package/dist/utils/genericUtil.js +63 -54
- package/dist/utils/liquidDynamicContent.js +15 -0
- package/dist/utils/templatePreparation.js +54 -52
- package/package.json +3 -3
- 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 -61
- package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.js +0 -72
- 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 -44
- package/dist/static/assets/icons/filled-arrow-rising.svg.js +0 -5
- package/dist/static/assets/icons/line-info.svg.js +0 -5
|
@@ -94,9 +94,9 @@ function j(e, t = {}) {
|
|
|
94
94
|
const u = s ?? P(n), l = y.getConfig(n);
|
|
95
95
|
if (u === "list" || !l.mobileLayoutEnabled)
|
|
96
96
|
return te({ currentNode: n, documentModifier: o });
|
|
97
|
-
const c = A(),
|
|
97
|
+
const c = A(), a = $(r, c.recommendationProducts), f = i ?? U(n, c.filterList), p = `<td><table class="ins-recommendation-product-container ins-recommendation-mobile-container" width="100%" cellpadding="0" cellspacing="0" border="0">${k(a, u, {
|
|
98
98
|
productsPerRow: l.mobileCardsInRow,
|
|
99
|
-
composition:
|
|
99
|
+
composition: f,
|
|
100
100
|
filterList: c.filterList,
|
|
101
101
|
priceInline: !l.priceMovedToNextLine,
|
|
102
102
|
// Match the initial render's gutter so a regeneration never changes block height (SD-143023, #386).
|
|
@@ -122,9 +122,9 @@ function ie(e, t = {}) {
|
|
|
122
122
|
const u = n.querySelector(L) ?? n.querySelector(W);
|
|
123
123
|
if (!u)
|
|
124
124
|
return !1;
|
|
125
|
-
const l = A(), c = $(r, l.recommendationProducts), { cardsInRow:
|
|
126
|
-
productsPerRow:
|
|
127
|
-
composition:
|
|
125
|
+
const l = A(), c = $(r, l.recommendationProducts), { cardsInRow: a } = y.getConfig(n), f = i ?? U(n, l.filterList), d = s ?? P(n), p = y.getConfig(n), E = k(c, d, {
|
|
126
|
+
productsPerRow: a,
|
|
127
|
+
composition: f,
|
|
128
128
|
filterList: l.filterList,
|
|
129
129
|
priceInline: !p.priceMovedToNextLine,
|
|
130
130
|
// Match the initial render's gutter so a regeneration never changes block height (SD-143023, #386).
|
|
@@ -153,10 +153,10 @@ function ce(e, t, n) {
|
|
|
153
153
|
return !1;
|
|
154
154
|
const s = A(), i = r.split(",").filter(Boolean), u = D(i, o, s.filterList), l = [], c = u.join(",") !== i.join(",");
|
|
155
155
|
c && l.push([R, u.join(",")]);
|
|
156
|
-
const
|
|
156
|
+
const a = le(
|
|
157
157
|
o.getAttribute(q)
|
|
158
|
-
),
|
|
159
|
-
if (
|
|
158
|
+
), f = a && z(a, o, s.filterList);
|
|
159
|
+
if (a && f && f.join(",") !== a.join(",") && l.push([q, JSON.stringify(f)]), l.length === 0)
|
|
160
160
|
return !1;
|
|
161
161
|
if (l.forEach(([d, p]) => {
|
|
162
162
|
t.modifyHtml(o).setAttribute(d, p);
|
|
@@ -177,20 +177,19 @@ function Te(e) {
|
|
|
177
177
|
products: r,
|
|
178
178
|
layout: s,
|
|
179
179
|
composition: i,
|
|
180
|
-
skipStylePreservation: u
|
|
181
|
-
forceApply: l = !1
|
|
180
|
+
skipStylePreservation: u
|
|
182
181
|
} = e;
|
|
183
182
|
if (!t)
|
|
184
183
|
return;
|
|
185
|
-
const
|
|
184
|
+
const l = u ? {} : x(t), c = {
|
|
186
185
|
currentNode: t,
|
|
187
186
|
documentModifier: n,
|
|
188
187
|
products: r,
|
|
189
188
|
layout: s,
|
|
190
189
|
composition: i
|
|
191
190
|
};
|
|
192
|
-
let a = ie(
|
|
193
|
-
a = j(
|
|
191
|
+
let a = ie(c, l);
|
|
192
|
+
a = j(c, l) || a, a && (ce(t, n, i), n.apply(new S("Regenerate products with styles"))), o == null || o();
|
|
194
193
|
}
|
|
195
194
|
function Re(e, t) {
|
|
196
195
|
return e.length === t ? e : e.length > t ? e.slice(0, t) : [...e, ...H(t - e.length)];
|
|
@@ -251,16 +250,16 @@ function se(e) {
|
|
|
251
250
|
omnibusDiscountEl: l,
|
|
252
251
|
buttonEl: c
|
|
253
252
|
} = e;
|
|
254
|
-
let
|
|
253
|
+
let a = !1;
|
|
255
254
|
if (o && "querySelector" in o) {
|
|
256
|
-
const
|
|
257
|
-
|
|
255
|
+
const f = o.querySelector("img");
|
|
256
|
+
f && (t.modifyHtml(f).setAttribute("src", X(n.image_url)).setAttribute("alt", n.name), a = !0);
|
|
258
257
|
const d = o.querySelector("a");
|
|
259
|
-
d && (t.modifyHtml(d).setAttribute("href", n.url),
|
|
258
|
+
d && (t.modifyHtml(d).setAttribute("href", n.url), a = !0);
|
|
260
259
|
}
|
|
261
260
|
if (r && "querySelector" in r) {
|
|
262
|
-
const
|
|
263
|
-
b(t,
|
|
261
|
+
const f = r.querySelector("strong") ?? r.querySelector("p");
|
|
262
|
+
b(t, f ?? null, n.name) && (a = !0);
|
|
264
263
|
}
|
|
265
264
|
if (K({
|
|
266
265
|
documentModifier: t,
|
|
@@ -269,11 +268,11 @@ function se(e) {
|
|
|
269
268
|
oldPriceEl: i,
|
|
270
269
|
omnibusPriceEl: u,
|
|
271
270
|
omnibusDiscountEl: l
|
|
272
|
-
}) && (
|
|
273
|
-
const
|
|
274
|
-
|
|
271
|
+
}) && (a = !0), c && "querySelector" in c) {
|
|
272
|
+
const f = c.querySelector("a.es-button") || c.querySelector("a");
|
|
273
|
+
f && (t.modifyHtml(f).setAttribute("href", n.url), a = !0);
|
|
275
274
|
}
|
|
276
|
-
return
|
|
275
|
+
return a;
|
|
277
276
|
}
|
|
278
277
|
function V(e) {
|
|
279
278
|
return "querySelector" in e ? e.querySelector(L) ?? e : e;
|
|
@@ -309,14 +308,14 @@ function fe(e, t, n) {
|
|
|
309
308
|
let s = !1;
|
|
310
309
|
return r.forEach((i, u) => {
|
|
311
310
|
const l = Math.min(i.length, n.length);
|
|
312
|
-
i.slice(0, l).forEach((c,
|
|
311
|
+
i.slice(0, l).forEach((c, a) => {
|
|
313
312
|
if (!("querySelector" in c))
|
|
314
313
|
return;
|
|
315
|
-
const
|
|
316
|
-
if (
|
|
314
|
+
const f = ae(u, n[a]);
|
|
315
|
+
if (f === null)
|
|
317
316
|
return;
|
|
318
317
|
const d = c.querySelector("p") ?? null;
|
|
319
|
-
b(t, d,
|
|
318
|
+
b(t, d, f) && (s = !0);
|
|
320
319
|
});
|
|
321
320
|
}), s;
|
|
322
321
|
}
|
|
@@ -337,9 +336,9 @@ function O(e, t, n) {
|
|
|
337
336
|
`[esd-extension-block-id="${m.OMNIBUS_DISCOUNT}"]`
|
|
338
337
|
), c = e.querySelectorAll(
|
|
339
338
|
`[esd-extension-block-id="${m.BUTTON}"]`
|
|
340
|
-
),
|
|
341
|
-
let
|
|
342
|
-
for (let d = 0; d <
|
|
339
|
+
), a = Math.min(o.length, n.length);
|
|
340
|
+
let f = !1;
|
|
341
|
+
for (let d = 0; d < a; d++) {
|
|
343
342
|
const p = se({
|
|
344
343
|
documentModifier: t,
|
|
345
344
|
product: n[d],
|
|
@@ -351,33 +350,33 @@ function O(e, t, n) {
|
|
|
351
350
|
omnibusDiscountEl: l[d] ?? null,
|
|
352
351
|
buttonEl: c[d] ?? null
|
|
353
352
|
});
|
|
354
|
-
|
|
353
|
+
f = f || p;
|
|
355
354
|
}
|
|
356
|
-
return fe(e, t, n) && (
|
|
355
|
+
return fe(e, t, n) && (f = !0), f;
|
|
357
356
|
}
|
|
358
357
|
function qe(e) {
|
|
359
|
-
const { currentNode: t, documentModifier: n, products: o
|
|
358
|
+
const { currentNode: t, documentModifier: n, products: o } = e;
|
|
360
359
|
if (!t || !("querySelectorAll" in t))
|
|
361
360
|
return !1;
|
|
362
|
-
const
|
|
363
|
-
if (!("querySelectorAll" in
|
|
361
|
+
const r = V(t);
|
|
362
|
+
if (!("querySelectorAll" in r) || r.querySelectorAll(
|
|
364
363
|
`[esd-extension-block-id="${m.IMAGE}"]`
|
|
365
364
|
).length !== o.length)
|
|
366
365
|
return !1;
|
|
367
|
-
let
|
|
368
|
-
const
|
|
369
|
-
if (
|
|
370
|
-
const
|
|
371
|
-
if (
|
|
366
|
+
let i = O(r, n, o);
|
|
367
|
+
const u = P(t), l = y.getConfig(t);
|
|
368
|
+
if (u !== "list" && l.mobileLayoutEnabled && "querySelector" in t) {
|
|
369
|
+
const c = t.querySelector(N);
|
|
370
|
+
if (c) {
|
|
372
371
|
const a = O(
|
|
373
|
-
|
|
372
|
+
c,
|
|
374
373
|
n,
|
|
375
374
|
o
|
|
376
375
|
);
|
|
377
|
-
|
|
376
|
+
i = i || a;
|
|
378
377
|
}
|
|
379
378
|
}
|
|
380
|
-
return
|
|
379
|
+
return i && n.apply(new S("Updated product content in-place")), !0;
|
|
381
380
|
}
|
|
382
381
|
function _(e, t, n) {
|
|
383
382
|
if (!("querySelectorAll" in e))
|
|
@@ -418,8 +417,8 @@ function Me(e) {
|
|
|
418
417
|
if (u !== "list" && l.mobileLayoutEnabled && "querySelector" in t) {
|
|
419
418
|
const c = t.querySelector(N);
|
|
420
419
|
if (c) {
|
|
421
|
-
const
|
|
422
|
-
i = i ||
|
|
420
|
+
const a = _(c, n, r);
|
|
421
|
+
i = i || a;
|
|
423
422
|
}
|
|
424
423
|
}
|
|
425
424
|
return i && n.apply(new S("Updated price formatting in-place")), i;
|
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
import { getRecommendationFeedSourceMaps 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 F } from "../../../../stores/config.js";
|
|
4
|
+
import { defineStore as P } from "pinia";
|
|
5
5
|
import "../constants/selectors.js";
|
|
6
|
-
import { DEFAULT_MOBILE_CARDS_IN_ROW as
|
|
7
|
-
import {
|
|
8
|
-
import { getDefaultProducts as
|
|
9
|
-
import { generateCompleteFilterQuery as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
const m = P();
|
|
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();
|
|
16
15
|
let f = null, g = null, h = 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: y,
|
|
43
41
|
textTrimming: !0,
|
|
44
42
|
unresponsive: !1,
|
|
45
43
|
size: "6",
|
|
@@ -48,22 +46,21 @@ 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
59
|
filterSnapshot: null,
|
|
63
|
-
|
|
60
|
+
syncedConfigFingerprint: null
|
|
64
61
|
};
|
|
65
62
|
}
|
|
66
|
-
const
|
|
63
|
+
const z = () => ({
|
|
67
64
|
recommendationCampaignUrls: {},
|
|
68
65
|
activePredictiveAlgorithms: [],
|
|
69
66
|
languages: {},
|
|
@@ -75,8 +72,8 @@ const E = () => ({
|
|
|
75
72
|
blockStates: {},
|
|
76
73
|
currentRecommendationId: null,
|
|
77
74
|
configVersion: 0
|
|
78
|
-
}),
|
|
79
|
-
state: () =>
|
|
75
|
+
}), Y = P("guidoRecommendationExtension", {
|
|
76
|
+
state: () => z(),
|
|
80
77
|
getters: {
|
|
81
78
|
// ====================================================================
|
|
82
79
|
// Proxy Getters — Backward Compatible Access to Current Block State
|
|
@@ -86,7 +83,7 @@ const E = () => ({
|
|
|
86
83
|
* This allows all existing code that reads `store.recommendationConfigs` to work unchanged.
|
|
87
84
|
*/
|
|
88
85
|
recommendationConfigs(t) {
|
|
89
|
-
return t.currentRecommendationId !== null && t.blockStates[t.currentRecommendationId] ? t.blockStates[t.currentRecommendationId].recommendationConfigs :
|
|
86
|
+
return t.currentRecommendationId !== null && t.blockStates[t.currentRecommendationId] ? t.blockStates[t.currentRecommendationId].recommendationConfigs : w();
|
|
90
87
|
},
|
|
91
88
|
/**
|
|
92
89
|
* Proxy getter: delegates to blockStates[currentRecommendationId].recommendationProducts
|
|
@@ -106,15 +103,6 @@ const E = () => ({
|
|
|
106
103
|
removeStrategyModalStatus(t) {
|
|
107
104
|
return t.currentRecommendationId !== null && t.blockStates[t.currentRecommendationId] ? t.blockStates[t.currentRecommendationId].removeStrategyModalStatus : !1;
|
|
108
105
|
},
|
|
109
|
-
isLegacyStrategyBlock() {
|
|
110
|
-
return k().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
106
|
assignedStrategy(t) {
|
|
119
107
|
const { strategyId: e } = this.recommendationConfigs;
|
|
120
108
|
return e ? t.strategies.find((r) => String(r.strategy_id) === e) ?? null : null;
|
|
@@ -150,8 +138,8 @@ const E = () => ({
|
|
|
150
138
|
return [...new Set(t.map((e) => e.filterGroup))].sort((e, r) => e - r);
|
|
151
139
|
},
|
|
152
140
|
getActivePredictiveAlgorithms: (t) => {
|
|
153
|
-
const e =
|
|
154
|
-
return t.activePredictiveAlgorithms.filter((n) => !
|
|
141
|
+
const e = b(), r = [];
|
|
142
|
+
return t.activePredictiveAlgorithms.filter((n) => !L.includes(n)).forEach((n) => {
|
|
155
143
|
r.push(...e.filter((s) => s.id === n));
|
|
156
144
|
}), r.map((n) => ({
|
|
157
145
|
text: n.name,
|
|
@@ -169,7 +157,7 @@ const E = () => ({
|
|
|
169
157
|
getFilterList() {
|
|
170
158
|
return Object.values(this.filterList).filter((t) => t.isFilterable !== 0 && t.isFilterable !== !1).map((t) => {
|
|
171
159
|
let e;
|
|
172
|
-
return t.type === "productAttribute" ? e = `product_attributes.${t.attributeName}` :
|
|
160
|
+
return t.type === "productAttribute" ? e = `product_attributes.${t.attributeName}` : v.includes(t.attributeName) ? e = `${t.attributeName}.${this.recommendationConfigs.currencySettings.value}` : e = t.attributeName, {
|
|
173
161
|
text: t.displayName,
|
|
174
162
|
value: e,
|
|
175
163
|
type: t.attributeType
|
|
@@ -191,7 +179,7 @@ const E = () => ({
|
|
|
191
179
|
setCurrentBlock(t) {
|
|
192
180
|
this.blockStates[t] || (this.blockStates = {
|
|
193
181
|
...this.blockStates,
|
|
194
|
-
[t]:
|
|
182
|
+
[t]: C()
|
|
195
183
|
}), this.currentRecommendationId = t;
|
|
196
184
|
},
|
|
197
185
|
/**
|
|
@@ -254,12 +242,12 @@ const E = () => ({
|
|
|
254
242
|
const r = (o, c) => o === "." || o === "," || o === " " ? o : c, n = {
|
|
255
243
|
name: e.currencyCode,
|
|
256
244
|
value: e.currencyCode,
|
|
257
|
-
symbol: e.
|
|
245
|
+
symbol: e.currencySymbol,
|
|
258
246
|
alignment: e.currencyAlignment === "before" ? "0" : "1",
|
|
259
247
|
decimalCount: String(e.currencyDecimalCount),
|
|
260
248
|
decimalSeparator: r(e.currencyDecimalSeparator, ","),
|
|
261
249
|
thousandSeparator: r(e.currencyThousandSeparator, ".")
|
|
262
|
-
}, s = !this.blockStates[t], i = s ?
|
|
250
|
+
}, s = !this.blockStates[t], i = s ? C() : this.blockStates[t];
|
|
263
251
|
i.recommendationConfigs = {
|
|
264
252
|
...i.recommendationConfigs,
|
|
265
253
|
strategy: e.strategy,
|
|
@@ -298,7 +286,7 @@ const E = () => ({
|
|
|
298
286
|
* Creates a filter with the first available attribute and operator pre-selected.
|
|
299
287
|
*/
|
|
300
288
|
createDefaultFilter(t, e) {
|
|
301
|
-
const [r] = this.getFilterList, [n] =
|
|
289
|
+
const [r] = this.getFilterList, [n] = G(r == null ? void 0 : r.type);
|
|
302
290
|
return {
|
|
303
291
|
type: "standardFilter",
|
|
304
292
|
attribute: (r == null ? void 0 : r.value) ?? "",
|
|
@@ -351,12 +339,6 @@ const E = () => ({
|
|
|
351
339
|
closeAssignStrategyDrawer() {
|
|
352
340
|
this.currentRecommendationId === null || !this.blockStates[this.currentRecommendationId] || (this.blockStates[this.currentRecommendationId].assignStrategyDrawerStatus = !1);
|
|
353
341
|
},
|
|
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
342
|
openRemoveStrategyModal() {
|
|
361
343
|
this.currentRecommendationId === null || !this.blockStates[this.currentRecommendationId] || (this.blockStates[this.currentRecommendationId].removeStrategyModalStatus = !0);
|
|
362
344
|
},
|
|
@@ -371,7 +353,7 @@ const E = () => ({
|
|
|
371
353
|
S = (async () => {
|
|
372
354
|
this.strategiesLoading = !0;
|
|
373
355
|
try {
|
|
374
|
-
this.strategies = await
|
|
356
|
+
this.strategies = await u.fetchRecommendationStrategies();
|
|
375
357
|
} finally {
|
|
376
358
|
this.strategiesLoading = !1;
|
|
377
359
|
}
|
|
@@ -386,7 +368,7 @@ const E = () => ({
|
|
|
386
368
|
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
369
|
if (s)
|
|
388
370
|
return s;
|
|
389
|
-
const { full_path: i = "" } = await
|
|
371
|
+
const { full_path: i = "" } = await u.generateStrategyEndpoint(t, e) ?? {};
|
|
390
372
|
return n && i && (this.strategyUrlTemplates = {
|
|
391
373
|
...this.strategyUrlTemplates,
|
|
392
374
|
[n]: i
|
|
@@ -398,35 +380,8 @@ const E = () => ({
|
|
|
398
380
|
...t.size !== void 0 ? { size: String(t.size) } : {}
|
|
399
381
|
});
|
|
400
382
|
},
|
|
401
|
-
async convertLegacyStrategy(t, e = { scope: "campaign" }) {
|
|
402
|
-
const r = this.currentRecommendationId;
|
|
403
|
-
if (r === null || !this.blockStates[r])
|
|
404
|
-
throw new Error("[Guido] convertLegacyStrategy called without an active block");
|
|
405
|
-
this.blockStates[r].legacyConversionLoading = !0;
|
|
406
|
-
try {
|
|
407
|
-
const n = await m.migrateLegacyStrategy(t, e);
|
|
408
|
-
try {
|
|
409
|
-
await this.fetchStrategies();
|
|
410
|
-
} catch (o) {
|
|
411
|
-
console.error("[Guido] strategy listing refresh after conversion failed", o);
|
|
412
|
-
}
|
|
413
|
-
const s = this.strategies.find((o) => String(o.strategy_id) === n), i = this.blockStates[r];
|
|
414
|
-
return i && (i.recommendationConfigs = {
|
|
415
|
-
...i.recommendationConfigs,
|
|
416
|
-
strategyId: n,
|
|
417
|
-
nodeConfigVersion: y,
|
|
418
|
-
...(s == null ? void 0 : s.size) !== void 0 ? { size: String(s.size) } : {}
|
|
419
|
-
}), this.currentRecommendationId === r && this.configVersion++, n;
|
|
420
|
-
} finally {
|
|
421
|
-
this.blockStates[r] && (this.blockStates[r].legacyConversionLoading = !1);
|
|
422
|
-
}
|
|
423
|
-
},
|
|
424
383
|
removeStrategy() {
|
|
425
|
-
this.patchCurrentBlockConfig({
|
|
426
|
-
strategyId: "",
|
|
427
|
-
size: N.size,
|
|
428
|
-
nodeConfigVersion: y
|
|
429
|
-
});
|
|
384
|
+
this.patchCurrentBlockConfig({ strategyId: "", size: N.size });
|
|
430
385
|
},
|
|
431
386
|
// ====================================================================
|
|
432
387
|
// Shared Data Fetching (fetched once, used by all blocks)
|
|
@@ -442,7 +397,7 @@ const E = () => ({
|
|
|
442
397
|
activePredictiveAlgorithms: t,
|
|
443
398
|
languages: e,
|
|
444
399
|
currencies: r
|
|
445
|
-
} = await
|
|
400
|
+
} = await u.fetchRecommendationCreateData();
|
|
446
401
|
if (this.activePredictiveAlgorithms = t, this.languages = e, this.currentRecommendationId !== null && this.blockStates[this.currentRecommendationId]) {
|
|
447
402
|
const n = this.blockStates[this.currentRecommendationId];
|
|
448
403
|
n.filterStatus = !!n.recommendationConfigs.filters.length;
|
|
@@ -463,7 +418,7 @@ const E = () => ({
|
|
|
463
418
|
return;
|
|
464
419
|
}
|
|
465
420
|
g = (async () => {
|
|
466
|
-
const t = await
|
|
421
|
+
const t = await u.fetchRecommendationFilters();
|
|
467
422
|
this.filterList = t;
|
|
468
423
|
})();
|
|
469
424
|
try {
|
|
@@ -498,7 +453,7 @@ const E = () => ({
|
|
|
498
453
|
const n = [...e.recommendationConfigs.filters];
|
|
499
454
|
n[r] = {
|
|
500
455
|
...t,
|
|
501
|
-
isValid:
|
|
456
|
+
isValid: B(t)
|
|
502
457
|
}, e.recommendationConfigs.filters = n;
|
|
503
458
|
}
|
|
504
459
|
},
|
|
@@ -536,7 +491,7 @@ const E = () => ({
|
|
|
536
491
|
}), e.recommendationConfigs.filters = r;
|
|
537
492
|
},
|
|
538
493
|
generateFilterQuery() {
|
|
539
|
-
return
|
|
494
|
+
return k(this.recommendationConfigs.filters);
|
|
540
495
|
},
|
|
541
496
|
/**
|
|
542
497
|
* Validation-only check invoked at save-CTA time. Defined as an action
|
|
@@ -544,7 +499,7 @@ const E = () => ({
|
|
|
544
499
|
* every block's recommendationConfigs across user edits.
|
|
545
500
|
*/
|
|
546
501
|
hasInvalidBlock() {
|
|
547
|
-
return Object.values(this.blockStates).some((t) => !
|
|
502
|
+
return Object.values(this.blockStates).some((t) => !M(t.recommendationConfigs, this));
|
|
548
503
|
},
|
|
549
504
|
// ====================================================================
|
|
550
505
|
// Per-Block Product Fetching
|
|
@@ -565,12 +520,12 @@ const E = () => ({
|
|
|
565
520
|
},
|
|
566
521
|
async _doFetchProducts() {
|
|
567
522
|
var d;
|
|
568
|
-
const t = this.currentRecommendationId, e = this.blockStates[t], { recommendationConfigs: r } = e, n =
|
|
523
|
+
const t = this.currentRecommendationId, e = this.blockStates[t], { recommendationConfigs: r } = e, n = F();
|
|
569
524
|
if (r.strategyId && n.isFeatureEnabled("reusableRecommendationStrategy")) {
|
|
570
525
|
await this._doFetchStrategyProducts(t);
|
|
571
526
|
return;
|
|
572
527
|
}
|
|
573
|
-
const s = r.filters.filter((
|
|
528
|
+
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 = {
|
|
574
529
|
locale: r.language,
|
|
575
530
|
currency: r.currencySettings.value,
|
|
576
531
|
partnerName: n.partnerName,
|
|
@@ -578,13 +533,13 @@ const E = () => ({
|
|
|
578
533
|
details: !0,
|
|
579
534
|
campaignId: n.variationId
|
|
580
535
|
};
|
|
581
|
-
r.strategy === "manualMerchandising" ? a.productId =
|
|
536
|
+
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(
|
|
582
537
|
a,
|
|
583
|
-
|
|
538
|
+
x(n.partnerName, r.strategy)
|
|
584
539
|
);
|
|
585
540
|
let l;
|
|
586
541
|
try {
|
|
587
|
-
l = await
|
|
542
|
+
l = await u.fetchRecommendationProducts(o, a);
|
|
588
543
|
} catch {
|
|
589
544
|
l = [];
|
|
590
545
|
}
|
|
@@ -602,8 +557,8 @@ const E = () => ({
|
|
|
602
557
|
);
|
|
603
558
|
if (i) {
|
|
604
559
|
s = parseInt(String(i.size ?? "")) || s;
|
|
605
|
-
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),
|
|
606
|
-
|
|
560
|
+
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;
|
|
561
|
+
y && (n = await u.fetchRecommendationProductsByUrl(y));
|
|
607
562
|
}
|
|
608
563
|
} catch {
|
|
609
564
|
n = [];
|
|
@@ -613,14 +568,14 @@ const E = () => ({
|
|
|
613
568
|
_setBlockProducts(t, e, r) {
|
|
614
569
|
if (!this.blockStates[t])
|
|
615
570
|
return;
|
|
616
|
-
const n = e.length > 0 ? e :
|
|
571
|
+
const n = e.length > 0 ? e : R(r);
|
|
617
572
|
this.blockStates[t].recommendationProducts = [
|
|
618
573
|
...n.slice(0, r),
|
|
619
|
-
...
|
|
574
|
+
...R(Math.max(0, r - n.length))
|
|
620
575
|
];
|
|
621
576
|
}
|
|
622
577
|
}
|
|
623
578
|
});
|
|
624
579
|
export {
|
|
625
|
-
|
|
580
|
+
Y as useRecommendationExtensionStore
|
|
626
581
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ModificationDescription as f } from "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
2
|
import { RECOMMENDATION_ID_ATTR as m } from "../constants/selectors.js";
|
|
3
|
-
import { isPartnerManagedBlock as
|
|
4
|
-
import { RecommendationConfigService as
|
|
3
|
+
import { isPartnerManagedBlock as a, updateProductContentInPlace as d, regenerateProductRowsWithStyles as l } from "../controls/main/utils.js";
|
|
4
|
+
import { RecommendationConfigService as s } from "../services/configService.js";
|
|
5
5
|
let e = null;
|
|
6
|
-
function
|
|
6
|
+
function N(r) {
|
|
7
7
|
e = r;
|
|
8
8
|
}
|
|
9
|
-
function
|
|
9
|
+
function D(r, c, i, u) {
|
|
10
10
|
const n = e == null ? void 0 : e.getDocumentRootHtmlNode();
|
|
11
11
|
if (!e || !n || !("querySelector" in n))
|
|
12
12
|
return !1;
|
|
@@ -14,9 +14,9 @@ function N(r, c, i, u) {
|
|
|
14
14
|
if (!t)
|
|
15
15
|
return !1;
|
|
16
16
|
const o = e.getDocumentModifier();
|
|
17
|
-
return
|
|
17
|
+
return s.stageConfig(o, t, c), a(t) ? (o.apply(new f(u)), !0) : (d({ currentNode: t, documentModifier: o, products: i }) || l({ currentNode: t, documentModifier: o, products: i }), !0);
|
|
18
18
|
}
|
|
19
19
|
export {
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
D as commitBlockChangeOutsidePanel,
|
|
21
|
+
N as registerNodeConfigWriter
|
|
22
22
|
};
|
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}
|