@vuetify/one 0.1.0 → 0.1.2
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/index.d.ts +636 -0
- package/dist/index.js +486 -0
- package/dist/style.css +1 -1
- package/package.json +28 -17
- package/dist/v-one.js +0 -5935
- package/dist/v-one.umd.cjs +0 -2
- package/index.d.ts +0 -8
package/dist/index.js
ADDED
|
@@ -0,0 +1,486 @@
|
|
|
1
|
+
import { reactive as Y, toRefs as Z, ref as K, shallowRef as E, computed as j, watch as N, defineComponent as L, openBlock as m, createBlock as g, unref as a, withCtx as d, createVNode as u, createTextVNode as w, toDisplayString as x, createCommentVNode as Q, mergeProps as ee, createElementVNode as b, createElementBlock as te, Fragment as oe, renderList as ie, pushScopeId as se, popScopeId as ne, onBeforeMount as re } from "vue";
|
|
2
|
+
import { defineStore as O } from "pinia";
|
|
3
|
+
import { merge as I } from "lodash-es";
|
|
4
|
+
import { mdiDiscord as H, mdiGithub as B, mdiViewDashboard as ae, mdiLogoutVariant as le, mdiLogin as ce, mdiShieldStarOutline as ue, mdiReddit as de } from "@mdi/js";
|
|
5
|
+
import { VListItem as F, VList as G, VListSubheader as fe } from "vuetify/lib/components/VList/index.mjs";
|
|
6
|
+
import { VAvatar as pe } from "vuetify/lib/components/VAvatar/index.mjs";
|
|
7
|
+
import { VBtn as M } from "vuetify/lib/components/VBtn/index.mjs";
|
|
8
|
+
import { VMenu as me } from "vuetify/lib/components/VMenu/index.mjs";
|
|
9
|
+
import { VSkeletonLoader as he } from "vuetify/lib/components/VSkeletonLoader/index.mjs";
|
|
10
|
+
import { useDisplay as ve, useTheme as ge } from "vuetify";
|
|
11
|
+
import { VCard as ye, VCardTitle as _e, VCardSubtitle as be } from "vuetify/lib/components/VCard/index.mjs";
|
|
12
|
+
import { VDialog as we } from "vuetify/lib/components/VDialog/index.mjs";
|
|
13
|
+
import { VImg as J } from "vuetify/lib/components/VImg/index.mjs";
|
|
14
|
+
import { VFooter as Le } from "vuetify/lib/components/VFooter/index.mjs";
|
|
15
|
+
import { VIcon as Ve } from "vuetify/lib/components/VIcon/index.mjs";
|
|
16
|
+
const A = typeof window < "u", U = {
|
|
17
|
+
v: 4,
|
|
18
|
+
api: "link-only",
|
|
19
|
+
avatar: "",
|
|
20
|
+
dev: !1,
|
|
21
|
+
disableAds: !1,
|
|
22
|
+
composition: "options",
|
|
23
|
+
pwaRefresh: !0,
|
|
24
|
+
theme: "system",
|
|
25
|
+
mixedTheme: !0,
|
|
26
|
+
direction: "ltr",
|
|
27
|
+
slashSearch: !1,
|
|
28
|
+
syncSettings: !0,
|
|
29
|
+
quickbar: !1,
|
|
30
|
+
railDrawer: !1,
|
|
31
|
+
notifications: {
|
|
32
|
+
show: !0,
|
|
33
|
+
read: [],
|
|
34
|
+
last: {
|
|
35
|
+
banner: [],
|
|
36
|
+
v2banner: null,
|
|
37
|
+
install: null,
|
|
38
|
+
notification: null,
|
|
39
|
+
promotion: null,
|
|
40
|
+
jobs: null
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}, W = O("user", () => {
|
|
44
|
+
const i = Y(I({}, U));
|
|
45
|
+
function t() {
|
|
46
|
+
if (!A)
|
|
47
|
+
return;
|
|
48
|
+
const r = localStorage.getItem("vuetify@user"), e = r ? JSON.parse(r) : {}, c = e.v === i.v;
|
|
49
|
+
e.v || (e.pwaRefresh = !0, typeof e.api == "boolean" && (e.api = e.api ? "inline" : "link-only"), typeof e.rtl == "boolean" && (e.direction = e.rtl ? "rtl" : "ltr", delete e.rtl), typeof e.theme == "object" && (e.mixedTheme = e.theme.mixed, e.theme = e.theme.system ? "system" : e.theme.dark ? "dark" : "light"), Array.isArray(e.notifications) && (e.notifications = { read: e.notifications }), typeof e.last == "object" && (e.notifications.last = e.last, delete e.last)), e.v === 1 && (Array.isArray(e.composition) && (e.composition = "composition"), Array.isArray(e.notifications.last.banner) || (e.notifications = e.notifications || {}, e.notifications.last = e.notifications.last || {}, e.notifications.last.banner = [])), e.v === 2 && (e.syncSettings = !0, e.disableAds = !1, e.v = 3), e.v === 3 && (e.quickbar = !1), e.v = i.v, Object.assign(i, I(i, e)), c && s();
|
|
50
|
+
}
|
|
51
|
+
function s() {
|
|
52
|
+
A && localStorage.setItem("vuetify@user", JSON.stringify(i, null, 2));
|
|
53
|
+
}
|
|
54
|
+
function n() {
|
|
55
|
+
A && (Object.assign(i, I({}, U)), s());
|
|
56
|
+
}
|
|
57
|
+
return t(), {
|
|
58
|
+
...Z(i),
|
|
59
|
+
load: t,
|
|
60
|
+
save: s,
|
|
61
|
+
reset: n
|
|
62
|
+
};
|
|
63
|
+
}), v = {}.VITE_API_SERVER_URL, V = O("auth", () => {
|
|
64
|
+
const i = K(null), t = W(), s = E(!1), n = j(() => {
|
|
65
|
+
var o, l;
|
|
66
|
+
return !v || ((o = i.value) == null ? void 0 : o.isAdmin) || ((l = i.value) == null ? void 0 : l.sponsorships.some((f) => f.isActive));
|
|
67
|
+
});
|
|
68
|
+
let r = !1;
|
|
69
|
+
N(i, (o) => {
|
|
70
|
+
if (!(o != null && o.settings))
|
|
71
|
+
return;
|
|
72
|
+
const l = localStorage.getItem("vuetify@user") || "{}";
|
|
73
|
+
JSON.stringify(o.settings, null, 2) !== l && (r = !0, Object.assign(t, o.settings));
|
|
74
|
+
}), t.$subscribe(() => {
|
|
75
|
+
r || e(), r = !1;
|
|
76
|
+
});
|
|
77
|
+
async function e() {
|
|
78
|
+
try {
|
|
79
|
+
await fetch(`${v}/user/settings`, {
|
|
80
|
+
method: "POST",
|
|
81
|
+
credentials: "include",
|
|
82
|
+
headers: {
|
|
83
|
+
"Content-Type": "application/json"
|
|
84
|
+
},
|
|
85
|
+
body: JSON.stringify({
|
|
86
|
+
settings: t.$state
|
|
87
|
+
})
|
|
88
|
+
});
|
|
89
|
+
} catch (o) {
|
|
90
|
+
console.error(o);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
async function c(o = !1) {
|
|
94
|
+
if (c.promise)
|
|
95
|
+
return c.promise;
|
|
96
|
+
s.value = !0, c.promise = fetch(`${v}/auth/verify`, {
|
|
97
|
+
credentials: "include",
|
|
98
|
+
headers: o ? {
|
|
99
|
+
"Cache-Control": "no-cache"
|
|
100
|
+
} : void 0
|
|
101
|
+
}).then(
|
|
102
|
+
async (l) => {
|
|
103
|
+
l.ok ? i.value = (await l.json()).user : l.status === 401 ? i.value = null : console.error(l.statusText);
|
|
104
|
+
},
|
|
105
|
+
() => {
|
|
106
|
+
}
|
|
107
|
+
).finally(() => {
|
|
108
|
+
s.value = !1, c.promise = null;
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
c.promise = null;
|
|
112
|
+
async function h(o = "github") {
|
|
113
|
+
s.value = !0;
|
|
114
|
+
const l = `${v}/auth/${o}/redirect`, f = 400, D = 600, z = window.screenX + (window.innerWidth - f) / 2, X = window.screenY + (window.innerHeight - D) / 2, p = window.open(
|
|
115
|
+
"",
|
|
116
|
+
"vuetify:authorize:popup",
|
|
117
|
+
`popup,left=${z},top=${X},width=${f},height=${D},resizable`
|
|
118
|
+
);
|
|
119
|
+
if (!p) {
|
|
120
|
+
console.error("Failed to open popup");
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
p.location.href = l;
|
|
124
|
+
let T = -1, R = -1;
|
|
125
|
+
function C(_) {
|
|
126
|
+
var P;
|
|
127
|
+
_.origin === v && ((P = _.data) == null ? void 0 : P.type) === "auth-response" && (_.data.status === "success" ? (i.value || localStorage.setItem("vuetify@lastLoginProvider", o), i.value = _.data.body.user) : console.error(_.data.message), k());
|
|
128
|
+
}
|
|
129
|
+
function k() {
|
|
130
|
+
window.removeEventListener("message", C), window.clearInterval(T), window.clearTimeout(R), p == null || p.close(), s.value = !1;
|
|
131
|
+
}
|
|
132
|
+
window.addEventListener("message", C), T = window.setInterval(() => {
|
|
133
|
+
!p || p.closed ? (console.error("Auth popup closed"), k()) : p.postMessage({ type: "auth-request" }, "*");
|
|
134
|
+
}, 1e3), R = window.setTimeout(() => {
|
|
135
|
+
k(), console.error("Auth timed out");
|
|
136
|
+
}, 120 * 1e3);
|
|
137
|
+
}
|
|
138
|
+
async function $() {
|
|
139
|
+
s.value = !0;
|
|
140
|
+
try {
|
|
141
|
+
await fetch(`${v}/auth/logout`, {
|
|
142
|
+
method: "POST",
|
|
143
|
+
credentials: "include"
|
|
144
|
+
}), await c(!0), i.value = null;
|
|
145
|
+
} catch (o) {
|
|
146
|
+
console.error(o);
|
|
147
|
+
} finally {
|
|
148
|
+
s.value = !1;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
function y() {
|
|
152
|
+
return localStorage.getItem("vuetify@lastLoginProvider");
|
|
153
|
+
}
|
|
154
|
+
return y() && c(), {
|
|
155
|
+
user: i,
|
|
156
|
+
url: v,
|
|
157
|
+
isLoading: s,
|
|
158
|
+
verify: c,
|
|
159
|
+
login: h,
|
|
160
|
+
logout: $,
|
|
161
|
+
isSubscriber: n,
|
|
162
|
+
lastLoginProvider: y
|
|
163
|
+
};
|
|
164
|
+
}), Se = /* @__PURE__ */ L({
|
|
165
|
+
__name: "VoDiscordLogin",
|
|
166
|
+
setup(i) {
|
|
167
|
+
const t = V();
|
|
168
|
+
return (s, n) => (m(), g(F, {
|
|
169
|
+
"prepend-icon": `svg:${a(H)}`,
|
|
170
|
+
title: a(t).user ? "Connect Discord" : "Log in with Discord",
|
|
171
|
+
subtitle: !a(t).user && a(t).lastLoginProvider() === "discord" ? "Last Used" : "",
|
|
172
|
+
nav: "",
|
|
173
|
+
"base-color": "#5865F2",
|
|
174
|
+
slim: "",
|
|
175
|
+
variant: "flat",
|
|
176
|
+
onClick: n[0] || (n[0] = (r) => a(t).login("discord"))
|
|
177
|
+
}, null, 8, ["prepend-icon", "title", "subtitle"]));
|
|
178
|
+
}
|
|
179
|
+
}), xe = /* @__PURE__ */ L({
|
|
180
|
+
__name: "VoGithubLogin",
|
|
181
|
+
setup(i) {
|
|
182
|
+
const t = V();
|
|
183
|
+
return (s, n) => (m(), g(F, {
|
|
184
|
+
"prepend-icon": `svg:${a(B)}`,
|
|
185
|
+
title: a(t).user ? "Connect GitHub" : "Log in with GitHub",
|
|
186
|
+
subtitle: !a(t).user && a(t).lastLoginProvider() === "github" ? "Last Used" : "",
|
|
187
|
+
"base-color": "#2a2a2a",
|
|
188
|
+
nav: "",
|
|
189
|
+
slim: "",
|
|
190
|
+
variant: "flat",
|
|
191
|
+
onClick: n[0] || (n[0] = (r) => a(t).login("github"))
|
|
192
|
+
}, null, 8, ["prepend-icon", "title", "subtitle"]));
|
|
193
|
+
}
|
|
194
|
+
}), $e = /* @__PURE__ */ L({
|
|
195
|
+
__name: "VoUserBtn",
|
|
196
|
+
props: {
|
|
197
|
+
external: Boolean
|
|
198
|
+
},
|
|
199
|
+
setup(i) {
|
|
200
|
+
const t = i, s = V(), n = W(), r = [
|
|
201
|
+
{ title: "Options", type: "subheader" },
|
|
202
|
+
{
|
|
203
|
+
title: "My Dashboard",
|
|
204
|
+
appendIcon: `svg:${ae}`,
|
|
205
|
+
to: t.external ? void 0 : "/user/dashboard",
|
|
206
|
+
href: t.external ? "https://vuetifyjs.com/user/dashboard/" : void 0,
|
|
207
|
+
target: t.external ? "_blank" : void 0
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
title: "Logout",
|
|
211
|
+
appendIcon: `svg:${le}`,
|
|
212
|
+
onClick: () => {
|
|
213
|
+
s.logout();
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
];
|
|
217
|
+
return (e, c) => (m(), g(M, {
|
|
218
|
+
class: "vo-user-btn",
|
|
219
|
+
loading: a(s).isLoading,
|
|
220
|
+
icon: ""
|
|
221
|
+
}, {
|
|
222
|
+
loader: d(() => [
|
|
223
|
+
u(he, { type: "avatar" })
|
|
224
|
+
]),
|
|
225
|
+
default: d(() => [
|
|
226
|
+
u(me, {
|
|
227
|
+
disabled: !a(s).user || a(s).isLoading,
|
|
228
|
+
activator: "parent",
|
|
229
|
+
location: "bottom end"
|
|
230
|
+
}, {
|
|
231
|
+
default: d(() => [
|
|
232
|
+
u(G, {
|
|
233
|
+
items: r,
|
|
234
|
+
lines: !1,
|
|
235
|
+
density: "compact",
|
|
236
|
+
"item-props": "",
|
|
237
|
+
nav: ""
|
|
238
|
+
}, {
|
|
239
|
+
subheader: d(({ props: h }) => [
|
|
240
|
+
u(fe, { class: "text-high-emphasis text-uppercase font-weight-black" }, {
|
|
241
|
+
default: d(() => [
|
|
242
|
+
w(x(h.title), 1)
|
|
243
|
+
]),
|
|
244
|
+
_: 2
|
|
245
|
+
}, 1024)
|
|
246
|
+
]),
|
|
247
|
+
_: 1
|
|
248
|
+
})
|
|
249
|
+
]),
|
|
250
|
+
_: 1
|
|
251
|
+
}, 8, ["disabled"]),
|
|
252
|
+
a(s).user ? (m(), g(pe, {
|
|
253
|
+
key: 0,
|
|
254
|
+
image: a(n).avatar || a(s).user.picture || ""
|
|
255
|
+
}, null, 8, ["image"])) : Q("", !0)
|
|
256
|
+
]),
|
|
257
|
+
_: 1
|
|
258
|
+
}, 8, ["loading"]));
|
|
259
|
+
}
|
|
260
|
+
});
|
|
261
|
+
const q = (i, t) => {
|
|
262
|
+
const s = i.__vccOpts || i;
|
|
263
|
+
for (const [n, r] of t)
|
|
264
|
+
s[n] = r;
|
|
265
|
+
return s;
|
|
266
|
+
}, ke = /* @__PURE__ */ q($e, [["__scopeId", "data-v-8e6fff6f"]]), Ie = { class: "text-center mb-6" }, Ae = /* @__PURE__ */ L({
|
|
267
|
+
__name: "VoAuthDialog",
|
|
268
|
+
setup(i) {
|
|
269
|
+
const t = V(), { mdAndDown: s, lgAndUp: n } = ve(), r = ge();
|
|
270
|
+
return (e, c) => !a(t).user && !a(t).isLoading ? (m(), g(we, {
|
|
271
|
+
key: 0,
|
|
272
|
+
"max-width": "480"
|
|
273
|
+
}, {
|
|
274
|
+
activator: d(({ props: h }) => [
|
|
275
|
+
u(M, ee({
|
|
276
|
+
...h,
|
|
277
|
+
[`${a(n) ? "append-" : ""}icon`]: `svg:${a(ce)}`,
|
|
278
|
+
text: a(n) ? "Login" : void 0
|
|
279
|
+
}, {
|
|
280
|
+
rounded: a(s),
|
|
281
|
+
class: "text-none",
|
|
282
|
+
color: "primary",
|
|
283
|
+
variant: "outlined"
|
|
284
|
+
}), null, 16, ["rounded"])
|
|
285
|
+
]),
|
|
286
|
+
default: d(() => [
|
|
287
|
+
u(ye, { class: "pt-6 pb-1 pb-sm-4 px-4 px-sm-8" }, {
|
|
288
|
+
default: d(() => [
|
|
289
|
+
u(J, {
|
|
290
|
+
src: `https://cdn.vuetifyjs.com/docs/images/logos/vuetify-logo-v3-slim-text-${a(r).name.value}.svg`,
|
|
291
|
+
class: "mb-4",
|
|
292
|
+
height: "30"
|
|
293
|
+
}, null, 8, ["src"]),
|
|
294
|
+
b("div", Ie, [
|
|
295
|
+
u(_e, { class: "text-h5 mb-1 text-md-h4 font-weight-bold" }, {
|
|
296
|
+
default: d(() => [
|
|
297
|
+
w(x(a(t).lastLoginProvider() ? "Welcome Back" : "Log in to Vuetify"), 1)
|
|
298
|
+
]),
|
|
299
|
+
_: 1
|
|
300
|
+
}),
|
|
301
|
+
u(be, { class: "text-wrap" }, {
|
|
302
|
+
default: d(() => [
|
|
303
|
+
w(" Sign in with GitHub or Discord to save your settings and unlock exclusive subscriber perks. ")
|
|
304
|
+
]),
|
|
305
|
+
_: 1
|
|
306
|
+
})
|
|
307
|
+
]),
|
|
308
|
+
u(G, {
|
|
309
|
+
class: "mx-auto",
|
|
310
|
+
"max-width": "300",
|
|
311
|
+
width: "100%"
|
|
312
|
+
}, {
|
|
313
|
+
default: d(() => [
|
|
314
|
+
u(xe, { class: "mb-3" }),
|
|
315
|
+
u(Se)
|
|
316
|
+
]),
|
|
317
|
+
_: 1
|
|
318
|
+
})
|
|
319
|
+
]),
|
|
320
|
+
_: 1
|
|
321
|
+
})
|
|
322
|
+
]),
|
|
323
|
+
_: 1
|
|
324
|
+
})) : (m(), g(ke, { key: 1 }));
|
|
325
|
+
}
|
|
326
|
+
}), je = (i) => (se("data-v-6f6b85b8"), i = i(), ne(), i), Oe = {
|
|
327
|
+
class: "d-inline-block me-2 text-decoration-none text-primary",
|
|
328
|
+
href: "https://vuetifyjs.com/",
|
|
329
|
+
target: "_blank",
|
|
330
|
+
title: "Vuetify Documentation",
|
|
331
|
+
rel: "noopener noreferrer"
|
|
332
|
+
}, De = ["href", "title"], Te = {
|
|
333
|
+
class: "text-caption",
|
|
334
|
+
style: { position: "absolute", right: "16px" }
|
|
335
|
+
}, Re = /* @__PURE__ */ je(() => /* @__PURE__ */ b("span", { class: "d-none d-sm-inline-block" }, "Vuetify, LLC", -1)), Ce = /* @__PURE__ */ L({
|
|
336
|
+
__name: "VoFooter",
|
|
337
|
+
setup(i) {
|
|
338
|
+
const t = [
|
|
339
|
+
{
|
|
340
|
+
title: "Vuetify Support",
|
|
341
|
+
icon: `svg:${ue}`,
|
|
342
|
+
href: "https://support.vuetifyjs.com/"
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
title: "Vuetify X",
|
|
346
|
+
icon: "svg:M2.04875 3.00002L9.77052 13.3248L1.99998 21.7192H3.74882L10.5519 14.3697L16.0486 21.7192H22L13.8437 10.8137L21.0765 3.00002H19.3277L13.0624 9.76874L8.0001 3.00002H2.04875ZM4.62054 4.28821H7.35461L19.4278 20.4308H16.6937L4.62054 4.28821Z",
|
|
347
|
+
href: "https://x.com/vuetifyjs"
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
title: "Vuetify GitHub",
|
|
351
|
+
icon: `svg:${B}`,
|
|
352
|
+
href: "https://github.com/vuetifyjs/vuetify"
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
title: "Vuetify Discord",
|
|
356
|
+
icon: `svg:${H}`,
|
|
357
|
+
href: "https://community.vuetifyjs.com/"
|
|
358
|
+
},
|
|
359
|
+
{
|
|
360
|
+
title: "Vuetify Reddit",
|
|
361
|
+
icon: `svg:${de}`,
|
|
362
|
+
href: "https://reddit.com/r/vuetifyjs"
|
|
363
|
+
}
|
|
364
|
+
];
|
|
365
|
+
return (s, n) => (m(), g(Le, {
|
|
366
|
+
class: "vo-footer",
|
|
367
|
+
theme: "dark",
|
|
368
|
+
height: "40"
|
|
369
|
+
}, {
|
|
370
|
+
default: d(() => [
|
|
371
|
+
b("a", Oe, [
|
|
372
|
+
u(J, {
|
|
373
|
+
alt: "Vuetify logo",
|
|
374
|
+
src: "https://cdn.vuetifyjs.com/docs/images/logos/v.svg",
|
|
375
|
+
width: "32"
|
|
376
|
+
})
|
|
377
|
+
]),
|
|
378
|
+
(m(), te(oe, null, ie(t, (r) => b("a", {
|
|
379
|
+
key: r.title,
|
|
380
|
+
href: r.href,
|
|
381
|
+
title: r.title,
|
|
382
|
+
class: "d-inline-block mx-2 social-link",
|
|
383
|
+
target: "_blank",
|
|
384
|
+
rel: "noopener noreferrer"
|
|
385
|
+
}, [
|
|
386
|
+
u(Ve, { size: "18" }, {
|
|
387
|
+
default: d(() => [
|
|
388
|
+
w(x(r.icon), 1)
|
|
389
|
+
]),
|
|
390
|
+
_: 2
|
|
391
|
+
}, 1024)
|
|
392
|
+
], 8, De)), 64)),
|
|
393
|
+
b("div", Te, [
|
|
394
|
+
w(" © 2016-" + x((/* @__PURE__ */ new Date()).getFullYear()) + " ", 1),
|
|
395
|
+
Re
|
|
396
|
+
])
|
|
397
|
+
]),
|
|
398
|
+
_: 1
|
|
399
|
+
}));
|
|
400
|
+
}
|
|
401
|
+
});
|
|
402
|
+
const Pe = /* @__PURE__ */ q(Ce, [["__scopeId", "data-v-6f6b85b8"]]), S = {}.VITE_API_SERVER_URL, Ke = O("one", () => {
|
|
403
|
+
const t = new URLSearchParams(window.location.search).get("session_id"), s = V(), n = E(!1), r = j(() => {
|
|
404
|
+
var o;
|
|
405
|
+
return (o = s.user) == null ? void 0 : o.sponsorships.find((l) => l.platform === "stripe" && l.tierName.startsWith("sub_"));
|
|
406
|
+
}), e = j(() => {
|
|
407
|
+
var o;
|
|
408
|
+
return (o = r.value) == null ? void 0 : o.isActive;
|
|
409
|
+
});
|
|
410
|
+
re(async () => {
|
|
411
|
+
t && await c();
|
|
412
|
+
}), N(e, (o) => {
|
|
413
|
+
o && y();
|
|
414
|
+
});
|
|
415
|
+
async function c() {
|
|
416
|
+
try {
|
|
417
|
+
n.value = !0;
|
|
418
|
+
const o = await fetch(`${S}/one/activate`, {
|
|
419
|
+
method: "POST",
|
|
420
|
+
credentials: "include",
|
|
421
|
+
headers: {
|
|
422
|
+
"Content-Type": "application/json"
|
|
423
|
+
},
|
|
424
|
+
body: JSON.stringify({ sessionId: t })
|
|
425
|
+
}).then((l) => l.json());
|
|
426
|
+
s.user = o.user;
|
|
427
|
+
} catch {
|
|
428
|
+
} finally {
|
|
429
|
+
n.value = !1;
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
async function h() {
|
|
433
|
+
n.value = !0, window.location.href = `${S}/one/subscribe`;
|
|
434
|
+
}
|
|
435
|
+
async function $() {
|
|
436
|
+
var o;
|
|
437
|
+
if (r.value)
|
|
438
|
+
try {
|
|
439
|
+
n.value = !0;
|
|
440
|
+
const l = await fetch(`${S}/one/cancel?subscriptionId=${(o = r.value) == null ? void 0 : o.tierName}`, {
|
|
441
|
+
method: "POST",
|
|
442
|
+
credentials: "include"
|
|
443
|
+
}).then((f) => f.json());
|
|
444
|
+
s.user = l.user;
|
|
445
|
+
} catch {
|
|
446
|
+
} finally {
|
|
447
|
+
n.value = !1;
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
async function y() {
|
|
451
|
+
var o;
|
|
452
|
+
if (r.value)
|
|
453
|
+
try {
|
|
454
|
+
n.value = !0;
|
|
455
|
+
const l = await fetch(`${S}/one/verify?subscriptionId=${(o = r.value) == null ? void 0 : o.tierName}`, {
|
|
456
|
+
method: "POST",
|
|
457
|
+
credentials: "include"
|
|
458
|
+
}).then((f) => f.json());
|
|
459
|
+
s.user = l.user;
|
|
460
|
+
} catch {
|
|
461
|
+
} finally {
|
|
462
|
+
n.value = !1;
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
return {
|
|
466
|
+
activate: c,
|
|
467
|
+
cancel: $,
|
|
468
|
+
subscribe: h,
|
|
469
|
+
verify: y,
|
|
470
|
+
subscription: r,
|
|
471
|
+
isLoading: n,
|
|
472
|
+
isSubscriber: e
|
|
473
|
+
};
|
|
474
|
+
});
|
|
475
|
+
function Qe() {
|
|
476
|
+
function i(t) {
|
|
477
|
+
t.component("VoAuthDialog", Ae), t.component("VoFooter", Pe);
|
|
478
|
+
}
|
|
479
|
+
return { install: i };
|
|
480
|
+
}
|
|
481
|
+
export {
|
|
482
|
+
Qe as createOne,
|
|
483
|
+
V as useAuthStore,
|
|
484
|
+
Ke as useOneStore,
|
|
485
|
+
W as useUserStore
|
|
486
|
+
};
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
.vo-user-btn[data-v-8e6fff6f] .v-skeleton-loader__avatar{min-height:40px;height:40px;width:40px;max-height:40px;min-width:40px;max-width:40px}.social-link[data-v-6f6b85b8] .v-icon{color:#1976d252;text-decoration:none;transition:.2s ease-in-out}.social-link[data-v-6f6b85b8] .v-icon:hover{color:#1976d2}
|
package/package.json
CHANGED
|
@@ -1,62 +1,73 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vuetify/one",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"private": false,
|
|
4
5
|
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
5
7
|
"files": [
|
|
6
|
-
"dist"
|
|
7
|
-
"./index.d.ts"
|
|
8
|
+
"dist"
|
|
8
9
|
],
|
|
9
|
-
"main": "./dist/
|
|
10
|
-
"module": "./dist/
|
|
11
|
-
"types": "./index.d.ts",
|
|
10
|
+
"main": "./dist/index.js",
|
|
11
|
+
"module": "./dist/index.js",
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
12
13
|
"exports": {
|
|
13
14
|
".": {
|
|
14
|
-
"import": "./dist/
|
|
15
|
-
"require": "./dist/v-one.umd.cjs"
|
|
15
|
+
"import": "./dist/index.js"
|
|
16
16
|
},
|
|
17
17
|
"./styles": {
|
|
18
|
-
"import": "./dist/style.css"
|
|
19
|
-
"require": "./dist/style.css"
|
|
18
|
+
"import": "./dist/style.css"
|
|
20
19
|
}
|
|
21
20
|
},
|
|
22
21
|
"scripts": {
|
|
23
22
|
"dev": "vite",
|
|
24
|
-
"build": "vite --config vite.build.config.ts build",
|
|
23
|
+
"build": "vite build --config vite.build.config.ts && yarn build:types",
|
|
24
|
+
"build:types": "rimraf types-temp && vue-tsc --pretty -p tsconfig.json && rollup --config rollup.types.config.js && rimraf types-temp",
|
|
25
25
|
"watch": "yarn build --mode development --watch",
|
|
26
26
|
"preview": "vite preview",
|
|
27
|
-
"lint": "eslint . --fix --ignore-path .gitignore"
|
|
27
|
+
"lint": "eslint . --ext .ts,.vue --fix --ignore-path .gitignore"
|
|
28
28
|
},
|
|
29
|
-
"
|
|
29
|
+
"peerDependencies": {
|
|
30
30
|
"@mdi/js": "6.2.95",
|
|
31
|
-
"core-js": "^3.29.0",
|
|
32
31
|
"lodash-es": "^4.17.21",
|
|
33
32
|
"vue": "^3.2.0",
|
|
34
33
|
"vuetify": "^3.0.0"
|
|
35
34
|
},
|
|
36
35
|
"devDependencies": {
|
|
37
36
|
"@babel/types": "^7.21.4",
|
|
37
|
+
"@mdi/js": "6.2.95",
|
|
38
|
+
"@rollup/plugin-alias": "^5.1.0",
|
|
38
39
|
"@types/lodash-es": "^4.17.12",
|
|
39
40
|
"@types/node": "^18.15.0",
|
|
40
41
|
"@vitejs/plugin-vue": "^4.0.0",
|
|
41
42
|
"@vue/eslint-config-typescript": "^11.0.0",
|
|
43
|
+
"conventional-changelog-cli": "^4.1.0",
|
|
44
|
+
"conventional-changelog-vuetify": "^1.1.0",
|
|
45
|
+
"conventional-github-releaser": "^3.1.5",
|
|
46
|
+
"core-js": "^3.29.0",
|
|
47
|
+
"eslint": "^8.46.0",
|
|
42
48
|
"eslint-config-standard": "^17.1.0",
|
|
43
49
|
"eslint-plugin-import": "^2.28.0",
|
|
44
50
|
"eslint-plugin-n": "^16.0.1",
|
|
45
51
|
"eslint-plugin-node": "^11.1.0",
|
|
46
52
|
"eslint-plugin-promise": "^6.1.1",
|
|
47
53
|
"eslint-plugin-vue": "^9.16.1",
|
|
48
|
-
"
|
|
54
|
+
"lodash-es": "^4.17.21",
|
|
49
55
|
"pinia": "^2.0.0",
|
|
56
|
+
"rimraf": "^5.0.5",
|
|
50
57
|
"roboto-fontface": "*",
|
|
58
|
+
"rollup": "^4.9.1",
|
|
59
|
+
"rollup-plugin-dts": "^6.1.0",
|
|
51
60
|
"sass": "^1.60.0",
|
|
52
61
|
"typescript": "^5.0.0",
|
|
53
62
|
"unplugin-fonts": "^1.0.3",
|
|
54
63
|
"unplugin-vue-components": "^0.26.0",
|
|
55
64
|
"unplugin-vue-router": "^0.7.0",
|
|
65
|
+
"vite": "^4.2.0",
|
|
56
66
|
"vite-plugin-vue-layouts": "^0.8.0",
|
|
57
67
|
"vite-plugin-vuetify": "^1.0.0",
|
|
58
|
-
"
|
|
68
|
+
"vue": "^3.2.0",
|
|
59
69
|
"vue-router": "^4.0.0",
|
|
60
|
-
"vue-tsc": "^1.2.0"
|
|
70
|
+
"vue-tsc": "^1.2.0",
|
|
71
|
+
"vuetify": "^3.0.0"
|
|
61
72
|
}
|
|
62
73
|
}
|