@useinsider/guido 1.0.0-beta.e415f9e → 1.0.0-beta.e490934

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 (53) hide show
  1. package/README.md +133 -21
  2. package/dist/@types/generic.d.ts +4 -0
  3. package/dist/components/Guido.vue.d.ts +7 -2
  4. package/dist/components/Guido.vue.js +8 -8
  5. package/dist/components/Guido.vue2.js +49 -31
  6. package/dist/components/organisms/design-preview/AmpErrorModal.vue.d.ts +16 -0
  7. package/dist/components/organisms/design-preview/AmpErrorModal.vue.js +21 -0
  8. package/dist/components/organisms/design-preview/AmpErrorModal.vue2.js +30 -0
  9. package/dist/components/organisms/design-preview/DesktopPreview.vue.d.ts +16 -0
  10. package/dist/components/organisms/design-preview/DesktopPreview.vue.js +22 -0
  11. package/dist/components/organisms/design-preview/DesktopPreview.vue2.js +42 -0
  12. package/dist/components/organisms/design-preview/EmailPreview.vue.d.ts +16 -0
  13. package/dist/components/organisms/design-preview/EmailPreview.vue.js +17 -0
  14. package/dist/components/organisms/design-preview/EmailPreview.vue2.js +33 -0
  15. package/dist/components/organisms/design-preview/EmailView.vue.d.ts +18 -0
  16. package/dist/components/organisms/design-preview/EmailView.vue.js +19 -0
  17. package/dist/components/organisms/design-preview/EmailView.vue2.js +24 -0
  18. package/dist/components/organisms/design-preview/InboxView.vue.d.ts +17 -0
  19. package/dist/components/organisms/design-preview/InboxView.vue.js +19 -0
  20. package/dist/components/organisms/design-preview/InboxView.vue2.js +23 -0
  21. package/dist/components/organisms/design-preview/MobilePreview.vue.d.ts +17 -0
  22. package/dist/components/organisms/design-preview/MobilePreview.vue.js +17 -0
  23. package/dist/components/organisms/design-preview/MobilePreview.vue2.js +24 -0
  24. package/dist/components/organisms/header/AmpToggle.vue.d.ts +2 -0
  25. package/dist/components/organisms/header/AmpToggle.vue.js +17 -0
  26. package/dist/components/organisms/header/AmpToggle.vue2.js +48 -0
  27. package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
  28. package/dist/components/organisms/header/LeftSlot.vue2.js +10 -8
  29. package/dist/components/organisms/header/MiddleSlot.vue.js +4 -4
  30. package/dist/components/organisms/header/MiddleSlot.vue2.js +17 -14
  31. package/dist/components/organisms/header/RightSlot.vue.js +1 -1
  32. package/dist/components/organisms/header/RightSlot.vue2.js +28 -14
  33. package/dist/components/organisms/header/ViewOptions.vue.js +6 -6
  34. package/dist/composables/useActionsApi.d.ts +2 -0
  35. package/dist/composables/useActionsApi.js +47 -36
  36. package/dist/composables/useDebounce.d.ts +4 -0
  37. package/dist/composables/useDebounce.js +12 -0
  38. package/dist/composables/useGuidoActions.d.ts +46 -0
  39. package/dist/composables/useGuidoActions.js +37 -0
  40. package/dist/composables/useMobileGmailFit.d.ts +5 -0
  41. package/dist/composables/useMobileGmailFit.js +69 -0
  42. package/dist/composables/useProvideInject.d.ts +14 -0
  43. package/dist/composables/useProvideInject.js +17 -0
  44. package/dist/composables/useStripo.js +15 -15
  45. package/dist/enums/gmailMobilePreview.d.ts +7 -0
  46. package/dist/enums/gmailMobilePreview.js +17 -0
  47. package/dist/guido.css +1 -1
  48. package/dist/services/stripoApi.js +26 -17
  49. package/dist/static/assets/inbox-mockup.svg.js +4 -0
  50. package/dist/static/assets/phone-mockup.svg.js +4 -0
  51. package/dist/stores/editor.d.ts +4 -0
  52. package/dist/stores/editor.js +7 -3
  53. package/package.json +1 -1
@@ -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
+ };
@@ -0,0 +1,17 @@
1
+ import type { EmailData } from '@@/Types/generic';
2
+ interface Props {
3
+ emailData?: EmailData;
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, {
6
+ "open-email": () => void;
7
+ }, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<Props>>>, {}>;
8
+ export default _default;
9
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
10
+ type __VLS_TypePropsToOption<T> = {
11
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
12
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
13
+ } : {
14
+ type: import('vue').PropType<T[K]>;
15
+ required: true;
16
+ };
17
+ };
@@ -0,0 +1,19 @@
1
+ import a from "./InboxView.vue2.js";
2
+ import e from "../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var n = function() {
4
+ var s = this, t = s._self._c, c = s._self._setupProxy;
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");
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
+ }, r = [], i = /* @__PURE__ */ e(
9
+ a,
10
+ n,
11
+ r,
12
+ !1,
13
+ null,
14
+ null
15
+ );
16
+ const m = i.exports;
17
+ export {
18
+ m as default
19
+ };
@@ -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
+ };
@@ -0,0 +1,17 @@
1
+ import type { EmailData } from '@@/Types/generic';
2
+ interface Props {
3
+ emailHtml: string;
4
+ isAmp: boolean;
5
+ emailData?: EmailData;
6
+ }
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
+ export default _default;
9
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
10
+ type __VLS_TypePropsToOption<T> = {
11
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
12
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
13
+ } : {
14
+ type: import('vue').PropType<T[K]>;
15
+ required: true;
16
+ };
17
+ };
@@ -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 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: a.mockupAlt, src: a.mockupImage } }), s("div", { staticClass: "p-a w-21-s h-24-s o-h", style: { top: a.phoneScreenTopMargin, left: "20px" } }, [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
+ }, l = [], n = /* @__PURE__ */ o(
7
+ e,
8
+ i,
9
+ l,
10
+ !1,
11
+ null,
12
+ null
13
+ );
14
+ const c = n.exports;
15
+ export {
16
+ c as default
17
+ };
@@ -0,0 +1,24 @@
1
+ import { defineComponent as l, ref as s, computed as e } from "vue";
2
+ import c from "../../../static/assets/inbox-mockup.svg.js";
3
+ import u from "../../../static/assets/phone-mockup.svg.js";
4
+ import f from "./EmailView.vue.js";
5
+ import v from "./InboxView.vue.js";
6
+ const I = /* @__PURE__ */ l({
7
+ __name: "MobilePreview",
8
+ props: {
9
+ emailHtml: null,
10
+ isAmp: { type: Boolean },
11
+ emailData: null
12
+ },
13
+ setup(n) {
14
+ const m = n, o = s(!1), p = e(() => o.value ? c : u), t = e(() => o.value ? "Inbox mockup" : "Phone mockup"), r = () => {
15
+ o.value = !1;
16
+ }, a = () => {
17
+ o.value = !0;
18
+ }, i = e(() => o.value ? "88px" : "44px");
19
+ return { __sfc: !0, props: m, showInbox: o, mockupImage: p, mockupAlt: t, openEmail: r, backToInbox: a, phoneScreenTopMargin: i, EmailView: f, InboxView: v };
20
+ }
21
+ });
22
+ export {
23
+ I as default
24
+ };
@@ -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 "./AmpToggle.vue2.js";
2
+ import s from "../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var a = function() {
4
+ var e = this, o = e._self._c, r = e._self._setupProxy;
5
+ return r.editorStore.isPreviewModeOpen ? o("div", [o("div", { staticClass: "d-f a-i-c ml-3" }, [o(r.InSegments, { attrs: { id: "guido__amp-toggle", "segment-list": r.segmentList, selected: r.editorStore.emailFormat }, on: { click: r.handleFormatChange } }), r.showErrorButton ? o(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 } }) : e._e()], 1), r.showErrorModal ? o(r.AmpErrorModal, { attrs: { errors: r.editorStore.ampErrors || [] }, on: { close: r.closeErrorModal } }) : e._e()], 1) : e._e();
6
+ }, n = [], l = /* @__PURE__ */ s(
7
+ t,
8
+ a,
9
+ n,
10
+ !1,
11
+ null,
12
+ null
13
+ );
14
+ const d = l.exports;
15
+ export {
16
+ d as default
17
+ };
@@ -0,0 +1,48 @@
1
+ import { defineComponent as h, ref as v, computed as r, watch as E } from "vue";
2
+ import { useActionsApi as g } from "../../../composables/useActionsApi.js";
3
+ import { useToaster as w } from "../../../composables/useToaster.js";
4
+ import { useTranslations as M } from "../../../composables/useTranslations.js";
5
+ import A from "../design-preview/AmpErrorModal.vue.js";
6
+ import { useEditorStore as _ } from "../../../stores/editor.js";
7
+ import { InButtonV2 as P, InSegments as y } from "@useinsider/design-system-vue";
8
+ const D = /* @__PURE__ */ h({
9
+ __name: "AmpToggle",
10
+ setup(F) {
11
+ const t = _(), { getPreviewData: s } = g(), { showToaster: l } = w(), e = M(), a = v(!1), m = r(() => !!t.ampHtml), n = r(() => !!(t.ampErrors && t.ampErrors.length > 0)), p = r(() => [
12
+ { text: e("dynamic-creatives.html"), value: "html" },
13
+ {
14
+ text: e("email-editor.amp-html"),
15
+ value: "amp",
16
+ tooltipText: m.value ? "" : e("email-editor.preview-amp-unavailable-tooltip"),
17
+ position: "bottom",
18
+ align: "center",
19
+ disable: !m.value
20
+ }
21
+ ]), i = async () => {
22
+ try {
23
+ const o = await s();
24
+ t.ampHtml = o.ampHtml ?? null, t.ampErrors = o.ampErrors ?? null, t.emailFormat = o.ampHtml ? "amp" : "html";
25
+ } catch {
26
+ l({
27
+ type: "error",
28
+ message: "Failed to load AMP data. Please try again later."
29
+ });
30
+ }
31
+ };
32
+ E([() => t.editorVisualMode, () => t.isPreviewModeOpen], () => {
33
+ t.isPreviewModeOpen && i();
34
+ }, { immediate: !0 });
35
+ const c = (o) => {
36
+ t.emailFormat = o;
37
+ }, u = () => {
38
+ a.value = !0;
39
+ }, d = r(() => t.emailFormat === "amp" && n.value);
40
+ function f() {
41
+ a.value = !1;
42
+ }
43
+ return { __sfc: !0, editorStore: t, getPreviewData: s, showToaster: l, trans: e, showErrorModal: a, hasAMP: m, hasAMPErrors: n, segmentList: p, updateAmpData: i, handleFormatChange: c, handleErrorClick: u, showErrorButton: d, closeErrorModal: f, AmpErrorModal: A, InSegments: y, InButtonV2: P };
44
+ }
45
+ });
46
+ export {
47
+ D as default
48
+ };
@@ -1,11 +1,11 @@
1
- import r from "./LeftSlot.vue2.js";
1
+ import n from "./LeftSlot.vue2.js";
2
2
  import o from "../../../_virtual/_plugin-vue2_normalizer.js";
3
- var n = function() {
4
- var t = this, e = t._self._c, s = t._self._setupProxy;
5
- return e("div", { staticClass: "d-f a-i-c" }, [e(s.InButtonV2, { staticClass: "p-2", attrs: { id: "guido__back-button", "label-text": "Back", "left-icon": "line-arrow-left", styling: "text", type: "secondary" } }), s.editorStore.isVersionHistoryOpen ? e(s.RestoreButton, { staticClass: "ml-3" }) : t._e()], 1);
3
+ var r = function() {
4
+ var e = this, s = e._self._c, t = e._self._setupProxy;
5
+ return s("div", { staticClass: "d-f a-i-c" }, [s(t.InButtonV2, { staticClass: "p-2", attrs: { id: "guido__back-button", "label-text": "Back", "left-icon": "line-arrow-left", styling: "text", type: "secondary" }, on: { click: t.handleBack } }), t.editorStore.isVersionHistoryOpen ? s(t.RestoreButton, { staticClass: "ml-3" }) : e._e()], 1);
6
6
  }, a = [], i = /* @__PURE__ */ o(
7
- r,
8
7
  n,
8
+ r,
9
9
  a,
10
10
  !1,
11
11
  null,
@@ -1,13 +1,15 @@
1
- import { defineComponent as t } from "vue";
2
- import { useEditorStore as o } from "../../../stores/editor.js";
3
- import { InButtonV2 as r } from "@useinsider/design-system-vue";
4
- import e from "./version-history/RestoreButton.vue.js";
5
- const _ = /* @__PURE__ */ t({
1
+ import { defineComponent as r } from "vue";
2
+ import { useBack as e } from "../../../composables/useGuidoActions.js";
3
+ import { useEditorStore as m } from "../../../stores/editor.js";
4
+ import { InButtonV2 as n } from "@useinsider/design-system-vue";
5
+ import s from "./version-history/RestoreButton.vue.js";
6
+ const c = /* @__PURE__ */ r({
6
7
  __name: "LeftSlot",
7
- setup(m) {
8
- return { __sfc: !0, editorStore: o(), InButtonV2: r, RestoreButton: e };
8
+ setup(f) {
9
+ const o = m(), t = e();
10
+ return { __sfc: !0, editorStore: o, handleBack: t, InButtonV2: n, RestoreButton: s };
9
11
  }
10
12
  });
11
13
  export {
12
- _ as default
14
+ c as default
13
15
  };
@@ -1,8 +1,8 @@
1
1
  import s from "./MiddleSlot.vue2.js";
2
2
  import i from "../../../_virtual/_plugin-vue2_normalizer.js";
3
3
  var n = function() {
4
- var e = this, o = e._self._c, t = e._self._setupProxy;
5
- return t.editorStore.isVersionHistoryOpen ? o("div", { staticClass: "d-f" }, [o(t.VersionHistory), o(t.VersionHistoryViewOptions)], 1) : o("div", { staticClass: "d-f" }, [o(t.InButtonV2, { attrs: { id: "guido__undo-button", "left-icon": "line-undo", styling: "ghost", type: "secondary", "label-text-status": !1 } }), o(t.InButtonV2, { attrs: { id: "guido__redo-button", "left-icon": "line-redo", styling: "ghost", type: "secondary", "label-text-status": !1 } }), o(t.InButtonV2, { attrs: { id: "guido__code-button", "data-testid": "Code Editor", "left-icon": "line-code", styling: "ghost", "tooltip-text": "Code Editor", type: "secondary", "label-text-status": !1, "selected-status": t.editorStore.isCodeEditorOpen, "tooltip-options": t.getTooltipOptions("guido__code-button") } }), o(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.trans("newsletter.email-preview") } }), o(t.ViewOptions, { staticClass: "ml-3" })], 1);
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, "tooltip-options": t.getTooltipOptions("guido__preview-button"), "tooltip-text": t.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
6
  }, l = [], r = /* @__PURE__ */ i(
7
7
  s,
8
8
  n,
@@ -11,7 +11,7 @@ var n = function() {
11
11
  null,
12
12
  null
13
13
  );
14
- const p = r.exports;
14
+ const u = r.exports;
15
15
  export {
16
- p as default
16
+ u as default
17
17
  };
@@ -1,22 +1,25 @@
1
- import { defineComponent as r } from "vue";
2
- import { useTranslations as s } from "../../../composables/useTranslations.js";
3
- import { useEditorStore as n } from "../../../stores/editor.js";
4
- import { InButtonV2 as e } from "@useinsider/design-system-vue";
5
- import m from "./version-history/VersionHistory.vue.js";
6
- import p from "./version-history/ViewOptions.vue.js";
7
- import f from "./ViewOptions.vue.js";
8
- const y = /* @__PURE__ */ r({
1
+ import { defineComponent as s, computed as n } from "vue";
2
+ import { useTranslations as p } from "../../../composables/useTranslations.js";
3
+ import { useEditorStore as m } from "../../../stores/editor.js";
4
+ import { InButtonV2 as c } from "@useinsider/design-system-vue";
5
+ import d from "./AmpToggle.vue.js";
6
+ import f from "./version-history/VersionHistory.vue.js";
7
+ import a from "./version-history/ViewOptions.vue.js";
8
+ import l from "./ViewOptions.vue.js";
9
+ const T = /* @__PURE__ */ s({
9
10
  __name: "MiddleSlot",
10
- setup(a) {
11
- const o = n(), t = s();
12
- return { __sfc: !0, editorStore: o, trans: t, getTooltipOptions: (i) => ({
13
- id: `${i}-tooltip`,
11
+ setup(u) {
12
+ const o = m(), t = p(), e = () => {
13
+ o.isPreviewModeOpen = !o.isPreviewModeOpen;
14
+ }, i = n(() => o.isPreviewModeOpen);
15
+ return { __sfc: !0, editorStore: o, trans: t, handlePreviewClick: e, isPreviewModeOpen: i, getTooltipOptions: (r) => ({
16
+ id: `${r}-tooltip`,
14
17
  dynamicPosition: !1,
15
18
  staticPosition: "bottom center",
16
19
  iconStatus: !1
17
- }), InButtonV2: e, VersionHistory: m, VersionHistoryViewOptions: p, ViewOptions: f };
20
+ }), InButtonV2: c, AmpToggle: d, VersionHistory: f, VersionHistoryViewOptions: a, ViewOptions: l };
18
21
  }
19
22
  });
20
23
  export {
21
- y as default
24
+ T as default
22
25
  };
@@ -2,7 +2,7 @@ import o from "./RightSlot.vue2.js";
2
2
  import i from "../../../_virtual/_plugin-vue2_normalizer.js";
3
3
  var n = function() {
4
4
  var s = this, e = s._self._c, t = s._self._setupProxy;
5
- return e("div", { staticClass: "d-f" }, [e(t.InButtonV2, { attrs: { id: "guido__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "label-text-status": !1, "selected-status": t.editorStore.isVersionHistoryOpen }, on: { click: t.handleVersionHistory } }), e(t.InButtonV2, { attrs: { id: "guido__export-button", "left-icon": "line-export", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryOpen, "label-text-status": !1 }, on: { click: t.exportHtml } }), e(t.InButtonV2, { attrs: { id: "guido__save-as-button", "left-icon": "line-newsletter-save-as-template", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryOpen, "label-text-status": !1 } }), e(t.InButtonV2, { attrs: { id: "guido__test-button", "left-icon": "line-architect-test-journey", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryOpen, "label-text-status": !1 } }), e(t.InButtonV2, { staticClass: "ml-3", attrs: { id: "guido__save-button", "label-text": "Save", "disabled-status": t.editorStore.isVersionHistoryOpen } })], 1);
5
+ return e("div", { staticClass: "d-f" }, [e(t.InButtonV2, { attrs: { id: "guido__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isPreviewModeOpen, "label-text-status": !1, "selected-status": t.editorStore.isVersionHistoryOpen }, on: { click: t.handleVersionHistory } }), e(t.InButtonV2, { attrs: { id: "guido__export-button", "left-icon": "line-export", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryOpen, "label-text-status": !1 }, on: { click: t.exportHtml } }), e(t.InButtonV2, { attrs: { id: "guido__save-as-button", "left-icon": "line-newsletter-save-as-template", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryOpen, "label-text-status": !1 } }), e(t.InButtonV2, { attrs: { id: "guido__test-button", "left-icon": "line-architect-test-journey", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryOpen, "label-text-status": !1 } }), e(t.InButtonV2, { staticClass: "ml-3", attrs: { id: "guido__save-button", "label-text": "Save", "disabled-status": t.editorStore.isVersionHistoryOpen || t.editorStore.isPreviewModeOpen }, on: { click: t.handleSave } })], 1);
6
6
  }, r = [], a = /* @__PURE__ */ i(
7
7
  o,
8
8
  n,
@@ -1,21 +1,35 @@
1
- import { defineComponent as s } from "vue";
2
- import { useExport as i } from "../../../composables/useExport.js";
3
- import { useVersionHistoryApi as n } from "../../../composables/useVersionHistoryApi.js";
4
- import { useEditorStore as p } from "../../../stores/editor.js";
5
- import { InButtonV2 as m } from "@useinsider/design-system-vue";
6
- const d = /* @__PURE__ */ s({
1
+ import { defineComponent as m } from "vue";
2
+ import { useActionsApi as p } from "../../../composables/useActionsApi.js";
3
+ import { useExport as c } from "../../../composables/useExport.js";
4
+ import { useSaveStart as l, useSaveComplete as f } from "../../../composables/useGuidoActions.js";
5
+ import { useVersionHistoryApi as u } from "../../../composables/useVersionHistoryApi.js";
6
+ import { useEditorStore as d } from "../../../stores/editor.js";
7
+ import { InButtonV2 as S } from "@useinsider/design-system-vue";
8
+ const E = /* @__PURE__ */ m({
7
9
  __name: "RightSlot",
8
- setup(f) {
9
- const { exportHtml: e } = i(), { openVersionHistory: o, closeVersionHistory: r } = n(), t = p();
10
- return { __sfc: !0, exportHtml: e, openVersionHistory: o, closeVersionHistory: r, editorStore: t, handleVersionHistory: () => {
11
- if (t.isVersionHistoryOpen) {
12
- r();
10
+ setup(h) {
11
+ const { exportHtml: a } = c(), { getCompiledEmail: t } = p(), e = l(), r = f(), { openVersionHistory: s, closeVersionHistory: n } = u(), i = d();
12
+ return { __sfc: !0, exportHtml: a, getCompiledEmail: t, saveStart: e, saveComplete: r, openVersionHistory: s, closeVersionHistory: n, editorStore: i, handleVersionHistory: () => {
13
+ if (i.isVersionHistoryOpen) {
14
+ n();
13
15
  return;
14
16
  }
15
- o();
16
- }, InButtonV2: m };
17
+ s();
18
+ }, handleSave: async () => {
19
+ e();
20
+ try {
21
+ const { html: o } = await t();
22
+ r({
23
+ html: o || "",
24
+ css: ""
25
+ // CSS is embedded in HTML from Stripo
26
+ });
27
+ } catch (o) {
28
+ console.error("Failed to get template data for save:", o);
29
+ }
30
+ }, InButtonV2: S };
17
31
  }
18
32
  });
19
33
  export {
20
- d as default
34
+ E as default
21
35
  };
@@ -1,16 +1,16 @@
1
1
  import r from "./ViewOptions.vue2.js";
2
2
  /* empty css */
3
- import s from "../../../_virtual/_plugin-vue2_normalizer.js";
4
- var n = function() {
3
+ import i from "../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var s = function() {
5
5
  var t = this, o = t._self._c, e = t._self._setupProxy;
6
- return o(e.InSegments, { attrs: { id: "guido__view-option-selection", "with-icon": "", "segment-list": e.segmentList, selected: e.editorStore.editorVisualMode } });
7
- }, i = [], _ = /* @__PURE__ */ s(
6
+ return o(e.InSegments, { attrs: { id: "guido__view-option-selection", "with-icon": "", disable: e.editorStore.isPreviewModeOpen, "segment-list": e.segmentList, selected: e.editorStore.editorVisualMode } });
7
+ }, n = [], _ = /* @__PURE__ */ i(
8
8
  r,
9
+ s,
9
10
  n,
10
- i,
11
11
  !1,
12
12
  null,
13
- "0fff376c"
13
+ "f90d31ea"
14
14
  );
15
15
  const l = _.exports;
16
16
  export {
@@ -1,5 +1,7 @@
1
+ import type { CompileEmailOptions } from '@@/Types/stripo';
1
2
  import { GetCompiledEmailOptions, CompiledEmailResult } from '@@/Types/actions-api';
2
3
  export declare const useActionsApi: () => {
3
4
  getCompiledEmail: (options?: GetCompiledEmailOptions) => Promise<CompiledEmailResult>;
4
5
  activateCustomViewStyles: (isActive?: boolean) => void;
6
+ getPreviewData: (options?: CompileEmailOptions) => Promise<CompiledEmailResult>;
5
7
  };
@@ -1,38 +1,49 @@
1
- const g = () => ({ getCompiledEmail: (t = {}) => new Promise((i, a) => {
2
- const s = { ...{
3
- minimize: !0,
4
- utmEntity: {
5
- utmSource: "",
6
- utmMedium: "",
7
- utmCampaign: "",
8
- utmContent: "",
9
- utmTerm: "",
10
- customUtms: [
11
- {
12
- name1: "val1",
13
- name2: "val2"
14
- }
15
- ]
16
- },
17
- mergeTags: ["Tag1", "Tag2"],
18
- forseAmp: !1,
19
- resetDataSavedFlag: !1,
20
- disableLineHeightsReplace: !0
21
- }, ...t }, o = {
22
- callback: (e, m, l, n, c) => {
23
- e ? a(e) : i({
24
- html: m,
25
- ampHtml: l,
26
- ampErrors: n,
27
- displayConditions: c
28
- });
29
- },
30
- ...s
31
- };
32
- window.StripoEditorApi.actionsApi.compileEmail(o);
33
- }), activateCustomViewStyles: (t = !0) => {
34
- window.StripoEditorApi.actionsApi.activateCustomViewStyles(t);
35
- } });
1
+ const w = () => {
2
+ const a = (e = {}) => new Promise((t, s) => {
3
+ const m = { ...{
4
+ minimize: !0,
5
+ utmEntity: {
6
+ utmSource: "",
7
+ utmMedium: "",
8
+ utmCampaign: "",
9
+ utmContent: "",
10
+ utmTerm: "",
11
+ customUtms: [
12
+ {
13
+ name1: "val1",
14
+ name2: "val2"
15
+ }
16
+ ]
17
+ },
18
+ mergeTags: ["Tag1", "Tag2"],
19
+ forseAmp: !1,
20
+ resetDataSavedFlag: !1,
21
+ disableLineHeightsReplace: !0
22
+ }, ...e }, o = {
23
+ callback: (i, n, l, r, c) => {
24
+ i ? s(i) : t({
25
+ html: n,
26
+ ampHtml: l,
27
+ ampErrors: r,
28
+ displayConditions: c
29
+ });
30
+ },
31
+ ...m
32
+ };
33
+ window.StripoEditorApi.actionsApi.compileEmail(o);
34
+ });
35
+ return { getCompiledEmail: a, activateCustomViewStyles: (e = !0) => {
36
+ window.StripoEditorApi.actionsApi.activateCustomViewStyles(e);
37
+ }, getPreviewData: async (e) => {
38
+ const t = await a({ minimize: !1, resetDataSavedFlag: !1, ...e });
39
+ return {
40
+ html: t.html,
41
+ ampHtml: t.ampHtml ?? "",
42
+ ampErrors: t.ampErrors ?? null,
43
+ displayConditions: t.displayConditions
44
+ };
45
+ } };
46
+ };
36
47
  export {
37
- g as useActionsApi
48
+ w as useActionsApi
38
49
  };
@@ -0,0 +1,4 @@
1
+ export declare const useDebounce: () => {
2
+ debounce: (fn: () => void, ms?: number) => void;
3
+ clearDebounce: () => void;
4
+ };
@@ -0,0 +1,12 @@
1
+ import { ref as c } from "vue";
2
+ const r = () => {
3
+ const e = c(void 0);
4
+ return { debounce: (o, u = 150) => {
5
+ e.value && window.clearTimeout(e.value), e.value = window.setTimeout(o, u);
6
+ }, clearDebounce: () => {
7
+ e.value && (window.clearTimeout(e.value), e.value = void 0);
8
+ } };
9
+ };
10
+ export {
11
+ r as useDebounce
12
+ };
@@ -0,0 +1,46 @@
1
+ import type { Template } from '@@/Types/stripo';
2
+ import type { InjectionKey } from 'vue';
3
+ export type BackHandler = () => void;
4
+ export type SaveStartHandler = () => void;
5
+ export type SaveCompleteHandler = (template: Omit<Template, 'forceRecreate'>) => void;
6
+ export declare const BACK_KEY: InjectionKey<BackHandler>;
7
+ export declare const SAVE_START_KEY: InjectionKey<SaveStartHandler>;
8
+ export declare const SAVE_COMPLETE_KEY: InjectionKey<SaveCompleteHandler>;
9
+ /**
10
+ * Provides Guido action handlers to child components
11
+ */
12
+ export declare const provideGuidoActions: (actions: {
13
+ onBack: BackHandler;
14
+ onSaveStart: SaveStartHandler;
15
+ onSaveComplete: SaveCompleteHandler;
16
+ }) => void;
17
+ /**
18
+ * Provides individual Guido action handlers
19
+ */
20
+ export declare const provideBackHandler: (handler: BackHandler) => void;
21
+ export declare const provideSaveStartHandler: (handler: SaveStartHandler) => void;
22
+ export declare const provideSaveCompleteHandler: (handler: SaveCompleteHandler) => void;
23
+ /**
24
+ * Hook to use the back navigation handler
25
+ * @returns Back navigation function
26
+ */
27
+ export declare const useBack: () => BackHandler;
28
+ /**
29
+ * Hook to use the save start handler
30
+ * @returns Save start function
31
+ */
32
+ export declare const useSaveStart: () => SaveStartHandler;
33
+ /**
34
+ * Hook to use the save complete handler
35
+ * @returns Save complete function
36
+ */
37
+ export declare const useSaveComplete: () => SaveCompleteHandler;
38
+ /**
39
+ * Convenience hook to get all Guido actions
40
+ * @returns Object containing all action handlers
41
+ */
42
+ export declare const useGuidoActions: () => {
43
+ back: BackHandler;
44
+ saveStart: SaveStartHandler;
45
+ saveComplete: SaveCompleteHandler;
46
+ };
@@ -0,0 +1,37 @@
1
+ import { provideValue as o, useInjectedValue as t } from "./useProvideInject.js";
2
+ const r = Symbol.for("guido.back"), n = Symbol.for("guido.save.start"), a = Symbol.for("guido.save.complete"), s = (e) => {
3
+ o(r, e.onBack), o(n, e.onSaveStart), o(a, e.onSaveComplete);
4
+ }, u = () => {
5
+ try {
6
+ return t(r);
7
+ } catch {
8
+ throw new Error(
9
+ "useBack: No back handler provided. Make sure Guido component is in the component tree."
10
+ );
11
+ }
12
+ }, d = () => {
13
+ try {
14
+ return t(n);
15
+ } catch {
16
+ throw new Error(
17
+ "useSaveStart: No save start handler provided. Make sure Guido component is in the component tree."
18
+ );
19
+ }
20
+ }, i = () => {
21
+ try {
22
+ return t(a);
23
+ } catch {
24
+ throw new Error(
25
+ "useSaveComplete: No save complete handler provided. Make sure Guido component is in the component tree."
26
+ );
27
+ }
28
+ };
29
+ export {
30
+ r as BACK_KEY,
31
+ a as SAVE_COMPLETE_KEY,
32
+ n as SAVE_START_KEY,
33
+ s as provideGuidoActions,
34
+ u as useBack,
35
+ i as useSaveComplete,
36
+ d as useSaveStart
37
+ };
@@ -0,0 +1,5 @@
1
+ export declare const useMobileGmailFit: () => {
2
+ setupMobileGmailFit: (iframe: HTMLIFrameElement) => void;
3
+ tearDownMobileGmailFit: (iframe: HTMLIFrameElement) => void;
4
+ hasResponsiveMetaViewport: (doc: Document) => boolean;
5
+ };