@useinsider/guido 3.24.0-beta.0aa04e8 → 3.24.0-beta.172ae7a

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.
Files changed (41) hide show
  1. package/README.md +9 -0
  2. package/dist/@types/config/schemas.js +18 -16
  3. package/dist/components/Guido.vue.js +4 -4
  4. package/dist/components/Guido.vue2.js +88 -84
  5. package/dist/components/organisms/unsubscribe/LegacyUnsubscribeConvertedModal.vue.js +17 -0
  6. package/dist/components/organisms/unsubscribe/LegacyUnsubscribeConvertedModal.vue2.js +30 -0
  7. package/dist/composables/useActionsApi.js +2 -2
  8. package/dist/composables/useEditorTrackingIds.js +49 -0
  9. package/dist/composables/useModuleRepair.js +32 -23
  10. package/dist/config/migrator/index.js +10 -9
  11. package/dist/config/migrator/legacyUnsubscribeTextMigrator.js +16 -0
  12. package/dist/config/migrator/unsubscribeMigrator.js +98 -94
  13. package/dist/enums/academy.js +2 -1
  14. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +10 -8
  15. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +28 -24
  16. package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +23 -22
  17. package/dist/extensions/Blocks/Unsubscribe/block.js +96 -104
  18. package/dist/extensions/Blocks/Unsubscribe/utils/constants.js +3 -4
  19. package/dist/guido.css +1 -1
  20. package/dist/package.json.js +1 -1
  21. package/dist/services/templateLibraryApi.js +39 -36
  22. package/dist/src/@types/config/schemas.d.ts +4 -0
  23. package/dist/src/components/organisms/unsubscribe/LegacyUnsubscribeConvertedModal.vue.d.ts +2 -0
  24. package/dist/src/composables/useConfig.d.ts +2 -0
  25. package/dist/src/composables/useEditorTrackingIds.d.ts +7 -0
  26. package/dist/src/composables/useModuleRepair.d.ts +2 -11
  27. package/dist/src/config/migrator/legacyUnsubscribeTextMigrator.d.ts +1 -0
  28. package/dist/src/enums/academy.d.ts +1 -0
  29. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +2 -0
  30. package/dist/src/extensions/Blocks/Unsubscribe/utils/constants.d.ts +0 -1
  31. package/dist/src/stores/config.d.ts +20 -0
  32. package/dist/src/stores/editor.d.ts +27 -0
  33. package/dist/src/utils/legacyUnsubscribeConversion.d.ts +10 -0
  34. package/dist/src/utils/linkTrackingIds.d.ts +19 -0
  35. package/dist/stores/editor.js +1 -0
  36. package/dist/utils/legacyUnsubscribeConversion.js +49 -0
  37. package/dist/utils/linkTrackingIds.js +82 -48
  38. package/dist/utils/templatePreparation.js +30 -33
  39. package/package.json +1 -1
  40. package/dist/extensions/Blocks/Unsubscribe/utils/swapMergeTagInHref.js +0 -5
  41. package/dist/src/extensions/Blocks/Unsubscribe/utils/swapMergeTagInHref.d.ts +0 -1
@@ -57,6 +57,7 @@ interface PerBlockState {
57
57
  legacyConversionLoading: boolean;
58
58
  configVersion: number;
59
59
  adoptedSizeVersion: number;
60
+ drawnProducts: RecommendationProduct[] | null;
60
61
  }
61
62
  /**
62
63
  * Persisted-config subset used by `seedBlockUrlConfig` to reconstruct
@@ -491,6 +492,7 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
491
492
  * (SD-149916).
492
493
  */
493
494
  cloneBlockState(sourceId: number, newId: number): void;
495
+ markProductsDrawn(id: number, products: RecommendationProduct[]): void;
494
496
  /**
495
497
  * Marks a block as initialized (initial API data has been fetched).
496
498
  * Automatically cleaned up when removeBlockState deletes the block entry.
@@ -9,5 +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_MERGE_TAG_REGEX: RegExp;
13
12
  export declare const UNSUBSCRIBE_LINK_SELECTOR = "a[data-unsubscribe-link=\"true\"], a.unsubscribe-link";
@@ -110,6 +110,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
110
110
  linkTrackingIds: boolean;
111
111
  allowSaveWithErrors: boolean;
112
112
  reusableRecommendationStrategy: boolean;
113
+ legacyUnsubscribeConversion: boolean;
113
114
  };
114
115
  blocks: {
115
116
  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")[];
@@ -256,6 +257,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
256
257
  linkTrackingIds: boolean;
257
258
  allowSaveWithErrors: boolean;
258
259
  reusableRecommendationStrategy: boolean;
260
+ legacyUnsubscribeConversion: boolean;
259
261
  };
260
262
  blocks: {
261
263
  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")[];
@@ -402,6 +404,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
402
404
  linkTrackingIds: boolean;
403
405
  allowSaveWithErrors: boolean;
404
406
  reusableRecommendationStrategy: boolean;
407
+ legacyUnsubscribeConversion: boolean;
405
408
  };
406
409
  blocks: {
407
410
  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")[];
@@ -548,6 +551,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
548
551
  linkTrackingIds: boolean;
549
552
  allowSaveWithErrors: boolean;
550
553
  reusableRecommendationStrategy: boolean;
554
+ legacyUnsubscribeConversion: boolean;
551
555
  };
552
556
  blocks: {
553
557
  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")[];
@@ -694,6 +698,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
694
698
  linkTrackingIds: boolean;
695
699
  allowSaveWithErrors: boolean;
696
700
  reusableRecommendationStrategy: boolean;
701
+ legacyUnsubscribeConversion: boolean;
697
702
  };
698
703
  blocks: {
699
704
  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")[];
@@ -840,6 +845,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
840
845
  linkTrackingIds: boolean;
841
846
  allowSaveWithErrors: boolean;
842
847
  reusableRecommendationStrategy: boolean;
848
+ legacyUnsubscribeConversion: boolean;
843
849
  };
844
850
  blocks: {
845
851
  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")[];
@@ -986,6 +992,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
986
992
  linkTrackingIds: boolean;
987
993
  allowSaveWithErrors: boolean;
988
994
  reusableRecommendationStrategy: boolean;
995
+ legacyUnsubscribeConversion: boolean;
989
996
  };
990
997
  blocks: {
991
998
  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")[];
@@ -1132,6 +1139,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1132
1139
  linkTrackingIds: boolean;
1133
1140
  allowSaveWithErrors: boolean;
1134
1141
  reusableRecommendationStrategy: boolean;
1142
+ legacyUnsubscribeConversion: boolean;
1135
1143
  };
1136
1144
  blocks: {
1137
1145
  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")[];
@@ -1278,6 +1286,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1278
1286
  linkTrackingIds: boolean;
1279
1287
  allowSaveWithErrors: boolean;
1280
1288
  reusableRecommendationStrategy: boolean;
1289
+ legacyUnsubscribeConversion: boolean;
1281
1290
  };
1282
1291
  blocks: {
1283
1292
  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")[];
@@ -1424,6 +1433,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1424
1433
  linkTrackingIds: boolean;
1425
1434
  allowSaveWithErrors: boolean;
1426
1435
  reusableRecommendationStrategy: boolean;
1436
+ legacyUnsubscribeConversion: boolean;
1427
1437
  };
1428
1438
  blocks: {
1429
1439
  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")[];
@@ -1570,6 +1580,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1570
1580
  linkTrackingIds: boolean;
1571
1581
  allowSaveWithErrors: boolean;
1572
1582
  reusableRecommendationStrategy: boolean;
1583
+ legacyUnsubscribeConversion: boolean;
1573
1584
  };
1574
1585
  blocks: {
1575
1586
  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")[];
@@ -1716,6 +1727,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1716
1727
  linkTrackingIds: boolean;
1717
1728
  allowSaveWithErrors: boolean;
1718
1729
  reusableRecommendationStrategy: boolean;
1730
+ legacyUnsubscribeConversion: boolean;
1719
1731
  };
1720
1732
  blocks: {
1721
1733
  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")[];
@@ -1862,6 +1874,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1862
1874
  linkTrackingIds: boolean;
1863
1875
  allowSaveWithErrors: boolean;
1864
1876
  reusableRecommendationStrategy: boolean;
1877
+ legacyUnsubscribeConversion: boolean;
1865
1878
  };
1866
1879
  blocks: {
1867
1880
  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")[];
@@ -2008,6 +2021,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
2008
2021
  linkTrackingIds: boolean;
2009
2022
  allowSaveWithErrors: boolean;
2010
2023
  reusableRecommendationStrategy: boolean;
2024
+ legacyUnsubscribeConversion: boolean;
2011
2025
  };
2012
2026
  blocks: {
2013
2027
  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")[];
@@ -2154,6 +2168,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
2154
2168
  linkTrackingIds: boolean;
2155
2169
  allowSaveWithErrors: boolean;
2156
2170
  reusableRecommendationStrategy: boolean;
2171
+ legacyUnsubscribeConversion: boolean;
2157
2172
  };
2158
2173
  blocks: {
2159
2174
  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")[];
@@ -2300,6 +2315,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
2300
2315
  linkTrackingIds: boolean;
2301
2316
  allowSaveWithErrors: boolean;
2302
2317
  reusableRecommendationStrategy: boolean;
2318
+ legacyUnsubscribeConversion: boolean;
2303
2319
  };
2304
2320
  blocks: {
2305
2321
  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")[];
@@ -2446,6 +2462,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
2446
2462
  linkTrackingIds: boolean;
2447
2463
  allowSaveWithErrors: boolean;
2448
2464
  reusableRecommendationStrategy: boolean;
2465
+ legacyUnsubscribeConversion: boolean;
2449
2466
  };
2450
2467
  blocks: {
2451
2468
  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")[];
@@ -2604,6 +2621,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
2604
2621
  linkTrackingIds: boolean;
2605
2622
  allowSaveWithErrors: boolean;
2606
2623
  reusableRecommendationStrategy: boolean;
2624
+ legacyUnsubscribeConversion: boolean;
2607
2625
  };
2608
2626
  blocks: {
2609
2627
  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")[];
@@ -2750,6 +2768,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
2750
2768
  linkTrackingIds: boolean;
2751
2769
  allowSaveWithErrors: boolean;
2752
2770
  reusableRecommendationStrategy: boolean;
2771
+ legacyUnsubscribeConversion: boolean;
2753
2772
  };
2754
2773
  blocks: {
2755
2774
  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")[];
@@ -2898,6 +2917,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
2898
2917
  linkTrackingIds: boolean;
2899
2918
  allowSaveWithErrors: boolean;
2900
2919
  reusableRecommendationStrategy: boolean;
2920
+ legacyUnsubscribeConversion: boolean;
2901
2921
  };
2902
2922
  blocks: {
2903
2923
  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")[];
@@ -12,6 +12,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
12
12
  hasChanges: boolean;
13
13
  changeSeq: number;
14
14
  isStripoInitialized: boolean;
15
+ isLegacyUnsubscribeModalRequested: boolean;
15
16
  templateId: string;
16
17
  syncModulesEnabled: boolean;
17
18
  trackIdSessionFloor: number;
@@ -29,6 +30,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
29
30
  hasChanges: boolean;
30
31
  changeSeq: number;
31
32
  isStripoInitialized: boolean;
33
+ isLegacyUnsubscribeModalRequested: boolean;
32
34
  templateId: string;
33
35
  syncModulesEnabled: boolean;
34
36
  trackIdSessionFloor: number;
@@ -45,6 +47,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
45
47
  hasChanges: boolean;
46
48
  changeSeq: number;
47
49
  isStripoInitialized: boolean;
50
+ isLegacyUnsubscribeModalRequested: boolean;
48
51
  templateId: string;
49
52
  syncModulesEnabled: boolean;
50
53
  trackIdSessionFloor: number;
@@ -62,6 +65,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
62
65
  hasChanges: boolean;
63
66
  changeSeq: number;
64
67
  isStripoInitialized: boolean;
68
+ isLegacyUnsubscribeModalRequested: boolean;
65
69
  templateId: string;
66
70
  syncModulesEnabled: boolean;
67
71
  trackIdSessionFloor: number;
@@ -78,6 +82,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
78
82
  hasChanges: boolean;
79
83
  changeSeq: number;
80
84
  isStripoInitialized: boolean;
85
+ isLegacyUnsubscribeModalRequested: boolean;
81
86
  templateId: string;
82
87
  syncModulesEnabled: boolean;
83
88
  trackIdSessionFloor: number;
@@ -95,6 +100,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
95
100
  hasChanges: boolean;
96
101
  changeSeq: number;
97
102
  isStripoInitialized: boolean;
103
+ isLegacyUnsubscribeModalRequested: boolean;
98
104
  templateId: string;
99
105
  syncModulesEnabled: boolean;
100
106
  trackIdSessionFloor: number;
@@ -111,6 +117,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
111
117
  hasChanges: boolean;
112
118
  changeSeq: number;
113
119
  isStripoInitialized: boolean;
120
+ isLegacyUnsubscribeModalRequested: boolean;
114
121
  templateId: string;
115
122
  syncModulesEnabled: boolean;
116
123
  trackIdSessionFloor: number;
@@ -128,6 +135,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
128
135
  hasChanges: boolean;
129
136
  changeSeq: number;
130
137
  isStripoInitialized: boolean;
138
+ isLegacyUnsubscribeModalRequested: boolean;
131
139
  templateId: string;
132
140
  syncModulesEnabled: boolean;
133
141
  trackIdSessionFloor: number;
@@ -144,6 +152,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
144
152
  hasChanges: boolean;
145
153
  changeSeq: number;
146
154
  isStripoInitialized: boolean;
155
+ isLegacyUnsubscribeModalRequested: boolean;
147
156
  templateId: string;
148
157
  syncModulesEnabled: boolean;
149
158
  trackIdSessionFloor: number;
@@ -161,6 +170,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
161
170
  hasChanges: boolean;
162
171
  changeSeq: number;
163
172
  isStripoInitialized: boolean;
173
+ isLegacyUnsubscribeModalRequested: boolean;
164
174
  templateId: string;
165
175
  syncModulesEnabled: boolean;
166
176
  trackIdSessionFloor: number;
@@ -177,6 +187,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
177
187
  hasChanges: boolean;
178
188
  changeSeq: number;
179
189
  isStripoInitialized: boolean;
190
+ isLegacyUnsubscribeModalRequested: boolean;
180
191
  templateId: string;
181
192
  syncModulesEnabled: boolean;
182
193
  trackIdSessionFloor: number;
@@ -194,6 +205,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
194
205
  hasChanges: boolean;
195
206
  changeSeq: number;
196
207
  isStripoInitialized: boolean;
208
+ isLegacyUnsubscribeModalRequested: boolean;
197
209
  templateId: string;
198
210
  syncModulesEnabled: boolean;
199
211
  trackIdSessionFloor: number;
@@ -210,6 +222,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
210
222
  hasChanges: boolean;
211
223
  changeSeq: number;
212
224
  isStripoInitialized: boolean;
225
+ isLegacyUnsubscribeModalRequested: boolean;
213
226
  templateId: string;
214
227
  syncModulesEnabled: boolean;
215
228
  trackIdSessionFloor: number;
@@ -227,6 +240,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
227
240
  hasChanges: boolean;
228
241
  changeSeq: number;
229
242
  isStripoInitialized: boolean;
243
+ isLegacyUnsubscribeModalRequested: boolean;
230
244
  templateId: string;
231
245
  syncModulesEnabled: boolean;
232
246
  trackIdSessionFloor: number;
@@ -243,6 +257,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
243
257
  hasChanges: boolean;
244
258
  changeSeq: number;
245
259
  isStripoInitialized: boolean;
260
+ isLegacyUnsubscribeModalRequested: boolean;
246
261
  templateId: string;
247
262
  syncModulesEnabled: boolean;
248
263
  trackIdSessionFloor: number;
@@ -260,6 +275,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
260
275
  hasChanges: boolean;
261
276
  changeSeq: number;
262
277
  isStripoInitialized: boolean;
278
+ isLegacyUnsubscribeModalRequested: boolean;
263
279
  templateId: string;
264
280
  syncModulesEnabled: boolean;
265
281
  trackIdSessionFloor: number;
@@ -276,6 +292,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
276
292
  hasChanges: boolean;
277
293
  changeSeq: number;
278
294
  isStripoInitialized: boolean;
295
+ isLegacyUnsubscribeModalRequested: boolean;
279
296
  templateId: string;
280
297
  syncModulesEnabled: boolean;
281
298
  trackIdSessionFloor: number;
@@ -293,6 +310,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
293
310
  hasChanges: boolean;
294
311
  changeSeq: number;
295
312
  isStripoInitialized: boolean;
313
+ isLegacyUnsubscribeModalRequested: boolean;
296
314
  templateId: string;
297
315
  syncModulesEnabled: boolean;
298
316
  trackIdSessionFloor: number;
@@ -309,6 +327,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
309
327
  hasChanges: boolean;
310
328
  changeSeq: number;
311
329
  isStripoInitialized: boolean;
330
+ isLegacyUnsubscribeModalRequested: boolean;
312
331
  templateId: string;
313
332
  syncModulesEnabled: boolean;
314
333
  trackIdSessionFloor: number;
@@ -326,6 +345,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
326
345
  hasChanges: boolean;
327
346
  changeSeq: number;
328
347
  isStripoInitialized: boolean;
348
+ isLegacyUnsubscribeModalRequested: boolean;
329
349
  templateId: string;
330
350
  syncModulesEnabled: boolean;
331
351
  trackIdSessionFloor: number;
@@ -342,6 +362,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
342
362
  hasChanges: boolean;
343
363
  changeSeq: number;
344
364
  isStripoInitialized: boolean;
365
+ isLegacyUnsubscribeModalRequested: boolean;
345
366
  templateId: string;
346
367
  syncModulesEnabled: boolean;
347
368
  trackIdSessionFloor: number;
@@ -359,6 +380,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
359
380
  hasChanges: boolean;
360
381
  changeSeq: number;
361
382
  isStripoInitialized: boolean;
383
+ isLegacyUnsubscribeModalRequested: boolean;
362
384
  templateId: string;
363
385
  syncModulesEnabled: boolean;
364
386
  trackIdSessionFloor: number;
@@ -375,6 +397,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
375
397
  hasChanges: boolean;
376
398
  changeSeq: number;
377
399
  isStripoInitialized: boolean;
400
+ isLegacyUnsubscribeModalRequested: boolean;
378
401
  templateId: string;
379
402
  syncModulesEnabled: boolean;
380
403
  trackIdSessionFloor: number;
@@ -392,6 +415,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
392
415
  hasChanges: boolean;
393
416
  changeSeq: number;
394
417
  isStripoInitialized: boolean;
418
+ isLegacyUnsubscribeModalRequested: boolean;
395
419
  templateId: string;
396
420
  syncModulesEnabled: boolean;
397
421
  trackIdSessionFloor: number;
@@ -408,6 +432,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
408
432
  hasChanges: boolean;
409
433
  changeSeq: number;
410
434
  isStripoInitialized: boolean;
435
+ isLegacyUnsubscribeModalRequested: boolean;
411
436
  templateId: string;
412
437
  syncModulesEnabled: boolean;
413
438
  trackIdSessionFloor: number;
@@ -425,6 +450,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
425
450
  hasChanges: boolean;
426
451
  changeSeq: number;
427
452
  isStripoInitialized: boolean;
453
+ isLegacyUnsubscribeModalRequested: boolean;
428
454
  templateId: string;
429
455
  syncModulesEnabled: boolean;
430
456
  trackIdSessionFloor: number;
@@ -441,6 +467,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
441
467
  hasChanges: boolean;
442
468
  changeSeq: number;
443
469
  isStripoInitialized: boolean;
470
+ isLegacyUnsubscribeModalRequested: boolean;
444
471
  templateId: string;
445
472
  syncModulesEnabled: boolean;
446
473
  trackIdSessionFloor: number;
@@ -0,0 +1,10 @@
1
+ export declare const LEGACY_UNSUBSCRIBE_SELECTOR = "td.unsubscribe-block";
2
+ export declare const LEGACY_UNSUBSCRIBE_LINK_SELECTORS: readonly ["a.unsubscribe-link", "a[href*=\"unsubscribe\"]"];
3
+ export interface LegacyUnsubscribeConversionResult {
4
+ html: string;
5
+ converted: boolean;
6
+ }
7
+ export declare const hasLegacyUnsubscribeClass: (html: string) => boolean;
8
+ export declare const convertLinklessLegacyUnsubscribeBlocks: (root: ParentNode) => number;
9
+ export declare const convertLegacyUnsubscribeInModuleHtml: (html: string) => LegacyUnsubscribeConversionResult;
10
+ export declare const convertLegacyUnsubscribeInDocumentHtml: (html: string) => LegacyUnsubscribeConversionResult;
@@ -20,6 +20,25 @@ export declare function readTrackSeq(html: string): number;
20
20
  * Scans the document because a rewrite can strip the seq host but keep the ids.
21
21
  */
22
22
  export declare function readTrackFloor(html: string, persistedCounter?: number): number;
23
+ export interface TrackingIdPlan {
24
+ /** Final id per anchor, in the order the raw values were given. */
25
+ ids: number[];
26
+ reassigned: boolean[];
27
+ nextSeq: number;
28
+ seqChanged: boolean;
29
+ changed: boolean;
30
+ }
31
+ /**
32
+ * The id rule shared by the string transform and the editor-model writer: `rawIds` are the
33
+ * anchors' current `data-ins-track-id` values in document order ('' when absent).
34
+ */
35
+ export declare function planTrackingIds(rawIds: readonly string[], persistedSeq: number, floor?: number): TrackingIdPlan;
36
+ /** Reads a `data-ins-track-seq` attribute value the way readTrackSeq reads it from HTML. */
37
+ export declare function parseTrackSeq(value: string | null): number;
38
+ /** The `data-ins-track-id` value of every `<a>` opening tag in `html`, in order ('' when absent). */
39
+ export declare function readAnchorTrackIds(html: string): string[];
40
+ /** Writes `ids[i]` onto the i-th `<a>` opening tag of `html`; `null` or a missing entry leaves it untouched. */
41
+ export declare function writeAnchorTrackIds(html: string, ids: readonly (number | null)[]): string;
23
42
  /**
24
43
  * Ensures every <a> opening tag carries a unique positive-integer id and the
25
44
  * document records the id high-water mark. Ids are minted above
@@ -16,6 +16,7 @@ const o = e("guidoEditor", {
16
16
  // that need every change (the outbound state bridge) watch this instead.
17
17
  changeSeq: 0,
18
18
  isStripoInitialized: !1,
19
+ isLegacyUnsubscribeModalRequested: !1,
19
20
  templateId: "",
20
21
  syncModulesEnabled: !1,
21
22
  // In-session id high-water mark; floors tracking-id minting so ids
@@ -0,0 +1,49 @@
1
+ import { protectLiquid as a, restoreLiquid as u } from "./liquidProtection.js";
2
+ const b = "td.unsubscribe-block", l = ["a.unsubscribe-link", 'a[href*="unsubscribe"]'], d = "esd-block-text", m = [
3
+ "unsubscribe-block",
4
+ "esd-extension",
5
+ "esd-extension-block",
6
+ "esd-unsubscribe-block",
7
+ "esd-block-unsubscribe"
8
+ ], L = "esd-extension-block-id", S = "data-unsubscribe-", E = "address,article,aside,blockquote,center,details,dialog,dir,div,dd,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,li,listing,main,menu,nav,ol,p,plaintext,pre,search,section,summary,table,ul,xmp", f = new RegExp(`class\\s*=\\s*(?:["'][^"']*)?(?<![\\w-])unsubscribe-block(?![\\w-])`, "i"), p = (e) => typeof e == "string" && f.test(e), y = (e) => l.some((t) => e.querySelector(t) !== null), g = (e) => {
9
+ e.classList.remove(...m), e.classList.add(d), e.removeAttribute(L), Array.from(e.attributes).filter(({ name: t }) => t.startsWith(S)).forEach(({ name: t }) => e.removeAttribute(t)), e.querySelector(E) || (e.innerHTML = `<p path="1">${e.innerHTML}</p>`);
10
+ }, h = (e) => {
11
+ const t = Array.from(e.querySelectorAll(b)).filter((r) => !y(r));
12
+ return t.forEach(g), t.length;
13
+ }, v = (e) => {
14
+ const t = e.trimStart(), r = new DOMParser();
15
+ return /^<t[dh][\s>]/i.test(t) ? r.parseFromString(`<table><tbody><tr>${e}</tr></tbody></table>`, "text/html").querySelector("tr") : /^<tr[\s>]/i.test(t) ? r.parseFromString(`<table><tbody>${e}</tbody></table>`, "text/html").querySelector("tbody") : /^<table[\s>]/i.test(t) ? r.parseFromString(e, "text/html").body : (console.debug("[LegacyUnsubscribeConversion] Skipped module with a non-table root"), null);
16
+ }, c = (e) => {
17
+ const t = e.search(/<html[\s>]/i), r = [...e.matchAll(/<\/html\s*>/gi)].at(-1), s = (r == null ? void 0 : r.index) === void 0 ? -1 : r.index + r[0].length;
18
+ return t < 0 || s <= t ? { head: "", root: e, tail: "" } : { head: e.slice(0, t), root: e.slice(t, s), tail: e.slice(s) };
19
+ }, i = (e, t, r, s) => {
20
+ if (!p(e))
21
+ return { html: e, converted: !1 };
22
+ try {
23
+ const o = a(e), n = t(o);
24
+ return !n || h(n) === 0 ? { html: e, converted: !1 } : { html: u(r(n, o)), converted: !0 };
25
+ } catch (o) {
26
+ return console.error(`Failed to convert legacy unsubscribe blocks in ${s}:`, o), { html: e, converted: !1 };
27
+ }
28
+ }, C = (e) => i(
29
+ e,
30
+ v,
31
+ (t) => t.innerHTML,
32
+ "module"
33
+ ), _ = (e) => i(
34
+ e,
35
+ (t) => new DOMParser().parseFromString(c(t).root, "text/html"),
36
+ (t, r) => {
37
+ const { head: s, tail: o } = c(r);
38
+ return `${s}${t.documentElement.outerHTML}${o}`;
39
+ },
40
+ "document"
41
+ );
42
+ export {
43
+ l as LEGACY_UNSUBSCRIBE_LINK_SELECTORS,
44
+ b as LEGACY_UNSUBSCRIBE_SELECTOR,
45
+ _ as convertLegacyUnsubscribeInDocumentHtml,
46
+ C as convertLegacyUnsubscribeInModuleHtml,
47
+ h as convertLinklessLegacyUnsubscribeBlocks,
48
+ p as hasLegacyUnsubscribeClass
49
+ };
@@ -1,56 +1,90 @@
1
- const g = "data-ins-track-id", $ = "data-ins-track-seq", E = `(?:[^>"']|"[^"]*"|'[^']*')*`, f = new RegExp(`<a\\b${E}>`, "gi"), b = new RegExp(`<body\\b${E}>`, "i"), N = new RegExp(`<html\\b${E}>`, "i"), I = new RegExp(`\\b${g}\\s*=\\s*(?:"([^"]*)"|'([^']*)'|([^\\s>]+))`, "i"), S = new RegExp(`\\b${$}\\s*=\\s*(?:"(\\d+)"|'(\\d+)'|(\\d+))`, "i"), p = "ins-track-seq", _ = new RegExp(`<!--\\s*${p}:(\\d+)\\s*-->`, "i"), w = /^[1-9][0-9]{0,14}$/, k = 999999999999999;
2
- function m(e) {
3
- const n = Number(e);
4
- return Number.isSafeInteger(n) && n > 0 ? n : 0;
5
- }
6
- function M(e) {
7
- var a;
8
- const n = (s) => {
9
- var r;
10
- const o = (r = s.exec(e)) == null ? void 0 : r[0];
11
- return o ? S.exec(o) : null;
12
- }, t = n(b) ?? n(N), c = (t == null ? void 0 : t[1]) ?? (t == null ? void 0 : t[2]) ?? (t == null ? void 0 : t[3]) ?? ((a = _.exec(e)) == null ? void 0 : a[1]) ?? "";
13
- return m(c);
14
- }
15
- function P(e, n = 0) {
16
- let t = 0;
17
- [...e.matchAll(f)].forEach(([a]) => {
18
- const s = I.exec(a), o = s ? s[1] ?? s[2] ?? s[3] ?? "" : "";
19
- w.test(o) && (t = Math.max(t, Number(o)));
1
+ const l = "data-ins-track-id", E = "data-ins-track-seq", A = `(?:[^>"']|"[^"]*"|'[^']*')*`, k = new RegExp(`<a\\b${A}>`, "gi"), R = new RegExp(`<body\\b${A}>`, "i"), _ = new RegExp(`<html\\b${A}>`, "i"), m = new RegExp(`\\b${l}\\s*=\\s*(?:"([^"]*)"|'([^']*)'|([^\\s>]+))`, "i"), f = new RegExp(`\\b${E}\\s*=\\s*(?:"(\\d+)"|'(\\d+)'|(\\d+))`, "i"), p = "ins-track-seq", x = new RegExp(`<!--\\s*${p}:(\\d+)\\s*-->`, "i"), $ = /^[1-9][0-9]{0,14}$/, q = 999999999999999;
2
+ function I(e) {
3
+ const c = Number(e);
4
+ return Number.isSafeInteger(c) && c > 0 ? c : 0;
5
+ }
6
+ function T(e) {
7
+ return [...e.matchAll(k)].map((c) => {
8
+ const [n] = c, t = m.exec(n), r = t ? t[1] ?? t[2] ?? t[3] ?? "" : "";
9
+ return { index: c.index, tag: n, attrMatch: t, rawValue: r };
20
10
  });
21
- const c = Number.isSafeInteger(n) && n > 0 ? n : 0;
22
- return Math.max(M(e), t, c);
23
- }
24
- function q(e, n) {
25
- const t = `${$}="${n}"`, c = b.exec(e) ?? N.exec(e);
26
- if (c) {
27
- const [s] = c, o = S.exec(s), r = o ? s.replace(o[0], t) : s.replace(/\/?>$/, (T) => ` ${t}${T}`);
28
- return e.slice(0, c.index) + r + e.slice(c.index + s.length);
11
+ }
12
+ function b(e) {
13
+ var r;
14
+ const c = (s) => {
15
+ var a;
16
+ const o = (a = s.exec(e)) == null ? void 0 : a[0];
17
+ return o ? f.exec(o) : null;
18
+ }, n = c(R) ?? c(_), t = (n == null ? void 0 : n[1]) ?? (n == null ? void 0 : n[2]) ?? (n == null ? void 0 : n[3]) ?? ((r = x.exec(e)) == null ? void 0 : r[1]) ?? "";
19
+ return I(t);
20
+ }
21
+ function h(e, c = 0) {
22
+ let n = 0;
23
+ T(e).forEach(({ rawValue: r }) => {
24
+ $.test(r) && (n = Math.max(n, Number(r)));
25
+ });
26
+ const t = Number.isSafeInteger(c) && c > 0 ? c : 0;
27
+ return Math.max(b(e), n, t);
28
+ }
29
+ function w(e, c) {
30
+ const n = `${E}="${c}"`, t = R.exec(e) ?? _.exec(e);
31
+ if (t) {
32
+ const [s] = t, o = f.exec(s), a = o ? s.replace(o[0], n) : s.replace(/\/?>$/, (u) => ` ${n}${u}`);
33
+ return e.slice(0, t.index) + a + e.slice(t.index + s.length);
29
34
  }
30
- const a = `<!--${p}:${n}-->`;
31
- return _.test(e) ? e.replace(_, a) : `${a}${e}`;
35
+ const r = `<!--${p}:${c}-->`;
36
+ return x.test(e) ? e.replace(x, r) : `${r}${e}`;
32
37
  }
33
- function D(e, n, t) {
34
- const c = `${g}="${t}"`;
35
- return n ? e.replace(n[0], c) : e.replace(/^<a\b/i, (a) => `${a} ${c}`);
38
+ function M(e, c, n) {
39
+ const t = `${l}="${n}"`;
40
+ return c ? e.replace(c[0], t) : e.replace(/^<a\b/i, (r) => `${r} ${t}`);
36
41
  }
37
- function C(e, n = 0) {
42
+ function C(e, c, n = 0) {
38
43
  const t = /* @__PURE__ */ new Set();
39
- let c = 0;
40
- const a = [...e.matchAll(f)].map((i) => {
41
- const [l] = i, u = I.exec(l), R = u ? u[1] ?? u[2] ?? u[3] ?? "" : "";
42
- let x = null;
43
- return w.test(R) && !t.has(Number(R)) && (x = Number(R), t.add(x), c = Math.max(c, x)), { index: i.index, tag: l, attrMatch: u, id: x };
44
- }), s = M(e), o = Number.isSafeInteger(n) && n > 0 && n < k ? n : 0;
45
- let r = Math.max(s, c, o), T = "", d = 0, A = !1;
46
- return a.forEach((i) => {
47
- T += e.slice(d, i.index), i.id === null ? (r += 1, T += D(i.tag, i.attrMatch, r), A = !0) : T += i.tag, d = i.index + i.tag.length;
48
- }), T += e.slice(d), r > 0 && s !== r && (T = q(T, r), A = !0), { html: T, changed: A, nextSeq: r };
44
+ let r = 0;
45
+ const s = e.map((i) => {
46
+ if (!$.test(i) || t.has(Number(i)))
47
+ return null;
48
+ const d = Number(i);
49
+ return t.add(d), r = Math.max(r, d), d;
50
+ }), o = Number.isSafeInteger(n) && n > 0 && n < q ? n : 0;
51
+ let a = Math.max(c, r, o);
52
+ const u = s.map((i) => i === null), S = s.map((i) => i !== null ? i : (a += 1, a)), g = a > 0 && c !== a;
53
+ return { ids: S, reassigned: u, nextSeq: a, seqChanged: g, changed: g || u.includes(!0) };
54
+ }
55
+ function D(e) {
56
+ return e !== null && /^\d+$/.test(e) ? I(e) : 0;
57
+ }
58
+ function N(e, c, n) {
59
+ let t = "", r = 0;
60
+ return c.forEach((s, o) => {
61
+ const a = n[o] ?? null;
62
+ t += e.slice(r, s.index), t += a === null ? s.tag : M(s.tag, s.attrMatch, a), r = s.index + s.tag.length;
63
+ }), t + e.slice(r);
64
+ }
65
+ function P(e) {
66
+ return T(e).map((c) => c.rawValue);
67
+ }
68
+ function K(e, c) {
69
+ return N(e, T(e), c);
70
+ }
71
+ function O(e, c = 0) {
72
+ const n = T(e), t = C(n.map((s) => s.rawValue), b(e), c);
73
+ let r = N(
74
+ e,
75
+ n,
76
+ t.ids.map((s, o) => t.reassigned[o] ? s : null)
77
+ );
78
+ return t.seqChanged && (r = w(r, t.nextSeq)), { html: r, changed: t.changed, nextSeq: t.nextSeq };
49
79
  }
50
80
  export {
51
- g as TRACK_ID_ATTRIBUTE,
52
- $ as TRACK_SEQ_ATTRIBUTE,
53
- C as assignTrackingIds,
54
- P as readTrackFloor,
55
- M as readTrackSeq
81
+ l as TRACK_ID_ATTRIBUTE,
82
+ E as TRACK_SEQ_ATTRIBUTE,
83
+ O as assignTrackingIds,
84
+ D as parseTrackSeq,
85
+ C as planTrackingIds,
86
+ P as readAnchorTrackIds,
87
+ h as readTrackFloor,
88
+ b as readTrackSeq,
89
+ K as writeAnchorTrackIds
56
90
  };