@vuetify/one 0.5.0 → 0.6.1

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.
Files changed (2) hide show
  1. package/dist/index.js +278 -236
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,51 +1,51 @@
1
- import { reactive as Y, toRefs as Z, ref as T, shallowRef as H, computed as b, watch as B, defineComponent as S, openBlock as g, createBlock as _, unref as a, withCtx as p, createVNode as f, createTextVNode as A, toDisplayString as N, createCommentVNode as K, mergeProps as Q, createElementVNode as D, createElementBlock as ee, Fragment as te, renderList as oe, pushScopeId as ne, popScopeId as se, onBeforeMount as ie } from "vue";
2
- import { defineStore as k } from "pinia";
3
- import { merge as C } from "lodash-es";
4
- import { mdiDiscord as M, mdiGithub as G, mdiViewDashboard as re, mdiLogoutVariant as ae, mdiLogin as le, mdiShieldStarOutline as ce, mdiReddit as ue } from "@mdi/js";
5
- import { VListItem as z, VList as J, VListSubheader as de } from "vuetify/lib/components/VList/index.mjs";
6
- import { VAvatar as fe } from "vuetify/lib/components/VAvatar/index.mjs";
1
+ import { reactive as Y, toRefs as Z, ref as B, shallowRef as D, computed as g, watch as N, defineComponent as $, openBlock as h, createBlock as b, unref as l, withCtx as v, createVNode as p, createTextVNode as j, toDisplayString as U, createCommentVNode as K, mergeProps as Q, createElementVNode as C, createElementBlock as ee, Fragment as te, renderList as ne, pushScopeId as oe, popScopeId as se, onBeforeMount as ie } from "vue";
2
+ import { defineStore as S } from "pinia";
3
+ import { merge as T } from "lodash-es";
4
+ import { mdiDiscord as M, mdiGithub as G, mdiViewDashboard as re, mdiLogoutVariant as ae, mdiLogin as le, mdiShieldStarOutline as ue, mdiReddit as ce } from "@mdi/js";
5
+ import { VListItem as z, VList as J, VListSubheader as fe } from "vuetify/lib/components/VList/index.mjs";
6
+ import { VAvatar as de } from "vuetify/lib/components/VAvatar/index.mjs";
7
7
  import { VBtn as W } from "vuetify/lib/components/VBtn/index.mjs";
8
8
  import { VMenu as pe } from "vuetify/lib/components/VMenu/index.mjs";
9
- import { VSkeletonLoader as me } from "vuetify/lib/components/VSkeletonLoader/index.mjs";
10
- import { useDisplay as ve, useTheme as he } from "vuetify";
9
+ import { VSkeletonLoader as ve } from "vuetify/lib/components/VSkeletonLoader/index.mjs";
10
+ import { useDisplay as me, useTheme as he } from "vuetify";
11
11
  import { VCard as ye, VCardTitle as ge, VCardSubtitle as be } from "vuetify/lib/components/VCard/index.mjs";
12
12
  import { VDialog as _e } from "vuetify/lib/components/VDialog/index.mjs";
13
13
  import { VImg as we } from "vuetify/lib/components/VImg/index.mjs";
14
14
  import { VFooter as Le } from "vuetify/lib/components/VFooter/index.mjs";
15
15
  import { VIcon as xe } from "vuetify/lib/components/VIcon/index.mjs";
16
- const U = k("http", {
16
+ const R = S("http", {
17
17
  state: () => ({
18
18
  url: ""
19
19
  }),
20
20
  actions: {
21
- async fetch(o, t = {}) {
22
- const n = await fetch(`${this.url}${o}`, {
21
+ async fetch(n, t = {}) {
22
+ const o = await fetch(`${this.url}${n}`, {
23
23
  credentials: "include",
24
24
  ...t
25
25
  });
26
- return n.status === 204 ? n : n.json();
26
+ return o.status === 204 ? o : o.json();
27
27
  },
28
- async post(o, t, n = {}) {
29
- return this.fetch(o, {
28
+ async post(n, t, o = {}) {
29
+ return this.fetch(n, {
30
30
  method: "POST",
31
31
  headers: {
32
32
  "Content-Type": "application/json"
33
33
  },
34
34
  body: JSON.stringify(t),
35
- ...n
35
+ ...o
36
36
  });
37
37
  },
38
- async get(o, t = {}) {
39
- return this.fetch(o, t);
38
+ async get(n, t = {}) {
39
+ return this.fetch(n, t);
40
40
  },
41
- async delete(o, t = {}) {
42
- return this.fetch(o, {
41
+ async delete(n, t = {}) {
42
+ return this.fetch(n, {
43
43
  method: "DELETE",
44
44
  ...t
45
45
  });
46
46
  }
47
47
  }
48
- }), O = typeof window < "u", P = {
48
+ }), H = typeof window < "u", P = {
49
49
  v: 4,
50
50
  api: "link-only",
51
51
  avatar: "",
@@ -56,6 +56,7 @@ const U = k("http", {
56
56
  theme: "system",
57
57
  mixedTheme: !0,
58
58
  direction: "ltr",
59
+ pins: !1,
59
60
  pinned: [],
60
61
  slashSearch: !1,
61
62
  syncSettings: !0,
@@ -73,152 +74,152 @@ const U = k("http", {
73
74
  jobs: null
74
75
  }
75
76
  }
76
- }, q = k("user", () => {
77
- const o = Y(C({}, P));
77
+ }, q = S("user", () => {
78
+ const n = Y(T({}, P));
78
79
  function t() {
79
- if (!O)
80
+ if (!H)
80
81
  return;
81
- const r = localStorage.getItem("vuetify@user"), e = r ? JSON.parse(r) : {}, m = e.v === o.v;
82
- 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 = o.v, Object.assign(o, C(o, e)), m && n();
82
+ const s = localStorage.getItem("vuetify@user"), e = s ? JSON.parse(s) : {}, m = e.v === n.v;
83
+ 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 = n.v, Object.assign(n, T(n, e)), m && o();
83
84
  }
84
- function n() {
85
- O && localStorage.setItem("vuetify@user", JSON.stringify(o, null, 2));
85
+ function o() {
86
+ H && localStorage.setItem("vuetify@user", JSON.stringify(n, null, 2));
86
87
  }
87
- function s() {
88
- O && (Object.assign(o, C({}, P)), n());
88
+ function i() {
89
+ H && (Object.assign(n, T({}, P)), o());
89
90
  }
90
91
  return t(), {
91
- ...Z(o),
92
+ ...Z(n),
92
93
  load: t,
93
- save: n,
94
- reset: s
94
+ save: o,
95
+ reset: i
95
96
  };
96
- }), L = k("auth", () => {
97
- const o = T(null), t = U(), n = q(), s = H(!1), r = b(() => {
98
- var i, l;
99
- return !t.url || ((i = o.value) == null ? void 0 : i.isAdmin) || ((l = o.value) == null ? void 0 : l.sponsorships.some((w) => w.isActive));
97
+ }), w = S("auth", () => {
98
+ const n = B(null), t = R(), o = q(), i = D(!1), s = g(() => {
99
+ var r, a;
100
+ return !t.url || ((r = n.value) == null ? void 0 : r.isAdmin) || ((a = n.value) == null ? void 0 : a.sponsorships.some((_) => _.isActive));
100
101
  });
101
102
  let e = !1;
102
- B(o, (i) => {
103
- if (!(i != null && i.settings))
103
+ N(n, (r) => {
104
+ if (!(r != null && r.settings))
104
105
  return;
105
- const l = localStorage.getItem("vuetify@user") || "{}";
106
- JSON.stringify(i.settings, null, 2) !== l && (e = !0, Object.assign(n, i.settings));
107
- }), n.$subscribe(() => {
106
+ const a = localStorage.getItem("vuetify@user") || "{}";
107
+ JSON.stringify(r.settings, null, 2) !== a && (e = !0, Object.assign(o, r.settings));
108
+ }), o.$subscribe(() => {
108
109
  e || m(), e = !1;
109
110
  });
110
111
  async function m() {
111
112
  try {
112
- await t.post("/user/settings", { settings: n.$state });
113
- } catch (i) {
114
- console.error(i);
113
+ await t.post("/user/settings", { settings: o.$state });
114
+ } catch (r) {
115
+ console.error(r);
115
116
  }
116
117
  }
117
- async function u(i = !1) {
118
- if (u.promise)
119
- return u.promise;
120
- s.value = !0, u.promise = fetch(`${t.url}/auth/verify`, {
118
+ async function f(r = !1) {
119
+ if (f.promise)
120
+ return f.promise;
121
+ i.value = !0, f.promise = fetch(`${t.url}/auth/verify`, {
121
122
  credentials: "include",
122
- headers: i ? {
123
+ headers: r ? {
123
124
  "Cache-Control": "no-cache"
124
125
  } : void 0
125
126
  }).then(
126
- async (l) => {
127
- l.ok ? o.value = (await l.json()).user : l.status === 401 ? o.value = null : console.error(l.statusText);
127
+ async (a) => {
128
+ a.ok ? n.value = (await a.json()).user : a.status === 401 ? n.value = null : console.error(a.statusText);
128
129
  },
129
130
  () => {
130
131
  }
131
132
  ).finally(() => {
132
- s.value = !1, u.promise = null;
133
+ i.value = !1, f.promise = null;
133
134
  });
134
135
  }
135
- u.promise = null;
136
- async function x(i = "github") {
137
- s.value = !0;
138
- const l = `${t.url}/auth/${i}/redirect`, w = 400, c = 600, d = window.screenX + (window.innerWidth - w) / 2, h = window.screenY + (window.innerHeight - c) / 2, v = window.open(
136
+ f.promise = null;
137
+ async function L(r = "github") {
138
+ i.value = !0;
139
+ const a = `${t.url}/auth/${r}/redirect`, _ = 400, k = 600, u = window.screenX + (window.innerWidth - _) / 2, c = window.screenY + (window.innerHeight - k) / 2, d = window.open(
139
140
  "",
140
141
  "vuetify:authorize:popup",
141
- `popup,left=${d},top=${h},width=${w},height=${c},resizable`
142
+ `popup,left=${u},top=${c},width=${_},height=${k},resizable`
142
143
  );
143
- if (!v) {
144
+ if (!d) {
144
145
  console.error("Failed to open popup");
145
146
  return;
146
147
  }
147
- v.location.href = l;
148
- let I = -1, R = -1;
149
- function E($) {
148
+ d.location.href = a;
149
+ let I = -1, A = -1;
150
+ function E(V) {
150
151
  var F;
151
- $.origin === t.url && ((F = $.data) == null ? void 0 : F.type) === "auth-response" && ($.data.status === "success" ? (o.value || localStorage.setItem("vuetify@lastLoginProvider", i), o.value = $.data.body.user) : console.error($.data.message), j());
152
+ V.origin === t.url && ((F = V.data) == null ? void 0 : F.type) === "auth-response" && (V.data.status === "success" ? (n.value || localStorage.setItem("vuetify@lastLoginProvider", r), n.value = V.data.body.user) : console.error(V.data.message), O());
152
153
  }
153
- function j() {
154
- window.removeEventListener("message", E), window.clearInterval(I), window.clearTimeout(R), v == null || v.close(), s.value = !1;
154
+ function O() {
155
+ window.removeEventListener("message", E), window.clearInterval(I), window.clearTimeout(A), d == null || d.close(), i.value = !1;
155
156
  }
156
157
  window.addEventListener("message", E), I = window.setInterval(() => {
157
- !v || v.closed ? (console.error("Auth popup closed"), j()) : v.postMessage({ type: "auth-request" }, "*");
158
- }, 1e3), R = window.setTimeout(() => {
159
- j(), console.error("Auth timed out");
158
+ !d || d.closed ? (console.error("Auth popup closed"), O()) : d.postMessage({ type: "auth-request" }, "*");
159
+ }, 1e3), A = window.setTimeout(() => {
160
+ O(), console.error("Auth timed out");
160
161
  }, 120 * 1e3);
161
162
  }
162
- async function V() {
163
- s.value = !0;
163
+ async function x() {
164
+ i.value = !0;
164
165
  try {
165
- await t.post("/auth/logout"), await u(!0), o.value = null;
166
- } catch (i) {
167
- console.error(i);
166
+ await t.post("/auth/logout"), await f(!0), n.value = null;
167
+ } catch (r) {
168
+ console.error(r);
168
169
  } finally {
169
- s.value = !1;
170
+ i.value = !1;
170
171
  }
171
172
  }
172
173
  function y() {
173
174
  return localStorage.getItem("vuetify@lastLoginProvider");
174
175
  }
175
- return y() && u(), {
176
- user: o,
176
+ return y() && f(), {
177
+ user: n,
177
178
  url: t.url,
178
- isLoading: s,
179
- verify: u,
180
- login: x,
181
- logout: V,
182
- isSubscriber: r,
179
+ isLoading: i,
180
+ verify: f,
181
+ login: L,
182
+ logout: x,
183
+ isSubscriber: s,
183
184
  lastLoginProvider: y
184
185
  };
185
- }), Ve = /* @__PURE__ */ S({
186
+ }), Ve = /* @__PURE__ */ $({
186
187
  __name: "VoDiscordLogin",
187
- setup(o) {
188
- const t = L();
189
- return (n, s) => (g(), _(z, {
190
- "prepend-icon": `svg:${a(M)}`,
191
- title: a(t).user ? "Connect Discord" : "Log in with Discord",
192
- subtitle: !a(t).user && a(t).lastLoginProvider() === "discord" ? "Last Used" : "",
188
+ setup(n) {
189
+ const t = w();
190
+ return (o, i) => (h(), b(z, {
191
+ "prepend-icon": `svg:${l(M)}`,
192
+ title: l(t).user ? "Connect Discord" : "Log in with Discord",
193
+ subtitle: !l(t).user && l(t).lastLoginProvider() === "discord" ? "Last Used" : "",
193
194
  nav: "",
194
195
  "base-color": "#5865F2",
195
196
  slim: "",
196
197
  variant: "flat",
197
- onClick: s[0] || (s[0] = (r) => a(t).login("discord"))
198
+ onClick: i[0] || (i[0] = (s) => l(t).login("discord"))
198
199
  }, null, 8, ["prepend-icon", "title", "subtitle"]));
199
200
  }
200
- }), $e = /* @__PURE__ */ S({
201
+ }), $e = /* @__PURE__ */ $({
201
202
  __name: "VoGithubLogin",
202
- setup(o) {
203
- const t = L();
204
- return (n, s) => (g(), _(z, {
205
- "prepend-icon": `svg:${a(G)}`,
206
- title: a(t).user ? "Connect GitHub" : "Log in with GitHub",
207
- subtitle: !a(t).user && a(t).lastLoginProvider() === "github" ? "Last Used" : "",
203
+ setup(n) {
204
+ const t = w();
205
+ return (o, i) => (h(), b(z, {
206
+ "prepend-icon": `svg:${l(G)}`,
207
+ title: l(t).user ? "Connect GitHub" : "Log in with GitHub",
208
+ subtitle: !l(t).user && l(t).lastLoginProvider() === "github" ? "Last Used" : "",
208
209
  "base-color": "#2a2a2a",
209
210
  nav: "",
210
211
  slim: "",
211
212
  variant: "flat",
212
- onClick: s[0] || (s[0] = (r) => a(t).login("github"))
213
+ onClick: i[0] || (i[0] = (s) => l(t).login("github"))
213
214
  }, null, 8, ["prepend-icon", "title", "subtitle"]));
214
215
  }
215
- }), Se = /* @__PURE__ */ S({
216
+ }), Se = /* @__PURE__ */ $({
216
217
  __name: "VoUserBtn",
217
218
  props: {
218
219
  external: Boolean
219
220
  },
220
- setup(o) {
221
- const t = o, n = L(), s = q(), r = b(() => [
221
+ setup(n) {
222
+ const t = n, o = w(), i = q(), s = g(() => [
222
223
  { title: "Options", type: "subheader" },
223
224
  {
224
225
  title: "My Dashboard",
@@ -237,36 +238,36 @@ const U = k("http", {
237
238
  title: "Logout",
238
239
  appendIcon: `svg:${ae}`,
239
240
  onClick: () => {
240
- n.logout();
241
+ o.logout();
241
242
  }
242
243
  }
243
244
  ]);
244
- return (e, m) => (g(), _(W, {
245
+ return (e, m) => (h(), b(W, {
245
246
  class: "vo-user-btn",
246
- loading: a(n).isLoading,
247
+ loading: l(o).isLoading,
247
248
  icon: ""
248
249
  }, {
249
- loader: p(() => [
250
- f(me, { type: "avatar" })
250
+ loader: v(() => [
251
+ p(ve, { type: "avatar" })
251
252
  ]),
252
- default: p(() => [
253
- f(pe, {
254
- disabled: !a(n).user || a(n).isLoading,
253
+ default: v(() => [
254
+ p(pe, {
255
+ disabled: !l(o).user || l(o).isLoading,
255
256
  activator: "parent",
256
257
  location: "bottom end"
257
258
  }, {
258
- default: p(() => [
259
- f(J, {
260
- items: r.value,
259
+ default: v(() => [
260
+ p(J, {
261
+ items: s.value,
261
262
  lines: !1,
262
263
  density: "compact",
263
264
  "item-props": "",
264
265
  nav: ""
265
266
  }, {
266
- subheader: p(({ props: u }) => [
267
- f(de, { class: "text-high-emphasis text-uppercase font-weight-black" }, {
268
- default: p(() => [
269
- A(N(u.title), 1)
267
+ subheader: v(({ props: f }) => [
268
+ p(fe, { class: "text-high-emphasis text-uppercase font-weight-black" }, {
269
+ default: v(() => [
270
+ j(U(f.title), 1)
270
271
  ]),
271
272
  _: 2
272
273
  }, 1024)
@@ -276,70 +277,70 @@ const U = k("http", {
276
277
  ]),
277
278
  _: 1
278
279
  }, 8, ["disabled"]),
279
- a(n).user ? (g(), _(fe, {
280
+ l(o).user ? (h(), b(de, {
280
281
  key: 0,
281
- image: a(s).avatar || a(n).user.picture || ""
282
+ image: l(i).avatar || l(o).user.picture || ""
282
283
  }, null, 8, ["image"])) : K("", !0)
283
284
  ]),
284
285
  _: 1
285
286
  }, 8, ["loading"]));
286
287
  }
287
288
  });
288
- const X = (o, t) => {
289
- const n = o.__vccOpts || o;
290
- for (const [s, r] of t)
291
- n[s] = r;
292
- return n;
293
- }, ke = /* @__PURE__ */ X(Se, [["__scopeId", "data-v-aeb16535"]]), Ie = { class: "text-center mb-6" }, Ae = /* @__PURE__ */ S({
289
+ const X = (n, t) => {
290
+ const o = n.__vccOpts || n;
291
+ for (const [i, s] of t)
292
+ o[i] = s;
293
+ return o;
294
+ }, ke = /* @__PURE__ */ X(Se, [["__scopeId", "data-v-aeb16535"]]), Ie = { class: "text-center mb-6" }, Ae = /* @__PURE__ */ $({
294
295
  __name: "VoAuthDialog",
295
- setup(o) {
296
- const t = L(), { mdAndDown: n, lgAndUp: s } = ve(), r = he();
297
- return (e, m) => !a(t).user && !a(t).isLoading ? (g(), _(_e, {
296
+ setup(n) {
297
+ const t = w(), { mdAndDown: o, lgAndUp: i } = me(), s = he();
298
+ return (e, m) => !l(t).user && !l(t).isLoading ? (h(), b(_e, {
298
299
  key: 0,
299
300
  "max-width": "480"
300
301
  }, {
301
- activator: p(({ props: u }) => [
302
- f(W, Q({
303
- ...u,
304
- [`${a(s) ? "append-" : ""}icon`]: `svg:${a(le)}`,
305
- text: a(s) ? "Login" : void 0
302
+ activator: v(({ props: f }) => [
303
+ p(W, Q({
304
+ ...f,
305
+ [`${l(i) ? "append-" : ""}icon`]: `svg:${l(le)}`,
306
+ text: l(i) ? "Login" : void 0
306
307
  }, {
307
- rounded: a(n),
308
+ rounded: l(o),
308
309
  class: "text-none",
309
310
  color: "primary",
310
311
  variant: "outlined"
311
312
  }), null, 16, ["rounded"])
312
313
  ]),
313
- default: p(() => [
314
- f(ye, { class: "pt-6 pb-1 pb-sm-4 px-4 px-sm-8" }, {
315
- default: p(() => [
316
- f(we, {
317
- src: `https://cdn.vuetifyjs.com/docs/images/logos/vuetify-logo-v3-slim-text-${a(r).name.value}.svg`,
314
+ default: v(() => [
315
+ p(ye, { class: "pt-6 pb-1 pb-sm-4 px-4 px-sm-8" }, {
316
+ default: v(() => [
317
+ p(we, {
318
+ src: `https://cdn.vuetifyjs.com/docs/images/logos/vuetify-logo-v3-slim-text-${l(s).name.value}.svg`,
318
319
  class: "mb-4",
319
320
  height: "30"
320
321
  }, null, 8, ["src"]),
321
- D("div", Ie, [
322
- f(ge, { class: "text-h5 mb-1 text-md-h4 font-weight-bold" }, {
323
- default: p(() => [
324
- A(N(a(t).lastLoginProvider() ? "Welcome Back" : "Log in to Vuetify"), 1)
322
+ C("div", Ie, [
323
+ p(ge, { class: "text-h5 mb-1 text-md-h4 font-weight-bold" }, {
324
+ default: v(() => [
325
+ j(U(l(t).lastLoginProvider() ? "Welcome Back" : "Log in to Vuetify"), 1)
325
326
  ]),
326
327
  _: 1
327
328
  }),
328
- f(be, { class: "text-wrap" }, {
329
- default: p(() => [
330
- A(" Sign in with GitHub or Discord to save your settings and unlock exclusive subscriber perks. ")
329
+ p(be, { class: "text-wrap" }, {
330
+ default: v(() => [
331
+ j(" Sign in with GitHub or Discord to save your settings and unlock exclusive subscriber perks. ")
331
332
  ]),
332
333
  _: 1
333
334
  })
334
335
  ]),
335
- f(J, {
336
+ p(J, {
336
337
  class: "mx-auto",
337
338
  "max-width": "300",
338
339
  width: "100%"
339
340
  }, {
340
- default: p(() => [
341
- f($e, { class: "mb-3" }),
342
- f(Ve)
341
+ default: v(() => [
342
+ p($e, { class: "mb-3" }),
343
+ p(Ve)
343
344
  ]),
344
345
  _: 1
345
346
  })
@@ -348,14 +349,14 @@ const X = (o, t) => {
348
349
  })
349
350
  ]),
350
351
  _: 1
351
- })) : (g(), _(ke, { key: 1 }));
352
+ })) : (h(), b(ke, { key: 1 }));
352
353
  }
353
- }), De = (o) => (ne("data-v-b66944c0"), o = o(), se(), o), je = ["href", "title"], Ce = {
354
+ }), De = (n) => (oe("data-v-b66944c0"), n = n(), se(), n), je = ["href", "title"], Ce = {
354
355
  class: "text-caption text-disabled",
355
356
  style: { position: "absolute", right: "16px" }
356
- }, Oe = /* @__PURE__ */ De(() => /* @__PURE__ */ D("span", { class: "d-none d-sm-inline-block" }, "Vuetify, LLC", -1)), Te = /* @__PURE__ */ S({
357
+ }, Oe = /* @__PURE__ */ De(() => /* @__PURE__ */ C("span", { class: "d-none d-sm-inline-block" }, "Vuetify, LLC", -1)), Te = /* @__PURE__ */ $({
357
358
  __name: "VoFooter",
358
- setup(o) {
359
+ setup(n) {
359
360
  const t = [
360
361
  {
361
362
  title: "Vuetify Documentation",
@@ -364,7 +365,7 @@ const X = (o, t) => {
364
365
  },
365
366
  {
366
367
  title: "Vuetify Support",
367
- icon: `svg:${ce}`,
368
+ icon: `svg:${ue}`,
368
369
  href: "https://support.vuetifyjs.com/"
369
370
  },
370
371
  {
@@ -384,31 +385,31 @@ const X = (o, t) => {
384
385
  },
385
386
  {
386
387
  title: "Vuetify Reddit",
387
- icon: `svg:${ue}`,
388
+ icon: `svg:${ce}`,
388
389
  href: "https://reddit.com/r/vuetifyjs"
389
390
  }
390
391
  ];
391
- return (n, s) => (g(), _(Le, {
392
+ return (o, i) => (h(), b(Le, {
392
393
  class: "vo-footer",
393
394
  theme: "dark",
394
395
  height: "40"
395
396
  }, {
396
- default: p(() => [
397
- (g(), ee(te, null, oe(t, (r) => D("a", {
398
- key: r.title,
399
- href: r.href,
400
- title: r.title,
397
+ default: v(() => [
398
+ (h(), ee(te, null, ne(t, (s) => C("a", {
399
+ key: s.title,
400
+ href: s.href,
401
+ title: s.title,
401
402
  class: "d-inline-block mx-2 social-link",
402
403
  target: "_blank",
403
404
  rel: "noopener noreferrer"
404
405
  }, [
405
- f(xe, {
406
- icon: r.icon,
407
- size: r.icon === "$vuetify" ? 24 : 16
406
+ p(xe, {
407
+ icon: s.icon,
408
+ size: s.icon === "$vuetify" ? 24 : 16
408
409
  }, null, 8, ["icon", "size"])
409
410
  ], 8, je)), 64)),
410
- D("div", Ce, [
411
- A(" © 2016-" + N((/* @__PURE__ */ new Date()).getFullYear()) + " ", 1),
411
+ C("div", Ce, [
412
+ j(" © 2016-" + U((/* @__PURE__ */ new Date()).getFullYear()) + " ", 1),
412
413
  Oe
413
414
  ])
414
415
  ]),
@@ -416,129 +417,170 @@ const X = (o, t) => {
416
417
  }));
417
418
  }
418
419
  });
419
- const He = /* @__PURE__ */ X(Te, [["__scopeId", "data-v-b66944c0"]]), Ze = k("bins", () => {
420
- const o = L(), t = U(), n = T([]), s = T(), r = H(-1), e = b(() => !o.user || !s.value ? !1 : o.user.id === s.value.owner.id), m = b(() => n.value.filter((c) => c.favorite)), u = b(() => n.value.filter((c) => c.pinned));
421
- B(() => s, () => {
422
- window.clearTimeout(r.value), r.value = window.setTimeout(() => {
423
- !s.value || !e.value || i(s.value, s.value.id);
420
+ const He = /* @__PURE__ */ X(Te, [["__scopeId", "data-v-b66944c0"]]), Ze = S("bins", () => {
421
+ const n = w(), t = R(), o = B([]), i = B(), s = D(!1), e = D(-1), m = g(() => !n.user || !i.value ? !1 : n.user.id === i.value.owner.id), f = g(() => o.value.filter((u) => u.favorite)), L = g(() => o.value.filter((u) => u.pinned));
422
+ N(i, () => {
423
+ window.clearTimeout(e.value), e.value = window.setTimeout(() => {
424
+ !i.value || !m.value || a(i.value, i.value.id);
424
425
  }, 100);
425
426
  }, { deep: !0 });
426
427
  async function x() {
427
- const c = await t.get("/one/bins");
428
- return n.value = c.bins, c.bins;
428
+ try {
429
+ s.value = !0;
430
+ const u = await t.get("/one/bins");
431
+ o.value = u.bins;
432
+ } catch {
433
+ } finally {
434
+ s.value = !1;
435
+ }
436
+ return o.value;
429
437
  }
430
- async function V(c) {
431
- const d = await t.delete(`/one/bins/${c}`);
432
- return n.value = n.value.filter((h) => h.id !== c), d;
438
+ async function y(u) {
439
+ try {
440
+ s.value = !0, await t.delete(`/one/bins/${u}`), o.value = o.value.filter((c) => c.id !== u);
441
+ } catch {
442
+ } finally {
443
+ s.value = !1;
444
+ }
445
+ return !0;
433
446
  }
434
- async function y(c) {
435
- const d = await t.post("/one/bins", { bin: c });
436
- return n.value.push(d.bin), s.value = d.bin, d;
447
+ async function r(u) {
448
+ try {
449
+ s.value = !0;
450
+ const c = await t.post("/one/bins", { bin: u });
451
+ return o.value.push(c.bin), i.value = c.bin, c;
452
+ } catch {
453
+ } finally {
454
+ s.value = !1;
455
+ }
456
+ return { bin: u };
437
457
  }
438
- async function i(c, d) {
439
- const h = await t.post(`/one/bins/${d}`, { bin: c }), v = n.value.findIndex((I) => I.id === d);
440
- return n.value.splice(v, 1, h.bin), h;
458
+ async function a(u, c) {
459
+ try {
460
+ s.value = !0;
461
+ const d = await t.post(`/one/bins/${c}`, { bin: u }), I = o.value.findIndex((A) => A.id === c);
462
+ o.value.splice(I, 1, d.bin);
463
+ } catch {
464
+ } finally {
465
+ s.value = !1;
466
+ }
467
+ return { bin: u };
441
468
  }
442
- async function l(c, d) {
443
- const h = d ? await i(c, d) : await y(c);
444
- return s.value = h.bin, h;
469
+ async function _(u, c) {
470
+ try {
471
+ s.value = !0;
472
+ const d = c ? await a(u, c) : await r(u);
473
+ i.value = d.bin;
474
+ } catch {
475
+ } finally {
476
+ s.value = !1;
477
+ }
478
+ return { bin: u };
445
479
  }
446
- async function w(c) {
447
- const d = await t.get(`/one/bins/${c}`);
448
- return s.value = d.bin, d;
480
+ async function k(u) {
481
+ try {
482
+ s.value = !0;
483
+ const c = await t.get(`/one/bins/${u}`);
484
+ i.value = c.bin;
485
+ } catch {
486
+ } finally {
487
+ s.value = !1;
488
+ }
489
+ return { bin: i.value };
449
490
  }
450
491
  return {
451
- isOwner: e,
452
- pinned: u,
453
- favorites: m,
454
- all: n,
455
- create: y,
456
- delete: V,
457
- current: s,
458
- find: w,
492
+ isLoading: s,
493
+ isOwner: m,
494
+ pinned: L,
495
+ favorites: f,
496
+ all: o,
497
+ create: r,
498
+ delete: y,
499
+ current: i,
500
+ find: k,
459
501
  get: x,
460
- update: i,
461
- updateOrCreate: l
502
+ update: a,
503
+ updateOrCreate: _
462
504
  };
463
- }), Ke = k("one", () => {
464
- const t = new URLSearchParams(window.location.search).get("session_id"), n = L(), s = U(), r = H(!1), e = b(() => {
465
- var i;
466
- return (i = n.user) == null ? void 0 : i.sponsorships.find((l) => l.platform === "stripe" && l.tierName.startsWith("sub_"));
467
- }), m = b(() => {
468
- var i;
469
- return (i = e.value) == null ? void 0 : i.isActive;
505
+ }), Ke = S("one", () => {
506
+ const t = new URLSearchParams(window.location.search).get("session_id"), o = w(), i = R(), s = D(!1), e = g(() => {
507
+ var r;
508
+ return (r = o.user) == null ? void 0 : r.sponsorships.find((a) => a.platform === "stripe" && a.tierName.startsWith("sub_"));
509
+ }), m = g(() => {
510
+ var r;
511
+ return (r = e.value) == null ? void 0 : r.isActive;
470
512
  });
471
513
  ie(async () => {
472
- t && await u();
473
- }), B(m, (i) => {
474
- i && y();
514
+ t && await f();
515
+ }), N(m, (r) => {
516
+ r && y();
475
517
  });
476
- async function u() {
518
+ async function f() {
477
519
  try {
478
- r.value = !0;
479
- const i = await s.post("/one/activate", { sessionId: t });
480
- n.user = i.user;
520
+ s.value = !0;
521
+ const r = await i.post("/one/activate", { sessionId: t });
522
+ o.user = r.user;
481
523
  } catch {
482
524
  } finally {
483
- r.value = !1;
525
+ s.value = !1;
484
526
  }
485
527
  }
486
- async function x() {
487
- r.value = !0, window.location.href = `${s.url}/one/subscribe`;
528
+ async function L() {
529
+ s.value = !0, window.location.href = `${i.url}/one/subscribe`;
488
530
  }
489
- async function V() {
490
- var i;
531
+ async function x() {
532
+ var r;
491
533
  if (e.value)
492
534
  try {
493
- r.value = !0;
494
- const l = await s.post(
495
- `/one/cancel?subscriptionId=${(i = e.value) == null ? void 0 : i.tierName}`
535
+ s.value = !0;
536
+ const a = await i.post(
537
+ `/one/cancel?subscriptionId=${(r = e.value) == null ? void 0 : r.tierName}`
496
538
  );
497
- n.user = l.user;
539
+ o.user = a.user;
498
540
  } catch {
499
541
  } finally {
500
- r.value = !1;
542
+ s.value = !1;
501
543
  }
502
544
  }
503
545
  async function y() {
504
- var i;
546
+ var r;
505
547
  if (e.value)
506
548
  try {
507
- r.value = !0;
508
- const l = await s.post(
509
- `/one/verify?subscriptionId=${(i = e.value) == null ? void 0 : i.tierName}`
549
+ s.value = !0;
550
+ const a = await i.post(
551
+ `/one/verify?subscriptionId=${(r = e.value) == null ? void 0 : r.tierName}`
510
552
  );
511
- n.user = l.user;
553
+ o.user = a.user;
512
554
  } catch {
513
555
  } finally {
514
- r.value = !1;
556
+ s.value = !1;
515
557
  }
516
558
  }
517
559
  return {
518
- activate: u,
519
- cancel: V,
520
- subscribe: x,
560
+ activate: f,
561
+ cancel: x,
562
+ subscribe: L,
521
563
  verify: y,
522
564
  subscription: e,
523
- isLoading: r,
565
+ isLoading: s,
524
566
  isSubscriber: m
525
567
  };
526
568
  });
527
569
  function Qe() {
528
- function o(t) {
570
+ function n(t) {
529
571
  t.component("VoAuthDialog", Ae), t.component("VoFooter", He);
530
572
  }
531
- return { install: o };
573
+ return { install: n };
532
574
  }
533
- function et(o) {
534
- o.store.url = "http://localhost:8096";
575
+ function et(n) {
576
+ n.store.url = "http://localhost:8096";
535
577
  }
536
578
  export {
537
579
  Qe as createOne,
538
580
  et as one,
539
- L as useAuthStore,
581
+ w as useAuthStore,
540
582
  Ze as useBinsStore,
541
- U as useHttpStore,
583
+ R as useHttpStore,
542
584
  Ke as useOneStore,
543
585
  q as useUserStore
544
586
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vuetify/one",
3
- "version": "0.5.0",
3
+ "version": "0.6.1",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "license": "MIT",