@useinsider/guido 3.2.0-beta.a49c53c → 3.2.0-beta.b277bd3
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 +39 -37
- package/dist/package.json.js +7 -0
- package/package.json +2 -2
|
@@ -9,35 +9,36 @@ import { localePatch as H } from "../config/i18n/index.js";
|
|
|
9
9
|
import { displayConditions as O } from "../enums/displayConditions.js";
|
|
10
10
|
import { useStripoApi as j } from "../services/stripoApi.js";
|
|
11
11
|
import L from "../static/styles/customEditorStyle.css.js";
|
|
12
|
-
import { useEditorStore as
|
|
13
|
-
import { dynamicContentToMergeTags as
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
import { useEditorStore as C } from "../stores/editor.js";
|
|
13
|
+
import { dynamicContentToMergeTags as $ } from "../utils/genericUtil.js";
|
|
14
|
+
import z from "../package.json.js";
|
|
15
|
+
const ae = (E, l) => {
|
|
16
|
+
const { features: c, template: h, isFeatureEnabled: u } = P(), { handleError: m } = x(), { getToken: w, getCustomFonts: b, getSyncModulesStatus: k } = j(), { handleEvent: B } = q(), { getStripoBlocksConfig: T } = I(), V = async (i, r = [], s = !1) => {
|
|
17
|
+
var g, S, y;
|
|
18
|
+
const e = C(), { html: p, css: a } = i, { baseBlocks: o, extensions: d } = await T(), f = ((g = c.value) == null ? void 0 : g.displayConditions) ?? !0, F = ((S = c.value) == null ? void 0 : S.modulesDisabled) ?? !1, v = ((y = h.value) == null ? void 0 : y.forceRecreate) ?? !1;
|
|
18
19
|
window.UIEditor.initEditor(
|
|
19
20
|
document.querySelector("#guido-editor"),
|
|
20
21
|
{
|
|
21
|
-
metadata:
|
|
22
|
-
html:
|
|
23
|
-
css:
|
|
24
|
-
forceRecreate:
|
|
22
|
+
metadata: E,
|
|
23
|
+
html: p,
|
|
24
|
+
css: a,
|
|
25
|
+
forceRecreate: v,
|
|
25
26
|
locale: "en",
|
|
26
27
|
undoButtonSelector: "#guido__undo-button",
|
|
27
28
|
redoButtonSelector: "#guido__redo-button",
|
|
28
29
|
mobileViewButtonSelector: ".guido__view-option-selection-mobile",
|
|
29
30
|
desktopViewButtonSelector: ".guido__view-option-selection-desktop",
|
|
30
31
|
codeEditorButtonSelector: "#guido__code-button",
|
|
31
|
-
customAppearanceMergetags: !
|
|
32
|
+
customAppearanceMergetags: !u("liquidSyntax"),
|
|
32
33
|
customAppearanceMergetagsBorderColor: "#f1f3fe",
|
|
33
34
|
customAppearanceMergetagsBackgroundColor: "#f1f3fe",
|
|
34
35
|
customViewStyles: L,
|
|
35
|
-
conditionsEnabled:
|
|
36
|
-
customConditionsEnabled:
|
|
36
|
+
conditionsEnabled: f,
|
|
37
|
+
customConditionsEnabled: f,
|
|
37
38
|
conditionCategories: O,
|
|
38
39
|
enableXSSSecurity: !0,
|
|
39
|
-
modulesDisabled:
|
|
40
|
-
syncModulesEnabled:
|
|
40
|
+
modulesDisabled: F,
|
|
41
|
+
syncModulesEnabled: s,
|
|
41
42
|
messageSettingsEnabled: !0,
|
|
42
43
|
displayGmailAnnotations: !0,
|
|
43
44
|
displayHiddenPreheader: !1,
|
|
@@ -45,7 +46,7 @@ const ne = (y, a) => {
|
|
|
45
46
|
displayUTM: !1,
|
|
46
47
|
selectElementAfterDrop: !0,
|
|
47
48
|
allowedScriptSourceDomains: "https://email-static.useinsider.com https://edge.fullstory.com https://rs.fullstory.com",
|
|
48
|
-
...
|
|
49
|
+
...o ? { baseBlocks: o } : {},
|
|
49
50
|
editorFonts: {
|
|
50
51
|
showDefaultStandardFonts: !0,
|
|
51
52
|
showDefaultNotStandardFonts: !0,
|
|
@@ -53,28 +54,28 @@ const ne = (y, a) => {
|
|
|
53
54
|
},
|
|
54
55
|
mergeTags: [
|
|
55
56
|
{
|
|
56
|
-
entries:
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
entries: $(
|
|
58
|
+
l.preselectedDynamicContentList,
|
|
59
|
+
u("liquidSyntax")
|
|
59
60
|
)
|
|
60
61
|
}
|
|
61
62
|
],
|
|
62
63
|
async onTokenRefreshRequest(t) {
|
|
63
64
|
try {
|
|
64
|
-
const
|
|
65
|
-
t(
|
|
66
|
-
} catch (
|
|
67
|
-
|
|
65
|
+
const n = await w();
|
|
66
|
+
t(n);
|
|
67
|
+
} catch (n) {
|
|
68
|
+
m(n, "Failed to refresh token");
|
|
68
69
|
}
|
|
69
70
|
},
|
|
70
71
|
onTemplateLoaded() {
|
|
71
72
|
try {
|
|
72
|
-
const { importCss: t } = U(), { activateCustomViewStyles:
|
|
73
|
-
t(),
|
|
73
|
+
const { importCss: t } = U(), { activateCustomViewStyles: n, updateTimerInClonedTemplate: M } = D(), { injectFullStory: A } = R();
|
|
74
|
+
t(), n(), A(), M(), l.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
|
|
74
75
|
e.hasChanges = !1;
|
|
75
76
|
}, 1e3);
|
|
76
77
|
} catch (t) {
|
|
77
|
-
|
|
78
|
+
m(t, "Failed to load custom interface appearance");
|
|
78
79
|
}
|
|
79
80
|
},
|
|
80
81
|
onCodeEditorVisibilityChanged(t) {
|
|
@@ -89,38 +90,39 @@ const ne = (y, a) => {
|
|
|
89
90
|
onDataChanged() {
|
|
90
91
|
e.hasChanges = !0;
|
|
91
92
|
},
|
|
92
|
-
onEvent:
|
|
93
|
+
onEvent: B,
|
|
93
94
|
ignoreClickOutsideSelectors: [
|
|
94
95
|
"#guido-dynamic-content-modal",
|
|
95
96
|
".in-on-board-wrapper",
|
|
96
97
|
".in-drawer__container"
|
|
97
98
|
],
|
|
98
|
-
extensions:
|
|
99
|
+
extensions: d,
|
|
99
100
|
localePatch: H
|
|
100
101
|
}
|
|
101
102
|
);
|
|
102
|
-
}, _ = (i) => new Promise((r,
|
|
103
|
+
}, _ = (i) => new Promise((r, s) => {
|
|
104
|
+
var d;
|
|
103
105
|
if (document.getElementById("UiEditorScript")) {
|
|
104
106
|
i(), r();
|
|
105
107
|
return;
|
|
106
108
|
}
|
|
107
|
-
const e =
|
|
108
|
-
o.id = "UiEditorScript", o.type = "module", o.src =
|
|
109
|
+
const e = z.guido, a = `https://email-static.useinsider.com/guido/${(d = e == null ? void 0 : e.stripo) == null ? void 0 : d.version}/UIEditor.js`, o = document.createElement("script");
|
|
110
|
+
o.id = "UiEditorScript", o.type = "module", o.src = a, o.onload = () => {
|
|
109
111
|
i(), r();
|
|
110
112
|
}, o.onerror = () => {
|
|
111
|
-
|
|
113
|
+
s(new Error(`Failed to load Stripo UIEditor script from S3: ${a}`));
|
|
112
114
|
}, document.body.appendChild(o);
|
|
113
115
|
});
|
|
114
116
|
return { initPlugin: async (i) => {
|
|
115
117
|
await _(async () => {
|
|
116
|
-
const r =
|
|
117
|
-
|
|
118
|
-
|
|
118
|
+
const r = C(), [s, e] = await Promise.all([
|
|
119
|
+
b(),
|
|
120
|
+
k()
|
|
119
121
|
]);
|
|
120
|
-
r.syncModulesEnabled = e, await
|
|
122
|
+
r.syncModulesEnabled = e, await V(i, s, e);
|
|
121
123
|
});
|
|
122
124
|
} };
|
|
123
125
|
};
|
|
124
126
|
export {
|
|
125
|
-
|
|
127
|
+
ae as useStripo
|
|
126
128
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.2.0-beta.
|
|
3
|
+
"version": "3.2.0-beta.b277bd3",
|
|
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",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
},
|
|
87
87
|
"guido": {
|
|
88
88
|
"stripo": {
|
|
89
|
-
"version": "2.
|
|
89
|
+
"version": "2.62.0"
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
}
|