@useinsider/guido 1.0.0-beta.5d42d5a → 1.0.0-beta.5db3c1a

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 (69) hide show
  1. package/dist/@types/generic.d.ts +1 -2
  2. package/dist/components/Guido.vue.d.ts +2 -1
  3. package/dist/components/Guido.vue.js +4 -4
  4. package/dist/components/Guido.vue2.js +32 -30
  5. package/dist/components/organisms/{email-preview/EmailPreviewContainer.vue.d.ts → design-preview/DesktopPreview.vue.d.ts} +3 -2
  6. package/dist/components/organisms/design-preview/DesktopPreview.vue.js +22 -0
  7. package/dist/components/organisms/design-preview/DesktopPreview.vue2.js +28 -0
  8. package/dist/components/organisms/{email-preview/desktop-preview/DesktopPreview.vue.d.ts → design-preview/EmailPreview.vue.d.ts} +3 -3
  9. package/dist/components/organisms/design-preview/EmailPreview.vue.js +17 -0
  10. package/dist/components/organisms/design-preview/EmailPreview.vue2.js +37 -0
  11. package/dist/components/organisms/{email-preview/mobile-preview/OpenedEmailView.vue.d.ts → design-preview/EmailView.vue.d.ts} +3 -2
  12. package/dist/components/organisms/{email-preview/mobile-preview/OpenedEmailView.vue.js → design-preview/EmailView.vue.js} +4 -4
  13. package/dist/components/organisms/design-preview/EmailView.vue2.js +24 -0
  14. package/dist/components/organisms/{email-preview/mobile-preview → design-preview}/InboxView.vue.d.ts +2 -2
  15. package/dist/components/organisms/{email-preview/mobile-preview → design-preview}/InboxView.vue.js +2 -2
  16. package/dist/components/organisms/design-preview/InboxView.vue2.js +23 -0
  17. package/dist/components/organisms/{email-preview/mobile-preview → design-preview}/MobilePreview.vue.d.ts +3 -3
  18. package/dist/components/organisms/design-preview/MobilePreview.vue.js +17 -0
  19. package/dist/components/organisms/design-preview/MobilePreview.vue2.js +22 -0
  20. package/dist/components/organisms/header/AmpErrorModal.vue.js +21 -0
  21. package/dist/components/organisms/header/AmpErrorModal.vue2.js +27 -0
  22. package/dist/components/organisms/header/AmpToggle.vue.js +19 -0
  23. package/dist/components/organisms/header/AmpToggle.vue2.js +38 -0
  24. package/dist/components/organisms/header/MiddleSlot.vue.js +3 -3
  25. package/dist/components/organisms/header/MiddleSlot.vue2.js +18 -16
  26. package/dist/composables/useActionsApi.d.ts +0 -2
  27. package/dist/composables/useActionsApi.js +36 -47
  28. package/dist/composables/useMobileGmailFit.d.ts +5 -0
  29. package/dist/composables/useMobileGmailFit.js +69 -0
  30. package/dist/composables/usePreviewMode.d.ts +4 -4
  31. package/dist/composables/usePreviewMode.js +16 -18
  32. package/dist/enums/defaults.js +6 -10
  33. package/dist/guido.css +1 -1
  34. package/dist/inbox-mockup.svg +41 -0
  35. package/dist/phone-mockup.svg +31 -0
  36. package/dist/stores/editor.d.ts +3 -0
  37. package/dist/stores/editor.js +6 -3
  38. package/package.json +1 -1
  39. package/dist/components/organisms/email-preview/EmailPreviewContainer.vue.js +0 -17
  40. package/dist/components/organisms/email-preview/EmailPreviewContainer.vue2.js +0 -32
  41. package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue.js +0 -19
  42. package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue2.js +0 -37
  43. package/dist/components/organisms/email-preview/amp/AmpToggle.vue.js +0 -17
  44. package/dist/components/organisms/email-preview/amp/AmpToggle.vue2.js +0 -57
  45. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +0 -22
  46. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +0 -39
  47. package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue.d.ts +0 -15
  48. package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue.js +0 -17
  49. package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue2.js +0 -15
  50. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.d.ts +0 -19
  51. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +0 -17
  52. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue2.js +0 -17
  53. package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue2.js +0 -23
  54. package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue.js +0 -17
  55. package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue2.js +0 -27
  56. package/dist/components/organisms/email-preview/mobile-preview/OpenedEmailView.vue2.js +0 -26
  57. package/dist/components/wrappers/BaseModal.vue.d.ts +0 -76
  58. package/dist/components/wrappers/BaseModal.vue.js +0 -19
  59. package/dist/components/wrappers/BaseModal.vue2.js +0 -22
  60. package/dist/composables/useCodeEditorApi.d.ts +0 -5
  61. package/dist/composables/useCodeEditorApi.js +0 -17
  62. package/dist/composables/useEmailResponsiveFit.d.ts +0 -5
  63. package/dist/composables/useEmailResponsiveFit.js +0 -72
  64. package/dist/static/assets/inbox-mockup.svg.js +0 -4
  65. package/dist/static/assets/phone-mockup.svg.js +0 -4
  66. package/dist/stores/preview.d.ts +0 -56
  67. package/dist/stores/preview.js +0 -23
  68. /package/dist/components/organisms/{email-preview/amp → header}/AmpErrorModal.vue.d.ts +0 -0
  69. /package/dist/components/organisms/{email-preview/amp → header}/AmpToggle.vue.d.ts +0 -0
@@ -3,14 +3,13 @@ export type GuidoConfig = {
3
3
  translationsPath: string;
4
4
  htmlCompilerRules?: CompilerRule[];
5
5
  ignoreDefaultHtmlCompilerRules?: boolean;
6
- emailHeader: EmailHeader;
7
6
  };
8
7
  export type DynamicContent = {
9
8
  value: string;
10
9
  text: string;
11
10
  fallback?: string;
12
11
  };
13
- export interface EmailHeader {
12
+ export interface EmailData {
14
13
  senderName: string;
15
14
  subject: string;
16
15
  }
@@ -1,4 +1,4 @@
1
- import type { DynamicContent, GuidoConfig } from '@@/Types/generic';
1
+ import type { DynamicContent, GuidoConfig, EmailData } from '@@/Types/generic';
2
2
  import type { Template } from '@@/Types/stripo';
3
3
  type __VLS_Props = {
4
4
  templateId: string;
@@ -9,6 +9,7 @@ type __VLS_Props = {
9
9
  html?: string;
10
10
  css?: string;
11
11
  guidoConfig: GuidoConfig;
12
+ emailData?: EmailData;
12
13
  };
13
14
  declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {
14
15
  dynamicContent: {
@@ -3,16 +3,16 @@ import o from "./Guido.vue2.js";
3
3
  import t from "../_virtual/_plugin-vue2_normalizer.js";
4
4
  var s = function() {
5
5
  var i = this, r = i._self._c, e = i._self._setupProxy;
6
- return r("div", { staticClass: "guido-editor__wrapper" }, [r(e.HeaderWrapper), e.editorStore.isPreviewModeOpen ? r(e.EmailPreview, { attrs: { "email-header": e.guidoConfig.emailHeader } }) : i._e(), r("div", { directives: [{ name: "show", rawName: "v-show", value: !e.editorStore.isPreviewModeOpen, expression: "!editorStore.isPreviewModeOpen" }], staticClass: "guido-editor__container", attrs: { id: "guido-editor" } })], 1);
6
+ return r("div", { staticClass: "guido-editor__wrapper" }, [r(e.HeaderWrapper), r(e.EmailPreview, { directives: [{ name: "show", rawName: "v-show", value: e.editorStore.isPreviewModeOpen, expression: "editorStore.isPreviewModeOpen" }], attrs: { "email-data": i.emailData, "is-visible": e.editorStore.isPreviewModeOpen } }), r("div", { directives: [{ name: "show", rawName: "v-show", value: !e.editorStore.isPreviewModeOpen, expression: "!editorStore.isPreviewModeOpen" }], staticClass: "guido-editor__container", attrs: { id: "guido-editor" } })], 1);
7
7
  }, a = [], d = /* @__PURE__ */ t(
8
8
  o,
9
9
  s,
10
10
  a,
11
11
  !1,
12
12
  null,
13
- "7f25de52"
13
+ "7836f831"
14
14
  );
15
- const v = d.exports;
15
+ const m = d.exports;
16
16
  export {
17
- v as default
17
+ m as default
18
18
  };
@@ -1,12 +1,13 @@
1
- import { defineComponent as E, defineAsyncComponent as S, onMounted as D } from "vue";
2
- import { provideGuidoActions as _ } from "../composables/useGuidoActions.js";
3
- import { usePartner as G } from "../composables/usePartner.js";
4
- import { useStripo as I } from "../composables/useStripo.js";
5
- import { DefaultUsername as P, DefaultGuidoConfig as k } from "../enums/defaults.js";
6
- import T from "./organisms/header/HeaderWrapper.vue.js";
7
- import { useStripoApi as A } from "../services/stripoApi.js";
1
+ import { defineComponent as w, onMounted as E } from "vue";
2
+ import { provideGuidoActions as S } from "../composables/useGuidoActions.js";
3
+ import { usePartner as D } from "../composables/usePartner.js";
4
+ import { useStripo as _ } from "../composables/useStripo.js";
5
+ import { DefaultUsername as G, DefaultGuidoConfig as I } from "../enums/defaults.js";
6
+ import P from "./organisms/design-preview/EmailPreview.vue.js";
7
+ import k from "./organisms/header/HeaderWrapper.vue.js";
8
+ import { useStripoApi as T } from "../services/stripoApi.js";
8
9
  import { useEditorStore as N } from "../stores/editor.js";
9
- const M = /* @__PURE__ */ E({
10
+ const M = /* @__PURE__ */ w({
10
11
  __name: "Guido",
11
12
  props: {
12
13
  templateId: null,
@@ -16,34 +17,35 @@ const M = /* @__PURE__ */ E({
16
17
  username: null,
17
18
  html: null,
18
19
  css: null,
19
- guidoConfig: null
20
+ guidoConfig: null,
21
+ emailData: null
20
22
  },
21
23
  emits: ["dynamic-content:open", "back", "save:start", "save:complete"],
22
- setup(C, { expose: b, emit: o }) {
23
- const t = C, h = S(() => import("./organisms/email-preview/EmailPreviewContainer.vue.js")), { getPartnerName: n, getProductType: c } = G(), {
24
- templateId: a,
25
- userId: i,
26
- guidoConfig: r,
24
+ setup(C, { expose: b, emit: t }) {
25
+ const o = C, { getPartnerName: n, getProductType: a } = D(), {
26
+ templateId: c,
27
+ userId: r,
28
+ guidoConfig: i,
27
29
  html: s = "",
28
- css: d = "",
29
- partnerName: l = n(),
30
- productType: u = c(),
31
- username: m = P
32
- } = t;
30
+ css: l = "",
31
+ partnerName: d = n(),
32
+ productType: u = a(),
33
+ username: m = G
34
+ } = o;
33
35
  window.GuidoConfig = {
34
- ...k,
35
- ...r
36
+ ...I,
37
+ ...i
36
38
  };
37
- const { initPlugin: p } = I({ emailId: a, userId: i, username: m, partnerName: l, productType: u }), { getDefaultTemplate: f } = A(), w = N();
38
- _({
39
+ const { initPlugin: p } = _({ emailId: c, userId: r, username: m, partnerName: d, productType: u }), { getDefaultTemplate: f } = T(), h = N();
40
+ S({
39
41
  onBack: () => {
40
- console.debug("guido:back"), o("back");
42
+ console.debug("guido:back"), t("back");
41
43
  },
42
44
  onSaveStart: () => {
43
- console.debug("guido:save:start"), o("save:start");
45
+ console.debug("guido:save:start"), t("save:start");
44
46
  },
45
47
  onSaveComplete: (e) => {
46
- console.debug("guido:save:complete", e), o("save:complete", e);
48
+ console.debug("guido:save:complete", e), t("save:complete", e);
47
49
  }
48
50
  });
49
51
  const g = (e) => {
@@ -51,12 +53,12 @@ const M = /* @__PURE__ */ E({
51
53
  }, y = () => {
52
54
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
53
55
  };
54
- return D(async () => {
56
+ return E(async () => {
55
57
  console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow");
56
58
  try {
57
59
  let e = {
58
60
  html: s,
59
- css: d,
61
+ css: l,
60
62
  forceRecreate: !0
61
63
  // TODO: It should be false for old templates. We will communicate with Stripo
62
64
  };
@@ -66,14 +68,14 @@ const M = /* @__PURE__ */ E({
66
68
  }
67
69
  document.addEventListener("dynamic-content:open", (e) => {
68
70
  const v = e;
69
- console.debug("dynamic-content:open", v.detail), o("dynamic-content:open", v.detail);
71
+ console.debug("dynamic-content:open", v.detail), t("dynamic-content:open", v.detail);
70
72
  });
71
73
  }), b({
72
74
  dynamicContent: {
73
75
  insert: g,
74
76
  close: y
75
77
  }
76
- }), { __sfc: !0, EmailPreview: h, props: t, getPartnerName: n, getProductType: c, templateId: a, userId: i, guidoConfig: r, html: s, css: d, partnerName: l, productType: u, username: m, emit: o, initPlugin: p, getDefaultTemplate: f, editorStore: w, insertDynamicContent: g, closeDynamicContent: y, HeaderWrapper: T };
78
+ }), { __sfc: !0, props: o, getPartnerName: n, getProductType: a, templateId: c, userId: r, guidoConfig: i, html: s, css: l, partnerName: d, productType: u, username: m, emit: t, initPlugin: p, getDefaultTemplate: f, editorStore: h, insertDynamicContent: g, closeDynamicContent: y, EmailPreview: P, HeaderWrapper: k };
77
79
  }
78
80
  });
79
81
  export {
@@ -1,6 +1,7 @@
1
- import type { EmailHeader } from '@@/Types/generic';
1
+ import type { EmailData } from '@@/Types/generic';
2
2
  interface Props {
3
- emailHeader: EmailHeader;
3
+ emailHtml: string;
4
+ emailData?: EmailData;
4
5
  }
5
6
  declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<Props>, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<Props>>>, {}>;
6
7
  export default _default;
@@ -0,0 +1,22 @@
1
+ import a from "./DesktopPreview.vue2.js";
2
+ /* empty css */
3
+ import i from "../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var r = function() {
5
+ var e = this, s = e._self._c, t = e._self._setupProxy;
6
+ return s(t.InContainer, { staticClass: "s-2 m-b-5", attrs: { "full-width-content-status": "", "header-status": "", "border-radius": "bor-r-1", "container-type": "default", "footer-status": !1 }, scopedSlots: e._u([{ key: "headerLeftSlot", fn: function() {
7
+ return [s("div", { staticClass: "d-f a-i-c j-c-s-b w-1" }, [s("div", { staticClass: "d-f a-i-c" }, [s("div", { staticClass: "b-c-49 bor-r-100 w-5-s h-5-s d-f a-i-c j-c-c" }, [s(t.InIcons, { attrs: { name: "line-menu-profile" } })], 1), s("div", { staticClass: "d-f f-d-c ml-2" }, [s("p", { staticClass: "t-c-53 f-w-600 f-s-1 l-h-1" }, [e._v(" " + e._s(t.senderName) + " ")]), s("p", { staticClass: "t-c-55 f-w-400 f-s-12 l-h-1" }, [e._v(" " + e._s(t.subject) + " ")])])])])];
8
+ }, proxy: !0 }, { key: "headerRightSlot", fn: function() {
9
+ return [s("div", { staticClass: "d-f a-i-c j-c-c" }, [s(t.InProgress, { staticClass: "min-w-15-s", attrs: { id: "email-size-progress", "description-status": "", "description-position": "left", description: t.emailSize, "max-value": t.MAX_EMAIL_SIZE, type: t.progressType, value: t.progressValue } }), s(t.InTooltip, { staticClass: "d-f ml-1", attrs: { id: "email-size-tooltip", align: "center", position: "bottom", text: t.trans("email.guido-preview.design-size-warning") } })], 1)];
10
+ }, proxy: !0 }]) }, [s("iframe", { staticClass: "email-iframe w-1 h-1 bor-w-0", attrs: { sandbox: "allow-same-origin allow-popups allow-forms allow-scripts", srcdoc: e.emailHtml } })]);
11
+ }, o = [], l = /* @__PURE__ */ i(
12
+ a,
13
+ r,
14
+ o,
15
+ !1,
16
+ null,
17
+ "b07fa463"
18
+ );
19
+ const p = l.exports;
20
+ export {
21
+ p as default
22
+ };
@@ -0,0 +1,28 @@
1
+ import { defineComponent as d, computed as c, ref as a, watch as _ } from "vue";
2
+ import { useTranslations as I } from "../../../composables/useTranslations.js";
3
+ import { InTooltip as S, InProgress as b, InIcons as h, InContainer as v } from "@useinsider/design-system-vue";
4
+ const w = /* @__PURE__ */ d({
5
+ __name: "DesktopPreview",
6
+ props: {
7
+ emailHtml: null,
8
+ emailData: null
9
+ },
10
+ setup(i) {
11
+ const t = i, u = c(() => {
12
+ var e;
13
+ return ((e = t.emailData) == null ? void 0 : e.senderName) || "{Sender Name}";
14
+ }), p = c(() => {
15
+ var e;
16
+ return ((e = t.emailData) == null ? void 0 : e.subject) || "{Subject | Your Subject}";
17
+ }), o = 102, r = a("~-- KB"), l = a(0), s = a("success"), f = I(), m = () => {
18
+ if (!t.emailHtml)
19
+ return;
20
+ const e = new Blob([t.emailHtml]).size, n = Math.round(e / 1024);
21
+ r.value = `~${n} KB`, l.value = Math.min(n, o), n < 102 ? s.value = "success" : s.value = "warning";
22
+ };
23
+ return _(() => t.emailHtml, m, { immediate: !0 }), { __sfc: !0, props: t, senderName: u, subject: p, MAX_EMAIL_SIZE: o, emailSize: r, progressValue: l, progressType: s, trans: f, calculateEmailSize: m, InContainer: v, InIcons: h, InProgress: b, InTooltip: S };
24
+ }
25
+ });
26
+ export {
27
+ w as default
28
+ };
@@ -1,7 +1,7 @@
1
- import type { EmailHeader } from '@@/Types/generic';
1
+ import type { EmailData } from '@@/Types/generic';
2
2
  interface Props {
3
- html: string;
4
- emailHeader?: EmailHeader;
3
+ isVisible: boolean;
4
+ emailData?: EmailData;
5
5
  }
6
6
  declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<Props>, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<Props>>>, {}>;
7
7
  export default _default;
@@ -0,0 +1,17 @@
1
+ import s from "./EmailPreview.vue2.js";
2
+ import i from "../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var r = function() {
4
+ var a = this, e = a._self._c, t = a._self._setupProxy;
5
+ return a.isVisible ? e("div", { staticClass: "d-f f-d-c h-1 b-c-5 bor-r-2" }, [e("div", { staticClass: "f-g-1 d-f p-5 o-a g-4 min-h-600" }, [e(t.DesktopPreview, { staticClass: "f-g-1 min-w-0", attrs: { "email-data": a.emailData, "email-html": t.currentHtml } }), e(t.MobilePreview, { staticClass: "f-0 min-w-a", attrs: { "email-data": a.emailData, "email-html": t.currentHtml, "is-amp": t.isAmp } })], 1)]) : a._e();
6
+ }, l = [], m = /* @__PURE__ */ i(
7
+ s,
8
+ r,
9
+ l,
10
+ !1,
11
+ null,
12
+ null
13
+ );
14
+ const c = m.exports;
15
+ export {
16
+ c as default
17
+ };
@@ -0,0 +1,37 @@
1
+ import { defineComponent as w, ref as c, computed as p, watch as u, onMounted as b } from "vue";
2
+ import { useDebounce as P } from "../../../composables/useDebounce.js";
3
+ import { usePreviewMode as _ } from "../../../composables/usePreviewMode.js";
4
+ import { useToaster as h } from "../../../composables/useToaster.js";
5
+ import { useEditorStore as V } from "../../../stores/editor.js";
6
+ import y from "./DesktopPreview.vue.js";
7
+ import F from "./MobilePreview.vue.js";
8
+ const x = /* @__PURE__ */ w({
9
+ __name: "EmailPreview",
10
+ props: {
11
+ isVisible: { type: Boolean },
12
+ emailData: null
13
+ },
14
+ setup(d) {
15
+ const o = d, { compile: a } = _(), { debounce: l } = P(), { handleError: m } = h(), e = V(), i = c(""), r = c(!1), f = p(() => e.emailFormat === "amp" && e.ampHtml ? e.ampHtml : i.value), v = p(() => e.emailFormat === "amp"), t = async () => {
16
+ r.value = !0;
17
+ try {
18
+ const s = await a();
19
+ i.value = s.html;
20
+ } catch {
21
+ console.error("Failed to load preview"), m("Failed to load preview", "Preview compilation");
22
+ } finally {
23
+ r.value = !1;
24
+ }
25
+ }, n = () => {
26
+ l(t, 350);
27
+ };
28
+ return u(() => o.isVisible, (s) => s && t()), u(() => e.editorVisualMode, () => {
29
+ o.isVisible && n();
30
+ }), b(() => {
31
+ o.isVisible && t();
32
+ }), { __sfc: !0, props: o, compile: a, debounce: l, handleError: m, editorStore: e, html: i, isLoading: r, currentHtml: f, isAmp: v, loadPreview: t, debouncedReload: n, DesktopPreview: y, MobilePreview: F };
33
+ }
34
+ });
35
+ export {
36
+ x as default
37
+ };
@@ -1,9 +1,10 @@
1
1
  interface Props {
2
- html: string;
3
- isAmp: boolean;
2
+ emailHtml: string;
3
+ isAmp?: boolean;
4
4
  }
5
5
  declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<Props>, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {
6
6
  "back-to-inbox": () => void;
7
+ load: () => void;
7
8
  }, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<Props>>>, {}>;
8
9
  export default _default;
9
10
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
@@ -1,10 +1,10 @@
1
- import n from "./OpenedEmailView.vue2.js";
2
- import c from "../../../../_virtual/_plugin-vue2_normalizer.js";
1
+ import n from "./EmailView.vue2.js";
2
+ import c from "../../../_virtual/_plugin-vue2_normalizer.js";
3
3
  var e = function() {
4
4
  var a = this, s = a._self._c, t = a._self._setupProxy;
5
- return s("div", { staticClass: "w-1 h-1 b-c-4 d-f f-d-c" }, [s("div", { staticClass: "d-f j-c-s-b a-i-c p-2 h-6-s" }, [s("div", { staticClass: "d-f a-i-c cur-p", on: { click: function(l) {
5
+ return s("div", { staticClass: "w-1 h-1 b-c-4 d-f f-d-c" }, [s("div", { staticClass: "d-f j-c-s-b a-i-c p-2 h-6-s" }, [s("div", { staticClass: "d-f a-i-c cur-p", on: { click: function(r) {
6
6
  return a.$emit("back-to-inbox");
7
- } } }, [s(t.InIcons, { staticClass: "f-s-3 i-c-7", attrs: { name: "line-chevron-left" } }), s("span", { staticClass: "ml-2 f-s-1 f-w-400 l-h-1 t-c-7" }, [a._v(a._s(t.trans("newsletter.inbox")))])], 1), s("div", { staticClass: "d-f a-i-c" }, [s(t.InIcons, { staticClass: "i-c-52", attrs: { name: "line-chevron-down" } }), s(t.InIcons, { staticClass: "ml-1 i-c-52", attrs: { name: "line-chevron-up" } })], 1)]), s("iframe", { ref: "iframeRef", staticClass: "f-g-1 w-1 d-b b-c-4 bor-s-n", attrs: { sandbox: "allow-same-origin allow-popups allow-forms allow-scripts", srcdoc: t.html }, on: { load: t.onLoad } })]);
7
+ } } }, [s(t.InIcons, { staticClass: "f-s-3 i-c-7", attrs: { name: "line-chevron-left" } }), s("span", { staticClass: "ml-2 f-s-1 f-w-400 l-h-1 t-c-7" }, [a._v(a._s(t.trans("newsletter.inbox")))])], 1), s("div", { staticClass: "d-f a-i-c" }, [s(t.InIcons, { staticClass: "i-c-52", attrs: { name: "line-chevron-down" } }), s(t.InIcons, { staticClass: "ml-1 i-c-52", attrs: { name: "line-chevron-up" } })], 1)]), s("iframe", { ref: "iframeRef", staticClass: "f-g-1 w-1 d-b b-c-4 bor-s-n", attrs: { sandbox: "allow-same-origin allow-popups allow-forms allow-scripts", srcdoc: a.emailHtml }, on: { load: t.onLoad } })]);
8
8
  }, i = [], o = /* @__PURE__ */ c(
9
9
  n,
10
10
  e,
@@ -0,0 +1,24 @@
1
+ import { defineComponent as p, ref as c } from "vue";
2
+ import { useMobileGmailFit as u } from "../../../composables/useMobileGmailFit.js";
3
+ import { useTranslations as f } from "../../../composables/useTranslations.js";
4
+ import { InIcons as d } from "@useinsider/design-system-vue";
5
+ const E = /* @__PURE__ */ p({
6
+ __name: "EmailView",
7
+ props: {
8
+ emailHtml: null,
9
+ isAmp: { type: Boolean }
10
+ },
11
+ emits: ["back-to-inbox", "load"],
12
+ setup(l, { emit: t }) {
13
+ const o = l, a = f(), n = c(), { setupMobileGmailFit: m } = u(), s = () => !!o.isAmp && o.emailHtml.includes("@media") && o.emailHtml.includes(".adapt-img"), r = (e) => {
14
+ e.documentElement.style.removeProperty("transform"), e.documentElement.style.removeProperty("transform-origin"), e.documentElement.style.removeProperty("height");
15
+ };
16
+ return { __sfc: !0, props: o, emit: t, trans: a, iframeRef: n, setupMobileGmailFit: m, isAmpResponsive: s, clearAmpTransforms: r, onLoad: () => {
17
+ const e = n.value, i = e == null ? void 0 : e.contentDocument;
18
+ !e || !i || (m(e), s() && setTimeout(() => r(i), 50), t("load"));
19
+ }, InIcons: d };
20
+ }
21
+ });
22
+ export {
23
+ E as default
24
+ };
@@ -1,6 +1,6 @@
1
- import type { EmailHeader } from '@@/Types/generic';
1
+ import type { EmailData } from '@@/Types/generic';
2
2
  interface Props {
3
- emailHeader?: EmailHeader;
3
+ emailData?: EmailData;
4
4
  }
5
5
  declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<Props>, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {
6
6
  "open-email": () => void;
@@ -1,9 +1,9 @@
1
1
  import a from "./InboxView.vue2.js";
2
- import e from "../../../../_virtual/_plugin-vue2_normalizer.js";
2
+ import e from "../../../_virtual/_plugin-vue2_normalizer.js";
3
3
  var n = function() {
4
4
  var s = this, t = s._self._c, c = s._self._setupProxy;
5
5
  return t("div", { staticClass: "p-y-13 p-x-3 bor-b-w-1 bor-b-s-s bor-b-c-50 cur-p b-c-4 b-c-h-5 p-3", on: { click: function(l) {
6
- return c.emit("open-email");
6
+ return s.$emit("open-email");
7
7
  } } }, [t("div", { staticClass: "d-f j-c-s-b a-i-c w-1" }, [t("div", { staticClass: "f-g-1 min-w-0-s" }, [t("div", { staticClass: "f-s-1 f-w-600 t-c-53 l-h-1 mb-12" }, [s._v(" " + s._s(c.senderName) + " ")]), t("div", { staticClass: "f-s-12 f-w-400 t-c-55 l-h-1" }, [s._v(" " + s._s(c.subject) + " ")])]), t("div", { staticClass: "f-sh-0 ml-2 f-s-12 f-w-400 t-c-55 l-h-1" }, [s._v(" " + s._s(c.trans("product-catalog.today")) + " ")]), t(c.InIcons, { staticClass: "i-c-52", attrs: { name: "line-chevron-right" } })], 1)]);
8
8
  }, r = [], i = /* @__PURE__ */ e(
9
9
  a,
@@ -0,0 +1,23 @@
1
+ import { defineComponent as r, computed as n } from "vue";
2
+ import { useTranslations as i } from "../../../composables/useTranslations.js";
3
+ import { InIcons as c } from "@useinsider/design-system-vue";
4
+ const f = /* @__PURE__ */ r({
5
+ __name: "InboxView",
6
+ props: {
7
+ emailData: null
8
+ },
9
+ emits: ["open-email"],
10
+ setup(o) {
11
+ const t = o, s = i(), a = n(() => {
12
+ var e;
13
+ return ((e = t.emailData) == null ? void 0 : e.senderName) || `(${s("settings.sender-name")})`;
14
+ }), m = n(() => {
15
+ var e;
16
+ return ((e = t.emailData) == null ? void 0 : e.subject) || s("newsletter.subject");
17
+ });
18
+ return { __sfc: !0, props: t, trans: s, senderName: a, subject: m, InIcons: c };
19
+ }
20
+ });
21
+ export {
22
+ f as default
23
+ };
@@ -1,8 +1,8 @@
1
- import type { EmailHeader } from '@@/Types/generic';
1
+ import type { EmailData } from '@@/Types/generic';
2
2
  interface Props {
3
- html: string;
3
+ emailHtml: string;
4
4
  isAmp: boolean;
5
- emailHeader?: EmailHeader;
5
+ emailData?: EmailData;
6
6
  }
7
7
  declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<Props>, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<Props>>>, {}>;
8
8
  export default _default;
@@ -0,0 +1,17 @@
1
+ import e from "./MobilePreview.vue2.js";
2
+ import o from "../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var i = function() {
4
+ var t = this, s = t._self._c, a = t._self._setupProxy;
5
+ return s("div", { staticClass: "d-f j-c-c p-4" }, [s("div", { staticClass: "p-r w-35-s h-26-s" }, [s("img", { staticClass: "w-1 h-1 d-b p-e-n", attrs: { alt: a.mockupAlt, src: a.mockupImage } }), s("div", { staticClass: "p-a l-3 w-21-s h-24-s o-h", style: { top: a.phoneScreenTopMargin } }, [a.showInbox ? s(a.InboxView, { attrs: { "email-data": a.props.emailData }, on: { "open-email": a.openEmail } }) : s(a.EmailView, { attrs: { "email-html": t.emailHtml, "is-amp": t.isAmp }, on: { "back-to-inbox": a.backToInbox } })], 1)])]);
6
+ }, n = [], r = /* @__PURE__ */ o(
7
+ e,
8
+ i,
9
+ n,
10
+ !1,
11
+ null,
12
+ null
13
+ );
14
+ const c = r.exports;
15
+ export {
16
+ c as default
17
+ };
@@ -0,0 +1,22 @@
1
+ import { defineComponent as c, ref as u, computed as e } from "vue";
2
+ import r from "./EmailView.vue.js";
3
+ import i from "./InboxView.vue.js";
4
+ const b = /* @__PURE__ */ c({
5
+ __name: "MobilePreview",
6
+ props: {
7
+ emailHtml: null,
8
+ isAmp: { type: Boolean },
9
+ emailData: null
10
+ },
11
+ setup(n) {
12
+ const p = n, o = u(!1), m = e(() => o.value ? "/inbox-mockup.svg" : "/phone-mockup.svg"), t = e(() => o.value ? "Inbox mockup" : "Phone mockup"), a = () => {
13
+ o.value = !1;
14
+ }, l = () => {
15
+ o.value = !0;
16
+ }, s = e(() => o.value ? "88px" : "44px");
17
+ return { __sfc: !0, props: p, showInbox: o, mockupImage: m, mockupAlt: t, openEmail: a, backToInbox: l, phoneScreenTopMargin: s, EmailView: r, InboxView: i };
18
+ }
19
+ });
20
+ export {
21
+ b as default
22
+ };
@@ -0,0 +1,21 @@
1
+ import n from "./AmpErrorModal.vue2.js";
2
+ import a from "../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var i = function() {
4
+ var e = this, o = e._self._c, t = e._self._setupProxy;
5
+ return o(t.InModalV2, { attrs: { id: "amp-error-modal", "close-button-status": "", "close-on-outside-click": "", "description-status": "", "footer-status": "", status: "", size: "medium", "description-text": t.trans("email.amp-validation-description"), "footer-button-group-options": t.footerButtonOptions, "title-text": t.trans("email.amp-validation-title") }, on: { cancelOrBackButtonEvent: t.handleClose, onCloseEvent: t.handleClose, primaryButtonEvent: t.handleFixInCodeEditor }, scopedSlots: e._u([{ key: "contentSlot", fn: function() {
6
+ return [o("div", { staticClass: "d-f f-d-c" }, [o("div", { staticClass: "mb-3" }, [o("div", { staticClass: "l-s-5 f-s-1 f-w-600 t-c-55 t-t-u" }, [e._v(" " + e._s(`${t.trans("products.errors")}(${t.errorCount})`) + " ")])]), o("div", { staticClass: "d-f f-d-c g-13 max-h-21-s o-y-a", staticStyle: { gap: "16px" } }, e._l(t.props.errors, function(s, r) {
7
+ return o(t.InOnPageMessage, { key: r, attrs: { icon: "filled-error-box", size: "medium", type: "alert", text: s } });
8
+ }), 1)])];
9
+ }, proxy: !0 }]) });
10
+ }, l = [], c = /* @__PURE__ */ a(
11
+ n,
12
+ i,
13
+ l,
14
+ !1,
15
+ null,
16
+ null
17
+ );
18
+ const f = c.exports;
19
+ export {
20
+ f as default
21
+ };
@@ -0,0 +1,27 @@
1
+ import { defineComponent as m } from "vue";
2
+ import { usePreviewMode as f } from "../../../composables/usePreviewMode.js";
3
+ import { useTranslations as u } from "../../../composables/useTranslations.js";
4
+ import { useEditorStore as E } from "../../../stores/editor.js";
5
+ import { InOnPageMessage as w, InModalV2 as A } from "@useinsider/design-system-vue";
6
+ const v = /* @__PURE__ */ m({
7
+ __name: "AmpErrorModal",
8
+ props: {
9
+ errors: null
10
+ },
11
+ emits: ["close"],
12
+ setup(a, { emit: o }) {
13
+ const r = a, p = r.errors.length, e = u(), t = E(), { disablePreviewUI: i } = f(), d = () => {
14
+ o("close");
15
+ }, l = () => {
16
+ var n, s;
17
+ o("close"), t.isPreviewModeOpen = !1, (s = (n = window.StripoEditorApi) == null ? void 0 : n.codeEditorApi) != null && s.openCodeEditor ? (i(), window.StripoEditorApi.codeEditorApi.openCodeEditor()) : console.error("StripoEditorApi codeEditorApi not available");
18
+ }, c = {
19
+ primaryButton: { type: "primary", labelText: e("email.amp-validation-fix") },
20
+ cancelOrBackButton: { type: "secondary", labelText: e("campaign-builder.cancel"), styling: "ghost" }
21
+ };
22
+ return { __sfc: !0, props: r, emit: o, errorCount: p, trans: e, editorStore: t, disablePreviewUI: i, handleClose: d, handleFixInCodeEditor: l, footerButtonOptions: c, InModalV2: A, InOnPageMessage: w };
23
+ }
24
+ });
25
+ export {
26
+ v as default
27
+ };
@@ -0,0 +1,19 @@
1
+ import o from "./AmpToggle.vue2.js";
2
+ import s from "../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var a = function() {
4
+ var e = this, t = e._self._c, r = e._self._setupProxy;
5
+ return r.editorStore.isPreviewModeOpen ? t("div", [t("div", { staticClass: "d-f a-i-c ml-3" }, [t(r.InSegments, { attrs: { id: "guido__amp-toggle", "segment-list": r.segmentList, selected: r.editorStore.emailFormat }, on: { click: r.handleFormatChange } }), r.editorStore.emailFormat === "amp" && r.hasAMPErrors ? t(r.InButtonV2, { staticClass: "ml-2 d-f a-i-c b-c-11 b-c-h-11 t-c-4 t-c-h-4 i-c-4 bor-w-1 bor-s-s bor-c-11", attrs: { id: "guido__amp-error-button", "left-icon": "line-error-box", type: "danger", "label-text-status": !1 }, on: { click: r.handleErrorClick } }) : e._e()], 1), r.showErrorModal ? t(r.AmpErrorModal, { attrs: { errors: r.editorStore.ampErrors || [] }, on: { close: function(c) {
6
+ r.showErrorModal = !1;
7
+ } } }) : e._e()], 1) : e._e();
8
+ }, n = [], i = /* @__PURE__ */ s(
9
+ o,
10
+ a,
11
+ n,
12
+ !1,
13
+ null,
14
+ null
15
+ );
16
+ const _ = i.exports;
17
+ export {
18
+ _ as default
19
+ };
@@ -0,0 +1,38 @@
1
+ import { defineComponent as i, ref as p, computed as t, watch as c } from "vue";
2
+ import { usePreviewMode as d } from "../../../composables/usePreviewMode.js";
3
+ import { useEditorStore as u } from "../../../stores/editor.js";
4
+ import { InButtonV2 as M, InSegments as f } from "@useinsider/design-system-vue";
5
+ import h from "./AmpErrorModal.vue.js";
6
+ const C = /* @__PURE__ */ i({
7
+ __name: "AmpToggle",
8
+ setup(E) {
9
+ const o = u(), { compile: a } = d(), m = p(!1), r = t(() => !!o.ampHtml), l = t(() => !!(o.ampErrors && o.ampErrors.length > 0)), s = t(() => [
10
+ { text: "HTML", value: "html" },
11
+ {
12
+ text: "AMP HTML",
13
+ value: "amp",
14
+ tooltipText: r.value ? "" : "AMP HTML Preview isn’t available as no AMP blocks found in your Email Design.",
15
+ position: "bottom",
16
+ align: "center",
17
+ disable: !r.value
18
+ }
19
+ ]), n = async () => {
20
+ try {
21
+ const e = await a();
22
+ o.ampHtml = e.ampHtml ?? null, o.ampErrors = e.ampErrors ?? null, o.emailFormat = e.ampHtml ? "amp" : "html";
23
+ } catch (e) {
24
+ console.error("Failed to compile for AMP:", e);
25
+ }
26
+ };
27
+ return c([() => o.editorVisualMode, () => o.isPreviewModeOpen], () => {
28
+ o.isPreviewModeOpen && n();
29
+ }, { immediate: !0 }), { __sfc: !0, editorStore: o, compile: a, showErrorModal: m, hasAMP: r, hasAMPErrors: l, segmentList: s, updateAmpData: n, handleFormatChange: (e) => {
30
+ o.emailFormat = e;
31
+ }, handleErrorClick: () => {
32
+ m.value = !0;
33
+ }, InSegments: f, InButtonV2: M, AmpErrorModal: h };
34
+ }
35
+ });
36
+ export {
37
+ C as default
38
+ };
@@ -2,11 +2,11 @@ import s from "./MiddleSlot.vue2.js";
2
2
  import i from "../../../_virtual/_plugin-vue2_normalizer.js";
3
3
  var n = function() {
4
4
  var o = this, e = o._self._c, t = o._self._setupProxy;
5
- return t.editorStore.isVersionHistoryOpen ? e("div", { staticClass: "d-f" }, [e(t.VersionHistory), e(t.VersionHistoryViewOptions)], 1) : e("div", { staticClass: "d-f" }, [e(t.InButtonV2, { attrs: { id: "guido__undo-button", "left-icon": "line-undo", styling: "ghost", type: "secondary", "disabled-status": t.isPreviewModeOpen, "label-text-status": !1 } }), e(t.InButtonV2, { attrs: { id: "guido__redo-button", "left-icon": "line-redo", styling: "ghost", type: "secondary", "disabled-status": t.isPreviewModeOpen, "label-text-status": !1 } }), e(t.InButtonV2, { attrs: { id: "guido__code-button", "data-testid": "Code Editor", "left-icon": "line-code", styling: "ghost", "tooltip-text": "Code Editor", type: "secondary", "disabled-status": t.isPreviewModeOpen, "label-text-status": !1, "selected-status": t.editorStore.isCodeEditorOpen, "tooltip-options": t.getTooltipOptions("guido__code-button") } }), e(t.InButtonV2, { attrs: { id: "guido__preview-button", "left-icon": "line-show-on", styling: "ghost", type: "secondary", "label-text-status": !1, "selected-status": t.isPreviewModeOpen, "tooltip-options": t.getTooltipOptions("guido__preview-button"), "tooltip-text": t.previewTooltipText }, on: { click: t.togglePreviewMode } }), e(t.ViewOptions, { staticClass: "ml-3" }), t.isPreviewModeOpen ? e(t.AmpToggle) : o._e()], 1);
6
- }, d = [], l = /* @__PURE__ */ i(
5
+ return t.editorStore.isVersionHistoryOpen ? e("div", { staticClass: "d-f" }, [e(t.VersionHistory), e(t.VersionHistoryViewOptions)], 1) : e("div", { staticClass: "d-f" }, [e(t.InButtonV2, { attrs: { id: "guido__undo-button", "left-icon": "line-undo", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isPreviewModeOpen, "label-text-status": !1 } }), e(t.InButtonV2, { attrs: { id: "guido__redo-button", "left-icon": "line-redo", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isPreviewModeOpen, "label-text-status": !1 } }), e(t.InButtonV2, { attrs: { id: "guido__code-button", "data-testid": "Code Editor", "left-icon": "line-code", styling: "ghost", "tooltip-text": "Code Editor", type: "secondary", "disabled-status": t.editorStore.isPreviewModeOpen, "label-text-status": !1, "selected-status": t.editorStore.isCodeEditorOpen, "tooltip-options": t.getTooltipOptions("guido__code-button") } }), e(t.InButtonV2, { attrs: { id: "guido__preview-button", "left-icon": "line-show-on", styling: "ghost", type: "secondary", "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__preview-button"), "tooltip-text": t.editorStore.isPreviewModeOpen ? t.trans("newsletter.close-email-preview") : t.trans("newsletter.email-preview") }, on: { click: t.handlePreviewClick } }), e(t.ViewOptions, { staticClass: "ml-3" }), e(t.AmpToggle)], 1);
6
+ }, r = [], l = /* @__PURE__ */ i(
7
7
  s,
8
8
  n,
9
- d,
9
+ r,
10
10
  !1,
11
11
  null,
12
12
  null