@useinsider/guido 3.12.0-beta.840207a → 3.12.0-beta.86e34da
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 +6 -6
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +1 -1
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +8 -8
- package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +5 -5
- package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue2.js +10 -10
- package/dist/components/organisms/extensions/recommendation/StrategyDetailDrawer.vue.js +8 -6
- package/dist/components/organisms/extensions/recommendation/StrategyDetailDrawer.vue2.js +98 -71
- package/dist/composables/usePreviewInteractionGuard.js +36 -11
- package/dist/composables/useRecommendation.js +63 -78
- package/dist/composables/useRecommendationPreview.js +61 -60
- package/dist/enums/extensions/filteringV2.js +1017 -1
- package/dist/enums/extensions/recommendationBlock.js +34 -19
- package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
- package/dist/extensions/Blocks/Recommendation/controls/blockBackground/index.js +10 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +24 -20
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +245 -106
- package/dist/extensions/Blocks/Recommendation/extension.js +23 -21
- package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +17 -3
- package/dist/extensions/Blocks/Recommendation/recommendation.css.js +257 -0
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +41 -40
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +310 -117
- package/dist/extensions/Blocks/Recommendation/utils/strategyNavigation.js +8 -0
- package/dist/extensions/Blocks/Recommendation/utils/strategySummary.js +93 -8
- package/dist/extensions/Blocks/Recommendation/utils/strategyUrl.js +43 -0
- package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +18 -16
- package/dist/extensions/Blocks/Unsubscribe/utils/constants.js +3 -2
- package/dist/extensions/Blocks/common-control.js +2 -1
- package/dist/extensions/Blocks/controlFactories.js +125 -75
- package/dist/guido.css +1 -1
- package/dist/services/recommendationApi.js +90 -45
- package/dist/services/stripoApi.js +18 -18
- package/dist/src/@types/config/schemas.d.ts +2 -2
- package/dist/src/composables/usePreviewInteractionGuard.d.ts +1 -1
- package/dist/src/enums/extensions/recommendationBlock.d.ts +25 -2
- package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/blockBackground/index.d.ts +14 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +7 -3
- package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +59 -45
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +301 -4
- package/dist/src/extensions/Blocks/Recommendation/utils/strategyNavigation.d.ts +10 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/strategyUrl.d.ts +51 -0
- package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +5 -0
- package/dist/src/extensions/Blocks/Unsubscribe/utils/constants.d.ts +1 -0
- package/dist/src/extensions/Blocks/common-control.d.ts +2 -1
- package/dist/src/extensions/Blocks/controlFactories.d.ts +36 -0
- package/dist/src/mock/api/recommendation-strategies.d.ts +2 -0
- package/dist/src/services/recommendationApi.d.ts +3 -1
- package/dist/src/utils/urlSchemes.d.ts +6 -0
- package/dist/static/styles/base.css.js +0 -15
- package/dist/static/styles/components/base-input.css.js +6 -7
- package/dist/utils/templatePreparation.js +56 -47
- package/dist/utils/urlSchemes.js +4 -0
- package/package.json +1 -1
|
@@ -87,6 +87,16 @@ interface StoreState {
|
|
|
87
87
|
* has no usable URL", which stops a broken id being retried on every compile.
|
|
88
88
|
*/
|
|
89
89
|
strategyUrlTemplates: Record<string, string>;
|
|
90
|
+
/**
|
|
91
|
+
* Whether the last listing fetch failed.
|
|
92
|
+
*
|
|
93
|
+
* Without it a transport failure is indistinguishable from "this partner has
|
|
94
|
+
* no strategies", and the feed-URL resolver would cache that as a settled
|
|
95
|
+
* "strategy has no URL" for the whole session.
|
|
96
|
+
*/
|
|
97
|
+
strategiesLoadFailed: boolean;
|
|
98
|
+
/** True while a Duplicate-and-Assign round trip is in flight. */
|
|
99
|
+
strategyDuplicating: boolean;
|
|
90
100
|
blockStates: Record<number, PerBlockState>;
|
|
91
101
|
currentRecommendationId: number | null;
|
|
92
102
|
configVersion: number;
|
|
@@ -136,6 +146,11 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
136
146
|
exclude_purchase_duration?: number | undefined;
|
|
137
147
|
exclude_purchase_duration_type?: string | undefined;
|
|
138
148
|
exclude_purchase_item_count?: number | undefined;
|
|
149
|
+
campaignCount?: {
|
|
150
|
+
active?: number | undefined;
|
|
151
|
+
passive?: number | undefined;
|
|
152
|
+
test?: number | undefined;
|
|
153
|
+
} | undefined;
|
|
139
154
|
}[];
|
|
140
155
|
strategiesLoading: boolean;
|
|
141
156
|
strategyCampaigns: {
|
|
@@ -153,6 +168,8 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
153
168
|
strategyCampaignsLoading: boolean;
|
|
154
169
|
strategyCampaignsFetchedFor: string | null;
|
|
155
170
|
strategyUrlTemplates: Record<string, string>;
|
|
171
|
+
strategiesLoadFailed: boolean;
|
|
172
|
+
strategyDuplicating: boolean;
|
|
156
173
|
blockStates: Record<number, PerBlockState>;
|
|
157
174
|
currentRecommendationId: number | null;
|
|
158
175
|
configVersion: number;
|
|
@@ -200,6 +217,11 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
200
217
|
exclude_purchase_duration?: number | undefined;
|
|
201
218
|
exclude_purchase_duration_type?: string | undefined;
|
|
202
219
|
exclude_purchase_item_count?: number | undefined;
|
|
220
|
+
campaignCount?: {
|
|
221
|
+
active?: number | undefined;
|
|
222
|
+
passive?: number | undefined;
|
|
223
|
+
test?: number | undefined;
|
|
224
|
+
} | undefined;
|
|
203
225
|
}[];
|
|
204
226
|
strategiesLoading: boolean;
|
|
205
227
|
strategyCampaigns: {
|
|
@@ -217,6 +239,8 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
217
239
|
strategyCampaignsLoading: boolean;
|
|
218
240
|
strategyCampaignsFetchedFor: string | null;
|
|
219
241
|
strategyUrlTemplates: Record<string, string>;
|
|
242
|
+
strategiesLoadFailed: boolean;
|
|
243
|
+
strategyDuplicating: boolean;
|
|
220
244
|
blockStates: Record<number, PerBlockState>;
|
|
221
245
|
currentRecommendationId: number | null;
|
|
222
246
|
configVersion: number;
|
|
@@ -264,6 +288,11 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
264
288
|
exclude_purchase_duration?: number | undefined;
|
|
265
289
|
exclude_purchase_duration_type?: string | undefined;
|
|
266
290
|
exclude_purchase_item_count?: number | undefined;
|
|
291
|
+
campaignCount?: {
|
|
292
|
+
active?: number | undefined;
|
|
293
|
+
passive?: number | undefined;
|
|
294
|
+
test?: number | undefined;
|
|
295
|
+
} | undefined;
|
|
267
296
|
}[];
|
|
268
297
|
strategiesLoading: boolean;
|
|
269
298
|
strategyCampaigns: {
|
|
@@ -281,6 +310,8 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
281
310
|
strategyCampaignsLoading: boolean;
|
|
282
311
|
strategyCampaignsFetchedFor: string | null;
|
|
283
312
|
strategyUrlTemplates: Record<string, string>;
|
|
313
|
+
strategiesLoadFailed: boolean;
|
|
314
|
+
strategyDuplicating: boolean;
|
|
284
315
|
blockStates: Record<number, PerBlockState>;
|
|
285
316
|
currentRecommendationId: number | null;
|
|
286
317
|
configVersion: number;
|
|
@@ -328,6 +359,11 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
328
359
|
exclude_purchase_duration?: number | undefined;
|
|
329
360
|
exclude_purchase_duration_type?: string | undefined;
|
|
330
361
|
exclude_purchase_item_count?: number | undefined;
|
|
362
|
+
campaignCount?: {
|
|
363
|
+
active?: number | undefined;
|
|
364
|
+
passive?: number | undefined;
|
|
365
|
+
test?: number | undefined;
|
|
366
|
+
} | undefined;
|
|
331
367
|
}[];
|
|
332
368
|
strategiesLoading: boolean;
|
|
333
369
|
strategyCampaigns: {
|
|
@@ -345,6 +381,8 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
345
381
|
strategyCampaignsLoading: boolean;
|
|
346
382
|
strategyCampaignsFetchedFor: string | null;
|
|
347
383
|
strategyUrlTemplates: Record<string, string>;
|
|
384
|
+
strategiesLoadFailed: boolean;
|
|
385
|
+
strategyDuplicating: boolean;
|
|
348
386
|
blockStates: Record<number, PerBlockState>;
|
|
349
387
|
currentRecommendationId: number | null;
|
|
350
388
|
configVersion: number;
|
|
@@ -392,6 +430,11 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
392
430
|
exclude_purchase_duration?: number | undefined;
|
|
393
431
|
exclude_purchase_duration_type?: string | undefined;
|
|
394
432
|
exclude_purchase_item_count?: number | undefined;
|
|
433
|
+
campaignCount?: {
|
|
434
|
+
active?: number | undefined;
|
|
435
|
+
passive?: number | undefined;
|
|
436
|
+
test?: number | undefined;
|
|
437
|
+
} | undefined;
|
|
395
438
|
}[];
|
|
396
439
|
strategiesLoading: boolean;
|
|
397
440
|
strategyCampaigns: {
|
|
@@ -409,6 +452,8 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
409
452
|
strategyCampaignsLoading: boolean;
|
|
410
453
|
strategyCampaignsFetchedFor: string | null;
|
|
411
454
|
strategyUrlTemplates: Record<string, string>;
|
|
455
|
+
strategiesLoadFailed: boolean;
|
|
456
|
+
strategyDuplicating: boolean;
|
|
412
457
|
blockStates: Record<number, PerBlockState>;
|
|
413
458
|
currentRecommendationId: number | null;
|
|
414
459
|
configVersion: number;
|
|
@@ -456,6 +501,11 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
456
501
|
exclude_purchase_duration?: number | undefined;
|
|
457
502
|
exclude_purchase_duration_type?: string | undefined;
|
|
458
503
|
exclude_purchase_item_count?: number | undefined;
|
|
504
|
+
campaignCount?: {
|
|
505
|
+
active?: number | undefined;
|
|
506
|
+
passive?: number | undefined;
|
|
507
|
+
test?: number | undefined;
|
|
508
|
+
} | undefined;
|
|
459
509
|
}[];
|
|
460
510
|
strategiesLoading: boolean;
|
|
461
511
|
strategyCampaigns: {
|
|
@@ -473,6 +523,8 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
473
523
|
strategyCampaignsLoading: boolean;
|
|
474
524
|
strategyCampaignsFetchedFor: string | null;
|
|
475
525
|
strategyUrlTemplates: Record<string, string>;
|
|
526
|
+
strategiesLoadFailed: boolean;
|
|
527
|
+
strategyDuplicating: boolean;
|
|
476
528
|
blockStates: Record<number, PerBlockState>;
|
|
477
529
|
currentRecommendationId: number | null;
|
|
478
530
|
configVersion: number;
|
|
@@ -521,6 +573,11 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
521
573
|
exclude_purchase_duration?: number | undefined;
|
|
522
574
|
exclude_purchase_duration_type?: string | undefined;
|
|
523
575
|
exclude_purchase_item_count?: number | undefined;
|
|
576
|
+
campaignCount?: {
|
|
577
|
+
active?: number | undefined;
|
|
578
|
+
passive?: number | undefined;
|
|
579
|
+
test?: number | undefined;
|
|
580
|
+
} | undefined;
|
|
524
581
|
}[];
|
|
525
582
|
strategiesLoading: boolean;
|
|
526
583
|
strategyCampaigns: {
|
|
@@ -538,6 +595,8 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
538
595
|
strategyCampaignsLoading: boolean;
|
|
539
596
|
strategyCampaignsFetchedFor: string | null;
|
|
540
597
|
strategyUrlTemplates: Record<string, string>;
|
|
598
|
+
strategiesLoadFailed: boolean;
|
|
599
|
+
strategyDuplicating: boolean;
|
|
541
600
|
blockStates: Record<number, PerBlockState>;
|
|
542
601
|
currentRecommendationId: number | null;
|
|
543
602
|
configVersion: number;
|
|
@@ -591,6 +650,11 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
591
650
|
exclude_purchase_duration?: number | undefined;
|
|
592
651
|
exclude_purchase_duration_type?: string | undefined;
|
|
593
652
|
exclude_purchase_item_count?: number | undefined;
|
|
653
|
+
campaignCount?: {
|
|
654
|
+
active?: number | undefined;
|
|
655
|
+
passive?: number | undefined;
|
|
656
|
+
test?: number | undefined;
|
|
657
|
+
} | undefined;
|
|
594
658
|
}[];
|
|
595
659
|
strategiesLoading: boolean;
|
|
596
660
|
strategyCampaigns: {
|
|
@@ -608,6 +672,8 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
608
672
|
strategyCampaignsLoading: boolean;
|
|
609
673
|
strategyCampaignsFetchedFor: string | null;
|
|
610
674
|
strategyUrlTemplates: Record<string, string>;
|
|
675
|
+
strategiesLoadFailed: boolean;
|
|
676
|
+
strategyDuplicating: boolean;
|
|
611
677
|
blockStates: Record<number, PerBlockState>;
|
|
612
678
|
currentRecommendationId: number | null;
|
|
613
679
|
configVersion: number;
|
|
@@ -632,6 +698,147 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
632
698
|
* missing strategy blocks the save.
|
|
633
699
|
*/
|
|
634
700
|
isRrsEnabled(): boolean;
|
|
701
|
+
/** Strategy ids currently offered for email, for the save-time deleted-strategy check. */
|
|
702
|
+
strategyIds: (state: {
|
|
703
|
+
recommendationCampaignUrls: Record<string, string>;
|
|
704
|
+
activePredictiveAlgorithms: number[];
|
|
705
|
+
languages: Languages;
|
|
706
|
+
currencyList: {
|
|
707
|
+
text: string;
|
|
708
|
+
value: string;
|
|
709
|
+
}[];
|
|
710
|
+
filterList: FiltersResponse;
|
|
711
|
+
strategies: {
|
|
712
|
+
strategy_id: number;
|
|
713
|
+
name: string;
|
|
714
|
+
algorithm: string;
|
|
715
|
+
status: string;
|
|
716
|
+
size: number;
|
|
717
|
+
suitable_channels: string;
|
|
718
|
+
updated_at: string;
|
|
719
|
+
algorithm_used?: string | undefined;
|
|
720
|
+
exclude_view?: (boolean | number) | undefined;
|
|
721
|
+
exclude_purchase?: (boolean | number) | undefined;
|
|
722
|
+
exclude_cart?: (boolean | number) | undefined;
|
|
723
|
+
filters?: string | undefined;
|
|
724
|
+
manual_merchandising_products?: string | undefined;
|
|
725
|
+
mixed_strategies?: string | undefined;
|
|
726
|
+
suitable_page_types?: (string | string[]) | undefined;
|
|
727
|
+
base_product?: string | undefined;
|
|
728
|
+
checkout_recommendation_cart_value?: (number | string) | undefined;
|
|
729
|
+
shuffle?: (boolean | number) | undefined;
|
|
730
|
+
attribute_affinity?: (boolean | number) | undefined;
|
|
731
|
+
is_user_context_filter_optional?: (boolean | number) | undefined;
|
|
732
|
+
last_updated_by?: string | undefined;
|
|
733
|
+
created_at?: string | undefined;
|
|
734
|
+
exclude_view_option?: string | undefined;
|
|
735
|
+
exclude_view_duration?: number | undefined;
|
|
736
|
+
exclude_view_duration_type?: string | undefined;
|
|
737
|
+
exclude_view_item_count?: number | undefined;
|
|
738
|
+
exclude_purchase_option?: string | undefined;
|
|
739
|
+
exclude_purchase_duration?: number | undefined;
|
|
740
|
+
exclude_purchase_duration_type?: string | undefined;
|
|
741
|
+
exclude_purchase_item_count?: number | undefined;
|
|
742
|
+
campaignCount?: {
|
|
743
|
+
active?: number | undefined;
|
|
744
|
+
passive?: number | undefined;
|
|
745
|
+
test?: number | undefined;
|
|
746
|
+
} | undefined;
|
|
747
|
+
}[];
|
|
748
|
+
strategiesLoading: boolean;
|
|
749
|
+
strategyCampaigns: {
|
|
750
|
+
id: string | number;
|
|
751
|
+
name: string;
|
|
752
|
+
status: string;
|
|
753
|
+
variants: {
|
|
754
|
+
id?: (number | string) | undefined;
|
|
755
|
+
name: string;
|
|
756
|
+
}[];
|
|
757
|
+
channel: string;
|
|
758
|
+
productAlias?: string | undefined;
|
|
759
|
+
isPreventing?: boolean | undefined;
|
|
760
|
+
}[];
|
|
761
|
+
strategyCampaignsLoading: boolean;
|
|
762
|
+
strategyCampaignsFetchedFor: string | null;
|
|
763
|
+
strategyUrlTemplates: Record<string, string>;
|
|
764
|
+
strategiesLoadFailed: boolean;
|
|
765
|
+
strategyDuplicating: boolean;
|
|
766
|
+
blockStates: Record<number, PerBlockState>;
|
|
767
|
+
currentRecommendationId: number | null;
|
|
768
|
+
configVersion: number;
|
|
769
|
+
} & import("pinia").PiniaCustomStateProperties<StoreState>) => string[];
|
|
770
|
+
/**
|
|
771
|
+
* Whether the listing is trustworthy enough to judge an assigned id against.
|
|
772
|
+
* Mid-fetch it is empty, and every assigned id would look deleted.
|
|
773
|
+
*/
|
|
774
|
+
canValidateStrategy: (state: {
|
|
775
|
+
recommendationCampaignUrls: Record<string, string>;
|
|
776
|
+
activePredictiveAlgorithms: number[];
|
|
777
|
+
languages: Languages;
|
|
778
|
+
currencyList: {
|
|
779
|
+
text: string;
|
|
780
|
+
value: string;
|
|
781
|
+
}[];
|
|
782
|
+
filterList: FiltersResponse;
|
|
783
|
+
strategies: {
|
|
784
|
+
strategy_id: number;
|
|
785
|
+
name: string;
|
|
786
|
+
algorithm: string;
|
|
787
|
+
status: string;
|
|
788
|
+
size: number;
|
|
789
|
+
suitable_channels: string;
|
|
790
|
+
updated_at: string;
|
|
791
|
+
algorithm_used?: string | undefined;
|
|
792
|
+
exclude_view?: (boolean | number) | undefined;
|
|
793
|
+
exclude_purchase?: (boolean | number) | undefined;
|
|
794
|
+
exclude_cart?: (boolean | number) | undefined;
|
|
795
|
+
filters?: string | undefined;
|
|
796
|
+
manual_merchandising_products?: string | undefined;
|
|
797
|
+
mixed_strategies?: string | undefined;
|
|
798
|
+
suitable_page_types?: (string | string[]) | undefined;
|
|
799
|
+
base_product?: string | undefined;
|
|
800
|
+
checkout_recommendation_cart_value?: (number | string) | undefined;
|
|
801
|
+
shuffle?: (boolean | number) | undefined;
|
|
802
|
+
attribute_affinity?: (boolean | number) | undefined;
|
|
803
|
+
is_user_context_filter_optional?: (boolean | number) | undefined;
|
|
804
|
+
last_updated_by?: string | undefined;
|
|
805
|
+
created_at?: string | undefined;
|
|
806
|
+
exclude_view_option?: string | undefined;
|
|
807
|
+
exclude_view_duration?: number | undefined;
|
|
808
|
+
exclude_view_duration_type?: string | undefined;
|
|
809
|
+
exclude_view_item_count?: number | undefined;
|
|
810
|
+
exclude_purchase_option?: string | undefined;
|
|
811
|
+
exclude_purchase_duration?: number | undefined;
|
|
812
|
+
exclude_purchase_duration_type?: string | undefined;
|
|
813
|
+
exclude_purchase_item_count?: number | undefined;
|
|
814
|
+
campaignCount?: {
|
|
815
|
+
active?: number | undefined;
|
|
816
|
+
passive?: number | undefined;
|
|
817
|
+
test?: number | undefined;
|
|
818
|
+
} | undefined;
|
|
819
|
+
}[];
|
|
820
|
+
strategiesLoading: boolean;
|
|
821
|
+
strategyCampaigns: {
|
|
822
|
+
id: string | number;
|
|
823
|
+
name: string;
|
|
824
|
+
status: string;
|
|
825
|
+
variants: {
|
|
826
|
+
id?: (number | string) | undefined;
|
|
827
|
+
name: string;
|
|
828
|
+
}[];
|
|
829
|
+
channel: string;
|
|
830
|
+
productAlias?: string | undefined;
|
|
831
|
+
isPreventing?: boolean | undefined;
|
|
832
|
+
}[];
|
|
833
|
+
strategyCampaignsLoading: boolean;
|
|
834
|
+
strategyCampaignsFetchedFor: string | null;
|
|
835
|
+
strategyUrlTemplates: Record<string, string>;
|
|
836
|
+
strategiesLoadFailed: boolean;
|
|
837
|
+
strategyDuplicating: boolean;
|
|
838
|
+
blockStates: Record<number, PerBlockState>;
|
|
839
|
+
currentRecommendationId: number | null;
|
|
840
|
+
configVersion: number;
|
|
841
|
+
} & import("pinia").PiniaCustomStateProperties<StoreState>) => boolean;
|
|
635
842
|
/**
|
|
636
843
|
* True when a strategy id is set but absent from the fetched listing.
|
|
637
844
|
*
|
|
@@ -678,6 +885,11 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
678
885
|
exclude_purchase_duration?: number | undefined;
|
|
679
886
|
exclude_purchase_duration_type?: string | undefined;
|
|
680
887
|
exclude_purchase_item_count?: number | undefined;
|
|
888
|
+
campaignCount?: {
|
|
889
|
+
active?: number | undefined;
|
|
890
|
+
passive?: number | undefined;
|
|
891
|
+
test?: number | undefined;
|
|
892
|
+
} | undefined;
|
|
681
893
|
}[];
|
|
682
894
|
strategiesLoading: boolean;
|
|
683
895
|
strategyCampaigns: {
|
|
@@ -695,6 +907,8 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
695
907
|
strategyCampaignsLoading: boolean;
|
|
696
908
|
strategyCampaignsFetchedFor: string | null;
|
|
697
909
|
strategyUrlTemplates: Record<string, string>;
|
|
910
|
+
strategiesLoadFailed: boolean;
|
|
911
|
+
strategyDuplicating: boolean;
|
|
698
912
|
blockStates: Record<number, PerBlockState>;
|
|
699
913
|
currentRecommendationId: number | null;
|
|
700
914
|
configVersion: number;
|
|
@@ -742,6 +956,11 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
742
956
|
exclude_purchase_duration?: number | undefined;
|
|
743
957
|
exclude_purchase_duration_type?: string | undefined;
|
|
744
958
|
exclude_purchase_item_count?: number | undefined;
|
|
959
|
+
campaignCount?: {
|
|
960
|
+
active?: number | undefined;
|
|
961
|
+
passive?: number | undefined;
|
|
962
|
+
test?: number | undefined;
|
|
963
|
+
} | undefined;
|
|
745
964
|
}[];
|
|
746
965
|
strategiesLoading: boolean;
|
|
747
966
|
strategyCampaigns: {
|
|
@@ -759,6 +978,8 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
759
978
|
strategyCampaignsLoading: boolean;
|
|
760
979
|
strategyCampaignsFetchedFor: string | null;
|
|
761
980
|
strategyUrlTemplates: Record<string, string>;
|
|
981
|
+
strategiesLoadFailed: boolean;
|
|
982
|
+
strategyDuplicating: boolean;
|
|
762
983
|
blockStates: Record<number, PerBlockState>;
|
|
763
984
|
currentRecommendationId: number | null;
|
|
764
985
|
configVersion: number;
|
|
@@ -831,6 +1052,41 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
831
1052
|
* Called after successful apply — discards the snapshot.
|
|
832
1053
|
*/
|
|
833
1054
|
closeFilterDrawer(): void;
|
|
1055
|
+
/**
|
|
1056
|
+
* Find a strategy record by id, fetching the listing once if it is not loaded.
|
|
1057
|
+
*
|
|
1058
|
+
* The endpoint-generate call needs the record, and the save/hydrate path can
|
|
1059
|
+
* reach it on a template the marketer never clicked into — where no panel has
|
|
1060
|
+
* ever triggered the listing fetch.
|
|
1061
|
+
*
|
|
1062
|
+
* THROWS when the listing could not be loaded, rather than reporting "not
|
|
1063
|
+
* found". The caller caches a not-found as a settled "this strategy has no
|
|
1064
|
+
* URL"; doing that for a network blip would strand the block on its old
|
|
1065
|
+
* algorithm feed for the rest of the session while the panel still showed
|
|
1066
|
+
* the strategy as assigned. A throw leaves the cache key unset, so the next
|
|
1067
|
+
* selection or save tries again.
|
|
1068
|
+
*/
|
|
1069
|
+
_resolveStrategyRecord(strategyId: string): Promise<RrsStrategy | null>;
|
|
1070
|
+
/**
|
|
1071
|
+
* Assign a strategy to the current block.
|
|
1072
|
+
*
|
|
1073
|
+
* Only patches Pinia: the `configVersion` bump makes the main control persist
|
|
1074
|
+
* `strategyId` into the block's node config (see `_persistStoreConfigToNode`),
|
|
1075
|
+
* which is the same route filters take. Resolving the URL template here rather
|
|
1076
|
+
* than at compile time matters — `buildCampaignUrl` is synchronous and would
|
|
1077
|
+
* otherwise silently fall back to the algorithm URL.
|
|
1078
|
+
*/
|
|
1079
|
+
selectStrategy(strategyId: string): Promise<void>;
|
|
1080
|
+
/**
|
|
1081
|
+
* Duplicate the selected strategy and assign the copy to this block.
|
|
1082
|
+
*
|
|
1083
|
+
* Runs inline — the marketer never leaves the editor. Two things the web flow
|
|
1084
|
+
* does that we deliberately skip: its follow-up `POST /{id}/assign` (that binds
|
|
1085
|
+
* a strategy to a campaign *variation*, a concept email blocks do not have —
|
|
1086
|
+
* here the assignment is the block's own config), and displaying the copy's
|
|
1087
|
+
* name from the response, which only carries the new id. Hence the refetch.
|
|
1088
|
+
*/
|
|
1089
|
+
duplicateAndAssignStrategy(): Promise<void>;
|
|
834
1090
|
/**
|
|
835
1091
|
* Opens the RRS detail drawer for the current block.
|
|
836
1092
|
*
|
|
@@ -848,13 +1104,38 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
848
1104
|
/**
|
|
849
1105
|
* Resolve and cache a strategy's recommendation-URL template.
|
|
850
1106
|
*
|
|
1107
|
+
* Keyed by id for caching, but the request itself carries the whole strategy
|
|
1108
|
+
* record — the algorithm inside it decides the feed's path and params, so an
|
|
1109
|
+
* id alone cannot describe the URL. The listing is therefore a prerequisite;
|
|
1110
|
+
* it is fetched on demand for callers (template hydrate) that may run before
|
|
1111
|
+
* the panel ever opened.
|
|
1112
|
+
*
|
|
851
1113
|
* Must be awaited before `buildCampaignUrl` runs for a strategy-driven block,
|
|
852
1114
|
* because that builder is synchronous and can only read what is already
|
|
853
|
-
* cached. Safe to call repeatedly: a
|
|
854
|
-
*
|
|
855
|
-
*
|
|
1115
|
+
* cached. Safe to call repeatedly: a resolved id short-circuits, and
|
|
1116
|
+
* concurrent callers for the same id share one request.
|
|
1117
|
+
*
|
|
1118
|
+
* Only a *settled* answer is cached. An id the server rejects caches as '',
|
|
1119
|
+
* so the block falls back instead of retrying on every compile. A request
|
|
1120
|
+
* that merely failed to complete leaves the key unset and resolves to false,
|
|
1121
|
+
* so the next selection or save tries again — caching a network blip as "no
|
|
1122
|
+
* URL" would strand the block on its old algorithm feed for the session while
|
|
1123
|
+
* the panel still showed the strategy as assigned.
|
|
1124
|
+
* @returns whether the strategy now has a USABLE url — not merely a cache
|
|
1125
|
+
* entry. A rejected id caches as '' to stop the retry storm, but reporting
|
|
1126
|
+
* that as success would let the caller confirm an assignment the compiled
|
|
1127
|
+
* email cannot honour.
|
|
856
1128
|
*/
|
|
857
|
-
fetchStrategyUrlTemplate(strategyId: string): Promise<
|
|
1129
|
+
fetchStrategyUrlTemplate(strategyId: string): Promise<boolean>;
|
|
1130
|
+
/**
|
|
1131
|
+
* Wait for every strategy-URL request still in flight.
|
|
1132
|
+
*
|
|
1133
|
+
* The compiler is synchronous: whatever is not cached by the time it runs
|
|
1134
|
+
* compiles as the block's old algorithm URL. Selection and template hydrate
|
|
1135
|
+
* both await their own request, but a save fired inside that round trip would
|
|
1136
|
+
* still race — so the save path drains the queue first.
|
|
1137
|
+
*/
|
|
1138
|
+
awaitPendingStrategyUrls(): Promise<void>;
|
|
858
1139
|
/**
|
|
859
1140
|
* Fetch the campaigns a strategy is used in, for the drawer's second tab.
|
|
860
1141
|
*
|
|
@@ -878,6 +1159,14 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
878
1159
|
* than blocking the panel — the block keeps working on its algorithm.
|
|
879
1160
|
*/
|
|
880
1161
|
fetchRecommendationStrategies(): Promise<void>;
|
|
1162
|
+
/**
|
|
1163
|
+
* Refetch the listing, ignoring the once-per-session cache.
|
|
1164
|
+
*
|
|
1165
|
+
* Needed after Duplicate and Assign: the copy exists server-side but not in
|
|
1166
|
+
* `strategies`, so without this the panel would read the freshly assigned id
|
|
1167
|
+
* back as a deleted strategy.
|
|
1168
|
+
*/
|
|
1169
|
+
refreshRecommendationStrategies(): Promise<void>;
|
|
881
1170
|
fetchRecommendationFilters(): Promise<void>;
|
|
882
1171
|
addFilterGroup(filterGroup: number): void;
|
|
883
1172
|
deleteFilterGroup(groupId: number): void;
|
|
@@ -893,5 +1182,13 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
893
1182
|
hasInvalidBlock(): boolean;
|
|
894
1183
|
fetchRecommendationProducts(): Promise<void>;
|
|
895
1184
|
_doFetchProducts(): Promise<void>;
|
|
1185
|
+
/**
|
|
1186
|
+
* Runs a product fetch and writes the result to `blockId`.
|
|
1187
|
+
*
|
|
1188
|
+
* Shared by the strategy and algorithm paths so the size padding/clipping —
|
|
1189
|
+
* which the in-place card renderer depends on for its element-count match —
|
|
1190
|
+
* cannot drift between them.
|
|
1191
|
+
*/
|
|
1192
|
+
_applyFetchedProducts(blockId: number, fetchProducts: () => Promise<RecommendationProduct[]>): Promise<void>;
|
|
896
1193
|
}>;
|
|
897
1194
|
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Smart Recommender pages live outside the editor. The task spec is explicit that
|
|
3
|
+
* Create and Edit open in the *same* tab and that the flow finishes over there —
|
|
4
|
+
* there is no return trip, so nothing is stashed before leaving.
|
|
5
|
+
*
|
|
6
|
+
* ponytail: a full page load, not a router push. Guido has no router and is
|
|
7
|
+
* embedded in inone; whatever unload handling the host registers still applies.
|
|
8
|
+
*/
|
|
9
|
+
export declare const navigateToStrategyPage: (path: string) => void;
|
|
10
|
+
export declare const buildStrategyEditPath: (id: string | number) => string;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Placeholder substitution for a strategy's product-feed URL.
|
|
3
|
+
*
|
|
4
|
+
* Smart Recommender's `endpoint-generate` answers one template per strategy with
|
|
5
|
+
* tokens left in it. The same template drives two consumers with different rules,
|
|
6
|
+
* which is why this lives outside `useRecommendation` (the store would otherwise
|
|
7
|
+
* import the composable that imports the store):
|
|
8
|
+
*
|
|
9
|
+
* compile — the URL is baked into the email. Per-recipient tokens must survive
|
|
10
|
+
* as merge tags, and anything we cannot resolve is left for the ESP.
|
|
11
|
+
* preview — the URL is fetched right now, in the editor. Per-recipient tokens
|
|
12
|
+
* have no value yet, and a leftover `{token}` would be sent literally,
|
|
13
|
+
* so those params are dropped.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* Tokens carrying a value the editor knows. Two spellings exist in the wild for
|
|
17
|
+
* the same thing — the web runtime's templates write `{language}`/`{partnerId}`,
|
|
18
|
+
* the Smart Recommender previewer writes `{locale}`/`{partnerName}` — so both are
|
|
19
|
+
* substituted rather than guessing which one a given template used.
|
|
20
|
+
*/
|
|
21
|
+
declare const RESOLVED_PLACEHOLDERS: {
|
|
22
|
+
readonly LOCALE: readonly ["{locale}", "{language}"];
|
|
23
|
+
readonly CURRENCY: readonly ["{currency}"];
|
|
24
|
+
readonly CAMPAIGN_ID: readonly ["{campaignId}"];
|
|
25
|
+
readonly STRATEGY_ID: readonly ["{strategyId}"];
|
|
26
|
+
readonly CLIENT_ID: readonly ["{clientId}"];
|
|
27
|
+
readonly PARTNER_NAME: readonly ["{partnerName}", "{partnerId}"];
|
|
28
|
+
readonly SIZE: readonly ["{size}"];
|
|
29
|
+
};
|
|
30
|
+
export type StrategyUrlValues = Record<keyof typeof RESOLVED_PLACEHOLDERS, string>;
|
|
31
|
+
export type StrategyUrlMode = 'compile' | 'preview';
|
|
32
|
+
/**
|
|
33
|
+
* Collect the token values from the block's config plus the editor's own context.
|
|
34
|
+
*
|
|
35
|
+
* Shared so the compiled URL and the canvas preview cannot drift: the preview is
|
|
36
|
+
* only trustworthy if it is the *same* URL the email will carry.
|
|
37
|
+
*/
|
|
38
|
+
export declare const buildStrategyUrlValues: (block: {
|
|
39
|
+
language: string;
|
|
40
|
+
currencyCode: string;
|
|
41
|
+
size: string;
|
|
42
|
+
strategyId: string;
|
|
43
|
+
}) => StrategyUrlValues;
|
|
44
|
+
/**
|
|
45
|
+
* Substitute the editor-owned tokens in a strategy feed template.
|
|
46
|
+
*
|
|
47
|
+
* Unknown tokens are preserved in `compile` mode — an unknown token means someone
|
|
48
|
+
* downstream owns it, and blanking it would silently corrupt the feed URL.
|
|
49
|
+
*/
|
|
50
|
+
export declare const resolveStrategyUrl: (template: string, values: StrategyUrlValues, mode: StrategyUrlMode) => string;
|
|
51
|
+
export {};
|
|
@@ -9,10 +9,15 @@ export interface ExtensionStoreSlice {
|
|
|
9
9
|
currencyList: Currency[];
|
|
10
10
|
/** Whether the `reusableRecommendationStrategy` feature is enabled. */
|
|
11
11
|
isRrsEnabled: boolean;
|
|
12
|
+
/** Ids of the strategies Smart Recommender currently offers for email. */
|
|
13
|
+
strategyIds: string[];
|
|
14
|
+
/** False while the strategy listing is unavailable, when nothing can be judged. */
|
|
15
|
+
canValidateStrategy: boolean;
|
|
12
16
|
}
|
|
13
17
|
export interface RequiredField {
|
|
14
18
|
key: string;
|
|
15
19
|
canBeEmpty?: boolean;
|
|
20
|
+
optional?: boolean;
|
|
16
21
|
getValue: (config: PerBlockConfigs) => string;
|
|
17
22
|
getAvailableOptions?: (store: ExtensionStoreSlice) => string[];
|
|
18
23
|
condition?: (config: PerBlockConfigs, store: ExtensionStoreSlice) => boolean;
|
|
@@ -9,3 +9,4 @@ export declare const DATA_ATTRIBUTES: {
|
|
|
9
9
|
readonly BLOCK_ID: "data-unsubscribe-block-id";
|
|
10
10
|
};
|
|
11
11
|
export declare const UNSUBSCRIBE_BLOCK_SELECTOR = ".unsubscribe-block-v2";
|
|
12
|
+
export declare const UNSUBSCRIBE_LINK_SELECTOR = "a[data-unsubscribe-link=\"true\"], a.unsubscribe-link";
|
|
@@ -28,6 +28,7 @@ interface IconButtonProps {
|
|
|
28
28
|
name: string;
|
|
29
29
|
icon: string;
|
|
30
30
|
className?: string;
|
|
31
|
+
id?: string;
|
|
31
32
|
}
|
|
32
33
|
interface SelectProps {
|
|
33
34
|
name: string;
|
|
@@ -121,7 +122,7 @@ export declare abstract class CommonControl extends Control {
|
|
|
121
122
|
* @param param0
|
|
122
123
|
* @returns It returns a button with an icon.
|
|
123
124
|
*/
|
|
124
|
-
_GuIconButton({ name, icon, className }: IconButtonProps): string;
|
|
125
|
+
_GuIconButton({ name, icon, className, id }: IconButtonProps): string;
|
|
125
126
|
_GuOneColumn(children: string[], className?: string): string;
|
|
126
127
|
_GuTwoColumns(children: string[], className?: string): string;
|
|
127
128
|
/**
|
|
@@ -115,6 +115,42 @@ export declare function createTextBackgroundColorControl(controlId: string, targ
|
|
|
115
115
|
isVisible(_node: ImmutableHtmlNode): boolean;
|
|
116
116
|
};
|
|
117
117
|
};
|
|
118
|
+
/**
|
|
119
|
+
* Factory for a background-color control that paints a whole extension block (SD-145082).
|
|
120
|
+
*
|
|
121
|
+
* Base is `ButtonBackgroundColorBuiltInControl` because its `GENERAL.BACKGROUND_COLOR` form key
|
|
122
|
+
* round-trips through `getValues()`; the block-text base (`TextBlockBackgroundBuiltInControl`, the
|
|
123
|
+
* built-in this replaces) reports `textBlockBackgroundColor`, which our read path never sees. That
|
|
124
|
+
* borrowed base targets the block's Buy buttons, so `getTargetNodes` here is a GUARD that keeps it
|
|
125
|
+
* off the buttons — not the write path.
|
|
126
|
+
*
|
|
127
|
+
* The write is entirely ours (`getAdditionalModifications`): Stripo's built-in emits a stylesheet
|
|
128
|
+
* rule that inline styles from regeneration outrank (SD-143023), so it would silently no-op on the
|
|
129
|
+
* next edit. We write inline `background-color` + `bgcolor` on the block `<td>` instead — surviving
|
|
130
|
+
* regeneration and reaching Outlook, matching the migrator's convention.
|
|
131
|
+
*/
|
|
132
|
+
export declare function createBlockBackgroundColorControl(controlId: string, blockRootSelector?: string): {
|
|
133
|
+
new (): {
|
|
134
|
+
getId(): string;
|
|
135
|
+
/** The parent control renders its own generic title; restore the block-level wording. */
|
|
136
|
+
getLabels(): {
|
|
137
|
+
title: string;
|
|
138
|
+
};
|
|
139
|
+
/** Guard: redirect the borrowed button parent onto the block `<td>` so it never paints the Buy buttons. */
|
|
140
|
+
getTargetNodes(root: ImmutableHtmlNode): ImmutableHtmlNode[];
|
|
141
|
+
/**
|
|
142
|
+
* Writes the picked background onto the block as an inline style plus a `bgcolor`
|
|
143
|
+
* attribute. This is the whole mechanism, not a mirror: the parent control's own
|
|
144
|
+
* write never reaches the block element (verified at runtime). `bgcolor` is the
|
|
145
|
+
* channel Outlook honours on a `<td>`, and matches what the migrator emits.
|
|
146
|
+
*/
|
|
147
|
+
getAdditionalModifications(root: ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").TemplateModifier<import("@stripoinc/ui-editor-extensions").HtmlNodeModifier, import("@stripoinc/ui-editor-extensions").CssNodeModifier> | undefined;
|
|
148
|
+
getParentControlId(): string;
|
|
149
|
+
api: import("@stripoinc/ui-editor-extensions").ControlApi;
|
|
150
|
+
getModificationDescription(): import("@stripoinc/ui-editor-extensions").ModificationDescription | undefined;
|
|
151
|
+
isVisible(_node: ImmutableHtmlNode): boolean;
|
|
152
|
+
};
|
|
153
|
+
};
|
|
118
154
|
/**
|
|
119
155
|
* Factory function to create paddings controls for different block elements
|
|
120
156
|
* When targetBlockId and containerSelector are not provided, applies directly to root
|
|
@@ -2,11 +2,13 @@ import type { InitialResponse, FiltersResponse, RecommendationProduct, Recommend
|
|
|
2
2
|
/** Translation lookup, matching `useTranslations()`. */
|
|
3
3
|
type TranslateFn = (key: string, params?: Record<string, string | number | boolean>) => string;
|
|
4
4
|
export declare const useRecommendationApi: () => {
|
|
5
|
+
duplicateStrategy: (strategyId: string) => Promise<string | null>;
|
|
5
6
|
fetchRecommendationCreateData: () => Promise<InitialResponse>;
|
|
6
7
|
fetchRecommendationFilters: () => Promise<FiltersResponse>;
|
|
7
8
|
fetchRecommendationProducts: (strategy: string, params: RecommendationProductsParams) => Promise<RecommendationProduct[]>;
|
|
9
|
+
fetchRecommendationProductsByUrl: (url: string) => Promise<RecommendationProduct[]>;
|
|
8
10
|
fetchRecommendationStrategies: () => Promise<RrsStrategy[]>;
|
|
9
11
|
fetchStrategyCampaigns: (strategyId: string, trans: TranslateFn) => Promise<RrsCampaign[]>;
|
|
10
|
-
|
|
12
|
+
generateStrategyEndpoint: (strategy: RrsStrategy, campaignId: string) => Promise<RrsStrategyUrl | null>;
|
|
11
13
|
};
|
|
12
14
|
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* URL schemes that are safe to follow from partner-authored email HTML. Shared so a
|
|
3
|
+
* future bypass fix lands in one place — the preview guard and the recommendation
|
|
4
|
+
* sanitizer both gate on it. Stored with the trailing colon to match `anchor.protocol`.
|
|
5
|
+
*/
|
|
6
|
+
export declare const BASE_SAFE_URL_SCHEMES: readonly string[];
|