@useinsider/guido 3.2.0-beta.d5a560f → 3.2.0-beta.dc55d68

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 (102) hide show
  1. package/dist/@types/config/schemas.js +150 -94
  2. package/dist/components/Guido.vue.js +1 -1
  3. package/dist/components/Guido.vue2.js +88 -87
  4. package/dist/components/organisms/onboarding/AMPOnboarding.vue2.js +51 -31
  5. package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +1 -1
  6. package/dist/components/organisms/onboarding/GenericOnboarding.vue2.js +23 -22
  7. package/dist/components/organisms/onboarding/ItemsOnboarding.vue.js +1 -1
  8. package/dist/components/organisms/onboarding/ItemsOnboarding.vue2.js +37 -39
  9. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.js +3 -3
  10. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue2.js +30 -41
  11. package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue2.js +15 -14
  12. package/dist/composables/useActionsApi.js +4 -4
  13. package/dist/composables/useFullStoryBridge.js +1 -1
  14. package/dist/composables/useRecommendation.js +16 -12
  15. package/dist/composables/useRibbonOffset.js +21 -0
  16. package/dist/composables/useSave.js +1 -1
  17. package/dist/config/compiler/recommendationCompilerRules.js +72 -67
  18. package/dist/config/compiler/unsubscribeCompilerRules.js +40 -37
  19. package/dist/config/compiler/utils/recommendationCompilerUtils.js +33 -30
  20. package/dist/config/migrator/index.js +9 -9
  21. package/dist/config/migrator/recommendation/compositionMapper.js +98 -0
  22. package/dist/config/migrator/recommendation/extractors.js +27 -0
  23. package/dist/config/migrator/recommendation/htmlBuilder.js +496 -0
  24. package/dist/config/migrator/recommendation/parseLegacyConfig.js +33 -0
  25. package/dist/config/migrator/recommendation/settingsMapper.js +78 -0
  26. package/dist/config/migrator/recommendation/themeMapper.js +93 -0
  27. package/dist/config/migrator/recommendationMigrator.js +74 -290
  28. package/dist/enums/extensions/recommendationBlock.js +2 -1
  29. package/dist/enums/onboarding.js +7 -2
  30. package/dist/enums/unsubscribe.js +34 -27
  31. package/dist/extensions/Blocks/Items/controls/price/singlePrice.js +38 -38
  32. package/dist/extensions/Blocks/Items/enums/productEnums.js +19 -7
  33. package/dist/extensions/Blocks/Recommendation/block.js +35 -32
  34. package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
  35. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +5 -5
  36. package/dist/extensions/Blocks/Recommendation/controls/customAttribute/index.js +21 -18
  37. package/dist/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.js +99 -0
  38. package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +6 -6
  39. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +3 -1
  40. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +228 -181
  41. package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +27 -57
  42. package/dist/extensions/Blocks/Recommendation/controls/shared/textTrimCssRules.js +14 -0
  43. package/dist/extensions/Blocks/Recommendation/services/configService.js +65 -29
  44. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +18 -17
  45. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +48 -42
  46. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +8 -8
  47. package/dist/extensions/Blocks/Recommendation/templates/list/template.js +11 -11
  48. package/dist/extensions/Blocks/Recommendation/templates/utils.js +1 -1
  49. package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +17 -14
  50. package/dist/extensions/Blocks/Recommendation/utils/preserveTextStyles.js +13 -22
  51. package/dist/extensions/Blocks/Unsubscribe/block.js +11 -11
  52. package/dist/guido.css +1 -1
  53. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +393 -264
  54. package/dist/node_modules/valibot/dist/index.js +450 -235
  55. package/dist/package.json.js +1 -1
  56. package/dist/src/@types/config/defaults.d.ts +5 -1
  57. package/dist/src/@types/config/index.d.ts +3 -3
  58. package/dist/src/@types/config/schemas.d.ts +213 -0
  59. package/dist/src/@types/config/types.d.ts +9 -1
  60. package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
  61. package/dist/src/composables/useActionsApi.d.ts +1 -1
  62. package/dist/src/composables/useConfig.d.ts +56 -0
  63. package/dist/src/composables/useRecommendation.test.d.ts +1 -0
  64. package/dist/src/composables/useRibbonOffset.d.ts +4 -0
  65. package/dist/src/config/migrator/index.d.ts +2 -1
  66. package/dist/src/config/migrator/recommendation/compositionMapper.d.ts +2 -0
  67. package/dist/src/config/migrator/recommendation/compositionMapper.test.d.ts +1 -0
  68. package/dist/src/config/migrator/recommendation/extractors.d.ts +7 -0
  69. package/dist/src/config/migrator/recommendation/extractors.test.d.ts +1 -0
  70. package/dist/src/config/migrator/recommendation/htmlBuilder.d.ts +11 -0
  71. package/dist/src/config/migrator/recommendation/parseLegacyConfig.d.ts +15 -0
  72. package/dist/src/config/migrator/recommendation/parseLegacyConfig.test.d.ts +1 -0
  73. package/dist/src/config/migrator/recommendation/settingsMapper.d.ts +7 -0
  74. package/dist/src/config/migrator/recommendation/settingsMapper.test.d.ts +1 -0
  75. package/dist/src/config/migrator/recommendation/themeMapper.d.ts +5 -0
  76. package/dist/src/config/migrator/recommendation/themeMapper.test.d.ts +1 -0
  77. package/dist/src/config/migrator/recommendation/types.d.ts +205 -0
  78. package/dist/src/config/migrator/recommendationMigrator.d.ts +13 -1
  79. package/dist/src/config/migrator/recommendationMigrator.test.d.ts +1 -0
  80. package/dist/src/enums/onboarding.d.ts +6 -0
  81. package/dist/src/enums/unsubscribe.d.ts +5 -0
  82. package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +1 -0
  83. package/dist/src/extensions/Blocks/Recommendation/controls/customAttribute/index.d.ts +3 -0
  84. package/dist/src/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.d.ts +35 -0
  85. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.test.d.ts +1 -0
  86. package/dist/src/extensions/Blocks/Recommendation/controls/name/textTrim.d.ts +3 -20
  87. package/dist/src/extensions/Blocks/Recommendation/controls/shared/textTrimCssRules.d.ts +29 -0
  88. package/dist/src/extensions/Blocks/Recommendation/services/configService.d.ts +10 -0
  89. package/dist/src/extensions/Blocks/Recommendation/services/configService.test.d.ts +1 -0
  90. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +1 -1
  91. package/dist/src/extensions/Blocks/Recommendation/utils/preserveTextStyles.d.ts +0 -3
  92. package/dist/src/stores/config.d.ts +504 -0
  93. package/dist/src/stores/onboarding.d.ts +4 -0
  94. package/dist/src/utils/htmlEscape.d.ts +5 -0
  95. package/dist/src/utils/htmlEscape.test.d.ts +1 -0
  96. package/dist/static/styles/components/button.css.js +16 -9
  97. package/dist/static/styles/components/loader.css.js +4 -0
  98. package/dist/static/styles/components/narrow-panel.css.js +52 -0
  99. package/dist/stores/onboarding.js +4 -0
  100. package/dist/utils/htmlEscape.js +13 -0
  101. package/package.json +7 -3
  102. package/dist/extensions/Blocks/Recommendation/templates/grid/migration.js +0 -251
@@ -1,59 +1,59 @@
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, minLength as d, custom as S, boolean as a, array as c, literal as l, variant as k } from "../../node_modules/valibot/dist/index.js";
3
- const m = {
1
+ import { ModuleFolderDefaults as S } from "../../enums/defaults.js";
2
+ import { object as o, number as n, optional as e, string as t, pipe as p, picklist as l, minLength as b, custom as h, boolean as a, array as c, record as k, looseObject as y, literal as i, variant as g, union as f, unknown as s } from "../../node_modules/valibot/dist/index.js";
3
+ const d = {
4
4
  /** Promotional/marketing emails */
5
5
  PROMOTIONAL: 1,
6
6
  /** Transactional/system emails */
7
7
  TRANSACTIONAL: 2
8
- }, s = {
8
+ }, r = {
9
9
  /** Standard email campaigns */
10
10
  EMAIL: 60,
11
11
  /** Architect journey builder */
12
12
  ARCHITECT: 49,
13
13
  /** Unsubscribe page builder */
14
14
  UNSUBSCRIBE_PAGES: 97
15
- }, h = o({
15
+ }, R = o({
16
16
  /** Unique identifier for the template being edited */
17
- templateId: u(
17
+ templateId: p(
18
18
  t(),
19
- d(1, "templateId is required")
19
+ b(1, "templateId is required")
20
20
  ),
21
21
  /** Unique identifier for the user editing the template */
22
- userId: u(
22
+ userId: p(
23
23
  t(),
24
- d(1, "userId is required")
24
+ b(1, "userId is required")
25
25
  ),
26
26
  /** Optional variation ID for A/B testing */
27
27
  variationId: e(t())
28
- }), y = o({
28
+ }), C = o({
29
29
  /** Fallback font name (e.g., "Georgia") */
30
30
  name: t(),
31
31
  /** Fallback font family (e.g., "serif" or "sans-serif") */
32
32
  family: t()
33
- }), f = o({
33
+ }), T = o({
34
34
  /** Partner/organization name (required) */
35
- name: u(
35
+ name: p(
36
36
  t(),
37
- d(1, "partner.name is required")
37
+ b(1, "partner.name is required")
38
38
  ),
39
39
  /** Product type identifier */
40
40
  productType: e(
41
- n([
42
- s.EMAIL,
43
- s.ARCHITECT,
44
- s.UNSUBSCRIBE_PAGES
41
+ l([
42
+ r.EMAIL,
43
+ r.ARCHITECT,
44
+ r.UNSUBSCRIBE_PAGES
45
45
  ]),
46
- s.EMAIL
46
+ r.EMAIL
47
47
  ),
48
48
  /** Message type (promotional or transactional) */
49
49
  messageType: e(
50
- n([m.PROMOTIONAL, m.TRANSACTIONAL]),
51
- m.PROMOTIONAL
50
+ l([d.PROMOTIONAL, d.TRANSACTIONAL]),
51
+ d.PROMOTIONAL
52
52
  ),
53
53
  /** Display name for the current user */
54
54
  username: e(t(), "Guido User"),
55
55
  /** Fallback font settings from partner settings — used to match backend size calculation */
56
- fallbackFont: e(y)
56
+ fallbackFont: e(C)
57
57
  }), A = o({
58
58
  /** Display text for the dynamic content */
59
59
  text: t(),
@@ -68,7 +68,59 @@ const m = {
68
68
  value: t()
69
69
  })
70
70
  )
71
- }), R = o({
71
+ }), I = y({
72
+ /** Block ID (matches the dictionary key and the legacy HTML element id) */
73
+ id: e(n()),
74
+ /** Decimal places for price display (legacy data may use string or number) */
75
+ decimalCount: e(f([t(), n()])),
76
+ /** Pinned product IDs (empty array when filter-driven) */
77
+ productIds: e(c(s())),
78
+ /** Whether the block requested live products at send time */
79
+ sendProductRequestFlag: e(a()),
80
+ /** Whether to randomize product order */
81
+ shuffleProducts: e(a()),
82
+ /** Filter rules driving product selection */
83
+ filters: e(c(s())),
84
+ /** Currency code (e.g. 'EUR') — sometimes absent in legacy data */
85
+ currency: e(t()),
86
+ /** Currency display settings (separators, alignment, decimals) */
87
+ currencySettings: e(s()),
88
+ /** Locale (e.g. 'nl_NL') */
89
+ language: e(t()),
90
+ /** Recommendation strategy key (e.g. 'newArrivals') */
91
+ strategy: e(t()),
92
+ /** Snapshot of products as rendered by the legacy block */
93
+ recommendedProducts: e(c(s())),
94
+ /** Number of product cards per row */
95
+ cardsInRow: e(n()),
96
+ /** Mobile-only padding (right) */
97
+ mobileRightPadding: e(n()),
98
+ /** Mobile-only padding (left) */
99
+ mobileLeftPadding: e(n()),
100
+ /** Disable responsive scaling */
101
+ unresponsive: e(a()),
102
+ /** Layout orientation ('vertical' | 'horizontal') */
103
+ orientation: e(t()),
104
+ /** Whether long text is trimmed */
105
+ textTrimming: e(a()),
106
+ /** Block type marker used by some legacy variants */
107
+ blockType: e(t()),
108
+ /** Size variant marker (legacy data may use string or number) */
109
+ size: e(f([t(), n()])),
110
+ /** Vertical responsiveness flag (legacy size=1 variants) */
111
+ verticalResponsiveness: e(a())
112
+ }), E = o({
113
+ /**
114
+ * Legacy recommendation block configs keyed by block ID.
115
+ * Pass this when loading a template authored with the v1
116
+ * recommendation block so the migrator can preserve filters,
117
+ * strategy, currency, locale, and layout data.
118
+ */
119
+ recommendationConfigs: e(
120
+ k(t(), I),
121
+ {}
122
+ )
123
+ }), L = o({
72
124
  /** Initial HTML content */
73
125
  html: e(t(), ""),
74
126
  /** Initial CSS content */
@@ -81,33 +133,35 @@ const m = {
81
133
  /** Valid custom field attribute names from the partner's categorized fields */
82
134
  customFieldAttributes: e(c(t()), []),
83
135
  /** Selected unsubscribe page IDs */
84
- selectedUnsubscribePages: e(c(p()), []),
136
+ selectedUnsubscribePages: e(c(n()), []),
85
137
  /** Force recreate template in Stripo storage (use true when updating externally modified templates) */
86
- forceRecreate: e(a(), !1)
87
- }), C = o({
138
+ forceRecreate: e(a(), !1),
139
+ /** Migration-only inputs (legacy block configs) */
140
+ migration: e(E, {})
141
+ }), O = o({
88
142
  /** Sender display name */
89
143
  senderName: e(t(), ""),
90
144
  /** Email subject line */
91
145
  subject: e(t(), "")
92
- }), T = o({
146
+ }), M = o({
93
147
  /** Locale for the editor UI */
94
148
  locale: e(t(), "en"),
95
149
  /** Path to translations object */
96
150
  translationsPath: e(t(), "window.trans[Object.keys(window.trans)[0]]"),
97
151
  /** Migration date for template compatibility */
98
- migrationDate: e(p(), 1759696858),
152
+ migrationDate: e(n(), 1759696858),
99
153
  /** Email header settings */
100
- emailHeader: e(C, { senderName: "", subject: "" }),
154
+ emailHeader: e(O, { senderName: "", subject: "" }),
101
155
  /** Folder name for user-saved modules (used by Stripo plugin panel for path construction) */
102
- savedModulesFolderName: e(t(), b.SAVED_MODULES),
156
+ savedModulesFolderName: e(t(), S.SAVED_MODULES),
103
157
  /** Folder name for default/prebuilt modules (used by Stripo plugin panel for path construction) */
104
- defaultModulesFolderName: e(t(), b.DEFAULT_MODULES)
105
- }), I = o({
158
+ defaultModulesFolderName: e(t(), S.DEFAULT_MODULES)
159
+ }), P = o({
106
160
  /** Whether to show the header bar */
107
161
  showHeader: e(a(), !0),
108
162
  /** Custom label for back button (if shown) */
109
163
  backButtonLabel: e(t())
110
- }), E = o({
164
+ }), v = o({
111
165
  /** Enable dynamic content insertion */
112
166
  dynamicContent: e(a(), !0),
113
167
  /** Enable save as template functionality */
@@ -124,7 +178,7 @@ const m = {
124
178
  modulesDisabled: e(a(), !1),
125
179
  /** Enable Liquid template syntax */
126
180
  liquidSyntax: e(a(), !1)
127
- }), g = n([
181
+ }), N = l([
128
182
  "amp-accordion",
129
183
  "amp-carousel",
130
184
  "amp-form-controls",
@@ -138,7 +192,7 @@ const m = {
138
192
  "text-block",
139
193
  "timer-block",
140
194
  "video-block"
141
- ]), O = n([
195
+ ]), D = l([
142
196
  "dynamic-content",
143
197
  "checkbox-block",
144
198
  "radio-button-block",
@@ -146,119 +200,121 @@ const m = {
146
200
  "unsubscribe-block",
147
201
  "coupon-block",
148
202
  "items-block"
149
- ]), L = o({
203
+ ]), x = o({
150
204
  /** Default blocks to exclude from the editor */
151
205
  excludeDefaults: e(
152
- c(g),
206
+ c(N),
153
207
  []
154
208
  ),
155
209
  /** Custom blocks to include in the editor */
156
210
  includeCustoms: e(
157
- c(O),
211
+ c(D),
158
212
  []
159
213
  )
160
- }), r = o({
214
+ }), m = o({
161
215
  /** Unique identifier for the rule */
162
216
  id: t(),
163
217
  /** Human-readable description */
164
218
  description: e(t()),
165
219
  /** Priority for rule ordering (lower = earlier) */
166
- priority: p()
167
- }), M = o({
168
- ...r.entries,
169
- type: l("replace"),
220
+ priority: n()
221
+ }), F = o({
222
+ ...m.entries,
223
+ type: i("replace"),
170
224
  /** String to search for */
171
225
  search: t(),
172
226
  /** Replacement string */
173
227
  replacement: t(),
174
228
  /** Replace all occurrences (default: false) */
175
229
  replaceAll: e(a())
176
- }), N = o({
177
- ...r.entries,
178
- type: l("regex"),
230
+ }), U = o({
231
+ ...m.entries,
232
+ type: i("regex"),
179
233
  /** Regex pattern string */
180
234
  pattern: t(),
181
235
  /** Replacement string (supports $1, $2, etc.) */
182
236
  replacement: t(),
183
237
  /** Regex flags (e.g., 'gi') */
184
238
  flags: e(t())
185
- }), D = o({
186
- ...r.entries,
187
- type: l("remove"),
239
+ }), B = o({
240
+ ...m.entries,
241
+ type: i("remove"),
188
242
  /** Strings or patterns to remove */
189
243
  targets: c(t())
190
- }), v = o({
191
- ...r.entries,
192
- type: l("custom"),
244
+ }), w = o({
245
+ ...m.entries,
246
+ type: i("custom"),
193
247
  /** Custom processor function */
194
- processor: S(
195
- (i) => typeof i == "function",
248
+ processor: h(
249
+ (u) => typeof u == "function",
196
250
  "processor must be a function"
197
251
  )
198
- }), x = k("type", [
199
- M,
200
- N,
201
- D,
202
- v
203
- ]), U = o({
252
+ }), H = g("type", [
253
+ F,
254
+ U,
255
+ B,
256
+ w
257
+ ]), j = o({
204
258
  /** Custom compiler rules to apply */
205
- customRules: e(c(x), []),
259
+ customRules: e(c(H), []),
206
260
  /** Skip default compiler rules */
207
261
  ignoreDefaultRules: e(a(), !1)
208
- }), B = o({
262
+ }), q = o({
209
263
  /**
210
264
  * External validation handler called before save completes.
211
265
  * Return false to cancel the save operation.
212
266
  */
213
267
  externalValidation: e(
214
- S(
215
- (i) => typeof i == "function",
268
+ h(
269
+ (u) => typeof u == "function",
216
270
  "externalValidation must be a function"
217
271
  )
218
272
  )
219
- }), H = o({
273
+ }), V = o({
220
274
  // Required sections
221
275
  /** Identity configuration (required) */
222
- identity: h,
276
+ identity: R,
223
277
  /** Partner configuration (required) */
224
- partner: f,
278
+ partner: T,
225
279
  // Optional sections (with defaults)
226
280
  /** Template content and presets */
227
- template: e(R, {}),
281
+ template: e(L, {}),
228
282
  /** Editor settings */
229
- editor: e(T, {}),
283
+ editor: e(M, {}),
230
284
  /** UI configuration */
231
- ui: e(I, {}),
285
+ ui: e(P, {}),
232
286
  /** Feature toggles */
233
- features: e(E, {}),
287
+ features: e(v, {}),
234
288
  /** Block configuration */
235
- blocks: e(L, {}),
289
+ blocks: e(x, {}),
236
290
  /** Compiler configuration */
237
- compiler: e(U, {}),
291
+ compiler: e(j, {}),
238
292
  /** Callbacks and event handlers */
239
- callbacks: e(B, {})
293
+ callbacks: e(q, {})
240
294
  });
241
295
  export {
242
- L as BlocksSchema,
243
- B as CallbacksSchema,
244
- x as CompilerRuleSchema,
245
- U as CompilerSchema,
246
- O as CustomBlockTypeSchema,
247
- v as CustomRuleSchema,
248
- g as DefaultBlockTypeSchema,
296
+ x as BlocksSchema,
297
+ q as CallbacksSchema,
298
+ H as CompilerRuleSchema,
299
+ j as CompilerSchema,
300
+ D as CustomBlockTypeSchema,
301
+ w as CustomRuleSchema,
302
+ N as DefaultBlockTypeSchema,
249
303
  A as DynamicContentSchema,
250
- T as EditorSchema,
251
- C as EmailHeaderSchema,
252
- y as FallbackFontSchema,
253
- E as FeaturesSchema,
254
- H as GuidoConfigSchema,
255
- h as IdentitySchema,
256
- m as MessageType,
257
- f as PartnerSchema,
258
- s as ProductType,
259
- N as RegexRuleSchema,
260
- D as RemoveRuleSchema,
261
- M as ReplaceRuleSchema,
262
- R as TemplateSchema,
263
- I as UISchema
304
+ M as EditorSchema,
305
+ O as EmailHeaderSchema,
306
+ C as FallbackFontSchema,
307
+ v as FeaturesSchema,
308
+ V as GuidoConfigSchema,
309
+ R as IdentitySchema,
310
+ I as LegacyRecommendationConfigSchema,
311
+ d as MessageType,
312
+ T as PartnerSchema,
313
+ r as ProductType,
314
+ U as RegexRuleSchema,
315
+ B as RemoveRuleSchema,
316
+ F as ReplaceRuleSchema,
317
+ E as TemplateMigrationSchema,
318
+ L as TemplateSchema,
319
+ P as UISchema
264
320
  };
@@ -12,7 +12,7 @@ var t = function() {
12
12
  n,
13
13
  !1,
14
14
  null,
15
- "25780af6"
15
+ "428c209a"
16
16
  );
17
17
  const u = s.exports;
18
18
  export {
@@ -1,131 +1,132 @@
1
- import { defineComponent as j, defineAsyncComponent as R, ref as A, computed as I, watch as J, onMounted as Q, onUnmounted as X } from "vue";
2
- import { provideGuidoActions as Y } from "../composables/useGuidoActions.js";
3
- import { usePartner as Z } from "../composables/usePartner.js";
4
- import { useStripo as ee } from "../composables/useStripo.js";
1
+ import { defineComponent as J, defineAsyncComponent as I, ref as W, computed as B, watch as Q, onMounted as X, onUnmounted as Y } from "vue";
2
+ import { provideGuidoActions as Z } from "../composables/useGuidoActions.js";
3
+ import { usePartner as ee } from "../composables/usePartner.js";
4
+ import { useStripo as oe } from "../composables/useStripo.js";
5
5
  import { useTimerClone as te } from "../composables/useTimerClone.js";
6
- import { migrate as W } from "../config/migrator/index.js";
7
- import { ModuleFolderDefaults as B } from "../enums/defaults.js";
8
- import { RIBBON_SELECTOR as oe } from "../enums/onboarding.js";
9
- import ne from "./organisms/base/Toaster.vue.js";
10
- import se from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
11
- import re from "./organisms/header/HeaderWrapper.vue.js";
12
- import ce from "./organisms/LoadingWrapper.vue.js";
13
- import ae from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
14
- import ie from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
15
- import { useStripoApi as me } from "../services/stripoApi.js";
16
- import { useConfigStore as de } from "../stores/config.js";
17
- import { useDynamicContentStore as le } from "../stores/dynamic-content.js";
18
- import { useEditorStore as ue } from "../stores/editor.js";
19
- import { usePreviewStore as pe } from "../stores/preview.js";
20
- import { useUnsubscribeStore as fe } from "../stores/unsubscribe.js";
21
- const Re = /* @__PURE__ */ j({
6
+ import { migrate as H } from "../config/migrator/index.js";
7
+ import { ModuleFolderDefaults as x } from "../enums/defaults.js";
8
+ import { RIBBON_SELECTOR as ne } from "../enums/onboarding.js";
9
+ import se from "./organisms/base/Toaster.vue.js";
10
+ import re from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
11
+ import ce from "./organisms/header/HeaderWrapper.vue.js";
12
+ import ae from "./organisms/LoadingWrapper.vue.js";
13
+ import ie from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
14
+ import me from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
15
+ import { useStripoApi as de } from "../services/stripoApi.js";
16
+ import { useConfigStore as le } from "../stores/config.js";
17
+ import { useDynamicContentStore as ue } from "../stores/dynamic-content.js";
18
+ import { useEditorStore as pe } from "../stores/editor.js";
19
+ import { usePreviewStore as fe } from "../stores/preview.js";
20
+ import { useUnsubscribeStore as ve } from "../stores/unsubscribe.js";
21
+ const Ae = /* @__PURE__ */ J({
22
22
  __name: "Guido",
23
23
  props: {
24
24
  config: null
25
25
  },
26
26
  emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
27
- setup(H, { expose: x, emit: s }) {
28
- const b = H, G = R(
27
+ setup(G, { expose: z, emit: n }) {
28
+ const g = G, q = I(
29
29
  () => import("./organisms/email-preview/PreviewContainer.vue.js")
30
- ), z = R(
30
+ ), K = I(
31
31
  () => import("./organisms/onboarding/OnboardingWrapper.vue.js")
32
- ), S = A(), d = A(), l = le(), g = fe(), a = de();
33
- a.init(b.config);
34
- const u = ue(), q = pe(), i = I(() => u.hasChanges), { isTestPartner: K } = Z(), w = () => {
32
+ ), w = W(), u = W(), p = ue(), E = ve(), i = le();
33
+ i.init(g.config);
34
+ const f = pe(), V = fe(), m = B(() => f.hasChanges), { isTestPartner: $ } = ee(), D = () => {
35
35
  var e;
36
- return (e = S.value) == null ? void 0 : e.handleSave(!0);
36
+ return (e = w.value) == null ? void 0 : e.handleSave(!0);
37
37
  }, {
38
- templateId: p,
39
- userId: E,
40
- partnerName: D,
41
- username: C,
42
- template: t,
38
+ templateId: v,
39
+ userId: C,
40
+ partnerName: T,
41
+ username: k,
42
+ template: o,
43
43
  editor: r
44
- } = a, m = (t == null ? void 0 : t.html) || "", T = (t == null ? void 0 : t.css) || "", f = (t == null ? void 0 : t.preselectedDynamicContent) || [], k = (r == null ? void 0 : r.savedModulesFolderName) || B.SAVED_MODULES, F = (r == null ? void 0 : r.defaultModulesFolderName) || B.DEFAULT_MODULES;
45
- u.templateId = p;
46
- const v = {
47
- emailId: p,
48
- userId: E,
49
- username: C,
50
- partnerName: D,
51
- savedModulesFolderName: k,
52
- defaultModulesFolderName: F
53
- }, L = {
54
- preselectedDynamicContentList: f,
44
+ } = i, d = (o == null ? void 0 : o.html) || "", F = (o == null ? void 0 : o.css) || "", y = (o == null ? void 0 : o.preselectedDynamicContent) || [], L = (r == null ? void 0 : r.savedModulesFolderName) || x.SAVED_MODULES, U = (r == null ? void 0 : r.defaultModulesFolderName) || x.DEFAULT_MODULES;
45
+ f.templateId = v;
46
+ const h = {
47
+ emailId: v,
48
+ userId: C,
49
+ username: k,
50
+ partnerName: T,
51
+ savedModulesFolderName: L,
52
+ defaultModulesFolderName: U
53
+ }, _ = {
54
+ preselectedDynamicContentList: y,
55
55
  onReady: () => {
56
- console.debug("guido:ready"), s("ready");
56
+ console.debug("guido:ready"), n("ready");
57
57
  }
58
- }, { initPlugin: U } = ee(v, L), { getDefaultTemplate: _ } = me(), { cloneTimersOnSave: M, hasTimerBlocks: O } = te(), V = I(() => {
58
+ }, { initPlugin: M } = oe(h, _), { getDefaultTemplate: O } = de(), { cloneTimersOnSave: P, hasTimerBlocks: N } = te(), j = B(() => {
59
59
  var e;
60
- return !((e = a.ui) != null && e.showHeader);
60
+ return !((e = i.ui) != null && e.showHeader);
61
61
  });
62
- Y({
62
+ Z({
63
63
  onBack: () => {
64
- console.debug("guido:back"), s("back");
64
+ console.debug("guido:back"), n("back");
65
65
  },
66
66
  onSaveStart: () => {
67
- console.debug("guido:save:start"), s("save:start");
67
+ console.debug("guido:save:start"), n("save:start");
68
68
  },
69
69
  onSaveComplete: (e) => {
70
- const n = { ...e, metadata: v };
71
- console.debug("guido:save:complete", n), s("save:complete", n);
70
+ const t = { ...e, metadata: h };
71
+ console.debug("guido:save:complete", t), n("save:complete", t);
72
72
  },
73
73
  onTestEmailClick: () => {
74
- console.debug("guido:test-email:click"), s("test-email:click");
74
+ console.debug("guido:test-email:click"), n("test-email:click");
75
75
  }
76
76
  });
77
- const P = (e) => {
78
- console.debug("dynamic-content:close", e), l.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
79
- }, N = () => {
77
+ const R = (e) => {
78
+ console.debug("dynamic-content:close", e), p.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
79
+ }, A = () => {
80
80
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
81
81
  };
82
- J(() => i.value, () => {
83
- s("on-change", i.value);
82
+ Q(() => m.value, () => {
83
+ n("on-change", m.value);
84
84
  });
85
- const y = (e) => {
86
- const n = e, { attribute: o, position: $ } = n.detail;
87
- console.debug("dynamic-content:open", n.detail), s("dynamic-content:open", o, $);
85
+ const b = (e) => {
86
+ const t = e, { attribute: l, position: a } = t.detail;
87
+ console.debug("dynamic-content:open", t.detail), n("dynamic-content:open", l, a);
88
88
  };
89
89
  let c = null;
90
- const h = () => {
91
- var n;
92
- const e = document.querySelector(oe);
93
- (n = d.value) == null || n.style.setProperty("--ribbon-offset", `${(e == null ? void 0 : e.offsetHeight) ?? 0}px`);
90
+ const S = () => {
91
+ var t;
92
+ const e = document.querySelector(ne);
93
+ (t = u.value) == null || t.style.setProperty("--ribbon-offset", `${(e == null ? void 0 : e.offsetHeight) ?? 0}px`);
94
94
  };
95
- return Q(async () => {
96
- var n;
97
- console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), h();
98
- const e = (n = d.value) == null ? void 0 : n.parentElement;
99
- e && (c = new ResizeObserver(h), c.observe(e));
95
+ return X(async () => {
96
+ var t, l;
97
+ console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), S();
98
+ const e = (t = u.value) == null ? void 0 : t.parentElement;
99
+ e && (c = new ResizeObserver(S), c.observe(e));
100
100
  try {
101
- g.selectedUnsubscribePages = (t == null ? void 0 : t.selectedUnsubscribePages) || [];
102
- let o = {
103
- html: m && await W(m),
104
- css: T
101
+ E.selectedUnsubscribePages = (o == null ? void 0 : o.selectedUnsubscribePages) || [];
102
+ const a = ((l = o == null ? void 0 : o.migration) == null ? void 0 : l.recommendationConfigs) ?? {};
103
+ let s = {
104
+ html: d && await H(d, a),
105
+ css: F
105
106
  };
106
- o.html || (o = await _(), o.html = await W(o.html)), O(o.html) && (o.html = await M(o.html)), await U(o), l.selectedDynamicContentList = f;
107
- } catch (o) {
108
- console.error("Failed to initialize Stripo editor:", o);
107
+ s.html || (s = await O(), s.html = await H(s.html, a)), N(s.html) && (s.html = await P(s.html)), await M(s), p.selectedDynamicContentList = y;
108
+ } catch (a) {
109
+ console.error("Failed to initialize Stripo editor:", a);
109
110
  }
110
- document.addEventListener("dynamic-content:open", y);
111
- }), X(() => {
112
- c == null || c.disconnect(), document.removeEventListener("dynamic-content:open", y);
111
+ document.addEventListener("dynamic-content:open", b);
112
+ }), Y(() => {
113
+ c == null || c.disconnect(), document.removeEventListener("dynamic-content:open", b);
113
114
  try {
114
115
  window.UIEditor.removeEditor();
115
116
  } catch {
116
117
  console.debug("Failed to remove Stripo editor: No editor found");
117
118
  }
118
- a.reset();
119
- }), x({
119
+ i.reset();
120
+ }), z({
120
121
  dynamicContent: {
121
- insert: P,
122
- close: N
122
+ insert: R,
123
+ close: A
123
124
  },
124
- hasChanges: i,
125
- saveSilent: w
126
- }), { __sfc: !0, PreviewContainer: G, OnboardingWrapper: z, headerWrapperRef: S, wrapperRef: d, dynamicContentStore: l, unsubscribeStore: g, props: b, configStore: a, editorStore: u, previewStore: q, hasChanges: i, isTestPartner: K, saveSilent: w, templateId: p, userId: E, partnerName: D, username: C, templateConfig: t, editorConfig: r, html: m, css: T, preselectedDynamicContentList: f, savedModulesFolderName: k, defaultModulesFolderName: F, emit: s, metadata: v, options: L, initPlugin: U, getDefaultTemplate: _, cloneTimersOnSave: M, hasTimerBlocks: O, noHeader: V, insertDynamicContent: P, closeDynamicContent: N, handleDynamicContentOpen: y, ribbonObserver: c, updateRibbonOffset: h, Toaster: ne, FilterSelectionDrawer: se, HeaderWrapper: re, LoadingWrapper: ce, SaveAsTemplateDrawer: ae, UnsubscribeWrapper: ie };
125
+ hasChanges: m,
126
+ saveSilent: D
127
+ }), { __sfc: !0, PreviewContainer: q, OnboardingWrapper: K, headerWrapperRef: w, wrapperRef: u, dynamicContentStore: p, unsubscribeStore: E, props: g, configStore: i, editorStore: f, previewStore: V, hasChanges: m, isTestPartner: $, saveSilent: D, templateId: v, userId: C, partnerName: T, username: k, templateConfig: o, editorConfig: r, html: d, css: F, preselectedDynamicContentList: y, savedModulesFolderName: L, defaultModulesFolderName: U, emit: n, metadata: h, options: _, initPlugin: M, getDefaultTemplate: O, cloneTimersOnSave: P, hasTimerBlocks: N, noHeader: j, insertDynamicContent: R, closeDynamicContent: A, handleDynamicContentOpen: b, ribbonObserver: c, updateRibbonOffset: S, Toaster: se, FilterSelectionDrawer: re, HeaderWrapper: ce, LoadingWrapper: ae, SaveAsTemplateDrawer: ie, UnsubscribeWrapper: me };
127
128
  }
128
129
  });
129
130
  export {
130
- Re as default
131
+ Ae as default
131
132
  };