@useinsider/guido 2.1.0-beta.786853a → 2.1.0-beta.798c928
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/services/stripoApi.js +13 -13
- package/package.json +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { useHttp as
|
|
2
|
-
import { useToaster as
|
|
3
|
-
import { MAX_DEFAULT_TEMPLATE_ID as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
const
|
|
7
|
-
const { get: o } =
|
|
1
|
+
import { useHttp as i } from "../composables/useHttp.js";
|
|
2
|
+
import { useToaster as l } from "../composables/useToaster.js";
|
|
3
|
+
import { MAX_DEFAULT_TEMPLATE_ID as u } from "../enums/defaults.js";
|
|
4
|
+
import d from "../static/templates/empty/index.html.js";
|
|
5
|
+
import f from "../static/templates/empty/style.css.js";
|
|
6
|
+
const k = () => {
|
|
7
|
+
const { get: o } = i(), { handleError: a } = l();
|
|
8
8
|
return {
|
|
9
9
|
getToken: async () => {
|
|
10
10
|
try {
|
|
@@ -27,14 +27,14 @@ const D = () => {
|
|
|
27
27
|
},
|
|
28
28
|
getDefaultTemplate: async () => {
|
|
29
29
|
const t = {
|
|
30
|
-
html:
|
|
31
|
-
css:
|
|
30
|
+
html: d,
|
|
31
|
+
css: f
|
|
32
32
|
};
|
|
33
33
|
try {
|
|
34
|
-
const
|
|
35
|
-
if (!m
|
|
34
|
+
const c = new URLSearchParams(window.location.search).get("default-template"), s = c ? parseInt(c) : 0, m = s >= 1 && s <= u ? s : 0;
|
|
35
|
+
if (!m)
|
|
36
36
|
return t;
|
|
37
|
-
const
|
|
37
|
+
const p = `/stripo/default-template/${m}`, { data: n } = await o(p), r = typeof n == "string" ? JSON.parse(n) : n;
|
|
38
38
|
return !r || typeof r != "object" || !("html" in r) || !("css" in r) ? t : r;
|
|
39
39
|
} catch (e) {
|
|
40
40
|
return a(e, "Failed to fetch default template"), t;
|
|
@@ -43,5 +43,5 @@ const D = () => {
|
|
|
43
43
|
};
|
|
44
44
|
};
|
|
45
45
|
export {
|
|
46
|
-
|
|
46
|
+
k as useStripoApi
|
|
47
47
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "2.1.0-beta.
|
|
3
|
+
"version": "2.1.0-beta.798c928",
|
|
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",
|