@proappstore/sdk 1.16.57 → 1.16.59
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.
- package/README.md +27 -14
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/navbar.d.ts +5 -0
- package/dist/navbar.d.ts.map +1 -1
- package/dist/navbar.js.map +1 -1
- package/dist/page.d.ts +27 -0
- package/dist/page.d.ts.map +1 -0
- package/dist/page.js +27 -0
- package/dist/page.js.map +1 -0
- package/dist/shell-css.d.ts +8 -0
- package/dist/shell-css.d.ts.map +1 -0
- package/dist/shell-css.js +28 -0
- package/dist/shell-css.js.map +1 -0
- package/dist/shell-resilience.d.ts +89 -0
- package/dist/shell-resilience.d.ts.map +1 -0
- package/dist/shell-resilience.js +178 -0
- package/dist/shell-resilience.js.map +1 -0
- package/dist/shell.css +20 -0
- package/dist/shell.d.ts +13 -1
- package/dist/shell.d.ts.map +1 -1
- package/dist/shell.js +43 -15
- package/dist/shell.js.map +1 -1
- package/dist/ui.d.ts +4 -0
- package/dist/ui.d.ts.map +1 -1
- package/dist/ui.js +3 -0
- package/dist/ui.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -18,6 +18,8 @@ import { initPro } from '@proappstore/sdk'
|
|
|
18
18
|
const app = initPro({ appId: 'my-app' })
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
+
Then wrap the whole app in `<ProShell app={app} appName="…" nav={[…]}>`, the standard app frame with the gates, topbar, main navigation and resilience layer. See [ProShell Component](#proshell-component).
|
|
22
|
+
|
|
21
23
|
Options:
|
|
22
24
|
|
|
23
25
|
| Option | Default | Description |
|
|
@@ -508,9 +510,9 @@ const all = await app.roles.listAll()
|
|
|
508
510
|
// [{ userId: 'user-456', role: 'moderator' }, ...]
|
|
509
511
|
```
|
|
510
512
|
|
|
511
|
-
## React Hooks
|
|
513
|
+
## React Hooks
|
|
512
514
|
|
|
513
|
-
|
|
515
|
+
Every app is wrapped in [`ProShell`](#proshell-component), which already runs the sign-in and subscription gates. Use these hooks inside its screens to read identity and subscription state, or to gate a single screen. Import from `@proappstore/sdk` or `@proappstore/sdk/hooks`.
|
|
514
516
|
|
|
515
517
|
### useProAuth
|
|
516
518
|
|
|
@@ -522,11 +524,10 @@ import { useProAuth } from '@proappstore/sdk/hooks'
|
|
|
522
524
|
|
|
523
525
|
const app = initPro({ appId: 'my-app' })
|
|
524
526
|
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
return <p>Welcome, {user.login}! <button onClick={signOut}>Sign out</button></p>
|
|
527
|
+
// A screen inside <ProShell>: the shell has already signed the user in.
|
|
528
|
+
function Welcome() {
|
|
529
|
+
const { user, signOut } = useProAuth(app)
|
|
530
|
+
return <p>Welcome, {user?.login}! <button onClick={signOut}>Sign out</button></p>
|
|
530
531
|
}
|
|
531
532
|
```
|
|
532
533
|
|
|
@@ -547,7 +548,7 @@ function Billing() {
|
|
|
547
548
|
|
|
548
549
|
### useProGate
|
|
549
550
|
|
|
550
|
-
Combined auth + subscription gate. Returns a single `gate` state for easy conditional rendering.
|
|
551
|
+
Combined auth + subscription gate. Returns a single `gate` state for easy conditional rendering. ProShell gates the whole app; use this for one Pro-only screen in an app that otherwise allows free users.
|
|
551
552
|
|
|
552
553
|
```tsx
|
|
553
554
|
import { initPro } from '@proappstore/sdk'
|
|
@@ -555,19 +556,19 @@ import { useProGate } from '@proappstore/sdk/hooks'
|
|
|
555
556
|
|
|
556
557
|
const app = initPro({ appId: 'my-app' })
|
|
557
558
|
|
|
558
|
-
|
|
559
|
-
|
|
559
|
+
// A screen inside <ProShell allowFree>: only this screen needs a subscription.
|
|
560
|
+
function ReportsScreen() {
|
|
561
|
+
const { gate, upgrade } = useProGate(app, { allowFree: false })
|
|
560
562
|
|
|
561
563
|
if (gate === 'loading') return <p>Loading...</p>
|
|
562
|
-
if (gate === 'signed-out') return <button onClick={signIn}>Sign in</button>
|
|
563
564
|
if (gate === 'no-subscription') return <button onClick={() => upgrade()}>Upgrade</button>
|
|
564
|
-
return <
|
|
565
|
+
return <Reports />
|
|
565
566
|
}
|
|
566
567
|
```
|
|
567
568
|
|
|
568
569
|
Gate states: `'loading'` | `'signed-out'` | `'no-subscription'` | `'ready'`
|
|
569
570
|
|
|
570
|
-
|
|
571
|
+
`allowFree` defaults to `true` (free users pass); pass `{ allowFree: false }` to require an active subscription.
|
|
571
572
|
|
|
572
573
|
## ProShell Component
|
|
573
574
|
|
|
@@ -601,7 +602,7 @@ Props:
|
|
|
601
602
|
| `app` | `ProAppStore` | SDK instance from `initPro()` |
|
|
602
603
|
| `children` | `ReactNode` | App content (rendered only when gates pass) |
|
|
603
604
|
| `appName` | `string?` | Name shown in the topbar |
|
|
604
|
-
| `nav` | `{ label: string; href: string; icon?: ReactNode }[]` | **The app's screens**, rendered as the main navigation in the topbar |
|
|
605
|
+
| `nav` | `{ label: string; href: string; icon?: ReactNode; title?: string }[]` | **The app's screens**, rendered as the main navigation in the topbar |
|
|
605
606
|
| `onNavigate` | `(href: string) => void` | Client-side navigation for nav clicks (e.g. a router's `navigate`); without it items are links |
|
|
606
607
|
| `renderNav` | `(ctx) => ReactNode` | Replace the built-in NavBar (`ctx`: `items`, `currentPath`, `onNavigate`) |
|
|
607
608
|
| `allowFree` | `boolean?` | Skip subscription gate (default: `true` until platform billing is live) |
|
|
@@ -611,6 +612,8 @@ Props:
|
|
|
611
612
|
| `hideFooter` | `boolean?` | Omit the default footer |
|
|
612
613
|
| `renderTopbar` | `(ctx) => ReactNode` | Replace the default topbar; place `ctx.nav` in it |
|
|
613
614
|
| `renderFooter` | `(ctx) => ReactNode` | Replace the default footer |
|
|
615
|
+
| `renderError` | `({ error, reset }) => ReactNode` | Replace the error-boundary fallback (errors are recorded via `app.logs`) |
|
|
616
|
+
| `renderLoading` | `() => ReactNode` | Replace the spinner shown while a lazy screen loads |
|
|
614
617
|
|
|
615
618
|
ProShell handles:
|
|
616
619
|
- Auth initialization and the sign-in gate
|
|
@@ -623,6 +626,14 @@ ProShell handles:
|
|
|
623
626
|
- 44 px targets and visible focus.
|
|
624
627
|
|
|
625
628
|
Its styles are injected when the navbar renders, so no setup is needed. They are also available as `@proappstore/sdk/shell.css`.
|
|
629
|
+
- Resilience and feedback:
|
|
630
|
+
- an error boundary (with a Try again fallback, errors recorded via `app.logs`) and a Suspense spinner around the content;
|
|
631
|
+
- `useToast()` for messages in one polite live region;
|
|
632
|
+
- an offline banner, plus `useOnline()`;
|
|
633
|
+
- tab titles from a nav item's `title` or `useDocumentTitle`;
|
|
634
|
+
- `PageHeader` for each screen's one `h1`;
|
|
635
|
+
- a skip link to `<main id="main">`;
|
|
636
|
+
- with `onNavigate`, scroll to top or restore on back/forward, and focus moved to the new screen's heading.
|
|
626
637
|
|
|
627
638
|
Do not build navigation into a page, and do not stack a second navbar under the shell. A custom topbar keeps the gates and places the rendered `nav`:
|
|
628
639
|
|
|
@@ -646,6 +657,8 @@ Do not build navigation into a page, and do not stack a second navbar under the
|
|
|
646
657
|
|
|
647
658
|
For a fully custom layout, use `<ProShell app={app} hideTopbar hideFooter>` and compose `NavBar`, `ProfileMenu`, `SignInButton`, `GateScreen`, and hooks from `@proappstore/sdk/ui` and `@proappstore/sdk/hooks`.
|
|
648
659
|
|
|
660
|
+
The children render only after the gates pass: signed-out visitors see the sign-in screen with no topbar or navigation, and `platform-cookie` apps show it briefly to returning users while the session hydrates. Routing caveats (routers, hash routing) and a step-by-step guide to replacing a hand-rolled header or navbar are in the [SDK overview](https://docs.proappstore.online/sdk-overview/#proshell-component).
|
|
661
|
+
|
|
649
662
|
## UI Components
|
|
650
663
|
|
|
651
664
|
Import from `@proappstore/sdk/ui`:
|
package/dist/index.d.ts
CHANGED
|
@@ -47,7 +47,11 @@ export { useProAuth, useProSubscription, useProGate, useProNotifications } from
|
|
|
47
47
|
export { ProProvider, useApp } from './provider.js';
|
|
48
48
|
export type { ProProviderProps } from './provider.js';
|
|
49
49
|
export { ProShell } from './shell.js';
|
|
50
|
-
export type { ProShellProps, ProShellRenderContext, ProShellNavContext, MenuItem } from './shell.js';
|
|
50
|
+
export type { ProShellProps, ProShellRenderContext, ProShellNavContext, MenuItem, ShellErrorContext } from './shell.js';
|
|
51
|
+
export { useToast, useOnline } from './shell-resilience.js';
|
|
52
|
+
export type { ToastApi, ToastOptions, ShellToastVariant } from './shell-resilience.js';
|
|
53
|
+
export { PageHeader, useDocumentTitle } from './page.js';
|
|
54
|
+
export type { PageHeaderProps } from './page.js';
|
|
51
55
|
export { NavBar } from './navbar.js';
|
|
52
56
|
export type { NavBarProps, NavItem } from './navbar.js';
|
|
53
57
|
export { Avatar, ThemeToggle, TextSizeToggle, SignInButton, ProfileMenu, ProBadge, SubscriptionStatus, UpgradeCard, BillingButton, GateScreen, ProProfilePage, } from './ui.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAmB,MAAM,WAAW,CAAC;AAClD,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAA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BAAa,WAAW;IACtB,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC;IAChB,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC;IACzB,QAAQ,CAAC,YAAY,EAAE,eAAe,CAAC;IACvC,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC;IAC7B,QAAQ,CAAC,EAAE,EAAE,QAAQ,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IACpB,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC;IACtC,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC;IAClB,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC;IAChB,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,6DAA6D;IAC7D,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,qFAAqF;IACrF,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;gBAER,IAAI,EAAE,cAAc;CAwCjC;AAED,+EAA+E;AAC/E,wBAAgB,OAAO,CAAC,IAAI,EAAE,cAAc,GAAG,WAAW,CAEzD"}
|
package/dist/index.js
CHANGED
|
@@ -36,6 +36,8 @@ export { useAuth, useSubscription, useGate, useNotifications, useTheme } from '.
|
|
|
36
36
|
export { useProAuth, useProSubscription, useProGate, useProNotifications } from './hooks.js';
|
|
37
37
|
export { ProProvider, useApp } from './provider.js';
|
|
38
38
|
export { ProShell } from './shell.js';
|
|
39
|
+
export { useToast, useOnline } from './shell-resilience.js';
|
|
40
|
+
export { PageHeader, useDocumentTitle } from './page.js';
|
|
39
41
|
export { NavBar } from './navbar.js';
|
|
40
42
|
export { Avatar, ThemeToggle, TextSizeToggle, SignInButton, ProfileMenu, ProBadge, SubscriptionStatus, UpgradeCard, BillingButton, GateScreen, ProProfilePage, } from './ui.js';
|
|
41
43
|
/**
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,uEAAuE;AACvE,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,C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AAC,IAAoB;IAC1C,OAAO,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;AAC/B,CAAC"}
|
package/dist/navbar.d.ts
CHANGED
|
@@ -6,6 +6,11 @@ export interface NavItem {
|
|
|
6
6
|
href: string;
|
|
7
7
|
/** Optional icon, rendered before the label (mark it `aria-hidden`). */
|
|
8
8
|
icon?: ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* Tab title while this item's route is current (#236, PAS-UI-003). ProShell
|
|
11
|
+
* applies it; a screen's own `useDocumentTitle` overrides it.
|
|
12
|
+
*/
|
|
13
|
+
title?: string;
|
|
9
14
|
}
|
|
10
15
|
export interface NavBarProps {
|
|
11
16
|
items: NavItem[];
|
package/dist/navbar.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navbar.d.ts","sourceRoot":"","sources":["../src/navbar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA2E,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGhH,+CAA+C;AAC/C,MAAM,WAAW,OAAO;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,wEAAwE;IACxE,IAAI,CAAC,EAAE,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"navbar.d.ts","sourceRoot":"","sources":["../src/navbar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA2E,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGhH,+CAA+C;AAC/C,MAAM,WAAW,OAAO;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,wEAAwE;IACxE,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,OAAO,EAAE,CAAC;IACjB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACrC;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC,CAYjF;AAED,oGAAoG;AACpG,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAOxE;AAYD;;;;;;;;GAQG;AACH,wBAAgB,MAAM,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,EAAE,WAAW,kDAmErE"}
|
package/dist/navbar.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navbar.js","sourceRoot":"","sources":["../src/navbar.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,kBAAkB,EAAE,MAAM,EAAE,QAAQ,EAAmC,MAAM,OAAO,CAAC;AAChH,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"navbar.js","sourceRoot":"","sources":["../src/navbar.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,kBAAkB,EAAE,MAAM,EAAE,QAAQ,EAAmC,MAAM,OAAO,CAAC;AAChH,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AA+B7C;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,OAAgB;IAC7C,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,OAAO,IAAI,CAAC,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;I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AAI,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,MAAM,EAAC,MAAM,EAAC,cAAc,EAAC,WAAW,EAAC,GAAG,EAAC,aAAa,EAAC,OAAO,YACxI,eAAM,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,yBAAyB,GAAI,GAClE,GACC,EACT,aAAI,EAAE,EAAE,MAAM,EAAE,SAAS,EAAC,yDAAyD,YAChF,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACnB,uBACE,aACE,IAAI,EAAE,IAAI,CAAC,IAAI,kBACD,IAAI,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EACxD,SAAS,EAAC,qRAAqR,EAC/R,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,aAEnC,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,KAAK,IACT,IATG,IAAI,CAAC,IAAI,CAUb,CACN,CAAC,GACC,IACD,CACP,CAAC;AACJ,CAAC"}
|
package/dist/page.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Set the tab title for the current screen (#236, PAS-UI-003). Call it once in
|
|
4
|
+
* each routed screen; the title follows the value while the screen is mounted.
|
|
5
|
+
* Runs after ProShell applies a nav item's `title`, so the screen's own title
|
|
6
|
+
* wins on the same route.
|
|
7
|
+
*
|
|
8
|
+
* ```tsx
|
|
9
|
+
* useDocumentTitle(`${task.title} — Tasks`)
|
|
10
|
+
* ```
|
|
11
|
+
*/
|
|
12
|
+
export declare function useDocumentTitle(title: string | null | undefined): void;
|
|
13
|
+
export interface PageHeaderProps {
|
|
14
|
+
/** The screen's heading — rendered as its single `<h1>`. */
|
|
15
|
+
title: ReactNode;
|
|
16
|
+
/** Optional line under the heading. */
|
|
17
|
+
description?: ReactNode;
|
|
18
|
+
/** Optional controls aligned with the heading (e.g. a primary button). */
|
|
19
|
+
actions?: ReactNode;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* The screen's heading (#236): renders the page's one `<h1>` the same way on
|
|
23
|
+
* every screen (PAS-UI-003). ProShell moves focus to it after a client-side
|
|
24
|
+
* navigation, so keyboard and screen-reader users land on the new page.
|
|
25
|
+
*/
|
|
26
|
+
export declare function PageHeader({ title, description, actions }: PageHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
//# sourceMappingURL=page.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../src/page.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAElD;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,CAIvE;AAED,MAAM,WAAW,eAAe;IAC9B,4DAA4D;IAC5D,KAAK,EAAE,SAAS,CAAC;IACjB,uCAAuC;IACvC,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,0EAA0E;IAC1E,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,EAAE,eAAe,2CAY1E"}
|
package/dist/page.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Set the tab title for the current screen (#236, PAS-UI-003). Call it once in
|
|
5
|
+
* each routed screen; the title follows the value while the screen is mounted.
|
|
6
|
+
* Runs after ProShell applies a nav item's `title`, so the screen's own title
|
|
7
|
+
* wins on the same route.
|
|
8
|
+
*
|
|
9
|
+
* ```tsx
|
|
10
|
+
* useDocumentTitle(`${task.title} — Tasks`)
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
export function useDocumentTitle(title) {
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
if (title)
|
|
16
|
+
document.title = title;
|
|
17
|
+
}, [title]);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The screen's heading (#236): renders the page's one `<h1>` the same way on
|
|
21
|
+
* every screen (PAS-UI-003). ProShell moves focus to it after a client-side
|
|
22
|
+
* navigation, so keyboard and screen-reader users land on the new page.
|
|
23
|
+
*/
|
|
24
|
+
export function PageHeader({ title, description, actions }) {
|
|
25
|
+
return (_jsxs("div", { className: "pas-page-header mb-5 flex flex-wrap items-end justify-between gap-3", children: [_jsxs("div", { children: [_jsx("h1", { className: "pas-page-header__title m-0 text-2xl font-bold text-[var(--ink)]", tabIndex: -1, "data-pas-page-heading": "", children: title }), description && _jsx("p", { className: "pas-page-header__description mt-1 text-sm text-[var(--muted)]", children: description })] }), actions && _jsx("div", { className: "flex items-center gap-2", children: actions })] }));
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=page.js.map
|
package/dist/page.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page.js","sourceRoot":"","sources":["../src/page.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAkB,MAAM,OAAO,CAAC;AAElD;;;;;;;;;GASG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAgC;IAC/D,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,KAAK;YAAE,QAAQ,CAAC,KAAK,GAAG,KAAK,CAAC;IACpC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;AACd,CAAC;AAWD;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,OAAO,EAAmB;IACzE,OAAO,CACL,eAAK,SAAS,EAAC,qEAAqE,aAClF,0BACE,aAAI,SAAS,EAAC,iEAAiE,EAAC,QAAQ,EAAE,CAAC,CAAC,2BAAwB,EAAE,YACnH,KAAK,GACH,EACJ,WAAW,IAAI,YAAG,SAAS,EAAC,+DAA+D,YAAE,WAAW,GAAK,IAC1G,EACL,OAAO,IAAI,cAAK,SAAS,EAAC,yBAAyB,YAAE,OAAO,GAAO,IAChE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ProShell's resilience and feedback layer styles (#236): skip link, offline
|
|
3
|
+
* banner, toast region, error and loading fallbacks, PageHeader. Same model as
|
|
4
|
+
* navbar-css.ts: canonical tokens only (PAS-UI-001), injected by ProShell at
|
|
5
|
+
* render so an app needs no configuration, and appended to dist/shell.css.
|
|
6
|
+
*/
|
|
7
|
+
export declare const SHELL_CSS = ".pas-skip-link:not(:focus){position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0}\n.pas-skip-link:focus{position:fixed;top:.5rem;left:.5rem;z-index:1200;padding:.7rem 1rem;border:2px solid var(--accent);border-radius:10px;background:var(--paper);color:var(--ink);font-weight:600;text-decoration:none;outline:2px solid var(--accent);outline-offset:2px}\n.pas-main:focus{outline:none}\n.pas-offline{display:flex;align-items:center;justify-content:space-between;gap:.75rem;padding:.25rem .5rem .25rem 1rem;background:var(--panel);color:var(--ink);border-bottom:1px solid var(--line);border-left:3px solid var(--warning);font-size:.875rem}\n.pas-toast-region{position:fixed;bottom:1.25rem;left:50%;z-index:1100;display:flex;flex-direction:column;align-items:center;gap:.5rem;max-width:calc(100vw - 2rem);transform:translateX(-50%);pointer-events:none}\n.pas-toast{display:flex;align-items:center;gap:.75rem;padding:.25rem .25rem .25rem 1rem;background:var(--ink);color:var(--paper);border-left:3px solid var(--accent);border-radius:var(--radius,.75rem);box-shadow:0 8px 24px rgba(0,0,0,.3);font-size:.875rem;pointer-events:auto}\n.pas-toast[data-variant=\"success\"]{border-left-color:var(--success)}\n.pas-toast[data-variant=\"error\"]{border-left-color:var(--danger)}\n.pas-dismiss{display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;padding:0;border:0;border-radius:10px;background:transparent;color:inherit;font:inherit;font-size:1.1rem;line-height:1;cursor:pointer;opacity:.75}\n.pas-dismiss:hover{opacity:1}\n.pas-shell-loading{display:flex;flex:1;align-items:center;justify-content:center;padding:3rem 1rem}\n.pas-shell-error{display:flex;flex:1;flex-direction:column;align-items:center;justify-content:center;gap:.75rem;padding:3rem 1rem;text-align:center;color:var(--ink)}\n.pas-shell-error h1{margin:0;font-size:1.25rem}\n.pas-shell-error p{margin:0;max-width:32rem;color:var(--muted);font-size:.9rem}\n.pas-shell-error__retry{min-height:44px;padding:0 1.25rem;border:0;border-radius:10px;background:var(--accent);color:var(--paper);font:inherit;font-weight:600;cursor:pointer}\n.pas-page-header{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:.75rem;margin:0 0 1.25rem}\n.pas-page-header__title{margin:0;color:var(--ink);font-size:1.5rem;font-weight:700;line-height:1.2}\n.pas-page-header__title:focus{outline:none}\n.pas-page-header__description{margin:.25rem 0 0;color:var(--muted);font-size:.9rem}\n.pas-dismiss:focus-visible,.pas-shell-error__retry:focus-visible{outline:2px solid var(--accent);outline-offset:2px}\n";
|
|
8
|
+
//# sourceMappingURL=shell-css.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shell-css.d.ts","sourceRoot":"","sources":["../src/shell-css.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,SAAS,2oFAoBrB,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ProShell's resilience and feedback layer styles (#236): skip link, offline
|
|
3
|
+
* banner, toast region, error and loading fallbacks, PageHeader. Same model as
|
|
4
|
+
* navbar-css.ts: canonical tokens only (PAS-UI-001), injected by ProShell at
|
|
5
|
+
* render so an app needs no configuration, and appended to dist/shell.css.
|
|
6
|
+
*/
|
|
7
|
+
export const SHELL_CSS = `.pas-skip-link:not(:focus){position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0}
|
|
8
|
+
.pas-skip-link:focus{position:fixed;top:.5rem;left:.5rem;z-index:1200;padding:.7rem 1rem;border:2px solid var(--accent);border-radius:10px;background:var(--paper);color:var(--ink);font-weight:600;text-decoration:none;outline:2px solid var(--accent);outline-offset:2px}
|
|
9
|
+
.pas-main:focus{outline:none}
|
|
10
|
+
.pas-offline{display:flex;align-items:center;justify-content:space-between;gap:.75rem;padding:.25rem .5rem .25rem 1rem;background:var(--panel);color:var(--ink);border-bottom:1px solid var(--line);border-left:3px solid var(--warning);font-size:.875rem}
|
|
11
|
+
.pas-toast-region{position:fixed;bottom:1.25rem;left:50%;z-index:1100;display:flex;flex-direction:column;align-items:center;gap:.5rem;max-width:calc(100vw - 2rem);transform:translateX(-50%);pointer-events:none}
|
|
12
|
+
.pas-toast{display:flex;align-items:center;gap:.75rem;padding:.25rem .25rem .25rem 1rem;background:var(--ink);color:var(--paper);border-left:3px solid var(--accent);border-radius:var(--radius,.75rem);box-shadow:0 8px 24px rgba(0,0,0,.3);font-size:.875rem;pointer-events:auto}
|
|
13
|
+
.pas-toast[data-variant="success"]{border-left-color:var(--success)}
|
|
14
|
+
.pas-toast[data-variant="error"]{border-left-color:var(--danger)}
|
|
15
|
+
.pas-dismiss{display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;padding:0;border:0;border-radius:10px;background:transparent;color:inherit;font:inherit;font-size:1.1rem;line-height:1;cursor:pointer;opacity:.75}
|
|
16
|
+
.pas-dismiss:hover{opacity:1}
|
|
17
|
+
.pas-shell-loading{display:flex;flex:1;align-items:center;justify-content:center;padding:3rem 1rem}
|
|
18
|
+
.pas-shell-error{display:flex;flex:1;flex-direction:column;align-items:center;justify-content:center;gap:.75rem;padding:3rem 1rem;text-align:center;color:var(--ink)}
|
|
19
|
+
.pas-shell-error h1{margin:0;font-size:1.25rem}
|
|
20
|
+
.pas-shell-error p{margin:0;max-width:32rem;color:var(--muted);font-size:.9rem}
|
|
21
|
+
.pas-shell-error__retry{min-height:44px;padding:0 1.25rem;border:0;border-radius:10px;background:var(--accent);color:var(--paper);font:inherit;font-weight:600;cursor:pointer}
|
|
22
|
+
.pas-page-header{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:.75rem;margin:0 0 1.25rem}
|
|
23
|
+
.pas-page-header__title{margin:0;color:var(--ink);font-size:1.5rem;font-weight:700;line-height:1.2}
|
|
24
|
+
.pas-page-header__title:focus{outline:none}
|
|
25
|
+
.pas-page-header__description{margin:.25rem 0 0;color:var(--muted);font-size:.9rem}
|
|
26
|
+
.pas-dismiss:focus-visible,.pas-shell-error__retry:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
|
|
27
|
+
`;
|
|
28
|
+
//# sourceMappingURL=shell-css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shell-css.js","sourceRoot":"","sources":["../src/shell-css.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG;;;;;;;;;;;;;;;;;;;;CAoBxB,CAAC"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { Component, type ErrorInfo, type ReactNode, type RefObject } from 'react';
|
|
2
|
+
import type { ProAppStore } from './index.js';
|
|
3
|
+
export interface ShellErrorContext {
|
|
4
|
+
error: Error;
|
|
5
|
+
/** Clear the error and render the screen again. */
|
|
6
|
+
reset: () => void;
|
|
7
|
+
}
|
|
8
|
+
interface BoundaryProps {
|
|
9
|
+
app: ProAppStore;
|
|
10
|
+
renderError: ((ctx: ShellErrorContext) => ReactNode) | undefined;
|
|
11
|
+
/** A change (the current route) clears a caught error, so navigating away recovers. */
|
|
12
|
+
resetKey: string;
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
}
|
|
15
|
+
interface BoundaryState {
|
|
16
|
+
error: Error | null;
|
|
17
|
+
resetKey: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Catches a render error in the app's content (#236) so one broken screen
|
|
21
|
+
* shows a fallback instead of a white screen. The error is recorded through
|
|
22
|
+
* `app.logs` — an error React catches never reaches `window.onerror`, so the
|
|
23
|
+
* automatic capture would otherwise miss it.
|
|
24
|
+
*/
|
|
25
|
+
export declare class ShellErrorBoundary extends Component<BoundaryProps, BoundaryState> {
|
|
26
|
+
state: BoundaryState;
|
|
27
|
+
static getDerivedStateFromError(error: unknown): Partial<BoundaryState>;
|
|
28
|
+
static getDerivedStateFromProps(props: BoundaryProps, state: BoundaryState): Partial<BoundaryState> | null;
|
|
29
|
+
componentDidCatch(error: unknown, info: ErrorInfo): void;
|
|
30
|
+
reset: () => void;
|
|
31
|
+
render(): ReactNode;
|
|
32
|
+
}
|
|
33
|
+
export type ShellToastVariant = 'info' | 'success' | 'error';
|
|
34
|
+
export interface ToastOptions {
|
|
35
|
+
variant?: ShellToastVariant;
|
|
36
|
+
/** Milliseconds before it dismisses itself; 0 keeps it until dismissed. Default 4000. */
|
|
37
|
+
duration?: number;
|
|
38
|
+
}
|
|
39
|
+
export interface ToastApi {
|
|
40
|
+
/** Show a message; returns its id. */
|
|
41
|
+
show: (message: string, options?: ToastOptions) => number;
|
|
42
|
+
dismiss: (id: number) => void;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Raise a message from any screen inside ProShell (#236). Messages appear in
|
|
46
|
+
* the shell's single polite live region.
|
|
47
|
+
*
|
|
48
|
+
* ```tsx
|
|
49
|
+
* const toast = useToast()
|
|
50
|
+
* toast.show('Saved', { variant: 'success' })
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
export declare function useToast(): ToastApi;
|
|
54
|
+
/**
|
|
55
|
+
* The shell's toast queue. The region is rendered once and always, so it is
|
|
56
|
+
* already in the accessibility tree when a message arrives — a live region
|
|
57
|
+
* created together with its first message is often not announced. Items carry
|
|
58
|
+
* no live-region role of their own.
|
|
59
|
+
*/
|
|
60
|
+
export declare function ToastProvider({ children }: {
|
|
61
|
+
children: ReactNode;
|
|
62
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
63
|
+
/** `navigator.onLine`, kept current by the browser's online/offline events. */
|
|
64
|
+
export declare function useOnline(): boolean;
|
|
65
|
+
/**
|
|
66
|
+
* A banner under the topbar while the connection is down (#236). Its polite
|
|
67
|
+
* live region is always present, so the change is announced. Dismissible;
|
|
68
|
+
* clears itself on reconnect, and a later drop shows it again.
|
|
69
|
+
*/
|
|
70
|
+
export declare function OfflineBanner(): import("react/jsx-runtime").JSX.Element;
|
|
71
|
+
/** The first focusable element: hidden until focused, moves focus to the shell's `<main id="main">`. */
|
|
72
|
+
export declare function SkipLink({ mainRef }: {
|
|
73
|
+
mainRef: RefObject<HTMLElement | null>;
|
|
74
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
75
|
+
/**
|
|
76
|
+
* Scroll and focus on client-side route changes (#236). Forward navigation
|
|
77
|
+
* lands at the top; back/forward returns to where that route was left. After
|
|
78
|
+
* either, focus moves to the new screen's PageHeader `<h1>`, else to `<main>`.
|
|
79
|
+
*
|
|
80
|
+
* Only for client-side navigation (`enabled` = the app passed `onNavigate`):
|
|
81
|
+
* with ordinary links every navigation is a page load, and the browser already
|
|
82
|
+
* restores scroll and resets focus — taking scroll restoration over there would
|
|
83
|
+
* break it on the way back.
|
|
84
|
+
*
|
|
85
|
+
* Returns the function to call just before a forward navigation.
|
|
86
|
+
*/
|
|
87
|
+
export declare function useRouteChangeEffects(path: string, mainRef: RefObject<HTMLElement | null>, enabled: boolean): () => void;
|
|
88
|
+
export {};
|
|
89
|
+
//# sourceMappingURL=shell-resilience.d.ts.map
|
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,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B,yFAAyF;IACzF,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,QAAQ;IACvB,sCAAsC;IACtC,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,KAAK,MAAM,CAAC;IAC1D,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CAC/B;AAcD;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,IAAI,QAAQ,CAInC;AAkBD;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,2CAqBlE;AAID,+EAA+E;AAC/E,wBAAgB,SAAS,IAAI,OAAO,CAcnC;AAED;;;;GAIG;AACH,wBAAgB,aAAa,4CAkB5B;AAID,wGAAwG;AACxG,wBAAgB,QAAQ,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAA;CAAE,2CAe/E;AAID;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,EAAE,OAAO,EAAE,OAAO,GAAG,MAAM,IAAI,CA0CxH"}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Component, createContext, useCallback, useContext, useEffect, useMemo, useRef, useState, } from 'react';
|
|
3
|
+
import { describeError } from './logs.js';
|
|
4
|
+
/**
|
|
5
|
+
* Catches a render error in the app's content (#236) so one broken screen
|
|
6
|
+
* shows a fallback instead of a white screen. The error is recorded through
|
|
7
|
+
* `app.logs` — an error React catches never reaches `window.onerror`, so the
|
|
8
|
+
* automatic capture would otherwise miss it.
|
|
9
|
+
*/
|
|
10
|
+
export class ShellErrorBoundary extends Component {
|
|
11
|
+
state = { error: null, resetKey: this.props.resetKey };
|
|
12
|
+
static getDerivedStateFromError(error) {
|
|
13
|
+
return { error: error instanceof Error ? error : new Error(String(error)) };
|
|
14
|
+
}
|
|
15
|
+
static getDerivedStateFromProps(props, state) {
|
|
16
|
+
return props.resetKey !== state.resetKey ? { error: null, resetKey: props.resetKey } : null;
|
|
17
|
+
}
|
|
18
|
+
componentDidCatch(error, info) {
|
|
19
|
+
const described = describeError(error);
|
|
20
|
+
this.props.app.logs.capture('error', 'react.error-boundary', described.message, {
|
|
21
|
+
stack: described.stack,
|
|
22
|
+
componentStack: info.componentStack ?? undefined,
|
|
23
|
+
path: typeof window === 'undefined' ? undefined : window.location.pathname,
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
reset = () => this.setState({ error: null });
|
|
27
|
+
render() {
|
|
28
|
+
const { error } = this.state;
|
|
29
|
+
if (!error)
|
|
30
|
+
return this.props.children;
|
|
31
|
+
if (this.props.renderError)
|
|
32
|
+
return this.props.renderError({ error, reset: this.reset });
|
|
33
|
+
return (_jsxs("div", { role: "alert", className: "pas-shell-error flex flex-1 flex-col items-center justify-center gap-3 px-4 py-12 text-center", children: [_jsx("h1", { children: "Something went wrong" }), _jsx("p", { children: "This screen hit an error and could not be shown. It has been reported. Try again, or use the navigation to go elsewhere." }), _jsx("button", { type: "button", className: "pas-shell-error__retry min-h-11 rounded-[10px] px-5 font-semibold", onClick: this.reset, children: "Try again" })] }));
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
/** At most this many messages at once; the oldest goes first. */
|
|
37
|
+
const MAX_TOASTS = 4;
|
|
38
|
+
const ToastContext = createContext(null);
|
|
39
|
+
/**
|
|
40
|
+
* Raise a message from any screen inside ProShell (#236). Messages appear in
|
|
41
|
+
* the shell's single polite live region.
|
|
42
|
+
*
|
|
43
|
+
* ```tsx
|
|
44
|
+
* const toast = useToast()
|
|
45
|
+
* toast.show('Saved', { variant: 'success' })
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
export function useToast() {
|
|
49
|
+
const api = useContext(ToastContext);
|
|
50
|
+
if (!api)
|
|
51
|
+
throw new Error('useToast must be used inside <ProShell>');
|
|
52
|
+
return api;
|
|
53
|
+
}
|
|
54
|
+
function ToastItem({ toast, onDismiss }) {
|
|
55
|
+
useEffect(() => {
|
|
56
|
+
if (toast.duration <= 0)
|
|
57
|
+
return;
|
|
58
|
+
const timer = setTimeout(() => onDismiss(toast.id), toast.duration);
|
|
59
|
+
return () => clearTimeout(timer);
|
|
60
|
+
}, [toast.id, toast.duration, onDismiss]);
|
|
61
|
+
return (_jsxs("div", { className: "pas-toast flex items-center gap-3 rounded-xl text-sm", "data-variant": toast.variant, children: [_jsx("span", { children: toast.message }), _jsx("button", { type: "button", className: "pas-dismiss min-h-11 min-w-11", "aria-label": "Dismiss", onClick: () => onDismiss(toast.id), children: "\u00D7" })] }));
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* The shell's toast queue. The region is rendered once and always, so it is
|
|
65
|
+
* already in the accessibility tree when a message arrives — a live region
|
|
66
|
+
* created together with its first message is often not announced. Items carry
|
|
67
|
+
* no live-region role of their own.
|
|
68
|
+
*/
|
|
69
|
+
export function ToastProvider({ children }) {
|
|
70
|
+
const [toasts, setToasts] = useState([]);
|
|
71
|
+
const nextId = useRef(1);
|
|
72
|
+
const dismiss = useCallback((id) => setToasts((all) => all.filter((t) => t.id !== id)), []);
|
|
73
|
+
const show = useCallback((message, options = {}) => {
|
|
74
|
+
const id = nextId.current++;
|
|
75
|
+
const toast = { id, message, variant: options.variant ?? 'info', duration: options.duration ?? 4000 };
|
|
76
|
+
setToasts((all) => [...all, toast].slice(-MAX_TOASTS));
|
|
77
|
+
return id;
|
|
78
|
+
}, []);
|
|
79
|
+
const api = useMemo(() => ({ show, dismiss }), [show, dismiss]);
|
|
80
|
+
return (_jsxs(ToastContext.Provider, { value: api, children: [children, _jsx("div", { role: "status", "aria-live": "polite", className: "pas-toast-region fixed bottom-5 left-1/2 flex -translate-x-1/2 flex-col items-center gap-2", children: toasts.map((toast) => _jsx(ToastItem, { toast: toast, onDismiss: dismiss }, toast.id)) })] }));
|
|
81
|
+
}
|
|
82
|
+
// ── Offline ─────────────────────────────────────────────────────
|
|
83
|
+
/** `navigator.onLine`, kept current by the browser's online/offline events. */
|
|
84
|
+
export function useOnline() {
|
|
85
|
+
const [online, setOnline] = useState(() => (typeof navigator === 'undefined' ? true : navigator.onLine));
|
|
86
|
+
useEffect(() => {
|
|
87
|
+
const up = () => setOnline(true);
|
|
88
|
+
const down = () => setOnline(false);
|
|
89
|
+
window.addEventListener('online', up);
|
|
90
|
+
window.addEventListener('offline', down);
|
|
91
|
+
setOnline(navigator.onLine);
|
|
92
|
+
return () => {
|
|
93
|
+
window.removeEventListener('online', up);
|
|
94
|
+
window.removeEventListener('offline', down);
|
|
95
|
+
};
|
|
96
|
+
}, []);
|
|
97
|
+
return online;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* A banner under the topbar while the connection is down (#236). Its polite
|
|
101
|
+
* live region is always present, so the change is announced. Dismissible;
|
|
102
|
+
* clears itself on reconnect, and a later drop shows it again.
|
|
103
|
+
*/
|
|
104
|
+
export function OfflineBanner() {
|
|
105
|
+
const online = useOnline();
|
|
106
|
+
const [dismissed, setDismissed] = useState(false);
|
|
107
|
+
useEffect(() => {
|
|
108
|
+
if (online)
|
|
109
|
+
setDismissed(false);
|
|
110
|
+
}, [online]);
|
|
111
|
+
return (_jsx("div", { role: "status", "aria-live": "polite", children: !online && !dismissed && (_jsxs("div", { className: "pas-offline flex items-center justify-between gap-3 text-sm", children: [_jsx("span", { children: "You're offline. Changes can't be saved until the connection is back." }), _jsx("button", { type: "button", className: "pas-dismiss min-h-11 min-w-11", "aria-label": "Dismiss offline notice", onClick: () => setDismissed(true), children: "\u00D7" })] })) }));
|
|
112
|
+
}
|
|
113
|
+
// ── Skip link ───────────────────────────────────────────────────
|
|
114
|
+
/** The first focusable element: hidden until focused, moves focus to the shell's `<main id="main">`. */
|
|
115
|
+
export function SkipLink({ mainRef }) {
|
|
116
|
+
return (_jsx("a", { href: "#main", className: "pas-skip-link", onClick: (e) => {
|
|
117
|
+
// Focus directly rather than following the fragment: a hash change is a
|
|
118
|
+
// history navigation, which a router would see as a route change.
|
|
119
|
+
e.preventDefault();
|
|
120
|
+
mainRef.current?.focus();
|
|
121
|
+
}, children: "Skip to content" }));
|
|
122
|
+
}
|
|
123
|
+
// ── Route changes: scroll and focus ─────────────────────────────
|
|
124
|
+
/**
|
|
125
|
+
* Scroll and focus on client-side route changes (#236). Forward navigation
|
|
126
|
+
* lands at the top; back/forward returns to where that route was left. After
|
|
127
|
+
* either, focus moves to the new screen's PageHeader `<h1>`, else to `<main>`.
|
|
128
|
+
*
|
|
129
|
+
* Only for client-side navigation (`enabled` = the app passed `onNavigate`):
|
|
130
|
+
* with ordinary links every navigation is a page load, and the browser already
|
|
131
|
+
* restores scroll and resets focus — taking scroll restoration over there would
|
|
132
|
+
* break it on the way back.
|
|
133
|
+
*
|
|
134
|
+
* Returns the function to call just before a forward navigation.
|
|
135
|
+
*/
|
|
136
|
+
export function useRouteChangeEffects(path, mainRef, enabled) {
|
|
137
|
+
const positions = useRef(new Map());
|
|
138
|
+
const lastPath = useRef(path);
|
|
139
|
+
const kind = useRef('push');
|
|
140
|
+
useEffect(() => {
|
|
141
|
+
if (!enabled)
|
|
142
|
+
return;
|
|
143
|
+
const previous = window.history.scrollRestoration;
|
|
144
|
+
window.history.scrollRestoration = 'manual';
|
|
145
|
+
// Runs before the re-render the same popstate causes, while the page still
|
|
146
|
+
// shows the route being left.
|
|
147
|
+
const onPop = () => {
|
|
148
|
+
positions.current.set(lastPath.current, window.scrollY);
|
|
149
|
+
kind.current = 'pop';
|
|
150
|
+
};
|
|
151
|
+
window.addEventListener('popstate', onPop);
|
|
152
|
+
return () => {
|
|
153
|
+
window.removeEventListener('popstate', onPop);
|
|
154
|
+
window.history.scrollRestoration = previous;
|
|
155
|
+
};
|
|
156
|
+
}, [enabled]);
|
|
157
|
+
useEffect(() => {
|
|
158
|
+
if (!enabled || path === lastPath.current)
|
|
159
|
+
return;
|
|
160
|
+
lastPath.current = path;
|
|
161
|
+
const back = kind.current === 'pop';
|
|
162
|
+
kind.current = 'push';
|
|
163
|
+
// A frame later, so a router that renders the new screen in its own update
|
|
164
|
+
// has committed it before we scroll to it and look for its heading.
|
|
165
|
+
const frame = requestAnimationFrame(() => {
|
|
166
|
+
window.scrollTo(0, back ? positions.current.get(path) ?? 0 : 0);
|
|
167
|
+
const main = mainRef.current;
|
|
168
|
+
const target = main?.querySelector('[data-pas-page-heading]') ?? main;
|
|
169
|
+
target?.focus({ preventScroll: true });
|
|
170
|
+
});
|
|
171
|
+
return () => cancelAnimationFrame(frame);
|
|
172
|
+
}, [path, enabled, mainRef]);
|
|
173
|
+
return useCallback(() => {
|
|
174
|
+
positions.current.set(lastPath.current, window.scrollY);
|
|
175
|
+
kind.current = 'push';
|
|
176
|
+
}, []);
|
|
177
|
+
}
|
|
178
|
+
//# sourceMappingURL=shell-resilience.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shell-resilience.js","sourceRoot":"","sources":["../src/shell-resilience.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,SAAS,EACT,aAAa,EACb,WAAW,EACX,UAAU,EACV,SAAS,EACT,OAAO,EACP,MAAM,EACN,QAAQ,GAIT,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAuB1C;;;;;GAKG;AACH,MAAM,OAAO,kBAAmB,SAAQ,SAAuC;IACpE,KAAK,GAAkB,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;IAE/E,MAAM,CAAC,wBAAwB,CAAC,KAAc;QAC5C,OAAO,EAAE,K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OAAO,GAAG,EAAE,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC;IAC3C,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;IAE7B,OAAO,WAAW,CAAC,GAAG,EAAE;QACtB,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;QACxD,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC"}
|
package/dist/shell.css
CHANGED
|
@@ -6,3 +6,23 @@
|
|
|
6
6
|
.pas-nav__link[aria-current="page"]{color:var(--accent);background:var(--line)}
|
|
7
7
|
.pas-nav__toggle:focus-visible,.pas-nav__link:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
|
|
8
8
|
@media (max-width:639px){.pas-nav{flex:0 0 auto;margin:0}.pas-nav__toggle{display:inline-flex}.pas-nav__list{display:none;position:absolute;top:calc(100% + .5rem);left:0;z-index:60;flex-direction:column;align-items:stretch;min-width:12rem;padding:.5rem;overflow:visible;background:var(--paper);border:1px solid var(--line);border-radius:12px;box-shadow:0 8px 24px rgba(0,0,0,.12)}.pas-nav[data-open="true"] .pas-nav__list{display:flex}}
|
|
9
|
+
.pas-skip-link:not(:focus){position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0}
|
|
10
|
+
.pas-skip-link:focus{position:fixed;top:.5rem;left:.5rem;z-index:1200;padding:.7rem 1rem;border:2px solid var(--accent);border-radius:10px;background:var(--paper);color:var(--ink);font-weight:600;text-decoration:none;outline:2px solid var(--accent);outline-offset:2px}
|
|
11
|
+
.pas-main:focus{outline:none}
|
|
12
|
+
.pas-offline{display:flex;align-items:center;justify-content:space-between;gap:.75rem;padding:.25rem .5rem .25rem 1rem;background:var(--panel);color:var(--ink);border-bottom:1px solid var(--line);border-left:3px solid var(--warning);font-size:.875rem}
|
|
13
|
+
.pas-toast-region{position:fixed;bottom:1.25rem;left:50%;z-index:1100;display:flex;flex-direction:column;align-items:center;gap:.5rem;max-width:calc(100vw - 2rem);transform:translateX(-50%);pointer-events:none}
|
|
14
|
+
.pas-toast{display:flex;align-items:center;gap:.75rem;padding:.25rem .25rem .25rem 1rem;background:var(--ink);color:var(--paper);border-left:3px solid var(--accent);border-radius:var(--radius,.75rem);box-shadow:0 8px 24px rgba(0,0,0,.3);font-size:.875rem;pointer-events:auto}
|
|
15
|
+
.pas-toast[data-variant="success"]{border-left-color:var(--success)}
|
|
16
|
+
.pas-toast[data-variant="error"]{border-left-color:var(--danger)}
|
|
17
|
+
.pas-dismiss{display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;padding:0;border:0;border-radius:10px;background:transparent;color:inherit;font:inherit;font-size:1.1rem;line-height:1;cursor:pointer;opacity:.75}
|
|
18
|
+
.pas-dismiss:hover{opacity:1}
|
|
19
|
+
.pas-shell-loading{display:flex;flex:1;align-items:center;justify-content:center;padding:3rem 1rem}
|
|
20
|
+
.pas-shell-error{display:flex;flex:1;flex-direction:column;align-items:center;justify-content:center;gap:.75rem;padding:3rem 1rem;text-align:center;color:var(--ink)}
|
|
21
|
+
.pas-shell-error h1{margin:0;font-size:1.25rem}
|
|
22
|
+
.pas-shell-error p{margin:0;max-width:32rem;color:var(--muted);font-size:.9rem}
|
|
23
|
+
.pas-shell-error__retry{min-height:44px;padding:0 1.25rem;border:0;border-radius:10px;background:var(--accent);color:var(--paper);font:inherit;font-weight:600;cursor:pointer}
|
|
24
|
+
.pas-page-header{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:.75rem;margin:0 0 1.25rem}
|
|
25
|
+
.pas-page-header__title{margin:0;color:var(--ink);font-size:1.5rem;font-weight:700;line-height:1.2}
|
|
26
|
+
.pas-page-header__title:focus{outline:none}
|
|
27
|
+
.pas-page-header__description{margin:.25rem 0 0;color:var(--muted);font-size:.9rem}
|
|
28
|
+
.pas-dismiss:focus-visible,.pas-shell-error__retry:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
|
package/dist/shell.d.ts
CHANGED
|
@@ -3,7 +3,9 @@ import type { ProAppStore } from './index.js';
|
|
|
3
3
|
import type { User } from './base-types.js';
|
|
4
4
|
import type { Subscription } from './types.js';
|
|
5
5
|
import { type NavItem } from './navbar.js';
|
|
6
|
+
import { type ShellErrorContext } from './shell-resilience.js';
|
|
6
7
|
export type { NavItem } from './navbar.js';
|
|
8
|
+
export type { ShellErrorContext } from './shell-resilience.js';
|
|
7
9
|
export interface MenuItem {
|
|
8
10
|
label: string;
|
|
9
11
|
onClick: () => void;
|
|
@@ -82,6 +84,13 @@ export interface ProShellProps {
|
|
|
82
84
|
renderTopbar?: (ctx: ProShellRenderContext) => ReactNode;
|
|
83
85
|
/** Replace the default footer. Return null to omit it. */
|
|
84
86
|
renderFooter?: (ctx: ProShellRenderContext) => ReactNode;
|
|
87
|
+
/**
|
|
88
|
+
* Replace the fallback shown when a screen throws while rendering (#236).
|
|
89
|
+
* The error is already recorded via `app.logs`; call `reset` to retry.
|
|
90
|
+
*/
|
|
91
|
+
renderError?: (ctx: ShellErrorContext) => ReactNode;
|
|
92
|
+
/** Replace the spinner shown while a lazy-loaded screen loads (#236). */
|
|
93
|
+
renderLoading?: () => ReactNode;
|
|
85
94
|
}
|
|
86
95
|
/**
|
|
87
96
|
* ProShell — platform-level Shell for all ProAppStore apps.
|
|
@@ -91,6 +100,9 @@ export interface ProShellProps {
|
|
|
91
100
|
* - Subscription check + upgrade wall (unless allowFree=true)
|
|
92
101
|
* - Topbar with avatar, app name, menu (sign out, delete account, manage billing)
|
|
93
102
|
* - Main navigation from the `nav` prop (<nav aria-label="Main">, current route, mobile menu)
|
|
103
|
+
* - Resilience and feedback (#236): error boundary + Suspense around the content,
|
|
104
|
+
* `useToast` region, offline banner, skip link, nav-item titles, and scroll +
|
|
105
|
+
* focus handling on client-side route changes
|
|
94
106
|
* - Theme support via CSS custom properties
|
|
95
107
|
* - Only renders children when all gates pass
|
|
96
108
|
*
|
|
@@ -110,5 +122,5 @@ export interface ProShellProps {
|
|
|
110
122
|
* }
|
|
111
123
|
* ```
|
|
112
124
|
*/
|
|
113
|
-
export declare function ProShell({ app, children, appName, nav, renderNav, onNavigate, allowFree, showThemeToggle, menuItems, hideTopbar, hideFooter, renderTopbar, renderFooter, }: ProShellProps): import("react/jsx-runtime").JSX.Element;
|
|
125
|
+
export declare function ProShell({ app, children, appName, nav, renderNav, onNavigate, allowFree, showThemeToggle, menuItems, hideTopbar, hideFooter, renderTopbar, renderFooter, renderError, renderLoading, }: ProShellProps): import("react/jsx-runtime").JSX.Element;
|
|
114
126
|
//# sourceMappingURL=shell.d.ts.map
|
package/dist/shell.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shell.d.ts","sourceRoot":"","sources":["../src/shell.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"shell.d.ts","sourceRoot":"","sources":["../src/shell.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA8E,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACnH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAG/C,OAAO,EAAsC,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC;AAE/E,OAAO,EAML,KAAK,iBAAiB,EACvB,MAAM,uBAAuB,CAAC;AAE/B,YAAY,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,YAAY,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CA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wC;IACxC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,qBAAqB,KAAK,SAAS,CAAC;IACzD,0DAA0D;IAC1D,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,qBAAqB,KAAK,SAAS,CAAC;IACzD;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,iBAAiB,KAAK,SAAS,CAAC;IACpD,yEAAyE;IACzE,aAAa,CAAC,EAAE,MAAM,SAAS,CAAC;CACjC;AAID;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,QAAQ,CAAC,EACvB,GAAG,EACH,QAAQ,EACR,OAAO,EACP,GAAG,EACH,SAAS,EACT,UAAU,EACV,SAAgB,EAChB,eAAsB,EACtB,SAAS,EACT,UAAkB,EAClB,UAAkB,EAClB,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,aAAa,GACd,EAAE,aAAa,2CAkJf"}
|
package/dist/shell.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { ProfileMenu, ProBadge, GateScreen, TextSizeToggle } from './ui.js';
|
|
2
|
+
import { Suspense, useEffect, useInsertionEffect, useLayoutEffect, useRef, useState } from 'react';
|
|
3
|
+
import { ProfileMenu, ProBadge, GateScreen, TextSizeToggle, Spinner } from './ui.js';
|
|
4
4
|
import { ProProvider } from './provider.js';
|
|
5
|
-
import { NavBar, useCurrentPath } from './navbar.js';
|
|
5
|
+
import { activeHref, NavBar, useCurrentPath } from './navbar.js';
|
|
6
|
+
import { SHELL_CSS } from './shell-css.js';
|
|
7
|
+
import { OfflineBanner, ShellErrorBoundary, SkipLink, ToastProvider, useRouteChangeEffects, } from './shell-resilience.js';
|
|
6
8
|
/**
|
|
7
9
|
* ProShell — platform-level Shell for all ProAppStore apps.
|
|
8
10
|
*
|
|
@@ -11,6 +13,9 @@ import { NavBar, useCurrentPath } from './navbar.js';
|
|
|
11
13
|
* - Subscription check + upgrade wall (unless allowFree=true)
|
|
12
14
|
* - Topbar with avatar, app name, menu (sign out, delete account, manage billing)
|
|
13
15
|
* - Main navigation from the `nav` prop (<nav aria-label="Main">, current route, mobile menu)
|
|
16
|
+
* - Resilience and feedback (#236): error boundary + Suspense around the content,
|
|
17
|
+
* `useToast` region, offline banner, skip link, nav-item titles, and scroll +
|
|
18
|
+
* focus handling on client-side route changes
|
|
14
19
|
* - Theme support via CSS custom properties
|
|
15
20
|
* - Only renders children when all gates pass
|
|
16
21
|
*
|
|
@@ -30,11 +35,30 @@ import { NavBar, useCurrentPath } from './navbar.js';
|
|
|
30
35
|
* }
|
|
31
36
|
* ```
|
|
32
37
|
*/
|
|
33
|
-
export function ProShell({ app, children, appName, nav, renderNav, onNavigate, allowFree = true, showThemeToggle = true, menuItems, hideTopbar = false, hideFooter = false, renderTopbar, renderFooter, }) {
|
|
38
|
+
export function ProShell({ app, children, appName, nav, renderNav, onNavigate, allowFree = true, showThemeToggle = true, menuItems, hideTopbar = false, hideFooter = false, renderTopbar, renderFooter, renderError, renderLoading, }) {
|
|
34
39
|
const [user, setUser] = useState(app.auth.user);
|
|
35
40
|
const [subscription, setSubscription] = useState(null);
|
|
36
41
|
const [gate, setGate] = useState('loading');
|
|
37
42
|
const [currentPath, setCurrentPath] = useCurrentPath();
|
|
43
|
+
const mainRef = useRef(null);
|
|
44
|
+
const beforeNavigate = useRouteChangeEffects(currentPath, mainRef, onNavigate !== undefined);
|
|
45
|
+
useInsertionEffect(() => {
|
|
46
|
+
if (document.getElementById('pas-shell-css'))
|
|
47
|
+
return;
|
|
48
|
+
const style = document.createElement('style');
|
|
49
|
+
style.id = 'pas-shell-css';
|
|
50
|
+
style.textContent = SHELL_CSS;
|
|
51
|
+
document.head.appendChild(style);
|
|
52
|
+
}, []);
|
|
53
|
+
// A nav item's `title` becomes the tab title on its route. A layout effect runs
|
|
54
|
+
// before every passive effect, so a screen's own useDocumentTitle still wins.
|
|
55
|
+
const navItems = nav ?? [];
|
|
56
|
+
const activeItem = navItems.find((item) => item.href === activeHref(navItems, currentPath));
|
|
57
|
+
const navTitle = activeItem?.title;
|
|
58
|
+
useLayoutEffect(() => {
|
|
59
|
+
if (navTitle)
|
|
60
|
+
document.title = navTitle;
|
|
61
|
+
}, [navTitle, currentPath]);
|
|
38
62
|
useEffect(() => {
|
|
39
63
|
app.auth.init();
|
|
40
64
|
return app.auth.onChange((u) => {
|
|
@@ -68,21 +92,24 @@ export function ProShell({ app, children, appName, nav, renderNav, onNavigate, a
|
|
|
68
92
|
return _jsx(GateScreen, { gate: "signed-out", app: app, appName: appName });
|
|
69
93
|
}
|
|
70
94
|
const profileMenu = (_jsx(ProfileMenu, { app: app, showThemeToggle: showThemeToggle, children: menuItems?.map((item, i) => (_jsx("button", { onClick: item.onClick, style: menuItemStyle, children: item.label }, i))) }));
|
|
71
|
-
|
|
95
|
+
// Client-side navigation goes through the shell, so it knows the route changed
|
|
96
|
+
// (scroll, focus, titles). Without onNavigate, items are plain links.
|
|
97
|
+
const navigate = onNavigate
|
|
98
|
+
? (href) => {
|
|
99
|
+
beforeNavigate();
|
|
100
|
+
onNavigate(href);
|
|
101
|
+
setCurrentPath(href);
|
|
102
|
+
}
|
|
103
|
+
: undefined;
|
|
72
104
|
const navNode = navItems.length === 0 ? null : renderNav
|
|
73
105
|
? renderNav({
|
|
74
106
|
items: navItems,
|
|
75
107
|
currentPath,
|
|
76
|
-
onNavigate: (href) =>
|
|
77
|
-
if (!onNavigate) {
|
|
78
|
-
window.location.assign(href);
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
onNavigate(href);
|
|
82
|
-
setCurrentPath(href);
|
|
83
|
-
},
|
|
108
|
+
onNavigate: navigate ?? ((href) => window.location.assign(href)),
|
|
84
109
|
})
|
|
85
|
-
:
|
|
110
|
+
: navigate
|
|
111
|
+
? _jsx(NavBar, { items: navItems, currentPath: currentPath, onNavigate: navigate })
|
|
112
|
+
: _jsx(NavBar, { items: navItems });
|
|
86
113
|
const shellContext = {
|
|
87
114
|
app,
|
|
88
115
|
appName,
|
|
@@ -95,8 +122,9 @@ export function ProShell({ app, children, appName, nav, renderNav, onNavigate, a
|
|
|
95
122
|
};
|
|
96
123
|
const topbar = renderTopbar ? renderTopbar(shellContext) : hideTopbar ? null : (_jsxs("header", { style: styles.topbar, children: [_jsxs("div", { style: styles.topbarLeft, children: [_jsx("a", { href: "https://proappstore.online", style: styles.logoLink, children: "Pro" }), appName && _jsx("span", { style: styles.appName, children: appName }), shellContext.proBadge] }), shellContext.nav, _jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: '0.5rem' }, children: [shellContext.textSizeToggle, shellContext.profileMenu] })] }));
|
|
97
124
|
const footer = renderFooter ? renderFooter(shellContext) : hideFooter ? null : (_jsxs("footer", { style: styles.footer, children: ["Part of", ' ', _jsx("a", { href: "https://proappstore.online", style: { color: 'var(--accent)', fontWeight: 600, textDecoration: 'none' }, children: "ProAppStore" })] }));
|
|
125
|
+
const loading = renderLoading ? renderLoading() : (_jsx("div", { className: "pas-shell-loading flex flex-1 items-center justify-center px-4 py-12", children: _jsx(Spinner, { size: 28 }) }));
|
|
98
126
|
// --- Ready: render app with topbar ---
|
|
99
|
-
return (_jsx(ProProvider, { app: app, children: _jsxs("div", { style: styles.shell, children: [topbar, _jsx("main", { style: styles.main, children: children }), footer] }) }));
|
|
127
|
+
return (_jsx(ProProvider, { app: app, children: _jsx(ToastProvider, { children: _jsxs("div", { style: styles.shell, children: [_jsx(SkipLink, { mainRef: mainRef }), topbar, _jsx(OfflineBanner, {}), _jsx("main", { id: "main", ref: mainRef, tabIndex: -1, className: "pas-main", style: styles.main, children: _jsx(ShellErrorBoundary, { app: app, renderError: renderError, resetKey: currentPath, children: _jsx(Suspense, { fallback: loading, children: children }) }) }), footer] }) }) }));
|
|
100
128
|
}
|
|
101
129
|
const menuItemStyle = {
|
|
102
130
|
display: 'block', width: '100%', padding: '0.5rem 1rem',
|
package/dist/shell.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shell.js","sourceRoot":"","sources":["../src/shell.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAkB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"shell.js","sourceRoot":"","sources":["../src/shell.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AAInH,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AACrF,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,cAAc,EAAgB,MAAM,aAAa,CAAC;AAC/E,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,QAAQ,EACR,aAAa,EACb,qBAAqB,GAEtB,MAAM,uBAAuB,CAAC;AAiG/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,UAAU,QAAQ,CAAC,EACvB,GAAG,EACH,QAAQ,EACR,OAAO,EACP,GAAG,EACH,SAAS,EACT,UAAU,EACV,SAAS,GAAG,IAAI,EAChB,eAAe,GAAG,IAAI,EACtB,SAAS,EACT,UAAU,GAAG,KAAK,EAClB,UAAU,GAAG,KAAK,EAClB,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,aAAa,GACC;IACd,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAChD,MAAM,CAAC,YAAY,EAAE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U,EAAE,QAAQ,EAAE,GAAG,EAAE,SAAS,EAAE;IACrE,QAAQ,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,EAAE;IAC/F,OAAO,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,EAAE,KAAK,EAAE,cAAc,EAAE;IACxE,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE;IAC3D,MAAM,EAAE;QACN,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS;QACzD,KAAK,EAAE,cAAc;QACrB,SAAS,EAAE,uBAAuB;KACnC;CACF,CAAC"}
|
package/dist/ui.d.ts
CHANGED
|
@@ -19,4 +19,8 @@ export { Button, Card, Input, Spinner, Modal, EmptyState, Tabs, Toast } from './
|
|
|
19
19
|
export type { ButtonProps, ButtonVariant, CardProps, InputProps, SpinnerProps, ModalProps, EmptyStateProps, TabItem, TabsProps, ToastProps, ToastVariant, } from './ui-base.js';
|
|
20
20
|
export { NavBar } from './navbar.js';
|
|
21
21
|
export type { NavBarProps, NavItem } from './navbar.js';
|
|
22
|
+
export { useToast, useOnline } from './shell-resilience.js';
|
|
23
|
+
export type { ToastApi, ToastOptions, ShellToastVariant } from './shell-resilience.js';
|
|
24
|
+
export { PageHeader, useDocumentTitle } from './page.js';
|
|
25
|
+
export type { PageHeaderProps } from './page.js';
|
|
22
26
|
//# sourceMappingURL=ui.d.ts.map
|
package/dist/ui.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../src/ui.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAA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
|
19
19
|
export { Button, Card, Input, Spinner, Modal, EmptyState, Tabs, Toast } from './ui-base.js';
|
|
20
20
|
// NavBar (#235) — the app's main navigation; ProShell renders it from its `nav` prop
|
|
21
21
|
export { NavBar } from './navbar.js';
|
|
22
|
+
// Shell feedback + page helpers (#236) — useToast needs <ProShell>; the rest work anywhere
|
|
23
|
+
export { useToast, useOnline } from './shell-resilience.js';
|
|
24
|
+
export { PageHeader, useDocumentTitle } from './page.js';
|
|
22
25
|
//# sourceMappingURL=ui.js.map
|
package/dist/ui.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui.js","sourceRoot":"","sources":["../src/ui.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,4BAA4B;AAC5B,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGzE,mDAAmD;AACnD,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,kBAAkB,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAShH,6BAA6B;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGnD,iBAAiB;AACjB,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAGtD,aAAa;AACb,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,4FAA4F;AAC5F,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAM5F,qFAAqF;AACrF,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"ui.js","sourceRoot":"","sources":["../src/ui.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,4BAA4B;AAC5B,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,M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