@useinsider/guido 3.12.0-beta.92049a8 → 3.12.0-beta.98baf2f
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.
|
@@ -3,30 +3,33 @@ import { useEditorStore as u } from "../stores/editor.js";
|
|
|
3
3
|
import { useOnboardingStore as l } from "../stores/onboarding.js";
|
|
4
4
|
import { useUnsubscribeStore as b } from "../stores/unsubscribe.js";
|
|
5
5
|
const v = () => {
|
|
6
|
-
const { updateSyncModule:
|
|
6
|
+
const { updateSyncModule: r, getSyncModule: s } = i(), d = u(), a = b(), c = {
|
|
7
7
|
block_dropped: ({ blockName: e }) => {
|
|
8
8
|
if (e === "BLOCK_TEXT") {
|
|
9
|
-
const o = l(), t = !o.shouldShowOnboarding("textBlockOnboarding"),
|
|
10
|
-
if (t ||
|
|
9
|
+
const o = l(), t = !o.shouldShowOnboarding("textBlockOnboarding"), n = o.isActive("textBlockOnboarding");
|
|
10
|
+
if (t || n)
|
|
11
11
|
return;
|
|
12
12
|
o.start("textBlockOnboarding");
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
module_saved: async (e) => {
|
|
16
|
-
|
|
16
|
+
d.syncModulesEnabled && (console.debug("[module_saved] Saved module data:", e), await r(e));
|
|
17
17
|
},
|
|
18
18
|
module_dropped: async (e) => {
|
|
19
|
-
if (!
|
|
19
|
+
if (!d.syncModulesEnabled)
|
|
20
20
|
return;
|
|
21
|
-
const { moduleId: o } = e
|
|
22
|
-
|
|
21
|
+
const { moduleId: o, syncModule: t } = e;
|
|
22
|
+
if (!t)
|
|
23
|
+
return;
|
|
24
|
+
const n = await s(o);
|
|
25
|
+
console.debug("[module_dropped] Sync module data:", n), n.unsubscriptionPreferencePages.length && await a.fetchTemplates();
|
|
23
26
|
},
|
|
24
27
|
module_updated: async (e) => {
|
|
25
|
-
|
|
28
|
+
d.syncModulesEnabled && (console.debug("[module_updated] Updated module data:", e), await r(e));
|
|
26
29
|
}
|
|
27
30
|
};
|
|
28
31
|
return { handleEvent: async (e, o) => {
|
|
29
|
-
const t =
|
|
32
|
+
const t = c[e];
|
|
30
33
|
console.debug("Stripo Event: ", e, o), t && await t(o);
|
|
31
34
|
} };
|
|
32
35
|
};
|
|
@@ -2,77 +2,78 @@ import { useHttp as d } from "../composables/useHttp.js";
|
|
|
2
2
|
import { useToaster as m } from "../composables/useToaster.js";
|
|
3
3
|
import { MAX_DEFAULT_TEMPLATE_ID as y } from "../enums/defaults.js";
|
|
4
4
|
import { useBlankTemplate as f } from "./blankTemplate.js";
|
|
5
|
-
const
|
|
6
|
-
const { get:
|
|
5
|
+
const I = () => {
|
|
6
|
+
const { get: a, post: i } = d(), { handleError: s } = m(), { getBlankTemplate: n } = f();
|
|
7
7
|
return {
|
|
8
8
|
getToken: async () => {
|
|
9
9
|
try {
|
|
10
|
-
const { data: t } = await
|
|
10
|
+
const { data: t } = await a("/stripo/get-user-token");
|
|
11
11
|
return t.body.token;
|
|
12
12
|
} catch (t) {
|
|
13
|
-
return
|
|
13
|
+
return s(t, "Failed to fetch token"), "";
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
16
|
getCustomFonts: async () => {
|
|
17
17
|
try {
|
|
18
|
-
const { data: t = [] } = await
|
|
18
|
+
const { data: t = [] } = await a("/stripo/get-partner-custom-fonts");
|
|
19
19
|
return t.map((e) => ({
|
|
20
20
|
...e,
|
|
21
21
|
active: !0
|
|
22
22
|
}));
|
|
23
23
|
} catch (t) {
|
|
24
|
-
return
|
|
24
|
+
return s(t, "Failed to fetch custom fonts"), [];
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
27
|
getDefaultTemplate: async () => {
|
|
28
28
|
try {
|
|
29
|
-
const t = new URLSearchParams(window.location.search), e = t.get("default-template"),
|
|
30
|
-
if (!
|
|
31
|
-
return await
|
|
32
|
-
const p = `/stripo/default-template/${
|
|
33
|
-
return !
|
|
29
|
+
const t = new URLSearchParams(window.location.search), e = t.get("default-template"), r = t.get("master"), c = e ? parseInt(e) : 0, l = c >= 1 && c <= y ? c : 0;
|
|
30
|
+
if (!l && !r)
|
|
31
|
+
return await n();
|
|
32
|
+
const p = `/stripo/default-template/${l}`, { data: u } = await a(p), o = typeof u == "string" ? JSON.parse(u) : u;
|
|
33
|
+
return !o || typeof o != "object" || !("html" in o) || !("css" in o) ? await n() : o;
|
|
34
34
|
} catch (t) {
|
|
35
|
-
return
|
|
35
|
+
return s(t, "Failed to fetch default template"), n();
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
38
|
getSyncModulesStatus: async () => {
|
|
39
39
|
try {
|
|
40
|
-
const { data: t } = await
|
|
40
|
+
const { data: t } = await a("/newsletter/settings/synchronisation-in-modules-status");
|
|
41
41
|
return t.status;
|
|
42
42
|
} catch (t) {
|
|
43
|
-
return
|
|
43
|
+
return s(t, "Failed to fetch sync modules status"), !1;
|
|
44
44
|
}
|
|
45
45
|
},
|
|
46
46
|
updateSyncModule: async (t) => {
|
|
47
47
|
try {
|
|
48
|
-
return await
|
|
48
|
+
return await i(`/stripo/stripo-modules/${t.moduleId}/update`), !0;
|
|
49
49
|
} catch (e) {
|
|
50
|
-
return
|
|
50
|
+
return s(e, "Failed to update sync module"), !1;
|
|
51
51
|
}
|
|
52
52
|
},
|
|
53
53
|
getSyncModule: async (t) => {
|
|
54
|
+
const e = {
|
|
55
|
+
id: 0,
|
|
56
|
+
stripoId: 0,
|
|
57
|
+
unsubscriptionPreferencePages: []
|
|
58
|
+
};
|
|
54
59
|
try {
|
|
55
|
-
const { data:
|
|
56
|
-
return e;
|
|
57
|
-
} catch (
|
|
58
|
-
return r
|
|
59
|
-
id: 0,
|
|
60
|
-
stripoId: 0,
|
|
61
|
-
unsubscriptionPreferencePages: []
|
|
62
|
-
};
|
|
60
|
+
const { data: r } = await a(`/stripo/stripo-modules/${t}/get`);
|
|
61
|
+
return Array.isArray(r) || !Array.isArray(r == null ? void 0 : r.unsubscriptionPreferencePages) ? e : r;
|
|
62
|
+
} catch (r) {
|
|
63
|
+
return s(r, "Failed to get sync module"), e;
|
|
63
64
|
}
|
|
64
65
|
},
|
|
65
66
|
setSyncModuleUnsubscriptionPages: async (t) => {
|
|
66
67
|
if (t.length === 0)
|
|
67
68
|
return !0;
|
|
68
69
|
try {
|
|
69
|
-
return await
|
|
70
|
+
return await i("/stripo/stripo-modules/set-unsubscription-preference-pages", t), !0;
|
|
70
71
|
} catch (e) {
|
|
71
|
-
return
|
|
72
|
+
return s(e, "Failed to set unsubscription preference pages"), !1;
|
|
72
73
|
}
|
|
73
74
|
}
|
|
74
75
|
};
|
|
75
76
|
};
|
|
76
77
|
export {
|
|
77
|
-
|
|
78
|
+
I as useStripoApi
|
|
78
79
|
};
|
|
@@ -3,12 +3,8 @@ const n = `.base-input {
|
|
|
3
3
|
border-radius: 4px;
|
|
4
4
|
background-color: var(--guido-color-gray-0);
|
|
5
5
|
align-items: center;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
focus. A fixed max-height clamped their inner box; keep 40px only as the floor. */
|
|
9
|
-
min-height: 40px;
|
|
10
|
-
height: auto;
|
|
11
|
-
max-height: none;
|
|
6
|
+
height: 40px;
|
|
7
|
+
max-height: 40px;
|
|
12
8
|
box-sizing: content-box;
|
|
13
9
|
outline: none;
|
|
14
10
|
resize: vertical;
|
|
@@ -40,6 +36,11 @@ ue-contenteditable .base-input {
|
|
|
40
36
|
line-height: 24px;
|
|
41
37
|
}
|
|
42
38
|
|
|
39
|
+
/* Image link input is auto-height; lift the fixed 40px cap so it can grow. */
|
|
40
|
+
ue-contenteditable.link-autoheight-contenteditable .base-input {
|
|
41
|
+
max-height: none;
|
|
42
|
+
}
|
|
43
|
+
|
|
43
44
|
ue-icon-component.icon-button.icon-clear-input {
|
|
44
45
|
right: 2px;
|
|
45
46
|
top: 2px;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.12.0-beta.
|
|
3
|
+
"version": "3.12.0-beta.98baf2f",
|
|
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",
|