@useinsider/guido 3.18.1-beta.cb31236 → 3.18.1-beta.d0bc5f3
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 +51 -59
- package/dist/components/Guido.vue.js +4 -4
- package/dist/components/Guido.vue2.js +70 -72
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +9 -7
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +76 -87
- package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue2.js +22 -24
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +26 -28
- package/dist/composables/useCustomInterfaceAppearance.js +42 -46
- package/dist/enums/extensions/recommendationBlock.js +29 -25
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +71 -72
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +37 -68
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +44 -45
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +119 -105
- package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +7 -7
- package/dist/guido.css +1 -1
- package/dist/services/recommendationApi.js +84 -93
- 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 +2 -3
- package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +0 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +0 -4
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +45 -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 +0 -421
- package/dist/static/styles/components/recommendation-strategy.css.js +41 -74
- package/dist/stores/config.js +60 -74
- package/dist/stores/onboarding.js +1 -6
- package/package.json +1 -1
- package/dist/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js +0 -18
- package/dist/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue2.js +0 -25
- package/dist/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue.js +0 -21
- package/dist/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue2.js +0 -46
- package/dist/composables/useLegacyStrategyConversion.js +0 -58
- 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/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
|
@@ -1,73 +1,48 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as E, defineAsyncComponent as u, ref as f, computed as c, watch as O } from "vue";
|
|
2
2
|
import "@useinsider/design-system-organisms/style";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
const st = /* @__PURE__ */ h({
|
|
3
|
+
import { useToaster as h } from "../../../../composables/useToaster.js";
|
|
4
|
+
import { useTranslations as A } from "../../../../composables/useTranslations.js";
|
|
5
|
+
import { DOTTED_DATE_LOCALE as I } from "../../../../enums/date.js";
|
|
6
|
+
import { URLS as C } from "../../../../enums/extensions/recommendationBlock.js";
|
|
7
|
+
import { ToasterTypeOptions as d } from "../../../../enums/toaster.js";
|
|
8
|
+
import { useRecommendationExtensionStore as B } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
9
|
+
import b from "./StrategyInfoBoxContent.vue.js";
|
|
10
|
+
import { formatShortDate as N } from "../../../../utils/dateUtil.js";
|
|
11
|
+
import { asText as S } from "../../../../utils/genericUtil.js";
|
|
12
|
+
import { escapeHtml as k } from "../../../../utils/htmlEscape.js";
|
|
13
|
+
import { InSkeleton as P } from "@useinsider/design-system-vue";
|
|
14
|
+
const Y = /* @__PURE__ */ E({
|
|
16
15
|
__name: "AssignStrategyDrawer",
|
|
17
|
-
setup(
|
|
18
|
-
const
|
|
19
|
-
render: (
|
|
20
|
-
}),
|
|
21
|
-
loader: async () => (await
|
|
22
|
-
loadingComponent:
|
|
16
|
+
setup(R) {
|
|
17
|
+
const g = () => import("@useinsider/design-system-organisms"), m = (t, e) => ({
|
|
18
|
+
render: (a) => a(P, { props: { sizing: { width: t, height: e } } })
|
|
19
|
+
}), T = u({
|
|
20
|
+
loader: async () => (await g()).OrgStrategyDetailModal,
|
|
21
|
+
loadingComponent: m(480, 240),
|
|
23
22
|
delay: 0
|
|
24
|
-
}),
|
|
25
|
-
loader: async () => (await
|
|
26
|
-
loadingComponent:
|
|
23
|
+
}), _ = u({
|
|
24
|
+
loader: async () => (await g()).OrgStrategyDropdown,
|
|
25
|
+
loadingComponent: m(240, 42),
|
|
27
26
|
delay: 0
|
|
28
|
-
}),
|
|
29
|
-
|
|
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) => {
|
|
30
29
|
if (!t)
|
|
31
30
|
return;
|
|
32
|
-
const { strategyId:
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
type:
|
|
36
|
-
message:
|
|
31
|
+
const { strategyId: e } = r.recommendationConfigs;
|
|
32
|
+
i.value = e || null, l.value = !1, r.fetchStrategies().catch(() => {
|
|
33
|
+
n({
|
|
34
|
+
type: d.Error,
|
|
35
|
+
message: s("discovery-strategy.error-description")
|
|
37
36
|
});
|
|
38
37
|
});
|
|
39
38
|
});
|
|
40
|
-
const
|
|
41
|
-
const
|
|
42
|
-
if (!
|
|
39
|
+
const p = (t) => {
|
|
40
|
+
const e = S(t.updated_at || t.created_at);
|
|
41
|
+
if (!e)
|
|
43
42
|
return "";
|
|
44
|
-
const
|
|
45
|
-
return
|
|
46
|
-
},
|
|
47
|
-
text: r("ds-steps.legacy-strategy"),
|
|
48
|
-
value: y,
|
|
49
|
-
infoBoxProps: {
|
|
50
|
-
id: "strategy-info-legacy",
|
|
51
|
-
theme: "light",
|
|
52
|
-
variant: "information",
|
|
53
|
-
className: "assign-strategy-info-box",
|
|
54
|
-
titleText: x(r("ds-steps.legacy-strategy")),
|
|
55
|
-
descriptionStatus: !0,
|
|
56
|
-
descriptionText: r("statistics.legacy-strategy-description"),
|
|
57
|
-
buttonOptions: [{
|
|
58
|
-
id: d,
|
|
59
|
-
type: "primary",
|
|
60
|
-
text: r("ds-steps.update"),
|
|
61
|
-
loadingStatus: e.legacyConversionLoading,
|
|
62
|
-
disabledStatus: e.legacyConversionLoading
|
|
63
|
-
}]
|
|
64
|
-
}
|
|
65
|
-
})), E = async (t) => {
|
|
66
|
-
if ((t == null ? void 0 : t.id) !== d)
|
|
67
|
-
return;
|
|
68
|
-
const a = await u();
|
|
69
|
-
a && (o.value = a);
|
|
70
|
-
}, m = s(() => e.strategies.map((t) => ({
|
|
43
|
+
const a = N(e, I);
|
|
44
|
+
return s("recommendation-strategy.last-updated-on", { value: a });
|
|
45
|
+
}, w = c(() => r.strategies.map((t) => ({
|
|
71
46
|
text: t.name,
|
|
72
47
|
value: t.strategy_id,
|
|
73
48
|
infoBoxProps: {
|
|
@@ -75,57 +50,71 @@ const st = /* @__PURE__ */ h({
|
|
|
75
50
|
theme: "light",
|
|
76
51
|
variant: "information",
|
|
77
52
|
className: "assign-strategy-info-box",
|
|
78
|
-
titleText:
|
|
53
|
+
titleText: k(S(t.name)),
|
|
79
54
|
descriptionStatus: !0,
|
|
80
|
-
descriptionText:
|
|
81
|
-
slot:
|
|
82
|
-
slotProps: { strategy: t }
|
|
55
|
+
descriptionText: p(t),
|
|
56
|
+
slot: b,
|
|
57
|
+
slotProps: { strategy: t },
|
|
58
|
+
// The info box drops the option's value/text, so the id is the only channel
|
|
59
|
+
// that can carry the strategy back to the click handler.
|
|
60
|
+
buttonOptions: [{
|
|
61
|
+
id: `${o}${t.strategy_id}`,
|
|
62
|
+
text: s("eureka.edit-strategy"),
|
|
63
|
+
type: "text",
|
|
64
|
+
// Resolved from Guido's own public/sprite.svg by InIcons; an unknown name would
|
|
65
|
+
// silently render blank space instead of failing.
|
|
66
|
+
icon: "line-open-website"
|
|
67
|
+
}]
|
|
83
68
|
}
|
|
84
|
-
}))),
|
|
85
|
-
|
|
69
|
+
}))), v = (t) => {
|
|
70
|
+
var a;
|
|
71
|
+
const e = (a = t == null ? void 0 : t.id) != null && a.startsWith(o) ? t.id.slice(o.length) : "";
|
|
72
|
+
e && r.openStrategyEdit(e);
|
|
73
|
+
}, y = c(() => {
|
|
74
|
+
const t = r.strategies.find((e) => String(e.strategy_id) === String(i.value ?? ""));
|
|
86
75
|
return t ? { ...t, fallback_config: null } : null;
|
|
87
|
-
}),
|
|
76
|
+
}), x = c(() => ({
|
|
88
77
|
primaryButton: {
|
|
89
78
|
styling: "solid",
|
|
90
79
|
type: "primary",
|
|
91
|
-
labelText:
|
|
80
|
+
labelText: s("products.assign-btn")
|
|
92
81
|
},
|
|
93
82
|
cancelOrBackButton: {
|
|
94
83
|
styling: "ghost",
|
|
95
84
|
type: "secondary",
|
|
96
|
-
labelText:
|
|
85
|
+
labelText: s("products.cancel")
|
|
97
86
|
}
|
|
98
87
|
}));
|
|
99
|
-
return { __sfc: !0, loadOrganisms:
|
|
100
|
-
|
|
88
|
+
return { __sfc: !0, loadOrganisms: g, skeleton: m, OrgStrategyDetailModal: T, OrgStrategyDropdown: _, EDIT_BUTTON_ID_PREFIX: o, trans: s, store: r, showToaster: n, selectedStrategyId: i, showSelectionError: l, drawerDescription: D, lastUpdatedText: p, strategyOptions: w, onInfoBoxButtonClick: v, selectedStrategy: y, footerButtonGroupOptions: x, closeDrawer: () => {
|
|
89
|
+
r.closeAssignStrategyDrawer();
|
|
101
90
|
}, assignStrategy: async () => {
|
|
102
|
-
const t =
|
|
91
|
+
const t = y.value;
|
|
103
92
|
if (!t) {
|
|
104
|
-
|
|
93
|
+
l.value = !0;
|
|
105
94
|
return;
|
|
106
95
|
}
|
|
107
|
-
let
|
|
96
|
+
let e = "";
|
|
108
97
|
try {
|
|
109
|
-
|
|
110
|
-
} catch (
|
|
111
|
-
console.error("[AssignStrategyDrawer] resolveStrategyUrlTemplate failed",
|
|
98
|
+
e = await r.resolveStrategyUrlTemplate(t, r.recommendationConfigs.currencySettings.value);
|
|
99
|
+
} catch (a) {
|
|
100
|
+
console.error("[AssignStrategyDrawer] resolveStrategyUrlTemplate failed", a);
|
|
112
101
|
}
|
|
113
|
-
if (!
|
|
114
|
-
|
|
115
|
-
type:
|
|
116
|
-
message:
|
|
102
|
+
if (!e) {
|
|
103
|
+
n({
|
|
104
|
+
type: d.Error,
|
|
105
|
+
message: s("email-editor.strategy-assign-failed", { strategyName: t.name })
|
|
117
106
|
});
|
|
118
107
|
return;
|
|
119
108
|
}
|
|
120
|
-
|
|
121
|
-
type:
|
|
122
|
-
message:
|
|
123
|
-
}),
|
|
109
|
+
r.assignStrategy(t), n({
|
|
110
|
+
type: d.Success,
|
|
111
|
+
message: s("email-editor.strategy-assigned-success", { strategyName: t.name })
|
|
112
|
+
}), r.closeAssignStrategyDrawer();
|
|
124
113
|
}, onSelect: (t) => {
|
|
125
|
-
|
|
114
|
+
i.value = t.value, l.value = !1;
|
|
126
115
|
} };
|
|
127
116
|
}
|
|
128
117
|
});
|
|
129
118
|
export {
|
|
130
|
-
|
|
119
|
+
Y as default
|
|
131
120
|
};
|
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { useToaster as
|
|
1
|
+
import { defineComponent as u, computed as n } from "vue";
|
|
2
|
+
import y from "../../../wrappers/WpModal.vue.js";
|
|
3
|
+
import { useToaster as f } from "../../../../composables/useToaster.js";
|
|
4
4
|
import { useTranslations as _ } from "../../../../composables/useTranslations.js";
|
|
5
|
-
import { ToasterTypeOptions as
|
|
6
|
-
import "../../../../extensions/Blocks/Recommendation/
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
import { escapeHtml as S } from "../../../../utils/htmlEscape.js";
|
|
11
|
-
const w = /* @__PURE__ */ y({
|
|
5
|
+
import { ToasterTypeOptions as v } from "../../../../enums/toaster.js";
|
|
6
|
+
import { useRecommendationExtensionStore as T } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
7
|
+
import { commitBlockChangeOutsidePanel as h } from "../../../../extensions/Blocks/Recommendation/utils/nodeConfigWriter.js";
|
|
8
|
+
import { escapeHtml as R } from "../../../../utils/htmlEscape.js";
|
|
9
|
+
const P = /* @__PURE__ */ u({
|
|
12
10
|
__name: "RemoveStrategyModal",
|
|
13
|
-
setup(
|
|
14
|
-
const t = _(), e =
|
|
11
|
+
setup(S) {
|
|
12
|
+
const t = _(), e = T(), { showToaster: a } = f(), i = n(() => ({
|
|
15
13
|
cancelOrBackButton: {
|
|
16
14
|
type: "secondary",
|
|
17
15
|
labelText: t("products.cancel"),
|
|
@@ -22,38 +20,38 @@ const w = /* @__PURE__ */ y({
|
|
|
22
20
|
labelText: t("discovery-strategy.remove")
|
|
23
21
|
}
|
|
24
22
|
})), m = n(() => {
|
|
25
|
-
var
|
|
26
|
-
const { strategyId:
|
|
27
|
-
return
|
|
23
|
+
var o;
|
|
24
|
+
const { strategyId: r } = e.recommendationConfigs;
|
|
25
|
+
return ((o = e.assignedStrategy) == null ? void 0 : o.name) || `#${r}`;
|
|
28
26
|
}), s = "__STRATEGY_NAME__", d = n(() => t("email-editor.remove-strategy-confirm-message", { strategyName: s }).split(s)), c = () => {
|
|
29
27
|
e.closeRemoveStrategyModal();
|
|
30
28
|
};
|
|
31
29
|
return { __sfc: !0, trans: t, store: e, showToaster: a, footerButtonOptions: i, strategyName: m, NAME_TOKEN: s, messageParts: d, close: c, handleConfirm: async () => {
|
|
32
|
-
const
|
|
30
|
+
const r = m.value, o = e.currentRecommendationId;
|
|
33
31
|
e.removeStrategy(), c();
|
|
34
32
|
const { strategyId: l, size: g } = e.recommendationConfigs;
|
|
35
33
|
if (a({
|
|
36
|
-
type:
|
|
34
|
+
type: v.Success,
|
|
37
35
|
// The toast renders through a sanitizing v-html, so the name is escaped first.
|
|
38
36
|
message: t("email-editor.strategy-removed-success", {
|
|
39
|
-
strategyName: `<b>${
|
|
37
|
+
strategyName: `<b>${R(r)}</b>`
|
|
40
38
|
})
|
|
41
|
-
}),
|
|
39
|
+
}), o !== null) {
|
|
42
40
|
try {
|
|
43
41
|
await e.fetchRecommendationProducts();
|
|
44
42
|
} catch (p) {
|
|
45
43
|
console.error("[RemoveStrategyModal] product refetch failed", p);
|
|
46
44
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
{ strategyId: l, size: g
|
|
45
|
+
h(
|
|
46
|
+
o,
|
|
47
|
+
{ strategyId: l, size: g },
|
|
50
48
|
e.recommendationProducts,
|
|
51
49
|
"Removed recommendation strategy"
|
|
52
50
|
);
|
|
53
51
|
}
|
|
54
|
-
}, WpModal:
|
|
52
|
+
}, WpModal: y };
|
|
55
53
|
}
|
|
56
54
|
});
|
|
57
55
|
export {
|
|
58
|
-
|
|
56
|
+
P as default
|
|
59
57
|
};
|
|
@@ -1,30 +1,28 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import h from "./
|
|
8
|
-
import w from "./
|
|
9
|
-
import P from "
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
const U = /* @__PURE__ */ f({
|
|
1
|
+
import { defineComponent as b, computed as e, onMounted as O, watch as t } from "vue";
|
|
2
|
+
import u from "./AMPOnboarding.vue.js";
|
|
3
|
+
import v from "./GenericOnboarding.vue.js";
|
|
4
|
+
import y from "./ItemsOnboarding.vue.js";
|
|
5
|
+
import l from "./NewVersionPopup.vue.js";
|
|
6
|
+
import S from "./RecommendationStrategyOnboarding.vue.js";
|
|
7
|
+
import h from "./TextBlockOnboarding.vue.js";
|
|
8
|
+
import w from "./VersionHistoryOnboarding.vue.js";
|
|
9
|
+
import { usePartner as P } from "../../../composables/usePartner.js";
|
|
10
|
+
import { useEditorStore as _ } from "../../../stores/editor.js";
|
|
11
|
+
import { useOnboardingStore as A } from "../../../stores/onboarding.js";
|
|
12
|
+
import { usePreviewStore as H } from "../../../stores/preview.js";
|
|
13
|
+
const N = /* @__PURE__ */ b({
|
|
15
14
|
__name: "OnboardingWrapper",
|
|
16
15
|
emits: ["onboarding-finished"],
|
|
17
|
-
setup(
|
|
18
|
-
const o =
|
|
19
|
-
{ type: "newVersionPopup", component:
|
|
20
|
-
{ type: "genericOnboarding", component:
|
|
21
|
-
{ type: "textBlockOnboarding", component:
|
|
22
|
-
{ type: "versionHistoryOnboarding", component:
|
|
23
|
-
{ type: "ampOnboarding", component:
|
|
24
|
-
{ type: "itemsOnboarding", component:
|
|
25
|
-
{ type: "recommendationStrategyOnboarding", component:
|
|
26
|
-
|
|
27
|
-
], c = (n) => p.value || !m.value ? !1 : n === "newVersionPopup" ? o.shouldShowOnboarding(n) : o.isActive(n), b = e(() => d.filter((n) => c(n.type)));
|
|
16
|
+
setup(M, { emit: g }) {
|
|
17
|
+
const o = A(), r = _(), s = H(), { isTestPartner: a } = P(), m = e(() => r.isStripoInitialized), p = e(() => a()), d = [
|
|
18
|
+
{ type: "newVersionPopup", component: l },
|
|
19
|
+
{ type: "genericOnboarding", component: v },
|
|
20
|
+
{ type: "textBlockOnboarding", component: h },
|
|
21
|
+
{ type: "versionHistoryOnboarding", component: w },
|
|
22
|
+
{ type: "ampOnboarding", component: u },
|
|
23
|
+
{ type: "itemsOnboarding", component: y },
|
|
24
|
+
{ type: "recommendationStrategyOnboarding", component: S }
|
|
25
|
+
], c = (n) => p.value || !m.value ? !1 : n === "newVersionPopup" ? o.shouldShowOnboarding(n) : o.isActive(n), f = e(() => d.filter((n) => c(n.type)));
|
|
28
26
|
return O(async () => {
|
|
29
27
|
await o.fetchUserModalState();
|
|
30
28
|
}), t(
|
|
@@ -33,7 +31,7 @@ const U = /* @__PURE__ */ f({
|
|
|
33
31
|
n && !i && o.shouldShowOnboarding("versionHistoryOnboarding") && o.start("versionHistoryOnboarding"), !n && i && o.isActive("versionHistoryOnboarding") && o.close("versionHistoryOnboarding");
|
|
34
32
|
}
|
|
35
33
|
), t(
|
|
36
|
-
() =>
|
|
34
|
+
() => s.emailFormat,
|
|
37
35
|
(n, i) => {
|
|
38
36
|
i !== "AMP" && n === "AMP" && o.shouldShowOnboarding("ampOnboarding") && o.start("ampOnboarding");
|
|
39
37
|
}
|
|
@@ -42,9 +40,9 @@ const U = /* @__PURE__ */ f({
|
|
|
42
40
|
(n) => {
|
|
43
41
|
!n && o.isActive("ampOnboarding") && o.close("ampOnboarding");
|
|
44
42
|
}
|
|
45
|
-
), { __sfc: !0, emit: g, onboardingStore: o, editorStore: r, previewStore:
|
|
43
|
+
), { __sfc: !0, emit: g, onboardingStore: o, editorStore: r, previewStore: s, isTestPartner: a, isStripoReady: m, isTestPartnerActive: p, onboardingConfigs: d, shouldShow: c, visibleOnboardings: f };
|
|
46
44
|
}
|
|
47
45
|
});
|
|
48
46
|
export {
|
|
49
|
-
|
|
47
|
+
N as default
|
|
50
48
|
};
|
|
@@ -1,71 +1,67 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import p from "../static/
|
|
5
|
-
import s from "../static/
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import c from "../static/styles/components/
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import d from "../static/styles/components/
|
|
13
|
-
import I from "../static/styles/components/counter.css.js";
|
|
14
|
-
import g from "../static/styles/components/dropdown-menu.css.js";
|
|
1
|
+
import S from "../static/assets/icons/line-change.svg.js";
|
|
2
|
+
import i from "../static/assets/icons/line-delete.svg.js";
|
|
3
|
+
import n from "../static/assets/icons/line-plus.svg.js";
|
|
4
|
+
import p from "../static/styles/base.css.js";
|
|
5
|
+
import s from "../static/styles/components/alert-message.css.js";
|
|
6
|
+
import C from "../static/styles/components/amp-block.css.js";
|
|
7
|
+
import a from "../static/styles/components/base-input.css.js";
|
|
8
|
+
import f from "../static/styles/components/button-group.css.js";
|
|
9
|
+
import c from "../static/styles/components/button.css.js";
|
|
10
|
+
import u from "../static/styles/components/combobox.css.js";
|
|
11
|
+
import l from "../static/styles/components/counter.css.js";
|
|
12
|
+
import d from "../static/styles/components/dropdown-menu.css.js";
|
|
15
13
|
import h from "../static/styles/components/loader.css.js";
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
14
|
+
import g from "../static/styles/components/narrow-panel.css.js";
|
|
15
|
+
import I from "../static/styles/components/popup.css.js";
|
|
16
|
+
import w from "../static/styles/components/recommendation-strategy.css.js";
|
|
17
|
+
import y from "../static/styles/components/switcher.css.js";
|
|
18
|
+
import b from "../static/styles/components/tabs.css.js";
|
|
19
|
+
import B from "../static/styles/components/tools.css.js";
|
|
20
|
+
import $ from "../static/styles/components/version-history.css.js";
|
|
21
|
+
import P from "../static/styles/components/wide-panel.css.js";
|
|
24
22
|
import x from "../static/styles/variables.css.js";
|
|
25
|
-
function
|
|
26
|
-
return `--guido-icon-${t}: url("data:image/svg+xml,${encodeURIComponent(
|
|
23
|
+
function r(t, o) {
|
|
24
|
+
return `--guido-icon-${t}: url("data:image/svg+xml,${encodeURIComponent(o.trim())}");`;
|
|
27
25
|
}
|
|
28
|
-
const
|
|
29
|
-
${
|
|
30
|
-
${
|
|
31
|
-
${
|
|
32
|
-
|
|
33
|
-
${o("line-plus", s)}
|
|
34
|
-
}`, D = [
|
|
26
|
+
const A = `:host {
|
|
27
|
+
${r("line-change", S)}
|
|
28
|
+
${r("line-delete", i)}
|
|
29
|
+
${r("line-plus", n)}
|
|
30
|
+
}`, R = [
|
|
35
31
|
x,
|
|
36
32
|
// Must be on top
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
A,
|
|
34
|
+
p,
|
|
39
35
|
// Must be on top
|
|
36
|
+
s,
|
|
40
37
|
C,
|
|
41
38
|
a,
|
|
39
|
+
f,
|
|
42
40
|
c,
|
|
43
|
-
l,
|
|
44
41
|
u,
|
|
42
|
+
l,
|
|
45
43
|
d,
|
|
46
|
-
I,
|
|
47
|
-
g,
|
|
48
44
|
h,
|
|
49
|
-
|
|
50
|
-
|
|
45
|
+
g,
|
|
46
|
+
I,
|
|
47
|
+
y,
|
|
51
48
|
b,
|
|
52
49
|
B,
|
|
53
|
-
|
|
50
|
+
$,
|
|
54
51
|
P,
|
|
55
|
-
|
|
56
|
-
y
|
|
52
|
+
w
|
|
57
53
|
// Last: overrides button.css / wide-panel.css defaults
|
|
58
54
|
].join(`
|
|
59
55
|
|
|
60
|
-
`),
|
|
61
|
-
const
|
|
62
|
-
|
|
56
|
+
`), Y = () => ({ importCss: () => {
|
|
57
|
+
const o = new CSSStyleSheet();
|
|
58
|
+
o.replaceSync(R);
|
|
63
59
|
const e = document.querySelector("ui-editor");
|
|
64
60
|
if (!e)
|
|
65
61
|
return;
|
|
66
62
|
const m = e.shadowRoot;
|
|
67
|
-
m && (m.adoptedStyleSheets = [
|
|
63
|
+
m && (m.adoptedStyleSheets = [o]);
|
|
68
64
|
} });
|
|
69
65
|
export {
|
|
70
|
-
|
|
66
|
+
Y as useCustomInterfaceAppearance
|
|
71
67
|
};
|
|
@@ -1,15 +1,20 @@
|
|
|
1
|
-
import { useTranslations as
|
|
2
|
-
const
|
|
1
|
+
import { useTranslations as n } from "../../composables/useTranslations.js";
|
|
2
|
+
const o = {
|
|
3
3
|
RECOMMENDATION_API_URL: "https://recommendationv2.api.useinsider.com",
|
|
4
4
|
// Relative path → same-origin as the embedding inone dashboard.
|
|
5
5
|
PRODUCT_ATTRIBUTES_PATH: "/product-attributes/get-attributes",
|
|
6
6
|
RECOMMENDATION_STRATEGIES_PATH: "/api/recommendation-strategies",
|
|
7
7
|
RECOMMENDATION_STRATEGIES_PANEL_PATH: "/discovery/recommendation-strategies",
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
// Smart Recommender hides the Email channel unless the URL asks for it, so a strategy created
|
|
9
|
+
// without this flag can never be Email-suitable and would never reach the editor's list.
|
|
10
|
+
RECOMMENDATION_STRATEGY_CREATE_PATH: "/discovery/recommendation-strategies/create?isEmail=true"
|
|
11
|
+
}, d = (e) => {
|
|
12
|
+
const { RECOMMENDATION_STRATEGIES_PANEL_PATH: r } = o;
|
|
13
|
+
return `${r}/${e}/edit`;
|
|
14
|
+
}, m = {
|
|
10
15
|
CLIENT_ID: "clientId"
|
|
11
16
|
}, p = () => {
|
|
12
|
-
const e =
|
|
17
|
+
const e = n();
|
|
13
18
|
return [
|
|
14
19
|
{
|
|
15
20
|
id: 11,
|
|
@@ -79,7 +84,7 @@ const l = {
|
|
|
79
84
|
{ text: "dot(.)", value: "." },
|
|
80
85
|
{ text: "comma(,)", value: "," },
|
|
81
86
|
{ text: "space( )", value: " " }
|
|
82
|
-
],
|
|
87
|
+
], b = [
|
|
83
88
|
{ text: "0", value: "0" },
|
|
84
89
|
{ text: "1", value: "1" },
|
|
85
90
|
{ text: "2", value: "2" },
|
|
@@ -91,56 +96,55 @@ const l = {
|
|
|
91
96
|
{ text: "contains", value: "~" },
|
|
92
97
|
{ text: "does not contain", value: "!~" },
|
|
93
98
|
{ text: "any of", value: a }
|
|
94
|
-
],
|
|
99
|
+
], s = [
|
|
95
100
|
{ text: "is exactly", value: "=" },
|
|
96
101
|
{ text: "is not exactly", value: "!==" },
|
|
97
102
|
{ text: "contains", value: "~" },
|
|
98
103
|
{ text: "does not contain", value: "!~" },
|
|
99
104
|
{ text: "any of", value: a }
|
|
100
|
-
],
|
|
105
|
+
], i = [
|
|
101
106
|
{ text: "is equal to", value: "=" },
|
|
102
107
|
{ text: "is greater than", value: ">" },
|
|
103
108
|
{ text: "is less than", value: "<" }
|
|
104
|
-
],
|
|
109
|
+
], u = [
|
|
105
110
|
{ text: "is equal to", value: "=" },
|
|
106
111
|
{ text: "after", value: ">" },
|
|
107
112
|
{ text: "before", value: "<" }
|
|
108
|
-
],
|
|
113
|
+
], c = [
|
|
109
114
|
{ text: "true", value: "==" },
|
|
110
115
|
{ text: "false", value: "!=" }
|
|
111
|
-
],
|
|
116
|
+
], g = (e) => {
|
|
112
117
|
if (!e)
|
|
113
118
|
return t;
|
|
114
119
|
switch (e) {
|
|
115
120
|
case "Boolean":
|
|
116
|
-
return
|
|
121
|
+
return c;
|
|
117
122
|
case "Date":
|
|
118
|
-
return
|
|
123
|
+
return u;
|
|
119
124
|
case "Number":
|
|
120
|
-
return
|
|
125
|
+
return i;
|
|
121
126
|
case "String":
|
|
122
127
|
return t;
|
|
123
128
|
case "Strings":
|
|
124
|
-
return
|
|
129
|
+
return s;
|
|
125
130
|
default:
|
|
126
131
|
return t;
|
|
127
132
|
}
|
|
128
133
|
};
|
|
129
134
|
export {
|
|
130
|
-
c as MIGRATE_STRATEGIES_SEGMENT,
|
|
131
135
|
a as OP_ANY_OF,
|
|
132
136
|
v as PriceAttributes,
|
|
133
137
|
m as QUERY_PARAMS,
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
E as currencyDecimalCounts,
|
|
138
|
+
o as URLS,
|
|
139
|
+
b as currencyDecimalCounts,
|
|
137
140
|
h as currencyLocationMaps,
|
|
138
141
|
x as currencyOperators,
|
|
139
|
-
|
|
142
|
+
g as getOperatorOptions,
|
|
140
143
|
p as getRecommendationFeedSourceMaps,
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
t as operatorOptionsForStrings
|
|
144
|
+
s as operatorOptionsForArrayOfStrings,
|
|
145
|
+
c as operatorOptionsForBooleans,
|
|
146
|
+
u as operatorOptionsForDates,
|
|
147
|
+
i as operatorOptionsForNumbers,
|
|
148
|
+
t as operatorOptionsForStrings,
|
|
149
|
+
d as strategyEditPath
|
|
146
150
|
};
|