@useinsider/guido 3.17.0-beta.1631b31 → 3.17.0-beta.238e3b9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/dist/@types/config/schemas.js +0 -5
- package/dist/components/Guido.vue.js +5 -5
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +7 -7
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +76 -39
- package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.js +11 -11
- package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue2.js +56 -6
- package/dist/composables/useRecommendation.js +24 -24
- package/dist/config/migrator/recommendation/settingsMapper.js +0 -2
- package/dist/config/migrator/recommendationMigrator.js +0 -1
- package/dist/enums/date.js +5 -4
- package/dist/enums/extensions/recommendationBlock.js +0 -1
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +0 -2
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +195 -142
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +0 -18
- package/dist/extensions/Blocks/Recommendation/services/configService.js +34 -16
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +17 -74
- package/dist/guido.css +1 -1
- package/dist/services/recommendationApi.js +10 -16
- package/dist/src/@types/config/schemas.d.ts +0 -10
- package/dist/src/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.d.ts +2 -4
- package/dist/src/enums/date.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +38 -15
- package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +0 -14
- package/dist/src/extensions/Blocks/Recommendation/services/configService.d.ts +12 -1
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +0 -56
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +0 -5
- package/dist/src/services/recommendationApi.d.ts +1 -1
- package/dist/src/stores/save-as-template.d.ts +4 -3
- package/dist/src/utils/genericUtil.d.ts +5 -0
- package/dist/static/assets/icons/line-delete.svg.js +2 -2
- package/dist/static/assets/icons/line-plus.svg.js +2 -2
- package/dist/static/styles/components/recommendation-strategy.css.js +2 -35
- package/dist/utils/dateUtil.js +18 -24
- package/dist/utils/genericUtil.js +28 -27
- package/dist/utils/templatePreparation.js +0 -2
- package/package.json +3 -3
- package/dist/src/utils/strategyInfoBox.d.ts +0 -35
- package/dist/utils/strategyInfoBox.js +0 -68
package/README.md
CHANGED
|
@@ -634,16 +634,16 @@ toaster fires (useful before the host has wired the catalog).
|
|
|
634
634
|
|
|
635
635
|
```bash
|
|
636
636
|
# Install
|
|
637
|
-
|
|
637
|
+
npm install
|
|
638
638
|
|
|
639
639
|
# Start dev server
|
|
640
|
-
|
|
640
|
+
npm start
|
|
641
641
|
|
|
642
642
|
# Build
|
|
643
|
-
|
|
643
|
+
npm run build
|
|
644
644
|
|
|
645
645
|
# Lint & type-check
|
|
646
|
-
|
|
646
|
+
npm run lint
|
|
647
647
|
```
|
|
648
648
|
|
|
649
649
|
### Environment Variables
|
|
@@ -661,7 +661,7 @@ VITE_STRIPO_USER=your_user
|
|
|
661
661
|
|
|
662
662
|
```bash
|
|
663
663
|
# Build the package
|
|
664
|
-
|
|
664
|
+
npm run build
|
|
665
665
|
|
|
666
666
|
# Create tarball
|
|
667
667
|
npm pack
|
|
@@ -220,11 +220,6 @@ const p = {
|
|
|
220
220
|
allowlistEnabled: e(o(), !1),
|
|
221
221
|
/** Enable persistent link tracking-id assignment for the click heatmap (opt-in) */
|
|
222
222
|
linkTrackingIds: e(o(), !1),
|
|
223
|
-
/**
|
|
224
|
-
* Assign a Reusable Recommendation Strategy (RRS) to recommendation blocks instead of
|
|
225
|
-
* per-block algorithm settings. Hides Algorithm, Filters, Shuffle and Number of Products
|
|
226
|
-
* (they live on the strategy) and adds the Assign Strategy flow.
|
|
227
|
-
*/
|
|
228
223
|
reusableRecommendationStrategy: e(o(), !1)
|
|
229
224
|
}), B = i([
|
|
230
225
|
"amp-accordion",
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import
|
|
1
|
+
import a from "./Guido.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import i from "../_virtual/_plugin-vue2_normalizer.js";
|
|
4
4
|
var t = function() {
|
|
5
|
-
var
|
|
6
|
-
return r("div", { ref: "wrapperRef", staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": e.noHeader } }, [r(e.HeaderWrapper, { ref: "headerWrapperRef" }), r(e.AutoSaveController), e.editorStore.isPreviewModeOpen ? r(e.PreviewContainer) :
|
|
5
|
+
var o = this, r = o._self._c, e = o._self._setupProxy;
|
|
6
|
+
return r("div", { ref: "wrapperRef", staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": e.noHeader } }, [r(e.HeaderWrapper, { ref: "headerWrapperRef" }), r(e.AutoSaveController), e.editorStore.isPreviewModeOpen ? r(e.PreviewContainer) : o._e(), r("div", { directives: [{ name: "show", rawName: "v-show", value: !e.previewStore.isLoaded, expression: "!previewStore.isLoaded" }], staticClass: "guido-editor__container", class: { "guido-editor__no-header": e.noHeader }, attrs: { id: "guido-editor" } }), r(e.Toaster), r(e.FilterSelectionDrawer), e.isRrsEnabled || e.hasAssignedStrategy ? r(e.AssignStrategyDrawer) : o._e(), r(e.SaveAsTemplateDrawer), e.isTestPartner() ? o._e() : r(e.OnboardingWrapper, { on: { "onboarding-finished": function(p) {
|
|
7
7
|
return e.emit("onboarding:finished");
|
|
8
8
|
} } }), r(e.UnsubscribeWrapper), r(e.LoadingWrapper)], 1);
|
|
9
9
|
}, s = [], n = /* @__PURE__ */ i(
|
|
10
|
-
|
|
10
|
+
a,
|
|
11
11
|
t,
|
|
12
12
|
s,
|
|
13
13
|
!1,
|
|
14
14
|
null,
|
|
15
|
-
"
|
|
15
|
+
"e6f99d29"
|
|
16
16
|
);
|
|
17
17
|
const l = n.exports;
|
|
18
18
|
export {
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import r from "./AssignStrategyDrawer.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
/* empty css */
|
|
4
|
-
import
|
|
5
|
-
var
|
|
4
|
+
import a from "../../../../_virtual/_plugin-vue2_normalizer.js";
|
|
5
|
+
var o = function() {
|
|
6
6
|
var e = this, s = e._self._c, t = e._self._setupProxy;
|
|
7
7
|
return t.store.assignStrategyDrawerStatus ? s(t.OrgStrategyDetailModal, { staticClass: "assign-strategy-drawer", attrs: { "description-status": "", show: "", "description-text": t.drawerDescription, "footer-button-group-options": t.footerButtonGroupOptions, strategy: t.selectedStrategy ?? {}, "title-text": t.trans("gpt-app-builder.assign-recommendation-strategy") }, on: { close: t.closeDrawer, primaryClick: t.assignStrategy }, scopedSlots: e._u([{ key: "contentTop", fn: function() {
|
|
8
|
-
return [s("div", { staticClass: "assign-strategy-drawer-content px-5 py-5" }, [s(t.OrgStrategyDropdown, { staticClass: "assign-strategy-select", attrs: { id: "assign-strategy-select", "info-box-position": "bottom right", "create-button-visible": !1, loading: t.store.strategiesLoading, "selected-strategy-id": t.selectedStrategyId, state: t.showSelectionError ? "error" : "default", "state-message": t.showSelectionError ? t.trans("ds-steps.select-strategy-tooltip") : "", strategies: t.strategyOptions }, on: { select: t.onSelect } })], 1)];
|
|
9
|
-
}, proxy: !0 }], null, !1,
|
|
10
|
-
}, n = [], i = /* @__PURE__ */
|
|
8
|
+
return [s("div", { staticClass: "assign-strategy-drawer-content px-5 py-5" }, [s(t.OrgStrategyDropdown, { staticClass: "assign-strategy-select", attrs: { id: "assign-strategy-select", "info-box-position": "bottom right", "create-button-visible": !1, loading: t.store.strategiesLoading, "placeholder-text": t.trans("smart-recommender.select-recommendation-strategy"), "selected-strategy-id": t.selectedStrategyId, state: t.showSelectionError ? "error" : "default", "state-message": t.showSelectionError ? t.trans("ds-steps.select-strategy-tooltip") : "", strategies: t.strategyOptions }, on: { select: t.onSelect } })], 1)];
|
|
9
|
+
}, proxy: !0 }], null, !1, 2542767044) }) : e._e();
|
|
10
|
+
}, n = [], i = /* @__PURE__ */ a(
|
|
11
11
|
r,
|
|
12
|
-
|
|
12
|
+
o,
|
|
13
13
|
n,
|
|
14
14
|
!1,
|
|
15
15
|
null,
|
|
16
|
-
"
|
|
16
|
+
"2580a7d9"
|
|
17
17
|
);
|
|
18
18
|
const y = i.exports;
|
|
19
19
|
export {
|
|
@@ -1,69 +1,106 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as v, defineAsyncComponent as y, ref as u, computed as l, watch as O } from "vue";
|
|
2
2
|
import "@useinsider/design-system-organisms/style";
|
|
3
|
-
import { useToaster as
|
|
4
|
-
import { useTranslations as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
|
|
3
|
+
import { useToaster as x } from "../../../../composables/useToaster.js";
|
|
4
|
+
import { useTranslations as A } from "../../../../composables/useTranslations.js";
|
|
5
|
+
import { DOTTED_DATE_LOCALE as E } from "../../../../enums/date.js";
|
|
6
|
+
import { URLS as h } from "../../../../enums/extensions/recommendationBlock.js";
|
|
7
|
+
import { ToasterTypeOptions as m } from "../../../../enums/toaster.js";
|
|
8
|
+
import { useRecommendationExtensionStore as C } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
9
|
+
import B from "./StrategyInfoBoxContent.vue.js";
|
|
10
|
+
import { formatShortDate as I } from "../../../../utils/dateUtil.js";
|
|
11
|
+
import { asText as f } from "../../../../utils/genericUtil.js";
|
|
12
|
+
import { escapeHtml as N } from "../../../../utils/htmlEscape.js";
|
|
13
|
+
import { InSkeleton as b } from "@useinsider/design-system-vue";
|
|
14
|
+
const W = /* @__PURE__ */ v({
|
|
11
15
|
__name: "AssignStrategyDrawer",
|
|
12
|
-
setup(
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
),
|
|
16
|
-
async () => (await
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
setup(k) {
|
|
17
|
+
const c = () => import("@useinsider/design-system-organisms"), g = (t, r) => ({
|
|
18
|
+
render: (a) => a(b, { props: { sizing: { width: t, height: r } } })
|
|
19
|
+
}), S = y({
|
|
20
|
+
loader: async () => (await c()).OrgStrategyDetailModal,
|
|
21
|
+
loadingComponent: g(480, 240),
|
|
22
|
+
delay: 0
|
|
23
|
+
}), T = y({
|
|
24
|
+
loader: async () => (await c()).OrgStrategyDropdown,
|
|
25
|
+
loadingComponent: g(240, 42),
|
|
26
|
+
delay: 0
|
|
27
|
+
}), o = A(), e = C(), { showToaster: s } = x(), n = u(null), i = u(!1), _ = l(() => e.assignStrategyDrawerStatus ? o("email-editor.assign-strategy-description", { url: h.RECOMMENDATION_STRATEGIES_PANEL_PATH }) : "");
|
|
28
|
+
O(() => e.assignStrategyDrawerStatus, (t) => {
|
|
19
29
|
if (!t)
|
|
20
30
|
return;
|
|
21
|
-
const { strategyId:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
type:
|
|
25
|
-
message:
|
|
31
|
+
const { strategyId: r } = e.recommendationConfigs;
|
|
32
|
+
n.value = r || null, i.value = !1, e.fetchStrategies().catch(() => {
|
|
33
|
+
s({
|
|
34
|
+
type: m.Error,
|
|
35
|
+
message: o("discovery-strategy.error-description")
|
|
26
36
|
});
|
|
27
37
|
});
|
|
28
38
|
});
|
|
29
|
-
const
|
|
39
|
+
const p = (t) => {
|
|
40
|
+
const r = f(t.updated_at || t.created_at);
|
|
41
|
+
if (!r)
|
|
42
|
+
return "";
|
|
43
|
+
const a = I(r, E);
|
|
44
|
+
return o("recommendation-strategy.last-updated-on", { value: a });
|
|
45
|
+
}, D = l(() => e.strategies.map((t) => ({
|
|
30
46
|
text: t.name,
|
|
31
47
|
value: t.strategy_id,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
48
|
+
infoBoxProps: {
|
|
49
|
+
id: `strategy-info-${t.strategy_id}`,
|
|
50
|
+
theme: "light",
|
|
51
|
+
variant: "information",
|
|
52
|
+
className: "assign-strategy-info-box",
|
|
53
|
+
titleText: N(f(t.name)),
|
|
54
|
+
descriptionStatus: !0,
|
|
55
|
+
descriptionText: p(t),
|
|
56
|
+
slot: B,
|
|
57
|
+
slotProps: { strategy: t }
|
|
58
|
+
}
|
|
59
|
+
}))), d = l(() => {
|
|
60
|
+
const t = e.strategies.find((r) => String(r.strategy_id) === String(n.value ?? ""));
|
|
37
61
|
return t ? { ...t, fallback_config: null } : null;
|
|
38
|
-
}),
|
|
62
|
+
}), w = l(() => ({
|
|
39
63
|
primaryButton: {
|
|
40
64
|
styling: "solid",
|
|
41
65
|
type: "primary",
|
|
42
|
-
labelText:
|
|
66
|
+
labelText: o("products.assign-btn")
|
|
43
67
|
},
|
|
44
68
|
cancelOrBackButton: {
|
|
45
69
|
styling: "ghost",
|
|
46
70
|
type: "secondary",
|
|
47
|
-
labelText:
|
|
71
|
+
labelText: o("products.cancel")
|
|
48
72
|
}
|
|
49
73
|
}));
|
|
50
|
-
return { __sfc: !0, OrgStrategyDetailModal:
|
|
74
|
+
return { __sfc: !0, loadOrganisms: c, skeleton: g, OrgStrategyDetailModal: S, OrgStrategyDropdown: T, trans: o, store: e, showToaster: s, selectedStrategyId: n, showSelectionError: i, drawerDescription: _, lastUpdatedText: p, strategyOptions: D, selectedStrategy: d, footerButtonGroupOptions: w, closeDrawer: () => {
|
|
51
75
|
e.closeAssignStrategyDrawer();
|
|
52
|
-
}, assignStrategy: () => {
|
|
53
|
-
const t =
|
|
76
|
+
}, assignStrategy: async () => {
|
|
77
|
+
const t = d.value;
|
|
54
78
|
if (!t) {
|
|
55
|
-
|
|
79
|
+
i.value = !0;
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
let r = "";
|
|
83
|
+
try {
|
|
84
|
+
r = await e.resolveStrategyUrlTemplate(t, e.recommendationConfigs.currencySettings.value);
|
|
85
|
+
} catch (a) {
|
|
86
|
+
console.error("[AssignStrategyDrawer] resolveStrategyUrlTemplate failed", a);
|
|
87
|
+
}
|
|
88
|
+
if (!r) {
|
|
89
|
+
s({
|
|
90
|
+
type: m.Error,
|
|
91
|
+
message: o("email-editor.strategy-assign-failed", { strategyName: t.name })
|
|
92
|
+
});
|
|
56
93
|
return;
|
|
57
94
|
}
|
|
58
|
-
e.assignStrategy(t),
|
|
59
|
-
type:
|
|
60
|
-
message:
|
|
95
|
+
e.assignStrategy(t), s({
|
|
96
|
+
type: m.Success,
|
|
97
|
+
message: o("email-editor.strategy-assigned-success", { strategyName: t.name })
|
|
61
98
|
}), e.closeAssignStrategyDrawer();
|
|
62
99
|
}, onSelect: (t) => {
|
|
63
|
-
|
|
100
|
+
n.value = t.value, i.value = !1;
|
|
64
101
|
} };
|
|
65
102
|
}
|
|
66
103
|
});
|
|
67
104
|
export {
|
|
68
|
-
|
|
105
|
+
W as default
|
|
69
106
|
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
var
|
|
4
|
-
var t = this, s = t._self._c;
|
|
5
|
-
return
|
|
6
|
-
return s("div", { key:
|
|
1
|
+
import r from "./StrategyInfoBoxContent.vue2.js";
|
|
2
|
+
import _ from "../../../../_virtual/_plugin-vue2_normalizer.js";
|
|
3
|
+
var c = function() {
|
|
4
|
+
var t = this, s = t._self._c, n = t._self._setupProxy;
|
|
5
|
+
return s("div", { staticClass: "d-f f-d-c mt-3" }, t._l(n.details, function(e, a) {
|
|
6
|
+
return s("div", { key: e.title, staticClass: "d-f f-d-c", class: { "mt-2": a > 0 } }, [s("span", { staticClass: "f-s-1 f-w-600 l-h-1 t-c-52 mb-12" }, [t._v(t._s(e.title))]), s("span", { staticClass: "f-s-1 l-h-6 t-c-55 w-b-b-w" }, [t._v(t._s(e.value))])]);
|
|
7
7
|
}), 0);
|
|
8
|
-
},
|
|
9
|
-
|
|
10
|
-
_,
|
|
8
|
+
}, f = [], l = /* @__PURE__ */ _(
|
|
9
|
+
r,
|
|
11
10
|
c,
|
|
11
|
+
f,
|
|
12
12
|
!1,
|
|
13
13
|
null,
|
|
14
14
|
null
|
|
15
15
|
);
|
|
16
|
-
const
|
|
16
|
+
const p = l.exports;
|
|
17
17
|
export {
|
|
18
|
-
|
|
18
|
+
p as default
|
|
19
19
|
};
|
|
@@ -1,13 +1,63 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
|
|
1
|
+
import { defineComponent as f, computed as i } from "vue";
|
|
2
|
+
import { useTranslations as _ } from "../../../../composables/useTranslations.js";
|
|
3
|
+
import { asText as c } from "../../../../utils/genericUtil.js";
|
|
4
|
+
const j = /* @__PURE__ */ f({
|
|
3
5
|
__name: "StrategyInfoBoxContent",
|
|
4
6
|
props: {
|
|
5
|
-
|
|
7
|
+
strategy: null
|
|
6
8
|
},
|
|
7
|
-
setup(
|
|
8
|
-
|
|
9
|
+
setup(p) {
|
|
10
|
+
const a = p, n = _(), s = i(() => n("recommendation-strategy.none")), u = i(() => {
|
|
11
|
+
const e = c(a.strategy.algorithm) === "MIXED" ? n("discovery-strategy.mixed-algorithm") : n("discovery-strategy.single-algorithm"), t = c(a.strategy.algorithm_used).split(",").map((r) => r.trim()).filter(Boolean).map((r) => n(`recommendation-algorithm-names.${r.replaceAll("_", "-").toLowerCase()}`));
|
|
12
|
+
return t.length ? `${e} · ${t.join(", ")}` : e;
|
|
13
|
+
}), d = i(() => [
|
|
14
|
+
[a.strategy.exclude_view, "discovery-strategy.exclude-recently-view-items"],
|
|
15
|
+
[a.strategy.exclude_purchase, "discovery-strategy.exclude-recently-purchased-items"],
|
|
16
|
+
[a.strategy.exclude_cart, "discovery-strategy.exclude-recently-added-cart-items"]
|
|
17
|
+
].filter(([e]) => Number(e) === 1).map(([, e]) => n(e)).join(", ") || s.value), l = (e) => {
|
|
18
|
+
const t = c(e).trim();
|
|
19
|
+
if (!t)
|
|
20
|
+
return "";
|
|
21
|
+
let r;
|
|
22
|
+
try {
|
|
23
|
+
r = JSON.parse(t);
|
|
24
|
+
} catch {
|
|
25
|
+
return t;
|
|
26
|
+
}
|
|
27
|
+
if (Array.isArray(r))
|
|
28
|
+
return r.length ? String(r.length) : "";
|
|
29
|
+
if (r && typeof r == "object") {
|
|
30
|
+
const o = Object.keys(r).length;
|
|
31
|
+
return o ? String(o) : "";
|
|
32
|
+
}
|
|
33
|
+
return t;
|
|
34
|
+
}, m = i(() => l(a.strategy.manual_merchandising) || l(a.strategy.manual_merchandising_products) || s.value), g = (e) => {
|
|
35
|
+
if (Array.isArray(e))
|
|
36
|
+
return e.length;
|
|
37
|
+
const { conditionList: t } = e ?? {};
|
|
38
|
+
return Array.isArray(t) ? t.length : 1;
|
|
39
|
+
}, y = i(() => {
|
|
40
|
+
const e = a.strategy.filters;
|
|
41
|
+
if (!e)
|
|
42
|
+
return s.value;
|
|
43
|
+
try {
|
|
44
|
+
const t = typeof e == "string" ? JSON.parse(e) : e;
|
|
45
|
+
if (!t || typeof t != "object")
|
|
46
|
+
return s.value;
|
|
47
|
+
const r = Object.values(t).reduce((o, v) => o + g(v), 0);
|
|
48
|
+
return r ? String(r) : s.value;
|
|
49
|
+
} catch {
|
|
50
|
+
return s.value;
|
|
51
|
+
}
|
|
52
|
+
}), h = i(() => [
|
|
53
|
+
{ title: n("gpt-app-builder.algorithms-and-method"), value: u.value },
|
|
54
|
+
{ title: n("gpt-app-builder.exclusions"), value: d.value },
|
|
55
|
+
{ title: n("discovery-strategy.filters"), value: y.value },
|
|
56
|
+
{ title: n("action-builder.manual-merchandising"), value: m.value }
|
|
57
|
+
]);
|
|
58
|
+
return { __sfc: !0, props: a, trans: n, none: s, algorithmsAndMethod: u, exclusions: d, asMerchandising: l, manualMerchandising: m, conditionsIn: g, filters: y, details: h };
|
|
9
59
|
}
|
|
10
60
|
});
|
|
11
61
|
export {
|
|
12
|
-
|
|
62
|
+
j as default
|
|
13
63
|
};
|
|
@@ -7,17 +7,17 @@ import { sanitizeProductIds as x } from "../extensions/Blocks/Recommendation/uti
|
|
|
7
7
|
import { useConfigStore as P } from "../stores/config.js";
|
|
8
8
|
const B = () => ({
|
|
9
9
|
calculateCardWidth: ({
|
|
10
|
-
mobileLeftPadding:
|
|
10
|
+
mobileLeftPadding: i,
|
|
11
11
|
mobileRightPadding: c,
|
|
12
12
|
cardsInRow: s,
|
|
13
|
-
unresponsive:
|
|
13
|
+
unresponsive: n
|
|
14
14
|
}) => {
|
|
15
|
-
const
|
|
16
|
-
return (C - e) /
|
|
15
|
+
const o = n ? s : 1, e = i + c + (o - 1) * R;
|
|
16
|
+
return (C - e) / o;
|
|
17
17
|
},
|
|
18
|
-
getRecommendationCampaignData: (
|
|
19
|
-
const c = l(), s = Number(
|
|
20
|
-
if (!
|
|
18
|
+
getRecommendationCampaignData: (i) => {
|
|
19
|
+
const c = l(), s = Number(i), n = c.blockStates[s];
|
|
20
|
+
if (!n)
|
|
21
21
|
return {
|
|
22
22
|
textTrimming: !1,
|
|
23
23
|
orientation: "vertical",
|
|
@@ -30,31 +30,31 @@ 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: (i, c) => {
|
|
48
48
|
var m;
|
|
49
|
-
const s = l(),
|
|
49
|
+
const s = l(), n = P(), o = Number(i);
|
|
50
50
|
let e;
|
|
51
51
|
if (c)
|
|
52
52
|
e = c;
|
|
53
53
|
else {
|
|
54
|
-
const
|
|
55
|
-
if (!
|
|
54
|
+
const a = s.blockStates[o];
|
|
55
|
+
if (!a)
|
|
56
56
|
return "";
|
|
57
|
-
const { recommendationConfigs: r } =
|
|
57
|
+
const { recommendationConfigs: r } = a;
|
|
58
58
|
e = {
|
|
59
59
|
strategy: r.strategy,
|
|
60
60
|
strategyId: r.strategyId,
|
|
@@ -66,18 +66,18 @@ const B = () => ({
|
|
|
66
66
|
shuffleProducts: r.shuffleProducts
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
|
-
if (e.strategyId)
|
|
70
|
-
return s.recommendationCampaignUrls[
|
|
69
|
+
if (e.strategyId && n.isFeatureEnabled("reusableRecommendationStrategy"))
|
|
70
|
+
return s.recommendationCampaignUrls[i] = {
|
|
71
71
|
strategyId: e.strategyId,
|
|
72
72
|
locale: e.language,
|
|
73
73
|
currency: e.currencyCode
|
|
74
74
|
}, "";
|
|
75
|
-
const
|
|
76
|
-
t.set("locale", e.language), t.set("currency", e.currencyCode), t.set("partnerName",
|
|
77
|
-
const
|
|
78
|
-
d && t.set("filter", d), e.shuffleProducts && t.set("shuffle", "true"), Object.entries(h(
|
|
79
|
-
const p = decodeURIComponent(t.toString()), u = `${I.RECOMMENDATION_API_URL}/v2/${
|
|
80
|
-
return s.recommendationCampaignUrls[
|
|
75
|
+
const g = ((m = y().find((a) => a.key === e.strategy)) == null ? void 0 : m.path) || "", t = new URLSearchParams();
|
|
76
|
+
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}");
|
|
77
|
+
const f = e.filters.filter((a) => a.isValid), d = b(f);
|
|
78
|
+
d && t.set("filter", d), e.shuffleProducts && t.set("shuffle", "true"), Object.entries(h(n.partnerName, e.strategy)).forEach(([a, r]) => t.set(a, r));
|
|
79
|
+
const p = decodeURIComponent(t.toString()), u = `${I.RECOMMENDATION_API_URL}/v2/${g}?${p}`;
|
|
80
|
+
return s.recommendationCampaignUrls[i] = u, u;
|
|
81
81
|
}
|
|
82
82
|
});
|
|
83
83
|
export {
|
|
@@ -66,8 +66,6 @@ function O(t, o, n) {
|
|
|
66
66
|
// gated). New Guido blocks default differently (see DEFAULT_NODE_CONFIG).
|
|
67
67
|
priceMovedToNextLine: !!t.isPriceMovedToNextLine,
|
|
68
68
|
priceHideIfSameAsDiscounted: !!t.isPriceDeletedForZeroSale,
|
|
69
|
-
// Legacy blocks stay on the pre-RRS era marker: the campaign they belong
|
|
70
|
-
// to keeps the old settings panel until its own migration ships.
|
|
71
69
|
configVersion: s
|
|
72
70
|
};
|
|
73
71
|
}
|
|
@@ -22,7 +22,6 @@ function B(i, t, a) {
|
|
|
22
22
|
currencySettings: v(t)
|
|
23
23
|
}, c = T(n, r, o), e = b((d = r.composition) == null ? void 0 : d.variables), l = C(t), g = M(t), p = {
|
|
24
24
|
...c,
|
|
25
|
-
// Legacy blocks predate RRS — never strategy-backed.
|
|
26
25
|
strategyId: "",
|
|
27
26
|
composition: e.composition,
|
|
28
27
|
visibility: e.visibility,
|
package/dist/enums/date.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
const t = "tr-TR",
|
|
1
|
+
const T = "tr-TR", t = "tr-TR", E = "default", L = "UTC";
|
|
2
2
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
L as DEFAULT_TZ
|
|
3
|
+
E as DEFAULT,
|
|
4
|
+
T as DEFAULT_LOCALE,
|
|
5
|
+
L as DEFAULT_TZ,
|
|
6
|
+
t as DOTTED_DATE_LOCALE
|
|
6
7
|
};
|
|
@@ -4,7 +4,6 @@ const l = {
|
|
|
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
|
-
// Panel route of the Recommendation Strategies listing.
|
|
8
7
|
RECOMMENDATION_STRATEGIES_PANEL_PATH: "/discovery/recommendation-strategies"
|
|
9
8
|
}, c = {
|
|
10
9
|
CLIENT_ID: "clientId"
|
|
@@ -64,8 +64,6 @@ const C = 1, l = 2, a = {
|
|
|
64
64
|
// of "false" (the actual hiding happens server-side at send).
|
|
65
65
|
priceHideIfSameAsDiscounted: !1,
|
|
66
66
|
// Meta
|
|
67
|
-
// Pre-RRS fallback only — block.ts stamps the era of the live session over
|
|
68
|
-
// it on creation. See PRE_RRS_CONFIG_VERSION.
|
|
69
67
|
configVersion: C,
|
|
70
68
|
recommendationId: 0
|
|
71
69
|
}, u = [11, 12];
|