@useinsider/guido 1.0.0-beta.614e7ff → 1.0.0-beta.637a8ae

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/dist/@types/generic.d.ts +2 -1
  2. package/dist/components/Guido.vue.d.ts +1 -2
  3. package/dist/components/Guido.vue.js +8 -8
  4. package/dist/components/Guido.vue2.js +35 -37
  5. package/dist/components/organisms/{design-preview/DesktopPreview.vue.d.ts → email-preview/EmailPreviewContainer.vue.d.ts} +2 -3
  6. package/dist/components/organisms/email-preview/EmailPreviewContainer.vue.js +17 -0
  7. package/dist/components/organisms/email-preview/EmailPreviewContainer.vue2.js +32 -0
  8. package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue.js +19 -0
  9. package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue2.js +37 -0
  10. package/dist/components/organisms/email-preview/amp/AmpToggle.vue.js +17 -0
  11. package/dist/components/organisms/email-preview/amp/AmpToggle.vue2.js +57 -0
  12. package/dist/components/organisms/{design-preview/EmailPreview.vue.d.ts → email-preview/desktop-preview/DesktopPreview.vue.d.ts} +3 -3
  13. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +22 -0
  14. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +39 -0
  15. package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue.d.ts +15 -0
  16. package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue.js +17 -0
  17. package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue2.js +15 -0
  18. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.d.ts +19 -0
  19. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +17 -0
  20. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue2.js +17 -0
  21. package/dist/components/organisms/{design-preview → email-preview/mobile-preview}/InboxView.vue.d.ts +2 -2
  22. package/dist/components/organisms/{design-preview → email-preview/mobile-preview}/InboxView.vue.js +2 -2
  23. package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue2.js +23 -0
  24. package/dist/components/organisms/{design-preview → email-preview/mobile-preview}/MobilePreview.vue.d.ts +3 -3
  25. package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue.js +17 -0
  26. package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue2.js +27 -0
  27. package/dist/components/organisms/{design-preview/EmailView.vue.d.ts → email-preview/mobile-preview/OpenedEmailView.vue.d.ts} +2 -3
  28. package/dist/components/organisms/{design-preview/EmailView.vue.js → email-preview/mobile-preview/OpenedEmailView.vue.js} +4 -4
  29. package/dist/components/organisms/email-preview/mobile-preview/OpenedEmailView.vue2.js +26 -0
  30. package/dist/components/organisms/header/MiddleSlot.vue.js +4 -4
  31. package/dist/components/organisms/header/MiddleSlot.vue2.js +15 -16
  32. package/dist/components/organisms/header/RightSlot.vue.js +1 -1
  33. package/dist/components/organisms/header/RightSlot.vue2.js +18 -17
  34. package/dist/components/organisms/header/ViewOptions.vue.js +5 -5
  35. package/dist/components/organisms/header/ViewOptions.vue2.js +10 -8
  36. package/dist/components/wrappers/BaseModal.vue.d.ts +76 -0
  37. package/dist/components/wrappers/BaseModal.vue.js +19 -0
  38. package/dist/components/wrappers/BaseModal.vue2.js +22 -0
  39. package/dist/composables/useActionsApi.js +15 -15
  40. package/dist/composables/useCodeEditorApi.d.ts +5 -0
  41. package/dist/composables/useCodeEditorApi.js +17 -0
  42. package/dist/composables/useEmailResponsiveFit.d.ts +5 -0
  43. package/dist/composables/useEmailResponsiveFit.js +72 -0
  44. package/dist/composables/usePreviewMode.d.ts +6 -0
  45. package/dist/composables/usePreviewMode.js +21 -0
  46. package/dist/enums/defaults.js +10 -6
  47. package/dist/guido.css +1 -1
  48. package/dist/stores/editor.d.ts +0 -3
  49. package/dist/stores/editor.js +3 -6
  50. package/dist/stores/preview.d.ts +56 -0
  51. package/dist/stores/preview.js +23 -0
  52. package/package.json +1 -1
  53. package/dist/components/organisms/design-preview/AmpErrorModal.vue.js +0 -21
  54. package/dist/components/organisms/design-preview/AmpErrorModal.vue2.js +0 -30
  55. package/dist/components/organisms/design-preview/DesktopPreview.vue.js +0 -22
  56. package/dist/components/organisms/design-preview/DesktopPreview.vue2.js +0 -43
  57. package/dist/components/organisms/design-preview/EmailPreview.vue.js +0 -17
  58. package/dist/components/organisms/design-preview/EmailPreview.vue2.js +0 -33
  59. package/dist/components/organisms/design-preview/EmailView.vue2.js +0 -24
  60. package/dist/components/organisms/design-preview/InboxView.vue2.js +0 -23
  61. package/dist/components/organisms/design-preview/MobilePreview.vue.js +0 -17
  62. package/dist/components/organisms/design-preview/MobilePreview.vue2.js +0 -24
  63. package/dist/components/organisms/header/AmpToggle.vue.js +0 -17
  64. package/dist/components/organisms/header/AmpToggle.vue2.js +0 -48
  65. package/dist/composables/useMobileGmailFit.d.ts +0 -5
  66. package/dist/composables/useMobileGmailFit.js +0 -69
  67. package/dist/enums/emailPreview.d.ts +0 -3
  68. package/dist/enums/emailPreview.js +0 -4
  69. /package/dist/components/organisms/{design-preview → email-preview/amp}/AmpErrorModal.vue.d.ts +0 -0
  70. /package/dist/components/organisms/{header → email-preview/amp}/AmpToggle.vue.d.ts +0 -0
@@ -3,13 +3,14 @@ export type GuidoConfig = {
3
3
  translationsPath: string;
4
4
  htmlCompilerRules?: CompilerRule[];
5
5
  ignoreDefaultHtmlCompilerRules?: boolean;
6
+ emailHeader: EmailHeader;
6
7
  };
7
8
  export type DynamicContent = {
8
9
  value: string;
9
10
  text: string;
10
11
  fallback?: string;
11
12
  };
12
- export interface EmailData {
13
+ export interface EmailHeader {
13
14
  senderName: string;
14
15
  subject: string;
15
16
  }
@@ -1,4 +1,4 @@
1
- import type { DynamicContent, GuidoConfig, EmailData } from '@@/Types/generic';
1
+ import type { DynamicContent, GuidoConfig } from '@@/Types/generic';
2
2
  import type { Template } from '@@/Types/stripo';
3
3
  type __VLS_Props = {
4
4
  templateId: string;
@@ -9,7 +9,6 @@ type __VLS_Props = {
9
9
  html?: string;
10
10
  css?: string;
11
11
  guidoConfig: GuidoConfig;
12
- emailData?: EmailData;
13
12
  };
14
13
  declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {
15
14
  dynamicContent: {
@@ -1,18 +1,18 @@
1
1
  import o from "./Guido.vue2.js";
2
2
  /* empty css */
3
- import t from "../_virtual/_plugin-vue2_normalizer.js";
4
- var s = function() {
3
+ import s from "../_virtual/_plugin-vue2_normalizer.js";
4
+ var a = 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), 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
- }, a = [], d = /* @__PURE__ */ t(
6
+ return r("div", { staticClass: "guido-editor__wrapper" }, [r(e.HeaderWrapper), e.isPreviewModeOpen ? r(e.EmailPreview, { attrs: { "email-header": e.guidoConfig.emailHeader } }) : i._e(), r("div", { directives: [{ name: "show", rawName: "v-show", value: !e.isPreviewModeOpen, expression: "!isPreviewModeOpen" }], staticClass: "guido-editor__container", attrs: { id: "guido-editor" } })], 1);
7
+ }, t = [], d = /* @__PURE__ */ s(
8
8
  o,
9
- s,
10
9
  a,
10
+ t,
11
11
  !1,
12
12
  null,
13
- "7836f831"
13
+ "988dfdfd"
14
14
  );
15
- const m = d.exports;
15
+ const v = d.exports;
16
16
  export {
17
- m as default
17
+ v as default
18
18
  };
@@ -1,13 +1,12 @@
1
- import { defineComponent as w, onMounted as E } from "vue";
1
+ import { defineComponent as E, defineAsyncComponent as P, onMounted as D } from "vue";
2
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";
9
- import { useEditorStore as N } from "../stores/editor.js";
10
- const M = /* @__PURE__ */ w({
3
+ import { usePartner as _ } from "../composables/usePartner.js";
4
+ import { usePreviewMode as G } from "../composables/usePreviewMode.js";
5
+ import { useStripo as I } from "../composables/useStripo.js";
6
+ import { DefaultUsername as k, DefaultGuidoConfig as T } from "../enums/defaults.js";
7
+ import A from "./organisms/header/HeaderWrapper.vue.js";
8
+ import { useStripoApi as M } from "../services/stripoApi.js";
9
+ const L = /* @__PURE__ */ E({
11
10
  __name: "Guido",
12
11
  props: {
13
12
  templateId: null,
@@ -17,48 +16,47 @@ const M = /* @__PURE__ */ w({
17
16
  username: null,
18
17
  html: null,
19
18
  css: null,
20
- guidoConfig: null,
21
- emailData: null
19
+ guidoConfig: null
22
20
  },
23
21
  emits: ["dynamic-content:open", "back", "save:start", "save:complete"],
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,
29
- html: s = "",
30
- css: l = "",
31
- partnerName: d = n(),
32
- productType: u = a(),
33
- username: m = G
34
- } = o;
22
+ setup(C, { expose: b, emit: o }) {
23
+ const t = C, w = P(() => import("./organisms/email-preview/EmailPreviewContainer.vue.js")), { getPartnerName: n, getProductType: c } = _(), { isPreviewModeOpen: h } = G(), {
24
+ templateId: a,
25
+ userId: i,
26
+ guidoConfig: s,
27
+ html: r = "",
28
+ css: d = "",
29
+ partnerName: l = n(),
30
+ productType: u = c(),
31
+ username: m = k
32
+ } = t;
35
33
  window.GuidoConfig = {
36
- ...I,
37
- ...i
34
+ ...T,
35
+ ...s
38
36
  };
39
- const { initPlugin: p } = _({ emailId: c, userId: r, username: m, partnerName: d, productType: u }), { getDefaultTemplate: f } = T(), h = N();
37
+ const { initPlugin: p } = I({ emailId: a, userId: i, username: m, partnerName: l, productType: u }), { getDefaultTemplate: f } = M();
40
38
  S({
41
39
  onBack: () => {
42
- console.debug("guido:back"), t("back");
40
+ console.debug("guido:back"), o("back");
43
41
  },
44
42
  onSaveStart: () => {
45
- console.debug("guido:save:start"), t("save:start");
43
+ console.debug("guido:save:start"), o("save:start");
46
44
  },
47
45
  onSaveComplete: (e) => {
48
- console.debug("guido:save:complete", e), t("save:complete", e);
46
+ console.debug("guido:save:complete", e), o("save:complete", e);
49
47
  }
50
48
  });
51
49
  const g = (e) => {
52
50
  console.debug("dynamic-content:close", e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
53
- }, y = () => {
51
+ }, v = () => {
54
52
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
55
53
  };
56
- return E(async () => {
54
+ return D(async () => {
57
55
  console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow");
58
56
  try {
59
57
  let e = {
60
- html: s,
61
- css: l,
58
+ html: r,
59
+ css: d,
62
60
  forceRecreate: !0
63
61
  // TODO: It should be false for old templates. We will communicate with Stripo
64
62
  };
@@ -67,17 +65,17 @@ const M = /* @__PURE__ */ w({
67
65
  console.error("Failed to initialize Stripo editor:", e);
68
66
  }
69
67
  document.addEventListener("dynamic-content:open", (e) => {
70
- const v = e;
71
- console.debug("dynamic-content:open", v.detail), t("dynamic-content:open", v.detail);
68
+ const y = e;
69
+ console.debug("dynamic-content:open", y.detail), o("dynamic-content:open", y.detail);
72
70
  });
73
71
  }), b({
74
72
  dynamicContent: {
75
73
  insert: g,
76
- close: y
74
+ close: v
77
75
  }
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 };
76
+ }), { __sfc: !0, EmailPreview: w, props: t, getPartnerName: n, getProductType: c, isPreviewModeOpen: h, templateId: a, userId: i, guidoConfig: s, html: r, css: d, partnerName: l, productType: u, username: m, emit: o, initPlugin: p, getDefaultTemplate: f, insertDynamicContent: g, closeDynamicContent: v, HeaderWrapper: A };
79
77
  }
80
78
  });
81
79
  export {
82
- M as default
80
+ L as default
83
81
  };
@@ -1,7 +1,6 @@
1
- import type { EmailData } from '@@/Types/generic';
1
+ import type { EmailHeader } from '@@/Types/generic';
2
2
  interface Props {
3
- emailHtml: string;
4
- emailData?: EmailData;
3
+ emailHeader: EmailHeader;
5
4
  }
6
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, {}, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<Props>>>, {}>;
7
6
  export default _default;
@@ -0,0 +1,17 @@
1
+ import t from "./EmailPreviewContainer.vue2.js";
2
+ import r from "../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var i = function() {
4
+ var s = this, a = s._self._c, e = s._self._setupProxy;
5
+ return a("div", { staticClass: "d-f f-d-c h-1 b-c-5 bor-r-2 pb-5" }, [a("div", { staticClass: "f-g-1 d-f p-5 o-a g-4 min-h-600" }, [e.isLoading ? [a("div", { staticClass: "d-f a-i-c j-c-c w-1 h-1 f-g-1" }, [a(e.InLoading, { attrs: { "color-class": "i-c-1", size: "32" } })], 1)] : [a(e.DesktopPreview, { staticClass: "f-g-1 min-w-0", attrs: { "email-header": s.emailHeader, html: e.currentHtml } }), a(e.MobilePreview, { staticClass: "f-0 min-w-a", attrs: { "email-header": s.emailHeader, html: e.currentHtml, "is-amp": e.isAmp } })]], 2)]);
6
+ }, l = [], n = /* @__PURE__ */ r(
7
+ t,
8
+ i,
9
+ l,
10
+ !1,
11
+ null,
12
+ null
13
+ );
14
+ const f = n.exports;
15
+ export {
16
+ f as default
17
+ };
@@ -0,0 +1,32 @@
1
+ import { defineComponent as p, ref as c, computed as i, onMounted as d } from "vue";
2
+ import { useActionsApi as f } from "../../../composables/useActionsApi.js";
3
+ import { useToaster as u } from "../../../composables/useToaster.js";
4
+ import { usePreviewStore as v } from "../../../stores/preview.js";
5
+ import { InLoading as w } from "@useinsider/design-system-vue";
6
+ import P from "./desktop-preview/DesktopPreview.vue.js";
7
+ import _ from "./mobile-preview/MobilePreview.vue.js";
8
+ const D = /* @__PURE__ */ p({
9
+ __name: "EmailPreviewContainer",
10
+ props: {
11
+ emailHeader: null
12
+ },
13
+ setup(s) {
14
+ const { emailHeader: g } = s, { getPreviewData: r } = f(), { showToaster: t } = u(), e = v(), o = c(!1), n = i(() => e.previewHtml), m = i(() => e.isAMPModeEnabled), a = async () => {
15
+ o.value = !0;
16
+ try {
17
+ const l = await r();
18
+ e.templateHtml = l.html;
19
+ } catch {
20
+ console.error("Failed to load preview"), t({ type: "error", message: "Failed to load email preview. Please try again later." });
21
+ } finally {
22
+ o.value = !1;
23
+ }
24
+ };
25
+ return d(() => {
26
+ a();
27
+ }), { __sfc: !0, getPreviewData: r, showToaster: t, previewStore: e, isLoading: o, currentHtml: n, isAmp: m, loadPreview: a, InLoading: w, DesktopPreview: P, MobilePreview: _ };
28
+ }
29
+ });
30
+ export {
31
+ D as default
32
+ };
@@ -0,0 +1,19 @@
1
+ import a from "./AmpErrorModal.vue2.js";
2
+ import i from "../../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var n = function() {
4
+ var e = this, r = e._self._c, t = e._self._setupProxy;
5
+ return r(t.BaseModal, { attrs: { id: "amp-error-modal", size: "medium", description: t.modalDescription, "footer-button-options": t.footerButtonOptions, title: t.modalTitle }, on: { close: t.handleClose, "primary-action": t.handleFixInCodeEditor } }, [r("div", { staticClass: "d-f f-d-c" }, [r("div", { staticClass: "mb-3" }, [r("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})`) + " ")])]), r("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(o, s) {
6
+ return r(t.InOnPageMessage, { key: s, attrs: { icon: "filled-error-box", size: "medium", type: "alert", text: o } });
7
+ }), 1)])]);
8
+ }, l = [], d = /* @__PURE__ */ i(
9
+ a,
10
+ n,
11
+ l,
12
+ !1,
13
+ null,
14
+ null
15
+ );
16
+ const f = d.exports;
17
+ export {
18
+ f as default
19
+ };
@@ -0,0 +1,37 @@
1
+ import { defineComponent as u, computed as e } from "vue";
2
+ import f from "../../../wrappers/BaseModal.vue.js";
3
+ import { useCodeEditorApi as C } from "../../../../composables/useCodeEditorApi.js";
4
+ import { usePreviewMode as E } from "../../../../composables/usePreviewMode.js";
5
+ import { useToaster as g } from "../../../../composables/useToaster.js";
6
+ import { useTranslations as h } from "../../../../composables/useTranslations.js";
7
+ import { InOnPageMessage as v } from "@useinsider/design-system-vue";
8
+ const I = /* @__PURE__ */ u({
9
+ __name: "AmpErrorModal",
10
+ props: {
11
+ errors: null
12
+ },
13
+ emits: ["close"],
14
+ setup(l, { emit: t }) {
15
+ const i = l, o = h(), { closePreviewMode: s } = E(), { showToaster: a } = g(), { openCodeEditor: n, isCodeEditorApiAvailable: r } = C(), d = e(() => i.errors.length), p = e(() => o("email-editor.amp-validation-title")), m = e(() => o("email-editor.amp-validation-description")), c = e(() => ({
16
+ cancelOrBackButton: {
17
+ type: "secondary",
18
+ labelText: o("campaign-builder.cancel"),
19
+ styling: "ghost"
20
+ },
21
+ primaryButton: {
22
+ type: "primary",
23
+ labelText: o("email-editor.amp-validation-fix"),
24
+ disabledStatus: !r()
25
+ }
26
+ }));
27
+ return { __sfc: !0, props: i, emit: t, trans: o, closePreviewMode: s, showToaster: a, openCodeEditor: n, isCodeEditorApiAvailable: r, errorCount: d, modalTitle: p, modalDescription: m, footerButtonOptions: c, handleClose: () => t("close"), handleFixInCodeEditor: () => {
28
+ t("close"), s(), r() ? n() : a({
29
+ type: "error",
30
+ message: "StripoEditorApi codeEditorApi not available"
31
+ });
32
+ }, BaseModal: f, InOnPageMessage: v };
33
+ }
34
+ });
35
+ export {
36
+ I as default
37
+ };
@@ -0,0 +1,17 @@
1
+ import o from "./AmpToggle.vue2.js";
2
+ import s from "../../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var a = function() {
4
+ var t = this, e = t._self._c, r = t._self._setupProxy;
5
+ return e("div", [e("div", { staticClass: "d-f a-i-c ml-3" }, [e(r.InSegments, { attrs: { id: "guido__amp-toggle", "segment-list": r.segmentList, selected: r.previewStore.emailFormat }, on: { click: r.handleFormatChange } }), r.showErrorButton ? e(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 bor-r-2", attrs: { id: "guido__amp-error-button", "left-icon": "line-error-box", type: "danger", "label-text-status": !1 }, on: { click: r.handleErrorClick } }) : t._e()], 1), r.isErrorModalVisible ? e(r.AmpErrorModal, { attrs: { errors: r.previewStore.AMPErrors }, on: { close: r.closeErrorModal } }) : t._e()], 1);
6
+ }, l = [], n = /* @__PURE__ */ s(
7
+ o,
8
+ a,
9
+ l,
10
+ !1,
11
+ null,
12
+ null
13
+ );
14
+ const m = n.exports;
15
+ export {
16
+ m as default
17
+ };
@@ -0,0 +1,57 @@
1
+ import { defineComponent as M, ref as P, computed as r, onMounted as f } from "vue";
2
+ import { useActionsApi as h } from "../../../../composables/useActionsApi.js";
3
+ import { useToaster as v } from "../../../../composables/useToaster.js";
4
+ import { useTranslations as E } from "../../../../composables/useTranslations.js";
5
+ import { usePreviewStore as g } from "../../../../stores/preview.js";
6
+ import { InButtonV2 as _, InSegments as w } from "@useinsider/design-system-vue";
7
+ import b from "./AmpErrorModal.vue.js";
8
+ const H = /* @__PURE__ */ M({
9
+ __name: "AmpToggle",
10
+ setup(y) {
11
+ const e = g(), { getPreviewData: s } = h(), { showToaster: n } = v(), o = E(), a = P(!1), i = r(() => e.hasAMP), l = r(() => e.hasAMPErrors), c = r(() => {
12
+ const t = !i.value;
13
+ return [
14
+ {
15
+ text: o("dynamic-creatives.html"),
16
+ value: "html"
17
+ },
18
+ {
19
+ text: o("email-editor.amp-html"),
20
+ value: "AMP",
21
+ tooltipText: t ? o("email-editor.preview-amp-unavailable-tooltip") : "",
22
+ position: "bottom",
23
+ align: "center",
24
+ disable: t
25
+ }
26
+ ];
27
+ }), p = r(() => e.isAMPModeEnabled && l.value), m = async () => {
28
+ try {
29
+ const t = await s();
30
+ e.updateAMPData({
31
+ AMPHtml: t.AMPHtml,
32
+ AMPErrors: t.AMPErrors
33
+ });
34
+ } catch {
35
+ n({
36
+ type: "error",
37
+ message: "Failed to load AMP data. Please try again later."
38
+ });
39
+ }
40
+ };
41
+ f(() => {
42
+ m();
43
+ });
44
+ const u = (t) => {
45
+ e.emailFormat = t;
46
+ }, d = () => {
47
+ a.value = !0;
48
+ };
49
+ function A() {
50
+ a.value = !1;
51
+ }
52
+ return { __sfc: !0, previewStore: e, getPreviewData: s, showToaster: n, trans: o, isErrorModalVisible: a, hasAMP: i, hasAMPErrors: l, segmentList: c, showErrorButton: p, updateAmpData: m, handleFormatChange: u, handleErrorClick: d, closeErrorModal: A, InSegments: w, InButtonV2: _, AmpErrorModal: b };
53
+ }
54
+ });
55
+ export {
56
+ H as default
57
+ };
@@ -1,7 +1,7 @@
1
- import type { EmailData } from '@@/Types/generic';
1
+ import type { EmailHeader } from '@@/Types/generic';
2
2
  interface Props {
3
- isVisible: boolean;
4
- emailData?: EmailData;
3
+ html: string;
4
+ emailHeader?: EmailHeader;
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,22 @@
1
+ import s from "./DesktopPreview.vue2.js";
2
+ /* empty css */
3
+ import a from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var o = function() {
5
+ var r = this, t = r._self._c, e = r._self._setupProxy;
6
+ return t("div", { ref: "containerRef", staticStyle: { "min-height": "720px", height: "80vh" } }, [t(e.InContainer, { staticClass: "s-2 m-b-5 desktop-preview-container", attrs: { "full-width-content-status": "", "header-status": "", "border-radius": "bor-r-1", "container-type": "default", "footer-status": !1 }, scopedSlots: r._u([{ key: "headerLeftSlot", fn: function() {
7
+ return [t(e.EmailHeaderInfo, { attrs: { "sender-name": e.senderName, subject: e.subject } })];
8
+ }, proxy: !0 }, { key: "headerRightSlot", fn: function() {
9
+ return [t(e.EmailSizeIndicator, { attrs: { "html-size": e.htmlSize, "max-value": e.MAX_EMAIL_SIZE_IN_KB, progress: e.progress } })];
10
+ }, proxy: !0 }]) }, [t("iframe", { staticClass: "email-iframe w-1 bor-w-0", style: { height: e.iframeHeight }, attrs: { sandbox: "allow-same-origin allow-popups allow-forms allow-scripts", srcdoc: e.html } })])], 1);
11
+ }, n = [], i = /* @__PURE__ */ a(
12
+ s,
13
+ o,
14
+ n,
15
+ !1,
16
+ null,
17
+ "9a504b0d"
18
+ );
19
+ const p = i.exports;
20
+ export {
21
+ p as default
22
+ };
@@ -0,0 +1,39 @@
1
+ import { defineComponent as E, computed as f, ref as r, onMounted as y, onUnmounted as M, watch as R } from "vue";
2
+ import { useTranslations as S } from "../../../../composables/useTranslations.js";
3
+ import { InContainer as C } from "@useinsider/design-system-vue";
4
+ import j from "./EmailHeaderInfo.vue.js";
5
+ import x from "./EmailSizeIndicator.vue.js";
6
+ const A = /* @__PURE__ */ E({
7
+ __name: "DesktopPreview",
8
+ props: {
9
+ html: null,
10
+ emailHeader: null
11
+ },
12
+ setup(v) {
13
+ var h, d;
14
+ const e = v, s = 102, l = S(), g = ((h = e.emailHeader) == null ? void 0 : h.senderName) || `(${l("settings.sender-name")})`, _ = ((d = e.emailHeader) == null ? void 0 : d.subject) || l("newsletter.subject"), H = f(() => e.html), n = r(0), B = f(() => `~${n.value} KB`), c = r({
15
+ type: "success",
16
+ value: 0
17
+ }), o = r(), u = r("400px"), m = () => {
18
+ const a = new Blob([e.html]).size;
19
+ n.value = Math.round(a / 1024), c.value.value = Math.min(n.value, s), c.value.type = n.value < s ? "success" : "warning";
20
+ }, i = () => {
21
+ if (!o.value)
22
+ return;
23
+ const a = o.value.querySelector(".in-container");
24
+ if (!a)
25
+ return;
26
+ const I = a.getBoundingClientRect(), p = a.querySelector(".in-container__header"), b = p ? p.getBoundingClientRect().height : 0, w = I.height - b;
27
+ u.value = `${w}px`;
28
+ };
29
+ let t = null;
30
+ return y(() => {
31
+ i(), o.value && (t = new ResizeObserver(i), t.observe(o.value));
32
+ }), M(() => {
33
+ t == null || t.disconnect();
34
+ }), R(() => e.html, m, { immediate: !0 }), { __sfc: !0, MAX_EMAIL_SIZE_IN_KB: s, trans: l, props: e, senderName: g, subject: _, html: H, htmlKB: n, htmlSize: B, progress: c, containerRef: o, iframeHeight: u, calculateProgress: m, calculateIframeHeight: i, resizeObserver: t, InContainer: C, EmailHeaderInfo: j, EmailSizeIndicator: x };
35
+ }
36
+ });
37
+ export {
38
+ A as default
39
+ };
@@ -0,0 +1,15 @@
1
+ interface Props {
2
+ senderName: string;
3
+ subject: string;
4
+ }
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, {}, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<Props>>>, {}>;
6
+ export default _default;
7
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
8
+ type __VLS_TypePropsToOption<T> = {
9
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
10
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
11
+ } : {
12
+ type: import('vue').PropType<T[K]>;
13
+ required: true;
14
+ };
15
+ };
@@ -0,0 +1,17 @@
1
+ import e from "./EmailHeaderInfo.vue2.js";
2
+ import c from "../../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var r = function() {
4
+ var s = this, t = s._self._c, a = s._self._setupProxy;
5
+ return t("div", { staticClass: "d-f a-i-c j-c-s-b w-1" }, [t("div", { staticClass: "d-f a-i-c" }, [t("div", { staticClass: "b-c-49 bor-r-100 w-5-s h-5-s d-f a-i-c j-c-c" }, [t(a.InIcons, { attrs: { name: "line-menu-profile" } })], 1), t("div", { staticClass: "d-f f-d-c ml-2" }, [t("p", { staticClass: "t-c-53 f-w-600 f-s-1 l-h-1" }, [s._v(" " + s._s(s.senderName) + " ")]), t("p", { staticClass: "t-c-55 f-w-400 f-s-12 l-h-1" }, [s._v(" " + s._s(s.subject) + " ")])])])]);
6
+ }, i = [], n = /* @__PURE__ */ c(
7
+ e,
8
+ r,
9
+ i,
10
+ !1,
11
+ null,
12
+ null
13
+ );
14
+ const o = n.exports;
15
+ export {
16
+ o as default
17
+ };
@@ -0,0 +1,15 @@
1
+ import { defineComponent as e } from "vue";
2
+ import { InIcons as n } from "@useinsider/design-system-vue";
3
+ const t = /* @__PURE__ */ e({
4
+ __name: "EmailHeaderInfo",
5
+ props: {
6
+ senderName: null,
7
+ subject: null
8
+ },
9
+ setup(o) {
10
+ return { __sfc: !0, InIcons: n };
11
+ }
12
+ });
13
+ export {
14
+ t as default
15
+ };
@@ -0,0 +1,19 @@
1
+ interface Props {
2
+ htmlSize: string;
3
+ progress: {
4
+ type: 'success' | 'warning';
5
+ value: number;
6
+ };
7
+ maxValue: number;
8
+ }
9
+ 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>>>, {}>;
10
+ export default _default;
11
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
12
+ type __VLS_TypePropsToOption<T> = {
13
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
14
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
15
+ } : {
16
+ type: import('vue').PropType<T[K]>;
17
+ required: true;
18
+ };
19
+ };
@@ -0,0 +1,17 @@
1
+ import i from "./EmailSizeIndicator.vue2.js";
2
+ import r from "../../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var o = function() {
4
+ var t = this, e = t._self._c, s = t._self._setupProxy;
5
+ return e("div", { staticClass: "d-f a-i-c j-c-c" }, [e(s.InProgress, { staticClass: "min-w-15-s", attrs: { id: "email-size-progress", "description-status": "", "description-position": "left", description: t.htmlSize, "max-value": t.maxValue, type: t.progress.type, value: t.progress.value } }), e(s.InTooltip, { staticClass: "d-f ml-1", attrs: { id: "email-size-tooltip", align: "center", position: "bottom", text: s.trans("email-editor.preview-design-size-tooltip") } })], 1);
6
+ }, a = [], n = /* @__PURE__ */ r(
7
+ i,
8
+ o,
9
+ a,
10
+ !1,
11
+ null,
12
+ null
13
+ );
14
+ const m = n.exports;
15
+ export {
16
+ m as default
17
+ };
@@ -0,0 +1,17 @@
1
+ import { defineComponent as r } from "vue";
2
+ import { useTranslations as o } from "../../../../composables/useTranslations.js";
3
+ import { InTooltip as n, InProgress as s } from "@useinsider/design-system-vue";
4
+ const p = /* @__PURE__ */ r({
5
+ __name: "EmailSizeIndicator",
6
+ props: {
7
+ htmlSize: null,
8
+ progress: null,
9
+ maxValue: null
10
+ },
11
+ setup(t) {
12
+ return { __sfc: !0, trans: o(), InProgress: s, InTooltip: n };
13
+ }
14
+ });
15
+ export {
16
+ p as default
17
+ };
@@ -1,6 +1,6 @@
1
- import type { EmailData } from '@@/Types/generic';
1
+ import type { EmailHeader } from '@@/Types/generic';
2
2
  interface Props {
3
- emailData?: EmailData;
3
+ emailHeader?: EmailHeader;
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 s.$emit("open-email");
6
+ return c.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 i, computed as t } from "vue";
2
+ import { useTranslations as c } from "../../../../composables/useTranslations.js";
3
+ import { InIcons as p } from "@useinsider/design-system-vue";
4
+ const f = /* @__PURE__ */ i({
5
+ __name: "InboxView",
6
+ props: {
7
+ emailHeader: null
8
+ },
9
+ emits: ["open-email"],
10
+ setup(o, { emit: r }) {
11
+ const s = o, n = c(), m = t(() => {
12
+ var e;
13
+ return ((e = s.emailHeader) == null ? void 0 : e.senderName) || `(${n("settings.sender-name")})`;
14
+ }), a = t(() => {
15
+ var e;
16
+ return ((e = s.emailHeader) == null ? void 0 : e.subject) || n("newsletter.subject");
17
+ });
18
+ return { __sfc: !0, props: s, emit: r, trans: n, senderName: m, subject: a, InIcons: p };
19
+ }
20
+ });
21
+ export {
22
+ f as default
23
+ };
@@ -1,8 +1,8 @@
1
- import type { EmailData } from '@@/Types/generic';
1
+ import type { EmailHeader } from '@@/Types/generic';
2
2
  interface Props {
3
- emailHtml: string;
3
+ html: string;
4
4
  isAmp: boolean;
5
- emailData?: EmailData;
5
+ emailHeader?: EmailHeader;
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 a from "./MobilePreview.vue2.js";
2
+ import o from "../../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var r = function() {
4
+ var t = this, s = t._self._c, e = t._self._setupProxy;
5
+ return s("div", { staticClass: "d-f j-c-c pl-5" }, [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: e.mockup.alt, src: e.mockup.image } }), s("div", { staticClass: "p-a w-21-s h-24-s o-h", style: { top: e.phoneScreenTopMargin, left: "20px" } }, [e.showInbox ? s(e.InboxView, { attrs: { "email-header": e.props.emailHeader }, on: { "open-email": e.openEmail } }) : s(e.OpenedEmailView, { attrs: { html: e.html, "is-amp": t.isAmp }, on: { "back-to-inbox": e.backToInbox } })], 1)])]);
6
+ }, i = [], n = /* @__PURE__ */ o(
7
+ a,
8
+ r,
9
+ i,
10
+ !1,
11
+ null,
12
+ null
13
+ );
14
+ const c = n.exports;
15
+ export {
16
+ c as default
17
+ };