@useinsider/guido 3.16.0-beta.0faee0c → 3.16.0
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/composables/useStripo.js +29 -30
- package/package.json +1 -1
|
@@ -16,22 +16,22 @@ import { useEditorStore as b } from "../stores/editor.js";
|
|
|
16
16
|
import { buildMergeTagEntries as W, flattenDynamicContentList as Y } from "../utils/genericUtil.js";
|
|
17
17
|
import Z from "../package.json.js";
|
|
18
18
|
let n = null;
|
|
19
|
-
const
|
|
20
|
-
const { features: c, template: u, isFeatureEnabled: m } = q(), { handleError: p, showToaster: k } = G(), { getToken:
|
|
19
|
+
const Ct = () => {
|
|
20
|
+
const { features: c, template: u, isFeatureEnabled: m } = q(), { handleError: p, showToaster: k } = G(), { getToken: T, getCustomFonts: v, getSyncModulesStatus: B } = K(), { handleEvent: F } = z(), { handleModuleAdd: M } = j(), { getStripoBlocksConfig: A } = O(), { getStripoNotifications: V } = $(), f = () => n || (n = new Promise((i, s) => {
|
|
21
21
|
var l;
|
|
22
22
|
if (document.getElementById("UiEditorScript")) {
|
|
23
23
|
i();
|
|
24
24
|
return;
|
|
25
25
|
}
|
|
26
|
-
const o = Z.guido, r = `https://email-static.useinsider.com/guido/${(l = o == null ? void 0 : o.stripo) == null ? void 0 : l.version}/UIEditor.js`,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}, document.body.appendChild(
|
|
26
|
+
const o = Z.guido, r = `https://email-static.useinsider.com/guido/${(l = o == null ? void 0 : o.stripo) == null ? void 0 : l.version}/UIEditor.js`, t = document.createElement("script");
|
|
27
|
+
t.id = "UiEditorScript", t.type = "module", t.src = r, t.onload = () => i(), t.onerror = () => {
|
|
28
|
+
t.remove(), s(new Error(`Failed to load Stripo UIEditor script from S3: ${r}`));
|
|
29
|
+
}, document.body.appendChild(t);
|
|
30
30
|
}), n.catch(() => {
|
|
31
31
|
n = null;
|
|
32
32
|
}), n), _ = async (i, s, o, a = [], r = !1) => {
|
|
33
33
|
var y, E, h, C;
|
|
34
|
-
const
|
|
34
|
+
const t = b(), { html: l, css: D } = i, { baseBlocks: g, extensions: R } = await A(), S = ((y = c.value) == null ? void 0 : y.displayConditions) ?? !0, P = ((E = c.value) == null ? void 0 : E.modulesDisabled) ?? !1, U = ((h = u.value) == null ? void 0 : h.forceRecreate) ?? !1;
|
|
35
35
|
await window.UIEditor.initEditor(
|
|
36
36
|
document.querySelector("#guido-editor"),
|
|
37
37
|
{
|
|
@@ -57,7 +57,6 @@ const Ce = () => {
|
|
|
57
57
|
messageSettingsEnabled: !0,
|
|
58
58
|
displayGmailAnnotations: !0,
|
|
59
59
|
displayHiddenPreheader: !1,
|
|
60
|
-
keepModuleStylesEnabled: !0,
|
|
61
60
|
displayTitle: !1,
|
|
62
61
|
displayUTM: !1,
|
|
63
62
|
selectElementAfterDrop: !0,
|
|
@@ -78,38 +77,38 @@ const Ce = () => {
|
|
|
78
77
|
)
|
|
79
78
|
}
|
|
80
79
|
],
|
|
81
|
-
async onTokenRefreshRequest(
|
|
80
|
+
async onTokenRefreshRequest(e) {
|
|
82
81
|
try {
|
|
83
|
-
const d = await
|
|
84
|
-
|
|
82
|
+
const d = await T();
|
|
83
|
+
e(d);
|
|
85
84
|
} catch (d) {
|
|
86
85
|
p(d, "Failed to refresh token");
|
|
87
86
|
}
|
|
88
87
|
},
|
|
89
88
|
onTemplateLoaded() {
|
|
90
89
|
try {
|
|
91
|
-
const { importCss:
|
|
92
|
-
|
|
93
|
-
|
|
90
|
+
const { importCss: e } = H(), { activateCustomViewStyles: d, updateTimerInClonedTemplate: I } = L(), { injectFullStory: x } = N();
|
|
91
|
+
e(), d(), x(), I(), o.onReady(), t.isStripoInitialized = !0, t.loadingStatus = !1, setTimeout(() => {
|
|
92
|
+
t.hasChanges = !1;
|
|
94
93
|
}, 1e3);
|
|
95
|
-
} catch (
|
|
96
|
-
p(
|
|
94
|
+
} catch (e) {
|
|
95
|
+
p(e, "Failed to load custom interface appearance");
|
|
97
96
|
}
|
|
98
97
|
},
|
|
99
|
-
onCodeEditorVisibilityChanged(
|
|
100
|
-
|
|
98
|
+
onCodeEditorVisibilityChanged(e) {
|
|
99
|
+
t.isCodeEditorOpen = e;
|
|
101
100
|
},
|
|
102
|
-
onEditorVisualModeChanged(
|
|
103
|
-
|
|
101
|
+
onEditorVisualModeChanged(e) {
|
|
102
|
+
t.editorVisualMode = e.toLowerCase();
|
|
104
103
|
},
|
|
105
|
-
onVersionHistoryVisibilityChanged(
|
|
106
|
-
|
|
104
|
+
onVersionHistoryVisibilityChanged(e) {
|
|
105
|
+
t.isVersionHistoryOpen = e;
|
|
107
106
|
},
|
|
108
107
|
onDataChanged() {
|
|
109
|
-
|
|
108
|
+
t.hasChanges = !0;
|
|
110
109
|
},
|
|
111
|
-
onEvent:
|
|
112
|
-
onModuleAdd:
|
|
110
|
+
onEvent: F,
|
|
111
|
+
onModuleAdd: M,
|
|
113
112
|
notifications: V(),
|
|
114
113
|
ignoreClickOutsideSelectors: [
|
|
115
114
|
"#guido-dynamic-content-modal",
|
|
@@ -125,11 +124,11 @@ const Ce = () => {
|
|
|
125
124
|
const a = b();
|
|
126
125
|
try {
|
|
127
126
|
await f();
|
|
128
|
-
const [r,
|
|
129
|
-
|
|
130
|
-
|
|
127
|
+
const [r, t] = await Promise.all([
|
|
128
|
+
v(),
|
|
129
|
+
B()
|
|
131
130
|
]);
|
|
132
|
-
a.syncModulesEnabled =
|
|
131
|
+
a.syncModulesEnabled = t, await _(i, s, o, r, t);
|
|
133
132
|
} catch {
|
|
134
133
|
a.loadingStatus = !1, k({
|
|
135
134
|
type: X.Error,
|
|
@@ -146,5 +145,5 @@ const Ce = () => {
|
|
|
146
145
|
} };
|
|
147
146
|
};
|
|
148
147
|
export {
|
|
149
|
-
|
|
148
|
+
Ct as useStripo
|
|
150
149
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.16.0
|
|
3
|
+
"version": "3.16.0",
|
|
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",
|