@useinsider/guido 3.19.0-beta.c8d2be8 → 3.19.0-beta.cd75ff0
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 +1 -0
- package/dist/@types/config/schemas.js +102 -87
- package/dist/components/Guido.vue.js +4 -4
- package/dist/components/Guido.vue2.js +83 -75
- package/dist/components/organisms/AutoSaveController.vue2.js +10 -8
- package/dist/components/organisms/base/AuthErrorModal.vue.js +18 -0
- package/dist/components/organisms/base/AuthErrorModal.vue2.js +42 -0
- package/dist/components/organisms/header/EditorActions.vue.js +2 -2
- package/dist/components/organisms/header/EditorActions.vue2.js +83 -48
- package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
- package/dist/components/organisms/header/LeftSlot.vue2.js +16 -12
- package/dist/components/organisms/validation/ValidationErrorDrawer.vue.js +20 -0
- package/dist/components/organisms/validation/ValidationErrorDrawer.vue2.js +50 -0
- package/dist/components/wrappers/WpDrawer.vue.js +9 -7
- package/dist/components/wrappers/WpDrawer.vue2.js +1 -1
- package/dist/components/wrappers/WpModal.vue.js +1 -1
- package/dist/components/wrappers/WpModal.vue2.js +4 -3
- package/dist/composables/useActionsApi.js +52 -47
- package/dist/composables/useAuthError.js +52 -0
- package/dist/composables/useAutoSave.js +44 -42
- package/dist/composables/useCodeEditorApi.js +23 -9
- package/dist/composables/useHtmlCompiler.js +37 -26
- package/dist/composables/useHtmlValidator.js +2 -0
- package/dist/composables/useHttp.js +48 -49
- package/dist/composables/useLegacyStrategyConversion.js +23 -19
- package/dist/composables/useSave.js +92 -45
- package/dist/composables/useSaveValidation.js +284 -0
- package/dist/composables/useSaveValidationRollout.js +20 -0
- package/dist/composables/useStripo.js +24 -20
- package/dist/composables/useToaster.js +17 -15
- package/dist/composables/useTranslations.js +3 -2
- package/dist/composables/useVersionHistoryApi.js +33 -24
- package/dist/composables/validators/useCouponBlockValidator.js +24 -21
- package/dist/composables/validators/useLiquidValidator.js +15 -15
- package/dist/composables/validators/useUnsubscribeBlockValidator.js +34 -27
- package/dist/config/migrator/index.js +14 -13
- package/dist/config/migrator/recommendationPartnerMigrator.js +50 -0
- package/dist/enums/extensions/recommendationBlock.js +30 -29
- package/dist/enums/save-validation.js +4 -0
- package/dist/extensions/Blocks/Recommendation/block.js +15 -14
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +45 -38
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +72 -49
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +30 -29
- package/dist/extensions/Blocks/Recommendation/utils/partnerScope.js +25 -0
- package/dist/guido.css +1 -1
- package/dist/services/settingsApi.js +11 -0
- package/dist/src/@types/config/schemas.d.ts +20 -0
- package/dist/src/@types/save-validation.d.ts +19 -0
- package/dist/src/components/Guido.vue.d.ts +17 -1
- package/dist/src/components/organisms/base/AuthErrorModal.vue.d.ts +2 -0
- package/dist/src/components/organisms/header/EditorActions.vue.d.ts +17 -1
- package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +17 -1
- package/dist/src/components/organisms/header/RightSlot.vue.d.ts +17 -1
- package/dist/src/components/organisms/validation/ValidationErrorDrawer.vue.d.ts +2 -0
- package/dist/src/components/wrappers/WpDrawer.vue.d.ts +4 -3
- package/dist/src/components/wrappers/WpModal.vue.d.ts +5 -1
- package/dist/src/composables/useAuthError.d.ts +12 -0
- package/dist/src/composables/useAutoSave.d.ts +4 -1
- package/dist/src/composables/useConfig.d.ts +4 -0
- package/dist/src/composables/useHtmlValidator.d.ts +21 -0
- package/dist/src/composables/useHttp.d.ts +2 -0
- package/dist/src/composables/useSave.d.ts +6 -1
- package/dist/src/composables/useSaveValidation.d.ts +6 -0
- package/dist/src/composables/useSaveValidationRollout.d.ts +4 -0
- package/dist/src/composables/validators/useCouponBlockValidator.d.ts +3 -0
- package/dist/src/composables/validators/useUnsubscribeBlockValidator.d.ts +10 -0
- package/dist/src/config/migrator/index.d.ts +2 -1
- package/dist/src/config/migrator/recommendationPartnerMigrator.d.ts +19 -0
- package/dist/src/enums/extensions/recommendationBlock.d.ts +1 -1
- package/dist/src/enums/save-validation.d.ts +27 -0
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +6 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/partnerScope.d.ts +33 -0
- package/dist/src/services/settingsApi.d.ts +6 -0
- package/dist/src/stores/config.d.ts +52 -0
- package/dist/src/stores/save-validation.d.ts +22 -0
- package/dist/src/stores/setup-settings.d.ts +4 -0
- package/dist/src/utils/stripoEditorApi.d.ts +4 -0
- package/dist/src/utils/templatePreparation.d.ts +30 -0
- package/dist/static/styles/components/recommendation-strategy.css.js +9 -0
- package/dist/stores/config.js +84 -67
- package/dist/stores/save-validation.js +30 -0
- package/dist/stores/setup-settings.js +10 -0
- package/dist/stores/unsubscribe.js +3 -3
- package/dist/utils/stripoEditorApi.js +11 -0
- package/dist/utils/templatePreparation.js +39 -36
- package/package.json +2 -1
|
@@ -48,6 +48,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
48
48
|
selectedUnsubscribePages: number[];
|
|
49
49
|
forceRecreate: boolean;
|
|
50
50
|
trackIdCounter: number;
|
|
51
|
+
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
51
52
|
migration: {
|
|
52
53
|
recommendationConfigs: {
|
|
53
54
|
[x: string]: {
|
|
@@ -106,6 +107,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
106
107
|
autosave: boolean;
|
|
107
108
|
allowlistEnabled: boolean;
|
|
108
109
|
linkTrackingIds: boolean;
|
|
110
|
+
allowSaveWithErrors: boolean;
|
|
109
111
|
reusableRecommendationStrategy: boolean;
|
|
110
112
|
};
|
|
111
113
|
blocks: {
|
|
@@ -191,6 +193,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
191
193
|
selectedUnsubscribePages: number[];
|
|
192
194
|
forceRecreate: boolean;
|
|
193
195
|
trackIdCounter: number;
|
|
196
|
+
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
194
197
|
migration: {
|
|
195
198
|
recommendationConfigs: {
|
|
196
199
|
[x: string]: {
|
|
@@ -249,6 +252,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
249
252
|
autosave: boolean;
|
|
250
253
|
allowlistEnabled: boolean;
|
|
251
254
|
linkTrackingIds: boolean;
|
|
255
|
+
allowSaveWithErrors: boolean;
|
|
252
256
|
reusableRecommendationStrategy: boolean;
|
|
253
257
|
};
|
|
254
258
|
blocks: {
|
|
@@ -334,6 +338,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
334
338
|
selectedUnsubscribePages: number[];
|
|
335
339
|
forceRecreate: boolean;
|
|
336
340
|
trackIdCounter: number;
|
|
341
|
+
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
337
342
|
migration: {
|
|
338
343
|
recommendationConfigs: {
|
|
339
344
|
[x: string]: {
|
|
@@ -392,6 +397,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
392
397
|
autosave: boolean;
|
|
393
398
|
allowlistEnabled: boolean;
|
|
394
399
|
linkTrackingIds: boolean;
|
|
400
|
+
allowSaveWithErrors: boolean;
|
|
395
401
|
reusableRecommendationStrategy: boolean;
|
|
396
402
|
};
|
|
397
403
|
blocks: {
|
|
@@ -477,6 +483,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
477
483
|
selectedUnsubscribePages: number[];
|
|
478
484
|
forceRecreate: boolean;
|
|
479
485
|
trackIdCounter: number;
|
|
486
|
+
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
480
487
|
migration: {
|
|
481
488
|
recommendationConfigs: {
|
|
482
489
|
[x: string]: {
|
|
@@ -535,6 +542,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
535
542
|
autosave: boolean;
|
|
536
543
|
allowlistEnabled: boolean;
|
|
537
544
|
linkTrackingIds: boolean;
|
|
545
|
+
allowSaveWithErrors: boolean;
|
|
538
546
|
reusableRecommendationStrategy: boolean;
|
|
539
547
|
};
|
|
540
548
|
blocks: {
|
|
@@ -620,6 +628,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
620
628
|
selectedUnsubscribePages: number[];
|
|
621
629
|
forceRecreate: boolean;
|
|
622
630
|
trackIdCounter: number;
|
|
631
|
+
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
623
632
|
migration: {
|
|
624
633
|
recommendationConfigs: {
|
|
625
634
|
[x: string]: {
|
|
@@ -678,6 +687,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
678
687
|
autosave: boolean;
|
|
679
688
|
allowlistEnabled: boolean;
|
|
680
689
|
linkTrackingIds: boolean;
|
|
690
|
+
allowSaveWithErrors: boolean;
|
|
681
691
|
reusableRecommendationStrategy: boolean;
|
|
682
692
|
};
|
|
683
693
|
blocks: {
|
|
@@ -763,6 +773,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
763
773
|
selectedUnsubscribePages: number[];
|
|
764
774
|
forceRecreate: boolean;
|
|
765
775
|
trackIdCounter: number;
|
|
776
|
+
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
766
777
|
migration: {
|
|
767
778
|
recommendationConfigs: {
|
|
768
779
|
[x: string]: {
|
|
@@ -821,6 +832,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
821
832
|
autosave: boolean;
|
|
822
833
|
allowlistEnabled: boolean;
|
|
823
834
|
linkTrackingIds: boolean;
|
|
835
|
+
allowSaveWithErrors: boolean;
|
|
824
836
|
reusableRecommendationStrategy: boolean;
|
|
825
837
|
};
|
|
826
838
|
blocks: {
|
|
@@ -906,6 +918,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
906
918
|
selectedUnsubscribePages: number[];
|
|
907
919
|
forceRecreate: boolean;
|
|
908
920
|
trackIdCounter: number;
|
|
921
|
+
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
909
922
|
migration: {
|
|
910
923
|
recommendationConfigs: {
|
|
911
924
|
[x: string]: {
|
|
@@ -964,6 +977,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
964
977
|
autosave: boolean;
|
|
965
978
|
allowlistEnabled: boolean;
|
|
966
979
|
linkTrackingIds: boolean;
|
|
980
|
+
allowSaveWithErrors: boolean;
|
|
967
981
|
reusableRecommendationStrategy: boolean;
|
|
968
982
|
};
|
|
969
983
|
blocks: {
|
|
@@ -1049,6 +1063,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1049
1063
|
selectedUnsubscribePages: number[];
|
|
1050
1064
|
forceRecreate: boolean;
|
|
1051
1065
|
trackIdCounter: number;
|
|
1066
|
+
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
1052
1067
|
migration: {
|
|
1053
1068
|
recommendationConfigs: {
|
|
1054
1069
|
[x: string]: {
|
|
@@ -1107,6 +1122,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1107
1122
|
autosave: boolean;
|
|
1108
1123
|
allowlistEnabled: boolean;
|
|
1109
1124
|
linkTrackingIds: boolean;
|
|
1125
|
+
allowSaveWithErrors: boolean;
|
|
1110
1126
|
reusableRecommendationStrategy: boolean;
|
|
1111
1127
|
};
|
|
1112
1128
|
blocks: {
|
|
@@ -1192,6 +1208,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1192
1208
|
selectedUnsubscribePages: number[];
|
|
1193
1209
|
forceRecreate: boolean;
|
|
1194
1210
|
trackIdCounter: number;
|
|
1211
|
+
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
1195
1212
|
migration: {
|
|
1196
1213
|
recommendationConfigs: {
|
|
1197
1214
|
[x: string]: {
|
|
@@ -1250,6 +1267,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1250
1267
|
autosave: boolean;
|
|
1251
1268
|
allowlistEnabled: boolean;
|
|
1252
1269
|
linkTrackingIds: boolean;
|
|
1270
|
+
allowSaveWithErrors: boolean;
|
|
1253
1271
|
reusableRecommendationStrategy: boolean;
|
|
1254
1272
|
};
|
|
1255
1273
|
blocks: {
|
|
@@ -1335,6 +1353,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1335
1353
|
selectedUnsubscribePages: number[];
|
|
1336
1354
|
forceRecreate: boolean;
|
|
1337
1355
|
trackIdCounter: number;
|
|
1356
|
+
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
1338
1357
|
migration: {
|
|
1339
1358
|
recommendationConfigs: {
|
|
1340
1359
|
[x: string]: {
|
|
@@ -1393,6 +1412,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1393
1412
|
autosave: boolean;
|
|
1394
1413
|
allowlistEnabled: boolean;
|
|
1395
1414
|
linkTrackingIds: boolean;
|
|
1415
|
+
allowSaveWithErrors: boolean;
|
|
1396
1416
|
reusableRecommendationStrategy: boolean;
|
|
1397
1417
|
};
|
|
1398
1418
|
blocks: {
|
|
@@ -1478,6 +1498,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1478
1498
|
selectedUnsubscribePages: number[];
|
|
1479
1499
|
forceRecreate: boolean;
|
|
1480
1500
|
trackIdCounter: number;
|
|
1501
|
+
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
1481
1502
|
migration: {
|
|
1482
1503
|
recommendationConfigs: {
|
|
1483
1504
|
[x: string]: {
|
|
@@ -1536,6 +1557,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1536
1557
|
autosave: boolean;
|
|
1537
1558
|
allowlistEnabled: boolean;
|
|
1538
1559
|
linkTrackingIds: boolean;
|
|
1560
|
+
allowSaveWithErrors: boolean;
|
|
1539
1561
|
reusableRecommendationStrategy: boolean;
|
|
1540
1562
|
};
|
|
1541
1563
|
blocks: {
|
|
@@ -1621,6 +1643,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1621
1643
|
selectedUnsubscribePages: number[];
|
|
1622
1644
|
forceRecreate: boolean;
|
|
1623
1645
|
trackIdCounter: number;
|
|
1646
|
+
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
1624
1647
|
migration: {
|
|
1625
1648
|
recommendationConfigs: {
|
|
1626
1649
|
[x: string]: {
|
|
@@ -1679,6 +1702,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1679
1702
|
autosave: boolean;
|
|
1680
1703
|
allowlistEnabled: boolean;
|
|
1681
1704
|
linkTrackingIds: boolean;
|
|
1705
|
+
allowSaveWithErrors: boolean;
|
|
1682
1706
|
reusableRecommendationStrategy: boolean;
|
|
1683
1707
|
};
|
|
1684
1708
|
blocks: {
|
|
@@ -1764,6 +1788,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1764
1788
|
selectedUnsubscribePages: number[];
|
|
1765
1789
|
forceRecreate: boolean;
|
|
1766
1790
|
trackIdCounter: number;
|
|
1791
|
+
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
1767
1792
|
migration: {
|
|
1768
1793
|
recommendationConfigs: {
|
|
1769
1794
|
[x: string]: {
|
|
@@ -1822,6 +1847,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1822
1847
|
autosave: boolean;
|
|
1823
1848
|
allowlistEnabled: boolean;
|
|
1824
1849
|
linkTrackingIds: boolean;
|
|
1850
|
+
allowSaveWithErrors: boolean;
|
|
1825
1851
|
reusableRecommendationStrategy: boolean;
|
|
1826
1852
|
};
|
|
1827
1853
|
blocks: {
|
|
@@ -1907,6 +1933,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1907
1933
|
selectedUnsubscribePages: number[];
|
|
1908
1934
|
forceRecreate: boolean;
|
|
1909
1935
|
trackIdCounter: number;
|
|
1936
|
+
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
1910
1937
|
migration: {
|
|
1911
1938
|
recommendationConfigs: {
|
|
1912
1939
|
[x: string]: {
|
|
@@ -1965,6 +1992,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1965
1992
|
autosave: boolean;
|
|
1966
1993
|
allowlistEnabled: boolean;
|
|
1967
1994
|
linkTrackingIds: boolean;
|
|
1995
|
+
allowSaveWithErrors: boolean;
|
|
1968
1996
|
reusableRecommendationStrategy: boolean;
|
|
1969
1997
|
};
|
|
1970
1998
|
blocks: {
|
|
@@ -2050,6 +2078,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2050
2078
|
selectedUnsubscribePages: number[];
|
|
2051
2079
|
forceRecreate: boolean;
|
|
2052
2080
|
trackIdCounter: number;
|
|
2081
|
+
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
2053
2082
|
migration: {
|
|
2054
2083
|
recommendationConfigs: {
|
|
2055
2084
|
[x: string]: {
|
|
@@ -2108,6 +2137,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2108
2137
|
autosave: boolean;
|
|
2109
2138
|
allowlistEnabled: boolean;
|
|
2110
2139
|
linkTrackingIds: boolean;
|
|
2140
|
+
allowSaveWithErrors: boolean;
|
|
2111
2141
|
reusableRecommendationStrategy: boolean;
|
|
2112
2142
|
};
|
|
2113
2143
|
blocks: {
|
|
@@ -2193,6 +2223,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2193
2223
|
selectedUnsubscribePages: number[];
|
|
2194
2224
|
forceRecreate: boolean;
|
|
2195
2225
|
trackIdCounter: number;
|
|
2226
|
+
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
2196
2227
|
migration: {
|
|
2197
2228
|
recommendationConfigs: {
|
|
2198
2229
|
[x: string]: {
|
|
@@ -2251,6 +2282,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2251
2282
|
autosave: boolean;
|
|
2252
2283
|
allowlistEnabled: boolean;
|
|
2253
2284
|
linkTrackingIds: boolean;
|
|
2285
|
+
allowSaveWithErrors: boolean;
|
|
2254
2286
|
reusableRecommendationStrategy: boolean;
|
|
2255
2287
|
};
|
|
2256
2288
|
blocks: {
|
|
@@ -2336,6 +2368,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2336
2368
|
selectedUnsubscribePages: number[];
|
|
2337
2369
|
forceRecreate: boolean;
|
|
2338
2370
|
trackIdCounter: number;
|
|
2371
|
+
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
2339
2372
|
migration: {
|
|
2340
2373
|
recommendationConfigs: {
|
|
2341
2374
|
[x: string]: {
|
|
@@ -2394,6 +2427,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2394
2427
|
autosave: boolean;
|
|
2395
2428
|
allowlistEnabled: boolean;
|
|
2396
2429
|
linkTrackingIds: boolean;
|
|
2430
|
+
allowSaveWithErrors: boolean;
|
|
2397
2431
|
reusableRecommendationStrategy: boolean;
|
|
2398
2432
|
};
|
|
2399
2433
|
blocks: {
|
|
@@ -2437,6 +2471,18 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2437
2471
|
};
|
|
2438
2472
|
} | null;
|
|
2439
2473
|
} & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => number;
|
|
2474
|
+
/**
|
|
2475
|
+
* Transactional campaigns keep the hard save block. Reactive getter, so
|
|
2476
|
+
* consumers stay safe in setup where a raw config read snapshots null (SD-147945).
|
|
2477
|
+
*/
|
|
2478
|
+
isTransactional(): boolean;
|
|
2479
|
+
/**
|
|
2480
|
+
* Soft-save policy: may the editor persist a template with validation errors?
|
|
2481
|
+
* Default true (host sets features.allowSaveWithErrors=false for transactional +
|
|
2482
|
+
* unsub). Reactive getter defaulting true — reading via isFeatureEnabled would
|
|
2483
|
+
* floor to false pre-init and momentarily hide the soft-save option (SD-147430).
|
|
2484
|
+
*/
|
|
2485
|
+
allowSaveWithErrors(): boolean;
|
|
2440
2486
|
/**
|
|
2441
2487
|
* Get the username
|
|
2442
2488
|
*/
|
|
@@ -2479,6 +2525,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2479
2525
|
selectedUnsubscribePages: number[];
|
|
2480
2526
|
forceRecreate: boolean;
|
|
2481
2527
|
trackIdCounter: number;
|
|
2528
|
+
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
2482
2529
|
migration: {
|
|
2483
2530
|
recommendationConfigs: {
|
|
2484
2531
|
[x: string]: {
|
|
@@ -2537,6 +2584,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2537
2584
|
autosave: boolean;
|
|
2538
2585
|
allowlistEnabled: boolean;
|
|
2539
2586
|
linkTrackingIds: boolean;
|
|
2587
|
+
allowSaveWithErrors: boolean;
|
|
2540
2588
|
reusableRecommendationStrategy: boolean;
|
|
2541
2589
|
};
|
|
2542
2590
|
blocks: {
|
|
@@ -2622,6 +2670,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2622
2670
|
selectedUnsubscribePages: number[];
|
|
2623
2671
|
forceRecreate: boolean;
|
|
2624
2672
|
trackIdCounter: number;
|
|
2673
|
+
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
2625
2674
|
migration: {
|
|
2626
2675
|
recommendationConfigs: {
|
|
2627
2676
|
[x: string]: {
|
|
@@ -2680,6 +2729,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2680
2729
|
autosave: boolean;
|
|
2681
2730
|
allowlistEnabled: boolean;
|
|
2682
2731
|
linkTrackingIds: boolean;
|
|
2732
|
+
allowSaveWithErrors: boolean;
|
|
2683
2733
|
reusableRecommendationStrategy: boolean;
|
|
2684
2734
|
};
|
|
2685
2735
|
blocks: {
|
|
@@ -2767,6 +2817,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2767
2817
|
selectedUnsubscribePages: number[];
|
|
2768
2818
|
forceRecreate: boolean;
|
|
2769
2819
|
trackIdCounter: number;
|
|
2820
|
+
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
2770
2821
|
migration: {
|
|
2771
2822
|
recommendationConfigs: {
|
|
2772
2823
|
[x: string]: {
|
|
@@ -2825,6 +2876,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2825
2876
|
autosave: boolean;
|
|
2826
2877
|
allowlistEnabled: boolean;
|
|
2827
2878
|
linkTrackingIds: boolean;
|
|
2879
|
+
allowSaveWithErrors: boolean;
|
|
2828
2880
|
reusableRecommendationStrategy: boolean;
|
|
2829
2881
|
};
|
|
2830
2882
|
blocks: {
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { SaveValidationError, SaveValidationIntent } from '@@/Types/save-validation';
|
|
2
|
+
interface SaveValidationState {
|
|
3
|
+
errors: SaveValidationError[];
|
|
4
|
+
isDrawerOpen: boolean;
|
|
5
|
+
intent: SaveValidationIntent | null;
|
|
6
|
+
}
|
|
7
|
+
export declare const useSaveValidationStore: import("pinia").StoreDefinition<"guidoSaveValidation", SaveValidationState, {
|
|
8
|
+
errorCount: (state: {
|
|
9
|
+
errors: {
|
|
10
|
+
rule: import("../enums/save-validation").SaveValidationRule;
|
|
11
|
+
message: string;
|
|
12
|
+
detail?: string | undefined;
|
|
13
|
+
type: import("../enums/toaster").ToasterTypeOptions;
|
|
14
|
+
}[];
|
|
15
|
+
isDrawerOpen: boolean;
|
|
16
|
+
intent: SaveValidationIntent | null;
|
|
17
|
+
} & import("pinia").PiniaCustomStateProperties<SaveValidationState>) => number;
|
|
18
|
+
}, {
|
|
19
|
+
open(errors: SaveValidationError[], intent: SaveValidationIntent): void;
|
|
20
|
+
close(): void;
|
|
21
|
+
}>;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { StripoEditorApi } from '@@/Types/stripo';
|
|
2
|
+
export declare const EDITOR_NOT_READY_MESSAGE = "The editor is not ready yet. Please wait for it to load and try again.";
|
|
3
|
+
export declare const findEditorApi: () => StripoEditorApi | undefined;
|
|
4
|
+
export declare const getEditorApi: () => StripoEditorApi;
|
|
@@ -15,6 +15,36 @@ import type { SavedTemplateDetails } from '@@/Types/stripo';
|
|
|
15
15
|
* same source), so it is reliably present regardless of how the block was added.
|
|
16
16
|
*/
|
|
17
17
|
export declare function getHtmlReferencedUnsubscribePages(html: string): number[];
|
|
18
|
+
/**
|
|
19
|
+
* Hydrates the recommendation extension store from the persisted `esd-ext-config`
|
|
20
|
+
* JSON blob on each `.recommendation-block-v2` element in the raw editor HTML.
|
|
21
|
+
*
|
|
22
|
+
* Why this runs before `compileHtml`:
|
|
23
|
+
* The HTML compiler's `prepareRecommendationBlocks` rule asks
|
|
24
|
+
* `useRecommendation.buildCampaignUrl(id)` to assemble each block's API URL
|
|
25
|
+
* from `blockStates[id].recommendationConfigs`. That Pinia entry is normally
|
|
26
|
+
* populated by `RecommendationBlockControl._syncNodeConfigToStore`, which
|
|
27
|
+
* only fires when the user *selects* the block. Saving without ever
|
|
28
|
+
* selecting a migrated block would otherwise build the URL from empty/
|
|
29
|
+
* default state and the campaign URL would not be saved.
|
|
30
|
+
*
|
|
31
|
+
* Why we read raw HTML, not compiled HTML:
|
|
32
|
+
* Stripo's `compileEmail()` strips editor-only attributes (`esd-*`) from the
|
|
33
|
+
* compiled output, so `esd-ext-config` is gone by the time the compiler
|
|
34
|
+
* pipeline sees the HTML. The raw HTML from `getTemplateData()` preserves
|
|
35
|
+
* the attribute as the migrator wrote it.
|
|
36
|
+
*
|
|
37
|
+
* Reference data pre-load:
|
|
38
|
+
* When the template has recommendation blocks, this also pre-loads the
|
|
39
|
+
* shared reference data (languages / currency list) so the save-time
|
|
40
|
+
* required-fields validator can check each block's locale and currency
|
|
41
|
+
* against the partner's real options. Best-effort — on a fetch failure the
|
|
42
|
+
* validator degrades to its empty-list guard (`requiredFields.ts`) instead
|
|
43
|
+
* of blocking the save or stranding the Save button.
|
|
44
|
+
*/
|
|
45
|
+
declare function hydrateRecommendationStoreFromRawHtml(rawHtml: string): Promise<void>;
|
|
18
46
|
export declare const useTemplatePreparation: () => {
|
|
19
47
|
prepareTemplateDetails: () => Promise<Omit<SavedTemplateDetails, "metadata">>;
|
|
48
|
+
hydrateRecommendationStore: typeof hydrateRecommendationStoreFromRawHtml;
|
|
20
49
|
};
|
|
50
|
+
export {};
|
|
@@ -52,6 +52,15 @@ const n = `.strategy-control-header {
|
|
|
52
52
|
mask-size: 24px 24px;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
+
.strategy-control-notice--error {
|
|
56
|
+
border-color: var(--guido-color-border-onpage-message-error);
|
|
57
|
+
background-color: var(--guido-color-background-onpage-message-error);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.strategy-control-notice--error::before {
|
|
61
|
+
background-color: var(--guido-color-border-onpage-message-error);
|
|
62
|
+
}
|
|
63
|
+
|
|
55
64
|
.strategy-control-notice-text {
|
|
56
65
|
margin: 0;
|
|
57
66
|
padding: 4px 0;
|
package/dist/stores/config.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import "../@types/config/schemas.js";
|
|
1
|
+
import { MessageType as r } from "../@types/config/schemas.js";
|
|
2
2
|
import "../@types/config/defaults.js";
|
|
3
|
-
import { parseConfig as
|
|
4
|
-
import { defineStore as
|
|
5
|
-
const
|
|
3
|
+
import { parseConfig as a } from "../@types/config/validator.js";
|
|
4
|
+
import { defineStore as o } from "pinia";
|
|
5
|
+
const g = o("guido-config", {
|
|
6
6
|
state: () => ({
|
|
7
7
|
initialized: !1,
|
|
8
8
|
config: null
|
|
@@ -11,135 +11,152 @@ const s = a("guido-config", {
|
|
|
11
11
|
/**
|
|
12
12
|
* Get the identity configuration
|
|
13
13
|
*/
|
|
14
|
-
identity: (
|
|
15
|
-
var
|
|
16
|
-
return ((
|
|
14
|
+
identity: (i) => {
|
|
15
|
+
var e;
|
|
16
|
+
return ((e = i.config) == null ? void 0 : e.identity) ?? null;
|
|
17
17
|
},
|
|
18
18
|
/**
|
|
19
19
|
* Get the partner configuration
|
|
20
20
|
*/
|
|
21
|
-
partner: (
|
|
22
|
-
var
|
|
23
|
-
return ((
|
|
21
|
+
partner: (i) => {
|
|
22
|
+
var e;
|
|
23
|
+
return ((e = i.config) == null ? void 0 : e.partner) ?? null;
|
|
24
24
|
},
|
|
25
25
|
/**
|
|
26
26
|
* Get the template configuration
|
|
27
27
|
*/
|
|
28
|
-
template: (
|
|
29
|
-
var
|
|
30
|
-
return ((
|
|
28
|
+
template: (i) => {
|
|
29
|
+
var e;
|
|
30
|
+
return ((e = i.config) == null ? void 0 : e.template) ?? null;
|
|
31
31
|
},
|
|
32
32
|
/**
|
|
33
33
|
* Get the editor configuration
|
|
34
34
|
*/
|
|
35
|
-
editor: (
|
|
36
|
-
var
|
|
37
|
-
return ((
|
|
35
|
+
editor: (i) => {
|
|
36
|
+
var e;
|
|
37
|
+
return ((e = i.config) == null ? void 0 : e.editor) ?? null;
|
|
38
38
|
},
|
|
39
39
|
/**
|
|
40
40
|
* Get the UI configuration
|
|
41
41
|
*/
|
|
42
|
-
ui: (
|
|
43
|
-
var
|
|
44
|
-
return ((
|
|
42
|
+
ui: (i) => {
|
|
43
|
+
var e;
|
|
44
|
+
return ((e = i.config) == null ? void 0 : e.ui) ?? null;
|
|
45
45
|
},
|
|
46
46
|
/**
|
|
47
47
|
* Get the features configuration
|
|
48
48
|
*/
|
|
49
|
-
features: (
|
|
50
|
-
var
|
|
51
|
-
return ((
|
|
49
|
+
features: (i) => {
|
|
50
|
+
var e;
|
|
51
|
+
return ((e = i.config) == null ? void 0 : e.features) ?? null;
|
|
52
52
|
},
|
|
53
53
|
/**
|
|
54
54
|
* Get the blocks configuration
|
|
55
55
|
*/
|
|
56
|
-
blocks: (
|
|
57
|
-
var
|
|
58
|
-
return ((
|
|
56
|
+
blocks: (i) => {
|
|
57
|
+
var e;
|
|
58
|
+
return ((e = i.config) == null ? void 0 : e.blocks) ?? null;
|
|
59
59
|
},
|
|
60
60
|
/**
|
|
61
61
|
* Get the compiler configuration
|
|
62
62
|
*/
|
|
63
|
-
compiler: (
|
|
64
|
-
var
|
|
65
|
-
return ((
|
|
63
|
+
compiler: (i) => {
|
|
64
|
+
var e;
|
|
65
|
+
return ((e = i.config) == null ? void 0 : e.compiler) ?? null;
|
|
66
66
|
},
|
|
67
67
|
/**
|
|
68
68
|
* Get the callbacks configuration
|
|
69
69
|
*/
|
|
70
|
-
callbacks: (
|
|
71
|
-
var
|
|
72
|
-
return ((
|
|
70
|
+
callbacks: (i) => {
|
|
71
|
+
var e;
|
|
72
|
+
return ((e = i.config) == null ? void 0 : e.callbacks) ?? null;
|
|
73
73
|
},
|
|
74
74
|
/**
|
|
75
75
|
* Get the template ID
|
|
76
76
|
*/
|
|
77
|
-
templateId: (
|
|
78
|
-
var
|
|
79
|
-
return ((t = (
|
|
77
|
+
templateId: (i) => {
|
|
78
|
+
var e, t;
|
|
79
|
+
return ((t = (e = i.config) == null ? void 0 : e.identity) == null ? void 0 : t.templateId) ?? "";
|
|
80
80
|
},
|
|
81
81
|
/**
|
|
82
82
|
* Get the user ID
|
|
83
83
|
*/
|
|
84
|
-
userId: (
|
|
85
|
-
var
|
|
86
|
-
return ((t = (
|
|
84
|
+
userId: (i) => {
|
|
85
|
+
var e, t;
|
|
86
|
+
return ((t = (e = i.config) == null ? void 0 : e.identity) == null ? void 0 : t.userId) ?? "";
|
|
87
87
|
},
|
|
88
88
|
/**
|
|
89
89
|
* Get the variation ID
|
|
90
90
|
*/
|
|
91
|
-
variationId: (
|
|
92
|
-
var
|
|
93
|
-
return ((t = (
|
|
91
|
+
variationId: (i) => {
|
|
92
|
+
var e, t;
|
|
93
|
+
return ((t = (e = i.config) == null ? void 0 : e.identity) == null ? void 0 : t.variationId) ?? "";
|
|
94
94
|
},
|
|
95
95
|
/**
|
|
96
96
|
* Get the campaign ID
|
|
97
97
|
*/
|
|
98
|
-
campaignId: (
|
|
99
|
-
var
|
|
100
|
-
return ((t = (
|
|
98
|
+
campaignId: (i) => {
|
|
99
|
+
var e, t;
|
|
100
|
+
return ((t = (e = i.config) == null ? void 0 : e.identity) == null ? void 0 : t.campaignId) ?? "";
|
|
101
101
|
},
|
|
102
102
|
/**
|
|
103
103
|
* Get the template-library ID of the host template
|
|
104
104
|
*/
|
|
105
|
-
templateLibraryId: (
|
|
106
|
-
var
|
|
107
|
-
return ((t = (
|
|
105
|
+
templateLibraryId: (i) => {
|
|
106
|
+
var e, t;
|
|
107
|
+
return ((t = (e = i.config) == null ? void 0 : e.identity) == null ? void 0 : t.templateLibraryId) ?? "";
|
|
108
108
|
},
|
|
109
109
|
/**
|
|
110
110
|
* Get the partner name
|
|
111
111
|
*/
|
|
112
|
-
partnerName: (
|
|
113
|
-
var
|
|
114
|
-
return ((t = (
|
|
112
|
+
partnerName: (i) => {
|
|
113
|
+
var e, t;
|
|
114
|
+
return ((t = (e = i.config) == null ? void 0 : e.partner) == null ? void 0 : t.name) ?? "";
|
|
115
115
|
},
|
|
116
116
|
/**
|
|
117
117
|
* Get the product type
|
|
118
118
|
*/
|
|
119
|
-
productType: (
|
|
120
|
-
var
|
|
121
|
-
return ((t = (
|
|
119
|
+
productType: (i) => {
|
|
120
|
+
var e, t;
|
|
121
|
+
return ((t = (e = i.config) == null ? void 0 : e.partner) == null ? void 0 : t.productType) ?? 60;
|
|
122
122
|
},
|
|
123
123
|
/**
|
|
124
124
|
* Get the message type
|
|
125
125
|
*/
|
|
126
|
-
messageType: (
|
|
127
|
-
var
|
|
128
|
-
return ((t = (
|
|
126
|
+
messageType: (i) => {
|
|
127
|
+
var e, t;
|
|
128
|
+
return ((t = (e = i.config) == null ? void 0 : e.partner) == null ? void 0 : t.messageType) ?? 1;
|
|
129
|
+
},
|
|
130
|
+
/**
|
|
131
|
+
* Transactional campaigns keep the hard save block. Reactive getter, so
|
|
132
|
+
* consumers stay safe in setup where a raw config read snapshots null (SD-147945).
|
|
133
|
+
*/
|
|
134
|
+
isTransactional() {
|
|
135
|
+
return this.messageType === r.TRANSACTIONAL;
|
|
136
|
+
},
|
|
137
|
+
/**
|
|
138
|
+
* Soft-save policy: may the editor persist a template with validation errors?
|
|
139
|
+
* Default true (host sets features.allowSaveWithErrors=false for transactional +
|
|
140
|
+
* unsub). Reactive getter defaulting true — reading via isFeatureEnabled would
|
|
141
|
+
* floor to false pre-init and momentarily hide the soft-save option (SD-147430).
|
|
142
|
+
*/
|
|
143
|
+
allowSaveWithErrors() {
|
|
144
|
+
var i;
|
|
145
|
+
return ((i = this.features) == null ? void 0 : i.allowSaveWithErrors) ?? !0;
|
|
129
146
|
},
|
|
130
147
|
/**
|
|
131
148
|
* Get the username
|
|
132
149
|
*/
|
|
133
|
-
username: (
|
|
134
|
-
var
|
|
135
|
-
return ((t = (
|
|
150
|
+
username: (i) => {
|
|
151
|
+
var e, t;
|
|
152
|
+
return ((t = (e = i.config) == null ? void 0 : e.partner) == null ? void 0 : t.username) ?? "Guido User";
|
|
136
153
|
},
|
|
137
154
|
/**
|
|
138
155
|
* Check if header should be shown
|
|
139
156
|
*/
|
|
140
|
-
showHeader: (
|
|
141
|
-
var
|
|
142
|
-
return ((t = (
|
|
157
|
+
showHeader: (i) => {
|
|
158
|
+
var e, t;
|
|
159
|
+
return ((t = (e = i.config) == null ? void 0 : e.ui) == null ? void 0 : t.showHeader) ?? !0;
|
|
143
160
|
},
|
|
144
161
|
/**
|
|
145
162
|
* Check if a specific feature is enabled.
|
|
@@ -147,18 +164,18 @@ const s = a("guido-config", {
|
|
|
147
164
|
* flash on during loading, then disappear once config resolves.
|
|
148
165
|
*/
|
|
149
166
|
// eslint-disable-next-line @stylistic/max-len
|
|
150
|
-
isFeatureEnabled: (
|
|
167
|
+
isFeatureEnabled: (i) => (e) => {
|
|
151
168
|
var t, n;
|
|
152
|
-
return ((n = (t =
|
|
169
|
+
return ((n = (t = i.config) == null ? void 0 : t.features) == null ? void 0 : n[e]) ?? !1;
|
|
153
170
|
}
|
|
154
171
|
},
|
|
155
172
|
actions: {
|
|
156
173
|
/**
|
|
157
174
|
* Initialize the config store with validated configuration
|
|
158
175
|
*/
|
|
159
|
-
init(
|
|
160
|
-
const
|
|
161
|
-
this.config =
|
|
176
|
+
init(i) {
|
|
177
|
+
const e = a(i);
|
|
178
|
+
this.config = e, this.initialized = !0;
|
|
162
179
|
},
|
|
163
180
|
/**
|
|
164
181
|
* Reset the config store
|
|
@@ -169,5 +186,5 @@ const s = a("guido-config", {
|
|
|
169
186
|
}
|
|
170
187
|
});
|
|
171
188
|
export {
|
|
172
|
-
|
|
189
|
+
g as useConfigStore
|
|
173
190
|
};
|