@vuetify/one 0.1.2 → 0.1.3

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 +67 -67
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
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";
1
+ import { reactive as Y, toRefs as Z, ref as K, shallowRef as U, computed as A, watch as B, defineComponent as L, openBlock as m, createBlock as v, unref as a, withCtx as d, createVNode as u, createTextVNode as w, toDisplayString as S, 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
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";
3
+ import { merge as j } from "lodash-es";
4
+ import { mdiDiscord as R, mdiGithub as F, mdiViewDashboard as ae, mdiLogoutVariant as le, mdiLogin as ce, mdiShieldStarOutline as ue, mdiReddit as de } from "@mdi/js";
5
+ import { VListItem as E, VList as G, VListSubheader as fe } from "vuetify/lib/components/VList/index.mjs";
6
6
  import { VAvatar as pe } from "vuetify/lib/components/VAvatar/index.mjs";
7
7
  import { VBtn as M } from "vuetify/lib/components/VBtn/index.mjs";
8
8
  import { VMenu as me } from "vuetify/lib/components/VMenu/index.mjs";
@@ -12,8 +12,8 @@ import { VCard as ye, VCardTitle as _e, VCardSubtitle as be } from "vuetify/lib/
12
12
  import { VDialog as we } from "vuetify/lib/components/VDialog/index.mjs";
13
13
  import { VImg as J } from "vuetify/lib/components/VImg/index.mjs";
14
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 = {
15
+ import { VIcon as xe } from "vuetify/lib/components/VIcon/index.mjs";
16
+ const I = typeof window < "u", H = {
17
17
  v: 4,
18
18
  api: "link-only",
19
19
  avatar: "",
@@ -41,18 +41,18 @@ const A = typeof window < "u", U = {
41
41
  }
42
42
  }
43
43
  }, W = O("user", () => {
44
- const i = Y(I({}, U));
44
+ const i = Y(j({}, H));
45
45
  function t() {
46
- if (!A)
46
+ if (!I)
47
47
  return;
48
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();
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, j(i, e)), c && s();
50
50
  }
51
51
  function s() {
52
- A && localStorage.setItem("vuetify@user", JSON.stringify(i, null, 2));
52
+ I && localStorage.setItem("vuetify@user", JSON.stringify(i, null, 2));
53
53
  }
54
54
  function n() {
55
- A && (Object.assign(i, I({}, U)), s());
55
+ I && (Object.assign(i, j({}, H)), s());
56
56
  }
57
57
  return t(), {
58
58
  ...Z(i),
@@ -60,13 +60,13 @@ const A = typeof window < "u", U = {
60
60
  save: s,
61
61
  reset: n
62
62
  };
63
- }), v = {}.VITE_API_SERVER_URL, V = O("auth", () => {
64
- const i = K(null), t = W(), s = E(!1), n = j(() => {
63
+ }), g = "https://api.vuetifyjs.com", x = O("auth", () => {
64
+ const i = K(null), t = W(), s = U(!1), n = A(() => {
65
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));
66
+ return ((o = i.value) == null ? void 0 : o.isAdmin) || ((l = i.value) == null ? void 0 : l.sponsorships.some((f) => f.isActive));
67
67
  });
68
68
  let r = !1;
69
- N(i, (o) => {
69
+ B(i, (o) => {
70
70
  if (!(o != null && o.settings))
71
71
  return;
72
72
  const l = localStorage.getItem("vuetify@user") || "{}";
@@ -76,7 +76,7 @@ const A = typeof window < "u", U = {
76
76
  });
77
77
  async function e() {
78
78
  try {
79
- await fetch(`${v}/user/settings`, {
79
+ await fetch(`${g}/user/settings`, {
80
80
  method: "POST",
81
81
  credentials: "include",
82
82
  headers: {
@@ -93,7 +93,7 @@ const A = typeof window < "u", U = {
93
93
  async function c(o = !1) {
94
94
  if (c.promise)
95
95
  return c.promise;
96
- s.value = !0, c.promise = fetch(`${v}/auth/verify`, {
96
+ s.value = !0, c.promise = fetch(`${g}/auth/verify`, {
97
97
  credentials: "include",
98
98
  headers: o ? {
99
99
  "Cache-Control": "no-cache"
@@ -111,7 +111,7 @@ const A = typeof window < "u", U = {
111
111
  c.promise = null;
112
112
  async function h(o = "github") {
113
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(
114
+ const l = `${g}/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
115
  "",
116
116
  "vuetify:authorize:popup",
117
117
  `popup,left=${z},top=${X},width=${f},height=${D},resizable`
@@ -121,24 +121,24 @@ const A = typeof window < "u", U = {
121
121
  return;
122
122
  }
123
123
  p.location.href = l;
124
- let T = -1, R = -1;
125
- function C(_) {
124
+ let C = -1, T = -1;
125
+ function N(_) {
126
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());
127
+ _.origin === g && ((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
128
  }
129
129
  function k() {
130
- window.removeEventListener("message", C), window.clearInterval(T), window.clearTimeout(R), p == null || p.close(), s.value = !1;
130
+ window.removeEventListener("message", N), window.clearInterval(C), window.clearTimeout(T), p == null || p.close(), s.value = !1;
131
131
  }
132
- window.addEventListener("message", C), T = window.setInterval(() => {
132
+ window.addEventListener("message", N), C = window.setInterval(() => {
133
133
  !p || p.closed ? (console.error("Auth popup closed"), k()) : p.postMessage({ type: "auth-request" }, "*");
134
- }, 1e3), R = window.setTimeout(() => {
134
+ }, 1e3), T = window.setTimeout(() => {
135
135
  k(), console.error("Auth timed out");
136
136
  }, 120 * 1e3);
137
137
  }
138
138
  async function $() {
139
139
  s.value = !0;
140
140
  try {
141
- await fetch(`${v}/auth/logout`, {
141
+ await fetch(`${g}/auth/logout`, {
142
142
  method: "POST",
143
143
  credentials: "include"
144
144
  }), await c(!0), i.value = null;
@@ -153,7 +153,7 @@ const A = typeof window < "u", U = {
153
153
  }
154
154
  return y() && c(), {
155
155
  user: i,
156
- url: v,
156
+ url: g,
157
157
  isLoading: s,
158
158
  verify: c,
159
159
  login: h,
@@ -161,12 +161,12 @@ const A = typeof window < "u", U = {
161
161
  isSubscriber: n,
162
162
  lastLoginProvider: y
163
163
  };
164
- }), Se = /* @__PURE__ */ L({
164
+ }), Ve = /* @__PURE__ */ L({
165
165
  __name: "VoDiscordLogin",
166
166
  setup(i) {
167
- const t = V();
168
- return (s, n) => (m(), g(F, {
169
- "prepend-icon": `svg:${a(H)}`,
167
+ const t = x();
168
+ return (s, n) => (m(), v(E, {
169
+ "prepend-icon": `svg:${a(R)}`,
170
170
  title: a(t).user ? "Connect Discord" : "Log in with Discord",
171
171
  subtitle: !a(t).user && a(t).lastLoginProvider() === "discord" ? "Last Used" : "",
172
172
  nav: "",
@@ -176,12 +176,12 @@ const A = typeof window < "u", U = {
176
176
  onClick: n[0] || (n[0] = (r) => a(t).login("discord"))
177
177
  }, null, 8, ["prepend-icon", "title", "subtitle"]));
178
178
  }
179
- }), xe = /* @__PURE__ */ L({
179
+ }), Se = /* @__PURE__ */ L({
180
180
  __name: "VoGithubLogin",
181
181
  setup(i) {
182
- const t = V();
183
- return (s, n) => (m(), g(F, {
184
- "prepend-icon": `svg:${a(B)}`,
182
+ const t = x();
183
+ return (s, n) => (m(), v(E, {
184
+ "prepend-icon": `svg:${a(F)}`,
185
185
  title: a(t).user ? "Connect GitHub" : "Log in with GitHub",
186
186
  subtitle: !a(t).user && a(t).lastLoginProvider() === "github" ? "Last Used" : "",
187
187
  "base-color": "#2a2a2a",
@@ -197,7 +197,7 @@ const A = typeof window < "u", U = {
197
197
  external: Boolean
198
198
  },
199
199
  setup(i) {
200
- const t = i, s = V(), n = W(), r = [
200
+ const t = i, s = x(), n = W(), r = [
201
201
  { title: "Options", type: "subheader" },
202
202
  {
203
203
  title: "My Dashboard",
@@ -214,7 +214,7 @@ const A = typeof window < "u", U = {
214
214
  }
215
215
  }
216
216
  ];
217
- return (e, c) => (m(), g(M, {
217
+ return (e, c) => (m(), v(M, {
218
218
  class: "vo-user-btn",
219
219
  loading: a(s).isLoading,
220
220
  icon: ""
@@ -239,7 +239,7 @@ const A = typeof window < "u", U = {
239
239
  subheader: d(({ props: h }) => [
240
240
  u(fe, { class: "text-high-emphasis text-uppercase font-weight-black" }, {
241
241
  default: d(() => [
242
- w(x(h.title), 1)
242
+ w(S(h.title), 1)
243
243
  ]),
244
244
  _: 2
245
245
  }, 1024)
@@ -249,7 +249,7 @@ const A = typeof window < "u", U = {
249
249
  ]),
250
250
  _: 1
251
251
  }, 8, ["disabled"]),
252
- a(s).user ? (m(), g(pe, {
252
+ a(s).user ? (m(), v(pe, {
253
253
  key: 0,
254
254
  image: a(n).avatar || a(s).user.picture || ""
255
255
  }, null, 8, ["image"])) : Q("", !0)
@@ -263,11 +263,11 @@ const q = (i, t) => {
263
263
  for (const [n, r] of t)
264
264
  s[n] = r;
265
265
  return s;
266
- }, ke = /* @__PURE__ */ q($e, [["__scopeId", "data-v-8e6fff6f"]]), Ie = { class: "text-center mb-6" }, Ae = /* @__PURE__ */ L({
266
+ }, ke = /* @__PURE__ */ q($e, [["__scopeId", "data-v-8e6fff6f"]]), je = { class: "text-center mb-6" }, Ie = /* @__PURE__ */ L({
267
267
  __name: "VoAuthDialog",
268
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, {
269
+ const t = x(), { mdAndDown: s, lgAndUp: n } = ve(), r = ge();
270
+ return (e, c) => !a(t).user && !a(t).isLoading ? (m(), v(we, {
271
271
  key: 0,
272
272
  "max-width": "480"
273
273
  }, {
@@ -291,10 +291,10 @@ const q = (i, t) => {
291
291
  class: "mb-4",
292
292
  height: "30"
293
293
  }, null, 8, ["src"]),
294
- b("div", Ie, [
294
+ b("div", je, [
295
295
  u(_e, { class: "text-h5 mb-1 text-md-h4 font-weight-bold" }, {
296
296
  default: d(() => [
297
- w(x(a(t).lastLoginProvider() ? "Welcome Back" : "Log in to Vuetify"), 1)
297
+ w(S(a(t).lastLoginProvider() ? "Welcome Back" : "Log in to Vuetify"), 1)
298
298
  ]),
299
299
  _: 1
300
300
  }),
@@ -311,8 +311,8 @@ const q = (i, t) => {
311
311
  width: "100%"
312
312
  }, {
313
313
  default: d(() => [
314
- u(xe, { class: "mb-3" }),
315
- u(Se)
314
+ u(Se, { class: "mb-3" }),
315
+ u(Ve)
316
316
  ]),
317
317
  _: 1
318
318
  })
@@ -321,18 +321,18 @@ const q = (i, t) => {
321
321
  })
322
322
  ]),
323
323
  _: 1
324
- })) : (m(), g(ke, { key: 1 }));
324
+ })) : (m(), v(ke, { key: 1 }));
325
325
  }
326
- }), je = (i) => (se("data-v-6f6b85b8"), i = i(), ne(), i), Oe = {
326
+ }), Ae = (i) => (se("data-v-6f6b85b8"), i = i(), ne(), i), Oe = {
327
327
  class: "d-inline-block me-2 text-decoration-none text-primary",
328
328
  href: "https://vuetifyjs.com/",
329
329
  target: "_blank",
330
330
  title: "Vuetify Documentation",
331
331
  rel: "noopener noreferrer"
332
- }, De = ["href", "title"], Te = {
332
+ }, De = ["href", "title"], Ce = {
333
333
  class: "text-caption",
334
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({
335
+ }, Te = /* @__PURE__ */ Ae(() => /* @__PURE__ */ b("span", { class: "d-none d-sm-inline-block" }, "Vuetify, LLC", -1)), Ne = /* @__PURE__ */ L({
336
336
  __name: "VoFooter",
337
337
  setup(i) {
338
338
  const t = [
@@ -348,12 +348,12 @@ const q = (i, t) => {
348
348
  },
349
349
  {
350
350
  title: "Vuetify GitHub",
351
- icon: `svg:${B}`,
351
+ icon: `svg:${F}`,
352
352
  href: "https://github.com/vuetifyjs/vuetify"
353
353
  },
354
354
  {
355
355
  title: "Vuetify Discord",
356
- icon: `svg:${H}`,
356
+ icon: `svg:${R}`,
357
357
  href: "https://community.vuetifyjs.com/"
358
358
  },
359
359
  {
@@ -362,7 +362,7 @@ const q = (i, t) => {
362
362
  href: "https://reddit.com/r/vuetifyjs"
363
363
  }
364
364
  ];
365
- return (s, n) => (m(), g(Le, {
365
+ return (s, n) => (m(), v(Le, {
366
366
  class: "vo-footer",
367
367
  theme: "dark",
368
368
  height: "40"
@@ -383,39 +383,39 @@ const q = (i, t) => {
383
383
  target: "_blank",
384
384
  rel: "noopener noreferrer"
385
385
  }, [
386
- u(Ve, { size: "18" }, {
386
+ u(xe, { size: "18" }, {
387
387
  default: d(() => [
388
- w(x(r.icon), 1)
388
+ w(S(r.icon), 1)
389
389
  ]),
390
390
  _: 2
391
391
  }, 1024)
392
392
  ], 8, De)), 64)),
393
- b("div", Te, [
394
- w(" © 2016-" + x((/* @__PURE__ */ new Date()).getFullYear()) + " ", 1),
395
- Re
393
+ b("div", Ce, [
394
+ w(" © 2016-" + S((/* @__PURE__ */ new Date()).getFullYear()) + " ", 1),
395
+ Te
396
396
  ])
397
397
  ]),
398
398
  _: 1
399
399
  }));
400
400
  }
401
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(() => {
402
+ const Pe = /* @__PURE__ */ q(Ne, [["__scopeId", "data-v-6f6b85b8"]]), V = "https://api.vuetifyjs.com", Ke = O("one", () => {
403
+ const t = new URLSearchParams(window.location.search).get("session_id"), s = x(), n = U(!1), r = A(() => {
404
404
  var o;
405
405
  return (o = s.user) == null ? void 0 : o.sponsorships.find((l) => l.platform === "stripe" && l.tierName.startsWith("sub_"));
406
- }), e = j(() => {
406
+ }), e = A(() => {
407
407
  var o;
408
408
  return (o = r.value) == null ? void 0 : o.isActive;
409
409
  });
410
410
  re(async () => {
411
411
  t && await c();
412
- }), N(e, (o) => {
412
+ }), B(e, (o) => {
413
413
  o && y();
414
414
  });
415
415
  async function c() {
416
416
  try {
417
417
  n.value = !0;
418
- const o = await fetch(`${S}/one/activate`, {
418
+ const o = await fetch(`${V}/one/activate`, {
419
419
  method: "POST",
420
420
  credentials: "include",
421
421
  headers: {
@@ -430,14 +430,14 @@ const Pe = /* @__PURE__ */ q(Ce, [["__scopeId", "data-v-6f6b85b8"]]), S = {}.VIT
430
430
  }
431
431
  }
432
432
  async function h() {
433
- n.value = !0, window.location.href = `${S}/one/subscribe`;
433
+ n.value = !0, window.location.href = `${V}/one/subscribe`;
434
434
  }
435
435
  async function $() {
436
436
  var o;
437
437
  if (r.value)
438
438
  try {
439
439
  n.value = !0;
440
- const l = await fetch(`${S}/one/cancel?subscriptionId=${(o = r.value) == null ? void 0 : o.tierName}`, {
440
+ const l = await fetch(`${V}/one/cancel?subscriptionId=${(o = r.value) == null ? void 0 : o.tierName}`, {
441
441
  method: "POST",
442
442
  credentials: "include"
443
443
  }).then((f) => f.json());
@@ -452,7 +452,7 @@ const Pe = /* @__PURE__ */ q(Ce, [["__scopeId", "data-v-6f6b85b8"]]), S = {}.VIT
452
452
  if (r.value)
453
453
  try {
454
454
  n.value = !0;
455
- const l = await fetch(`${S}/one/verify?subscriptionId=${(o = r.value) == null ? void 0 : o.tierName}`, {
455
+ const l = await fetch(`${V}/one/verify?subscriptionId=${(o = r.value) == null ? void 0 : o.tierName}`, {
456
456
  method: "POST",
457
457
  credentials: "include"
458
458
  }).then((f) => f.json());
@@ -474,13 +474,13 @@ const Pe = /* @__PURE__ */ q(Ce, [["__scopeId", "data-v-6f6b85b8"]]), S = {}.VIT
474
474
  });
475
475
  function Qe() {
476
476
  function i(t) {
477
- t.component("VoAuthDialog", Ae), t.component("VoFooter", Pe);
477
+ t.component("VoAuthDialog", Ie), t.component("VoFooter", Pe);
478
478
  }
479
479
  return { install: i };
480
480
  }
481
481
  export {
482
482
  Qe as createOne,
483
- V as useAuthStore,
483
+ x as useAuthStore,
484
484
  Ke as useOneStore,
485
485
  W as useUserStore
486
486
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vuetify/one",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "license": "MIT",