@vuetify/one 2.5.1 → 2.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.
@@ -1,8 +1,8 @@
1
- import { defineStore as k } from "pinia";
1
+ import { defineStore as $ } from "pinia";
2
2
  import { ref as E, reactive as z, watch as A, toRefs as V, computed as f, shallowRef as U, nextTick as M } from "vue";
3
3
  import { merge as F } from "lodash-es";
4
4
  import { useRoute as X, useRouter as H } from "vue-router";
5
- const _ = k("queue", () => {
5
+ const _ = $("queue", () => {
6
6
  const e = E([]);
7
7
  function s(o) {
8
8
  const u = typeof o == "string" ? { text: o } : o;
@@ -21,7 +21,7 @@ const _ = k("queue", () => {
21
21
  show: s,
22
22
  showError: t
23
23
  };
24
- }), C = k("http", {
24
+ }), C = $("http", {
25
25
  state: () => ({
26
26
  url: ""
27
27
  }),
@@ -80,6 +80,8 @@ function G(e) {
80
80
  showErrors: !0,
81
81
  wordWrap: !1
82
82
  },
83
+ studio: {},
84
+ link: {},
83
85
  docs: {
84
86
  api: e.api || "link-only",
85
87
  composition: e.composition || "composition",
@@ -140,6 +142,8 @@ const W = typeof window < "u", P = {
140
142
  showErrors: !0,
141
143
  wordWrap: !1
142
144
  },
145
+ studio: {},
146
+ link: {},
143
147
  docs: {
144
148
  api: "link-only",
145
149
  composition: "composition",
@@ -184,7 +188,7 @@ const W = typeof window < "u", P = {
184
188
  sync: !0,
185
189
  devmode: !1
186
190
  }
187
- }, Z = k("user", () => {
191
+ }, Z = $("user", () => {
188
192
  const e = z(structuredClone(P));
189
193
  A(e, t, { deep: !0 });
190
194
  function s() {
@@ -229,8 +233,8 @@ function J() {
229
233
  () => e.query
230
234
  );
231
235
  }
232
- const Q = k("one", () => {
233
- const e = J(), s = H(), t = B(), o = C(), u = _(), n = U(!1), c = U(!1), d = E(), y = E([]), g = f(() => e.value.session_id), T = f(() => d.value?.items[0].plan.interval), p = f(() => d.value?.items[0].plan.type), I = E([]), h = f(() => t.user?.sponsorships.find((r) => r.platform === "stripe" && r.tierName.startsWith("sub_"))), q = f(() => !!h.value?.tierName), a = f(() => t.user?.sponsorships.reduce((r, m) => {
236
+ const Q = $("one", () => {
237
+ const e = J(), s = H(), t = B(), o = C(), u = _(), n = U(!1), c = U(!1), d = E(null), y = E([]), g = f(() => e.value.session_id), T = f(() => d.value?.items[0].plan.interval), p = f(() => d.value?.items[0].plan.type), I = E([]), h = f(() => t.user?.sponsorships.find((r) => r.platform === "stripe" && r.tierName.startsWith("sub_"))), q = f(() => !!h.value?.tierName), a = f(() => t.user?.sponsorships.reduce((r, m) => {
234
238
  if (!m.isActive || m.interval === "once")
235
239
  return r;
236
240
  const b = m.interval === "month" ? m.amount : m.amount / 12;
@@ -248,7 +252,7 @@ const Q = k("one", () => {
248
252
  }, { immediate: !0 });
249
253
  async function O() {
250
254
  try {
251
- n.value = !0, await o.post("/one/activate", { sessionId: g.value }), await t.verify(!0), await $();
255
+ n.value = !0, await o.post("/one/activate", { sessionId: g.value }), await t.verify(!0), await k();
252
256
  const r = new URL(window.location.href), m = r.searchParams;
253
257
  m.delete("session_id"), m.delete("team"), history.pushState(null, "", r.toString());
254
258
  } catch (r) {
@@ -291,7 +295,7 @@ const Q = k("one", () => {
291
295
  n.value = !1;
292
296
  }
293
297
  }
294
- async function $() {
298
+ async function k() {
295
299
  try {
296
300
  n.value = !0;
297
301
  const r = await o.get("/one/info");
@@ -333,9 +337,9 @@ const Q = k("one", () => {
333
337
  modify: x,
334
338
  resetQuery: w,
335
339
  subscribe: R,
336
- subscriptionInfo: $
340
+ subscriptionInfo: k
337
341
  };
338
- }), D = k("team", () => {
342
+ }), D = $("team", () => {
339
343
  const e = J(), s = B(), t = Q(), o = C(), u = _(), n = U(!1), c = E(null), d = E(!1), y = f(() => e.value.invite), g = f(
340
344
  () => c.value ? t.access?.some((a) => ["one/team", "snips/team"].includes(a)) : !1
341
345
  );
@@ -400,7 +404,7 @@ const Q = k("one", () => {
400
404
  joinTeam: I,
401
405
  clearTeamQuery: h
402
406
  };
403
- }), B = k("auth", () => {
407
+ }), B = $("auth", () => {
404
408
  const e = E(!1), s = E(null), t = C(), o = Z(), u = H(), n = U(!1), c = Q(), d = D(), y = _();
405
409
  let g = !!a();
406
410
  A(s, (i) => {
@@ -463,15 +467,15 @@ const Q = k("one", () => {
463
467
  S.location.href = l;
464
468
  let R = -1, j = -1;
465
469
  function x(w) {
466
- w.origin === t.url && w.data?.type === "auth-response" && (w.data.status === "success" ? (s.value || localStorage.setItem("vuetify@lastLoginProvider", i), s.value = w.data.body.user, c.access = w.data.body.access, d.team = w.data.body.user?.team, T()) : console.error(w.data.message), $());
470
+ w.origin === t.url && w.data?.type === "auth-response" && (w.data.status === "success" ? (s.value || localStorage.setItem("vuetify@lastLoginProvider", i), s.value = w.data.body.user, c.access = w.data.body.access, d.team = w.data.body.user?.team, T()) : console.error(w.data.message), k());
467
471
  }
468
- function $() {
472
+ function k() {
469
473
  window.removeEventListener("message", x), window.clearInterval(R), window.clearTimeout(j), S?.close(), n.value = !1;
470
474
  }
471
475
  window.addEventListener("message", x), R = window.setInterval(() => {
472
- !S || S.closed ? (console.error("Auth popup closed"), $()) : S.postMessage({ type: "auth-request" }, "*");
476
+ !S || S.closed ? (console.error("Auth popup closed"), k()) : S.postMessage({ type: "auth-request" }, "*");
473
477
  }, 1e3), j = window.setTimeout(() => {
474
- $(), console.error("Auth timed out");
478
+ k(), console.error("Auth timed out");
475
479
  }, 120 * 1e3);
476
480
  }
477
481
  async function h(i) {
package/dist/index.d.ts CHANGED
@@ -161,6 +161,7 @@ interface VOneUser {
161
161
  isAdmin: boolean;
162
162
  role: 'super' | 'admin' | 'editor' | 'user';
163
163
  name: string;
164
+ shortid: string;
164
165
  picture: string;
165
166
  settings: Record<string, any> | null;
166
167
  createdAt: string;
@@ -440,7 +441,7 @@ interface Invoice {
440
441
  pdf: string;
441
442
  }
442
443
  interface OneState {
443
- info: Ref<Info | undefined>;
444
+ info: Ref<Info | null>;
444
445
  interval: ComputedRef<SubscriptionItemPlan['interval'] | undefined>;
445
446
  subscriptionType: ComputedRef<SubscriptionItemPlan['type'] | undefined>;
446
447
  access: Ref<string[]>;
@@ -1044,11 +1045,47 @@ declare const useUserStore: pinia.StoreDefinition<"user", Pick<{
1044
1045
  ecosystem: globalThis.Ref<{
1045
1046
  bin: {
1046
1047
  wordWrap: boolean;
1048
+ dashboard?: {
1049
+ [x: string]: any;
1050
+ sortBy: {
1051
+ key: string;
1052
+ order?: boolean | "asc" | "desc" | undefined;
1053
+ }[];
1054
+ itemsPerPage: number;
1055
+ } | undefined;
1047
1056
  };
1048
1057
  play: {
1049
1058
  showErrors: boolean;
1050
1059
  wordWrap: boolean;
1051
- };
1060
+ dashboard?: {
1061
+ [x: string]: any;
1062
+ sortBy: {
1063
+ key: string;
1064
+ order?: boolean | "asc" | "desc" | undefined;
1065
+ }[];
1066
+ itemsPerPage: number;
1067
+ } | undefined;
1068
+ };
1069
+ studio?: {
1070
+ dashboard?: {
1071
+ [x: string]: any;
1072
+ sortBy: {
1073
+ key: string;
1074
+ order?: boolean | "asc" | "desc" | undefined;
1075
+ }[];
1076
+ itemsPerPage: number;
1077
+ } | undefined;
1078
+ } | undefined;
1079
+ link?: {
1080
+ dashboard?: {
1081
+ [x: string]: any;
1082
+ sortBy: {
1083
+ key: string;
1084
+ order?: boolean | "asc" | "desc" | undefined;
1085
+ }[];
1086
+ itemsPerPage: number;
1087
+ } | undefined;
1088
+ } | undefined;
1052
1089
  docs: {
1053
1090
  api: "link-only" | "inline";
1054
1091
  composition: "composition" | "options";
@@ -1064,11 +1101,47 @@ declare const useUserStore: pinia.StoreDefinition<"user", Pick<{
1064
1101
  }, {
1065
1102
  bin: {
1066
1103
  wordWrap: boolean;
1104
+ dashboard?: {
1105
+ [x: string]: any;
1106
+ sortBy: {
1107
+ key: string;
1108
+ order?: boolean | "asc" | "desc" | undefined;
1109
+ }[];
1110
+ itemsPerPage: number;
1111
+ } | undefined;
1067
1112
  };
1068
1113
  play: {
1069
1114
  showErrors: boolean;
1070
1115
  wordWrap: boolean;
1071
- };
1116
+ dashboard?: {
1117
+ [x: string]: any;
1118
+ sortBy: {
1119
+ key: string;
1120
+ order?: boolean | "asc" | "desc" | undefined;
1121
+ }[];
1122
+ itemsPerPage: number;
1123
+ } | undefined;
1124
+ };
1125
+ studio?: {
1126
+ dashboard?: {
1127
+ [x: string]: any;
1128
+ sortBy: {
1129
+ key: string;
1130
+ order?: boolean | "asc" | "desc" | undefined;
1131
+ }[];
1132
+ itemsPerPage: number;
1133
+ } | undefined;
1134
+ } | undefined;
1135
+ link?: {
1136
+ dashboard?: {
1137
+ [x: string]: any;
1138
+ sortBy: {
1139
+ key: string;
1140
+ order?: boolean | "asc" | "desc" | undefined;
1141
+ }[];
1142
+ itemsPerPage: number;
1143
+ } | undefined;
1144
+ } | undefined;
1072
1145
  docs: {
1073
1146
  api: "link-only" | "inline";
1074
1147
  composition: "composition" | "options";
@@ -1151,11 +1224,47 @@ declare const useUserStore: pinia.StoreDefinition<"user", Pick<{
1151
1224
  ecosystem: globalThis.Ref<{
1152
1225
  bin: {
1153
1226
  wordWrap: boolean;
1227
+ dashboard?: {
1228
+ [x: string]: any;
1229
+ sortBy: {
1230
+ key: string;
1231
+ order?: boolean | "asc" | "desc" | undefined;
1232
+ }[];
1233
+ itemsPerPage: number;
1234
+ } | undefined;
1154
1235
  };
1155
1236
  play: {
1156
1237
  showErrors: boolean;
1157
1238
  wordWrap: boolean;
1158
- };
1239
+ dashboard?: {
1240
+ [x: string]: any;
1241
+ sortBy: {
1242
+ key: string;
1243
+ order?: boolean | "asc" | "desc" | undefined;
1244
+ }[];
1245
+ itemsPerPage: number;
1246
+ } | undefined;
1247
+ };
1248
+ studio?: {
1249
+ dashboard?: {
1250
+ [x: string]: any;
1251
+ sortBy: {
1252
+ key: string;
1253
+ order?: boolean | "asc" | "desc" | undefined;
1254
+ }[];
1255
+ itemsPerPage: number;
1256
+ } | undefined;
1257
+ } | undefined;
1258
+ link?: {
1259
+ dashboard?: {
1260
+ [x: string]: any;
1261
+ sortBy: {
1262
+ key: string;
1263
+ order?: boolean | "asc" | "desc" | undefined;
1264
+ }[];
1265
+ itemsPerPage: number;
1266
+ } | undefined;
1267
+ } | undefined;
1159
1268
  docs: {
1160
1269
  api: "link-only" | "inline";
1161
1270
  composition: "composition" | "options";
@@ -1171,11 +1280,47 @@ declare const useUserStore: pinia.StoreDefinition<"user", Pick<{
1171
1280
  }, {
1172
1281
  bin: {
1173
1282
  wordWrap: boolean;
1283
+ dashboard?: {
1284
+ [x: string]: any;
1285
+ sortBy: {
1286
+ key: string;
1287
+ order?: boolean | "asc" | "desc" | undefined;
1288
+ }[];
1289
+ itemsPerPage: number;
1290
+ } | undefined;
1174
1291
  };
1175
1292
  play: {
1176
1293
  showErrors: boolean;
1177
1294
  wordWrap: boolean;
1178
- };
1295
+ dashboard?: {
1296
+ [x: string]: any;
1297
+ sortBy: {
1298
+ key: string;
1299
+ order?: boolean | "asc" | "desc" | undefined;
1300
+ }[];
1301
+ itemsPerPage: number;
1302
+ } | undefined;
1303
+ };
1304
+ studio?: {
1305
+ dashboard?: {
1306
+ [x: string]: any;
1307
+ sortBy: {
1308
+ key: string;
1309
+ order?: boolean | "asc" | "desc" | undefined;
1310
+ }[];
1311
+ itemsPerPage: number;
1312
+ } | undefined;
1313
+ } | undefined;
1314
+ link?: {
1315
+ dashboard?: {
1316
+ [x: string]: any;
1317
+ sortBy: {
1318
+ key: string;
1319
+ order?: boolean | "asc" | "desc" | undefined;
1320
+ }[];
1321
+ itemsPerPage: number;
1322
+ } | undefined;
1323
+ } | undefined;
1179
1324
  docs: {
1180
1325
  api: "link-only" | "inline";
1181
1326
  composition: "composition" | "options";
@@ -1258,11 +1403,47 @@ declare const useUserStore: pinia.StoreDefinition<"user", Pick<{
1258
1403
  ecosystem: globalThis.Ref<{
1259
1404
  bin: {
1260
1405
  wordWrap: boolean;
1406
+ dashboard?: {
1407
+ [x: string]: any;
1408
+ sortBy: {
1409
+ key: string;
1410
+ order?: boolean | "asc" | "desc" | undefined;
1411
+ }[];
1412
+ itemsPerPage: number;
1413
+ } | undefined;
1261
1414
  };
1262
1415
  play: {
1263
1416
  showErrors: boolean;
1264
1417
  wordWrap: boolean;
1265
- };
1418
+ dashboard?: {
1419
+ [x: string]: any;
1420
+ sortBy: {
1421
+ key: string;
1422
+ order?: boolean | "asc" | "desc" | undefined;
1423
+ }[];
1424
+ itemsPerPage: number;
1425
+ } | undefined;
1426
+ };
1427
+ studio?: {
1428
+ dashboard?: {
1429
+ [x: string]: any;
1430
+ sortBy: {
1431
+ key: string;
1432
+ order?: boolean | "asc" | "desc" | undefined;
1433
+ }[];
1434
+ itemsPerPage: number;
1435
+ } | undefined;
1436
+ } | undefined;
1437
+ link?: {
1438
+ dashboard?: {
1439
+ [x: string]: any;
1440
+ sortBy: {
1441
+ key: string;
1442
+ order?: boolean | "asc" | "desc" | undefined;
1443
+ }[];
1444
+ itemsPerPage: number;
1445
+ } | undefined;
1446
+ } | undefined;
1266
1447
  docs: {
1267
1448
  api: "link-only" | "inline";
1268
1449
  composition: "composition" | "options";
@@ -1278,11 +1459,47 @@ declare const useUserStore: pinia.StoreDefinition<"user", Pick<{
1278
1459
  }, {
1279
1460
  bin: {
1280
1461
  wordWrap: boolean;
1462
+ dashboard?: {
1463
+ [x: string]: any;
1464
+ sortBy: {
1465
+ key: string;
1466
+ order?: boolean | "asc" | "desc" | undefined;
1467
+ }[];
1468
+ itemsPerPage: number;
1469
+ } | undefined;
1281
1470
  };
1282
1471
  play: {
1283
1472
  showErrors: boolean;
1284
1473
  wordWrap: boolean;
1285
- };
1474
+ dashboard?: {
1475
+ [x: string]: any;
1476
+ sortBy: {
1477
+ key: string;
1478
+ order?: boolean | "asc" | "desc" | undefined;
1479
+ }[];
1480
+ itemsPerPage: number;
1481
+ } | undefined;
1482
+ };
1483
+ studio?: {
1484
+ dashboard?: {
1485
+ [x: string]: any;
1486
+ sortBy: {
1487
+ key: string;
1488
+ order?: boolean | "asc" | "desc" | undefined;
1489
+ }[];
1490
+ itemsPerPage: number;
1491
+ } | undefined;
1492
+ } | undefined;
1493
+ link?: {
1494
+ dashboard?: {
1495
+ [x: string]: any;
1496
+ sortBy: {
1497
+ key: string;
1498
+ order?: boolean | "asc" | "desc" | undefined;
1499
+ }[];
1500
+ itemsPerPage: number;
1501
+ } | undefined;
1502
+ } | undefined;
1286
1503
  docs: {
1287
1504
  api: "link-only" | "inline";
1288
1505
  composition: "composition" | "options";