@useinsider/guido 3.3.0-beta.878c1c2 → 3.3.0-beta.c1e1d7e
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/useCustomInterfaceAppearance.js +16 -18
- package/dist/composables/useStripo.js +43 -41
- package/dist/composables/useStripoNotifications.js +30 -0
- package/dist/src/composables/useStripoNotifications.d.ts +4 -0
- package/package.json +1 -1
- package/dist/static/styles/components/notification.css.js +0 -74
|
@@ -4,21 +4,20 @@ import e from "../static/styles/components/amp-block.css.js";
|
|
|
4
4
|
import i from "../static/styles/components/base-input.css.js";
|
|
5
5
|
import p from "../static/styles/components/button-group.css.js";
|
|
6
6
|
import n from "../static/styles/components/button.css.js";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
7
|
+
import s from "../static/styles/components/combobox.css.js";
|
|
8
|
+
import C from "../static/styles/components/counter.css.js";
|
|
9
9
|
import f from "../static/styles/components/dropdown-menu.css.js";
|
|
10
10
|
import a from "../static/styles/components/loader.css.js";
|
|
11
11
|
import u from "../static/styles/components/narrow-panel.css.js";
|
|
12
|
-
import c from "../static/styles/components/
|
|
13
|
-
import d from "../static/styles/components/
|
|
14
|
-
import l from "../static/styles/components/
|
|
15
|
-
import h from "../static/styles/components/
|
|
16
|
-
import w from "../static/styles/components/
|
|
17
|
-
import y from "../static/styles/components/
|
|
18
|
-
import B from "../static/styles/
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
b,
|
|
12
|
+
import c from "../static/styles/components/popup.css.js";
|
|
13
|
+
import d from "../static/styles/components/switcher.css.js";
|
|
14
|
+
import l from "../static/styles/components/tabs.css.js";
|
|
15
|
+
import h from "../static/styles/components/tools.css.js";
|
|
16
|
+
import w from "../static/styles/components/version-history.css.js";
|
|
17
|
+
import y from "../static/styles/components/wide-panel.css.js";
|
|
18
|
+
import B from "../static/styles/variables.css.js";
|
|
19
|
+
const b = [
|
|
20
|
+
B,
|
|
22
21
|
// Must be on top
|
|
23
22
|
S,
|
|
24
23
|
// Must be on top
|
|
@@ -27,8 +26,8 @@ const A = [
|
|
|
27
26
|
i,
|
|
28
27
|
p,
|
|
29
28
|
n,
|
|
30
|
-
C,
|
|
31
29
|
s,
|
|
30
|
+
C,
|
|
32
31
|
f,
|
|
33
32
|
a,
|
|
34
33
|
u,
|
|
@@ -37,13 +36,12 @@ const A = [
|
|
|
37
36
|
l,
|
|
38
37
|
h,
|
|
39
38
|
w,
|
|
40
|
-
y
|
|
41
|
-
B
|
|
39
|
+
y
|
|
42
40
|
].join(`
|
|
43
41
|
|
|
44
|
-
`),
|
|
42
|
+
`), v = () => ({ importCss: () => {
|
|
45
43
|
const o = new CSSStyleSheet();
|
|
46
|
-
o.replaceSync(
|
|
44
|
+
o.replaceSync(b);
|
|
47
45
|
const r = document.querySelector("ui-editor");
|
|
48
46
|
if (!r)
|
|
49
47
|
return;
|
|
@@ -51,5 +49,5 @@ const A = [
|
|
|
51
49
|
t && (t.adoptedStyleSheets = [o]);
|
|
52
50
|
} });
|
|
53
51
|
export {
|
|
54
|
-
|
|
52
|
+
v as useCustomInterfaceAppearance
|
|
55
53
|
};
|
|
@@ -1,27 +1,28 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useBlocksConfig as
|
|
3
|
-
import { useConfig as
|
|
4
|
-
import { useCustomInterfaceAppearance as
|
|
5
|
-
import { useFullStoryBridge as
|
|
6
|
-
import { useStripoEventHandler as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import j from "../
|
|
1
|
+
import { useActionsApi as I } from "./useActionsApi.js";
|
|
2
|
+
import { useBlocksConfig as P } from "./useBlocksConfig.js";
|
|
3
|
+
import { useConfig as U } from "./useConfig.js";
|
|
4
|
+
import { useCustomInterfaceAppearance as R } from "./useCustomInterfaceAppearance.js";
|
|
5
|
+
import { useFullStoryBridge as q } from "./useFullStoryBridge.js";
|
|
6
|
+
import { useStripoEventHandler as x } from "./useStripoEventHandler.js";
|
|
7
|
+
import { useStripoNotifications as H } from "./useStripoNotifications.js";
|
|
8
|
+
import { useToaster as N } from "./useToaster.js";
|
|
9
|
+
import { localePatch as O } from "../config/i18n/index.js";
|
|
10
|
+
import { useStripoApi as j } from "../services/stripoApi.js";
|
|
11
|
+
import L from "../static/styles/customEditorStyle.css.js";
|
|
11
12
|
import { useEditorStore as E } from "../stores/editor.js";
|
|
12
|
-
import { dynamicContentToMergeTags as
|
|
13
|
-
import
|
|
14
|
-
const
|
|
15
|
-
const { features:
|
|
13
|
+
import { dynamicContentToMergeTags as $ } from "../utils/genericUtil.js";
|
|
14
|
+
import z from "../package.json.js";
|
|
15
|
+
const dt = (C, c) => {
|
|
16
|
+
const { features: l, template: h, isFeatureEnabled: u } = U(), { handleError: m } = N(), { getToken: w, getCustomFonts: b, getSyncModulesStatus: k } = j(), { handleEvent: B } = x(), { getStripoNotifications: T } = H(), { getStripoBlocksConfig: V } = P(), _ = async (i, r = [], s = !1) => {
|
|
16
17
|
var g, S, y;
|
|
17
|
-
const
|
|
18
|
+
const t = E(), { html: p, css: a } = i, { baseBlocks: o, extensions: d } = await V(), f = ((g = l.value) == null ? void 0 : g.displayConditions) ?? !0, v = ((S = l.value) == null ? void 0 : S.modulesDisabled) ?? !1, M = ((y = h.value) == null ? void 0 : y.forceRecreate) ?? !1;
|
|
18
19
|
window.UIEditor.initEditor(
|
|
19
20
|
document.querySelector("#guido-editor"),
|
|
20
21
|
{
|
|
21
22
|
metadata: C,
|
|
22
23
|
html: p,
|
|
23
24
|
css: a,
|
|
24
|
-
forceRecreate:
|
|
25
|
+
forceRecreate: M,
|
|
25
26
|
locale: "en",
|
|
26
27
|
undoButtonSelector: "#guido__undo-button",
|
|
27
28
|
redoButtonSelector: "#guido__redo-button",
|
|
@@ -31,11 +32,11 @@ const se = (C, l) => {
|
|
|
31
32
|
customAppearanceMergetags: !u("liquidSyntax"),
|
|
32
33
|
customAppearanceMergetagsBorderColor: "#f1f3fe",
|
|
33
34
|
customAppearanceMergetagsBackgroundColor: "#f1f3fe",
|
|
34
|
-
customViewStyles:
|
|
35
|
+
customViewStyles: L,
|
|
35
36
|
conditionsEnabled: f,
|
|
36
37
|
customConditionsEnabled: f,
|
|
37
38
|
enableXSSSecurity: !0,
|
|
38
|
-
modulesDisabled:
|
|
39
|
+
modulesDisabled: v,
|
|
39
40
|
syncModulesEnabled: s,
|
|
40
41
|
messageSettingsEnabled: !0,
|
|
41
42
|
displayGmailAnnotations: !0,
|
|
@@ -52,59 +53,60 @@ const se = (C, l) => {
|
|
|
52
53
|
},
|
|
53
54
|
mergeTags: [
|
|
54
55
|
{
|
|
55
|
-
entries:
|
|
56
|
-
|
|
56
|
+
entries: $(
|
|
57
|
+
c.preselectedDynamicContentList,
|
|
57
58
|
u("liquidSyntax")
|
|
58
59
|
)
|
|
59
60
|
}
|
|
60
61
|
],
|
|
61
|
-
async onTokenRefreshRequest(
|
|
62
|
+
async onTokenRefreshRequest(e) {
|
|
62
63
|
try {
|
|
63
64
|
const n = await w();
|
|
64
|
-
|
|
65
|
+
e(n);
|
|
65
66
|
} catch (n) {
|
|
66
67
|
m(n, "Failed to refresh token");
|
|
67
68
|
}
|
|
68
69
|
},
|
|
69
70
|
onTemplateLoaded() {
|
|
70
71
|
try {
|
|
71
|
-
const { importCss:
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
const { importCss: e } = R(), { activateCustomViewStyles: n, updateTimerInClonedTemplate: A } = I(), { injectFullStory: D } = q();
|
|
73
|
+
e(), n(), D(), A(), c.onReady(), t.isStripoInitialized = !0, t.loadingStatus = !1, setTimeout(() => {
|
|
74
|
+
t.hasChanges = !1;
|
|
74
75
|
}, 1e3);
|
|
75
|
-
} catch (
|
|
76
|
-
m(
|
|
76
|
+
} catch (e) {
|
|
77
|
+
m(e, "Failed to load custom interface appearance");
|
|
77
78
|
}
|
|
78
79
|
},
|
|
79
|
-
onCodeEditorVisibilityChanged(
|
|
80
|
-
|
|
80
|
+
onCodeEditorVisibilityChanged(e) {
|
|
81
|
+
t.isCodeEditorOpen = e;
|
|
81
82
|
},
|
|
82
|
-
onEditorVisualModeChanged(
|
|
83
|
-
|
|
83
|
+
onEditorVisualModeChanged(e) {
|
|
84
|
+
t.editorVisualMode = e.toLowerCase();
|
|
84
85
|
},
|
|
85
|
-
onVersionHistoryVisibilityChanged(
|
|
86
|
-
|
|
86
|
+
onVersionHistoryVisibilityChanged(e) {
|
|
87
|
+
t.isVersionHistoryOpen = e;
|
|
87
88
|
},
|
|
88
89
|
onDataChanged() {
|
|
89
|
-
|
|
90
|
+
t.hasChanges = !0;
|
|
90
91
|
},
|
|
91
92
|
onEvent: B,
|
|
93
|
+
notifications: T(),
|
|
92
94
|
ignoreClickOutsideSelectors: [
|
|
93
95
|
"#guido-dynamic-content-modal",
|
|
94
96
|
".in-on-board-wrapper",
|
|
95
97
|
".in-drawer__container"
|
|
96
98
|
],
|
|
97
99
|
extensions: d,
|
|
98
|
-
localePatch:
|
|
100
|
+
localePatch: O
|
|
99
101
|
}
|
|
100
102
|
);
|
|
101
|
-
},
|
|
103
|
+
}, F = (i) => new Promise((r, s) => {
|
|
102
104
|
var d;
|
|
103
105
|
if (document.getElementById("UiEditorScript")) {
|
|
104
106
|
i(), r();
|
|
105
107
|
return;
|
|
106
108
|
}
|
|
107
|
-
const
|
|
109
|
+
const t = z.guido, a = `https://email-static.useinsider.com/guido/${(d = t == null ? void 0 : t.stripo) == null ? void 0 : d.version}/UIEditor.js`, o = document.createElement("script");
|
|
108
110
|
o.id = "UiEditorScript", o.type = "module", o.src = a, o.onload = () => {
|
|
109
111
|
i(), r();
|
|
110
112
|
}, o.onerror = () => {
|
|
@@ -112,15 +114,15 @@ const se = (C, l) => {
|
|
|
112
114
|
}, document.body.appendChild(o);
|
|
113
115
|
});
|
|
114
116
|
return { initPlugin: async (i) => {
|
|
115
|
-
await
|
|
116
|
-
const r = E(), [s,
|
|
117
|
+
await F(async () => {
|
|
118
|
+
const r = E(), [s, t] = await Promise.all([
|
|
117
119
|
b(),
|
|
118
120
|
k()
|
|
119
121
|
]);
|
|
120
|
-
r.syncModulesEnabled =
|
|
122
|
+
r.syncModulesEnabled = t, await _(i, s, t);
|
|
121
123
|
});
|
|
122
124
|
} };
|
|
123
125
|
};
|
|
124
126
|
export {
|
|
125
|
-
|
|
127
|
+
dt as useStripo
|
|
126
128
|
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { useToaster as a } from "./useToaster.js";
|
|
2
|
+
import { ToasterTypeOptions as r } from "../enums/toaster.js";
|
|
3
|
+
const h = () => {
|
|
4
|
+
const { showToaster: l, hideToaster: u } = a();
|
|
5
|
+
let e = null, s = null;
|
|
6
|
+
const c = (t, o, i, n) => {
|
|
7
|
+
if (e === i && s === o)
|
|
8
|
+
return;
|
|
9
|
+
e = i, s = o;
|
|
10
|
+
const f = n != null && n.action ? { text: n.action.label, onClick: n.action.func } : void 0;
|
|
11
|
+
l({ type: t, message: o, actionButton: f });
|
|
12
|
+
};
|
|
13
|
+
return { getStripoNotifications: () => ({
|
|
14
|
+
info: (t, o, i) => c(r.Success, t, o, i),
|
|
15
|
+
success: (t, o, i) => c(r.Success, t, o, i),
|
|
16
|
+
warn: (t, o, i) => c(r.Warning, t, o, i),
|
|
17
|
+
error: (t, o, i) => c(r.Alert, t, o, i),
|
|
18
|
+
// Stripo emits `loader` for in-progress operations expected to persist until
|
|
19
|
+
// explicit hide(id). Available toaster types auto-dismiss at 6s, so showing
|
|
20
|
+
// anything here would lie about completion. Skip until a persistent type exists.
|
|
21
|
+
loader: () => {
|
|
22
|
+
},
|
|
23
|
+
hide: (t) => {
|
|
24
|
+
e === t && (u(), e = null, s = null);
|
|
25
|
+
}
|
|
26
|
+
}) };
|
|
27
|
+
};
|
|
28
|
+
export {
|
|
29
|
+
h as useStripoNotifications
|
|
30
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.3.0-beta.
|
|
3
|
+
"version": "3.3.0-beta.c1e1d7e",
|
|
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",
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
const n = `ue-notifications-container {
|
|
2
|
-
left: 96px;
|
|
3
|
-
margin: 0;
|
|
4
|
-
bottom: 32px;
|
|
5
|
-
top: unset;
|
|
6
|
-
width: unset;
|
|
7
|
-
position: fixed;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
ue-notifications-container ue-message + ue-message {
|
|
11
|
-
margin-bottom: 24px;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
ue-notifications-container .alert-message-wrapper {
|
|
15
|
-
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.07);
|
|
16
|
-
border: none;
|
|
17
|
-
padding: 16px 24px;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
ue-notifications-container .alert-message-wrapper.info,
|
|
21
|
-
ue-notifications-container .alert-message-wrapper.loader {
|
|
22
|
-
background-color: var(--guido-color-background-toaster-info) !important;
|
|
23
|
-
color: inherit;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.alert-message-wrapper .alert-message-main {
|
|
27
|
-
align-items: center;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
ue-notifications-container ue-caption .caption {
|
|
31
|
-
color: var(--guido-color-white) !important;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
ue-block-thumb-hint {
|
|
35
|
-
text-align: left;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
ue-notifications-container .alert-message-wrapper .alert-message-main .alert-message-content {
|
|
39
|
-
width: calc(100% - 64px);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
ue-notifications-container .alert-message-wrapper .alert-message-main .alert-message-text {
|
|
43
|
-
font-size: 15px;
|
|
44
|
-
font-weight: 600;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
ue-notifications-container .alert-message-text,
|
|
48
|
-
ue-notifications-container .alert-message-wrapper ue-icon-component.icon,
|
|
49
|
-
ue-notifications-container .alert-message-wrapper ue-icon-component.icon-button {
|
|
50
|
-
color: var(--guido-color-white);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
ue-notifications-container ue-message ue-button.close {
|
|
54
|
-
margin: 0 0 0 16px;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
ue-notifications-container .alert-message-wrapper.success {
|
|
58
|
-
background: var(--guido-color-background-toaster-success);
|
|
59
|
-
color: inherit;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
ue-notifications-container .alert-message-wrapper.error {
|
|
63
|
-
background: var(--guido-color-background-toaster-error);
|
|
64
|
-
color: inherit;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
ue-notifications-container .alert-message-wrapper.warn {
|
|
68
|
-
background: var(--guido-color-background-toaster-warn);
|
|
69
|
-
color: inherit;
|
|
70
|
-
}
|
|
71
|
-
`;
|
|
72
|
-
export {
|
|
73
|
-
n as default
|
|
74
|
-
};
|