@useinsider/guido 3.12.0-beta.840207a → 3.12.0-beta.841bb6a
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 +8 -13
- package/dist/components/Guido.vue.js +6 -6
- package/dist/components/Guido.vue2.js +49 -50
- package/dist/composables/useRecommendation.js +51 -82
- package/dist/config/migrator/recommendationMigrator.js +4 -7
- package/dist/enums/date.js +3 -4
- package/dist/enums/extensions/recommendationBlock.js +22 -28
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +11 -12
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +109 -123
- package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +1 -1
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +102 -256
- package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +12 -24
- package/dist/guido.css +1 -1
- package/dist/services/recommendationApi.js +29 -72
- package/dist/src/@types/config/schemas.d.ts +0 -10
- package/dist/src/composables/useConfig.d.ts +0 -2
- package/dist/src/composables/useRecommendation.d.ts +0 -2
- package/dist/src/enums/extensions/recommendationBlock.d.ts +0 -10
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +1 -3
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +1 -606
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +0 -7
- package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +1 -3
- package/dist/src/services/recommendationApi.d.ts +1 -7
- package/dist/src/stores/config.d.ts +0 -18
- package/dist/src/utils/genericUtil.d.ts +0 -9
- package/dist/static/styles/base.css.js +0 -15
- package/dist/utils/dateUtil.js +10 -23
- package/dist/utils/genericUtil.js +1 -10
- package/dist/utils/pairProductVariables.js +44 -43
- package/dist/utils/templatePreparation.js +58 -62
- package/package.json +1 -1
- package/dist/components/organisms/extensions/recommendation/StrategyDetailDrawer.vue.js +0 -36
- package/dist/components/organisms/extensions/recommendation/StrategyDetailDrawer.vue2.js +0 -244
- package/dist/components/organisms/extensions/recommendation/strategy-detail/CampaignTable.vue.js +0 -18
- package/dist/components/organisms/extensions/recommendation/strategy-detail/CampaignTable.vue2.js +0 -42
- package/dist/components/organisms/extensions/recommendation/strategy-detail/FilterHumanizer.vue.js +0 -20
- package/dist/components/organisms/extensions/recommendation/strategy-detail/FilterHumanizer.vue2.js +0 -18
- package/dist/components/organisms/extensions/recommendation/strategy-detail/HumanizerCondition.vue.js +0 -20
- package/dist/components/organisms/extensions/recommendation/strategy-detail/HumanizerCondition.vue2.js +0 -60
- package/dist/components/organisms/extensions/recommendation/strategy-detail/HumanizerGroup.vue.js +0 -19
- package/dist/components/organisms/extensions/recommendation/strategy-detail/HumanizerGroup.vue2.js +0 -19
- package/dist/components/organisms/extensions/recommendation/strategy-detail/InfoDisplayValue.vue.js +0 -22
- package/dist/components/organisms/extensions/recommendation/strategy-detail/InfoDisplayValue.vue2.js +0 -29
- package/dist/composables/useStrategyFilters.js +0 -16
- package/dist/enums/extensions/filteringV2.js +0 -8
- package/dist/enums/extensions/strategyDetail.js +0 -148
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +0 -146
- package/dist/extensions/Blocks/Recommendation/utils/strategyHumanizer.js +0 -97
- package/dist/extensions/Blocks/Recommendation/utils/strategySummary.js +0 -10
- package/dist/src/components/organisms/extensions/recommendation/StrategyDetailDrawer.vue.d.ts +0 -2
- package/dist/src/components/organisms/extensions/recommendation/strategy-detail/CampaignTable.vue.d.ts +0 -43
- package/dist/src/components/organisms/extensions/recommendation/strategy-detail/FilterHumanizer.vue.d.ts +0 -29
- package/dist/src/components/organisms/extensions/recommendation/strategy-detail/HumanizerCondition.vue.d.ts +0 -40
- package/dist/src/components/organisms/extensions/recommendation/strategy-detail/HumanizerGroup.vue.d.ts +0 -38
- package/dist/src/components/organisms/extensions/recommendation/strategy-detail/InfoDisplayValue.vue.d.ts +0 -51
- package/dist/src/composables/useStrategyFilters.d.ts +0 -24
- package/dist/src/enums/extensions/filteringV2.d.ts +0 -72
- package/dist/src/enums/extensions/strategyDetail.d.ts +0 -90
- package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +0 -61
- package/dist/src/extensions/Blocks/Recommendation/utils/strategyHumanizer.d.ts +0 -50
- package/dist/src/extensions/Blocks/Recommendation/utils/strategySummary.d.ts +0 -34
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
const a = "TIME", r = "COUNT", o = {
|
|
2
|
-
OPERATOR: {
|
|
3
|
-
IN_LAST: "in-last",
|
|
4
|
-
IN_BETWEEN: "is-between",
|
|
5
|
-
IN: "in",
|
|
6
|
-
NOT_IN: "not-in"
|
|
7
|
-
}
|
|
8
|
-
}, e = [
|
|
9
|
-
{ value: "is-exactly", text: "campaign-builder.exactly", operator: "=" },
|
|
10
|
-
{ value: "is-not-exactly", text: "action-builder.is-not-exactly", operator: "!=" },
|
|
11
|
-
{ value: "contains", text: "campaign-builder.contains", operator: "~" },
|
|
12
|
-
{ value: "does-not-contain", text: "campaign-builder.does-not-contain", operator: "!~" },
|
|
13
|
-
{ value: "in", text: "smart-recommender.in", operator: "=" },
|
|
14
|
-
{ value: "not-in", text: "campaign-builder.not-in", operator: "!=" },
|
|
15
|
-
{ value: "matches-with", text: "discovery-strategy-filtering.matches-with", operator: "=" },
|
|
16
|
-
{ value: "does-not-match-with", text: "discovery-strategy-filtering.does-not-match-with", operator: "!=" },
|
|
17
|
-
{ value: "contains-user-context", text: "campaign-builder.contains", operator: "~" },
|
|
18
|
-
{ value: "does-not-contain-user-context", text: "campaign-builder.does-not-contain", operator: "!~" }
|
|
19
|
-
], t = [
|
|
20
|
-
{ value: "is-equal-to", text: "campaign-builder.equal-to", operator: "=" },
|
|
21
|
-
{ value: "is-not-equal-to", text: "smart-recommender.is-not-equal-to", operator: "!=" },
|
|
22
|
-
{ value: "is-greater-than", text: "campaign-builder.greater-than", operator: ">" },
|
|
23
|
-
{ value: "is-less-than", text: "campaign-builder.less-than", operator: "<" },
|
|
24
|
-
{ value: "is-greater-than-or-equal", text: "campaign-builder.greater-than-or-equal-to", operator: ">=" },
|
|
25
|
-
{ value: "is-less-than-or-equal", text: "campaign-builder.less-than-or-equal-to", operator: "<=" },
|
|
26
|
-
{ value: "is-between", text: "smart-recommender.in-between", operator: "><" },
|
|
27
|
-
{ value: "in", text: "smart-recommender.in", operator: "=" },
|
|
28
|
-
{ value: "not-in", text: "campaign-builder.not-in", operator: "!=" },
|
|
29
|
-
{ value: "is-exactly", text: "campaign-builder.exactly", operator: "=" }
|
|
30
|
-
], i = {
|
|
31
|
-
Number: [
|
|
32
|
-
...t,
|
|
33
|
-
{ value: "matches-with", text: "discovery-strategy-filtering.matches-with", operator: "=" },
|
|
34
|
-
{ value: "does-not-match-with", text: "discovery-strategy-filtering.does-not-match-with", operator: "!=" },
|
|
35
|
-
{ value: "is-greater-than-user-context", text: "campaign-builder.greater-than", operator: ">" },
|
|
36
|
-
{ value: "is-less-than-user-context", text: "campaign-builder.less-than", operator: "<" },
|
|
37
|
-
{
|
|
38
|
-
value: "is-greater-than-or-equal-user-context",
|
|
39
|
-
text: "campaign-builder.greater-than-or-equal-to",
|
|
40
|
-
operator: ">="
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
value: "is-less-than-or-equal-user-context",
|
|
44
|
-
text: "campaign-builder.less-than-or-equal-to",
|
|
45
|
-
operator: "<="
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
value: "is-more-than-currently-viewing-item-page-context",
|
|
49
|
-
text: "discovery-strategy-filtering.in-range-greater-than",
|
|
50
|
-
operator: "><"
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
value: "is-less-than-currently-viewing-item-page-context",
|
|
54
|
-
text: "discovery-strategy-filtering.in-range-less-than",
|
|
55
|
-
operator: "><"
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
value: "is-more-or-less-than-currently-viewing-item-page-context",
|
|
59
|
-
text: "discovery-strategy-filtering.in-range-less-or-greater-than",
|
|
60
|
-
operator: "><"
|
|
61
|
-
}
|
|
62
|
-
],
|
|
63
|
-
String: e,
|
|
64
|
-
"Array[String]": e,
|
|
65
|
-
Array: e,
|
|
66
|
-
Strings: e,
|
|
67
|
-
Numbers: e,
|
|
68
|
-
Booleans: e,
|
|
69
|
-
Dates: [
|
|
70
|
-
{ value: "is-exactly", text: "campaign-builder.exactly", operator: "=" },
|
|
71
|
-
{ value: "is-not-exactly", text: "action-builder.is-not-exactly", operator: "!=" },
|
|
72
|
-
{ value: "contains", text: "campaign-builder.contains", operator: "~" },
|
|
73
|
-
{ value: "does-not-contain", text: "campaign-builder.does-not-contain", operator: "!~" },
|
|
74
|
-
{ value: "in", text: "smart-recommender.in", operator: "=" },
|
|
75
|
-
{ value: "not-in", text: "campaign-builder.not-in", operator: "!=" }
|
|
76
|
-
],
|
|
77
|
-
Boolean: [
|
|
78
|
-
{ value: "true", text: "smart-recommender.is-true", operator: "=" },
|
|
79
|
-
{ value: "false", text: "smart-recommender.is-false", operator: "=" }
|
|
80
|
-
],
|
|
81
|
-
Image: [
|
|
82
|
-
{ value: "is-equal-to", text: "campaign-builder.exactly", operator: "=" },
|
|
83
|
-
{ value: "contains", text: "campaign-builder.contains", operator: "~" },
|
|
84
|
-
{ value: "does-not-contain", text: "campaign-builder.does-not-contain", operator: "!~" },
|
|
85
|
-
{ value: "is-empty", text: "condition.empty", operator: "?" },
|
|
86
|
-
{ value: "is-not-empty", text: "condition.not-empty", operator: "!?" }
|
|
87
|
-
],
|
|
88
|
-
Date: [
|
|
89
|
-
{ value: "after", text: "campaign-builder.after", operator: ">" },
|
|
90
|
-
{ value: "before", text: "campaign-builder.before", operator: "<" },
|
|
91
|
-
{ value: "is", text: "campaign-builder.is", operator: "=" },
|
|
92
|
-
{ value: "is-not", text: "campaign-builder.is-not", operator: "!=" },
|
|
93
|
-
{ value: "in-last", text: "purchase-history.in-last", operator: "<=" },
|
|
94
|
-
{ value: "matches-with", text: "discovery-strategy-filtering.matches-with", operator: "=" },
|
|
95
|
-
{ value: "does-not-match-with", text: "discovery-strategy-filtering.does-not-match-with", operator: "!=" },
|
|
96
|
-
{ value: "after-user-context", text: "campaign-builder.after", operator: ">" },
|
|
97
|
-
{ value: "before-user-context", text: "campaign-builder.before", operator: "<" }
|
|
98
|
-
],
|
|
99
|
-
Object: t
|
|
100
|
-
}, n = {
|
|
101
|
-
STRING: "String",
|
|
102
|
-
DATE: "Date"
|
|
103
|
-
}, s = ["Strings", "String", "Array"], l = {
|
|
104
|
-
IS_EXACTLY: "is-exactly",
|
|
105
|
-
IS_NOT_EXACTLY: "is-not-exactly",
|
|
106
|
-
CONTAINS: "contains",
|
|
107
|
-
NOT_CONTAINS: "does-not-contain"
|
|
108
|
-
}, c = {
|
|
109
|
-
USER_CONTEXT_FILTER: "userContextFilter",
|
|
110
|
-
USER_ATTRIBUTE_FILTER: "userAttributeFilter",
|
|
111
|
-
USER_EVENT_FILTER: "userEventFilter",
|
|
112
|
-
EVENT_BASED_FILTER: "eventBasedFilter"
|
|
113
|
-
}, u = {
|
|
114
|
-
CURRENTLY_VIEWED_ITEM: "page",
|
|
115
|
-
LEGACY_CURRENTLY_VIEWED_ITEM: "currentlyViewedItem"
|
|
116
|
-
}, p = [
|
|
117
|
-
{ value: "lastViewed", text: "discovery-strategy-filtering.users-last-viewed" },
|
|
118
|
-
{ value: "lastPurchased", text: "discovery-strategy-filtering.users-last-purchased" },
|
|
119
|
-
{ value: "lastAddedToCart", text: "discovery-strategy-filtering.users-last-added-to-cart" },
|
|
120
|
-
{ value: "lastRemovedFromCart", text: "discovery-strategy-filtering.users-last-removed-from-cart" },
|
|
121
|
-
{ value: "lastAddedToWishlist", text: "discovery-strategy-filtering.users-last-added-to-wishlist" },
|
|
122
|
-
{ value: "lastRemovedFromWishlist", text: "discovery-strategy-filtering.users-last-removed-from-wishlist" },
|
|
123
|
-
{ value: "page", text: "discovery-strategy-filtering.currently-viewed-item-on-page" },
|
|
124
|
-
{ value: "currentlyViewedItem", text: "discovery-strategy-filtering.currently-viewed-item-on-page" }
|
|
125
|
-
], d = "email", g = {
|
|
126
|
-
CATEGORY: "products.category-pages",
|
|
127
|
-
PRODUCT: "products.product-article-pages",
|
|
128
|
-
CART: "products.cart-pages",
|
|
129
|
-
ALL_PAGES: "products.all-pages"
|
|
130
|
-
}, v = {
|
|
131
|
-
GENERAL: "general",
|
|
132
|
-
OTHER: "other"
|
|
133
|
-
};
|
|
134
|
-
export {
|
|
135
|
-
r as COUNT,
|
|
136
|
-
n as DataTypes,
|
|
137
|
-
v as DetailTabs,
|
|
138
|
-
d as EMAIL_CHANNEL,
|
|
139
|
-
c as FilterTypeNames,
|
|
140
|
-
s as MultiSelectDataTypes,
|
|
141
|
-
o as OperatorAbbreviations,
|
|
142
|
-
l as OperatorNames,
|
|
143
|
-
i as Operators,
|
|
144
|
-
g as PageTypeTranslationKeys,
|
|
145
|
-
a as TIME,
|
|
146
|
-
u as UserEventKeys,
|
|
147
|
-
p as UserEvents
|
|
148
|
-
};
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
var g = Object.defineProperty;
|
|
2
|
-
var d = (o, s, t) => s in o ? g(o, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[s] = t;
|
|
3
|
-
var r = (o, s, t) => d(o, typeof s != "symbol" ? s + "" : s, t);
|
|
4
|
-
import { UEAttr as l } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
5
|
-
import { CommonControl as c } from "../../../common-control.js";
|
|
6
|
-
import { RecommendationConfigService as a } from "../../services/configService.js";
|
|
7
|
-
import { useRecommendationExtensionStore as S } from "../../store/recommendation.js";
|
|
8
|
-
const m = "recommendation-strategy-control", e = {
|
|
9
|
-
STRATEGY: "strategyId",
|
|
10
|
-
DETAILS_BUTTON: "strategyDetails",
|
|
11
|
-
MESSAGE: "strategyMessage"
|
|
12
|
-
}, h = "guido__btn-strategy-details";
|
|
13
|
-
class E extends c {
|
|
14
|
-
constructor() {
|
|
15
|
-
super(...arguments);
|
|
16
|
-
// Store is used ONLY for API-fetched data (strategy list), not for config
|
|
17
|
-
r(this, "store", S());
|
|
18
|
-
r(this, "detailsListener", () => {
|
|
19
|
-
});
|
|
20
|
-
r(this, "detailsButton", null);
|
|
21
|
-
}
|
|
22
|
-
getId() {
|
|
23
|
-
return m;
|
|
24
|
-
}
|
|
25
|
-
getTemplate() {
|
|
26
|
-
return `
|
|
27
|
-
<div class="strategy-control-container">
|
|
28
|
-
${this._GuTwoColumns([
|
|
29
|
-
this._GuLabel({ text: this.api.translate("Recommendation Strategy") }),
|
|
30
|
-
`<div class="strategy-control__select-row">
|
|
31
|
-
${this._GuSelect({
|
|
32
|
-
name: e.STRATEGY,
|
|
33
|
-
placeholder: this.api.translate("Select Recommendation Strategy"),
|
|
34
|
-
options: this.store.getStrategyOptions
|
|
35
|
-
})}
|
|
36
|
-
${this._GuIconButton({
|
|
37
|
-
name: e.DETAILS_BUTTON,
|
|
38
|
-
icon: "strategy-details-icon",
|
|
39
|
-
className: h
|
|
40
|
-
})}
|
|
41
|
-
</div>`
|
|
42
|
-
])}
|
|
43
|
-
${this._GuOnPageMessage({ name: e.MESSAGE, icon: "migration-info-icon" })}
|
|
44
|
-
</div>
|
|
45
|
-
`;
|
|
46
|
-
}
|
|
47
|
-
onRender() {
|
|
48
|
-
this._initializeSelectItems(), this._setFormValues(), this._listenToFormUpdates(), this._setupDetailsButtonListener(), this._refreshSelectionState();
|
|
49
|
-
}
|
|
50
|
-
onDestroy() {
|
|
51
|
-
var t;
|
|
52
|
-
(t = this.detailsButton) == null || t.removeEventListener("click", this.detailsListener);
|
|
53
|
-
}
|
|
54
|
-
onTemplateNodeUpdated(t) {
|
|
55
|
-
super.onTemplateNodeUpdated(t), this._initializeSelectItems(), this._setFormValues(), this._refreshSelectionState();
|
|
56
|
-
}
|
|
57
|
-
_setFormValues() {
|
|
58
|
-
const t = a.getConfig(this.currentNode);
|
|
59
|
-
this.api.updateValues({ [e.STRATEGY]: t.strategyId });
|
|
60
|
-
}
|
|
61
|
-
_initializeSelectItems() {
|
|
62
|
-
var i;
|
|
63
|
-
const t = (i = this.store) == null ? void 0 : i.getStrategyOptions;
|
|
64
|
-
if (t != null && t.length)
|
|
65
|
-
try {
|
|
66
|
-
this.api.setUIEAttribute(
|
|
67
|
-
e.STRATEGY,
|
|
68
|
-
l.SELECTPICKER.items,
|
|
69
|
-
t
|
|
70
|
-
);
|
|
71
|
-
} catch (n) {
|
|
72
|
-
console.warn("[StrategyControl] Failed to set strategy options:", n);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Reconciles the panel with the strategy listing: loading, empty, and
|
|
77
|
-
* deleted-strategy states.
|
|
78
|
-
*
|
|
79
|
-
* A strategy the partner deleted in Smart Recommender still lives in this
|
|
80
|
-
* block's saved config. The id is deliberately left in place and surfaced
|
|
81
|
-
* instead of being cleared — silently dropping it would make a template that
|
|
82
|
-
* compiles a broken feed URL look correctly configured.
|
|
83
|
-
*
|
|
84
|
-
* ponytail: one message element, three texts. Severity styling (warning vs
|
|
85
|
-
* info) is not drawn in Figma and pending design sign-off — see open question
|
|
86
|
-
* 4 in the handoff. Vary `type` once that lands.
|
|
87
|
-
*/
|
|
88
|
-
_refreshSelectionState() {
|
|
89
|
-
const t = !!this.store.getStrategyOptions.length, { strategyId: i } = a.getConfig(this.currentNode);
|
|
90
|
-
if (this._setDisabled(e.STRATEGY, this.store.strategiesLoading || !t), this._setDisabled(e.DETAILS_BUTTON, !this.store.getSelectedStrategy), this.store.strategiesLoading) {
|
|
91
|
-
this._showMessage(this.api.translate("Loading recommendation strategies..."));
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
if (!t) {
|
|
95
|
-
this._showMessage(this.api.translate(
|
|
96
|
-
"No recommendation strategies are available for email. Create one in Smart Recommender, then reopen this block."
|
|
97
|
-
));
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
if (this.store.hasMissingStrategy) {
|
|
101
|
-
this._showMessage(this.api.translate(
|
|
102
|
-
`The selected strategy (${i}) is no longer available. Pick another one, otherwise this block will not load products.`
|
|
103
|
-
));
|
|
104
|
-
return;
|
|
105
|
-
}
|
|
106
|
-
this._hideMessage();
|
|
107
|
-
}
|
|
108
|
-
_setDisabled(t, i) {
|
|
109
|
-
try {
|
|
110
|
-
this.api.setUIEAttribute(t, l.SELECTPICKER.disabled, i);
|
|
111
|
-
} catch (n) {
|
|
112
|
-
console.warn(`[StrategyControl] Failed to set disabled on ${t}:`, n);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
_showMessage(t) {
|
|
116
|
-
this._setInfoMessageValue(e.MESSAGE, t);
|
|
117
|
-
}
|
|
118
|
-
_hideMessage() {
|
|
119
|
-
const t = this.getContainer().querySelector(`[data-info-message="${e.MESSAGE}"]`);
|
|
120
|
-
t && (t.style.display = "none");
|
|
121
|
-
}
|
|
122
|
-
_onDetailsClick() {
|
|
123
|
-
this.store.openStrategyDrawer();
|
|
124
|
-
}
|
|
125
|
-
_setupDetailsButtonListener() {
|
|
126
|
-
var t;
|
|
127
|
-
this.detailsListener = this._onDetailsClick.bind(this), this.detailsButton = this.getContainer().querySelector(`.${h}`), (t = this.detailsButton) == null || t.addEventListener("click", this.detailsListener);
|
|
128
|
-
}
|
|
129
|
-
_onStrategyChange(t) {
|
|
130
|
-
!this.currentNode || a.getConfig(this.currentNode).strategyId === t || (a.updateConfig(
|
|
131
|
-
this.api,
|
|
132
|
-
this.currentNode,
|
|
133
|
-
{ strategyId: t },
|
|
134
|
-
`Changed recommendation strategy to ${t}`
|
|
135
|
-
), this.store.patchCurrentBlockConfig({ strategyId: t }), this.store.fetchStrategyUrlTemplate(t), this._refreshSelectionState());
|
|
136
|
-
}
|
|
137
|
-
_listenToFormUpdates() {
|
|
138
|
-
this.api.onValueChanged(e.STRATEGY, (t) => {
|
|
139
|
-
this._onStrategyChange(t);
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
export {
|
|
144
|
-
m as STRATEGY_CONTROL_ID,
|
|
145
|
-
E as StrategyControl
|
|
146
|
-
};
|
|
@@ -1,97 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
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
|
-
};
|
package/dist/src/components/organisms/extensions/recommendation/StrategyDetailDrawer.vue.d.ts
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
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;
|
|
@@ -1,43 +0,0 @@
|
|
|
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
|
-
} & {};
|
|
@@ -1,29 +0,0 @@
|
|
|
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
|
-
} & {};
|
|
@@ -1,40 +0,0 @@
|
|
|
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
|
-
} & {};
|
|
@@ -1,38 +0,0 @@
|
|
|
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
|
-
} & {};
|
|
@@ -1,51 +0,0 @@
|
|
|
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
|
-
} & {};
|
|
@@ -1,24 +0,0 @@
|
|
|
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;
|