@useinsider/guido 1.0.3-beta.d1ff593 → 1.0.3-beta.d6f4719

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 (68) hide show
  1. package/README.md +126 -0
  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 +5 -5
  5. package/dist/components/organisms/header/RightSlot.vue2.js +20 -19
  6. package/dist/composables/useBlocksConfig.js +58 -0
  7. package/dist/composables/usePartner.js +9 -5
  8. package/dist/composables/useStripo.js +39 -50
  9. package/dist/config/migrator/index.js +6 -7
  10. package/dist/enums/defaults.js +10 -5
  11. package/dist/extensions/Blocks/Recommendation/block.js +2 -5
  12. package/dist/extensions/Blocks/Recommendation/control.js +40 -68
  13. package/dist/extensions/Blocks/Recommendation/extension.js +6 -25
  14. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +18 -58
  15. package/dist/extensions/Blocks/Recommendation/template.js +151 -265
  16. package/dist/extensions/Blocks/common-control.js +43 -125
  17. package/dist/guido.css +1 -1
  18. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +104 -289
  19. package/dist/src/@types/generic.d.ts +7 -0
  20. package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
  21. package/dist/src/composables/useBlocksConfig.d.ts +11 -0
  22. package/dist/src/composables/usePartner.d.ts +1 -0
  23. package/dist/src/extensions/Blocks/Recommendation/block.d.ts +0 -1
  24. package/dist/src/extensions/Blocks/Recommendation/control.d.ts +0 -6
  25. package/dist/src/extensions/Blocks/Recommendation/template.d.ts +1 -38
  26. package/dist/src/extensions/Blocks/common-control.d.ts +0 -21
  27. package/dist/src/stores/config.d.ts +4 -0
  28. package/package.json +2 -2
  29. package/dist/config/migrator/recommendationMigrator.js +0 -203
  30. package/dist/extensions/Blocks/Recommendation/cardCompositionControl.js +0 -335
  31. package/dist/extensions/Blocks/Recommendation/controls/button/align.js +0 -12
  32. package/dist/extensions/Blocks/Recommendation/controls/button/border.js +0 -12
  33. package/dist/extensions/Blocks/Recommendation/controls/button/borderRadius.js +0 -12
  34. package/dist/extensions/Blocks/Recommendation/controls/button/color.js +0 -12
  35. package/dist/extensions/Blocks/Recommendation/controls/button/fitToContent.js +0 -12
  36. package/dist/extensions/Blocks/Recommendation/controls/button/fontFamily.js +0 -12
  37. package/dist/extensions/Blocks/Recommendation/controls/button/margins.js +0 -12
  38. package/dist/extensions/Blocks/Recommendation/controls/button/paddings.js +0 -12
  39. package/dist/extensions/Blocks/Recommendation/controls/button/text.js +0 -12
  40. package/dist/extensions/Blocks/Recommendation/controls/button/textSize.js +0 -12
  41. package/dist/extensions/Blocks/Recommendation/controls/button/textStyleAndFontColor.js +0 -12
  42. package/dist/extensions/Blocks/Recommendation/controls/name/align.js +0 -12
  43. package/dist/extensions/Blocks/Recommendation/controls/name/background.js +0 -12
  44. package/dist/extensions/Blocks/Recommendation/controls/name/color.js +0 -12
  45. package/dist/extensions/Blocks/Recommendation/controls/name/fontFamily.js +0 -12
  46. package/dist/extensions/Blocks/Recommendation/controls/name/paddings.js +0 -12
  47. package/dist/extensions/Blocks/Recommendation/controls/name/size.js +0 -12
  48. package/dist/extensions/Blocks/Recommendation/controls/name/style.js +0 -12
  49. package/dist/src/config/migrator/recommendationMigrator.d.ts +0 -1
  50. package/dist/src/extensions/Blocks/Recommendation/cardCompositionControl.d.ts +0 -65
  51. package/dist/src/extensions/Blocks/Recommendation/controls/button/align.d.ts +0 -5
  52. package/dist/src/extensions/Blocks/Recommendation/controls/button/border.d.ts +0 -5
  53. package/dist/src/extensions/Blocks/Recommendation/controls/button/borderRadius.d.ts +0 -5
  54. package/dist/src/extensions/Blocks/Recommendation/controls/button/color.d.ts +0 -5
  55. package/dist/src/extensions/Blocks/Recommendation/controls/button/fitToContent.d.ts +0 -5
  56. package/dist/src/extensions/Blocks/Recommendation/controls/button/fontFamily.d.ts +0 -5
  57. package/dist/src/extensions/Blocks/Recommendation/controls/button/margins.d.ts +0 -5
  58. package/dist/src/extensions/Blocks/Recommendation/controls/button/paddings.d.ts +0 -5
  59. package/dist/src/extensions/Blocks/Recommendation/controls/button/text.d.ts +0 -5
  60. package/dist/src/extensions/Blocks/Recommendation/controls/button/textSize.d.ts +0 -5
  61. package/dist/src/extensions/Blocks/Recommendation/controls/button/textStyleAndFontColor.d.ts +0 -5
  62. package/dist/src/extensions/Blocks/Recommendation/controls/name/align.d.ts +0 -5
  63. package/dist/src/extensions/Blocks/Recommendation/controls/name/background.d.ts +0 -5
  64. package/dist/src/extensions/Blocks/Recommendation/controls/name/color.d.ts +0 -5
  65. package/dist/src/extensions/Blocks/Recommendation/controls/name/fontFamily.d.ts +0 -5
  66. package/dist/src/extensions/Blocks/Recommendation/controls/name/paddings.d.ts +0 -5
  67. package/dist/src/extensions/Blocks/Recommendation/controls/name/size.d.ts +0 -5
  68. package/dist/src/extensions/Blocks/Recommendation/controls/name/style.d.ts +0 -5
package/README.md CHANGED
@@ -191,6 +191,10 @@ interface GuidoConfig {
191
191
  saveAsTemplate: boolean;
192
192
  versionHistory: boolean;
193
193
  };
194
+ blocks?: {
195
+ excludeDefaults?: GuidoBlockType[];
196
+ includeCustoms?: GuidoCustomBlockType[];
197
+ };
194
198
  }
195
199
  ```
196
200
 
@@ -204,6 +208,9 @@ interface GuidoConfig {
204
208
  | `features.dynamicContent` | `boolean` | `true` | Enable dynamic content insertion feature |
205
209
  | `features.saveAsTemplate` | `boolean` | `true` | Enable save as template feature |
206
210
  | `features.versionHistory` | `boolean` | `true` | Enable version history feature |
211
+ | `blocks` | `BlocksConfig` | `{ excludeDefaults: [], includeCustoms: [] }` | Block configuration for excluding default blocks and including custom blocks. See [Blocks Configuration](#-blocks-configuration) section below |
212
+ | `blocks.excludeDefaults` | `GuidoBlockType[]` | `[]` | Array of default Stripo blocks to exclude from the editor |
213
+ | `blocks.includeCustoms` | `GuidoCustomBlockType[]` | `[]` | Array of custom blocks to include in the editor |
207
214
 
208
215
  ```typescript
209
216
  interface DynamicContent {
@@ -220,6 +227,125 @@ interface DynamicContent {
220
227
  | `text` | `string` | '' | Visible value of the dynamic content |
221
228
  | `fallback?` | `string` | '' | Fallback value of the dynamic content. Optional |
222
229
 
230
+ ## 🧱 Blocks Configuration
231
+
232
+ 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.
233
+
234
+ ### Block Types
235
+
236
+ #### Default Blocks (GuidoBlockType)
237
+
238
+ These are the standard Stripo email editor blocks that can be excluded:
239
+
240
+ ```typescript
241
+ type GuidoBlockType =
242
+ | 'amp-accordion' // AMP accordion component
243
+ | 'amp-carousel' // AMP image carousel
244
+ | 'amp-form-controls' // AMP form elements
245
+ | 'banner-block' // Banner/hero section
246
+ | 'button-block' // Call-to-action buttons
247
+ | 'html-block' // Custom HTML
248
+ | 'image-block' // Image elements
249
+ | 'menu-block' // Navigation menu
250
+ | 'social-block' // Social media links
251
+ | 'spacer-block' // Vertical spacing
252
+ | 'text-block' // Text content
253
+ | 'timer-block' // Countdown timer
254
+ | 'video-block' // Video embeds
255
+ ```
256
+
257
+ #### Custom Blocks (GuidoCustomBlockType)
258
+
259
+ These are custom blocks that can be selectively included:
260
+
261
+ ```typescript
262
+ type GuidoCustomBlockType =
263
+ | 'dynamic-content' // Dynamic content merge tags
264
+ | 'checkbox-block' // Checkbox form input
265
+ | 'radio-button-block' // Radio button form input
266
+ | 'recommendation-block' // Product recommendations
267
+ | 'unsubscribe-block' // Unsubscribe link
268
+ | 'coupon-block' // Coupon/promo code
269
+ | 'items-block' // Cart items display
270
+ ```
271
+
272
+ ### Configuration Examples
273
+
274
+ #### Example 1: Exclude Specific Default Blocks
275
+
276
+ Disable button, image, and video blocks while keeping all custom blocks:
277
+
278
+ ```typescript
279
+ const guidoConfig = {
280
+ translationsPath: 'window.trans.en',
281
+ features: {
282
+ dynamicContent: true,
283
+ saveAsTemplate: true,
284
+ versionHistory: true
285
+ },
286
+ blocks: {
287
+ excludeDefaults: ['button-block', 'image-block', 'video-block']
288
+ }
289
+ };
290
+ ```
291
+
292
+ **Result:**
293
+ - Button, Image, Video blocks disabled
294
+ - All other default blocks enabled
295
+ - All custom blocks are disabled.
296
+
297
+ #### Example 2: Include Only Specific Custom Blocks
298
+
299
+ Enable only coupon and recommendation blocks:
300
+
301
+ ```typescript
302
+ const guidoConfig = {
303
+ translationsPath: 'window.trans.en',
304
+ features: {
305
+ dynamicContent: true,
306
+ saveAsTemplate: true,
307
+ versionHistory: true
308
+ },
309
+ blocks: {
310
+ includeCustoms: ['coupon-block', 'recommendation-block']
311
+ }
312
+ };
313
+ ```
314
+
315
+ **Result:**
316
+ - All default blocks enabled
317
+ - Only Coupon and Recommendation extensions enabled.
318
+ - Other custom blocks are disabled
319
+
320
+ ### Default Behavior
321
+
322
+ When `blocks` is not provided or is `undefined`:
323
+
324
+ ```typescript
325
+ const guidoConfig = {
326
+ translationsPath: 'window.trans.en',
327
+ features: {
328
+ dynamicContent: true,
329
+ saveAsTemplate: true,
330
+ versionHistory: true
331
+ }
332
+ // No blocks config
333
+ };
334
+ ```
335
+
336
+ **Result:**
337
+ - All 13 default Stripo blocks enabled
338
+ - All custom blocks are disabled.
339
+
340
+ ### Block Configuration Interface
341
+
342
+ ```typescript
343
+ interface BlocksConfig {
344
+ excludeDefaults?: GuidoBlockType[];
345
+ includeCustoms?: GuidoCustomBlockType[];
346
+ }
347
+ ```
348
+
223
349
  ### TypeScript Types
224
350
 
225
351
  The library exports the following TypeScript types:
@@ -10,7 +10,7 @@ var n = function() {
10
10
  a,
11
11
  !1,
12
12
  null,
13
- "2c168944"
13
+ "244e7935"
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";
1
+ import { defineComponent as c, computed as a } from "vue";
2
2
  import { useBack as m } from "../../../composables/useGuidoActions.js";
3
- import { usePreviewMode as a } from "../../../composables/usePreviewMode.js";
4
- 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({
3
+ import { usePartner as u } from "../../../composables/usePartner.js";
4
+ import { usePreviewMode as p } from "../../../composables/usePreviewMode.js";
5
+ import { useTranslations as f } from "../../../composables/useTranslations.js";
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 h = /* @__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: () => {
14
- if (o.isVersionHistoryOpen) {
12
+ setup(_) {
13
+ const e = l(), r = m(), { closeVersionHistory: t } = d(), { closePreviewMode: i } = p(), { isUnsubscribePages: s } = u(), o = f(), n = a(() => e.isVersionHistoryOpen || e.isPreviewModeOpen ? o("email-editor.back-to-editor") : s() ? o("email-editor.back-to-unsubscribe-pages") : o("email-editor.back-to-design"));
14
+ return { __sfc: !0, editorStore: e, handleBack: r, closeVersionHistory: t, closePreviewMode: i, isUnsubscribePages: s, trans: o, backButtonLabel: n, handleBackClick: () => {
15
+ if (e.isVersionHistoryOpen) {
15
16
  t();
16
17
  return;
17
18
  }
18
- if (o.isPreviewModeOpen) {
19
+ if (e.isPreviewModeOpen) {
19
20
  i();
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
+ h as default
28
29
  };
@@ -1,12 +1,12 @@
1
1
  import n from "./RightSlot.vue2.js";
2
2
  import a from "../../../_virtual/_plugin-vue2_normalizer.js";
3
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) {
4
+ var o, i;
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(), t.isUnsubscribePages() ? s._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) {
7
7
  return t.handleSave(!1);
8
8
  } } })], 1);
9
- }, r = [], d = /* @__PURE__ */ a(
9
+ }, r = [], u = /* @__PURE__ */ a(
10
10
  n,
11
11
  l,
12
12
  r,
@@ -14,7 +14,7 @@ var l = function() {
14
14
  null,
15
15
  null
16
16
  );
17
- const g = d.exports;
17
+ const g = u.exports;
18
18
  export {
19
19
  g as default
20
20
  };
@@ -1,35 +1,36 @@
1
- import { defineComponent as g, ref as l, computed as H } from "vue";
2
- import { useConfig as _ } from "../../../composables/useConfig.js";
3
- import { useExport as h } from "../../../composables/useExport.js";
4
- import { useSave as V } from "../../../composables/useSave.js";
5
- import { useTranslations as x } from "../../../composables/useTranslations.js";
6
- import { useVersionHistoryApi as w } from "../../../composables/useVersionHistoryApi.js";
7
- import { useEditorStore as T } from "../../../stores/editor.js";
8
- import { getTooltipOptions as E } from "../../../utils/tooltipUtils.js";
9
- import { InButtonV2 as O } from "@useinsider/design-system-vue";
10
- const z = /* @__PURE__ */ g({
1
+ import { defineComponent as H, ref as l, computed as _ } from "vue";
2
+ import { useConfig as h } from "../../../composables/useConfig.js";
3
+ import { useExport as V } from "../../../composables/useExport.js";
4
+ import { usePartner as x } from "../../../composables/usePartner.js";
5
+ import { useSave as w } from "../../../composables/useSave.js";
6
+ import { useTranslations as T } from "../../../composables/useTranslations.js";
7
+ import { useVersionHistoryApi as E } from "../../../composables/useVersionHistoryApi.js";
8
+ import { useEditorStore as O } from "../../../stores/editor.js";
9
+ import { getTooltipOptions as A } from "../../../utils/tooltipUtils.js";
10
+ import { InButtonV2 as b } from "@useinsider/design-system-vue";
11
+ const F = /* @__PURE__ */ H({
11
12
  __name: "RightSlot",
12
- setup(A, { expose: m }) {
13
- const { config: u } = _(), { exportHtml: r } = h(), { save: n } = V(), { openVersionHistory: i, closeVersionHistory: a } = w(), o = T(), t = x(), e = l(!1), s = l(!1), c = () => {
13
+ setup(C, { expose: m }) {
14
+ const { config: u } = h(), { exportHtml: r } = V(), { save: n } = w(), { openVersionHistory: i, closeVersionHistory: a } = E(), { isUnsubscribePages: c } = x(), o = O(), t = T(), e = l(!1), s = l(!1), f = () => {
14
15
  if (o.isVersionHistoryOpen) {
15
16
  a();
16
17
  return;
17
18
  }
18
19
  i();
19
- }, f = async () => {
20
+ }, v = async () => {
20
21
  e.value = !0, await r(), e.value = !1;
21
- }, v = () => {
22
+ }, d = () => {
22
23
  o.isSaveAsTemplateDrawerOpen = !0;
23
- }, d = H(() => o.isVersionHistoryOpen ? t("newsletter.close-version-history") : t("newsletter.version-history")), p = async (y) => {
24
+ }, y = _(() => o.isVersionHistoryOpen ? t("newsletter.close-version-history") : t("newsletter.version-history")), p = async (S) => {
24
25
  s.value = !0, o.loadingStatus = !0;
25
- const S = await n(y);
26
- return s.value = !1, o.loadingStatus = !1, S;
26
+ const g = await n(S);
27
+ return s.value = !1, o.loadingStatus = !1, g;
27
28
  };
28
29
  return m({
29
30
  handleSave: p
30
- }), { __sfc: !0, config: u, exportHtml: r, save: n, openVersionHistory: i, closeVersionHistory: a, editorStore: o, trans: t, isExporting: e, isSaving: s, handleVersionHistory: c, handleExport: f, handleSaveAs: v, versionHistoryTooltipText: d, handleSave: p, getTooltipOptions: E, InButtonV2: O };
31
+ }), { __sfc: !0, config: u, exportHtml: r, save: n, openVersionHistory: i, closeVersionHistory: a, isUnsubscribePages: c, editorStore: o, trans: t, isExporting: e, isSaving: s, handleVersionHistory: f, handleExport: v, handleSaveAs: d, versionHistoryTooltipText: y, handleSave: p, getTooltipOptions: A, InButtonV2: b };
31
32
  }
32
33
  });
33
34
  export {
34
- z as default
35
+ F as default
35
36
  };
@@ -0,0 +1,58 @@
1
+ import c from "../extensions/Blocks/Checkbox/extension.js";
2
+ import r from "../extensions/Blocks/CouponBlock/extension.js";
3
+ import i from "../extensions/Blocks/RadioButton/extension.js";
4
+ import l from "../extensions/Blocks/Recommendation/extension.js";
5
+ import s from "../extensions/Blocks/Unsubscribe/extension.js";
6
+ import b from "../extensions/DynamicContent/extension.js";
7
+ const a = {
8
+ "amp-accordion": "ampAccordionEnabled",
9
+ "amp-carousel": "ampCarouselEnabled",
10
+ "amp-form-controls": "ampFormControlsEnabled",
11
+ "banner-block": "bannerEnabled",
12
+ "button-block": "buttonEnabled",
13
+ "html-block": "htmlEnabled",
14
+ "image-block": "imageEnabled",
15
+ "menu-block": "menuEnabled",
16
+ "social-block": "socialNetEnabled",
17
+ "spacer-block": "spacerEnabled",
18
+ "text-block": "textEnabled",
19
+ "timer-block": "timerEnabled",
20
+ "video-block": "videoEnabled"
21
+ }, m = {
22
+ "dynamic-content": b,
23
+ "checkbox-block": c,
24
+ "radio-button-block": i,
25
+ "recommendation-block": l,
26
+ "unsubscribe-block": s,
27
+ "coupon-block": r,
28
+ "items-block": null
29
+ // TODO: Add ItemsBlock extension when available
30
+ }, E = (n) => {
31
+ if (!n || !n.length)
32
+ return {};
33
+ const o = {};
34
+ return n.forEach((e) => {
35
+ const t = a[e];
36
+ t && (o[t] = !1);
37
+ }), o;
38
+ }, d = (n) => {
39
+ if (!n || !n.length)
40
+ return [];
41
+ const o = [];
42
+ return n.forEach((e) => {
43
+ const t = m[e];
44
+ t && o.push(t);
45
+ }), o;
46
+ }, C = () => ({
47
+ getStripoBlocksConfig: () => {
48
+ var e;
49
+ const o = (e = window.GuidoConfig) == null ? void 0 : e.blocks;
50
+ return {
51
+ baseBlocks: E(o == null ? void 0 : o.excludeDefaults),
52
+ extensions: d(o == null ? void 0 : o.includeCustoms)
53
+ };
54
+ }
55
+ });
56
+ export {
57
+ C as useBlocksConfig
58
+ };
@@ -1,18 +1,22 @@
1
- import { TEST_PARTNER_LIST as r, DefaultProductType as o, ProductIds as n } from "../enums/defaults.js";
2
- const i = () => {
1
+ import { ProductIds as n, TEST_PARTNER_LIST as o, DefaultProductType as s } from "../enums/defaults.js";
2
+ const p = () => {
3
3
  const e = () => window.location.hostname.split(".")[0] || "";
4
4
  return {
5
5
  getPartnerName: e,
6
6
  getProductType: () => {
7
- const t = window.location.pathname.split("/").filter(Boolean)[0] || o;
7
+ const t = window.location.pathname.split("/").filter(Boolean)[0] || s;
8
8
  return n[t] || 0;
9
9
  },
10
10
  isTestPartner: () => {
11
11
  const t = e();
12
- return r.includes(t);
12
+ return o.includes(t);
13
+ },
14
+ isUnsubscribePages: () => {
15
+ var t, r;
16
+ return ((r = (t = window.GuidoConfig) == null ? void 0 : t.partner) == null ? void 0 : r.productType) === n.unsubscribePages;
13
17
  }
14
18
  };
15
19
  };
16
20
  export {
17
- i as usePartner
21
+ p as usePartner
18
22
  };
@@ -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";
1
+ import { useActionsApi as E } from "./useActionsApi.js";
2
+ import { useBlocksConfig as y } from "./useBlocksConfig.js";
3
+ import { useCustomInterfaceAppearance as h } from "./useCustomInterfaceAppearance.js";
4
+ import { useStripoEventHandler as w } from "./useStripoEventHandler.js";
5
+ import { useToaster as b } from "./useToaster.js";
6
+ import { displayConditions as k } from "../enums/displayConditions.js";
12
7
  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";
15
- 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;
8
+ import V from "../static/styles/customEditorStyle.css.js";
9
+ import { useEditorStore as _ } from "../stores/editor.js";
10
+ import { dynamicContentToMergeTags as F } from "../utils/genericUtil.js";
11
+ import A from "../package.json.js";
12
+ const L = (d) => {
13
+ const { handleError: u } = b(), { getToken: p, getCustomFonts: m } = B(), { handleEvent: g } = w(), { getStripoBlocksConfig: f } = y(), S = (r, i = []) => {
14
+ const t = _(), { html: n, css: l, forceRecreate: a } = r, { baseBlocks: e, extensions: c } = 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: V,
37
32
  conditionsEnabled: !0,
38
33
  customConditionsEnabled: !0,
39
- conditionCategories: y,
34
+ conditionCategories: k,
40
35
  enableXSSSecurity: !0,
41
36
  messageSettingsEnabled: !1,
42
37
  selectBlockAfterDropFromSettingsPanel: !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: F(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 } = h(), { 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 = A.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
+ S(r, i);
116
105
  });
117
106
  } };
118
107
  };
119
108
  export {
120
- G as useStripo
109
+ L as useStripo
121
110
  };
@@ -1,12 +1,11 @@
1
- import { migrateCheckbox as m } from "./checkboxMigrator.js";
2
- import { migrateCouponBlock as o } from "./couponBlockMigrator.js";
1
+ import { migrateCheckbox as o } from "./checkboxMigrator.js";
2
+ import { migrateCouponBlock as m } from "./couponBlockMigrator.js";
3
3
  import { migrateRadioButton as i } from "./radioButtonMigrator.js";
4
- import { migrateRecommendation as e } from "./recommendationMigrator.js";
5
- import { migrateUnsubscribe as a } from "./unsubscribeMigrator.js";
6
- const s = async (t) => {
4
+ import { migrateUnsubscribe as e } from "./unsubscribeMigrator.js";
5
+ const c = async (t) => {
7
6
  let r = t;
8
- return r = m(r), r = i(r), r = await a(r), r = o(r), r = e(r), r;
7
+ return r = o(r), r = i(r), r = await e(r), r = m(r), r;
9
8
  };
10
9
  export {
11
- s as migrate
10
+ c as migrate
12
11
  };
@@ -1,4 +1,4 @@
1
- const a = {
1
+ const e = {
2
2
  translationsPath: "window.trans.en",
3
3
  emailHeader: {
4
4
  senderName: "",
@@ -7,6 +7,10 @@ const a = {
7
7
  extensions: {
8
8
  unsubscribe: !0
9
9
  },
10
+ blocks: {
11
+ excludeDefaults: [],
12
+ includeCustoms: []
13
+ },
10
14
  features: {
11
15
  dynamicContent: !0,
12
16
  saveAsTemplate: !0,
@@ -16,9 +20,10 @@ const a = {
16
20
  }, t = {
17
21
  promotional: 1,
18
22
  transactional: 2
19
- }, e = "email", o = "Guido User", n = t.promotional, s = 2, i = {
23
+ }, a = "email", o = "Guido User", n = t.promotional, s = 2, i = {
20
24
  email: 60,
21
- architect: 49
25
+ architect: 49,
26
+ unsubscribePages: 97
22
27
  }, u = [
23
28
  "alfredtesting",
24
29
  "electio",
@@ -52,9 +57,9 @@ const a = {
52
57
  "stripoeditorlivetest"
53
58
  ];
54
59
  export {
55
- a as DefaultGuidoConfig,
60
+ e as DefaultGuidoConfig,
56
61
  n as DefaultMessageType,
57
- e as DefaultProductType,
62
+ a as DefaultProductType,
58
63
  o as DefaultUsername,
59
64
  s as EditorType,
60
65
  i as ProductIds,
@@ -1,10 +1,7 @@
1
1
  import { Block as e, BlockCompositionType as t } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
2
  import { getDefaultTemplate as o } from "./template.js";
3
3
  const n = "recommendation-block";
4
- class m extends e {
5
- constructor() {
6
- super();
7
- }
4
+ class c extends e {
8
5
  getId() {
9
6
  return n;
10
7
  }
@@ -26,5 +23,5 @@ class m extends e {
26
23
  }
27
24
  export {
28
25
  n as BLOCK_ID,
29
- m as RecommendationBlock
26
+ c as RecommendationBlock
30
27
  };