@useinsider/guido 3.18.1-beta.d82285c → 3.18.1-beta.d931f79
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/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +1 -1
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +65 -61
- package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue2.js +23 -37
- package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.js +3 -3
- package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue2.js +21 -20
- package/dist/composables/useCustomInterfaceAppearance.js +56 -46
- package/dist/composables/useRecommendation.js +38 -36
- package/dist/composables/useStripo.js +30 -30
- package/dist/enums/extensions/recommendationBlock.js +5 -5
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +21 -20
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +58 -53
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +81 -62
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +159 -138
- package/dist/extensions/Blocks/Recommendation/utils/strategyDetach.js +19 -0
- package/dist/guido.css +1 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +2 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +8 -0
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +30 -4
- package/dist/src/extensions/Blocks/Recommendation/utils/strategyDetach.d.ts +12 -0
- package/dist/static/styles/components/recommendation-strategy.css.js +19 -21
- package/dist/static/styles/components/skeleton.css.js +23 -0
- package/dist/utils/templatePreparation.js +10 -10
- package/package.json +1 -1
|
@@ -1,48 +1,47 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as I, defineAsyncComponent as S, ref as T, computed as l, watch as h } from "vue";
|
|
2
2
|
import "@useinsider/design-system-organisms/style";
|
|
3
|
-
import { useToaster as
|
|
4
|
-
import { useTranslations as
|
|
5
|
-
import { DOTTED_DATE_LOCALE as
|
|
6
|
-
import { URLS as
|
|
7
|
-
import { ToasterTypeOptions as
|
|
8
|
-
import { useRecommendationExtensionStore as
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
3
|
+
import { useToaster as A } from "../../../../composables/useToaster.js";
|
|
4
|
+
import { useTranslations as C } from "../../../../composables/useTranslations.js";
|
|
5
|
+
import { DOTTED_DATE_LOCALE as B } from "../../../../enums/date.js";
|
|
6
|
+
import { URLS as b } from "../../../../enums/extensions/recommendationBlock.js";
|
|
7
|
+
import { ToasterTypeOptions as m } from "../../../../enums/toaster.js";
|
|
8
|
+
import { useRecommendationExtensionStore as k } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
9
|
+
import { commitStrategyDetach as N } from "../../../../extensions/Blocks/Recommendation/utils/strategyDetach.js";
|
|
10
|
+
import R from "./StrategyInfoBoxContent.vue.js";
|
|
11
|
+
import { formatShortDate as P } from "../../../../utils/dateUtil.js";
|
|
12
|
+
import { asText as _ } from "../../../../utils/genericUtil.js";
|
|
13
|
+
import { escapeHtml as U } from "../../../../utils/htmlEscape.js";
|
|
14
|
+
import { InSkeleton as L } from "@useinsider/design-system-vue";
|
|
15
|
+
const rt = /* @__PURE__ */ I({
|
|
15
16
|
__name: "AssignStrategyDrawer",
|
|
16
|
-
setup(
|
|
17
|
-
const g = () => import("@useinsider/design-system-organisms"),
|
|
18
|
-
render: (
|
|
19
|
-
}),
|
|
17
|
+
setup(M) {
|
|
18
|
+
const g = () => import("@useinsider/design-system-organisms"), d = (t, r) => ({
|
|
19
|
+
render: (o) => o(L, { props: { sizing: { width: t, height: r } } })
|
|
20
|
+
}), D = S({
|
|
20
21
|
loader: async () => (await g()).OrgStrategyDetailModal,
|
|
21
|
-
loadingComponent:
|
|
22
|
+
loadingComponent: d(480, 240),
|
|
22
23
|
delay: 0
|
|
23
|
-
}),
|
|
24
|
-
loader: async () => (await g()).OrgStrategyDropdown
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}), o = "guido-edit-strategy-", s = A(), r = B(), { showToaster: n } = h(), i = f(null), l = f(!1), D = c(() => r.assignStrategyDrawerStatus ? s("email-editor.assign-strategy-description", { url: C.RECOMMENDATION_STRATEGIES_PANEL_PATH }) : "");
|
|
28
|
-
O(() => r.assignStrategyDrawerStatus, (t) => {
|
|
24
|
+
}), v = S({
|
|
25
|
+
loader: async () => (await g()).OrgStrategyDropdown
|
|
26
|
+
}), n = "guido-edit-strategy-", s = C(), e = k(), { showToaster: i } = A(), a = T(null), c = T(!1), w = l(() => e.assignStrategyDrawerStatus ? s("email-editor.assign-strategy-description", { url: b.RECOMMENDATION_STRATEGIES_PANEL_PATH }) : "");
|
|
27
|
+
h(() => e.assignStrategyDrawerStatus, (t) => {
|
|
29
28
|
if (!t)
|
|
30
29
|
return;
|
|
31
|
-
const { strategyId:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
type:
|
|
30
|
+
const { strategyId: r } = e.recommendationConfigs;
|
|
31
|
+
a.value = r || null, c.value = !1, e.fetchStrategies().catch(() => {
|
|
32
|
+
i({
|
|
33
|
+
type: m.Error,
|
|
35
34
|
message: s("discovery-strategy.error-description")
|
|
36
35
|
});
|
|
37
36
|
});
|
|
38
37
|
});
|
|
39
|
-
const
|
|
40
|
-
const
|
|
41
|
-
if (!
|
|
38
|
+
const u = (t) => {
|
|
39
|
+
const r = _(t.updated_at || t.created_at);
|
|
40
|
+
if (!r)
|
|
42
41
|
return "";
|
|
43
|
-
const
|
|
44
|
-
return s("recommendation-strategy.last-updated-on", { value:
|
|
45
|
-
},
|
|
42
|
+
const o = P(r, B);
|
|
43
|
+
return s("recommendation-strategy.last-updated-on", { value: o });
|
|
44
|
+
}, x = l(() => e.strategies.map((t) => ({
|
|
46
45
|
text: t.name,
|
|
47
46
|
value: t.strategy_id,
|
|
48
47
|
infoBoxProps: {
|
|
@@ -50,15 +49,15 @@ const Y = /* @__PURE__ */ E({
|
|
|
50
49
|
theme: "light",
|
|
51
50
|
variant: "information",
|
|
52
51
|
className: "assign-strategy-info-box",
|
|
53
|
-
titleText:
|
|
52
|
+
titleText: U(_(t.name)),
|
|
54
53
|
descriptionStatus: !0,
|
|
55
|
-
descriptionText:
|
|
56
|
-
slot:
|
|
54
|
+
descriptionText: u(t),
|
|
55
|
+
slot: R,
|
|
57
56
|
slotProps: { strategy: t },
|
|
58
57
|
// The info box drops the option's value/text, so the id is the only channel
|
|
59
58
|
// that can carry the strategy back to the click handler.
|
|
60
59
|
buttonOptions: [{
|
|
61
|
-
id: `${
|
|
60
|
+
id: `${n}${t.strategy_id}`,
|
|
62
61
|
text: s("eureka.edit-strategy"),
|
|
63
62
|
type: "text",
|
|
64
63
|
// Resolved from Guido's own public/sprite.svg by InIcons; an unknown name would
|
|
@@ -66,14 +65,19 @@ const Y = /* @__PURE__ */ E({
|
|
|
66
65
|
icon: "line-open-website"
|
|
67
66
|
}]
|
|
68
67
|
}
|
|
69
|
-
}))),
|
|
70
|
-
var
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
const
|
|
68
|
+
}))), E = (t) => {
|
|
69
|
+
var f;
|
|
70
|
+
const r = (f = t == null ? void 0 : t.id) != null && f.startsWith(n) ? t.id.slice(n.length) : "";
|
|
71
|
+
if (!r)
|
|
72
|
+
return;
|
|
73
|
+
const o = e.currentRecommendationId;
|
|
74
|
+
String(a.value ?? "") === r && (a.value = null);
|
|
75
|
+
const y = e.recommendationConfigs.strategyId === r;
|
|
76
|
+
y && e.removeStrategy(), e.openStrategyEdit(r), y && o !== null && N(o);
|
|
77
|
+
}, p = l(() => {
|
|
78
|
+
const t = e.strategies.find((r) => String(r.strategy_id) === String(a.value ?? ""));
|
|
75
79
|
return t ? { ...t, fallback_config: null } : null;
|
|
76
|
-
}),
|
|
80
|
+
}), O = l(() => ({
|
|
77
81
|
primaryButton: {
|
|
78
82
|
styling: "solid",
|
|
79
83
|
type: "primary",
|
|
@@ -85,36 +89,36 @@ const Y = /* @__PURE__ */ E({
|
|
|
85
89
|
labelText: s("products.cancel")
|
|
86
90
|
}
|
|
87
91
|
}));
|
|
88
|
-
return { __sfc: !0, loadOrganisms: g, skeleton:
|
|
89
|
-
|
|
92
|
+
return { __sfc: !0, loadOrganisms: g, skeleton: d, OrgStrategyDetailModal: D, OrgStrategyDropdown: v, EDIT_BUTTON_ID_PREFIX: n, trans: s, store: e, showToaster: i, selectedStrategyId: a, showSelectionError: c, drawerDescription: w, lastUpdatedText: u, strategyOptions: x, onInfoBoxButtonClick: E, selectedStrategy: p, footerButtonGroupOptions: O, closeDrawer: () => {
|
|
93
|
+
e.closeAssignStrategyDrawer();
|
|
90
94
|
}, assignStrategy: async () => {
|
|
91
|
-
const t =
|
|
95
|
+
const t = p.value;
|
|
92
96
|
if (!t) {
|
|
93
|
-
|
|
97
|
+
c.value = !0;
|
|
94
98
|
return;
|
|
95
99
|
}
|
|
96
|
-
let
|
|
100
|
+
let r = "";
|
|
97
101
|
try {
|
|
98
|
-
|
|
99
|
-
} catch (
|
|
100
|
-
console.error("[AssignStrategyDrawer] resolveStrategyUrlTemplate failed",
|
|
102
|
+
r = await e.resolveStrategyUrlTemplate(t, e.recommendationConfigs.currencySettings.value);
|
|
103
|
+
} catch (o) {
|
|
104
|
+
console.error("[AssignStrategyDrawer] resolveStrategyUrlTemplate failed", o);
|
|
101
105
|
}
|
|
102
|
-
if (!
|
|
103
|
-
|
|
104
|
-
type:
|
|
106
|
+
if (!r) {
|
|
107
|
+
i({
|
|
108
|
+
type: m.Error,
|
|
105
109
|
message: s("email-editor.strategy-assign-failed", { strategyName: t.name })
|
|
106
110
|
});
|
|
107
111
|
return;
|
|
108
112
|
}
|
|
109
|
-
|
|
110
|
-
type:
|
|
113
|
+
e.assignStrategy(t), i({
|
|
114
|
+
type: m.Success,
|
|
111
115
|
message: s("email-editor.strategy-assigned-success", { strategyName: t.name })
|
|
112
|
-
}),
|
|
116
|
+
}), e.closeAssignStrategyDrawer();
|
|
113
117
|
}, onSelect: (t) => {
|
|
114
|
-
|
|
118
|
+
a.value = t.value, c.value = !1;
|
|
115
119
|
} };
|
|
116
120
|
}
|
|
117
121
|
});
|
|
118
122
|
export {
|
|
119
|
-
|
|
123
|
+
rt as default
|
|
120
124
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { useToaster as
|
|
4
|
-
import { useTranslations as
|
|
5
|
-
import { ToasterTypeOptions as
|
|
6
|
-
import { useRecommendationExtensionStore as
|
|
7
|
-
import {
|
|
8
|
-
import { escapeHtml as
|
|
9
|
-
const
|
|
1
|
+
import { defineComponent as l, computed as a } from "vue";
|
|
2
|
+
import d from "../../../wrappers/WpModal.vue.js";
|
|
3
|
+
import { useToaster as g } from "../../../../composables/useToaster.js";
|
|
4
|
+
import { useTranslations as y } from "../../../../composables/useTranslations.js";
|
|
5
|
+
import { ToasterTypeOptions as u } from "../../../../enums/toaster.js";
|
|
6
|
+
import { useRecommendationExtensionStore as f } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
7
|
+
import { commitStrategyDetach as _ } from "../../../../extensions/Blocks/Recommendation/utils/strategyDetach.js";
|
|
8
|
+
import { escapeHtml as T } from "../../../../utils/htmlEscape.js";
|
|
9
|
+
const C = /* @__PURE__ */ l({
|
|
10
10
|
__name: "RemoveStrategyModal",
|
|
11
|
-
setup(
|
|
12
|
-
const t =
|
|
11
|
+
setup(v) {
|
|
12
|
+
const t = y(), e = f(), { showToaster: n } = g(), i = a(() => ({
|
|
13
13
|
cancelOrBackButton: {
|
|
14
14
|
type: "secondary",
|
|
15
15
|
labelText: t("products.cancel"),
|
|
@@ -19,39 +19,25 @@ const P = /* @__PURE__ */ u({
|
|
|
19
19
|
type: "danger",
|
|
20
20
|
labelText: t("discovery-strategy.remove")
|
|
21
21
|
}
|
|
22
|
-
})), m =
|
|
22
|
+
})), m = a(() => {
|
|
23
23
|
var o;
|
|
24
|
-
const { strategyId:
|
|
25
|
-
return ((o = e.assignedStrategy) == null ? void 0 : o.name) || `#${
|
|
26
|
-
}),
|
|
24
|
+
const { strategyId: s } = e.recommendationConfigs;
|
|
25
|
+
return ((o = e.assignedStrategy) == null ? void 0 : o.name) || `#${s}`;
|
|
26
|
+
}), r = "__STRATEGY_NAME__", p = a(() => t("email-editor.remove-strategy-confirm-message", { strategyName: r }).split(r)), c = () => {
|
|
27
27
|
e.closeRemoveStrategyModal();
|
|
28
28
|
};
|
|
29
|
-
return { __sfc: !0, trans: t, store: e, showToaster:
|
|
30
|
-
const
|
|
31
|
-
e.removeStrategy(), c()
|
|
32
|
-
|
|
33
|
-
if (a({
|
|
34
|
-
type: v.Success,
|
|
29
|
+
return { __sfc: !0, trans: t, store: e, showToaster: n, footerButtonOptions: i, strategyName: m, NAME_TOKEN: r, messageParts: p, close: c, handleConfirm: async () => {
|
|
30
|
+
const s = m.value, o = e.currentRecommendationId;
|
|
31
|
+
e.removeStrategy(), c(), n({
|
|
32
|
+
type: u.Success,
|
|
35
33
|
// The toast renders through a sanitizing v-html, so the name is escaped first.
|
|
36
34
|
message: t("email-editor.strategy-removed-success", {
|
|
37
|
-
strategyName: `<b>${
|
|
35
|
+
strategyName: `<b>${T(s)}</b>`
|
|
38
36
|
})
|
|
39
|
-
}), o !== null)
|
|
40
|
-
|
|
41
|
-
await e.fetchRecommendationProducts();
|
|
42
|
-
} catch (p) {
|
|
43
|
-
console.error("[RemoveStrategyModal] product refetch failed", p);
|
|
44
|
-
}
|
|
45
|
-
h(
|
|
46
|
-
o,
|
|
47
|
-
{ strategyId: l, size: g },
|
|
48
|
-
e.recommendationProducts,
|
|
49
|
-
"Removed recommendation strategy"
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
}, WpModal: y };
|
|
37
|
+
}), o !== null && await _(o);
|
|
38
|
+
}, WpModal: d };
|
|
53
39
|
}
|
|
54
40
|
});
|
|
55
41
|
export {
|
|
56
|
-
|
|
42
|
+
C as default
|
|
57
43
|
};
|
|
@@ -2,9 +2,9 @@ import d from "./RecommendationStrategyOnboarding.vue2.js";
|
|
|
2
2
|
/* empty css */
|
|
3
3
|
import g from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
4
|
var m = function() {
|
|
5
|
-
var e, n, r,
|
|
5
|
+
var e, n, r, i, a;
|
|
6
6
|
var t = this, s = t._self._c, o = t._self._setupProxy;
|
|
7
|
-
return o.isVisible ? s(o.InOnboard, { key: "guido__recommendation-strategy-onboard", staticClass: "w-21-s p-a z-11", class: (e = o.onboardingStore.getRecommendationStrategyCurrentCard) == null ? void 0 : e.classes, attrs: { id: "guido__recommendation-strategy-onboard", "is-multiple-page": "", visible: "", "image-source": "", title: "", "left-position": (n = o.onboardingStore.getRecommendationStrategyCurrentCard) == null ? void 0 : n.left, "pages-config": o.onboardingStore.onboardings.recommendationStrategyOnboarding.config, "pointer-position": (r = o.onboardingStore.getRecommendationStrategyCurrentCard) == null ? void 0 : r.position, "right-position": (
|
|
7
|
+
return o.isVisible ? s(o.InOnboard, { key: "guido__recommendation-strategy-onboard", staticClass: "w-21-s p-a z-11", class: (e = o.onboardingStore.getRecommendationStrategyCurrentCard) == null ? void 0 : e.classes, attrs: { id: "guido__recommendation-strategy-onboard", "is-multiple-page": "", visible: "", "image-source": "", title: "", "left-position": (n = o.onboardingStore.getRecommendationStrategyCurrentCard) == null ? void 0 : n.left, "pages-config": o.onboardingStore.onboardings.recommendationStrategyOnboarding.config, "pointer-position": (r = o.onboardingStore.getRecommendationStrategyCurrentCard) == null ? void 0 : r.position, "right-position": (i = o.onboardingStore.getRecommendationStrategyCurrentCard) == null ? void 0 : i.right, "top-position": (a = o.onboardingStore.getRecommendationStrategyCurrentCard) == null ? void 0 : a.top }, on: { close: function(p) {
|
|
8
8
|
return o.onboardingStore.close(o.ONBOARDING_TYPE);
|
|
9
9
|
}, nextButtonClick: o.handleNext } }) : t._e();
|
|
10
10
|
}, c = [], _ = /* @__PURE__ */ g(
|
|
@@ -13,7 +13,7 @@ var m = function() {
|
|
|
13
13
|
c,
|
|
14
14
|
!1,
|
|
15
15
|
null,
|
|
16
|
-
"
|
|
16
|
+
"ec2027ff"
|
|
17
17
|
);
|
|
18
18
|
const S = _.exports;
|
|
19
19
|
export {
|
|
@@ -1,46 +1,47 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useRibbonOffset as
|
|
3
|
-
import { useTranslations as
|
|
4
|
-
import { ACADEMY_LINKS as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
1
|
+
import { defineComponent as g, computed as p, watch as b } from "vue";
|
|
2
|
+
import { useRibbonOffset as u } from "../../../composables/useRibbonOffset.js";
|
|
3
|
+
import { useTranslations as l } from "../../../composables/useTranslations.js";
|
|
4
|
+
import { ACADEMY_LINKS as f } from "../../../enums/academy.js";
|
|
5
|
+
import { useRecommendationExtensionStore as O } from "../../../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
6
|
+
import { useOnboardingStore as _ } from "../../../stores/onboarding.js";
|
|
7
|
+
import { InOnboard as y } from "@useinsider/design-system-vue";
|
|
8
|
+
const h = /* @__PURE__ */ g({
|
|
8
9
|
__name: "RecommendationStrategyOnboarding",
|
|
9
|
-
setup(
|
|
10
|
-
const
|
|
10
|
+
setup(C) {
|
|
11
|
+
const n = "recommendationStrategyOnboarding", e = l(), t = _(), i = O(), { getTopPosition: r } = u(), a = `<a href="${f.EMAIL_RECOMMENDATION_BLOCK}" target="_blank" rel="noopener noreferrer">${e("action-builder.visit-academy")}</a>`, m = () => [
|
|
11
12
|
{
|
|
12
13
|
classes: "guido-recommendation-strategy-onboarding",
|
|
13
14
|
// Sits in the gap left of the settings panel and points at the strategy section, which
|
|
14
15
|
// starts 208px down: the panel header and its tab row are fixed chrome above it.
|
|
15
16
|
right: "426px",
|
|
16
|
-
top:
|
|
17
|
+
top: r(208),
|
|
17
18
|
position: "Right Top",
|
|
18
|
-
title:
|
|
19
|
-
description:
|
|
20
|
-
academyLink:
|
|
19
|
+
title: e("email-editor.onboarding-recommendation-strategy-title"),
|
|
20
|
+
description: e("email-editor.onboarding-recommendation-strategy-description", {
|
|
21
|
+
academyLink: a
|
|
21
22
|
}),
|
|
22
23
|
imageSource: "",
|
|
23
24
|
backButtonClick: () => {
|
|
24
25
|
},
|
|
25
26
|
nextButtonType: "text",
|
|
26
|
-
nextButtonText:
|
|
27
|
+
nextButtonText: e("action-builder.ok"),
|
|
27
28
|
nextButtonClick: () => {
|
|
28
|
-
t.close(
|
|
29
|
+
t.close(n);
|
|
29
30
|
}
|
|
30
31
|
}
|
|
31
|
-
],
|
|
32
|
+
], c = p(() => i.strategyPanelOpen && t.onboardings.recommendationStrategyOnboarding.config.length > 0 && t.onboardings.recommendationStrategyOnboarding.isActive), d = () => {
|
|
32
33
|
var o, s;
|
|
33
34
|
(s = (o = t.getRecommendationStrategyCurrentCard) == null ? void 0 : o.nextButtonClick) == null || s.call(o);
|
|
34
35
|
};
|
|
35
36
|
return b(
|
|
36
|
-
() => t.isActive(
|
|
37
|
+
() => t.isActive(n),
|
|
37
38
|
(o) => {
|
|
38
|
-
o && t.setConfig(
|
|
39
|
+
o && t.setConfig(n, m());
|
|
39
40
|
},
|
|
40
41
|
{ immediate: !0 }
|
|
41
|
-
), { __sfc: !0, ONBOARDING_TYPE:
|
|
42
|
+
), { __sfc: !0, ONBOARDING_TYPE: n, trans: e, onboardingStore: t, recommendationStore: i, getTopPosition: r, academyLink: a, buildOnboardingCards: m, isVisible: c, handleNext: d, InOnboard: y };
|
|
42
43
|
}
|
|
43
44
|
});
|
|
44
45
|
export {
|
|
45
|
-
|
|
46
|
+
h as default
|
|
46
47
|
};
|
|
@@ -1,67 +1,77 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
1
|
+
import p from "../static/assets/icons/line-change.svg.js";
|
|
2
|
+
import s from "../static/assets/icons/line-delete.svg.js";
|
|
3
|
+
import a from "../static/assets/icons/line-plus.svg.js";
|
|
4
|
+
import f from "../static/styles/base.css.js";
|
|
5
|
+
import C from "../static/styles/components/alert-message.css.js";
|
|
6
|
+
import c from "../static/styles/components/amp-block.css.js";
|
|
7
|
+
import l from "../static/styles/components/base-input.css.js";
|
|
8
|
+
import d from "../static/styles/components/button-group.css.js";
|
|
9
|
+
import u from "../static/styles/components/button.css.js";
|
|
10
|
+
import h from "../static/styles/components/combobox.css.js";
|
|
11
|
+
import g from "../static/styles/components/counter.css.js";
|
|
12
|
+
import w from "../static/styles/components/dropdown-menu.css.js";
|
|
13
|
+
import y from "../static/styles/components/loader.css.js";
|
|
14
|
+
import I from "../static/styles/components/narrow-panel.css.js";
|
|
15
|
+
import A from "../static/styles/components/popup.css.js";
|
|
16
|
+
import b from "../static/styles/components/recommendation-strategy.css.js";
|
|
17
|
+
import B from "../static/styles/components/skeleton.css.js";
|
|
18
|
+
import D from "../static/styles/components/switcher.css.js";
|
|
19
|
+
import $ from "../static/styles/components/tabs.css.js";
|
|
20
|
+
import P from "../static/styles/components/tools.css.js";
|
|
21
|
+
import R from "../static/styles/components/version-history.css.js";
|
|
22
|
+
import T from "../static/styles/components/wide-panel.css.js";
|
|
22
23
|
import x from "../static/styles/variables.css.js";
|
|
23
|
-
function r(
|
|
24
|
-
return `--guido-icon-${
|
|
24
|
+
function r(S, o) {
|
|
25
|
+
return `--guido-icon-${S}: url("data:image/svg+xml,${encodeURIComponent(o.trim())}");`;
|
|
25
26
|
}
|
|
26
|
-
const
|
|
27
|
-
${r("line-change",
|
|
28
|
-
${r("line-delete",
|
|
29
|
-
${r("line-plus",
|
|
30
|
-
}`,
|
|
27
|
+
const M = `:host {
|
|
28
|
+
${r("line-change", p)}
|
|
29
|
+
${r("line-delete", s)}
|
|
30
|
+
${r("line-plus", a)}
|
|
31
|
+
}`, O = [
|
|
31
32
|
x,
|
|
32
33
|
// Must be on top
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
M,
|
|
35
|
+
f,
|
|
35
36
|
// Must be on top
|
|
36
|
-
s,
|
|
37
37
|
C,
|
|
38
|
-
a,
|
|
39
|
-
f,
|
|
40
38
|
c,
|
|
41
|
-
u,
|
|
42
39
|
l,
|
|
43
40
|
d,
|
|
41
|
+
u,
|
|
44
42
|
h,
|
|
45
43
|
g,
|
|
46
|
-
|
|
44
|
+
w,
|
|
47
45
|
y,
|
|
48
|
-
|
|
46
|
+
I,
|
|
47
|
+
A,
|
|
49
48
|
B,
|
|
49
|
+
D,
|
|
50
50
|
$,
|
|
51
51
|
P,
|
|
52
|
-
|
|
52
|
+
R,
|
|
53
|
+
T,
|
|
54
|
+
b
|
|
53
55
|
// Last: overrides button.css / wide-panel.css defaults
|
|
54
56
|
].join(`
|
|
55
57
|
|
|
56
|
-
`),
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
const m =
|
|
63
|
-
|
|
58
|
+
`), V = 3e4;
|
|
59
|
+
let e = null;
|
|
60
|
+
function W() {
|
|
61
|
+
return e || (e = new CSSStyleSheet(), e.replaceSync(O)), e;
|
|
62
|
+
}
|
|
63
|
+
const So = () => ({ importCss: () => {
|
|
64
|
+
const o = W(), i = Date.now() + V, m = () => {
|
|
65
|
+
var n;
|
|
66
|
+
const t = (n = document.querySelector("ui-editor")) == null ? void 0 : n.shadowRoot;
|
|
67
|
+
if (t) {
|
|
68
|
+
t.adoptedStyleSheets.includes(o) || (t.adoptedStyleSheets = [...t.adoptedStyleSheets, o]);
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
Date.now() < i && requestAnimationFrame(m);
|
|
72
|
+
};
|
|
73
|
+
m();
|
|
64
74
|
} });
|
|
65
75
|
export {
|
|
66
|
-
|
|
76
|
+
So as useCustomInterfaceAppearance
|
|
67
77
|
};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { getRecommendationFeedSourceMaps as y, URLS as I } from "../enums/extensions/recommendationBlock.js";
|
|
2
2
|
import { MinDeviceViewport as C, DefaultPadding as R } from "../enums/recommendation.js";
|
|
3
|
-
import { useRecommendationExtensionStore as
|
|
3
|
+
import { useRecommendationExtensionStore as g } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
4
4
|
import { generateCompleteFilterQuery as b } from "../extensions/Blocks/Recommendation/utils/filterUtil.js";
|
|
5
5
|
import { getPartnerRecommendationParams as h } from "../extensions/Blocks/Recommendation/utils/partnerCustomizations.js";
|
|
6
6
|
import { sanitizeProductIds as x } from "../extensions/Blocks/Recommendation/utils/productIds.js";
|
|
7
7
|
import { useConfigStore as P } from "../stores/config.js";
|
|
8
8
|
const B = () => ({
|
|
9
9
|
calculateCardWidth: ({
|
|
10
|
-
mobileLeftPadding:
|
|
10
|
+
mobileLeftPadding: s,
|
|
11
11
|
mobileRightPadding: c,
|
|
12
|
-
cardsInRow:
|
|
13
|
-
unresponsive:
|
|
12
|
+
cardsInRow: o,
|
|
13
|
+
unresponsive: a
|
|
14
14
|
}) => {
|
|
15
|
-
const
|
|
16
|
-
return (C - e) /
|
|
15
|
+
const i = a ? o : 1, e = s + c + (i - 1) * R;
|
|
16
|
+
return (C - e) / i;
|
|
17
17
|
},
|
|
18
|
-
getRecommendationCampaignData: (
|
|
19
|
-
const c =
|
|
20
|
-
if (!
|
|
18
|
+
getRecommendationCampaignData: (s) => {
|
|
19
|
+
const c = g(), o = Number(s), a = c.blockStates[o];
|
|
20
|
+
if (!a)
|
|
21
21
|
return {
|
|
22
22
|
textTrimming: !1,
|
|
23
23
|
orientation: "vertical",
|
|
@@ -30,57 +30,59 @@ const B = () => ({
|
|
|
30
30
|
discountBeforeTextValue: "",
|
|
31
31
|
discountAfterTextValue: ""
|
|
32
32
|
};
|
|
33
|
-
const { recommendationConfigs:
|
|
33
|
+
const { recommendationConfigs: i } = a, e = i.orientation === "grid" ? "vertical" : "horizontal";
|
|
34
34
|
return {
|
|
35
|
-
textTrimming:
|
|
35
|
+
textTrimming: i.textTrimming,
|
|
36
36
|
orientation: e,
|
|
37
37
|
mobileLeftPadding: 0,
|
|
38
38
|
mobileRightPadding: 0,
|
|
39
|
-
cardsInRow:
|
|
40
|
-
unresponsive:
|
|
39
|
+
cardsInRow: i.cardsInRow,
|
|
40
|
+
unresponsive: i.unresponsive,
|
|
41
41
|
priceBeforeTextValue: "",
|
|
42
42
|
priceAfterTextValue: "",
|
|
43
43
|
discountBeforeTextValue: "",
|
|
44
44
|
discountAfterTextValue: ""
|
|
45
45
|
};
|
|
46
46
|
},
|
|
47
|
-
buildCampaignUrl: (
|
|
47
|
+
buildCampaignUrl: (s, c) => {
|
|
48
48
|
var l;
|
|
49
|
-
const
|
|
49
|
+
const o = g(), a = P(), i = Number(s);
|
|
50
50
|
let e;
|
|
51
51
|
if (c)
|
|
52
52
|
e = c;
|
|
53
53
|
else {
|
|
54
|
-
const
|
|
55
|
-
if (!
|
|
54
|
+
const r = o.blockStates[i];
|
|
55
|
+
if (!r)
|
|
56
56
|
return "";
|
|
57
|
-
const { recommendationConfigs:
|
|
57
|
+
const { recommendationConfigs: n } = r;
|
|
58
58
|
e = {
|
|
59
|
-
strategy:
|
|
60
|
-
strategyId:
|
|
61
|
-
language:
|
|
62
|
-
currencyCode:
|
|
63
|
-
size:
|
|
64
|
-
productIds:
|
|
65
|
-
filters:
|
|
66
|
-
shuffleProducts:
|
|
59
|
+
strategy: n.strategy,
|
|
60
|
+
strategyId: n.strategyId,
|
|
61
|
+
language: n.language,
|
|
62
|
+
currencyCode: n.currencySettings.value,
|
|
63
|
+
size: n.size,
|
|
64
|
+
productIds: n.productIds,
|
|
65
|
+
filters: n.filters,
|
|
66
|
+
shuffleProducts: n.shuffleProducts
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
|
-
if (e.strategyId &&
|
|
70
|
-
return
|
|
69
|
+
if (e.strategyId && a.isFeatureEnabled("reusableRecommendationStrategy"))
|
|
70
|
+
return o.recommendationCampaignUrls[s] = {
|
|
71
71
|
strategyId: e.strategyId,
|
|
72
72
|
locale: e.language,
|
|
73
73
|
currency: e.currencyCode
|
|
74
74
|
}, "";
|
|
75
|
-
const d = ((l = y().find((
|
|
76
|
-
if (!d)
|
|
77
|
-
|
|
75
|
+
const d = ((l = y().find((r) => r.key === e.strategy)) == null ? void 0 : l.path) || "";
|
|
76
|
+
if (!d) {
|
|
77
|
+
const r = { ...o.recommendationCampaignUrls };
|
|
78
|
+
return delete r[s], o.recommendationCampaignUrls = r, "";
|
|
79
|
+
}
|
|
78
80
|
const t = new URLSearchParams();
|
|
79
|
-
t.set("locale", e.language), t.set("currency", e.currencyCode), t.set("partnerName",
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
const p = decodeURIComponent(t.toString()),
|
|
83
|
-
return
|
|
81
|
+
t.set("locale", e.language), t.set("currency", e.currencyCode), t.set("partnerName", a.partnerName), t.set("size", e.size), t.set("details", "true"), t.set("campaignId", a.variationId), e.strategy === "manualMerchandising" ? t.set("productId", x(e.productIds)) : e.strategy === "similarViewed" && t.set("productId", "{itemId}"), e.strategy === "userBased" && t.set("userId", "{user_id}");
|
|
82
|
+
const f = e.filters.filter((r) => r.isValid), m = b(f);
|
|
83
|
+
m && t.set("filter", m), e.shuffleProducts && t.set("shuffle", "true"), Object.entries(h(a.partnerName, e.strategy)).forEach(([r, n]) => t.set(r, n));
|
|
84
|
+
const p = decodeURIComponent(t.toString()), u = `${I.RECOMMENDATION_API_URL}/v2/${d}?${p}`;
|
|
85
|
+
return o.recommendationCampaignUrls[s] = u, u;
|
|
84
86
|
}
|
|
85
87
|
});
|
|
86
88
|
export {
|