@useinsider/guido 2.0.0-beta.2004fb6 → 2.0.0-beta.25fe7cd

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 (70) hide show
  1. package/README.md +2 -0
  2. package/dist/@types/config/schemas.js +57 -39
  3. package/dist/components/Guido.vue.js +1 -1
  4. package/dist/components/Guido.vue2.js +15 -17
  5. package/dist/components/organisms/email-preview/PreviewContainer.vue.js +3 -3
  6. package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue.js +8 -8
  7. package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue2.js +17 -13
  8. package/dist/components/organisms/email-preview/amp/AmpToggle.vue.js +7 -8
  9. package/dist/components/organisms/email-preview/amp/AmpToggle.vue2.js +14 -12
  10. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +10 -14
  11. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +18 -22
  12. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +3 -3
  13. package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +11 -10
  14. package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue.js +12 -10
  15. package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue.js +11 -10
  16. package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue2.js +15 -14
  17. package/dist/components/organisms/header/HeaderWrapper.vue.js +5 -5
  18. package/dist/components/organisms/header/LeftSlot.vue.js +11 -11
  19. package/dist/components/organisms/header/LeftSlot.vue2.js +11 -12
  20. package/dist/components/organisms/header/MiddleSlot.vue.js +5 -4
  21. package/dist/components/organisms/header/MiddleSlot.vue2.js +14 -13
  22. package/dist/components/organisms/header/RightSlot.vue.js +12 -12
  23. package/dist/components/organisms/header/RightSlot.vue2.js +27 -21
  24. package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +15 -15
  25. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +1 -1
  26. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +20 -19
  27. package/dist/composables/useConfig.js +29 -27
  28. package/dist/composables/useSave.js +13 -11
  29. package/dist/composables/useStripo.js +57 -56
  30. package/dist/enums/academy.js +8 -0
  31. package/dist/enums/onboarding.js +1 -2
  32. package/dist/enums/unsubscribe.js +20 -21
  33. package/dist/extensions/Blocks/CouponBlock/constants.js +4 -0
  34. package/dist/extensions/Blocks/CouponBlock/controls/index.js +29 -0
  35. package/dist/extensions/Blocks/CouponBlock/extension.js +5 -4
  36. package/dist/extensions/Blocks/CouponBlock/settingsPanel.js +20 -14
  37. package/dist/extensions/Blocks/CouponBlock/template.js +22 -11
  38. package/dist/extensions/Blocks/Unsubscribe/extension.js +9 -9
  39. package/dist/extensions/Blocks/common-control.js +6 -7
  40. package/dist/extensions/Blocks/controlFactories.js +122 -111
  41. package/dist/guido.css +1 -1
  42. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +57 -52
  43. package/dist/services/stripoApi.js +6 -10
  44. package/dist/src/@types/config/index.d.ts +2 -2
  45. package/dist/src/@types/config/schemas.d.ts +34 -0
  46. package/dist/src/@types/config/types.d.ts +7 -1
  47. package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -1
  48. package/dist/src/composables/useConfig.d.ts +10 -0
  49. package/dist/src/enums/academy.d.ts +12 -0
  50. package/dist/src/enums/onboarding.d.ts +0 -1
  51. package/dist/src/enums/unsubscribe.d.ts +0 -1
  52. package/dist/src/extensions/Blocks/CouponBlock/constants.d.ts +14 -0
  53. package/dist/src/extensions/Blocks/CouponBlock/controls/index.d.ts +108 -0
  54. package/dist/src/extensions/Blocks/CouponBlock/template.d.ts +1 -1
  55. package/dist/src/extensions/Blocks/common-control.d.ts +1 -1
  56. package/dist/src/extensions/Blocks/controlFactories.d.ts +30 -7
  57. package/dist/src/stores/config.d.ts +181 -1
  58. package/dist/static/assets/desktop/desktop-mockup-center.svg.js +4 -0
  59. package/dist/static/assets/desktop/desktop-mockup-left.svg.js +4 -0
  60. package/dist/static/assets/desktop/desktop-mockup-right.svg.js +4 -0
  61. package/dist/static/assets/mobile/email-mockup.svg.js +4 -0
  62. package/dist/static/assets/mobile/inbox-mockup.svg.js +4 -0
  63. package/dist/static/styles/components/button.css.js +1 -1
  64. package/dist/static/styles/components/narrow-panel.css.js +0 -10
  65. package/dist/stores/config.js +7 -0
  66. package/package.json +1 -1
  67. package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue.js +0 -17
  68. package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue2.js +0 -20
  69. package/dist/static/assets/inbox-mockup.svg.js +0 -4
  70. package/dist/static/assets/phone-mockup.svg.js +0 -4
@@ -1,15 +1,17 @@
1
- import { useSaveStart as i, useSaveComplete as m } from "./useGuidoActions.js";
2
- import { useTemplatePreparation as n } from "../utils/templatePreparation.js";
3
- import { useHtmlValidator as l } from "./useHtmlValidator.js";
4
- const f = () => {
5
- const e = i(), a = m(), { validateHtml: s } = l();
6
- return { save: async (o = !1) => {
7
- e();
8
- const { prepareTemplateDetails: r } = n(), t = await r();
9
- if (await s(t.compiledHtml, t.dynamicContentList, !0))
10
- return o || a(t), t;
1
+ import { useConfig as l } from "./useConfig.js";
2
+ import { useSaveStart as m, useSaveComplete as c } from "./useGuidoActions.js";
3
+ import { useTemplatePreparation as d } from "../utils/templatePreparation.js";
4
+ import { useHtmlValidator as p } from "./useHtmlValidator.js";
5
+ const w = () => {
6
+ const i = m(), s = c(), { validateHtml: o } = p(), { callbacks: a } = l();
7
+ return { save: async (r = !1) => {
8
+ var e;
9
+ i();
10
+ const { prepareTemplateDetails: n } = d(), t = await n();
11
+ if (await o(t.compiledHtml, t.dynamicContentList, !0) && !((e = a.value) != null && e.externalValidation && !await a.value.externalValidation(t)))
12
+ return r || s(t), t;
11
13
  } };
12
14
  };
13
15
  export {
14
- f as useSave
16
+ w as useSave
15
17
  };
@@ -1,26 +1,26 @@
1
- import { useActionsApi as b } from "./useActionsApi.js";
2
- import { useBlocksConfig as k } from "./useBlocksConfig.js";
3
- import { useConfig as T } from "./useConfig.js";
4
- import { useCustomInterfaceAppearance as V } from "./useCustomInterfaceAppearance.js";
5
- import { useStripoEventHandler as _ } from "./useStripoEventHandler.js";
6
- import { useToaster as B } from "./useToaster.js";
7
- import { displayConditions as A } from "../enums/displayConditions.js";
8
- import { useStripoApi as v } from "../services/stripoApi.js";
9
- import F from "../static/styles/customEditorStyle.css.js";
10
- import { useEditorStore as I } from "../stores/editor.js";
11
- import { dynamicContentToMergeTags as M } from "../utils/genericUtil.js";
12
- import U from "../package.json.js";
13
- const N = (c) => {
14
- const { features: g } = T(), { handleError: l } = B(), { getToken: f, getCustomFonts: y } = v(), { handleEvent: S } = _(), { getStripoBlocksConfig: C } = k(), E = async (i, r = []) => {
15
- var m;
16
- const e = I(), { html: n, css: u, forceRecreate: a } = i, { baseBlocks: t, extensions: d } = await C(), p = ((m = g.value) == null ? void 0 : m.displayConditions) ?? !0;
1
+ import { useActionsApi as _ } from "./useActionsApi.js";
2
+ import { useBlocksConfig as B } from "./useBlocksConfig.js";
3
+ import { useConfig as v } from "./useConfig.js";
4
+ import { useCustomInterfaceAppearance as A } from "./useCustomInterfaceAppearance.js";
5
+ import { useStripoEventHandler as F } from "./useStripoEventHandler.js";
6
+ import { useToaster as D } from "./useToaster.js";
7
+ import { displayConditions as I } from "../enums/displayConditions.js";
8
+ import { useStripoApi as M } from "../services/stripoApi.js";
9
+ import U from "../static/styles/customEditorStyle.css.js";
10
+ import { useEditorStore as P } from "../stores/editor.js";
11
+ import { dynamicContentToMergeTags as R } from "../utils/genericUtil.js";
12
+ import H from "../package.json.js";
13
+ const W = (c) => {
14
+ const { features: l, template: y } = v(), { handleError: u } = D(), { getToken: C, getCustomFonts: S } = M(), { handleEvent: E } = F(), { getStripoBlocksConfig: h } = B(), w = async (i, n = []) => {
15
+ var m, g, f;
16
+ const o = P(), { html: r, css: p } = i, { baseBlocks: s, extensions: t } = await h(), a = ((m = l.value) == null ? void 0 : m.displayConditions) ?? !0, k = ((g = l.value) == null ? void 0 : g.modulesDisabled) ?? !1, T = ((f = y.value) == null ? void 0 : f.forceRecreate) ?? !1;
17
17
  window.UIEditor.initEditor(
18
18
  document.querySelector("#guido-editor"),
19
19
  {
20
20
  metadata: c,
21
- html: n,
22
- css: u,
23
- forceRecreate: a,
21
+ html: r,
22
+ css: p,
23
+ forceRecreate: T,
24
24
  locale: "en",
25
25
  undoButtonSelector: "#guido__undo-button",
26
26
  redoButtonSelector: "#guido__redo-button",
@@ -30,87 +30,88 @@ const N = (c) => {
30
30
  customAppearanceMergetags: !0,
31
31
  customAppearanceMergetagsBorderColor: "#f1f3fe",
32
32
  customAppearanceMergetagsBackgroundColor: "#f1f3fe",
33
- customViewStyles: F,
34
- conditionsEnabled: p,
35
- customConditionsEnabled: p,
36
- conditionCategories: A,
33
+ customViewStyles: U,
34
+ conditionsEnabled: a,
35
+ customConditionsEnabled: a,
36
+ conditionCategories: I,
37
37
  enableXSSSecurity: !0,
38
+ modulesDisabled: k,
38
39
  messageSettingsEnabled: !0,
39
40
  displayGmailAnnotations: !0,
40
41
  displayHiddenPreheader: !1,
41
42
  displayTitle: !1,
42
43
  displayUTM: !1,
43
44
  selectElementAfterDrop: !0,
44
- ...t ? { baseBlocks: t } : {},
45
+ ...s ? { baseBlocks: s } : {},
45
46
  editorFonts: {
46
47
  showDefaultStandardFonts: !0,
47
48
  showDefaultNotStandardFonts: !0,
48
- customFonts: r
49
+ customFonts: n
49
50
  },
50
51
  mergeTags: [
51
52
  {
52
- entries: M(c.preselectedDynamicContentList)
53
+ entries: R(c.preselectedDynamicContentList)
53
54
  }
54
55
  ],
55
- async onTokenRefreshRequest(o) {
56
+ async onTokenRefreshRequest(e) {
56
57
  try {
57
- const s = await f();
58
- o(s);
59
- } catch (s) {
60
- l(s, "Failed to refresh token");
58
+ const d = await C();
59
+ e(d);
60
+ } catch (d) {
61
+ u(d, "Failed to refresh token");
61
62
  }
62
63
  },
63
64
  onTemplateLoaded() {
64
65
  try {
65
- const { importCss: o } = V(), { activateCustomViewStyles: s, updateTimerInClonedTemplate: w } = b();
66
- o(), s(), w(), c.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
67
- e.hasChanges = !1;
66
+ const { importCss: e } = A(), { activateCustomViewStyles: d, updateTimerInClonedTemplate: V } = _();
67
+ e(), d(), V(), c.onReady(), o.isStripoInitialized = !0, o.loadingStatus = !1, setTimeout(() => {
68
+ o.hasChanges = !1;
68
69
  }, 1e3);
69
- } catch (o) {
70
- l(o, "Failed to load custom interface appearance");
70
+ } catch (e) {
71
+ u(e, "Failed to load custom interface appearance");
71
72
  }
72
73
  },
73
- onCodeEditorVisibilityChanged(o) {
74
- e.isCodeEditorOpen = o;
74
+ onCodeEditorVisibilityChanged(e) {
75
+ o.isCodeEditorOpen = e;
75
76
  },
76
- onEditorVisualModeChanged(o) {
77
- e.editorVisualMode = o.toLowerCase();
77
+ onEditorVisualModeChanged(e) {
78
+ o.editorVisualMode = e.toLowerCase();
78
79
  },
79
- onVersionHistoryVisibilityChanged(o) {
80
- e.isVersionHistoryOpen = o;
80
+ onVersionHistoryVisibilityChanged(e) {
81
+ o.isVersionHistoryOpen = e;
81
82
  },
82
83
  onDataChanged() {
83
- e.hasChanges = !0;
84
+ o.hasChanges = !0;
84
85
  },
85
- onEvent: S,
86
+ onEvent: E,
86
87
  ignoreClickOutsideSelectors: [
87
88
  "#guido-dynamic-content-modal",
88
89
  ".in-on-board-wrapper",
89
90
  ".in-drawer__container"
90
91
  ],
91
- extensions: d
92
+ extensions: t
92
93
  }
93
94
  );
94
- }, h = (i) => new Promise((r, e) => {
95
- var d;
95
+ }, b = (i) => new Promise((n, o) => {
96
+ var a;
96
97
  if (document.getElementById("UiEditorScript")) {
97
- i(), r();
98
+ i(), n();
98
99
  return;
99
100
  }
100
- const n = U.guido, a = `https://email-static.useinsider.com/guido/${(d = n == null ? void 0 : n.stripo) == null ? void 0 : d.version}/UIEditor.js`, t = document.createElement("script");
101
- t.id = "UiEditorScript", t.type = "module", t.src = a, t.onload = () => {
102
- i(), r();
101
+ const r = H.guido, s = `https://email-static.useinsider.com/guido/${(a = r == null ? void 0 : r.stripo) == null ? void 0 : a.version}/UIEditor.js`, t = document.createElement("script");
102
+ t.id = "UiEditorScript", t.type = "module", t.src = s, t.onload = () => {
103
+ i(), n();
103
104
  }, t.onerror = () => {
104
- e(new Error(`Failed to load Stripo UIEditor script from S3: ${a}`));
105
+ o(new Error(`Failed to load Stripo UIEditor script from S3: ${s}`));
105
106
  }, document.body.appendChild(t);
106
107
  });
107
108
  return { initPlugin: async (i) => {
108
- await h(async () => {
109
- const r = await y();
110
- await E(i, r);
109
+ await b(async () => {
110
+ const n = await S();
111
+ await w(i, n);
111
112
  });
112
113
  } };
113
114
  };
114
115
  export {
115
- N as useStripo
116
+ W as useStripo
116
117
  };
@@ -0,0 +1,8 @@
1
+ const e = "https://academy.useinsider.com", o = {
2
+ EMAIL_EDITOR: `${e}/docs/email-drag-drop-editor`,
3
+ GLOBAL_UNSUBSCRIBE: `${e}/docs/global-unsubscribe-preference-center`,
4
+ AMP_FOR_EMAILS: `${e}/docs/amp-for-emails`
5
+ };
6
+ export {
7
+ o as ACADEMY_LINKS
8
+ };
@@ -2,9 +2,8 @@ const e = [
2
2
  ".service-element.stacked-panel-item.ng-tns-c1014751574-3.level-bottom-0.ng-star-inserted",
3
3
  ".service-element.stacked-panel-item.ng-tns-c1014751574-3.level-bottom-1.ng-star-inserted",
4
4
  ".service-element.stacked-panel-item.ng-tns-c1014751574-3.level-bottom-2.ng-star-inserted"
5
- ], t = "ui-editor", n = 'button[role="tab"][aria-label="Card Composition"]', s = 'button[role="tab"][aria-label="Settings"]', o = ".in-ribbons-wrapper", a = "https://academy.useinsider.com/docs/email-drag-drop-editor";
5
+ ], t = "ui-editor", n = 'button[role="tab"][aria-label="Card Composition"]', s = 'button[role="tab"][aria-label="Settings"]', o = ".in-ribbons-wrapper";
6
6
  export {
7
- a as ACADEMY_LINK,
8
7
  n as CARD_COMPOSITION_TAB_SELECTOR,
9
8
  o as RIBBON_SELECTOR,
10
9
  e as SERVICE_HOVER_SELECTORS,
@@ -1,26 +1,26 @@
1
- import { useTranslations as n } from "../composables/useTranslations.js";
1
+ import { useTranslations as e } from "../composables/useTranslations.js";
2
2
  import { getEnvironmentPrefix as R } from "../utils/environmentUtil.js";
3
- const N = {
3
+ const I = {
4
4
  UNSUBSCRIBE_LINK_TYPE: 1,
5
5
  PREFERENCES_LINK_TYPE: 3
6
- }, I = {
6
+ }, r = {
7
7
  UNSUBSCRIBE_LINK_REGEX: /{{ins-unsubscribe-link}}/g,
8
8
  DATA_OGSB_BUTTON_CSS_REGEX: "\\[data-ogsb\\]\\s*\\.es-button\\.es-button-[0-9]+\\s*\\{(?:[^\\}]*)\\}",
9
9
  GLOBAL_UNSUBSCRIBE_LINK_REGEX: /{{ins-global-unsubscribe-link}}/g,
10
10
  PREFERENCES_UNSUBSCRIBE_LINK_REGEX: /{{ins-preferences-unsubscribe-link}}/g
11
- }, s = R(), i = {
11
+ }, s = R(), _ = {
12
12
  UNSUBSCRIBE_URL: `https://mail.${s}.com/user/v1/unsub`,
13
13
  PREFERENCES_URL: `https://mail.${s}.com/user/v1/prefs`
14
- }, _ = "iid", B = {
14
+ }, i = "iid", B = {
15
15
  name: "Global Unsubscribe",
16
16
  sendGridId: "G"
17
- }, t = "https://academy.useinsider.com/docs/global-unsubscribe-preference-center", C = "/email/unsubscribe-pages", E = {
17
+ }, C = "/email/unsubscribe-pages", E = {
18
18
  GLOBAL_UNSUBSCRIBE: 1,
19
19
  GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE: 2,
20
20
  SUBSCRIPTION_PREFERENCE_CENTER: 3,
21
21
  SUBSCRIPTION_PREFERENCE_CONFIRMATION: 4,
22
22
  RESUBSCRIBE: 5
23
- }, c = {
23
+ }, t = {
24
24
  [E.GLOBAL_UNSUBSCRIBE]: [
25
25
  E.GLOBAL_UNSUBSCRIBE,
26
26
  E.GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE,
@@ -31,29 +31,28 @@ const N = {
31
31
  E.SUBSCRIPTION_PREFERENCE_CONFIRMATION
32
32
  ]
33
33
  }, U = () => {
34
- const e = n();
34
+ const n = e();
35
35
  return {
36
- [E.GLOBAL_UNSUBSCRIBE]: e("unsubscription-preference.type-global-unsubscribe"),
37
- [E.GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE]: e("unsubscription-preference.type-global-unsubscription-confirmation"),
38
- [E.RESUBSCRIBE]: e("unsubscription-preference.type-resubscribe"),
39
- [E.SUBSCRIPTION_PREFERENCE_CENTER]: e("unsubscription-preference.type-subscription-preferences-center"),
40
- [E.SUBSCRIPTION_PREFERENCE_CONFIRMATION]: e("unsubscription-preference.type-subscription-preferences-confirmation")
36
+ [E.GLOBAL_UNSUBSCRIBE]: n("unsubscription-preference.type-global-unsubscribe"),
37
+ [E.GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE]: n("unsubscription-preference.type-global-unsubscription-confirmation"),
38
+ [E.RESUBSCRIBE]: n("unsubscription-preference.type-resubscribe"),
39
+ [E.SUBSCRIPTION_PREFERENCE_CENTER]: n("unsubscription-preference.type-subscription-preferences-center"),
40
+ [E.SUBSCRIPTION_PREFERENCE_CONFIRMATION]: n("unsubscription-preference.type-subscription-preferences-confirmation")
41
41
  };
42
- }, o = {
42
+ }, c = {
43
43
  default: "{{ins-unsubscribe-link}}",
44
44
  [E.GLOBAL_UNSUBSCRIBE]: "{{ins-global-unsubscribe-link}}",
45
45
  [E.SUBSCRIPTION_PREFERENCE_CENTER]: "{{ins-preferences-unsubscribe-link}}"
46
46
  };
47
47
  export {
48
- t as ACADEMY_LINK,
49
48
  B as DEFAULT_UNSUBSCRIBE_GROUP,
50
- _ as INSIDER_ID,
51
- I as LINK_REGEXES,
52
- N as LINK_TYPES,
53
- o as MERGE_TAGS,
49
+ i as INSIDER_ID,
50
+ r as LINK_REGEXES,
51
+ I as LINK_TYPES,
52
+ c as MERGE_TAGS,
54
53
  E as PAGE_TYPES,
55
- c as TYPE_COLLECTIONS,
54
+ t as TYPE_COLLECTIONS,
56
55
  C as UNSUBSCRIBE_PAGES_LINK,
57
- i as URLS,
56
+ _ as URLS,
58
57
  U as getTypeTranslations
59
58
  };
@@ -0,0 +1,4 @@
1
+ var t = /* @__PURE__ */ ((c) => (c.TEXT_ALIGN = "coupon-block-text-align-control", c.TEXT_COLOR = "coupon-block-text-color-control", c.TEXT_SIZE = "coupon-block-text-size-control", c.TEXT_STYLE = "coupon-block-text-style-control", c.TEXT_FONT_FAMILY = "coupon-block-text-font-family-control", c.TEXT_BACKGROUND = "coupon-block-text-background-control", c.TEXT_PADDINGS = "coupon-block-text-paddings-control", c.TEXT_LINE_SPACING = "coupon-block-text-line-spacing-control", c))(t || {});
2
+ export {
3
+ t as CouponControlId
4
+ };
@@ -0,0 +1,29 @@
1
+ import { createTextAlignControl as t, createTextColorControl as e, createTextSizeControl as n, createTextStyleControl as r, createTextFontFamilyControl as T, createTextBackgroundColorControl as l, createPaddingsControl as C, createTextLineSpacingControl as c } from "../../controlFactories.js";
2
+ import { CouponControlId as o } from "../constants.js";
3
+ const i = t(
4
+ o.TEXT_ALIGN
5
+ ), E = e(
6
+ o.TEXT_COLOR
7
+ ), s = n(
8
+ o.TEXT_SIZE
9
+ ), S = r(
10
+ o.TEXT_STYLE
11
+ ), _ = T(
12
+ o.TEXT_FONT_FAMILY
13
+ ), g = l(
14
+ o.TEXT_BACKGROUND
15
+ ), X = C(
16
+ o.TEXT_PADDINGS
17
+ ), d = c(
18
+ o.TEXT_LINE_SPACING
19
+ );
20
+ export {
21
+ i as TextAlignControl,
22
+ g as TextBackgroundControl,
23
+ E as TextColorControl,
24
+ _ as TextFontFamilyControl,
25
+ d as TextLineSpacingControl,
26
+ X as TextPaddingsControl,
27
+ s as TextSizeControl,
28
+ S as TextStyleControl
29
+ };
@@ -1,8 +1,9 @@
1
1
  import { ExtensionBuilder as o } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
2
  import { CouponBlock as t } from "./block.js";
3
- import { CouponIconsRegistry as i } from "./iconsRegistry.js";
4
- import { CouponBlockSettings as n } from "./settingsPanel.js";
5
- const p = new o().addBlock(t).withSettingsPanelRegistry(n).withIconsRegistry(i).build();
3
+ import { TextAlignControl as n, TextColorControl as r, TextSizeControl as l, TextStyleControl as d, TextFontFamilyControl as e, TextBackgroundControl as i, TextPaddingsControl as C, TextLineSpacingControl as a } from "./controls/index.js";
4
+ import { CouponIconsRegistry as s } from "./iconsRegistry.js";
5
+ import { CouponBlockSettings as m } from "./settingsPanel.js";
6
+ const u = new o().addBlock(t).withSettingsPanelRegistry(m).addControl(n).addControl(r).addControl(l).addControl(d).addControl(e).addControl(i).addControl(C).addControl(a).withIconsRegistry(s).build();
6
7
  export {
7
- p as default
8
+ u as default
8
9
  };
@@ -1,24 +1,30 @@
1
- import { SettingsPanelRegistry as T, SettingsPanelTab as o, SettingsTab as O, TextControls as t } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
- import { COUPON_BLOCK_ID as N } from "./block.js";
3
- class _ extends T {
1
+ import { SettingsPanelRegistry as n, SettingsPanelTab as o, SettingsTab as t } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
+ import { COUPON_BLOCK_ID as E } from "./block.js";
3
+ import { CouponControlId as T } from "./constants.js";
4
+ class i extends n {
4
5
  registerBlockControls(e) {
5
- e[N] = [
6
+ e[E] = [
6
7
  new o(
7
- O.SETTINGS,
8
+ t.SETTINGS,
8
9
  [
9
- t.FONT_FAMILY,
10
- t.FONT_SIZE,
11
- t.FORMAT,
12
- t.FONT_COLOR,
13
- t.TEXT_BLOCK_BACKGROUND_COLOR,
14
- t.ALIGN,
15
- t.LINE_HEIGHT,
16
- t.INTERNAL_INDENTS
10
+ T.TEXT_STYLE,
11
+ T.TEXT_ALIGN,
12
+ T.TEXT_PADDINGS
13
+ ]
14
+ ),
15
+ new o(
16
+ t.STYLES,
17
+ [
18
+ T.TEXT_BACKGROUND,
19
+ T.TEXT_FONT_FAMILY,
20
+ T.TEXT_LINE_SPACING,
21
+ T.TEXT_SIZE,
22
+ T.TEXT_COLOR
17
23
  ]
18
24
  )
19
25
  ];
20
26
  }
21
27
  }
22
28
  export {
23
- _ as CouponBlockSettings
29
+ i as CouponBlockSettings
24
30
  };
@@ -1,18 +1,29 @@
1
- const o = `
2
- <td class="coupon-block ins-coupon-code esd-block-text coupon-block-v2">
3
- <p class="ins-title" contenteditable="false">{@COUPON_CODE}</p>
4
- </td>`, e = `
5
- <td
6
- class="coupon-block coupon-block-v2 ins-coupon-code esd-block-text esd-extension-block"
7
- esd-extension-block-id="coupon-block"
1
+ import { BlockType as o } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
+ import { COUPON_BLOCK_ID as e } from "./block.js";
3
+ const t = `
4
+ <${o.BLOCK_TEXT}
5
+ class="coupon-block ins-coupon-code coupon-block-v2 es-p10"
6
+ align="center"
7
+ esd-extension-block-id="${e}">
8
+ <p
9
+ path="1"
10
+ contenteditable="false"
11
+ style="font-size: 16px; color: #333333;">
12
+ <strong path="1,0">{@COUPON_CODE}</strong>
13
+ </p>
14
+ </${o.BLOCK_TEXT}>
15
+ `, l = `
16
+ <td
17
+ class="coupon-block coupon-block-v2 ins-coupon-code esd-block-text esd-extension-block"
18
+ esd-extension-block-id="${e}"
8
19
  >
9
20
  <p class="ins-title" contenteditable="false">{@COUPON_CODE}</p>
10
21
  </td>
11
22
  `;
12
- function t() {
13
- return o;
23
+ function s() {
24
+ return t;
14
25
  }
15
26
  export {
16
- e as default,
17
- t as getDefaultTemplate
27
+ l as default,
28
+ s as getDefaultTemplate
18
29
  };
@@ -1,21 +1,21 @@
1
1
  import { ExtensionBuilder as e } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
2
  import { UnsubscribeBlock as i } from "./block.js";
3
3
  import { UnsubscribeControl as t } from "./control.js";
4
- import { PreviewUIElement as o } from "./elements/preview.js";
5
- import { UnsubscribeIconsRegistry as r } from "./iconsRegistry.js";
6
- import { SettingsPanel as s } from "./settingsPanel.js";
4
+ import { PreviewUIElement as s } from "./elements/preview.js";
5
+ import { UnsubscribeIconsRegistry as o } from "./iconsRegistry.js";
6
+ import { SettingsPanel as r } from "./settingsPanel.js";
7
7
  import n from "./styles.css.js";
8
- import { UnsubscribeTagRegistry as l } from "./tagRegistry.js";
9
- const f = new e().addBlock(i).withSettingsPanelRegistry(s).addControl(t).addUiElement(o).addStyles(n).withLocalization({
8
+ import { UnsubscribeTagRegistry as c } from "./tagRegistry.js";
9
+ const g = new e().addBlock(i).withSettingsPanelRegistry(r).addControl(t).addUiElement(s).addStyles(n).withLocalization({
10
10
  en: {
11
- "Unsubscribe Block": "Unsubscribe Block",
12
- "Unsubscribe Block Description": "Add an unsubscribe link to your email",
11
+ "Unsubscribe Block": "Unsubscribe",
12
+ "Unsubscribe Block Description": "Unsubscribe lets you add an Unsubscribe Link to direct users to opt out of receiving your messages.",
13
13
  "Select Template": "Select Template",
14
14
  "Unsubscribe Template": "Unsubscribe Template",
15
15
  Showing: "Showing",
16
16
  of: "of"
17
17
  }
18
- }).withUiElementTagRegistry(l).withIconsRegistry(r).build();
18
+ }).withUiElementTagRegistry(c).withIconsRegistry(o).build();
19
19
  export {
20
- f as default
20
+ g as default
21
21
  };
@@ -1,12 +1,12 @@
1
1
  var c = Object.defineProperty;
2
2
  var I = (a, r, e) => r in a ? c(a, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[r] = e;
3
- var l = (a, r, e) => I(a, typeof r != "symbol" ? r + "" : r, e);
3
+ var u = (a, r, e) => I(a, typeof r != "symbol" ? r + "" : r, e);
4
4
  import { Control as O, UIElementType as t, UEAttr as $ } from "../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
5
  class _ extends O {
6
6
  constructor() {
7
7
  super(...arguments);
8
- l(this, "currentNode");
9
- l(this, "lastBlockInstanceId", null);
8
+ u(this, "currentNode");
9
+ u(this, "lastBlockInstanceId", null);
10
10
  }
11
11
  getContainer() {
12
12
  var e;
@@ -52,10 +52,9 @@ class _ extends O {
52
52
  const T = o !== this.lastBlockInstanceId;
53
53
  return T ? (this.currentNode && e(this.currentNode), n(), this.lastBlockInstanceId = o) : n(), T;
54
54
  }
55
- _GuLabel({ text: e, name: n = "", position: E = "top" }) {
55
+ _GuLabel({ text: e, name: n = "" }) {
56
56
  return `
57
57
  <${t.LABEL}
58
- style="${E === "top" ? "margin-bottom: 8px;" : ""}"
59
58
  ${$.LABEL.text}="${e}"
60
59
  ${$.LABEL.name}="${n || `${e} Label`}">
61
60
  </${t.LABEL}>
@@ -170,9 +169,9 @@ class _ extends O {
170
169
  _GuOrderable(e, n) {
171
170
  let E = "";
172
171
  n.forEach((T) => {
173
- const u = $.ORDERABLE_ITEM && "name" in $.ORDERABLE_ITEM ? $.ORDERABLE_ITEM.name : "name";
172
+ const l = $.ORDERABLE_ITEM && "name" in $.ORDERABLE_ITEM ? $.ORDERABLE_ITEM.name : "name";
174
173
  E += `
175
- <${t.ORDERABLE_ITEM} ${u}="${T.key}">
174
+ <${t.ORDERABLE_ITEM} ${l}="${T.key}">
176
175
  ${T.content}
177
176
  </${t.ORDERABLE_ITEM}>
178
177
  `;