@wssto2/vue-core 0.4.25 → 0.4.27

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 (74) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/dist/{AccessGate.vue_vue_type_script_setup_true_lang-DcbZBINh.js → AccessGate.vue_vue_type_script_setup_true_lang-J5HoyGNJ.js} +1 -1
  3. package/dist/{Activity-CI-l_OFl.js → Activity-xtkZq4vG.js} +3 -3
  4. package/dist/{AdaptivePageShell.vue_vue_type_script_setup_true_lang-CxU9aNRQ.js → AdaptivePageShell.vue_vue_type_script_setup_true_lang-GUTIXuNd.js} +58 -53
  5. package/dist/{AsyncSection.vue_vue_type_script_setup_true_lang-Blj6KgCr.js → AsyncSection.vue_vue_type_script_setup_true_lang-B0NfvG3B.js} +45 -40
  6. package/dist/Avatar.vue_vue_type_script_setup_true_lang-BPj_fkJR.js +50 -0
  7. package/dist/{Changes-BdR0R20V.js → Changes-BPB8h56i.js} +4 -4
  8. package/dist/{CollectionPage.vue_vue_type_script_setup_true_lang-BNM_cbXa.js → CollectionPage.vue_vue_type_script_setup_true_lang-CVEYkb26.js} +3 -3
  9. package/dist/{DataTable.vue_vue_type_script_setup_true_lang-DPuH84I7.js → DataTable.vue_vue_type_script_setup_true_lang-DcQQ-uQS.js} +1 -1
  10. package/dist/{DeadLetters-CRTeoZS1.js → DeadLetters-DeYxkTMh.js} +4 -4
  11. package/dist/{General-hdmVP72B.js → General-BLbn4BCc.js} +2 -2
  12. package/dist/{NewRolePage-BPeKasOp.js → NewRolePage-B7DwFWPk.js} +4 -4
  13. package/dist/{ProfilePage-Dq9lcO5O.js → ProfilePage-CQYHj9Ns.js} +5 -5
  14. package/dist/{RecordHeader.vue_vue_type_script_setup_true_lang-szzWzdDu.js → RecordHeader.vue_vue_type_script_setup_true_lang-fmx0f8xi.js} +1 -1
  15. package/dist/{ResourcePage.vue_vue_type_script_setup_true_lang-BFaaFQSm.js → ResourcePage.vue_vue_type_script_setup_true_lang-BFBGvevP.js} +2 -2
  16. package/dist/{RoleEditor.vue_vue_type_script_setup_true_lang-B6g2760V.js → RoleEditor.vue_vue_type_script_setup_true_lang-DRHmjA9w.js} +2 -2
  17. package/dist/{RolePage-BYH-0fVI.js → RolePage-ODFu68Ce.js} +6 -6
  18. package/dist/{RolesPage-BRm5xDw7.js → RolesPage-B5RwSZ89.js} +4 -4
  19. package/dist/{SectionList.vue_vue_type_script_setup_true_lang-BJnz2ROc.js → SectionList.vue_vue_type_script_setup_true_lang-wyW7n3Uq.js} +1 -1
  20. package/dist/{SectionNavigator.vue_vue_type_script_setup_true_lang-BltrQnrQ.js → SectionNavigator.vue_vue_type_script_setup_true_lang-Dmv6TpCi.js} +3 -3
  21. package/dist/{Sessions-B1eKG_I2.js → Sessions-wEdUsK-U.js} +3 -3
  22. package/dist/{SettingsPage-0P38Ty4w.js → SettingsPage-BVrMihx0.js} +4 -4
  23. package/dist/{SignIn-Dp8Ji0_r.js → SignIn-CK9rq8LQ.js} +2 -2
  24. package/dist/{SignInPage-CiStJboK.js → SignInPage-BORsM1g4.js} +2 -2
  25. package/dist/{SignInTable.vue_vue_type_script_setup_true_lang-ByEAVfjv.js → SignInTable.vue_vue_type_script_setup_true_lang-AakWNvaM.js} +1 -1
  26. package/dist/{SignIns-Bo7R2Coi.js → SignIns-C-8kVf7I.js} +4 -4
  27. package/dist/Timestamp.vue_vue_type_script_setup_true_lang-DRmzPDOP.js +51 -0
  28. package/dist/{UserRecord-DGq_PPy1.js → UserRecord-C1SzdpKu.js} +7 -7
  29. package/dist/{UsersList-BulNu4aE.js → UsersList-B3hc683r.js} +5 -5
  30. package/dist/access/index.js +1 -1
  31. package/dist/app/index.js +5 -5
  32. package/dist/collection/index.js +5 -5
  33. package/dist/content/Avatar.vue.d.ts +6 -0
  34. package/dist/content/Timestamp.vue.d.ts +14 -0
  35. package/dist/content/index.js +2 -2
  36. package/dist/{contributions-DsfmDoRD.js → contributions-BVBZP5Jb.js} +1 -1
  37. package/dist/form/index.js +2 -2
  38. package/dist/{guards-Dve61KjR.js → guards-BJZjc3FZ.js} +1 -1
  39. package/dist/{http-D_D9YbLH.js → http-BFfkA7gN.js} +1 -1
  40. package/dist/identity/index.js +1 -1
  41. package/dist/{index-Yy28omu6.js → index-C3E6DcO0.js} +6 -6
  42. package/dist/{index-BmowiT1y.js → index-LP6NNnow.js} +12 -12
  43. package/dist/{index-tnSTp0cM.js → index-qUaGJ9j2.js} +3 -3
  44. package/dist/index.d.ts +1 -1
  45. package/dist/index.js +1 -1
  46. package/dist/{navigation-Cm3iChlR.js → navigation-DpcDF0rX.js} +1 -1
  47. package/dist/{neighbors-DVN_cADL.js → neighbors-RVQ4O3Qv.js} +1 -1
  48. package/dist/notifications/index.js +1 -1
  49. package/dist/overlay/MenuButton.vue.d.ts +23 -0
  50. package/dist/overlay/index.d.ts +1 -0
  51. package/dist/overlay/index.js +59 -35
  52. package/dist/page/index.js +5 -5
  53. package/dist/platform/index.d.ts +25 -1
  54. package/dist/platform/index.js +59 -49
  55. package/dist/platform/platform.d.ts +9 -5
  56. package/dist/platform/session.d.ts +10 -0
  57. package/dist/platform/sessionUser.d.ts +8 -0
  58. package/dist/platform-PZpUkkMS.js +268 -0
  59. package/dist/resource/index.js +1 -1
  60. package/dist/router/index.js +3 -3
  61. package/dist/{rowLayout-D1vrdy0s.js → rowLayout-Dh749umr.js} +1 -1
  62. package/dist/{sections-D-kD98vu.js → sections-CeZl-Jxg.js} +1 -1
  63. package/dist/shell/index.js +6 -4
  64. package/dist/state/async.d.ts +16 -0
  65. package/dist/state/index.d.ts +1 -1
  66. package/dist/state/index.js +38 -37
  67. package/dist/{status-Bh3-Cg7o.js → status-D9iQJJiz.js} +2 -2
  68. package/dist/styles.css +1 -1
  69. package/dist/testing/index.js +1 -1
  70. package/dist/testing/platform.d.ts +10 -7
  71. package/package.json +3 -2
  72. package/dist/Avatar.vue_vue_type_script_setup_true_lang-CFIheaSr.js +0 -35
  73. package/dist/Timestamp.vue_vue_type_script_setup_true_lang-CU2Y5oYl.js +0 -34
  74. package/dist/platform-q3cjODLx.js +0 -255
@@ -1,35 +0,0 @@
1
- import { defineComponent as l, computed as a, openBlock as r, createElementBlock as i, normalizeClass as c, toDisplayString as m } from "vue";
2
- function u(t) {
3
- const e = (t ?? "").trim().split(/\s+/).filter(Boolean);
4
- return (e.length > 1 ? [e[0]?.[0], e[e.length - 1]?.[0]] : [e[0]?.[0]]).filter(Boolean).join("").toLocaleUpperCase() || "?";
5
- }
6
- const d = /* @__PURE__ */ l({
7
- __name: "Avatar",
8
- props: {
9
- name: { default: "" },
10
- size: { default: "sm" },
11
- tone: { default: "neutral" }
12
- },
13
- setup(t) {
14
- const e = t, n = {
15
- xs: "size-5 text-3xs",
16
- sm: "size-7 text-2xs",
17
- md: "size-9 text-xs",
18
- lg: "size-12 text-base",
19
- // Record header: 72px on wide screens, 96px on compact ones. Square by aspect ratio, so it
20
- // can shrink in a very narrow column (enlarged text).
21
- xl: "aspect-square w-18 max-w-full text-2xl compact:w-24 compact:text-3xl"
22
- }, s = {
23
- neutral: "bg-fill text-content-muted",
24
- anchor: "bg-tile-anchor text-tile-anchor-foreground"
25
- }, o = a(() => u(e.name));
26
- return (x, p) => (r(), i("span", {
27
- "aria-hidden": "true",
28
- class: c(["inline-flex shrink-0 select-none items-center justify-center rounded-full font-semibold", [n[e.size], s[e.tone]]])
29
- }, m(o.value), 3));
30
- }
31
- });
32
- export {
33
- d as _,
34
- u as i
35
- };
@@ -1,34 +0,0 @@
1
- import { defineComponent as p, computed as a, openBlock as n, createElementBlock as s, createVNode as v, unref as r, createTextVNode as _, toDisplayString as c } from "vue";
2
- import { useI18n as f } from "vue-i18n";
3
- import { u as x, t as y } from "./format-D8X4zsx6.js";
4
- import { _ as T } from "./Icon.vue_vue_type_script_lang-D7oC-d-S.js";
5
- const g = ["datetime"], k = {
6
- key: 1,
7
- class: "text-xs text-content-muted"
8
- }, B = /* @__PURE__ */ p({
9
- __name: "Timestamp",
10
- props: {
11
- value: { default: void 0 },
12
- precision: { default: "dateTime" }
13
- },
14
- setup(i) {
15
- const m = /^\d{4}-\d{2}-\d{2}$/, e = i, { t: l } = f(), o = x(), t = a(() => y(e.value)), u = a(() => {
16
- if (t.value)
17
- return typeof e.value == "string" && m.test(e.value) ? e.value : t.value.toISOString();
18
- }), d = a(() => e.precision === "date" ? o.date(t.value) : o.dateTime(t.value));
19
- return (I, V) => t.value ? (n(), s("time", {
20
- key: 0,
21
- datetime: u.value,
22
- class: "inline-flex items-center gap-2 text-xs text-content"
23
- }, [
24
- v(r(T), {
25
- name: "calendarEventFill",
26
- class: "text-content-muted"
27
- }),
28
- _(c(d.value), 1)
29
- ], 8, g)) : (n(), s("span", k, c(r(l)("core.state.empty")), 1));
30
- }
31
- });
32
- export {
33
- B as _
34
- };
@@ -1,255 +0,0 @@
1
- import { c as P } from "./client-k9euDWF4.js";
2
- import { d as k } from "./context-Ch1r4fdN.js";
3
- import { a as x, A as q } from "./error-CD7x0Jrz.js";
4
- import { shallowRef as U } from "vue";
5
- const _ = (e, n) => e.level === n.level && e.id === n.id, z = (e, n) => Object.prototype.hasOwnProperty.call(e, n);
6
- function C(e, n = {}) {
7
- const t = n.covers ?? _;
8
- function o(r) {
9
- const s = e();
10
- return !s || !z(s.permissions, r) || s.unavailable.includes(r) ? null : s.permissions[r] ?? null;
11
- }
12
- function a(r, s) {
13
- const i = o(r);
14
- return i ? s ? (i.clauses.length > 0 ? i.clauses.map((c) => c.scope) : [i.scope]).some((c) => t(c, s)) : !0 : !1;
15
- }
16
- return {
17
- get root() {
18
- return e()?.root ?? !1;
19
- },
20
- can: a,
21
- canAny: (r) => r.some((s) => a(s)),
22
- canAll: (r) => r.every((s) => a(s)),
23
- held: o
24
- };
25
- }
26
- const A = ["own", "own_location", "all"], m = (e) => typeof e == "object" && e !== null && !Array.isArray(e);
27
- function $(e, n, t) {
28
- return !m(e) || typeof e.level != "string" ? (t.push(`${n}: expected { level: string, id?: number }`), { level: "" }) : (e.id !== void 0 && typeof e.id != "number" && t.push(`${n}.id: expected number`), typeof e.id == "number" ? { level: e.level, id: e.id } : { level: e.level });
29
- }
30
- function S(e, n, t) {
31
- return typeof e == "string" && A.includes(e) ? e : (t.push(`${n}: expected one of ${A.join(", ")}`), "own");
32
- }
33
- function I(e) {
34
- const n = [], t = {}, o = { root: !1, permissions: {}, unavailable: [] };
35
- if (!m(e)) return { snapshot: o, issues: ["access: expected an object"] };
36
- if (!m(e.permissions)) n.push("access.permissions: expected an object");
37
- else
38
- for (const [r, s] of Object.entries(e.permissions)) {
39
- const i = `access.permissions.${r}`;
40
- if (!m(s)) {
41
- n.push(`${i}: expected an object`);
42
- continue;
43
- }
44
- const u = (Array.isArray(s.clauses) ? s.clauses : []).map((c, y) => {
45
- const l = `${i}.clauses[${y}]`;
46
- if (!m(c))
47
- return n.push(`${l}: expected an object`), { scope: { level: "" }, qualifier: "own" };
48
- const f = { scope: $(c.scope, `${l}.scope`, n), qualifier: S(c.qualifier, `${l}.qualifier`, n) };
49
- return typeof c.role == "string" ? { ...f, role: c.role } : f;
50
- });
51
- t[r] = {
52
- scope: $(s.scope, `${i}.scope`, n),
53
- qualifier: S(s.qualifier, `${i}.qualifier`, n),
54
- clauses: u
55
- };
56
- }
57
- const a = e.unavailable ?? [];
58
- return (!Array.isArray(a) || !a.every((r) => typeof r == "string")) && n.push("access.unavailable: expected an array of strings"), {
59
- snapshot: {
60
- root: e.root === !0,
61
- permissions: t,
62
- unavailable: Array.isArray(a) ? a.filter((r) => typeof r == "string") : []
63
- },
64
- issues: n
65
- };
66
- }
67
- const T = (e) => typeof e == "object" && e !== null && !Array.isArray(e);
68
- function j(e, n, t = "navigation") {
69
- return Array.isArray(e) ? e.flatMap((o, a) => {
70
- const r = `${t}[${a}]`;
71
- if (!T(o) || typeof o.i18n != "string")
72
- return n.push(`${r}: expected an object with an i18n key`), [];
73
- for (const i of ["icon", "route"])
74
- o[i] != null && typeof o[i] != "string" && n.push(`${r}.${i}: expected a string`);
75
- const s = o.children == null ? void 0 : j(o.children, n, `${r}.children`);
76
- return [
77
- {
78
- i18n: o.i18n,
79
- ...typeof o.icon == "string" && { icon: o.icon },
80
- ...typeof o.route == "string" && { route: o.route },
81
- ...s && { children: s }
82
- }
83
- ];
84
- }) : (n.push(`${t}: expected an array`), []);
85
- }
86
- const b = (e) => typeof e == "object" && e !== null && !Array.isArray(e), N = (e) => {
87
- if (b(e) && (typeof e.id == "number" || typeof e.id == "string")) return { id: e.id };
88
- throw new TypeError("expected an object with a numeric or string id");
89
- };
90
- function B(e, n = N) {
91
- const t = [];
92
- if (!b(e)) throw O(["expected an object"]);
93
- let o = null;
94
- try {
95
- o = n(e.user);
96
- } catch (u) {
97
- t.push(`user: ${u instanceof Error ? u.message : "invalid"}`);
98
- }
99
- let a = null;
100
- if (e.expires_at !== void 0 && e.expires_at !== null) {
101
- const u = typeof e.expires_at == "string" ? new Date(e.expires_at) : null;
102
- u === null || Number.isNaN(u.getTime()) ? t.push("expires_at: expected an ISO date-time string") : a = u;
103
- }
104
- let r;
105
- if (e.impersonator !== void 0 && e.impersonator !== null) {
106
- const u = e.impersonator;
107
- b(u) && (typeof u.id == "number" || typeof u.id == "string") && typeof u.name == "string" ? r = { id: u.id, name: u.name } : t.push("impersonator: expected { id, name }");
108
- }
109
- const s = I(e.access);
110
- t.push(...s.issues);
111
- const i = e.navigation === void 0 || e.navigation === null ? void 0 : j(e.navigation, t);
112
- if (o === null || t.length > 0) throw O(t);
113
- return { user: o, expiresAt: a, access: s.snapshot, ...r && { impersonator: r }, ...i && { navigation: i } };
114
- }
115
- const O = (e) => new q({ kind: "malformed", message: `Unreadable session payload: ${e.join("; ")}` });
116
- function F(e, n = {}) {
117
- const { mePath: t = "/auth/me", signOutPath: o = "/auth/logout", parseUser: a } = n;
118
- return {
119
- async load(r) {
120
- try {
121
- const { data: s } = await e.get(t, { signal: r, handleUnauthorized: !1 });
122
- return B(s, a);
123
- } catch (s) {
124
- if (x(s) && s.kind === "unauthorized") return null;
125
- throw s;
126
- }
127
- },
128
- async signOut() {
129
- try {
130
- await e.post(o, void 0, { handleUnauthorized: !1 });
131
- } catch (r) {
132
- if (!(x(r) && r.kind === "unauthorized")) throw r;
133
- }
134
- }
135
- };
136
- }
137
- function E(e) {
138
- return e.status === "authenticated" ? e : e.status === "anonymous" && e.reason === "expired" ? e.previous ?? null : null;
139
- }
140
- const w = 3e3;
141
- function H(e, n = {}) {
142
- const t = U({ status: "unknown" });
143
- let o = 0;
144
- const a = new Set(n.beforeSignOut ? [n.beforeSignOut] : []);
145
- let r = !1, s = null, i = null;
146
- function u() {
147
- o++, i?.controller.abort(), i = null;
148
- }
149
- async function c(l) {
150
- const f = new AbortController();
151
- let h;
152
- const g = new Promise((d) => {
153
- h = setTimeout(() => {
154
- f.abort(), n.onError?.(new Error(`A before-sign-out hook did not finish within ${w} ms; signing out without it.`)), d();
155
- }, w);
156
- }), v = Promise.all(
157
- [...a].map(async (d) => {
158
- try {
159
- await d(l, f.signal);
160
- } catch (p) {
161
- n.onError?.(p);
162
- }
163
- })
164
- ).then(() => {
165
- });
166
- await Promise.race([v, g]), clearTimeout(h);
167
- }
168
- function y() {
169
- if (i) return i.promise;
170
- const l = o, f = new AbortController(), h = t.value, g = E(h) !== null;
171
- g || (t.value = { status: "loading" });
172
- const v = async () => {
173
- try {
174
- const p = await e.load(f.signal);
175
- if (o !== l) return t.value;
176
- t.value = p ? { status: "authenticated", ...p } : { status: "anonymous", reason: "none" };
177
- } catch (p) {
178
- if (o !== l) return t.value;
179
- n.onError?.(p), t.value = g ? h : { status: "failed", error: p };
180
- } finally {
181
- o === l && (i = null);
182
- }
183
- return t.value;
184
- }, d = Promise.resolve().then(v);
185
- return i = { controller: f, promise: d }, d;
186
- }
187
- return {
188
- state: t,
189
- restore: () => t.value.status === "unknown" || t.value.status === "failed" ? y() : i?.promise ?? Promise.resolve(t.value),
190
- refresh: y,
191
- establish(l) {
192
- u(), t.value = { status: "authenticated", ...l };
193
- },
194
- expire() {
195
- if (t.value.status !== "authenticated") return;
196
- const { status: l, ...f } = t.value;
197
- u(), t.value = r && !t.value.impersonator ? { status: "anonymous", reason: "expired", previous: f } : { status: "anonymous", reason: "expired" }, n.onExpired?.();
198
- },
199
- signOut() {
200
- return s ?? (s = (async () => {
201
- try {
202
- const l = t.value;
203
- l.status === "authenticated" && a.size > 0 && await c(l.user), u(), t.value = { status: "anonymous", reason: "signedOut" }, await e.signOut();
204
- } finally {
205
- s = null;
206
- }
207
- })()), s;
208
- },
209
- holdExpired(l) {
210
- r = l;
211
- },
212
- onBeforeSignOut(l) {
213
- return a.add(l), () => void a.delete(l);
214
- }
215
- };
216
- }
217
- function M(e) {
218
- let n = null;
219
- const t = P({
220
- baseUrl: e.config.apiBase,
221
- transport: e.transport,
222
- headers: e.headers,
223
- credentials: e.credentials,
224
- requestId: e.requestId,
225
- async onUnauthorized() {
226
- return r.state.value.status !== "authenticated" ? "fail" : e.renewSession && (n ?? (n = e.renewSession(r, t).then(
227
- (i) => i,
228
- () => !1
229
- ).finally(() => {
230
- n = null;
231
- })), await n) ? "retry" : (r.expire(), "fail");
232
- }
233
- }), o = e.session ?? ((i) => F(i)), a = typeof o == "function" ? o(t) : o, r = H(a, { onError: e.onSessionError, onExpired: e.onSessionExpired, beforeSignOut: e.beforeSignOut }), s = C(
234
- () => E(r.state.value)?.access ?? null,
235
- { covers: e.covers }
236
- );
237
- return { config: e.config, http: t, session: r, access: s };
238
- }
239
- const [Q, G] = k("platform");
240
- function J(e, n) {
241
- e.provide(Q, n);
242
- }
243
- export {
244
- M as a,
245
- w as b,
246
- C as c,
247
- H as d,
248
- F as e,
249
- B as f,
250
- Q as g,
251
- E as h,
252
- J as i,
253
- j as p,
254
- G as u
255
- };