@useinsider/guido 3.7.0-beta.2037cb1 → 3.7.0-beta.516b778
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 -44
- package/package.json +10 -1
|
@@ -1,42 +1,42 @@
|
|
|
1
1
|
import { useActionsApi as D } from "./useActionsApi.js";
|
|
2
|
-
import { useBlocksConfig as
|
|
3
|
-
import { useConfig as
|
|
2
|
+
import { useBlocksConfig as I } from "./useBlocksConfig.js";
|
|
3
|
+
import { useConfig as P } from "./useConfig.js";
|
|
4
4
|
import { useCustomInterfaceAppearance as U } from "./useCustomInterfaceAppearance.js";
|
|
5
5
|
import { useFullStoryBridge as R } from "./useFullStoryBridge.js";
|
|
6
6
|
import { useStripoEventHandler as q } from "./useStripoEventHandler.js";
|
|
7
7
|
import { useToaster as x } from "./useToaster.js";
|
|
8
8
|
import { localePatch as H } from "../config/i18n/index.js";
|
|
9
9
|
import { useStripoApi as O } from "../services/stripoApi.js";
|
|
10
|
-
import
|
|
11
|
-
import { useEditorStore as
|
|
12
|
-
import { dynamicContentToMergeTags as
|
|
13
|
-
import
|
|
14
|
-
const se = (
|
|
15
|
-
const { features:
|
|
10
|
+
import j from "../static/styles/customEditorStyle.css.js";
|
|
11
|
+
import { useEditorStore as E } from "../stores/editor.js";
|
|
12
|
+
import { dynamicContentToMergeTags as z } from "../utils/genericUtil.js";
|
|
13
|
+
import L from "../package.json.js";
|
|
14
|
+
const se = (C, l) => {
|
|
15
|
+
const { features: c, template: h, isFeatureEnabled: u } = P(), { handleError: m } = x(), { getToken: w, getCustomFonts: b, getSyncModulesStatus: k } = O(), { handleEvent: F } = q(), { getStripoBlocksConfig: B } = I(), T = async (i, r = [], s = !1) => {
|
|
16
16
|
var g, S, y;
|
|
17
|
-
const e =
|
|
17
|
+
const e = E(), { html: p, css: a } = i, { baseBlocks: o, extensions: d } = await B(), f = ((g = c.value) == null ? void 0 : g.displayConditions) ?? !0, _ = ((S = c.value) == null ? void 0 : S.modulesDisabled) ?? !1, v = ((y = h.value) == null ? void 0 : y.forceRecreate) ?? !1;
|
|
18
18
|
window.UIEditor.initEditor(
|
|
19
19
|
document.querySelector("#guido-editor"),
|
|
20
20
|
{
|
|
21
|
-
metadata:
|
|
21
|
+
metadata: C,
|
|
22
22
|
html: p,
|
|
23
23
|
css: a,
|
|
24
|
-
forceRecreate:
|
|
24
|
+
forceRecreate: v,
|
|
25
25
|
locale: "en",
|
|
26
26
|
undoButtonSelector: "#guido__undo-button",
|
|
27
27
|
redoButtonSelector: "#guido__redo-button",
|
|
28
28
|
mobileViewButtonSelector: ".guido__view-option-selection-mobile",
|
|
29
29
|
desktopViewButtonSelector: ".guido__view-option-selection-desktop",
|
|
30
30
|
codeEditorButtonSelector: "#guido__code-button",
|
|
31
|
-
customAppearanceMergetags: !
|
|
31
|
+
customAppearanceMergetags: !u("liquidSyntax"),
|
|
32
32
|
customAppearanceMergetagsBorderColor: "#f1f3fe",
|
|
33
33
|
customAppearanceMergetagsBackgroundColor: "#f1f3fe",
|
|
34
|
-
customViewStyles:
|
|
34
|
+
customViewStyles: j,
|
|
35
35
|
conditionsEnabled: f,
|
|
36
36
|
customConditionsEnabled: f,
|
|
37
37
|
enableXSSSecurity: !0,
|
|
38
|
-
modulesDisabled:
|
|
39
|
-
syncModulesEnabled:
|
|
38
|
+
modulesDisabled: _,
|
|
39
|
+
syncModulesEnabled: s,
|
|
40
40
|
messageSettingsEnabled: !0,
|
|
41
41
|
displayGmailAnnotations: !0,
|
|
42
42
|
displayHiddenPreheader: !1,
|
|
@@ -45,7 +45,7 @@ const se = (E, c) => {
|
|
|
45
45
|
selectElementAfterDrop: !0,
|
|
46
46
|
sameFontSizeForOutlook: !0,
|
|
47
47
|
allowedScriptSourceDomains: "https://email-static.useinsider.com https://edge.fullstory.com https://rs.fullstory.com",
|
|
48
|
-
...
|
|
48
|
+
...o ? { baseBlocks: o } : {},
|
|
49
49
|
editorFonts: {
|
|
50
50
|
showDefaultStandardFonts: !0,
|
|
51
51
|
showDefaultNotStandardFonts: !0,
|
|
@@ -53,9 +53,9 @@ const se = (E, c) => {
|
|
|
53
53
|
},
|
|
54
54
|
mergeTags: [
|
|
55
55
|
{
|
|
56
|
-
entries:
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
entries: z(
|
|
57
|
+
l.preselectedDynamicContentList,
|
|
58
|
+
u("liquidSyntax")
|
|
59
59
|
)
|
|
60
60
|
}
|
|
61
61
|
],
|
|
@@ -64,17 +64,17 @@ const se = (E, c) => {
|
|
|
64
64
|
const n = await w();
|
|
65
65
|
t(n);
|
|
66
66
|
} catch (n) {
|
|
67
|
-
|
|
67
|
+
m(n, "Failed to refresh token");
|
|
68
68
|
}
|
|
69
69
|
},
|
|
70
70
|
onTemplateLoaded() {
|
|
71
71
|
try {
|
|
72
72
|
const { importCss: t } = U(), { activateCustomViewStyles: n, updateTimerInClonedTemplate: M } = D(), { injectFullStory: A } = R();
|
|
73
|
-
t(), n(), A(), M(),
|
|
73
|
+
t(), n(), A(), M(), l.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
|
|
74
74
|
e.hasChanges = !1;
|
|
75
75
|
}, 1e3);
|
|
76
76
|
} catch (t) {
|
|
77
|
-
|
|
77
|
+
m(t, "Failed to load custom interface appearance");
|
|
78
78
|
}
|
|
79
79
|
},
|
|
80
80
|
onCodeEditorVisibilityChanged(t) {
|
|
@@ -89,7 +89,7 @@ const se = (E, c) => {
|
|
|
89
89
|
onDataChanged() {
|
|
90
90
|
e.hasChanges = !0;
|
|
91
91
|
},
|
|
92
|
-
onEvent:
|
|
92
|
+
onEvent: F,
|
|
93
93
|
ignoreClickOutsideSelectors: [
|
|
94
94
|
"#guido-dynamic-content-modal",
|
|
95
95
|
".in-on-board-wrapper",
|
|
@@ -99,32 +99,27 @@ const se = (E, c) => {
|
|
|
99
99
|
localePatch: H
|
|
100
100
|
}
|
|
101
101
|
);
|
|
102
|
-
},
|
|
102
|
+
}, V = (i) => new Promise((r, s) => {
|
|
103
103
|
var d;
|
|
104
104
|
if (document.getElementById("UiEditorScript")) {
|
|
105
|
-
|
|
105
|
+
i(), r();
|
|
106
106
|
return;
|
|
107
107
|
}
|
|
108
|
-
const e =
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
},
|
|
112
|
-
|
|
113
|
-
}, document.body.appendChild(
|
|
108
|
+
const e = L.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
|
+
o.id = "UiEditorScript", o.type = "module", o.src = a, o.onload = () => {
|
|
110
|
+
i(), r();
|
|
111
|
+
}, o.onerror = () => {
|
|
112
|
+
s(new Error(`Failed to load Stripo UIEditor script from S3: ${a}`));
|
|
113
|
+
}, document.body.appendChild(o);
|
|
114
114
|
});
|
|
115
|
-
return { initPlugin: async (
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
r.syncModulesEnabled = e, await B(s, o, e);
|
|
124
|
-
});
|
|
125
|
-
} catch (o) {
|
|
126
|
-
r.loadingStatus = !1, l(o, "Failed to load the editor");
|
|
127
|
-
}
|
|
115
|
+
return { initPlugin: async (i) => {
|
|
116
|
+
await V(async () => {
|
|
117
|
+
const r = E(), [s, e] = await Promise.all([
|
|
118
|
+
b(),
|
|
119
|
+
k()
|
|
120
|
+
]);
|
|
121
|
+
r.syncModulesEnabled = e, await T(i, s, e);
|
|
122
|
+
});
|
|
128
123
|
} };
|
|
129
124
|
};
|
|
130
125
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.7.0-beta.
|
|
3
|
+
"version": "3.7.0-beta.516b778",
|
|
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",
|
|
@@ -27,6 +27,8 @@
|
|
|
27
27
|
"test": "vitest run --coverage",
|
|
28
28
|
"test:watch": "vitest",
|
|
29
29
|
"test:visual-update": "npx playwright test --update-snapshots --reporter html",
|
|
30
|
+
"test:e2e:coverage": "E2E_COVERAGE=true playwright test",
|
|
31
|
+
"coverage:e2e:report": "nyc report --reporter=lcov --reporter=text-summary --report-dir=coverage/e2e",
|
|
30
32
|
"prepare": "husky",
|
|
31
33
|
"preinstall": "rm -rf ./node_modules/.vite"
|
|
32
34
|
},
|
|
@@ -74,10 +76,12 @@
|
|
|
74
76
|
"happy-dom": "15.11.7",
|
|
75
77
|
"husky": "9.1.7",
|
|
76
78
|
"msw": "2.10.3",
|
|
79
|
+
"nyc": "17.1.0",
|
|
77
80
|
"sass": "1.69.7",
|
|
78
81
|
"typescript": "5.5.4",
|
|
79
82
|
"typescript-eslint": "8.26.0",
|
|
80
83
|
"vite-plugin-dts": "4.5.4",
|
|
84
|
+
"vite-plugin-istanbul": "7.0.0",
|
|
81
85
|
"vitest": "2.1.9",
|
|
82
86
|
"vue-tsc": "2.2.10"
|
|
83
87
|
},
|
|
@@ -90,6 +94,11 @@
|
|
|
90
94
|
"msw": {
|
|
91
95
|
"workerDirectory": "public"
|
|
92
96
|
},
|
|
97
|
+
"nyc": {
|
|
98
|
+
"report-dir": "coverage/e2e",
|
|
99
|
+
"reporter": ["lcov", "text-summary"],
|
|
100
|
+
"all": false
|
|
101
|
+
},
|
|
93
102
|
"guido": {
|
|
94
103
|
"stripo": {
|
|
95
104
|
"version": "2.65.0"
|