@useinsider/guido 2.1.0-beta.fd71a10 → 2.1.0-beta.ff1bc98

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 (145) hide show
  1. package/README.md +0 -36
  2. package/dist/@types/config/schemas.js +65 -70
  3. package/dist/components/Guido.vue.js +1 -1
  4. package/dist/components/Guido.vue2.js +58 -69
  5. package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue2.js +15 -14
  6. package/dist/composables/useBlocksConfig.js +16 -26
  7. package/dist/composables/useHtmlValidator.js +114 -104
  8. package/dist/composables/useRecommendation.js +54 -21
  9. package/dist/config/compiler/recommendationCompilerRules.js +45 -39
  10. package/dist/config/compiler/utils/recommendationCompilerUtils.js +116 -0
  11. package/dist/config/migrator/recommendationMigrator.js +2 -2
  12. package/dist/enums/defaults.js +4 -8
  13. package/dist/enums/extensions/recommendationBlock.js +1 -1
  14. package/dist/enums/recommendation.js +16 -15
  15. package/dist/extensions/Blocks/Recommendation/block.js +133 -9
  16. package/dist/extensions/Blocks/Recommendation/constants/blockIds.js +4 -0
  17. package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +4 -0
  18. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +66 -0
  19. package/dist/extensions/Blocks/Recommendation/constants/layout.js +22 -0
  20. package/dist/extensions/Blocks/Recommendation/constants/selectors.js +21 -0
  21. package/dist/extensions/Blocks/Recommendation/controls/button/index.js +64 -0
  22. package/dist/extensions/Blocks/Recommendation/controls/cardBackground/index.js +80 -0
  23. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +232 -0
  24. package/dist/extensions/Blocks/Recommendation/controls/image/index.js +19 -0
  25. package/dist/extensions/Blocks/Recommendation/controls/layout/index.js +92 -0
  26. package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +102 -0
  27. package/dist/extensions/Blocks/Recommendation/controls/main/currency.js +209 -0
  28. package/dist/extensions/Blocks/Recommendation/controls/main/filters.js +52 -0
  29. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +250 -0
  30. package/dist/extensions/Blocks/Recommendation/controls/main/locale.js +70 -0
  31. package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +160 -0
  32. package/dist/extensions/Blocks/Recommendation/controls/main/shuffle.js +67 -0
  33. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +307 -0
  34. package/dist/extensions/Blocks/Recommendation/controls/mobileLayout/cssRules.js +21 -0
  35. package/dist/extensions/Blocks/Recommendation/controls/name/index.js +46 -0
  36. package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +108 -0
  37. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/index.js +44 -0
  38. package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/index.js +48 -0
  39. package/dist/extensions/Blocks/Recommendation/controls/{omnibusDiscountTextAfterControl.js → omnibusDiscount/textAfter.js} +16 -14
  40. package/dist/extensions/Blocks/Recommendation/controls/{omnibusDiscountTextBeforeControl.js → omnibusDiscount/textBefore.js} +16 -14
  41. package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/index.js +48 -0
  42. package/dist/extensions/Blocks/Recommendation/controls/{omnibusPriceTextAfterControl.js → omnibusPrice/textAfter.js} +16 -14
  43. package/dist/extensions/Blocks/Recommendation/controls/{omnibusPriceTextBeforeControl.js → omnibusPrice/textBefore.js} +14 -12
  44. package/dist/extensions/Blocks/Recommendation/controls/price/index.js +44 -0
  45. package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +222 -0
  46. package/dist/extensions/Blocks/Recommendation/extension.js +40 -17
  47. package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +19 -3
  48. package/dist/extensions/Blocks/Recommendation/recommendation.css.js +13 -4
  49. package/dist/extensions/Blocks/Recommendation/services/configService.js +240 -0
  50. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +21 -10
  51. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +254 -207
  52. package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +233 -0
  53. package/dist/extensions/Blocks/Recommendation/templates/grid/migration.js +251 -0
  54. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +66 -0
  55. package/dist/extensions/Blocks/Recommendation/templates/index.js +12 -0
  56. package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +174 -0
  57. package/dist/extensions/Blocks/Recommendation/templates/list/template.js +73 -0
  58. package/dist/extensions/Blocks/Recommendation/templates/utils.js +134 -0
  59. package/dist/extensions/Blocks/Recommendation/types/nodeConfig.js +6 -0
  60. package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +9 -9
  61. package/dist/extensions/Blocks/Recommendation/utils/preserveTextStyles.js +26 -15
  62. package/dist/extensions/Blocks/Recommendation/utils/priceFormatter.js +29 -0
  63. package/dist/extensions/Blocks/Recommendation/utils/tagName.js +46 -0
  64. package/dist/extensions/Blocks/controlFactories.js +125 -93
  65. package/dist/guido.css +1 -1
  66. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +225 -237
  67. package/dist/services/recommendationApi.js +11 -8
  68. package/dist/services/templateLibraryApi.js +16 -13
  69. package/dist/src/@types/config/schemas.d.ts +0 -8
  70. package/dist/src/components/wrappers/WpDrawer.vue.d.ts +1 -1
  71. package/dist/src/composables/useConfig.d.ts +0 -4
  72. package/dist/src/composables/useRecommendation.d.ts +1 -0
  73. package/dist/src/config/compiler/utils/recommendationCompilerUtils.d.ts +17 -0
  74. package/dist/src/enums/defaults.d.ts +0 -4
  75. package/dist/src/extensions/Blocks/Recommendation/block.d.ts +67 -0
  76. package/dist/src/extensions/Blocks/Recommendation/constants/blockIds.d.ts +13 -0
  77. package/dist/src/extensions/Blocks/Recommendation/{constants.d.ts → constants/controlIds.d.ts} +0 -24
  78. package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +49 -0
  79. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +13 -0
  80. package/dist/src/extensions/Blocks/Recommendation/constants/layout.d.ts +41 -0
  81. package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +35 -0
  82. package/dist/src/extensions/Blocks/Recommendation/controls/button/index.d.ts +143 -0
  83. package/dist/src/extensions/Blocks/Recommendation/controls/cardBackground/index.d.ts +31 -0
  84. package/dist/src/extensions/Blocks/Recommendation/{cardCompositionControl.d.ts → controls/cardComposition/index.d.ts} +23 -3
  85. package/dist/src/extensions/Blocks/Recommendation/controls/image/index.d.ts +35 -0
  86. package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +21 -589
  87. package/dist/src/extensions/Blocks/Recommendation/controls/layout/index.d.ts +37 -0
  88. package/dist/src/extensions/Blocks/Recommendation/controls/main/algorithm.d.ts +29 -0
  89. package/dist/src/extensions/Blocks/Recommendation/controls/main/currency.d.ts +52 -0
  90. package/dist/src/extensions/Blocks/Recommendation/controls/main/filters.d.ts +22 -0
  91. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +79 -0
  92. package/dist/src/extensions/Blocks/Recommendation/controls/main/locale.d.ts +24 -0
  93. package/dist/src/extensions/Blocks/Recommendation/controls/main/productLayout.d.ts +60 -0
  94. package/dist/src/extensions/Blocks/Recommendation/controls/main/shuffle.d.ts +23 -0
  95. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +221 -0
  96. package/dist/src/extensions/Blocks/Recommendation/controls/mobileLayout/cssRules.d.ts +29 -0
  97. package/dist/src/extensions/Blocks/Recommendation/controls/name/index.d.ts +97 -0
  98. package/dist/src/extensions/Blocks/Recommendation/controls/name/textTrim.d.ts +34 -0
  99. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/index.d.ts +95 -0
  100. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscount/index.d.ts +100 -0
  101. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscount/textAfter.d.ts +15 -0
  102. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscount/textBefore.d.ts +15 -0
  103. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPrice/index.d.ts +100 -0
  104. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPrice/textAfter.d.ts +15 -0
  105. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPrice/textBefore.d.ts +15 -0
  106. package/dist/src/extensions/Blocks/Recommendation/controls/price/index.d.ts +95 -0
  107. package/dist/src/extensions/Blocks/Recommendation/controls/spacing/index.d.ts +83 -0
  108. package/dist/src/extensions/Blocks/Recommendation/extension.d.ts +9 -0
  109. package/dist/src/extensions/Blocks/Recommendation/services/configService.d.ts +151 -0
  110. package/dist/src/extensions/Blocks/Recommendation/services/index.d.ts +6 -0
  111. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +138 -468
  112. package/dist/src/extensions/Blocks/Recommendation/templates/grid/elementRenderer.d.ts +20 -0
  113. package/dist/src/extensions/Blocks/Recommendation/templates/{migrationTemplate.d.ts → grid/migration.d.ts} +11 -4
  114. package/dist/src/extensions/Blocks/Recommendation/templates/grid/template.d.ts +33 -0
  115. package/dist/src/extensions/Blocks/Recommendation/templates/index.d.ts +41 -0
  116. package/dist/src/extensions/Blocks/Recommendation/templates/list/elementRenderer.d.ts +8 -0
  117. package/dist/src/extensions/Blocks/Recommendation/templates/list/migration.d.ts +25 -0
  118. package/dist/src/extensions/Blocks/Recommendation/templates/list/template.d.ts +18 -0
  119. package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +66 -0
  120. package/dist/src/extensions/Blocks/Recommendation/types/index.d.ts +7 -0
  121. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +166 -0
  122. package/dist/src/extensions/Blocks/Recommendation/utils/priceFormatter.d.ts +33 -0
  123. package/dist/src/extensions/Blocks/Recommendation/utils/stylePreserver.d.ts +113 -0
  124. package/dist/src/extensions/Blocks/Recommendation/utils/tagName.d.ts +77 -0
  125. package/dist/src/stores/config.d.ts +0 -36
  126. package/dist/static/styles/customEditorStyle.css.js +35 -11
  127. package/dist/utils/pairProductVariables.js +57 -56
  128. package/dist/utils/templatePreparation.js +15 -14
  129. package/package.json +1 -1
  130. package/dist/extensions/Blocks/Recommendation/cardCompositionControl.js +0 -187
  131. package/dist/extensions/Blocks/Recommendation/constants.js +0 -13
  132. package/dist/extensions/Blocks/Recommendation/control.js +0 -336
  133. package/dist/extensions/Blocks/Recommendation/controls/cardBackgroundColorControl.js +0 -68
  134. package/dist/extensions/Blocks/Recommendation/controls/index.js +0 -245
  135. package/dist/extensions/Blocks/Recommendation/controls/nameTextTrimControl.js +0 -74
  136. package/dist/extensions/Blocks/Recommendation/controls/spacingControl.js +0 -188
  137. package/dist/extensions/Blocks/Recommendation/templates/blockTemplate.js +0 -181
  138. package/dist/extensions/Blocks/Recommendation/templates/migrationTemplate.js +0 -189
  139. package/dist/extensions/Blocks/Recommendation/templates/templateUtils.js +0 -209
  140. package/dist/extensions/ModulesTabIcons/extension.js +0 -17
  141. package/dist/src/extensions/Blocks/Recommendation/control.d.ts +0 -38
  142. package/dist/src/extensions/Blocks/Recommendation/controls/nameTextTrimControl.d.ts +0 -16
  143. package/dist/src/extensions/Blocks/Recommendation/templates/blockTemplate.d.ts +0 -16
  144. package/dist/src/extensions/Blocks/Recommendation/templates/templateUtils.d.ts +0 -52
  145. package/dist/src/extensions/ModulesTabIcons/extension.d.ts +0 -2
package/README.md CHANGED
@@ -122,8 +122,6 @@ const config: GuidoConfigInput = {
122
122
  senderName?: string,
123
123
  subject?: string,
124
124
  },
125
- savedModulesFolderName?: string, // Default: 'savedModules' - folder name for user-saved modules
126
- defaultModulesFolderName?: string, // Default: 'defaultModules' - folder name for default/prebuilt modules
127
125
  },
128
126
 
129
127
  // Optional: UI settings
@@ -143,11 +141,6 @@ const config: GuidoConfigInput = {
143
141
  modulesDisabled?: boolean, // Default: false - Disable modules panel
144
142
  },
145
143
 
146
- // Optional: Callbacks
147
- callbacks?: {
148
- externalValidation?: (data: SavedTemplateDetails) => Promise<boolean>, // Return false to cancel save
149
- },
150
-
151
144
  // Optional: Block configuration
152
145
  blocks?: {
153
146
  excludeDefaults?: DefaultBlockType[],
@@ -258,35 +251,6 @@ const config: GuidoConfigInput = {
258
251
 
259
252
  ---
260
253
 
261
- ## Module Folder Configuration
262
-
263
- 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.
264
-
265
- ```typescript
266
- const config: GuidoConfigInput = {
267
- identity: { templateId: 'tpl-123', userId: 'user-456' },
268
- partner: { name: 'acme' },
269
- editor: {
270
- // Folder name for user-saved modules
271
- savedModulesFolderName: 'savedModules',
272
-
273
- // Folder name for default/prebuilt modules
274
- defaultModulesFolderName: 'defaultModules',
275
- },
276
- };
277
- ```
278
-
279
- ### Default Values
280
-
281
- | Config Option | Default Value |
282
- |--------------|---------------|
283
- | `savedModulesFolderName` | `'savedModules'` |
284
- | `defaultModulesFolderName` | `'defaultModules'` |
285
-
286
- > **Note:** The actual folder paths (e.g., `guido_acme_savedModules`) are configured in the Stripo plugin panel using variable substitution like `${savedModulesFolderName}`.
287
-
288
- ---
289
-
290
254
  ## HTML Compiler Rules
291
255
 
292
256
  Add custom rules to transform HTML during export:
@@ -1,5 +1,4 @@
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";
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";
3
2
  const m = {
4
3
  /** Promotional/marketing emails */
5
4
  PROMOTIONAL: 1,
@@ -12,24 +11,24 @@ const m = {
12
11
  ARCHITECT: 49,
13
12
  /** Unsubscribe page builder */
14
13
  UNSUBSCRIBE_PAGES: 97
15
- }, h = o({
14
+ }, S = o({
16
15
  /** Unique identifier for the template being edited */
17
16
  templateId: u(
18
17
  t(),
19
- d(1, "templateId is required")
18
+ p(1, "templateId is required")
20
19
  ),
21
20
  /** Unique identifier for the user editing the template */
22
21
  userId: u(
23
22
  t(),
24
- d(1, "userId is required")
23
+ p(1, "userId is required")
25
24
  ),
26
25
  /** Optional variation ID for A/B testing */
27
26
  variationId: e(t())
28
- }), y = o({
27
+ }), h = o({
29
28
  /** Partner/organization name (required) */
30
29
  name: u(
31
30
  t(),
32
- d(1, "partner.name is required")
31
+ p(1, "partner.name is required")
33
32
  ),
34
33
  /** Product type identifier */
35
34
  productType: e(
@@ -47,7 +46,7 @@ const m = {
47
46
  ),
48
47
  /** Display name for the current user */
49
48
  username: e(t(), "Guido User")
50
- }), f = o({
49
+ }), y = o({
51
50
  /** Display text for the dynamic content */
52
51
  text: t(),
53
52
  /** Template variable value (e.g., {{username}}) */
@@ -68,14 +67,14 @@ const m = {
68
67
  css: e(t(), ""),
69
68
  /** Preselected dynamic content items */
70
69
  preselectedDynamicContent: e(
71
- c(f),
70
+ a(y),
72
71
  []
73
72
  ),
74
73
  /** Selected unsubscribe page IDs */
75
- selectedUnsubscribePages: e(c(p()), []),
74
+ selectedUnsubscribePages: e(a(b()), []),
76
75
  /** Force recreate template in Stripo storage (use true when updating externally modified templates) */
77
- forceRecreate: e(a(), !1)
78
- }), A = o({
76
+ forceRecreate: e(c(), !1)
77
+ }), f = o({
79
78
  /** Sender display name */
80
79
  senderName: e(t(), ""),
81
80
  /** Email subject line */
@@ -86,34 +85,30 @@ const m = {
86
85
  /** Path to translations object */
87
86
  translationsPath: e(t(), "window.trans[Object.keys(window.trans)[0]]"),
88
87
  /** Migration date for template compatibility */
89
- migrationDate: e(p(), 1759696858),
88
+ migrationDate: e(b(), 1759696858),
90
89
  /** Email header settings */
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({
90
+ emailHeader: e(f, { senderName: "", subject: "" })
91
+ }), I = o({
97
92
  /** Whether to show the header bar */
98
- showHeader: e(a(), !0),
93
+ showHeader: e(c(), !0),
99
94
  /** Custom label for back button (if shown) */
100
95
  backButtonLabel: e(t())
101
- }), I = o({
96
+ }), T = o({
102
97
  /** Enable dynamic content insertion */
103
- dynamicContent: e(a(), !0),
98
+ dynamicContent: e(c(), !0),
104
99
  /** Enable save as template functionality */
105
- saveAsTemplate: e(a(), !0),
100
+ saveAsTemplate: e(c(), !0),
106
101
  /** Enable version history */
107
- versionHistory: e(a(), !0),
102
+ versionHistory: e(c(), !0),
108
103
  /** Enable test message sending */
109
- testMessage: e(a(), !0),
104
+ testMessage: e(c(), !0),
110
105
  /** Enable display conditions */
111
- displayConditions: e(a(), !0),
106
+ displayConditions: e(c(), !0),
112
107
  /** Enable unsubscribe block */
113
- unsubscribe: e(a(), !0),
108
+ unsubscribe: e(c(), !0),
114
109
  /** Disable modules panel in the editor */
115
- modulesDisabled: e(a(), !1)
116
- }), E = n([
110
+ modulesDisabled: e(c(), !1)
111
+ }), A = n([
117
112
  "amp-accordion",
118
113
  "amp-carousel",
119
114
  "amp-form-controls",
@@ -138,12 +133,12 @@ const m = {
138
133
  ]), O = o({
139
134
  /** Default blocks to exclude from the editor */
140
135
  excludeDefaults: e(
141
- c(E),
136
+ a(A),
142
137
  []
143
138
  ),
144
139
  /** Custom blocks to include in the editor */
145
140
  includeCustoms: e(
146
- c(g),
141
+ a(g),
147
142
  []
148
143
  )
149
144
  }), l = o({
@@ -152,8 +147,8 @@ const m = {
152
147
  /** Human-readable description */
153
148
  description: e(t()),
154
149
  /** Priority for rule ordering (lower = earlier) */
155
- priority: p()
156
- }), L = o({
150
+ priority: b()
151
+ }), E = o({
157
152
  ...l.entries,
158
153
  type: r("replace"),
159
154
  /** String to search for */
@@ -161,8 +156,8 @@ const m = {
161
156
  /** Replacement string */
162
157
  replacement: t(),
163
158
  /** Replace all occurrences (default: false) */
164
- replaceAll: e(a())
165
- }), M = o({
159
+ replaceAll: e(c())
160
+ }), N = o({
166
161
  ...l.entries,
167
162
  type: r("regex"),
168
163
  /** Regex pattern string */
@@ -171,82 +166,82 @@ const m = {
171
166
  replacement: t(),
172
167
  /** Regex flags (e.g., 'gi') */
173
168
  flags: e(t())
174
- }), N = o({
169
+ }), L = o({
175
170
  ...l.entries,
176
171
  type: r("remove"),
177
172
  /** Strings or patterns to remove */
178
- targets: c(t())
179
- }), D = o({
173
+ targets: a(t())
174
+ }), v = o({
180
175
  ...l.entries,
181
176
  type: r("custom"),
182
177
  /** Custom processor function */
183
- processor: S(
178
+ processor: d(
184
179
  (i) => typeof i == "function",
185
180
  "processor must be a function"
186
181
  )
187
- }), v = k("type", [
188
- L,
189
- M,
182
+ }), x = k("type", [
183
+ E,
190
184
  N,
191
- D
192
- ]), U = o({
185
+ L,
186
+ v
187
+ ]), B = o({
193
188
  /** Custom compiler rules to apply */
194
- customRules: e(c(v), []),
189
+ customRules: e(a(x), []),
195
190
  /** Skip default compiler rules */
196
- ignoreDefaultRules: e(a(), !1)
197
- }), x = o({
191
+ ignoreDefaultRules: e(c(), !1)
192
+ }), P = o({
198
193
  /**
199
194
  * External validation handler called before save completes.
200
195
  * Return false to cancel the save operation.
201
196
  */
202
197
  externalValidation: e(
203
- S(
198
+ d(
204
199
  (i) => typeof i == "function",
205
200
  "externalValidation must be a function"
206
201
  )
207
202
  )
208
- }), H = o({
203
+ }), D = o({
209
204
  // Required sections
210
205
  /** Identity configuration (required) */
211
- identity: h,
206
+ identity: S,
212
207
  /** Partner configuration (required) */
213
- partner: y,
208
+ partner: h,
214
209
  // Optional sections (with defaults)
215
210
  /** Template content and presets */
216
211
  template: e(R, {}),
217
212
  /** Editor settings */
218
213
  editor: e(C, {}),
219
214
  /** UI configuration */
220
- ui: e(T, {}),
215
+ ui: e(I, {}),
221
216
  /** Feature toggles */
222
- features: e(I, {}),
217
+ features: e(T, {}),
223
218
  /** Block configuration */
224
219
  blocks: e(O, {}),
225
220
  /** Compiler configuration */
226
- compiler: e(U, {}),
221
+ compiler: e(B, {}),
227
222
  /** Callbacks and event handlers */
228
- callbacks: e(x, {})
223
+ callbacks: e(P, {})
229
224
  });
230
225
  export {
231
226
  O as BlocksSchema,
232
- x as CallbacksSchema,
233
- v as CompilerRuleSchema,
234
- U as CompilerSchema,
227
+ P as CallbacksSchema,
228
+ x as CompilerRuleSchema,
229
+ B as CompilerSchema,
235
230
  g as CustomBlockTypeSchema,
236
- D as CustomRuleSchema,
237
- E as DefaultBlockTypeSchema,
238
- f as DynamicContentSchema,
231
+ v as CustomRuleSchema,
232
+ A as DefaultBlockTypeSchema,
233
+ y as DynamicContentSchema,
239
234
  C as EditorSchema,
240
- A as EmailHeaderSchema,
241
- I as FeaturesSchema,
242
- H as GuidoConfigSchema,
243
- h as IdentitySchema,
235
+ f as EmailHeaderSchema,
236
+ T as FeaturesSchema,
237
+ D as GuidoConfigSchema,
238
+ S as IdentitySchema,
244
239
  m as MessageType,
245
- y as PartnerSchema,
240
+ h as PartnerSchema,
246
241
  s as ProductType,
247
- M as RegexRuleSchema,
248
- N as RemoveRuleSchema,
249
- L as ReplaceRuleSchema,
242
+ N as RegexRuleSchema,
243
+ L as RemoveRuleSchema,
244
+ E as ReplaceRuleSchema,
250
245
  R as TemplateSchema,
251
- T as UISchema
246
+ I as UISchema
252
247
  };
@@ -12,7 +12,7 @@ var t = function() {
12
12
  n,
13
13
  !1,
14
14
  null,
15
- "16abb398"
15
+ "890b5336"
16
16
  );
17
17
  const v = s.exports;
18
18
  export {
@@ -1,65 +1,54 @@
1
- import { defineComponent as z, defineAsyncComponent as M, ref as K, computed as _, watch as V, onMounted as j, onUnmounted as q } from "vue";
2
- import { provideGuidoActions as J } from "../composables/useGuidoActions.js";
3
- import { usePartner as Q } from "../composables/usePartner.js";
4
- import { useStripo as X } from "../composables/useStripo.js";
5
- import { useTimerClone as Y } from "../composables/useTimerClone.js";
6
- import { migrate as P } from "../config/migrator/index.js";
7
- import { ModuleFolderDefaults as A } from "../enums/defaults.js";
8
- import Z from "./organisms/base/Toaster.vue.js";
9
- import $ from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
10
- import ee from "./organisms/header/HeaderWrapper.vue.js";
11
- import oe from "./organisms/LoadingWrapper.vue.js";
12
- import te from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
13
- import ne from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
14
- import { useStripoApi as re } from "../services/stripoApi.js";
15
- import { useConfigStore as se } from "../stores/config.js";
16
- import { useDynamicContentStore as ce } from "../stores/dynamic-content.js";
17
- import { useEditorStore as ae } from "../stores/editor.js";
18
- import { usePreviewStore as ie } from "../stores/preview.js";
19
- import { useUnsubscribeStore as de } from "../stores/unsubscribe.js";
20
- const Le = /* @__PURE__ */ z({
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({
21
20
  __name: "Guido",
22
21
  props: {
23
22
  config: null
24
23
  },
25
24
  emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
26
- setup(N, { expose: W, emit: t }) {
27
- const u = N, I = M(
25
+ setup(_, { expose: I, emit: t }) {
26
+ const l = _, L = P(
28
27
  () => import("./organisms/email-preview/PreviewContainer.vue.js")
29
- ), O = M(
28
+ ), A = P(
30
29
  () => import("./organisms/onboarding/OnboardingWrapper.vue.js")
31
- ), p = K(), a = ce(), v = de(), r = se();
32
- r.init(u.config);
33
- const i = ae(), G = ie(), s = _(() => i.hasChanges), { isTestPartner: H } = Q(), y = () => {
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 = () => {
34
33
  var e;
35
34
  return (e = p.value) == null ? void 0 : e.handleSave(!0);
36
- }, {
37
- templateId: d,
38
- userId: h,
39
- partnerName: f,
40
- productType: b,
41
- username: S,
42
- template: o,
43
- editor: n
44
- } = r, c = (o == null ? void 0 : o.html) || "", g = (o == null ? void 0 : o.css) || "", m = (o == null ? void 0 : o.preselectedDynamicContent) || [], w = (n == null ? void 0 : n.savedModulesFolderName) || A.SAVED_MODULES, D = (n == null ? void 0 : n.defaultModulesFolderName) || A.DEFAULT_MODULES;
45
- i.templateId = d;
46
- const { initPlugin: E } = X({
47
- emailId: d,
48
- userId: h,
49
- username: S,
50
- partnerName: f,
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,
51
42
  productType: b,
52
43
  preselectedDynamicContentList: m,
53
- savedModulesFolderName: w,
54
- defaultModulesFolderName: D,
55
44
  onReady: () => {
56
45
  console.debug("guido:ready"), t("ready");
57
46
  }
58
- }), { getDefaultTemplate: C } = re(), { cloneTimersOnSave: T, hasTimerBlocks: k } = Y(), x = _(() => {
47
+ }), { getDefaultTemplate: w } = ee(), { cloneTimersOnSave: C, hasTimerBlocks: D } = J(), H = U(() => {
59
48
  var e;
60
- return !((e = r.ui) != null && e.showHeader);
49
+ return !((e = n.ui) != null && e.showHeader);
61
50
  });
62
- J({
51
+ M({
63
52
  onBack: () => {
64
53
  console.debug("guido:back"), t("back");
65
54
  },
@@ -73,49 +62,49 @@ const Le = /* @__PURE__ */ z({
73
62
  console.debug("guido:test-email:click"), t("test-email:click");
74
63
  }
75
64
  });
76
- const F = (e) => {
77
- console.debug("dynamic-content:close", e), a.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
78
- }, U = () => {
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 = () => {
79
68
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
80
69
  };
81
- V(() => s.value, () => {
82
- t("on-change", s.value);
70
+ R(() => r.value, () => {
71
+ t("on-change", r.value);
83
72
  });
84
- const l = (e) => {
85
- const L = e, { attribute: B, position: R } = L.detail;
86
- console.debug("dynamic-content:open", L.detail), t("dynamic-content:open", B, R);
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);
87
76
  };
88
- return j(async () => {
77
+ return z(async () => {
89
78
  console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow");
90
79
  try {
91
- v.selectedUnsubscribePages = (o == null ? void 0 : o.selectedUnsubscribePages) || [];
80
+ u.selectedUnsubscribePages = (o == null ? void 0 : o.selectedUnsubscribePages) || [];
92
81
  let e = {
93
- html: c && await P(c),
82
+ html: s && await W(s),
94
83
  css: g
95
84
  };
96
- e.html || (e = await C(), e.html = await P(e.html)), k(e.html) && (e.html = await T(e.html)), await E(e), a.selectedDynamicContentList = m;
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;
97
86
  } catch (e) {
98
87
  console.error("Failed to initialize Stripo editor:", e);
99
88
  }
100
- document.addEventListener("dynamic-content:open", l);
101
- }), q(() => {
102
- document.removeEventListener("dynamic-content:open", l);
89
+ document.addEventListener("dynamic-content:open", d);
90
+ }), K(() => {
91
+ document.removeEventListener("dynamic-content:open", d);
103
92
  try {
104
93
  window.UIEditor.removeEditor();
105
94
  } catch {
106
95
  console.debug("Failed to remove Stripo editor: No editor found");
107
96
  }
108
- r.reset();
109
- }), W({
97
+ n.reset();
98
+ }), I({
110
99
  dynamicContent: {
111
- insert: F,
112
- close: U
100
+ insert: E,
101
+ close: k
113
102
  },
114
- hasChanges: s,
115
- saveSilent: y
116
- }), { __sfc: !0, PreviewContainer: I, OnboardingWrapper: O, headerWrapperRef: p, dynamicContentStore: a, unsubscribeStore: v, props: u, configStore: r, editorStore: i, previewStore: G, hasChanges: s, isTestPartner: H, saveSilent: y, templateId: d, userId: h, partnerName: f, productType: b, username: S, templateConfig: o, editorConfig: n, html: c, css: g, preselectedDynamicContentList: m, savedModulesFolderName: w, defaultModulesFolderName: D, emit: t, initPlugin: E, getDefaultTemplate: C, cloneTimersOnSave: T, hasTimerBlocks: k, noHeader: x, insertDynamicContent: F, closeDynamicContent: U, handleDynamicContentOpen: l, Toaster: Z, FilterSelectionDrawer: $, HeaderWrapper: ee, LoadingWrapper: oe, SaveAsTemplateDrawer: te, UnsubscribeWrapper: ne };
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: $ };
117
106
  }
118
107
  });
119
108
  export {
120
- Le as default
109
+ Ee as default
121
110
  };
@@ -1,16 +1,16 @@
1
1
  import { defineComponent as n, ref as a, computed as l } from "vue";
2
2
  import i from "../../../wrappers/WpDrawer.vue.js";
3
- import { useTranslations as p } from "../../../../composables/useTranslations.js";
4
- import { useRecommendationExtensionStore as c } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
3
+ import { useTranslations as c } from "../../../../composables/useTranslations.js";
4
+ import { useRecommendationExtensionStore as p } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
5
5
  import u from "./Filters.vue.js";
6
- const b = /* @__PURE__ */ n({
6
+ const v = /* @__PURE__ */ n({
7
7
  __name: "FilterSelectionDrawer",
8
- setup(m) {
9
- const t = p(), o = c(), e = a(!1), s = l(() => ({
8
+ setup(f) {
9
+ const r = c(), t = p(), e = a(!1), s = l(() => ({
10
10
  primaryButton: {
11
11
  styling: "solid",
12
12
  type: "primary",
13
- labelText: t(
13
+ labelText: r(
14
14
  e.value ? "unsubscription-preference.selecting-type" : "products.select-and-continue"
15
15
  ),
16
16
  loadingStatus: e.value,
@@ -19,19 +19,20 @@ const b = /* @__PURE__ */ n({
19
19
  cancelOrBackButton: {
20
20
  styling: "ghost",
21
21
  type: "secondary",
22
- labelText: t("products.cancel"),
22
+ labelText: r("products.cancel"),
23
23
  disabledStatus: e.value
24
24
  }
25
- })), r = () => {
26
- o.filterSelectionDrawerStatus = !1;
25
+ })), o = () => {
26
+ t.closeFilterDrawer();
27
27
  };
28
- return { __sfc: !0, trans: t, store: o, isApplying: e, footerButtonGroupOptions: s, closeModal: r, applyFilter: () => {
29
- e.value = !0, setTimeout(() => {
30
- console.debug("Filter applied!"), r(), o.generateFilterQuery();
31
- }, 2e3);
28
+ return { __sfc: !0, trans: r, store: t, isApplying: e, footerButtonGroupOptions: s, closeModal: o, applyFilter: () => {
29
+ e.value = !0, t.patchCurrentBlockConfig(
30
+ { filters: t.recommendationConfigs.filters },
31
+ { triggerRefetch: !0 }
32
+ ), o(), e.value = !1;
32
33
  }, WpDrawer: i, Filters: u };
33
34
  }
34
35
  });
35
36
  export {
36
- b as default
37
+ v as default
37
38
  };
@@ -1,6 +1,5 @@
1
- import r from "../extensions/ModulesTabIcons/extension.js";
2
1
  import { useConfigStore as l } from "../stores/config.js";
3
- const a = {
2
+ const r = {
4
3
  "amp-accordion": "ampAccordionEnabled",
5
4
  "amp-carousel": "ampCarouselEnabled",
6
5
  "amp-form-controls": "ampFormControlsEnabled",
@@ -14,7 +13,7 @@ const a = {
14
13
  "text-block": "textEnabled",
15
14
  "timer-block": "timerEnabled",
16
15
  "video-block": "videoEnabled"
17
- }, s = {
16
+ }, c = {
18
17
  "dynamic-content": () => import("../extensions/DynamicContent/extension.js"),
19
18
  "checkbox-block": () => import("../extensions/Blocks/Checkbox/extension.js"),
20
19
  "radio-button-block": () => import("../extensions/Blocks/RadioButton/extension.js"),
@@ -22,40 +21,31 @@ const a = {
22
21
  "unsubscribe-block": () => import("../extensions/Blocks/Unsubscribe/extension.js"),
23
22
  "coupon-block": () => import("../extensions/Blocks/CouponBlock/extension.js"),
24
23
  "items-block": () => import("../extensions/Blocks/Items/extension.js")
25
- }, i = (n) => {
24
+ }, a = (n) => {
26
25
  if (!n || !n.length)
27
26
  return {};
28
- const t = {};
27
+ const e = {};
29
28
  return n.forEach((o) => {
30
- const e = a[o];
31
- e && (t[e] = !1);
32
- }), t;
33
- }, b = () => [r], m = async (n) => {
34
- const t = b();
35
- if (!n || !n.length)
36
- return t;
37
- const o = await Promise.all(
38
- n.map(async (e) => {
39
- const c = s[e];
40
- return c ? (await c()).default : null;
41
- })
42
- );
43
- return [
44
- ...t,
45
- ...o.filter((e) => e !== null)
46
- ];
47
- }, E = () => {
29
+ const t = r[o];
30
+ t && (e[t] = !1);
31
+ }), e;
32
+ }, i = async (n) => !n || !n.length ? [] : (await Promise.all(
33
+ n.map(async (o) => {
34
+ const t = c[o];
35
+ return t ? (await t()).default : null;
36
+ })
37
+ )).filter((o) => o !== null), m = () => {
48
38
  const n = l();
49
39
  return {
50
40
  getStripoBlocksConfig: async () => {
51
41
  const o = n.blocks;
52
42
  return {
53
- baseBlocks: i(o == null ? void 0 : o.excludeDefaults),
54
- extensions: await m(o == null ? void 0 : o.includeCustoms)
43
+ baseBlocks: a(o == null ? void 0 : o.excludeDefaults),
44
+ extensions: await i(o == null ? void 0 : o.includeCustoms)
55
45
  };
56
46
  }
57
47
  };
58
48
  };
59
49
  export {
60
- E as useBlocksConfig
50
+ m as useBlocksConfig
61
51
  };