nexus-shell 0.2.9 → 0.2.11

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.
@@ -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;
@@ -1,8 +1,13 @@
1
+ /**
2
+ * The terminal's scrollback.
3
+ *
4
+ * Visibility used to live here too, back when the terminal had exactly one
5
+ * place it could be. It is now registered like any other panel, so whatever
6
+ * hosts it owns whether it is showing — see `terminalPanel()` and
7
+ * `togglePanel()`.
8
+ */
1
9
  interface TerminalState {
2
- isOpen: boolean;
3
10
  history: string[];
4
- setOpen: (open: boolean) => void;
5
- toggle: () => void;
6
11
  addHistory: (line: string) => void;
7
12
  clearHistory: () => void;
8
13
  }
package/dist/index.d.ts CHANGED
@@ -23,7 +23,8 @@
23
23
  * to.
24
24
  */
25
25
  export { ShellLayout, ShellLayout as NexusWorkspaceShell, type ShellLayoutProps } from './components/layout/ShellLayout';
26
- export { initializeShell, DEFAULT_COMMAND_IDS, type InitializeShellOptions, } from './core/Boot';
26
+ export { initializeShell, togglePanel, DEFAULT_COMMAND_IDS, type InitializeShellOptions, } from './core/Boot';
27
+ export { PaneHostProvider, usePaneHost, useHostChrome, type IPaneHost, type PaneHostProviderProps, } from './components/layout/PaneHost';
27
28
  export { commandRegistry, CommandRegistry, type ICommand } from './core/registry/CommandRegistry';
28
29
  export { menuRegistry, MenuRegistry, type IMenuItemConfig } from './core/registry/MenuRegistry';
29
30
  export { pluginRegistry, type IPlugin, type PluginStatus } from './core/registry/PluginRegistry';
@@ -31,8 +32,7 @@ export { componentRegistry, type ComponentConstructor } from './core/registry/Co
31
32
  export { useChatStore, type ISlashCommandConfig } from './core/services/ChatService';
32
33
  export { useLayoutStore } from './core/services/LayoutService';
33
34
  export { useModalStore, type ModalType as ModalStoreType } from './core/services/ModalStoreService';
34
- export { useRightSidebarStore } from './core/services/RightSidebarService';
35
- export { useSidebarStore, type ISidebarPanel } from './core/services/SidebarService';
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';
@@ -50,7 +50,7 @@ export { Modal, type ModalProps, type ModalType } from './components/widgets/Mod
50
50
  export { QuickSearch, type QuickSearchProps, type IQuickSearchResult } from './components/widgets/QuickSearch';
51
51
  export { SearchWidget, type SearchWidgetProps, type ISearchResult } from './components/widgets/SearchWidget';
52
52
  export { SettingsPanel, type SettingsPanelProps, type ISettingsThemeOption, DEFAULT_SETTINGS_THEMES } from './components/widgets/SettingsPanel';
53
- export { SidebarPane, type SidebarPaneProps } from './components/widgets/SidebarPane';
53
+ export { SidebarPane, type SidebarPaneProps, type PaneSide } from './components/widgets/SidebarPane';
54
54
  export { StatusBar, type StatusBarProps, type IStatusBarWidget } from './components/widgets/StatusBar';
55
55
  export { TerminalPane, type TerminalPaneProps } from './components/widgets/TerminalPane';
56
56
  export { ThemeSwitcher, type ThemeSwitcherProps, type IThemeOption, DEFAULT_THEME_OPTIONS } from './components/widgets/ThemeSwitcher';