@useinsider/guido 3.17.0-beta.6b602e7 → 3.17.0-beta.6f780fd
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 +15 -13
- package/dist/components/Guido.vue.js +4 -4
- package/dist/components/Guido.vue2.js +46 -48
- 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/header/AutoSaveStatus.vue.js +17 -0
- package/dist/components/organisms/header/AutoSaveStatus.vue2.js +21 -0
- package/dist/components/organisms/header/EditorActions.vue.js +13 -13
- package/dist/components/organisms/header/EditorActions.vue2.js +34 -50
- package/dist/components/organisms/header/EditorActionsMenu.vue.js +20 -0
- package/dist/components/organisms/header/EditorActionsMenu.vue2.js +39 -0
- package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
- package/dist/components/organisms/header/LeftSlot.vue2.js +28 -23
- package/dist/components/organisms/header/MiddleSlot.vue.js +4 -4
- package/dist/components/organisms/header/MiddleSlot.vue2.js +8 -7
- package/dist/components/organisms/header/RightSlot.vue.js +7 -6
- package/dist/components/organisms/header/RightSlot.vue2.js +17 -15
- package/dist/components/organisms/header/accessibility/AccessibilityToolbar.vue.js +18 -0
- package/dist/components/organisms/header/accessibility/AccessibilityToolbar.vue2.js +37 -0
- package/dist/components/organisms/header/accessibility/ColorVisionSelect.vue.js +24 -0
- package/dist/components/organisms/header/accessibility/ColorVisionSelect.vue2.js +48 -0
- package/dist/components/organisms/onboarding/EditorTabBarOnboarding.vue.js +18 -0
- package/dist/components/organisms/onboarding/EditorTabBarOnboarding.vue2.js +74 -0
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +43 -34
- package/dist/composables/useAccessibilityApi.js +31 -0
- package/dist/composables/useCustomInterfaceAppearance.js +44 -45
- package/dist/config/i18n/en/labels.json.js +28 -4
- 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 +31 -66
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +49 -90
- package/dist/guido.css +1 -1
- package/dist/node_modules/@vueuse/core/index.js +102 -0
- package/dist/node_modules/@vueuse/shared/index.js +40 -28
- package/dist/services/recommendationApi.js +52 -61
- package/dist/sprite.svg +6 -0
- package/dist/src/@types/config/schemas.d.ts +4 -0
- package/dist/src/components/organisms/header/accessibility/AccessibilityToolbar.vue.d.ts +2 -0
- package/dist/src/components/organisms/header/accessibility/ColorVisionSelect.vue.d.ts +2 -0
- package/dist/src/components/organisms/onboarding/EditorTabBarOnboarding.vue.d.ts +2 -0
- package/dist/src/composables/useAccessibilityApi.d.ts +15 -0
- package/dist/src/composables/useActionsApi.d.ts +2 -2
- package/dist/src/composables/useConfig.d.ts +2 -0
- package/dist/src/enums/extensions/recommendationBlock.d.ts +0 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +0 -1
- 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 +18 -0
- package/dist/src/stores/editor.d.ts +76 -0
- package/dist/src/stores/onboarding.d.ts +377 -0
- package/dist/src/stores/version-history.d.ts +1 -1
- package/dist/src/utils/timeUtil.d.ts +10 -0
- package/dist/static/styles/components/accessibility.css.js +137 -0
- package/dist/static/styles/components/recommendation-strategy.css.js +5 -70
- package/dist/static/styles/variables.css.js +1 -0
- package/dist/stores/editor.js +4 -1
- package/dist/stores/onboarding.js +16 -11
- package/dist/utils/timeUtil.js +7 -17
- 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/header/AutoSaveToggle.vue.js +0 -22
- package/dist/components/organisms/header/AutoSaveToggle.vue2.js +0 -19
- package/dist/composables/useLegacyStrategyConversion.js +0 -52
- package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.js +0 -58
- 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
- /package/dist/src/components/organisms/{extensions/recommendation/LegacyStrategyUpdatedModal.vue.d.ts → header/AutoSaveStatus.vue.d.ts} +0 -0
- /package/dist/src/components/organisms/header/{AutoSaveToggle.vue.d.ts → EditorActionsMenu.vue.d.ts} +0 -0
|
@@ -1,30 +1,26 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class R extends f {
|
|
1
|
+
var d = Object.defineProperty;
|
|
2
|
+
var y = (r, s, t) => s in r ? d(r, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[s] = t;
|
|
3
|
+
var o = (r, s, t) => y(r, typeof s != "symbol" ? s + "" : s, t);
|
|
4
|
+
import { ACADEMY_LINKS as m } from "../../../../../enums/academy.js";
|
|
5
|
+
import { CommonControl as h } from "../../../common-control.js";
|
|
6
|
+
import { useRecommendationExtensionStore as u } from "../../store/recommendation.js";
|
|
7
|
+
const p = "recommendation-strategy-control";
|
|
8
|
+
class f extends h {
|
|
10
9
|
constructor() {
|
|
11
10
|
super(...arguments);
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
c(this, "storeUnsubscription", () => {
|
|
11
|
+
o(this, "store", u());
|
|
12
|
+
o(this, "storeUnsubscription", () => {
|
|
15
13
|
});
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
o(this, "listeners", []);
|
|
15
|
+
o(this, "lastPaintedState", null);
|
|
18
16
|
}
|
|
19
17
|
getId() {
|
|
20
|
-
return
|
|
18
|
+
return p;
|
|
21
19
|
}
|
|
22
20
|
getTemplate() {
|
|
23
21
|
const t = this.api.translate(
|
|
24
22
|
"You can assign a recommendation strategy by selecting an existing one or creating a new one to show specific content."
|
|
25
|
-
), e = this.api.translate("For more information, you can"),
|
|
26
|
-
"Note that this is an older version of the Recommendation Strategy. We recommend you update it to the new Recommendation Strategy for an improved experience."
|
|
27
|
-
);
|
|
23
|
+
), e = this.api.translate("For more information, you can"), a = this.api.translate("visit Academy");
|
|
28
24
|
return `
|
|
29
25
|
<div class="strategy-control-container">
|
|
30
26
|
<div class="strategy-control-header">
|
|
@@ -35,9 +31,9 @@ class R extends f {
|
|
|
35
31
|
${t}
|
|
36
32
|
${e}
|
|
37
33
|
<a
|
|
38
|
-
href="${
|
|
34
|
+
href="${m.EMAIL_RECOMMENDATION_BLOCK}"
|
|
39
35
|
target="_blank"
|
|
40
|
-
rel="noopener noreferrer">${
|
|
36
|
+
rel="noopener noreferrer">${a}</a>.
|
|
41
37
|
</p>
|
|
42
38
|
</div>
|
|
43
39
|
<div data-strategy-empty-state>
|
|
@@ -57,28 +53,6 @@ class R extends f {
|
|
|
57
53
|
})
|
|
58
54
|
], "strategy-control-cta-row")}
|
|
59
55
|
</div>
|
|
60
|
-
<div data-strategy-legacy-state style="display: none;">
|
|
61
|
-
<div class="strategy-control-notice-row">
|
|
62
|
-
<div class="strategy-control-notice">
|
|
63
|
-
<p class="strategy-control-notice-text">${n}</p>
|
|
64
|
-
</div>
|
|
65
|
-
</div>
|
|
66
|
-
<div class="strategy-control-name-band">
|
|
67
|
-
<span class="strategy-control-name">${r}</span>
|
|
68
|
-
${this._strategyAction({
|
|
69
|
-
id: "guido__btn-update-legacy-strategy",
|
|
70
|
-
label: this.api.translate("Update"),
|
|
71
|
-
modifier: "update"
|
|
72
|
-
})}
|
|
73
|
-
</div>
|
|
74
|
-
<div class="strategy-control-actions">
|
|
75
|
-
${this._strategyAction({
|
|
76
|
-
id: "guido__btn-change-legacy-strategy",
|
|
77
|
-
label: this.api.translate("Change"),
|
|
78
|
-
modifier: "change"
|
|
79
|
-
})}
|
|
80
|
-
</div>
|
|
81
|
-
</div>
|
|
82
56
|
<div data-strategy-assigned-state style="display: none;">
|
|
83
57
|
<div class="strategy-control-name-band">
|
|
84
58
|
<span class="strategy-control-name" data-strategy-name></span>
|
|
@@ -99,12 +73,12 @@ class R extends f {
|
|
|
99
73
|
</div>
|
|
100
74
|
`;
|
|
101
75
|
}
|
|
102
|
-
_strategyAction({ id: t, label: e, modifier:
|
|
76
|
+
_strategyAction({ id: t, label: e, modifier: a }) {
|
|
103
77
|
return `
|
|
104
78
|
<button
|
|
105
79
|
id="${t}"
|
|
106
80
|
type="button"
|
|
107
|
-
class="strategy-control-action strategy-control-action--${
|
|
81
|
+
class="strategy-control-action strategy-control-action--${a}">
|
|
108
82
|
<span>${e}</span>
|
|
109
83
|
</button>
|
|
110
84
|
`;
|
|
@@ -126,34 +100,25 @@ class R extends f {
|
|
|
126
100
|
const t = this.getContainer();
|
|
127
101
|
if (!t)
|
|
128
102
|
return;
|
|
129
|
-
const e = (
|
|
130
|
-
const
|
|
131
|
-
|
|
103
|
+
const e = (a, n) => {
|
|
104
|
+
const i = t.querySelector(a);
|
|
105
|
+
i && (i.addEventListener("click", n), this.listeners.push({ element: i, handler: n }));
|
|
132
106
|
};
|
|
133
|
-
e("#guido__btn-assign-strategy", () => this.store.openAssignStrategyDrawer()), e("#guido__btn-change-strategy", () => this.store.openAssignStrategyDrawer()), e("#guido__btn-
|
|
134
|
-
this.legacyConversion.convertLegacyStrategy();
|
|
135
|
-
});
|
|
107
|
+
e("#guido__btn-assign-strategy", () => this.store.openAssignStrategyDrawer()), e("#guido__btn-change-strategy", () => this.store.openAssignStrategyDrawer()), e("#guido__btn-remove-strategy", () => this.store.openRemoveStrategyModal());
|
|
136
108
|
}
|
|
137
109
|
_renderState() {
|
|
138
|
-
var
|
|
139
|
-
const { strategyId: t } = this.store.recommendationConfigs, e = t ? ((
|
|
140
|
-
if (
|
|
141
|
-
return;
|
|
142
|
-
const g = this.getContainer();
|
|
143
|
-
if (!g)
|
|
110
|
+
var l;
|
|
111
|
+
const { strategyId: t } = this.store.recommendationConfigs, e = t ? ((l = this.store.assignedStrategy) == null ? void 0 : l.name) ?? "" : "", a = `${t}\0${e}`;
|
|
112
|
+
if (a === this.lastPaintedState)
|
|
144
113
|
return;
|
|
145
|
-
const
|
|
146
|
-
if (!
|
|
114
|
+
const n = this.getContainer();
|
|
115
|
+
if (!n)
|
|
147
116
|
return;
|
|
148
|
-
const
|
|
149
|
-
|
|
150
|
-
l.style.display = l === p ? "" : "none";
|
|
151
|
-
}), i.querySelectorAll("button").forEach((l) => {
|
|
152
|
-
l.disabled = s;
|
|
153
|
-
}), i.classList.toggle("is-converting", s), m && t && (m.textContent = e || `#${t}`), this.lastPaintedState = h;
|
|
117
|
+
const i = n.querySelector("[data-strategy-empty-state]"), c = n.querySelector("[data-strategy-assigned-state]"), g = n.querySelector("[data-strategy-name]");
|
|
118
|
+
!i || !c || (i.style.display = t ? "none" : "", c.style.display = t ? "" : "none", g && t && (g.textContent = e || `#${t}`), this.lastPaintedState = a);
|
|
154
119
|
}
|
|
155
120
|
}
|
|
156
121
|
export {
|
|
157
|
-
|
|
158
|
-
|
|
122
|
+
p as STRATEGY_CONTROL_ID,
|
|
123
|
+
f as StrategyControl
|
|
159
124
|
};
|
|
@@ -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
|
},
|
|
@@ -398,28 +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 u.migrateLegacyStrategy(t);
|
|
408
|
-
try {
|
|
409
|
-
await this.fetchStrategies();
|
|
410
|
-
} catch (s) {
|
|
411
|
-
console.error("[Guido] strategy listing refresh after conversion failed", s);
|
|
412
|
-
}
|
|
413
|
-
const n = this.strategies.find((s) => String(s.strategy_id) === r);
|
|
414
|
-
return this.patchCurrentBlockConfig({
|
|
415
|
-
strategyId: r,
|
|
416
|
-
nodeConfigVersion: w,
|
|
417
|
-
...(n == null ? void 0 : n.size) !== void 0 ? { size: String(n.size) } : {}
|
|
418
|
-
}), r;
|
|
419
|
-
} finally {
|
|
420
|
-
this.blockStates[e].legacyConversionLoading = !1;
|
|
421
|
-
}
|
|
422
|
-
},
|
|
423
382
|
removeStrategy() {
|
|
424
383
|
this.patchCurrentBlockConfig({ strategyId: "", size: N.size });
|
|
425
384
|
},
|
|
@@ -453,18 +412,18 @@ const E = () => ({
|
|
|
453
412
|
},
|
|
454
413
|
async fetchRecommendationFilters() {
|
|
455
414
|
if (!Object.keys(this.filterList).length) {
|
|
456
|
-
if (
|
|
457
|
-
await
|
|
415
|
+
if (h) {
|
|
416
|
+
await h;
|
|
458
417
|
return;
|
|
459
418
|
}
|
|
460
|
-
|
|
419
|
+
h = (async () => {
|
|
461
420
|
const t = await u.fetchRecommendationFilters();
|
|
462
421
|
this.filterList = t;
|
|
463
422
|
})();
|
|
464
423
|
try {
|
|
465
|
-
await
|
|
424
|
+
await h;
|
|
466
425
|
} finally {
|
|
467
|
-
|
|
426
|
+
h = null;
|
|
468
427
|
}
|
|
469
428
|
}
|
|
470
429
|
},
|
|
@@ -493,7 +452,7 @@ const E = () => ({
|
|
|
493
452
|
const n = [...e.recommendationConfigs.filters];
|
|
494
453
|
n[r] = {
|
|
495
454
|
...t,
|
|
496
|
-
isValid:
|
|
455
|
+
isValid: B(t)
|
|
497
456
|
}, e.recommendationConfigs.filters = n;
|
|
498
457
|
}
|
|
499
458
|
},
|
|
@@ -531,7 +490,7 @@ const E = () => ({
|
|
|
531
490
|
}), e.recommendationConfigs.filters = r;
|
|
532
491
|
},
|
|
533
492
|
generateFilterQuery() {
|
|
534
|
-
return
|
|
493
|
+
return k(this.recommendationConfigs.filters);
|
|
535
494
|
},
|
|
536
495
|
/**
|
|
537
496
|
* Validation-only check invoked at save-CTA time. Defined as an action
|
|
@@ -539,33 +498,33 @@ const E = () => ({
|
|
|
539
498
|
* every block's recommendationConfigs across user edits.
|
|
540
499
|
*/
|
|
541
500
|
hasInvalidBlock() {
|
|
542
|
-
return Object.values(this.blockStates).some((t) => !
|
|
501
|
+
return Object.values(this.blockStates).some((t) => !M(t.recommendationConfigs, this));
|
|
543
502
|
},
|
|
544
503
|
// ====================================================================
|
|
545
504
|
// Per-Block Product Fetching
|
|
546
505
|
// ====================================================================
|
|
547
506
|
async fetchRecommendationProducts() {
|
|
548
507
|
if (!(this.currentRecommendationId === null || !this.blockStates[this.currentRecommendationId])) {
|
|
549
|
-
if (
|
|
550
|
-
await
|
|
508
|
+
if (g) {
|
|
509
|
+
await g;
|
|
551
510
|
return;
|
|
552
511
|
}
|
|
553
|
-
|
|
512
|
+
g = this._doFetchProducts();
|
|
554
513
|
try {
|
|
555
|
-
await
|
|
514
|
+
await g;
|
|
556
515
|
} finally {
|
|
557
|
-
|
|
516
|
+
g = null;
|
|
558
517
|
}
|
|
559
518
|
}
|
|
560
519
|
},
|
|
561
520
|
async _doFetchProducts() {
|
|
562
521
|
var d;
|
|
563
|
-
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();
|
|
564
523
|
if (r.strategyId && n.isFeatureEnabled("reusableRecommendationStrategy")) {
|
|
565
524
|
await this._doFetchStrategyProducts(t);
|
|
566
525
|
return;
|
|
567
526
|
}
|
|
568
|
-
const s = r.filters.filter((m) => m.isValid), i =
|
|
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 = {
|
|
569
528
|
locale: r.language,
|
|
570
529
|
currency: r.currencySettings.value,
|
|
571
530
|
partnerName: n.partnerName,
|
|
@@ -573,9 +532,9 @@ const E = () => ({
|
|
|
573
532
|
details: !0,
|
|
574
533
|
campaignId: n.variationId
|
|
575
534
|
};
|
|
576
|
-
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(
|
|
577
536
|
a,
|
|
578
|
-
|
|
537
|
+
x(n.partnerName, r.strategy)
|
|
579
538
|
);
|
|
580
539
|
let l;
|
|
581
540
|
try {
|
|
@@ -608,14 +567,14 @@ const E = () => ({
|
|
|
608
567
|
_setBlockProducts(t, e, r) {
|
|
609
568
|
if (!this.blockStates[t])
|
|
610
569
|
return;
|
|
611
|
-
const n = e.length > 0 ? e :
|
|
570
|
+
const n = e.length > 0 ? e : R(r);
|
|
612
571
|
this.blockStates[t].recommendationProducts = [
|
|
613
572
|
...n.slice(0, r),
|
|
614
|
-
...
|
|
573
|
+
...R(Math.max(0, r - n.length))
|
|
615
574
|
];
|
|
616
575
|
}
|
|
617
576
|
}
|
|
618
577
|
});
|
|
619
578
|
export {
|
|
620
|
-
|
|
579
|
+
Y as useRecommendationExtensionStore
|
|
621
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-
|
|
1
|
+
@charset "UTF-8";.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-2f127fb6] .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}.color-vision-select__menu[data-v-869e2871]{top:calc(100% + 4px);left:0;z-index:20;width:387px;padding:8px 0;border-radius:8px;background-color:#fff;box-shadow:0 4px 12px #39393926}.color-vision-select__option[data-v-869e2871]{width:100%;padding:4px 12px;border:none;background-color:transparent;text-align:left;cursor:pointer}.color-vision-select__option[data-v-869e2871]:hover,.color-vision-select__option_selected[data-v-869e2871]{background-color:#f1f3fe}.color-vision-select__option_selected .color-vision-select__option-label[data-v-869e2871],.color-vision-select__option_selected .color-vision-select__option-description[data-v-869e2871]{color:#0a2ecc}.color-vision-select__option-label[data-v-869e2871]{line-height:24px}.color-vision-select__option-description[data-v-869e2871]{line-height:16px}.accessibility-toolbar[data-v-4e1e854b]{gap:16px}.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}.editor-actions-menu__panel[data-v-f1952caa]{top:calc(100% + 4px);right:0;z-index:20;width:222px;padding:8px 0;border-radius:8px;background-color:#fff;box-shadow:0 4px 12px #39393926}.editor-actions-menu__section[data-v-f1952caa]{padding:8px 12px 4px;text-transform:uppercase;letter-spacing:.4px}.editor-actions-menu__icon[data-v-f1952caa]{color:#666;fill:currentColor}.editor-actions-menu__row[data-v-f1952caa]{width:100%;padding:4px 12px;border:none;background-color:transparent;color:#292929;line-height:24px;text-align:left;cursor:pointer}.editor-actions-menu__row[data-v-f1952caa]:not(.editor-actions-menu__row_static):hover{background-color:#f1f3fe}.editor-actions-menu__row_static[data-v-f1952caa]{cursor:default}.editor-actions-menu__row[data-v-f1952caa]:disabled{cursor:not-allowed;opacity:.6}.editor-actions-menu__divider[data-v-f1952caa]{height:1px;margin:4px 0;background-color:#e1e1e1}.editor-actions[data-v-8aa5b2ca]{gap:16px}.editor-actions__divider[data-v-8aa5b2ca]{width:1px;height:40px;background-color:#e1e1e1}.right-slot[data-v-1ad38e93]{gap:16px}.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-5c588dc5]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-5c588dc5]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-5c588dc5]{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}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { noop as b, isIOS as F, isClient as O, toValue as h, isObject as T, tryOnScopeDispose as C } from "../shared/index.js";
|
|
2
|
+
import { createFilterWrapper as x, debounceFilter as D, useDebounceFn as j } from "../shared/index.js";
|
|
3
|
+
import "../../vue-demi/lib/index.js";
|
|
4
|
+
import { watch as I } from "vue";
|
|
5
|
+
const P = O ? window : void 0;
|
|
6
|
+
function p(n) {
|
|
7
|
+
var i;
|
|
8
|
+
const o = h(n);
|
|
9
|
+
return (i = o == null ? void 0 : o.$el) != null ? i : o;
|
|
10
|
+
}
|
|
11
|
+
function k(...n) {
|
|
12
|
+
let i, o, r, d;
|
|
13
|
+
if (typeof n[0] == "string" || Array.isArray(n[0]) ? ([o, r, d] = n, i = P) : [i, o, r, d] = n, !i)
|
|
14
|
+
return b;
|
|
15
|
+
Array.isArray(o) || (o = [o]), Array.isArray(r) || (r = [r]);
|
|
16
|
+
const m = [], y = () => {
|
|
17
|
+
m.forEach((c) => c()), m.length = 0;
|
|
18
|
+
}, a = (c, l, u, f) => (c.addEventListener(l, u, f), () => c.removeEventListener(l, u, f)), E = I(
|
|
19
|
+
() => [p(i), h(d)],
|
|
20
|
+
([c, l]) => {
|
|
21
|
+
if (y(), !c)
|
|
22
|
+
return;
|
|
23
|
+
const u = T(l) ? { ...l } : l;
|
|
24
|
+
m.push(
|
|
25
|
+
...o.flatMap((f) => r.map((w) => a(c, f, w, u)))
|
|
26
|
+
);
|
|
27
|
+
},
|
|
28
|
+
{ immediate: !0, flush: "post" }
|
|
29
|
+
), A = () => {
|
|
30
|
+
E(), y();
|
|
31
|
+
};
|
|
32
|
+
return C(A), A;
|
|
33
|
+
}
|
|
34
|
+
let L = !1;
|
|
35
|
+
function $(n, i, o = {}) {
|
|
36
|
+
const { window: r = P, ignore: d = [], capture: m = !0, detectIframe: y = !1 } = o;
|
|
37
|
+
if (!r)
|
|
38
|
+
return b;
|
|
39
|
+
F && !L && (L = !0, Array.from(r.document.body.children).forEach((e) => e.addEventListener("click", b)), r.document.documentElement.addEventListener("click", b));
|
|
40
|
+
let a = !0;
|
|
41
|
+
const E = (e) => h(d).some((t) => {
|
|
42
|
+
if (typeof t == "string")
|
|
43
|
+
return Array.from(r.document.querySelectorAll(t)).some((s) => s === e.target || e.composedPath().includes(s));
|
|
44
|
+
{
|
|
45
|
+
const s = p(t);
|
|
46
|
+
return s && (e.target === s || e.composedPath().includes(s));
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
function A(e) {
|
|
50
|
+
const t = h(e);
|
|
51
|
+
return t && t.$.subTree.shapeFlag === 16;
|
|
52
|
+
}
|
|
53
|
+
function c(e, t) {
|
|
54
|
+
const s = h(e), v = s.$.subTree && s.$.subTree.children;
|
|
55
|
+
return v == null || !Array.isArray(v) ? !1 : v.some((g) => g.el === t.target || t.composedPath().includes(g.el));
|
|
56
|
+
}
|
|
57
|
+
const l = (e) => {
|
|
58
|
+
const t = p(n);
|
|
59
|
+
if (e.target != null && !(!(t instanceof Element) && A(n) && c(n, e)) && !(!t || t === e.target || e.composedPath().includes(t))) {
|
|
60
|
+
if (e.detail === 0 && (a = !E(e)), !a) {
|
|
61
|
+
a = !0;
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
i(e);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
let u = !1;
|
|
68
|
+
const f = [
|
|
69
|
+
k(r, "click", (e) => {
|
|
70
|
+
u || (u = !0, setTimeout(() => {
|
|
71
|
+
u = !1;
|
|
72
|
+
}, 0), l(e));
|
|
73
|
+
}, { passive: !0, capture: m }),
|
|
74
|
+
k(r, "pointerdown", (e) => {
|
|
75
|
+
const t = p(n);
|
|
76
|
+
a = !E(e) && !!(t && !e.composedPath().includes(t));
|
|
77
|
+
}, { passive: !0 }),
|
|
78
|
+
y && k(r, "blur", (e) => {
|
|
79
|
+
setTimeout(() => {
|
|
80
|
+
var t;
|
|
81
|
+
const s = p(n);
|
|
82
|
+
((t = r.document.activeElement) == null ? void 0 : t.tagName) === "IFRAME" && !(s != null && s.contains(r.document.activeElement)) && i(e);
|
|
83
|
+
}, 0);
|
|
84
|
+
})
|
|
85
|
+
].filter(Boolean);
|
|
86
|
+
return () => f.forEach((e) => e());
|
|
87
|
+
}
|
|
88
|
+
export {
|
|
89
|
+
x as createFilterWrapper,
|
|
90
|
+
D as debounceFilter,
|
|
91
|
+
P as defaultWindow,
|
|
92
|
+
O as isClient,
|
|
93
|
+
F as isIOS,
|
|
94
|
+
T as isObject,
|
|
95
|
+
b as noop,
|
|
96
|
+
$ as onClickOutside,
|
|
97
|
+
h as toValue,
|
|
98
|
+
C as tryOnScopeDispose,
|
|
99
|
+
p as unrefElement,
|
|
100
|
+
j as useDebounceFn,
|
|
101
|
+
k as useEventListener
|
|
102
|
+
};
|