@aiquants/console-ui 0.7.2 → 0.8.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 (2) hide show
  1. package/README.md +3 -2
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -109,7 +109,7 @@ export const Console = ({ orphanCount, openSignIn }: { orphanCount: number | nul
109
109
  const accessFailure = useCallback<AccessFailurePresenter<ReactNode>>(
110
110
  (occurrence) => (
111
111
  <AccessFailureNotice
112
- view={accessFailureView(occurrence, { keepsWork: true }, ACCESS_FAILURE_LABELS)}
112
+ view={accessFailureView(occurrence, { signedIn: true, keepsWork: true }, ACCESS_FAILURE_LABELS)}
113
113
  handlers={{ "sign-in-again-in-new-window": openSignIn, ...(occurrence.retry === null ? {} : { retry: occurrence.retry }) }}
114
114
  testId="access-failure"
115
115
  />
@@ -129,7 +129,8 @@ export const Console = ({ orphanCount, openSignIn }: { orphanCount: number | nul
129
129
  `ConsoleUiRoot` has no default language (`locale` is `"en"` or `"ja"`; anything else throws), validates `formatLocale` as a BCP 47 tag and `timeZone` as an IANA time zone `Intl` knows (both reach the context in canonical form), and has no default for either.
130
130
  `accessFailure` is the host's presenter of access failures (`AccessFailurePresenter<ReactNode>` of `@aiquants/auth-core`), and it has no default either: a value that is not a function throws `TypeError` when the root renders, not at the first 401 or 403.
131
131
  Every 401 and 403 the console shows goes through it, as one occurrence (`{ kind, place, deniedSentence, retry }`: `unauthenticated` or `forbidden`, `read` or `write`, the denied sentence of a 403 or `null`, and the retry or `null`), and the node it returns is drawn in place of a failure sentence (`FailureMessage`, `ResourceFailed`; a component of the host's own reaches it with `useAccessFailure()`).
132
- So the host decides once, for the whole console, the texts (its own catalog, `resolveAccessFailureLabels` of `@aiquants/auth-core`), whether work in progress survives signing in again (`keepsWork`: in a new window, the screen stays as it is) and where each action leads; drawing it with `AccessFailureNotice` keeps the console's look, and the presenter passes a handler for every action the view can show at the places the console uses (a missing one throws `TypeError`).
132
+ So the host decides once, for the whole console, the texts (its own catalog, `resolveAccessFailureLabels` of `@aiquants/auth-core`), whether it knows the reader is signed in (`signedIn`: a console behind a sign-in passes `true`, so a 401 of a read or a write reads as an expired sign-in; with `false` it asks the reader to sign in), whether work in progress survives signing in again (`keepsWork`: in a new window, the screen stays as it is; only with `signedIn: true`) and where each action leads.
133
+ Drawing it with `AccessFailureNotice` keeps the console's look, and the presenter passes a handler for every action the view can show at the places the console uses (a missing one throws `TypeError`).
133
134
  Pass a presenter with one identity (`useCallback`, or a module constant): a new function on every render changes the root's context and re-renders every component that reads it.
134
135
  A console shows every instant with `formatInstant(iso, formatLocale, timeZone)` from the values `useConsoleUi()` returns, so every panel names the same instant with the same string and a page rendered on the server hydrates without a mismatch (the ambient time zone differs between the server and the browser).
135
136
  A console has exactly one root: a `ConsoleUiRoot` rendered inside another one throws, because a second root would add a second live region and a second token scope and could switch the language partway through the console. A view that is also used inside a console built on the package therefore takes the root from its host instead of wrapping itself in one.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiquants/console-ui",
3
- "version": "0.7.2",
3
+ "version": "0.8.0",
4
4
  "description": "Host-agnostic UI foundation for React admin consoles, with a React entry, a React-free core entry, a DOM testing entry and a stylesheet.",
5
5
  "sideEffects": [
6
6
  "**/*.css"
@@ -60,12 +60,12 @@
60
60
  "author": "AI Quants",
61
61
  "license": "MIT",
62
62
  "peerDependencies": {
63
- "@aiquants/auth-core": "^0.8.0",
63
+ "@aiquants/auth-core": "^0.9.0",
64
64
  "react": ">=19",
65
65
  "react-dom": ">=19"
66
66
  },
67
67
  "devDependencies": {
68
- "@aiquants/auth-core": "0.8.0",
68
+ "@aiquants/auth-core": "0.9.0",
69
69
  "@testing-library/jest-dom": "^6.9.1",
70
70
  "@testing-library/react": "^16.3.2",
71
71
  "@testing-library/user-event": "^14.6.1",