@useinsider/guido 1.0.0-beta.c2acdd4 → 1.0.0-beta.c798ebe

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 (80) hide show
  1. package/dist/@types/generic.d.ts +5 -0
  2. package/dist/components/Guido.vue.js +6 -6
  3. package/dist/components/Guido.vue2.js +36 -37
  4. package/dist/components/organisms/email-preview/PreviewContainer.vue.d.ts +2 -0
  5. package/dist/components/organisms/email-preview/PreviewContainer.vue.js +19 -0
  6. package/dist/components/organisms/email-preview/PreviewContainer.vue2.js +19 -0
  7. package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue.d.ts +4 -0
  8. package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue.js +22 -0
  9. package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue2.js +30 -0
  10. package/dist/components/organisms/email-preview/amp/AmpToggle.vue.d.ts +2 -0
  11. package/dist/components/organisms/email-preview/amp/AmpToggle.vue.js +19 -0
  12. package/dist/components/organisms/email-preview/amp/AmpToggle.vue2.js +29 -0
  13. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.d.ts +2 -0
  14. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +22 -0
  15. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +30 -0
  16. package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue.d.ts +2 -0
  17. package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue.js +17 -0
  18. package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue2.js +20 -0
  19. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.d.ts +2 -0
  20. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +18 -0
  21. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue2.js +22 -0
  22. package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.d.ts +4 -0
  23. package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +19 -0
  24. package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue2.js +23 -0
  25. package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue.d.ts +4 -0
  26. package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue.js +20 -0
  27. package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue2.js +21 -0
  28. package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue.d.ts +2 -0
  29. package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue.js +17 -0
  30. package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue2.js +22 -0
  31. package/dist/components/organisms/header/MiddleSlot.vue.js +9 -9
  32. package/dist/components/organisms/header/MiddleSlot.vue2.js +19 -14
  33. package/dist/components/organisms/header/RightSlot.vue.js +3 -3
  34. package/dist/components/organisms/header/RightSlot.vue2.js +19 -20
  35. package/dist/components/organisms/header/ViewOptions.vue.js +8 -8
  36. package/dist/components/organisms/header/ViewOptions.vue2.js +10 -8
  37. package/dist/components/wrappers/{ModalWrapper.vue.d.ts → WpModal.vue.d.ts} +37 -33
  38. package/dist/components/wrappers/WpModal.vue.js +27 -0
  39. package/dist/components/wrappers/WpModal.vue2.js +22 -0
  40. package/dist/composables/useActionsApi.d.ts +3 -2
  41. package/dist/composables/useActionsApi.js +49 -43
  42. package/dist/composables/useCodeEditorApi.d.ts +4 -0
  43. package/dist/composables/useCodeEditorApi.js +11 -0
  44. package/dist/composables/useConfig.d.ts +5 -0
  45. package/dist/composables/useConfig.js +11 -0
  46. package/dist/composables/useDebounce.d.ts +4 -0
  47. package/dist/composables/useDebounce.js +12 -0
  48. package/dist/composables/useHttp.js +21 -23
  49. package/dist/composables/usePreviewMode.d.ts +5 -0
  50. package/dist/composables/usePreviewMode.js +31 -0
  51. package/dist/composables/useResponsivePreview.d.ts +5 -0
  52. package/dist/composables/useResponsivePreview.js +86 -0
  53. package/dist/enums/defaults.js +9 -5
  54. package/dist/enums/preview.d.ts +13 -0
  55. package/dist/enums/preview.js +23 -0
  56. package/dist/guido.css +1 -1
  57. package/dist/static/assets/inbox-mockup.svg.js +4 -0
  58. package/dist/static/assets/phone-mockup.svg.js +4 -0
  59. package/dist/stores/editor.d.ts +0 -1
  60. package/dist/stores/editor.js +1 -2
  61. package/dist/stores/preview.d.ts +89 -0
  62. package/dist/stores/preview.js +63 -0
  63. package/package.json +3 -1
  64. package/dist/components/organisms/save-template/SaveTemplateModal.vue.d.ts +0 -16
  65. package/dist/components/organisms/save-template/SaveTemplateModal.vue.js +0 -20
  66. package/dist/components/organisms/save-template/SaveTemplateModal.vue2.js +0 -78
  67. package/dist/components/wrappers/ModalWrapper.vue.js +0 -19
  68. package/dist/components/wrappers/ModalWrapper.vue2.js +0 -43
  69. package/dist/composables/useSaveAsTemplate.d.ts +0 -7
  70. package/dist/composables/useSaveAsTemplate.js +0 -51
  71. package/dist/composables/useTemplateNameValidation.d.ts +0 -7
  72. package/dist/composables/useTemplateNameValidation.js +0 -33
  73. package/dist/mock/api/template-library.d.ts +0 -2
  74. package/dist/stores/template-categories.d.ts +0 -41
  75. package/dist/stores/template-categories.js +0 -91
  76. package/dist/utils/base64.d.ts +0 -2
  77. package/dist/utils/base64.js +0 -14
  78. package/dist/utils/generic.d.ts +0 -1
  79. package/dist/utils/generic.js +0 -7
  80. package/dist/utils/textUtil.d.ts +0 -2
@@ -3,9 +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
  };
13
+ export interface EmailHeader {
14
+ senderName: string;
15
+ subject: string;
16
+ }
@@ -1,16 +1,16 @@
1
1
  import o from "./Guido.vue2.js";
2
2
  /* empty css */
3
- import a from "../_virtual/_plugin-vue2_normalizer.js";
3
+ import t from "../_virtual/_plugin-vue2_normalizer.js";
4
4
  var s = function() {
5
- var t = this, e = t._self._c, r = t._self._setupProxy;
6
- return e("div", { staticClass: "guido-editor__wrapper" }, [e(r.HeaderWrapper), e("div", { staticClass: "guido-editor__container", attrs: { id: "guido-editor" } }), e(r.SaveTemplateModal, { attrs: { "is-open": r.editorStore.isSaveTemplateModalOpen }, on: { close: r.handleCloseSaveTemplateModal } })], 1);
7
- }, i = [], n = /* @__PURE__ */ a(
5
+ var i = this, e = i._self._c, r = i._self._setupProxy;
6
+ return e("div", { staticClass: "guido-editor__wrapper" }, [e(r.HeaderWrapper), r.previewStore.isPreviewModeOpen ? e(r.PreviewContainer) : i._e(), e("div", { directives: [{ name: "show", rawName: "v-show", value: !r.previewStore.isPreviewModeOpen, expression: "!previewStore.isPreviewModeOpen" }], staticClass: "guido-editor__container", attrs: { id: "guido-editor" } })], 1);
7
+ }, a = [], n = /* @__PURE__ */ t(
8
8
  o,
9
9
  s,
10
- i,
10
+ a,
11
11
  !1,
12
12
  null,
13
- "66fa3f35"
13
+ "5fe1cbdf"
14
14
  );
15
15
  const c = n.exports;
16
16
  export {
@@ -1,13 +1,12 @@
1
- import { defineComponent as w, onMounted as E } from "vue";
2
- import { provideGuidoActions as T } 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 k from "./organisms/header/HeaderWrapper.vue.js";
7
- import M from "./organisms/save-template/SaveTemplateModal.vue.js";
8
- import { useStripoApi as P } from "../services/stripoApi.js";
9
- import { useEditorStore as N } from "../stores/editor.js";
10
- const O = /* @__PURE__ */ w({
1
+ import { defineComponent as S, defineAsyncComponent as D, onMounted as E } from "vue";
2
+ import { provideGuidoActions as P } from "../composables/useGuidoActions.js";
3
+ import { usePartner as _ } from "../composables/usePartner.js";
4
+ import { useStripo as G } from "../composables/useStripo.js";
5
+ import { DefaultUsername as I, 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";
8
+ import { usePreviewStore as N } from "../stores/preview.js";
9
+ const M = /* @__PURE__ */ S({
11
10
  __name: "Guido",
12
11
  props: {
13
12
  templateId: null,
@@ -20,23 +19,25 @@ const O = /* @__PURE__ */ w({
20
19
  guidoConfig: null
21
20
  },
22
21
  emits: ["dynamic-content:open", "back", "save:start", "save:complete"],
23
- setup(b, { expose: S, emit: o }) {
24
- const t = b, { getPartnerName: n, getProductType: a } = D(), {
25
- templateId: c,
26
- userId: s,
27
- guidoConfig: r,
28
- html: i = "",
29
- css: l = "",
30
- partnerName: d = n(),
31
- productType: m = a(),
32
- username: u = G
22
+ setup(C, { expose: b, emit: o }) {
23
+ const t = C, w = D(
24
+ () => import("./organisms/email-preview/PreviewContainer.vue.js")
25
+ ), { getPartnerName: n, getProductType: c } = _(), h = N(), {
26
+ templateId: a,
27
+ userId: r,
28
+ guidoConfig: i,
29
+ html: s = "",
30
+ css: d = "",
31
+ partnerName: l = n(),
32
+ productType: u = c(),
33
+ username: m = I
33
34
  } = t;
34
35
  window.GuidoConfig = {
35
- ...I,
36
- ...r
36
+ ...k,
37
+ ...i
37
38
  };
38
- const { initPlugin: p } = _({ emailId: c, userId: s, username: u, partnerName: d, productType: m }), { getDefaultTemplate: f } = P();
39
- T({
39
+ const { initPlugin: p } = G({ emailId: a, userId: r, username: m, partnerName: l, productType: u }), { getDefaultTemplate: f } = A();
40
+ P({
40
41
  onBack: () => {
41
42
  console.debug("guido:back"), o("back");
42
43
  },
@@ -47,19 +48,17 @@ const O = /* @__PURE__ */ w({
47
48
  console.debug("guido:save:complete", e), o("save:complete", e);
48
49
  }
49
50
  });
50
- const g = N(), h = () => {
51
- g.isSaveTemplateModalOpen = !1;
52
- }, v = (e) => {
51
+ const g = (e) => {
53
52
  console.debug("dynamic-content:close", e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
54
- }, y = () => {
53
+ }, v = () => {
55
54
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
56
55
  };
57
56
  return E(async () => {
58
57
  console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow");
59
58
  try {
60
59
  let e = {
61
- html: i,
62
- css: l,
60
+ html: s,
61
+ css: d,
63
62
  forceRecreate: !0
64
63
  // TODO: It should be false for old templates. We will communicate with Stripo
65
64
  };
@@ -68,17 +67,17 @@ const O = /* @__PURE__ */ w({
68
67
  console.error("Failed to initialize Stripo editor:", e);
69
68
  }
70
69
  document.addEventListener("dynamic-content:open", (e) => {
71
- const C = e;
72
- console.debug("dynamic-content:open", C.detail), o("dynamic-content:open", C.detail);
70
+ const y = e;
71
+ console.debug("dynamic-content:open", y.detail), o("dynamic-content:open", y.detail);
73
72
  });
74
- }), S({
73
+ }), b({
75
74
  dynamicContent: {
76
- insert: v,
77
- close: y
75
+ insert: g,
76
+ close: v
78
77
  }
79
- }), { __sfc: !0, props: t, getPartnerName: n, getProductType: a, templateId: c, userId: s, guidoConfig: r, html: i, css: l, partnerName: d, productType: m, username: u, emit: o, initPlugin: p, getDefaultTemplate: f, editorStore: g, handleCloseSaveTemplateModal: h, insertDynamicContent: v, closeDynamicContent: y, HeaderWrapper: k, SaveTemplateModal: M };
78
+ }), { __sfc: !0, PreviewContainer: w, props: t, getPartnerName: n, getProductType: c, previewStore: h, templateId: a, userId: r, guidoConfig: i, html: s, css: d, partnerName: l, productType: u, username: m, emit: o, initPlugin: p, getDefaultTemplate: f, insertDynamicContent: g, closeDynamicContent: v, HeaderWrapper: T };
80
79
  }
81
80
  });
82
81
  export {
83
- O as default
82
+ M as default
84
83
  };
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
2
+ export default _default;
@@ -0,0 +1,19 @@
1
+ import i from "./PreviewContainer.vue2.js";
2
+ import o from "../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var t = function() {
4
+ var s = this, e = s._self._c, r = s._self._setupProxy;
5
+ return e("div", { staticClass: "d-f f-d-c h-1 b-c-5 bor-r-2 pb-5" }, [e("div", { staticClass: "f-g-1 d-f p-5 o-a g-4 min-h-600" }, [r.previewStore.isLoading ? [e("div", { staticClass: "d-f a-i-c j-c-c w-1 h-1 f-g-1" }, [e(r.InLoading, { attrs: { "color-class": "i-c-1", size: "32" } })], 1)] : [e(r.DesktopPreview, { staticClass: "f-g-1 min-w-0" }), e(r.MobilePreview, { staticClass: "f-0 min-w-a" })]], 2), r.previewStore.isAMPErrorModalVisible ? e(r.AmpErrorModal, { on: { close: function(l) {
6
+ return r.previewStore.closeErrorModal();
7
+ } } }) : s._e()], 1);
8
+ }, a = [], n = /* @__PURE__ */ o(
9
+ i,
10
+ t,
11
+ a,
12
+ !1,
13
+ null,
14
+ null
15
+ );
16
+ const d = n.exports;
17
+ export {
18
+ d as default
19
+ };
@@ -0,0 +1,19 @@
1
+ import { defineComponent as r, onMounted as t } from "vue";
2
+ import { usePreviewMode as i } from "../../../composables/usePreviewMode.js";
3
+ import { usePreviewStore as m } from "../../../stores/preview.js";
4
+ import { InLoading as n } from "@useinsider/design-system-vue";
5
+ import p from "./amp/AmpErrorModal.vue.js";
6
+ import f from "./desktop-preview/DesktopPreview.vue.js";
7
+ import s from "./mobile-preview/MobilePreview.vue.js";
8
+ const l = /* @__PURE__ */ r({
9
+ __name: "PreviewContainer",
10
+ setup(a) {
11
+ const { loadPreviewData: o } = i(), e = m();
12
+ return t(() => {
13
+ o();
14
+ }), { __sfc: !0, loadPreviewData: o, previewStore: e, InLoading: n, AmpErrorModal: p, DesktopPreview: f, MobilePreview: s };
15
+ }
16
+ });
17
+ export {
18
+ l as default
19
+ };
@@ -0,0 +1,4 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {
2
+ close: () => void;
3
+ }, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
4
+ export default _default;
@@ -0,0 +1,22 @@
1
+ import s from "./AmpErrorModal.vue2.js";
2
+ /* empty css */
3
+ import a from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var n = function() {
5
+ var e = this, r = e._self._c, t = e._self._setupProxy;
6
+ return r(t.WpModal, { attrs: { id: "amp-error-modal", size: "medium", description: t.trans("email-editor.amp-validation-description"), "footer-button-options": t.footerButtonOptions, title: t.trans("email-editor.amp-validation-title") }, on: { close: function(o) {
7
+ return t.emit("close");
8
+ }, "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.errorCountText) + " ")])]), r("div", { staticClass: "d-f f-d-c g-13 max-h-21-s o-y-a error-list" }, e._l(t.previewStore.ampErrors, function(o, i) {
9
+ return r(t.InOnPageMessage, { key: i, attrs: { icon: "filled-error-box", size: "medium", type: "alert", text: o } });
10
+ }), 1)])]);
11
+ }, l = [], d = /* @__PURE__ */ a(
12
+ s,
13
+ n,
14
+ l,
15
+ !1,
16
+ null,
17
+ "cfb613b7"
18
+ );
19
+ const _ = d.exports;
20
+ export {
21
+ _ as default
22
+ };
@@ -0,0 +1,30 @@
1
+ import { defineComponent as p, ref as m, computed as c } from "vue";
2
+ import d from "../../../wrappers/WpModal.vue.js";
3
+ import { useCodeEditorApi as l } from "../../../../composables/useCodeEditorApi.js";
4
+ import { usePreviewMode as u } from "../../../../composables/usePreviewMode.js";
5
+ import { useTranslations as f } from "../../../../composables/useTranslations.js";
6
+ import { usePreviewStore as _ } from "../../../../stores/preview.js";
7
+ import { InOnPageMessage as g } from "@useinsider/design-system-vue";
8
+ const P = /* @__PURE__ */ p({
9
+ __name: "AmpErrorModal",
10
+ emits: ["close"],
11
+ setup(x, { emit: e }) {
12
+ const o = f(), { closePreviewMode: r } = u(), { openCodeEditor: t } = l(), n = _(), s = m({
13
+ cancelOrBackButton: {
14
+ type: "secondary",
15
+ labelText: o("campaign-builder.cancel"),
16
+ styling: "ghost"
17
+ },
18
+ primaryButton: {
19
+ type: "primary",
20
+ labelText: o("email-editor.amp-validation-fix")
21
+ }
22
+ }), i = () => {
23
+ e("close"), r(), t();
24
+ }, a = c(() => `${o("products.errors")}(${n.ampErrors.length})`);
25
+ return { __sfc: !0, emit: e, trans: o, closePreviewMode: r, openCodeEditor: t, previewStore: n, footerButtonOptions: s, handleFixInCodeEditor: i, errorCountText: a, WpModal: d, InOnPageMessage: g };
26
+ }
27
+ });
28
+ export {
29
+ P as default
30
+ };
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
2
+ export default _default;
@@ -0,0 +1,19 @@
1
+ import o from "./AmpToggle.vue2.js";
2
+ import n from "../../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var s = function() {
4
+ var r = this, t = r._self._c, e = r._self._setupProxy;
5
+ return t("div", [t("div", { staticClass: "d-f a-i-c ml-3" }, [t(e.InSegments, { attrs: { id: "guido__amp-toggle", "segment-list": e.segmentList, selected: e.previewStore.emailFormat }, on: { click: e.handleFormatChange } }), e.previewStore.showAMPErrorButton ? t(e.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: function(c) {
6
+ return e.previewStore.openErrorModal();
7
+ } } }) : r._e()], 1)]);
8
+ }, a = [], i = /* @__PURE__ */ n(
9
+ o,
10
+ s,
11
+ a,
12
+ !1,
13
+ null,
14
+ null
15
+ );
16
+ const d = i.exports;
17
+ export {
18
+ d as default
19
+ };
@@ -0,0 +1,29 @@
1
+ import { defineComponent as m, computed as n } from "vue";
2
+ import { useTranslations as r } from "../../../../composables/useTranslations.js";
3
+ import { usePreviewStore as i } from "../../../../stores/preview.js";
4
+ import { InButtonV2 as s, InSegments as l } from "@useinsider/design-system-vue";
5
+ const _ = /* @__PURE__ */ m({
6
+ __name: "AmpToggle",
7
+ setup(p) {
8
+ const t = i(), e = r(), o = n(() => [
9
+ {
10
+ text: e("dynamic-creatives.html"),
11
+ value: "html"
12
+ },
13
+ {
14
+ text: e("email-editor.amp-html"),
15
+ value: "AMP",
16
+ tooltipText: t.hasAMP ? "" : e("email-editor.preview-amp-unavailable-tooltip"),
17
+ position: "bottom",
18
+ align: "center",
19
+ disable: !t.hasAMP
20
+ }
21
+ ]);
22
+ return { __sfc: !0, previewStore: t, trans: e, segmentList: o, handleFormatChange: (a) => {
23
+ t.setEmailFormat(a);
24
+ }, InSegments: l, InButtonV2: s };
25
+ }
26
+ });
27
+ export {
28
+ _ as default
29
+ };
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
2
+ export default _default;
@@ -0,0 +1,22 @@
1
+ import o from "./DesktopPreview.vue2.js";
2
+ /* empty css */
3
+ import a from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var s = 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)];
8
+ }, proxy: !0 }, { key: "headerRightSlot", fn: function() {
9
+ return [t(e.EmailSizeIndicator)];
10
+ }, proxy: !0 }]) }, [e.isContainerReady ? 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.previewStore.previewHtml } }) : r._e()])], 1);
11
+ }, i = [], n = /* @__PURE__ */ a(
12
+ o,
13
+ s,
14
+ i,
15
+ !1,
16
+ null,
17
+ "9c6e7ff0"
18
+ );
19
+ const m = n.exports;
20
+ export {
21
+ m as default
22
+ };
@@ -0,0 +1,30 @@
1
+ import { defineComponent as f, ref as r, onMounted as p, nextTick as d, onBeforeUnmount as h } from "vue";
2
+ import { usePreviewStore as v } from "../../../../stores/preview.js";
3
+ import { InContainer as g } from "@useinsider/design-system-vue";
4
+ import _ from "./EmailHeaderInfo.vue.js";
5
+ import R from "./EmailSizeIndicator.vue.js";
6
+ const I = /* @__PURE__ */ f({
7
+ __name: "DesktopPreview",
8
+ setup(C) {
9
+ const t = r(), i = r("400px"), a = r(!1), l = v(), n = () => {
10
+ if (!t.value)
11
+ return;
12
+ const o = t.value.querySelector(".in-container");
13
+ if (!o)
14
+ return;
15
+ const s = o.getBoundingClientRect(), c = o.querySelector(".in-container__header"), u = c ? c.getBoundingClientRect().height : 0, m = s.height - u;
16
+ i.value = `${m}px`;
17
+ };
18
+ let e = null;
19
+ return p(() => {
20
+ n(), t.value && (e = new ResizeObserver(n), e.observe(t.value), d(() => {
21
+ a.value = !0;
22
+ }));
23
+ }), h(() => {
24
+ e == null || e.disconnect();
25
+ }), { __sfc: !0, containerRef: t, iframeHeight: i, isContainerReady: a, previewStore: l, calculateIframeHeight: n, resizeObserver: e, InContainer: g, EmailHeaderInfo: _, EmailSizeIndicator: R };
26
+ }
27
+ });
28
+ export {
29
+ I as default
30
+ };
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
2
+ export default _default;
@@ -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 t = this, s = t._self._c, a = t._self._setupProxy;
5
+ 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(a.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" }, [t._v(" " + t._s(a.senderName) + " ")]), s("p", { staticClass: "t-c-55 f-w-400 f-s-12 l-h-1" }, [t._v(" " + t._s(a.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,20 @@
1
+ import { defineComponent as m, computed as t } from "vue";
2
+ import { useConfig as a } from "../../../../composables/useConfig.js";
3
+ import { useTranslations as c } from "../../../../composables/useTranslations.js";
4
+ import { InIcons as i } from "@useinsider/design-system-vue";
5
+ const l = /* @__PURE__ */ m({
6
+ __name: "EmailHeaderInfo",
7
+ setup(f) {
8
+ const { config: n } = a(), s = c(), o = t(() => {
9
+ var e;
10
+ return ((e = n.emailHeader) == null ? void 0 : e.senderName) || `(${s("settings.sender-name")})`;
11
+ }), r = t(() => {
12
+ var e;
13
+ return ((e = n.emailHeader) == null ? void 0 : e.subject) || s("newsletter.subject");
14
+ });
15
+ return { __sfc: !0, config: n, trans: s, senderName: o, subject: r, InIcons: i };
16
+ }
17
+ });
18
+ export {
19
+ l as default
20
+ };
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
2
+ export default _default;
@@ -0,0 +1,18 @@
1
+ import i from "./EmailSizeIndicator.vue2.js";
2
+ /* empty css */
3
+ import r from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var o = function() {
5
+ var s = this, e = s._self._c, t = s._self._setupProxy;
6
+ return e("div", { staticClass: "d-f a-i-c j-c-c" }, [e(t.InProgress, { staticClass: "min-w-15-s", attrs: { id: "email-size-progress", "description-status": "", "description-position": "left", description: t.htmlSize, "max-value": t.MAX_EMAIL_SIZE_IN_KB, type: t.progress.type, value: t.progress.value } }), e(t.InTooltip, { staticClass: "d-f ml-1", attrs: { id: "email-size-tooltip", align: "center", position: "bottom", text: t.trans("email-editor.preview-design-size-tooltip") } })], 1);
7
+ }, a = [], n = /* @__PURE__ */ r(
8
+ i,
9
+ o,
10
+ a,
11
+ !1,
12
+ null,
13
+ "bd212ce2"
14
+ );
15
+ const m = n.exports;
16
+ export {
17
+ m as default
18
+ };
@@ -0,0 +1,22 @@
1
+ import { defineComponent as c, ref as n, computed as l, watch as u } from "vue";
2
+ import { useTranslations as p } from "../../../../composables/useTranslations.js";
3
+ import { usePreviewStore as v } from "../../../../stores/preview.js";
4
+ import { InTooltip as _, InProgress as f } from "@useinsider/design-system-vue";
5
+ const S = /* @__PURE__ */ c({
6
+ __name: "EmailSizeIndicator",
7
+ setup(w) {
8
+ const t = v(), o = 102, e = n(0), s = n({
9
+ type: "success",
10
+ value: 0
11
+ }), a = l(() => `~${e.value} KB`), r = () => {
12
+ const m = new Blob([t.previewHtml]).size;
13
+ e.value = Math.round(m / 1024), s.value.value = Math.min(e.value, o), s.value.type = e.value < o ? "success" : "warning";
14
+ }, i = p();
15
+ return u(() => t.previewHtml, () => {
16
+ r();
17
+ }, { immediate: !0 }), { __sfc: !0, previewStore: t, MAX_EMAIL_SIZE_IN_KB: o, htmlKB: e, progress: s, htmlSize: a, calculateProgress: r, trans: i, InProgress: f, InTooltip: _ };
18
+ }
19
+ });
20
+ export {
21
+ S as default
22
+ };
@@ -0,0 +1,4 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {
2
+ "back-to-inbox": () => void;
3
+ }, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
4
+ export default _default;
@@ -0,0 +1,19 @@
1
+ import n from "./ContentView.vue2.js";
2
+ import e from "../../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var c = function() {
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) {
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.previewStore.previewHtml }, on: { load: t.onLoad } })]);
8
+ }, i = [], o = /* @__PURE__ */ e(
9
+ n,
10
+ c,
11
+ i,
12
+ !1,
13
+ null,
14
+ null
15
+ );
16
+ const d = o.exports;
17
+ export {
18
+ d as default
19
+ };
@@ -0,0 +1,23 @@
1
+ import { defineComponent as m, ref as c } from "vue";
2
+ import { useResponsivePreview as f } from "../../../../composables/useResponsivePreview.js";
3
+ import { useTranslations as a } from "../../../../composables/useTranslations.js";
4
+ import { usePreviewStore as p } from "../../../../stores/preview.js";
5
+ import { InIcons as u } from "@useinsider/design-system-vue";
6
+ const h = /* @__PURE__ */ m({
7
+ __name: "ContentView",
8
+ emits: ["back-to-inbox"],
9
+ setup(v) {
10
+ const i = a(), t = p(), n = c(), { setupResponsivePreview: r } = f(), s = (o) => {
11
+ ["transform", "transform-origin", "height"].forEach((e) => {
12
+ o.documentElement.style.removeProperty(e);
13
+ });
14
+ };
15
+ return { __sfc: !0, trans: i, previewStore: t, iframeRef: n, setupResponsivePreview: r, clearAMPTransforms: s, onLoad: () => {
16
+ const o = n.value, e = o == null ? void 0 : o.contentDocument;
17
+ e && (r(o), t.isAMPResponsive && s(e));
18
+ }, InIcons: u };
19
+ }
20
+ });
21
+ export {
22
+ h as default
23
+ };
@@ -0,0 +1,4 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {
2
+ "open-email": () => void;
3
+ }, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
4
+ export default _default;
@@ -0,0 +1,20 @@
1
+ import e from "./InboxView.vue2.js";
2
+ /* empty css */
3
+ import r from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var a = function() {
5
+ var s = this, t = s._self._c, c = s._self._setupProxy;
6
+ 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(_) {
7
+ return c.emit("open-email");
8
+ } } }, [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 cropped-text" }, [s._v(" " + s._s(c.senderName) + " ")]), t("div", { staticClass: "f-s-12 f-w-400 t-c-55 l-h-1 cropped-text" }, [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)]);
9
+ }, i = [], n = /* @__PURE__ */ r(
10
+ e,
11
+ a,
12
+ i,
13
+ !1,
14
+ null,
15
+ "d3bb77b4"
16
+ );
17
+ const d = n.exports;
18
+ export {
19
+ d as default
20
+ };
@@ -0,0 +1,21 @@
1
+ import { defineComponent as a, computed as t } from "vue";
2
+ import { useConfig as i } from "../../../../composables/useConfig.js";
3
+ import { useTranslations as c } from "../../../../composables/useTranslations.js";
4
+ import { InIcons as p } from "@useinsider/design-system-vue";
5
+ const b = /* @__PURE__ */ a({
6
+ __name: "InboxView",
7
+ emits: ["open-email"],
8
+ setup(f, { emit: o }) {
9
+ const n = c(), { config: s } = i(), r = t(() => {
10
+ var e;
11
+ return ((e = s.emailHeader) == null ? void 0 : e.senderName) || `(${n("settings.sender-name")})`;
12
+ }), m = t(() => {
13
+ var e;
14
+ return ((e = s.emailHeader) == null ? void 0 : e.subject) || n("newsletter.subject");
15
+ });
16
+ return { __sfc: !0, emit: o, trans: n, config: s, senderName: r, subject: m, InIcons: p };
17
+ }
18
+ });
19
+ export {
20
+ b as default
21
+ };
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
2
+ export default _default;
@@ -0,0 +1,17 @@
1
+ import t from "./MobilePreview.vue2.js";
2
+ import n from "../../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var a = function() {
4
+ var o = this, s = o._self._c, e = o._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, { on: { "open-email": e.openEmail } }) : s(e.ContentView, { on: { "back-to-inbox": e.backToInbox } })], 1)])]);
6
+ }, r = [], i = /* @__PURE__ */ n(
7
+ t,
8
+ a,
9
+ r,
10
+ !1,
11
+ null,
12
+ null
13
+ );
14
+ const _ = i.exports;
15
+ export {
16
+ _ as default
17
+ };
@@ -0,0 +1,22 @@
1
+ import { defineComponent as m, ref as i, computed as e } from "vue";
2
+ import a from "../../../../static/assets/inbox-mockup.svg.js";
3
+ import c from "../../../../static/assets/phone-mockup.svg.js";
4
+ import s from "./ContentView.vue.js";
5
+ import u from "./InboxView.vue.js";
6
+ const w = /* @__PURE__ */ m({
7
+ __name: "MobilePreview",
8
+ setup(f) {
9
+ const o = i(!1), n = e(() => ({
10
+ image: o.value ? a : c,
11
+ alt: o.value ? "Inbox mockup" : "Phone mockup"
12
+ })), r = () => {
13
+ o.value = !1;
14
+ }, t = () => {
15
+ o.value = !0;
16
+ }, p = e(() => o.value ? "88px" : "44px");
17
+ return { __sfc: !0, showInbox: o, mockup: n, openEmail: r, backToInbox: t, phoneScreenTopMargin: p, ContentView: s, InboxView: u };
18
+ }
19
+ });
20
+ export {
21
+ w as default
22
+ };