@useinsider/guido 3.12.0-beta.40db55d → 3.12.0-beta.840207a
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 +2 -14
- package/dist/@types/config/schemas.js +13 -8
- package/dist/components/Guido.vue.js +6 -6
- package/dist/components/Guido.vue2.js +50 -49
- package/dist/components/organisms/extensions/recommendation/StrategyDetailDrawer.vue.js +36 -0
- package/dist/components/organisms/extensions/recommendation/StrategyDetailDrawer.vue2.js +244 -0
- package/dist/components/organisms/extensions/recommendation/strategy-detail/CampaignTable.vue.js +18 -0
- package/dist/components/organisms/extensions/recommendation/strategy-detail/CampaignTable.vue2.js +42 -0
- package/dist/components/organisms/extensions/recommendation/strategy-detail/FilterHumanizer.vue.js +20 -0
- package/dist/components/organisms/extensions/recommendation/strategy-detail/FilterHumanizer.vue2.js +18 -0
- package/dist/components/organisms/extensions/recommendation/strategy-detail/HumanizerCondition.vue.js +20 -0
- package/dist/components/organisms/extensions/recommendation/strategy-detail/HumanizerCondition.vue2.js +60 -0
- package/dist/components/organisms/extensions/recommendation/strategy-detail/HumanizerGroup.vue.js +19 -0
- package/dist/components/organisms/extensions/recommendation/strategy-detail/HumanizerGroup.vue2.js +19 -0
- package/dist/components/organisms/extensions/recommendation/strategy-detail/InfoDisplayValue.vue.js +22 -0
- package/dist/components/organisms/extensions/recommendation/strategy-detail/InfoDisplayValue.vue2.js +29 -0
- package/dist/components/organisms/header/ViewOptions.vue.js +3 -3
- package/dist/components/organisms/header/version-history/ViewOptions.vue.js +1 -1
- package/dist/composables/useRecommendation.js +82 -51
- package/dist/composables/useStrategyFilters.js +16 -0
- package/dist/config/migrator/recommendationMigrator.js +7 -4
- package/dist/enums/date.js +4 -3
- package/dist/enums/extensions/filteringV2.js +8 -0
- package/dist/enums/extensions/recommendationBlock.js +28 -22
- package/dist/enums/extensions/strategyDetail.js +148 -0
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +12 -11
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +123 -109
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +146 -0
- package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +1 -1
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +256 -102
- package/dist/extensions/Blocks/Recommendation/utils/strategyHumanizer.js +97 -0
- package/dist/extensions/Blocks/Recommendation/utils/strategySummary.js +10 -0
- package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +24 -12
- package/dist/guido.css +1 -1
- package/dist/services/recommendationApi.js +72 -29
- package/dist/src/@types/config/schemas.d.ts +10 -0
- package/dist/src/components/organisms/extensions/recommendation/StrategyDetailDrawer.vue.d.ts +2 -0
- package/dist/src/components/organisms/extensions/recommendation/strategy-detail/CampaignTable.vue.d.ts +43 -0
- package/dist/src/components/organisms/extensions/recommendation/strategy-detail/FilterHumanizer.vue.d.ts +29 -0
- package/dist/src/components/organisms/extensions/recommendation/strategy-detail/HumanizerCondition.vue.d.ts +40 -0
- package/dist/src/components/organisms/extensions/recommendation/strategy-detail/HumanizerGroup.vue.d.ts +38 -0
- package/dist/src/components/organisms/extensions/recommendation/strategy-detail/InfoDisplayValue.vue.d.ts +51 -0
- package/dist/src/composables/useConfig.d.ts +2 -0
- package/dist/src/composables/useRecommendation.d.ts +2 -0
- package/dist/src/composables/useStrategyFilters.d.ts +24 -0
- package/dist/src/enums/extensions/filteringV2.d.ts +72 -0
- package/dist/src/enums/extensions/recommendationBlock.d.ts +10 -0
- package/dist/src/enums/extensions/strategyDetail.d.ts +90 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +3 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +61 -0
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +606 -1
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/strategyHumanizer.d.ts +50 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/strategySummary.d.ts +34 -0
- package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +3 -1
- package/dist/src/services/recommendationApi.d.ts +7 -1
- package/dist/src/stores/config.d.ts +18 -0
- package/dist/src/utils/genericUtil.d.ts +9 -0
- package/dist/static/styles/base.css.js +15 -0
- package/dist/utils/dateUtil.js +23 -10
- package/dist/utils/genericUtil.js +10 -1
- package/dist/utils/templatePreparation.js +62 -58
- package/package.json +5 -10
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { FilterTypeNames as f, OperatorAbbreviations as N, UserEvents as y, UserEventKeys as d } from "../../../../enums/extensions/strategyDetail.js";
|
|
2
|
+
import { formatShortDate as p } from "../../../../utils/dateUtil.js";
|
|
3
|
+
const L = /* @__PURE__ */ new Set([
|
|
4
|
+
d.CURRENTLY_VIEWED_ITEM,
|
|
5
|
+
d.LEGACY_CURRENTLY_VIEWED_ITEM
|
|
6
|
+
]), g = /^(\d+)([whd])$/, h = (t) => t ? t.charAt(0).toUpperCase() + t.slice(1) : "", v = (t, e) => {
|
|
7
|
+
const r = y.find((n) => n.value === t);
|
|
8
|
+
return r ? e(r.text) : t;
|
|
9
|
+
}, C = (t, e) => {
|
|
10
|
+
if (t.userAttribute)
|
|
11
|
+
return t.userAttribute;
|
|
12
|
+
if (!t.userEvent)
|
|
13
|
+
return "";
|
|
14
|
+
const r = v(t.userEvent, e);
|
|
15
|
+
if (L.has(t.userEvent))
|
|
16
|
+
return r;
|
|
17
|
+
const n = t.userEventCount ?? 0;
|
|
18
|
+
if (n <= 0)
|
|
19
|
+
return r;
|
|
20
|
+
const a = e(
|
|
21
|
+
n === 1 ? "discovery-strategy-filtering.item" : "discovery-strategy-filtering.items"
|
|
22
|
+
);
|
|
23
|
+
return `${r} ${n} ${a}`;
|
|
24
|
+
}, O = [
|
|
25
|
+
f.USER_ATTRIBUTE_FILTER,
|
|
26
|
+
f.USER_EVENT_FILTER,
|
|
27
|
+
f.USER_CONTEXT_FILTER
|
|
28
|
+
], V = (t) => O.includes(t ?? ""), S = (t, e, r) => {
|
|
29
|
+
if (!t)
|
|
30
|
+
return "";
|
|
31
|
+
const n = g.exec(t);
|
|
32
|
+
if (!n)
|
|
33
|
+
return "";
|
|
34
|
+
const [, a, c] = n, s = e.find((T) => T.value === c), $ = s ? s.text.toLowerCase() : c;
|
|
35
|
+
return ` ${r("purchase-history.in-last")} ${a} ${$}`;
|
|
36
|
+
}, R = (t, e) => t.map((r) => `[${r}]`).join(` ${e} `), b = (t) => {
|
|
37
|
+
let e;
|
|
38
|
+
try {
|
|
39
|
+
e = JSON.parse(t);
|
|
40
|
+
} catch {
|
|
41
|
+
return t.split(",");
|
|
42
|
+
}
|
|
43
|
+
return Array.isArray(e) ? e.map((r) => String(r)) : [String(e)];
|
|
44
|
+
};
|
|
45
|
+
function w(t) {
|
|
46
|
+
const {
|
|
47
|
+
condition: e,
|
|
48
|
+
selectedOperator: r,
|
|
49
|
+
filterValue: n,
|
|
50
|
+
timeUnit: a,
|
|
51
|
+
inBetweenValues: c,
|
|
52
|
+
timeUnitOptions: s,
|
|
53
|
+
isDateAttribute: $,
|
|
54
|
+
isMultiSelect: T,
|
|
55
|
+
isInOrNotInOperator: U,
|
|
56
|
+
trans: E
|
|
57
|
+
} = t, { IN_LAST: A, IN_BETWEEN: _ } = N.OPERATOR, l = E("action-builder.and");
|
|
58
|
+
if (V(e.type)) {
|
|
59
|
+
const i = C(e, E);
|
|
60
|
+
if (i)
|
|
61
|
+
return `${i}${S(e.duration, s, E)}`;
|
|
62
|
+
}
|
|
63
|
+
const u = e.type === f.EVENT_BASED_FILTER ? S(e.duration, s, E) : "";
|
|
64
|
+
if (e.time && r !== _)
|
|
65
|
+
return `${p(e.time)}${u}`;
|
|
66
|
+
if (r === A) {
|
|
67
|
+
const [i] = n.match(/\d+/g) || [];
|
|
68
|
+
if (!i)
|
|
69
|
+
return n;
|
|
70
|
+
const o = s.find((m) => m.value === a);
|
|
71
|
+
return `${i} ${h((o == null ? void 0 : o.text) ?? "")}`.trimEnd();
|
|
72
|
+
}
|
|
73
|
+
if (r === _) {
|
|
74
|
+
if ($() && e.time) {
|
|
75
|
+
const [m = "", I = ""] = e.time.split(":");
|
|
76
|
+
return `${p(m)} ${l} ${p(I)}${u}`;
|
|
77
|
+
}
|
|
78
|
+
const [i = "", o = ""] = c ?? [];
|
|
79
|
+
return `${i} ${l} ${o}${u}`;
|
|
80
|
+
}
|
|
81
|
+
if (T())
|
|
82
|
+
return `${R(b(n), l)}${u}`;
|
|
83
|
+
if (U()) {
|
|
84
|
+
const i = n.split(",");
|
|
85
|
+
return `${i.length > 1 ? R(i, l) : n}${u}`;
|
|
86
|
+
}
|
|
87
|
+
return `${n}${u}`;
|
|
88
|
+
}
|
|
89
|
+
export {
|
|
90
|
+
R as bracketJoin,
|
|
91
|
+
h as capitalizeFirstLetter,
|
|
92
|
+
S as getDurationSuffix,
|
|
93
|
+
w as getSuitableValue,
|
|
94
|
+
C as getUserContextValue,
|
|
95
|
+
v as getUserEventLabel,
|
|
96
|
+
b as parseMultiSelectValue
|
|
97
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import "../../../../enums/extensions/strategyDetail.js";
|
|
2
|
+
import "../../../../utils/dateUtil.js";
|
|
3
|
+
const e = "CHEF", o = "MIXED", i = (t) => `recommendation-algorithm-names.${(t || "").replaceAll("_", "-").toLowerCase()}`, n = (t) => ({
|
|
4
|
+
[e]: "discovery-strategy.chef",
|
|
5
|
+
[o]: "discovery-strategy.mixed-algorithm"
|
|
6
|
+
})[t] ?? "discovery-strategy.single-algorithm";
|
|
7
|
+
export {
|
|
8
|
+
i as getAlgorithmTranslationKey,
|
|
9
|
+
n as getMethodTranslationKey
|
|
10
|
+
};
|
|
@@ -9,26 +9,38 @@ const l = [
|
|
|
9
9
|
getValue: (e) => e.currencySettings.value,
|
|
10
10
|
getAvailableOptions: (e) => e.currencyList.map((n) => n.text),
|
|
11
11
|
canBeEmpty: !0
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
// Required only behind the feature flag: with the flag off the block is still
|
|
15
|
+
// driven by its algorithm, so an empty strategyId is the normal state and must
|
|
16
|
+
// not block the save.
|
|
17
|
+
//
|
|
18
|
+
// Deliberately no `getAvailableOptions`: a strategy the partner deleted in
|
|
19
|
+
// Smart Recommender would then fail validation and strand an already-saved
|
|
20
|
+
// template. The panel surfaces that case instead (see `strategy.ts`).
|
|
21
|
+
key: "strategy",
|
|
22
|
+
getValue: (e) => e.strategyId,
|
|
23
|
+
condition: (e, n) => n.isRrsEnabled
|
|
12
24
|
}
|
|
13
|
-
],
|
|
14
|
-
function c(e, n,
|
|
15
|
-
return
|
|
16
|
-
var
|
|
17
|
-
if (t.condition && !t.condition(e))
|
|
25
|
+
], s = "newsletter.recommendation-fill-required-fields";
|
|
26
|
+
function c(e, n, u = l) {
|
|
27
|
+
return u.filter((t) => {
|
|
28
|
+
var i;
|
|
29
|
+
if (t.condition && !t.condition(e, n))
|
|
18
30
|
return !1;
|
|
19
|
-
const
|
|
20
|
-
if (t.canBeEmpty && (
|
|
31
|
+
const a = (i = t.getAvailableOptions) == null ? void 0 : i.call(t, n);
|
|
32
|
+
if (t.canBeEmpty && (a == null ? void 0 : a.length) === 0)
|
|
21
33
|
return !1;
|
|
22
|
-
const
|
|
23
|
-
return
|
|
34
|
+
const r = t.getValue(e);
|
|
35
|
+
return r ? a !== void 0 && !a.includes(r) : !0;
|
|
24
36
|
}).map((t) => t.key);
|
|
25
37
|
}
|
|
26
|
-
function
|
|
38
|
+
function o(e, n) {
|
|
27
39
|
return c(e, n).length === 0;
|
|
28
40
|
}
|
|
29
41
|
export {
|
|
30
42
|
l as REQUIRED_RECOMMENDATION_FIELDS,
|
|
31
|
-
|
|
43
|
+
s as RecommendationRequiredFieldsKey,
|
|
32
44
|
c as getInvalidFields,
|
|
33
|
-
|
|
45
|
+
o as isConfigValid
|
|
34
46
|
};
|
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-73199fa4] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.view-options-wrapper[data-v-
|
|
1
|
+
.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-3ff1b2a9] .in-ag-filter-header{display:none}.condition-data[data-v-ef803818]{gap:4px}.filter-humanizer[data-v-3ecb7de4]{margin:0 -32px}[data-v-6e572ff5] .in-tooltip-wrapper__box{max-width:inherit}[data-v-008cf324] .in-drawer__content{padding:0}.other-details div[data-v-008cf324]:first-child{margin-top:0}[data-v-73199fa4] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.view-options-wrapper[data-v-195ab6d4]{position:relative;display:inline-block}.new-tag[data-v-195ab6d4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-195ab6d4] .guido__view-option-selection-desktop svg,[data-v-195ab6d4] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-195ab6d4] .in-segments-wrapper__button_selected,[data-v-195ab6d4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-195ab6d4] .in-tooltip-wrapper__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-fad98586]{gap:8px}.version-history__toolbar[data-v-fad98586]{gap:4px}.view-options-wrapper[data-v-d405ca59]{position:relative;display:inline-block}.new-tag[data-v-d405ca59]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-d405ca59] .guido__verion-history-view-option-selection-desktop svg,[data-v-d405ca59] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-d405ca59] .in-segments-wrapper__button_selected,[data-v-d405ca59] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-d405ca59] .in-tooltip-wrapper__icon{cursor:pointer}.auto-save-toggle[data-v-2c964af4]{position:relative}.auto-save-toggle__info-box[data-v-2c964af4]{position:absolute;top:100%;left:0;z-index:10;width:280px}.editor-actions[data-v-6e711fd7]{gap:4px}.header-wrapper[data-v-d11dd577]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-f96d1003]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-f96d1003]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-f96d1003]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-91a26acd]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-91a26acd]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-91a26acd]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-91a26acd]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-91a26acd]{object-fit:cover;transform:scale(1)}[data-v-b9a93c6e] .guido__verion-history-view-option-selection-desktop svg,[data-v-b9a93c6e] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-b9a93c6e] .in-segments-wrapper__button_selected,[data-v-b9a93c6e] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-c3fd5d4b]{gap:16px}.desktop-browser-header[data-v-d86c5af5]{height:79px;min-height:79px}.desktop-browser-header__left[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:378px}.desktop-browser-header__center[data-v-d86c5af5]{height:79px;background-repeat:repeat-x;background-size:auto 100%;background-position:left top}.desktop-browser-header__right[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:112px}.desktop-preview[data-v-06afaecb]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-06afaecb]{min-height:504px}.iframe-wrapper[data-v-cbafc185]{width:258px}.iframe-scaled[data-v-cbafc185]{width:320px;height:124.0310077519%;transform:scale(.80625);transform-origin:top left}.cropped-text[data-v-eb3d05d7]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mobile-preview-wrapper__phone[data-v-3f472f96]{width:282px}.mobile-preview-wrapper__phone img[data-v-3f472f96]{object-fit:cover;border-radius:44px}.mobile-preview-wrapper__content[data-v-3f472f96]{width:258px;height:450px;left:12px}[data-v-6bcaca8a] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-f16f20f8] .vueperslides__bullets{pointer-events:none!important}[data-v-f16f20f8] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-bb3cca55] .vueperslides__bullets{pointer-events:none!important}[data-v-bb3cca55] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-b09e80c4] .vueperslides__bullets{pointer-events:none!important}[data-v-b09e80c4] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-9bdef600] .vueperslides__parallax-wrapper{padding-bottom:110px!important}
|
|
@@ -1,52 +1,95 @@
|
|
|
1
1
|
import { useHttp as d } from "../composables/useHttp.js";
|
|
2
|
-
import { QUERY_PARAMS as
|
|
3
|
-
const
|
|
4
|
-
(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
import { QUERY_PARAMS as m, URLS as s, RRS_EMAIL_ACTIVE_FILTER as A } from "../enums/extensions/recommendationBlock.js";
|
|
3
|
+
const h = (t) => {
|
|
4
|
+
if (Array.isArray(t))
|
|
5
|
+
return t;
|
|
6
|
+
const a = !!t && typeof t == "object" && "data" in t, r = t == null ? void 0 : t.data;
|
|
7
|
+
return Array.isArray(r) ? r : (t && (!a || r != null) && console.error("[Guido] Unexpected RRS payload shape, falling back to empty:", Object.keys(t)), []);
|
|
8
|
+
}, l = (t) => !t || typeof t != "object" ? null : "data" in t ? t.data ?? null : Object.keys(t).length ? t : null, f = (t) => t.reduce(
|
|
9
|
+
(a, r, u) => (a[u] = {
|
|
10
|
+
attributeName: r.attributeName,
|
|
11
|
+
attributeJs: r.attributeJs,
|
|
12
|
+
attributeType: r.attributeType,
|
|
13
|
+
type: r.type,
|
|
14
|
+
displayName: r.displayName,
|
|
15
|
+
isFilterable: r.isFilterable
|
|
11
16
|
}, a),
|
|
12
17
|
{}
|
|
13
|
-
),
|
|
14
|
-
const { get:
|
|
18
|
+
), b = () => {
|
|
19
|
+
const { get: t } = d(), { get: a } = d({ headers: {} }), r = "6KcLM9TwheVB1mgK";
|
|
15
20
|
return {
|
|
16
21
|
fetchRecommendationCreateData: async () => {
|
|
17
22
|
try {
|
|
18
|
-
return (await
|
|
23
|
+
return (await t("/newsletter/recommendations/create-data")).data;
|
|
19
24
|
} catch (e) {
|
|
20
|
-
throw console.error("
|
|
25
|
+
throw console.error("fetchRecommendationCreateData error:", e), e;
|
|
21
26
|
}
|
|
22
27
|
},
|
|
23
28
|
fetchRecommendationFilters: async () => {
|
|
24
29
|
try {
|
|
25
|
-
const { data: e } = await
|
|
26
|
-
|
|
27
|
-
),
|
|
28
|
-
return
|
|
30
|
+
const { data: e } = await t(
|
|
31
|
+
s.PRODUCT_ATTRIBUTES_PATH
|
|
32
|
+
), o = Array.isArray(e) ? e : (e == null ? void 0 : e.data) ?? [];
|
|
33
|
+
return f(o);
|
|
29
34
|
} catch (e) {
|
|
30
35
|
throw console.error("fetchRecommendationFilters error:", e), e;
|
|
31
36
|
}
|
|
32
37
|
},
|
|
33
|
-
fetchRecommendationProducts: async (e,
|
|
34
|
-
var
|
|
38
|
+
fetchRecommendationProducts: async (e, o) => {
|
|
39
|
+
var c;
|
|
35
40
|
try {
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
const
|
|
39
|
-
console.debug("🏁 Recommendation API Query:",
|
|
40
|
-
const
|
|
41
|
-
`${
|
|
41
|
+
const n = new URLSearchParams(Object.entries(o));
|
|
42
|
+
n.set(m.CLIENT_ID, r);
|
|
43
|
+
const R = decodeURIComponent(n.toString());
|
|
44
|
+
console.debug("🏁 Recommendation API Query:", R);
|
|
45
|
+
const i = await a(
|
|
46
|
+
`${s.RECOMMENDATION_API_URL}/v2/${e}?${R}`
|
|
42
47
|
);
|
|
43
|
-
return ((
|
|
44
|
-
} catch (
|
|
45
|
-
throw console.error("fetchRecommendationProducts error:",
|
|
48
|
+
return ((c = i == null ? void 0 : i.data) == null ? void 0 : c.data) ?? [];
|
|
49
|
+
} catch (n) {
|
|
50
|
+
throw console.error("fetchRecommendationProducts error:", n), n;
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
fetchRecommendationStrategies: async () => {
|
|
54
|
+
try {
|
|
55
|
+
const e = new URLSearchParams({ [m.FILTERS]: A }), { data: o } = await t(
|
|
56
|
+
`${s.RECOMMENDATION_STRATEGIES_PATH}/?${e.toString()}`
|
|
57
|
+
);
|
|
58
|
+
return h(o);
|
|
59
|
+
} catch (e) {
|
|
60
|
+
throw console.error("fetchRecommendationStrategies error:", e), e;
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
fetchStrategyCampaigns: async (e, o) => {
|
|
64
|
+
try {
|
|
65
|
+
const { data: c } = await t(
|
|
66
|
+
`${s.RECOMMENDATION_STRATEGIES_PATH}/${e}/campaigns`
|
|
67
|
+
);
|
|
68
|
+
return h(c).map((n) => ({
|
|
69
|
+
id: n.id,
|
|
70
|
+
name: n.name,
|
|
71
|
+
status: n.status,
|
|
72
|
+
variants: n.variants ?? [],
|
|
73
|
+
channel: o(`products.${n.productAlias}`),
|
|
74
|
+
productAlias: n.productAlias,
|
|
75
|
+
isPreventing: n.isPreventing
|
|
76
|
+
}));
|
|
77
|
+
} catch (c) {
|
|
78
|
+
return console.error("fetchStrategyCampaigns error:", c), [];
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
fetchStrategyRecommendationUrl: async (e) => {
|
|
82
|
+
try {
|
|
83
|
+
const o = new URLSearchParams({ [m.STRATEGY_ID]: e }), { data: c } = await t(
|
|
84
|
+
`${s.STRATEGY_RECOMMENDATION_URL_PATH}?${o.toString()}`
|
|
85
|
+
);
|
|
86
|
+
return l(c);
|
|
87
|
+
} catch (o) {
|
|
88
|
+
return console.error("fetchStrategyRecommendationUrl error:", o), null;
|
|
46
89
|
}
|
|
47
90
|
}
|
|
48
91
|
};
|
|
49
92
|
};
|
|
50
93
|
export {
|
|
51
|
-
|
|
94
|
+
b as useRecommendationApi
|
|
52
95
|
};
|
|
@@ -377,6 +377,11 @@ export declare const FeaturesSchema: v.ObjectSchema<{
|
|
|
377
377
|
readonly liquidSyntax: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
378
378
|
/** Enable autosave (3-min interval + tab-hide). User toggles on/off from the header. */
|
|
379
379
|
readonly autosave: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
380
|
+
/**
|
|
381
|
+
* Select a Reusable Recommendation Strategy (RRS) instead of a per-block algorithm.
|
|
382
|
+
* Replaces the algorithm dropdown with a strategy dropdown fed from Smart Recommender.
|
|
383
|
+
*/
|
|
384
|
+
readonly reusableRecommendationStrategy: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
380
385
|
}, undefined>;
|
|
381
386
|
/**
|
|
382
387
|
* Default block types available in Stripo
|
|
@@ -764,6 +769,11 @@ export declare const GuidoConfigSchema: v.ObjectSchema<{
|
|
|
764
769
|
readonly liquidSyntax: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
765
770
|
/** Enable autosave (3-min interval + tab-hide). User toggles on/off from the header. */
|
|
766
771
|
readonly autosave: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
772
|
+
/**
|
|
773
|
+
* Select a Reusable Recommendation Strategy (RRS) instead of a per-block algorithm.
|
|
774
|
+
* Replaces the algorithm dropdown with a strategy dropdown fed from Smart Recommender.
|
|
775
|
+
*/
|
|
776
|
+
readonly reusableRecommendationStrategy: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
767
777
|
}, undefined>, {}>;
|
|
768
778
|
/** Block configuration */
|
|
769
779
|
readonly blocks: v.OptionalSchema<v.ObjectSchema<{
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Campaigns a strategy is used in — the drawer's second tab.
|
|
3
|
+
*
|
|
4
|
+
* Ported from design-system-organisms
|
|
5
|
+
* `src/organisms/OrgStrategyDetailModal/components/CampaignTable.vue`.
|
|
6
|
+
*
|
|
7
|
+
* DS 1.3.0 note: the source passed `is-wrapper-box` and `skeleton-status` to
|
|
8
|
+
* `InDataTableV2`. Neither prop exists at this version, so both are dropped —
|
|
9
|
+
* loading state is expressed through `loading-status` alone.
|
|
10
|
+
*/
|
|
11
|
+
import type { RrsCampaign } from '@@/Types/recommendation';
|
|
12
|
+
type __VLS_Props = {
|
|
13
|
+
campaigns?: RrsCampaign[];
|
|
14
|
+
loading?: boolean;
|
|
15
|
+
};
|
|
16
|
+
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
|
|
17
|
+
campaigns: () => never[];
|
|
18
|
+
loading: boolean;
|
|
19
|
+
}>, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
|
|
20
|
+
campaigns: () => never[];
|
|
21
|
+
loading: boolean;
|
|
22
|
+
}>>>, {
|
|
23
|
+
campaigns: RrsCampaign[];
|
|
24
|
+
loading: boolean;
|
|
25
|
+
}>;
|
|
26
|
+
export default _default;
|
|
27
|
+
type __VLS_WithDefaults<P, D> = {
|
|
28
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
|
|
29
|
+
default: D[K];
|
|
30
|
+
}> : P[K];
|
|
31
|
+
};
|
|
32
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
33
|
+
type __VLS_TypePropsToOption<T> = {
|
|
34
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
35
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
36
|
+
} : {
|
|
37
|
+
type: import('vue').PropType<T[K]>;
|
|
38
|
+
required: true;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
type __VLS_PrettifyLocal<T> = {
|
|
42
|
+
[K in keyof T]: T[K];
|
|
43
|
+
} & {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
/** Raw `filters` JSON exactly as the strategy stores it. */
|
|
3
|
+
filters?: string;
|
|
4
|
+
};
|
|
5
|
+
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
|
|
6
|
+
filters: string;
|
|
7
|
+
}>, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
|
|
8
|
+
filters: string;
|
|
9
|
+
}>>>, {
|
|
10
|
+
filters: string;
|
|
11
|
+
}>;
|
|
12
|
+
export default _default;
|
|
13
|
+
type __VLS_WithDefaults<P, D> = {
|
|
14
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
|
|
15
|
+
default: D[K];
|
|
16
|
+
}> : P[K];
|
|
17
|
+
};
|
|
18
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
19
|
+
type __VLS_TypePropsToOption<T> = {
|
|
20
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
21
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
22
|
+
} : {
|
|
23
|
+
type: import('vue').PropType<T[K]>;
|
|
24
|
+
required: true;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
type __VLS_PrettifyLocal<T> = {
|
|
28
|
+
[K in keyof T]: T[K];
|
|
29
|
+
} & {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One humanized filter condition, e.g. "Product type · does not contain [Shirt]".
|
|
3
|
+
*
|
|
4
|
+
* Ported from design-system-organisms
|
|
5
|
+
* `src/organisms/OrgStrategyDetailModal/components/HumanizerCondition.vue`.
|
|
6
|
+
*
|
|
7
|
+
* DS 1.3.0 note: `InStatusText` has no `color` prop and requires `status`. The source
|
|
8
|
+
* passed `color="grey"`; `status="draft"` is the grey pair at this version.
|
|
9
|
+
*/
|
|
10
|
+
import type { RrsDetailCondition } from '@@/Types/recommendation';
|
|
11
|
+
type __VLS_Props = {
|
|
12
|
+
condition: RrsDetailCondition;
|
|
13
|
+
index: number;
|
|
14
|
+
isLast?: boolean;
|
|
15
|
+
};
|
|
16
|
+
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
|
|
17
|
+
isLast: boolean;
|
|
18
|
+
}>, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
|
|
19
|
+
isLast: boolean;
|
|
20
|
+
}>>>, {
|
|
21
|
+
isLast: boolean;
|
|
22
|
+
}>;
|
|
23
|
+
export default _default;
|
|
24
|
+
type __VLS_WithDefaults<P, D> = {
|
|
25
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
|
|
26
|
+
default: D[K];
|
|
27
|
+
}> : P[K];
|
|
28
|
+
};
|
|
29
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
30
|
+
type __VLS_TypePropsToOption<T> = {
|
|
31
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
32
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
33
|
+
} : {
|
|
34
|
+
type: import('vue').PropType<T[K]>;
|
|
35
|
+
required: true;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
type __VLS_PrettifyLocal<T> = {
|
|
39
|
+
[K in keyof T]: T[K];
|
|
40
|
+
} & {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One filter group: its conditions, plus the AND/OR chip joining it to the next group.
|
|
3
|
+
*
|
|
4
|
+
* Ported from design-system-organisms
|
|
5
|
+
* `src/organisms/OrgStrategyDetailModal/components/HumanizerGroup.vue`.
|
|
6
|
+
*/
|
|
7
|
+
import type { RrsDetailCondition, RrsDetailFilterGroup } from '@@/Types/recommendation';
|
|
8
|
+
type __VLS_Props = {
|
|
9
|
+
filters: Record<string, RrsDetailFilterGroup>;
|
|
10
|
+
conditionList: RrsDetailCondition[];
|
|
11
|
+
groupIndex: string;
|
|
12
|
+
groupLogic?: string;
|
|
13
|
+
};
|
|
14
|
+
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
|
|
15
|
+
groupLogic: string;
|
|
16
|
+
}>, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
|
|
17
|
+
groupLogic: string;
|
|
18
|
+
}>>>, {
|
|
19
|
+
groupLogic: string;
|
|
20
|
+
}>;
|
|
21
|
+
export default _default;
|
|
22
|
+
type __VLS_WithDefaults<P, D> = {
|
|
23
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
|
|
24
|
+
default: D[K];
|
|
25
|
+
}> : P[K];
|
|
26
|
+
};
|
|
27
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
28
|
+
type __VLS_TypePropsToOption<T> = {
|
|
29
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
30
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
31
|
+
} : {
|
|
32
|
+
type: import('vue').PropType<T[K]>;
|
|
33
|
+
required: true;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
type __VLS_PrettifyLocal<T> = {
|
|
37
|
+
[K in keyof T]: T[K];
|
|
38
|
+
} & {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
index: number;
|
|
3
|
+
title: string;
|
|
4
|
+
value: string;
|
|
5
|
+
/** When true, each comma-part of `value` is a translation key rather than a literal. */
|
|
6
|
+
translateValue?: boolean;
|
|
7
|
+
icon?: string;
|
|
8
|
+
iconTooltip?: string;
|
|
9
|
+
/** Shown briefly after the icon is clicked, e.g. "Copied". */
|
|
10
|
+
iconTooltipAfterClicked?: string;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
};
|
|
13
|
+
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
|
|
14
|
+
translateValue: boolean;
|
|
15
|
+
icon: string;
|
|
16
|
+
iconTooltip: string;
|
|
17
|
+
iconTooltipAfterClicked: string;
|
|
18
|
+
disabled: boolean;
|
|
19
|
+
}>, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {
|
|
20
|
+
iconClick: () => void;
|
|
21
|
+
}, string, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
|
|
22
|
+
translateValue: boolean;
|
|
23
|
+
icon: string;
|
|
24
|
+
iconTooltip: string;
|
|
25
|
+
iconTooltipAfterClicked: string;
|
|
26
|
+
disabled: boolean;
|
|
27
|
+
}>>>, {
|
|
28
|
+
icon: string;
|
|
29
|
+
disabled: boolean;
|
|
30
|
+
translateValue: boolean;
|
|
31
|
+
iconTooltip: string;
|
|
32
|
+
iconTooltipAfterClicked: string;
|
|
33
|
+
}>;
|
|
34
|
+
export default _default;
|
|
35
|
+
type __VLS_WithDefaults<P, D> = {
|
|
36
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
|
|
37
|
+
default: D[K];
|
|
38
|
+
}> : P[K];
|
|
39
|
+
};
|
|
40
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
41
|
+
type __VLS_TypePropsToOption<T> = {
|
|
42
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
43
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
44
|
+
} : {
|
|
45
|
+
type: import('vue').PropType<T[K]>;
|
|
46
|
+
required: true;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
type __VLS_PrettifyLocal<T> = {
|
|
50
|
+
[K in keyof T]: T[K];
|
|
51
|
+
} & {};
|
|
@@ -96,6 +96,7 @@ export declare const useConfig: () => {
|
|
|
96
96
|
modulesDisabled: boolean;
|
|
97
97
|
liquidSyntax: boolean;
|
|
98
98
|
autosave: boolean;
|
|
99
|
+
reusableRecommendationStrategy: boolean;
|
|
99
100
|
};
|
|
100
101
|
blocks: {
|
|
101
102
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -227,6 +228,7 @@ export declare const useConfig: () => {
|
|
|
227
228
|
modulesDisabled: boolean;
|
|
228
229
|
liquidSyntax: boolean;
|
|
229
230
|
autosave: boolean;
|
|
231
|
+
reusableRecommendationStrategy: boolean;
|
|
230
232
|
} | null>;
|
|
231
233
|
blocks: import("vue").ComputedRef<{
|
|
232
234
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -18,6 +18,8 @@ export declare const useRecommendation: () => {
|
|
|
18
18
|
getRecommendationCampaignData: (id: string) => CampaignData;
|
|
19
19
|
buildCampaignUrl: (campaignId: string, overrides?: {
|
|
20
20
|
strategy: string;
|
|
21
|
+
/** RRS strategy id; empty string when the block still uses an algorithm. */
|
|
22
|
+
strategyId: string;
|
|
21
23
|
language: string;
|
|
22
24
|
currencyCode: string;
|
|
23
25
|
size: string;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parses a strategy's `filters` JSON into groups and caps how many are shown.
|
|
3
|
+
*
|
|
4
|
+
* Ported from design-system-organisms
|
|
5
|
+
* `src/organisms/OrgStrategyDetailModal/composables/useFilters.ts` (branch `develop`).
|
|
6
|
+
*
|
|
7
|
+
* The drawer lists two filter groups by default and reveals the rest behind a
|
|
8
|
+
* "Show more" toggle, so a strategy with a dozen groups cannot push the campaign
|
|
9
|
+
* tab off the screen.
|
|
10
|
+
*/
|
|
11
|
+
import type { RrsDetailFilterGroup } from '@@/Types/recommendation';
|
|
12
|
+
import { type ComputedRef, type Ref } from 'vue';
|
|
13
|
+
export interface UseStrategyFilters {
|
|
14
|
+
filterQuery: ComputedRef<Record<string, RrsDetailFilterGroup>>;
|
|
15
|
+
hasAnyFilter: ComputedRef<boolean>;
|
|
16
|
+
canToggle: ComputedRef<boolean>;
|
|
17
|
+
isCollapsed: Ref<boolean>;
|
|
18
|
+
toggleMore: () => void;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* @param filters - Getter for the raw `filters` JSON string, so the caller can pass a
|
|
22
|
+
* reactive prop without this composable needing to know about props.
|
|
23
|
+
*/
|
|
24
|
+
export declare function useStrategyFilters(filters: () => string | undefined): UseStrategyFilters;
|