@useinsider/guido 1.0.3-beta.729420c → 1.0.3-beta.734efde

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 (170) hide show
  1. package/README.md +169 -3
  2. package/dist/components/organisms/header/LeftSlot.vue.js +1 -1
  3. package/dist/components/organisms/header/LeftSlot.vue2.js +16 -15
  4. package/dist/components/organisms/header/RightSlot.vue.js +11 -11
  5. package/dist/composables/useBlocksConfig.js +48 -0
  6. package/dist/composables/useStripo.js +40 -51
  7. package/dist/config/migrator/index.js +7 -6
  8. package/dist/config/migrator/recommendationMigrator.js +293 -0
  9. package/dist/enums/defaults.js +15 -9
  10. package/dist/enums/extensions/recommendationBlock.js +2 -2
  11. package/dist/extensions/Blocks/Checkbox/block.js +5 -2
  12. package/dist/extensions/Blocks/Checkbox/extension.js +2 -2
  13. package/dist/extensions/Blocks/CouponBlock/extension.js +2 -2
  14. package/dist/extensions/Blocks/Items/block.js +66 -0
  15. package/dist/extensions/Blocks/Items/controls/button/link.js +68 -0
  16. package/dist/extensions/Blocks/Items/controls/cardComposition.js +99 -0
  17. package/dist/extensions/Blocks/Items/controls/image/link.js +68 -0
  18. package/dist/extensions/Blocks/Items/controls/index.js +217 -0
  19. package/dist/extensions/Blocks/Items/controls/name/trimming.js +70 -0
  20. package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +107 -0
  21. package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +123 -0
  22. package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +76 -0
  23. package/dist/extensions/Blocks/Items/controls/price/hideDiscount.js +61 -0
  24. package/dist/extensions/Blocks/Items/controls/settingsControl.js +280 -0
  25. package/dist/extensions/Blocks/Items/enums/controlEnums.js +5 -0
  26. package/dist/extensions/Blocks/Items/enums/productEnums.js +195 -0
  27. package/dist/extensions/Blocks/Items/enums/settingsEnums.js +70 -0
  28. package/dist/extensions/Blocks/Items/extension.js +19 -0
  29. package/dist/extensions/Blocks/Items/iconsRegistry.js +32 -0
  30. package/dist/extensions/Blocks/Items/items.css.js +23 -0
  31. package/dist/extensions/Blocks/Items/layouts/horizontal.html.js +61 -0
  32. package/dist/extensions/Blocks/Items/layouts/vertical.html.js +61 -0
  33. package/dist/extensions/Blocks/Items/settingsPanel.js +106 -0
  34. package/dist/extensions/Blocks/Items/store/items-block.js +71 -0
  35. package/dist/extensions/Blocks/Items/template.js +110 -0
  36. package/dist/extensions/Blocks/Items/utils/configBlockUtils.js +17 -0
  37. package/dist/extensions/Blocks/Items/utils/syncAttributeFromConfigBlock.js +28 -0
  38. package/dist/extensions/Blocks/Items/utils/syncAttributesFromConfigBlock.js +67 -0
  39. package/dist/extensions/Blocks/Items/utils/updateAttributes.js +44 -0
  40. package/dist/extensions/Blocks/RadioButton/block.js +5 -2
  41. package/dist/extensions/Blocks/Recommendation/block.js +6 -3
  42. package/dist/extensions/Blocks/Recommendation/cardCompositionControl.js +103 -0
  43. package/dist/extensions/Blocks/Recommendation/constants.js +5 -0
  44. package/dist/extensions/Blocks/Recommendation/control.js +69 -40
  45. package/dist/extensions/Blocks/Recommendation/controls/button/align.js +13 -0
  46. package/dist/extensions/Blocks/Recommendation/controls/button/border.js +13 -0
  47. package/dist/extensions/Blocks/Recommendation/controls/button/borderRadius.js +13 -0
  48. package/dist/extensions/Blocks/Recommendation/controls/button/color.js +13 -0
  49. package/dist/extensions/Blocks/Recommendation/controls/button/fitToContent.js +13 -0
  50. package/dist/extensions/Blocks/Recommendation/controls/button/fontFamily.js +13 -0
  51. package/dist/extensions/Blocks/Recommendation/controls/button/margins.js +13 -0
  52. package/dist/extensions/Blocks/Recommendation/controls/button/paddings.js +13 -0
  53. package/dist/extensions/Blocks/Recommendation/controls/button/text.js +13 -0
  54. package/dist/extensions/Blocks/Recommendation/controls/button/textSize.js +13 -0
  55. package/dist/extensions/Blocks/Recommendation/controls/button/textStyleAndFontColor.js +13 -0
  56. package/dist/extensions/Blocks/Recommendation/controls/image/margins.js +13 -0
  57. package/dist/extensions/Blocks/Recommendation/controls/image/size.js +13 -0
  58. package/dist/extensions/Blocks/Recommendation/controls/name/align.js +13 -0
  59. package/dist/extensions/Blocks/Recommendation/controls/name/background.js +13 -0
  60. package/dist/extensions/Blocks/Recommendation/controls/name/color.js +13 -0
  61. package/dist/extensions/Blocks/Recommendation/controls/name/fontFamily.js +13 -0
  62. package/dist/extensions/Blocks/Recommendation/controls/name/paddings.js +13 -0
  63. package/dist/extensions/Blocks/Recommendation/controls/name/size.js +13 -0
  64. package/dist/extensions/Blocks/Recommendation/controls/name/style.js +13 -0
  65. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/align.js +13 -0
  66. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/background.js +13 -0
  67. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/color.js +13 -0
  68. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/fontFamily.js +13 -0
  69. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/paddings.js +13 -0
  70. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/size.js +13 -0
  71. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/style.js +13 -0
  72. package/dist/extensions/Blocks/Recommendation/controls/price/align.js +13 -0
  73. package/dist/extensions/Blocks/Recommendation/controls/price/background.js +13 -0
  74. package/dist/extensions/Blocks/Recommendation/controls/price/color.js +13 -0
  75. package/dist/extensions/Blocks/Recommendation/controls/price/fontFamily.js +13 -0
  76. package/dist/extensions/Blocks/Recommendation/controls/price/paddings.js +13 -0
  77. package/dist/extensions/Blocks/Recommendation/controls/price/size.js +13 -0
  78. package/dist/extensions/Blocks/Recommendation/controls/price/style.js +13 -0
  79. package/dist/extensions/Blocks/Recommendation/extension.js +42 -7
  80. package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +43 -43
  81. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +107 -22
  82. package/dist/extensions/Blocks/Recommendation/templates/blockTemplate.js +160 -0
  83. package/dist/extensions/Blocks/Recommendation/templates/migrationTemplate.js +152 -0
  84. package/dist/extensions/Blocks/Recommendation/templates/templateUtils.js +180 -0
  85. package/dist/extensions/Blocks/common-control.js +201 -55
  86. package/dist/extensions/Blocks/controlFactories.js +223 -0
  87. package/dist/guido.css +1 -1
  88. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +353 -101
  89. package/dist/package.json.js +1 -1
  90. package/dist/services/recommendationApi.js +13 -19
  91. package/dist/services/stripoApi.js +1 -1
  92. package/dist/src/@types/generic.d.ts +9 -0
  93. package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
  94. package/dist/src/composables/useBlocksConfig.d.ts +11 -0
  95. package/dist/src/config/migrator/recommendationMigrator.d.ts +1 -0
  96. package/dist/src/extensions/Blocks/Checkbox/block.d.ts +1 -0
  97. package/dist/src/extensions/Blocks/Items/block.d.ts +13 -0
  98. package/dist/src/extensions/Blocks/Items/controls/button/link.d.ts +14 -0
  99. package/dist/src/extensions/Blocks/Items/controls/cardComposition.d.ts +20 -0
  100. package/dist/src/extensions/Blocks/Items/controls/image/link.d.ts +14 -0
  101. package/dist/src/extensions/Blocks/Items/controls/index.d.ts +501 -0
  102. package/dist/src/extensions/Blocks/Items/controls/name/trimming.d.ts +14 -0
  103. package/dist/src/extensions/Blocks/Items/controls/price/currencyLocation.d.ts +19 -0
  104. package/dist/src/extensions/Blocks/Items/controls/price/currencySymbol.d.ts +21 -0
  105. package/dist/src/extensions/Blocks/Items/controls/price/formattedPrice.d.ts +14 -0
  106. package/dist/src/extensions/Blocks/Items/controls/price/hideDiscount.d.ts +13 -0
  107. package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +42 -0
  108. package/dist/src/extensions/Blocks/Items/enums/controlEnums.d.ts +61 -0
  109. package/dist/src/extensions/Blocks/Items/enums/productEnums.d.ts +154 -0
  110. package/dist/src/extensions/Blocks/Items/enums/settingsEnums.d.ts +43 -0
  111. package/dist/src/extensions/Blocks/Items/extension.d.ts +2 -0
  112. package/dist/src/extensions/Blocks/Items/iconsRegistry.d.ts +4 -0
  113. package/dist/src/extensions/Blocks/Items/settingsPanel.d.ts +4 -0
  114. package/dist/src/extensions/Blocks/Items/store/items-block.d.ts +41 -0
  115. package/dist/src/extensions/Blocks/Items/template.d.ts +16 -0
  116. package/dist/src/extensions/Blocks/Items/utils/configBlockUtils.d.ts +23 -0
  117. package/dist/src/extensions/Blocks/Items/utils/syncAttributeFromConfigBlock.d.ts +32 -0
  118. package/dist/src/extensions/Blocks/Items/utils/syncAttributesFromConfigBlock.d.ts +44 -0
  119. package/dist/src/extensions/Blocks/Items/utils/updateAttributes.d.ts +8 -0
  120. package/dist/src/extensions/Blocks/RadioButton/block.d.ts +1 -0
  121. package/dist/src/extensions/Blocks/Recommendation/block.d.ts +1 -0
  122. package/dist/src/extensions/Blocks/Recommendation/cardCompositionControl.d.ts +28 -0
  123. package/dist/src/extensions/Blocks/Recommendation/constants.d.ts +51 -0
  124. package/dist/src/extensions/Blocks/Recommendation/control.d.ts +6 -0
  125. package/dist/src/extensions/Blocks/Recommendation/controls/button/align.d.ts +5 -0
  126. package/dist/src/extensions/Blocks/Recommendation/controls/button/border.d.ts +5 -0
  127. package/dist/src/extensions/Blocks/Recommendation/controls/button/borderRadius.d.ts +5 -0
  128. package/dist/src/extensions/Blocks/Recommendation/controls/button/color.d.ts +5 -0
  129. package/dist/src/extensions/Blocks/Recommendation/controls/button/fitToContent.d.ts +5 -0
  130. package/dist/src/extensions/Blocks/Recommendation/controls/button/fontFamily.d.ts +5 -0
  131. package/dist/src/extensions/Blocks/Recommendation/controls/button/margins.d.ts +5 -0
  132. package/dist/src/extensions/Blocks/Recommendation/controls/button/paddings.d.ts +5 -0
  133. package/dist/src/extensions/Blocks/Recommendation/controls/button/text.d.ts +5 -0
  134. package/dist/src/extensions/Blocks/Recommendation/controls/button/textSize.d.ts +5 -0
  135. package/dist/src/extensions/Blocks/Recommendation/controls/button/textStyleAndFontColor.d.ts +5 -0
  136. package/dist/src/extensions/Blocks/Recommendation/controls/image/margins.d.ts +5 -0
  137. package/dist/src/extensions/Blocks/Recommendation/controls/image/size.d.ts +5 -0
  138. package/dist/src/extensions/Blocks/Recommendation/controls/name/align.d.ts +5 -0
  139. package/dist/src/extensions/Blocks/Recommendation/controls/name/background.d.ts +5 -0
  140. package/dist/src/extensions/Blocks/Recommendation/controls/name/color.d.ts +5 -0
  141. package/dist/src/extensions/Blocks/Recommendation/controls/name/fontFamily.d.ts +5 -0
  142. package/dist/src/extensions/Blocks/Recommendation/controls/name/paddings.d.ts +5 -0
  143. package/dist/src/extensions/Blocks/Recommendation/controls/name/size.d.ts +5 -0
  144. package/dist/src/extensions/Blocks/Recommendation/controls/name/style.d.ts +5 -0
  145. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/align.d.ts +5 -0
  146. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/background.d.ts +5 -0
  147. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/color.d.ts +5 -0
  148. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/fontFamily.d.ts +5 -0
  149. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/paddings.d.ts +5 -0
  150. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/size.d.ts +5 -0
  151. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/style.d.ts +5 -0
  152. package/dist/src/extensions/Blocks/Recommendation/controls/price/align.d.ts +5 -0
  153. package/dist/src/extensions/Blocks/Recommendation/controls/price/background.d.ts +5 -0
  154. package/dist/src/extensions/Blocks/Recommendation/controls/price/color.d.ts +5 -0
  155. package/dist/src/extensions/Blocks/Recommendation/controls/price/fontFamily.d.ts +5 -0
  156. package/dist/src/extensions/Blocks/Recommendation/controls/price/paddings.d.ts +5 -0
  157. package/dist/src/extensions/Blocks/Recommendation/controls/price/size.d.ts +5 -0
  158. package/dist/src/extensions/Blocks/Recommendation/controls/price/style.d.ts +5 -0
  159. package/dist/src/extensions/Blocks/Recommendation/templates/blockTemplate.d.ts +16 -0
  160. package/dist/src/extensions/Blocks/Recommendation/templates/migrationTemplate.d.ts +16 -0
  161. package/dist/src/extensions/Blocks/Recommendation/templates/templateUtils.d.ts +44 -0
  162. package/dist/src/extensions/Blocks/common-control.d.ts +65 -7
  163. package/dist/src/extensions/Blocks/controlFactories.d.ts +312 -0
  164. package/dist/src/stores/config.d.ts +6 -0
  165. package/dist/static/styles/components/narrow-panel.css.js +10 -0
  166. package/dist/static/styles/customEditorStyle.css.js +5 -0
  167. package/dist/utils/genericUtil.js +7 -8
  168. package/package.json +11 -4
  169. package/dist/extensions/Blocks/Recommendation/template.js +0 -200
  170. package/dist/src/extensions/Blocks/Recommendation/template.d.ts +0 -6
package/README.md CHANGED
@@ -82,10 +82,12 @@ export default {
82
82
  translationsPath: 'window.trans.en',
83
83
  htmlCompilerRules: [],
84
84
  ignoreDefaultHtmlCompilerRules: false,
85
+ backButtonLabel?: "Back to Design",
85
86
  features: {
86
87
  dynamicContent: true,
87
88
  saveAsTemplate: true,
88
- versionHistory: true
89
+ versionHistory: true,
90
+ testMessage: true
89
91
  }
90
92
  },
91
93
  dynamicContentModalVisible: false
@@ -194,6 +196,11 @@ interface GuidoConfig {
194
196
  dynamicContent: boolean;
195
197
  saveAsTemplate: boolean;
196
198
  versionHistory: boolean;
199
+ testMessage: boolean;
200
+ };
201
+ blocks?: {
202
+ excludeDefaults?: GuidoBlockType[];
203
+ includeCustoms?: GuidoCustomBlockType[];
197
204
  };
198
205
  }
199
206
  ```
@@ -208,6 +215,9 @@ interface GuidoConfig {
208
215
  | `features.dynamicContent` | `boolean` | `true` | Enable dynamic content insertion feature |
209
216
  | `features.saveAsTemplate` | `boolean` | `true` | Enable save as template feature |
210
217
  | `features.versionHistory` | `boolean` | `true` | Enable version history feature |
218
+ | `blocks` | `BlocksConfig` | `{ excludeDefaults: [], includeCustoms: [] }` | Block configuration for excluding default blocks and including custom blocks. See [Blocks Configuration](#-blocks-configuration) section below |
219
+ | `blocks.excludeDefaults` | `GuidoBlockType[]` | `[]` | Array of default Stripo blocks to exclude from the editor |
220
+ | `blocks.includeCustoms` | `GuidoCustomBlockType[]` | `[]` | Array of custom blocks to include in the editor |
211
221
 
212
222
  ```typescript
213
223
  interface DynamicContent {
@@ -224,6 +234,128 @@ interface DynamicContent {
224
234
  | `text` | `string` | '' | Visible value of the dynamic content |
225
235
  | `fallback?` | `string` | '' | Fallback value of the dynamic content. Optional |
226
236
 
237
+ ## 🧱 Blocks Configuration
238
+
239
+ Guido allows you to customize which blocks are available in the editor. You can exclude default Stripo blocks and selectively include custom blocks to create tailored editing experiences for different product types.
240
+
241
+ ### Block Types
242
+
243
+ #### Default Blocks (GuidoBlockType)
244
+
245
+ These are the standard Stripo email editor blocks that can be excluded:
246
+
247
+ ```typescript
248
+ type GuidoBlockType =
249
+ | 'amp-accordion' // AMP accordion component
250
+ | 'amp-carousel' // AMP image carousel
251
+ | 'amp-form-controls' // AMP form elements
252
+ | 'banner-block' // Banner/hero section
253
+ | 'button-block' // Call-to-action buttons
254
+ | 'html-block' // Custom HTML
255
+ | 'image-block' // Image elements
256
+ | 'menu-block' // Navigation menu
257
+ | 'social-block' // Social media links
258
+ | 'spacer-block' // Vertical spacing
259
+ | 'text-block' // Text content
260
+ | 'timer-block' // Countdown timer
261
+ | 'video-block' // Video embeds
262
+ ```
263
+
264
+ #### Custom Blocks (GuidoCustomBlockType)
265
+
266
+ These are custom blocks that can be selectively included:
267
+
268
+ ```typescript
269
+ type GuidoCustomBlockType =
270
+ | 'dynamic-content' // Dynamic content merge tags
271
+ | 'checkbox-block' // Checkbox form input
272
+ | 'radio-button-block' // Radio button form input
273
+ | 'recommendation-block' // Product recommendations
274
+ | 'unsubscribe-block' // Unsubscribe link
275
+ | 'coupon-block' // Coupon/promo code
276
+ | 'items-block' // Cart items display
277
+ ```
278
+
279
+ ### Configuration Examples
280
+
281
+ #### Example 1: Exclude Specific Default Blocks
282
+
283
+ Disable button, image, and video blocks while keeping all custom blocks:
284
+
285
+ ```typescript
286
+ const guidoConfig = {
287
+ translationsPath: 'window.trans.en',
288
+ features: {
289
+ dynamicContent: true,
290
+ saveAsTemplate: true,
291
+ versionHistory: true,
292
+ testMessage: true
293
+ },
294
+ blocks: {
295
+ excludeDefaults: ['button-block', 'image-block', 'video-block']
296
+ }
297
+ };
298
+ ```
299
+
300
+ **Result:**
301
+ - Button, Image, Video blocks disabled
302
+ - All other default blocks enabled
303
+ - All custom blocks are disabled.
304
+
305
+ #### Example 2: Include Only Specific Custom Blocks
306
+
307
+ Enable only coupon and recommendation blocks:
308
+
309
+ ```typescript
310
+ const guidoConfig = {
311
+ translationsPath: 'window.trans.en',
312
+ features: {
313
+ dynamicContent: true,
314
+ saveAsTemplate: true,
315
+ versionHistory: true,
316
+ testMessage: true
317
+ },
318
+ blocks: {
319
+ includeCustoms: ['coupon-block', 'recommendation-block']
320
+ }
321
+ };
322
+ ```
323
+
324
+ **Result:**
325
+ - All default blocks enabled
326
+ - Only Coupon and Recommendation extensions enabled.
327
+ - Other custom blocks are disabled
328
+
329
+ ### Default Behavior
330
+
331
+ When `blocks` is not provided or is `undefined`:
332
+
333
+ ```typescript
334
+ const guidoConfig = {
335
+ translationsPath: 'window.trans.en',
336
+ features: {
337
+ dynamicContent: true,
338
+ saveAsTemplate: true,
339
+ versionHistory: true,
340
+ testMessage: true
341
+ },
342
+ // No blocks config
343
+ };
344
+ ```
345
+
346
+ **Result:**
347
+ - All 13 default Stripo blocks enabled
348
+ - All custom blocks are disabled.
349
+
350
+ ### Block Configuration Interface
351
+
352
+ ```typescript
353
+ interface BlocksConfig {
354
+ excludeDefaults?: GuidoBlockType[];
355
+ includeCustoms?: GuidoCustomBlockType[];
356
+ }
357
+ ```
358
+
227
359
  ### TypeScript Types
228
360
 
229
361
  The library exports the following TypeScript types:
@@ -318,7 +450,8 @@ const guidoConfig = {
318
450
  features: {
319
451
  dynamicContent: true,
320
452
  saveAsTemplate: true,
321
- versionHistory: false // Disable version history
453
+ versionHistory: false, // Disable version history
454
+ testMessage: true
322
455
  },
323
456
  htmlCompilerRules: [
324
457
  {
@@ -351,7 +484,8 @@ const guidoConfig = {
351
484
  features: {
352
485
  dynamicContent: true,
353
486
  saveAsTemplate: true,
354
- versionHistory: true
487
+ versionHistory: true,
488
+ testMessage: true
355
489
  },
356
490
  ignoreDefaultHtmlCompilerRules: true, // Skip all default rules
357
491
  htmlCompilerRules: [
@@ -650,3 +784,35 @@ ISC License
650
784
  - Playwright integrationBoilerplate/control.ts
651
785
  - Commitlint & Precommit Hooks integration
652
786
  - Get Pre-built display conditions from API
787
+
788
+ Recommendation Block:
789
+ - [ ] Validations for Filters
790
+ - [ ] DOM Rerender after Filters change
791
+ - [ ] Change currencySymbol as Input Type
792
+ - [ ] Apply filter query to request
793
+ - [ ] Drawer loading bug
794
+ - [ ] Drawer send request when apply filters
795
+ - [ ] Clear all feature for Drawer
796
+ - [ ] Stripo's controls should be effect specific DOM item -- Try extending CommonControl class
797
+ - [ ] Show toaster message if uses multiple recommendation blocks in same template
798
+ - [ ] Change filter button text as Change Filters
799
+ - [ ] Migration template for Recommendation Block
800
+ - [ ] Recommendation Algorithm default value should be mostPopular
801
+ - [ ] Default fields for empty template like currency, title etc.
802
+ - [ ] Recommendation Block Icon Registry should be updated
803
+ - [ ] AMP Block Icon should be updated
804
+ - [ ] Padding feature for between Product Rows
805
+
806
+ Items Block Phase 2:
807
+ [ ] Writing configs to esd-config-data DOM.
808
+ [ ] Build on save feature should be working
809
+ [ ] Data Migration feature should be working
810
+
811
+ Tech Debts:
812
+ [ ] Merge Custom Blocks into a single File
813
+ [ ] Move Custom Blocks names to an enum file
814
+ [ ] Template Replacement should be optimized for version history
815
+ [ ] Code Optimization for Items Block inner blocks reordering
816
+ [ ] Image Size & Margins controls has an error on console
817
+ [ ] Feed Text Trimming feature to toggle settings
818
+ [ ] Formatted Price feature to toggle settings
@@ -10,7 +10,7 @@ var n = function() {
10
10
  a,
11
11
  !1,
12
12
  null,
13
- "2c168944"
13
+ "0502bceb"
14
14
  );
15
15
  const p = i.exports;
16
16
  export {
@@ -1,28 +1,29 @@
1
- import { defineComponent as s, computed as c } from "vue";
2
- import { useBack as m } from "../../../composables/useGuidoActions.js";
3
- import { usePreviewMode as a } from "../../../composables/usePreviewMode.js";
1
+ import { defineComponent as c, computed as a } from "vue";
2
+ import { useConfig as m } from "../../../composables/useConfig.js";
3
+ import { useBack as u } from "../../../composables/useGuidoActions.js";
4
+ import { usePreviewMode as f } from "../../../composables/usePreviewMode.js";
4
5
  import { useTranslations as p } from "../../../composables/useTranslations.js";
5
- import { useVersionHistoryApi as u } from "../../../composables/useVersionHistoryApi.js";
6
- import { useEditorStore as d } from "../../../stores/editor.js";
7
- import { InButtonV2 as f } from "@useinsider/design-system-vue";
8
- import l from "./version-history/RestoreButton.vue.js";
9
- const O = /* @__PURE__ */ s({
6
+ import { useVersionHistoryApi as d } from "../../../composables/useVersionHistoryApi.js";
7
+ import { useEditorStore as l } from "../../../stores/editor.js";
8
+ import { InButtonV2 as k } from "@useinsider/design-system-vue";
9
+ import B from "./version-history/RestoreButton.vue.js";
10
+ const P = /* @__PURE__ */ c({
10
11
  __name: "LeftSlot",
11
- setup(k) {
12
- const o = d(), r = m(), { closeVersionHistory: t } = u(), { closePreviewMode: i } = a(), e = p(), n = c(() => o.isVersionHistoryOpen || o.isPreviewModeOpen ? e("email-editor.back-to-editor") : e("email-editor.back-to-design"));
13
- return { __sfc: !0, editorStore: o, handleBack: r, closeVersionHistory: t, closePreviewMode: i, trans: e, backButtonLabel: n, handleBackClick: () => {
12
+ setup(b) {
13
+ const o = l(), r = u(), { closeVersionHistory: i } = d(), { closePreviewMode: n } = f(), e = p(), { config: t } = m(), s = a(() => o.isVersionHistoryOpen || o.isPreviewModeOpen ? e("email-editor.back-to-editor") : t.backButtonLabel ? t.backButtonLabel : e("email-editor.back-to-design"));
14
+ return { __sfc: !0, editorStore: o, handleBack: r, closeVersionHistory: i, closePreviewMode: n, trans: e, config: t, backButtonLabel: s, handleBackClick: () => {
14
15
  if (o.isVersionHistoryOpen) {
15
- t();
16
+ i();
16
17
  return;
17
18
  }
18
19
  if (o.isPreviewModeOpen) {
19
- i();
20
+ n();
20
21
  return;
21
22
  }
22
23
  r();
23
- }, InButtonV2: f, RestoreButton: l };
24
+ }, InButtonV2: k, RestoreButton: B };
24
25
  }
25
26
  });
26
27
  export {
27
- O as default
28
+ P as default
28
29
  };
@@ -1,20 +1,20 @@
1
- import n from "./RightSlot.vue2.js";
2
- import a from "../../../_virtual/_plugin-vue2_normalizer.js";
3
- var l = function() {
4
- var s, i;
5
- var o = this, e = o._self._c, t = o._self._setupProxy;
6
- return e("div", { staticClass: "d-f" }, [(s = t.config.features) != null && s.versionHistory ? e(t.InButtonV2, { attrs: { id: "guido__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryButtonDisabled, "label-text-status": !1, "selected-status": t.editorStore.isVersionHistoryOpen, "tooltip-options": t.getTooltipOptions("guido__history-button"), "tooltip-text": t.versionHistoryTooltipText }, on: { click: t.handleVersionHistory } }) : o._e(), e(t.InButtonV2, { attrs: { id: "guido__export-button", "left-icon": "line-export", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isExportButtonDisabled, "label-text-status": !1, "loading-status": t.isExporting, "tooltip-options": t.getTooltipOptions("guido__export-button"), "tooltip-text": t.trans("newsletter.export") }, on: { click: t.handleExport } }), (i = t.config.features) != null && i.saveAsTemplate ? e(t.InButtonV2, { attrs: { id: "guido__save-as-button", "left-icon": "line-newsletter-save-as-template", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isSaveAsButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__save-as-button"), "tooltip-text": t.trans("newsletter.save-templates") }, on: { click: t.handleSaveAs } }) : o._e(), e(t.InButtonV2, { attrs: { id: "guido__test-button", "left-icon": "line-architect-test-journey", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isTestButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__test-button"), "tooltip-text": t.trans("newsletter.test-email") } }), e(t.InButtonV2, { staticClass: "ml-3", attrs: { id: "guido__save-button", "label-text": "Save", "disabled-status": !t.isSaving && t.editorStore.isSaveButtonDisabled, "loading-status": t.isSaving }, on: { click: function(p) {
1
+ import a from "./RightSlot.vue2.js";
2
+ import l from "../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var r = function() {
4
+ var o, i, n;
5
+ var s = this, e = s._self._c, t = s._self._setupProxy;
6
+ return e("div", { staticClass: "d-f" }, [(o = t.config.features) != null && o.versionHistory ? e(t.InButtonV2, { attrs: { id: "guido__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryButtonDisabled, "label-text-status": !1, "selected-status": t.editorStore.isVersionHistoryOpen, "tooltip-options": t.getTooltipOptions("guido__history-button"), "tooltip-text": t.versionHistoryTooltipText }, on: { click: t.handleVersionHistory } }) : s._e(), e(t.InButtonV2, { attrs: { id: "guido__export-button", "left-icon": "line-export", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isExportButtonDisabled, "label-text-status": !1, "loading-status": t.isExporting, "tooltip-options": t.getTooltipOptions("guido__export-button"), "tooltip-text": t.trans("newsletter.export") }, on: { click: t.handleExport } }), (i = t.config.features) != null && i.saveAsTemplate ? e(t.InButtonV2, { attrs: { id: "guido__save-as-button", "left-icon": "line-newsletter-save-as-template", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isSaveAsButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__save-as-button"), "tooltip-text": t.trans("newsletter.save-templates") }, on: { click: t.handleSaveAs } }) : s._e(), (n = t.config.features) != null && n.testMessage ? e(t.InButtonV2, { attrs: { id: "guido__test-button", "left-icon": "line-architect-test-journey", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isTestButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__test-button"), "tooltip-text": t.trans("newsletter.test-email") } }) : s._e(), e(t.InButtonV2, { staticClass: "ml-3", attrs: { id: "guido__save-button", "label-text": "Save", "disabled-status": !t.isSaving && t.editorStore.isSaveButtonDisabled, "loading-status": t.isSaving }, on: { click: function(_) {
7
7
  return t.handleSave(!1);
8
8
  } } })], 1);
9
- }, r = [], d = /* @__PURE__ */ a(
10
- n,
11
- l,
9
+ }, u = [], d = /* @__PURE__ */ l(
10
+ a,
12
11
  r,
12
+ u,
13
13
  !1,
14
14
  null,
15
15
  null
16
16
  );
17
- const g = d.exports;
17
+ const f = d.exports;
18
18
  export {
19
- g as default
19
+ f as default
20
20
  };
@@ -0,0 +1,48 @@
1
+ const l = {
2
+ "amp-accordion": "ampAccordionEnabled",
3
+ "amp-carousel": "ampCarouselEnabled",
4
+ "amp-form-controls": "ampFormControlsEnabled",
5
+ "banner-block": "bannerEnabled",
6
+ "button-block": "buttonEnabled",
7
+ "html-block": "htmlEnabled",
8
+ "image-block": "imageEnabled",
9
+ "menu-block": "menuEnabled",
10
+ "social-block": "socialNetEnabled",
11
+ "spacer-block": "spacerEnabled",
12
+ "text-block": "textEnabled",
13
+ "timer-block": "timerEnabled",
14
+ "video-block": "videoEnabled"
15
+ }, c = {
16
+ "dynamic-content": () => import("../extensions/DynamicContent/extension.js"),
17
+ "checkbox-block": () => import("../extensions/Blocks/Checkbox/extension.js"),
18
+ "radio-button-block": () => import("../extensions/Blocks/RadioButton/extension.js"),
19
+ "recommendation-block": () => import("../extensions/Blocks/Recommendation/extension.js"),
20
+ "unsubscribe-block": () => import("../extensions/Blocks/Unsubscribe/extension.js"),
21
+ "coupon-block": () => import("../extensions/Blocks/CouponBlock/extension.js"),
22
+ "items-block": () => import("../extensions/Blocks/Items/extension.js")
23
+ }, a = (n) => {
24
+ if (!n || !n.length)
25
+ return {};
26
+ const o = {};
27
+ return n.forEach((e) => {
28
+ const t = l[e];
29
+ t && (o[t] = !1);
30
+ }), o;
31
+ }, r = async (n) => !n || !n.length ? [] : (await Promise.all(
32
+ n.map(async (e) => {
33
+ const t = c[e];
34
+ return t ? (await t()).default : null;
35
+ })
36
+ )).filter((e) => e !== null), s = () => ({
37
+ getStripoBlocksConfig: async () => {
38
+ var e;
39
+ const o = (e = window.GuidoConfig) == null ? void 0 : e.blocks;
40
+ return {
41
+ baseBlocks: a(o == null ? void 0 : o.excludeDefaults),
42
+ extensions: await r(o == null ? void 0 : o.includeCustoms)
43
+ };
44
+ }
45
+ });
46
+ export {
47
+ s as useBlocksConfig
48
+ };
@@ -1,29 +1,24 @@
1
- import { useActionsApi as f } from "./useActionsApi.js";
2
- import { useCustomInterfaceAppearance as E } from "./useCustomInterfaceAppearance.js";
3
- import { useStripoEventHandler as S } from "./useStripoEventHandler.js";
4
- import { useToaster as C } from "./useToaster.js";
5
- import { displayConditions as y } from "../enums/displayConditions.js";
6
- import h from "../extensions/Blocks/Checkbox/extension.js";
7
- import w from "../extensions/Blocks/CouponBlock/extension.js";
8
- import b from "../extensions/Blocks/RadioButton/extension.js";
9
- import V from "../extensions/Blocks/Recommendation/extension.js";
10
- import _ from "../extensions/Blocks/Unsubscribe/extension.js";
11
- import k from "../extensions/DynamicContent/extension.js";
12
- import { useStripoApi as B } from "../services/stripoApi.js";
13
- import x from "../static/styles/customEditorStyle.css.js";
14
- import { useEditorStore as F } from "../stores/editor.js";
1
+ import { useActionsApi as E } from "./useActionsApi.js";
2
+ import { useBlocksConfig as y } from "./useBlocksConfig.js";
3
+ import { useCustomInterfaceAppearance as w } from "./useCustomInterfaceAppearance.js";
4
+ import { useStripoEventHandler as h } from "./useStripoEventHandler.js";
5
+ import { useToaster as b } from "./useToaster.js";
6
+ import { displayConditions as k } from "../enums/displayConditions.js";
7
+ import { useStripoApi as V } from "../services/stripoApi.js";
8
+ import _ from "../static/styles/customEditorStyle.css.js";
9
+ import { useEditorStore as B } from "../stores/editor.js";
15
10
  import { dynamicContentToMergeTags as A } from "../utils/genericUtil.js";
16
- import T from "../package.json.js";
17
- const G = (a) => {
18
- const { handleError: d } = C(), { getToken: u, getCustomFonts: m } = B(), { handleEvent: p } = S(), l = (r, i = []) => {
19
- const t = F(), { html: n, css: c, forceRecreate: s } = r;
11
+ import F from "../package.json.js";
12
+ const L = (d) => {
13
+ const { handleError: u } = b(), { getToken: p, getCustomFonts: m } = V(), { handleEvent: g } = h(), { getStripoBlocksConfig: f } = y(), S = async (r, i = []) => {
14
+ const t = B(), { html: n, css: l, forceRecreate: a } = r, { baseBlocks: e, extensions: c } = await f();
20
15
  window.UIEditor.initEditor(
21
16
  document.querySelector("#guido-editor"),
22
17
  {
23
- metadata: a,
18
+ metadata: d,
24
19
  html: n,
25
- css: c,
26
- forceRecreate: s,
20
+ css: l,
21
+ forceRecreate: a,
27
22
  locale: "en",
28
23
  undoButtonSelector: "#guido__undo-button",
29
24
  redoButtonSelector: "#guido__redo-button",
@@ -33,13 +28,14 @@ const G = (a) => {
33
28
  customAppearanceMergetags: !0,
34
29
  customAppearanceMergetagsBorderColor: "#f1f3fe",
35
30
  customAppearanceMergetagsBackgroundColor: "#f1f3fe",
36
- customViewStyles: x,
31
+ customViewStyles: _,
37
32
  conditionsEnabled: !0,
38
33
  customConditionsEnabled: !0,
39
- conditionCategories: y,
34
+ conditionCategories: k,
40
35
  enableXSSSecurity: !0,
41
36
  messageSettingsEnabled: !1,
42
- selectBlockAfterDropFromSettingsPanel: !0,
37
+ selectElementAfterDrop: !0,
38
+ ...e ? { baseBlocks: e } : {},
43
39
  editorFonts: {
44
40
  showDefaultStandardFonts: !0,
45
41
  showDefaultNotStandardFonts: !0,
@@ -47,25 +43,25 @@ const G = (a) => {
47
43
  },
48
44
  mergeTags: [
49
45
  {
50
- entries: A(a.preselectedDynamicContentList)
46
+ entries: A(d.preselectedDynamicContentList)
51
47
  }
52
48
  ],
53
49
  async onTokenRefreshRequest(o) {
54
50
  try {
55
- const e = await u();
56
- o(e);
57
- } catch (e) {
58
- d(e, "Failed to refresh token");
51
+ const s = await p();
52
+ o(s);
53
+ } catch (s) {
54
+ u(s, "Failed to refresh token");
59
55
  }
60
56
  },
61
57
  onTemplateLoaded() {
62
58
  try {
63
- const { importCss: o } = E(), { activateCustomViewStyles: e } = f();
64
- o(), e(), a.onReady(), t.isStripoInitialized = !0, t.loadingStatus = !1, setTimeout(() => {
59
+ const { importCss: o } = w(), { activateCustomViewStyles: s } = E();
60
+ o(), s(), d.onReady(), t.isStripoInitialized = !0, t.loadingStatus = !1, setTimeout(() => {
65
61
  t.hasChanges = !1;
66
62
  }, 1e3);
67
63
  } catch (o) {
68
- d(o, "Failed to load custom interface appearance");
64
+ u(o, "Failed to load custom interface appearance");
69
65
  }
70
66
  },
71
67
  onCodeEditorVisibilityChanged(o) {
@@ -80,42 +76,35 @@ const G = (a) => {
80
76
  onDataChanged() {
81
77
  t.hasChanges = !0;
82
78
  },
83
- onEvent: p,
79
+ onEvent: g,
84
80
  ignoreClickOutsideSelectors: [
85
81
  "#guido-dynamic-content-modal",
86
82
  ".in-on-board-wrapper",
87
83
  ".in-drawer__container"
88
84
  ],
89
- extensions: [
90
- k,
91
- h,
92
- b,
93
- V,
94
- _,
95
- w
96
- ]
85
+ extensions: c
97
86
  }
98
87
  );
99
- }, g = (r) => new Promise((i, t) => {
100
- var e;
88
+ }, C = (r) => new Promise((i, t) => {
89
+ var c;
101
90
  if (document.getElementById("UiEditorScript")) {
102
91
  r(), i();
103
92
  return;
104
93
  }
105
- const n = T.guido, s = `https://email-static.useinsider.com/guido/${(e = n == null ? void 0 : n.stripo) == null ? void 0 : e.version}/UIEditor.js`, o = document.createElement("script");
106
- o.id = "UiEditorScript", o.type = "module", o.src = s, o.onload = () => {
94
+ const n = F.guido, a = `https://email-static.useinsider.com/guido/${(c = n == null ? void 0 : n.stripo) == null ? void 0 : c.version}/UIEditor.js`, e = document.createElement("script");
95
+ e.id = "UiEditorScript", e.type = "module", e.src = a, e.onload = () => {
107
96
  r(), i();
108
- }, o.onerror = () => {
109
- t(new Error(`Failed to load Stripo UIEditor script from S3: ${s}`));
110
- }, document.body.appendChild(o);
97
+ }, e.onerror = () => {
98
+ t(new Error(`Failed to load Stripo UIEditor script from S3: ${a}`));
99
+ }, document.body.appendChild(e);
111
100
  });
112
101
  return { initPlugin: async (r) => {
113
- await g(async () => {
102
+ await C(async () => {
114
103
  const i = await m();
115
- l(r, i);
104
+ await S(r, i);
116
105
  });
117
106
  } };
118
107
  };
119
108
  export {
120
- G as useStripo
109
+ L as useStripo
121
110
  };
@@ -1,11 +1,12 @@
1
- import { migrateCheckbox as o } from "./checkboxMigrator.js";
2
- import { migrateCouponBlock as m } from "./couponBlockMigrator.js";
1
+ import { migrateCheckbox as m } from "./checkboxMigrator.js";
2
+ import { migrateCouponBlock as o } from "./couponBlockMigrator.js";
3
3
  import { migrateRadioButton as i } from "./radioButtonMigrator.js";
4
- import { migrateUnsubscribe as e } from "./unsubscribeMigrator.js";
5
- const c = async (t) => {
4
+ import { migrateRecommendation as e } from "./recommendationMigrator.js";
5
+ import { migrateUnsubscribe as a } from "./unsubscribeMigrator.js";
6
+ const s = async (t) => {
6
7
  let r = t;
7
- return r = o(r), r = i(r), r = await e(r), r = m(r), r;
8
+ return r = m(r), r = i(r), r = await a(r), r = o(r), r = e(r), r;
8
9
  };
9
10
  export {
10
- c as migrate
11
+ s as migrate
11
12
  };