@useinsider/guido 1.0.0-beta.a19efaa → 1.0.0-beta.a3ed027

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 (63) hide show
  1. package/README.md +133 -21
  2. package/dist/@types/generic.d.ts +3 -5
  3. package/dist/components/Guido.vue.d.ts +9 -2
  4. package/dist/components/Guido.vue.js +8 -8
  5. package/dist/components/Guido.vue2.js +56 -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 +43 -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 +23 -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 +6 -6
  30. package/dist/components/organisms/header/MiddleSlot.vue2.js +18 -13
  31. package/dist/components/organisms/header/RightSlot.vue.js +7 -7
  32. package/dist/components/organisms/header/RightSlot.vue2.js +27 -15
  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 -14
  45. package/dist/enums/emailPreview.d.ts +3 -0
  46. package/dist/enums/emailPreview.js +6 -0
  47. package/dist/enums/gmailMobilePreview.d.ts +7 -0
  48. package/dist/enums/gmailMobilePreview.js +17 -0
  49. package/dist/guido.css +1 -1
  50. package/dist/inbox-mockup.svg +39 -0
  51. package/dist/mock/api/default-template.d.ts +2 -0
  52. package/dist/phone-mockup.svg +31 -0
  53. package/dist/services/stripoApi.d.ts +2 -1
  54. package/dist/services/stripoApi.js +27 -7
  55. package/dist/stores/editor.d.ts +3 -0
  56. package/dist/stores/editor.js +6 -3
  57. package/package.json +1 -1
  58. package/dist/composables/useTemplates.d.ts +0 -5
  59. package/dist/composables/useTemplates.js +0 -27
  60. package/dist/static/templates/default/index.html.js +0 -5
  61. package/dist/static/templates/default/style.css.js +0 -119
  62. package/dist/utils/tooltipUtils.d.ts +0 -2
  63. package/dist/utils/tooltipUtils.js +0 -9
@@ -0,0 +1,19 @@
1
+ import i from "./EmailView.vue2.js";
2
+ import n from "../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var t = function() {
4
+ var e = this, s = e._self._c, a = e._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 e.$emit("back-to-inbox");
7
+ } } }, [s(a.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" }, [e._v(e._s(a.trans("newsletter.inbox")))])], 1), s("div", { staticClass: "d-f a-i-c" }, [s(a.InIcons, { staticClass: "i-c-52", attrs: { name: "line-chevron-down" } }), s(a.InIcons, { staticClass: "ml-1 i-c-52", attrs: { name: "line-chevron-up" } })], 1)]), s("div", { directives: [{ name: "show", rawName: "v-show", value: a.isLoadingIframe, expression: "isLoadingIframe" }], staticClass: "d-f a-i-c j-c-c w-1 h-1" }, [s(a.InLoading)], 1), s("iframe", { directives: [{ name: "show", rawName: "v-show", value: !a.isLoadingIframe, expression: "!isLoadingIframe" }], 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: e.emailHtml }, on: { load: a.onLoad } })]);
8
+ }, o = [], c = /* @__PURE__ */ n(
9
+ i,
10
+ t,
11
+ o,
12
+ !1,
13
+ null,
14
+ null
15
+ );
16
+ const d = c.exports;
17
+ export {
18
+ d as default
19
+ };
@@ -0,0 +1,24 @@
1
+ import { defineComponent as u, ref as l } from "vue";
2
+ import { useMobileGmailFit as f } from "../../../composables/useMobileGmailFit.js";
3
+ import { useTranslations as d } from "../../../composables/useTranslations.js";
4
+ import { InLoading as y, InIcons as v } from "@useinsider/design-system-vue";
5
+ const I = /* @__PURE__ */ u({
6
+ __name: "EmailView",
7
+ props: {
8
+ emailHtml: null,
9
+ isAmp: { type: Boolean }
10
+ },
11
+ emits: ["back-to-inbox", "load"],
12
+ setup(c, { emit: t }) {
13
+ const o = c, p = d(), n = l(), { setupMobileGmailFit: s } = f(), m = l(!0), r = () => !!o.isAmp && o.emailHtml.includes("@media") && o.emailHtml.includes(".adapt-img"), i = (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: p, iframeRef: n, setupMobileGmailFit: s, isLoadingIframe: m, isAmpResponsive: r, clearAmpTransforms: i, onLoad: () => {
17
+ const e = n.value, a = e == null ? void 0 : e.contentDocument;
18
+ !e || !a || (s(e), r() && setTimeout(() => i(a), 50), t("load"), m.value = !1);
19
+ }, InIcons: v, InLoading: y };
20
+ }
21
+ });
22
+ export {
23
+ I 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,23 @@
1
+ import { defineComponent as s, ref as c, computed as e } from "vue";
2
+ import { INBOX_PREVIEW_PATH as u, PHONE_PREVIEW_PATH as i } from "../../../enums/emailPreview.js";
3
+ import f from "./EmailView.vue.js";
4
+ import _ from "./InboxView.vue.js";
5
+ const b = /* @__PURE__ */ s({
6
+ __name: "MobilePreview",
7
+ props: {
8
+ emailHtml: null,
9
+ isAmp: { type: Boolean },
10
+ emailData: null
11
+ },
12
+ setup(n) {
13
+ const t = n, o = c(!1), m = e(() => o.value ? u : i), p = e(() => o.value ? "Inbox mockup" : "Phone mockup"), a = () => {
14
+ o.value = !1;
15
+ }, l = () => {
16
+ o.value = !0;
17
+ }, r = e(() => o.value ? "88px" : "44px");
18
+ return { __sfc: !0, props: t, showInbox: o, mockupImage: m, mockupAlt: p, openEmail: a, backToInbox: l, phoneScreenTopMargin: r, EmailView: f, InboxView: _ };
19
+ }
20
+ });
21
+ export {
22
+ b as default
23
+ };
@@ -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 a, 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(), r = v(!1), m = a(() => !!t.ampHtml), n = a(() => !!(t.ampErrors && t.ampErrors.length > 0)), p = a(() => [
12
+ { text: e("dynamic-creatives.html"), value: "html" },
13
+ {
14
+ text: e("email.amp-html"),
15
+ value: "amp",
16
+ tooltipText: m.value ? "" : e("email.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
+ r.value = !0;
39
+ }, d = a(() => t.emailFormat === "amp" && n.value);
40
+ function f() {
41
+ r.value = !1;
42
+ }
43
+ return { __sfc: !0, editorStore: t, getPreviewData: s, showToaster: l, trans: e, showErrorModal: r, 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,10 +1,10 @@
1
- import i from "./MiddleSlot.vue2.js";
2
- import s from "../../../_virtual/_plugin-vue2_normalizer.js";
1
+ import s from "./MiddleSlot.vue2.js";
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, "tooltip-options": t.getTooltipOptions("guido__undo-button"), "tooltip-text": t.trans("action-builder.undo") } }), o(t.InButtonV2, { attrs: { id: "guido__redo-button", "left-icon": "line-redo", styling: "ghost", type: "secondary", "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__redo-button"), "tooltip-text": t.trans("action-builder.redo") } }), o(t.InButtonV2, { attrs: { id: "guido__code-button", "data-testid": "Code Editor", "left-icon": "line-code", styling: "ghost", type: "secondary", "label-text-status": !1, "selected-status": t.editorStore.isCodeEditorOpen, "tooltip-options": t.getTooltipOptions("guido__code-button"), "tooltip-text": t.codeEditorTooltipText } }), o(t.InButtonV2, { attrs: { id: "guido__preview-button", "left-icon": "line-show-on", styling: "ghost", type: "secondary", "label-text-status": !1, "selected-status": t.editorStore.isPreviewModeOpen, "tooltip-options": t.getTooltipOptions("guido__preview-button"), "tooltip-text": t.previewTooltipText }, on: { click: t.handlePreview } }), o(t.ViewOptions, { staticClass: "ml-3" })], 1);
6
- }, l = [], r = /* @__PURE__ */ s(
7
- i,
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
+ }, l = [], r = /* @__PURE__ */ i(
7
+ s,
8
8
  n,
9
9
  l,
10
10
  !1,
@@ -1,20 +1,25 @@
1
- import { defineComponent as s, computed as t } from "vue";
2
- import { InButtonV2 as n } from "@useinsider/design-system-vue";
1
+ import { defineComponent as s, computed as n } from "vue";
3
2
  import { useTranslations as p } from "../../../composables/useTranslations.js";
4
3
  import { useEditorStore as m } from "../../../stores/editor.js";
5
- import { getTooltipOptions as l } from "../../../utils/tooltipUtils.js";
6
- import d from "./version-history/VersionHistory.vue.js";
7
- import w from "./version-history/ViewOptions.vue.js";
8
- import c from "./ViewOptions.vue.js";
9
- const M = /* @__PURE__ */ s({
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({
10
10
  __name: "MiddleSlot",
11
- setup(f) {
12
- const e = m(), o = p(), r = t(() => e.isCodeEditorOpen ? o("newsletter.close-html-editor") : o("newsletter.html-editor")), i = t(() => e.isPreviewModeOpen ? o("newsletter.close-email-preview") : o("newsletter.email-preview"));
13
- return { __sfc: !0, editorStore: e, trans: o, codeEditorTooltipText: r, previewTooltipText: i, handlePreview: () => {
14
- e.isPreviewModeOpen = !e.isPreviewModeOpen;
15
- }, InButtonV2: n, getTooltipOptions: l, VersionHistory: d, VersionHistoryViewOptions: w, ViewOptions: c };
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`,
17
+ dynamicPosition: !1,
18
+ staticPosition: "bottom center",
19
+ iconStatus: !1
20
+ }), InButtonV2: c, AmpToggle: d, VersionHistory: f, VersionHistoryViewOptions: a, ViewOptions: l };
16
21
  }
17
22
  });
18
23
  export {
19
- M as default
24
+ T as default
20
25
  };
@@ -1,17 +1,17 @@
1
- import s from "./RightSlot.vue2.js";
1
+ import o from "./RightSlot.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 o("div", { staticClass: "d-f" }, [o(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, "tooltip-options": t.getTooltipOptions("guido__history-button"), "tooltip-text": t.versionHistoryTooltipText }, on: { click: t.handleVersionHistory } }), o(t.InButtonV2, { attrs: { id: "guido__export-button", "left-icon": "line-export", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryOpen, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__export-button"), "tooltip-text": t.trans("newsletter.export") }, on: { click: t.exportHtml } }), o(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, "tooltip-options": t.getTooltipOptions("guido__save-as-button"), "tooltip-text": t.trans("newsletter.save-templates") } }), o(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, "tooltip-options": t.getTooltipOptions("guido__test-button"), "tooltip-text": t.trans("newsletter.test-email") } }), o(t.InButtonV2, { staticClass: "ml-3", attrs: { id: "guido__save-button", "label-text": "Save", "disabled-status": t.editorStore.isVersionHistoryOpen } })], 1);
6
- }, r = [], l = /* @__PURE__ */ i(
7
- s,
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", "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
+ }, r = [], a = /* @__PURE__ */ i(
7
+ o,
8
8
  n,
9
9
  r,
10
10
  !1,
11
11
  null,
12
12
  null
13
13
  );
14
- const d = l.exports;
14
+ const c = a.exports;
15
15
  export {
16
- d as default
16
+ c as default
17
17
  };
@@ -1,23 +1,35 @@
1
- import { defineComponent as p, computed as m } from "vue";
2
- import { InButtonV2 as c } from "@useinsider/design-system-vue";
3
- import { useExport as f } from "../../../composables/useExport.js";
4
- import { useTranslations as l } from "../../../composables/useTranslations.js";
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
5
  import { useVersionHistoryApi as u } from "../../../composables/useVersionHistoryApi.js";
6
- import { useEditorStore as y } from "../../../stores/editor.js";
7
- import { getTooltipOptions as a } from "../../../utils/tooltipUtils.js";
8
- const O = /* @__PURE__ */ p({
6
+ import { useEditorStore as d } from "../../../stores/editor.js";
7
+ import { InButtonV2 as S } from "@useinsider/design-system-vue";
8
+ const E = /* @__PURE__ */ m({
9
9
  __name: "RightSlot",
10
- setup(H) {
11
- const { exportHtml: e } = f(), { openVersionHistory: r, closeVersionHistory: s } = u(), o = y(), t = l(), i = () => {
12
- if (o.isVersionHistoryOpen) {
13
- s();
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();
14
15
  return;
15
16
  }
16
- r();
17
- }, n = m(() => o.isVersionHistoryOpen ? t("newsletter.close-version-history") : t("newsletter.version-history"));
18
- return { __sfc: !0, exportHtml: e, openVersionHistory: r, closeVersionHistory: s, editorStore: o, trans: t, handleVersionHistory: i, versionHistoryTooltipText: n, InButtonV2: c, getTooltipOptions: a };
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 };
19
31
  }
20
32
  });
21
33
  export {
22
- O as default
34
+ E as default
23
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
+ };