@useinsider/guido 1.4.4-beta.b53ed50 → 1.4.4-beta.c77b465
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/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +50 -49
- package/dist/composables/useActionsApi.js +42 -25
- package/dist/composables/useStripo.js +25 -25
- package/dist/composables/useTimerClone.js +53 -0
- package/dist/enums/defaults.js +3 -2
- package/dist/guido.css +1 -1
- package/dist/services/stripoApi.js +13 -14
- package/dist/src/composables/useActionsApi.d.ts +2 -0
- package/dist/src/composables/useTimerClone.d.ts +6 -0
- package/dist/src/enums/defaults.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,53 +1,54 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { provideGuidoActions as
|
|
3
|
-
import { usePartner as
|
|
4
|
-
import { useStripo as
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
|
|
1
|
+
import { defineComponent as x, defineAsyncComponent as P, ref as B, computed as U, watch as N, onMounted as z, onUnmounted as K } from "vue";
|
|
2
|
+
import { provideGuidoActions as M } from "../composables/useGuidoActions.js";
|
|
3
|
+
import { usePartner as j } from "../composables/usePartner.js";
|
|
4
|
+
import { useStripo as q } from "../composables/useStripo.js";
|
|
5
|
+
import { useTimerClone as J } from "../composables/useTimerClone.js";
|
|
6
|
+
import { migrate as W } from "../config/migrator/index.js";
|
|
7
|
+
import Q from "./organisms/base/Toaster.vue.js";
|
|
8
|
+
import V from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
|
|
9
|
+
import X from "./organisms/header/HeaderWrapper.vue.js";
|
|
10
|
+
import Y from "./organisms/LoadingWrapper.vue.js";
|
|
11
|
+
import Z from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
|
|
12
|
+
import $ from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
|
|
13
|
+
import { useStripoApi as ee } from "../services/stripoApi.js";
|
|
14
|
+
import { useConfigStore as oe } from "../stores/config.js";
|
|
15
|
+
import { useDynamicContentStore as te } from "../stores/dynamic-content.js";
|
|
16
|
+
import { useEditorStore as ne } from "../stores/editor.js";
|
|
17
|
+
import { usePreviewStore as re } from "../stores/preview.js";
|
|
18
|
+
import { useUnsubscribeStore as ce } from "../stores/unsubscribe.js";
|
|
19
|
+
const Ee = /* @__PURE__ */ x({
|
|
19
20
|
__name: "Guido",
|
|
20
21
|
props: {
|
|
21
22
|
config: null
|
|
22
23
|
},
|
|
23
24
|
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
|
|
24
|
-
setup(
|
|
25
|
-
const l =
|
|
25
|
+
setup(_, { expose: I, emit: t }) {
|
|
26
|
+
const l = _, L = P(
|
|
26
27
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
27
|
-
),
|
|
28
|
+
), A = P(
|
|
28
29
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
29
|
-
), p =
|
|
30
|
+
), p = B(), s = te(), u = ce(), n = oe();
|
|
30
31
|
n.init(l.config);
|
|
31
|
-
const i =
|
|
32
|
+
const i = ne(), F = re(), r = U(() => i.hasChanges), { isTestPartner: G } = j(), v = () => {
|
|
32
33
|
var e;
|
|
33
34
|
return (e = p.value) == null ? void 0 : e.handleSave(!0);
|
|
34
|
-
}, { templateId: a, userId:
|
|
35
|
+
}, { templateId: a, userId: y, partnerName: h, productType: f, username: b, template: o } = n, c = (o == null ? void 0 : o.html) || "", g = (o == null ? void 0 : o.css) || "", m = (o == null ? void 0 : o.preselectedDynamicContent) || [];
|
|
35
36
|
i.templateId = a;
|
|
36
|
-
const { initPlugin: S } =
|
|
37
|
+
const { initPlugin: S } = q({
|
|
37
38
|
emailId: a,
|
|
38
|
-
userId:
|
|
39
|
-
username:
|
|
40
|
-
partnerName:
|
|
39
|
+
userId: y,
|
|
40
|
+
username: b,
|
|
41
|
+
partnerName: h,
|
|
41
42
|
productType: f,
|
|
42
|
-
preselectedDynamicContentList:
|
|
43
|
+
preselectedDynamicContentList: m,
|
|
43
44
|
onReady: () => {
|
|
44
45
|
console.debug("guido:ready"), t("ready");
|
|
45
46
|
}
|
|
46
|
-
}), { getDefaultTemplate: w } =
|
|
47
|
+
}), { getDefaultTemplate: w } = ee(), { cloneTimersOnSave: C, hasTimerBlocks: D } = J(), H = U(() => {
|
|
47
48
|
var e;
|
|
48
49
|
return !((e = n.ui) != null && e.showHeader);
|
|
49
50
|
});
|
|
50
|
-
|
|
51
|
+
M({
|
|
51
52
|
onBack: () => {
|
|
52
53
|
console.debug("guido:back"), t("back");
|
|
53
54
|
},
|
|
@@ -61,51 +62,51 @@ const Se = /* @__PURE__ */ R({
|
|
|
61
62
|
console.debug("guido:test-email:click"), t("test-email:click");
|
|
62
63
|
}
|
|
63
64
|
});
|
|
64
|
-
const
|
|
65
|
+
const E = (e) => {
|
|
65
66
|
console.debug("dynamic-content:close", e), s.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
|
|
66
|
-
},
|
|
67
|
+
}, k = () => {
|
|
67
68
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
68
69
|
};
|
|
69
70
|
N(() => r.value, () => {
|
|
70
71
|
t("on-change", r.value);
|
|
71
72
|
});
|
|
72
|
-
const
|
|
73
|
-
const
|
|
74
|
-
console.debug("dynamic-content:open",
|
|
73
|
+
const d = (e) => {
|
|
74
|
+
const T = e, { attribute: O, position: R } = T.detail;
|
|
75
|
+
console.debug("dynamic-content:open", T.detail), t("dynamic-content:open", O, R);
|
|
75
76
|
};
|
|
76
|
-
return
|
|
77
|
+
return z(async () => {
|
|
77
78
|
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow");
|
|
78
79
|
try {
|
|
79
80
|
u.selectedUnsubscribePages = (o == null ? void 0 : o.selectedUnsubscribePages) || [];
|
|
80
81
|
let e = {
|
|
81
|
-
html: c && await
|
|
82
|
-
css:
|
|
82
|
+
html: c && await W(c),
|
|
83
|
+
css: g,
|
|
83
84
|
forceRecreate: !0
|
|
84
85
|
// TODO: It should be false for old templates. We will communicate with Stripo
|
|
85
86
|
};
|
|
86
|
-
e.html || (e = await w(), e.html = await
|
|
87
|
+
e.html || (e = await w(), e.html = await W(e.html)), D(e.html) && (e.html = await C(e.html)), await S(e), s.selectedDynamicContentList = m;
|
|
87
88
|
} catch (e) {
|
|
88
89
|
console.error("Failed to initialize Stripo editor:", e);
|
|
89
90
|
}
|
|
90
|
-
document.addEventListener("dynamic-content:open",
|
|
91
|
-
}),
|
|
92
|
-
document.removeEventListener("dynamic-content:open",
|
|
91
|
+
document.addEventListener("dynamic-content:open", d);
|
|
92
|
+
}), K(() => {
|
|
93
|
+
document.removeEventListener("dynamic-content:open", d);
|
|
93
94
|
try {
|
|
94
95
|
window.UIEditor.removeEditor();
|
|
95
96
|
} catch {
|
|
96
97
|
console.debug("Failed to remove Stripo editor: No editor found");
|
|
97
98
|
}
|
|
98
99
|
n.reset();
|
|
99
|
-
}),
|
|
100
|
+
}), I({
|
|
100
101
|
dynamicContent: {
|
|
101
|
-
insert:
|
|
102
|
-
close:
|
|
102
|
+
insert: E,
|
|
103
|
+
close: k
|
|
103
104
|
},
|
|
104
105
|
hasChanges: r,
|
|
105
|
-
saveSilent:
|
|
106
|
-
}), { __sfc: !0, PreviewContainer:
|
|
106
|
+
saveSilent: v
|
|
107
|
+
}), { __sfc: !0, PreviewContainer: L, OnboardingWrapper: A, headerWrapperRef: p, dynamicContentStore: s, unsubscribeStore: u, props: l, configStore: n, editorStore: i, previewStore: F, hasChanges: r, isTestPartner: G, saveSilent: v, templateId: a, userId: y, partnerName: h, productType: f, username: b, templateConfig: o, html: c, css: g, preselectedDynamicContentList: m, emit: t, initPlugin: S, getDefaultTemplate: w, cloneTimersOnSave: C, hasTimerBlocks: D, noHeader: H, insertDynamicContent: E, closeDynamicContent: k, handleDynamicContentOpen: d, Toaster: Q, FilterSelectionDrawer: V, HeaderWrapper: X, LoadingWrapper: Y, SaveAsTemplateDrawer: Z, UnsubscribeWrapper: $ };
|
|
107
108
|
}
|
|
108
109
|
});
|
|
109
110
|
export {
|
|
110
|
-
|
|
111
|
+
Ee as default
|
|
111
112
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { useToaster as
|
|
2
|
-
const
|
|
3
|
-
const { handleError: l } =
|
|
4
|
-
const
|
|
1
|
+
import { useToaster as w } from "./useToaster.js";
|
|
2
|
+
const S = () => {
|
|
3
|
+
const { handleError: l } = w(), s = (t = {}) => new Promise((e, i) => {
|
|
4
|
+
const n = { ...{
|
|
5
5
|
minimize: !0,
|
|
6
6
|
utmEntity: {
|
|
7
7
|
utmSource: "",
|
|
@@ -21,28 +21,28 @@ const A = () => {
|
|
|
21
21
|
resetDataSavedFlag: !1,
|
|
22
22
|
disableLineHeightsReplace: !0
|
|
23
23
|
}, ...t }, m = {
|
|
24
|
-
callback: (
|
|
25
|
-
|
|
26
|
-
html:
|
|
27
|
-
ampHtml:
|
|
28
|
-
ampErrors:
|
|
29
|
-
displayConditions:
|
|
24
|
+
callback: (o, p, d, c, u) => {
|
|
25
|
+
o ? i(o) : e({
|
|
26
|
+
html: p,
|
|
27
|
+
ampHtml: d,
|
|
28
|
+
ampErrors: c,
|
|
29
|
+
displayConditions: u
|
|
30
30
|
});
|
|
31
31
|
},
|
|
32
|
-
...
|
|
32
|
+
...n
|
|
33
33
|
};
|
|
34
34
|
window.StripoEditorApi.actionsApi.compileEmail(m);
|
|
35
35
|
});
|
|
36
36
|
return {
|
|
37
|
-
getCompiledEmail:
|
|
37
|
+
getCompiledEmail: s,
|
|
38
38
|
getTemplateData: () => new Promise((t) => {
|
|
39
|
-
const e = ({ html:
|
|
40
|
-
html:
|
|
41
|
-
css:
|
|
42
|
-
width:
|
|
39
|
+
const e = ({ html: i, css: a, width: n, height: r, utmParams: m, syncModulesIds: o }) => t({
|
|
40
|
+
html: i,
|
|
41
|
+
css: a,
|
|
42
|
+
width: n,
|
|
43
43
|
height: r,
|
|
44
44
|
utmParams: m,
|
|
45
|
-
syncModulesIds:
|
|
45
|
+
syncModulesIds: o
|
|
46
46
|
});
|
|
47
47
|
window.StripoEditorApi.actionsApi.getTemplateData(e);
|
|
48
48
|
}),
|
|
@@ -53,15 +53,15 @@ const A = () => {
|
|
|
53
53
|
try {
|
|
54
54
|
const {
|
|
55
55
|
html: e,
|
|
56
|
-
displayConditions:
|
|
57
|
-
ampHtml:
|
|
58
|
-
ampErrors:
|
|
59
|
-
} = await
|
|
56
|
+
displayConditions: i,
|
|
57
|
+
ampHtml: a = "",
|
|
58
|
+
ampErrors: n = []
|
|
59
|
+
} = await s({ minimize: !1, resetDataSavedFlag: !1, ...t });
|
|
60
60
|
return {
|
|
61
61
|
html: e,
|
|
62
|
-
ampHtml:
|
|
63
|
-
ampErrors:
|
|
64
|
-
displayConditions:
|
|
62
|
+
ampHtml: a,
|
|
63
|
+
ampErrors: n,
|
|
64
|
+
displayConditions: i
|
|
65
65
|
};
|
|
66
66
|
} catch (e) {
|
|
67
67
|
return l(e, "Error loading preview"), {
|
|
@@ -71,9 +71,26 @@ const A = () => {
|
|
|
71
71
|
displayConditions: []
|
|
72
72
|
};
|
|
73
73
|
}
|
|
74
|
+
},
|
|
75
|
+
updateTimerInClonedTemplate: () => new Promise((t) => {
|
|
76
|
+
var e, i;
|
|
77
|
+
if (typeof ((i = (e = window.StripoEditorApi) == null ? void 0 : e.actionsApi) == null ? void 0 : i.updateTimerInClonedTemplate) != "function") {
|
|
78
|
+
t(null);
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
try {
|
|
82
|
+
window.StripoEditorApi.actionsApi.updateTimerInClonedTemplate((a, n) => {
|
|
83
|
+
a ? (l(a, "Failed to update timer in cloned template"), t(null)) : t(n || null);
|
|
84
|
+
});
|
|
85
|
+
} catch (a) {
|
|
86
|
+
l(a, "Failed to call updateTimerInClonedTemplate"), t(null);
|
|
87
|
+
}
|
|
88
|
+
}),
|
|
89
|
+
updateHtmlAndCss: (t, e) => {
|
|
90
|
+
window.StripoEditorApi.actionsApi.updateHtmlAndCss(t, e);
|
|
74
91
|
}
|
|
75
92
|
};
|
|
76
93
|
};
|
|
77
94
|
export {
|
|
78
|
-
|
|
95
|
+
S as useActionsApi
|
|
79
96
|
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useBlocksConfig as
|
|
3
|
-
import { useConfig as
|
|
1
|
+
import { useActionsApi as b } from "./useActionsApi.js";
|
|
2
|
+
import { useBlocksConfig as k } from "./useBlocksConfig.js";
|
|
3
|
+
import { useConfig as T } from "./useConfig.js";
|
|
4
4
|
import { useCustomInterfaceAppearance as V } from "./useCustomInterfaceAppearance.js";
|
|
5
5
|
import { useStripoEventHandler as _ } from "./useStripoEventHandler.js";
|
|
6
6
|
import { useToaster as B } from "./useToaster.js";
|
|
7
|
-
import { displayConditions as
|
|
8
|
-
import { useStripoApi as
|
|
7
|
+
import { displayConditions as A } from "../enums/displayConditions.js";
|
|
8
|
+
import { useStripoApi as v } from "../services/stripoApi.js";
|
|
9
9
|
import F from "../static/styles/customEditorStyle.css.js";
|
|
10
|
-
import { useEditorStore as
|
|
10
|
+
import { useEditorStore as I } from "../stores/editor.js";
|
|
11
11
|
import { dynamicContentToMergeTags as M } from "../utils/genericUtil.js";
|
|
12
12
|
import U from "../package.json.js";
|
|
13
|
-
const
|
|
14
|
-
const { features: g } =
|
|
13
|
+
const N = (c) => {
|
|
14
|
+
const { features: g } = T(), { handleError: l } = B(), { getToken: f, getCustomFonts: y } = v(), { handleEvent: S } = _(), { getStripoBlocksConfig: C } = k(), E = async (i, r = []) => {
|
|
15
15
|
var m;
|
|
16
|
-
const
|
|
16
|
+
const e = I(), { html: n, css: u, forceRecreate: a } = i, { baseBlocks: t, extensions: d } = await C(), p = ((m = g.value) == null ? void 0 : m.displayConditions) ?? !0;
|
|
17
17
|
window.UIEditor.initEditor(
|
|
18
18
|
document.querySelector("#guido-editor"),
|
|
19
19
|
{
|
|
@@ -33,7 +33,7 @@ const J = (c) => {
|
|
|
33
33
|
customViewStyles: F,
|
|
34
34
|
conditionsEnabled: p,
|
|
35
35
|
customConditionsEnabled: p,
|
|
36
|
-
conditionCategories:
|
|
36
|
+
conditionCategories: A,
|
|
37
37
|
enableXSSSecurity: !0,
|
|
38
38
|
messageSettingsEnabled: !0,
|
|
39
39
|
displayGmailAnnotations: !0,
|
|
@@ -41,7 +41,7 @@ const J = (c) => {
|
|
|
41
41
|
displayTitle: !1,
|
|
42
42
|
displayUTM: !1,
|
|
43
43
|
selectElementAfterDrop: !0,
|
|
44
|
-
...
|
|
44
|
+
...t ? { baseBlocks: t } : {},
|
|
45
45
|
editorFonts: {
|
|
46
46
|
showDefaultStandardFonts: !0,
|
|
47
47
|
showDefaultNotStandardFonts: !0,
|
|
@@ -62,25 +62,25 @@ const J = (c) => {
|
|
|
62
62
|
},
|
|
63
63
|
onTemplateLoaded() {
|
|
64
64
|
try {
|
|
65
|
-
const { importCss: o } = V(), { activateCustomViewStyles: s } =
|
|
66
|
-
o(), s(), c.onReady(),
|
|
67
|
-
|
|
65
|
+
const { importCss: o } = V(), { activateCustomViewStyles: s, updateTimerInClonedTemplate: w } = b();
|
|
66
|
+
o(), s(), w(), c.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
|
|
67
|
+
e.hasChanges = !1;
|
|
68
68
|
}, 1e3);
|
|
69
69
|
} catch (o) {
|
|
70
70
|
l(o, "Failed to load custom interface appearance");
|
|
71
71
|
}
|
|
72
72
|
},
|
|
73
73
|
onCodeEditorVisibilityChanged(o) {
|
|
74
|
-
|
|
74
|
+
e.isCodeEditorOpen = o;
|
|
75
75
|
},
|
|
76
76
|
onEditorVisualModeChanged(o) {
|
|
77
|
-
|
|
77
|
+
e.editorVisualMode = o.toLowerCase();
|
|
78
78
|
},
|
|
79
79
|
onVersionHistoryVisibilityChanged(o) {
|
|
80
|
-
|
|
80
|
+
e.isVersionHistoryOpen = o;
|
|
81
81
|
},
|
|
82
82
|
onDataChanged() {
|
|
83
|
-
|
|
83
|
+
e.hasChanges = !0;
|
|
84
84
|
},
|
|
85
85
|
onEvent: S,
|
|
86
86
|
ignoreClickOutsideSelectors: [
|
|
@@ -91,18 +91,18 @@ const J = (c) => {
|
|
|
91
91
|
extensions: d
|
|
92
92
|
}
|
|
93
93
|
);
|
|
94
|
-
}, h = (i) => new Promise((r,
|
|
94
|
+
}, h = (i) => new Promise((r, e) => {
|
|
95
95
|
var d;
|
|
96
96
|
if (document.getElementById("UiEditorScript")) {
|
|
97
97
|
i(), r();
|
|
98
98
|
return;
|
|
99
99
|
}
|
|
100
|
-
const n = U.guido, a = `https://email-static.useinsider.com/guido/${(d = n == null ? void 0 : n.stripo) == null ? void 0 : d.version}/UIEditor.js`,
|
|
101
|
-
|
|
100
|
+
const n = U.guido, a = `https://email-static.useinsider.com/guido/${(d = n == null ? void 0 : n.stripo) == null ? void 0 : d.version}/UIEditor.js`, t = document.createElement("script");
|
|
101
|
+
t.id = "UiEditorScript", t.type = "module", t.src = a, t.onload = () => {
|
|
102
102
|
i(), r();
|
|
103
|
-
},
|
|
104
|
-
|
|
105
|
-
}, document.body.appendChild(
|
|
103
|
+
}, t.onerror = () => {
|
|
104
|
+
e(new Error(`Failed to load Stripo UIEditor script from S3: ${a}`));
|
|
105
|
+
}, document.body.appendChild(t);
|
|
106
106
|
});
|
|
107
107
|
return { initPlugin: async (i) => {
|
|
108
108
|
await h(async () => {
|
|
@@ -112,5 +112,5 @@ const J = (c) => {
|
|
|
112
112
|
} };
|
|
113
113
|
};
|
|
114
114
|
export {
|
|
115
|
-
|
|
115
|
+
N as useStripo
|
|
116
116
|
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { useActionsApi as f } from "./useActionsApi.js";
|
|
2
|
+
import { useHttp as w } from "./useHttp.js";
|
|
3
|
+
import { useToaster as H } from "./useToaster.js";
|
|
4
|
+
import { useStripoApi as y } from "../services/stripoApi.js";
|
|
5
|
+
const O = () => {
|
|
6
|
+
const { handleError: c } = H(), { getToken: u } = y(), { post: d } = w(), { updateHtmlAndCss: l } = f(), s = (t) => /esd-timer-id="(\d+)"/.test(t), i = async (t, e) => {
|
|
7
|
+
try {
|
|
8
|
+
return (await d(
|
|
9
|
+
"https://plugins.stripo.email/api/v1/timers/clone",
|
|
10
|
+
{ html: t },
|
|
11
|
+
{
|
|
12
|
+
headers: {
|
|
13
|
+
"ES-PLUGIN-AUTH": `Bearer ${e}`,
|
|
14
|
+
"Content-Type": "application/json"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
)).data.html;
|
|
18
|
+
} catch (r) {
|
|
19
|
+
return c(r, "Failed to clone timer IDs"), null;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
return {
|
|
23
|
+
hasTimerBlocks: s,
|
|
24
|
+
cloneTimersInHtml: i,
|
|
25
|
+
cloneTimersOnSave: async (t) => {
|
|
26
|
+
if (!s(t))
|
|
27
|
+
return t;
|
|
28
|
+
const e = await u();
|
|
29
|
+
return e && await i(t, e) || t;
|
|
30
|
+
},
|
|
31
|
+
updateTimersOnLoad: async (t) => {
|
|
32
|
+
var e, r, o, m;
|
|
33
|
+
try {
|
|
34
|
+
const n = (r = (e = window.UIEditor) == null ? void 0 : e.getHtml) == null ? void 0 : r.call(e);
|
|
35
|
+
if (!n || !s(n))
|
|
36
|
+
return;
|
|
37
|
+
const p = await t();
|
|
38
|
+
if (!p)
|
|
39
|
+
return;
|
|
40
|
+
const a = await i(n, p);
|
|
41
|
+
if (!a || a === n)
|
|
42
|
+
return;
|
|
43
|
+
const T = ((m = (o = window.UIEditor) == null ? void 0 : o.getCss) == null ? void 0 : m.call(o)) || "";
|
|
44
|
+
l(a, T);
|
|
45
|
+
} catch (n) {
|
|
46
|
+
c(n, "Failed to update timer blocks");
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
export {
|
|
52
|
+
O as useTimerClone
|
|
53
|
+
};
|
package/dist/enums/defaults.js
CHANGED
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.gap-16[data-v-6562e38c],.gap-16[data-v-1ccb6d4a]{gap:16px}[data-v-06e6f7a7] .in-button-v2__wrapper{line-height:0}[data-v-b5997368] .in-segments-wrapper .in-tooltip-wrapper__box{text-align:left}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history-wrapper[data-v-52a77eec]{gap:8px}.view-options-wrapper[data-v-d405ca59]{position:relative;display:inline-block}.new-tag[data-v-d405ca59]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-d405ca59] .guido__verion-history-view-option-selection-desktop svg,[data-v-d405ca59] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-d405ca59] .in-segments-wrapper__button_selected,[data-v-d405ca59] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-d405ca59] .in-tooltip-wrapper__icon{cursor:pointer}.view-options-wrapper[data-v-195ab6d4]{position:relative;display:inline-block}.new-tag[data-v-195ab6d4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-195ab6d4] .guido__view-option-selection-desktop svg,[data-v-195ab6d4] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-195ab6d4] .in-segments-wrapper__button_selected,[data-v-195ab6d4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-195ab6d4] .in-tooltip-wrapper__icon{cursor:pointer}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-
|
|
1
|
+
.gap-16[data-v-6562e38c],.gap-16[data-v-1ccb6d4a]{gap:16px}[data-v-06e6f7a7] .in-button-v2__wrapper{line-height:0}[data-v-b5997368] .in-segments-wrapper .in-tooltip-wrapper__box{text-align:left}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history-wrapper[data-v-52a77eec]{gap:8px}.view-options-wrapper[data-v-d405ca59]{position:relative;display:inline-block}.new-tag[data-v-d405ca59]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-d405ca59] .guido__verion-history-view-option-selection-desktop svg,[data-v-d405ca59] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-d405ca59] .in-segments-wrapper__button_selected,[data-v-d405ca59] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-d405ca59] .in-tooltip-wrapper__icon{cursor:pointer}.view-options-wrapper[data-v-195ab6d4]{position:relative;display:inline-block}.new-tag[data-v-195ab6d4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-195ab6d4] .guido__view-option-selection-desktop svg,[data-v-195ab6d4] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-195ab6d4] .in-segments-wrapper__button_selected,[data-v-195ab6d4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-195ab6d4] .in-tooltip-wrapper__icon{cursor:pointer}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-282ca4d1]{position:relative;width:100%;height:calc(100vh - 128px)}.guido-editor__container[data-v-282ca4d1]{width:100%;height:calc(100vh - 128px)}.guido-editor__no-header[data-v-282ca4d1]{height:calc(100vh - 75px)}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-a86fc486]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-a86fc486]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-a86fc486]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-a86fc486]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-a86fc486]{object-fit:cover;transform:scale(1)}[data-v-bb3bb07c] .guido__verion-history-view-option-selection-desktop svg,[data-v-bb3bb07c] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-bb3bb07c] .in-segments-wrapper__button_selected,[data-v-bb3bb07c] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-7a09985c]{gap:16px}[data-v-c2adc57d] .in-progress-wrapper__progress p span:last-child{display:none!important}.desktop-preview-container[data-v-2dd60b0c],[data-v-2dd60b0c] .desktop-preview-container .in-container{min-height:720px!important;height:100%}.cropped-text[data-v-4b876c1b]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}[data-v-d3c52b44] .vueperslides__bullets,[data-v-dd1a237a] .vueperslides__bullets{pointer-events:none!important}[data-v-dd1a237a] .vueperslides__parallax-wrapper{height:110px!important}[data-v-a408dcea] .vueperslides__bullets{pointer-events:none!important}[data-v-a408dcea] .vueperslides__parallax-wrapper{height:110px!important}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { useHttp as
|
|
2
|
-
import { useToaster as
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { useHttp as m } from "../composables/useHttp.js";
|
|
2
|
+
import { useToaster as u } from "../composables/useToaster.js";
|
|
3
|
+
import { MAX_DEFAULT_TEMPLATE_ID as i } from "../enums/defaults.js";
|
|
4
|
+
const y = () => {
|
|
5
|
+
const { get: r } = m(), { handleError: o } = u();
|
|
5
6
|
return {
|
|
6
7
|
getToken: async () => {
|
|
7
8
|
try {
|
|
@@ -29,15 +30,13 @@ const m = () => {
|
|
|
29
30
|
forceRecreate: !0
|
|
30
31
|
};
|
|
31
32
|
try {
|
|
32
|
-
const { data:
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
return t;
|
|
40
|
-
}
|
|
33
|
+
const c = new URLSearchParams(window.location.search).get("default-template"), s = c ? parseInt(c) : 0, l = s >= 1 && s <= i ? s : 0, { data: n } = await r(
|
|
34
|
+
`/stripo/default-template/${l}`
|
|
35
|
+
), a = typeof n == "string" ? JSON.parse(n) : n;
|
|
36
|
+
return !a || typeof a != "object" || !("html" in a) || !("css" in a) ? t : {
|
|
37
|
+
...a,
|
|
38
|
+
forceRecreate: !0
|
|
39
|
+
};
|
|
41
40
|
} catch (e) {
|
|
42
41
|
return o(e, "Failed to fetch default template"), t;
|
|
43
42
|
}
|
|
@@ -45,5 +44,5 @@ const m = () => {
|
|
|
45
44
|
};
|
|
46
45
|
};
|
|
47
46
|
export {
|
|
48
|
-
|
|
47
|
+
y as useStripoApi
|
|
49
48
|
};
|
|
@@ -5,4 +5,6 @@ export declare const useActionsApi: () => {
|
|
|
5
5
|
getTemplateData: () => Promise<TemplateData>;
|
|
6
6
|
activateCustomViewStyles: (isActive?: boolean) => void;
|
|
7
7
|
getPreviewData: (options?: CompileEmailOptions) => Promise<CompiledEmailResult>;
|
|
8
|
+
updateTimerInClonedTemplate: () => Promise<string | null>;
|
|
9
|
+
updateHtmlAndCss: (html: string, css: string) => void;
|
|
8
10
|
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const useTimerClone: () => {
|
|
2
|
+
hasTimerBlocks: (html: string) => boolean;
|
|
3
|
+
cloneTimersInHtml: (html: string, authToken: string) => Promise<string | null>;
|
|
4
|
+
cloneTimersOnSave: (html: string) => Promise<string>;
|
|
5
|
+
updateTimersOnLoad: (getTokenFn: () => Promise<string>) => Promise<void>;
|
|
6
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "1.4.4-beta.
|
|
3
|
+
"version": "1.4.4-beta.c77b465",
|
|
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",
|