@useinsider/guido 3.17.0-beta.6255bfc → 3.17.0-beta.6b5cdfc
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -6
- package/dist/@types/config/schemas.js +6 -12
- package/dist/components/Guido.vue.js +2 -2
- package/dist/components/Guido.vue2.js +30 -31
- package/dist/composables/useCustomInterfaceAppearance.js +38 -52
- package/dist/composables/useRecommendation.js +44 -52
- package/dist/config/migrator/recommendation/settingsMapper.js +17 -19
- package/dist/config/migrator/recommendationMigrator.js +4 -6
- package/dist/enums/academy.js +1 -2
- package/dist/enums/date.js +3 -4
- package/dist/enums/extensions/recommendationBlock.js +1 -4
- package/dist/extensions/Blocks/Recommendation/block.js +21 -26
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +34 -36
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +95 -96
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +166 -180
- package/dist/extensions/Blocks/Recommendation/services/configService.js +35 -35
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +110 -251
- package/dist/extensions/Blocks/common-control.js +19 -22
- package/dist/guido.css +1 -1
- package/dist/services/recommendationApi.js +30 -75
- package/dist/src/@types/config/schemas.d.ts +0 -12
- package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
- package/dist/src/composables/useConfig.d.ts +0 -2
- package/dist/src/composables/useRecommendation.d.ts +0 -1
- package/dist/src/enums/academy.d.ts +0 -1
- package/dist/src/enums/extensions/recommendationBlock.d.ts +0 -2
- package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +6 -7
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +3 -15
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +10 -206
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +0 -6
- package/dist/src/extensions/Blocks/common-control.d.ts +1 -4
- package/dist/src/services/recommendationApi.d.ts +1 -4
- package/dist/src/stores/config.d.ts +0 -18
- package/dist/src/utils/liquidDynamicContent.d.ts +18 -0
- package/dist/utils/dateUtil.js +10 -29
- package/dist/utils/genericUtil.js +54 -54
- package/dist/utils/liquidDynamicContent.js +14 -0
- package/dist/utils/templatePreparation.js +34 -37
- package/package.json +2 -3
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +0 -18
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +0 -66
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +0 -142
- package/dist/src/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.d.ts +0 -3
- package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +0 -30
- package/dist/src/mock/api/recommendation-strategies.d.ts +0 -63
- package/dist/src/utils/strategyInfoBox.d.ts +0 -22
- package/dist/static/assets/icons/line-change.svg.js +0 -5
- package/dist/static/assets/icons/line-delete.svg.js +0 -5
- package/dist/static/assets/icons/line-plus.svg.js +0 -5
- package/dist/static/styles/components/recommendation-strategy.css.js +0 -188
- package/dist/utils/strategyInfoBox.js +0 -37
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Orientation, Languages, Currency, NumericSeparator, FiltersResponse, Filter,
|
|
1
|
+
import type { Orientation, Languages, Currency, NumericSeparator, FiltersResponse, Filter, RecommendationProduct } from '@@/Types/recommendation';
|
|
2
2
|
export interface PerBlockConfigs {
|
|
3
3
|
cardsInRow: number;
|
|
4
4
|
currencySettings: {
|
|
@@ -21,8 +21,6 @@ export interface PerBlockConfigs {
|
|
|
21
21
|
sendProductRequestFlag: boolean;
|
|
22
22
|
shuffleProducts: boolean;
|
|
23
23
|
strategy: string;
|
|
24
|
-
/** Assigned RRS id ('' = none) — mirrors RecommendationNodeConfig.strategyId (SD-149105) */
|
|
25
|
-
strategyId: string;
|
|
26
24
|
textTrimming: boolean;
|
|
27
25
|
unresponsive: boolean;
|
|
28
26
|
size: string;
|
|
@@ -35,8 +33,6 @@ interface PerBlockState {
|
|
|
35
33
|
recommendationProducts: RecommendationProduct[];
|
|
36
34
|
filterStatus: boolean;
|
|
37
35
|
filterSelectionDrawerStatus: boolean;
|
|
38
|
-
/** Assign Recommendation Strategy drawer visibility (SD-149105) */
|
|
39
|
-
assignStrategyDrawerStatus: boolean;
|
|
40
36
|
filterGroup: number;
|
|
41
37
|
/** Whether initial API data (filters, algorithms, products) has been fetched for this block */
|
|
42
38
|
isInitialized: boolean;
|
|
@@ -51,7 +47,6 @@ interface PerBlockState {
|
|
|
51
47
|
*/
|
|
52
48
|
export interface PerBlockUrlConfig {
|
|
53
49
|
strategy: string;
|
|
54
|
-
strategyId: string;
|
|
55
50
|
language: string;
|
|
56
51
|
size: string;
|
|
57
52
|
productIds: string[];
|
|
@@ -64,14 +59,11 @@ export interface PerBlockUrlConfig {
|
|
|
64
59
|
currencyThousandSeparator: string;
|
|
65
60
|
}
|
|
66
61
|
interface StoreState {
|
|
67
|
-
recommendationCampaignUrls: Record<string,
|
|
62
|
+
recommendationCampaignUrls: Record<string, string>;
|
|
68
63
|
activePredictiveAlgorithms: number[];
|
|
69
64
|
languages: Languages;
|
|
70
65
|
currencyList: Currency[];
|
|
71
66
|
filterList: FiltersResponse;
|
|
72
|
-
strategies: RrsStrategy[];
|
|
73
|
-
strategiesLoading: boolean;
|
|
74
|
-
strategyUrlTemplates: Record<string, string>;
|
|
75
67
|
blockStates: Record<number, PerBlockState>;
|
|
76
68
|
currentRecommendationId: number | null;
|
|
77
69
|
configVersion: number;
|
|
@@ -82,7 +74,7 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
82
74
|
* This allows all existing code that reads `store.recommendationConfigs` to work unchanged.
|
|
83
75
|
*/
|
|
84
76
|
recommendationConfigs(state: {
|
|
85
|
-
recommendationCampaignUrls: Record<string,
|
|
77
|
+
recommendationCampaignUrls: Record<string, string>;
|
|
86
78
|
activePredictiveAlgorithms: number[];
|
|
87
79
|
languages: Languages;
|
|
88
80
|
currencyList: {
|
|
@@ -90,16 +82,6 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
90
82
|
value: string;
|
|
91
83
|
}[];
|
|
92
84
|
filterList: FiltersResponse;
|
|
93
|
-
strategies: {
|
|
94
|
-
[x: string]: unknown;
|
|
95
|
-
strategy_id: number;
|
|
96
|
-
name: string;
|
|
97
|
-
status: string;
|
|
98
|
-
suitable_channels: string;
|
|
99
|
-
size?: (number | string) | undefined;
|
|
100
|
-
}[];
|
|
101
|
-
strategiesLoading: boolean;
|
|
102
|
-
strategyUrlTemplates: Record<string, string>;
|
|
103
85
|
blockStates: Record<number, PerBlockState>;
|
|
104
86
|
currentRecommendationId: number | null;
|
|
105
87
|
configVersion: number;
|
|
@@ -108,7 +90,7 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
108
90
|
* Proxy getter: delegates to blockStates[currentRecommendationId].recommendationProducts
|
|
109
91
|
*/
|
|
110
92
|
recommendationProducts(state: {
|
|
111
|
-
recommendationCampaignUrls: Record<string,
|
|
93
|
+
recommendationCampaignUrls: Record<string, string>;
|
|
112
94
|
activePredictiveAlgorithms: number[];
|
|
113
95
|
languages: Languages;
|
|
114
96
|
currencyList: {
|
|
@@ -116,16 +98,6 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
116
98
|
value: string;
|
|
117
99
|
}[];
|
|
118
100
|
filterList: FiltersResponse;
|
|
119
|
-
strategies: {
|
|
120
|
-
[x: string]: unknown;
|
|
121
|
-
strategy_id: number;
|
|
122
|
-
name: string;
|
|
123
|
-
status: string;
|
|
124
|
-
suitable_channels: string;
|
|
125
|
-
size?: (number | string) | undefined;
|
|
126
|
-
}[];
|
|
127
|
-
strategiesLoading: boolean;
|
|
128
|
-
strategyUrlTemplates: Record<string, string>;
|
|
129
101
|
blockStates: Record<number, PerBlockState>;
|
|
130
102
|
currentRecommendationId: number | null;
|
|
131
103
|
configVersion: number;
|
|
@@ -134,33 +106,7 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
134
106
|
* Proxy getter: delegates to blockStates[currentRecommendationId].filterSelectionDrawerStatus
|
|
135
107
|
*/
|
|
136
108
|
filterSelectionDrawerStatus(state: {
|
|
137
|
-
recommendationCampaignUrls: Record<string,
|
|
138
|
-
activePredictiveAlgorithms: number[];
|
|
139
|
-
languages: Languages;
|
|
140
|
-
currencyList: {
|
|
141
|
-
text: string;
|
|
142
|
-
value: string;
|
|
143
|
-
}[];
|
|
144
|
-
filterList: FiltersResponse;
|
|
145
|
-
strategies: {
|
|
146
|
-
[x: string]: unknown;
|
|
147
|
-
strategy_id: number;
|
|
148
|
-
name: string;
|
|
149
|
-
status: string;
|
|
150
|
-
suitable_channels: string;
|
|
151
|
-
size?: (number | string) | undefined;
|
|
152
|
-
}[];
|
|
153
|
-
strategiesLoading: boolean;
|
|
154
|
-
strategyUrlTemplates: Record<string, string>;
|
|
155
|
-
blockStates: Record<number, PerBlockState>;
|
|
156
|
-
currentRecommendationId: number | null;
|
|
157
|
-
configVersion: number;
|
|
158
|
-
} & import("pinia").PiniaCustomStateProperties<StoreState>): boolean;
|
|
159
|
-
/**
|
|
160
|
-
* Proxy getter: delegates to blockStates[currentRecommendationId].assignStrategyDrawerStatus
|
|
161
|
-
*/
|
|
162
|
-
assignStrategyDrawerStatus(state: {
|
|
163
|
-
recommendationCampaignUrls: Record<string, RecommendationCampaignUrlValue>;
|
|
109
|
+
recommendationCampaignUrls: Record<string, string>;
|
|
164
110
|
activePredictiveAlgorithms: number[];
|
|
165
111
|
languages: Languages;
|
|
166
112
|
currencyList: {
|
|
@@ -168,52 +114,15 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
168
114
|
value: string;
|
|
169
115
|
}[];
|
|
170
116
|
filterList: FiltersResponse;
|
|
171
|
-
strategies: {
|
|
172
|
-
[x: string]: unknown;
|
|
173
|
-
strategy_id: number;
|
|
174
|
-
name: string;
|
|
175
|
-
status: string;
|
|
176
|
-
suitable_channels: string;
|
|
177
|
-
size?: (number | string) | undefined;
|
|
178
|
-
}[];
|
|
179
|
-
strategiesLoading: boolean;
|
|
180
|
-
strategyUrlTemplates: Record<string, string>;
|
|
181
117
|
blockStates: Record<number, PerBlockState>;
|
|
182
118
|
currentRecommendationId: number | null;
|
|
183
119
|
configVersion: number;
|
|
184
120
|
} & import("pinia").PiniaCustomStateProperties<StoreState>): boolean;
|
|
185
|
-
/**
|
|
186
|
-
* The current block's assigned strategy record from the listing,
|
|
187
|
-
* or null when nothing is assigned / the strategy is no longer listed.
|
|
188
|
-
*/
|
|
189
|
-
assignedStrategy(state: {
|
|
190
|
-
recommendationCampaignUrls: Record<string, RecommendationCampaignUrlValue>;
|
|
191
|
-
activePredictiveAlgorithms: number[];
|
|
192
|
-
languages: Languages;
|
|
193
|
-
currencyList: {
|
|
194
|
-
text: string;
|
|
195
|
-
value: string;
|
|
196
|
-
}[];
|
|
197
|
-
filterList: FiltersResponse;
|
|
198
|
-
strategies: {
|
|
199
|
-
[x: string]: unknown;
|
|
200
|
-
strategy_id: number;
|
|
201
|
-
name: string;
|
|
202
|
-
status: string;
|
|
203
|
-
suitable_channels: string;
|
|
204
|
-
size?: (number | string) | undefined;
|
|
205
|
-
}[];
|
|
206
|
-
strategiesLoading: boolean;
|
|
207
|
-
strategyUrlTemplates: Record<string, string>;
|
|
208
|
-
blockStates: Record<number, PerBlockState>;
|
|
209
|
-
currentRecommendationId: number | null;
|
|
210
|
-
configVersion: number;
|
|
211
|
-
} & import("pinia").PiniaCustomStateProperties<StoreState>): RrsStrategy | null;
|
|
212
121
|
/**
|
|
213
122
|
* Proxy getter: delegates to blockStates[currentRecommendationId].filterStatus
|
|
214
123
|
*/
|
|
215
124
|
filterStatus(state: {
|
|
216
|
-
recommendationCampaignUrls: Record<string,
|
|
125
|
+
recommendationCampaignUrls: Record<string, string>;
|
|
217
126
|
activePredictiveAlgorithms: number[];
|
|
218
127
|
languages: Languages;
|
|
219
128
|
currencyList: {
|
|
@@ -221,16 +130,6 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
221
130
|
value: string;
|
|
222
131
|
}[];
|
|
223
132
|
filterList: FiltersResponse;
|
|
224
|
-
strategies: {
|
|
225
|
-
[x: string]: unknown;
|
|
226
|
-
strategy_id: number;
|
|
227
|
-
name: string;
|
|
228
|
-
status: string;
|
|
229
|
-
suitable_channels: string;
|
|
230
|
-
size?: (number | string) | undefined;
|
|
231
|
-
}[];
|
|
232
|
-
strategiesLoading: boolean;
|
|
233
|
-
strategyUrlTemplates: Record<string, string>;
|
|
234
133
|
blockStates: Record<number, PerBlockState>;
|
|
235
134
|
currentRecommendationId: number | null;
|
|
236
135
|
configVersion: number;
|
|
@@ -239,7 +138,7 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
239
138
|
* Proxy getter: delegates to blockStates[currentRecommendationId].filterGroup
|
|
240
139
|
*/
|
|
241
140
|
filterGroup(state: {
|
|
242
|
-
recommendationCampaignUrls: Record<string,
|
|
141
|
+
recommendationCampaignUrls: Record<string, string>;
|
|
243
142
|
activePredictiveAlgorithms: number[];
|
|
244
143
|
languages: Languages;
|
|
245
144
|
currencyList: {
|
|
@@ -247,16 +146,6 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
247
146
|
value: string;
|
|
248
147
|
}[];
|
|
249
148
|
filterList: FiltersResponse;
|
|
250
|
-
strategies: {
|
|
251
|
-
[x: string]: unknown;
|
|
252
|
-
strategy_id: number;
|
|
253
|
-
name: string;
|
|
254
|
-
status: string;
|
|
255
|
-
suitable_channels: string;
|
|
256
|
-
size?: (number | string) | undefined;
|
|
257
|
-
}[];
|
|
258
|
-
strategiesLoading: boolean;
|
|
259
|
-
strategyUrlTemplates: Record<string, string>;
|
|
260
149
|
blockStates: Record<number, PerBlockState>;
|
|
261
150
|
currentRecommendationId: number | null;
|
|
262
151
|
configVersion: number;
|
|
@@ -266,7 +155,7 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
266
155
|
getFilterGroupCount(): number;
|
|
267
156
|
getUniqueFilterGroups(): number[];
|
|
268
157
|
getActivePredictiveAlgorithms: (state: {
|
|
269
|
-
recommendationCampaignUrls: Record<string,
|
|
158
|
+
recommendationCampaignUrls: Record<string, string>;
|
|
270
159
|
activePredictiveAlgorithms: number[];
|
|
271
160
|
languages: Languages;
|
|
272
161
|
currencyList: {
|
|
@@ -274,16 +163,6 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
274
163
|
value: string;
|
|
275
164
|
}[];
|
|
276
165
|
filterList: FiltersResponse;
|
|
277
|
-
strategies: {
|
|
278
|
-
[x: string]: unknown;
|
|
279
|
-
strategy_id: number;
|
|
280
|
-
name: string;
|
|
281
|
-
status: string;
|
|
282
|
-
suitable_channels: string;
|
|
283
|
-
size?: (number | string) | undefined;
|
|
284
|
-
}[];
|
|
285
|
-
strategiesLoading: boolean;
|
|
286
|
-
strategyUrlTemplates: Record<string, string>;
|
|
287
166
|
blockStates: Record<number, PerBlockState>;
|
|
288
167
|
currentRecommendationId: number | null;
|
|
289
168
|
configVersion: number;
|
|
@@ -292,7 +171,7 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
292
171
|
value: string;
|
|
293
172
|
}[];
|
|
294
173
|
getLanguages: (state: {
|
|
295
|
-
recommendationCampaignUrls: Record<string,
|
|
174
|
+
recommendationCampaignUrls: Record<string, string>;
|
|
296
175
|
activePredictiveAlgorithms: number[];
|
|
297
176
|
languages: Languages;
|
|
298
177
|
currencyList: {
|
|
@@ -300,16 +179,6 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
300
179
|
value: string;
|
|
301
180
|
}[];
|
|
302
181
|
filterList: FiltersResponse;
|
|
303
|
-
strategies: {
|
|
304
|
-
[x: string]: unknown;
|
|
305
|
-
strategy_id: number;
|
|
306
|
-
name: string;
|
|
307
|
-
status: string;
|
|
308
|
-
suitable_channels: string;
|
|
309
|
-
size?: (number | string) | undefined;
|
|
310
|
-
}[];
|
|
311
|
-
strategiesLoading: boolean;
|
|
312
|
-
strategyUrlTemplates: Record<string, string>;
|
|
313
182
|
blockStates: Record<number, PerBlockState>;
|
|
314
183
|
currentRecommendationId: number | null;
|
|
315
184
|
configVersion: number;
|
|
@@ -318,7 +187,7 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
318
187
|
value: string;
|
|
319
188
|
}[];
|
|
320
189
|
getCurrencySymbolList: (state: {
|
|
321
|
-
recommendationCampaignUrls: Record<string,
|
|
190
|
+
recommendationCampaignUrls: Record<string, string>;
|
|
322
191
|
activePredictiveAlgorithms: number[];
|
|
323
192
|
languages: Languages;
|
|
324
193
|
currencyList: {
|
|
@@ -326,16 +195,6 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
326
195
|
value: string;
|
|
327
196
|
}[];
|
|
328
197
|
filterList: FiltersResponse;
|
|
329
|
-
strategies: {
|
|
330
|
-
[x: string]: unknown;
|
|
331
|
-
strategy_id: number;
|
|
332
|
-
name: string;
|
|
333
|
-
status: string;
|
|
334
|
-
suitable_channels: string;
|
|
335
|
-
size?: (number | string) | undefined;
|
|
336
|
-
}[];
|
|
337
|
-
strategiesLoading: boolean;
|
|
338
|
-
strategyUrlTemplates: Record<string, string>;
|
|
339
198
|
blockStates: Record<number, PerBlockState>;
|
|
340
199
|
currentRecommendationId: number | null;
|
|
341
200
|
configVersion: number;
|
|
@@ -413,47 +272,6 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
413
272
|
* to the snapshot taken when the drawer was opened.
|
|
414
273
|
*/
|
|
415
274
|
cancelFilterDrawer(): void;
|
|
416
|
-
/**
|
|
417
|
-
* Opens the Assign Strategy drawer for the current block.
|
|
418
|
-
* Selection state lives in the drawer component until Assign is
|
|
419
|
-
* pressed, so closing without assigning needs no snapshot/revert.
|
|
420
|
-
*/
|
|
421
|
-
openAssignStrategyDrawer(): void;
|
|
422
|
-
closeAssignStrategyDrawer(): void;
|
|
423
|
-
/**
|
|
424
|
-
* Fetches the active + EMAIL strategy listing. Always fetches fresh
|
|
425
|
-
* (dead-strategy detection and post-create refresh need freshness);
|
|
426
|
-
* only concurrent in-flight calls share one request.
|
|
427
|
-
*/
|
|
428
|
-
fetchStrategies(): Promise<void>;
|
|
429
|
-
/**
|
|
430
|
-
* Resolves a strategy's recommendation endpoint template via
|
|
431
|
-
* endpoint-generate, cached per strategy id + revision + currency.
|
|
432
|
-
* Failures throw and are NOT cached, so the next attempt retries.
|
|
433
|
-
*
|
|
434
|
-
* `full_path` bakes in the algorithm path and `size=` as they were when
|
|
435
|
-
* generated, so the revision keys the cache — and a record with no
|
|
436
|
-
* revision is not cached at all, since its key could never change.
|
|
437
|
-
* Currency joins the key because it is sent in the request body, so two
|
|
438
|
-
* currencies can resolve to different paths for the same revision.
|
|
439
|
-
*/
|
|
440
|
-
resolveStrategyUrlTemplate(strategy: RrsStrategy, currency: string): Promise<string>;
|
|
441
|
-
/**
|
|
442
|
-
* Assigns a strategy to the current block. The config write is
|
|
443
|
-
* synchronous (before any await) so a block switch cannot misdirect
|
|
444
|
-
* it; the configVersion bump persists it to node config and triggers
|
|
445
|
-
* the product refetch via the coordinator control's subscription.
|
|
446
|
-
*/
|
|
447
|
-
assignStrategy(strategy: RrsStrategy): void;
|
|
448
|
-
/**
|
|
449
|
-
* Clears the current block's strategy; it falls back to the per-block
|
|
450
|
-
* algorithm settings.
|
|
451
|
-
*
|
|
452
|
-
* `size` goes back to the default rather than staying on the removed
|
|
453
|
-
* strategy's count: with Number of Products hidden in RRS mode, a block
|
|
454
|
-
* left on that count would have no UI to correct it.
|
|
455
|
-
*/
|
|
456
|
-
removeStrategy(): void;
|
|
457
275
|
fetchRecommendationCreateData(): Promise<void>;
|
|
458
276
|
fetchRecommendationFilters(): Promise<void>;
|
|
459
277
|
addFilterGroup(filterGroup: number): void;
|
|
@@ -470,19 +288,5 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
470
288
|
hasInvalidBlock(): boolean;
|
|
471
289
|
fetchRecommendationProducts(): Promise<void>;
|
|
472
290
|
_doFetchProducts(): Promise<void>;
|
|
473
|
-
/**
|
|
474
|
-
* Fetches products for a strategy-backed block: listing lookup →
|
|
475
|
-
* endpoint-generate template → fill {locale}/{currency}, drop
|
|
476
|
-
* {user_id} (resolved at send time) → fetch. Any failure (dead
|
|
477
|
-
* strategy, resolution error) falls back to placeholder products.
|
|
478
|
-
*/
|
|
479
|
-
_doFetchStrategyProducts(blockId: number): Promise<void>;
|
|
480
|
-
/**
|
|
481
|
-
* Writes products to a block's state, padded/clipped to exactly `size`:
|
|
482
|
-
* in-place content updates compare the DOM element count against
|
|
483
|
-
* products.length, and a longer list makes the renderer extend its slot
|
|
484
|
-
* grid, which resets migrator-applied styles.
|
|
485
|
-
*/
|
|
486
|
-
_setBlockProducts(blockId: number, products: RecommendationProduct[], size: number): void;
|
|
487
291
|
}>;
|
|
488
292
|
export {};
|
|
@@ -82,12 +82,6 @@ export interface RecommendationNodeConfig {
|
|
|
82
82
|
* Uses existing Filter interface from recommendation types
|
|
83
83
|
*/
|
|
84
84
|
filters: Filter[];
|
|
85
|
-
/**
|
|
86
|
-
* Assigned Reusable Recommendation Strategy id (SD-149105).
|
|
87
|
-
* '' = no strategy assigned; block uses the per-block settings above.
|
|
88
|
-
* When set, algorithm/size/filters/shuffle come from the strategy record.
|
|
89
|
-
*/
|
|
90
|
-
strategyId: string;
|
|
91
85
|
/**
|
|
92
86
|
* Layout orientation
|
|
93
87
|
* - 'grid': Products in a grid, attributes aligned across products
|
|
@@ -56,9 +56,6 @@ interface ButtonProps {
|
|
|
56
56
|
name: string;
|
|
57
57
|
label: string;
|
|
58
58
|
id?: string;
|
|
59
|
-
className?: string;
|
|
60
|
-
icon?: string;
|
|
61
|
-
disabled?: boolean;
|
|
62
59
|
}
|
|
63
60
|
/**
|
|
64
61
|
* Common control for all blocks which includes common UI Elements.
|
|
@@ -119,7 +116,7 @@ export declare abstract class CommonControl extends Control {
|
|
|
119
116
|
icon?: string;
|
|
120
117
|
}): string;
|
|
121
118
|
_GuRadioButton({ name, buttons, id }: RadioButtonProps): string;
|
|
122
|
-
_GuButton({ name, label, id
|
|
119
|
+
_GuButton({ name, label, id }: ButtonProps): string;
|
|
123
120
|
_GuIcon({ src, className }: IconProps): string;
|
|
124
121
|
/**
|
|
125
122
|
*
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import type { InitialResponse, FiltersResponse, RecommendationProduct, RecommendationProductsParams
|
|
1
|
+
import type { InitialResponse, FiltersResponse, RecommendationProduct, RecommendationProductsParams } 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>;
|
|
9
6
|
};
|
|
@@ -104,7 +104,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
104
104
|
autosave: boolean;
|
|
105
105
|
allowlistEnabled: boolean;
|
|
106
106
|
linkTrackingIds: boolean;
|
|
107
|
-
reusableRecommendationStrategy: boolean;
|
|
108
107
|
};
|
|
109
108
|
blocks: {
|
|
110
109
|
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")[];
|
|
@@ -245,7 +244,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
245
244
|
autosave: boolean;
|
|
246
245
|
allowlistEnabled: boolean;
|
|
247
246
|
linkTrackingIds: boolean;
|
|
248
|
-
reusableRecommendationStrategy: boolean;
|
|
249
247
|
};
|
|
250
248
|
blocks: {
|
|
251
249
|
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")[];
|
|
@@ -386,7 +384,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
386
384
|
autosave: boolean;
|
|
387
385
|
allowlistEnabled: boolean;
|
|
388
386
|
linkTrackingIds: boolean;
|
|
389
|
-
reusableRecommendationStrategy: boolean;
|
|
390
387
|
};
|
|
391
388
|
blocks: {
|
|
392
389
|
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")[];
|
|
@@ -527,7 +524,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
527
524
|
autosave: boolean;
|
|
528
525
|
allowlistEnabled: boolean;
|
|
529
526
|
linkTrackingIds: boolean;
|
|
530
|
-
reusableRecommendationStrategy: boolean;
|
|
531
527
|
};
|
|
532
528
|
blocks: {
|
|
533
529
|
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")[];
|
|
@@ -668,7 +664,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
668
664
|
autosave: boolean;
|
|
669
665
|
allowlistEnabled: boolean;
|
|
670
666
|
linkTrackingIds: boolean;
|
|
671
|
-
reusableRecommendationStrategy: boolean;
|
|
672
667
|
};
|
|
673
668
|
blocks: {
|
|
674
669
|
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")[];
|
|
@@ -809,7 +804,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
809
804
|
autosave: boolean;
|
|
810
805
|
allowlistEnabled: boolean;
|
|
811
806
|
linkTrackingIds: boolean;
|
|
812
|
-
reusableRecommendationStrategy: boolean;
|
|
813
807
|
};
|
|
814
808
|
blocks: {
|
|
815
809
|
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")[];
|
|
@@ -950,7 +944,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
950
944
|
autosave: boolean;
|
|
951
945
|
allowlistEnabled: boolean;
|
|
952
946
|
linkTrackingIds: boolean;
|
|
953
|
-
reusableRecommendationStrategy: boolean;
|
|
954
947
|
};
|
|
955
948
|
blocks: {
|
|
956
949
|
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")[];
|
|
@@ -1091,7 +1084,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1091
1084
|
autosave: boolean;
|
|
1092
1085
|
allowlistEnabled: boolean;
|
|
1093
1086
|
linkTrackingIds: boolean;
|
|
1094
|
-
reusableRecommendationStrategy: boolean;
|
|
1095
1087
|
};
|
|
1096
1088
|
blocks: {
|
|
1097
1089
|
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")[];
|
|
@@ -1232,7 +1224,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1232
1224
|
autosave: boolean;
|
|
1233
1225
|
allowlistEnabled: boolean;
|
|
1234
1226
|
linkTrackingIds: boolean;
|
|
1235
|
-
reusableRecommendationStrategy: boolean;
|
|
1236
1227
|
};
|
|
1237
1228
|
blocks: {
|
|
1238
1229
|
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")[];
|
|
@@ -1373,7 +1364,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1373
1364
|
autosave: boolean;
|
|
1374
1365
|
allowlistEnabled: boolean;
|
|
1375
1366
|
linkTrackingIds: boolean;
|
|
1376
|
-
reusableRecommendationStrategy: boolean;
|
|
1377
1367
|
};
|
|
1378
1368
|
blocks: {
|
|
1379
1369
|
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")[];
|
|
@@ -1514,7 +1504,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1514
1504
|
autosave: boolean;
|
|
1515
1505
|
allowlistEnabled: boolean;
|
|
1516
1506
|
linkTrackingIds: boolean;
|
|
1517
|
-
reusableRecommendationStrategy: boolean;
|
|
1518
1507
|
};
|
|
1519
1508
|
blocks: {
|
|
1520
1509
|
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")[];
|
|
@@ -1655,7 +1644,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1655
1644
|
autosave: boolean;
|
|
1656
1645
|
allowlistEnabled: boolean;
|
|
1657
1646
|
linkTrackingIds: boolean;
|
|
1658
|
-
reusableRecommendationStrategy: boolean;
|
|
1659
1647
|
};
|
|
1660
1648
|
blocks: {
|
|
1661
1649
|
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")[];
|
|
@@ -1796,7 +1784,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1796
1784
|
autosave: boolean;
|
|
1797
1785
|
allowlistEnabled: boolean;
|
|
1798
1786
|
linkTrackingIds: boolean;
|
|
1799
|
-
reusableRecommendationStrategy: boolean;
|
|
1800
1787
|
};
|
|
1801
1788
|
blocks: {
|
|
1802
1789
|
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")[];
|
|
@@ -1937,7 +1924,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1937
1924
|
autosave: boolean;
|
|
1938
1925
|
allowlistEnabled: boolean;
|
|
1939
1926
|
linkTrackingIds: boolean;
|
|
1940
|
-
reusableRecommendationStrategy: boolean;
|
|
1941
1927
|
};
|
|
1942
1928
|
blocks: {
|
|
1943
1929
|
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")[];
|
|
@@ -2078,7 +2064,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2078
2064
|
autosave: boolean;
|
|
2079
2065
|
allowlistEnabled: boolean;
|
|
2080
2066
|
linkTrackingIds: boolean;
|
|
2081
|
-
reusableRecommendationStrategy: boolean;
|
|
2082
2067
|
};
|
|
2083
2068
|
blocks: {
|
|
2084
2069
|
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")[];
|
|
@@ -2219,7 +2204,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2219
2204
|
autosave: boolean;
|
|
2220
2205
|
allowlistEnabled: boolean;
|
|
2221
2206
|
linkTrackingIds: boolean;
|
|
2222
|
-
reusableRecommendationStrategy: boolean;
|
|
2223
2207
|
};
|
|
2224
2208
|
blocks: {
|
|
2225
2209
|
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")[];
|
|
@@ -2360,7 +2344,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2360
2344
|
autosave: boolean;
|
|
2361
2345
|
allowlistEnabled: boolean;
|
|
2362
2346
|
linkTrackingIds: boolean;
|
|
2363
|
-
reusableRecommendationStrategy: boolean;
|
|
2364
2347
|
};
|
|
2365
2348
|
blocks: {
|
|
2366
2349
|
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")[];
|
|
@@ -2503,7 +2486,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2503
2486
|
autosave: boolean;
|
|
2504
2487
|
allowlistEnabled: boolean;
|
|
2505
2488
|
linkTrackingIds: boolean;
|
|
2506
|
-
reusableRecommendationStrategy: boolean;
|
|
2507
2489
|
};
|
|
2508
2490
|
blocks: {
|
|
2509
2491
|
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")[];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { BaseDynamicContent } from '@@/Types/generic';
|
|
2
|
+
export type DynamicContentFormat = NonNullable<BaseDynamicContent['format']>;
|
|
3
|
+
/** Format key the dynamic-content picker sends for a custom date/time format. */
|
|
4
|
+
export declare const TIME_FORMAT_KEY = "time-format";
|
|
5
|
+
/**
|
|
6
|
+
* `{ key: 'time-format', value: '%Y-%m-%d' }` -> `date: "%Y-%m-%d"`.
|
|
7
|
+
*
|
|
8
|
+
* Only a custom date/time strftime pattern has a Liquid equivalent. Anything else returns null so
|
|
9
|
+
* the caller emits a plain tag rather than one that silently lost — or literally printed — its
|
|
10
|
+
* format.
|
|
11
|
+
* @example formatToLiquidFilter({ key: 'time-format', value: '%b %-d, %Y' }) -> date: "%b %-d, %Y"
|
|
12
|
+
*/
|
|
13
|
+
export declare const formatToLiquidFilter: (format: DynamicContentFormat) => string | null;
|
|
14
|
+
/**
|
|
15
|
+
* Inverse of `formatToLiquidFilter` — reads the picker format back out of one filter segment, so a
|
|
16
|
+
* reopened tag restores its selection in the host's format dropdown.
|
|
17
|
+
*/
|
|
18
|
+
export declare const liquidFilterToFormat: (segment: string) => DynamicContentFormat | null;
|
package/dist/utils/dateUtil.js
CHANGED
|
@@ -1,25 +1,10 @@
|
|
|
1
|
-
import { DEFAULT_LOCALE as
|
|
2
|
-
const
|
|
1
|
+
import { DEFAULT_LOCALE as r, DEFAULT as o } from "../enums/date.js";
|
|
2
|
+
const c = () => {
|
|
3
3
|
const t = window.l10n;
|
|
4
|
-
return (t == null ? void 0 : t.locale) ===
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}, i = /* @__PURE__ */ new Map(), l = (t, e) => {
|
|
9
|
-
const r = `${t}|${e}`, n = i.get(r);
|
|
10
|
-
if (n)
|
|
11
|
-
return n;
|
|
12
|
-
const o = new Intl.DateTimeFormat(t, {
|
|
13
|
-
year: "numeric",
|
|
14
|
-
month: "2-digit",
|
|
15
|
-
day: "2-digit",
|
|
16
|
-
timeZone: e
|
|
17
|
-
});
|
|
18
|
-
return i.set(r, o), o;
|
|
19
|
-
}, T = (t, e = u(), r = D()) => {
|
|
20
|
-
const n = m(t);
|
|
21
|
-
return l(e, r).format(n);
|
|
22
|
-
}, g = (t) => {
|
|
4
|
+
return (t == null ? void 0 : t.locale) === o ? r : (t == null ? void 0 : t.locale) || r;
|
|
5
|
+
};
|
|
6
|
+
new Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
7
|
+
const i = (t) => {
|
|
23
8
|
if (!t)
|
|
24
9
|
return "";
|
|
25
10
|
const e = new Date(t);
|
|
@@ -31,13 +16,9 @@ const m = (t) => t ? t instanceof Date ? t : typeof t == "string" ? t.length ===
|
|
|
31
16
|
second: "2-digit",
|
|
32
17
|
hour12: !1
|
|
33
18
|
}).format(e);
|
|
34
|
-
},
|
|
19
|
+
}, m = (t) => t ? Math.floor(Date.now() / 1e3) >= t : !1;
|
|
35
20
|
export {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
w as isAfterDate,
|
|
40
|
-
f as localTz,
|
|
41
|
-
u as locale,
|
|
42
|
-
D as timezone
|
|
21
|
+
i as formatPatchDate,
|
|
22
|
+
m as isAfterDate,
|
|
23
|
+
c as locale
|
|
43
24
|
};
|