@useinsider/guido 1.0.0-beta.9980c81 → 1.0.0-beta.9e097de
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 +11 -4
- package/dist/components/Guido.vue.d.ts +1 -5
- package/dist/components/Guido.vue.js +8 -8
- package/dist/components/Guido.vue2.js +37 -56
- package/dist/components/organisms/header/MiddleSlot.vue.js +7 -7
- package/dist/components/organisms/header/MiddleSlot.vue2.js +15 -17
- package/dist/components/organisms/header/RightSlot.vue.js +7 -7
- package/dist/components/organisms/header/RightSlot.vue2.js +24 -24
- package/dist/components/organisms/header/ViewOptions.vue.js +3 -3
- package/dist/components/organisms/header/ViewOptions.vue2.js +25 -10
- package/dist/composables/useActionsApi.d.ts +1 -2
- package/dist/composables/useActionsApi.js +35 -45
- package/dist/composables/useHttp.js +21 -23
- package/dist/composables/useStripo.js +17 -23
- package/dist/extensions/DynamicContent/dynamic-content.js +15 -13
- package/dist/guido.css +1 -1
- package/dist/stores/editor.d.ts +1 -1
- package/dist/stores/editor.js +4 -4
- package/dist/utils/tooltipUtils.d.ts +2 -0
- package/dist/utils/tooltipUtils.js +11 -0
- package/package.json +3 -1
- package/dist/components/organisms/save-template/SaveTemplateModal.vue.d.ts +0 -16
- package/dist/components/organisms/save-template/SaveTemplateModal.vue.js +0 -20
- package/dist/components/organisms/save-template/SaveTemplateModal.vue2.js +0 -78
- package/dist/components/wrappers/ModalWrapper.vue.d.ts +0 -72
- package/dist/components/wrappers/ModalWrapper.vue.js +0 -19
- package/dist/components/wrappers/ModalWrapper.vue2.js +0 -43
- package/dist/composables/useSaveAsTemplate.d.ts +0 -7
- package/dist/composables/useSaveAsTemplate.js +0 -52
- package/dist/composables/useTemplateNameValidation.d.ts +0 -7
- package/dist/composables/useTemplateNameValidation.js +0 -33
- package/dist/mock/api/template-library.d.ts +0 -2
- package/dist/stores/dynamic-content.d.ts +0 -27
- package/dist/stores/dynamic-content.js +0 -23
- package/dist/stores/template-categories.d.ts +0 -41
- package/dist/stores/template-categories.js +0 -91
- package/dist/utils/arrayUtil.d.ts +0 -1
- package/dist/utils/arrayUtil.js +0 -10
- package/dist/utils/base64.d.ts +0 -2
- package/dist/utils/base64.js +0 -14
- package/dist/utils/generic.d.ts +0 -1
- package/dist/utils/generic.js +0 -7
- package/dist/utils/genericUtil.d.ts +0 -2
- package/dist/utils/genericUtil.js +0 -7
- package/dist/utils/textUtil.d.ts +0 -2
package/dist/@types/generic.d.ts
CHANGED
|
@@ -9,7 +9,14 @@ export type DynamicContent = {
|
|
|
9
9
|
text: string;
|
|
10
10
|
fallback?: string;
|
|
11
11
|
};
|
|
12
|
-
export
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
export interface TooltipOptions {
|
|
13
|
+
id: string;
|
|
14
|
+
dynamicPosition: boolean;
|
|
15
|
+
staticPosition: 'top center' | 'top left' | 'top right' | 'bottom center' | 'bottom left' | 'bottom right' | 'right center' | 'right top' | 'right bottom' | 'left center' | 'left top' | 'left bottom';
|
|
16
|
+
iconStatus: boolean;
|
|
17
|
+
offset?: {
|
|
18
|
+
x: number;
|
|
19
|
+
y: number;
|
|
20
|
+
};
|
|
21
|
+
preventXss?: boolean;
|
|
22
|
+
}
|
|
@@ -8,7 +8,6 @@ type __VLS_Props = {
|
|
|
8
8
|
username?: string;
|
|
9
9
|
html?: string;
|
|
10
10
|
css?: string;
|
|
11
|
-
preselectedDynamicContentList: DynamicContent[];
|
|
12
11
|
guidoConfig: GuidoConfig;
|
|
13
12
|
};
|
|
14
13
|
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {
|
|
@@ -20,10 +19,7 @@ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__
|
|
|
20
19
|
"dynamic-content:open": (detail: DynamicContent | null) => void;
|
|
21
20
|
back: () => void;
|
|
22
21
|
"save:start": () => void;
|
|
23
|
-
"save:complete": (
|
|
24
|
-
template: Omit<Template, "forceRecreate">;
|
|
25
|
-
dynamicContentList: DynamicContent[];
|
|
26
|
-
}) => void;
|
|
22
|
+
"save:complete": (template: Omit<Template, "forceRecreate">) => void;
|
|
27
23
|
}, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
|
|
28
24
|
export default _default;
|
|
29
25
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import o from "./Guido.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
3
|
+
import i from "../_virtual/_plugin-vue2_normalizer.js";
|
|
4
4
|
var s = function() {
|
|
5
|
-
var
|
|
6
|
-
return
|
|
7
|
-
},
|
|
5
|
+
var e = this, r = e._self._c, t = e._self._setupProxy;
|
|
6
|
+
return r("div", { staticClass: "guido-editor__wrapper" }, [r(t.HeaderWrapper), r("div", { staticClass: "guido-editor__container", attrs: { id: "guido-editor" } })], 1);
|
|
7
|
+
}, _ = [], a = /* @__PURE__ */ i(
|
|
8
8
|
o,
|
|
9
9
|
s,
|
|
10
|
-
|
|
10
|
+
_,
|
|
11
11
|
!1,
|
|
12
12
|
null,
|
|
13
|
-
"
|
|
13
|
+
"89bedf08"
|
|
14
14
|
);
|
|
15
|
-
const
|
|
15
|
+
const f = a.exports;
|
|
16
16
|
export {
|
|
17
|
-
|
|
17
|
+
f as default
|
|
18
18
|
};
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { provideGuidoActions as
|
|
3
|
-
import { usePartner as
|
|
4
|
-
import { useStripo as
|
|
5
|
-
import { DefaultUsername as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
import { useEditorStore as x } from "../stores/editor.js";
|
|
10
|
-
import { useDynamicContentStore as A } from "../stores/dynamic-content.js";
|
|
11
|
-
const q = /* @__PURE__ */ w({
|
|
1
|
+
import { defineComponent as h, onMounted as w } from "vue";
|
|
2
|
+
import { provideGuidoActions as D } from "../composables/useGuidoActions.js";
|
|
3
|
+
import { usePartner as E } from "../composables/usePartner.js";
|
|
4
|
+
import { useStripo as S } from "../composables/useStripo.js";
|
|
5
|
+
import { DefaultUsername as _, DefaultGuidoConfig as G } from "../enums/defaults.js";
|
|
6
|
+
import I from "./organisms/header/HeaderWrapper.vue.js";
|
|
7
|
+
import { useStripoApi as k } from "../services/stripoApi.js";
|
|
8
|
+
const B = /* @__PURE__ */ h({
|
|
12
9
|
__name: "Guido",
|
|
13
10
|
props: {
|
|
14
11
|
templateId: null,
|
|
@@ -18,34 +15,26 @@ const q = /* @__PURE__ */ w({
|
|
|
18
15
|
username: null,
|
|
19
16
|
html: null,
|
|
20
17
|
css: null,
|
|
21
|
-
preselectedDynamicContentList: null,
|
|
22
18
|
guidoConfig: null
|
|
23
19
|
},
|
|
24
20
|
emits: ["dynamic-content:open", "back", "save:start", "save:complete"],
|
|
25
|
-
setup(
|
|
26
|
-
const o =
|
|
27
|
-
templateId:
|
|
28
|
-
userId:
|
|
29
|
-
guidoConfig:
|
|
30
|
-
html:
|
|
31
|
-
css:
|
|
32
|
-
partnerName:
|
|
33
|
-
productType:
|
|
34
|
-
username:
|
|
21
|
+
setup(C, { expose: b, emit: t }) {
|
|
22
|
+
const o = C, { getPartnerName: n, getProductType: a } = E(), {
|
|
23
|
+
templateId: c,
|
|
24
|
+
userId: s,
|
|
25
|
+
guidoConfig: i,
|
|
26
|
+
html: r = "",
|
|
27
|
+
css: l = "",
|
|
28
|
+
partnerName: d = n(),
|
|
29
|
+
productType: u = a(),
|
|
30
|
+
username: m = _
|
|
35
31
|
} = o;
|
|
36
32
|
window.GuidoConfig = {
|
|
37
|
-
...
|
|
38
|
-
...
|
|
33
|
+
...G,
|
|
34
|
+
...i
|
|
39
35
|
};
|
|
40
|
-
const { initPlugin:
|
|
41
|
-
|
|
42
|
-
userId: r,
|
|
43
|
-
username: y,
|
|
44
|
-
partnerName: u,
|
|
45
|
-
productType: p,
|
|
46
|
-
preselectedDynamicContentList: c
|
|
47
|
-
}), { getDefaultTemplate: g } = N();
|
|
48
|
-
T({
|
|
36
|
+
const { initPlugin: p } = S({ emailId: c, userId: s, username: m, partnerName: d, productType: u }), { getDefaultTemplate: g } = k();
|
|
37
|
+
D({
|
|
49
38
|
onBack: () => {
|
|
50
39
|
console.debug("guido:back"), t("back");
|
|
51
40
|
},
|
|
@@ -53,47 +42,39 @@ const q = /* @__PURE__ */ w({
|
|
|
53
42
|
console.debug("guido:save:start"), t("save:start");
|
|
54
43
|
},
|
|
55
44
|
onSaveComplete: (e) => {
|
|
56
|
-
console.debug("guido:save:complete",
|
|
57
|
-
template: e,
|
|
58
|
-
dynamicContentList: n.getSelectedDynamicContentList
|
|
59
|
-
}), t("save:complete", {
|
|
60
|
-
template: e,
|
|
61
|
-
dynamicContentList: n.getSelectedDynamicContentList
|
|
62
|
-
});
|
|
45
|
+
console.debug("guido:save:complete", e), t("save:complete", e);
|
|
63
46
|
}
|
|
64
47
|
});
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
},
|
|
68
|
-
console.debug("dynamic-content:close", e), n.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
|
|
69
|
-
}, S = () => {
|
|
48
|
+
const f = (e) => {
|
|
49
|
+
console.debug("dynamic-content:close", e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
|
|
50
|
+
}, y = () => {
|
|
70
51
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
71
52
|
};
|
|
72
|
-
return
|
|
53
|
+
return w(async () => {
|
|
73
54
|
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow");
|
|
74
55
|
try {
|
|
75
56
|
let e = {
|
|
76
|
-
html:
|
|
77
|
-
css:
|
|
57
|
+
html: r,
|
|
58
|
+
css: l,
|
|
78
59
|
forceRecreate: !0
|
|
79
60
|
// TODO: It should be false for old templates. We will communicate with Stripo
|
|
80
61
|
};
|
|
81
|
-
e.html || (e = await g()), await
|
|
62
|
+
e.html || (e = await g()), await p(e);
|
|
82
63
|
} catch (e) {
|
|
83
64
|
console.error("Failed to initialize Stripo editor:", e);
|
|
84
65
|
}
|
|
85
66
|
document.addEventListener("dynamic-content:open", (e) => {
|
|
86
|
-
const
|
|
87
|
-
console.debug("dynamic-content:open",
|
|
67
|
+
const v = e;
|
|
68
|
+
console.debug("dynamic-content:open", v.detail), t("dynamic-content:open", v.detail);
|
|
88
69
|
});
|
|
89
|
-
}),
|
|
70
|
+
}), b({
|
|
90
71
|
dynamicContent: {
|
|
91
|
-
insert:
|
|
92
|
-
close:
|
|
72
|
+
insert: f,
|
|
73
|
+
close: y
|
|
93
74
|
}
|
|
94
|
-
}), { __sfc: !0,
|
|
75
|
+
}), { __sfc: !0, props: o, getPartnerName: n, getProductType: a, templateId: c, userId: s, guidoConfig: i, html: r, css: l, partnerName: d, productType: u, username: m, emit: t, initPlugin: p, getDefaultTemplate: g, insertDynamicContent: f, closeDynamicContent: y, HeaderWrapper: I };
|
|
95
76
|
}
|
|
96
77
|
});
|
|
97
78
|
export {
|
|
98
|
-
|
|
79
|
+
B as default
|
|
99
80
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import i from "./MiddleSlot.vue2.js";
|
|
2
|
+
import s from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
3
3
|
var n = function() {
|
|
4
4
|
var e = this, o = e._self._c, t = e._self._setupProxy;
|
|
5
|
-
return t.editorStore.isVersionHistoryOpen ? o("div", { staticClass: "d-f" }, [o(t.VersionHistory), o(t.VersionHistoryViewOptions)], 1) : o("div", { staticClass: "d-f" }, [o(t.InButtonV2, { attrs: { id: "guido__undo-button", "left-icon": "line-undo", styling: "ghost", type: "secondary", "label-text-status": !1 } }), o(t.InButtonV2, { attrs: { id: "guido__redo-button", "left-icon": "line-redo", styling: "ghost", type: "secondary", "label-text-status": !1 } }), o(t.InButtonV2, { attrs: { id: "guido__code-button", "data-testid": "Code Editor", "left-icon": "line-code", styling: "ghost",
|
|
6
|
-
}, l = [], r = /* @__PURE__ */
|
|
7
|
-
|
|
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,
|
|
8
8
|
n,
|
|
9
9
|
l,
|
|
10
10
|
!1,
|
|
11
11
|
null,
|
|
12
12
|
null
|
|
13
13
|
);
|
|
14
|
-
const
|
|
14
|
+
const u = r.exports;
|
|
15
15
|
export {
|
|
16
|
-
|
|
16
|
+
u as default
|
|
17
17
|
};
|
|
@@ -1,22 +1,20 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useTranslations as
|
|
3
|
-
import { useEditorStore as
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
|
|
1
|
+
import { defineComponent as s, computed as t } from "vue";
|
|
2
|
+
import { useTranslations as n } from "../../../composables/useTranslations.js";
|
|
3
|
+
import { useEditorStore as p } from "../../../stores/editor.js";
|
|
4
|
+
import { getTooltipOptions as m } from "../../../utils/tooltipUtils.js";
|
|
5
|
+
import { InButtonV2 as l } from "@useinsider/design-system-vue";
|
|
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({
|
|
9
10
|
__name: "MiddleSlot",
|
|
10
|
-
setup(
|
|
11
|
-
const o = n(), t =
|
|
12
|
-
return { __sfc: !0, editorStore:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
staticPosition: "bottom center",
|
|
16
|
-
iconStatus: !1
|
|
17
|
-
}), InButtonV2: e, VersionHistory: m, VersionHistoryViewOptions: p, ViewOptions: f };
|
|
11
|
+
setup(f) {
|
|
12
|
+
const e = p(), o = n(), 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
|
+
}, getTooltipOptions: m, InButtonV2: l, VersionHistory: d, VersionHistoryViewOptions: w, ViewOptions: c };
|
|
18
16
|
}
|
|
19
17
|
});
|
|
20
18
|
export {
|
|
21
|
-
|
|
19
|
+
M as default
|
|
22
20
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import
|
|
1
|
+
import s 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", "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
|
|
6
|
-
},
|
|
7
|
-
|
|
4
|
+
var o = this, e = o._self._c, t = o._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, "tooltip-options": t.getTooltipOptions("guido__history-button"), "tooltip-text": t.versionHistoryTooltipText }, 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, "tooltip-options": t.getTooltipOptions("guido__export-button"), "tooltip-text": t.trans("newsletter.export") }, 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, "tooltip-options": t.getTooltipOptions("guido__save-as-button"), "tooltip-text": t.trans("newsletter.save-templates") } }), 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, "tooltip-options": t.getTooltipOptions("guido__test-button"), "tooltip-text": t.trans("newsletter.test-email") } }), e(t.InButtonV2, { staticClass: "ml-3", attrs: { id: "guido__save-button", "label-text": "Save", "disabled-status": t.editorStore.isVersionHistoryOpen }, on: { click: t.handleSave } })], 1);
|
|
6
|
+
}, r = [], l = /* @__PURE__ */ i(
|
|
7
|
+
s,
|
|
8
8
|
n,
|
|
9
|
-
|
|
9
|
+
r,
|
|
10
10
|
!1,
|
|
11
11
|
null,
|
|
12
12
|
null
|
|
13
13
|
);
|
|
14
|
-
const u =
|
|
14
|
+
const u = l.exports;
|
|
15
15
|
export {
|
|
16
16
|
u as default
|
|
17
17
|
};
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useActionsApi as
|
|
3
|
-
import { useExport as
|
|
4
|
-
import { useSaveStart as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
1
|
+
import { defineComponent as l, computed as f } from "vue";
|
|
2
|
+
import { useActionsApi as u } from "../../../composables/useActionsApi.js";
|
|
3
|
+
import { useExport as d } from "../../../composables/useExport.js";
|
|
4
|
+
import { useSaveStart as y, useSaveComplete as v } from "../../../composables/useGuidoActions.js";
|
|
5
|
+
import { useTranslations as h } from "../../../composables/useTranslations.js";
|
|
6
|
+
import { useVersionHistoryApi as S } from "../../../composables/useVersionHistoryApi.js";
|
|
7
|
+
import { useEditorStore as H } from "../../../stores/editor.js";
|
|
8
|
+
import { getTooltipOptions as _ } from "../../../utils/tooltipUtils.js";
|
|
9
|
+
import { InButtonV2 as V } from "@useinsider/design-system-vue";
|
|
10
|
+
const R = /* @__PURE__ */ l({
|
|
9
11
|
__name: "RightSlot",
|
|
10
|
-
setup(
|
|
11
|
-
const { exportHtml:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
a();
|
|
12
|
+
setup(g) {
|
|
13
|
+
const { exportHtml: p } = d(), { getCompiledEmail: r } = u(), s = y(), i = v(), { openVersionHistory: n, closeVersionHistory: m } = S(), o = H(), t = h(), a = () => {
|
|
14
|
+
if (o.isVersionHistoryOpen) {
|
|
15
|
+
m();
|
|
15
16
|
return;
|
|
16
17
|
}
|
|
17
18
|
n();
|
|
18
|
-
},
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
r();
|
|
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
|
+
s();
|
|
22
22
|
try {
|
|
23
|
-
const { html:
|
|
24
|
-
|
|
25
|
-
html:
|
|
23
|
+
const { html: e } = await r();
|
|
24
|
+
i({
|
|
25
|
+
html: e || "",
|
|
26
26
|
css: ""
|
|
27
27
|
// CSS is embedded in HTML from Stripo
|
|
28
28
|
});
|
|
29
|
-
} catch (
|
|
30
|
-
console.error("Failed to get template data for save:",
|
|
29
|
+
} catch (e) {
|
|
30
|
+
console.error("Failed to get template data for save:", e);
|
|
31
31
|
}
|
|
32
|
-
}, InButtonV2:
|
|
32
|
+
}, getTooltipOptions: _, InButtonV2: V };
|
|
33
33
|
}
|
|
34
34
|
});
|
|
35
35
|
export {
|
|
36
|
-
|
|
36
|
+
R as default
|
|
37
37
|
};
|
|
@@ -1,15 +1,30 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { defineComponent as n } from "vue";
|
|
2
|
+
import { useTranslations as p } from "../../../composables/useTranslations.js";
|
|
3
|
+
import { useEditorStore as s } from "../../../stores/editor.js";
|
|
4
|
+
import { getTooltipOptions as o } from "../../../utils/tooltipUtils.js";
|
|
5
|
+
import { InSegments as r } from "@useinsider/design-system-vue";
|
|
6
|
+
const f = /* @__PURE__ */ n({
|
|
5
7
|
__name: "ViewOptions",
|
|
6
|
-
setup(
|
|
7
|
-
|
|
8
|
-
{
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
setup(m) {
|
|
9
|
+
const e = s(), t = p(), i = [
|
|
10
|
+
{
|
|
11
|
+
text: "",
|
|
12
|
+
icon: "line-desktop",
|
|
13
|
+
value: "desktop",
|
|
14
|
+
tooltipText: t("newsletter.desktop"),
|
|
15
|
+
tooltipOptions: o("guido__view-option-desktop")
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
text: "",
|
|
19
|
+
icon: "line-menu-mobileapp",
|
|
20
|
+
value: "mobile",
|
|
21
|
+
tooltipText: t("newsletter.mobile"),
|
|
22
|
+
tooltipOptions: o("guido__view-option-mobile")
|
|
23
|
+
}
|
|
24
|
+
];
|
|
25
|
+
return { __sfc: !0, editorStore: e, trans: t, segmentList: i, InSegments: r };
|
|
11
26
|
}
|
|
12
27
|
});
|
|
13
28
|
export {
|
|
14
|
-
|
|
29
|
+
f as default
|
|
15
30
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { GetCompiledEmailOptions, CompiledEmailResult
|
|
1
|
+
import { GetCompiledEmailOptions, CompiledEmailResult } from '@@/Types/actions-api';
|
|
2
2
|
export declare const useActionsApi: () => {
|
|
3
3
|
getCompiledEmail: (options?: GetCompiledEmailOptions) => Promise<CompiledEmailResult>;
|
|
4
|
-
getRawTemplateData: () => Promise<TemplateDataResult>;
|
|
5
4
|
activateCustomViewStyles: (isActive?: boolean) => void;
|
|
6
5
|
};
|
|
@@ -1,48 +1,38 @@
|
|
|
1
|
-
const g = () => ({
|
|
2
|
-
|
|
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
|
-
|
|
36
|
-
window.StripoEditorApi.actionsApi.getTemplateData(
|
|
37
|
-
(e) => {
|
|
38
|
-
t(e);
|
|
39
|
-
}
|
|
40
|
-
);
|
|
41
|
-
}),
|
|
42
|
-
activateCustomViewStyles: (t = !0) => {
|
|
43
|
-
window.StripoEditorApi.actionsApi.activateCustomViewStyles(t);
|
|
44
|
-
}
|
|
45
|
-
});
|
|
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
|
+
} });
|
|
46
36
|
export {
|
|
47
37
|
g as useActionsApi
|
|
48
38
|
};
|
|
@@ -1,20 +1,18 @@
|
|
|
1
|
-
import { ref as p, computed as
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
const h = p(!1), a = p(null), u = p(null), g = T(() => h.value), y = T(() => a.value !== null), v = {
|
|
1
|
+
import { ref as p, computed as v } from "vue";
|
|
2
|
+
const j = (y = {}) => {
|
|
3
|
+
const h = p(!1), a = p(null), u = p(null), E = v(() => h.value), g = v(() => a.value !== null), T = {
|
|
5
4
|
baseURL: "",
|
|
6
5
|
timeout: 1e4,
|
|
7
6
|
retry: 0,
|
|
8
7
|
retryDelay: 1e3,
|
|
9
8
|
headers: {
|
|
10
|
-
"Content-Type": "application/json"
|
|
11
|
-
"X-CSRF-TOKEN": H()
|
|
9
|
+
"Content-Type": "application/json"
|
|
12
10
|
},
|
|
13
|
-
...
|
|
11
|
+
...y
|
|
14
12
|
}, w = (e, s) => {
|
|
15
13
|
if (e.startsWith("http://") || e.startsWith("https://"))
|
|
16
14
|
return e;
|
|
17
|
-
const t = s ||
|
|
15
|
+
const t = s || T.baseURL || "";
|
|
18
16
|
return t.endsWith("/") && e.startsWith("/") ? `${t}${e.slice(1)}` : t.endsWith("/") || e.startsWith("/") ? `${t}${e}` : `${t}/${e}`;
|
|
19
17
|
}, P = (e) => new Promise((s, t) => {
|
|
20
18
|
setTimeout(() => {
|
|
@@ -24,20 +22,20 @@ const k = (b = {}) => {
|
|
|
24
22
|
setTimeout(s, e);
|
|
25
23
|
}), i = async (e, s, t, D = {}) => {
|
|
26
24
|
a.value = null, h.value = !0, u.value = new AbortController();
|
|
27
|
-
const n = { ...
|
|
25
|
+
const n = { ...T, ...D }, L = w(s, n.baseURL), c = {
|
|
28
26
|
method: e,
|
|
29
27
|
headers: { ...n.headers },
|
|
30
28
|
signal: u.value.signal,
|
|
31
29
|
...n
|
|
32
30
|
};
|
|
33
31
|
t && ["POST", "PUT", "PATCH"].includes(e) && (t instanceof FormData ? (delete c.headers["Content-Type"], c.body = t) : c.body = JSON.stringify(t));
|
|
34
|
-
const
|
|
32
|
+
const b = async (m = 0) => {
|
|
35
33
|
try {
|
|
36
34
|
const o = [fetch(L, c)];
|
|
37
35
|
n.timeout && o.push(P(n.timeout));
|
|
38
36
|
const r = await Promise.race(o);
|
|
39
37
|
if (!r.ok) {
|
|
40
|
-
const
|
|
38
|
+
const H = `HTTP Error: ${r.status} ${r.statusText}`, d = new Error(H);
|
|
41
39
|
throw d.status = r.status, d.statusText = r.statusText, d.response = r, d;
|
|
42
40
|
}
|
|
43
41
|
let f;
|
|
@@ -51,36 +49,36 @@ const k = (b = {}) => {
|
|
|
51
49
|
} catch (o) {
|
|
52
50
|
const r = o instanceof Error && o.name === "AbortError";
|
|
53
51
|
if (m < (n.retry || 0) && !r)
|
|
54
|
-
return await x(n.retryDelay || 1e3),
|
|
52
|
+
return await x(n.retryDelay || 1e3), b(m + 1);
|
|
55
53
|
throw o instanceof Error ? o.name === "AbortError" ? a.value = { message: "Request was cancelled" } : a.value = { message: o.message } : a.value = o, o;
|
|
56
54
|
}
|
|
57
55
|
};
|
|
58
56
|
try {
|
|
59
|
-
return await
|
|
57
|
+
return await b();
|
|
60
58
|
} finally {
|
|
61
59
|
h.value = !1, u.value = null;
|
|
62
60
|
}
|
|
63
|
-
},
|
|
61
|
+
}, $ = (e, s) => i("GET", e, void 0, s), C = (e, s, t) => i("POST", e, s, t), U = (e, s, t) => i("PUT", e, s, t), A = (e, s, t) => i("PATCH", e, s, t), R = (e, s) => i("DELETE", e, void 0, s), W = (e) => {
|
|
64
62
|
u.value && u.value.abort(e);
|
|
65
63
|
}, q = () => {
|
|
66
64
|
a.value = null;
|
|
67
65
|
};
|
|
68
66
|
return {
|
|
69
67
|
// State
|
|
70
|
-
loading:
|
|
71
|
-
error:
|
|
72
|
-
hasError:
|
|
68
|
+
loading: E,
|
|
69
|
+
error: v(() => a.value),
|
|
70
|
+
hasError: g,
|
|
73
71
|
// Methods
|
|
74
72
|
request: i,
|
|
75
|
-
get:
|
|
76
|
-
post:
|
|
77
|
-
put:
|
|
78
|
-
patch:
|
|
79
|
-
delete:
|
|
73
|
+
get: $,
|
|
74
|
+
post: C,
|
|
75
|
+
put: U,
|
|
76
|
+
patch: A,
|
|
77
|
+
delete: R,
|
|
80
78
|
cancel: W,
|
|
81
79
|
clearError: q
|
|
82
80
|
};
|
|
83
81
|
};
|
|
84
82
|
export {
|
|
85
|
-
|
|
83
|
+
j as useHttp
|
|
86
84
|
};
|