@useinsider/guido 1.0.0-beta.f47d56f → 1.0.0-beta.f5fd3cf
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/README.md +18 -11
- package/dist/@types/generic.d.ts +0 -10
- package/dist/composables/useApiExample.d.ts +6 -4
- package/dist/composables/useHttp.d.ts +19 -1
- package/dist/composables/useStripo.js +53 -33
- package/dist/node_modules/pinia/dist/pinia.js +317 -0
- package/dist/node_modules/pinia/node_modules/vue-demi/lib/index.js +11 -0
- package/dist/stores/editor.js +1 -1
- package/dist/stores/version-history.js +1 -1
- package/package.json +1 -1
- package/dist/@types/http.d.ts +0 -19
- package/dist/services/stripoApi.d.ts +0 -7
- package/dist/services/stripoApi.js +0 -29
package/README.md
CHANGED
|
@@ -144,17 +144,24 @@ VITE_STRIPO_ROLE=your_role
|
|
|
144
144
|
|
|
145
145
|
```
|
|
146
146
|
src/
|
|
147
|
-
├── components/
|
|
148
|
-
├──
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
├──
|
|
154
|
-
├──
|
|
155
|
-
|
|
156
|
-
├──
|
|
157
|
-
|
|
147
|
+
├── components/
|
|
148
|
+
│ ├── Guido.vue # Main component
|
|
149
|
+
│ └── organisms/
|
|
150
|
+
│ └── header/ # Header components
|
|
151
|
+
│ └── version-history/ # Version History components
|
|
152
|
+
...
|
|
153
|
+
├── composables/
|
|
154
|
+
│ ├── useStripo.ts # Stripo integration
|
|
155
|
+
│ └── useTranslations.ts # Translation management
|
|
156
|
+
├── @types/
|
|
157
|
+
│ ├── generic.ts # Generic types
|
|
158
|
+
│ ├── stripo.d.ts # Stripo-specific types
|
|
159
|
+
│ └── events.ts # Event types
|
|
160
|
+
├── static/
|
|
161
|
+
│ ├── editor.css # Custom editor styles
|
|
162
|
+
│ └── templates/
|
|
163
|
+
│ └── default/ # Default email template
|
|
164
|
+
└── library.ts # Main export for library
|
|
158
165
|
```
|
|
159
166
|
|
|
160
167
|
## 🌐 i18n
|
package/dist/@types/generic.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
interface User {
|
|
2
|
+
id: number;
|
|
3
|
+
name: string;
|
|
4
|
+
email: string;
|
|
5
|
+
}
|
|
5
6
|
export declare const useApiExample: () => {
|
|
6
7
|
loading: import("vue").ComputedRef<boolean>;
|
|
7
8
|
error: import("vue").ComputedRef<{
|
|
@@ -59,3 +60,4 @@ export declare const useApiExample: () => {
|
|
|
59
60
|
uploadFile: (file: File) => Promise<string>;
|
|
60
61
|
clearError: () => void;
|
|
61
62
|
};
|
|
63
|
+
export {};
|
|
@@ -1,4 +1,22 @@
|
|
|
1
|
-
|
|
1
|
+
export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
2
|
+
export interface HttpOptions extends Omit<RequestInit, 'method' | 'body'> {
|
|
3
|
+
baseURL?: string;
|
|
4
|
+
timeout?: number;
|
|
5
|
+
retry?: number;
|
|
6
|
+
retryDelay?: number;
|
|
7
|
+
}
|
|
8
|
+
export interface HttpResponse<T = unknown> {
|
|
9
|
+
data: T;
|
|
10
|
+
status: number;
|
|
11
|
+
statusText: string;
|
|
12
|
+
headers: Headers;
|
|
13
|
+
}
|
|
14
|
+
export interface HttpError {
|
|
15
|
+
message: string;
|
|
16
|
+
status?: number;
|
|
17
|
+
statusText?: string;
|
|
18
|
+
response?: Response;
|
|
19
|
+
}
|
|
2
20
|
export declare const useHttp: (defaultOptions?: HttpOptions) => {
|
|
3
21
|
loading: import("vue").ComputedRef<boolean>;
|
|
4
22
|
error: import("vue").ComputedRef<{
|
|
@@ -1,16 +1,36 @@
|
|
|
1
|
-
import { useCustomInterfaceAppearance as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { useEditorStore as
|
|
5
|
-
const
|
|
6
|
-
const {
|
|
7
|
-
|
|
1
|
+
import { useCustomInterfaceAppearance as g } from "./useCustomInterfaceAppearance.js";
|
|
2
|
+
import { useHttp as y } from "./useHttp.js";
|
|
3
|
+
import { useToaster as h } from "./useToaster.js";
|
|
4
|
+
import { useEditorStore as w } from "../stores/editor.js";
|
|
5
|
+
const k = (c) => {
|
|
6
|
+
const { get: a, post: u } = y(), { handleError: i } = h(), l = async () => {
|
|
7
|
+
try {
|
|
8
|
+
return (await u("/v2/stripo/get-user-token", {
|
|
9
|
+
pluginId: void 0,
|
|
10
|
+
secretKey: void 0,
|
|
11
|
+
role: void 0,
|
|
12
|
+
userId: c.emailId
|
|
13
|
+
})).data.token;
|
|
14
|
+
} catch (t) {
|
|
15
|
+
return i(t, "Failed to fetch token"), "";
|
|
16
|
+
}
|
|
17
|
+
}, p = async () => {
|
|
18
|
+
try {
|
|
19
|
+
return ((await a("/stripo/get-partner-custom-fonts")).data || []).map((n) => ({
|
|
20
|
+
...n,
|
|
21
|
+
active: !0
|
|
22
|
+
}));
|
|
23
|
+
} catch (t) {
|
|
24
|
+
return i(t, "Failed to fetch custom fonts"), [];
|
|
25
|
+
}
|
|
26
|
+
}, m = (t, r = []) => {
|
|
27
|
+
const n = w(), { html: e, css: s } = t;
|
|
8
28
|
window.UIEditor.initEditor(
|
|
9
29
|
document.querySelector("#guido-editor"),
|
|
10
30
|
{
|
|
11
31
|
metadata: c,
|
|
12
|
-
html:
|
|
13
|
-
css:
|
|
32
|
+
html: e,
|
|
33
|
+
css: s,
|
|
14
34
|
locale: "en",
|
|
15
35
|
undoButtonSelector: "#guido__undo-button",
|
|
16
36
|
redoButtonSelector: "#guido__redo-button",
|
|
@@ -20,55 +40,55 @@ const _ = (c) => {
|
|
|
20
40
|
editorFonts: {
|
|
21
41
|
showDefaultStandardFonts: !0,
|
|
22
42
|
showDefaultNotStandardFonts: !0,
|
|
23
|
-
customFonts:
|
|
43
|
+
customFonts: r
|
|
24
44
|
},
|
|
25
45
|
async onTokenRefreshRequest(o) {
|
|
26
46
|
try {
|
|
27
|
-
const
|
|
28
|
-
o(
|
|
29
|
-
} catch (
|
|
30
|
-
d
|
|
47
|
+
const d = await l();
|
|
48
|
+
o(d);
|
|
49
|
+
} catch (d) {
|
|
50
|
+
i(d, "Failed to refresh token");
|
|
31
51
|
}
|
|
32
52
|
},
|
|
33
53
|
onTemplateLoaded() {
|
|
34
54
|
try {
|
|
35
|
-
const { importCss: o } =
|
|
55
|
+
const { importCss: o } = g();
|
|
36
56
|
o();
|
|
37
57
|
} catch (o) {
|
|
38
|
-
|
|
58
|
+
i(o, "Failed to load custom interface appearance");
|
|
39
59
|
}
|
|
40
60
|
},
|
|
41
61
|
onCodeEditorVisibilityChanged(o) {
|
|
42
|
-
|
|
62
|
+
n.isCodeEditorOpen = o;
|
|
43
63
|
},
|
|
44
64
|
onEditorVisualModeChanged(o) {
|
|
45
|
-
|
|
65
|
+
n.editorVisualMode = o.toLowerCase();
|
|
46
66
|
},
|
|
47
67
|
onVersionHistoryVisibilityChanged(o) {
|
|
48
|
-
|
|
68
|
+
n.isVersionHistoryOpen = o;
|
|
49
69
|
}
|
|
50
70
|
}
|
|
51
71
|
);
|
|
52
|
-
},
|
|
72
|
+
}, f = (t) => new Promise((r, n) => {
|
|
53
73
|
if (document.getElementById("UiEditorScript")) {
|
|
54
|
-
|
|
74
|
+
t(), r();
|
|
55
75
|
return;
|
|
56
76
|
}
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
},
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
}, document.body.appendChild(
|
|
77
|
+
const e = document.createElement("script");
|
|
78
|
+
e.id = "UiEditorScript", e.type = "module", e.src = "https://plugins.stripo.email/resources/uieditor/latest/UIEditor.js", e.onload = () => {
|
|
79
|
+
t(), r();
|
|
80
|
+
}, e.onerror = () => {
|
|
81
|
+
const s = new Error("Failed to load Stripo UIEditor script");
|
|
82
|
+
n(s);
|
|
83
|
+
}, document.body.appendChild(e);
|
|
64
84
|
});
|
|
65
|
-
return { initPlugin: async (
|
|
66
|
-
await
|
|
67
|
-
const
|
|
68
|
-
|
|
85
|
+
return { initPlugin: async (t) => {
|
|
86
|
+
await f(async () => {
|
|
87
|
+
const r = await p();
|
|
88
|
+
m(t, r);
|
|
69
89
|
});
|
|
70
90
|
} };
|
|
71
91
|
};
|
|
72
92
|
export {
|
|
73
|
-
|
|
93
|
+
k as useStripo
|
|
74
94
|
};
|
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
import { hasInjectionContext as ut } from "../node_modules/vue-demi/lib/index.js";
|
|
2
|
+
import { inject as at, getCurrentInstance as it, set as O, ref as K, reactive as ft, markRaw as j, effectScope as _t, isRef as x, isReactive as J, toRef as T, del as A, nextTick as B, computed as tt, getCurrentScope as lt, onScopeDispose as Et, watch as pt, toRefs as Q } from "vue";
|
|
3
|
+
/*!
|
|
4
|
+
* pinia v2.3.1
|
|
5
|
+
* (c) 2025 Eduardo San Martin Morote
|
|
6
|
+
* @license MIT
|
|
7
|
+
*/
|
|
8
|
+
let R;
|
|
9
|
+
const L = (t) => R = t, dt = process.env.NODE_ENV !== "production" ? Symbol("pinia") : (
|
|
10
|
+
/* istanbul ignore next */
|
|
11
|
+
Symbol()
|
|
12
|
+
);
|
|
13
|
+
function V(t) {
|
|
14
|
+
return t && typeof t == "object" && Object.prototype.toString.call(t) === "[object Object]" && typeof t.toJSON != "function";
|
|
15
|
+
}
|
|
16
|
+
var w;
|
|
17
|
+
(function(t) {
|
|
18
|
+
t.direct = "direct", t.patchObject = "patch object", t.patchFunction = "patch function";
|
|
19
|
+
})(w || (w = {}));
|
|
20
|
+
const C = typeof window < "u";
|
|
21
|
+
function et(t, u) {
|
|
22
|
+
for (const r in u) {
|
|
23
|
+
const o = u[r];
|
|
24
|
+
if (!(r in t))
|
|
25
|
+
continue;
|
|
26
|
+
const c = t[r];
|
|
27
|
+
V(c) && V(o) && !x(o) && !J(o) ? t[r] = et(c, o) : O(t, r, o);
|
|
28
|
+
}
|
|
29
|
+
return t;
|
|
30
|
+
}
|
|
31
|
+
const ot = () => {
|
|
32
|
+
};
|
|
33
|
+
function X(t, u, r, o = ot) {
|
|
34
|
+
t.push(u);
|
|
35
|
+
const c = () => {
|
|
36
|
+
const f = t.indexOf(u);
|
|
37
|
+
f > -1 && (t.splice(f, 1), o());
|
|
38
|
+
};
|
|
39
|
+
return !r && lt() && Et(c), c;
|
|
40
|
+
}
|
|
41
|
+
function g(t, ...u) {
|
|
42
|
+
t.slice().forEach((r) => {
|
|
43
|
+
r(...u);
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
const ht = (t) => t(), Y = Symbol(), W = Symbol();
|
|
47
|
+
function H(t, u) {
|
|
48
|
+
t instanceof Map && u instanceof Map ? u.forEach((r, o) => t.set(o, r)) : t instanceof Set && u instanceof Set && u.forEach(t.add, t);
|
|
49
|
+
for (const r in u) {
|
|
50
|
+
if (!u.hasOwnProperty(r))
|
|
51
|
+
continue;
|
|
52
|
+
const o = u[r], c = t[r];
|
|
53
|
+
V(c) && V(o) && t.hasOwnProperty(r) && !x(o) && !J(o) ? t[r] = H(c, o) : t[r] = o;
|
|
54
|
+
}
|
|
55
|
+
return t;
|
|
56
|
+
}
|
|
57
|
+
const Nt = process.env.NODE_ENV !== "production" ? Symbol("pinia:skipHydration") : (
|
|
58
|
+
/* istanbul ignore next */
|
|
59
|
+
Symbol()
|
|
60
|
+
);
|
|
61
|
+
function vt(t) {
|
|
62
|
+
return !V(t) || !t.hasOwnProperty(Nt);
|
|
63
|
+
}
|
|
64
|
+
const { assign: y } = Object;
|
|
65
|
+
function Z(t) {
|
|
66
|
+
return !!(x(t) && t.effect);
|
|
67
|
+
}
|
|
68
|
+
function G(t, u, r, o) {
|
|
69
|
+
const { state: c, actions: f, getters: E } = u, i = r.state.value[t];
|
|
70
|
+
let b;
|
|
71
|
+
function N() {
|
|
72
|
+
!i && (process.env.NODE_ENV === "production" || !o) && O(r.state.value, t, c ? c() : {});
|
|
73
|
+
const p = process.env.NODE_ENV !== "production" && o ? (
|
|
74
|
+
// use ref() to unwrap refs inside state TODO: check if this is still necessary
|
|
75
|
+
Q(K(c ? c() : {}).value)
|
|
76
|
+
) : Q(r.state.value[t]);
|
|
77
|
+
return y(p, f, Object.keys(E || {}).reduce((_, l) => (process.env.NODE_ENV !== "production" && l in p && console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with "${l}" in store "${t}".`), _[l] = j(tt(() => {
|
|
78
|
+
L(r);
|
|
79
|
+
const v = r._s.get(t);
|
|
80
|
+
if (v._r)
|
|
81
|
+
return E[l].call(v, v);
|
|
82
|
+
})), _), {}));
|
|
83
|
+
}
|
|
84
|
+
return b = M(t, N, u, r, o, !0), b;
|
|
85
|
+
}
|
|
86
|
+
function M(t, u, r = {}, o, c, f) {
|
|
87
|
+
let E;
|
|
88
|
+
const i = y({ actions: {} }, r);
|
|
89
|
+
if (process.env.NODE_ENV !== "production" && !o._e.active)
|
|
90
|
+
throw new Error("Pinia destroyed");
|
|
91
|
+
const b = { deep: !0 };
|
|
92
|
+
process.env.NODE_ENV;
|
|
93
|
+
let N, p, _ = [], l = [], v;
|
|
94
|
+
const D = o.state.value[t];
|
|
95
|
+
!f && !D && (process.env.NODE_ENV === "production" || !c) && O(o.state.value, t, {});
|
|
96
|
+
const $ = K({});
|
|
97
|
+
let q;
|
|
98
|
+
function z(s) {
|
|
99
|
+
let e;
|
|
100
|
+
N = p = !1, process.env.NODE_ENV !== "production" && (v = []), typeof s == "function" ? (s(o.state.value[t]), e = {
|
|
101
|
+
type: w.patchFunction,
|
|
102
|
+
storeId: t,
|
|
103
|
+
events: v
|
|
104
|
+
}) : (H(o.state.value[t], s), e = {
|
|
105
|
+
type: w.patchObject,
|
|
106
|
+
payload: s,
|
|
107
|
+
storeId: t,
|
|
108
|
+
events: v
|
|
109
|
+
});
|
|
110
|
+
const a = q = Symbol();
|
|
111
|
+
B().then(() => {
|
|
112
|
+
q === a && (N = !0);
|
|
113
|
+
}), p = !0, g(_, e, o.state.value[t]);
|
|
114
|
+
}
|
|
115
|
+
const st = f ? function() {
|
|
116
|
+
const { state: e } = r, a = e ? e() : {};
|
|
117
|
+
this.$patch((d) => {
|
|
118
|
+
y(d, a);
|
|
119
|
+
});
|
|
120
|
+
} : (
|
|
121
|
+
/* istanbul ignore next */
|
|
122
|
+
process.env.NODE_ENV !== "production" ? () => {
|
|
123
|
+
throw new Error(`🍍: Store "${t}" is built using the setup syntax and does not implement $reset().`);
|
|
124
|
+
} : ot
|
|
125
|
+
);
|
|
126
|
+
function nt() {
|
|
127
|
+
E.stop(), _ = [], l = [], o._s.delete(t);
|
|
128
|
+
}
|
|
129
|
+
const k = (s, e = "") => {
|
|
130
|
+
if (Y in s)
|
|
131
|
+
return s[W] = e, s;
|
|
132
|
+
const a = function() {
|
|
133
|
+
L(o);
|
|
134
|
+
const d = Array.from(arguments), P = [], F = [];
|
|
135
|
+
function rt(h) {
|
|
136
|
+
P.push(h);
|
|
137
|
+
}
|
|
138
|
+
function ct(h) {
|
|
139
|
+
F.push(h);
|
|
140
|
+
}
|
|
141
|
+
g(l, {
|
|
142
|
+
args: d,
|
|
143
|
+
name: a[W],
|
|
144
|
+
store: n,
|
|
145
|
+
after: rt,
|
|
146
|
+
onError: ct
|
|
147
|
+
});
|
|
148
|
+
let S;
|
|
149
|
+
try {
|
|
150
|
+
S = s.apply(this && this.$id === t ? this : n, d);
|
|
151
|
+
} catch (h) {
|
|
152
|
+
throw g(F, h), h;
|
|
153
|
+
}
|
|
154
|
+
return S instanceof Promise ? S.then((h) => (g(P, h), h)).catch((h) => (g(F, h), Promise.reject(h))) : (g(P, S), S);
|
|
155
|
+
};
|
|
156
|
+
return a[Y] = !0, a[W] = e, a;
|
|
157
|
+
}, I = /* @__PURE__ */ j({
|
|
158
|
+
actions: {},
|
|
159
|
+
getters: {},
|
|
160
|
+
state: [],
|
|
161
|
+
hotState: $
|
|
162
|
+
}), U = {
|
|
163
|
+
_p: o,
|
|
164
|
+
// _s: scope,
|
|
165
|
+
$id: t,
|
|
166
|
+
$onAction: X.bind(null, l),
|
|
167
|
+
$patch: z,
|
|
168
|
+
$reset: st,
|
|
169
|
+
$subscribe(s, e = {}) {
|
|
170
|
+
const a = X(_, s, e.detached, () => d()), d = E.run(() => pt(() => o.state.value[t], (P) => {
|
|
171
|
+
(e.flush === "sync" ? p : N) && s({
|
|
172
|
+
storeId: t,
|
|
173
|
+
type: w.direct,
|
|
174
|
+
events: v
|
|
175
|
+
}, P);
|
|
176
|
+
}, y({}, b, e)));
|
|
177
|
+
return a;
|
|
178
|
+
},
|
|
179
|
+
$dispose: nt
|
|
180
|
+
};
|
|
181
|
+
U._r = !1;
|
|
182
|
+
const n = ft(process.env.NODE_ENV !== "production" || (process.env.NODE_ENV !== "production" || typeof __VUE_PROD_DEVTOOLS__ < "u" && __VUE_PROD_DEVTOOLS__) && process.env.NODE_ENV !== "test" && C ? y(
|
|
183
|
+
{
|
|
184
|
+
_hmrPayload: I,
|
|
185
|
+
_customProperties: j(/* @__PURE__ */ new Set())
|
|
186
|
+
// devtools custom properties
|
|
187
|
+
},
|
|
188
|
+
U
|
|
189
|
+
// must be added later
|
|
190
|
+
// setupStore
|
|
191
|
+
) : U);
|
|
192
|
+
o._s.set(t, n);
|
|
193
|
+
const m = (o._a && o._a.runWithContext || ht)(() => o._e.run(() => (E = _t()).run(() => u({ action: k }))));
|
|
194
|
+
for (const s in m) {
|
|
195
|
+
const e = m[s];
|
|
196
|
+
if (x(e) && !Z(e) || J(e))
|
|
197
|
+
process.env.NODE_ENV !== "production" && c ? O($.value, s, T(m, s)) : f || (D && vt(e) && (x(e) ? e.value = D[s] : H(e, D[s])), O(o.state.value[t], s, e)), process.env.NODE_ENV !== "production" && I.state.push(s);
|
|
198
|
+
else if (typeof e == "function") {
|
|
199
|
+
const a = process.env.NODE_ENV !== "production" && c ? e : k(e, s);
|
|
200
|
+
O(m, s, a), process.env.NODE_ENV !== "production" && (I.actions[s] = e), i.actions[s] = e;
|
|
201
|
+
} else process.env.NODE_ENV !== "production" && Z(e) && (I.getters[s] = f ? (
|
|
202
|
+
// @ts-expect-error
|
|
203
|
+
r.getters[s]
|
|
204
|
+
) : e, C && (m._getters || // @ts-expect-error: same
|
|
205
|
+
(m._getters = j([]))).push(s));
|
|
206
|
+
}
|
|
207
|
+
if (Object.keys(m).forEach((s) => {
|
|
208
|
+
O(n, s, m[s]);
|
|
209
|
+
}), Object.defineProperty(n, "$state", {
|
|
210
|
+
get: () => process.env.NODE_ENV !== "production" && c ? $.value : o.state.value[t],
|
|
211
|
+
set: (s) => {
|
|
212
|
+
if (process.env.NODE_ENV !== "production" && c)
|
|
213
|
+
throw new Error("cannot set hotState");
|
|
214
|
+
z((e) => {
|
|
215
|
+
y(e, s);
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
}), process.env.NODE_ENV !== "production" && (n._hotUpdate = j((s) => {
|
|
219
|
+
n._hotUpdating = !0, s._hmrPayload.state.forEach((e) => {
|
|
220
|
+
if (e in n.$state) {
|
|
221
|
+
const a = s.$state[e], d = n.$state[e];
|
|
222
|
+
typeof a == "object" && V(a) && V(d) ? et(a, d) : s.$state[e] = d;
|
|
223
|
+
}
|
|
224
|
+
O(n, e, T(s.$state, e));
|
|
225
|
+
}), Object.keys(n.$state).forEach((e) => {
|
|
226
|
+
e in s.$state || A(n, e);
|
|
227
|
+
}), N = !1, p = !1, o.state.value[t] = T(s._hmrPayload, "hotState"), p = !0, B().then(() => {
|
|
228
|
+
N = !0;
|
|
229
|
+
});
|
|
230
|
+
for (const e in s._hmrPayload.actions) {
|
|
231
|
+
const a = s[e];
|
|
232
|
+
O(n, e, k(a, e));
|
|
233
|
+
}
|
|
234
|
+
for (const e in s._hmrPayload.getters) {
|
|
235
|
+
const a = s._hmrPayload.getters[e], d = f ? (
|
|
236
|
+
// special handling of options api
|
|
237
|
+
tt(() => (L(o), a.call(n, n)))
|
|
238
|
+
) : a;
|
|
239
|
+
O(n, e, d);
|
|
240
|
+
}
|
|
241
|
+
Object.keys(n._hmrPayload.getters).forEach((e) => {
|
|
242
|
+
e in s._hmrPayload.getters || A(n, e);
|
|
243
|
+
}), Object.keys(n._hmrPayload.actions).forEach((e) => {
|
|
244
|
+
e in s._hmrPayload.actions || A(n, e);
|
|
245
|
+
}), n._hmrPayload = s._hmrPayload, n._getters = s._getters, n._hotUpdating = !1;
|
|
246
|
+
})), (process.env.NODE_ENV !== "production" || typeof __VUE_PROD_DEVTOOLS__ < "u" && __VUE_PROD_DEVTOOLS__) && process.env.NODE_ENV !== "test" && C) {
|
|
247
|
+
const s = {
|
|
248
|
+
writable: !0,
|
|
249
|
+
configurable: !0,
|
|
250
|
+
// avoid warning on devtools trying to display this property
|
|
251
|
+
enumerable: !1
|
|
252
|
+
};
|
|
253
|
+
["_p", "_hmrPayload", "_getters", "_customProperties"].forEach((e) => {
|
|
254
|
+
Object.defineProperty(n, e, y({ value: n[e] }, s));
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
return n._r = !0, o._p.forEach((s) => {
|
|
258
|
+
if ((process.env.NODE_ENV !== "production" || typeof __VUE_PROD_DEVTOOLS__ < "u" && __VUE_PROD_DEVTOOLS__) && process.env.NODE_ENV !== "test" && C) {
|
|
259
|
+
const e = E.run(() => s({
|
|
260
|
+
store: n,
|
|
261
|
+
app: o._a,
|
|
262
|
+
pinia: o,
|
|
263
|
+
options: i
|
|
264
|
+
}));
|
|
265
|
+
Object.keys(e || {}).forEach((a) => n._customProperties.add(a)), y(n, e);
|
|
266
|
+
} else
|
|
267
|
+
y(n, E.run(() => s({
|
|
268
|
+
store: n,
|
|
269
|
+
app: o._a,
|
|
270
|
+
pinia: o,
|
|
271
|
+
options: i
|
|
272
|
+
})));
|
|
273
|
+
}), process.env.NODE_ENV !== "production" && n.$state && typeof n.$state == "object" && typeof n.$state.constructor == "function" && !n.$state.constructor.toString().includes("[native code]") && console.warn(`[🍍]: The "state" must be a plain object. It cannot be
|
|
274
|
+
state: () => new MyClass()
|
|
275
|
+
Found in store "${n.$id}".`), D && f && r.hydrate && r.hydrate(n.$state, D), N = !0, p = !0, n;
|
|
276
|
+
}
|
|
277
|
+
/*! #__NO_SIDE_EFFECTS__ */
|
|
278
|
+
// @__NO_SIDE_EFFECTS__
|
|
279
|
+
function mt(t, u, r) {
|
|
280
|
+
let o, c;
|
|
281
|
+
const f = typeof u == "function";
|
|
282
|
+
if (typeof t == "string")
|
|
283
|
+
o = t, c = f ? r : u;
|
|
284
|
+
else if (c = t, o = t.id, process.env.NODE_ENV !== "production" && typeof o != "string")
|
|
285
|
+
throw new Error('[🍍]: "defineStore()" must be passed a store id as its first argument.');
|
|
286
|
+
function E(i, b) {
|
|
287
|
+
const N = ut();
|
|
288
|
+
if (i = // in test mode, ignore the argument provided as we can always retrieve a
|
|
289
|
+
// pinia instance with getActivePinia()
|
|
290
|
+
(process.env.NODE_ENV === "test" && R && R._testing ? null : i) || (N ? at(dt, null) : null), i && L(i), process.env.NODE_ENV !== "production" && !R)
|
|
291
|
+
throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?
|
|
292
|
+
See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.
|
|
293
|
+
This will fail in production.`);
|
|
294
|
+
i = R, i._s.has(o) || (f ? M(o, u, c, i) : G(o, c, i), process.env.NODE_ENV !== "production" && (E._pinia = i));
|
|
295
|
+
const p = i._s.get(o);
|
|
296
|
+
if (process.env.NODE_ENV !== "production" && b) {
|
|
297
|
+
const _ = "__hot:" + o, l = f ? M(_, u, c, i, !0) : G(_, y({}, c), i, !0);
|
|
298
|
+
b._hotUpdate(l), delete i.state.value[_], i._s.delete(_);
|
|
299
|
+
}
|
|
300
|
+
if (process.env.NODE_ENV !== "production" && C) {
|
|
301
|
+
const _ = it();
|
|
302
|
+
if (_ && _.proxy && // avoid adding stores that are just built for hot module replacement
|
|
303
|
+
!b) {
|
|
304
|
+
const l = _.proxy, v = "_pStores" in l ? l._pStores : l._pStores = {};
|
|
305
|
+
v[o] = p;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
return p;
|
|
309
|
+
}
|
|
310
|
+
return E.$id = o, E;
|
|
311
|
+
}
|
|
312
|
+
export {
|
|
313
|
+
w as MutationType,
|
|
314
|
+
mt as defineStore,
|
|
315
|
+
L as setActivePinia,
|
|
316
|
+
vt as shouldHydrate
|
|
317
|
+
};
|
package/dist/stores/editor.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.f5fd3cf",
|
|
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",
|
package/dist/@types/http.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
2
|
-
export interface HttpOptions extends Omit<RequestInit, 'method' | 'body'> {
|
|
3
|
-
baseURL?: string;
|
|
4
|
-
timeout?: number;
|
|
5
|
-
retry?: number;
|
|
6
|
-
retryDelay?: number;
|
|
7
|
-
}
|
|
8
|
-
export interface HttpResponse<T = unknown> {
|
|
9
|
-
data: T;
|
|
10
|
-
status: number;
|
|
11
|
-
statusText: string;
|
|
12
|
-
headers: Headers;
|
|
13
|
-
}
|
|
14
|
-
export interface HttpError {
|
|
15
|
-
message: string;
|
|
16
|
-
status?: number;
|
|
17
|
-
statusText?: string;
|
|
18
|
-
response?: Response;
|
|
19
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { useHttp as s } from "../composables/useHttp.js";
|
|
2
|
-
import { useToaster as n } from "../composables/useToaster.js";
|
|
3
|
-
const m = () => {
|
|
4
|
-
const { get: o } = s(), { handleError: r } = n();
|
|
5
|
-
return {
|
|
6
|
-
getToken: async () => {
|
|
7
|
-
try {
|
|
8
|
-
const t = Number(localStorage.getItem("ins-guido-test-instance")), { data: e } = await o(`/stripo/get-user-token?test=${t}`);
|
|
9
|
-
return e.body.token;
|
|
10
|
-
} catch (t) {
|
|
11
|
-
return r(t, "Failed to fetch token"), "";
|
|
12
|
-
}
|
|
13
|
-
},
|
|
14
|
-
getCustomFonts: async () => {
|
|
15
|
-
try {
|
|
16
|
-
const { data: t = [] } = await o("/stripo/get-partner-custom-fonts");
|
|
17
|
-
return t.map((e) => ({
|
|
18
|
-
...e,
|
|
19
|
-
active: !0
|
|
20
|
-
}));
|
|
21
|
-
} catch (t) {
|
|
22
|
-
return r(t, "Failed to fetch custom fonts"), [];
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
export {
|
|
28
|
-
m as useStripoApi
|
|
29
|
-
};
|