@useinsider/guido 2.1.0-beta.25c1ef4 → 2.1.0-beta.28741ae

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 (61) hide show
  1. package/README.md +1 -3
  2. package/dist/components/organisms/header/EditorActions.vue.js +10 -8
  3. package/dist/components/organisms/header/EditorActions.vue2.js +40 -31
  4. package/dist/components/organisms/header/MigrationConfirmModal.vue.js +17 -0
  5. package/dist/components/organisms/header/MigrationConfirmModal.vue2.js +41 -0
  6. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.js +1 -1
  7. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +19 -19
  8. package/dist/composables/useSave.js +12 -16
  9. package/dist/composables/useStripo.js +57 -59
  10. package/dist/composables/useStripoEventHandler.js +12 -27
  11. package/dist/composables/useVersionHistoryApi.js +1 -1
  12. package/dist/config/i18n/en/index.js +11 -0
  13. package/dist/config/i18n/en/labels.json.js +12 -0
  14. package/dist/config/i18n/en/toasters.json.js +56 -0
  15. package/dist/config/i18n/en/tooltips.json.js +82 -0
  16. package/dist/config/i18n/index.js +7 -0
  17. package/dist/config/migrator/itemsBlockMigrator.js +136 -134
  18. package/dist/config/migrator/recommendationMigrator.js +42 -40
  19. package/dist/enums/unsubscribe.js +21 -25
  20. package/dist/extensions/Blocks/Items/block.js +45 -25
  21. package/dist/extensions/Blocks/Items/iconsRegistry.js +6 -5
  22. package/dist/extensions/Blocks/Items/items.css.js +48 -0
  23. package/dist/extensions/Blocks/Recommendation/block.js +49 -29
  24. package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +4 -3
  25. package/dist/extensions/Blocks/Recommendation/recommendation.css.js +48 -0
  26. package/dist/extensions/Blocks/Unsubscribe/block.js +29 -29
  27. package/dist/extensions/Blocks/Unsubscribe/control.js +12 -9
  28. package/dist/extensions/Blocks/Unsubscribe/elements/preview.js +13 -11
  29. package/dist/extensions/Blocks/Unsubscribe/styles.css.js +31 -1
  30. package/dist/extensions/Blocks/common-control.js +12 -4
  31. package/dist/extensions/Blocks/common-icons.js +39 -0
  32. package/dist/guido.css +1 -1
  33. package/dist/services/stripoApi.js +19 -55
  34. package/dist/src/@types/events.d.ts +2 -34
  35. package/dist/src/components/Guido.vue.d.ts +1 -1
  36. package/dist/src/components/organisms/header/EditorActions.vue.d.ts +1 -1
  37. package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -1
  38. package/dist/src/components/organisms/header/MigrationConfirmModal.vue.d.ts +6 -0
  39. package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -1
  40. package/dist/src/components/wrappers/WpModal.vue.d.ts +2 -2
  41. package/dist/src/config/i18n/en/index.d.ts +1 -0
  42. package/dist/src/config/i18n/index.d.ts +16 -0
  43. package/dist/src/enums/unsubscribe.d.ts +0 -3
  44. package/dist/src/extensions/Blocks/Items/block.d.ts +1 -0
  45. package/dist/src/extensions/Blocks/Recommendation/block.d.ts +1 -0
  46. package/dist/src/extensions/Blocks/Unsubscribe/control.d.ts +1 -0
  47. package/dist/src/extensions/Blocks/common-control.d.ts +5 -0
  48. package/dist/src/extensions/Blocks/common-icons.d.ts +1 -0
  49. package/dist/src/services/stripoApi.d.ts +0 -5
  50. package/dist/src/stores/editor.d.ts +0 -23
  51. package/dist/src/stores/template.d.ts +3 -0
  52. package/dist/static/styles/components/notification.css.js +18 -0
  53. package/dist/static/styles/components/tools.css.js +6 -2
  54. package/dist/static/styles/variables.css.js +2 -0
  55. package/dist/stores/editor.js +1 -2
  56. package/dist/stores/template.js +9 -0
  57. package/dist/stores/unsubscribe.js +37 -34
  58. package/package.json +1 -1
  59. package/dist/composables/useSyncModuleExtractor.js +0 -33
  60. package/dist/src/composables/useSyncModuleExtractor.d.ts +0 -4
  61. package/dist/src/mock/api/settings.d.ts +0 -2
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Stripo Editor Translation Overrides
3
+ *
4
+ * Custom translations for Stripo editor UI elements.
5
+ * Each language has its own folder with categorized JSON files.
6
+ *
7
+ * Reference: https://email-static.useinsider.com/guido/{version}/assets/i18n/en.json
8
+ * @module config/i18n
9
+ */
10
+ /**
11
+ * Combined locale patch for Stripo editor initialization.
12
+ * Maps language codes to their translation overrides.
13
+ */
14
+ export declare const localePatch: {
15
+ en: Record<string, string>;
16
+ };
@@ -25,9 +25,6 @@ export declare const PAGE_TYPES: {
25
25
  SUBSCRIPTION_PREFERENCE_CONFIRMATION: number;
26
26
  RESUBSCRIBE: number;
27
27
  };
28
- export declare const UNSUBSCRIBE_SYNC_MODULE_TYPES: {
29
- [x: number]: string;
30
- };
31
28
  export declare const TYPE_COLLECTIONS: {
32
29
  [x: number]: number[];
33
30
  };
@@ -20,6 +20,7 @@ export declare class ItemsBlock extends Block {
20
20
  getBlockCompositionType(): BlockCompositionType;
21
21
  getName(): string;
22
22
  getDescription(): string;
23
+ getSettingsPanelTitleHtml(): string;
23
24
  getTemplate(): string;
24
25
  allowInnerBlocksDND(): boolean;
25
26
  onCreated(node: ImmutableHtmlNode): void;
@@ -20,6 +20,7 @@ export declare class RecommendationBlock extends Block {
20
20
  getBlockCompositionType(): BlockCompositionType;
21
21
  getName(): string;
22
22
  getDescription(): string;
23
+ getSettingsPanelTitleHtml(): string;
23
24
  /**
24
25
  * Returns the template HTML for a new recommendation block.
25
26
  * Generates a unique recommendation ID and embeds the instance class
@@ -17,6 +17,7 @@ export declare class UnsubscribeControl extends Control {
17
17
  private _onButtonClick;
18
18
  private _onPrevClick;
19
19
  private _onNextClick;
20
+ private _loadAndUpdatePreview;
20
21
  private _updatePreview;
21
22
  private _updateCounter;
22
23
  private _getPreview;
@@ -11,6 +11,10 @@ interface LabelProps {
11
11
  name?: string;
12
12
  position?: 'top' | 'left';
13
13
  }
14
+ interface IconProps {
15
+ src: string;
16
+ className?: string;
17
+ }
14
18
  interface IconButtonProps {
15
19
  name: string;
16
20
  icon: string;
@@ -89,6 +93,7 @@ export declare abstract class CommonControl extends Control {
89
93
  }): string;
90
94
  _GuRadioButton({ name, buttons, id }: RadioButtonProps): string;
91
95
  _GuButton({ name, label, id }: ButtonProps): string;
96
+ _GuIcon({ src, className }: IconProps): string;
92
97
  /**
93
98
  *
94
99
  * @param param0
@@ -0,0 +1 @@
1
+ export declare const MIGRATION_INFO_ICON = "\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <g transform=\"translate(3, 2.5)\">\n <path d=\"M6.87812 0.141942C10.7873 -0.580665 14.6797 1.51065 16.201 5.16436C17.7344\n 8.84685 16.432 13.0909 13.0906 15.3015C9.77511 17.4946 5.36819 17.08 2.52785\n 14.3193L2.46105 14.2536C0.882709 12.6854 -0.00259777 10.5591 5.72603e-06\n 8.34301L0.000643642 8.24974C0.0491816 4.30543 2.87651 0.926565 6.78576\n 0.159555L6.87812 0.141942ZM14.5911 5.82406C13.3749 2.90345 10.2486 1.24158 7.12372\n 1.85468C3.99888 2.46779 1.74568 5.18516 1.74194 8.34505C1.73988 10.1027 2.44203\n 11.789 3.69379 13.0328C5.94435 15.269 9.4739 15.617 12.1241 13.8638C14.7742 12.1106\n 15.8071 8.74458 14.5911 5.82406Z\" fill=\"#258DDE\"/>\n <path d=\"M12.5195 13.5806C12.8537 13.2479 13.3933 13.2417 13.7351 13.5628L13.7512\n 13.5783L17.7437 17.5239C18.0845 17.8607 18.0856 18.4077 17.7461 18.7458C17.4066\n 19.0838 16.8551 19.0849 16.5143 18.7481L12.5218 14.8025L12.5061 14.7866C12.1811\n 14.4487 12.1853 13.9134 12.5195 13.5806Z\" fill=\"#258DDE\"/>\n <path d=\"M6.71262 5.42913C6.37248 5.09172 5.82105 5.09172 5.48092 5.42913C5.14079\n 5.76655 5.14079 6.3136 5.48092 6.65104L6.71262 5.42913ZM7.80353 8.95504C8.14367\n 9.29246 8.69506 9.29246 9.0352 8.95504C9.37534 8.61762 9.37534 8.07053 9.0352\n 7.73311L7.80353 8.95504ZM9.0352 7.73311C8.69506 7.39569 8.14367 7.39569 7.80353\n 7.73311C7.46339 8.07053 7.46339 8.61762 7.80353 8.95504L9.0352 7.73311ZM10.1261\n 11.259C10.4663 11.5965 11.0176 11.5965 11.3578 11.259C11.6979 10.9216 11.6979\n 10.3745 11.3578 10.0371L10.1261 11.259ZM9.0352 8.95504C9.37534 8.61762 9.37534\n 8.07053 9.0352 7.73311C8.69506 7.39569 8.14367 7.39569 7.80353 7.73311L9.0352\n 8.95504ZM5.48092 10.0371C5.14079 10.3745 5.14079 10.9216 5.48092 11.259C5.82105\n 11.5965 6.37248 11.5965 6.71262 11.259L5.48092 10.0371ZM7.80353 7.73311C7.46339\n 8.07053 7.46339 8.61762 7.80353 8.95504C8.14367 9.29246 8.69506 9.29246 9.0352\n 8.95504L7.80353 7.73311ZM11.3578 6.65104C11.6979 6.3136 11.6979 5.76655 11.3578\n 5.42913C11.0176 5.09172 10.4663 5.09172 10.1261 5.42913L11.3578 6.65104ZM5.48092\n 6.65104L7.80353 8.95504L9.0352 7.73311L6.71262 5.42913L5.48092 6.65104ZM7.80353\n 8.95504L10.1261 11.259L11.3578 10.0371L9.0352 7.73311L7.80353 8.95504ZM7.80353\n 7.73311L5.48092 10.0371L6.71262 11.259L9.0352 8.95504L7.80353 7.73311ZM9.0352\n 8.95504L11.3578 6.65104L10.1261 5.42913L7.80353 7.73311L9.0352 8.95504Z\"\n fill=\"#258DDE\"/>\n </g>\n </svg>\n";
@@ -1,4 +1,3 @@
1
- import type { ModuleUpdatedParams, SyncModuleResponse, SyncModuleUnsubscribePayload } from '@@/Types/events';
2
1
  import type { CustomFont, Template } from '@@/Types/stripo';
3
2
  export declare const useStripoApi: () => {
4
3
  getToken: () => Promise<string>;
@@ -6,8 +5,4 @@ export declare const useStripoApi: () => {
6
5
  active: boolean;
7
6
  })[]>;
8
7
  getDefaultTemplate: () => Promise<Template>;
9
- getSyncModulesStatus: () => Promise<boolean>;
10
- updateSyncModule: (params: ModuleUpdatedParams) => Promise<boolean>;
11
- getSyncModule: (moduleId: number) => Promise<SyncModuleResponse>;
12
- setSyncModuleUnsubscriptionPages: (payload: SyncModuleUnsubscribePayload[]) => Promise<boolean>;
13
8
  };
@@ -8,7 +8,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
8
8
  hasChanges: boolean;
9
9
  isStripoInitialized: boolean;
10
10
  templateId: string;
11
- syncModulesEnabled: boolean;
12
11
  }, {
13
12
  isEditorToolbarVisible: (state: {
14
13
  loadingStatus: boolean;
@@ -20,7 +19,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
20
19
  hasChanges: boolean;
21
20
  isStripoInitialized: boolean;
22
21
  templateId: string;
23
- syncModulesEnabled: boolean;
24
22
  } & import("pinia").PiniaCustomStateProperties<{
25
23
  loadingStatus: boolean;
26
24
  isCodeEditorOpen: boolean;
@@ -31,7 +29,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
31
29
  hasChanges: boolean;
32
30
  isStripoInitialized: boolean;
33
31
  templateId: string;
34
- syncModulesEnabled: boolean;
35
32
  }>) => boolean;
36
33
  isUndoButtonDisabled: (state: {
37
34
  loadingStatus: boolean;
@@ -43,7 +40,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
43
40
  hasChanges: boolean;
44
41
  isStripoInitialized: boolean;
45
42
  templateId: string;
46
- syncModulesEnabled: boolean;
47
43
  } & import("pinia").PiniaCustomStateProperties<{
48
44
  loadingStatus: boolean;
49
45
  isCodeEditorOpen: boolean;
@@ -54,7 +50,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
54
50
  hasChanges: boolean;
55
51
  isStripoInitialized: boolean;
56
52
  templateId: string;
57
- syncModulesEnabled: boolean;
58
53
  }>) => boolean;
59
54
  isRedoButtonDisabled: (state: {
60
55
  loadingStatus: boolean;
@@ -66,7 +61,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
66
61
  hasChanges: boolean;
67
62
  isStripoInitialized: boolean;
68
63
  templateId: string;
69
- syncModulesEnabled: boolean;
70
64
  } & import("pinia").PiniaCustomStateProperties<{
71
65
  loadingStatus: boolean;
72
66
  isCodeEditorOpen: boolean;
@@ -77,7 +71,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
77
71
  hasChanges: boolean;
78
72
  isStripoInitialized: boolean;
79
73
  templateId: string;
80
- syncModulesEnabled: boolean;
81
74
  }>) => boolean;
82
75
  isCodeEditorButtonDisabled: (state: {
83
76
  loadingStatus: boolean;
@@ -89,7 +82,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
89
82
  hasChanges: boolean;
90
83
  isStripoInitialized: boolean;
91
84
  templateId: string;
92
- syncModulesEnabled: boolean;
93
85
  } & import("pinia").PiniaCustomStateProperties<{
94
86
  loadingStatus: boolean;
95
87
  isCodeEditorOpen: boolean;
@@ -100,7 +92,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
100
92
  hasChanges: boolean;
101
93
  isStripoInitialized: boolean;
102
94
  templateId: string;
103
- syncModulesEnabled: boolean;
104
95
  }>) => boolean;
105
96
  isPreviewButtonDisabled: (state: {
106
97
  loadingStatus: boolean;
@@ -112,7 +103,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
112
103
  hasChanges: boolean;
113
104
  isStripoInitialized: boolean;
114
105
  templateId: string;
115
- syncModulesEnabled: boolean;
116
106
  } & import("pinia").PiniaCustomStateProperties<{
117
107
  loadingStatus: boolean;
118
108
  isCodeEditorOpen: boolean;
@@ -123,7 +113,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
123
113
  hasChanges: boolean;
124
114
  isStripoInitialized: boolean;
125
115
  templateId: string;
126
- syncModulesEnabled: boolean;
127
116
  }>) => boolean;
128
117
  isViewOptionsDisabled: (state: {
129
118
  loadingStatus: boolean;
@@ -135,7 +124,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
135
124
  hasChanges: boolean;
136
125
  isStripoInitialized: boolean;
137
126
  templateId: string;
138
- syncModulesEnabled: boolean;
139
127
  } & import("pinia").PiniaCustomStateProperties<{
140
128
  loadingStatus: boolean;
141
129
  isCodeEditorOpen: boolean;
@@ -146,7 +134,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
146
134
  hasChanges: boolean;
147
135
  isStripoInitialized: boolean;
148
136
  templateId: string;
149
- syncModulesEnabled: boolean;
150
137
  }>) => boolean;
151
138
  isVersionHistoryButtonDisabled: (state: {
152
139
  loadingStatus: boolean;
@@ -158,7 +145,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
158
145
  hasChanges: boolean;
159
146
  isStripoInitialized: boolean;
160
147
  templateId: string;
161
- syncModulesEnabled: boolean;
162
148
  } & import("pinia").PiniaCustomStateProperties<{
163
149
  loadingStatus: boolean;
164
150
  isCodeEditorOpen: boolean;
@@ -169,7 +155,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
169
155
  hasChanges: boolean;
170
156
  isStripoInitialized: boolean;
171
157
  templateId: string;
172
- syncModulesEnabled: boolean;
173
158
  }>) => boolean;
174
159
  isExportButtonDisabled: (state: {
175
160
  loadingStatus: boolean;
@@ -181,7 +166,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
181
166
  hasChanges: boolean;
182
167
  isStripoInitialized: boolean;
183
168
  templateId: string;
184
- syncModulesEnabled: boolean;
185
169
  } & import("pinia").PiniaCustomStateProperties<{
186
170
  loadingStatus: boolean;
187
171
  isCodeEditorOpen: boolean;
@@ -192,7 +176,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
192
176
  hasChanges: boolean;
193
177
  isStripoInitialized: boolean;
194
178
  templateId: string;
195
- syncModulesEnabled: boolean;
196
179
  }>) => boolean;
197
180
  isSaveAsButtonDisabled: (state: {
198
181
  loadingStatus: boolean;
@@ -204,7 +187,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
204
187
  hasChanges: boolean;
205
188
  isStripoInitialized: boolean;
206
189
  templateId: string;
207
- syncModulesEnabled: boolean;
208
190
  } & import("pinia").PiniaCustomStateProperties<{
209
191
  loadingStatus: boolean;
210
192
  isCodeEditorOpen: boolean;
@@ -215,7 +197,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
215
197
  hasChanges: boolean;
216
198
  isStripoInitialized: boolean;
217
199
  templateId: string;
218
- syncModulesEnabled: boolean;
219
200
  }>) => boolean;
220
201
  isTestButtonDisabled: (state: {
221
202
  loadingStatus: boolean;
@@ -227,7 +208,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
227
208
  hasChanges: boolean;
228
209
  isStripoInitialized: boolean;
229
210
  templateId: string;
230
- syncModulesEnabled: boolean;
231
211
  } & import("pinia").PiniaCustomStateProperties<{
232
212
  loadingStatus: boolean;
233
213
  isCodeEditorOpen: boolean;
@@ -238,7 +218,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
238
218
  hasChanges: boolean;
239
219
  isStripoInitialized: boolean;
240
220
  templateId: string;
241
- syncModulesEnabled: boolean;
242
221
  }>) => boolean;
243
222
  isSaveButtonDisabled: (state: {
244
223
  loadingStatus: boolean;
@@ -250,7 +229,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
250
229
  hasChanges: boolean;
251
230
  isStripoInitialized: boolean;
252
231
  templateId: string;
253
- syncModulesEnabled: boolean;
254
232
  } & import("pinia").PiniaCustomStateProperties<{
255
233
  loadingStatus: boolean;
256
234
  isCodeEditorOpen: boolean;
@@ -261,6 +239,5 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
261
239
  hasChanges: boolean;
262
240
  isStripoInitialized: boolean;
263
241
  templateId: string;
264
- syncModulesEnabled: boolean;
265
242
  }>) => boolean;
266
243
  }, {}>;
@@ -0,0 +1,3 @@
1
+ export declare const useTemplateStore: import("pinia").StoreDefinition<"guidoTemplate", {
2
+ migrations: Record<string, number>;
3
+ }, {}, {}>;
@@ -17,6 +17,24 @@ ue-notifications-container .alert-message-wrapper {
17
17
  padding: 16px 24px;
18
18
  }
19
19
 
20
+ ue-notifications-container .alert-message-wrapper.info,
21
+ ue-notifications-container .alert-message-wrapper.loader {
22
+ background-color: var(--guido-color-background-toaster-info) !important;
23
+ color: inherit;
24
+ }
25
+
26
+ .alert-message-wrapper .alert-message-main {
27
+ align-items: center;
28
+ }
29
+
30
+ ue-notifications-container ue-caption .caption {
31
+ color: var(--guido-color-white) !important;
32
+ }
33
+
34
+ ue-block-thumb-hint {
35
+ text-align: left;
36
+ }
37
+
20
38
  ue-notifications-container .alert-message-wrapper .alert-message-main .alert-message-content {
21
39
  width: calc(100% - 64px);
22
40
  }
@@ -1,4 +1,4 @@
1
- const o = `ue-emoji .emoji-tabs .active-smile-tab {
1
+ const e = `ue-emoji .emoji-tabs .active-smile-tab {
2
2
  border-color: var(--guido-color-primary-500);
3
3
  }
4
4
 
@@ -17,7 +17,11 @@ ue-insert-table .template-cell {
17
17
  border: 1px solid var(--guido-color-gray-300);
18
18
  box-shadow: var(--guido-box-shadow);
19
19
  }
20
+
21
+ .ue-popover.dark-tiny {
22
+ text-align: left !important;
23
+ }
20
24
  `;
21
25
  export {
22
- o as default
26
+ e as default
23
27
  };
@@ -10,6 +10,7 @@ const o = `:host {
10
10
  --guido-color-gray-1: #F0F0F0;
11
11
  --guido-color-gray-0: #F9F9F9;
12
12
  --guido-color-neutral-800: #222938;
13
+ --guido-color-neutral-700: #2C3546;
13
14
  --guido-color-neutral-200: #DCDFE6;
14
15
  --guido-color-neutral-100: #EFF2F4;
15
16
  --guido-color-danger-300: #e84342;
@@ -25,6 +26,7 @@ const o = `:host {
25
26
  --guido-color-border-onpage-message-error: var(--guido-color-danger-500);
26
27
  --guido-color-background-toaster-success: #128745;
27
28
  --guido-color-background-toaster-error: var(--guido-color-danger-500);
29
+ --guido-color-background-toaster-info: var(--guido-color-neutral-700);
28
30
  --guido-color-background-toaster-warn: #D37400;
29
31
  }
30
32
  `;
@@ -9,8 +9,7 @@ const o = e("guidoEditor", {
9
9
  editorVisualMode: "desktop",
10
10
  hasChanges: !1,
11
11
  isStripoInitialized: !1,
12
- templateId: "",
13
- syncModulesEnabled: !1
12
+ templateId: ""
14
13
  }),
15
14
  getters: {
16
15
  // Middle Slot
@@ -0,0 +1,9 @@
1
+ import { defineStore as e } from "pinia";
2
+ const o = e("guidoTemplate", {
3
+ state: () => ({
4
+ migrations: {}
5
+ })
6
+ });
7
+ export {
8
+ o as useTemplateStore
9
+ };
@@ -1,39 +1,40 @@
1
- import { TYPE_COLLECTIONS as i, PAGE_TYPES as a } from "../enums/unsubscribe.js";
2
- import { useUnsubscribeApi as r } from "../services/unsubscribeApi.js";
3
- import { defineStore as d } from "pinia";
4
- const p = () => ({
1
+ import { TYPE_COLLECTIONS as i, PAGE_TYPES as p } from "../enums/unsubscribe.js";
2
+ import { useUnsubscribeApi as d } from "../services/unsubscribeApi.js";
3
+ import { defineStore as h } from "pinia";
4
+ let o = null;
5
+ const r = () => ({
5
6
  templates: [],
6
7
  selectedTemplates: {},
7
8
  selectedUnsubscribePages: [],
8
- selectedCollectionType: a.GLOBAL_UNSUBSCRIBE,
9
- activeType: a.GLOBAL_UNSUBSCRIBE,
9
+ selectedCollectionType: p.GLOBAL_UNSUBSCRIBE,
10
+ activeType: p.GLOBAL_UNSUBSCRIBE,
10
11
  pageSelectionUpdateStatus: !1,
11
12
  pageSelectionDrawerStatus: !1,
12
13
  typeSelectionDrawerStatus: !1,
13
14
  isGlobalUnsubscribeDisabled: !1,
14
15
  isSubscriptionPreferencesCenterDisabled: !1
15
- }), g = d("guidoUnsubscribe", {
16
- state: () => p(),
16
+ }), b = h("guidoUnsubscribe", {
17
+ state: () => r(),
17
18
  getters: {
18
19
  getSelectedCollection: (e) => i[e.selectedCollectionType],
19
20
  getSelectedTemplateByActiveType: (e) => e.selectedTemplates[e.activeType],
20
21
  getTemplatesByActiveType: (e) => e.templates.filter((t) => t.type === e.activeType),
21
22
  getThumbnailByTemplateId: (e) => (t) => {
22
- var c;
23
- return ((c = e.templates.find((s) => s.id === t)) == null ? void 0 : c.thumbnail) ?? "";
23
+ var l;
24
+ return ((l = e.templates.find((s) => s.id === t)) == null ? void 0 : l.thumbnail) ?? "";
24
25
  },
25
26
  getSelectedUnsubscribePagesByCollection: (e) => (t) => {
26
- const c = i[t];
27
- if (!c)
27
+ const l = i[t];
28
+ if (!l)
28
29
  return [];
29
30
  const s = /* @__PURE__ */ new Map();
30
31
  e.templates.forEach((n) => {
31
32
  s.set(n.id, n.type);
32
33
  });
33
- const l = new Set(c);
34
+ const c = new Set(l);
34
35
  return e.selectedUnsubscribePages.filter((n) => {
35
- const o = s.get(n);
36
- return o !== void 0 && l.has(o);
36
+ const a = s.get(n);
37
+ return a !== void 0 && c.has(a);
37
38
  });
38
39
  },
39
40
  isActiveTypeFirstInCollection: (e) => {
@@ -47,7 +48,7 @@ const p = () => ({
47
48
  hasTemplatesByCollectionType: (e) => {
48
49
  const t = {};
49
50
  return i[e.selectedCollectionType].forEach((s) => {
50
- t[s] = e.templates.some((l) => l.type === s);
51
+ t[s] = e.templates.some((c) => c.type === s);
51
52
  }), t;
52
53
  },
53
54
  unsubscribePagesStatus: (e) => e.selectedUnsubscribePages.length > 0
@@ -56,29 +57,31 @@ const p = () => ({
56
57
  $reset() {
57
58
  const { templates: e, selectedUnsubscribePages: t } = this;
58
59
  Object.assign(this, {
59
- ...p(),
60
+ ...r(),
60
61
  templates: e,
61
62
  selectedUnsubscribePages: t
62
63
  });
63
64
  },
64
65
  async fetchTemplates() {
65
- if (this.templates.length)
66
- return;
67
- const { getUnsubscribePages: e } = r(), t = await e();
68
- this.templates = t;
66
+ this.templates.length || (o || (o = (async () => {
67
+ const { getUnsubscribePages: e } = d();
68
+ this.templates = await e();
69
+ })().finally(() => {
70
+ o = null;
71
+ })), await o);
69
72
  },
70
73
  setCollection(e) {
71
74
  this.selectedCollectionType = e;
72
75
  const t = i[e];
73
76
  if (t && t.length > 0) {
74
77
  [this.activeType] = t;
75
- const c = { ...this.selectedTemplates };
78
+ const l = { ...this.selectedTemplates };
76
79
  t.forEach((s) => {
77
- if (!c[s]) {
78
- const l = this.templates.find((n) => n.type === s);
79
- l && (c[s] = l.id);
80
+ if (!l[s]) {
81
+ const c = this.templates.find((n) => n.type === s);
82
+ c && (l[s] = c.id);
80
83
  }
81
- }), this.selectedTemplates = c;
84
+ }), this.selectedTemplates = l;
82
85
  }
83
86
  },
84
87
  setCollectionWithoutAutoSelection(e) {
@@ -101,17 +104,17 @@ const p = () => ({
101
104
  t >= 0 && (this.activeType = this.getSelectedCollection[t]);
102
105
  },
103
106
  loadSelectedTemplates(e) {
104
- const t = new Map(this.templates.map((s) => [s.id, s.type])), c = { ...this.selectedTemplates };
107
+ const t = new Map(this.templates.map((s) => [s.id, s.type])), l = { ...this.selectedTemplates };
105
108
  e.forEach((s) => {
106
- const l = t.get(s);
107
- l !== void 0 && (c[l] = s);
108
- }), this.selectedTemplates = c;
109
+ const c = t.get(s);
110
+ c !== void 0 && (l[c] = s);
111
+ }), this.selectedTemplates = l;
109
112
  },
110
113
  getSelectedTemplatesByCollection(e) {
111
- const t = i[e], c = [];
114
+ const t = i[e], l = [];
112
115
  return t.forEach((s) => {
113
- this.selectedTemplates[s] && c.push(this.selectedTemplates[s]);
114
- }), c;
116
+ this.selectedTemplates[s] && l.push(this.selectedTemplates[s]);
117
+ }), l;
115
118
  },
116
119
  addUnsubscribePages(e) {
117
120
  const t = /* @__PURE__ */ new Set([...this.selectedUnsubscribePages, ...e]);
@@ -125,5 +128,5 @@ const p = () => ({
125
128
  }
126
129
  });
127
130
  export {
128
- g as useUnsubscribeStore
131
+ b as useUnsubscribeStore
129
132
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "2.1.0-beta.25c1ef4",
3
+ "version": "2.1.0-beta.28741ae",
4
4
  "description": "Guido is a Vue + TypeScript wrapper for Email Plugin. Easily embed the email editor in your Vue applications.",
5
5
  "main": "./dist/guido.umd.cjs",
6
6
  "module": "./dist/library.js",
@@ -1,33 +0,0 @@
1
- import { UNSUBSCRIBE_SYNC_MODULE_TYPES as S } from "../enums/unsubscribe.js";
2
- import { DATA_ATTRIBUTES as a } from "../extensions/Blocks/Unsubscribe/utils/constants.js";
3
- import { useEditorStore as d } from "../stores/editor.js";
4
- const T = ".esd-synchronizable-module", m = '[esd-extension-block-id="unsubscribe-block"]', A = "esd-custom-block-id", M = () => {
5
- const l = d();
6
- return { extractSyncModuleUnsubscribeData: (p) => {
7
- if (!l.syncModulesEnabled)
8
- return [];
9
- const E = new DOMParser().parseFromString(p, "text/html").querySelectorAll(T), e = [];
10
- return E.forEach((r) => {
11
- const s = r.getAttribute(A);
12
- if (!s)
13
- return;
14
- r.querySelectorAll(m).forEach((o) => {
15
- const n = o.getAttribute(a.PAGE_LIST), c = o.getAttribute(a.PAGE_TYPE);
16
- if (!n || !c)
17
- return;
18
- const b = parseInt(c), u = S[b];
19
- if (!u)
20
- return;
21
- const i = n.split(",").map((t) => parseInt(t.trim())).filter((t) => !Number.isNaN(t));
22
- i.length !== 0 && e.push({
23
- stripoModuleId: s,
24
- unsubscriptionPreferencePages: i,
25
- type: u
26
- });
27
- });
28
- }), e;
29
- } };
30
- };
31
- export {
32
- M as useSyncModuleExtractor
33
- };
@@ -1,4 +0,0 @@
1
- import type { SyncModuleUnsubscribePayload } from '@@/Types/events';
2
- export declare const useSyncModuleExtractor: () => {
3
- extractSyncModuleUnsubscribeData: (html: string) => SyncModuleUnsubscribePayload[];
4
- };
@@ -1,2 +0,0 @@
1
- declare const _default: import("msw").HttpHandler[];
2
- export default _default;