@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
@@ -14,7 +14,7 @@ import { useRouter as ge } from "vue-router";
14
14
  import { _ as F } from "./Button.vue_vue_type_script_setup_true_lang-CL9Qh5yq.js";
15
15
  import { u as ye } from "./format-D8X4zsx6.js";
16
16
  import { _ as xe } from "./Icon.vue_vue_type_script_lang-D7oC-d-S.js";
17
- import { _ as he } from "./AsyncSection.vue_vue_type_script_setup_true_lang-Blj6KgCr.js";
17
+ import { _ as he } from "./AsyncSection.vue_vue_type_script_setup_true_lang-B0NfvG3B.js";
18
18
  const M = {
19
19
  list: y("GET", "/v1/notifications"),
20
20
  unread: y("GET", "/v1/notifications/unread"),
@@ -31,9 +31,9 @@ const M = {
31
31
  deadLettersRetryAll: y("POST", "/v1/events/dead-letters/retry", { permission: "events.deadletter:retry" }),
32
32
  consumers: y("GET", "/v1/events/consumers", { permission: "events.deadletter:view" })
33
33
  }, [ke, ee] = fe("vue-core.notifications"), we = "events.deadletter:view", bt = "events.deadletter:retry", J = Z({
34
- index: { name: "events.deadletters", path: "/events/dead-letters", component: () => import("./DeadLetters-CRTeoZS1.js"), meta: { access: we, titleKey: "core.notifications.dead_letters.title" } }
34
+ index: { name: "events.deadletters", path: "/events/dead-letters", component: () => import("./DeadLetters-DeYxkTMh.js"), meta: { access: we, titleKey: "core.notifications.dead_letters.title" } }
35
35
  }), j = Z({
36
- index: { name: "notifications.settings", path: "/profile/notifications", component: () => import("./SettingsPage-0P38Ty4w.js"), meta: { titleKey: "core.notifications.settings.title" } }
36
+ index: { name: "notifications.settings", path: "/profile/notifications", component: () => import("./SettingsPage-BVrMihx0.js"), meta: { titleKey: "core.notifications.settings.title" } }
37
37
  }), Te = /* @__PURE__ */ z({
38
38
  __name: "SettingsMenuItem",
39
39
  setup(o) {
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  /** The version of @wssto2/vue-core (kept equal to package.json by index.test.ts). */
2
- export declare const version = "0.4.25";
2
+ export declare const version = "0.4.27";
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- const o = "0.4.25";
1
+ const o = "0.4.27";
2
2
  export {
3
3
  o as version
4
4
  };
@@ -1,6 +1,6 @@
1
1
  import { computed as k } from "vue";
2
2
  import { d as y } from "./context-Ch1r4fdN.js";
3
- import { h as N } from "./platform-q3cjODLx.js";
3
+ import { h as N } from "./platform-PZpUkkMS.js";
4
4
  function F(l, a = {}) {
5
5
  const i = /* @__PURE__ */ new Map(), o = [];
6
6
  for (const e of l) {
@@ -1,7 +1,7 @@
1
1
  import { computed as j, ref as z, shallowRef as I, watch as F, getCurrentScope as J, onScopeDispose as Q } from "vue";
2
2
  import { useRoute as O } from "vue-router";
3
3
  import { i as N } from "./error-CD7x0Jrz.js";
4
- import { L as k, d as B, e as D, o as U, q as V } from "./http-D_D9YbLH.js";
4
+ import { L as k, d as B, e as D, o as U, q as V } from "./http-BFfkA7gN.js";
5
5
  function K(l, t, n, g) {
6
6
  return typeof t == "string" ? t : { ...t, query: { ...t.query, [n]: D(l, g) } };
7
7
  }
@@ -1,4 +1,4 @@
1
- import { d as s, e as o, n as a, a as i, b as n } from "../index-tnSTp0cM.js";
1
+ import { d as s, e as o, n as a, a as i, b as n } from "../index-qUaGJ9j2.js";
2
2
  export {
3
3
  s as deadLettersRoutes,
4
4
  o as eventsRoutes,
@@ -0,0 +1,23 @@
1
+ import { type IconName } from "../icon";
2
+ /**
3
+ * The "⋯" button of a `Menu`: an icon-only round button for its `#trigger` slot, with the trigger
4
+ * attrs (`aria-haspopup`, `aria-expanded`, `aria-controls`) and a pressed look while the menu is
5
+ * open. Spread the slot scope on it.
6
+ *
7
+ * <Menu :items="items" :label="t('rowActions')">
8
+ * <template #trigger="trigger"><MenuButton v-bind="trigger" :label="t('rowActions')" /></template>
9
+ * </Menu>
10
+ */
11
+ type __VLS_Props = {
12
+ /** The accessible name (the button shows only an icon). */
13
+ label: string;
14
+ icon?: IconName;
15
+ /** The slot scope of `Menu`'s `#trigger`: */
16
+ presented: boolean;
17
+ toggle: () => void;
18
+ attrs: Record<string, string | boolean>;
19
+ };
20
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
21
+ icon: IconName;
22
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
23
+ export default _default;
@@ -1,5 +1,6 @@
1
1
  export { default as AlertDialog } from "./AlertDialog.vue";
2
2
  export { default as Menu, type MenuItem } from "./Menu.vue";
3
+ export { default as MenuButton } from "./MenuButton.vue";
3
4
  export { default as Popover } from "./Popover.vue";
4
5
  export { default as Toaster } from "./Toaster.vue";
5
6
  export { default as Tooltip } from "./Tooltip.vue";
@@ -1,15 +1,38 @@
1
- import { _ as x } from "../AlertDialog.vue_vue_type_script_setup_true_lang-whA4WLdl.js";
2
- import { _ as w } from "../Menu.vue_vue_type_script_setup_true_lang-DsFOeCVe.js";
3
- import { _ as I } from "../Popover.vue_vue_type_script_setup_true_lang-C70GrCP7.js";
4
- import { _ as v } from "../Toaster.vue_vue_type_script_setup_true_lang-55boRLAj.js";
5
- import { _ as P } from "../Tooltip.vue_vue_type_script_setup_true_lang-mErNPt8e.js";
6
- import { t as y } from "../toast-CqSDTWRX.js";
7
- import { I as k, u as E } from "../dialogStack-DZZg55w0.js";
8
- import { I as S, u as B } from "../useDialog-CXR3hN0G.js";
9
- import { C as O, u as V } from "../mediaQuery-CygcXmFW.js";
10
- import { _ as N } from "../PhotoViewer.vue_vue_type_script_setup_true_lang-CY5EZiyK.js";
11
- import { defineComponent as s, openBlock as r, createElementBlock as n, normalizeClass as l, toDisplayString as c } from "vue";
12
- const p = ["aria-disabled"], m = /* @__PURE__ */ s({
1
+ import { _ as P } from "../AlertDialog.vue_vue_type_script_setup_true_lang-whA4WLdl.js";
2
+ import { _ as y } from "../Menu.vue_vue_type_script_setup_true_lang-DsFOeCVe.js";
3
+ import { defineComponent as i, openBlock as a, createElementBlock as n, mergeProps as l, createVNode as u, unref as c, normalizeClass as f, toDisplayString as p } from "vue";
4
+ import { _ as d } from "../Icon.vue_vue_type_script_lang-D7oC-d-S.js";
5
+ import { _ as k } from "../Popover.vue_vue_type_script_setup_true_lang-C70GrCP7.js";
6
+ import { _ as D } from "../Toaster.vue_vue_type_script_setup_true_lang-55boRLAj.js";
7
+ import { _ as E } from "../Tooltip.vue_vue_type_script_setup_true_lang-mErNPt8e.js";
8
+ import { t as S } from "../toast-CqSDTWRX.js";
9
+ import { I as $, u as N } from "../dialogStack-DZZg55w0.js";
10
+ import { I as j, u as z } from "../useDialog-CXR3hN0G.js";
11
+ import { C as L, u as U } from "../mediaQuery-CygcXmFW.js";
12
+ import { _ as Q } from "../PhotoViewer.vue_vue_type_script_setup_true_lang-CY5EZiyK.js";
13
+ const m = ["aria-label", "data-pressed"], v = /* @__PURE__ */ i({
14
+ __name: "MenuButton",
15
+ props: {
16
+ label: {},
17
+ icon: { default: "moreLine" },
18
+ presented: { type: Boolean },
19
+ toggle: {},
20
+ attrs: {}
21
+ },
22
+ setup(s) {
23
+ const e = s;
24
+ return (t, o) => (a(), n("button", l({ type: "button" }, e.attrs, {
25
+ "aria-label": e.label,
26
+ class: "hit-target flex size-9 shrink-0 cursor-pointer items-center justify-center rounded-full bg-fill text-content-strong transition-colors duration-motion-fast hover:bg-fill-strong data-pressed:bg-fill-strong focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus",
27
+ "data-pressed": e.presented || void 0,
28
+ onClick: o[0] || (o[0] = (r) => e.toggle())
29
+ }), [
30
+ u(c(d), {
31
+ name: e.icon
32
+ }, null, 8, ["name"])
33
+ ], 16, m));
34
+ }
35
+ }), b = ["aria-disabled"], C = /* @__PURE__ */ i({
13
36
  __name: "PhotoViewerAction",
14
37
  props: {
15
38
  label: {},
@@ -17,33 +40,34 @@ const p = ["aria-disabled"], m = /* @__PURE__ */ s({
17
40
  disabled: { type: Boolean }
18
41
  },
19
42
  emits: ["select"],
20
- setup(o, { emit: t }) {
21
- const e = o, i = t;
22
- function a() {
23
- e.disabled || i("select");
43
+ setup(s, { emit: e }) {
44
+ const t = s, o = e;
45
+ function r() {
46
+ t.disabled || o("select");
24
47
  }
25
- return (f, u) => (r(), n("button", {
48
+ return (_, x) => (a(), n("button", {
26
49
  type: "button",
27
- "aria-disabled": e.disabled || void 0,
50
+ "aria-disabled": t.disabled || void 0,
28
51
  "data-part": "photo-viewer-action",
29
- class: l(["flex min-h-11 shrink-0 cursor-pointer items-center justify-center rounded-full bg-white/8 px-4 text-subheadline font-medium whitespace-nowrap transition-colors duration-motion-fast hover:bg-white/16 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[#6ee7b7] aria-disabled:cursor-default aria-disabled:opacity-40 aria-disabled:hover:bg-white/8", e.tone === "critical" ? "text-[#ff8a80]" : "text-[#f1f5f3]"]),
30
- onClick: a
31
- }, c(e.label), 11, p));
52
+ class: f(["flex min-h-11 shrink-0 cursor-pointer items-center justify-center rounded-full bg-white/8 px-4 text-subheadline font-medium whitespace-nowrap transition-colors duration-motion-fast hover:bg-white/16 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[#6ee7b7] aria-disabled:cursor-default aria-disabled:opacity-40 aria-disabled:hover:bg-white/8", t.tone === "critical" ? "text-[#ff8a80]" : "text-[#f1f5f3]"]),
53
+ onClick: r
54
+ }, p(t.label), 11, b));
32
55
  }
33
56
  });
34
57
  export {
35
- x as AlertDialog,
36
- O as COMPACT_MEDIA_QUERY,
37
- k as INERT_SKIP_ATTR,
38
- S as INITIAL_FOCUS_SKIP_ATTR,
39
- w as Menu,
40
- N as PhotoViewer,
41
- m as PhotoViewerAction,
42
- I as Popover,
43
- v as Toaster,
44
- P as Tooltip,
45
- y as toast,
46
- V as useCompactPresentation,
47
- B as useDialog,
48
- E as useOpenDialogCount
58
+ P as AlertDialog,
59
+ L as COMPACT_MEDIA_QUERY,
60
+ $ as INERT_SKIP_ATTR,
61
+ j as INITIAL_FOCUS_SKIP_ATTR,
62
+ y as Menu,
63
+ v as MenuButton,
64
+ Q as PhotoViewer,
65
+ C as PhotoViewerAction,
66
+ k as Popover,
67
+ D as Toaster,
68
+ E as Tooltip,
69
+ S as toast,
70
+ U as useCompactPresentation,
71
+ z as useDialog,
72
+ N as useOpenDialogCount
49
73
  };
@@ -1,15 +1,15 @@
1
- import { _ as x } from "../AdaptivePageShell.vue_vue_type_script_setup_true_lang-CxU9aNRQ.js";
2
- import { a as W, b as X, c as Y, d as Z, p as ee, u as te, e as ae } from "../AdaptivePageShell.vue_vue_type_script_setup_true_lang-CxU9aNRQ.js";
1
+ import { _ as x } from "../AdaptivePageShell.vue_vue_type_script_setup_true_lang-GUTIXuNd.js";
2
+ import { a as W, b as X, c as Y, d as Z, p as ee, u as te, e as ae } from "../AdaptivePageShell.vue_vue_type_script_setup_true_lang-GUTIXuNd.js";
3
3
  import { _ as se } from "../BottomDock.vue_vue_type_script_setup_true_lang-CjN7xYEr.js";
4
4
  import { b as ne, i as re, u as ie } from "../bottomDock-BZEiOPYZ.js";
5
5
  import { defineComponent as v, openBlock as a, createBlock as b, withCtx as c, createElementVNode as s, normalizeStyle as k, createElementBlock as l, Fragment as y, renderList as B, normalizeClass as d, unref as h, createCommentVNode as p, toDisplayString as f, useModel as S, useId as C, useTemplateRef as P, computed as $, mergeProps as w, createSlots as T, renderSlot as m, mergeModels as D } from "vue";
6
6
  import { _ as L } from "../Icon.vue_vue_type_script_lang-D7oC-d-S.js";
7
- import { _ as ue } from "../RecordHeader.vue_vue_type_script_setup_true_lang-szzWzdDu.js";
7
+ import { _ as ue } from "../RecordHeader.vue_vue_type_script_setup_true_lang-fmx0f8xi.js";
8
8
  import { c as pe, i as fe, p as me, a as be, u as ge, b as ve } from "../chrome-nUcmVu8G.js";
9
9
  import { s as z, u as I } from "../sectionIndex-BS0ic5W7.js";
10
10
  import { p as _e, a as xe } from "../sectionIndex-BS0ic5W7.js";
11
- import { _ as ye } from "../SectionNavigator.vue_vue_type_script_setup_true_lang-BltrQnrQ.js";
12
- import { a as Se, _ as Ce } from "../SectionList.vue_vue_type_script_setup_true_lang-BJnz2ROc.js";
11
+ import { _ as ye } from "../SectionNavigator.vue_vue_type_script_setup_true_lang-Dmv6TpCi.js";
12
+ import { a as Se, _ as Ce } from "../SectionList.vue_vue_type_script_setup_true_lang-wyW7n3Uq.js";
13
13
  import { _ as A } from "../Panel.vue_vue_type_script_setup_true_lang-BA0u_DtS.js";
14
14
  const K = ["aria-label"], M = ["aria-label"], N = ["aria-selected", "tabindex", "onClick"], R = { class: "relative" }, E = {
15
15
  key: 2,
@@ -1,3 +1,5 @@
1
+ import type { BootstrapConfig } from "./bootstrap";
2
+ import type { SessionUser } from "./session";
1
3
  export { createAccessClient } from "./access";
2
4
  export type { AccessClient, AccessClientOptions, AccessClause, AccessQualifier, AccessScope, AccessSnapshot, HeldAccess } from "./access";
3
5
  export { BootstrapError, BootstrapFields, parseBootstrap, readBootstrap } from "./bootstrap";
@@ -9,8 +11,9 @@ export { httpSessionAdapter, parseSessionPayload } from "./httpSession";
9
11
  export type { HttpSessionOptions, UserParser } from "./httpSession";
10
12
  export { createPlatform, installPlatform, platformKey, usePlatform } from "./platform";
11
13
  export type { Platform, PlatformOptions } from "./platform";
14
+ export { useSessionUser } from "./sessionUser";
12
15
  export { beforeSignOutTimeout, createSession, heldSession } from "./session";
13
- export type { BeforeSignOutHook, Session, SessionAdapter, SessionEnd, SessionImpersonator, SessionOptions, SessionSnapshot, SessionState, SessionUser } from "./session";
16
+ export type { BeforeSignOutHook, Session, SessionAdapter, SessionEnd, SessionImpersonator, SessionOptions, SessionPatch, SessionSnapshot, SessionState, SessionUser } from "./session";
14
17
  /**
15
18
  * The permission identifiers of the application. The library declares none: an app adds its own by
16
19
  * augmenting this interface (declaration merging, like `IconRegistry`), so route metadata and
@@ -26,3 +29,24 @@ export interface PermissionRegistry {
26
29
  export type Permission = keyof PermissionRegistry extends never ? string : Extract<keyof PermissionRegistry, string>;
27
30
  export { default as AccessGate } from "./AccessGate.vue";
28
31
  export type { AccessGateProps } from "./AccessGate.vue";
32
+ /**
33
+ * The application's own session user and bootstrap config. The library declares neither: an app says
34
+ * once what they are by augmenting this interface (declaration merging, like `PermissionRegistry`), and
35
+ * `usePlatform()`, `useSessionUser()`, `createApplication` and `createTestPlatform` are typed from it, with no cast.
36
+ *
37
+ * declare module "@wssto2/vue-core/platform" {
38
+ * interface PlatformRegistry { user: AppUser; config: AppConfig }
39
+ * }
40
+ *
41
+ * Both keys are optional: a missing one leaves `SessionUser` / `BootstrapConfig`.
42
+ */
43
+ export interface PlatformRegistry {
44
+ }
45
+ /** The registered session user (`PlatformRegistry["user"]`); `SessionUser` until the app declares one. */
46
+ export type RegisteredUser = PlatformRegistry extends {
47
+ user: infer U extends SessionUser;
48
+ } ? U : SessionUser;
49
+ /** The registered bootstrap config (`PlatformRegistry["config"]`); `BootstrapConfig` until the app declares one. */
50
+ export type RegisteredConfig = PlatformRegistry extends {
51
+ config: infer C extends BootstrapConfig;
52
+ } ? C : BootstrapConfig;
@@ -1,14 +1,16 @@
1
1
  var N = Object.defineProperty;
2
- var B = (s) => {
2
+ var S = (s) => {
3
3
  throw TypeError(s);
4
4
  };
5
- var E = (s, t, e) => t in s ? N(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
6
- var $ = (s, t, e) => E(s, typeof t != "symbol" ? t + "" : t, e), w = (s, t, e) => t.has(s) || B("Cannot " + e);
7
- var o = (s, t, e) => (w(s, t, "read from private field"), e ? e.call(s) : t.get(s)), h = (s, t, e) => t.has(s) ? B("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(s) : t.set(s, e), f = (s, t, e, r) => (w(s, t, "write to private field"), r ? r.call(s, e) : t.set(s, e), e), u = (s, t, e) => (w(s, t, "access private method"), e);
8
- import { b as J, c as L, a as M, d as T, h as q, e as F, i as G, p as K, f as _, g as z, u as D } from "../platform-q3cjODLx.js";
9
- import { M as Q, d as R } from "../context-Ch1r4fdN.js";
10
- import { _ as V } from "../AccessGate.vue_vue_type_script_setup_true_lang-DcbZBINh.js";
11
- class d extends Error {
5
+ var v = (s, t, e) => t in s ? N(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
6
+ var $ = (s, t, e) => v(s, typeof t != "symbol" ? t + "" : t, e), w = (s, t, e) => t.has(s) || S("Cannot " + e);
7
+ var o = (s, t, e) => (w(s, t, "read from private field"), e ? e.call(s) : t.get(s)), l = (s, t, e) => t.has(s) ? S("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(s) : t.set(s, e), f = (s, t, e, r) => (w(s, t, "write to private field"), r ? r.call(s, e) : t.set(s, e), e), h = (s, t, e) => (w(s, t, "access private method"), e);
8
+ import { u as E } from "../platform-PZpUkkMS.js";
9
+ import { b as F, c as G, a as K, d as U, h as _, e as z, i as D, p as H, f as Q, g as R } from "../platform-PZpUkkMS.js";
10
+ import { M as W, d as X } from "../context-Ch1r4fdN.js";
11
+ import { computed as O } from "vue";
12
+ import { _ as Z } from "../AccessGate.vue_vue_type_script_setup_true_lang-J5HoyGNJ.js";
13
+ class m extends Error {
12
14
  constructor(e, r = [], n) {
13
15
  super(r.length > 0 ? `${e}: ${r.join("; ")}` : e);
14
16
  $(this, "issues");
@@ -16,52 +18,52 @@ class d extends Error {
16
18
  this.name = "BootstrapError", this.issues = r, this.cause = n?.cause;
17
19
  }
18
20
  }
19
- const x = (s) => s === null ? "null" : Array.isArray(s) ? "array" : typeof s, S = (s) => typeof s == "object" && s !== null && !Array.isArray(s);
20
- var a, c, p, m, l, g;
21
+ const x = (s) => s === null ? "null" : Array.isArray(s) ? "array" : typeof s, B = (s) => typeof s == "object" && s !== null && !Array.isArray(s);
22
+ var a, c, p, d, u, g;
21
23
  const b = class b {
22
24
  /** @internal use the `fields` passed to `extend`. */
23
25
  constructor(t, e, r, n = !1) {
24
- h(this, l);
25
- h(this, a);
26
- h(this, c);
27
- h(this, p);
28
- h(this, m);
29
- f(this, a, t), f(this, c, e), f(this, p, r), f(this, m, n);
26
+ l(this, u);
27
+ l(this, a);
28
+ l(this, c);
29
+ l(this, p);
30
+ l(this, d);
31
+ f(this, a, t), f(this, c, e), f(this, p, r), f(this, d, n);
30
32
  }
31
33
  /** Records a problem with `key`; for values `raw` returns that the application validates itself. */
32
34
  fail(t, e) {
33
- o(this, m) || o(this, p).push(`${o(this, c)}${t}: ${e}`);
35
+ o(this, d) || o(this, p).push(`${o(this, c)}${t}: ${e}`);
34
36
  }
35
37
  /** The value as sent, unchecked. Validate it and report with `fail`. */
36
38
  raw(t) {
37
39
  return o(this, a)[t];
38
40
  }
39
41
  string(t, ...e) {
40
- return u(this, l, g).call(this, t, "string", (r) => typeof r == "string", e);
42
+ return h(this, u, g).call(this, t, "string", (r) => typeof r == "string", e);
41
43
  }
42
44
  number(t, ...e) {
43
- return u(this, l, g).call(this, t, "number", (r) => typeof r == "number" && Number.isFinite(r), e);
45
+ return h(this, u, g).call(this, t, "number", (r) => typeof r == "number" && Number.isFinite(r), e);
44
46
  }
45
47
  boolean(t, ...e) {
46
- return u(this, l, g).call(this, t, "boolean", (r) => typeof r == "boolean", e);
48
+ return h(this, u, g).call(this, t, "boolean", (r) => typeof r == "boolean", e);
47
49
  }
48
50
  stringList(t, ...e) {
49
- return u(this, l, g).call(this, t, "array of strings", (r) => Array.isArray(r) && r.every((n) => typeof n == "string"), e);
51
+ return h(this, u, g).call(this, t, "array of strings", (r) => Array.isArray(r) && r.every((n) => typeof n == "string"), e);
50
52
  }
51
53
  /** A nested object, read with the same checks; issues are reported as `parent.child`. */
52
54
  section(t) {
53
55
  const e = o(this, a)[t];
54
- return S(e) ? new b(e, `${o(this, c)}${t}.`, o(this, p)) : (this.fail(t, `expected object, got ${x(e)}`), new b({}, `${o(this, c)}${t}.`, o(this, p), !0));
56
+ return B(e) ? new b(e, `${o(this, c)}${t}.`, o(this, p)) : (this.fail(t, `expected object, got ${x(e)}`), new b({}, `${o(this, c)}${t}.`, o(this, p), !0));
55
57
  }
56
58
  };
57
- a = new WeakMap(), c = new WeakMap(), p = new WeakMap(), m = new WeakMap(), l = new WeakSet(), g = function(t, e, r, n) {
59
+ a = new WeakMap(), c = new WeakMap(), p = new WeakMap(), d = new WeakMap(), u = new WeakSet(), g = function(t, e, r, n) {
58
60
  const i = o(this, a)[t];
59
61
  return i === void 0 && n.length > 0 ? n[0] : r(i) ? i : (this.fail(t, `expected ${e}, got ${i === void 0 ? "nothing (missing)" : x(i)}`), null);
60
62
  };
61
63
  let A = b;
62
- function O(s, t) {
63
- if (!S(s))
64
- throw new d("Invalid bootstrap config", [`expected a JSON object, got ${x(s)}`]);
64
+ function C(s, t) {
65
+ if (!B(s))
66
+ throw new m("Invalid bootstrap config", [`expected a JSON object, got ${x(s)}`]);
65
67
  const e = [], r = new A(s, "", e), n = r.string("locale");
66
68
  n === "" && r.fail("locale", "must not be empty");
67
69
  const i = {
@@ -70,42 +72,50 @@ function O(s, t) {
70
72
  appName: r.string("app_name", null),
71
73
  capabilities: r.stringList("capabilities", [])
72
74
  }, y = t?.(r) ?? {};
73
- if (e.length > 0) throw new d("Invalid bootstrap config", e);
75
+ if (e.length > 0) throw new m("Invalid bootstrap config", e);
74
76
  return { ...y, ...i };
75
77
  }
76
- function C(s = {}) {
78
+ function L(s = {}) {
77
79
  const { element: t = "app-state", extend: e } = s, r = typeof t == "string" ? document.getElementById(t) : t, n = typeof t == "string" ? `#${t}` : "the given element";
78
80
  if (!r)
79
- throw new d(
81
+ throw new m(
80
82
  `Bootstrap config not found: the page has no ${n} element (expected <script id="app-state" type="application/json">)`
81
83
  );
82
84
  const i = r.textContent?.trim() ?? "";
83
- if (i === "") throw new d(`Bootstrap config is empty: ${n} has no content`);
85
+ if (i === "") throw new m(`Bootstrap config is empty: ${n} has no content`);
84
86
  let y;
85
87
  try {
86
88
  y = JSON.parse(i);
87
89
  } catch (j) {
88
- throw new d(`Bootstrap config in ${n} is not valid JSON`, [], { cause: j });
90
+ throw new m(`Bootstrap config in ${n} is not valid JSON`, [], { cause: j });
89
91
  }
90
- return O(y, e);
92
+ return C(y, e);
93
+ }
94
+ function M() {
95
+ const { session: s } = E();
96
+ return O(() => {
97
+ const t = s.state.value;
98
+ return t.status === "authenticated" ? t.user : null;
99
+ });
91
100
  }
92
101
  export {
93
- V as AccessGate,
94
- d as BootstrapError,
102
+ Z as AccessGate,
103
+ m as BootstrapError,
95
104
  A as BootstrapFields,
96
- Q as MissingContextError,
97
- J as beforeSignOutTimeout,
98
- L as createAccessClient,
99
- M as createPlatform,
100
- T as createSession,
101
- R as defineFeatureContext,
102
- q as heldSession,
103
- F as httpSessionAdapter,
104
- G as installPlatform,
105
- O as parseBootstrap,
106
- K as parseNavigation,
107
- _ as parseSessionPayload,
108
- z as platformKey,
109
- C as readBootstrap,
110
- D as usePlatform
105
+ W as MissingContextError,
106
+ F as beforeSignOutTimeout,
107
+ G as createAccessClient,
108
+ K as createPlatform,
109
+ U as createSession,
110
+ X as defineFeatureContext,
111
+ _ as heldSession,
112
+ z as httpSessionAdapter,
113
+ D as installPlatform,
114
+ C as parseBootstrap,
115
+ H as parseNavigation,
116
+ Q as parseSessionPayload,
117
+ R as platformKey,
118
+ L as readBootstrap,
119
+ E as usePlatform,
120
+ M as useSessionUser
111
121
  };
@@ -1,10 +1,14 @@
1
- import type { App } from "vue";
1
+ import type { App, InjectionKey } from "vue";
2
2
  import { type HttpClient, type HttpClientOptions, type Transport } from "../client";
3
3
  import { type AccessClient, type AccessClientOptions } from "./access";
4
4
  import type { BootstrapConfig } from "./bootstrap";
5
+ import type { RegisteredConfig, RegisteredUser } from "./index";
5
6
  import { type BeforeSignOutHook, type Session, type SessionAdapter, type SessionUser } from "./session";
6
- /** One application's shared services. Everything in it belongs to this instance alone. */
7
- export interface Platform<U extends SessionUser = SessionUser, C extends BootstrapConfig = BootstrapConfig> {
7
+ /**
8
+ * One application's shared services. Everything in it belongs to this instance alone. Bare `Platform` is the
9
+ * application's own: its user and config as declared in `PlatformRegistry`.
10
+ */
11
+ export interface Platform<U extends SessionUser = RegisteredUser, C extends BootstrapConfig = RegisteredConfig> {
8
12
  readonly config: C;
9
13
  readonly http: HttpClient;
10
14
  readonly session: Session<U>;
@@ -54,6 +58,6 @@ export declare function createPlatform<C extends BootstrapConfig>(options: Platf
54
58
  export declare function createPlatform<U extends SessionUser, C extends BootstrapConfig>(options: PlatformOptions<U, C> & {
55
59
  session: NonNullable<PlatformOptions<U, C>["session"]>;
56
60
  }): Platform<U, C>;
57
- /** The platform as a context: `installPlatform(app, platform)` once, `usePlatform()` in components. */
58
- export declare const platformKey: import("vue").InjectionKey<Platform<SessionUser, BootstrapConfig>>, usePlatform: () => Platform<SessionUser, BootstrapConfig>;
61
+ export declare const platformKey: InjectionKey<Platform>;
62
+ export declare const usePlatform: () => Platform;
59
63
  export declare function installPlatform(app: App, platform: Platform): void;
@@ -51,6 +51,8 @@ export type SessionState<U extends SessionUser = SessionUser> =
51
51
  * expired (its user, access and menu stay on screen while the person signs in again); null otherwise.
52
52
  */
53
53
  export declare function heldSession<U extends SessionUser>(state: SessionState<U>): SessionSnapshot<U> | null;
54
+ /** The parts of a signed-in session `Session.update` may replace. */
55
+ export type SessionPatch<U extends SessionUser = SessionUser> = Partial<Pick<SessionSnapshot<U>, "user" | "access" | "navigation">>;
54
56
  /** The seam to a backend: how to ask who is signed in and how to end the session. */
55
57
  export interface SessionAdapter<U extends SessionUser = SessionUser> {
56
58
  /** The current session, or null when there is none (not signed in). Reject for failures; honour `signal`. */
@@ -77,6 +79,14 @@ export interface Session<U extends SessionUser = SessionUser> {
77
79
  refresh(): Promise<SessionState<U>>;
78
80
  /** A sign-in succeeded: the application's login call produced this snapshot. */
79
81
  establish(snapshot: SessionSnapshot<U>): void;
82
+ /**
83
+ * The same person, changed in place: a profile or language saved, a menu or access re-read by the application. Replaces
84
+ * only the parts in the patch; the status, `expiresAt` and the impersonator stay, and nothing in flight is cancelled
85
+ * (this is not "a change of who is signed in", which is `establish`). A no-op unless authenticated. A `user.id` other than
86
+ * the signed-in one is a programming error and throws: a different person is `establish`. A refresh already asked
87
+ * still lands when it is answered, with the server's version.
88
+ */
89
+ update(patch: SessionPatch<U>): void;
80
90
  /** The server rejected the session (401): signed in becomes anonymous with reason `expired`. No-op when nobody is signed in. */
81
91
  expire(): void;
82
92
  /**
@@ -0,0 +1,8 @@
1
+ import { type ComputedRef } from "vue";
2
+ import type { RegisteredUser } from "./index";
3
+ /**
4
+ * The signed-in user, typed from `PlatformRegistry`, or `null` while nobody is signed in (also while a session
5
+ * that expired is held on screen: it is not a signed-in user). Follows the session, so a user changed in place
6
+ * (`session.update({ user })`) reaches the reader. The impersonator stays on `session.state`.
7
+ */
8
+ export declare function useSessionUser(): Readonly<ComputedRef<RegisteredUser | null>>;