@useinsider/guido 3.2.0-beta.b397787 → 3.2.0-beta.d5a560f
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.
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var i;
|
|
6
|
-
const t = o("_fs_org", "");
|
|
7
|
-
if (!t)
|
|
1
|
+
const c = "https://email-static.useinsider.com/guido/guido-fullstory.js", u = () => ({ injectFullStory: () => {
|
|
2
|
+
var n;
|
|
3
|
+
const s = window;
|
|
4
|
+
if (typeof s._fs_org != "string" || !s._fs_org)
|
|
8
5
|
return;
|
|
9
|
-
const
|
|
10
|
-
if (!
|
|
6
|
+
const r = document.querySelector("ui-editor"), o = (n = r == null ? void 0 : r.shadowRoot) == null ? void 0 : n.querySelector("iframe"), e = o == null ? void 0 : o.contentDocument;
|
|
7
|
+
if (!e || e.querySelector('script[data-fullstory-bridge="true"]'))
|
|
11
8
|
return;
|
|
12
|
-
const
|
|
13
|
-
|
|
9
|
+
const t = e.createElement("script");
|
|
10
|
+
t.src = c, t.async = !0, t.crossOrigin = "anonymous", t.dataset.fullstoryBridge = "true", e.head.appendChild(t);
|
|
14
11
|
} });
|
|
15
12
|
export {
|
|
16
|
-
|
|
13
|
+
u as useFullStoryBridge
|
|
17
14
|
};
|
|
@@ -12,10 +12,10 @@ import L from "../static/styles/customEditorStyle.css.js";
|
|
|
12
12
|
import { useEditorStore as C } from "../stores/editor.js";
|
|
13
13
|
import { dynamicContentToMergeTags as $ } from "../utils/genericUtil.js";
|
|
14
14
|
import z from "../package.json.js";
|
|
15
|
-
const
|
|
16
|
-
const { features: c, template: h, isFeatureEnabled: u } = P(), { handleError: m } = x(), { getToken:
|
|
17
|
-
var g,
|
|
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 = ((
|
|
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;
|
|
19
19
|
window.UIEditor.initEditor(
|
|
20
20
|
document.querySelector("#guido-editor"),
|
|
21
21
|
{
|
|
@@ -38,18 +38,19 @@ const se = (E, l) => {
|
|
|
38
38
|
conditionCategories: O,
|
|
39
39
|
enableXSSSecurity: !0,
|
|
40
40
|
modulesDisabled: F,
|
|
41
|
-
syncModulesEnabled:
|
|
41
|
+
syncModulesEnabled: s,
|
|
42
42
|
messageSettingsEnabled: !0,
|
|
43
43
|
displayGmailAnnotations: !0,
|
|
44
44
|
displayHiddenPreheader: !1,
|
|
45
45
|
displayTitle: !1,
|
|
46
46
|
displayUTM: !1,
|
|
47
47
|
selectElementAfterDrop: !0,
|
|
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,
|
|
52
|
-
customFonts:
|
|
53
|
+
customFonts: r
|
|
53
54
|
},
|
|
54
55
|
mergeTags: [
|
|
55
56
|
{
|
|
@@ -61,16 +62,16 @@ const se = (E, l) => {
|
|
|
61
62
|
],
|
|
62
63
|
async onTokenRefreshRequest(t) {
|
|
63
64
|
try {
|
|
64
|
-
const
|
|
65
|
-
t(
|
|
66
|
-
} catch (
|
|
67
|
-
m(
|
|
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) {
|
|
@@ -99,29 +100,29 @@ const se = (E, l) => {
|
|
|
99
100
|
localePatch: H
|
|
100
101
|
}
|
|
101
102
|
);
|
|
102
|
-
}, _ = (i) => new Promise((
|
|
103
|
+
}, _ = (i) => new Promise((r, s) => {
|
|
103
104
|
var d;
|
|
104
105
|
if (document.getElementById("UiEditorScript")) {
|
|
105
|
-
i(),
|
|
106
|
+
i(), r();
|
|
106
107
|
return;
|
|
107
108
|
}
|
|
108
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");
|
|
109
110
|
o.id = "UiEditorScript", o.type = "module", o.src = a, o.onload = () => {
|
|
110
|
-
i(),
|
|
111
|
+
i(), r();
|
|
111
112
|
}, o.onerror = () => {
|
|
112
|
-
|
|
113
|
+
s(new Error(`Failed to load Stripo UIEditor script from S3: ${a}`));
|
|
113
114
|
}, document.body.appendChild(o);
|
|
114
115
|
});
|
|
115
116
|
return { initPlugin: async (i) => {
|
|
116
117
|
await _(async () => {
|
|
117
|
-
const
|
|
118
|
-
|
|
118
|
+
const r = C(), [s, e] = await Promise.all([
|
|
119
|
+
b(),
|
|
119
120
|
k()
|
|
120
121
|
]);
|
|
121
|
-
|
|
122
|
+
r.syncModulesEnabled = e, await V(i, s, e);
|
|
122
123
|
});
|
|
123
124
|
} };
|
|
124
125
|
};
|
|
125
126
|
export {
|
|
126
|
-
|
|
127
|
+
ae as useStripo
|
|
127
128
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Injects the hosted FullStory bridge script into the Stripo editor iframe.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* The bridge script's origin is allowlisted via Stripo's
|
|
5
|
+
* `allowedScriptSourceDomains` in useStripo, so the iframe's CSP permits
|
|
6
|
+
* the load. The bundled script itself handles reading FS config from the
|
|
7
|
+
* parent window and booting the FullStory queue stub inside the iframe.
|
|
7
8
|
*/
|
|
8
9
|
export declare const useFullStoryBridge: () => {
|
|
9
10
|
injectFullStory: () => void;
|
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.d5a560f",
|
|
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",
|