@useinsider/guido 3.21.2-beta.e29e764 → 3.21.2-beta.e89b843

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 (68) hide show
  1. package/README.md +1 -0
  2. package/dist/@types/config/schemas.js +41 -39
  3. package/dist/@types/display-condition.js +25 -0
  4. package/dist/components/Guido.vue.js +6 -6
  5. package/dist/components/Guido.vue2.js +81 -79
  6. package/dist/components/organisms/display-conditions/CodeEditorField.vue.js +20 -0
  7. package/dist/components/organisms/display-conditions/CodeEditorField.vue2.js +30 -0
  8. package/dist/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue.js +30 -0
  9. package/dist/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue2.js +71 -0
  10. package/dist/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue.js +34 -0
  11. package/dist/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue2.js +57 -0
  12. package/dist/components/organisms/display-conditions/DisplayConditionsHost.vue.js +17 -0
  13. package/dist/components/organisms/display-conditions/DisplayConditionsHost.vue2.js +22 -0
  14. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.js +5 -5
  15. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +9 -9
  16. package/dist/composables/useBlocksConfig.js +32 -24
  17. package/dist/composables/useDisplayConditions.js +102 -0
  18. package/dist/composables/useSave.js +75 -68
  19. package/dist/composables/validators/useHtmlDocumentCountValidator.js +22 -0
  20. package/dist/enums/academy.js +1 -0
  21. package/dist/enums/display-condition.js +12 -0
  22. package/dist/extensions/DisplayConditions/bridge.js +17 -0
  23. package/dist/extensions/DisplayConditions/constants.js +17 -0
  24. package/dist/extensions/DisplayConditions/control.js +178 -0
  25. package/dist/extensions/DisplayConditions/display-conditions.css.js +201 -0
  26. package/dist/extensions/DisplayConditions/extension.js +28 -0
  27. package/dist/extensions/DisplayConditions/iconsRegistry.js +20 -0
  28. package/dist/extensions/DisplayConditions/library.js +27 -0
  29. package/dist/extensions/DisplayConditions/settingsPanel.js +17 -0
  30. package/dist/guido.css +1 -1
  31. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +93 -92
  32. package/dist/node_modules/valibot/dist/index.js +297 -261
  33. package/dist/services/displayConditionApi.js +39 -0
  34. package/dist/services/templateLibraryApi.js +36 -31
  35. package/dist/src/@types/config/schemas.d.ts +4 -0
  36. package/dist/src/@types/display-condition.d.ts +59 -0
  37. package/dist/src/components/organisms/display-conditions/CodeEditorField.vue.d.ts +43 -0
  38. package/dist/src/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue.d.ts +2 -0
  39. package/dist/src/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue.d.ts +2 -0
  40. package/dist/src/components/organisms/display-conditions/DisplayConditionsHost.vue.d.ts +2 -0
  41. package/dist/src/composables/useConfig.d.ts +2 -0
  42. package/dist/src/composables/useDisplayConditions.d.ts +16 -0
  43. package/dist/src/composables/validators/useHtmlDocumentCountValidator.d.ts +3 -0
  44. package/dist/src/enums/academy.d.ts +1 -0
  45. package/dist/src/enums/display-condition.d.ts +15 -0
  46. package/dist/src/extensions/DisplayConditions/bridge.d.ts +6 -0
  47. package/dist/src/extensions/DisplayConditions/constants.d.ts +14 -0
  48. package/dist/src/extensions/DisplayConditions/control.d.ts +23 -0
  49. package/dist/src/extensions/DisplayConditions/extension.d.ts +2 -0
  50. package/dist/src/extensions/DisplayConditions/iconsRegistry.d.ts +4 -0
  51. package/dist/src/extensions/DisplayConditions/library.d.ts +8 -0
  52. package/dist/src/extensions/DisplayConditions/settingsPanel.d.ts +5 -0
  53. package/dist/src/mock/api/display-conditions.d.ts +2 -0
  54. package/dist/src/services/displayConditionApi.d.ts +8 -0
  55. package/dist/src/stores/config.d.ts +166 -0
  56. package/dist/src/stores/display-condition.d.ts +81 -0
  57. package/dist/src/stores/unsubscribe.d.ts +0 -10
  58. package/dist/src/utils/displayCondition.d.ts +10 -0
  59. package/dist/src/utils/protectTableText.d.ts +2 -0
  60. package/dist/src/utils/templatePreparation.d.ts +2 -1
  61. package/dist/stores/config.js +13 -6
  62. package/dist/stores/display-condition.js +28 -0
  63. package/dist/stores/unsubscribe.js +24 -28
  64. package/dist/utils/displayCondition.js +26 -0
  65. package/dist/utils/pairProductVariables.js +99 -90
  66. package/dist/utils/protectTableText.js +22 -0
  67. package/dist/utils/templatePreparation.js +30 -30
  68. package/package.json +1 -1
@@ -94,6 +94,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
94
94
  ui: {
95
95
  showHeader: boolean;
96
96
  backButtonLabel?: string | undefined;
97
+ externalDisplayConditions: boolean;
97
98
  };
98
99
  features: {
99
100
  dynamicContent: boolean;
@@ -239,6 +240,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
239
240
  ui: {
240
241
  showHeader: boolean;
241
242
  backButtonLabel?: string | undefined;
243
+ externalDisplayConditions: boolean;
242
244
  };
243
245
  features: {
244
246
  dynamicContent: boolean;
@@ -384,6 +386,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
384
386
  ui: {
385
387
  showHeader: boolean;
386
388
  backButtonLabel?: string | undefined;
389
+ externalDisplayConditions: boolean;
387
390
  };
388
391
  features: {
389
392
  dynamicContent: boolean;
@@ -529,6 +532,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
529
532
  ui: {
530
533
  showHeader: boolean;
531
534
  backButtonLabel?: string | undefined;
535
+ externalDisplayConditions: boolean;
532
536
  };
533
537
  features: {
534
538
  dynamicContent: boolean;
@@ -674,6 +678,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
674
678
  ui: {
675
679
  showHeader: boolean;
676
680
  backButtonLabel?: string | undefined;
681
+ externalDisplayConditions: boolean;
677
682
  };
678
683
  features: {
679
684
  dynamicContent: boolean;
@@ -819,6 +824,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
819
824
  ui: {
820
825
  showHeader: boolean;
821
826
  backButtonLabel?: string | undefined;
827
+ externalDisplayConditions: boolean;
822
828
  };
823
829
  features: {
824
830
  dynamicContent: boolean;
@@ -964,6 +970,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
964
970
  ui: {
965
971
  showHeader: boolean;
966
972
  backButtonLabel?: string | undefined;
973
+ externalDisplayConditions: boolean;
967
974
  };
968
975
  features: {
969
976
  dynamicContent: boolean;
@@ -1109,6 +1116,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1109
1116
  ui: {
1110
1117
  showHeader: boolean;
1111
1118
  backButtonLabel?: string | undefined;
1119
+ externalDisplayConditions: boolean;
1112
1120
  };
1113
1121
  features: {
1114
1122
  dynamicContent: boolean;
@@ -1254,6 +1262,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1254
1262
  ui: {
1255
1263
  showHeader: boolean;
1256
1264
  backButtonLabel?: string | undefined;
1265
+ externalDisplayConditions: boolean;
1257
1266
  };
1258
1267
  features: {
1259
1268
  dynamicContent: boolean;
@@ -1399,6 +1408,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1399
1408
  ui: {
1400
1409
  showHeader: boolean;
1401
1410
  backButtonLabel?: string | undefined;
1411
+ externalDisplayConditions: boolean;
1402
1412
  };
1403
1413
  features: {
1404
1414
  dynamicContent: boolean;
@@ -1544,6 +1554,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1544
1554
  ui: {
1545
1555
  showHeader: boolean;
1546
1556
  backButtonLabel?: string | undefined;
1557
+ externalDisplayConditions: boolean;
1547
1558
  };
1548
1559
  features: {
1549
1560
  dynamicContent: boolean;
@@ -1689,6 +1700,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1689
1700
  ui: {
1690
1701
  showHeader: boolean;
1691
1702
  backButtonLabel?: string | undefined;
1703
+ externalDisplayConditions: boolean;
1692
1704
  };
1693
1705
  features: {
1694
1706
  dynamicContent: boolean;
@@ -1834,6 +1846,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1834
1846
  ui: {
1835
1847
  showHeader: boolean;
1836
1848
  backButtonLabel?: string | undefined;
1849
+ externalDisplayConditions: boolean;
1837
1850
  };
1838
1851
  features: {
1839
1852
  dynamicContent: boolean;
@@ -1979,6 +1992,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1979
1992
  ui: {
1980
1993
  showHeader: boolean;
1981
1994
  backButtonLabel?: string | undefined;
1995
+ externalDisplayConditions: boolean;
1982
1996
  };
1983
1997
  features: {
1984
1998
  dynamicContent: boolean;
@@ -2124,6 +2138,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
2124
2138
  ui: {
2125
2139
  showHeader: boolean;
2126
2140
  backButtonLabel?: string | undefined;
2141
+ externalDisplayConditions: boolean;
2127
2142
  };
2128
2143
  features: {
2129
2144
  dynamicContent: boolean;
@@ -2269,6 +2284,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
2269
2284
  ui: {
2270
2285
  showHeader: boolean;
2271
2286
  backButtonLabel?: string | undefined;
2287
+ externalDisplayConditions: boolean;
2272
2288
  };
2273
2289
  features: {
2274
2290
  dynamicContent: boolean;
@@ -2414,6 +2430,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
2414
2430
  ui: {
2415
2431
  showHeader: boolean;
2416
2432
  backButtonLabel?: string | undefined;
2433
+ externalDisplayConditions: boolean;
2417
2434
  };
2418
2435
  features: {
2419
2436
  dynamicContent: boolean;
@@ -2571,6 +2588,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
2571
2588
  ui: {
2572
2589
  showHeader: boolean;
2573
2590
  backButtonLabel?: string | undefined;
2591
+ externalDisplayConditions: boolean;
2574
2592
  };
2575
2593
  features: {
2576
2594
  dynamicContent: boolean;
@@ -2716,6 +2734,153 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
2716
2734
  ui: {
2717
2735
  showHeader: boolean;
2718
2736
  backButtonLabel?: string | undefined;
2737
+ externalDisplayConditions: boolean;
2738
+ };
2739
+ features: {
2740
+ dynamicContent: boolean;
2741
+ saveAsTemplate: boolean;
2742
+ versionHistory: boolean;
2743
+ testMessage: boolean;
2744
+ displayConditions: boolean;
2745
+ unsubscribe: boolean;
2746
+ modulesDisabled: boolean;
2747
+ liquidSyntax: boolean;
2748
+ autosave: boolean;
2749
+ allowlistEnabled: boolean;
2750
+ linkTrackingIds: boolean;
2751
+ allowSaveWithErrors: boolean;
2752
+ reusableRecommendationStrategy: boolean;
2753
+ };
2754
+ blocks: {
2755
+ 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")[];
2756
+ includeCustoms: ("dynamic-content" | "checkbox-block" | "radio-button-block" | "recommendation-block" | "unsubscribe-block" | "coupon-block" | "items-block")[];
2757
+ };
2758
+ compiler: {
2759
+ customRules: ({
2760
+ type: "replace";
2761
+ search: string;
2762
+ replacement: string;
2763
+ replaceAll?: boolean | undefined;
2764
+ id: string;
2765
+ description?: string | undefined;
2766
+ priority: number;
2767
+ } | {
2768
+ type: "regex";
2769
+ pattern: string;
2770
+ replacement: string;
2771
+ flags?: string | undefined;
2772
+ id: string;
2773
+ description?: string | undefined;
2774
+ priority: number;
2775
+ } | {
2776
+ type: "remove";
2777
+ targets: string[];
2778
+ id: string;
2779
+ description?: string | undefined;
2780
+ priority: number;
2781
+ } | {
2782
+ type: "custom";
2783
+ processor: (html: string) => string;
2784
+ id: string;
2785
+ description?: string | undefined;
2786
+ priority: number;
2787
+ })[];
2788
+ ignoreDefaultRules: boolean;
2789
+ };
2790
+ callbacks: {
2791
+ externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
2792
+ };
2793
+ } | null;
2794
+ } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => boolean;
2795
+ /**
2796
+ * Check if the Insider display-condition UI replaces Stripo's
2797
+ */
2798
+ externalDisplayConditions: (state: {
2799
+ initialized: boolean;
2800
+ config: {
2801
+ identity: {
2802
+ templateId: string;
2803
+ userId: string;
2804
+ variationId?: string | undefined;
2805
+ campaignId?: string | undefined;
2806
+ templateLibraryId?: string | undefined;
2807
+ };
2808
+ partner: {
2809
+ name: string;
2810
+ productType: 60 | 49 | 97;
2811
+ messageType: 1 | 2;
2812
+ username: string;
2813
+ fallbackFont?: {
2814
+ name: string;
2815
+ family: string;
2816
+ } | undefined;
2817
+ };
2818
+ template: {
2819
+ html: string;
2820
+ css: string;
2821
+ preselectedDynamicContent: {
2822
+ text: string;
2823
+ value: string;
2824
+ fallback?: string | undefined;
2825
+ format?: {
2826
+ key: string;
2827
+ value: string;
2828
+ } | undefined;
2829
+ }[];
2830
+ dynamicContentList: {
2831
+ [x: string]: import("../library").DynamicContentNode[];
2832
+ };
2833
+ customFieldAttributes: string[];
2834
+ selectedUnsubscribePages: number[];
2835
+ forceRecreate: boolean;
2836
+ trackIdCounter: number;
2837
+ recommendationCampaignUrls?: Record<string, unknown> | undefined;
2838
+ migration: {
2839
+ recommendationConfigs: {
2840
+ [x: string]: {
2841
+ id?: number | undefined;
2842
+ decimalCount?: string | number | undefined;
2843
+ productIds?: unknown[] | undefined;
2844
+ sendProductRequestFlag?: boolean | undefined;
2845
+ shuffleProducts?: boolean | undefined;
2846
+ filters?: unknown[] | undefined;
2847
+ currency?: string | undefined;
2848
+ currencySettings?: unknown;
2849
+ language?: string | undefined;
2850
+ strategy?: string | undefined;
2851
+ recommendedProducts?: unknown[] | undefined;
2852
+ cardsInRow?: number | undefined;
2853
+ mobileRightPadding?: number | undefined;
2854
+ mobileLeftPadding?: number | undefined;
2855
+ unresponsive?: boolean | undefined;
2856
+ orientation?: string | undefined;
2857
+ textTrimming?: boolean | undefined;
2858
+ blockType?: string | undefined;
2859
+ size?: string | number | undefined;
2860
+ verticalResponsiveness?: boolean | undefined;
2861
+ isPriceMovedToNextLine?: boolean | undefined;
2862
+ isPriceDeletedForZeroSale?: boolean | undefined;
2863
+ } & {
2864
+ [key: string]: unknown;
2865
+ };
2866
+ };
2867
+ };
2868
+ };
2869
+ editor: {
2870
+ locale: string;
2871
+ translationsPath: string;
2872
+ migrationDate: number;
2873
+ emailHeader: {
2874
+ senderName: string;
2875
+ subject: string;
2876
+ };
2877
+ savedModulesFolderName: string;
2878
+ defaultModulesFolderName: string;
2879
+ };
2880
+ ui: {
2881
+ showHeader: boolean;
2882
+ backButtonLabel?: string | undefined;
2883
+ externalDisplayConditions: boolean;
2719
2884
  };
2720
2885
  features: {
2721
2886
  dynamicContent: boolean;
@@ -2863,6 +3028,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
2863
3028
  ui: {
2864
3029
  showHeader: boolean;
2865
3030
  backButtonLabel?: string | undefined;
3031
+ externalDisplayConditions: boolean;
2866
3032
  };
2867
3033
  features: {
2868
3034
  dynamicContent: boolean;
@@ -0,0 +1,81 @@
1
+ import type { AppliedDisplayCondition, SavedDisplayCondition } from '@@/Types/display-condition';
2
+ export type DisplayConditionView = 'none' | 'create' | 'select';
3
+ export type DisplayConditionListStatus = 'idle' | 'loading' | 'loaded' | 'error';
4
+ interface DisplayConditionState {
5
+ view: DisplayConditionView;
6
+ editing: AppliedDisplayCondition | null;
7
+ list: SavedDisplayCondition[];
8
+ listStatus: DisplayConditionListStatus;
9
+ pendingDelete: SavedDisplayCondition | null;
10
+ }
11
+ export declare const useDisplayConditionStore: import("pinia").StoreDefinition<"guidoDisplayCondition", DisplayConditionState, {
12
+ isCreateOpen: (state: {
13
+ view: DisplayConditionView;
14
+ editing: {
15
+ id: number;
16
+ name: string;
17
+ description: string;
18
+ beforeScript: string;
19
+ afterScript: string;
20
+ extraData?: string | undefined;
21
+ } | null;
22
+ list: {
23
+ id: number;
24
+ name: string;
25
+ description: string;
26
+ syntax: "liquid" | "pongo";
27
+ method: "codeOnly" | "logicBuilder";
28
+ codeBefore: string;
29
+ codeAfter: string;
30
+ createdAt?: string | undefined;
31
+ }[];
32
+ listStatus: DisplayConditionListStatus;
33
+ pendingDelete: {
34
+ id: number;
35
+ name: string;
36
+ description: string;
37
+ syntax: "liquid" | "pongo";
38
+ method: "codeOnly" | "logicBuilder";
39
+ codeBefore: string;
40
+ codeAfter: string;
41
+ createdAt?: string | undefined;
42
+ } | null;
43
+ } & import("pinia").PiniaCustomStateProperties<DisplayConditionState>) => boolean;
44
+ isSelectOpen: (state: {
45
+ view: DisplayConditionView;
46
+ editing: {
47
+ id: number;
48
+ name: string;
49
+ description: string;
50
+ beforeScript: string;
51
+ afterScript: string;
52
+ extraData?: string | undefined;
53
+ } | null;
54
+ list: {
55
+ id: number;
56
+ name: string;
57
+ description: string;
58
+ syntax: "liquid" | "pongo";
59
+ method: "codeOnly" | "logicBuilder";
60
+ codeBefore: string;
61
+ codeAfter: string;
62
+ createdAt?: string | undefined;
63
+ }[];
64
+ listStatus: DisplayConditionListStatus;
65
+ pendingDelete: {
66
+ id: number;
67
+ name: string;
68
+ description: string;
69
+ syntax: "liquid" | "pongo";
70
+ method: "codeOnly" | "logicBuilder";
71
+ codeBefore: string;
72
+ codeAfter: string;
73
+ createdAt?: string | undefined;
74
+ } | null;
75
+ } & import("pinia").PiniaCustomStateProperties<DisplayConditionState>) => boolean;
76
+ }, {
77
+ openCreate(editing?: AppliedDisplayCondition | null): void;
78
+ openSelect(): void;
79
+ close(): void;
80
+ }>;
81
+ export {};
@@ -26,7 +26,6 @@ export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"guido
26
26
  createdAt: string;
27
27
  updatedAt: string;
28
28
  status: number;
29
- isDefault?: boolean | undefined;
30
29
  }[];
31
30
  selectedTemplates: Record<number, number>;
32
31
  selectedUnsubscribePages: number[];
@@ -52,7 +51,6 @@ export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"guido
52
51
  createdAt: string;
53
52
  updatedAt: string;
54
53
  status: number;
55
- isDefault?: boolean | undefined;
56
54
  }[];
57
55
  selectedTemplates: Record<number, number>;
58
56
  selectedUnsubscribePages: number[];
@@ -78,7 +76,6 @@ export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"guido
78
76
  createdAt: string;
79
77
  updatedAt: string;
80
78
  status: number;
81
- isDefault?: boolean | undefined;
82
79
  }[];
83
80
  selectedTemplates: Record<number, number>;
84
81
  selectedUnsubscribePages: number[];
@@ -102,7 +99,6 @@ export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"guido
102
99
  createdAt: string;
103
100
  updatedAt: string;
104
101
  status: number;
105
- isDefault?: boolean | undefined;
106
102
  }[];
107
103
  getThumbnailByTemplateId: (state: {
108
104
  templates: {
@@ -117,7 +113,6 @@ export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"guido
117
113
  createdAt: string;
118
114
  updatedAt: string;
119
115
  status: number;
120
- isDefault?: boolean | undefined;
121
116
  }[];
122
117
  selectedTemplates: Record<number, number>;
123
118
  selectedUnsubscribePages: number[];
@@ -143,7 +138,6 @@ export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"guido
143
138
  createdAt: string;
144
139
  updatedAt: string;
145
140
  status: number;
146
- isDefault?: boolean | undefined;
147
141
  }[];
148
142
  selectedTemplates: Record<number, number>;
149
143
  selectedUnsubscribePages: number[];
@@ -169,7 +163,6 @@ export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"guido
169
163
  createdAt: string;
170
164
  updatedAt: string;
171
165
  status: number;
172
- isDefault?: boolean | undefined;
173
166
  }[];
174
167
  selectedTemplates: Record<number, number>;
175
168
  selectedUnsubscribePages: number[];
@@ -195,7 +188,6 @@ export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"guido
195
188
  createdAt: string;
196
189
  updatedAt: string;
197
190
  status: number;
198
- isDefault?: boolean | undefined;
199
191
  }[];
200
192
  selectedTemplates: Record<number, number>;
201
193
  selectedUnsubscribePages: number[];
@@ -221,7 +213,6 @@ export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"guido
221
213
  createdAt: string;
222
214
  updatedAt: string;
223
215
  status: number;
224
- isDefault?: boolean | undefined;
225
216
  }[];
226
217
  selectedTemplates: Record<number, number>;
227
218
  selectedUnsubscribePages: number[];
@@ -247,7 +238,6 @@ export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"guido
247
238
  createdAt: string;
248
239
  updatedAt: string;
249
240
  status: number;
250
- isDefault?: boolean | undefined;
251
241
  }[];
252
242
  selectedTemplates: Record<number, number>;
253
243
  selectedUnsubscribePages: number[];
@@ -0,0 +1,10 @@
1
+ import type { AppliedDisplayCondition, DisplayConditionSource } from '@@/Types/display-condition';
2
+ export declare const parseSource: (condition: AppliedDisplayCondition | null | undefined) => DisplayConditionSource | null;
3
+ type ConditionLike = Omit<AppliedDisplayCondition, 'description'> & {
4
+ description?: string | null;
5
+ };
6
+ export declare const toAppliedCondition: (condition: ConditionLike | null | undefined) => AppliedDisplayCondition | null;
7
+ export declare const nextConditionId: () => number;
8
+ export type CodeField = 'codeBefore' | 'codeAfter';
9
+ export declare const findInvalidCodeFields: (codeBefore: string, codeAfter: string) => CodeField[];
10
+ export {};
@@ -0,0 +1,2 @@
1
+ export declare function protectTableText(html: string): string;
2
+ export declare const restoreTableText: (html: string) => string;
@@ -1,3 +1,4 @@
1
+ import type { TemplateData } from '@@/Types/actions-api';
1
2
  import type { SavedTemplateDetails } from '@@/Types/stripo';
2
3
  /**
3
4
  * Collects every unsubscribe page id referenced by the unsubscribe blocks
@@ -44,7 +45,7 @@ export declare function getHtmlReferencedUnsubscribePages(html: string): number[
44
45
  */
45
46
  declare function hydrateRecommendationStoreFromRawHtml(rawHtml: string): Promise<void>;
46
47
  export declare const useTemplatePreparation: () => {
47
- prepareTemplateDetails: () => Promise<Omit<SavedTemplateDetails, "metadata">>;
48
+ prepareTemplateDetails: (prefetched?: TemplateData) => Promise<Omit<SavedTemplateDetails, "metadata">>;
48
49
  hydrateRecommendationStore: typeof hydrateRecommendationStoreFromRawHtml;
49
50
  };
50
51
  export {};
@@ -1,8 +1,8 @@
1
- import { MessageType as r } from "../@types/config/schemas.js";
1
+ import { MessageType as a } from "../@types/config/schemas.js";
2
2
  import "../@types/config/defaults.js";
3
- import { parseConfig as a } from "../@types/config/validator.js";
4
- import { defineStore as o } from "pinia";
5
- const g = o("guido-config", {
3
+ import { parseConfig as o } from "../@types/config/validator.js";
4
+ import { defineStore as l } from "pinia";
5
+ const g = l("guido-config", {
6
6
  state: () => ({
7
7
  initialized: !1,
8
8
  config: null
@@ -132,7 +132,7 @@ const g = o("guido-config", {
132
132
  * consumers stay safe in setup where a raw config read snapshots null (SD-147945).
133
133
  */
134
134
  isTransactional() {
135
- return this.messageType === r.TRANSACTIONAL;
135
+ return this.messageType === a.TRANSACTIONAL;
136
136
  },
137
137
  /**
138
138
  * Soft-save policy: may the editor persist a template with validation errors?
@@ -158,6 +158,13 @@ const g = o("guido-config", {
158
158
  var e, t;
159
159
  return ((t = (e = i.config) == null ? void 0 : e.ui) == null ? void 0 : t.showHeader) ?? !0;
160
160
  },
161
+ /**
162
+ * Check if the Insider display-condition UI replaces Stripo's
163
+ */
164
+ externalDisplayConditions: (i) => {
165
+ var e, t, n, r;
166
+ return (((t = (e = i.config) == null ? void 0 : e.ui) == null ? void 0 : t.externalDisplayConditions) ?? !1) && (((r = (n = i.config) == null ? void 0 : n.features) == null ? void 0 : r.displayConditions) ?? !0);
167
+ },
161
168
  /**
162
169
  * Check if a specific feature is enabled.
163
170
  * Returns false before init (config null) so header controls don't
@@ -174,7 +181,7 @@ const g = o("guido-config", {
174
181
  * Initialize the config store with validated configuration
175
182
  */
176
183
  init(i) {
177
- const e = a(i);
184
+ const e = o(i);
178
185
  this.config = e, this.initialized = !0;
179
186
  },
180
187
  /**
@@ -0,0 +1,28 @@
1
+ import { defineStore as i } from "pinia";
2
+ const n = i("guidoDisplayCondition", {
3
+ state: () => ({
4
+ view: "none",
5
+ editing: null,
6
+ list: [],
7
+ listStatus: "idle",
8
+ pendingDelete: null
9
+ }),
10
+ getters: {
11
+ isCreateOpen: (e) => e.view === "create",
12
+ isSelectOpen: (e) => e.view === "select"
13
+ },
14
+ actions: {
15
+ openCreate(e = null) {
16
+ this.editing = e, this.view = "create";
17
+ },
18
+ openSelect() {
19
+ this.editing = null, this.view = "select";
20
+ },
21
+ close() {
22
+ this.view = "none", this.pendingDelete = null;
23
+ }
24
+ }
25
+ });
26
+ export {
27
+ n as useDisplayConditionStore
28
+ };