nexus-shell 0.2.10 → 0.2.12
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/dist/components/layout/ShellLayout.d.ts +18 -17
- package/dist/components/widgets/ActivityBar.d.ts +7 -3
- package/dist/components/widgets/SidebarPane.d.ts +12 -5
- package/dist/connected/ConnectedPane.d.ts +24 -0
- package/dist/connected/ConnectedPaneRail.d.ts +25 -0
- package/dist/connected/ConnectedSettingsPanel.d.ts +12 -0
- package/dist/connected/index.d.ts +4 -3
- package/dist/connected/panels.d.ts +22 -14
- package/dist/core/Boot.d.ts +6 -9
- package/dist/core/services/ChatService.d.ts +16 -0
- package/dist/core/services/PaneService.d.ts +66 -0
- package/dist/index.d.ts +1 -1
- package/dist/nexus-shell.es.js +1523 -1482
- package/dist/nexus-shell.umd.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/dist/connected/ConnectedActivityBar.d.ts +0 -21
- package/dist/connected/ConnectedSidebarPane.d.ts +0 -33
- package/dist/core/services/SidebarService.d.ts +0 -48
|
@@ -2,25 +2,22 @@ import { ReactNode } from 'react';
|
|
|
2
2
|
import { Model, IJsonModel } from 'flexlayout-react';
|
|
3
3
|
import { IMenuItemConfig } from '../../core/registry/MenuRegistry';
|
|
4
4
|
import { ISlashCommandConfig } from '../../core/services/ChatService';
|
|
5
|
-
import {
|
|
5
|
+
import { IPanel } from '../../core/services/PaneService';
|
|
6
6
|
import { IStatusBarWidgetConfig } from '../../core/services/StatusBarService';
|
|
7
7
|
|
|
8
8
|
export interface ShellLayoutProps {
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
*
|
|
16
|
-
* selection rather than about navigation.
|
|
10
|
+
* Panels to register, for every edge.
|
|
11
|
+
*
|
|
12
|
+
* Each panel's `side` decides where it docks — `"left"`, `"right"` or
|
|
13
|
+
* `"bottom"`, defaulting to left — and each edge keeps its own open panel, so
|
|
14
|
+
* a file tree, an inspector and a terminal can all be showing at once. A rail
|
|
15
|
+
* appears only once its edge has a panel.
|
|
17
16
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* the right, both at once. The right-hand rail appears only once at least one
|
|
21
|
-
* is registered.
|
|
17
|
+
* Placement is data on the panel rather than a separate prop per side, so
|
|
18
|
+
* moving something is a one-word change.
|
|
22
19
|
*/
|
|
23
|
-
|
|
20
|
+
panels?: IPanel[];
|
|
24
21
|
/** Slash commands available in the chat pane. */
|
|
25
22
|
slashCommands?: ISlashCommandConfig[];
|
|
26
23
|
/** Menu structure, keyed by top-level menu name. Items dispatch by `commandId`. */
|
|
@@ -61,8 +58,8 @@ export interface ShellLayoutProps {
|
|
|
61
58
|
onLayoutChange?: (layout: IJsonModel) => void;
|
|
62
59
|
}
|
|
63
60
|
/**
|
|
64
|
-
* The complete application shell: menu bar,
|
|
65
|
-
* `flexlayout-react` docking workspace,
|
|
61
|
+
* The complete application shell: menu bar, a docked pane and rail on each
|
|
62
|
+
* edge, a `flexlayout-react` docking workspace, and a status bar.
|
|
66
63
|
*
|
|
67
64
|
* **This is where an application starts.** Call {@link initializeShell} once to
|
|
68
65
|
* register your commands, menus and panels, render this component, and add
|
|
@@ -91,7 +88,11 @@ export interface ShellLayoutProps {
|
|
|
91
88
|
* componentRegistry.register('editor', Editor);
|
|
92
89
|
*
|
|
93
90
|
* initializeShell({
|
|
94
|
-
* panels: [
|
|
91
|
+
* panels: [
|
|
92
|
+
* { id: 'files', label: 'Explorer', icon: Files, component: FileTree },
|
|
93
|
+
* chatPanel({ side: 'right' }),
|
|
94
|
+
* terminalPanel({ side: 'bottom' }),
|
|
95
|
+
* ],
|
|
95
96
|
* commands: [{ id: 'file.save', label: 'File: Save', keybinding: 'Control+s', execute: save }],
|
|
96
97
|
* menus: { File: [{ id: 'save', label: 'Save', commandId: 'file.save' }] },
|
|
97
98
|
* statusBar: [{ id: 'branch', label: 'main', alignment: 'left' }],
|
|
@@ -102,4 +103,4 @@ export interface ShellLayoutProps {
|
|
|
102
103
|
* );
|
|
103
104
|
* ```
|
|
104
105
|
*/
|
|
105
|
-
export declare const ShellLayout: ({ panels,
|
|
106
|
+
export declare const ShellLayout: ({ panels, slashCommands, menuConfig, statusBarConfig, title, rightMenuBarContent, centerMenuBarContent, layoutModel, initialLayoutJson, disableLocalStorage, onLayoutChange, }: ShellLayoutProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -14,8 +14,12 @@ export interface ActivityBarProps {
|
|
|
14
14
|
/** Items rendered in the main (top) group, in order. */
|
|
15
15
|
items?: IActivityBarItem[];
|
|
16
16
|
/**
|
|
17
|
-
* Items rendered in the bottom group, below the flex spacer.
|
|
18
|
-
*
|
|
17
|
+
* Items rendered in the bottom group, below the flex spacer. Empty by
|
|
18
|
+
* default.
|
|
19
|
+
*
|
|
20
|
+
* This used to default to a Settings item, which meant every rail grew one
|
|
21
|
+
* whether the app had settings or not. Settings is now an ordinary panel with
|
|
22
|
+
* `align: 'end'` — see `settingsPanel()`.
|
|
19
23
|
*/
|
|
20
24
|
bottomItems?: IActivityBarItem[];
|
|
21
25
|
/** Id of the currently active item, or `null` when nothing is selected. */
|
|
@@ -31,7 +35,7 @@ export interface ActivityBarProps {
|
|
|
31
35
|
* The divider and the active-item indicator both mirror, so a right-hand rail
|
|
32
36
|
* marks its selection on the edge facing the content.
|
|
33
37
|
*/
|
|
34
|
-
side?: PaneSide
|
|
38
|
+
side?: Exclude<PaneSide, 'bottom'>;
|
|
35
39
|
/** Extra classes merged onto the root `<aside>`. */
|
|
36
40
|
className?: string;
|
|
37
41
|
/** Accessible label for the landmark. Defaults to `"Activity Bar"`. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
|
|
3
3
|
/** Which edge of the shell a pane or rail is docked to. */
|
|
4
|
-
export type PaneSide = 'left' | 'right';
|
|
4
|
+
export type PaneSide = 'left' | 'right' | 'bottom';
|
|
5
5
|
export interface SidebarPaneProps {
|
|
6
6
|
/**
|
|
7
7
|
* Heading text. Rendered uppercase with letter-spacing; pass it in natural
|
|
@@ -15,8 +15,10 @@ export interface SidebarPaneProps {
|
|
|
15
15
|
* entirely — useful when the pane is always visible.
|
|
16
16
|
*/
|
|
17
17
|
onClose?: () => void;
|
|
18
|
-
/** Fixed pane width, as a CSS length. Defaults to `"300px"`. */
|
|
18
|
+
/** Fixed pane width, as a CSS length. Ignored when `side` is `"bottom"`. Defaults to `"300px"`. */
|
|
19
19
|
width?: string;
|
|
20
|
+
/** Fixed pane height, as a CSS length. Only used when `side` is `"bottom"`. Defaults to `"240px"`. */
|
|
21
|
+
height?: string;
|
|
20
22
|
/**
|
|
21
23
|
* Which edge of the shell the pane is docked to. Defaults to `"left"`.
|
|
22
24
|
*
|
|
@@ -39,8 +41,9 @@ export interface SidebarPaneProps {
|
|
|
39
41
|
* prop existed every application hand-rolled its own right-hand
|
|
40
42
|
* `<div className="w-80 border-l …">`, and they all drifted apart.
|
|
41
43
|
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
+
* `bottom` docks it below the workspace, where `width` gives way to `height`.
|
|
45
|
+
*
|
|
46
|
+
* For the store-backed variant used by `ShellLayout`, see `ConnectedPane`.
|
|
44
47
|
*
|
|
45
48
|
* @example
|
|
46
49
|
* ```tsx
|
|
@@ -51,6 +54,10 @@ export interface SidebarPaneProps {
|
|
|
51
54
|
* <SidebarPane title="Properties" side="right" width="320px">
|
|
52
55
|
* <PropertyPanel subjects={selected} fields={fields} />
|
|
53
56
|
* </SidebarPane>
|
|
57
|
+
*
|
|
58
|
+
* <SidebarPane title="Terminal" side="bottom" height="240px">
|
|
59
|
+
* <ConnectedTerminalPane />
|
|
60
|
+
* </SidebarPane>
|
|
54
61
|
* ```
|
|
55
62
|
*/
|
|
56
|
-
export declare const SidebarPane: ({ title, children, onClose, width, side, className, }: SidebarPaneProps) => import("react/jsx-runtime").JSX.Element;
|
|
63
|
+
export declare const SidebarPane: ({ title, children, onClose, width, height, side, className, }: SidebarPaneProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { SidebarPaneProps, PaneSide } from '../components/widgets/SidebarPane';
|
|
2
|
+
|
|
3
|
+
export type ConnectedPaneProps = Omit<SidebarPaneProps, 'title' | 'children' | 'onClose'> & {
|
|
4
|
+
/** Which edge to render. Defaults to `"left"`. */
|
|
5
|
+
side?: PaneSide;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* {@link SidebarPane} bound to the pane store for one edge.
|
|
9
|
+
*
|
|
10
|
+
* Renders whichever panel is open on that edge, or nothing when the pane is
|
|
11
|
+
* collapsed. Every edge resolves against its own registry, so the left pane,
|
|
12
|
+
* the right pane and the bottom drawer open and close independently — a file
|
|
13
|
+
* tree, an inspector and a terminal all at once is the normal case, not a
|
|
14
|
+
* special one.
|
|
15
|
+
*
|
|
16
|
+
* There is nothing edge-specific in here. A panel decides where it lives
|
|
17
|
+
* through its `side`, and this renders whatever arrived.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```tsx
|
|
21
|
+
* <ConnectedPane side="right" width="320px" />
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export declare const ConnectedPane: ({ side, ...props }: ConnectedPaneProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ActivityBarProps } from '../components/widgets/ActivityBar';
|
|
2
|
+
import { PaneSide } from '../components/widgets/SidebarPane';
|
|
3
|
+
|
|
4
|
+
export type ConnectedPaneRailProps = Omit<ActivityBarProps, 'items' | 'bottomItems' | 'activeId' | 'onSelect' | 'side'> & {
|
|
5
|
+
/** Which edge to render. Defaults to `"left"`. */
|
|
6
|
+
side?: Exclude<PaneSide, 'bottom'>;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* {@link ActivityBar} bound to the pane store for one edge.
|
|
10
|
+
*
|
|
11
|
+
* Derives its items from the panels registered on that edge and toggles the
|
|
12
|
+
* open one — clicking the already-open item closes the pane. Items with
|
|
13
|
+
* `align: 'end'` go to the far group, which is how settings ends up at the
|
|
14
|
+
* bottom without the rail knowing what settings is.
|
|
15
|
+
*
|
|
16
|
+
* Renders nothing when no panels are registered for the edge. An empty rail is
|
|
17
|
+
* a twelve-pixel strip of nothing, and both edges behave the same way — the
|
|
18
|
+
* left rail used to render regardless, which made the two sides subtly
|
|
19
|
+
* different for no reason anyone had chosen.
|
|
20
|
+
*
|
|
21
|
+
* There is no bottom rail: a bottom drawer is toggled from the status bar, a
|
|
22
|
+
* command or a keybinding, and a horizontal strip of icons under the workspace
|
|
23
|
+
* costs more room than it earns.
|
|
24
|
+
*/
|
|
25
|
+
export declare const ConnectedPaneRail: ({ side, ...props }: ConnectedPaneRailProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SettingsPanelProps } from '../components/widgets/SettingsPanel';
|
|
2
|
+
|
|
3
|
+
export type ConnectedSettingsPanelProps = Omit<SettingsPanelProps, 'theme' | 'onThemeChange'>;
|
|
4
|
+
/**
|
|
5
|
+
* {@link SettingsPanel} bound to `useThemeStore`.
|
|
6
|
+
*
|
|
7
|
+
* This used to be reached through a reserved `"settings"` panel id that the
|
|
8
|
+
* pane special-cased. Making it an ordinary connected component means the pane
|
|
9
|
+
* has no privileged ids left, and both rails behave identically — register it
|
|
10
|
+
* with `settingsPanel()`, or don't, and nothing else changes.
|
|
11
|
+
*/
|
|
12
|
+
export declare const ConnectedSettingsPanel: (props: ConnectedSettingsPanelProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -9,13 +9,14 @@
|
|
|
9
9
|
* Reach for these when you want the shell's behavior. Reach for the plain
|
|
10
10
|
* components when you want control.
|
|
11
11
|
*/
|
|
12
|
-
export { chatPanel, terminalPanel } from './panels';
|
|
13
|
-
export {
|
|
12
|
+
export { chatPanel, terminalPanel, settingsPanel } from './panels';
|
|
13
|
+
export { ConnectedPaneRail, type ConnectedPaneRailProps } from './ConnectedPaneRail';
|
|
14
14
|
export { ConnectedChatPane, type ConnectedChatPaneProps } from './ConnectedChatPane';
|
|
15
15
|
export { ConnectedCommandPalette, type ConnectedCommandPaletteProps } from './ConnectedCommandPalette';
|
|
16
16
|
export { ConnectedMenuBar, type ConnectedMenuBarProps } from './ConnectedMenuBar';
|
|
17
17
|
export { ConnectedModal, type ConnectedModalProps } from './ConnectedModal';
|
|
18
|
-
export {
|
|
18
|
+
export { ConnectedPane, type ConnectedPaneProps } from './ConnectedPane';
|
|
19
|
+
export { ConnectedSettingsPanel, type ConnectedSettingsPanelProps, } from './ConnectedSettingsPanel';
|
|
19
20
|
export { ConnectedStatusBar, type ConnectedStatusBarProps } from './ConnectedStatusBar';
|
|
20
21
|
export { ConnectedTerminalPane, type ConnectedTerminalPaneProps } from './ConnectedTerminalPane';
|
|
21
22
|
export { ConnectedThemeSwitcher, type ConnectedThemeSwitcherProps } from './ConnectedThemeSwitcher';
|
|
@@ -1,28 +1,36 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IPanel } from '../core/services/PaneService';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Ready-made panel descriptors for the shell's own pieces.
|
|
5
5
|
*
|
|
6
|
-
* Chat and
|
|
7
|
-
* terminal along the bottom
|
|
8
|
-
* They are now ordinary registrations
|
|
6
|
+
* Chat, terminal and settings were each nailed into a fixed place — chat on the
|
|
7
|
+
* right, terminal along the bottom, settings behind a reserved panel id the
|
|
8
|
+
* pane special-cased. They are now ordinary registrations with no privileges,
|
|
9
|
+
* so they go wherever you put them:
|
|
9
10
|
*
|
|
10
11
|
* ```tsx
|
|
11
12
|
* initializeShell({
|
|
12
|
-
* panels: [
|
|
13
|
-
*
|
|
13
|
+
* panels: [
|
|
14
|
+
* { id: 'files', label: 'Explorer', icon: Files, component: FileTree },
|
|
15
|
+
* chatPanel({ side: 'right' }),
|
|
16
|
+
* terminalPanel({ side: 'bottom' }),
|
|
17
|
+
* settingsPanel(),
|
|
18
|
+
* ],
|
|
14
19
|
* });
|
|
15
|
-
*
|
|
16
|
-
* // …or as a dockable tab, alongside everything else:
|
|
17
|
-
* componentRegistry.register('terminal', ConnectedTerminalPane);
|
|
18
|
-
* useLayoutStore.getState().addTab('terminal', 'Terminal');
|
|
19
20
|
* ```
|
|
20
21
|
*
|
|
21
|
-
* Each takes overrides, so the id, label or
|
|
22
|
+
* Each takes overrides, so the id, label, icon or side can change without
|
|
22
23
|
* rebuilding the descriptor by hand.
|
|
23
24
|
*/
|
|
24
25
|
/** The chat pane, as a registerable panel. */
|
|
25
|
-
export declare const chatPanel: (overrides?: Partial<
|
|
26
|
+
export declare const chatPanel: (overrides?: Partial<IPanel>) => IPanel;
|
|
26
27
|
/** The terminal, as a registerable panel. */
|
|
27
|
-
export declare const terminalPanel: (overrides?: Partial<
|
|
28
|
-
|
|
28
|
+
export declare const terminalPanel: (overrides?: Partial<IPanel>) => IPanel;
|
|
29
|
+
/**
|
|
30
|
+
* The theme picker, as a registerable panel.
|
|
31
|
+
*
|
|
32
|
+
* `align: 'end'` pins it to the far group of its rail, which is where a
|
|
33
|
+
* settings icon conventionally sits — and is now the only reason it ends up
|
|
34
|
+
* there, rather than the pane knowing the string `"settings"`.
|
|
35
|
+
*/
|
|
36
|
+
export declare const settingsPanel: (overrides?: Partial<IPanel>) => IPanel;
|
package/dist/core/Boot.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ICommand } from './registry/CommandRegistry';
|
|
2
2
|
import { IMenuItemConfig } from './registry/MenuRegistry';
|
|
3
3
|
import { ISlashCommandConfig } from './services/ChatService';
|
|
4
|
-
import {
|
|
4
|
+
import { IPanel } from './services/PaneService';
|
|
5
5
|
import { IStatusBarWidgetConfig } from './services/StatusBarService';
|
|
6
6
|
|
|
7
7
|
export interface InitializeShellOptions {
|
|
@@ -9,13 +9,7 @@ export interface InitializeShellOptions {
|
|
|
9
9
|
* Sidebar panels to register. Each becomes an icon in the activity bar and
|
|
10
10
|
* renders its `component` in the sidebar when selected.
|
|
11
11
|
*/
|
|
12
|
-
panels?:
|
|
13
|
-
/**
|
|
14
|
-
* Right-hand panels — inspectors and properties, as opposed to navigation.
|
|
15
|
-
* Registered against `useInspectorStore`, so they open and close
|
|
16
|
-
* independently of the left-hand sidebar.
|
|
17
|
-
*/
|
|
18
|
-
inspectorPanels?: ISidebarPanel[];
|
|
12
|
+
panels?: IPanel[];
|
|
19
13
|
/** Menus keyed by top-level name. Items dispatch through their `commandId`. */
|
|
20
14
|
menus?: Record<string, IMenuItemConfig[]>;
|
|
21
15
|
/** Commands available to the palette, menus and keybindings. */
|
|
@@ -72,7 +66,10 @@ export declare const togglePanel: (id: string) => boolean;
|
|
|
72
66
|
* componentRegistry.register('editor', Editor);
|
|
73
67
|
*
|
|
74
68
|
* initializeShell({
|
|
75
|
-
* panels: [
|
|
69
|
+
* panels: [
|
|
70
|
+
* { id: 'files', label: 'Explorer', icon: Files, component: FileTree },
|
|
71
|
+
* chatPanel({ side: 'right' }),
|
|
72
|
+
* ],
|
|
76
73
|
* commands: [{ id: 'file.save', label: 'File: Save', keybinding: 'Control+s', execute: save }],
|
|
77
74
|
* menus: { File: [{ id: 'save', label: 'Save', commandId: 'file.save' }] },
|
|
78
75
|
* statusBar: [{ id: 'branch', label: 'main', alignment: 'left' }],
|
|
@@ -17,7 +17,23 @@ interface ChatState {
|
|
|
17
17
|
}) => void;
|
|
18
18
|
clearMessages: () => void;
|
|
19
19
|
setSlashCommands: (commands: ISlashCommandConfig[]) => void;
|
|
20
|
+
/**
|
|
21
|
+
* Add a command, replacing any existing one with the same `command` word.
|
|
22
|
+
*
|
|
23
|
+
* Registering is idempotent so that a component registering in an effect is
|
|
24
|
+
* safe to mount twice — which React does in StrictMode, and again on every
|
|
25
|
+
* remount. Appending blindly would leave the same command listed two or three
|
|
26
|
+
* times in the suggestion list.
|
|
27
|
+
*/
|
|
20
28
|
registerSlashCommand: (command: ISlashCommandConfig) => void;
|
|
29
|
+
/**
|
|
30
|
+
* Remove a command by its `command` word. Unknown words are ignored.
|
|
31
|
+
*
|
|
32
|
+
* The counterpart to {@link ChatState.registerSlashCommand}, so a component
|
|
33
|
+
* that registers on mount can clean up on unmount and stop offering a command
|
|
34
|
+
* whose handler is gone.
|
|
35
|
+
*/
|
|
36
|
+
unregisterSlashCommand: (command: string) => void;
|
|
21
37
|
}
|
|
22
38
|
/**
|
|
23
39
|
* Shell-level store for the chat pane's transcript and slash commands.
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { StoreApi, UseBoundStore } from 'zustand';
|
|
2
|
+
import { LucideIcon } from 'lucide-react';
|
|
3
|
+
import { PaneSide } from '../../components/widgets/SidebarPane';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The shell's docked panes, one store per edge.
|
|
7
|
+
*
|
|
8
|
+
* Every edge behaves identically — a registry of panels, one of which is open,
|
|
9
|
+
* remembered across reloads — so they share an implementation rather than
|
|
10
|
+
* drifting into three. Which edge a panel belongs to is data on the panel, not
|
|
11
|
+
* a separate API per side.
|
|
12
|
+
*/
|
|
13
|
+
/** Ids the shell's own panels use by default. */
|
|
14
|
+
export declare const CHAT_PANEL_ID = "chat";
|
|
15
|
+
export declare const TERMINAL_PANEL_ID = "terminal";
|
|
16
|
+
export declare const SETTINGS_PANEL_ID = "settings";
|
|
17
|
+
export interface IPanel {
|
|
18
|
+
id: string;
|
|
19
|
+
label: string;
|
|
20
|
+
icon: LucideIcon;
|
|
21
|
+
component: React.ComponentType<any> | React.ReactNode;
|
|
22
|
+
/**
|
|
23
|
+
* Which edge the panel docks to. Defaults to `"left"`.
|
|
24
|
+
*
|
|
25
|
+
* This is the whole placement API: move a panel by changing this, not by
|
|
26
|
+
* registering it somewhere else.
|
|
27
|
+
*/
|
|
28
|
+
side?: PaneSide;
|
|
29
|
+
/**
|
|
30
|
+
* Where the panel's icon sits on its rail. `"end"` pins it to the far group —
|
|
31
|
+
* conventionally settings and account. Defaults to `"start"`.
|
|
32
|
+
*/
|
|
33
|
+
align?: 'start' | 'end';
|
|
34
|
+
}
|
|
35
|
+
export interface PaneState {
|
|
36
|
+
/** Id of the open panel, or `null` when the pane is collapsed. */
|
|
37
|
+
activePanel: string | null;
|
|
38
|
+
panels: IPanel[];
|
|
39
|
+
setActivePanel: (id: string | null) => void;
|
|
40
|
+
/** Open the panel, or close it if it is already open. */
|
|
41
|
+
togglePanel: (id: string) => void;
|
|
42
|
+
setPanels: (panels: IPanel[]) => void;
|
|
43
|
+
}
|
|
44
|
+
export type PaneStore = UseBoundStore<StoreApi<PaneState>>;
|
|
45
|
+
/**
|
|
46
|
+
* A pane store bound to one storage key.
|
|
47
|
+
*
|
|
48
|
+
* Exported so an application with a docked region the shell doesn't provide
|
|
49
|
+
* gets the same behaviour without reimplementing it.
|
|
50
|
+
*/
|
|
51
|
+
export declare const createPaneStore: (storageKey: string) => PaneStore;
|
|
52
|
+
export declare const useLeftPaneStore: PaneStore;
|
|
53
|
+
export declare const useRightPaneStore: PaneStore;
|
|
54
|
+
export declare const useBottomPaneStore: PaneStore;
|
|
55
|
+
/** The store for one edge. */
|
|
56
|
+
export declare const paneStore: (side: PaneSide) => PaneStore;
|
|
57
|
+
/** Every pane store, for code that has to look across all of them. */
|
|
58
|
+
export declare const PANE_SIDES: PaneSide[];
|
|
59
|
+
/**
|
|
60
|
+
* Register panels across every edge at once.
|
|
61
|
+
*
|
|
62
|
+
* Panels arrive as one list and are routed by their `side`, so a caller never
|
|
63
|
+
* has to know there are three stores. Each edge is set rather than appended,
|
|
64
|
+
* matching how the rest of the shell's configuration behaves.
|
|
65
|
+
*/
|
|
66
|
+
export declare const setPanels: (panels: IPanel[]) => void;
|
package/dist/index.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ export { componentRegistry, type ComponentConstructor } from './core/registry/Co
|
|
|
32
32
|
export { useChatStore, type ISlashCommandConfig } from './core/services/ChatService';
|
|
33
33
|
export { useLayoutStore } from './core/services/LayoutService';
|
|
34
34
|
export { useModalStore, type ModalType as ModalStoreType } from './core/services/ModalStoreService';
|
|
35
|
-
export {
|
|
35
|
+
export { createPaneStore, paneStore, setPanels, useLeftPaneStore, useRightPaneStore, useBottomPaneStore, PANE_SIDES, CHAT_PANEL_ID, TERMINAL_PANEL_ID, SETTINGS_PANEL_ID, type IPanel, type PaneState, type PaneStore, } from './core/services/PaneService';
|
|
36
36
|
export { useStatusBarStore, type IStatusBarWidgetConfig } from './core/services/StatusBarService';
|
|
37
37
|
export { useTerminalStore } from './core/services/TerminalService';
|
|
38
38
|
export { useThemeStore, type ThemeType } from './core/services/ThemeService';
|