@useinsider/guido 2.1.0-beta.7d0f92a → 2.1.0-beta.84a7014

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 (90) hide show
  1. package/README.md +77 -2
  2. package/dist/@types/config/schemas.js +70 -65
  3. package/dist/components/Guido.vue.js +1 -1
  4. package/dist/components/Guido.vue2.js +73 -62
  5. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.js +1 -1
  6. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +19 -19
  7. package/dist/composables/useBlocksConfig.js +26 -16
  8. package/dist/composables/useHtmlValidator.js +107 -119
  9. package/dist/composables/useSave.js +16 -12
  10. package/dist/composables/useStripo.js +63 -57
  11. package/dist/composables/useStripoEventHandler.js +27 -12
  12. package/dist/composables/useSyncModuleExtractor.js +45 -0
  13. package/dist/composables/useVersionHistoryApi.js +1 -1
  14. package/dist/config/compiler/utils/recommendationCompilerUtils.js +27 -22
  15. package/dist/config/i18n/en/index.js +11 -0
  16. package/dist/config/i18n/en/labels.json.js +7 -0
  17. package/dist/config/i18n/en/toasters.json.js +56 -0
  18. package/dist/config/i18n/en/tooltips.json.js +82 -0
  19. package/dist/config/i18n/index.js +7 -0
  20. package/dist/config/migrator/itemsBlockMigrator.js +127 -122
  21. package/dist/enums/defaults.js +8 -4
  22. package/dist/enums/unsubscribe.js +25 -21
  23. package/dist/extensions/Blocks/Recommendation/block.js +26 -23
  24. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +27 -26
  25. package/dist/extensions/Blocks/Recommendation/constants/layout.js +6 -4
  26. package/dist/extensions/Blocks/Recommendation/constants/selectors.js +12 -10
  27. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +103 -70
  28. package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +87 -37
  29. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +138 -117
  30. package/dist/extensions/Blocks/Recommendation/controls/mobileLayout/cssRules.js +21 -0
  31. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +117 -107
  32. package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +25 -30
  33. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +27 -30
  34. package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +20 -25
  35. package/dist/extensions/Blocks/Recommendation/templates/utils.js +43 -31
  36. package/dist/extensions/Blocks/Unsubscribe/block.js +29 -29
  37. package/dist/extensions/Blocks/Unsubscribe/control.js +12 -9
  38. package/dist/extensions/Blocks/Unsubscribe/elements/preview.js +13 -11
  39. package/dist/extensions/Blocks/Unsubscribe/styles.css.js +31 -1
  40. package/dist/extensions/ModulesTabIcons/extension.js +17 -0
  41. package/dist/guido.css +1 -1
  42. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +257 -187
  43. package/dist/services/recommendationApi.js +11 -9
  44. package/dist/services/stripoApi.js +56 -17
  45. package/dist/src/@types/config/schemas.d.ts +9 -1
  46. package/dist/src/@types/events.d.ts +38 -2
  47. package/dist/src/components/Guido.vue.d.ts +2 -2
  48. package/dist/src/components/organisms/header/EditorActions.vue.d.ts +1 -1
  49. package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -1
  50. package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -1
  51. package/dist/src/composables/useConfig.d.ts +4 -0
  52. package/dist/src/composables/useGuidoActions.d.ts +1 -1
  53. package/dist/src/composables/useSave.d.ts +2 -2
  54. package/dist/src/composables/useStripo.d.ts +2 -2
  55. package/dist/src/composables/useSyncModuleExtractor.d.ts +4 -0
  56. package/dist/src/config/i18n/en/index.d.ts +1 -0
  57. package/dist/src/config/i18n/index.d.ts +16 -0
  58. package/dist/src/enums/defaults.d.ts +4 -0
  59. package/dist/src/enums/unsubscribe.d.ts +3 -0
  60. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +2 -2
  61. package/dist/src/extensions/Blocks/Recommendation/constants/layout.d.ts +6 -0
  62. package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +4 -0
  63. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +12 -1
  64. package/dist/src/extensions/Blocks/Recommendation/controls/main/productLayout.d.ts +22 -4
  65. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +9 -2
  66. package/dist/src/extensions/Blocks/Recommendation/controls/mobileLayout/cssRules.d.ts +29 -0
  67. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +7 -0
  68. package/dist/src/extensions/Blocks/Recommendation/templates/grid/template.d.ts +1 -1
  69. package/dist/src/extensions/Blocks/Recommendation/templates/index.d.ts +2 -0
  70. package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +12 -3
  71. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +6 -0
  72. package/dist/src/extensions/Blocks/Unsubscribe/control.d.ts +1 -0
  73. package/dist/src/extensions/ModulesTabIcons/extension.d.ts +2 -0
  74. package/dist/src/mock/api/settings.d.ts +2 -0
  75. package/dist/src/services/stripoApi.d.ts +5 -0
  76. package/dist/src/stores/config.d.ts +36 -0
  77. package/dist/src/stores/editor.d.ts +23 -0
  78. package/dist/src/utils/templatePreparation.d.ts +1 -1
  79. package/dist/static/styles/components/notification.css.js +19 -0
  80. package/dist/static/styles/components/tools.css.js +6 -2
  81. package/dist/static/styles/components/version-history.css.js +10 -2
  82. package/dist/static/styles/components/wide-panel.css.js +18 -2
  83. package/dist/static/styles/customEditorStyle.css.js +10 -9
  84. package/dist/static/styles/variables.css.js +2 -0
  85. package/dist/static/templates/empty/index.html.js +74 -0
  86. package/dist/static/templates/empty/style.css.js +779 -0
  87. package/dist/stores/editor.js +2 -1
  88. package/dist/stores/unsubscribe.js +37 -34
  89. package/dist/utils/templatePreparation.js +1 -1
  90. package/package.json +1 -1
package/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  <p align="center">
2
2
  <a href="https://www.youtube.com/shorts/Y0RwBeMezL4" target="_blank" rel="noopener noreferrer">
3
- <img width="180" src="./public/guido.png" alt="Guido logo">
3
+ <img width="180"
4
+ src="https://web-image.useinsider.com/guido/defaultImageLibrary/iUH0liTK0d2YDsVB5LDN1770169173.jpg"
5
+ alt="Guido logo">
4
6
  </a>
5
7
  </p>
6
8
 
@@ -122,6 +124,8 @@ const config: GuidoConfigInput = {
122
124
  senderName?: string,
123
125
  subject?: string,
124
126
  },
127
+ savedModulesFolderName?: string, // Default: 'savedModules' - folder name for user-saved modules
128
+ defaultModulesFolderName?: string, // Default: 'defaultModules' - folder name for default/prebuilt modules
125
129
  },
126
130
 
127
131
  // Optional: UI settings
@@ -141,6 +145,11 @@ const config: GuidoConfigInput = {
141
145
  modulesDisabled?: boolean, // Default: false - Disable modules panel
142
146
  },
143
147
 
148
+ // Optional: Callbacks
149
+ callbacks?: {
150
+ externalValidation?: (data: SavedTemplateDetails) => Promise<boolean>, // Return false to cancel save
151
+ },
152
+
144
153
  // Optional: Block configuration
145
154
  blocks?: {
146
155
  excludeDefaults?: DefaultBlockType[],
@@ -165,11 +174,48 @@ const config: GuidoConfigInput = {
165
174
  | `dynamic-content:open` | `DynamicContent \| null` | User wants to insert dynamic content |
166
175
  | `back` | - | Back button clicked |
167
176
  | `save:start` | - | Save process started |
168
- | `save:complete` | `Template` | Save completed successfully |
177
+ | `save:complete` | `SavedTemplateDetails` | Save completed successfully (includes `metadata`) |
169
178
  | `on-change` | - | Template was modified |
170
179
  | `test-email:click` | - | Test email button clicked |
171
180
  | `onboarding-finished` | - | Onboarding popup dismissed |
172
181
 
182
+ ### `save:complete` Payload
183
+
184
+ The `save:complete` event emits a `SavedTemplateDetails` object containing the compiled template data along with editor `metadata`:
185
+
186
+ ```typescript
187
+ interface SavedTemplateDetails {
188
+ dynamicContentList: DynamicContent[];
189
+ compiledHtml: string;
190
+ rawHtml: string;
191
+ css: string;
192
+ ampHtml: string;
193
+ ampErrors: string[];
194
+ modules: number[];
195
+ recommendation: {
196
+ campaignUrls: Record<string, string>;
197
+ configs: Record<string, string>;
198
+ };
199
+ unsubscribe: {
200
+ status: boolean;
201
+ config: number[];
202
+ };
203
+ metadata: Metadata;
204
+ }
205
+
206
+ interface Metadata {
207
+ emailId: string;
208
+ partnerName?: string;
209
+ productType?: number;
210
+ userId: string;
211
+ username?: string;
212
+ savedModulesFolderName?: string;
213
+ defaultModulesFolderName?: string;
214
+ }
215
+ ```
216
+
217
+ > ⚠️ **Important:** The `metadata` object in the `save:complete` payload must be passed directly into your `templateConfig` / `stripoConfig` object while saving. This ensures the email-service receives the correct version of sync modules features
218
+
173
219
  ---
174
220
 
175
221
  ## Exposed Methods
@@ -251,6 +297,35 @@ const config: GuidoConfigInput = {
251
297
 
252
298
  ---
253
299
 
300
+ ## Module Folder Configuration
301
+
302
+ Customize the Stripo module folder names for saved and default modules. These values are passed to Stripo metadata and the dynamic folder paths are constructed in the Stripo plugin panel configuration.
303
+
304
+ ```typescript
305
+ const config: GuidoConfigInput = {
306
+ identity: { templateId: 'tpl-123', userId: 'user-456' },
307
+ partner: { name: 'acme' },
308
+ editor: {
309
+ // Folder name for user-saved modules
310
+ savedModulesFolderName: 'savedModules',
311
+
312
+ // Folder name for default/prebuilt modules
313
+ defaultModulesFolderName: 'defaultModules',
314
+ },
315
+ };
316
+ ```
317
+
318
+ ### Default Values
319
+
320
+ | Config Option | Default Value |
321
+ |--------------|---------------|
322
+ | `savedModulesFolderName` | `'savedModules'` |
323
+ | `defaultModulesFolderName` | `'defaultModules'` |
324
+
325
+ > **Note:** The actual folder paths (e.g., `guido_acme_savedModules`) are configured in the Stripo plugin panel using variable substitution like `${savedModulesFolderName}`.
326
+
327
+ ---
328
+
254
329
  ## HTML Compiler Rules
255
330
 
256
331
  Add custom rules to transform HTML during export:
@@ -1,4 +1,5 @@
1
- import { object as o, number as b, optional as e, string as t, pipe as u, picklist as n, custom as d, boolean as c, array as a, minLength as p, literal as r, variant as k } from "../../node_modules/valibot/dist/index.js";
1
+ import { ModuleFolderDefaults as b } from "../../enums/defaults.js";
2
+ import { object as o, number as p, optional as e, string as t, pipe as u, picklist as n, custom as S, boolean as a, array as c, minLength as d, literal as r, variant as k } from "../../node_modules/valibot/dist/index.js";
2
3
  const m = {
3
4
  /** Promotional/marketing emails */
4
5
  PROMOTIONAL: 1,
@@ -11,24 +12,24 @@ const m = {
11
12
  ARCHITECT: 49,
12
13
  /** Unsubscribe page builder */
13
14
  UNSUBSCRIBE_PAGES: 97
14
- }, S = o({
15
+ }, h = o({
15
16
  /** Unique identifier for the template being edited */
16
17
  templateId: u(
17
18
  t(),
18
- p(1, "templateId is required")
19
+ d(1, "templateId is required")
19
20
  ),
20
21
  /** Unique identifier for the user editing the template */
21
22
  userId: u(
22
23
  t(),
23
- p(1, "userId is required")
24
+ d(1, "userId is required")
24
25
  ),
25
26
  /** Optional variation ID for A/B testing */
26
27
  variationId: e(t())
27
- }), h = o({
28
+ }), y = o({
28
29
  /** Partner/organization name (required) */
29
30
  name: u(
30
31
  t(),
31
- p(1, "partner.name is required")
32
+ d(1, "partner.name is required")
32
33
  ),
33
34
  /** Product type identifier */
34
35
  productType: e(
@@ -46,7 +47,7 @@ const m = {
46
47
  ),
47
48
  /** Display name for the current user */
48
49
  username: e(t(), "Guido User")
49
- }), y = o({
50
+ }), f = o({
50
51
  /** Display text for the dynamic content */
51
52
  text: t(),
52
53
  /** Template variable value (e.g., {{username}}) */
@@ -67,14 +68,14 @@ const m = {
67
68
  css: e(t(), ""),
68
69
  /** Preselected dynamic content items */
69
70
  preselectedDynamicContent: e(
70
- a(y),
71
+ c(f),
71
72
  []
72
73
  ),
73
74
  /** Selected unsubscribe page IDs */
74
- selectedUnsubscribePages: e(a(b()), []),
75
+ selectedUnsubscribePages: e(c(p()), []),
75
76
  /** Force recreate template in Stripo storage (use true when updating externally modified templates) */
76
- forceRecreate: e(c(), !1)
77
- }), f = o({
77
+ forceRecreate: e(a(), !1)
78
+ }), A = o({
78
79
  /** Sender display name */
79
80
  senderName: e(t(), ""),
80
81
  /** Email subject line */
@@ -85,30 +86,34 @@ const m = {
85
86
  /** Path to translations object */
86
87
  translationsPath: e(t(), "window.trans[Object.keys(window.trans)[0]]"),
87
88
  /** Migration date for template compatibility */
88
- migrationDate: e(b(), 1759696858),
89
+ migrationDate: e(p(), 1759696858),
89
90
  /** Email header settings */
90
- emailHeader: e(f, { senderName: "", subject: "" })
91
- }), I = o({
91
+ emailHeader: e(A, { senderName: "", subject: "" }),
92
+ /** Folder name for user-saved modules (used by Stripo plugin panel for path construction) */
93
+ savedModulesFolderName: e(t(), b.SAVED_MODULES),
94
+ /** Folder name for default/prebuilt modules (used by Stripo plugin panel for path construction) */
95
+ defaultModulesFolderName: e(t(), b.DEFAULT_MODULES)
96
+ }), T = o({
92
97
  /** Whether to show the header bar */
93
- showHeader: e(c(), !0),
98
+ showHeader: e(a(), !0),
94
99
  /** Custom label for back button (if shown) */
95
100
  backButtonLabel: e(t())
96
- }), T = o({
101
+ }), I = o({
97
102
  /** Enable dynamic content insertion */
98
- dynamicContent: e(c(), !0),
103
+ dynamicContent: e(a(), !0),
99
104
  /** Enable save as template functionality */
100
- saveAsTemplate: e(c(), !0),
105
+ saveAsTemplate: e(a(), !0),
101
106
  /** Enable version history */
102
- versionHistory: e(c(), !0),
107
+ versionHistory: e(a(), !0),
103
108
  /** Enable test message sending */
104
- testMessage: e(c(), !0),
109
+ testMessage: e(a(), !0),
105
110
  /** Enable display conditions */
106
- displayConditions: e(c(), !0),
111
+ displayConditions: e(a(), !0),
107
112
  /** Enable unsubscribe block */
108
- unsubscribe: e(c(), !0),
113
+ unsubscribe: e(a(), !0),
109
114
  /** Disable modules panel in the editor */
110
- modulesDisabled: e(c(), !1)
111
- }), A = n([
115
+ modulesDisabled: e(a(), !1)
116
+ }), E = n([
112
117
  "amp-accordion",
113
118
  "amp-carousel",
114
119
  "amp-form-controls",
@@ -133,12 +138,12 @@ const m = {
133
138
  ]), O = o({
134
139
  /** Default blocks to exclude from the editor */
135
140
  excludeDefaults: e(
136
- a(A),
141
+ c(E),
137
142
  []
138
143
  ),
139
144
  /** Custom blocks to include in the editor */
140
145
  includeCustoms: e(
141
- a(g),
146
+ c(g),
142
147
  []
143
148
  )
144
149
  }), l = o({
@@ -147,8 +152,8 @@ const m = {
147
152
  /** Human-readable description */
148
153
  description: e(t()),
149
154
  /** Priority for rule ordering (lower = earlier) */
150
- priority: b()
151
- }), E = o({
155
+ priority: p()
156
+ }), L = o({
152
157
  ...l.entries,
153
158
  type: r("replace"),
154
159
  /** String to search for */
@@ -156,8 +161,8 @@ const m = {
156
161
  /** Replacement string */
157
162
  replacement: t(),
158
163
  /** Replace all occurrences (default: false) */
159
- replaceAll: e(c())
160
- }), N = o({
164
+ replaceAll: e(a())
165
+ }), M = o({
161
166
  ...l.entries,
162
167
  type: r("regex"),
163
168
  /** Regex pattern string */
@@ -166,82 +171,82 @@ const m = {
166
171
  replacement: t(),
167
172
  /** Regex flags (e.g., 'gi') */
168
173
  flags: e(t())
169
- }), L = o({
174
+ }), N = o({
170
175
  ...l.entries,
171
176
  type: r("remove"),
172
177
  /** Strings or patterns to remove */
173
- targets: a(t())
174
- }), v = o({
178
+ targets: c(t())
179
+ }), D = o({
175
180
  ...l.entries,
176
181
  type: r("custom"),
177
182
  /** Custom processor function */
178
- processor: d(
183
+ processor: S(
179
184
  (i) => typeof i == "function",
180
185
  "processor must be a function"
181
186
  )
182
- }), x = k("type", [
183
- E,
184
- N,
187
+ }), v = k("type", [
185
188
  L,
186
- v
187
- ]), B = o({
189
+ M,
190
+ N,
191
+ D
192
+ ]), U = o({
188
193
  /** Custom compiler rules to apply */
189
- customRules: e(a(x), []),
194
+ customRules: e(c(v), []),
190
195
  /** Skip default compiler rules */
191
- ignoreDefaultRules: e(c(), !1)
192
- }), P = o({
196
+ ignoreDefaultRules: e(a(), !1)
197
+ }), x = o({
193
198
  /**
194
199
  * External validation handler called before save completes.
195
200
  * Return false to cancel the save operation.
196
201
  */
197
202
  externalValidation: e(
198
- d(
203
+ S(
199
204
  (i) => typeof i == "function",
200
205
  "externalValidation must be a function"
201
206
  )
202
207
  )
203
- }), D = o({
208
+ }), H = o({
204
209
  // Required sections
205
210
  /** Identity configuration (required) */
206
- identity: S,
211
+ identity: h,
207
212
  /** Partner configuration (required) */
208
- partner: h,
213
+ partner: y,
209
214
  // Optional sections (with defaults)
210
215
  /** Template content and presets */
211
216
  template: e(R, {}),
212
217
  /** Editor settings */
213
218
  editor: e(C, {}),
214
219
  /** UI configuration */
215
- ui: e(I, {}),
220
+ ui: e(T, {}),
216
221
  /** Feature toggles */
217
- features: e(T, {}),
222
+ features: e(I, {}),
218
223
  /** Block configuration */
219
224
  blocks: e(O, {}),
220
225
  /** Compiler configuration */
221
- compiler: e(B, {}),
226
+ compiler: e(U, {}),
222
227
  /** Callbacks and event handlers */
223
- callbacks: e(P, {})
228
+ callbacks: e(x, {})
224
229
  });
225
230
  export {
226
231
  O as BlocksSchema,
227
- P as CallbacksSchema,
228
- x as CompilerRuleSchema,
229
- B as CompilerSchema,
232
+ x as CallbacksSchema,
233
+ v as CompilerRuleSchema,
234
+ U as CompilerSchema,
230
235
  g as CustomBlockTypeSchema,
231
- v as CustomRuleSchema,
232
- A as DefaultBlockTypeSchema,
233
- y as DynamicContentSchema,
236
+ D as CustomRuleSchema,
237
+ E as DefaultBlockTypeSchema,
238
+ f as DynamicContentSchema,
234
239
  C as EditorSchema,
235
- f as EmailHeaderSchema,
236
- T as FeaturesSchema,
237
- D as GuidoConfigSchema,
238
- S as IdentitySchema,
240
+ A as EmailHeaderSchema,
241
+ I as FeaturesSchema,
242
+ H as GuidoConfigSchema,
243
+ h as IdentitySchema,
239
244
  m as MessageType,
240
- h as PartnerSchema,
245
+ y as PartnerSchema,
241
246
  s as ProductType,
242
- N as RegexRuleSchema,
243
- L as RemoveRuleSchema,
244
- E as ReplaceRuleSchema,
247
+ M as RegexRuleSchema,
248
+ N as RemoveRuleSchema,
249
+ L as ReplaceRuleSchema,
245
250
  R as TemplateSchema,
246
- I as UISchema
251
+ T as UISchema
247
252
  };
@@ -12,7 +12,7 @@ var t = function() {
12
12
  n,
13
13
  !1,
14
14
  null,
15
- "890b5336"
15
+ "a26d7792"
16
16
  );
17
17
  const v = s.exports;
18
18
  export {
@@ -1,54 +1,64 @@
1
- import { defineComponent as B, defineAsyncComponent as P, ref as N, computed as U, watch as R, onMounted as z, onUnmounted as K } from "vue";
2
- import { provideGuidoActions as M } from "../composables/useGuidoActions.js";
3
- import { usePartner as j } from "../composables/usePartner.js";
4
- import { useStripo as q } from "../composables/useStripo.js";
5
- import { useTimerClone as J } from "../composables/useTimerClone.js";
6
- import { migrate as W } from "../config/migrator/index.js";
7
- import Q from "./organisms/base/Toaster.vue.js";
8
- import V from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
9
- import X from "./organisms/header/HeaderWrapper.vue.js";
10
- import Y from "./organisms/LoadingWrapper.vue.js";
11
- import Z from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
12
- import $ from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
13
- import { useStripoApi as ee } from "../services/stripoApi.js";
14
- import { useConfigStore as oe } from "../stores/config.js";
15
- import { useDynamicContentStore as te } from "../stores/dynamic-content.js";
16
- import { useEditorStore as ne } from "../stores/editor.js";
17
- import { usePreviewStore as re } from "../stores/preview.js";
18
- import { useUnsubscribeStore as se } from "../stores/unsubscribe.js";
19
- const Ee = /* @__PURE__ */ B({
1
+ import { defineComponent as K, defineAsyncComponent as _, ref as V, computed as P, watch as j, onMounted as q, onUnmounted as J } from "vue";
2
+ import { provideGuidoActions as Q } from "../composables/useGuidoActions.js";
3
+ import { usePartner as X } from "../composables/usePartner.js";
4
+ import { useStripo as Y } from "../composables/useStripo.js";
5
+ import { useTimerClone as Z } from "../composables/useTimerClone.js";
6
+ import { migrate as A } from "../config/migrator/index.js";
7
+ import { ModuleFolderDefaults as N } from "../enums/defaults.js";
8
+ import $ from "./organisms/base/Toaster.vue.js";
9
+ import ee from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
10
+ import oe from "./organisms/header/HeaderWrapper.vue.js";
11
+ import te from "./organisms/LoadingWrapper.vue.js";
12
+ import ne from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
13
+ import se from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
14
+ import { useStripoApi as re } from "../services/stripoApi.js";
15
+ import { useConfigStore as ce } from "../stores/config.js";
16
+ import { useDynamicContentStore as ae } from "../stores/dynamic-content.js";
17
+ import { useEditorStore as ie } from "../stores/editor.js";
18
+ import { usePreviewStore as me } from "../stores/preview.js";
19
+ import { useUnsubscribeStore as de } from "../stores/unsubscribe.js";
20
+ const Me = /* @__PURE__ */ K({
20
21
  __name: "Guido",
21
22
  props: {
22
23
  config: null
23
24
  },
24
25
  emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
25
- setup(_, { expose: I, emit: t }) {
26
- const l = _, L = P(
26
+ setup(W, { expose: I, emit: t }) {
27
+ const v = W, O = _(
27
28
  () => import("./organisms/email-preview/PreviewContainer.vue.js")
28
- ), A = P(
29
+ ), G = _(
29
30
  () => import("./organisms/onboarding/OnboardingWrapper.vue.js")
30
- ), p = N(), c = te(), u = se(), n = oe();
31
- n.init(l.config);
32
- const i = ne(), F = re(), r = U(() => i.hasChanges), { isTestPartner: G } = j(), v = () => {
31
+ ), h = V(), i = ae(), y = de(), s = ce();
32
+ s.init(v.config);
33
+ const m = ie(), H = me(), c = P(() => m.hasChanges), { isTestPartner: x } = X(), f = () => {
33
34
  var e;
34
- return (e = p.value) == null ? void 0 : e.handleSave(!0);
35
- }, { templateId: a, userId: y, partnerName: h, productType: b, username: f, template: o } = n, s = (o == null ? void 0 : o.html) || "", g = (o == null ? void 0 : o.css) || "", m = (o == null ? void 0 : o.preselectedDynamicContent) || [];
36
- i.templateId = a;
37
- const { initPlugin: S } = q({
38
- emailId: a,
39
- userId: y,
40
- username: f,
41
- partnerName: h,
42
- productType: b,
43
- preselectedDynamicContentList: m,
35
+ return (e = h.value) == null ? void 0 : e.handleSave(!0);
36
+ }, {
37
+ templateId: d,
38
+ userId: b,
39
+ partnerName: S,
40
+ username: g,
41
+ template: o,
42
+ editor: n
43
+ } = s, a = (o == null ? void 0 : o.html) || "", D = (o == null ? void 0 : o.css) || "", l = (o == null ? void 0 : o.preselectedDynamicContent) || [], w = (n == null ? void 0 : n.savedModulesFolderName) || N.SAVED_MODULES, E = (n == null ? void 0 : n.defaultModulesFolderName) || N.DEFAULT_MODULES;
44
+ m.templateId = d;
45
+ const u = {
46
+ emailId: d,
47
+ userId: b,
48
+ username: g,
49
+ partnerName: S,
50
+ savedModulesFolderName: w,
51
+ defaultModulesFolderName: E
52
+ }, C = {
53
+ preselectedDynamicContentList: l,
44
54
  onReady: () => {
45
55
  console.debug("guido:ready"), t("ready");
46
56
  }
47
- }), { getDefaultTemplate: w } = ee(), { cloneTimersOnSave: C, hasTimerBlocks: D } = J(), H = U(() => {
57
+ }, { initPlugin: T } = Y(u, C), { getDefaultTemplate: k } = re(), { cloneTimersOnSave: F, hasTimerBlocks: U } = Z(), B = P(() => {
48
58
  var e;
49
- return !((e = n.ui) != null && e.showHeader);
59
+ return !((e = s.ui) != null && e.showHeader);
50
60
  });
51
- M({
61
+ Q({
52
62
  onBack: () => {
53
63
  console.debug("guido:back"), t("back");
54
64
  },
@@ -56,55 +66,56 @@ const Ee = /* @__PURE__ */ B({
56
66
  console.debug("guido:save:start"), t("save:start");
57
67
  },
58
68
  onSaveComplete: (e) => {
59
- console.debug("guido:save:complete", e), t("save:complete", e);
69
+ const r = { ...e, metadata: u };
70
+ console.debug("guido:save:complete", r), t("save:complete", r);
60
71
  },
61
72
  onTestEmailClick: () => {
62
73
  console.debug("guido:test-email:click"), t("test-email:click");
63
74
  }
64
75
  });
65
- const E = (e) => {
66
- console.debug("dynamic-content:close", e), c.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
67
- }, k = () => {
76
+ const L = (e) => {
77
+ console.debug("dynamic-content:close", e), i.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
78
+ }, M = () => {
68
79
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
69
80
  };
70
- R(() => r.value, () => {
71
- t("on-change", r.value);
81
+ j(() => c.value, () => {
82
+ t("on-change", c.value);
72
83
  });
73
- const d = (e) => {
74
- const T = e, { attribute: O, position: x } = T.detail;
75
- console.debug("dynamic-content:open", T.detail), t("dynamic-content:open", O, x);
84
+ const p = (e) => {
85
+ const r = e, { attribute: R, position: z } = r.detail;
86
+ console.debug("dynamic-content:open", r.detail), t("dynamic-content:open", R, z);
76
87
  };
77
- return z(async () => {
88
+ return q(async () => {
78
89
  console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow");
79
90
  try {
80
- u.selectedUnsubscribePages = (o == null ? void 0 : o.selectedUnsubscribePages) || [];
91
+ y.selectedUnsubscribePages = (o == null ? void 0 : o.selectedUnsubscribePages) || [];
81
92
  let e = {
82
- html: s && await W(s),
83
- css: g
93
+ html: a && await A(a),
94
+ css: D
84
95
  };
85
- e.html || (e = await w(), e.html = await W(e.html)), D(e.html) && (e.html = await C(e.html)), await S(e), c.selectedDynamicContentList = m;
96
+ e.html || (e = await k(), e.html = await A(e.html)), U(e.html) && (e.html = await F(e.html)), await T(e), i.selectedDynamicContentList = l;
86
97
  } catch (e) {
87
98
  console.error("Failed to initialize Stripo editor:", e);
88
99
  }
89
- document.addEventListener("dynamic-content:open", d);
90
- }), K(() => {
91
- document.removeEventListener("dynamic-content:open", d);
100
+ document.addEventListener("dynamic-content:open", p);
101
+ }), J(() => {
102
+ document.removeEventListener("dynamic-content:open", p);
92
103
  try {
93
104
  window.UIEditor.removeEditor();
94
105
  } catch {
95
106
  console.debug("Failed to remove Stripo editor: No editor found");
96
107
  }
97
- n.reset();
108
+ s.reset();
98
109
  }), I({
99
110
  dynamicContent: {
100
- insert: E,
101
- close: k
111
+ insert: L,
112
+ close: M
102
113
  },
103
- hasChanges: r,
104
- saveSilent: v
105
- }), { __sfc: !0, PreviewContainer: L, OnboardingWrapper: A, headerWrapperRef: p, dynamicContentStore: c, unsubscribeStore: u, props: l, configStore: n, editorStore: i, previewStore: F, hasChanges: r, isTestPartner: G, saveSilent: v, templateId: a, userId: y, partnerName: h, productType: b, username: f, templateConfig: o, html: s, css: g, preselectedDynamicContentList: m, emit: t, initPlugin: S, getDefaultTemplate: w, cloneTimersOnSave: C, hasTimerBlocks: D, noHeader: H, insertDynamicContent: E, closeDynamicContent: k, handleDynamicContentOpen: d, Toaster: Q, FilterSelectionDrawer: V, HeaderWrapper: X, LoadingWrapper: Y, SaveAsTemplateDrawer: Z, UnsubscribeWrapper: $ };
114
+ hasChanges: c,
115
+ saveSilent: f
116
+ }), { __sfc: !0, PreviewContainer: O, OnboardingWrapper: G, headerWrapperRef: h, dynamicContentStore: i, unsubscribeStore: y, props: v, configStore: s, editorStore: m, previewStore: H, hasChanges: c, isTestPartner: x, saveSilent: f, templateId: d, userId: b, partnerName: S, username: g, templateConfig: o, editorConfig: n, html: a, css: D, preselectedDynamicContentList: l, savedModulesFolderName: w, defaultModulesFolderName: E, emit: t, metadata: u, options: C, initPlugin: T, getDefaultTemplate: k, cloneTimersOnSave: F, hasTimerBlocks: U, noHeader: B, insertDynamicContent: L, closeDynamicContent: M, handleDynamicContentOpen: p, Toaster: $, FilterSelectionDrawer: ee, HeaderWrapper: oe, LoadingWrapper: te, SaveAsTemplateDrawer: ne, UnsubscribeWrapper: se };
106
117
  }
107
118
  });
108
119
  export {
109
- Ee as default
120
+ Me as default
110
121
  };
@@ -16,7 +16,7 @@ var o = function() {
16
16
  i,
17
17
  !1,
18
18
  null,
19
- "a86fc486"
19
+ "df672485"
20
20
  );
21
21
  const _ = c.exports;
22
22
  export {