@useinsider/guido 1.0.0-beta.eb2a99e → 1.0.0-beta.ef5e504
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.
- package/README.md +21 -133
- package/dist/@types/generic.d.ts +4 -0
- package/dist/components/Guido.vue.d.ts +2 -5
- package/dist/components/Guido.vue.js +8 -8
- package/dist/components/Guido.vue2.js +38 -50
- package/dist/components/organisms/design-preview/DesktopPreview.vue.d.ts +16 -0
- package/dist/components/organisms/design-preview/DesktopPreview.vue.js +22 -0
- package/dist/components/organisms/design-preview/DesktopPreview.vue2.js +28 -0
- package/dist/components/organisms/design-preview/EmailPreview.vue.d.ts +16 -0
- package/dist/components/organisms/design-preview/EmailPreview.vue.js +17 -0
- package/dist/components/organisms/design-preview/EmailPreview.vue2.js +37 -0
- package/dist/components/organisms/design-preview/EmailView.vue.d.ts +18 -0
- package/dist/components/organisms/design-preview/EmailView.vue.js +19 -0
- package/dist/components/organisms/design-preview/EmailView.vue2.js +24 -0
- package/dist/components/organisms/design-preview/InboxView.vue.d.ts +17 -0
- package/dist/components/organisms/design-preview/InboxView.vue.js +19 -0
- package/dist/components/organisms/design-preview/InboxView.vue2.js +23 -0
- package/dist/components/organisms/design-preview/MobilePreview.vue.d.ts +17 -0
- package/dist/components/organisms/design-preview/MobilePreview.vue.js +17 -0
- package/dist/components/organisms/design-preview/MobilePreview.vue2.js +22 -0
- package/dist/components/organisms/header/AmpErrorModal.vue.d.ts +16 -0
- package/dist/components/organisms/header/AmpErrorModal.vue.js +21 -0
- package/dist/components/organisms/header/AmpErrorModal.vue2.js +27 -0
- package/dist/components/organisms/header/AmpToggle.vue.d.ts +2 -0
- package/dist/components/organisms/header/AmpToggle.vue.js +19 -0
- package/dist/components/organisms/header/AmpToggle.vue2.js +38 -0
- package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
- package/dist/components/organisms/header/LeftSlot.vue2.js +8 -10
- package/dist/components/organisms/header/MiddleSlot.vue.js +6 -6
- package/dist/components/organisms/header/MiddleSlot.vue2.js +17 -13
- package/dist/components/organisms/header/RightSlot.vue.js +1 -1
- package/dist/components/organisms/header/RightSlot.vue2.js +14 -28
- package/dist/components/organisms/header/ViewOptions.vue.js +6 -6
- package/dist/composables/useDebounce.d.ts +4 -0
- package/dist/composables/useDebounce.js +12 -0
- package/dist/composables/useMobileGmailFit.d.ts +5 -0
- package/dist/composables/useMobileGmailFit.js +69 -0
- package/dist/composables/usePreviewMode.d.ts +6 -0
- package/dist/composables/usePreviewMode.js +19 -0
- package/dist/composables/useStripo.js +15 -15
- package/dist/enums/gmailMobilePreview.d.ts +7 -0
- package/dist/enums/gmailMobilePreview.js +17 -0
- package/dist/guido.css +1 -1
- package/dist/inbox-mockup.svg +41 -0
- package/dist/phone-mockup.svg +31 -0
- package/dist/services/stripoApi.js +2 -6
- package/dist/stores/editor.d.ts +4 -0
- package/dist/stores/editor.js +7 -3
- package/package.json +1 -1
- package/dist/composables/useGuidoActions.d.ts +0 -46
- package/dist/composables/useGuidoActions.js +0 -37
- package/dist/composables/useProvideInject.d.ts +0 -14
- package/dist/composables/useProvideInject.js +0 -17
|
@@ -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 p-4" }, [s("div", { staticClass: "p-r w-35-s h-26-s" }, [s("img", { staticClass: "w-1 h-1 d-b p-e-n", attrs: { alt: a.mockupAlt, src: a.mockupImage } }), s("div", { staticClass: "p-a l-3 w-21-s h-24-s o-h", style: { top: a.phoneScreenTopMargin } }, [a.showInbox ? s(a.InboxView, { attrs: { "email-data": a.props.emailData }, on: { "open-email": a.openEmail } }) : s(a.EmailView, { attrs: { "email-html": t.emailHtml, "is-amp": t.isAmp }, on: { "back-to-inbox": a.backToInbox } })], 1)])]);
|
|
6
|
+
}, n = [], r = /* @__PURE__ */ o(
|
|
7
|
+
e,
|
|
8
|
+
i,
|
|
9
|
+
n,
|
|
10
|
+
!1,
|
|
11
|
+
null,
|
|
12
|
+
null
|
|
13
|
+
);
|
|
14
|
+
const c = r.exports;
|
|
15
|
+
export {
|
|
16
|
+
c as default
|
|
17
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { defineComponent as c, ref as u, computed as e } from "vue";
|
|
2
|
+
import r from "./EmailView.vue.js";
|
|
3
|
+
import i from "./InboxView.vue.js";
|
|
4
|
+
const b = /* @__PURE__ */ c({
|
|
5
|
+
__name: "MobilePreview",
|
|
6
|
+
props: {
|
|
7
|
+
emailHtml: null,
|
|
8
|
+
isAmp: { type: Boolean },
|
|
9
|
+
emailData: null
|
|
10
|
+
},
|
|
11
|
+
setup(n) {
|
|
12
|
+
const p = n, o = u(!1), m = e(() => o.value ? "/inbox-mockup.svg" : "/phone-mockup.svg"), t = e(() => o.value ? "Inbox mockup" : "Phone mockup"), a = () => {
|
|
13
|
+
o.value = !1;
|
|
14
|
+
}, l = () => {
|
|
15
|
+
o.value = !0;
|
|
16
|
+
}, s = e(() => o.value ? "88px" : "44px");
|
|
17
|
+
return { __sfc: !0, props: p, showInbox: o, mockupImage: m, mockupAlt: t, openEmail: a, backToInbox: l, phoneScreenTopMargin: s, EmailView: r, InboxView: i };
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
export {
|
|
21
|
+
b as default
|
|
22
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
errors: string[];
|
|
3
|
+
}
|
|
4
|
+
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, {
|
|
5
|
+
close: () => void;
|
|
6
|
+
}, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<Props>>>, {}>;
|
|
7
|
+
export default _default;
|
|
8
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
9
|
+
type __VLS_TypePropsToOption<T> = {
|
|
10
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
11
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
12
|
+
} : {
|
|
13
|
+
type: import('vue').PropType<T[K]>;
|
|
14
|
+
required: true;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import n from "./AmpErrorModal.vue2.js";
|
|
2
|
+
import a from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
3
|
+
var i = function() {
|
|
4
|
+
var e = this, o = e._self._c, t = e._self._setupProxy;
|
|
5
|
+
return o(t.InModalV2, { attrs: { id: "amp-error-modal", "close-button-status": "", "close-on-outside-click": "", "description-status": "", "footer-status": "", status: "", size: "medium", "description-text": t.trans("email.amp-validation-description"), "footer-button-group-options": t.footerButtonOptions, "title-text": t.trans("email.amp-validation-title") }, on: { cancelOrBackButtonEvent: t.handleClose, onCloseEvent: t.handleClose, primaryButtonEvent: t.handleFixInCodeEditor }, scopedSlots: e._u([{ key: "contentSlot", fn: function() {
|
|
6
|
+
return [o("div", { staticClass: "d-f f-d-c" }, [o("div", { staticClass: "mb-3" }, [o("div", { staticClass: "l-s-5 f-s-1 f-w-600 t-c-55 t-t-u" }, [e._v(" " + e._s(`${t.trans("products.errors")}(${t.errorCount})`) + " ")])]), o("div", { staticClass: "d-f f-d-c g-13 max-h-21-s o-y-a", staticStyle: { gap: "16px" } }, e._l(t.props.errors, function(s, r) {
|
|
7
|
+
return o(t.InOnPageMessage, { key: r, attrs: { icon: "filled-error-box", size: "medium", type: "alert", text: s } });
|
|
8
|
+
}), 1)])];
|
|
9
|
+
}, proxy: !0 }]) });
|
|
10
|
+
}, l = [], c = /* @__PURE__ */ a(
|
|
11
|
+
n,
|
|
12
|
+
i,
|
|
13
|
+
l,
|
|
14
|
+
!1,
|
|
15
|
+
null,
|
|
16
|
+
null
|
|
17
|
+
);
|
|
18
|
+
const f = c.exports;
|
|
19
|
+
export {
|
|
20
|
+
f as default
|
|
21
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { defineComponent as m } from "vue";
|
|
2
|
+
import { usePreviewMode as f } from "../../../composables/usePreviewMode.js";
|
|
3
|
+
import { useTranslations as u } from "../../../composables/useTranslations.js";
|
|
4
|
+
import { useEditorStore as E } from "../../../stores/editor.js";
|
|
5
|
+
import { InOnPageMessage as w, InModalV2 as A } from "@useinsider/design-system-vue";
|
|
6
|
+
const v = /* @__PURE__ */ m({
|
|
7
|
+
__name: "AmpErrorModal",
|
|
8
|
+
props: {
|
|
9
|
+
errors: null
|
|
10
|
+
},
|
|
11
|
+
emits: ["close"],
|
|
12
|
+
setup(a, { emit: o }) {
|
|
13
|
+
const r = a, p = r.errors.length, e = u(), t = E(), { disablePreviewUI: i } = f(), d = () => {
|
|
14
|
+
o("close");
|
|
15
|
+
}, l = () => {
|
|
16
|
+
var n, s;
|
|
17
|
+
o("close"), t.isPreviewModeOpen = !1, (s = (n = window.StripoEditorApi) == null ? void 0 : n.codeEditorApi) != null && s.openCodeEditor ? (i(), window.StripoEditorApi.codeEditorApi.openCodeEditor()) : console.error("StripoEditorApi codeEditorApi not available");
|
|
18
|
+
}, c = {
|
|
19
|
+
primaryButton: { type: "primary", labelText: e("email.amp-validation-fix") },
|
|
20
|
+
cancelOrBackButton: { type: "secondary", labelText: e("campaign-builder.cancel"), styling: "ghost" }
|
|
21
|
+
};
|
|
22
|
+
return { __sfc: !0, props: r, emit: o, errorCount: p, trans: e, editorStore: t, disablePreviewUI: i, handleClose: d, handleFixInCodeEditor: l, footerButtonOptions: c, InModalV2: A, InOnPageMessage: w };
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
export {
|
|
26
|
+
v as default
|
|
27
|
+
};
|
|
@@ -0,0 +1,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 s from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
3
|
+
var a = function() {
|
|
4
|
+
var e = this, t = e._self._c, r = e._self._setupProxy;
|
|
5
|
+
return r.editorStore.isPreviewModeOpen ? t("div", [t("div", { staticClass: "d-f a-i-c ml-3" }, [t(r.InSegments, { attrs: { id: "guido__amp-toggle", "segment-list": r.segmentList, selected: r.editorStore.emailFormat }, on: { click: r.handleFormatChange } }), r.editorStore.emailFormat === "amp" && r.hasAMPErrors ? t(r.InButtonV2, { staticClass: "ml-2 d-f a-i-c b-c-11 b-c-h-11 t-c-4 t-c-h-4 i-c-4 bor-w-1 bor-s-s bor-c-11", attrs: { id: "guido__amp-error-button", "left-icon": "line-error-box", type: "danger", "label-text-status": !1 }, on: { click: r.handleErrorClick } }) : e._e()], 1), r.showErrorModal ? t(r.AmpErrorModal, { attrs: { errors: r.editorStore.ampErrors || [] }, on: { close: function(c) {
|
|
6
|
+
r.showErrorModal = !1;
|
|
7
|
+
} } }) : e._e()], 1) : e._e();
|
|
8
|
+
}, n = [], i = /* @__PURE__ */ s(
|
|
9
|
+
o,
|
|
10
|
+
a,
|
|
11
|
+
n,
|
|
12
|
+
!1,
|
|
13
|
+
null,
|
|
14
|
+
null
|
|
15
|
+
);
|
|
16
|
+
const _ = i.exports;
|
|
17
|
+
export {
|
|
18
|
+
_ as default
|
|
19
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { defineComponent as i, ref as p, computed as t, watch as c } from "vue";
|
|
2
|
+
import { usePreviewMode as d } from "../../../composables/usePreviewMode.js";
|
|
3
|
+
import { useEditorStore as u } from "../../../stores/editor.js";
|
|
4
|
+
import { InButtonV2 as M, InSegments as f } from "@useinsider/design-system-vue";
|
|
5
|
+
import h from "./AmpErrorModal.vue.js";
|
|
6
|
+
const C = /* @__PURE__ */ i({
|
|
7
|
+
__name: "AmpToggle",
|
|
8
|
+
setup(E) {
|
|
9
|
+
const o = u(), { compile: a } = d(), m = p(!1), r = t(() => !!o.ampHtml), l = t(() => !!(o.ampErrors && o.ampErrors.length > 0)), s = t(() => [
|
|
10
|
+
{ text: "HTML", value: "html" },
|
|
11
|
+
{
|
|
12
|
+
text: "AMP HTML",
|
|
13
|
+
value: "amp",
|
|
14
|
+
tooltipText: r.value ? "" : "AMP HTML Preview isn’t available as no AMP blocks found in your Email Design.",
|
|
15
|
+
position: "bottom",
|
|
16
|
+
align: "center",
|
|
17
|
+
disable: !r.value
|
|
18
|
+
}
|
|
19
|
+
]), n = async () => {
|
|
20
|
+
try {
|
|
21
|
+
const e = await a();
|
|
22
|
+
o.ampHtml = e.ampHtml ?? null, o.ampErrors = e.ampErrors ?? null, o.emailFormat = e.ampHtml ? "amp" : "html";
|
|
23
|
+
} catch (e) {
|
|
24
|
+
console.error("Failed to compile for AMP:", e);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
return c([() => o.editorVisualMode, () => o.isPreviewModeOpen], () => {
|
|
28
|
+
o.isPreviewModeOpen && n();
|
|
29
|
+
}, { immediate: !0 }), { __sfc: !0, editorStore: o, compile: a, showErrorModal: m, hasAMP: r, hasAMPErrors: l, segmentList: s, updateAmpData: n, handleFormatChange: (e) => {
|
|
30
|
+
o.emailFormat = e;
|
|
31
|
+
}, handleErrorClick: () => {
|
|
32
|
+
m.value = !0;
|
|
33
|
+
}, InSegments: f, InButtonV2: M, AmpErrorModal: h };
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
export {
|
|
37
|
+
C as default
|
|
38
|
+
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import r from "./LeftSlot.vue2.js";
|
|
2
2
|
import o from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
return
|
|
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);
|
|
6
6
|
}, a = [], i = /* @__PURE__ */ o(
|
|
7
|
-
n,
|
|
8
7
|
r,
|
|
8
|
+
n,
|
|
9
9
|
a,
|
|
10
10
|
!1,
|
|
11
11
|
null,
|
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
const c = /* @__PURE__ */ r({
|
|
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({
|
|
7
6
|
__name: "LeftSlot",
|
|
8
|
-
setup(
|
|
9
|
-
|
|
10
|
-
return { __sfc: !0, editorStore: o, handleBack: t, InButtonV2: n, RestoreButton: s };
|
|
7
|
+
setup(m) {
|
|
8
|
+
return { __sfc: !0, editorStore: o(), InButtonV2: r, RestoreButton: e };
|
|
11
9
|
}
|
|
12
10
|
});
|
|
13
11
|
export {
|
|
14
|
-
|
|
12
|
+
_ as default
|
|
15
13
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
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
|
|
5
|
-
return t.editorStore.isVersionHistoryOpen ?
|
|
6
|
-
},
|
|
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.editorStore.isPreviewModeOpen, "label-text-status": !1 } }), e(t.InButtonV2, { attrs: { id: "guido__redo-button", "left-icon": "line-redo", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isPreviewModeOpen, "label-text-status": !1 } }), e(t.InButtonV2, { attrs: { id: "guido__code-button", "data-testid": "Code Editor", "left-icon": "line-code", styling: "ghost", "tooltip-text": "Code Editor", type: "secondary", "disabled-status": t.editorStore.isPreviewModeOpen, "label-text-status": !1, "selected-status": t.editorStore.isCodeEditorOpen, "tooltip-options": t.getTooltipOptions("guido__code-button") } }), e(t.InButtonV2, { attrs: { id: "guido__preview-button", "left-icon": "line-show-on", styling: "ghost", type: "secondary", "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__preview-button"), "tooltip-text": t.editorStore.isPreviewModeOpen ? t.trans("newsletter.close-email-preview") : t.trans("newsletter.email-preview") }, on: { click: t.handlePreviewClick } }), e(t.ViewOptions, { staticClass: "ml-3" }), e(t.AmpToggle)], 1);
|
|
6
|
+
}, r = [], l = /* @__PURE__ */ i(
|
|
7
7
|
s,
|
|
8
8
|
n,
|
|
9
|
-
|
|
9
|
+
r,
|
|
10
10
|
!1,
|
|
11
11
|
null,
|
|
12
12
|
null
|
|
13
13
|
);
|
|
14
|
-
const
|
|
14
|
+
const u = l.exports;
|
|
15
15
|
export {
|
|
16
|
-
|
|
16
|
+
u as default
|
|
17
17
|
};
|
|
@@ -1,20 +1,24 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import f from "./
|
|
8
|
-
|
|
1
|
+
import { defineComponent as s } from "vue";
|
|
2
|
+
import { usePreviewMode as n } from "../../../composables/usePreviewMode.js";
|
|
3
|
+
import { useTranslations as p } from "../../../composables/useTranslations.js";
|
|
4
|
+
import { useEditorStore as m } from "../../../stores/editor.js";
|
|
5
|
+
import { InButtonV2 as l } from "@useinsider/design-system-vue";
|
|
6
|
+
import a from "./AmpToggle.vue.js";
|
|
7
|
+
import f from "./version-history/VersionHistory.vue.js";
|
|
8
|
+
import d from "./version-history/ViewOptions.vue.js";
|
|
9
|
+
import c from "./ViewOptions.vue.js";
|
|
10
|
+
const y = /* @__PURE__ */ s({
|
|
9
11
|
__name: "MiddleSlot",
|
|
10
|
-
setup(
|
|
11
|
-
const o =
|
|
12
|
-
return { __sfc: !0, editorStore: o, trans: t,
|
|
13
|
-
|
|
12
|
+
setup(w) {
|
|
13
|
+
const o = m(), t = p(), { enablePreviewUI: e, disablePreviewUI: i } = n();
|
|
14
|
+
return { __sfc: !0, editorStore: o, trans: t, enablePreviewUI: e, disablePreviewUI: i, handlePreviewClick: () => {
|
|
15
|
+
o.isPreviewModeOpen = !o.isPreviewModeOpen, o.isPreviewModeOpen ? e() : i();
|
|
16
|
+
}, getTooltipOptions: (r) => ({
|
|
17
|
+
id: `${r}-tooltip`,
|
|
14
18
|
dynamicPosition: !1,
|
|
15
19
|
staticPosition: "bottom center",
|
|
16
20
|
iconStatus: !1
|
|
17
|
-
}), InButtonV2:
|
|
21
|
+
}), InButtonV2: l, AmpToggle: a, VersionHistory: f, VersionHistoryViewOptions: d, ViewOptions: c };
|
|
18
22
|
}
|
|
19
23
|
});
|
|
20
24
|
export {
|
|
@@ -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
|
|
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 } })], 1);
|
|
6
6
|
}, r = [], a = /* @__PURE__ */ i(
|
|
7
7
|
o,
|
|
8
8
|
n,
|
|
@@ -1,35 +1,21 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
import { InButtonV2 as S } from "@useinsider/design-system-vue";
|
|
8
|
-
const E = /* @__PURE__ */ m({
|
|
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({
|
|
9
7
|
__name: "RightSlot",
|
|
10
|
-
setup(
|
|
11
|
-
const { exportHtml:
|
|
12
|
-
return { __sfc: !0, exportHtml:
|
|
13
|
-
if (
|
|
14
|
-
|
|
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();
|
|
15
13
|
return;
|
|
16
14
|
}
|
|
17
|
-
|
|
18
|
-
},
|
|
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 };
|
|
15
|
+
o();
|
|
16
|
+
}, InButtonV2: m };
|
|
31
17
|
}
|
|
32
18
|
});
|
|
33
19
|
export {
|
|
34
|
-
|
|
20
|
+
d as default
|
|
35
21
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import r from "./ViewOptions.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
var
|
|
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
|
-
},
|
|
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
|
-
"
|
|
13
|
+
"f90d31ea"
|
|
14
14
|
);
|
|
15
15
|
const l = _.exports;
|
|
16
16
|
export {
|
|
@@ -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,69 @@
|
|
|
1
|
+
import { useDebounce as p } from "./useDebounce.js";
|
|
2
|
+
import { META_VIEWPORT_REGEX as h, INLINE_WIDTH_REGEX as w, EMAIL_CONTAINER_SELECTORS as f, DEFAULT_EMAIL_WIDTH as b, MIN_SCALE as v, TABLE_WIDTH_REGEX as A, RESIZE_DEBOUNCE_MS as u } from "../enums/gmailMobilePreview.js";
|
|
3
|
+
let a = null, c = null;
|
|
4
|
+
const { debounce: y } = p(), M = (t) => {
|
|
5
|
+
if (!t)
|
|
6
|
+
return null;
|
|
7
|
+
const e = t.match(A);
|
|
8
|
+
if (!e)
|
|
9
|
+
return null;
|
|
10
|
+
const r = Number(e[1]);
|
|
11
|
+
return Number.isNaN(r) ? null : r;
|
|
12
|
+
}, g = (t) => {
|
|
13
|
+
const e = Array.from(t.querySelectorAll("table[width]")).reduce(
|
|
14
|
+
(n, i) => {
|
|
15
|
+
const o = M(i.getAttribute("width"));
|
|
16
|
+
return o && o > n ? o : n;
|
|
17
|
+
},
|
|
18
|
+
0
|
|
19
|
+
), r = Array.from(t.querySelectorAll('[style*="width"]')).reduce(
|
|
20
|
+
(n, i) => {
|
|
21
|
+
const l = (i.getAttribute("style") || "").match(w);
|
|
22
|
+
if (!l)
|
|
23
|
+
return n;
|
|
24
|
+
const m = Number(l[1]);
|
|
25
|
+
return !Number.isNaN(m) && m > n ? m : n;
|
|
26
|
+
},
|
|
27
|
+
0
|
|
28
|
+
), s = f.reduce((n, i) => {
|
|
29
|
+
const o = t.querySelector(i);
|
|
30
|
+
if (!o)
|
|
31
|
+
return n;
|
|
32
|
+
const l = Math.max(o.offsetWidth, o.scrollWidth);
|
|
33
|
+
return l > n ? l : n;
|
|
34
|
+
}, 0);
|
|
35
|
+
return Math.max(e, r, s) || b;
|
|
36
|
+
}, N = (t) => {
|
|
37
|
+
t.documentElement.style.setProperty("overflow-x", "visible", "important"), t.body.style.setProperty("visibility", "visible", "important");
|
|
38
|
+
}, S = (t) => {
|
|
39
|
+
t.documentElement.style.removeProperty("transform"), t.documentElement.style.removeProperty("transform-origin"), t.documentElement.style.removeProperty("height"), t.body.style.removeProperty("overflow-x");
|
|
40
|
+
}, d = (t) => {
|
|
41
|
+
const e = t.querySelector('meta[name="viewport"]');
|
|
42
|
+
if (!e)
|
|
43
|
+
return !1;
|
|
44
|
+
const r = e.getAttribute("content") || "";
|
|
45
|
+
return h.test(r);
|
|
46
|
+
}, W = (t, e) => {
|
|
47
|
+
const r = g(t), s = e / r, n = Math.min(Math.max(s, v), 1);
|
|
48
|
+
t.documentElement.style.setProperty("height", "100%", "important"), t.documentElement.style.setProperty("transform", `scale(${n})`, "important"), t.documentElement.style.setProperty("transform-origin", "top left", "important"), t.body.style.setProperty("overflow-x", "hidden", "important");
|
|
49
|
+
}, E = (t) => {
|
|
50
|
+
const e = t.contentWindow;
|
|
51
|
+
c && e && e.removeEventListener("resize", c), a && window.removeEventListener("resize", a), c = null, a = null;
|
|
52
|
+
}, P = () => ({ setupMobileGmailFit: (e) => {
|
|
53
|
+
const r = e.contentDocument, s = e.contentWindow;
|
|
54
|
+
if (!r || !s)
|
|
55
|
+
return;
|
|
56
|
+
N(r);
|
|
57
|
+
const n = () => {
|
|
58
|
+
const i = e.clientWidth || e.getBoundingClientRect().width || 375;
|
|
59
|
+
if (d(r)) {
|
|
60
|
+
S(r);
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
W(r, i);
|
|
64
|
+
};
|
|
65
|
+
n(), E(e), c = () => y(n, u), s.addEventListener("resize", c), a = () => y(n, u), window.addEventListener("resize", a);
|
|
66
|
+
}, tearDownMobileGmailFit: E, hasResponsiveMetaViewport: d });
|
|
67
|
+
export {
|
|
68
|
+
P as useMobileGmailFit
|
|
69
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { CompiledEmailResult, CompileEmailOptions } from '@@/Types/stripo';
|
|
2
|
+
export declare const usePreviewMode: () => {
|
|
3
|
+
compile: (options?: CompileEmailOptions) => Promise<CompiledEmailResult>;
|
|
4
|
+
enablePreviewUI: () => void;
|
|
5
|
+
disablePreviewUI: () => void;
|
|
6
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useActionsApi as s } from "./useActionsApi.js";
|
|
2
|
+
const a = () => {
|
|
3
|
+
const { getCompiledEmail: e } = s();
|
|
4
|
+
return { compile: async (t) => {
|
|
5
|
+
const i = await e({ minimize: !1, resetDataSavedFlag: !1, ...t });
|
|
6
|
+
return {
|
|
7
|
+
html: i.html,
|
|
8
|
+
ampHtml: i.ampHtml || null,
|
|
9
|
+
ampErrors: i.ampErrors || null
|
|
10
|
+
};
|
|
11
|
+
}, enablePreviewUI: () => {
|
|
12
|
+
window.StripoEditorApi.uiApi.setSettingsPanelVisible(!1), window.StripoEditorApi.uiApi.setBlocksPanelVisible(!1);
|
|
13
|
+
}, disablePreviewUI: () => {
|
|
14
|
+
window.StripoEditorApi.uiApi.setSettingsPanelVisible(!0), window.StripoEditorApi.uiApi.setBlocksPanelVisible(!0);
|
|
15
|
+
} };
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
a as usePreviewMode
|
|
19
|
+
};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useCustomInterfaceAppearance as
|
|
3
|
-
import { useToaster as
|
|
4
|
-
import { displayConditions as
|
|
5
|
-
import
|
|
6
|
-
import { useStripoApi as
|
|
7
|
-
import { useEditorStore as
|
|
8
|
-
const
|
|
9
|
-
const { handleError: d } =
|
|
10
|
-
const i =
|
|
1
|
+
import { useActionsApi as m } from "./useActionsApi.js";
|
|
2
|
+
import { useCustomInterfaceAppearance as g } from "./useCustomInterfaceAppearance.js";
|
|
3
|
+
import { useToaster as f } from "./useToaster.js";
|
|
4
|
+
import { displayConditions as E } from "../enums/displayConditions.js";
|
|
5
|
+
import S from "../extensions/DynamicContent/extension.js";
|
|
6
|
+
import { useStripoApi as y } from "../services/stripoApi.js";
|
|
7
|
+
import { useEditorStore as C } from "../stores/editor.js";
|
|
8
|
+
const x = (a) => {
|
|
9
|
+
const { handleError: d } = f(), { getToken: c, getCustomFonts: u } = y(), l = (e, r = []) => {
|
|
10
|
+
const i = C(), { html: t, css: s } = e;
|
|
11
11
|
window.UIEditor.initEditor(
|
|
12
12
|
document.querySelector("#guido-editor"),
|
|
13
13
|
{
|
|
14
14
|
metadata: a,
|
|
15
15
|
html: t,
|
|
16
16
|
css: s,
|
|
17
|
-
forceRecreate:
|
|
17
|
+
forceRecreate: !0,
|
|
18
18
|
locale: "en",
|
|
19
19
|
undoButtonSelector: "#guido__undo-button",
|
|
20
20
|
redoButtonSelector: "#guido__redo-button",
|
|
@@ -30,7 +30,7 @@ const A = (a) => {
|
|
|
30
30
|
`,
|
|
31
31
|
conditionsEnabled: !0,
|
|
32
32
|
customConditionsEnabled: !0,
|
|
33
|
-
conditionCategories:
|
|
33
|
+
conditionCategories: E,
|
|
34
34
|
messageSettingsEnabled: !1,
|
|
35
35
|
editorFonts: {
|
|
36
36
|
showDefaultStandardFonts: !0,
|
|
@@ -47,7 +47,7 @@ const A = (a) => {
|
|
|
47
47
|
},
|
|
48
48
|
onTemplateLoaded() {
|
|
49
49
|
try {
|
|
50
|
-
const { importCss: o } =
|
|
50
|
+
const { importCss: o } = g(), { activateCustomViewStyles: n } = m();
|
|
51
51
|
o(), n();
|
|
52
52
|
} catch (o) {
|
|
53
53
|
d(o, "Failed to load custom interface appearance");
|
|
@@ -63,7 +63,7 @@ const A = (a) => {
|
|
|
63
63
|
i.isVersionHistoryOpen = o;
|
|
64
64
|
},
|
|
65
65
|
ignoreClickOutsideSelectors: ["#guido-dynamic-content-modal"],
|
|
66
|
-
extensions: [
|
|
66
|
+
extensions: [S]
|
|
67
67
|
}
|
|
68
68
|
);
|
|
69
69
|
}, p = (e) => new Promise((r, i) => {
|
|
@@ -87,5 +87,5 @@ const A = (a) => {
|
|
|
87
87
|
} };
|
|
88
88
|
};
|
|
89
89
|
export {
|
|
90
|
-
|
|
90
|
+
x as useStripo
|
|
91
91
|
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const DEFAULT_EMAIL_WIDTH = 600;
|
|
2
|
+
export declare const MIN_SCALE = 0.2;
|
|
3
|
+
export declare const RESIZE_DEBOUNCE_MS = 100;
|
|
4
|
+
export declare const INLINE_WIDTH_REGEX: RegExp;
|
|
5
|
+
export declare const TABLE_WIDTH_REGEX: RegExp;
|
|
6
|
+
export declare const META_VIEWPORT_REGEX: RegExp;
|
|
7
|
+
export declare const EMAIL_CONTAINER_SELECTORS: readonly [".wrapper", ".container", "#wrapper", "#container", "[data-email-container]", "[role=\"presentation\"]"];
|