@wssto2/vue-core 0.12.1 → 0.13.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 (124) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/README.md +4 -2
  3. package/dist/{AccessGate.vue_vue_type_script_setup_true_lang-CzQbD2Pc.js → AccessGate.vue_vue_type_script_setup_true_lang-DEzXovsY.js} +1 -1
  4. package/dist/{Activity-CdkJW68R.js → Activity-ChfxdvXf.js} +24 -23
  5. package/dist/{AdaptivePageShell.vue_vue_type_script_setup_true_lang-D5i77H6S.js → AdaptivePageShell.vue_vue_type_script_setup_true_lang-lPj9hPqV.js} +33 -33
  6. package/dist/{Changes-DxK_QfiB.js → Changes-BCa43_mO.js} +18 -17
  7. package/dist/{CollectionPage.vue_vue_type_script_setup_true_lang-x0jyJ01f.js → CollectionPage.vue_vue_type_script_setup_true_lang-C1GCvyZx.js} +6 -6
  8. package/dist/{DataTable.vue_vue_type_script_setup_true_lang-C_ZytnW-.js → DataTable.vue_vue_type_script_setup_true_lang-B9r9M5Gt.js} +1 -1
  9. package/dist/{DateField.vue_vue_type_script_setup_true_lang-CeNwBbJT.js → DateField.vue_vue_type_script_setup_true_lang-B5UUY1OO.js} +2 -2
  10. package/dist/{DeadLetters-DnA7LP1w.js → DeadLetters-wFTqhISU.js} +5 -5
  11. package/dist/{General-2matxl2Y.js → General-jW7u4MjH.js} +16 -15
  12. package/dist/{IncidentRecord-Bt3G4HlX.js → IncidentRecord-zTemLz2R.js} +6 -6
  13. package/dist/{IncidentsList-2iwgqp9J.js → IncidentsList-yu0xSMrH.js} +6 -6
  14. package/dist/{NewRolePage-DhGFwvk3.js → NewRolePage-CQ5UVaHs.js} +3 -3
  15. package/dist/{NumberField.vue_vue_type_script_setup_true_lang-B3UrXNqH.js → NumberField.vue_vue_type_script_setup_true_lang-YVgf5CP6.js} +1 -1
  16. package/dist/{PersonAccess.vue_vue_type_script_setup_true_lang-DbGZSNQc.js → PersonAccess.vue_vue_type_script_setup_true_lang-CWCt9_dM.js} +2 -2
  17. package/dist/{ProfilePage-CpuyDBAv.js → ProfilePage-Ca3x3UAH.js} +79 -77
  18. package/dist/{RecordHeader.vue_vue_type_script_setup_true_lang-DqGc3Jyo.js → RecordHeader.vue_vue_type_script_setup_true_lang-Do_ATJwT.js} +1 -1
  19. package/dist/{ResourcePage.vue_vue_type_script_setup_true_lang-DljhsTU4.js → ResourcePage.vue_vue_type_script_setup_true_lang-Coz91xht.js} +1 -1
  20. package/dist/{RoleEditor.vue_vue_type_script_setup_true_lang-C0FIotFA.js → RoleEditor.vue_vue_type_script_setup_true_lang-d_aaeXTT.js} +2 -2
  21. package/dist/{RolePage-DaNv049g.js → RolePage-BUj1w1m1.js} +5 -5
  22. package/dist/{RolesPage-6hlzJes_.js → RolesPage-NKzBUsrM.js} +3 -3
  23. package/dist/{SectionNavigator.vue_vue_type_script_setup_true_lang-Dh3sXUt_.js → SectionNavigator.vue_vue_type_script_setup_true_lang-DfKEhTFv.js} +2 -2
  24. package/dist/{ServiceAccountDialog.vue_vue_type_script_setup_true_lang-FJbWxME_.js → ServiceAccountDialog.vue_vue_type_script_setup_true_lang-4nbhEpv_.js} +10 -9
  25. package/dist/{ServiceAccountRecord-0-JF5lRx.js → ServiceAccountRecord-ClbyeLhL.js} +8 -8
  26. package/dist/{ServiceAccountsList-DcsnOcf-.js → ServiceAccountsList-B2VDnYxD.js} +5 -5
  27. package/dist/{Sessions-DgWhpk-i.js → Sessions-BjkciyHH.js} +23 -21
  28. package/dist/{SettingsPage-BXPWATYU.js → SettingsPage-Csb14qsx.js} +7 -7
  29. package/dist/{SignIn-DPoUwHZd.js → SignIn-DPFMv4C7.js} +14 -12
  30. package/dist/{SignInPage-OyrVemro.js → SignInPage-DukoFqkt.js} +2 -2
  31. package/dist/{SignIns-BMDrZVVp.js → SignIns-DvdpNkiS.js} +23 -22
  32. package/dist/{TimeField.vue_vue_type_script_setup_true_lang-D-Em4glH.js → TimeField.vue_vue_type_script_setup_true_lang-DpDXHH7u.js} +2 -2
  33. package/dist/{Timestamp.vue_vue_type_script_setup_true_lang-ClZAAUMd.js → Timestamp.vue_vue_type_script_setup_true_lang-DlEUKWra.js} +1 -1
  34. package/dist/{UserRecord-BW-gdCqi.js → UserRecord-B9SeSWQh.js} +57 -55
  35. package/dist/{UsersList-B3ZF_1Dj.js → UsersList-CREG8q3l.js} +4 -4
  36. package/dist/access/index.js +4 -4
  37. package/dist/app/application.d.ts +14 -6
  38. package/dist/app/current.d.ts +11 -0
  39. package/dist/app/environment.d.ts +8 -0
  40. package/dist/app/index.d.ts +1 -0
  41. package/dist/app/index.js +14 -12
  42. package/dist/application-DomS6sbx.js +435 -0
  43. package/dist/collection/http.d.ts +16 -1
  44. package/dist/collection/index.d.ts +1 -1
  45. package/dist/collection/index.js +34 -32
  46. package/dist/content/Money.vue.d.ts +1 -1
  47. package/dist/content/index.js +151 -158
  48. package/dist/{contributions-CeG4bszd.js → contributions-obnyn03x.js} +1 -1
  49. package/dist/current-B0lHKTWr.js +17 -0
  50. package/dist/form/DateField.vue.d.ts +2 -2
  51. package/dist/form/DateTimeField.vue.d.ts +2 -2
  52. package/dist/form/MoneyField.vue.d.ts +1 -1
  53. package/dist/form/NumberField.vue.d.ts +1 -1
  54. package/dist/form/date/MonthYearPanel.vue.d.ts +1 -1
  55. package/dist/form/date/days.d.ts +3 -3
  56. package/dist/form/index.d.ts +2 -0
  57. package/dist/form/index.js +1111 -1081
  58. package/dist/form/zodErrorMap.d.ts +35 -0
  59. package/dist/format/format.d.ts +51 -6
  60. package/dist/format/index.d.ts +1 -1
  61. package/dist/format/index.js +1 -1
  62. package/dist/format-DoKs29bZ.js +118 -0
  63. package/dist/{guards-Biv_SlGn.js → guards-DGcSfTEh.js} +1 -1
  64. package/dist/http-DOEfFCDA.js +107 -0
  65. package/dist/i18n/index.js +15 -15
  66. package/dist/identity/index.d.ts +2 -0
  67. package/dist/identity/index.js +43 -40
  68. package/dist/identity/usePreferences.d.ts +19 -0
  69. package/dist/incidents/clientErrorReporter.d.ts +2 -1
  70. package/dist/incidents/index.js +1 -1
  71. package/dist/{index-kEHY7hcG.js → index-Be9Q1PB_.js} +78 -76
  72. package/dist/{index-Cq9TuOqH.js → index-DZikGJ8L.js} +457 -511
  73. package/dist/{index-ClJeyW3F.js → index-D_yyd4C2.js} +4 -4
  74. package/dist/index.d.ts +1 -1
  75. package/dist/index.js +1 -1
  76. package/dist/internal/intlLocale.d.ts +5 -2
  77. package/dist/modules/identity/entities.d.ts +4 -0
  78. package/dist/modules/identity/routes.d.ts +5 -2
  79. package/dist/modules/identity/schemas.d.ts +6 -2
  80. package/dist/modules/incident/routes.d.ts +2 -0
  81. package/dist/modules/incident/schemas.d.ts +2 -0
  82. package/dist/{navigation-TnVFYRaX.js → navigation-CctcxT51.js} +1 -1
  83. package/dist/{neighbors-OyvGi233.js → neighbors-Csfan8Ho.js} +1 -1
  84. package/dist/notifications/index.js +1 -1
  85. package/dist/onboarding/Tip.vue.d.ts +41 -0
  86. package/dist/onboarding/index.d.ts +1 -0
  87. package/dist/onboarding/index.js +145 -0
  88. package/dist/onboarding/tips.d.ts +5 -0
  89. package/dist/page/index.js +3 -3
  90. package/dist/phone/index.js +74 -74
  91. package/dist/phone/phone.d.ts +3 -3
  92. package/dist/platform/httpSession.d.ts +1 -1
  93. package/dist/platform/index.d.ts +2 -0
  94. package/dist/platform/index.js +16 -13
  95. package/dist/platform/preferences.d.ts +35 -0
  96. package/dist/platform/session.d.ts +6 -1
  97. package/dist/platform-DtISOEt7.js +284 -0
  98. package/dist/playwright/session.d.ts +2 -0
  99. package/dist/preferences-hYhrw8Uy.js +91 -0
  100. package/dist/resource/index.d.ts +1 -0
  101. package/dist/resource/index.js +24 -8
  102. package/dist/resource/read.d.ts +16 -0
  103. package/dist/router/index.js +3 -3
  104. package/dist/{rowLayout-BsKEzEME.js → rowLayout-y1IB_h2r.js} +2 -2
  105. package/dist/{sections-CvUwZ-S1.js → sections-fkW_IJLc.js} +1 -1
  106. package/dist/{serverMessages-B6GHgi40.js → serverMessages-Ddghrewh.js} +1 -1
  107. package/dist/shell/darkMode.d.ts +13 -8
  108. package/dist/shell/index.js +396 -384
  109. package/dist/{state-6KSYsVw0.js → state-CXMexi0l.js} +1 -1
  110. package/dist/styles.css +1 -1
  111. package/dist/testing/app.d.ts +11 -0
  112. package/dist/testing/format.d.ts +4 -2
  113. package/dist/testing/index.d.ts +1 -1
  114. package/dist/testing/index.js +96 -89
  115. package/dist/testing/platform.d.ts +2 -0
  116. package/dist/usePreferences-B8LIZp_f.js +47 -0
  117. package/dist/{useTypedEntry-C_Bk4sI0.js → useTypedEntry-DKs8I1yP.js} +279 -280
  118. package/package.json +6 -2
  119. package/src/styles/components.css +17 -0
  120. package/dist/application-CuzT-0vW.js +0 -420
  121. package/dist/format-D8KUBmbS.js +0 -87
  122. package/dist/http-Dm0uXY9O.js +0 -95
  123. package/dist/intlLocale-CeRU44qJ.js +0 -4
  124. package/dist/platform-BQOX_Ntw.js +0 -283
@@ -1,283 +0,0 @@
1
- import { c as U } from "./client-Dg303Pmc.js";
2
- import { d as _ } from "./context-Ch1r4fdN.js";
3
- import { a as A, A as z } from "./error-CD7x0Jrz.js";
4
- import { shallowRef as C } from "vue";
5
- const I = (e, t) => e.level === t.level && e.id === t.id, T = (e, t) => Object.prototype.hasOwnProperty.call(e, t);
6
- function N(e, t = {}) {
7
- const n = t.covers ?? I;
8
- function o(s) {
9
- const r = e();
10
- return !r || !T(r.permissions, s) || r.unavailable.includes(s) ? null : r.permissions[s] ?? null;
11
- }
12
- function i(s, r) {
13
- const c = o(s);
14
- return c ? r ? (c.clauses.length > 0 ? c.clauses.map((f) => f.scope) : [c.scope]).some((f) => n(f, r)) : !0 : !1;
15
- }
16
- return {
17
- get root() {
18
- return e()?.root ?? !1;
19
- },
20
- can: i,
21
- canAny: (s) => s.some((r) => i(r)),
22
- canAll: (s) => s.every((r) => i(r)),
23
- held: o
24
- };
25
- }
26
- const $ = ["own", "own_location", "all"], y = (e) => typeof e == "object" && e !== null && !Array.isArray(e);
27
- function S(e, t, n) {
28
- return !y(e) || typeof e.level != "string" ? (n.push(`${t}: expected { level: string, id?: number }`), { level: "" }) : (e.id !== void 0 && typeof e.id != "number" && n.push(`${t}.id: expected number`), typeof e.id == "number" ? { level: e.level, id: e.id } : { level: e.level });
29
- }
30
- function O(e, t, n) {
31
- return typeof e == "string" && $.includes(e) ? e : (n.push(`${t}: expected one of ${$.join(", ")}`), "own");
32
- }
33
- function B(e) {
34
- const t = [], n = {}, o = { root: !1, permissions: {}, unavailable: [] };
35
- if (!y(e)) return { snapshot: o, issues: ["access: expected an object"] };
36
- if (!y(e.permissions)) t.push("access.permissions: expected an object");
37
- else
38
- for (const [s, r] of Object.entries(e.permissions)) {
39
- const c = `access.permissions.${s}`;
40
- if (!y(r)) {
41
- t.push(`${c}: expected an object`);
42
- continue;
43
- }
44
- const a = (Array.isArray(r.clauses) ? r.clauses : []).map((f, b) => {
45
- const h = `${c}.clauses[${b}]`;
46
- if (!y(f))
47
- return t.push(`${h}: expected an object`), { scope: { level: "" }, qualifier: "own" };
48
- const d = { scope: S(f.scope, `${h}.scope`, t), qualifier: O(f.qualifier, `${h}.qualifier`, t) };
49
- return typeof f.role == "string" ? { ...d, role: f.role } : d;
50
- });
51
- n[s] = {
52
- scope: S(r.scope, `${c}.scope`, t),
53
- qualifier: O(r.qualifier, `${c}.qualifier`, t),
54
- clauses: a
55
- };
56
- }
57
- const i = e.unavailable ?? [];
58
- return (!Array.isArray(i) || !i.every((s) => typeof s == "string")) && t.push("access.unavailable: expected an array of strings"), {
59
- snapshot: {
60
- root: e.root === !0,
61
- permissions: n,
62
- unavailable: Array.isArray(i) ? i.filter((s) => typeof s == "string") : []
63
- },
64
- issues: t
65
- };
66
- }
67
- const F = (e) => typeof e == "object" && e !== null && !Array.isArray(e);
68
- function P(e, t, n = "navigation") {
69
- return Array.isArray(e) ? e.flatMap((o, i) => {
70
- const s = `${n}[${i}]`;
71
- if (!F(o) || typeof o.i18n != "string")
72
- return t.push(`${s}: expected an object with an i18n key`), [];
73
- for (const c of ["icon", "route"])
74
- o[c] != null && typeof o[c] != "string" && t.push(`${s}.${c}: expected a string`);
75
- const r = o.children == null ? void 0 : P(o.children, t, `${s}.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
- ...r && { children: r }
82
- }
83
- ];
84
- }) : (t.push(`${n}: expected an array`), []);
85
- }
86
- const w = (e) => typeof e == "object" && e !== null && !Array.isArray(e), H = (e) => {
87
- if (w(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 Q(e, t = H) {
91
- const n = [];
92
- if (!w(e)) throw j(["expected an object"]);
93
- let o = null;
94
- try {
95
- o = t(e.user);
96
- } catch (a) {
97
- n.push(`user: ${a instanceof Error ? a.message : "invalid"}`);
98
- }
99
- let i = null;
100
- if (e.expires_at !== void 0 && e.expires_at !== null) {
101
- const a = typeof e.expires_at == "string" ? new Date(e.expires_at) : null;
102
- a === null || Number.isNaN(a.getTime()) ? n.push("expires_at: expected an ISO date-time string") : i = a;
103
- }
104
- let s;
105
- if (e.impersonator !== void 0 && e.impersonator !== null) {
106
- const a = e.impersonator;
107
- w(a) && (typeof a.id == "number" || typeof a.id == "string") && typeof a.name == "string" ? s = { id: a.id, name: a.name } : n.push("impersonator: expected { id, name }");
108
- }
109
- const r = B(e.access);
110
- n.push(...r.issues);
111
- const c = e.navigation === void 0 || e.navigation === null ? void 0 : P(e.navigation, n);
112
- if (o === null || n.length > 0) throw j(n);
113
- return { user: o, expiresAt: i, access: r.snapshot, ...s && { impersonator: s }, ...c && { navigation: c } };
114
- }
115
- const j = (e) => new z({ kind: "malformed", message: `Unreadable session payload: ${e.join("; ")}` });
116
- function R(e, t = {}) {
117
- const { mePath: n = "/auth/me", signOutPath: o = "/auth/logout", parseUser: i } = t;
118
- return {
119
- async load(s) {
120
- try {
121
- const { data: r } = await e.get(n, { signal: s, handleUnauthorized: !1 });
122
- return Q(r, i);
123
- } catch (r) {
124
- if (A(r) && r.kind === "unauthorized") return null;
125
- throw r;
126
- }
127
- },
128
- async signOut() {
129
- try {
130
- await e.post(o, void 0, { handleUnauthorized: !1 });
131
- } catch (s) {
132
- if (!(A(s) && s.kind === "unauthorized")) throw s;
133
- }
134
- }
135
- };
136
- }
137
- function k(e) {
138
- return e.status === "authenticated" ? e : e.status === "anonymous" && e.reason === "expired" ? e.previous ?? null : null;
139
- }
140
- const E = 3e3;
141
- function D(e, t = {}) {
142
- const n = C({ status: "unknown" });
143
- let o = 0;
144
- const i = new Set(t.beforeSignOut ? [t.beforeSignOut] : []);
145
- let s = !1, r = null, c = null, a = null;
146
- function f() {
147
- o++, a?.controller.abort(), a = null;
148
- }
149
- async function b(u) {
150
- const l = new AbortController();
151
- let g;
152
- const v = new Promise((m) => {
153
- g = setTimeout(() => {
154
- l.abort(), t.onError?.(new Error(`A before-sign-out hook did not finish within ${E} ms; signing out without it.`)), m();
155
- }, E);
156
- }), x = Promise.all(
157
- [...i].map(async (m) => {
158
- try {
159
- await m(u, l.signal);
160
- } catch (p) {
161
- t.onError?.(p);
162
- }
163
- })
164
- ).then(() => {
165
- });
166
- await Promise.race([x, v]), clearTimeout(g);
167
- }
168
- function h() {
169
- if (a) return a.promise;
170
- const u = o, l = new AbortController(), g = n.value, v = k(g) !== null;
171
- v || (n.value = { status: "loading" });
172
- const x = async () => {
173
- try {
174
- const p = await e.load(l.signal);
175
- if (o !== u) return n.value;
176
- n.value = p ? { status: "authenticated", ...p } : { status: "anonymous", reason: "none" };
177
- } catch (p) {
178
- if (o !== u) return n.value;
179
- t.onError?.(p), n.value = v ? g : { status: "failed", error: p };
180
- } finally {
181
- o === u && (a = null);
182
- }
183
- return n.value;
184
- }, m = Promise.resolve().then(x);
185
- return a = { controller: l, promise: m }, m;
186
- }
187
- const d = {
188
- state: n,
189
- restore: () => n.value.status === "unknown" || n.value.status === "failed" ? h() : a?.promise ?? Promise.resolve(n.value),
190
- refresh: h,
191
- establish(u) {
192
- f(), n.value = { status: "authenticated", ...u };
193
- },
194
- update(u) {
195
- const l = n.value;
196
- if (l.status === "authenticated") {
197
- if (u.user && u.user.id !== l.user.id)
198
- throw new Error(`session.update cannot change who is signed in (user ${String(l.user.id)} to ${String(u.user.id)}); use session.establish for a different person.`);
199
- n.value = {
200
- ...l,
201
- user: u.user ?? l.user,
202
- access: u.access ?? l.access,
203
- ...(u.navigation ?? l.navigation) && { navigation: u.navigation ?? l.navigation }
204
- };
205
- }
206
- },
207
- expire() {
208
- if (n.value.status !== "authenticated") return;
209
- const { status: u, ...l } = n.value;
210
- f(), n.value = s && !n.value.impersonator ? { status: "anonymous", reason: "expired", previous: l } : { status: "anonymous", reason: "expired" }, t.onExpired?.();
211
- },
212
- signOut() {
213
- return r ?? (r = (async () => {
214
- try {
215
- const u = n.value;
216
- u.status === "authenticated" && i.size > 0 && await b(u.user), f(), n.value = { status: "anonymous", reason: "signedOut" }, await e.signOut();
217
- } finally {
218
- r = null;
219
- }
220
- })()), r;
221
- },
222
- get renewable() {
223
- return t.renew !== void 0 && (t.renewable?.() ?? !0);
224
- },
225
- renew() {
226
- return n.value.status !== "authenticated" ? Promise.resolve(!1) : (c ?? (c = (async () => {
227
- try {
228
- if (d.renewable && await t.renew(d)) return !0;
229
- } catch {
230
- }
231
- return d.expire(), !1;
232
- })().finally(() => {
233
- c = null;
234
- })), c);
235
- },
236
- holdExpired(u) {
237
- s = u;
238
- },
239
- onBeforeSignOut(u) {
240
- return i.add(u), () => void i.delete(u);
241
- }
242
- };
243
- return d;
244
- }
245
- function V(e) {
246
- const t = U({
247
- baseUrl: e.config.apiBase,
248
- transport: e.transport,
249
- headers: e.headers,
250
- credentials: e.credentials,
251
- requestId: e.requestId,
252
- async onUnauthorized() {
253
- return await i.renew() ? "retry" : "fail";
254
- }
255
- }), n = e.session ?? ((r) => R(r)), o = typeof n == "function" ? n(t) : n, i = D(o, {
256
- onError: e.onSessionError,
257
- onExpired: e.onSessionExpired,
258
- beforeSignOut: e.beforeSignOut,
259
- renew: e.renewSession && ((r) => e.renewSession(r, t)),
260
- renewable: e.renewable
261
- }), s = N(
262
- () => k(i.state.value)?.access ?? null,
263
- { covers: e.covers }
264
- );
265
- return { config: e.config, http: t, session: i, access: s };
266
- }
267
- const q = _("platform"), K = q[0], W = q[1];
268
- function X(e, t) {
269
- e.provide(K, t);
270
- }
271
- export {
272
- V as a,
273
- E as b,
274
- N as c,
275
- D as d,
276
- R as e,
277
- Q as f,
278
- K as g,
279
- k as h,
280
- X as i,
281
- P as p,
282
- W as u
283
- };