@wssto2/vue-core 0.12.0 → 0.13.0

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 (122) 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-CXzgLKqI.js} +6 -6
  13. package/dist/{IncidentsList-2iwgqp9J.js → IncidentsList-D1MySyXb.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-CRxU_Wh2.js} +61 -61
  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 +7 -2
  78. package/dist/modules/identity/routes.d.ts +5 -2
  79. package/dist/modules/identity/schemas.d.ts +6 -2
  80. package/dist/{navigation-TnVFYRaX.js → navigation-CctcxT51.js} +1 -1
  81. package/dist/{neighbors-OyvGi233.js → neighbors-Csfan8Ho.js} +1 -1
  82. package/dist/notifications/index.js +1 -1
  83. package/dist/onboarding/Tip.vue.d.ts +41 -0
  84. package/dist/onboarding/index.d.ts +1 -0
  85. package/dist/onboarding/index.js +145 -0
  86. package/dist/onboarding/tips.d.ts +5 -0
  87. package/dist/page/index.js +3 -3
  88. package/dist/phone/index.js +74 -74
  89. package/dist/phone/phone.d.ts +3 -3
  90. package/dist/platform/httpSession.d.ts +1 -1
  91. package/dist/platform/index.d.ts +2 -0
  92. package/dist/platform/index.js +16 -13
  93. package/dist/platform/preferences.d.ts +35 -0
  94. package/dist/platform/session.d.ts +6 -1
  95. package/dist/platform-DtISOEt7.js +284 -0
  96. package/dist/playwright/session.d.ts +7 -11
  97. package/dist/preferences-hYhrw8Uy.js +91 -0
  98. package/dist/resource/index.d.ts +1 -0
  99. package/dist/resource/index.js +24 -8
  100. package/dist/resource/read.d.ts +16 -0
  101. package/dist/router/index.js +3 -3
  102. package/dist/{rowLayout-BsKEzEME.js → rowLayout-y1IB_h2r.js} +2 -2
  103. package/dist/{sections-CvUwZ-S1.js → sections-fkW_IJLc.js} +1 -1
  104. package/dist/{serverMessages-B6GHgi40.js → serverMessages-Ddghrewh.js} +1 -1
  105. package/dist/shell/darkMode.d.ts +13 -8
  106. package/dist/shell/index.js +396 -384
  107. package/dist/{state-6KSYsVw0.js → state-CXMexi0l.js} +1 -1
  108. package/dist/styles.css +1 -1
  109. package/dist/testing/app.d.ts +11 -0
  110. package/dist/testing/format.d.ts +4 -2
  111. package/dist/testing/index.d.ts +1 -1
  112. package/dist/testing/index.js +96 -89
  113. package/dist/testing/platform.d.ts +2 -0
  114. package/dist/usePreferences-B8LIZp_f.js +47 -0
  115. package/dist/{useTypedEntry-C_Bk4sI0.js → useTypedEntry-DKs8I1yP.js} +279 -280
  116. package/package.json +6 -2
  117. package/src/styles/components.css +17 -0
  118. package/dist/application-CuzT-0vW.js +0 -420
  119. package/dist/format-D8KUBmbS.js +0 -87
  120. package/dist/http-Dm0uXY9O.js +0 -95
  121. package/dist/intlLocale-CeRU44qJ.js +0 -4
  122. package/dist/platform-BQOX_Ntw.js +0 -283
@@ -1,22 +1,24 @@
1
- import { defineComponent as E, openBlock as N, createBlock as L, unref as e, withCtx as p, createVNode as n, mergeProps as R, provide as C, computed as _, useTemplateRef as D, createElementVNode as h, toDisplayString as S, createTextVNode as K } from "vue";
1
+ import { defineComponent as E, openBlock as N, createBlock as L, unref as e, withCtx as p, createVNode as n, mergeProps as q, provide as C, computed as _, useTemplateRef as D, createElementVNode as h, toDisplayString as S, createTextVNode as K } from "vue";
2
2
  import { useI18n as U } from "vue-i18n";
3
- import { u as z } from "./neighbors-OyvGi233.js";
3
+ import { u as z } from "./neighbors-Csfan8Ho.js";
4
4
  import { _ as G } from "./Avatar.vue_vue_type_script_setup_true_lang-BPj_fkJR.js";
5
5
  import { u as I } from "./describeError-B-NMa--w.js";
6
- import { i as k, P as O, q as j, c as F, d as H, b as J, M as Q, r as W, s as X, g as Y } from "./index-Cq9TuOqH.js";
7
- import { _ as Z } from "./AlertDialog.vue_vue_type_script_setup_true_lang-CrFhR9rJ.js";
6
+ import { i as k } from "./preferences-hYhrw8Uy.js";
7
+ import { _ as O } from "./AlertDialog.vue_vue_type_script_setup_true_lang-CrFhR9rJ.js";
8
8
  import { t as $ } from "./toast-CqSDTWRX.js";
9
- import { _ as ee } from "./SectionNavigator.vue_vue_type_script_setup_true_lang-Dh3sXUt_.js";
10
- import { u as V } from "./platform-BQOX_Ntw.js";
11
- import { a as se } from "./routeResource-DlTsGTg_.js";
12
- import { a as ae } from "./ResourcePage.vue_vue_type_script_setup_true_lang-DljhsTU4.js";
13
- import { A as te } from "./access-DmAceEo5.js";
14
- import { _ as oe } from "./Badge.vue_vue_type_script_setup_true_lang-DJyZc0C7.js";
15
- import { u as re } from "./useLoad-M7V-AVwR.js";
9
+ import { _ as j } from "./SectionNavigator.vue_vue_type_script_setup_true_lang-DfKEhTFv.js";
10
+ import { u as V } from "./platform-DtISOEt7.js";
11
+ import { a as F } from "./routeResource-DlTsGTg_.js";
12
+ import { a as H } from "./ResourcePage.vue_vue_type_script_setup_true_lang-Coz91xht.js";
13
+ import { A as J } from "./access-DmAceEo5.js";
14
+ import { _ as Q } from "./Badge.vue_vue_type_script_setup_true_lang-DJyZc0C7.js";
15
+ import { u as W } from "./useLoad-M7V-AVwR.js";
16
+ import { i as X } from "./usePreferences-B8LIZp_f.js";
17
+ import { P as Y, p as Z, c as ee, d as se, b as ae, M as te, o as oe, s as re } from "./index-DZikGJ8L.js";
16
18
  import { a as ne } from "./FormGroup.vue_vue_type_script_setup_true_lang-D6jYfNjW.js";
17
19
  import { _ as A } from "./TextField.vue_vue_type_script_setup_true_lang-CWIeeZRE.js";
18
- import { u as ce, _ as ie } from "./useCommand-Ch_nx1AQ.js";
19
- import { u as le } from "./serverMessages-B6GHgi40.js";
20
+ import { u as ie, _ as ce } from "./useCommand-Ch_nx1AQ.js";
21
+ import { u as le } from "./serverMessages-Ddghrewh.js";
20
22
  const ue = /* @__PURE__ */ E({
21
23
  __name: "SetPasswordDialog",
22
24
  props: {
@@ -24,25 +26,25 @@ const ue = /* @__PURE__ */ E({
24
26
  name: {}
25
27
  },
26
28
  emits: ["saved"],
27
- setup(q, { expose: s, emit: f }) {
28
- const v = q, w = f, { t: o } = U(), { http: c } = V(), u = {
29
+ setup(P, { expose: s, emit: f }) {
30
+ const v = P, w = f, { t: o } = U(), { http: i } = V(), u = {
29
31
  safeParse(a) {
30
- const { password: i, repeat: d } = a, g = [
31
- ...i === "" ? [{ path: ["password"], message: o("core.account.validation.required") }] : [],
32
- ...i !== "" && d !== i ? [{ path: ["repeat"], message: o(d === "" ? "core.account.validation.required" : "core.account.validation.mismatch") }] : []
32
+ const { password: c, repeat: d } = a, b = [
33
+ ...c === "" ? [{ path: ["password"], message: o("core.account.validation.required") }] : [],
34
+ ...c !== "" && d !== c ? [{ path: ["repeat"], message: o(d === "" ? "core.account.validation.required" : "core.account.validation.mismatch") }] : []
33
35
  ];
34
- return g.length > 0 ? { success: !1, error: { issues: g } } : { success: !0, data: { password: i } };
36
+ return b.length > 0 ? { success: !1, error: { issues: b } } : { success: !0, data: { password: c } };
35
37
  }
36
- }, m = ce({
38
+ }, m = ie({
37
39
  ...le(),
38
40
  defaults: () => ({ password: "", repeat: "" }),
39
41
  validator: u,
40
- run: (a) => c.request(k.usersSetPassword, { id: v.id, password: a.password }),
42
+ run: (a) => i.request(k.usersSetPassword, { id: v.id, password: a.password }),
41
43
  done: () => {
42
44
  $.success(o("core.users.password.done", { name: v.name })), w("saved");
43
45
  }
44
46
  });
45
- return s({ open: () => m.present() }), (a, i) => (N(), L(e(ie), {
47
+ return s({ open: () => m.present() }), (a, c) => (N(), L(e(ce), {
46
48
  command: e(m),
47
49
  title: e(o)("core.users.password.title"),
48
50
  subtitle: v.name,
@@ -54,13 +56,13 @@ const ue = /* @__PURE__ */ E({
54
56
  "data-set-password-dialog": ""
55
57
  }, {
56
58
  default: p(() => [
57
- n(e(A), R(e(m).form.bind("password"), {
59
+ n(e(A), q(e(m).form.bind("password"), {
58
60
  label: e(o)("core.users.fields.password"),
59
61
  type: "password",
60
62
  required: "",
61
63
  autocomplete: "new-password"
62
64
  }), null, 16, ["label"]),
63
- n(e(A), R(e(m).form.bind("repeat"), {
65
+ n(e(A), q(e(m).form.bind("repeat"), {
64
66
  label: e(o)("core.users.fields.password_repeat"),
65
67
  type: "password",
66
68
  required: "",
@@ -76,48 +78,48 @@ const ue = /* @__PURE__ */ E({
76
78
  }), me = {
77
79
  class: "flex items-center gap-3 px-1.5",
78
80
  "data-person-identity": ""
79
- }, de = { class: "flex min-w-0 flex-col items-start gap-0.5" }, pe = { class: "max-w-full truncate text-headline font-semibold text-content-strong" }, fe = { class: "max-w-full truncate text-footnote text-content-muted" }, Le = /* @__PURE__ */ E({
81
+ }, de = { class: "flex min-w-0 flex-col items-start gap-0.5" }, pe = { class: "max-w-full truncate text-headline font-semibold text-content-strong" }, fe = { class: "max-w-full truncate text-footnote text-content-muted" }, Ve = /* @__PURE__ */ E({
80
82
  __name: "UserRecord",
81
- setup(q) {
82
- const { t: s } = U(), { http: f, access: v, session: w } = V(), o = I(), c = se({
83
- key: O,
83
+ setup(P) {
84
+ const { t: s } = U(), { http: f, access: v, session: w } = V(), o = I(), i = F({
85
+ key: Y,
84
86
  param: "id",
85
87
  load: async (t, { signal: l }) => (await f.request(k.usersShow, { id: t }, { signal: l })).data
86
- }), u = re(
88
+ }), u = W(
87
89
  async ({ signal: t }) => {
88
- const l = c.data.value?.id;
90
+ const l = i.data.value?.id;
89
91
  return l === void 0 ? { sessions: [] } : (await f.request(k.usersSessions, { id: l }, { signal: t })).data;
90
92
  },
91
- { watch: () => c.data.value?.id }
93
+ { watch: () => i.data.value?.id }
92
94
  );
93
- C(j, u);
94
- const m = z(H(), { current: () => c.id.value, list: F.index, param: "id", backLabel: () => s("core.users.title") }), a = _(() => c.data.value), i = _(() => a.value !== null && w.state.value.status === "authenticated" && w.state.value.user.id === a.value.id), d = D("deactivateDialog"), { deactivate: g } = J(), P = D("passwordDialog"), x = D("activateDialog");
95
- async function b() {
96
- await Promise.all([c.reload(), u.reload()]);
95
+ C(Z, u);
96
+ const m = z(se(), { current: () => i.id.value, list: ee.index, param: "id", backLabel: () => s("core.users.title") }), a = _(() => i.data.value), c = _(() => a.value !== null && w.state.value.status === "authenticated" && w.state.value.user.id === a.value.id), d = D("deactivateDialog"), { deactivate: b } = ae(), R = D("passwordDialog"), x = D("activateDialog");
97
+ async function g() {
98
+ await Promise.all([i.reload(), u.reload()]);
97
99
  }
98
100
  async function M() {
99
- const t = c.id.value;
101
+ const t = i.id.value;
100
102
  if (t !== null) {
101
103
  try {
102
104
  await f.request(k.usersActivate, { id: t }), $.success(s("core.users.activate.done", { name: a.value?.name ?? "" }));
103
105
  } catch (l) {
104
- Y(l) || $.error(o(l, { fallback: s("core.users.activate.failed") }));
106
+ X(l) || $.error(o(l, { fallback: s("core.users.activate.failed") }));
105
107
  }
106
- await b();
108
+ await g();
107
109
  }
108
110
  }
109
111
  const y = _(() => {
110
- const t = v.can(Q);
111
- return { manage: t, deactivate: t && !!a.value?.active && !i.value, activate: t && a.value !== null && !a.value.active, endSessions: t && !i.value };
112
+ const t = v.can(te);
113
+ return { manage: t, deactivate: t && !!a.value?.active && !c.value, activate: t && a.value !== null && !a.value.active, endSessions: t && !c.value };
112
114
  });
113
- C(W, {
115
+ C(oe, {
114
116
  get can() {
115
117
  return y.value;
116
118
  },
117
119
  deactivate: () => d.value?.open(),
118
120
  activate: () => x.value?.present(),
119
- setPassword: () => P.value?.open(),
120
- refresh: b
121
+ setPassword: () => R.value?.open(),
122
+ refresh: g
121
123
  });
122
124
  const T = _(() => [
123
125
  ...y.value.deactivate ? [{ id: "deactivate", label: s("core.users.actions.deactivate"), icon: "lockLine", placement: "overflow", tone: "critical", onClick: () => d.value?.open() }] : [],
@@ -126,14 +128,14 @@ const ue = /* @__PURE__ */ E({
126
128
  ...u.data.value ? { "users.record.sessions": u.data.value.sessions.length } : {},
127
129
  ...a.value?.status === "locked" ? { "users.record.signin": s("core.users.status.locked") } : {}
128
130
  }));
129
- return (t, l) => (N(), L(e(ae), {
130
- resource: e(c),
131
+ return (t, l) => (N(), L(e(H), {
132
+ resource: e(i),
131
133
  title: a.value?.name ?? e(s)("core.users.record"),
132
134
  list: e(m).context,
133
135
  actions: T.value
134
136
  }, {
135
137
  default: p(({ record: r }) => [
136
- n(e(ee), {
138
+ n(e(j), {
137
139
  label: e(s)("core.users.sections_label"),
138
140
  desktop: "sidebar",
139
141
  compact: "rows",
@@ -150,8 +152,8 @@ const ue = /* @__PURE__ */ E({
150
152
  h("div", de, [
151
153
  h("span", pe, S(r.name), 1),
152
154
  h("span", fe, S(r.email), 1),
153
- n(e(oe), {
154
- tone: e(X)(r.status),
155
+ n(e(Q), {
156
+ tone: e(re)(r.status),
155
157
  dot: "",
156
158
  "data-person-status": ""
157
159
  }, {
@@ -164,26 +166,26 @@ const ue = /* @__PURE__ */ E({
164
166
  ])
165
167
  ]),
166
168
  default: p(() => [
167
- n(e(te))
169
+ n(e(J))
168
170
  ]),
169
171
  _: 2
170
172
  }, 1032, ["label", "back-label", "counts"]),
171
- n(e(g), {
173
+ n(e(b), {
172
174
  ref_key: "deactivateDialog",
173
175
  ref: d,
174
176
  id: r.id,
175
177
  name: r.name,
176
178
  "session-count": e(u).data.value?.sessions.length ?? null,
177
- onDone: b
179
+ onDone: g
178
180
  }, null, 8, ["id", "name", "session-count"]),
179
181
  n(ue, {
180
182
  ref_key: "passwordDialog",
181
- ref: P,
183
+ ref: R,
182
184
  id: r.id,
183
185
  name: r.name,
184
- onSaved: b
186
+ onSaved: g
185
187
  }, null, 8, ["id", "name"]),
186
- n(e(Z), {
188
+ n(e(O), {
187
189
  ref_key: "activateDialog",
188
190
  ref: x,
189
191
  icon: "checkCircle",
@@ -198,5 +200,5 @@ const ue = /* @__PURE__ */ E({
198
200
  }
199
201
  });
200
202
  export {
201
- Le as default
203
+ Ve as default
202
204
  };
@@ -1,12 +1,12 @@
1
1
  import { defineComponent as C, useTemplateRef as N, computed as a, openBlock as i, createBlock as m, unref as s, withCtx as r, createVNode as d, createTextVNode as R, toDisplayString as l, createCommentVNode as S, createElementBlock as _, normalizeClass as p } from "vue";
2
2
  import { useI18n as E } from "vue-i18n";
3
3
  import { useRouter as $ } from "vue-router";
4
- import { u as B, _ as T } from "./CollectionPage.vue_vue_type_script_setup_true_lang-x0jyJ01f.js";
4
+ import { u as B, _ as T } from "./CollectionPage.vue_vue_type_script_setup_true_lang-C1GCvyZx.js";
5
5
  import { _ as V } from "./Avatar.vue_vue_type_script_setup_true_lang-BPj_fkJR.js";
6
- import { u as L } from "./format-D8KUBmbS.js";
7
- import { u as z } from "./platform-BQOX_Ntw.js";
6
+ import { u as L } from "./format-DoKs29bZ.js";
7
+ import { u as z } from "./platform-DtISOEt7.js";
8
8
  import { _ as A } from "./Badge.vue_vue_type_script_setup_true_lang-DJyZc0C7.js";
9
- import { b as D, U as I, c as f, d as M, M as q, s as F } from "./index-Cq9TuOqH.js";
9
+ import { b as D, U as I, c as f, d as M, M as q, s as F } from "./index-DZikGJ8L.js";
10
10
  const G = ["datetime"], Z = /* @__PURE__ */ C({
11
11
  __name: "UsersList",
12
12
  setup(K) {
@@ -1,15 +1,15 @@
1
- import { _ as f, a as R, b } from "../PersonAccess.vue_vue_type_script_setup_true_lang-DbGZSNQc.js";
1
+ import { _ as f, a as R, b } from "../PersonAccess.vue_vue_type_script_setup_true_lang-CWCt9_dM.js";
2
2
  import { d as o, p as c } from "../feature-DdUAfyi4.js";
3
3
  import { a as s, b as t } from "../refusals-DfPzVNNY.js";
4
4
  import { d as g, p as x, r as h, c as v, u as y, e as C, f as K } from "../refusals-DfPzVNNY.js";
5
5
  import { d as r } from "../defineRoutes-BGAdiIrt.js";
6
6
  const a = r({
7
- roles: { name: "access.roles", path: "/iam/roles", component: () => import("../RolesPage-6hlzJes_.js"), meta: { access: s.viewRoles, titleKey: "core.access.title" } },
8
- newRole: { name: "access.roles.new", path: "/iam/roles/new", component: () => import("../NewRolePage-DhGFwvk3.js"), meta: { access: s.manageRoles, titleKey: "core.access.new_title" } },
7
+ roles: { name: "access.roles", path: "/iam/roles", component: () => import("../RolesPage-NKzBUsrM.js"), meta: { access: s.viewRoles, titleKey: "core.access.title" } },
8
+ newRole: { name: "access.roles.new", path: "/iam/roles/new", component: () => import("../NewRolePage-CQ5UVaHs.js"), meta: { access: s.manageRoles, titleKey: "core.access.new_title" } },
9
9
  role: {
10
10
  name: "access.role",
11
11
  path: "/iam/roles/:ref",
12
- component: () => import("../RolePage-DaNv049g.js"),
12
+ component: () => import("../RolePage-BUj1w1m1.js"),
13
13
  // A role's ref (its key, or the id of a custom one) swaps in place when a link leads to another role.
14
14
  meta: { access: s.viewRoles, titleKey: "core.access.title", remountOnParam: "ref" }
15
15
  }
@@ -1,7 +1,7 @@
1
1
  import { type App, type Component } from "vue";
2
2
  import { type PluralizationRule } from "vue-i18n";
3
3
  import { type RouteLocationRaw, type Router, type RouterHistory, type RouterScrollBehavior } from "vue-router";
4
- import { type Formatters } from "../format";
4
+ import { type Formatters, type Formatting, type FormattingSettings } from "../format";
5
5
  import { type MessageNamespace } from "../i18n";
6
6
  import { type IconSet } from "../icon";
7
7
  import { type Platform, type SessionSnapshot } from "../platform";
@@ -21,7 +21,8 @@ export interface ShellDefinition {
21
21
  }
22
22
  /** Where an error the application caught came from. */
23
23
  export interface ApplicationErrorReport {
24
- readonly source: "vue" | "unhandledrejection" | "window" | "effect" | "messages" | "session" | "router" | "locale";
24
+ /** `handled`: an error the application's own code caught and showed the user (`report`), not one that escaped. */
25
+ readonly source: "vue" | "unhandledrejection" | "window" | "effect" | "messages" | "session" | "router" | "locale" | "handled";
25
26
  readonly error: unknown;
26
27
  /** The route the user was on, when there was one. */
27
28
  readonly route: string | null;
@@ -82,10 +83,11 @@ export interface ApplicationOptions {
82
83
  router?: ApplicationRouterOptions;
83
84
  i18n?: ApplicationI18nOptions;
84
85
  locale?: ApplicationLocaleOptions;
85
- /** Replace any of the `Intl` formatters (ARV shows `DD.MM.YYYY.`), and the symbol shown after an amount without an ISO currency ("€", "KM"). */
86
- formatting?: Partial<Formatters> & {
87
- currencySymbol?: string;
88
- };
86
+ /**
87
+ * How dates and numbers are written: the `Intl` formatters, any of them replaced, and the `FormattingSettings` (the `intlLocale` map, a numeric
88
+ * `datePattern` per language, `numberSymbols`, `emptyNumber`, the `currencySymbol` shown after an amount without an ISO currency).
89
+ */
90
+ formatting?: Partial<Formatters> & FormattingSettings;
89
91
  /** Message namespaces the application or its shell owns itself, outside any feature. */
90
92
  messages?: readonly MessageNamespace[];
91
93
  /** The application's icons (`installIcons`): one set, or several partial ones (a feature's own) that are merged. */
@@ -114,12 +116,18 @@ export interface ApplicationOptions {
114
116
  export interface Application {
115
117
  /** The Vue app, for the few things that need it (a plugin, a test). */
116
118
  readonly app: App;
119
+ /** The app-scoped services, as `createApplication` was given them: `currentApplication().platform.http` outside setup. */
120
+ readonly platform: Platform;
121
+ /** The application's formatting (`useFormat()` in setup): dates, numbers and money in the active locale. */
122
+ readonly format: Formatting;
117
123
  readonly router: Router;
118
124
  /** The vue-i18n instance of this application. */
119
125
  readonly i18n: ApplicationI18n;
120
126
  readonly state: ApplicationEnvironment["state"];
121
127
  readonly locale: ApplicationEnvironment["locale"];
122
128
  setLocale: ApplicationEnvironment["setLocale"];
129
+ /** Reports an error the code caught and the user saw fail (`ApplicationEnvironment.report`), through `onError`. */
130
+ report: ApplicationEnvironment["report"];
123
131
  /**
124
132
  * Starts the application and mounts it: restores the session, loads the essential texts, runs the
125
133
  * first navigation, then renders. A failure of the session or the texts mounts the failure view
@@ -0,0 +1,11 @@
1
+ import type { Application } from "./application";
2
+ /** Called by `createApplication`; the returned function unbinds, and only if this application is still the current one. */
3
+ export declare function bindApplication(application: Application): () => void;
4
+ /**
5
+ * The application `createApplication` made, for code that runs outside setup: an `api.ts` reading `currentApplication().platform.http`, a router
6
+ * guard, a store. Inside a component use `useApplication()` and the injected services; read it when the code runs, not at module load
7
+ * (a module is evaluated before `main.ts` creates the application).
8
+ *
9
+ * Throws before one exists. In a unit test make one first: `createTestApplication()` from `@wssto2/vue-core/testing`, and `dispose()` it after.
10
+ */
11
+ export declare function currentApplication(): Application;
@@ -28,5 +28,13 @@ export interface ApplicationEnvironment {
28
28
  setLocale(locale: string): Promise<boolean>;
29
29
  /** Tries the start again after a failed one. */
30
30
  retry(): Promise<void>;
31
+ /**
32
+ * Reports an error the code caught and the user saw fail (a save that did not go through, a panel that could not load): it goes
33
+ * through the application's `onError` as `source: "handled"` with the page the user was on, and `clientErrorReporter` sends it to the
34
+ * incidents. `detail` says where ("vehicle-location-edit"). Not for an error the user is expected to fix (a validation message).
35
+ */
36
+ report(error: unknown, options?: {
37
+ readonly detail?: string;
38
+ }): void;
31
39
  }
32
40
  export declare const applicationKey: import("vue").InjectionKey<ApplicationEnvironment>, useApplication: () => ApplicationEnvironment;
@@ -1,5 +1,6 @@
1
1
  export { createApplication } from "./application";
2
2
  export type { Application, ApplicationI18n, ApplicationErrorReport, ApplicationI18nOptions, ApplicationLocaleOptions, ApplicationOptions, ApplicationRouterOptions, ShellDefinition, } from "./application";
3
+ export { currentApplication } from "./current";
3
4
  export { ShellOutlet } from "./contributions";
4
5
  export { applicationKey, useApplication } from "./environment";
5
6
  export type { ApplicationEnvironment, ApplicationState } from "./environment";
package/dist/app/index.js CHANGED
@@ -1,16 +1,18 @@
1
- import { A as o, c as p } from "../application-CuzT-0vW.js";
2
- import { S as t } from "../contributions-CeG4bszd.js";
3
- import { a as i, u as l } from "../environment-Dva-SG8D.js";
4
- import { d as u, p as c } from "../feature-DdUAfyi4.js";
5
- import { k as x, u as m } from "../keepAlive-ClGnsIzT.js";
1
+ import { A as o, c as r } from "../application-DomS6sbx.js";
2
+ import { c as t } from "../current-B0lHKTWr.js";
3
+ import { S as i } from "../contributions-obnyn03x.js";
4
+ import { a as c, u as l } from "../environment-Dva-SG8D.js";
5
+ import { d as f, p as x } from "../feature-DdUAfyi4.js";
6
+ import { k as A, u as d } from "../keepAlive-ClGnsIzT.js";
6
7
  export {
7
8
  o as ApplicationError,
8
- t as ShellOutlet,
9
- i as applicationKey,
10
- p as createApplication,
11
- u as defineFeature,
12
- x as keepSessionAlive,
13
- c as provideContext,
9
+ i as ShellOutlet,
10
+ c as applicationKey,
11
+ r as createApplication,
12
+ t as currentApplication,
13
+ f as defineFeature,
14
+ A as keepSessionAlive,
15
+ x as provideContext,
14
16
  l as useApplication,
15
- m as useLanguages
17
+ d as useLanguages
16
18
  };