@useinsider/guido 3.12.0-beta.98baf2f → 3.12.0-beta.aa6f9ba
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 +13 -8
- package/dist/components/Guido.vue.js +6 -6
- package/dist/components/Guido.vue2.js +50 -49
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +1 -1
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +8 -8
- package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +5 -5
- package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue2.js +10 -10
- 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/composables/usePreviewInteractionGuard.js +36 -11
- package/dist/composables/useRecommendation.js +82 -51
- package/dist/composables/useRecommendationPreview.js +61 -60
- package/dist/composables/useStrategyFilters.js +16 -0
- package/dist/composables/useStripoEventHandler.js +9 -12
- 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/controlIds.js +1 -1
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +12 -11
- package/dist/extensions/Blocks/Recommendation/controls/blockBackground/index.js +10 -0
- 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/extension.js +23 -21
- package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +1 -1
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +41 -40
- 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/extensions/Blocks/Unsubscribe/utils/constants.js +3 -2
- package/dist/extensions/Blocks/controlFactories.js +125 -75
- package/dist/guido.css +1 -1
- package/dist/services/recommendationApi.js +72 -29
- package/dist/services/stripoApi.js +27 -28
- 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/usePreviewInteractionGuard.d.ts +1 -1
- 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/constants/controlIds.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/blockBackground/index.d.ts +14 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +1 -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/extensions/Blocks/Unsubscribe/utils/constants.d.ts +1 -0
- package/dist/src/extensions/Blocks/controlFactories.d.ts +36 -0
- 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/src/utils/urlSchemes.d.ts +6 -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/dist/utils/urlSchemes.js +4 -0
- package/package.json +1 -1
|
@@ -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
|
};
|
|
@@ -2,78 +2,77 @@ import { useHttp as d } from "../composables/useHttp.js";
|
|
|
2
2
|
import { useToaster as m } from "../composables/useToaster.js";
|
|
3
3
|
import { MAX_DEFAULT_TEMPLATE_ID as y } from "../enums/defaults.js";
|
|
4
4
|
import { useBlankTemplate as f } from "./blankTemplate.js";
|
|
5
|
-
const
|
|
6
|
-
const { get:
|
|
5
|
+
const D = () => {
|
|
6
|
+
const { get: s, post: u } = d(), { handleError: r } = m(), { getBlankTemplate: o } = f();
|
|
7
7
|
return {
|
|
8
8
|
getToken: async () => {
|
|
9
9
|
try {
|
|
10
|
-
const { data: t } = await
|
|
10
|
+
const { data: t } = await s("/stripo/get-user-token");
|
|
11
11
|
return t.body.token;
|
|
12
12
|
} catch (t) {
|
|
13
|
-
return
|
|
13
|
+
return r(t, "Failed to fetch token"), "";
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
16
|
getCustomFonts: async () => {
|
|
17
17
|
try {
|
|
18
|
-
const { data: t = [] } = await
|
|
18
|
+
const { data: t = [] } = await s("/stripo/get-partner-custom-fonts");
|
|
19
19
|
return t.map((e) => ({
|
|
20
20
|
...e,
|
|
21
21
|
active: !0
|
|
22
22
|
}));
|
|
23
23
|
} catch (t) {
|
|
24
|
-
return
|
|
24
|
+
return r(t, "Failed to fetch custom fonts"), [];
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
27
|
getDefaultTemplate: async () => {
|
|
28
28
|
try {
|
|
29
|
-
const t = new URLSearchParams(window.location.search), e = t.get("default-template"),
|
|
30
|
-
if (!
|
|
31
|
-
return await
|
|
32
|
-
const p = `/stripo/default-template/${
|
|
33
|
-
return !
|
|
29
|
+
const t = new URLSearchParams(window.location.search), e = t.get("default-template"), l = t.get("master"), n = e ? parseInt(e) : 0, i = n >= 1 && n <= y ? n : 0;
|
|
30
|
+
if (!i && !l)
|
|
31
|
+
return await o();
|
|
32
|
+
const p = `/stripo/default-template/${i}`, { data: c } = await s(p), a = typeof c == "string" ? JSON.parse(c) : c;
|
|
33
|
+
return !a || typeof a != "object" || !("html" in a) || !("css" in a) ? await o() : a;
|
|
34
34
|
} catch (t) {
|
|
35
|
-
return
|
|
35
|
+
return r(t, "Failed to fetch default template"), o();
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
38
|
getSyncModulesStatus: async () => {
|
|
39
39
|
try {
|
|
40
|
-
const { data: t } = await
|
|
40
|
+
const { data: t } = await s("/newsletter/settings/synchronisation-in-modules-status");
|
|
41
41
|
return t.status;
|
|
42
42
|
} catch (t) {
|
|
43
|
-
return
|
|
43
|
+
return r(t, "Failed to fetch sync modules status"), !1;
|
|
44
44
|
}
|
|
45
45
|
},
|
|
46
46
|
updateSyncModule: async (t) => {
|
|
47
47
|
try {
|
|
48
|
-
return await
|
|
48
|
+
return await u(`/stripo/stripo-modules/${t.moduleId}/update`), !0;
|
|
49
49
|
} catch (e) {
|
|
50
|
-
return
|
|
50
|
+
return r(e, "Failed to update sync module"), !1;
|
|
51
51
|
}
|
|
52
52
|
},
|
|
53
53
|
getSyncModule: async (t) => {
|
|
54
|
-
const e = {
|
|
55
|
-
id: 0,
|
|
56
|
-
stripoId: 0,
|
|
57
|
-
unsubscriptionPreferencePages: []
|
|
58
|
-
};
|
|
59
54
|
try {
|
|
60
|
-
const { data:
|
|
61
|
-
return
|
|
62
|
-
} catch (
|
|
63
|
-
return
|
|
55
|
+
const { data: e } = await s(`/stripo/stripo-modules/${t}/get`);
|
|
56
|
+
return e;
|
|
57
|
+
} catch (e) {
|
|
58
|
+
return r(e, "Failed to get sync module"), {
|
|
59
|
+
id: 0,
|
|
60
|
+
stripoId: 0,
|
|
61
|
+
unsubscriptionPreferencePages: []
|
|
62
|
+
};
|
|
64
63
|
}
|
|
65
64
|
},
|
|
66
65
|
setSyncModuleUnsubscriptionPages: async (t) => {
|
|
67
66
|
if (t.length === 0)
|
|
68
67
|
return !0;
|
|
69
68
|
try {
|
|
70
|
-
return await
|
|
69
|
+
return await u("/stripo/stripo-modules/set-unsubscription-preference-pages", t), !0;
|
|
71
70
|
} catch (e) {
|
|
72
|
-
return
|
|
71
|
+
return r(e, "Failed to set unsubscription preference pages"), !1;
|
|
73
72
|
}
|
|
74
73
|
}
|
|
75
74
|
};
|
|
76
75
|
};
|
|
77
76
|
export {
|
|
78
|
-
|
|
77
|
+
D as useStripoApi
|
|
79
78
|
};
|
|
@@ -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;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Filtering enums for Reusable Recommendation Strategies (RRS).
|
|
3
|
+
*
|
|
4
|
+
* Ported verbatim from discovery-strategies-fe `src/enums/FilteringEnumsV2.js`
|
|
5
|
+
* (branch `develop`). Only the subset the strategy info-box / humanizer needs is
|
|
6
|
+
* carried over: `Operators`, `OperatorAbbreviations`, `DataTypes`,
|
|
7
|
+
* `MultiSelectDataTypes`, `OperatorNames`, `TimeAbbreviations`.
|
|
8
|
+
*
|
|
9
|
+
* Guido has no equivalent — `utils/filterUtil.ts` and `validation/filterSchema.ts`
|
|
10
|
+
* serve the recommendation block's filters, which are a different shape from a
|
|
11
|
+
* strategy's filters. Do not merge the two.
|
|
12
|
+
*
|
|
13
|
+
* The `text` values are translation keys, not literals; resolve them through
|
|
14
|
+
* `useTranslations().trans()`.
|
|
15
|
+
*
|
|
16
|
+
* ponytail: kept as a literal copy rather than a re-derivation so it stays easy
|
|
17
|
+
* to diff against the source when Smart Recommender adds an operator.
|
|
18
|
+
*/
|
|
19
|
+
/** A single operator option, keyed under its attribute data type. */
|
|
20
|
+
export interface OperatorDefinition {
|
|
21
|
+
value: string;
|
|
22
|
+
text: string;
|
|
23
|
+
operator: string;
|
|
24
|
+
/** Alternative label used when the strategy targets the cart page. */
|
|
25
|
+
cartPageText?: string;
|
|
26
|
+
/** Absent on the `Object` data type in the source. */
|
|
27
|
+
filterType?: string;
|
|
28
|
+
}
|
|
29
|
+
export declare const Operators: Record<string, OperatorDefinition[]>;
|
|
30
|
+
export declare const TimeAbbreviations: {
|
|
31
|
+
readonly WEEK: "w";
|
|
32
|
+
readonly DAY: "d";
|
|
33
|
+
readonly HOUR: "h";
|
|
34
|
+
};
|
|
35
|
+
export declare const OperatorAbbreviations: {
|
|
36
|
+
readonly OPERATOR: {
|
|
37
|
+
readonly IN_LAST: "in-last";
|
|
38
|
+
readonly IS_EMPTY: "is-empty";
|
|
39
|
+
readonly IS_NOT_EMPTY: "is-not-empty";
|
|
40
|
+
readonly IN_BETWEEN: "is-between";
|
|
41
|
+
readonly IS_TRUE: "true";
|
|
42
|
+
readonly IS_FALSE: "false";
|
|
43
|
+
};
|
|
44
|
+
readonly OPERATOR_EXPRESSION: {
|
|
45
|
+
readonly IS_EMPTY: "?";
|
|
46
|
+
readonly IS_NOT_EMPTY: "!?";
|
|
47
|
+
};
|
|
48
|
+
readonly DATE_PICKER_OPERATORS: readonly ["after", "before", "is", "is-not"];
|
|
49
|
+
readonly NON_INPUT_OPERATORS: readonly ["in", "not-in", "after", "before", "is", "is-not", "is-empty", "is-not-empty"];
|
|
50
|
+
readonly CHIPS_WIDGET_OPERATORS: readonly ["in", "not-in"];
|
|
51
|
+
};
|
|
52
|
+
export declare const DataTypes: {
|
|
53
|
+
readonly STRING: "String";
|
|
54
|
+
readonly BOOLEAN: "Boolean";
|
|
55
|
+
readonly DATE: "Date";
|
|
56
|
+
readonly NUMBER: "Number";
|
|
57
|
+
readonly TEXT: "Text";
|
|
58
|
+
readonly URL: "Image";
|
|
59
|
+
readonly NUMBERS: "Numbers";
|
|
60
|
+
readonly DATES: "Dates";
|
|
61
|
+
readonly BOOLEANS: "Booleans";
|
|
62
|
+
readonly STRINGS: "Strings";
|
|
63
|
+
};
|
|
64
|
+
export declare const MultiSelectDataTypes: readonly ["Strings", "String", "Array"];
|
|
65
|
+
export declare const OperatorNames: {
|
|
66
|
+
readonly IS_EXACTLY: "is-exactly";
|
|
67
|
+
readonly IS_NOT_EXACTLY: "is-not-exactly";
|
|
68
|
+
readonly CONTAINS: "contains";
|
|
69
|
+
readonly NOT_CONTAINS: "does-not-contain";
|
|
70
|
+
readonly IN: "in";
|
|
71
|
+
readonly NOT_IN: "not-in";
|
|
72
|
+
};
|
|
@@ -3,10 +3,20 @@ import type { RecommendationFeedItem } from '@@/Types/recommendation';
|
|
|
3
3
|
export declare const URLS: {
|
|
4
4
|
RECOMMENDATION_API_URL: string;
|
|
5
5
|
PRODUCT_ATTRIBUTES_PATH: string;
|
|
6
|
+
RECOMMENDATION_STRATEGIES_PATH: string;
|
|
7
|
+
STRATEGY_RECOMMENDATION_URL_PATH: string;
|
|
6
8
|
};
|
|
7
9
|
export declare const QUERY_PARAMS: {
|
|
8
10
|
CLIENT_ID: string;
|
|
11
|
+
STRATEGY_ID: string;
|
|
12
|
+
FILTERS: string;
|
|
9
13
|
};
|
|
14
|
+
/**
|
|
15
|
+
* Smart Recommender's filter grammar: `[table.field][operator][value]`, ANDed with `*`.
|
|
16
|
+
* `~` means "contains" — required because `suitable_channels` is a comma-separated
|
|
17
|
+
* column, so `=` would only ever match single-channel strategies.
|
|
18
|
+
*/
|
|
19
|
+
export declare const RRS_EMAIL_ACTIVE_FILTER = "[sr_strategies.status][=][active]*[sr_strategies.suitable_channels][~][EMAIL]";
|
|
10
20
|
/**
|
|
11
21
|
* Get recommendation feed source maps lazily so translated names resolve at access time.
|
|
12
22
|
* Must be called within a Vue component context or after Pinia is initialized.
|