@useinsider/guido 3.17.0-beta.3a4c221 → 3.17.0-beta.3cd7f07
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 +6 -5
- package/dist/@types/config/schemas.js +7 -6
- package/dist/components/Guido.vue.js +10 -10
- package/dist/components/Guido.vue2.js +86 -78
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +21 -0
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +131 -0
- package/dist/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js +18 -0
- package/dist/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue2.js +25 -0
- package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue.js +17 -0
- package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue2.js +57 -0
- package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.js +19 -0
- package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue2.js +63 -0
- package/dist/composables/useCustomInterfaceAppearance.js +56 -38
- package/dist/composables/useLegacyStrategyConversion.js +52 -0
- package/dist/composables/useRecommendation.js +41 -34
- package/dist/composables/useStripo.js +14 -14
- package/dist/config/i18n/en/labels.json.js +1 -1
- package/dist/config/migrator/index.js +9 -8
- package/dist/config/migrator/recommendation/compositionMapper.js +20 -20
- package/dist/config/migrator/recommendation/extractors.js +29 -24
- package/dist/config/migrator/recommendation/htmlBuilder.js +116 -130
- package/dist/config/migrator/recommendation/settingsMapper.js +17 -17
- package/dist/config/migrator/recommendationMigrator.js +31 -25
- package/dist/config/migrator/recommendationTitleMigrator.js +119 -0
- package/dist/enums/academy.js +2 -1
- package/dist/enums/date.js +5 -3
- package/dist/enums/extensions/recommendationBlock.js +4 -1
- package/dist/extensions/Blocks/Recommendation/block.js +35 -29
- package/dist/extensions/Blocks/Recommendation/constants/blockIds.js +1 -1
- package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +29 -27
- package/dist/extensions/Blocks/Recommendation/constants/selectors.js +35 -28
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +309 -236
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +242 -180
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +159 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +1 -0
- package/dist/extensions/Blocks/Recommendation/controls/title/index.js +44 -0
- package/dist/extensions/Blocks/Recommendation/extension.js +31 -29
- package/dist/extensions/Blocks/Recommendation/services/configService.js +54 -36
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +23 -4
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +217 -80
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +3 -3
- package/dist/extensions/Blocks/Recommendation/templates/titleRows.js +33 -0
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +85 -107
- package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.js +58 -0
- package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +22 -0
- package/dist/extensions/Blocks/common-control.js +22 -19
- package/dist/guido.css +1 -1
- package/dist/services/recommendationApi.js +81 -33
- package/dist/src/@types/config/schemas.d.ts +2 -0
- package/dist/src/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.d.ts +3 -0
- package/dist/src/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.d.ts +2 -0
- package/dist/src/components/organisms/extensions/recommendation/RemoveStrategyModal.vue.d.ts +2 -0
- package/dist/src/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.d.ts +15 -0
- package/dist/src/composables/useConfig.d.ts +2 -0
- package/dist/src/composables/useLegacyStrategyConversion.d.ts +3 -0
- package/dist/src/composables/useRecommendation.d.ts +1 -0
- package/dist/src/config/migrator/recommendation/extractors.d.ts +8 -0
- package/dist/src/config/migrator/recommendationTitleMigrator.d.ts +5 -0
- package/dist/src/enums/academy.d.ts +1 -0
- package/dist/src/enums/date.d.ts +1 -0
- package/dist/src/enums/extensions/recommendationBlock.d.ts +3 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/blockIds.d.ts +2 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +3 -6
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +2 -2
- package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +12 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +11 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +44 -8
- package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +17 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/title/index.d.ts +86 -0
- package/dist/src/extensions/Blocks/Recommendation/services/configService.d.ts +12 -1
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +229 -10
- package/dist/src/extensions/Blocks/Recommendation/templates/titleRows.d.ts +13 -0
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.d.ts +39 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/nodeConfigWriter.d.ts +31 -0
- package/dist/src/extensions/Blocks/common-control.d.ts +4 -1
- package/dist/src/mock/api/recommendation-strategies.d.ts +2 -0
- package/dist/src/services/recommendationApi.d.ts +5 -1
- package/dist/src/stores/config.d.ts +18 -0
- package/dist/src/stores/save-as-template.d.ts +4 -3
- package/dist/src/utils/genericUtil.d.ts +5 -0
- package/dist/static/assets/icons/filled-arrow-rising.svg.js +5 -0
- package/dist/static/assets/icons/line-change.svg.js +5 -0
- package/dist/static/assets/icons/line-delete.svg.js +5 -0
- package/dist/static/assets/icons/line-info.svg.js +5 -0
- package/dist/static/assets/icons/line-plus.svg.js +5 -0
- package/dist/static/styles/components/recommendation-strategy.css.js +220 -0
- package/dist/static/styles/customEditorStyle.css.js +3 -1
- package/dist/utils/dateUtil.js +23 -10
- package/dist/utils/genericUtil.js +54 -44
- package/dist/utils/templatePreparation.js +35 -34
- package/package.json +3 -2
- package/dist/src/utils/dynamicContentFormat.d.ts +0 -26
- package/dist/utils/dynamicContentFormat.js +0 -37
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Orientation, Languages, Currency, NumericSeparator, FiltersResponse, Filter, RecommendationProduct } from '@@/Types/recommendation';
|
|
1
|
+
import type { Orientation, Languages, Currency, NumericSeparator, FiltersResponse, Filter, RecommendationCampaignUrlValue, RecommendationProduct, RrsMigrationPayload, RrsStrategy } from '@@/Types/recommendation';
|
|
2
2
|
export interface PerBlockConfigs {
|
|
3
3
|
cardsInRow: number;
|
|
4
4
|
currencySettings: {
|
|
@@ -21,6 +21,8 @@ export interface PerBlockConfigs {
|
|
|
21
21
|
sendProductRequestFlag: boolean;
|
|
22
22
|
shuffleProducts: boolean;
|
|
23
23
|
strategy: string;
|
|
24
|
+
strategyId: string;
|
|
25
|
+
nodeConfigVersion: number;
|
|
24
26
|
textTrimming: boolean;
|
|
25
27
|
unresponsive: boolean;
|
|
26
28
|
size: string;
|
|
@@ -33,11 +35,15 @@ interface PerBlockState {
|
|
|
33
35
|
recommendationProducts: RecommendationProduct[];
|
|
34
36
|
filterStatus: boolean;
|
|
35
37
|
filterSelectionDrawerStatus: boolean;
|
|
38
|
+
assignStrategyDrawerStatus: boolean;
|
|
39
|
+
removeStrategyModalStatus: boolean;
|
|
40
|
+
legacyStrategyUpdatedModalStatus: boolean;
|
|
36
41
|
filterGroup: number;
|
|
37
42
|
/** Whether initial API data (filters, algorithms, products) has been fetched for this block */
|
|
38
43
|
isInitialized: boolean;
|
|
39
44
|
/** Snapshot of filters taken when the drawer opens, used to revert on cancel */
|
|
40
45
|
filterSnapshot: Filter[] | null;
|
|
46
|
+
legacyConversionLoading: boolean;
|
|
41
47
|
}
|
|
42
48
|
/**
|
|
43
49
|
* Persisted-config subset used by `seedBlockUrlConfig` to reconstruct
|
|
@@ -47,6 +53,7 @@ interface PerBlockState {
|
|
|
47
53
|
*/
|
|
48
54
|
export interface PerBlockUrlConfig {
|
|
49
55
|
strategy: string;
|
|
56
|
+
strategyId: string;
|
|
50
57
|
language: string;
|
|
51
58
|
size: string;
|
|
52
59
|
productIds: string[];
|
|
@@ -59,11 +66,14 @@ export interface PerBlockUrlConfig {
|
|
|
59
66
|
currencyThousandSeparator: string;
|
|
60
67
|
}
|
|
61
68
|
interface StoreState {
|
|
62
|
-
recommendationCampaignUrls: Record<string,
|
|
69
|
+
recommendationCampaignUrls: Record<string, RecommendationCampaignUrlValue>;
|
|
63
70
|
activePredictiveAlgorithms: number[];
|
|
64
71
|
languages: Languages;
|
|
65
72
|
currencyList: Currency[];
|
|
66
73
|
filterList: FiltersResponse;
|
|
74
|
+
strategies: RrsStrategy[];
|
|
75
|
+
strategiesLoading: boolean;
|
|
76
|
+
strategyUrlTemplates: Record<string, string>;
|
|
67
77
|
blockStates: Record<number, PerBlockState>;
|
|
68
78
|
currentRecommendationId: number | null;
|
|
69
79
|
configVersion: number;
|
|
@@ -74,7 +84,7 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
74
84
|
* This allows all existing code that reads `store.recommendationConfigs` to work unchanged.
|
|
75
85
|
*/
|
|
76
86
|
recommendationConfigs(state: {
|
|
77
|
-
recommendationCampaignUrls: Record<string,
|
|
87
|
+
recommendationCampaignUrls: Record<string, RecommendationCampaignUrlValue>;
|
|
78
88
|
activePredictiveAlgorithms: number[];
|
|
79
89
|
languages: Languages;
|
|
80
90
|
currencyList: {
|
|
@@ -82,6 +92,16 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
82
92
|
value: string;
|
|
83
93
|
}[];
|
|
84
94
|
filterList: FiltersResponse;
|
|
95
|
+
strategies: {
|
|
96
|
+
[x: string]: unknown;
|
|
97
|
+
strategy_id: number;
|
|
98
|
+
name: string;
|
|
99
|
+
status: string;
|
|
100
|
+
suitable_channels: string;
|
|
101
|
+
size?: (number | string) | undefined;
|
|
102
|
+
}[];
|
|
103
|
+
strategiesLoading: boolean;
|
|
104
|
+
strategyUrlTemplates: Record<string, string>;
|
|
85
105
|
blockStates: Record<number, PerBlockState>;
|
|
86
106
|
currentRecommendationId: number | null;
|
|
87
107
|
configVersion: number;
|
|
@@ -90,7 +110,7 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
90
110
|
* Proxy getter: delegates to blockStates[currentRecommendationId].recommendationProducts
|
|
91
111
|
*/
|
|
92
112
|
recommendationProducts(state: {
|
|
93
|
-
recommendationCampaignUrls: Record<string,
|
|
113
|
+
recommendationCampaignUrls: Record<string, RecommendationCampaignUrlValue>;
|
|
94
114
|
activePredictiveAlgorithms: number[];
|
|
95
115
|
languages: Languages;
|
|
96
116
|
currencyList: {
|
|
@@ -98,6 +118,16 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
98
118
|
value: string;
|
|
99
119
|
}[];
|
|
100
120
|
filterList: FiltersResponse;
|
|
121
|
+
strategies: {
|
|
122
|
+
[x: string]: unknown;
|
|
123
|
+
strategy_id: number;
|
|
124
|
+
name: string;
|
|
125
|
+
status: string;
|
|
126
|
+
suitable_channels: string;
|
|
127
|
+
size?: (number | string) | undefined;
|
|
128
|
+
}[];
|
|
129
|
+
strategiesLoading: boolean;
|
|
130
|
+
strategyUrlTemplates: Record<string, string>;
|
|
101
131
|
blockStates: Record<number, PerBlockState>;
|
|
102
132
|
currentRecommendationId: number | null;
|
|
103
133
|
configVersion: number;
|
|
@@ -106,7 +136,53 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
106
136
|
* Proxy getter: delegates to blockStates[currentRecommendationId].filterSelectionDrawerStatus
|
|
107
137
|
*/
|
|
108
138
|
filterSelectionDrawerStatus(state: {
|
|
109
|
-
recommendationCampaignUrls: Record<string,
|
|
139
|
+
recommendationCampaignUrls: Record<string, RecommendationCampaignUrlValue>;
|
|
140
|
+
activePredictiveAlgorithms: number[];
|
|
141
|
+
languages: Languages;
|
|
142
|
+
currencyList: {
|
|
143
|
+
text: string;
|
|
144
|
+
value: string;
|
|
145
|
+
}[];
|
|
146
|
+
filterList: FiltersResponse;
|
|
147
|
+
strategies: {
|
|
148
|
+
[x: string]: unknown;
|
|
149
|
+
strategy_id: number;
|
|
150
|
+
name: string;
|
|
151
|
+
status: string;
|
|
152
|
+
suitable_channels: string;
|
|
153
|
+
size?: (number | string) | undefined;
|
|
154
|
+
}[];
|
|
155
|
+
strategiesLoading: boolean;
|
|
156
|
+
strategyUrlTemplates: Record<string, string>;
|
|
157
|
+
blockStates: Record<number, PerBlockState>;
|
|
158
|
+
currentRecommendationId: number | null;
|
|
159
|
+
configVersion: number;
|
|
160
|
+
} & import("pinia").PiniaCustomStateProperties<StoreState>): boolean;
|
|
161
|
+
assignStrategyDrawerStatus(state: {
|
|
162
|
+
recommendationCampaignUrls: Record<string, RecommendationCampaignUrlValue>;
|
|
163
|
+
activePredictiveAlgorithms: number[];
|
|
164
|
+
languages: Languages;
|
|
165
|
+
currencyList: {
|
|
166
|
+
text: string;
|
|
167
|
+
value: string;
|
|
168
|
+
}[];
|
|
169
|
+
filterList: FiltersResponse;
|
|
170
|
+
strategies: {
|
|
171
|
+
[x: string]: unknown;
|
|
172
|
+
strategy_id: number;
|
|
173
|
+
name: string;
|
|
174
|
+
status: string;
|
|
175
|
+
suitable_channels: string;
|
|
176
|
+
size?: (number | string) | undefined;
|
|
177
|
+
}[];
|
|
178
|
+
strategiesLoading: boolean;
|
|
179
|
+
strategyUrlTemplates: Record<string, string>;
|
|
180
|
+
blockStates: Record<number, PerBlockState>;
|
|
181
|
+
currentRecommendationId: number | null;
|
|
182
|
+
configVersion: number;
|
|
183
|
+
} & import("pinia").PiniaCustomStateProperties<StoreState>): boolean;
|
|
184
|
+
removeStrategyModalStatus(state: {
|
|
185
|
+
recommendationCampaignUrls: Record<string, RecommendationCampaignUrlValue>;
|
|
110
186
|
activePredictiveAlgorithms: number[];
|
|
111
187
|
languages: Languages;
|
|
112
188
|
currencyList: {
|
|
@@ -114,15 +190,95 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
114
190
|
value: string;
|
|
115
191
|
}[];
|
|
116
192
|
filterList: FiltersResponse;
|
|
193
|
+
strategies: {
|
|
194
|
+
[x: string]: unknown;
|
|
195
|
+
strategy_id: number;
|
|
196
|
+
name: string;
|
|
197
|
+
status: string;
|
|
198
|
+
suitable_channels: string;
|
|
199
|
+
size?: (number | string) | undefined;
|
|
200
|
+
}[];
|
|
201
|
+
strategiesLoading: boolean;
|
|
202
|
+
strategyUrlTemplates: Record<string, string>;
|
|
117
203
|
blockStates: Record<number, PerBlockState>;
|
|
118
204
|
currentRecommendationId: number | null;
|
|
119
205
|
configVersion: number;
|
|
120
206
|
} & import("pinia").PiniaCustomStateProperties<StoreState>): boolean;
|
|
207
|
+
isLegacyStrategyBlock(): boolean;
|
|
208
|
+
legacyConversionLoading(state: {
|
|
209
|
+
recommendationCampaignUrls: Record<string, RecommendationCampaignUrlValue>;
|
|
210
|
+
activePredictiveAlgorithms: number[];
|
|
211
|
+
languages: Languages;
|
|
212
|
+
currencyList: {
|
|
213
|
+
text: string;
|
|
214
|
+
value: string;
|
|
215
|
+
}[];
|
|
216
|
+
filterList: FiltersResponse;
|
|
217
|
+
strategies: {
|
|
218
|
+
[x: string]: unknown;
|
|
219
|
+
strategy_id: number;
|
|
220
|
+
name: string;
|
|
221
|
+
status: string;
|
|
222
|
+
suitable_channels: string;
|
|
223
|
+
size?: (number | string) | undefined;
|
|
224
|
+
}[];
|
|
225
|
+
strategiesLoading: boolean;
|
|
226
|
+
strategyUrlTemplates: Record<string, string>;
|
|
227
|
+
blockStates: Record<number, PerBlockState>;
|
|
228
|
+
currentRecommendationId: number | null;
|
|
229
|
+
configVersion: number;
|
|
230
|
+
} & import("pinia").PiniaCustomStateProperties<StoreState>): boolean;
|
|
231
|
+
legacyStrategyUpdatedModalStatus(state: {
|
|
232
|
+
recommendationCampaignUrls: Record<string, RecommendationCampaignUrlValue>;
|
|
233
|
+
activePredictiveAlgorithms: number[];
|
|
234
|
+
languages: Languages;
|
|
235
|
+
currencyList: {
|
|
236
|
+
text: string;
|
|
237
|
+
value: string;
|
|
238
|
+
}[];
|
|
239
|
+
filterList: FiltersResponse;
|
|
240
|
+
strategies: {
|
|
241
|
+
[x: string]: unknown;
|
|
242
|
+
strategy_id: number;
|
|
243
|
+
name: string;
|
|
244
|
+
status: string;
|
|
245
|
+
suitable_channels: string;
|
|
246
|
+
size?: (number | string) | undefined;
|
|
247
|
+
}[];
|
|
248
|
+
strategiesLoading: boolean;
|
|
249
|
+
strategyUrlTemplates: Record<string, string>;
|
|
250
|
+
blockStates: Record<number, PerBlockState>;
|
|
251
|
+
currentRecommendationId: number | null;
|
|
252
|
+
configVersion: number;
|
|
253
|
+
} & import("pinia").PiniaCustomStateProperties<StoreState>): boolean;
|
|
254
|
+
assignedStrategy(state: {
|
|
255
|
+
recommendationCampaignUrls: Record<string, RecommendationCampaignUrlValue>;
|
|
256
|
+
activePredictiveAlgorithms: number[];
|
|
257
|
+
languages: Languages;
|
|
258
|
+
currencyList: {
|
|
259
|
+
text: string;
|
|
260
|
+
value: string;
|
|
261
|
+
}[];
|
|
262
|
+
filterList: FiltersResponse;
|
|
263
|
+
strategies: {
|
|
264
|
+
[x: string]: unknown;
|
|
265
|
+
strategy_id: number;
|
|
266
|
+
name: string;
|
|
267
|
+
status: string;
|
|
268
|
+
suitable_channels: string;
|
|
269
|
+
size?: (number | string) | undefined;
|
|
270
|
+
}[];
|
|
271
|
+
strategiesLoading: boolean;
|
|
272
|
+
strategyUrlTemplates: Record<string, string>;
|
|
273
|
+
blockStates: Record<number, PerBlockState>;
|
|
274
|
+
currentRecommendationId: number | null;
|
|
275
|
+
configVersion: number;
|
|
276
|
+
} & import("pinia").PiniaCustomStateProperties<StoreState>): RrsStrategy | null;
|
|
121
277
|
/**
|
|
122
278
|
* Proxy getter: delegates to blockStates[currentRecommendationId].filterStatus
|
|
123
279
|
*/
|
|
124
280
|
filterStatus(state: {
|
|
125
|
-
recommendationCampaignUrls: Record<string,
|
|
281
|
+
recommendationCampaignUrls: Record<string, RecommendationCampaignUrlValue>;
|
|
126
282
|
activePredictiveAlgorithms: number[];
|
|
127
283
|
languages: Languages;
|
|
128
284
|
currencyList: {
|
|
@@ -130,6 +286,16 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
130
286
|
value: string;
|
|
131
287
|
}[];
|
|
132
288
|
filterList: FiltersResponse;
|
|
289
|
+
strategies: {
|
|
290
|
+
[x: string]: unknown;
|
|
291
|
+
strategy_id: number;
|
|
292
|
+
name: string;
|
|
293
|
+
status: string;
|
|
294
|
+
suitable_channels: string;
|
|
295
|
+
size?: (number | string) | undefined;
|
|
296
|
+
}[];
|
|
297
|
+
strategiesLoading: boolean;
|
|
298
|
+
strategyUrlTemplates: Record<string, string>;
|
|
133
299
|
blockStates: Record<number, PerBlockState>;
|
|
134
300
|
currentRecommendationId: number | null;
|
|
135
301
|
configVersion: number;
|
|
@@ -138,7 +304,7 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
138
304
|
* Proxy getter: delegates to blockStates[currentRecommendationId].filterGroup
|
|
139
305
|
*/
|
|
140
306
|
filterGroup(state: {
|
|
141
|
-
recommendationCampaignUrls: Record<string,
|
|
307
|
+
recommendationCampaignUrls: Record<string, RecommendationCampaignUrlValue>;
|
|
142
308
|
activePredictiveAlgorithms: number[];
|
|
143
309
|
languages: Languages;
|
|
144
310
|
currencyList: {
|
|
@@ -146,6 +312,16 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
146
312
|
value: string;
|
|
147
313
|
}[];
|
|
148
314
|
filterList: FiltersResponse;
|
|
315
|
+
strategies: {
|
|
316
|
+
[x: string]: unknown;
|
|
317
|
+
strategy_id: number;
|
|
318
|
+
name: string;
|
|
319
|
+
status: string;
|
|
320
|
+
suitable_channels: string;
|
|
321
|
+
size?: (number | string) | undefined;
|
|
322
|
+
}[];
|
|
323
|
+
strategiesLoading: boolean;
|
|
324
|
+
strategyUrlTemplates: Record<string, string>;
|
|
149
325
|
blockStates: Record<number, PerBlockState>;
|
|
150
326
|
currentRecommendationId: number | null;
|
|
151
327
|
configVersion: number;
|
|
@@ -155,7 +331,7 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
155
331
|
getFilterGroupCount(): number;
|
|
156
332
|
getUniqueFilterGroups(): number[];
|
|
157
333
|
getActivePredictiveAlgorithms: (state: {
|
|
158
|
-
recommendationCampaignUrls: Record<string,
|
|
334
|
+
recommendationCampaignUrls: Record<string, RecommendationCampaignUrlValue>;
|
|
159
335
|
activePredictiveAlgorithms: number[];
|
|
160
336
|
languages: Languages;
|
|
161
337
|
currencyList: {
|
|
@@ -163,6 +339,16 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
163
339
|
value: string;
|
|
164
340
|
}[];
|
|
165
341
|
filterList: FiltersResponse;
|
|
342
|
+
strategies: {
|
|
343
|
+
[x: string]: unknown;
|
|
344
|
+
strategy_id: number;
|
|
345
|
+
name: string;
|
|
346
|
+
status: string;
|
|
347
|
+
suitable_channels: string;
|
|
348
|
+
size?: (number | string) | undefined;
|
|
349
|
+
}[];
|
|
350
|
+
strategiesLoading: boolean;
|
|
351
|
+
strategyUrlTemplates: Record<string, string>;
|
|
166
352
|
blockStates: Record<number, PerBlockState>;
|
|
167
353
|
currentRecommendationId: number | null;
|
|
168
354
|
configVersion: number;
|
|
@@ -171,7 +357,7 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
171
357
|
value: string;
|
|
172
358
|
}[];
|
|
173
359
|
getLanguages: (state: {
|
|
174
|
-
recommendationCampaignUrls: Record<string,
|
|
360
|
+
recommendationCampaignUrls: Record<string, RecommendationCampaignUrlValue>;
|
|
175
361
|
activePredictiveAlgorithms: number[];
|
|
176
362
|
languages: Languages;
|
|
177
363
|
currencyList: {
|
|
@@ -179,6 +365,16 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
179
365
|
value: string;
|
|
180
366
|
}[];
|
|
181
367
|
filterList: FiltersResponse;
|
|
368
|
+
strategies: {
|
|
369
|
+
[x: string]: unknown;
|
|
370
|
+
strategy_id: number;
|
|
371
|
+
name: string;
|
|
372
|
+
status: string;
|
|
373
|
+
suitable_channels: string;
|
|
374
|
+
size?: (number | string) | undefined;
|
|
375
|
+
}[];
|
|
376
|
+
strategiesLoading: boolean;
|
|
377
|
+
strategyUrlTemplates: Record<string, string>;
|
|
182
378
|
blockStates: Record<number, PerBlockState>;
|
|
183
379
|
currentRecommendationId: number | null;
|
|
184
380
|
configVersion: number;
|
|
@@ -187,7 +383,7 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
187
383
|
value: string;
|
|
188
384
|
}[];
|
|
189
385
|
getCurrencySymbolList: (state: {
|
|
190
|
-
recommendationCampaignUrls: Record<string,
|
|
386
|
+
recommendationCampaignUrls: Record<string, RecommendationCampaignUrlValue>;
|
|
191
387
|
activePredictiveAlgorithms: number[];
|
|
192
388
|
languages: Languages;
|
|
193
389
|
currencyList: {
|
|
@@ -195,6 +391,16 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
195
391
|
value: string;
|
|
196
392
|
}[];
|
|
197
393
|
filterList: FiltersResponse;
|
|
394
|
+
strategies: {
|
|
395
|
+
[x: string]: unknown;
|
|
396
|
+
strategy_id: number;
|
|
397
|
+
name: string;
|
|
398
|
+
status: string;
|
|
399
|
+
suitable_channels: string;
|
|
400
|
+
size?: (number | string) | undefined;
|
|
401
|
+
}[];
|
|
402
|
+
strategiesLoading: boolean;
|
|
403
|
+
strategyUrlTemplates: Record<string, string>;
|
|
198
404
|
blockStates: Record<number, PerBlockState>;
|
|
199
405
|
currentRecommendationId: number | null;
|
|
200
406
|
configVersion: number;
|
|
@@ -272,6 +478,17 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
272
478
|
* to the snapshot taken when the drawer was opened.
|
|
273
479
|
*/
|
|
274
480
|
cancelFilterDrawer(): void;
|
|
481
|
+
openAssignStrategyDrawer(): void;
|
|
482
|
+
closeAssignStrategyDrawer(): void;
|
|
483
|
+
openLegacyStrategyUpdatedModal(): void;
|
|
484
|
+
closeLegacyStrategyUpdatedModal(): void;
|
|
485
|
+
openRemoveStrategyModal(): void;
|
|
486
|
+
closeRemoveStrategyModal(): void;
|
|
487
|
+
fetchStrategies(): Promise<void>;
|
|
488
|
+
resolveStrategyUrlTemplate(strategy: RrsStrategy, currency: string): Promise<string>;
|
|
489
|
+
assignStrategy(strategy: RrsStrategy): void;
|
|
490
|
+
convertLegacyStrategy(payload: RrsMigrationPayload): Promise<string>;
|
|
491
|
+
removeStrategy(): void;
|
|
275
492
|
fetchRecommendationCreateData(): Promise<void>;
|
|
276
493
|
fetchRecommendationFilters(): Promise<void>;
|
|
277
494
|
addFilterGroup(filterGroup: number): void;
|
|
@@ -288,5 +505,7 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
288
505
|
hasInvalidBlock(): boolean;
|
|
289
506
|
fetchRecommendationProducts(): Promise<void>;
|
|
290
507
|
_doFetchProducts(): Promise<void>;
|
|
508
|
+
_doFetchStrategyProducts(blockId: number): Promise<void>;
|
|
509
|
+
_setBlockProducts(blockId: number, products: RecommendationProduct[], size: number): void;
|
|
291
510
|
}>;
|
|
292
511
|
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const DEFAULT_TITLE_TEXT = "You May Also Like!";
|
|
2
|
+
export declare const DEFAULT_TITLE_PARAGRAPH: string;
|
|
3
|
+
/**
|
|
4
|
+
* Builds the two block-level title rows: the title itself and the spacer below it.
|
|
5
|
+
* Both carry the same `recommendation-attribute-row` tagging a card attribute row has,
|
|
6
|
+
* so the Card Composition toggle hides the pair together and the compiler's
|
|
7
|
+
* `[data-visibility="0"]` sweep drops both — no leading gap when the title is off.
|
|
8
|
+
* @param paragraphHtml - Full `<p>` markup rendered inside the title cell
|
|
9
|
+
* @param visible - Whether the title starts visible
|
|
10
|
+
* @param spacerHeightPx - Height of the spacer row below the title
|
|
11
|
+
* @returns HTML string with the title row followed by its spacer row
|
|
12
|
+
*/
|
|
13
|
+
export declare function buildTitleRows(paragraphHtml?: string, visible?: boolean, spacerHeightPx?: number): string;
|
|
@@ -82,6 +82,7 @@ export interface RecommendationNodeConfig {
|
|
|
82
82
|
* Uses existing Filter interface from recommendation types
|
|
83
83
|
*/
|
|
84
84
|
filters: Filter[];
|
|
85
|
+
strategyId: string;
|
|
85
86
|
/**
|
|
86
87
|
* Layout orientation
|
|
87
88
|
* - 'grid': Products in a grid, attributes aligned across products
|
|
@@ -138,6 +139,12 @@ export interface RecommendationNodeConfig {
|
|
|
138
139
|
* Keys are ATTR_PRODUCT_* constants
|
|
139
140
|
*/
|
|
140
141
|
visibility: Record<string, boolean>;
|
|
142
|
+
/**
|
|
143
|
+
* Snapshot of the block title's row markup before it's removed.
|
|
144
|
+
* Restored verbatim when the title is re-enabled.
|
|
145
|
+
* @default ''
|
|
146
|
+
*/
|
|
147
|
+
previousTitleHtml: string;
|
|
141
148
|
/**
|
|
142
149
|
* Omnibus price text configuration
|
|
143
150
|
* For EU Omnibus Directive compliance
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { Filter, RrsMigrationFilterGroup, RrsMigrationPayload } from '@@/Types/recommendation';
|
|
2
|
+
type FilterAttribute = {
|
|
3
|
+
value: string;
|
|
4
|
+
type: string;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* A block authored before reusable strategies: it still carries a plain feed
|
|
8
|
+
* configuration (compiled into a feed URL string) instead of a strategy id.
|
|
9
|
+
* Blocks created under RRS stamp `CURRENT_CONFIG_VERSION`, so the version is
|
|
10
|
+
* what separates "never converted" from "not assigned yet".
|
|
11
|
+
*/
|
|
12
|
+
export declare function isLegacyStrategyConfig({ strategyId, nodeConfigVersion }: {
|
|
13
|
+
strategyId: string;
|
|
14
|
+
nodeConfigVersion: number;
|
|
15
|
+
}): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Groups the block's valid filters the way the feed URL groups them, in the
|
|
18
|
+
* shape the migration endpoint validates. The URL's filter DSL states no
|
|
19
|
+
* attribute type and cannot express a mixed-operator group, which is exactly
|
|
20
|
+
* what this override exists to supply.
|
|
21
|
+
*/
|
|
22
|
+
export declare function toMigrationFilterGroups(filters: Filter[], attributes: FilterAttribute[]): RrsMigrationFilterGroup[];
|
|
23
|
+
interface MigrationInputs {
|
|
24
|
+
blockId: number;
|
|
25
|
+
url: string;
|
|
26
|
+
templateId: string;
|
|
27
|
+
variationId: string;
|
|
28
|
+
strategy: string;
|
|
29
|
+
productIds: string[];
|
|
30
|
+
filters: Filter[];
|
|
31
|
+
attributes: FilterAttribute[];
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The server names and de-duplicates the strategy, so nothing here derives a
|
|
35
|
+
* name; `campaignId`/`variationId` only feed that name and fall back to 0 for
|
|
36
|
+
* templates and modules, which carry no numeric campaign.
|
|
37
|
+
*/
|
|
38
|
+
export declare function buildLegacyMigrationPayload({ blockId, url, templateId, variationId, strategy, productIds, filters, attributes, }: MigrationInputs): RrsMigrationPayload;
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { DocumentModifier } from '../services/configService';
|
|
2
|
+
import type { PartialNodeConfig } from '../types/nodeConfig';
|
|
3
|
+
import type { RecommendationProduct } from '@@/Types/recommendation';
|
|
4
|
+
import { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
|
|
5
|
+
interface ConfigWriterApi {
|
|
6
|
+
getDocumentModifier: () => DocumentModifier;
|
|
7
|
+
getDocumentRootHtmlNode: () => ImmutableHtmlNode;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Keeps a document handle alive for writes the settings panel can no longer make.
|
|
11
|
+
* Deliberately not cleared on deselect — that is the exact moment the handle is
|
|
12
|
+
* needed. It is replaced on the next render, and goes stale only if the editor
|
|
13
|
+
* itself is torn down.
|
|
14
|
+
*/
|
|
15
|
+
export declare function registerNodeConfigWriter(api: ConfigWriterApi): void;
|
|
16
|
+
/**
|
|
17
|
+
* Commits a config change and its product re-render straight to the document,
|
|
18
|
+
* bypassing the settings panel.
|
|
19
|
+
*
|
|
20
|
+
* Host-rendered UI (the remove-strategy modal) lives outside `ui-editor`, and
|
|
21
|
+
* Stripo deselects the block on the first click that lands there — destroying the
|
|
22
|
+
* control that normally does both, before the store change even happens.
|
|
23
|
+
*
|
|
24
|
+
* Mirrors the control's regenerate routine so config and cards land in ONE undo
|
|
25
|
+
* entry, and so partner-managed blocks keep their hand-authored cells.
|
|
26
|
+
* @param description - labels the undo entry only when there are no cards to
|
|
27
|
+
* re-render; the product helpers label their own batch.
|
|
28
|
+
* @returns whether the write reached a node
|
|
29
|
+
*/
|
|
30
|
+
export declare function commitBlockChangeOutsidePanel(blockId: number, updates: PartialNodeConfig, products: RecommendationProduct[], description: string): boolean;
|
|
31
|
+
export {};
|
|
@@ -56,6 +56,9 @@ interface ButtonProps {
|
|
|
56
56
|
name: string;
|
|
57
57
|
label: string;
|
|
58
58
|
id?: string;
|
|
59
|
+
className?: string;
|
|
60
|
+
icon?: string;
|
|
61
|
+
disabled?: boolean;
|
|
59
62
|
}
|
|
60
63
|
/**
|
|
61
64
|
* Common control for all blocks which includes common UI Elements.
|
|
@@ -116,7 +119,7 @@ export declare abstract class CommonControl extends Control {
|
|
|
116
119
|
icon?: string;
|
|
117
120
|
}): string;
|
|
118
121
|
_GuRadioButton({ name, buttons, id }: RadioButtonProps): string;
|
|
119
|
-
_GuButton({ name, label, id }: ButtonProps): string;
|
|
122
|
+
_GuButton({ name, label, id, className, icon, disabled }: ButtonProps): string;
|
|
120
123
|
_GuIcon({ src, className }: IconProps): string;
|
|
121
124
|
/**
|
|
122
125
|
*
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import type { InitialResponse, FiltersResponse, RecommendationProduct, RecommendationProductsParams } from '@@/Types/recommendation';
|
|
1
|
+
import type { InitialResponse, FiltersResponse, RecommendationProduct, RecommendationProductsParams, RrsEndpointGenerateResponse, RrsMigrationPayload, RrsStrategy } from '@@/Types/recommendation';
|
|
2
2
|
export declare const useRecommendationApi: () => {
|
|
3
3
|
fetchRecommendationCreateData: () => Promise<InitialResponse>;
|
|
4
4
|
fetchRecommendationFilters: () => Promise<FiltersResponse>;
|
|
5
5
|
fetchRecommendationProducts: (strategy: string, params: RecommendationProductsParams) => Promise<RecommendationProduct[]>;
|
|
6
|
+
fetchRecommendationProductsByUrl: (url: string) => Promise<RecommendationProduct[]>;
|
|
7
|
+
fetchRecommendationStrategies: () => Promise<RrsStrategy[]>;
|
|
8
|
+
generateStrategyEndpoint: (strategy: RrsStrategy, currency: string) => Promise<RrsEndpointGenerateResponse | null>;
|
|
9
|
+
migrateLegacyStrategy: (payload: RrsMigrationPayload) => Promise<string>;
|
|
6
10
|
};
|