@useinsider/guido 3.2.0-beta.e01b42a → 3.2.0-beta.e0e56ef

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 (152) hide show
  1. package/README.md +1 -0
  2. package/dist/@types/config/schemas.js +164 -96
  3. package/dist/components/Guido.vue.js +4 -4
  4. package/dist/components/Guido.vue2.js +91 -80
  5. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +7 -7
  6. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue2.js +12 -20
  7. package/dist/components/organisms/header/EditorActions.vue.js +2 -2
  8. package/dist/components/organisms/header/EditorActions.vue2.js +51 -36
  9. package/dist/components/organisms/header/RightSlot.vue.js +10 -10
  10. package/dist/components/organisms/header/RightSlot.vue2.js +16 -13
  11. package/dist/components/organisms/onboarding/AMPOnboarding.vue2.js +51 -31
  12. package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +1 -1
  13. package/dist/components/organisms/onboarding/GenericOnboarding.vue2.js +23 -22
  14. package/dist/components/organisms/onboarding/ItemsOnboarding.vue.js +1 -1
  15. package/dist/components/organisms/onboarding/ItemsOnboarding.vue2.js +37 -39
  16. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.js +3 -3
  17. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue2.js +30 -41
  18. package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue2.js +15 -14
  19. package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue2.js +18 -17
  20. package/dist/composables/useActionsApi.js +4 -4
  21. package/dist/composables/useFullStoryBridge.js +14 -0
  22. package/dist/composables/useHtmlCompiler.js +23 -21
  23. package/dist/composables/useHtmlValidator.js +40 -38
  24. package/dist/composables/usePreviewMode.js +20 -16
  25. package/dist/composables/useRibbonOffset.js +21 -0
  26. package/dist/composables/useSave.js +23 -15
  27. package/dist/composables/useStripo.js +52 -47
  28. package/dist/composables/validators/useLiquidValidator.js +42 -0
  29. package/dist/config/compiler/liquidCompilerRules.js +15 -0
  30. package/dist/config/compiler/recommendationCompilerRules.js +162 -43
  31. package/dist/config/compiler/unsubscribeCompilerRules.js +48 -45
  32. package/dist/config/compiler/utils/recommendationCompilerUtils.js +52 -46
  33. package/dist/config/migrator/checkboxMigrator.js +5 -3
  34. package/dist/config/migrator/index.js +9 -9
  35. package/dist/config/migrator/radioButtonMigrator.js +14 -12
  36. package/dist/config/migrator/recommendation/compositionMapper.js +98 -0
  37. package/dist/config/migrator/recommendation/extractors.js +27 -0
  38. package/dist/config/migrator/recommendation/htmlBuilder.js +496 -0
  39. package/dist/config/migrator/recommendation/parseLegacyConfig.js +33 -0
  40. package/dist/config/migrator/recommendation/settingsMapper.js +78 -0
  41. package/dist/config/migrator/recommendation/themeMapper.js +93 -0
  42. package/dist/config/migrator/recommendationMigrator.js +74 -290
  43. package/dist/enums/extensions/recommendationBlock.js +16 -12
  44. package/dist/enums/onboarding.js +7 -2
  45. package/dist/enums/recommendation.js +2 -2
  46. package/dist/enums/unsubscribe.js +34 -27
  47. package/dist/extensions/Blocks/CouponBlock/template.js +24 -13
  48. package/dist/extensions/Blocks/Items/controls/price/singlePrice.js +38 -38
  49. package/dist/extensions/Blocks/Items/enums/productEnums.js +19 -7
  50. package/dist/extensions/Blocks/Recommendation/block.js +35 -32
  51. package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
  52. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +5 -5
  53. package/dist/extensions/Blocks/Recommendation/constants/selectors.js +27 -11
  54. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +185 -172
  55. package/dist/extensions/Blocks/Recommendation/controls/customAttribute/index.js +21 -18
  56. package/dist/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.js +99 -0
  57. package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +6 -6
  58. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +3 -1
  59. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +211 -162
  60. package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +27 -57
  61. package/dist/extensions/Blocks/Recommendation/controls/shared/textTrimCssRules.js +14 -0
  62. package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +31 -31
  63. package/dist/extensions/Blocks/Recommendation/services/configService.js +65 -29
  64. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +18 -17
  65. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +29 -25
  66. package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +7 -5
  67. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +30 -29
  68. package/dist/extensions/Blocks/Recommendation/templates/index.js +7 -7
  69. package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +3 -1
  70. package/dist/extensions/Blocks/Recommendation/templates/list/template.js +21 -21
  71. package/dist/extensions/Blocks/Recommendation/templates/utils.js +57 -50
  72. package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +17 -14
  73. package/dist/extensions/Blocks/Recommendation/utils/preserveTextStyles.js +13 -22
  74. package/dist/extensions/Blocks/Unsubscribe/block.js +11 -11
  75. package/dist/extensions/DynamicContent/dynamic-content.js +17 -12
  76. package/dist/guido.css +1 -1
  77. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +258 -235
  78. package/dist/node_modules/valibot/dist/index.js +450 -235
  79. package/dist/package.json.js +1 -1
  80. package/dist/services/recommendationApi.js +15 -15
  81. package/dist/services/stripoApi.js +9 -9
  82. package/dist/services/templateLibraryApi.js +48 -46
  83. package/dist/src/@types/config/defaults.d.ts +5 -1
  84. package/dist/src/@types/config/index.d.ts +3 -3
  85. package/dist/src/@types/config/schemas.d.ts +241 -0
  86. package/dist/src/@types/config/types.d.ts +11 -1
  87. package/dist/src/@types/generic.d.ts +0 -1
  88. package/dist/src/@types/save-as-template.d.ts +1 -0
  89. package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
  90. package/dist/src/composables/useActionsApi.d.ts +1 -1
  91. package/dist/src/composables/useConfig.d.ts +68 -0
  92. package/dist/src/composables/useFullStoryBridge.d.ts +11 -0
  93. package/dist/src/composables/useRibbonOffset.d.ts +4 -0
  94. package/dist/src/composables/validators/useLiquidValidator.d.ts +3 -0
  95. package/dist/src/config/compiler/liquidCompilerRules.d.ts +2 -0
  96. package/dist/src/config/compiler/utils/recommendationCompilerUtils.d.ts +1 -1
  97. package/dist/src/config/migrator/index.d.ts +2 -1
  98. package/dist/src/config/migrator/recommendation/compositionMapper.d.ts +2 -0
  99. package/dist/src/config/migrator/recommendation/compositionMapper.test.d.ts +1 -0
  100. package/dist/src/config/migrator/recommendation/extractors.d.ts +7 -0
  101. package/dist/src/config/migrator/recommendation/extractors.test.d.ts +1 -0
  102. package/dist/src/config/migrator/recommendation/htmlBuilder.d.ts +11 -0
  103. package/dist/src/config/migrator/recommendation/parseLegacyConfig.d.ts +15 -0
  104. package/dist/src/config/migrator/recommendation/parseLegacyConfig.test.d.ts +1 -0
  105. package/dist/src/config/migrator/recommendation/settingsMapper.d.ts +7 -0
  106. package/dist/src/config/migrator/recommendation/settingsMapper.test.d.ts +1 -0
  107. package/dist/src/config/migrator/recommendation/themeMapper.d.ts +5 -0
  108. package/dist/src/config/migrator/recommendation/themeMapper.test.d.ts +1 -0
  109. package/dist/src/config/migrator/recommendation/types.d.ts +205 -0
  110. package/dist/src/config/migrator/recommendationMigrator.d.ts +13 -1
  111. package/dist/src/config/migrator/recommendationMigrator.test.d.ts +1 -0
  112. package/dist/src/enums/extensions/recommendationBlock.d.ts +3 -0
  113. package/dist/src/enums/onboarding.d.ts +6 -0
  114. package/dist/src/enums/unsubscribe.d.ts +5 -0
  115. package/dist/src/extensions/Blocks/CouponBlock/template.d.ts +2 -0
  116. package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +1 -0
  117. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
  118. package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +5 -0
  119. package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +5 -0
  120. package/dist/src/extensions/Blocks/Recommendation/controls/customAttribute/index.d.ts +3 -0
  121. package/dist/src/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.d.ts +35 -0
  122. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.test.d.ts +1 -0
  123. package/dist/src/extensions/Blocks/Recommendation/controls/name/textTrim.d.ts +3 -20
  124. package/dist/src/extensions/Blocks/Recommendation/controls/shared/textTrimCssRules.d.ts +29 -0
  125. package/dist/src/extensions/Blocks/Recommendation/services/configService.d.ts +10 -0
  126. package/dist/src/extensions/Blocks/Recommendation/services/configService.test.d.ts +1 -0
  127. package/dist/src/extensions/Blocks/Recommendation/templates/grid/template.d.ts +4 -4
  128. package/dist/src/extensions/Blocks/Recommendation/templates/list/template.d.ts +3 -3
  129. package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +20 -3
  130. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +1 -1
  131. package/dist/src/extensions/Blocks/Recommendation/utils/preserveTextStyles.d.ts +0 -3
  132. package/dist/src/extensions/Blocks/Recommendation/utils/tagName.d.ts +3 -3
  133. package/dist/src/services/templateLibraryApi.d.ts +1 -1
  134. package/dist/src/stores/config.d.ts +612 -0
  135. package/dist/src/stores/onboarding.d.ts +4 -0
  136. package/dist/src/stores/preview.d.ts +3 -0
  137. package/dist/src/utils/genericUtil.d.ts +1 -1
  138. package/dist/src/utils/htmlCompiler.d.ts +2 -1
  139. package/dist/src/utils/htmlEscape.d.ts +5 -0
  140. package/dist/src/utils/htmlEscape.test.d.ts +1 -0
  141. package/dist/static/styles/base.css.js +7 -2
  142. package/dist/static/styles/components/button.css.js +3 -2
  143. package/dist/static/styles/components/loader.css.js +4 -0
  144. package/dist/stores/onboarding.js +4 -0
  145. package/dist/stores/preview.js +4 -3
  146. package/dist/utils/genericUtil.js +42 -20
  147. package/dist/utils/htmlCompiler.js +48 -41
  148. package/dist/utils/htmlEscape.js +13 -0
  149. package/dist/utils/templatePreparation.js +36 -25
  150. package/dist/utils/tooltipUtils.js +4 -5
  151. package/package.json +8 -4
  152. package/dist/extensions/Blocks/Recommendation/templates/grid/migration.js +0 -251
package/README.md CHANGED
@@ -143,6 +143,7 @@ const config: GuidoConfigInput = {
143
143
  displayConditions?: boolean, // Default: true
144
144
  unsubscribe?: boolean, // Default: true
145
145
  modulesDisabled?: boolean, // Default: false - Disable modules panel
146
+ liquidSyntax?: boolean, // Default: false - Enable Liquid template syntax
146
147
  },
147
148
 
148
149
  // Optional: Callbacks
@@ -1,53 +1,60 @@
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 r, 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
+ /** Fallback font name (e.g., "Georgia") */
30
+ name: t(),
31
+ /** Fallback font family (e.g., "serif" or "sans-serif") */
32
+ family: t()
33
+ }), T = o({
29
34
  /** Partner/organization name (required) */
30
- name: u(
35
+ name: p(
31
36
  t(),
32
- d(1, "partner.name is required")
37
+ b(1, "partner.name is required")
33
38
  ),
34
39
  /** Product type identifier */
35
40
  productType: e(
36
- n([
37
- s.EMAIL,
38
- s.ARCHITECT,
39
- s.UNSUBSCRIBE_PAGES
41
+ l([
42
+ r.EMAIL,
43
+ r.ARCHITECT,
44
+ r.UNSUBSCRIBE_PAGES
40
45
  ]),
41
- s.EMAIL
46
+ r.EMAIL
42
47
  ),
43
48
  /** Message type (promotional or transactional) */
44
49
  messageType: e(
45
- n([m.PROMOTIONAL, m.TRANSACTIONAL]),
46
- m.PROMOTIONAL
50
+ l([d.PROMOTIONAL, d.TRANSACTIONAL]),
51
+ d.PROMOTIONAL
47
52
  ),
48
53
  /** Display name for the current user */
49
- username: e(t(), "Guido User")
50
- }), f = o({
54
+ username: e(t(), "Guido User"),
55
+ /** Fallback font settings from partner settings — used to match backend size calculation */
56
+ fallbackFont: e(C)
57
+ }), A = o({
51
58
  /** Display text for the dynamic content */
52
59
  text: t(),
53
60
  /** Template variable value (e.g., {{username}}) */
@@ -61,44 +68,100 @@ const m = {
61
68
  value: t()
62
69
  })
63
70
  )
64
- }), 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({
65
124
  /** Initial HTML content */
66
125
  html: e(t(), ""),
67
126
  /** Initial CSS content */
68
127
  css: e(t(), ""),
69
128
  /** Preselected dynamic content items */
70
129
  preselectedDynamicContent: e(
71
- c(f),
130
+ c(A),
72
131
  []
73
132
  ),
133
+ /** Valid custom field attribute names from the partner's categorized fields */
134
+ customFieldAttributes: e(c(t()), []),
74
135
  /** Selected unsubscribe page IDs */
75
- selectedUnsubscribePages: e(c(p()), []),
136
+ selectedUnsubscribePages: e(c(n()), []),
76
137
  /** Force recreate template in Stripo storage (use true when updating externally modified templates) */
77
- forceRecreate: e(a(), !1)
78
- }), A = o({
138
+ forceRecreate: e(a(), !1),
139
+ /** Migration-only inputs (legacy block configs) */
140
+ migration: e(E, {})
141
+ }), O = o({
79
142
  /** Sender display name */
80
143
  senderName: e(t(), ""),
81
144
  /** Email subject line */
82
145
  subject: e(t(), "")
83
- }), C = o({
146
+ }), M = o({
84
147
  /** Locale for the editor UI */
85
148
  locale: e(t(), "en"),
86
149
  /** Path to translations object */
87
150
  translationsPath: e(t(), "window.trans[Object.keys(window.trans)[0]]"),
88
151
  /** Migration date for template compatibility */
89
- migrationDate: e(p(), 1759696858),
152
+ migrationDate: e(n(), 1759696858),
90
153
  /** Email header settings */
91
- emailHeader: e(A, { senderName: "", subject: "" }),
154
+ emailHeader: e(O, { senderName: "", subject: "" }),
92
155
  /** Folder name for user-saved modules (used by Stripo plugin panel for path construction) */
93
- savedModulesFolderName: e(t(), b.SAVED_MODULES),
156
+ savedModulesFolderName: e(t(), S.SAVED_MODULES),
94
157
  /** Folder name for default/prebuilt modules (used by Stripo plugin panel for path construction) */
95
- defaultModulesFolderName: e(t(), b.DEFAULT_MODULES)
96
- }), T = o({
158
+ defaultModulesFolderName: e(t(), S.DEFAULT_MODULES)
159
+ }), P = o({
97
160
  /** Whether to show the header bar */
98
161
  showHeader: e(a(), !0),
99
162
  /** Custom label for back button (if shown) */
100
163
  backButtonLabel: e(t())
101
- }), I = o({
164
+ }), v = o({
102
165
  /** Enable dynamic content insertion */
103
166
  dynamicContent: e(a(), !0),
104
167
  /** Enable save as template functionality */
@@ -112,8 +175,10 @@ const m = {
112
175
  /** Enable unsubscribe block */
113
176
  unsubscribe: e(a(), !0),
114
177
  /** Disable modules panel in the editor */
115
- modulesDisabled: e(a(), !1)
116
- }), E = n([
178
+ modulesDisabled: e(a(), !1),
179
+ /** Enable Liquid template syntax */
180
+ liquidSyntax: e(a(), !1)
181
+ }), N = l([
117
182
  "amp-accordion",
118
183
  "amp-carousel",
119
184
  "amp-form-controls",
@@ -127,7 +192,7 @@ const m = {
127
192
  "text-block",
128
193
  "timer-block",
129
194
  "video-block"
130
- ]), g = n([
195
+ ]), D = l([
131
196
  "dynamic-content",
132
197
  "checkbox-block",
133
198
  "radio-button-block",
@@ -135,118 +200,121 @@ const m = {
135
200
  "unsubscribe-block",
136
201
  "coupon-block",
137
202
  "items-block"
138
- ]), O = o({
203
+ ]), x = o({
139
204
  /** Default blocks to exclude from the editor */
140
205
  excludeDefaults: e(
141
- c(E),
206
+ c(N),
142
207
  []
143
208
  ),
144
209
  /** Custom blocks to include in the editor */
145
210
  includeCustoms: e(
146
- c(g),
211
+ c(D),
147
212
  []
148
213
  )
149
- }), l = o({
214
+ }), m = o({
150
215
  /** Unique identifier for the rule */
151
216
  id: t(),
152
217
  /** Human-readable description */
153
218
  description: e(t()),
154
219
  /** Priority for rule ordering (lower = earlier) */
155
- priority: p()
156
- }), L = o({
157
- ...l.entries,
158
- type: r("replace"),
220
+ priority: n()
221
+ }), F = o({
222
+ ...m.entries,
223
+ type: i("replace"),
159
224
  /** String to search for */
160
225
  search: t(),
161
226
  /** Replacement string */
162
227
  replacement: t(),
163
228
  /** Replace all occurrences (default: false) */
164
229
  replaceAll: e(a())
165
- }), M = o({
166
- ...l.entries,
167
- type: r("regex"),
230
+ }), U = o({
231
+ ...m.entries,
232
+ type: i("regex"),
168
233
  /** Regex pattern string */
169
234
  pattern: t(),
170
235
  /** Replacement string (supports $1, $2, etc.) */
171
236
  replacement: t(),
172
237
  /** Regex flags (e.g., 'gi') */
173
238
  flags: e(t())
174
- }), N = o({
175
- ...l.entries,
176
- type: r("remove"),
239
+ }), B = o({
240
+ ...m.entries,
241
+ type: i("remove"),
177
242
  /** Strings or patterns to remove */
178
243
  targets: c(t())
179
- }), D = o({
180
- ...l.entries,
181
- type: r("custom"),
244
+ }), w = o({
245
+ ...m.entries,
246
+ type: i("custom"),
182
247
  /** Custom processor function */
183
- processor: S(
184
- (i) => typeof i == "function",
248
+ processor: h(
249
+ (u) => typeof u == "function",
185
250
  "processor must be a function"
186
251
  )
187
- }), v = k("type", [
188
- L,
189
- M,
190
- N,
191
- D
192
- ]), U = o({
252
+ }), H = g("type", [
253
+ F,
254
+ U,
255
+ B,
256
+ w
257
+ ]), j = o({
193
258
  /** Custom compiler rules to apply */
194
- customRules: e(c(v), []),
259
+ customRules: e(c(H), []),
195
260
  /** Skip default compiler rules */
196
261
  ignoreDefaultRules: e(a(), !1)
197
- }), x = o({
262
+ }), q = o({
198
263
  /**
199
264
  * External validation handler called before save completes.
200
265
  * Return false to cancel the save operation.
201
266
  */
202
267
  externalValidation: e(
203
- S(
204
- (i) => typeof i == "function",
268
+ h(
269
+ (u) => typeof u == "function",
205
270
  "externalValidation must be a function"
206
271
  )
207
272
  )
208
- }), H = o({
273
+ }), V = o({
209
274
  // Required sections
210
275
  /** Identity configuration (required) */
211
- identity: h,
276
+ identity: R,
212
277
  /** Partner configuration (required) */
213
- partner: y,
278
+ partner: T,
214
279
  // Optional sections (with defaults)
215
280
  /** Template content and presets */
216
- template: e(R, {}),
281
+ template: e(L, {}),
217
282
  /** Editor settings */
218
- editor: e(C, {}),
283
+ editor: e(M, {}),
219
284
  /** UI configuration */
220
- ui: e(T, {}),
285
+ ui: e(P, {}),
221
286
  /** Feature toggles */
222
- features: e(I, {}),
287
+ features: e(v, {}),
223
288
  /** Block configuration */
224
- blocks: e(O, {}),
289
+ blocks: e(x, {}),
225
290
  /** Compiler configuration */
226
- compiler: e(U, {}),
291
+ compiler: e(j, {}),
227
292
  /** Callbacks and event handlers */
228
- callbacks: e(x, {})
293
+ callbacks: e(q, {})
229
294
  });
230
295
  export {
231
- O as BlocksSchema,
232
- x as CallbacksSchema,
233
- v as CompilerRuleSchema,
234
- U as CompilerSchema,
235
- g as CustomBlockTypeSchema,
236
- D as CustomRuleSchema,
237
- E as DefaultBlockTypeSchema,
238
- f as DynamicContentSchema,
239
- C as EditorSchema,
240
- A as EmailHeaderSchema,
241
- I as FeaturesSchema,
242
- H as GuidoConfigSchema,
243
- h as IdentitySchema,
244
- m as MessageType,
245
- y as PartnerSchema,
246
- s as ProductType,
247
- M as RegexRuleSchema,
248
- N as RemoveRuleSchema,
249
- L as ReplaceRuleSchema,
250
- R as TemplateSchema,
251
- T as UISchema
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,
303
+ A as DynamicContentSchema,
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
252
320
  };
@@ -3,7 +3,7 @@ import i from "./Guido.vue2.js";
3
3
  import a from "../_virtual/_plugin-vue2_normalizer.js";
4
4
  var t = function() {
5
5
  var o = this, r = o._self._c, e = o._self._setupProxy;
6
- return r("div", { staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": e.noHeader } }, [r(e.HeaderWrapper, { ref: "headerWrapperRef" }), e.editorStore.isPreviewModeOpen ? r(e.PreviewContainer) : o._e(), r("div", { directives: [{ name: "show", rawName: "v-show", value: !e.previewStore.isLoaded, expression: "!previewStore.isLoaded" }], staticClass: "guido-editor__container", class: { "guido-editor__no-header": e.noHeader }, attrs: { id: "guido-editor" } }), r(e.Toaster), r(e.FilterSelectionDrawer), r(e.SaveAsTemplateDrawer), e.isTestPartner() ? o._e() : r(e.OnboardingWrapper, { on: { "onboarding-finished": function(_) {
6
+ return r("div", { ref: "wrapperRef", staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": e.noHeader } }, [r(e.HeaderWrapper, { ref: "headerWrapperRef" }), e.editorStore.isPreviewModeOpen ? r(e.PreviewContainer) : o._e(), r("div", { directives: [{ name: "show", rawName: "v-show", value: !e.previewStore.isLoaded, expression: "!previewStore.isLoaded" }], staticClass: "guido-editor__container", class: { "guido-editor__no-header": e.noHeader }, attrs: { id: "guido-editor" } }), r(e.Toaster), r(e.FilterSelectionDrawer), r(e.SaveAsTemplateDrawer), e.isTestPartner() ? o._e() : r(e.OnboardingWrapper, { on: { "onboarding-finished": function(p) {
7
7
  return e.emit("onboarding:finished");
8
8
  } } }), r(e.UnsubscribeWrapper), r(e.LoadingWrapper)], 1);
9
9
  }, n = [], s = /* @__PURE__ */ a(
@@ -12,9 +12,9 @@ var t = function() {
12
12
  n,
13
13
  !1,
14
14
  null,
15
- "a26d7792"
15
+ "428c209a"
16
16
  );
17
- const v = s.exports;
17
+ const u = s.exports;
18
18
  export {
19
- v as default
19
+ u as default
20
20
  };
@@ -1,121 +1,132 @@
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({
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
+ import { useTimerClone as te } from "../composables/useTimerClone.js";
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({
21
22
  __name: "Guido",
22
23
  props: {
23
24
  config: null
24
25
  },
25
26
  emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
26
- setup(W, { expose: I, emit: t }) {
27
- const v = W, O = _(
27
+ setup(G, { expose: z, emit: n }) {
28
+ const g = G, q = I(
28
29
  () => import("./organisms/email-preview/PreviewContainer.vue.js")
29
- ), G = _(
30
+ ), K = I(
30
31
  () => import("./organisms/onboarding/OnboardingWrapper.vue.js")
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 = () => {
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 = () => {
34
35
  var e;
35
- return (e = h.value) == null ? void 0 : e.handleSave(!0);
36
+ return (e = w.value) == null ? void 0 : e.handleSave(!0);
36
37
  }, {
37
- templateId: d,
38
- userId: b,
39
- partnerName: S,
40
- username: g,
38
+ templateId: v,
39
+ userId: C,
40
+ partnerName: T,
41
+ username: k,
41
42
  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,
43
+ editor: r
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,
54
55
  onReady: () => {
55
- console.debug("guido:ready"), t("ready");
56
+ console.debug("guido:ready"), n("ready");
56
57
  }
57
- }, { initPlugin: T } = Y(u, C), { getDefaultTemplate: k } = re(), { cloneTimersOnSave: F, hasTimerBlocks: U } = Z(), B = P(() => {
58
+ }, { initPlugin: M } = oe(h, _), { getDefaultTemplate: O } = de(), { cloneTimersOnSave: P, hasTimerBlocks: N } = te(), j = B(() => {
58
59
  var e;
59
- return !((e = s.ui) != null && e.showHeader);
60
+ return !((e = i.ui) != null && e.showHeader);
60
61
  });
61
- Q({
62
+ Z({
62
63
  onBack: () => {
63
- console.debug("guido:back"), t("back");
64
+ console.debug("guido:back"), n("back");
64
65
  },
65
66
  onSaveStart: () => {
66
- console.debug("guido:save:start"), t("save:start");
67
+ console.debug("guido:save:start"), n("save:start");
67
68
  },
68
69
  onSaveComplete: (e) => {
69
- const r = { ...e, metadata: u };
70
- console.debug("guido:save:complete", r), t("save:complete", r);
70
+ const t = { ...e, metadata: h };
71
+ console.debug("guido:save:complete", t), n("save:complete", t);
71
72
  },
72
73
  onTestEmailClick: () => {
73
- console.debug("guido:test-email:click"), t("test-email:click");
74
+ console.debug("guido:test-email:click"), n("test-email:click");
74
75
  }
75
76
  });
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 = () => {
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 = () => {
79
80
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
80
81
  };
81
- j(() => c.value, () => {
82
- t("on-change", c.value);
82
+ Q(() => m.value, () => {
83
+ n("on-change", m.value);
83
84
  });
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);
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);
87
88
  };
88
- return q(async () => {
89
- console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow");
89
+ let c = null;
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
+ };
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));
90
100
  try {
91
- y.selectedUnsubscribePages = (o == null ? void 0 : o.selectedUnsubscribePages) || [];
92
- let e = {
93
- html: a && await A(a),
94
- css: D
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
95
106
  };
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;
97
- } catch (e) {
98
- console.error("Failed to initialize Stripo editor:", e);
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);
99
110
  }
100
- document.addEventListener("dynamic-content:open", p);
101
- }), J(() => {
102
- document.removeEventListener("dynamic-content:open", p);
111
+ document.addEventListener("dynamic-content:open", b);
112
+ }), Y(() => {
113
+ c == null || c.disconnect(), document.removeEventListener("dynamic-content:open", b);
103
114
  try {
104
115
  window.UIEditor.removeEditor();
105
116
  } catch {
106
117
  console.debug("Failed to remove Stripo editor: No editor found");
107
118
  }
108
- s.reset();
109
- }), I({
119
+ i.reset();
120
+ }), z({
110
121
  dynamicContent: {
111
- insert: L,
112
- close: M
122
+ insert: R,
123
+ close: A
113
124
  },
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 };
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 };
117
128
  }
118
129
  });
119
130
  export {
120
- Me as default
131
+ Ae as default
121
132
  };