@useinsider/guido 3.18.2-beta.c3e75f6 → 3.18.2-beta.c512191
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/components/organisms/header/EditorActions.vue.js +4 -4
- package/dist/components/organisms/header/EditorActions.vue2.js +25 -23
- package/dist/composables/useActionsApi.js +47 -52
- package/dist/composables/useCodeEditorApi.js +9 -23
- package/dist/composables/useHttp.js +48 -39
- package/dist/composables/useTranslations.js +2 -3
- package/dist/composables/useVersionHistoryApi.js +24 -33
- package/dist/guido.css +1 -1
- package/dist/stores/unsubscribe.js +3 -3
- package/package.json +5 -5
- package/dist/src/utils/stripoEditorApi.d.ts +0 -4
- package/dist/utils/stripoEditorApi.js +0 -11
|
@@ -9,15 +9,15 @@ var u = function() {
|
|
|
9
9
|
} } }), e(t.MigrationConfirmModal, { ref: "migrationModalRef", on: { confirm: function(r) {
|
|
10
10
|
return t.executeSave(!1);
|
|
11
11
|
} } })], 1);
|
|
12
|
-
},
|
|
12
|
+
}, p = [], c = /* @__PURE__ */ d(
|
|
13
13
|
l,
|
|
14
14
|
u,
|
|
15
|
-
|
|
15
|
+
p,
|
|
16
16
|
!1,
|
|
17
17
|
null,
|
|
18
|
-
"
|
|
18
|
+
"1ca6baf0"
|
|
19
19
|
);
|
|
20
|
-
const v =
|
|
20
|
+
const v = c.exports;
|
|
21
21
|
export {
|
|
22
22
|
v as default
|
|
23
23
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as q, ref as
|
|
1
|
+
import { defineComponent as q, ref as l, computed as w } from "vue";
|
|
2
2
|
import { useActionsApi as b } from "../../../composables/useActionsApi.js";
|
|
3
3
|
import { useConfig as k } from "../../../composables/useConfig.js";
|
|
4
4
|
import { useExport as B } from "../../../composables/useExport.js";
|
|
@@ -17,46 +17,48 @@ import { storeToRefs as Q } from "pinia";
|
|
|
17
17
|
import U from "./MigrationConfirmModal.vue.js";
|
|
18
18
|
const ft = /* @__PURE__ */ q({
|
|
19
19
|
__name: "EditorActions",
|
|
20
|
-
setup(W, { expose:
|
|
21
|
-
const { config:
|
|
20
|
+
setup(W, { expose: x }) {
|
|
21
|
+
const { config: m, isFeatureEnabled: c } = k(), { exportHtml: p } = B(), { save: u } = R(), { openVersionHistory: f, closeVersionHistory: d } = P(), { getCompiledEmail: v } = b(), { compileHtml: y } = L(), { validateLiquidSyntax: g } = j(), { handleError: r } = z(), e = G(), h = J(), { hasMigrations: H } = Q(h), s = I(), i = l(!1), a = l(!1), S = l(), V = D(), _ = () => {
|
|
22
22
|
if (e.isVersionHistoryOpen) {
|
|
23
|
-
|
|
23
|
+
d();
|
|
24
24
|
return;
|
|
25
25
|
}
|
|
26
|
-
|
|
26
|
+
f();
|
|
27
27
|
}, C = async () => {
|
|
28
|
-
i.value = !0, await
|
|
28
|
+
i.value = !0, await p(), i.value = !1;
|
|
29
29
|
}, A = () => {
|
|
30
30
|
e.isSaveAsTemplateDrawerOpen = !0;
|
|
31
|
-
}, M =
|
|
31
|
+
}, M = w(() => e.isVersionHistoryOpen ? s("newsletter.close-version-history") : s("newsletter.version-history")), O = w(
|
|
32
32
|
() => {
|
|
33
33
|
var t, o;
|
|
34
|
-
return ((o = (t =
|
|
34
|
+
return ((o = (t = m.value) == null ? void 0 : t.features) == null ? void 0 : o.versionHistory) && !e.isPreviewModeOpen;
|
|
35
35
|
}
|
|
36
|
-
),
|
|
36
|
+
), E = async (t) => {
|
|
37
37
|
a.value = !0, t || (e.loadingStatus = !0);
|
|
38
38
|
let o;
|
|
39
39
|
try {
|
|
40
|
-
o = await
|
|
41
|
-
} catch (
|
|
42
|
-
|
|
40
|
+
o = await u(t);
|
|
41
|
+
} catch (n) {
|
|
42
|
+
if (t)
|
|
43
|
+
throw n;
|
|
44
|
+
r(n, "Failed to save template");
|
|
43
45
|
} finally {
|
|
44
46
|
a.value = !1, !t && !o && (e.loadingStatus = !1);
|
|
45
47
|
}
|
|
46
48
|
return o;
|
|
47
|
-
},
|
|
49
|
+
}, T = (t) => {
|
|
48
50
|
var o;
|
|
49
|
-
if (!t &&
|
|
50
|
-
(o =
|
|
51
|
+
if (!t && H.value) {
|
|
52
|
+
(o = S.value) == null || o.open();
|
|
51
53
|
return;
|
|
52
54
|
}
|
|
53
|
-
return
|
|
55
|
+
return E(t);
|
|
54
56
|
}, F = async () => {
|
|
55
|
-
if (
|
|
57
|
+
if (c("liquidSyntax")) {
|
|
56
58
|
e.loadingStatus = !0;
|
|
57
59
|
try {
|
|
58
|
-
const { html: t } = await
|
|
59
|
-
if (!await
|
|
60
|
+
const { html: t } = await v({ minimize: !0, resetDataSavedFlag: !1 }), { compiledHtml: o } = y(t);
|
|
61
|
+
if (!await g(o))
|
|
60
62
|
return;
|
|
61
63
|
} catch (t) {
|
|
62
64
|
r(t, "Failed to prepare test email");
|
|
@@ -65,11 +67,11 @@ const ft = /* @__PURE__ */ q({
|
|
|
65
67
|
e.loadingStatus = !1;
|
|
66
68
|
}
|
|
67
69
|
}
|
|
68
|
-
|
|
70
|
+
V();
|
|
69
71
|
};
|
|
70
|
-
return
|
|
71
|
-
handleSave:
|
|
72
|
-
}), { __sfc: !0, config:
|
|
72
|
+
return x({
|
|
73
|
+
handleSave: T
|
|
74
|
+
}), { __sfc: !0, config: m, isFeatureEnabled: c, exportHtml: p, save: u, openVersionHistory: f, closeVersionHistory: d, getCompiledEmail: v, compileHtml: y, validateLiquidSyntax: g, handleError: r, editorStore: e, templateStore: h, hasMigrations: H, trans: s, isExporting: i, isSaving: a, migrationModalRef: S, testEmailClick: V, handleVersionHistory: _, handleExport: C, handleSaveAs: A, versionHistoryTooltipText: M, isVersionHistoryButtonVisible: O, executeSave: E, handleSave: T, handleTestEmail: F, getTooltipOptions: K, InButtonV2: N, MigrationConfirmModal: U };
|
|
73
75
|
}
|
|
74
76
|
});
|
|
75
77
|
export {
|
|
@@ -1,23 +1,18 @@
|
|
|
1
|
-
import { filterAmpErrors as
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
() => p(new Error(`${n} did not report completion within ${l}ms`)),
|
|
1
|
+
import { filterAmpErrors as v } from "../utils/ampErrorFilter.js";
|
|
2
|
+
import { useToaster as y } from "./useToaster.js";
|
|
3
|
+
const D = 1e4, d = 3e4, s = (n, l, u) => new Promise((T, m) => {
|
|
4
|
+
const w = setTimeout(
|
|
5
|
+
() => m(new Error(`${n} did not report completion within ${l}ms`)),
|
|
7
6
|
l
|
|
8
|
-
),
|
|
9
|
-
clearTimeout(
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
d(t);
|
|
15
|
-
}
|
|
16
|
-
}), P = () => {
|
|
17
|
-
const { handleError: n } = D(), l = (t = {}) => r(
|
|
7
|
+
), p = (A) => (t) => {
|
|
8
|
+
clearTimeout(w), A(t);
|
|
9
|
+
};
|
|
10
|
+
u(p(T), p(m));
|
|
11
|
+
}), I = () => {
|
|
12
|
+
const { handleError: n } = y(), l = (t = {}) => s(
|
|
18
13
|
"compileEmail",
|
|
19
|
-
|
|
20
|
-
(e,
|
|
14
|
+
d,
|
|
15
|
+
(e, a) => {
|
|
21
16
|
const o = { ...{
|
|
22
17
|
minimize: !0,
|
|
23
18
|
utmEntity: {
|
|
@@ -37,53 +32,53 @@ const h = 1e4, T = 3e4, r = (n, l, A) => new Promise((C, p) => {
|
|
|
37
32
|
forceAmp: !1,
|
|
38
33
|
resetDataSavedFlag: !1,
|
|
39
34
|
disableLineHeightsReplace: !0
|
|
40
|
-
}, ...t },
|
|
41
|
-
callback: (
|
|
42
|
-
|
|
43
|
-
html:
|
|
44
|
-
ampHtml:
|
|
45
|
-
ampErrors:
|
|
46
|
-
displayConditions:
|
|
35
|
+
}, ...t }, c = {
|
|
36
|
+
callback: (r, C, f, S, g) => {
|
|
37
|
+
r ? a(r) : e({
|
|
38
|
+
html: C,
|
|
39
|
+
ampHtml: f,
|
|
40
|
+
ampErrors: v(S ?? []),
|
|
41
|
+
displayConditions: g
|
|
47
42
|
});
|
|
48
43
|
},
|
|
49
44
|
...o
|
|
50
45
|
};
|
|
51
|
-
|
|
46
|
+
window.StripoEditorApi.actionsApi.compileEmail(c);
|
|
52
47
|
}
|
|
53
48
|
);
|
|
54
49
|
return {
|
|
55
50
|
getCompiledEmail: l,
|
|
56
|
-
getTemplateData: () =>
|
|
51
|
+
getTemplateData: () => s(
|
|
57
52
|
"getTemplateData",
|
|
58
|
-
|
|
53
|
+
d,
|
|
59
54
|
(t) => {
|
|
60
|
-
const e = ({ html:
|
|
61
|
-
html:
|
|
62
|
-
css:
|
|
55
|
+
const e = ({ html: a, css: i, width: o, height: E, utmParams: c, syncModulesIds: r }) => t({
|
|
56
|
+
html: a,
|
|
57
|
+
css: i,
|
|
63
58
|
width: o,
|
|
64
59
|
height: E,
|
|
65
|
-
utmParams:
|
|
66
|
-
syncModulesIds:
|
|
60
|
+
utmParams: c,
|
|
61
|
+
syncModulesIds: r
|
|
67
62
|
});
|
|
68
|
-
|
|
63
|
+
window.StripoEditorApi.actionsApi.getTemplateData(e);
|
|
69
64
|
}
|
|
70
65
|
),
|
|
71
66
|
activateCustomViewStyles: (t = !0) => {
|
|
72
|
-
|
|
67
|
+
window.StripoEditorApi.actionsApi.activateCustomViewStyles(t);
|
|
73
68
|
},
|
|
74
69
|
getPreviewData: async (t) => {
|
|
75
70
|
try {
|
|
76
71
|
const {
|
|
77
72
|
html: e,
|
|
78
|
-
displayConditions:
|
|
79
|
-
ampHtml:
|
|
73
|
+
displayConditions: a,
|
|
74
|
+
ampHtml: i = "",
|
|
80
75
|
ampErrors: o = []
|
|
81
76
|
} = await l({ minimize: !1, resetDataSavedFlag: !1, ...t });
|
|
82
77
|
return {
|
|
83
78
|
html: e,
|
|
84
|
-
ampHtml:
|
|
79
|
+
ampHtml: i,
|
|
85
80
|
ampErrors: o,
|
|
86
|
-
displayConditions:
|
|
81
|
+
displayConditions: a
|
|
87
82
|
};
|
|
88
83
|
} catch (e) {
|
|
89
84
|
return n(e, "Error loading preview"), {
|
|
@@ -95,30 +90,30 @@ const h = 1e4, T = 3e4, r = (n, l, A) => new Promise((C, p) => {
|
|
|
95
90
|
}
|
|
96
91
|
},
|
|
97
92
|
updateTimerInClonedTemplate: () => new Promise((t) => {
|
|
98
|
-
var e,
|
|
99
|
-
if (typeof ((
|
|
93
|
+
var e, a;
|
|
94
|
+
if (typeof ((a = (e = window.StripoEditorApi) == null ? void 0 : e.actionsApi) == null ? void 0 : a.updateTimerInClonedTemplate) != "function") {
|
|
100
95
|
t(null);
|
|
101
96
|
return;
|
|
102
97
|
}
|
|
103
98
|
try {
|
|
104
|
-
window.StripoEditorApi.actionsApi.updateTimerInClonedTemplate((
|
|
105
|
-
|
|
99
|
+
window.StripoEditorApi.actionsApi.updateTimerInClonedTemplate((i, o) => {
|
|
100
|
+
i ? (n(i, "Failed to update timer in cloned template"), t(null)) : t(o || null);
|
|
106
101
|
});
|
|
107
|
-
} catch (
|
|
108
|
-
n(
|
|
102
|
+
} catch (i) {
|
|
103
|
+
n(i, "Failed to call updateTimerInClonedTemplate"), t(null);
|
|
109
104
|
}
|
|
110
105
|
}),
|
|
111
106
|
updateHtmlAndCss: (t, e) => {
|
|
112
|
-
const { actionsApi:
|
|
113
|
-
return
|
|
114
|
-
|
|
107
|
+
const { actionsApi: a } = window.StripoEditorApi;
|
|
108
|
+
return s("updateHtmlAndCss", D, (i) => {
|
|
109
|
+
a.updateHtmlAndCss(t, e, () => i());
|
|
115
110
|
});
|
|
116
111
|
},
|
|
117
|
-
editorSave: () =>
|
|
112
|
+
editorSave: () => s(
|
|
118
113
|
"save",
|
|
119
|
-
|
|
114
|
+
d,
|
|
120
115
|
(t) => {
|
|
121
|
-
|
|
116
|
+
window.StripoEditorApi.actionsApi.save((e) => {
|
|
122
117
|
if (e) {
|
|
123
118
|
n(e, "Failed to save template"), t(!1);
|
|
124
119
|
return;
|
|
@@ -130,5 +125,5 @@ const h = 1e4, T = 3e4, r = (n, l, A) => new Promise((C, p) => {
|
|
|
130
125
|
};
|
|
131
126
|
};
|
|
132
127
|
export {
|
|
133
|
-
|
|
128
|
+
I as useActionsApi
|
|
134
129
|
};
|
|
@@ -1,25 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
i({ type: d.Error, message: p });
|
|
10
|
-
return;
|
|
11
|
-
}
|
|
12
|
-
o(e);
|
|
13
|
-
};
|
|
14
|
-
return {
|
|
15
|
-
openCodeEditor: () => {
|
|
16
|
-
t((o) => o.openCodeEditor());
|
|
17
|
-
},
|
|
18
|
-
closeCodeEditor: () => {
|
|
19
|
-
t((o) => o.closeCodeEditor());
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
};
|
|
1
|
+
const i = () => ({
|
|
2
|
+
openCodeEditor: () => {
|
|
3
|
+
window.StripoEditorApi.codeEditorApi.openCodeEditor();
|
|
4
|
+
},
|
|
5
|
+
closeCodeEditor: () => {
|
|
6
|
+
window.StripoEditorApi.codeEditorApi.closeCodeEditor();
|
|
7
|
+
}
|
|
8
|
+
});
|
|
23
9
|
export {
|
|
24
|
-
|
|
10
|
+
i as useCodeEditorApi
|
|
25
11
|
};
|
|
@@ -1,88 +1,97 @@
|
|
|
1
|
-
import { getCsrfToken as
|
|
2
|
-
import { ref as m, computed as
|
|
3
|
-
const
|
|
4
|
-
const
|
|
1
|
+
import { getCsrfToken as j } from "../utils/genericUtil.js";
|
|
2
|
+
import { ref as m, computed as v } from "vue";
|
|
3
|
+
const k = (b = {}) => {
|
|
4
|
+
const d = m(!1), n = m(null), u = m(null), g = v(() => d.value), y = v(() => n.value !== null), w = {
|
|
5
5
|
baseURL: "",
|
|
6
6
|
timeout: 1e4,
|
|
7
7
|
retry: 0,
|
|
8
8
|
retryDelay: 1e3,
|
|
9
9
|
headers: {
|
|
10
10
|
"Content-Type": "application/json",
|
|
11
|
-
"X-CSRF-TOKEN":
|
|
11
|
+
"X-CSRF-TOKEN": j(),
|
|
12
12
|
Accept: "application/json",
|
|
13
|
+
// The panel backend only answers 401/419 to ajax requests; without this a guest
|
|
14
|
+
// fetch gets a 302 to the login page and never sees an auth status.
|
|
13
15
|
"X-Requested-With": "XMLHttpRequest"
|
|
14
16
|
},
|
|
15
17
|
...b
|
|
16
|
-
},
|
|
18
|
+
}, P = (e, r) => {
|
|
17
19
|
if (e.startsWith("http://") || e.startsWith("https://"))
|
|
18
20
|
return e;
|
|
19
|
-
const t =
|
|
21
|
+
const t = r || w.baseURL || "";
|
|
20
22
|
return t.endsWith("/") && e.startsWith("/") ? `${t}${e.slice(1)}` : t.endsWith("/") || e.startsWith("/") ? `${t}${e}` : `${t}/${e}`;
|
|
21
|
-
},
|
|
23
|
+
}, x = (e) => new Promise((r, t) => {
|
|
22
24
|
setTimeout(() => {
|
|
23
25
|
t(new Error("Request timeout"));
|
|
24
26
|
}, e);
|
|
25
|
-
}),
|
|
26
|
-
setTimeout(
|
|
27
|
-
}), i = async (e,
|
|
28
|
-
|
|
29
|
-
const
|
|
27
|
+
}), C = (e) => new Promise((r) => {
|
|
28
|
+
setTimeout(r, e);
|
|
29
|
+
}), i = async (e, r, t, D = {}) => {
|
|
30
|
+
n.value = null, d.value = !0, u.value = new AbortController();
|
|
31
|
+
const a = { ...w, ...D }, T = P(r, a.baseURL), c = {
|
|
30
32
|
method: e,
|
|
31
|
-
headers: { ...
|
|
33
|
+
headers: { ...a.headers },
|
|
32
34
|
signal: u.value.signal,
|
|
33
|
-
...
|
|
35
|
+
...a
|
|
34
36
|
};
|
|
35
37
|
t && ["POST", "PUT", "PATCH"].includes(e) && (t instanceof FormData ? (delete c.headers["Content-Type"], c.body = t) : c.body = JSON.stringify(t));
|
|
36
|
-
const E = async (
|
|
38
|
+
const E = async (p = 0) => {
|
|
37
39
|
try {
|
|
38
|
-
const o = [fetch(
|
|
39
|
-
|
|
40
|
-
const
|
|
41
|
-
if (!
|
|
42
|
-
const H = `HTTP Error: ${
|
|
43
|
-
throw
|
|
40
|
+
const o = [fetch(T, c)];
|
|
41
|
+
a.timeout && o.push(x(a.timeout));
|
|
42
|
+
const s = await Promise.race(o);
|
|
43
|
+
if (!s.ok) {
|
|
44
|
+
const H = `HTTP Error: ${s.status} ${s.statusText}`, h = new Error(H);
|
|
45
|
+
throw h.status = s.status, h.statusText = s.statusText, h.response = s, [401, 403, 419].includes(s.status) && Promise.resolve().then(() => s.clone().text().catch(() => "")).then((O) => window.dispatchEvent(new CustomEvent("insider:http-auth-error", {
|
|
46
|
+
detail: {
|
|
47
|
+
status: s.status,
|
|
48
|
+
body: O,
|
|
49
|
+
url: new URL(T, window.location.href).href
|
|
50
|
+
}
|
|
51
|
+
}))).catch(() => {
|
|
52
|
+
}), h;
|
|
44
53
|
}
|
|
45
54
|
let f;
|
|
46
|
-
const l =
|
|
47
|
-
return l != null && l.includes("application/json") ? f = await
|
|
55
|
+
const l = s.headers.get("content-type");
|
|
56
|
+
return l != null && l.includes("application/json") ? f = await s.json() : l != null && l.includes("text/") ? f = await s.text() : f = await s.blob(), {
|
|
48
57
|
data: f,
|
|
49
|
-
status:
|
|
50
|
-
statusText:
|
|
51
|
-
headers:
|
|
58
|
+
status: s.status,
|
|
59
|
+
statusText: s.statusText,
|
|
60
|
+
headers: s.headers
|
|
52
61
|
};
|
|
53
62
|
} catch (o) {
|
|
54
|
-
const
|
|
55
|
-
if (
|
|
56
|
-
return await
|
|
57
|
-
throw o instanceof Error ? o.name === "AbortError" ?
|
|
63
|
+
const s = o instanceof Error && o.name === "AbortError";
|
|
64
|
+
if (p < (a.retry || 0) && !s)
|
|
65
|
+
return await C(a.retryDelay || 1e3), E(p + 1);
|
|
66
|
+
throw o instanceof Error ? o.name === "AbortError" ? n.value = { message: "Request was cancelled" } : n.value = { message: o.message } : n.value = o, o;
|
|
58
67
|
}
|
|
59
68
|
};
|
|
60
69
|
try {
|
|
61
70
|
return await E();
|
|
62
71
|
} finally {
|
|
63
|
-
|
|
72
|
+
d.value = !1, u.value = null;
|
|
64
73
|
}
|
|
65
|
-
},
|
|
74
|
+
}, R = (e, r) => i("GET", e, void 0, r), U = (e, r, t) => i("POST", e, r, t), $ = (e, r, t) => i("PUT", e, r, t), q = (e, r, t) => i("PATCH", e, r, t), A = (e, r) => i("DELETE", e, void 0, r), L = (e) => {
|
|
66
75
|
u.value && u.value.abort(e);
|
|
67
76
|
}, W = () => {
|
|
68
|
-
|
|
77
|
+
n.value = null;
|
|
69
78
|
};
|
|
70
79
|
return {
|
|
71
80
|
// State
|
|
72
81
|
loading: g,
|
|
73
|
-
error:
|
|
82
|
+
error: v(() => n.value),
|
|
74
83
|
hasError: y,
|
|
75
84
|
// Methods
|
|
76
85
|
request: i,
|
|
77
|
-
get:
|
|
78
|
-
post:
|
|
86
|
+
get: R,
|
|
87
|
+
post: U,
|
|
79
88
|
put: $,
|
|
80
89
|
patch: q,
|
|
81
90
|
delete: A,
|
|
82
|
-
cancel:
|
|
91
|
+
cancel: L,
|
|
83
92
|
clearError: W
|
|
84
93
|
};
|
|
85
94
|
};
|
|
86
95
|
export {
|
|
87
|
-
|
|
96
|
+
k as useHttp
|
|
88
97
|
};
|
|
@@ -6,10 +6,9 @@ import { useConfig } from "./useConfig.js";
|
|
|
6
6
|
const useTranslations = () => {
|
|
7
7
|
var o, e;
|
|
8
8
|
const { config } = useConfig(), translationsPath = ((e = (o = config.value) == null ? void 0 : o.editor) == null ? void 0 : e.translationsPath) || DEFAULT_EDITOR.translationsPath, translations = ref(eval(translationsPath)), trans = (t, n) => {
|
|
9
|
-
|
|
10
|
-
const r = (s = translations.value) == null ? void 0 : s[t];
|
|
9
|
+
const r = translations.value[t];
|
|
11
10
|
return r ? n ? Object.entries(n).reduce(
|
|
12
|
-
(
|
|
11
|
+
(s, [i, a]) => s.replace(new RegExp(`{${i}}`, "g"), String(a)),
|
|
13
12
|
r
|
|
14
13
|
) : r : (console.warn(`Translation key not found: ${t}`), t);
|
|
15
14
|
};
|
|
@@ -1,63 +1,54 @@
|
|
|
1
1
|
import { ToasterTypeOptions as t } from "../enums/toaster.js";
|
|
2
|
-
import { useVersionHistoryStore as
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
if (!r) {
|
|
10
|
-
i({ type: t.Error, message: y });
|
|
11
|
-
return;
|
|
12
|
-
}
|
|
13
|
-
e(r);
|
|
14
|
-
}, p = (e) => {
|
|
15
|
-
n.$reset(), n.updateState(e);
|
|
16
|
-
}, a = () => {
|
|
17
|
-
n.$reset();
|
|
2
|
+
import { useVersionHistoryStore as c } from "../stores/version-history.js";
|
|
3
|
+
import { useToaster as w } from "./useToaster.js";
|
|
4
|
+
const S = () => {
|
|
5
|
+
const i = c(), { showToaster: s } = w(), n = (e) => {
|
|
6
|
+
i.$reset(), i.updateState(e);
|
|
7
|
+
}, p = () => {
|
|
8
|
+
i.$reset();
|
|
18
9
|
};
|
|
19
10
|
return {
|
|
20
11
|
openVersionHistory: () => {
|
|
21
|
-
|
|
12
|
+
window.StripoEditorApi.versionHistoryApi.openVersionHistory(n, p);
|
|
22
13
|
},
|
|
23
14
|
closeVersionHistory: () => {
|
|
24
|
-
|
|
15
|
+
window.StripoEditorApi.versionHistoryApi.closeVersionHistory();
|
|
25
16
|
},
|
|
26
17
|
switchToDesktopPreview: () => {
|
|
27
|
-
|
|
18
|
+
window.StripoEditorApi.versionHistoryApi.switchToDesktopPreview();
|
|
28
19
|
},
|
|
29
20
|
switchToMobilePreview: () => {
|
|
30
|
-
|
|
21
|
+
window.StripoEditorApi.versionHistoryApi.switchToMobilePreview();
|
|
31
22
|
},
|
|
32
23
|
previewVersion: (e) => {
|
|
33
|
-
|
|
34
|
-
const
|
|
35
|
-
|
|
24
|
+
window.StripoEditorApi.versionHistoryApi.previewVersion(e, (o) => {
|
|
25
|
+
const r = o instanceof Error ? o.message : String(o);
|
|
26
|
+
s({
|
|
36
27
|
type: t.Error,
|
|
37
|
-
message: `Error compiling email: ${
|
|
28
|
+
message: `Error compiling email: ${r}`
|
|
38
29
|
});
|
|
39
|
-
})
|
|
30
|
+
});
|
|
40
31
|
},
|
|
41
32
|
restoreVersion: (e) => {
|
|
42
|
-
|
|
33
|
+
window.StripoEditorApi.versionHistoryApi.restoreVersion(
|
|
43
34
|
e,
|
|
44
35
|
() => {
|
|
45
|
-
|
|
36
|
+
s({
|
|
46
37
|
type: t.Success,
|
|
47
38
|
message: "Your version has been restored successfully."
|
|
48
39
|
});
|
|
49
40
|
},
|
|
50
|
-
(
|
|
51
|
-
const
|
|
52
|
-
|
|
41
|
+
(o) => {
|
|
42
|
+
const r = o instanceof Error ? o.message : String(o);
|
|
43
|
+
s({
|
|
53
44
|
type: t.Error,
|
|
54
|
-
message: `Error compiling email: ${
|
|
45
|
+
message: `Error compiling email: ${r}`
|
|
55
46
|
});
|
|
56
47
|
}
|
|
57
|
-
)
|
|
48
|
+
);
|
|
58
49
|
}
|
|
59
50
|
};
|
|
60
51
|
};
|
|
61
52
|
export {
|
|
62
|
-
|
|
53
|
+
S as useVersionHistoryApi
|
|
63
54
|
};
|
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-73199fa4] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.view-options-wrapper[data-v-87033101]{position:relative;display:inline-block}.new-tag[data-v-87033101]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-87033101] .guido__view-option-selection-desktop svg,[data-v-87033101] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-87033101] .in-segments-wrapper__button_selected,[data-v-87033101] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-87033101] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-fad98586]{gap:8px}.version-history__toolbar[data-v-fad98586]{gap:4px}.view-options-wrapper[data-v-6ebabfe4]{position:relative;display:inline-block}.new-tag[data-v-6ebabfe4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-6ebabfe4] .guido__verion-history-view-option-selection-desktop svg,[data-v-6ebabfe4] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6ebabfe4] .in-segments-wrapper__button_selected,[data-v-6ebabfe4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-6ebabfe4] .in-tooltip-wrapper-v2__icon{cursor:pointer}.auto-save-toggle[data-v-2c964af4]{position:relative}.auto-save-toggle__info-box[data-v-2c964af4]{position:absolute;top:100%;left:0;z-index:10;width:280px}.editor-actions[data-v-
|
|
1
|
+
@charset "UTF-8";.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-73199fa4] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.view-options-wrapper[data-v-87033101]{position:relative;display:inline-block}.new-tag[data-v-87033101]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-87033101] .guido__view-option-selection-desktop svg,[data-v-87033101] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-87033101] .in-segments-wrapper__button_selected,[data-v-87033101] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-87033101] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-fad98586]{gap:8px}.version-history__toolbar[data-v-fad98586]{gap:4px}.view-options-wrapper[data-v-6ebabfe4]{position:relative;display:inline-block}.new-tag[data-v-6ebabfe4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-6ebabfe4] .guido__verion-history-view-option-selection-desktop svg,[data-v-6ebabfe4] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6ebabfe4] .in-segments-wrapper__button_selected,[data-v-6ebabfe4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-6ebabfe4] .in-tooltip-wrapper-v2__icon{cursor:pointer}.auto-save-toggle[data-v-2c964af4]{position:relative}.auto-save-toggle__info-box[data-v-2c964af4]{position:absolute;top:100%;left:0;z-index:10;width:280px}.editor-actions[data-v-1ca6baf0]{gap:4px}.header-wrapper[data-v-d11dd577]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-050dfa52]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-050dfa52]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-050dfa52]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-91a26acd]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-91a26acd]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-91a26acd]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-91a26acd]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-91a26acd]{object-fit:cover;transform:scale(1)}[data-v-b9a93c6e] .guido__verion-history-view-option-selection-desktop svg,[data-v-b9a93c6e] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-b9a93c6e] .in-segments-wrapper__button_selected,[data-v-b9a93c6e] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-c3fd5d4b]{gap:16px}.desktop-browser-header[data-v-d86c5af5]{height:79px;min-height:79px}.desktop-browser-header__left[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:378px}.desktop-browser-header__center[data-v-d86c5af5]{height:79px;background-repeat:repeat-x;background-size:auto 100%;background-position:left top}.desktop-browser-header__right[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:112px}.desktop-preview[data-v-cf946232]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-cf946232]{min-height:504px}.iframe-wrapper[data-v-f255b2bb]{width:258px}.iframe-scaled[data-v-f255b2bb]{width:320px;height:124.0310077519%;transform:scale(.80625);transform-origin:top left}.cropped-text[data-v-eb3d05d7]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mobile-preview-wrapper__phone[data-v-3f472f96]{width:282px}.mobile-preview-wrapper__phone img[data-v-3f472f96]{object-fit:cover;border-radius:44px}.mobile-preview-wrapper__content[data-v-3f472f96]{width:258px;height:450px;left:12px}[data-v-6bcaca8a] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-f16f20f8] .vueperslides__bullets{pointer-events:none!important}[data-v-f16f20f8] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-bb3cca55] .vueperslides__bullets{pointer-events:none!important}[data-v-bb3cca55] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-b09e80c4] .vueperslides__bullets{pointer-events:none!important}[data-v-b09e80c4] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-9bdef600] .vueperslides__parallax-wrapper{padding-bottom:110px!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-2580a7d9]{width:100%;max-width:none}.assign-strategy-drawer-content .assign-strategy-select[data-v-2580a7d9] .in-dropdown-box__container{width:413px}.assign-strategy-drawer .spaced-dot-sep{background-image:linear-gradient(90deg,#91949f 20%,#fff0 0);background-position:center bottom;background-repeat:repeat-x;background-size:5px 1px}.assign-strategy-drawer .spaced-dot-sep--top{background-position:center top}.assign-strategy-drawer .spaced-dot-sep--fc-n:first-child{background:none}
|
|
@@ -39,16 +39,16 @@ const r = () => ({
|
|
|
39
39
|
});
|
|
40
40
|
},
|
|
41
41
|
isActiveTypeFirstInCollection: (e) => {
|
|
42
|
-
const t = i[e.selectedCollectionType]
|
|
42
|
+
const t = i[e.selectedCollectionType];
|
|
43
43
|
return e.activeType === t[0];
|
|
44
44
|
},
|
|
45
45
|
isActiveTypeLastInCollection: (e) => {
|
|
46
|
-
const t = i[e.selectedCollectionType]
|
|
46
|
+
const t = i[e.selectedCollectionType];
|
|
47
47
|
return e.activeType === t[t.length - 1];
|
|
48
48
|
},
|
|
49
49
|
hasTemplatesByCollectionType: (e) => {
|
|
50
50
|
const t = {};
|
|
51
|
-
return
|
|
51
|
+
return i[e.selectedCollectionType].forEach((s) => {
|
|
52
52
|
t[s] = e.templates.some((c) => c.type === s);
|
|
53
53
|
}), t;
|
|
54
54
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.18.2-beta.
|
|
3
|
+
"version": "3.18.2-beta.c512191",
|
|
4
4
|
"description": "Guido is a Vue + TypeScript wrapper for Email Plugin. Easily embed the email editor in your Vue applications.",
|
|
5
5
|
"main": "./dist/guido.umd.cjs",
|
|
6
6
|
"module": "./dist/library.js",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"@typescript-eslint/parser": "7.18.0",
|
|
78
78
|
"@useinsider/eslint-config": "1.5.3",
|
|
79
79
|
"@vitejs/plugin-vue2": "2.3.1",
|
|
80
|
-
"@vitest/coverage-v8": "
|
|
80
|
+
"@vitest/coverage-v8": "4.1.11",
|
|
81
81
|
"eslint": "8.57.1",
|
|
82
82
|
"eslint-config-airbnb-base": "15.0.0",
|
|
83
83
|
"eslint-config-airbnb-typescript": "18.0.0",
|
|
@@ -90,17 +90,17 @@
|
|
|
90
90
|
"happy-dom": "15.11.7",
|
|
91
91
|
"husky": "9.1.7",
|
|
92
92
|
"msw": "2.10.3",
|
|
93
|
-
"nyc": "
|
|
93
|
+
"nyc": "18.0.0",
|
|
94
94
|
"sass": "1.69.7",
|
|
95
95
|
"typescript": "5.5.4",
|
|
96
96
|
"typescript-eslint": "8.26.0",
|
|
97
97
|
"vite-plugin-dts": "4.5.4",
|
|
98
98
|
"vite-plugin-istanbul": "7.0.0",
|
|
99
|
-
"vitest": "
|
|
99
|
+
"vitest": "4.1.11",
|
|
100
100
|
"vue-tsc": "2.2.10"
|
|
101
101
|
},
|
|
102
102
|
"overrides": {
|
|
103
|
-
"axios": "1.
|
|
103
|
+
"axios": "1.20.0",
|
|
104
104
|
"flatted": "3.4.2",
|
|
105
105
|
"micromatch": "4.0.8",
|
|
106
106
|
"path-to-regexp": "6.3.0"
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { StripoEditorApi } from '@@/Types/stripo';
|
|
2
|
-
export declare const EDITOR_NOT_READY_MESSAGE = "The editor is not ready yet. Please wait for it to load and try again.";
|
|
3
|
-
export declare const findEditorApi: () => StripoEditorApi | undefined;
|
|
4
|
-
export declare const getEditorApi: () => StripoEditorApi;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
const o = "The editor is not ready yet. Please wait for it to load and try again.", i = () => window.StripoEditorApi, r = () => {
|
|
2
|
-
const t = i();
|
|
3
|
-
if (!t)
|
|
4
|
-
throw new Error(o);
|
|
5
|
-
return t;
|
|
6
|
-
};
|
|
7
|
-
export {
|
|
8
|
-
o as EDITOR_NOT_READY_MESSAGE,
|
|
9
|
-
i as findEditorApi,
|
|
10
|
-
r as getEditorApi
|
|
11
|
-
};
|