@useinsider/guido 3.18.1-beta.d931f79 → 3.18.1-beta.db1e41e
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 +50 -56
- package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue2.js +37 -23
- package/dist/composables/useCustomInterfaceAppearance.js +20 -22
- package/dist/composables/useRecommendation.js +36 -38
- package/dist/enums/extensions/recommendationBlock.js +5 -5
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +20 -21
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +1 -1
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +1 -1
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +126 -132
- package/dist/guido.css +1 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +0 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +2 -3
- package/dist/static/styles/components/recommendation-strategy.css.js +17 -0
- package/dist/utils/templatePreparation.js +10 -10
- package/package.json +1 -1
- package/dist/extensions/Blocks/Recommendation/utils/strategyDetach.js +0 -19
- package/dist/src/extensions/Blocks/Recommendation/utils/strategyDetach.d.ts +0 -12
- package/dist/static/styles/components/skeleton.css.js +0 -23
|
@@ -1,47 +1,46 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as E, defineAsyncComponent as y, ref as f, computed as c, watch as O } 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
|
|
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
7
|
import { ToasterTypeOptions as m } from "../../../../enums/toaster.js";
|
|
8
|
-
import { useRecommendationExtensionStore as
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
const rt = /* @__PURE__ */ I({
|
|
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 g = () => import("@useinsider/design-system-organisms"), d = (t,
|
|
19
|
-
render: (
|
|
20
|
-
}),
|
|
16
|
+
setup(R) {
|
|
17
|
+
const g = () => import("@useinsider/design-system-organisms"), d = (t, e) => ({
|
|
18
|
+
render: (a) => a(P, { props: { sizing: { width: t, height: e } } })
|
|
19
|
+
}), T = y({
|
|
21
20
|
loader: async () => (await g()).OrgStrategyDetailModal,
|
|
22
21
|
loadingComponent: d(480, 240),
|
|
23
22
|
delay: 0
|
|
24
|
-
}),
|
|
23
|
+
}), _ = y({
|
|
25
24
|
loader: async () => (await g()).OrgStrategyDropdown
|
|
26
|
-
}), n = "guido-edit-strategy-", s =
|
|
27
|
-
|
|
25
|
+
}), n = "guido-edit-strategy-", s = A(), r = B(), { showToaster: i } = h(), o = f(null), l = f(!1), D = c(() => r.assignStrategyDrawerStatus ? s("email-editor.assign-strategy-description", { url: C.RECOMMENDATION_STRATEGIES_PANEL_PATH }) : "");
|
|
26
|
+
O(() => r.assignStrategyDrawerStatus, (t) => {
|
|
28
27
|
if (!t)
|
|
29
28
|
return;
|
|
30
|
-
const { strategyId:
|
|
31
|
-
|
|
29
|
+
const { strategyId: e } = r.recommendationConfigs;
|
|
30
|
+
o.value = e || null, l.value = !1, r.fetchStrategies().catch(() => {
|
|
32
31
|
i({
|
|
33
32
|
type: m.Error,
|
|
34
33
|
message: s("discovery-strategy.error-description")
|
|
35
34
|
});
|
|
36
35
|
});
|
|
37
36
|
});
|
|
38
|
-
const
|
|
39
|
-
const
|
|
40
|
-
if (!
|
|
37
|
+
const p = (t) => {
|
|
38
|
+
const e = S(t.updated_at || t.created_at);
|
|
39
|
+
if (!e)
|
|
41
40
|
return "";
|
|
42
|
-
const
|
|
43
|
-
return s("recommendation-strategy.last-updated-on", { value:
|
|
44
|
-
},
|
|
41
|
+
const a = N(e, I);
|
|
42
|
+
return s("recommendation-strategy.last-updated-on", { value: a });
|
|
43
|
+
}, v = c(() => r.strategies.map((t) => ({
|
|
45
44
|
text: t.name,
|
|
46
45
|
value: t.strategy_id,
|
|
47
46
|
infoBoxProps: {
|
|
@@ -49,10 +48,10 @@ const rt = /* @__PURE__ */ I({
|
|
|
49
48
|
theme: "light",
|
|
50
49
|
variant: "information",
|
|
51
50
|
className: "assign-strategy-info-box",
|
|
52
|
-
titleText:
|
|
51
|
+
titleText: k(S(t.name)),
|
|
53
52
|
descriptionStatus: !0,
|
|
54
|
-
descriptionText:
|
|
55
|
-
slot:
|
|
53
|
+
descriptionText: p(t),
|
|
54
|
+
slot: b,
|
|
56
55
|
slotProps: { strategy: t },
|
|
57
56
|
// The info box drops the option's value/text, so the id is the only channel
|
|
58
57
|
// that can carry the strategy back to the click handler.
|
|
@@ -65,19 +64,14 @@ const rt = /* @__PURE__ */ I({
|
|
|
65
64
|
icon: "line-open-website"
|
|
66
65
|
}]
|
|
67
66
|
}
|
|
68
|
-
}))),
|
|
69
|
-
var
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
const
|
|
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 ?? ""));
|
|
67
|
+
}))), w = (t) => {
|
|
68
|
+
var a;
|
|
69
|
+
const e = (a = t == null ? void 0 : t.id) != null && a.startsWith(n) ? t.id.slice(n.length) : "";
|
|
70
|
+
e && (String(o.value ?? "") === e && (o.value = null), r.recommendationConfigs.strategyId === e && r.removeStrategy(), r.openStrategyEdit(e));
|
|
71
|
+
}, u = c(() => {
|
|
72
|
+
const t = r.strategies.find((e) => String(e.strategy_id) === String(o.value ?? ""));
|
|
79
73
|
return t ? { ...t, fallback_config: null } : null;
|
|
80
|
-
}),
|
|
74
|
+
}), x = c(() => ({
|
|
81
75
|
primaryButton: {
|
|
82
76
|
styling: "solid",
|
|
83
77
|
type: "primary",
|
|
@@ -89,36 +83,36 @@ const rt = /* @__PURE__ */ I({
|
|
|
89
83
|
labelText: s("products.cancel")
|
|
90
84
|
}
|
|
91
85
|
}));
|
|
92
|
-
return { __sfc: !0, loadOrganisms: g, skeleton: d, OrgStrategyDetailModal:
|
|
93
|
-
|
|
86
|
+
return { __sfc: !0, loadOrganisms: g, skeleton: d, OrgStrategyDetailModal: T, OrgStrategyDropdown: _, EDIT_BUTTON_ID_PREFIX: n, trans: s, store: r, showToaster: i, selectedStrategyId: o, showSelectionError: l, drawerDescription: D, lastUpdatedText: p, strategyOptions: v, onInfoBoxButtonClick: w, selectedStrategy: u, footerButtonGroupOptions: x, closeDrawer: () => {
|
|
87
|
+
r.closeAssignStrategyDrawer();
|
|
94
88
|
}, assignStrategy: async () => {
|
|
95
|
-
const t =
|
|
89
|
+
const t = u.value;
|
|
96
90
|
if (!t) {
|
|
97
|
-
|
|
91
|
+
l.value = !0;
|
|
98
92
|
return;
|
|
99
93
|
}
|
|
100
|
-
let
|
|
94
|
+
let e = "";
|
|
101
95
|
try {
|
|
102
|
-
|
|
103
|
-
} catch (
|
|
104
|
-
console.error("[AssignStrategyDrawer] resolveStrategyUrlTemplate failed",
|
|
96
|
+
e = await r.resolveStrategyUrlTemplate(t, r.recommendationConfigs.currencySettings.value);
|
|
97
|
+
} catch (a) {
|
|
98
|
+
console.error("[AssignStrategyDrawer] resolveStrategyUrlTemplate failed", a);
|
|
105
99
|
}
|
|
106
|
-
if (!
|
|
100
|
+
if (!e) {
|
|
107
101
|
i({
|
|
108
102
|
type: m.Error,
|
|
109
103
|
message: s("email-editor.strategy-assign-failed", { strategyName: t.name })
|
|
110
104
|
});
|
|
111
105
|
return;
|
|
112
106
|
}
|
|
113
|
-
|
|
107
|
+
r.assignStrategy(t), i({
|
|
114
108
|
type: m.Success,
|
|
115
109
|
message: s("email-editor.strategy-assigned-success", { strategyName: t.name })
|
|
116
|
-
}),
|
|
110
|
+
}), r.closeAssignStrategyDrawer();
|
|
117
111
|
}, onSelect: (t) => {
|
|
118
|
-
|
|
112
|
+
o.value = t.value, l.value = !1;
|
|
119
113
|
} };
|
|
120
114
|
}
|
|
121
115
|
});
|
|
122
116
|
export {
|
|
123
|
-
|
|
117
|
+
Y as default
|
|
124
118
|
};
|
|
@@ -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 u, computed as n } from "vue";
|
|
2
|
+
import y from "../../../wrappers/WpModal.vue.js";
|
|
3
|
+
import { useToaster as f } from "../../../../composables/useToaster.js";
|
|
4
|
+
import { useTranslations as _ } from "../../../../composables/useTranslations.js";
|
|
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({
|
|
10
10
|
__name: "RemoveStrategyModal",
|
|
11
|
-
setup(
|
|
12
|
-
const t =
|
|
11
|
+
setup(S) {
|
|
12
|
+
const t = _(), e = T(), { showToaster: a } = f(), i = n(() => ({
|
|
13
13
|
cancelOrBackButton: {
|
|
14
14
|
type: "secondary",
|
|
15
15
|
labelText: t("products.cancel"),
|
|
@@ -19,25 +19,39 @@ const C = /* @__PURE__ */ l({
|
|
|
19
19
|
type: "danger",
|
|
20
20
|
labelText: t("discovery-strategy.remove")
|
|
21
21
|
}
|
|
22
|
-
})), m =
|
|
22
|
+
})), m = n(() => {
|
|
23
23
|
var o;
|
|
24
|
-
const { strategyId:
|
|
25
|
-
return ((o = e.assignedStrategy) == null ? void 0 : o.name) || `#${
|
|
26
|
-
}),
|
|
24
|
+
const { strategyId: r } = e.recommendationConfigs;
|
|
25
|
+
return ((o = e.assignedStrategy) == null ? void 0 : o.name) || `#${r}`;
|
|
26
|
+
}), s = "__STRATEGY_NAME__", d = n(() => t("email-editor.remove-strategy-confirm-message", { strategyName: s }).split(s)), c = () => {
|
|
27
27
|
e.closeRemoveStrategyModal();
|
|
28
28
|
};
|
|
29
|
-
return { __sfc: !0, trans: t, store: e, showToaster:
|
|
30
|
-
const
|
|
31
|
-
e.removeStrategy(), c()
|
|
32
|
-
|
|
29
|
+
return { __sfc: !0, trans: t, store: e, showToaster: a, footerButtonOptions: i, strategyName: m, NAME_TOKEN: s, messageParts: d, close: c, handleConfirm: async () => {
|
|
30
|
+
const r = m.value, o = e.currentRecommendationId;
|
|
31
|
+
e.removeStrategy(), c();
|
|
32
|
+
const { strategyId: l, size: g } = e.recommendationConfigs;
|
|
33
|
+
if (a({
|
|
34
|
+
type: v.Success,
|
|
33
35
|
// The toast renders through a sanitizing v-html, so the name is escaped first.
|
|
34
36
|
message: t("email-editor.strategy-removed-success", {
|
|
35
|
-
strategyName: `<b>${
|
|
37
|
+
strategyName: `<b>${R(r)}</b>`
|
|
36
38
|
})
|
|
37
|
-
}), o !== null
|
|
38
|
-
|
|
39
|
+
}), o !== null) {
|
|
40
|
+
try {
|
|
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 };
|
|
39
53
|
}
|
|
40
54
|
});
|
|
41
55
|
export {
|
|
42
|
-
|
|
56
|
+
P as default
|
|
43
57
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import p from "../static/assets/icons/line-change.svg.js";
|
|
2
2
|
import s from "../static/assets/icons/line-delete.svg.js";
|
|
3
3
|
import a from "../static/assets/icons/line-plus.svg.js";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
4
|
+
import c from "../static/styles/base.css.js";
|
|
5
|
+
import f from "../static/styles/components/alert-message.css.js";
|
|
6
|
+
import C from "../static/styles/components/amp-block.css.js";
|
|
7
7
|
import l from "../static/styles/components/base-input.css.js";
|
|
8
8
|
import d from "../static/styles/components/button-group.css.js";
|
|
9
9
|
import u from "../static/styles/components/button.css.js";
|
|
@@ -14,28 +14,27 @@ import y from "../static/styles/components/loader.css.js";
|
|
|
14
14
|
import I from "../static/styles/components/narrow-panel.css.js";
|
|
15
15
|
import A from "../static/styles/components/popup.css.js";
|
|
16
16
|
import b from "../static/styles/components/recommendation-strategy.css.js";
|
|
17
|
-
import B from "../static/styles/components/
|
|
18
|
-
import D from "../static/styles/components/
|
|
19
|
-
import $ from "../static/styles/components/
|
|
20
|
-
import P from "../static/styles/components/
|
|
21
|
-
import R from "../static/styles/components/
|
|
22
|
-
import T from "../static/styles/
|
|
23
|
-
import x from "../static/styles/variables.css.js";
|
|
17
|
+
import B from "../static/styles/components/switcher.css.js";
|
|
18
|
+
import D from "../static/styles/components/tabs.css.js";
|
|
19
|
+
import $ from "../static/styles/components/tools.css.js";
|
|
20
|
+
import P from "../static/styles/components/version-history.css.js";
|
|
21
|
+
import R from "../static/styles/components/wide-panel.css.js";
|
|
22
|
+
import T from "../static/styles/variables.css.js";
|
|
24
23
|
function r(S, o) {
|
|
25
24
|
return `--guido-icon-${S}: url("data:image/svg+xml,${encodeURIComponent(o.trim())}");`;
|
|
26
25
|
}
|
|
27
|
-
const
|
|
26
|
+
const x = `:host {
|
|
28
27
|
${r("line-change", p)}
|
|
29
28
|
${r("line-delete", s)}
|
|
30
29
|
${r("line-plus", a)}
|
|
31
|
-
}`,
|
|
30
|
+
}`, M = [
|
|
31
|
+
T,
|
|
32
|
+
// Must be on top
|
|
32
33
|
x,
|
|
34
|
+
c,
|
|
33
35
|
// Must be on top
|
|
34
|
-
M,
|
|
35
36
|
f,
|
|
36
|
-
// Must be on top
|
|
37
37
|
C,
|
|
38
|
-
c,
|
|
39
38
|
l,
|
|
40
39
|
d,
|
|
41
40
|
u,
|
|
@@ -50,18 +49,17 @@ const M = `:host {
|
|
|
50
49
|
$,
|
|
51
50
|
P,
|
|
52
51
|
R,
|
|
53
|
-
T,
|
|
54
52
|
b
|
|
55
53
|
// Last: overrides button.css / wide-panel.css defaults
|
|
56
54
|
].join(`
|
|
57
55
|
|
|
58
|
-
`),
|
|
56
|
+
`), O = 3e4;
|
|
59
57
|
let e = null;
|
|
60
|
-
function
|
|
61
|
-
return e || (e = new CSSStyleSheet(), e.replaceSync(
|
|
58
|
+
function V() {
|
|
59
|
+
return e || (e = new CSSStyleSheet(), e.replaceSync(M)), e;
|
|
62
60
|
}
|
|
63
|
-
const
|
|
64
|
-
const o =
|
|
61
|
+
const eo = () => ({ importCss: () => {
|
|
62
|
+
const o = V(), i = Date.now() + O, m = () => {
|
|
65
63
|
var n;
|
|
66
64
|
const t = (n = document.querySelector("ui-editor")) == null ? void 0 : n.shadowRoot;
|
|
67
65
|
if (t) {
|
|
@@ -73,5 +71,5 @@ const So = () => ({ importCss: () => {
|
|
|
73
71
|
m();
|
|
74
72
|
} });
|
|
75
73
|
export {
|
|
76
|
-
|
|
74
|
+
eo as useCustomInterfaceAppearance
|
|
77
75
|
};
|
|
@@ -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 f } 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: a,
|
|
11
11
|
mobileRightPadding: c,
|
|
12
|
-
cardsInRow:
|
|
13
|
-
unresponsive:
|
|
12
|
+
cardsInRow: i,
|
|
13
|
+
unresponsive: n
|
|
14
14
|
}) => {
|
|
15
|
-
const
|
|
16
|
-
return (C - e) /
|
|
15
|
+
const o = n ? i : 1, e = a + c + (o - 1) * R;
|
|
16
|
+
return (C - e) / o;
|
|
17
17
|
},
|
|
18
|
-
getRecommendationCampaignData: (
|
|
19
|
-
const c =
|
|
20
|
-
if (!
|
|
18
|
+
getRecommendationCampaignData: (a) => {
|
|
19
|
+
const c = f(), i = Number(a), n = c.blockStates[i];
|
|
20
|
+
if (!n)
|
|
21
21
|
return {
|
|
22
22
|
textTrimming: !1,
|
|
23
23
|
orientation: "vertical",
|
|
@@ -30,59 +30,57 @@ const B = () => ({
|
|
|
30
30
|
discountBeforeTextValue: "",
|
|
31
31
|
discountAfterTextValue: ""
|
|
32
32
|
};
|
|
33
|
-
const { recommendationConfigs:
|
|
33
|
+
const { recommendationConfigs: o } = n, e = o.orientation === "grid" ? "vertical" : "horizontal";
|
|
34
34
|
return {
|
|
35
|
-
textTrimming:
|
|
35
|
+
textTrimming: o.textTrimming,
|
|
36
36
|
orientation: e,
|
|
37
37
|
mobileLeftPadding: 0,
|
|
38
38
|
mobileRightPadding: 0,
|
|
39
|
-
cardsInRow:
|
|
40
|
-
unresponsive:
|
|
39
|
+
cardsInRow: o.cardsInRow,
|
|
40
|
+
unresponsive: o.unresponsive,
|
|
41
41
|
priceBeforeTextValue: "",
|
|
42
42
|
priceAfterTextValue: "",
|
|
43
43
|
discountBeforeTextValue: "",
|
|
44
44
|
discountAfterTextValue: ""
|
|
45
45
|
};
|
|
46
46
|
},
|
|
47
|
-
buildCampaignUrl: (
|
|
47
|
+
buildCampaignUrl: (a, c) => {
|
|
48
48
|
var l;
|
|
49
|
-
const
|
|
49
|
+
const i = f(), n = P(), o = Number(a);
|
|
50
50
|
let e;
|
|
51
51
|
if (c)
|
|
52
52
|
e = c;
|
|
53
53
|
else {
|
|
54
|
-
const
|
|
55
|
-
if (!
|
|
54
|
+
const s = i.blockStates[o];
|
|
55
|
+
if (!s)
|
|
56
56
|
return "";
|
|
57
|
-
const { recommendationConfigs:
|
|
57
|
+
const { recommendationConfigs: r } = s;
|
|
58
58
|
e = {
|
|
59
|
-
strategy:
|
|
60
|
-
strategyId:
|
|
61
|
-
language:
|
|
62
|
-
currencyCode:
|
|
63
|
-
size:
|
|
64
|
-
productIds:
|
|
65
|
-
filters:
|
|
66
|
-
shuffleProducts:
|
|
59
|
+
strategy: r.strategy,
|
|
60
|
+
strategyId: r.strategyId,
|
|
61
|
+
language: r.language,
|
|
62
|
+
currencyCode: r.currencySettings.value,
|
|
63
|
+
size: r.size,
|
|
64
|
+
productIds: r.productIds,
|
|
65
|
+
filters: r.filters,
|
|
66
|
+
shuffleProducts: r.shuffleProducts
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
|
-
if (e.strategyId &&
|
|
70
|
-
return
|
|
69
|
+
if (e.strategyId && n.isFeatureEnabled("reusableRecommendationStrategy"))
|
|
70
|
+
return i.recommendationCampaignUrls[a] = {
|
|
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
|
-
|
|
78
|
-
return delete r[s], o.recommendationCampaignUrls = r, "";
|
|
79
|
-
}
|
|
75
|
+
const d = ((l = y().find((s) => s.key === e.strategy)) == null ? void 0 : l.path) || "";
|
|
76
|
+
if (!d)
|
|
77
|
+
return delete i.recommendationCampaignUrls[a], "";
|
|
80
78
|
const t = new URLSearchParams();
|
|
81
|
-
t.set("locale", e.language), t.set("currency", e.currencyCode), t.set("partnerName",
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
const p = decodeURIComponent(t.toString()),
|
|
85
|
-
return
|
|
79
|
+
t.set("locale", e.language), t.set("currency", e.currencyCode), t.set("partnerName", n.partnerName), t.set("size", e.size), t.set("details", "true"), t.set("campaignId", n.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}");
|
|
80
|
+
const g = e.filters.filter((s) => s.isValid), u = b(g);
|
|
81
|
+
u && t.set("filter", u), e.shuffleProducts && t.set("shuffle", "true"), Object.entries(h(n.partnerName, e.strategy)).forEach(([s, r]) => t.set(s, r));
|
|
82
|
+
const p = decodeURIComponent(t.toString()), m = `${I.RECOMMENDATION_API_URL}/v2/${d}?${p}`;
|
|
83
|
+
return i.recommendationCampaignUrls[a] = m, m;
|
|
86
84
|
}
|
|
87
85
|
});
|
|
88
86
|
export {
|
|
@@ -10,7 +10,7 @@ const o = {
|
|
|
10
10
|
RECOMMENDATION_STRATEGY_CREATE_PATH: "/discovery/recommendation-strategies/create?isEmail=true"
|
|
11
11
|
}, d = (e) => {
|
|
12
12
|
const { RECOMMENDATION_STRATEGIES_PANEL_PATH: r } = o;
|
|
13
|
-
return `${r}/${e}/edit
|
|
13
|
+
return `${r}/${e}/edit`;
|
|
14
14
|
}, m = {
|
|
15
15
|
CLIENT_ID: "clientId"
|
|
16
16
|
}, p = () => {
|
|
@@ -84,7 +84,7 @@ const o = {
|
|
|
84
84
|
{ text: "dot(.)", value: "." },
|
|
85
85
|
{ text: "comma(,)", value: "," },
|
|
86
86
|
{ text: "space( )", value: " " }
|
|
87
|
-
],
|
|
87
|
+
], b = [
|
|
88
88
|
{ text: "0", value: "0" },
|
|
89
89
|
{ text: "1", value: "1" },
|
|
90
90
|
{ text: "2", value: "2" },
|
|
@@ -113,7 +113,7 @@ const o = {
|
|
|
113
113
|
], c = [
|
|
114
114
|
{ text: "true", value: "==" },
|
|
115
115
|
{ text: "false", value: "!=" }
|
|
116
|
-
],
|
|
116
|
+
], g = (e) => {
|
|
117
117
|
if (!e)
|
|
118
118
|
return t;
|
|
119
119
|
switch (e) {
|
|
@@ -136,10 +136,10 @@ export {
|
|
|
136
136
|
v as PriceAttributes,
|
|
137
137
|
m as QUERY_PARAMS,
|
|
138
138
|
o as URLS,
|
|
139
|
-
|
|
139
|
+
b as currencyDecimalCounts,
|
|
140
140
|
h as currencyLocationMaps,
|
|
141
141
|
x as currencyOperators,
|
|
142
|
-
|
|
142
|
+
g as getOperatorOptions,
|
|
143
143
|
p as getRecommendationFeedSourceMaps,
|
|
144
144
|
s as operatorOptionsForArrayOfStrings,
|
|
145
145
|
c as operatorOptionsForBooleans,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { DEFAULT_COLUMN_SPACING as
|
|
2
|
-
import { ATTR_PRODUCT_IMAGE as o, ATTR_PRODUCT_NAME as t, ATTR_PRODUCT_OLD_PRICE as _, ATTR_PRODUCT_PRICE as T, ATTR_PRODUCT_OMNIBUS_PRICE as
|
|
3
|
-
const
|
|
1
|
+
import { DEFAULT_COLUMN_SPACING as R, DEFAULT_ROW_SPACING as s, DEFAULT_MOBILE_ROW_SPACING as n, DEFAULT_MOBILE_COLUMN_SPACING as O, DEFAULT_MOBILE_CARDS_IN_ROW as e, DEFAULT_CARDS_IN_ROW as C } from "./layout.js";
|
|
2
|
+
import { ATTR_PRODUCT_IMAGE as o, ATTR_PRODUCT_NAME as t, ATTR_PRODUCT_OLD_PRICE as _, ATTR_PRODUCT_PRICE as T, ATTR_PRODUCT_OMNIBUS_PRICE as r, ATTR_PRODUCT_OMNIBUS_DISCOUNT as I, ATTR_PRODUCT_BUTTON as i, ATTR_RECOMMENDATION_TITLE as U } from "./selectors.js";
|
|
3
|
+
const A = 1, u = 2, D = {
|
|
4
4
|
code: "USD",
|
|
5
5
|
symbol: "USD",
|
|
6
6
|
alignment: "after",
|
|
7
7
|
decimalCount: 2,
|
|
8
8
|
decimalSeparator: ".",
|
|
9
9
|
thousandSeparator: ","
|
|
10
|
-
},
|
|
10
|
+
}, E = {
|
|
11
11
|
textBefore: "",
|
|
12
12
|
textAfter: ""
|
|
13
13
|
}, a = {
|
|
@@ -18,26 +18,26 @@ const U = 1, u = 2, m = 2, A = {
|
|
|
18
18
|
t,
|
|
19
19
|
_,
|
|
20
20
|
T,
|
|
21
|
+
r,
|
|
21
22
|
I,
|
|
22
|
-
|
|
23
|
-
r
|
|
23
|
+
i
|
|
24
24
|
], N = {
|
|
25
|
-
[
|
|
25
|
+
[U]: !0,
|
|
26
26
|
[o]: !0,
|
|
27
27
|
[t]: !0,
|
|
28
28
|
[T]: !0,
|
|
29
29
|
[_]: !0,
|
|
30
|
+
[r]: !1,
|
|
30
31
|
[I]: !1,
|
|
31
|
-
[
|
|
32
|
-
|
|
33
|
-
}, L = {
|
|
32
|
+
[i]: !0
|
|
33
|
+
}, m = {
|
|
34
34
|
// Settings
|
|
35
35
|
strategy: "mostPopular",
|
|
36
36
|
productIds: [],
|
|
37
37
|
size: "6",
|
|
38
38
|
shuffleProducts: !1,
|
|
39
39
|
language: "en_US",
|
|
40
|
-
currency:
|
|
40
|
+
currency: D,
|
|
41
41
|
filters: [],
|
|
42
42
|
strategyId: "",
|
|
43
43
|
// Layout
|
|
@@ -46,7 +46,7 @@ const U = 1, u = 2, m = 2, A = {
|
|
|
46
46
|
mobileCardsInRow: e,
|
|
47
47
|
mobileLayoutEnabled: !1,
|
|
48
48
|
previousMobileCardsInRow: e,
|
|
49
|
-
columnSpacing:
|
|
49
|
+
columnSpacing: R,
|
|
50
50
|
rowSpacing: s,
|
|
51
51
|
mobileColumnSpacing: O,
|
|
52
52
|
mobileRowSpacing: n,
|
|
@@ -55,7 +55,7 @@ const U = 1, u = 2, m = 2, A = {
|
|
|
55
55
|
visibility: N,
|
|
56
56
|
previousTitleHtml: "",
|
|
57
57
|
// Element settings
|
|
58
|
-
omnibusPrice:
|
|
58
|
+
omnibusPrice: E,
|
|
59
59
|
omnibusDiscount: a,
|
|
60
60
|
textTrimming: !1,
|
|
61
61
|
// Price placement (block-level, affects all cards)
|
|
@@ -66,18 +66,17 @@ const U = 1, u = 2, m = 2, A = {
|
|
|
66
66
|
// of "false" (the actual hiding happens server-side at send).
|
|
67
67
|
priceHideIfSameAsDiscounted: !1,
|
|
68
68
|
// Meta
|
|
69
|
-
configVersion:
|
|
69
|
+
configVersion: A,
|
|
70
70
|
recommendationId: 0
|
|
71
|
-
},
|
|
71
|
+
}, L = [11, 12];
|
|
72
72
|
export {
|
|
73
73
|
u as CURRENT_CONFIG_VERSION,
|
|
74
74
|
c as DEFAULT_COMPOSITION,
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
D as DEFAULT_CURRENCY,
|
|
76
|
+
m as DEFAULT_NODE_CONFIG,
|
|
77
77
|
a as DEFAULT_OMNIBUS_DISCOUNT,
|
|
78
|
-
|
|
78
|
+
E as DEFAULT_OMNIBUS_PRICE,
|
|
79
79
|
N as DEFAULT_VISIBILITY,
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
m as RRS_CONFIG_VERSION
|
|
80
|
+
L as EXCLUDED_ALGORITHM_IDS,
|
|
81
|
+
A as PRE_RRS_CONFIG_VERSION
|
|
83
82
|
};
|
|
@@ -4,7 +4,7 @@ var r = (g, c, t) => C(g, typeof c != "symbol" ? c + "" : c, t);
|
|
|
4
4
|
import { useConfig as p } from "../../../../../composables/useConfig.js";
|
|
5
5
|
import { ModificationDescription as y } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
6
6
|
import { CommonControl as N } from "../../../common-control.js";
|
|
7
|
-
import {
|
|
7
|
+
import { CURRENT_CONFIG_VERSION as _, DEFAULT_NODE_CONFIG as a } from "../../constants/defaultConfig.js";
|
|
8
8
|
import { RECOMMENDATION_ID_ATTR as I } from "../../constants/selectors.js";
|
|
9
9
|
import { RecommendationConfigService as l } from "../../services/configService.js";
|
|
10
10
|
import { useRecommendationExtensionStore as R } from "../../store/recommendation.js";
|
|
@@ -4,7 +4,7 @@ var r = (o, n, t) => S(o, typeof n != "symbol" ? n + "" : n, t);
|
|
|
4
4
|
import { ACADEMY_LINKS as _ } from "../../../../../enums/academy.js";
|
|
5
5
|
import { useOnboardingStore as f } from "../../../../../stores/onboarding.js";
|
|
6
6
|
import { CommonControl as v } from "../../../common-control.js";
|
|
7
|
-
import {
|
|
7
|
+
import { CURRENT_CONFIG_VERSION as b } from "../../constants/defaultConfig.js";
|
|
8
8
|
import { RecommendationConfigService as h } from "../../services/configService.js";
|
|
9
9
|
import { useRecommendationExtensionStore as C } from "../../store/recommendation.js";
|
|
10
10
|
const k = "recommendation-strategy-control";
|