@owlmeans/web-panel 0.1.18-rc.6 → 0.1.18-rc.60
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 +450 -84
- package/agent-meta/manifest.json +2 -2
- package/agent-meta/skills/web-panel/SKILL.md +515 -8
- package/build/@/components/ui/alert-dialog.d.ts +15 -0
- package/build/@/components/ui/alert-dialog.d.ts.map +1 -0
- package/build/@/components/ui/alert-dialog.js +39 -0
- package/build/@/components/ui/alert-dialog.js.map +1 -0
- package/build/@/components/ui/alert.js +1 -1
- package/build/@/components/ui/alert.js.map +1 -1
- package/build/@/components/ui/button.js +1 -1
- package/build/@/components/ui/button.js.map +1 -1
- package/build/@/components/ui/card.js +1 -1
- package/build/@/components/ui/card.js.map +1 -1
- package/build/@/components/ui/input.js +1 -1
- package/build/@/components/ui/input.js.map +1 -1
- package/build/@/components/ui/label.js +1 -1
- package/build/@/components/ui/label.js.map +1 -1
- package/build/@/components/ui/navigation-menu.d.ts +15 -0
- package/build/@/components/ui/navigation-menu.d.ts.map +1 -0
- package/build/@/components/ui/navigation-menu.js +32 -0
- package/build/@/components/ui/navigation-menu.js.map +1 -0
- package/build/@/components/ui/progress.js +1 -1
- package/build/@/components/ui/progress.js.map +1 -1
- package/build/@/components/ui/separator.js +1 -1
- package/build/@/components/ui/separator.js.map +1 -1
- package/build/@/components/ui/sheet.d.ts +15 -0
- package/build/@/components/ui/sheet.d.ts.map +1 -0
- package/build/@/components/ui/sheet.js +40 -0
- package/build/@/components/ui/sheet.js.map +1 -0
- package/build/auth/context.d.ts.map +1 -1
- package/build/auth/context.js +0 -1
- package/build/auth/context.js.map +1 -1
- package/build/auth/entrypoints.d.ts +10 -0
- package/build/auth/entrypoints.d.ts.map +1 -0
- package/build/auth/entrypoints.js +4 -0
- package/build/auth/entrypoints.js.map +1 -0
- package/build/auth/exports.d.ts +3 -3
- package/build/auth/exports.d.ts.map +1 -1
- package/build/auth/exports.js +3 -3
- package/build/auth/exports.js.map +1 -1
- package/build/auth/plugins/basic-ed25519.js +4 -4
- package/build/auth/plugins/basic-ed25519.js.map +1 -1
- package/build/auth/plugins/re-captcha.js +3 -3
- package/build/auth/plugins/re-captcha.js.map +1 -1
- package/build/auth/plugins/tunnel-consumer.js +1 -1
- package/build/auth/plugins/tunnel-consumer.js.map +1 -1
- package/build/components/block.js +2 -2
- package/build/components/block.js.map +1 -1
- package/build/components/footer/component.d.ts +30 -0
- package/build/components/footer/component.d.ts.map +1 -0
- package/build/components/footer/component.js +51 -0
- package/build/components/footer/component.js.map +1 -0
- package/build/components/footer/credit.d.ts +29 -0
- package/build/components/footer/credit.d.ts.map +1 -0
- package/build/components/footer/credit.js +42 -0
- package/build/components/footer/credit.js.map +1 -0
- package/build/components/footer/index.d.ts +4 -0
- package/build/components/footer/index.d.ts.map +1 -0
- package/build/components/footer/index.js +3 -0
- package/build/components/footer/index.js.map +1 -0
- package/build/components/footer/types.d.ts +27 -0
- package/build/components/footer/types.d.ts.map +1 -0
- package/build/components/footer/types.js +2 -0
- package/build/components/footer/types.js.map +1 -0
- package/build/components/form/button/component.js +2 -2
- package/build/components/form/button/component.js.map +1 -1
- package/build/components/form/component.js +2 -2
- package/build/components/form/component.js.map +1 -1
- package/build/components/form/text/component.js +2 -2
- package/build/components/form/text/component.js.map +1 -1
- package/build/components/index.d.ts +6 -0
- package/build/components/index.d.ts.map +1 -1
- package/build/components/index.js +6 -0
- package/build/components/index.js.map +1 -1
- package/build/components/link.js +3 -3
- package/build/components/link.js.map +1 -1
- package/build/components/login/append.d.ts +22 -0
- package/build/components/login/append.d.ts.map +1 -0
- package/build/components/login/append.js +26 -0
- package/build/components/login/append.js.map +1 -0
- package/build/components/login/credit.d.ts +19 -0
- package/build/components/login/credit.d.ts.map +1 -0
- package/build/components/login/credit.js +19 -0
- package/build/components/login/credit.js.map +1 -0
- package/build/components/login/icons.d.ts +14 -0
- package/build/components/login/icons.d.ts.map +1 -0
- package/build/components/login/icons.js +29 -0
- package/build/components/login/icons.js.map +1 -0
- package/build/components/login/index.d.ts +7 -0
- package/build/components/login/index.d.ts.map +1 -0
- package/build/components/login/index.js +7 -0
- package/build/components/login/index.js.map +1 -0
- package/build/components/login/notify.d.ts +18 -0
- package/build/components/login/notify.d.ts.map +1 -0
- package/build/components/login/notify.js +42 -0
- package/build/components/login/notify.js.map +1 -0
- package/build/components/login/screen.d.ts +23 -0
- package/build/components/login/screen.d.ts.map +1 -0
- package/build/components/login/screen.js +74 -0
- package/build/components/login/screen.js.map +1 -0
- package/build/components/login/terms.d.ts +17 -0
- package/build/components/login/terms.d.ts.map +1 -0
- package/build/components/login/terms.js +52 -0
- package/build/components/login/terms.js.map +1 -0
- package/build/components/nav/index.d.ts +6 -0
- package/build/components/nav/index.d.ts.map +1 -0
- package/build/components/nav/index.js +5 -0
- package/build/components/nav/index.js.map +1 -0
- package/build/components/nav/layout.d.ts +19 -0
- package/build/components/nav/layout.d.ts.map +1 -0
- package/build/components/nav/layout.js +87 -0
- package/build/components/nav/layout.js.map +1 -0
- package/build/components/nav/mobile.d.ts +21 -0
- package/build/components/nav/mobile.d.ts.map +1 -0
- package/build/components/nav/mobile.js +70 -0
- package/build/components/nav/mobile.js.map +1 -0
- package/build/components/nav/side.d.ts +11 -0
- package/build/components/nav/side.d.ts.map +1 -0
- package/build/components/nav/side.js +25 -0
- package/build/components/nav/side.js.map +1 -0
- package/build/components/nav/top.d.ts +10 -0
- package/build/components/nav/top.d.ts.map +1 -0
- package/build/components/nav/top.js +44 -0
- package/build/components/nav/top.js.map +1 -0
- package/build/components/nav/types.d.ts +93 -0
- package/build/components/nav/types.d.ts.map +1 -0
- package/build/components/nav/types.js +2 -0
- package/build/components/nav/types.js.map +1 -0
- package/build/components/panel-app/component.d.ts.map +1 -1
- package/build/components/panel-app/component.js +4 -3
- package/build/components/panel-app/component.js.map +1 -1
- package/build/components/scheme/hook.d.ts +16 -0
- package/build/components/scheme/hook.d.ts.map +1 -0
- package/build/components/scheme/hook.js +51 -0
- package/build/components/scheme/hook.js.map +1 -0
- package/build/components/scheme/index.d.ts +4 -0
- package/build/components/scheme/index.d.ts.map +1 -0
- package/build/components/scheme/index.js +3 -0
- package/build/components/scheme/index.js.map +1 -0
- package/build/components/scheme/toggle.d.ts +14 -0
- package/build/components/scheme/toggle.d.ts.map +1 -0
- package/build/components/scheme/toggle.js +34 -0
- package/build/components/scheme/toggle.js.map +1 -0
- package/build/components/scheme/types.d.ts +21 -0
- package/build/components/scheme/types.d.ts.map +1 -0
- package/build/components/scheme/types.js +2 -0
- package/build/components/scheme/types.js.map +1 -0
- package/build/components/socket/i18n/be.json +9 -0
- package/build/components/socket/i18n/de.json +9 -0
- package/build/components/socket/i18n/en.json +9 -0
- package/build/components/socket/i18n/es.json +9 -0
- package/build/components/socket/i18n/fr.json +9 -0
- package/build/components/socket/i18n/pl.json +9 -0
- package/build/components/socket/i18n/ru.json +9 -0
- package/build/components/socket/i18n/uk.json +9 -0
- package/build/components/socket/i18n.d.ts +2 -0
- package/build/components/socket/i18n.d.ts.map +1 -0
- package/build/components/socket/i18n.js +18 -0
- package/build/components/socket/i18n.js.map +1 -0
- package/build/components/socket/index.d.ts +3 -0
- package/build/components/socket/index.d.ts.map +1 -0
- package/build/components/socket/index.js +3 -0
- package/build/components/socket/index.js.map +1 -0
- package/build/components/socket/reload-dialog.d.ts +22 -0
- package/build/components/socket/reload-dialog.d.ts.map +1 -0
- package/build/components/socket/reload-dialog.js +34 -0
- package/build/components/socket/reload-dialog.js.map +1 -0
- package/build/components/status.js +1 -1
- package/build/components/status.js.map +1 -1
- package/build/components/text.js +1 -1
- package/build/components/text.js.map +1 -1
- package/build/components/toaster.d.ts +16 -0
- package/build/components/toaster.d.ts.map +1 -0
- package/build/components/toaster.js +52 -0
- package/build/components/toaster.js.map +1 -0
- package/build/components/uploader/image.js +1 -1
- package/build/components/uploader/image.js.map +1 -1
- package/build/consent/component.d.ts +23 -0
- package/build/consent/component.d.ts.map +1 -0
- package/build/consent/component.js +53 -0
- package/build/consent/component.js.map +1 -0
- package/build/consent/consts.d.ts +2 -0
- package/build/consent/consts.d.ts.map +1 -0
- package/build/consent/consts.js +2 -0
- package/build/consent/consts.js.map +1 -0
- package/build/consent/index.d.ts +9 -0
- package/build/consent/index.d.ts.map +1 -0
- package/build/consent/index.js +7 -0
- package/build/consent/index.js.map +1 -0
- package/build/consent/menu-widget.d.ts +13 -0
- package/build/consent/menu-widget.d.ts.map +1 -0
- package/build/consent/menu-widget.js +20 -0
- package/build/consent/menu-widget.js.map +1 -0
- package/build/consent/presence.d.ts +30 -0
- package/build/consent/presence.d.ts.map +1 -0
- package/build/consent/presence.js +40 -0
- package/build/consent/presence.js.map +1 -0
- package/build/consent/service.d.ts +18 -0
- package/build/consent/service.d.ts.map +1 -0
- package/build/consent/service.js +53 -0
- package/build/consent/service.js.map +1 -0
- package/build/consent/translate.d.ts +14 -0
- package/build/consent/translate.d.ts.map +1 -0
- package/build/consent/translate.js +28 -0
- package/build/consent/translate.js.map +1 -0
- package/build/consent/types.d.ts +19 -0
- package/build/consent/types.d.ts.map +1 -0
- package/build/consent/types.js +2 -0
- package/build/consent/types.js.map +1 -0
- package/build/context.d.ts.map +1 -1
- package/build/context.js +10 -0
- package/build/context.js.map +1 -1
- package/build/entrypoints.d.ts +6 -0
- package/build/entrypoints.d.ts.map +1 -0
- package/build/entrypoints.js +4 -0
- package/build/entrypoints.js.map +1 -0
- package/build/exports.d.ts +3 -4
- package/build/exports.d.ts.map +1 -1
- package/build/exports.js +3 -4
- package/build/exports.js.map +1 -1
- package/build/index.d.ts +1 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +1 -1
- package/build/index.js.map +1 -1
- package/build/scheme/index.d.ts +3 -0
- package/build/scheme/index.d.ts.map +1 -0
- package/build/scheme/index.js +2 -0
- package/build/scheme/index.js.map +1 -0
- package/build/scheme/scheme.d.ts +44 -0
- package/build/scheme/scheme.d.ts.map +1 -0
- package/build/scheme/scheme.js +78 -0
- package/build/scheme/scheme.js.map +1 -0
- package/build/types.d.ts +11 -1
- package/build/types.d.ts.map +1 -1
- package/package.json +57 -33
- package/src/@/components/ui/alert-dialog.tsx +156 -0
- package/src/@/components/ui/alert.tsx +1 -1
- package/src/@/components/ui/button.tsx +1 -1
- package/src/@/components/ui/card.tsx +1 -1
- package/src/@/components/ui/input.tsx +1 -1
- package/src/@/components/ui/label.tsx +1 -1
- package/src/@/components/ui/navigation-menu.tsx +169 -0
- package/src/@/components/ui/progress.tsx +1 -1
- package/src/@/components/ui/separator.tsx +1 -1
- package/src/@/components/ui/sheet.tsx +142 -0
- package/src/auth/context.ts +0 -2
- package/src/auth/entrypoints.ts +5 -0
- package/src/auth/exports.ts +3 -3
- package/src/auth/plugins/basic-ed25519.tsx +4 -4
- package/src/auth/plugins/re-captcha.tsx +3 -3
- package/src/auth/plugins/tunnel-consumer.tsx +1 -1
- package/src/components/block.tsx +2 -2
- package/src/components/footer/component.tsx +77 -0
- package/src/components/footer/credit.tsx +65 -0
- package/src/components/footer/index.ts +4 -0
- package/src/components/footer/types.ts +26 -0
- package/src/components/form/button/component.tsx +2 -2
- package/src/components/form/component.tsx +2 -2
- package/src/components/form/text/component.tsx +2 -2
- package/src/components/index.ts +6 -0
- package/src/components/link.tsx +3 -3
- package/src/components/login/append.ts +40 -0
- package/src/components/login/credit.tsx +41 -0
- package/src/components/login/icons.tsx +39 -0
- package/src/components/login/index.ts +6 -0
- package/src/components/login/notify.ts +53 -0
- package/src/components/login/screen.tsx +142 -0
- package/src/components/login/terms.tsx +121 -0
- package/src/components/nav/index.ts +6 -0
- package/src/components/nav/layout.tsx +187 -0
- package/src/components/nav/mobile.tsx +147 -0
- package/src/components/nav/side.tsx +52 -0
- package/src/components/nav/top.tsx +62 -0
- package/src/components/nav/types.ts +94 -0
- package/src/components/panel-app/component.tsx +9 -1
- package/src/components/scheme/hook.ts +64 -0
- package/src/components/scheme/index.ts +4 -0
- package/src/components/scheme/toggle.tsx +43 -0
- package/src/components/scheme/types.ts +23 -0
- package/src/components/socket/i18n/be.json +9 -0
- package/src/components/socket/i18n/de.json +9 -0
- package/src/components/socket/i18n/en.json +9 -0
- package/src/components/socket/i18n/es.json +9 -0
- package/src/components/socket/i18n/fr.json +9 -0
- package/src/components/socket/i18n/pl.json +9 -0
- package/src/components/socket/i18n/ru.json +9 -0
- package/src/components/socket/i18n/uk.json +9 -0
- package/src/components/socket/i18n.ts +19 -0
- package/src/components/socket/index.ts +2 -0
- package/src/components/socket/reload-dialog.tsx +61 -0
- package/src/components/status.tsx +1 -1
- package/src/components/text.tsx +1 -1
- package/src/components/toaster.tsx +68 -0
- package/src/components/uploader/image.tsx +1 -1
- package/src/consent/component.tsx +74 -0
- package/src/consent/consts.ts +1 -0
- package/src/consent/index.ts +18 -0
- package/src/consent/menu-widget.tsx +22 -0
- package/src/consent/presence.ts +45 -0
- package/src/consent/service.ts +75 -0
- package/src/consent/translate.ts +31 -0
- package/src/consent/types.ts +21 -0
- package/src/context.ts +12 -0
- package/src/entrypoints.ts +5 -0
- package/src/exports.ts +3 -4
- package/src/index.ts +1 -1
- package/src/scheme/index.ts +4 -0
- package/src/scheme/scheme.ts +86 -0
- package/src/types.ts +11 -1
- package/tests/consent.spec.ts +47 -0
- package/tests/context.ts +43 -0
- package/tests/harness/index.html +11 -0
- package/tests/harness/mount.tsx +319 -0
- package/tests/login.spec.ts +262 -0
- package/tests/nav.spec.ts +522 -0
- package/tests/package-boundary.spec.ts +19 -0
- package/tests/scheme.spec.ts +149 -0
- package/tests/smoke.spec.ts +5 -1
- package/tests/socket-dialog.spec.ts +154 -0
- package/tests/toaster.spec.ts +59 -0
- package/zz-tw.d.mts +2 -0
- package/zz-tw.d.mts.map +1 -0
- package/build/.gitkeep +0 -0
- package/build/auth/modules.d.ts +0 -2
- package/build/auth/modules.d.ts.map +0 -1
- package/build/auth/modules.js +0 -4
- package/build/auth/modules.js.map +0 -1
- package/build/modules.d.ts +0 -2
- package/build/modules.d.ts.map +0 -1
- package/build/modules.js +0 -4
- package/build/modules.js.map +0 -1
- package/src/auth/modules.ts +0 -5
- package/src/modules.ts +0 -5
package/README.md
CHANGED
|
@@ -1,51 +1,51 @@
|
|
|
1
1
|
# @owlmeans/web-panel
|
|
2
2
|
|
|
3
|
-
shadcn UI + Tailwind v4 implementation of the OwlMeans web panel layer.
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
shadcn UI + Tailwind v4 implementation of the OwlMeans web panel layer. It wraps the headless
|
|
4
|
+
`@owlmeans/client-panel` logic and `@owlmeans/web-client`'s context with shadcn primitives: the base
|
|
5
|
+
context factory, the navigation shell, forms, panels, the sign-in screen, toasts and the socket
|
|
6
|
+
reload prompt. New OwlMeans web apps build on it. An app that renders only its own components and
|
|
7
|
+
needs no panel can stay on [`@owlmeans/web-client`](../web-client). Material UI apps already on
|
|
8
|
+
[`@owlmeans/mui-panel`](../mui-panel) are legacy: the same surface rendered with MUI, maintained
|
|
9
|
+
but never started.
|
|
6
10
|
|
|
7
|
-
##
|
|
8
|
-
|
|
9
|
-
- New OwlMeans web apps where the consumer owns its shadcn primitives and
|
|
10
|
-
Tailwind v4 theme.
|
|
11
|
-
- Drop-in replacement for the previous Material-UI based `@owlmeans/web-panel`
|
|
12
|
-
(which has been renamed to [`@owlmeans/mui-panel`](../mui-panel) for
|
|
13
|
-
backwards-compatibility consumers).
|
|
14
|
-
|
|
15
|
-
## Install
|
|
11
|
+
## Installation
|
|
16
12
|
|
|
17
13
|
```sh
|
|
18
|
-
bun add @owlmeans/web-panel
|
|
14
|
+
bun add @owlmeans/web-panel@^0.1.18-rc.60
|
|
19
15
|
```
|
|
20
16
|
|
|
21
17
|
Peer requirements (the consuming app provides these): `react`, `react-dom`,
|
|
22
18
|
`react-hook-form`, `ajv`, `tailwindcss@^4`, `lucide-react`, `clsx`,
|
|
23
19
|
`tailwind-merge`, `class-variance-authority`, plus the radix primitives
|
|
24
|
-
listed in `peerDependencies
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
listed in `peerDependencies` (`alert-dialog`, `dialog`, `label`, `navigation-menu`, `progress`,
|
|
21
|
+
`separator`, `slot`). Also declare `ajv-formats` next to `ajv`: the form model imports it, but no dependency
|
|
22
|
+
section of this manifest lists it.
|
|
27
23
|
|
|
28
|
-
|
|
29
|
-
its utility as `@/lib/utils`. Build emits these specifiers verbatim
|
|
30
|
-
(TypeScript `moduleResolution: Bundler`). The consumer's bundler must
|
|
31
|
-
resolve `@/*` to its own shadcn primitive copy.
|
|
24
|
+
## Concepts
|
|
32
25
|
|
|
33
|
-
|
|
26
|
+
- **Panel context** — `makeContext(cfg)` is `@owlmeans/web-client`'s context plus
|
|
27
|
+
`apiConfigMiddleware`, the flow service (`context.flow()`), the socket-status service and the
|
|
28
|
+
default shadcn sign-in screen. The app factory calls it and appends its own mixins.
|
|
29
|
+
- **Package boundary** — the shadcn primitives and `cn` are private files under the package's own
|
|
30
|
+
`build/@/` tree, imported relatively. A consumer needs no `@` alias and vendors nothing. It
|
|
31
|
+
supplies the peers, its Tailwind theme tokens and an `@source` line for this package.
|
|
32
|
+
- **Two-layer navigation** — the top menu lists sections and the side menu lists the active
|
|
33
|
+
section's screens. A section holding a single screen renders no side menu. The model
|
|
34
|
+
(`usePanelNav`, `PanelNav*`) is headless in `@owlmeans/client-panel`. With `mobileMenu`, a
|
|
35
|
+
narrow viewport gets both levels behind one menu button and a sheet instead.
|
|
36
|
+
- **Style slots** — `className` (page root), `headerClassName` (sticky bar), `contentClassName`
|
|
37
|
+
and `containerClassName` (width and padding of all three rows) are merged over their defaults
|
|
38
|
+
with tailwind-merge, never substituted.
|
|
39
|
+
- **Global overlays** — `PanelApp` renders its `children` and `SocketReloadDialog` beside the
|
|
40
|
+
router, so a dialog survives navigation.
|
|
41
|
+
- **`translate` props** — the navigation and login components take a
|
|
42
|
+
`(key, defaultValue) => string` resolver as a prop instead of reading an i18n provider implicitly.
|
|
34
43
|
|
|
35
|
-
|
|
36
|
-
from this package's `src/@/components/ui/` or use the shadcn CLI:
|
|
37
|
-
|
|
38
|
-
```sh
|
|
39
|
-
npx shadcn add button card input label progress alert separator
|
|
40
|
-
```
|
|
44
|
+
## Usage
|
|
41
45
|
|
|
42
|
-
|
|
43
|
-
`baseColor: neutral`. See `components.json` for the exact config.
|
|
46
|
+
### Consumer setup — theme tokens and `@source`
|
|
44
47
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
The components rely on the following CSS variables (defined inside
|
|
48
|
-
`@theme` in your app's globals.css):
|
|
48
|
+
The components paint with these CSS variables, defined inside `@theme` in the app's globals.css:
|
|
49
49
|
|
|
50
50
|
- `--color-background`, `--color-foreground`
|
|
51
51
|
- `--color-card`, `--color-card-foreground`
|
|
@@ -60,67 +60,433 @@ The components rely on the following CSS variables (defined inside
|
|
|
60
60
|
- `--animate-progress-indeterminate` + the `@keyframes progress-indeterminate`
|
|
61
61
|
rule for the `Progress` component's indeterminate mode
|
|
62
62
|
|
|
63
|
-
A working set is shipped at `src/@/globals.css` (for dev/test only).
|
|
63
|
+
A working set is shipped at `src/@/globals.css` (for dev/test only). Toasts additionally read
|
|
64
|
+
`--popover`, `--popover-foreground` and `--border`.
|
|
65
|
+
|
|
66
|
+
Tailwind's scanner reads your CSS root plus its `@source` directives, and it excludes
|
|
67
|
+
`node_modules`. Classes that exist only inside this package's components — the whole navigation
|
|
68
|
+
shell and footer — therefore never reach your stylesheet unless you point Tailwind at the
|
|
69
|
+
installed package's `src`:
|
|
70
|
+
|
|
71
|
+
```css
|
|
72
|
+
@import "tailwindcss";
|
|
73
|
+
|
|
74
|
+
@source "../../../node_modules/@owlmeans/web-panel/src";
|
|
75
|
+
```
|
|
64
76
|
|
|
65
|
-
|
|
77
|
+
Adjust the relative depth to your own layout. An app using `./consent` adds a second `@source` for
|
|
78
|
+
`@owlmeans/web-consent`'s `src`.
|
|
79
|
+
|
|
80
|
+
### 1. Config and context factory
|
|
81
|
+
|
|
82
|
+
```ts
|
|
83
|
+
// src/config.ts
|
|
84
|
+
import { config } from '@owlmeans/web-panel'
|
|
85
|
+
import { commonConfig, MY_APP_WEB } from 'my-app-common'
|
|
86
|
+
import type { Config } from './types.js'
|
|
87
|
+
|
|
88
|
+
const cfg: Config = config(MY_APP_WEB, commonConfig as Config)
|
|
89
|
+
// Block the screen with a "try again / reload the page" prompt once a socket has given up reconnecting.
|
|
90
|
+
cfg.socket = { ...cfg.socket, reloadDialog: true }
|
|
91
|
+
|
|
92
|
+
export default cfg
|
|
93
|
+
```
|
|
66
94
|
|
|
67
95
|
```ts
|
|
68
|
-
//
|
|
69
|
-
|
|
96
|
+
// src/context.ts
|
|
97
|
+
import { appendLoginScreen, makeContext as makePanelContext, useContext as usePanelContext } from '@owlmeans/web-panel'
|
|
98
|
+
import type { AppConfig, AppContext } from '@owlmeans/web-panel'
|
|
99
|
+
import { appendConsentWidgetService } from '@owlmeans/web-panel/consent'
|
|
100
|
+
import { appendStateResource } from '@owlmeans/state'
|
|
101
|
+
import { BrandMark } from './components/brand.js'
|
|
102
|
+
import { PROJECT_STATE } from './consts.js'
|
|
103
|
+
|
|
104
|
+
export interface Config extends AppConfig {}
|
|
105
|
+
export interface Context<C extends Config = Config> extends AppContext<C> {}
|
|
106
|
+
|
|
107
|
+
export const useContext = (): Context => usePanelContext<Config, Context>()
|
|
108
|
+
|
|
109
|
+
export const makeContext = <C extends Config, T extends Context<C>>(cfg: C): T => {
|
|
110
|
+
const context = makePanelContext<C, T>(cfg)
|
|
111
|
+
// Idempotent: makeContext registered the default screen; this puts the app's mark on it.
|
|
112
|
+
appendLoginScreen<C, T>(context, { Logo: BrandMark })
|
|
113
|
+
appendConsentWidgetService<C, T>(context)
|
|
114
|
+
appendStateResource<C, T>(context, PROJECT_STATE)
|
|
115
|
+
|
|
116
|
+
return context
|
|
117
|
+
}
|
|
70
118
|
```
|
|
71
119
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
This package keeps the same public name and re-export surface as the
|
|
75
|
-
previous MUI implementation, but the following props/types have changed:
|
|
76
|
-
|
|
77
|
-
- **`styles?: SxProps` is removed.** Use the new `className?: string` and
|
|
78
|
-
`style?: React.CSSProperties` props instead. Affected: `BlockProps`,
|
|
79
|
-
`TextProps`, `LinkProps`, `WebFormProps`, `LayoutProps`.
|
|
80
|
-
- **`variant` on `Text` / `Link` is now `TextVariant`**, a string-literal
|
|
81
|
-
union: `'h1' | 'h2' | 'h3' | 'h4' | 'p' | 'lead' | 'large' | 'small' |
|
|
82
|
-
'muted' | 'blockquote'`. The previous MUI `TypographyOwnProps['variant']`
|
|
83
|
-
union no longer applies.
|
|
84
|
-
- **`PanelAppProps.theme?: Theme` is replaced with
|
|
85
|
-
`PanelAppProps.rootClassName?: string`.** Apply your theme via Tailwind
|
|
86
|
-
classes / CSS variables instead of MUI's `Theme` object.
|
|
87
|
-
- **`render(context, theme?, opts?)` signature → `render(context, opts?)`**
|
|
88
|
-
where `opts` includes the new `rootClassName?: string`.
|
|
89
|
-
- **`scalingToStyles()`** now returns a class-name string (composable with
|
|
90
|
-
`cn()`), not an `SxProps` object. The `theme?: Theme` parameter is
|
|
91
|
-
removed (Tailwind handles breakpoints declaratively).
|
|
92
|
-
- **`useBreakPoint` / `useMapBreakpoint`** now use Tailwind's static
|
|
93
|
-
default breakpoints (`xs/sm/md/lg/xl`) instead of MUI's `Theme.breakpoints`.
|
|
94
|
-
Customise via Tailwind config in the consuming app.
|
|
95
|
-
- **Component prop API for buttons** stays compatible (`'small' | 'medium'
|
|
96
|
-
| 'large'`, `variant` strings `contained`/`outlined`/`text`/shadcn names).
|
|
97
|
-
Internally they map to shadcn variants.
|
|
98
|
-
|
|
99
|
-
Consumers that need the previous MUI behaviour should swap to
|
|
100
|
-
[`@owlmeans/mui-panel`](../mui-panel) — same exports, MUI-rendered.
|
|
101
|
-
|
|
102
|
-
## Public exports
|
|
120
|
+
### 2. Entrypoints and mounting with overlays
|
|
103
121
|
|
|
104
122
|
```ts
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
} from '
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
123
|
+
// src/entrypoints.ts
|
|
124
|
+
import { bindAll, bindScreen, entrypoints as panelEntrypoints, handler } from '@owlmeans/web-panel'
|
|
125
|
+
import { entrypoints as authEntrypoints } from '@owlmeans/client-auth'
|
|
126
|
+
import { apiProtocols, webProtocols } from 'my-app-common'
|
|
127
|
+
import { MainLayout } from './layout/main.js'
|
|
128
|
+
import { HomeScreen } from './screens/home.js'
|
|
129
|
+
import { CookiePolicyScreen } from './screens/legal/cookies.js'
|
|
130
|
+
|
|
131
|
+
export const appEntrypoints = [
|
|
132
|
+
...authEntrypoints,
|
|
133
|
+
...panelEntrypoints,
|
|
134
|
+
...bindAll(apiProtocols),
|
|
135
|
+
bindScreen(webProtocols.base, handler(MainLayout)),
|
|
136
|
+
bindScreen(webProtocols.home, handler(HomeScreen)),
|
|
137
|
+
bindScreen(webProtocols.legal.cookies, handler(CookiePolicyScreen)),
|
|
138
|
+
]
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
`render(context, { rootClassName })` mounts `PanelApp` with the browser language detector
|
|
142
|
+
installed. An app with global overlays of its own mounts `PanelApp` itself:
|
|
143
|
+
|
|
144
|
+
```tsx
|
|
145
|
+
// src/render.tsx
|
|
146
|
+
import type { FC } from 'react'
|
|
147
|
+
import { render as mount } from '@owlmeans/web-client'
|
|
148
|
+
import type { AppContext } from '@owlmeans/web-client'
|
|
149
|
+
import { useI18nInstance } from '@owlmeans/client-i18n/utils'
|
|
150
|
+
import { PanelApp } from '@owlmeans/web-panel'
|
|
151
|
+
import { PanelCookieConsent } from '@owlmeans/web-panel/consent'
|
|
152
|
+
import detector from 'i18next-browser-languagedetector'
|
|
153
|
+
|
|
154
|
+
const App: FC<{ context: AppContext }> = ({ context }) => {
|
|
155
|
+
useI18nInstance(context.cfg).use(detector)
|
|
156
|
+
|
|
157
|
+
// Children of PanelApp sit beside the router, so the dialog survives navigation.
|
|
158
|
+
return <PanelApp context={context} rootClassName="dark">
|
|
159
|
+
<PanelCookieConsent policyHref="/legal/cookies" />
|
|
160
|
+
</PanelApp>
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export const render = (context: AppContext) => mount(<App context={context} />)
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
```ts
|
|
167
|
+
// src/index.tsx
|
|
168
|
+
const context = makeContext(config)
|
|
169
|
+
context.registerEntrypoints(appEntrypoints)
|
|
170
|
+
context.serviceRoute(MY_APP_WEB, true)
|
|
171
|
+
render(context)
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### 3. Navigation shell, toasts and a guarded layout
|
|
175
|
+
|
|
176
|
+
`NavLayout` is the standard shell: header, section menu, the active section's screen menu, content
|
|
177
|
+
and footer. A layout entrypoint binds a component that renders it; the matched screen arrives as
|
|
178
|
+
`children`. Keep the navigation as data in its own module, so screens, entrypoints and the shell
|
|
179
|
+
read the same aliases.
|
|
180
|
+
|
|
181
|
+
```tsx
|
|
182
|
+
import type { FC, PropsWithChildren } from 'react'
|
|
183
|
+
import { HOME, NavLayout, Toaster, useI18nApp } from '@owlmeans/web-panel'
|
|
184
|
+
import type { PanelNavConfig, PanelNavLink } from '@owlmeans/web-panel'
|
|
185
|
+
import { useSelfAuth } from '@owlmeans/client-auth'
|
|
186
|
+
import { webProtocols } from 'my-app-common'
|
|
187
|
+
|
|
188
|
+
export const navConfig: PanelNavConfig = {
|
|
189
|
+
sections: [
|
|
190
|
+
{ name: 'home', label: 'Home', items: [{ alias: HOME, label: 'Overview' }] },
|
|
191
|
+
{
|
|
192
|
+
name: 'projects', items: [
|
|
193
|
+
{ alias: webProtocols.projects.alias },
|
|
194
|
+
{ alias: webProtocols.archive.alias },
|
|
195
|
+
]
|
|
196
|
+
},
|
|
197
|
+
],
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
const footerLinks: PanelNavLink[] = [
|
|
201
|
+
{ alias: HOME, label: 'My App' },
|
|
202
|
+
{ href: 'https://example.com/docs', label: 'Docs', open: true },
|
|
203
|
+
]
|
|
204
|
+
|
|
205
|
+
export const MainLayout: FC<PropsWithChildren> = ({ children }) => {
|
|
206
|
+
useSelfAuth(true)
|
|
207
|
+
const t = useI18nApp('menu')
|
|
208
|
+
|
|
209
|
+
return <>
|
|
210
|
+
<NavLayout nav={navConfig} title="My App" footer={footerLinks}
|
|
211
|
+
translate={(key, defaultValue) => t(key, { defaultValue })}
|
|
212
|
+
headerClassName="bg-secondary text-secondary-foreground"
|
|
213
|
+
containerClassName="max-w-[1280px]">
|
|
214
|
+
{children}
|
|
215
|
+
</NavLayout>
|
|
216
|
+
{/* Exactly once, in the layout. Messages come from `toast.success(...)` in `sonner`. */}
|
|
217
|
+
<Toaster />
|
|
218
|
+
</>
|
|
219
|
+
}
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
Labels resolve as literal `label`, then `translate(key, humanized alias)`, then the humanized
|
|
223
|
+
alias. Default keys are `nav.<section>` and `modules.<alias>`.
|
|
224
|
+
|
|
225
|
+
| Component | Props |
|
|
226
|
+
|---|---|
|
|
227
|
+
| `NavLayout` | `nav`, `translate?`, `title?`, `home?` (brand target; defaults to the first section's first item), `actions?`, `mobileMenu?` (below `md`, a menu button and a sheet replace the section menu and the screen strip; `actions` stay), `skipLinkLabel?` (the first-on-page skip link to `<main id="main">`; default `shell.skip` → "Skip to content"; `false` renders no link and no `#main`), `themeToggle?` (`true` or `{ labels? }`: the light/dark switcher in the footer's bottom row beside the credit; names via `shell.toLight` / `shell.toDark`), `footer?` (`PanelNavLink[]` renders the centred link row; a node renders as a full-width block above the credit), `headerClassName?`, `contentClassName?`, `containerClassName?`, `className?`, `style?` |
|
|
228
|
+
| `TopNav` | `config`, `translate?`, `ariaLabel?`, `className?`, `style?` |
|
|
229
|
+
| `SideNav` | the same, plus `variant?: 'side' \| 'bar'` |
|
|
230
|
+
| `MobileNav` | the same as `TopNav`; the trigger's name and the sheet title resolve `shell.menu` ("Menu"), its close button `shell.close` ("Close"); `className`/`style` land on the trigger |
|
|
231
|
+
| `Footer` | `links?`, `content?` (full-width block, `data-footer-content`), `translate?`, `containerClassName?`, `children?` (join the link row), `themeToggle?`, `className?`, `style?` — always renders the platform/owner credit line last, via `ShellCredit` |
|
|
232
|
+
| `ThemeToggle` | `labels?: { toLight?, toDark? }` (English defaults), `className?`, `style?` — a 44px `<button data-theme-toggle>` flipping the resolved scheme |
|
|
233
|
+
| `ShellCredit`, `useShellCredit` | `className?` — "Powered by OwlMeans" plus the owner's copyright, resolved the same way the sign-in screen's credit is |
|
|
234
|
+
|
|
235
|
+
### 4. Forms, panels and status
|
|
236
|
+
|
|
237
|
+
`Form` owns the whole model: `useForm` with an `ajvResolver` over `validation`, published through
|
|
238
|
+
`FormProvider` and `FormContext`, so every control below reads one form.
|
|
239
|
+
|
|
240
|
+
```tsx
|
|
241
|
+
import type { FC } from 'react'
|
|
242
|
+
import { useCallback } from 'react'
|
|
243
|
+
import { toast } from 'sonner'
|
|
244
|
+
import { Block, BlockScaling, Button, Form, PanelContext, SubmitButton, TextInput, useFormRef } from '@owlmeans/web-panel'
|
|
245
|
+
import { apiProtocols, ProjectCreateSchema } from 'my-app-common'
|
|
246
|
+
import type { ProjectCreate } from 'my-app-common'
|
|
247
|
+
import { useContext } from '../context.js'
|
|
248
|
+
|
|
249
|
+
export const CreateProject: FC<{ onCancel: () => void }> = ({ onCancel }) => {
|
|
250
|
+
const context = useContext()
|
|
251
|
+
const formRef = useFormRef<ProjectCreate>()
|
|
252
|
+
|
|
253
|
+
const onSubmit = useCallback(async (data: ProjectCreate) => {
|
|
254
|
+
try {
|
|
255
|
+
await context.entrypoint(apiProtocols.project.create).call({ body: data })
|
|
256
|
+
toast.success('Project created')
|
|
257
|
+
} catch (error) {
|
|
258
|
+
// Plants a root error; Form shows it through Status when decorated.
|
|
259
|
+
formRef.current?.error(error)
|
|
260
|
+
}
|
|
261
|
+
}, [])
|
|
262
|
+
|
|
263
|
+
return <PanelContext resource="my-app" prefix="project-create">
|
|
264
|
+
{/* `decorate` renders a Card, the root error and a SubmitButton in the footer. */}
|
|
265
|
+
<Form decorate name="project" formRef={formRef} validation={ProjectCreateSchema}
|
|
266
|
+
horizontal={BlockScaling.Half} onSubmit={onSubmit}>
|
|
267
|
+
<TextInput name="name" label placeholder hint />
|
|
268
|
+
<TextInput name="repository" type="url" label="Repository URL" disableAutocomplete />
|
|
269
|
+
</Form>
|
|
270
|
+
<Button label="cancel" variant="text" onClick={onCancel} />
|
|
271
|
+
</PanelContext>
|
|
272
|
+
}
|
|
114
273
|
```
|
|
115
274
|
|
|
275
|
+
- `TextInput` takes `label`, `placeholder` and `hint` as `string | boolean`: `true` resolves
|
|
276
|
+
`<name>.label` / `.placeholder` / `.hint` from the form namespace, and a string is used verbatim.
|
|
277
|
+
- Without `decorate`, `Form` is a bare flex column with no card, no root-error surface and no submit
|
|
278
|
+
button, so render your own `SubmitButton` inside it.
|
|
279
|
+
- `formRef` (from `useFormRef()`) is filled with `{ form, update, loader, error }`.
|
|
280
|
+
- `Button` maps `contained` / `outlined` / `text` onto shadcn `default` / `outline` / `ghost`, and
|
|
281
|
+
forwards any other shadcn variant name unchanged.
|
|
282
|
+
|
|
283
|
+
Panels and feedback:
|
|
284
|
+
|
|
285
|
+
```tsx
|
|
286
|
+
import { Block, ButtonSelector, ImageUploader, Link, Status, Text } from '@owlmeans/web-panel'
|
|
287
|
+
|
|
288
|
+
<Block horizontal={BlockScaling.Wide} Actions={() => <Link module={webProtocols.projects.alias} />}>
|
|
289
|
+
<Text variant="h3" name="title" />
|
|
290
|
+
<ButtonSelector name="period" options={['day', 'week', 'month']} current={period} onSelect={setPeriod} />
|
|
291
|
+
<ImageUploader maxFiles={1} previewUrl={logoUrl} onDrop={files => upload(files[0])} />
|
|
292
|
+
{result != null && <Status ok={result.ok} error={result.error} message={result.message} />}
|
|
293
|
+
</Block>
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
### 5. Socket connection state
|
|
297
|
+
|
|
298
|
+
With `cfg.socket.reloadDialog` set, `PanelApp` mounts `SocketReloadDialog`. It is a blocking
|
|
299
|
+
`AlertDialog` that opens when every `ws()` / `useWs()` connection has exhausted its retry budget
|
|
300
|
+
(`useSocketStatus() === 'lost'`), and its only action reloads the page. An app that prefers an
|
|
301
|
+
inline state leaves the flag off and reads the same status:
|
|
302
|
+
|
|
303
|
+
```tsx
|
|
304
|
+
import type { FC } from 'react'
|
|
305
|
+
import { useSocketStatus } from '@owlmeans/client-socket'
|
|
306
|
+
import { useI18nApp } from '@owlmeans/web-panel'
|
|
307
|
+
|
|
308
|
+
export const ConnectionBadge: FC = () => {
|
|
309
|
+
const status = useSocketStatus() // 'online' | 'reconnecting' | 'lost'
|
|
310
|
+
const t = useI18nApp('connection')
|
|
311
|
+
|
|
312
|
+
return status === 'online' ? null : <span role="status" data-state={status}>{t(status)}</span>
|
|
313
|
+
}
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
The dialog's strings are the lib-tier `socket` namespace (`reload.title`, `reload.description`,
|
|
317
|
+
`reload.action`), shipped in seven languages.
|
|
318
|
+
|
|
319
|
+
## API
|
|
320
|
+
|
|
321
|
+
### Context and mounting
|
|
322
|
+
|
|
323
|
+
| Symbol | Kind | Purpose |
|
|
324
|
+
|---|---|---|
|
|
325
|
+
| `makeContext<C, T>(cfg)` | function | Panel context factory — see *Concepts* |
|
|
326
|
+
| `useContext<C, T>()` | hook | The current panel context |
|
|
327
|
+
| `render(context, opts?)` | function | Mount `PanelApp` with the language detector; `opts` is `WebRenderOptions` |
|
|
328
|
+
| `WebRenderOptions` | type | `@owlmeans/web-client`'s `RenderOptions` plus `rootClassName` |
|
|
329
|
+
| `PanelApp`, `PanelAppProps` | component, type | Themed root `div`, i18n provider, app and router, overlays |
|
|
330
|
+
| `entrypoints` | const | `@owlmeans/web-client`'s entrypoints plus `@owlmeans/api-config-client`'s |
|
|
331
|
+
| `AppConfig`, `AppContext` | type | Adds `socket?: SocketClientSettings & { reloadDialog? }`, `flow()` and the socket-status append |
|
|
332
|
+
|
|
333
|
+
### Components
|
|
334
|
+
|
|
335
|
+
| Symbol | Kind | Purpose |
|
|
336
|
+
|---|---|---|
|
|
337
|
+
| `NavLayout`, `TopNav`, `SideNav`, `MobileNav`, `Footer`, `ShellCredit` | component | Navigation shell and its pieces, including the narrow-viewport menu sheet and the footer's platform/owner credit |
|
|
338
|
+
| `NavLayoutProps`, `TopNavProps`, `SideNavProps`, `MobileNavProps`, `FooterProps`, `ShellCreditProps` | type | Their props |
|
|
339
|
+
| `useShellCredit` | hook | Resolves the credit `ShellCredit` renders, without rendering it |
|
|
340
|
+
| `Layout`, `LayoutProps` | component, type | Plain content wrapper |
|
|
341
|
+
| `Form`, `WebFormProps` | component, type | Web form; `FormProps` plus `className` / `style` |
|
|
342
|
+
| `TextInput`, `TextInputProps` | component, type | `react-hook-form` controlled input |
|
|
343
|
+
| `Button`, `SubmitButton`, `ButtonProps`, `SubmitProps` | component, type | Action buttons; `SubmitButton` is bound to `handleSubmit` |
|
|
344
|
+
| `ButtonSelector`, `SelectorProps` | component, type | One button per option, the current one `contained` |
|
|
345
|
+
| `Block`, `Text`, `Link`, `Status` | component | Card panel with `Actions`, translated text, entrypoint link, translated `Alert` |
|
|
346
|
+
| `BlockProps`, `TextProps`, `LinkProps`, `StatusProps`, `StyledProps`, `TextVariant` | type | Their props |
|
|
347
|
+
| `ImageUploader`, `ImageUploaderProps` | component, type | Drop target with a `previewUrl` |
|
|
348
|
+
| `Toaster` | component | `sonner` surface themed from app tokens; follows `.dark` on the document element |
|
|
349
|
+
| `ThemeToggle`, `ThemeToggleProps`, `ThemeToggleLabels` | component, type | The light/dark switcher |
|
|
350
|
+
| `useColorScheme()`, `ColorSchemeModel` | hook, type | `{ scheme, choice, setChoice }` — the resolved scheme, the stored choice (`null` = follow the OS), and the setter |
|
|
351
|
+
| `SocketReloadDialog` | component | Blocking reload prompt for `'lost'` sockets |
|
|
352
|
+
| `LoginScreen`, `LocalizedLoginScreen` | component | Identity-provider choice screen; the localized one binds `translate` to the app's resources |
|
|
353
|
+
| `appendLoginScreen(ctx, setup?)`, `LoginScreenSetup` | function, type | Register the screen on the login service, with `Logo` and other `LoginScreenProps` |
|
|
354
|
+
| `LoginTerms`, `LoginCredit`, `LoginMethodIcon` | component | The screen's terms sentence, credit line and method icons |
|
|
355
|
+
| `LoginTermsProps`, `LoginCreditProps` | type | Their props |
|
|
356
|
+
| `scalingToStyles(horizontal?, vertical?)` | function | `BlockScaling` to Tailwind width/height classes |
|
|
357
|
+
| `useBreakPoint()` | hook | The current Tailwind breakpoint name |
|
|
358
|
+
| `useMapBreakpoint(map, def?, breakpoint?)` | hook | The map entry for the current breakpoint; throws `SyntaxError` when nothing matches and no `def` is given |
|
|
359
|
+
|
|
360
|
+
### Re-exports
|
|
361
|
+
|
|
362
|
+
| Symbol | From |
|
|
363
|
+
|---|---|
|
|
364
|
+
| everything (`usePanelNav`, `PanelNavConfig` / `PanelNavItem` / `PanelNavSection` / `PanelNavLink` / `NavTranslate`, `PanelContext`, `BlockScaling`, `useFormRef`, `FormContext`, ...) | `@owlmeans/client-panel` |
|
|
365
|
+
| `handler`, `useNavigate`, `useValue`, `useEntrypoint` | `@owlmeans/client` |
|
|
366
|
+
| `bind`, `bindAll`, `bindScreen`, `provideRequest`, `stab`; type `Module` | `@owlmeans/client-entrypoint` |
|
|
367
|
+
| `route`, `frontend` / `croute` | `@owlmeans/route` / `@owlmeans/client-route` |
|
|
368
|
+
| `config` / `service` / `addWebService` | `@owlmeans/client-context` / `@owlmeans/config` / `@owlmeans/client-config` |
|
|
369
|
+
| `AppType`, `HOME`, `ROOT`, `BASE`, `GUEST` | `@owlmeans/context` |
|
|
370
|
+
| `DISPATCHER`, `CAUTHEN_FLOW_ENTER`; type `AuthToken` | `@owlmeans/auth` |
|
|
371
|
+
| `DAUTH_GUARD` (`DEFAULT_ALIAS`), `bindExternalAuthentication` | `@owlmeans/client-auth` |
|
|
372
|
+
| `Dispatcher`, `appendWebAuthService` | `@owlmeans/web-client` |
|
|
373
|
+
| `composePrefix`, `useI18n`, `useI18nApp`, `useI18nLib`, `useLanguage` | `@owlmeans/client-i18n` |
|
|
374
|
+
| `addI18nApp`, `addI18nLib`, `SUPPORTED_LNGS` | `@owlmeans/i18n` |
|
|
375
|
+
| `flow`, `configureFlows` / `FLOW_PARAM`, `SERVICE_PARAM`, `useFlow` | `@owlmeans/flow` / `@owlmeans/web-flow` |
|
|
376
|
+
|
|
377
|
+
### `@owlmeans/web-panel/auth`
|
|
378
|
+
|
|
379
|
+
The context and screens for an authentication manager app — the identity-provider side, not a
|
|
380
|
+
relying party.
|
|
381
|
+
|
|
382
|
+
| Symbol | Kind | Purpose |
|
|
383
|
+
|---|---|---|
|
|
384
|
+
| `makeContext`, `useContext` | function, hook | Client context with IndexedDB, router, `apiConfigMiddleware` and flow service, without the relying-party auth service |
|
|
385
|
+
| `AppConfig`, `AppContext` | type | With `flow()` |
|
|
386
|
+
| `render` | function | Same as the root `render` |
|
|
387
|
+
| `plugins` | registry | `@owlmeans/client-auth/manager`'s registry with the shadcn renderers assigned |
|
|
388
|
+
| `Ed22519BasicAuthUIPlugin`, `ReCaptchaAuthUIPlugin`, `TunnelConsumerUIPlugin` | component | Those renderers |
|
|
389
|
+
| `AuthenticationHOC`, `AuthenticationType`, `DISPATCHER`, `CAUTHEN`, `EntrypointOutcome`, `RouteMethod`, `FLOW_ALIAS`, type `Navigator` / `AbstractRequest` / `Request` / `ServiceRoute` / `FlowService`, and the `@owlmeans/client-panel/auth` exports | re-export | Authentication-manager vocabulary |
|
|
390
|
+
|
|
391
|
+
`@owlmeans/web-panel/auth/entrypoints` exports `entrypoints`: `@owlmeans/client-auth/manager`'s
|
|
392
|
+
bindings plus `@owlmeans/api-config-client`'s.
|
|
393
|
+
|
|
394
|
+
### `@owlmeans/web-panel/scheme`
|
|
395
|
+
|
|
396
|
+
React-free — it imports nothing, so a Node build script can load it.
|
|
397
|
+
|
|
398
|
+
| Symbol | Kind | Purpose |
|
|
399
|
+
|---|---|---|
|
|
400
|
+
| `COLOR_SCHEME_KEY` | const | `'owlmeans:color-scheme'`, the `localStorage` key |
|
|
401
|
+
| `COLOR_SCHEME_EVENT` | const | The `window` event every change dispatches |
|
|
402
|
+
| `ColorSchemeChoice` | type | `'light' \| 'dark'` |
|
|
403
|
+
| `readColorScheme()` | function | The stored choice or `null` (storage errors swallowed) |
|
|
404
|
+
| `applyColorScheme(choice \| null)` | function | Sets the `light`/`dark` class on `<html>`, stores or clears the key, dispatches the event |
|
|
405
|
+
| `colorSchemeBootstrapScript()` | function | The inline head script that applies a stored choice before first paint |
|
|
406
|
+
|
|
407
|
+
The class contract: `.dark` = chosen dark, `.light` = chosen light, neither = follow the OS. A
|
|
408
|
+
consumer's CSS puts dark tokens under `.dark` AND under
|
|
409
|
+
`@media (prefers-color-scheme: dark) { :root:not(.light) { … } }`, and inlines
|
|
410
|
+
`colorSchemeBootstrapScript()` in the document head.
|
|
411
|
+
|
|
412
|
+
### `@owlmeans/web-panel/consent`
|
|
413
|
+
|
|
414
|
+
| Symbol | Kind | Purpose |
|
|
415
|
+
|---|---|---|
|
|
416
|
+
| `PanelCookieConsent`, `PanelCookiePolicy` | component | `@owlmeans/web-consent` components bound to the app's language and translations |
|
|
417
|
+
| `PanelConsentMenuWidget` | component | The cookie-preferences control for a host menu or footer ("Cookie settings" — pass `label` and `className`) |
|
|
418
|
+
| `appendConsentWidgetService(ctx, alias?)`, `createConsentWidgetService` | function | Ref-counted presence service over a state resource |
|
|
419
|
+
| `useConsentMenuPresence()`, `useConsentWidgetPresent()` | hook | Declare that a menu shows the row; read whether one does (hides the floating button) |
|
|
420
|
+
| `CONSENT_WIDGET_SERVICE`, `CONSENT_WIDGET_STATE` | const | Service alias and state alias |
|
|
421
|
+
| `ConsentWidgetPresenceRecord`, `ConsentWidgetService`, `ConsentWidgetServiceAppend` | type | Service types |
|
|
422
|
+
| `useConsent`, `useConsentCategory`, `consentStore`, `openConsent`, `isConsented`, `readConsent`, `writeConsent`, `clearConsent`, `consentBootstrapScript`, `DEFAULT_CONSENT_CATEGORIES`, `CONSENT_KEY`, `CONSENT_ESSENTIAL`, `CONSENT_ANALYTICS`, `CONSENT_MARKETING` and the consent types | re-export | `@owlmeans/web-consent` |
|
|
423
|
+
|
|
424
|
+
### Differences from `@owlmeans/mui-panel`
|
|
425
|
+
|
|
426
|
+
The public names match the MUI implementation; these props and types differ:
|
|
427
|
+
|
|
428
|
+
- **`styles?: SxProps` is removed.** Use `className?: string` and `style?: React.CSSProperties`
|
|
429
|
+
(`BlockProps`, `TextProps`, `LinkProps`, `WebFormProps`, `LayoutProps`).
|
|
430
|
+
- **`variant` on `Text` / `Link` is `TextVariant`**: `'h1' | 'h2' | 'h3' | 'h4' | 'p' | 'lead' |
|
|
431
|
+
'large' | 'small' | 'muted' | 'blockquote'`.
|
|
432
|
+
- **`PanelAppProps.theme?: Theme` is replaced with `rootClassName?: string`.** Apply the theme
|
|
433
|
+
through Tailwind classes and CSS variables.
|
|
434
|
+
- **`render(context, theme?, opts?)` is now `render(context, opts?)`**, where `opts` includes
|
|
435
|
+
`rootClassName`.
|
|
436
|
+
- **`scalingToStyles()` returns a class-name string** composable with other classes, not an
|
|
437
|
+
`SxProps`; its `theme` parameter is gone.
|
|
438
|
+
- **`useBreakPoint` / `useMapBreakpoint` use Tailwind's default breakpoints**
|
|
439
|
+
(`xs/sm/md/lg/xl`) instead of MUI's `Theme.breakpoints`.
|
|
440
|
+
- **Button props stay compatible** (`'small' | 'medium' | 'large'`, `contained` / `outlined` /
|
|
441
|
+
`text` or shadcn variant names).
|
|
442
|
+
|
|
443
|
+
## Common pitfalls
|
|
444
|
+
|
|
445
|
+
- **Add the `@source` line** for this package's `src` (and for `@owlmeans/web-consent` when using
|
|
446
|
+
`./consent`). Without it the navigation shell renders unstyled.
|
|
447
|
+
- **A parent frontend route needs a `default: true` child.** A grouping screen with children but no
|
|
448
|
+
default child renders blank at its own path.
|
|
449
|
+
- **Menu and login labels need a `translate` prop to be localized.** The components never read the
|
|
450
|
+
i18n context implicitly, so without the prop they show literal labels or humanized aliases.
|
|
451
|
+
- **Mount `Toaster` exactly once, in the layout.** Two surfaces render every toast twice. An app
|
|
452
|
+
raising its own toasts declares `sonner` at a range that resolves to the same copy.
|
|
453
|
+
- **Mount dialogs beside the router** (`PanelApp` children or the web-client overlay slot), never
|
|
454
|
+
inside a route.
|
|
455
|
+
- **Give a dark top bar both halves through `headerClassName`** (`bg-secondary
|
|
456
|
+
text-secondary-foreground`). The header is its own surface; colouring only the root leaves its
|
|
457
|
+
menu unreadable.
|
|
458
|
+
- **Name only the utility you want to move in `containerClassName`.** It merges over
|
|
459
|
+
`mx-auto w-full max-w-6xl px-4`, so `max-w-[1280px]` changes only the width.
|
|
460
|
+
- **`Link` resolves its `href` asynchronously.** Never key a test or layout on the anchor having an
|
|
461
|
+
`href` at first paint.
|
|
462
|
+
- **`reloadDialog` is off by default.** The dialog renders nothing unless `cfg.socket.reloadDialog`
|
|
463
|
+
is `true`.
|
|
464
|
+
- **Run `useConsentMenuPresence()` from the menu's always-mounted component**, never from inside a
|
|
465
|
+
dropdown row, which mounts only while the menu is open. Without `appendConsentWidgetService` it
|
|
466
|
+
does nothing and `PanelCookieConsent` keeps its floating button.
|
|
467
|
+
- **Pass an application footer layout as a node `footer`.** It renders full-width above the credit;
|
|
468
|
+
an array renders the centred link row. Neither removes the credit.
|
|
469
|
+
- **A theme for `ThemeToggle` reads both classes.** Dark tokens under `.dark` only never follow
|
|
470
|
+
the OS; under the media query only, they ignore an explicit light choice. Inline the head
|
|
471
|
+
bootstrap or a stored dark choice flashes light for a frame.
|
|
472
|
+
- **The shell already renders the skip link and `<main id="main">`.** A screen never renders a
|
|
473
|
+
second `<main>` or `#main`; an app with its own skip link passes `skipLinkLabel={false}`.
|
|
474
|
+
- **`mobileMenu` is opt-in.** Without it a narrow viewport keeps the section menu and the screen
|
|
475
|
+
strip; with it both move into the sheet.
|
|
476
|
+
- **Never import `@/…` from package code or vendor its primitives in the app.** The `@` alias
|
|
477
|
+
belongs to the consumer.
|
|
478
|
+
- **Every override of a packaged string covers all seven languages** (`SUPPORTED_LNGS`).
|
|
479
|
+
|
|
116
480
|
## Related packages
|
|
117
481
|
|
|
118
|
-
- [`@owlmeans/
|
|
119
|
-
|
|
120
|
-
- [`@owlmeans/
|
|
121
|
-
|
|
122
|
-
- [`@owlmeans/
|
|
123
|
-
|
|
482
|
+
- [`@owlmeans/web-client`](../web-client) — the web context and mount helpers this package builds on
|
|
483
|
+
- [`@owlmeans/client-panel`](../client-panel) — headless form, layout, navigation and login models
|
|
484
|
+
- [`@owlmeans/client-auth`](../client-auth) — auth service, login hooks and plugin registry
|
|
485
|
+
- [`@owlmeans/client-socket`](../client-socket) — `useSocketStatus` behind the reload prompt
|
|
486
|
+
- [`@owlmeans/web-consent`](../web-consent) — cookie consent components behind `./consent`
|
|
487
|
+
- [`@owlmeans/web-oidc-rp`](../web-oidc-rp) — OIDC relying party UI on the same Tailwind theme
|
|
488
|
+
- [`@owlmeans/web-router`](../web-router) — default OwlMeans routing plugin
|
|
489
|
+
- [`@owlmeans/mui-panel`](../mui-panel) — legacy Material UI implementation of the same surface
|
|
124
490
|
|
|
125
491
|
<!-- owlmeans:agent-guidance:start -->
|
|
126
492
|
## Agent guidance
|
|
@@ -130,7 +496,7 @@ This package ships embedded agent skills under `agent-meta/`. After installing y
|
|
|
130
496
|
your project's skill store (`.agents/skills/`):
|
|
131
497
|
|
|
132
498
|
```sh
|
|
133
|
-
npx @owlmeans/agent-skills
|
|
499
|
+
npx @owlmeans/agent-skills@^0.1.18-rc.38
|
|
134
500
|
```
|
|
135
501
|
|
|
136
502
|
The embedded files are version-matched to this package release. Do not edit them
|
package/agent-meta/manifest.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 2,
|
|
3
3
|
"package": "@owlmeans/web-panel",
|
|
4
|
-
"version": "0.1.18-rc.
|
|
5
|
-
"generatedAt": "2026-
|
|
4
|
+
"version": "0.1.18-rc.60",
|
|
5
|
+
"generatedAt": "2026-09-23T19:57:40.709Z",
|
|
6
6
|
"canonicalRepo": "https://github.com/owlmeans/common",
|
|
7
7
|
"entries": [
|
|
8
8
|
{
|