@tooee/panels 0.10.1 → 0.10.2
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 +34 -66
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js.map +1 -1
- package/dist/hooks.d.ts.map +1 -1
- package/dist/hooks.js.map +1 -1
- package/dist/panel-group.d.ts.map +1 -1
- package/dist/panel-group.js +1 -1
- package/dist/panel-group.js.map +1 -1
- package/dist/panel.d.ts.map +1 -1
- package/dist/panel.js +1 -1
- package/dist/panel.js.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +11 -11
- package/src/context.ts +1 -1
- package/src/hooks.ts +3 -2
- package/src/panel-group.tsx +10 -9
- package/src/panel.tsx +4 -3
- package/src/types.ts +1 -1
package/README.md
CHANGED
|
@@ -1,27 +1,16 @@
|
|
|
1
1
|
# @tooee/panels
|
|
2
2
|
|
|
3
|
-
First-class panels for Tooee: multiple visible regions with exactly one active,
|
|
4
|
-
each owning its commands, local mode, and optional chrome.
|
|
3
|
+
First-class panels for Tooee: multiple visible regions with exactly one active, each owning its commands, local mode, and optional chrome.
|
|
5
4
|
|
|
6
5
|
Part of the [Tooee](https://github.com/gingerhendrix/tooee) monorepo. See the main repo for documentation.
|
|
7
6
|
|
|
8
7
|
## Model
|
|
9
8
|
|
|
10
|
-
A `PanelGroup` holds peer `Panel`s among which exactly one is active. The active
|
|
11
|
-
panel owns keyboard input — only its `useCommand`/`useMode` children dispatch —
|
|
12
|
-
and shows the active chrome. Panels stay mounted across switches, so local state,
|
|
13
|
-
panel-local router stacks, and per-panel mode persist. A topmost modal overlay
|
|
14
|
-
still suspends the whole group and returns input to the same panel on close.
|
|
9
|
+
A `PanelGroup` holds peer `Panel`s among which exactly one is active. The active panel owns keyboard input — only its `useCommand`/`useMode` children dispatch — and shows the active chrome. Panels stay mounted across switches, so local state, panel-local router stacks, and per-panel mode persist. A topmost modal overlay still suspends the whole group and returns input to the same panel on close.
|
|
15
10
|
|
|
16
|
-
Panels build on `@tooee/commands`' `"panel"` surface role: the active panel's
|
|
17
|
-
commands dispatch, and keys it does not handle **fall through** to the enclosing
|
|
18
|
-
surface in cursor/select mode, with a panel command **shadowing** a root command
|
|
19
|
-
of the same hotkey while active. Insert-mode panels do not fall through: typed
|
|
20
|
-
characters and Tab stay with the focused editor/input. See the
|
|
21
|
-
[`@tooee/commands` arbitration docs](../commands/README.md#command-surfaces--arbitration).
|
|
11
|
+
Panels build on `@tooee/commands`' `"panel"` surface role: the active panel's commands dispatch, and keys it does not handle **fall through** to the enclosing surface in cursor/select mode, with a panel command **shadowing** a root command of the same hotkey while active. Insert-mode panels do not fall through: typed characters and Tab stay with the focused editor/input. See the [`@tooee/commands` arbitration docs](../commands/README.md#command-surfaces--arbitration).
|
|
22
12
|
|
|
23
|
-
The app supplies layout (flex rows/columns); panels manage activation, command
|
|
24
|
-
ownership, and chrome around it — not resizing or splitting.
|
|
13
|
+
The app supplies layout (flex rows/columns); panels manage activation, command ownership, and chrome around it — not resizing or splitting.
|
|
25
14
|
|
|
26
15
|
## Examples
|
|
27
16
|
|
|
@@ -49,59 +38,42 @@ bun examples/panels-custom-chrome.tsx
|
|
|
49
38
|
bun examples/panels-disabled.tsx
|
|
50
39
|
```
|
|
51
40
|
|
|
52
|
-
- [`panels.tsx`](../../examples/panels.tsx) — complete composition with
|
|
53
|
-
|
|
54
|
-
- [`panels-
|
|
55
|
-
|
|
56
|
-
- [`panels-custom-chrome.tsx`](../../examples/panels-custom-chrome.tsx) —
|
|
57
|
-
`chrome="none"`, app-defined active cues, click activation, and
|
|
58
|
-
`usePanelState()`.
|
|
59
|
-
- [`panels-disabled.tsx`](../../examples/panels-disabled.tsx) — a disabled panel,
|
|
60
|
-
`switchKeys={null}`, and app-owned previous/next commands that skip it.
|
|
41
|
+
- [`panels.tsx`](../../examples/panels.tsx) — complete composition with panel-owned commands, a panel-local router, and a suspending modal.
|
|
42
|
+
- [`panels-controlled.tsx`](../../examples/panels-controlled.tsx) — controlled activation, direct selection, and group state through `usePanels()`.
|
|
43
|
+
- [`panels-custom-chrome.tsx`](../../examples/panels-custom-chrome.tsx) — `chrome="none"`, app-defined active cues, click activation, and `usePanelState()`.
|
|
44
|
+
- [`panels-disabled.tsx`](../../examples/panels-disabled.tsx) — a disabled panel, `switchKeys={null}`, and app-owned previous/next commands that skip it.
|
|
61
45
|
|
|
62
46
|
## `PanelGroup`
|
|
63
47
|
|
|
64
|
-
Renders no box of its own. Owns activation (controlled or uncontrolled), Tab
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
|
68
|
-
|
|
|
69
|
-
| `
|
|
70
|
-
| `
|
|
71
|
-
| `
|
|
72
|
-
| `
|
|
73
|
-
| `
|
|
74
|
-
| `
|
|
75
|
-
| `
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
the effective palette, so sibling and nested groups cannot overwrite one
|
|
81
|
-
another. Their stable ids remain remappable through `keymap`.
|
|
82
|
-
|
|
83
|
-
Activation repair: when the active panel unmounts or becomes `disabled`, the
|
|
84
|
-
next activatable panel (else the previous, else none) takes over. A controlled
|
|
85
|
-
group is never repaired — a missing/disabled controlled id activates no panel.
|
|
86
|
-
In uncontrolled groups, `onActivePanelChange` reports the initial resolved panel,
|
|
87
|
-
explicit activation, switching, and repair. In controlled groups it reports a
|
|
88
|
-
valid activation request but does not echo prop changes. The callback remains a
|
|
89
|
-
non-null API: empty groups and transitions to no active panel do not emit it;
|
|
90
|
-
read `usePanels().activePanelId` to observe `null`.
|
|
48
|
+
Renders no box of its own. Owns activation (controlled or uncontrolled), Tab cycle order (source order), activation repair, and the switch commands.
|
|
49
|
+
|
|
50
|
+
| Prop | Default | Meaning |
|
|
51
|
+
| --- | --- | --- |
|
|
52
|
+
| `id` | generated | Stable group id (fine to omit for a single group). |
|
|
53
|
+
| `defaultActivePanelId` | first panel | Uncontrolled initial active panel. |
|
|
54
|
+
| `activePanelId` | — | Controlled active panel; `null` explicitly selects none. |
|
|
55
|
+
| `onActivePanelChange` | — | Uncontrolled resolved changes, or controlled activation requests (non-null). |
|
|
56
|
+
| `switchKeys` | `{ next: "tab", previous: "shift+tab" }` | Switch hotkeys; `null` disables built-in switching. |
|
|
57
|
+
| `switchModes` | `["cursor", "select"]` | Modes in which the switch keys are live (so insert-mode `Tab` reaches editors). |
|
|
58
|
+
| `wrap` | `true` | Wrap from last to first. |
|
|
59
|
+
| `activateOnMouseDown` | `true` | Activate a panel on mouse-down (default chrome only). |
|
|
60
|
+
|
|
61
|
+
The `panels.next` / `panels.previous` switch commands register on every panel's local command surface. Only the active panel's pair can dispatch or appear in the effective palette, so sibling and nested groups cannot overwrite one another. Their stable ids remain remappable through `keymap`.
|
|
62
|
+
|
|
63
|
+
Activation repair: when the active panel unmounts or becomes `disabled`, the next activatable panel (else the previous, else none) takes over. A controlled group is never repaired — a missing/disabled controlled id activates no panel. In uncontrolled groups, `onActivePanelChange` reports the initial resolved panel, explicit activation, switching, and repair. In controlled groups it reports a valid activation request but does not echo prop changes. The callback remains a non-null API: empty groups and transitions to no active panel do not emit it; read `usePanels().activePanelId` to observe `null`.
|
|
91
64
|
|
|
92
65
|
## `Panel`
|
|
93
66
|
|
|
94
|
-
| Prop
|
|
95
|
-
|
|
|
96
|
-
| `id`
|
|
97
|
-
| `title`
|
|
98
|
-
| `disabled`
|
|
99
|
-
| `initialMode` | `"cursor"` | Initial local mode.
|
|
100
|
-
| `chrome`
|
|
101
|
-
| `style`
|
|
67
|
+
| Prop | Default | Meaning |
|
|
68
|
+
| --- | --- | --- |
|
|
69
|
+
| `id` | — | Stable id; also the panel's command-surface id. |
|
|
70
|
+
| `title` | — | Chrome title (rendered with a `▸` marker + `borderActive` when active); not a palette/which-key heading. |
|
|
71
|
+
| `disabled` | `false` | Excluded from activation/switching; renders disabled chrome, stays mounted. |
|
|
72
|
+
| `initialMode` | `"cursor"` | Initial local mode. |
|
|
73
|
+
| `chrome` | `"border"` | `"border"` renders a themed box; `"none"` renders no chrome (the app draws its own from `usePanelState()`). |
|
|
74
|
+
| `style` | — | Layout props forwarded to the chrome box. |
|
|
102
75
|
|
|
103
|
-
Chrome uses existing theme tokens only (`borderActive` / `border` / `borderSubtle`,
|
|
104
|
-
`textMuted`, `backgroundPanel`) — no new theme keys.
|
|
76
|
+
Chrome uses existing theme tokens only (`borderActive` / `border` / `borderSubtle`, `textMuted`, `backgroundPanel`) — no new theme keys.
|
|
105
77
|
|
|
106
78
|
## Hooks
|
|
107
79
|
|
|
@@ -111,8 +83,4 @@ Chrome uses existing theme tokens only (`borderActive` / `border` / `borderSubtl
|
|
|
111
83
|
|
|
112
84
|
## Router composition
|
|
113
85
|
|
|
114
|
-
Panels do not depend on `@tooee/router`. A router mounted **inside** a panel is
|
|
115
|
-
navigated independently and keeps its stack across switches; effects on a leaf
|
|
116
|
-
inside an inactive panel pause (screen focus is the enclosing panel's activity
|
|
117
|
-
ANDed with the route-chain leaf). A router **outside** the group replaces the
|
|
118
|
-
whole panel composition on navigation.
|
|
86
|
+
Panels do not depend on `@tooee/router`. A router mounted **inside** a panel is navigated independently and keeps its stack across switches; effects on a leaf inside an inactive panel pause (screen focus is the enclosing panel's activity ANDed with the route-chain leaf). A router **outside** the group replaces the whole panel composition on navigation.
|
package/dist/context.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAG5C;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,qFAAqF;IACrF,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,+DAA+D;IAC/D,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,sDAAsD;IACtD,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,4EAA4E;IAC5E,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,+CAA+C;IAC/C,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,oFAAoF;IACpF,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,IAAI,CAAC;IAC1C,wDAAwD;IACxD,WAAW,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAC1D,0EAA0E;IAC1E,mBAAmB,EAAE,OAAO,CAAC;IAC7B,wFAAwF;IACxF,aAAa,EAAE,OAAO,CAAC;IACvB,kCAAkC;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,sCAAsC;IACtC,cAAc,EAAE,MAAM,CAAC;IACvB,kEAAkE;IAClE,WAAW,EAAE,IAAI,EAAE,CAAC;CACrB;AAED,eAAO,MAAM,iBAAiB,wDAAqD,CAAC;AAEpF,eAAO,MAAM,oBAAoB,QAAoC,sBAMpE,CAAC;AAEF,eAAO,MAAM,4BAA4B,QACE,sBAAsB,GAAG,IAEjE,CAAC;AAEJ,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,YAAY,mDAAgD,CAAC;AAE1E,eAAO,MAAM,uBAAuB,QACE,iBAAiB,GAAG,IAEvD,CAAC"}
|
package/dist/context.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAmClD,MAAM,CAAC,MAAM,iBAAiB,GAAG,aAAa,CAAgC,IAAI,CAAC,CAAC;AAEpF,MAAM,CAAC,MAAM,oBAAoB,GAAG,SAAS,oBAAoB;IAC/D,MAAM,GAAG,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAC;IAC1C,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAC;IAC3E,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,4BAA4B,GACvC,SAAS,4BAA4B;IACnC,OAAO,UAAU,CAAC,iBAAiB,CAAC,CAAC;AACvC,CAAC,CAAC;AAQJ,MAAM,CAAC,MAAM,YAAY,GAAG,aAAa,CAA2B,IAAI,CAAC,CAAC;AAE1E,MAAM,CAAC,MAAM,uBAAuB,GAClC,SAAS,uBAAuB;IAC9B,OAAO,UAAU,CAAC,YAAY,CAAC,CAAC;AAClC,CAAC,CAAC"}
|
package/dist/hooks.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../src/hooks.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../src/hooks.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mEAAmE;IACnE,QAAQ,EAAE,OAAO,CAAC;IAClB,2BAA2B;IAC3B,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,8CAA8C;AAC9C,eAAO,MAAM,aAAa,QAA6B,UAoBtD,CAAC;AAEF,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,2EAA2E;AAC3E,eAAO,MAAM,SAAS,QAAyB,cAO9C,CAAC;AAEF,4FAA4F;AAC5F,eAAO,MAAM,cAAc,QAA8B,OAOxD,CAAC"}
|
package/dist/hooks.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../src/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../src/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,EAAE,YAAY,EAAE,4BAA4B,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAWhG,8CAA8C;AAC9C,MAAM,CAAC,MAAM,aAAa,GAAG,SAAS,aAAa;IACjD,MAAM,KAAK,GAAG,UAAU,CAAC,YAAY,CAAC,CAAC;IACvC,MAAM,KAAK,GAAG,oBAAoB,EAAE,CAAC;IACrC,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;IAC/D,CAAC;IACD,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,KAAK,KAAK,CAAC,EAAE,CAAC;IAC7C,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAC3B,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IAC5B,OAAO,OAAO,CACZ,GAAG,EAAE,CAAC,CAAC;QACL,QAAQ,EAAE,GAAG,EAAE;YACb,QAAQ,CAAC,EAAE,CAAC,CAAC;QACf,CAAC;QACD,EAAE;QACF,QAAQ;QACR,KAAK;KACN,CAAC,EACF,CAAC,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,QAAQ,CAAC,CAChC,CAAC;AACJ,CAAC,CAAC;AAUF,2EAA2E;AAC3E,MAAM,CAAC,MAAM,SAAS,GAAG,SAAS,SAAS;IACzC,MAAM,KAAK,GAAG,oBAAoB,EAAE,CAAC;IACrC,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAC/D,OAAO,OAAO,CACZ,GAAG,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,EACvE,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,CAAC,CAC/C,CAAC;AACJ,CAAC,CAAC;AAEF,4FAA4F;AAC5F,MAAM,CAAC,MAAM,cAAc,GAAG,SAAS,cAAc;IACnD,MAAM,KAAK,GAAG,UAAU,CAAC,YAAY,CAAC,CAAC;IACvC,MAAM,KAAK,GAAG,4BAA4B,EAAE,CAAC;IAC7C,IAAI,CAAC,KAAK,IAAI,CAAC,KAAK,EAAE,CAAC;QACrB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,KAAK,CAAC,QAAQ,KAAK,KAAK,CAAC,EAAE,CAAC;AACrC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"panel-group.d.ts","sourceRoot":"","sources":["../src/panel-group.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"panel-group.d.ts","sourceRoot":"","sources":["../src/panel-group.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAQvC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAWlD;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,oIAUpB,eAAe,KAAG,SAiNpB,CAAC"}
|
package/dist/panel-group.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "@opentui/react/jsx-runtime";
|
|
2
|
-
import { useCallback, useEffect, useId, useMemo, useRef, useState } from "react";
|
|
3
2
|
import { useCommandStore } from "@tooee/commands";
|
|
3
|
+
import { useCallback, useEffect, useId, useMemo, useRef, useState } from "react";
|
|
4
4
|
import { PanelGroupContext, useOptionalPanelContext, useOptionalPanelGroupContext, } from "./context.js";
|
|
5
5
|
const DEFAULT_SWITCH_MODES = ["cursor", "select"];
|
|
6
6
|
/**
|
package/dist/panel-group.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"panel-group.js","sourceRoot":"","sources":["../src/panel-group.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"panel-group.js","sourceRoot":"","sources":["../src/panel-group.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGjF,OAAO,EACL,iBAAiB,EACjB,uBAAuB,EACvB,4BAA4B,GAC7B,MAAM,cAAc,CAAC;AAWtB,MAAM,oBAAoB,GAA0C,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;AAEzF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,SAAS,UAAU,CAAC,EAC5C,EAAE,EACF,oBAAoB,EACpB,aAAa,EACb,mBAAmB,EACnB,UAAU,EACV,WAAW,EACX,IAAI,EACJ,mBAAmB,EACnB,QAAQ,GACQ;IAChB,MAAM,WAAW,GAAG,KAAK,EAAE,CAAC;IAC5B,MAAM,OAAO,GAAG,EAAE,IAAI,WAAW,CAAC;IAClC,MAAM,YAAY,GAAG,eAAe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"}
|
package/dist/panel.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"panel.d.ts","sourceRoot":"","sources":["../src/panel.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"panel.d.ts","sourceRoot":"","sources":["../src/panel.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AA0B7C;;;;;;GAMG;AACH,eAAO,MAAM,KAAK,mEAQf,UAAU,KAAG,SAoEf,CAAC"}
|
package/dist/panel.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "@opentui/react/jsx-runtime";
|
|
2
|
-
import { useCallback, useEffect, useMemo } from "react";
|
|
3
2
|
import { CommandSurfaceProvider, ScreenScopeProvider, useCommand } from "@tooee/commands";
|
|
4
3
|
import { useTheme } from "@tooee/themes";
|
|
4
|
+
import { useCallback, useEffect, useMemo } from "react";
|
|
5
5
|
import { PanelContext, usePanelGroupContext } from "./context.js";
|
|
6
6
|
const PanelSwitchCommands = function PanelSwitchCommands({ group, }) {
|
|
7
7
|
useCommand({
|
package/dist/panel.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"panel.js","sourceRoot":"","sources":["../src/panel.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"panel.js","sourceRoot":"","sources":["../src/panel.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC1F,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAGxD,OAAO,EAAE,YAAY,EAAE,oBAAoB,EA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,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC;IACnE,IAAI,YAAgC,CAAC;IACrC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,YAAY,GAAG,QAAQ,CAAC,CAAC,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;IACjD,CAAC;IACD,MAAM,sBAAsB,GAAG,KAAK,CAAC,mBAAmB,IAAI,CAAC,aAAa,CAAC;IAE3E,OAAO,CACL,cACE,MAAM,QACN,WAAW,EAAE,WAAW,EACxB,KAAK,EAAE,YAAY,EACnB,UAAU,EAAE,UAAU,EACtB,eAAe,EAAE,KAAK,CAAC,eAAe,EACtC,WAAW,EAAE,sBAAsB,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,EAC1D,KAAK,EAAE,KAAK,YAEX,KAAK,GACF,CACP,CAAC;AACJ,CAAC,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
2
1
|
import type { BoxProps } from "@opentui/react";
|
|
3
2
|
import type { Mode } from "@tooee/commands";
|
|
3
|
+
import type { ReactNode } from "react";
|
|
4
4
|
/** Switch shortcuts for a panel group. Set the whole prop to `null` to disable built-in switching. */
|
|
5
5
|
export interface PanelSwitchKeys {
|
|
6
6
|
/** Hotkey for "next panel" (default `"tab"`). */
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,EAAE,SAAS,EAA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"description": "First-class panels (peer command surfaces with activation and chrome) for Tooee",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -38,21 +38,21 @@
|
|
|
38
38
|
"typecheck": "tsc --noEmit"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@tooee/commands": "0.10.
|
|
42
|
-
"@tooee/themes": "0.10.
|
|
41
|
+
"@tooee/commands": "0.10.2",
|
|
42
|
+
"@tooee/themes": "0.10.2"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@opentui/core": "^0.5.
|
|
46
|
-
"@opentui/react": "^0.5.
|
|
47
|
-
"@tooee/router": "0.10.
|
|
45
|
+
"@opentui/core": "^0.5.12",
|
|
46
|
+
"@opentui/react": "^0.5.12",
|
|
47
|
+
"@tooee/router": "0.10.2",
|
|
48
48
|
"@tooee/test-support": "0.7.3",
|
|
49
|
-
"@types/bun": "^1.
|
|
50
|
-
"@types/react": "^19.
|
|
51
|
-
"typescript": "^
|
|
49
|
+
"@types/bun": "^1.4.2",
|
|
50
|
+
"@types/react": "^19.3.0",
|
|
51
|
+
"typescript": "^7.0.2"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
|
-
"@opentui/core": "^0.5.
|
|
55
|
-
"@opentui/react": "^0.5.
|
|
54
|
+
"@opentui/core": "^0.5.12",
|
|
55
|
+
"@opentui/react": "^0.5.12",
|
|
56
56
|
"react": "^18.0.0 || ^19.0.0"
|
|
57
57
|
}
|
|
58
58
|
}
|
package/src/context.ts
CHANGED
package/src/hooks.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useContext, useMemo } from "react";
|
|
2
|
+
|
|
2
3
|
import { PanelContext, useOptionalPanelGroupContext, usePanelGroupContext } from "./context.js";
|
|
3
4
|
|
|
4
5
|
export interface PanelState {
|
|
@@ -29,7 +30,7 @@ export const usePanelState = function usePanelState(): PanelState {
|
|
|
29
30
|
isActive,
|
|
30
31
|
title,
|
|
31
32
|
}),
|
|
32
|
-
[activate, id, title, isActive]
|
|
33
|
+
[activate, id, title, isActive]
|
|
33
34
|
);
|
|
34
35
|
};
|
|
35
36
|
|
|
@@ -47,7 +48,7 @@ export const usePanels = function usePanels(): PanelsControls {
|
|
|
47
48
|
const { panelIds, activeId, activate, next, previous } = group;
|
|
48
49
|
return useMemo<PanelsControls>(
|
|
49
50
|
() => ({ activate, activePanelId: activeId, next, panelIds, previous }),
|
|
50
|
-
[panelIds, activeId, activate, next, previous]
|
|
51
|
+
[panelIds, activeId, activate, next, previous]
|
|
51
52
|
);
|
|
52
53
|
};
|
|
53
54
|
|
package/src/panel-group.tsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { useCommandStore } from "@tooee/commands";
|
|
1
2
|
import { useCallback, useEffect, useId, useMemo, useRef, useState } from "react";
|
|
2
3
|
import type { ReactNode } from "react";
|
|
3
|
-
|
|
4
|
+
|
|
4
5
|
import {
|
|
5
6
|
PanelGroupContext,
|
|
6
7
|
useOptionalPanelContext,
|
|
@@ -50,7 +51,7 @@ export const PanelGroup = function PanelGroup({
|
|
|
50
51
|
const [registrations, setRegistrations] = useState<readonly Registration[]>([]);
|
|
51
52
|
const orderCounterRef = useRef(0);
|
|
52
53
|
const [uncontrolledActive, setUncontrolledActive] = useState<string | null>(
|
|
53
|
-
defaultActivePanelId ?? null
|
|
54
|
+
defaultActivePanelId ?? null
|
|
54
55
|
);
|
|
55
56
|
// Order of the last resolved active panel, so removal repair can pick the
|
|
56
57
|
// next-in-order (else previous) panel rather than always jumping to the first.
|
|
@@ -62,7 +63,7 @@ export const PanelGroup = function PanelGroup({
|
|
|
62
63
|
setRegistrations((prev) =>
|
|
63
64
|
prev.some((entry) => entry.id === panelId)
|
|
64
65
|
? prev
|
|
65
|
-
: [...prev, { disabled: false, id: panelId, order }]
|
|
66
|
+
: [...prev, { disabled: false, id: panelId, order }]
|
|
66
67
|
);
|
|
67
68
|
return () => {
|
|
68
69
|
setRegistrations((prev) => prev.filter((entry) => entry.id !== panelId));
|
|
@@ -83,7 +84,7 @@ export const PanelGroup = function PanelGroup({
|
|
|
83
84
|
|
|
84
85
|
const activatable = useMemo(
|
|
85
86
|
() => registrations.filter((entry) => !entry.disabled).toSorted((a, b) => a.order - b.order),
|
|
86
|
-
[registrations]
|
|
87
|
+
[registrations]
|
|
87
88
|
);
|
|
88
89
|
|
|
89
90
|
const requestedId = isControlled ? (activePanelId ?? null) : uncontrolledActive;
|
|
@@ -158,7 +159,7 @@ export const PanelGroup = function PanelGroup({
|
|
|
158
159
|
() => () => {
|
|
159
160
|
commandStore.removePanelGroup(groupId);
|
|
160
161
|
},
|
|
161
|
-
[commandStore, groupId]
|
|
162
|
+
[commandStore, groupId]
|
|
162
163
|
);
|
|
163
164
|
|
|
164
165
|
const activate = useCallback(
|
|
@@ -172,7 +173,7 @@ export const PanelGroup = function PanelGroup({
|
|
|
172
173
|
setUncontrolledActive(panelId);
|
|
173
174
|
}
|
|
174
175
|
},
|
|
175
|
-
[isControlled]
|
|
176
|
+
[isControlled]
|
|
176
177
|
);
|
|
177
178
|
|
|
178
179
|
const step = useCallback(
|
|
@@ -190,7 +191,7 @@ export const PanelGroup = function PanelGroup({
|
|
|
190
191
|
}
|
|
191
192
|
activate(list[nextIndex].id);
|
|
192
193
|
},
|
|
193
|
-
[activate, wrapEnabled]
|
|
194
|
+
[activate, wrapEnabled]
|
|
194
195
|
);
|
|
195
196
|
|
|
196
197
|
const next = useCallback(() => {
|
|
@@ -207,7 +208,7 @@ export const PanelGroup = function PanelGroup({
|
|
|
207
208
|
|
|
208
209
|
const panelIds = useMemo(
|
|
209
210
|
() => [...registrations].toSorted((a, b) => a.order - b.order).map((entry) => entry.id),
|
|
210
|
-
[registrations]
|
|
211
|
+
[registrations]
|
|
211
212
|
);
|
|
212
213
|
|
|
213
214
|
const contextValue = useMemo<PanelGroupContextValue>(
|
|
@@ -240,7 +241,7 @@ export const PanelGroup = function PanelGroup({
|
|
|
240
241
|
setDisabled,
|
|
241
242
|
switchEnabled,
|
|
242
243
|
resolvedSwitchModes,
|
|
243
|
-
]
|
|
244
|
+
]
|
|
244
245
|
);
|
|
245
246
|
|
|
246
247
|
return <PanelGroupContext value={contextValue}>{children}</PanelGroupContext>;
|
package/src/panel.tsx
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { useCallback, useEffect, useMemo } from "react";
|
|
2
|
-
import type { ReactNode } from "react";
|
|
3
1
|
import { CommandSurfaceProvider, ScreenScopeProvider, useCommand } from "@tooee/commands";
|
|
4
2
|
import { useTheme } from "@tooee/themes";
|
|
3
|
+
import { useCallback, useEffect, useMemo } from "react";
|
|
4
|
+
import type { ReactNode } from "react";
|
|
5
|
+
|
|
5
6
|
import { PanelContext, usePanelGroupContext } from "./context.js";
|
|
6
7
|
import type { PanelContextValue, PanelGroupContextValue } from "./context.js";
|
|
7
8
|
import type { PanelProps } from "./types.js";
|
|
@@ -67,7 +68,7 @@ export const Panel = function Panel({
|
|
|
67
68
|
|
|
68
69
|
const panelContext = useMemo<PanelContextValue>(
|
|
69
70
|
() => ({ groupId, id, title }),
|
|
70
|
-
[groupId, id, title]
|
|
71
|
+
[groupId, id, title]
|
|
71
72
|
);
|
|
72
73
|
|
|
73
74
|
const inner = (
|
package/src/types.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
2
1
|
import type { BoxProps } from "@opentui/react";
|
|
3
2
|
import type { Mode } from "@tooee/commands";
|
|
3
|
+
import type { ReactNode } from "react";
|
|
4
4
|
|
|
5
5
|
/** Switch shortcuts for a panel group. Set the whole prop to `null` to disable built-in switching. */
|
|
6
6
|
export interface PanelSwitchKeys {
|