@monkey-mini-app/panel 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +46 -0
  2. package/package.json +1 -1
package/README.md ADDED
@@ -0,0 +1,46 @@
1
+ # @monkey-mini-app/panel
2
+
3
+ Pure React panel UI (the `PanelHost` seam). It renders the shell you see around a mini-app
4
+ —— the app list, settings, theme pop, tab bar. It talks to a host **over HTTP/frame**, so
5
+ it bundles no server and must not depend on `host` or `dsh`.
6
+
7
+ ## Mount
8
+
9
+ ```tsx
10
+ import { createMiniAppPanel, createRestPanelHost } from "@monkey-mini-app/panel";
11
+
12
+ const panel = createMiniAppPanel(createRestPanelHost({ baseUrl, ... }), { ... });
13
+ // panel.mount(el) / panel.unmount()
14
+ ```
15
+
16
+ `createMiniAppPanel(host: PanelHost, options?)` returns a `PanelInstance`. `PanelProvider`
17
+ supplies `usePanelActions` / `usePanelI18n` for the state + i18n context. For a REST
18
+ backend, build the host with `createRestPanelHost` (`RestOptions`) which drives the host's
19
+ `HttpGateway`.
20
+
21
+ ## Seams
22
+
23
+ | Export | Role |
24
+ |--------|------|
25
+ | `PanelHost` / `capabilitiesOf` | The panel adapter seam (fetchApps / persistTheme / frame …) |
26
+ | `createRestPanelHost` / `RestOptions` | REST client that drives `HttpGateway` |
27
+ | `createFrameController` / `FrameController` | iframe ↔ host frame bridge |
28
+ | `createHostShell` / `HostShellInstance` | host wiring for the panel |
29
+ | `createMiniAppPanel` / `MiniAppPanel` | The top-level panel component / mount |
30
+
31
+ ## State & theme
32
+
33
+ - `usePanelState` / `getPanelState` / `setPanelState` / `subscribePanel` — shared store.
34
+ - `themes.ts` — `cssVars`, `PALETTES`, `tokensOf`, `applyThemeTo`, `runnerThemeCss`,
35
+ `parseThemeCss`, `*Theme*` helpers.
36
+ - `styles.ts` — `injectPanelCss` / `PANEL_CSS_TAG` (inject the panel CSS without a file).
37
+
38
+ ## Errors
39
+
40
+ `HostUnreachableError` — thrown by the REST host when the host socket is unreachable; the
41
+ panel renders a browser-actionable message instead of a blank screen.
42
+
43
+ ## Constraints
44
+
45
+ - Pure React: no `/api`, no `host`/`dsh` dependency (import direction enforced by eslint).
46
+ - Theme/CSS helpers are self-contained so the panel can be dropped into any host.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monkey-mini-app/panel",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",