@useinsider/guido 1.0.0-beta.a0d6eee → 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.
- package/dist/@types/generic.d.ts +3 -14
- package/dist/components/Guido.vue.d.ts +3 -6
- package/dist/components/Guido.vue.js +8 -8
- package/dist/components/Guido.vue2.js +36 -48
- package/dist/components/organisms/design-preview/AmpErrorModal.vue.d.ts +16 -0
- package/dist/components/organisms/design-preview/AmpErrorModal.vue.js +21 -0
- package/dist/components/organisms/design-preview/AmpErrorModal.vue2.js +30 -0
- 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 +43 -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 +33 -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 +23 -0
- package/dist/components/organisms/header/AmpToggle.vue.d.ts +2 -0
- package/dist/components/organisms/header/AmpToggle.vue.js +17 -0
- package/dist/components/organisms/header/AmpToggle.vue2.js +48 -0
- package/dist/components/organisms/header/MiddleSlot.vue.js +6 -6
- package/dist/components/organisms/header/MiddleSlot.vue2.js +20 -15
- package/dist/components/organisms/header/RightSlot.vue.js +7 -7
- package/dist/components/organisms/header/RightSlot.vue2.js +22 -24
- package/dist/components/organisms/header/ViewOptions.vue.js +6 -6
- package/dist/components/organisms/header/ViewOptions.vue2.js +10 -29
- package/dist/components/organisms/header/version-history/ViewOptions.vue.js +3 -3
- package/dist/components/organisms/header/version-history/ViewOptions.vue2.js +16 -34
- package/dist/composables/useActionsApi.d.ts +2 -0
- package/dist/composables/useActionsApi.js +47 -36
- 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/useStripo.js +17 -23
- package/dist/enums/emailPreview.d.ts +3 -0
- package/dist/enums/emailPreview.js +6 -0
- package/dist/enums/gmailMobilePreview.d.ts +7 -0
- package/dist/enums/gmailMobilePreview.js +17 -0
- package/dist/extensions/DynamicContent/dynamic-content.js +15 -13
- package/dist/guido.css +1 -1
- package/dist/inbox-mockup.svg +39 -0
- package/dist/phone-mockup.svg +31 -0
- package/dist/stores/editor.d.ts +3 -0
- package/dist/stores/editor.js +6 -3
- package/package.json +1 -1
- package/dist/stores/dynamic-content.d.ts +0 -27
- package/dist/stores/dynamic-content.js +0 -23
- package/dist/utils/arrayUtil.d.ts +0 -1
- package/dist/utils/arrayUtil.js +0 -10
- package/dist/utils/genericUtil.d.ts +0 -2
- package/dist/utils/genericUtil.js +0 -7
- package/dist/utils/tooltipUtils.d.ts +0 -2
- package/dist/utils/tooltipUtils.js +0 -11
|
@@ -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,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import s from "./MiddleSlot.vue2.js";
|
|
2
|
+
import i from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
3
3
|
var n = function() {
|
|
4
|
-
var
|
|
5
|
-
return t.editorStore.isVersionHistoryOpen ?
|
|
6
|
-
}, l = [], r = /* @__PURE__ */
|
|
7
|
-
|
|
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
|
|
2
|
-
import { useTranslations as
|
|
3
|
-
import { useEditorStore as
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
const
|
|
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({
|
|
10
10
|
__name: "MiddleSlot",
|
|
11
|
-
setup(
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
|
|
24
|
+
T as default
|
|
20
25
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import
|
|
1
|
+
import o from "./RightSlot.vue2.js";
|
|
2
2
|
import i from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
3
3
|
var n = function() {
|
|
4
|
-
var
|
|
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", "
|
|
6
|
-
}, r = [],
|
|
7
|
-
|
|
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
|
|
14
|
+
const c = a.exports;
|
|
15
15
|
export {
|
|
16
|
-
|
|
16
|
+
c as default
|
|
17
17
|
};
|
|
@@ -1,37 +1,35 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useActionsApi as
|
|
3
|
-
import { useExport as
|
|
4
|
-
import { useSaveStart as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
import { InButtonV2 as V } from "@useinsider/design-system-vue";
|
|
10
|
-
const R = /* @__PURE__ */ l({
|
|
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({
|
|
11
9
|
__name: "RightSlot",
|
|
12
|
-
setup(
|
|
13
|
-
const { exportHtml:
|
|
14
|
-
|
|
15
|
-
|
|
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();
|
|
16
15
|
return;
|
|
17
16
|
}
|
|
18
|
-
n();
|
|
19
|
-
}, c = f(() => o.isVersionHistoryOpen ? t("newsletter.close-version-history") : t("newsletter.version-history"));
|
|
20
|
-
return { __sfc: !0, exportHtml: p, getCompiledEmail: r, saveStart: s, saveComplete: i, openVersionHistory: n, closeVersionHistory: m, editorStore: o, trans: t, handleVersionHistory: a, versionHistoryTooltipText: c, handleSave: async () => {
|
|
21
17
|
s();
|
|
18
|
+
}, handleSave: async () => {
|
|
19
|
+
e();
|
|
22
20
|
try {
|
|
23
|
-
const { html:
|
|
24
|
-
|
|
25
|
-
html:
|
|
21
|
+
const { html: o } = await t();
|
|
22
|
+
r({
|
|
23
|
+
html: o || "",
|
|
26
24
|
css: ""
|
|
27
25
|
// CSS is embedded in HTML from Stripo
|
|
28
26
|
});
|
|
29
|
-
} catch (
|
|
30
|
-
console.error("Failed to get template data for save:",
|
|
27
|
+
} catch (o) {
|
|
28
|
+
console.error("Failed to get template data for save:", o);
|
|
31
29
|
}
|
|
32
|
-
},
|
|
30
|
+
}, InButtonV2: S };
|
|
33
31
|
}
|
|
34
32
|
});
|
|
35
33
|
export {
|
|
36
|
-
|
|
34
|
+
E as default
|
|
37
35
|
};
|
|
@@ -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 {
|
|
@@ -1,34 +1,15 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
import { InSegments as r } from "@useinsider/design-system-vue";
|
|
6
|
-
const d = /* @__PURE__ */ n({
|
|
1
|
+
import { defineComponent as e } from "vue";
|
|
2
|
+
import { useEditorStore as t } from "../../../stores/editor.js";
|
|
3
|
+
import { InSegments as o } from "@useinsider/design-system-vue";
|
|
4
|
+
const u = /* @__PURE__ */ e({
|
|
7
5
|
__name: "ViewOptions",
|
|
8
|
-
setup(
|
|
9
|
-
|
|
10
|
-
{
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
value: "desktop",
|
|
14
|
-
position: "bottom",
|
|
15
|
-
align: "center",
|
|
16
|
-
tooltipText: t("newsletter.desktop"),
|
|
17
|
-
tooltipOptions: o("guido__view-option-desktop")
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
text: "",
|
|
21
|
-
icon: "line-menu-mobileapp",
|
|
22
|
-
value: "mobile",
|
|
23
|
-
position: "bottom",
|
|
24
|
-
align: "center",
|
|
25
|
-
tooltipText: t("newsletter.mobile"),
|
|
26
|
-
tooltipOptions: o("guido__view-option-mobile")
|
|
27
|
-
}
|
|
28
|
-
];
|
|
29
|
-
return { __sfc: !0, editorStore: e, trans: t, segmentList: i, InSegments: r };
|
|
6
|
+
setup(n) {
|
|
7
|
+
return { __sfc: !0, editorStore: t(), segmentList: [
|
|
8
|
+
{ text: "", icon: "line-desktop", value: "desktop" },
|
|
9
|
+
{ text: "", icon: "line-menu-mobileapp", value: "mobile" }
|
|
10
|
+
], InSegments: o };
|
|
30
11
|
}
|
|
31
12
|
});
|
|
32
13
|
export {
|
|
33
|
-
|
|
14
|
+
u as default
|
|
34
15
|
};
|
|
@@ -1,41 +1,23 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
import { InSegments as c } from "@useinsider/design-system-vue";
|
|
7
|
-
const h = /* @__PURE__ */ p({
|
|
1
|
+
import { defineComponent as s } from "vue";
|
|
2
|
+
import { useVersionHistoryApi as n } from "../../../../composables/useVersionHistoryApi.js";
|
|
3
|
+
import { useVersionHistoryStore as r } from "../../../../stores/version-history.js";
|
|
4
|
+
import { InSegments as m } from "@useinsider/design-system-vue";
|
|
5
|
+
const d = /* @__PURE__ */ s({
|
|
8
6
|
__name: "ViewOptions",
|
|
9
|
-
setup(
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
tooltipText: o("newsletter.desktop"),
|
|
18
|
-
tooltipOptions: n("guido__version-history-view-option-desktop")
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
text: "",
|
|
22
|
-
icon: "line-menu-mobileapp",
|
|
23
|
-
value: "mobile",
|
|
24
|
-
position: "bottom",
|
|
25
|
-
align: "center",
|
|
26
|
-
tooltipText: o("newsletter.mobile"),
|
|
27
|
-
tooltipOptions: n("guido__version-history-view-option-mobile")
|
|
28
|
-
}
|
|
29
|
-
];
|
|
30
|
-
return { __sfc: !0, versionHistoryStore: t, switchToDesktopPreview: e, switchToMobilePreview: i, trans: o, segmentList: r, changeVisualMode: (s) => {
|
|
31
|
-
if (t.editorVisualMode = s, s === "mobile") {
|
|
32
|
-
i();
|
|
7
|
+
setup(p) {
|
|
8
|
+
const e = r(), { switchToDesktopPreview: o, switchToMobilePreview: t } = n();
|
|
9
|
+
return { __sfc: !0, versionHistoryStore: e, switchToDesktopPreview: o, switchToMobilePreview: t, segmentList: [
|
|
10
|
+
{ text: "", icon: "line-desktop", value: "desktop" },
|
|
11
|
+
{ text: "", icon: "line-menu-mobileapp", value: "mobile" }
|
|
12
|
+
], changeVisualMode: (i) => {
|
|
13
|
+
if (e.editorVisualMode = i, i === "mobile") {
|
|
14
|
+
t();
|
|
33
15
|
return;
|
|
34
16
|
}
|
|
35
|
-
|
|
36
|
-
}, InSegments:
|
|
17
|
+
o();
|
|
18
|
+
}, InSegments: m };
|
|
37
19
|
}
|
|
38
20
|
});
|
|
39
21
|
export {
|
|
40
|
-
|
|
22
|
+
d as default
|
|
41
23
|
};
|
|
@@ -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
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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
|
-
|
|
48
|
+
w as useActionsApi
|
|
38
49
|
};
|
|
@@ -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
|
+
};
|