@useinsider/guido 1.0.3-beta.bf31272 → 1.0.3-beta.c1a273d

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.
@@ -23,11 +23,11 @@ const e = {
23
23
  }, t = {
24
24
  promotional: 1,
25
25
  transactional: 2
26
- }, a = "email", o = "Guido User", s = t.promotional, n = 2, i = 13, u = {
26
+ }, a = "email", o = "Guido User", s = t.promotional, n = 2, i = {
27
27
  email: 60,
28
28
  architect: 49,
29
29
  unsubscribePages: 97
30
- }, r = [
30
+ }, u = [
31
31
  "alfredtesting",
32
32
  "electio",
33
33
  "eurekatest",
@@ -65,8 +65,7 @@ export {
65
65
  a as DefaultProductType,
66
66
  o as DefaultUsername,
67
67
  n as EditorType,
68
- i as MAX_DEFAULT_TEMPLATE_ID,
69
- u as ProductIds,
70
- r as TEST_PARTNER_LIST,
68
+ i as ProductIds,
69
+ u as TEST_PARTNER_LIST,
71
70
  t as TemplateTypes
72
71
  };
@@ -1,12 +1,11 @@
1
- import { useHttp as u } from "../composables/useHttp.js";
2
- import { useToaster as m } from "../composables/useToaster.js";
3
- import { MAX_DEFAULT_TEMPLATE_ID as p } from "../enums/defaults.js";
4
- const y = () => {
5
- const { get: a } = u(), { handleError: o } = m();
1
+ import { useHttp as a } from "../composables/useHttp.js";
2
+ import { useToaster as s } from "../composables/useToaster.js";
3
+ const m = () => {
4
+ const { get: r } = a(), { handleError: o } = s();
6
5
  return {
7
6
  getToken: async () => {
8
7
  try {
9
- const t = Number(localStorage.getItem("ins-guido-test-instance")), { data: e } = await a(`/stripo/get-user-token?test=${t}`);
8
+ const t = Number(localStorage.getItem("ins-guido-test-instance")), { data: e } = await r(`/stripo/get-user-token?test=${t}`);
10
9
  return e.body.token;
11
10
  } catch (t) {
12
11
  return o(t, "Failed to fetch token"), "";
@@ -14,7 +13,7 @@ const y = () => {
14
13
  },
15
14
  getCustomFonts: async () => {
16
15
  try {
17
- const { data: t = [] } = await a("/stripo/get-partner-custom-fonts");
16
+ const { data: t = [] } = await r("/stripo/get-partner-custom-fonts");
18
17
  return t.map((e) => ({
19
18
  ...e,
20
19
  active: !0
@@ -30,19 +29,21 @@ const y = () => {
30
29
  forceRecreate: !0
31
30
  };
32
31
  try {
33
- const c = new URLSearchParams(window.location.search).get("default-template"), s = c ? parseInt(c) : 0, l = s >= 1 && s <= p ? s : 0, { data: n } = await a(
34
- `/stripo/default-template/${l}`
35
- ), r = typeof n == "string" ? JSON.parse(n) : n;
36
- return !r || typeof r != "object" || !("html" in r) || !("css" in r) ? t : {
37
- ...r,
38
- forceRecreate: !0
39
- };
32
+ const { data: e } = await r("/stripo/default-template/0");
33
+ try {
34
+ return {
35
+ ...JSON.parse(e),
36
+ forceRecreate: !0
37
+ };
38
+ } catch {
39
+ return t;
40
+ }
40
41
  } catch (e) {
41
- return console.debug("getDefaultTemplate: Error occurred", e), o(e, "Failed to fetch default template"), t;
42
+ return o(e, "Failed to fetch default template"), t;
42
43
  }
43
44
  }
44
45
  };
45
46
  };
46
47
  export {
47
- y as useStripoApi
48
+ m as useStripoApi
48
49
  };
@@ -8,6 +8,5 @@ export declare const DefaultProductType = "email";
8
8
  export declare const DefaultUsername = "Guido User";
9
9
  export declare const DefaultMessageType: number;
10
10
  export declare const EditorType: number;
11
- export declare const MAX_DEFAULT_TEMPLATE_ID = 13;
12
11
  export declare const ProductIds: Record<string, number>;
13
12
  export declare const TEST_PARTNER_LIST: string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "1.0.3-beta.bf31272",
3
+ "version": "1.0.3-beta.c1a273d",
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",