react-dockable-desktop 5.3.5 → 6.0.0
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/index.cjs +5 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +84 -4
- package/dist/index.d.ts +84 -4
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/styles.css +38 -13
- package/package.json +2 -1
package/dist/index.d.cts
CHANGED
|
@@ -1321,6 +1321,12 @@ interface SidePanelOptions {
|
|
|
1321
1321
|
icon?: React$1.ReactNode;
|
|
1322
1322
|
/** Specific CSS width (e.g. 300, '40%') for the panel container. */
|
|
1323
1323
|
width?: number | string;
|
|
1324
|
+
/**
|
|
1325
|
+
* CSS padding for the panel body content — a number (px) or any CSS value/shorthand
|
|
1326
|
+
* (e.g. `'10px 16px'`). Default: `0` (edge-to-edge) — pass `10` to restore the pre-v6.0.0
|
|
1327
|
+
* default, or any value your content needs.
|
|
1328
|
+
*/
|
|
1329
|
+
bodyPadding?: number | string;
|
|
1324
1330
|
}
|
|
1325
1331
|
/** Configuration options applied when opening a Modal. */
|
|
1326
1332
|
interface ModalOptions {
|
|
@@ -1332,6 +1338,12 @@ interface ModalOptions {
|
|
|
1332
1338
|
size?: 'small' | 'medium' | 'large' | 'fullscreen' | 'auto';
|
|
1333
1339
|
/** If false, hides the modal backdrop exit click and header close button. */
|
|
1334
1340
|
closable?: boolean;
|
|
1341
|
+
/**
|
|
1342
|
+
* CSS padding for the modal body content — a number (px) or any CSS value/shorthand
|
|
1343
|
+
* (e.g. `'10px 16px'`). Default: `0` (edge-to-edge) — pass `10` to restore the pre-v6.0.0
|
|
1344
|
+
* default, or any value your content needs.
|
|
1345
|
+
*/
|
|
1346
|
+
bodyPadding?: number | string;
|
|
1335
1347
|
}
|
|
1336
1348
|
/**
|
|
1337
1349
|
* Represents a rendered instance of a panel or modal in the layout.
|
|
@@ -1479,7 +1491,16 @@ declare const ConfirmationForm: React$1.FC<ConfirmationFormProps>;
|
|
|
1479
1491
|
interface SidebarTab {
|
|
1480
1492
|
id: string;
|
|
1481
1493
|
label: string;
|
|
1482
|
-
icon
|
|
1494
|
+
/** Required unless `hidden` is true — a hidden tab never renders a rail button, so it has no icon to show. */
|
|
1495
|
+
icon?: React$1.ReactNode;
|
|
1496
|
+
/**
|
|
1497
|
+
* Omit this tab's rail button entirely — no icon, no click target — while it
|
|
1498
|
+
* remains fully openable via `openTab()` / `useSidebar().openTab()` / a controlled
|
|
1499
|
+
* `activeTabId`. Use for menu-driven panels with no persistent icon (e.g. a
|
|
1500
|
+
* Google-Maps-style hamburger that opens content not otherwise pinned to the rail).
|
|
1501
|
+
* Default: false
|
|
1502
|
+
*/
|
|
1503
|
+
hidden?: boolean;
|
|
1483
1504
|
/**
|
|
1484
1505
|
* Mount immediately when the Sidebar first renders, not on first user click.
|
|
1485
1506
|
* Implies `preserveState: true`.
|
|
@@ -1582,9 +1603,46 @@ interface SidebarProps {
|
|
|
1582
1603
|
onStripVisibilityChange?: (visible: boolean) => void;
|
|
1583
1604
|
/**
|
|
1584
1605
|
* Show an "X" close button in the expanded drawer's header, as an additional way to collapse
|
|
1585
|
-
* the sidebar (equivalent to clicking the active tab's own icon again). Opt-in. Default: false
|
|
1606
|
+
* the sidebar (equivalent to clicking the active tab's own icon again). Opt-in. Default: false.
|
|
1607
|
+
* Has no effect once the default header is suppressed — via `hideDefaultHeader`, or simply by
|
|
1608
|
+
* passing `renderHeader` (either one is sufficient) — since the entire default header, this
|
|
1609
|
+
* button included, is skipped for every tab in that case.
|
|
1586
1610
|
*/
|
|
1587
1611
|
showCloseButton?: boolean;
|
|
1612
|
+
/**
|
|
1613
|
+
* Suppress the library's own drawer header (title + `showCloseButton`'s close
|
|
1614
|
+
* button) for every tab, so `renderHeader` (or each tab's own `renderContent`)
|
|
1615
|
+
* can supply a header, border, and styling instead. Applies uniformly across
|
|
1616
|
+
* all tabs — there's no per-tab override. Passing `renderHeader` by itself has
|
|
1617
|
+
* the same suppressing effect even if this is left unset — the two conditions
|
|
1618
|
+
* are combined with OR, precisely so that supplying `renderHeader` alone is
|
|
1619
|
+
* never a silent no-op. The close mechanism is unaffected either way: the
|
|
1620
|
+
* `onClose` parameter passed to `renderContent`/`renderHeader`, or
|
|
1621
|
+
* `useSidebarTab().onClose` from anywhere in a tab's content tree.
|
|
1622
|
+
* Default: false
|
|
1623
|
+
*/
|
|
1624
|
+
hideDefaultHeader?: boolean;
|
|
1625
|
+
/**
|
|
1626
|
+
* Custom header renderer used in place of the library's own drawer header.
|
|
1627
|
+
* Passing `renderHeader` is by itself sufficient to suppress the default
|
|
1628
|
+
* header, whether or not `hideDefaultHeader` is also set — the two props are
|
|
1629
|
+
* combined with OR. Called once for whichever tab is currently active, so
|
|
1630
|
+
* the same header markup (e.g. a hamburger icon, a search field, a close
|
|
1631
|
+
* button) is shared uniformly across every tab instead of being repeated
|
|
1632
|
+
* inside each tab's own `renderContent`. Omit `renderHeader` and set
|
|
1633
|
+
* `hideDefaultHeader: true` to render no header at all and let each tab's
|
|
1634
|
+
* `renderContent` supply its own instead.
|
|
1635
|
+
* @param tab - the currently active tab
|
|
1636
|
+
* @param onClose - call to collapse the sidebar drawer
|
|
1637
|
+
* @param onOpen - call to (re-)select this tab
|
|
1638
|
+
*/
|
|
1639
|
+
renderHeader?: (tab: SidebarTab, onClose: () => void, onOpen: () => void) => React$1.ReactNode;
|
|
1640
|
+
/**
|
|
1641
|
+
* @internal Marks this instance as a secondary sidebar for context-broadcasting
|
|
1642
|
+
* purposes. Set automatically by `<SecondarySidebar>` — do not pass this directly.
|
|
1643
|
+
* Default: false
|
|
1644
|
+
*/
|
|
1645
|
+
isSecondary?: boolean;
|
|
1588
1646
|
/** Main workspace content rendered alongside the sidebar. */
|
|
1589
1647
|
children?: React$1.ReactNode;
|
|
1590
1648
|
}
|
|
@@ -1611,6 +1669,10 @@ interface SidebarContextValue {
|
|
|
1611
1669
|
openTab: (tabId: string) => void;
|
|
1612
1670
|
closeDrawer: () => void;
|
|
1613
1671
|
getActiveTab: () => string | null;
|
|
1672
|
+
/** Which side this Sidebar instance is rendering on. */
|
|
1673
|
+
position: 'left' | 'right';
|
|
1674
|
+
/** True if this instance is a `<SecondarySidebar>`, false for a primary `<Sidebar>`. */
|
|
1675
|
+
isSecondary: boolean;
|
|
1614
1676
|
}
|
|
1615
1677
|
/**
|
|
1616
1678
|
* Value provided by `useSidebarTab()`. Available only to components rendered
|
|
@@ -1623,6 +1685,23 @@ interface SidebarTabContextValue {
|
|
|
1623
1685
|
openTab: (tabId: string) => void;
|
|
1624
1686
|
}
|
|
1625
1687
|
declare const Sidebar: React$1.ForwardRefExoticComponent<SidebarProps & React$1.RefAttributes<SidebarHandle>>;
|
|
1688
|
+
/**
|
|
1689
|
+
* Props for {@link SecondarySidebar} — identical to {@link SidebarProps} except
|
|
1690
|
+
* `position` (always the opposite of whatever primary `Sidebar` it's nested inside)
|
|
1691
|
+
* and `isSecondary` (always `true`) are not settable.
|
|
1692
|
+
*/
|
|
1693
|
+
type SecondarySidebarProps = Omit<SidebarProps, 'position' | 'isSecondary'>;
|
|
1694
|
+
/**
|
|
1695
|
+
* A second, independent `Sidebar` instance for the opposite edge of the screen —
|
|
1696
|
+
* same component, same behavior, zero forked code. Must be rendered inside a
|
|
1697
|
+
* primary `Sidebar`'s `children`; automatically takes whichever side that primary
|
|
1698
|
+
* isn't using, so the side is never specified directly.
|
|
1699
|
+
*
|
|
1700
|
+
* @throws Error if rendered without an ancestor `Sidebar`, or nested inside another
|
|
1701
|
+
* `SecondarySidebar` — this library supports exactly one primary and one secondary,
|
|
1702
|
+
* nothing deeper.
|
|
1703
|
+
*/
|
|
1704
|
+
declare const SecondarySidebar: React$1.ForwardRefExoticComponent<SecondarySidebarProps & React$1.RefAttributes<SidebarHandle>>;
|
|
1626
1705
|
/**
|
|
1627
1706
|
* Returns sidebar control functions from anywhere inside a `<Sidebar>` tree,
|
|
1628
1707
|
* including floating panels rendered via `{children}`.
|
|
@@ -2240,7 +2319,8 @@ declare function usePanelContribution(contribution: PanelContribution): void;
|
|
|
2240
2319
|
declare function useActivePanelContribution(): PanelContribution | null;
|
|
2241
2320
|
/**
|
|
2242
2321
|
* Converts a contributed sidebar section into a `SidebarTab` for `<Sidebar tabs={...}>`.
|
|
2243
|
-
* `SidebarTab.icon` is
|
|
2322
|
+
* `SidebarTab.icon` is optional but recommended unless the tab is `hidden`; supply
|
|
2323
|
+
* `fallbackIcon` for sections that omit one.
|
|
2244
2324
|
* `eagerMount`/`preserveState` have no contribution-side equivalent — a contribution
|
|
2245
2325
|
* only exists while its owning panel is mounted and active, so both are left unset.
|
|
2246
2326
|
*/
|
|
@@ -2340,4 +2420,4 @@ declare function computeResizedRect(dir: ResizeDir, dx: number, dy: number, star
|
|
|
2340
2420
|
*/
|
|
2341
2421
|
declare function useColorScheme(): 'dark' | 'light';
|
|
2342
2422
|
|
|
2343
|
-
export { type BuiltInPanelEvents, type ButtonVariant, type CloseOptions, ConfirmationForm, type ConfirmationFormProps, ContextMenu, type ContextMenuAdapter, type ContextMenuCheckbox, type ContextMenuHandle, type ContextMenuItem, type ContextMenuLabel, type ContextMenuPredefinedMessage, type ContextMenuProps, ContextMenuProvider, type ContextMenuSeparator, type ContextMenuSimpleItem, type ContextMenuSubMenu, DefaultContextMenuAdapter, DockableDesktopProvider, type DockableDesktopProviderProps, type DropPosition, type DropTarget, type FloatAnchor, type FloatingWindow, FormContainerContext, type FormContainerContract, FormContainerProvider, type LayoutGridNode, type LayoutLeafNode, type LayoutNode, LeftPanelRenderer, type ManagedWindowConfig, type MenuItemAction, type MessageFormatter, type ModalOptions, ModalStackRenderer, type OpenPanelOptions, type PanelActions, type PanelContribution, PanelContributionProvider, type PanelDefinition, PanelFloatingWindow, type PanelFloatingWindowManagerHandle, type PanelFloatingWindowProps, type PanelInfo, type PanelInstance, type PanelInstanceId, PanelOverlayRoot, type PanelOverlayRootProps, PanelProvider, PanelRegistry, PanelRegistryClass, type PanelRegistryEntry, type PanelSidebarSection, type PanelState, type PanelTitle, PanelToolbar, ToolbarItem as PanelToolbarItem, type PanelToolbarProps, ToolbarSeparator as PanelToolbarSeparator, type PointerDragConfig, type PredefinedMessageKey, type ResizeConstraints, type ResizeDir, type ResizeRect, type ResolvedToastOptions, RightPanelRenderer, type SearchResult, type SerializedLayout, type ShowContextMenuOptions, type SidePanelOptions, SidePanelRenderer, type SidePanelRendererProps, Sidebar, type SidebarContextValue, type SidebarHandle, type SidebarHeaderAction, type SidebarHeaderActionButton, type SidebarHeaderActionCustom, type SidebarProps, type SidebarTab, type SidebarTabContextValue, type SplitDirection, type SplitOrientation, type StyleClasses, type TaskbarVisibility, type ToastAdapter, ToastContainer, type ToastContainerProps, type ToastFunction, type ToastOptions, type ToastPosition, type ToastPromiseMessages, type ToastType, Toolbar, type ToolbarActionItem, ToolbarButton, type ToolbarButtonProps, ToolbarCenter, type ToolbarContextValue, type ToolbarGroupEntry, type ToolbarGroupItem, type ToolbarGroupSubItem, type ToolbarHandle, type ToolbarItem$1 as ToolbarItem, type ToolbarPosition, type ToolbarProps, ToolbarProvider, type ToolbarRadioItem, ToolbarSearchInput, type ToolbarSearchInputProps, type ToolbarSeparator$1 as ToolbarSeparator, ToolbarSpacer, ToolbarToggle, type ToolbarToggleItem, type ToolbarToggleProps, type ToolbarVariant, type UsePanelFloatingWindowReturn, type WindowActions, WindowManager, type WindowManagerProps, WindowManagerProvider, type WindowManagerProviderProps, type WindowState, WorkspaceClient, type WorkspaceClientConfig, computeResizedRect, defaultPredefinedMessages, formatLabel, isSerializable, sidebarSectionToTab, startPointerDrag, toast, useActivePanelContribution, useColorScheme, useFormContainer, useFormatMessage, useMergedSidebarTabs, useMergedToolbarItems, usePanelActions, usePanelContext, usePanelContextMenu, usePanelContribution, usePanelFloatingWindow, usePanelFloatingWindowManager, usePanelId, usePanelSize, usePanelState, usePredefinedMessages, useRegistry, useShowContextMenu, useSidebar, useSidebarTab, useStyleClasses, useToolbar, useWindowManagerActions, useWindowManagerState };
|
|
2423
|
+
export { type BuiltInPanelEvents, type ButtonVariant, type CloseOptions, ConfirmationForm, type ConfirmationFormProps, ContextMenu, type ContextMenuAdapter, type ContextMenuCheckbox, type ContextMenuHandle, type ContextMenuItem, type ContextMenuLabel, type ContextMenuPredefinedMessage, type ContextMenuProps, ContextMenuProvider, type ContextMenuSeparator, type ContextMenuSimpleItem, type ContextMenuSubMenu, DefaultContextMenuAdapter, DockableDesktopProvider, type DockableDesktopProviderProps, type DropPosition, type DropTarget, type FloatAnchor, type FloatingWindow, FormContainerContext, type FormContainerContract, FormContainerProvider, type LayoutGridNode, type LayoutLeafNode, type LayoutNode, LeftPanelRenderer, type ManagedWindowConfig, type MenuItemAction, type MessageFormatter, type ModalOptions, ModalStackRenderer, type OpenPanelOptions, type PanelActions, type PanelContribution, PanelContributionProvider, type PanelDefinition, PanelFloatingWindow, type PanelFloatingWindowManagerHandle, type PanelFloatingWindowProps, type PanelInfo, type PanelInstance, type PanelInstanceId, PanelOverlayRoot, type PanelOverlayRootProps, PanelProvider, PanelRegistry, PanelRegistryClass, type PanelRegistryEntry, type PanelSidebarSection, type PanelState, type PanelTitle, PanelToolbar, ToolbarItem as PanelToolbarItem, type PanelToolbarProps, ToolbarSeparator as PanelToolbarSeparator, type PointerDragConfig, type PredefinedMessageKey, type ResizeConstraints, type ResizeDir, type ResizeRect, type ResolvedToastOptions, RightPanelRenderer, type SearchResult, SecondarySidebar, type SecondarySidebarProps, type SerializedLayout, type ShowContextMenuOptions, type SidePanelOptions, SidePanelRenderer, type SidePanelRendererProps, Sidebar, type SidebarContextValue, type SidebarHandle, type SidebarHeaderAction, type SidebarHeaderActionButton, type SidebarHeaderActionCustom, type SidebarProps, type SidebarTab, type SidebarTabContextValue, type SplitDirection, type SplitOrientation, type StyleClasses, type TaskbarVisibility, type ToastAdapter, ToastContainer, type ToastContainerProps, type ToastFunction, type ToastOptions, type ToastPosition, type ToastPromiseMessages, type ToastType, Toolbar, type ToolbarActionItem, ToolbarButton, type ToolbarButtonProps, ToolbarCenter, type ToolbarContextValue, type ToolbarGroupEntry, type ToolbarGroupItem, type ToolbarGroupSubItem, type ToolbarHandle, type ToolbarItem$1 as ToolbarItem, type ToolbarPosition, type ToolbarProps, ToolbarProvider, type ToolbarRadioItem, ToolbarSearchInput, type ToolbarSearchInputProps, type ToolbarSeparator$1 as ToolbarSeparator, ToolbarSpacer, ToolbarToggle, type ToolbarToggleItem, type ToolbarToggleProps, type ToolbarVariant, type UsePanelFloatingWindowReturn, type WindowActions, WindowManager, type WindowManagerProps, WindowManagerProvider, type WindowManagerProviderProps, type WindowState, WorkspaceClient, type WorkspaceClientConfig, computeResizedRect, defaultPredefinedMessages, formatLabel, isSerializable, sidebarSectionToTab, startPointerDrag, toast, useActivePanelContribution, useColorScheme, useFormContainer, useFormatMessage, useMergedSidebarTabs, useMergedToolbarItems, usePanelActions, usePanelContext, usePanelContextMenu, usePanelContribution, usePanelFloatingWindow, usePanelFloatingWindowManager, usePanelId, usePanelSize, usePanelState, usePredefinedMessages, useRegistry, useShowContextMenu, useSidebar, useSidebarTab, useStyleClasses, useToolbar, useWindowManagerActions, useWindowManagerState };
|
package/dist/index.d.ts
CHANGED
|
@@ -1321,6 +1321,12 @@ interface SidePanelOptions {
|
|
|
1321
1321
|
icon?: React$1.ReactNode;
|
|
1322
1322
|
/** Specific CSS width (e.g. 300, '40%') for the panel container. */
|
|
1323
1323
|
width?: number | string;
|
|
1324
|
+
/**
|
|
1325
|
+
* CSS padding for the panel body content — a number (px) or any CSS value/shorthand
|
|
1326
|
+
* (e.g. `'10px 16px'`). Default: `0` (edge-to-edge) — pass `10` to restore the pre-v6.0.0
|
|
1327
|
+
* default, or any value your content needs.
|
|
1328
|
+
*/
|
|
1329
|
+
bodyPadding?: number | string;
|
|
1324
1330
|
}
|
|
1325
1331
|
/** Configuration options applied when opening a Modal. */
|
|
1326
1332
|
interface ModalOptions {
|
|
@@ -1332,6 +1338,12 @@ interface ModalOptions {
|
|
|
1332
1338
|
size?: 'small' | 'medium' | 'large' | 'fullscreen' | 'auto';
|
|
1333
1339
|
/** If false, hides the modal backdrop exit click and header close button. */
|
|
1334
1340
|
closable?: boolean;
|
|
1341
|
+
/**
|
|
1342
|
+
* CSS padding for the modal body content — a number (px) or any CSS value/shorthand
|
|
1343
|
+
* (e.g. `'10px 16px'`). Default: `0` (edge-to-edge) — pass `10` to restore the pre-v6.0.0
|
|
1344
|
+
* default, or any value your content needs.
|
|
1345
|
+
*/
|
|
1346
|
+
bodyPadding?: number | string;
|
|
1335
1347
|
}
|
|
1336
1348
|
/**
|
|
1337
1349
|
* Represents a rendered instance of a panel or modal in the layout.
|
|
@@ -1479,7 +1491,16 @@ declare const ConfirmationForm: React$1.FC<ConfirmationFormProps>;
|
|
|
1479
1491
|
interface SidebarTab {
|
|
1480
1492
|
id: string;
|
|
1481
1493
|
label: string;
|
|
1482
|
-
icon
|
|
1494
|
+
/** Required unless `hidden` is true — a hidden tab never renders a rail button, so it has no icon to show. */
|
|
1495
|
+
icon?: React$1.ReactNode;
|
|
1496
|
+
/**
|
|
1497
|
+
* Omit this tab's rail button entirely — no icon, no click target — while it
|
|
1498
|
+
* remains fully openable via `openTab()` / `useSidebar().openTab()` / a controlled
|
|
1499
|
+
* `activeTabId`. Use for menu-driven panels with no persistent icon (e.g. a
|
|
1500
|
+
* Google-Maps-style hamburger that opens content not otherwise pinned to the rail).
|
|
1501
|
+
* Default: false
|
|
1502
|
+
*/
|
|
1503
|
+
hidden?: boolean;
|
|
1483
1504
|
/**
|
|
1484
1505
|
* Mount immediately when the Sidebar first renders, not on first user click.
|
|
1485
1506
|
* Implies `preserveState: true`.
|
|
@@ -1582,9 +1603,46 @@ interface SidebarProps {
|
|
|
1582
1603
|
onStripVisibilityChange?: (visible: boolean) => void;
|
|
1583
1604
|
/**
|
|
1584
1605
|
* Show an "X" close button in the expanded drawer's header, as an additional way to collapse
|
|
1585
|
-
* the sidebar (equivalent to clicking the active tab's own icon again). Opt-in. Default: false
|
|
1606
|
+
* the sidebar (equivalent to clicking the active tab's own icon again). Opt-in. Default: false.
|
|
1607
|
+
* Has no effect once the default header is suppressed — via `hideDefaultHeader`, or simply by
|
|
1608
|
+
* passing `renderHeader` (either one is sufficient) — since the entire default header, this
|
|
1609
|
+
* button included, is skipped for every tab in that case.
|
|
1586
1610
|
*/
|
|
1587
1611
|
showCloseButton?: boolean;
|
|
1612
|
+
/**
|
|
1613
|
+
* Suppress the library's own drawer header (title + `showCloseButton`'s close
|
|
1614
|
+
* button) for every tab, so `renderHeader` (or each tab's own `renderContent`)
|
|
1615
|
+
* can supply a header, border, and styling instead. Applies uniformly across
|
|
1616
|
+
* all tabs — there's no per-tab override. Passing `renderHeader` by itself has
|
|
1617
|
+
* the same suppressing effect even if this is left unset — the two conditions
|
|
1618
|
+
* are combined with OR, precisely so that supplying `renderHeader` alone is
|
|
1619
|
+
* never a silent no-op. The close mechanism is unaffected either way: the
|
|
1620
|
+
* `onClose` parameter passed to `renderContent`/`renderHeader`, or
|
|
1621
|
+
* `useSidebarTab().onClose` from anywhere in a tab's content tree.
|
|
1622
|
+
* Default: false
|
|
1623
|
+
*/
|
|
1624
|
+
hideDefaultHeader?: boolean;
|
|
1625
|
+
/**
|
|
1626
|
+
* Custom header renderer used in place of the library's own drawer header.
|
|
1627
|
+
* Passing `renderHeader` is by itself sufficient to suppress the default
|
|
1628
|
+
* header, whether or not `hideDefaultHeader` is also set — the two props are
|
|
1629
|
+
* combined with OR. Called once for whichever tab is currently active, so
|
|
1630
|
+
* the same header markup (e.g. a hamburger icon, a search field, a close
|
|
1631
|
+
* button) is shared uniformly across every tab instead of being repeated
|
|
1632
|
+
* inside each tab's own `renderContent`. Omit `renderHeader` and set
|
|
1633
|
+
* `hideDefaultHeader: true` to render no header at all and let each tab's
|
|
1634
|
+
* `renderContent` supply its own instead.
|
|
1635
|
+
* @param tab - the currently active tab
|
|
1636
|
+
* @param onClose - call to collapse the sidebar drawer
|
|
1637
|
+
* @param onOpen - call to (re-)select this tab
|
|
1638
|
+
*/
|
|
1639
|
+
renderHeader?: (tab: SidebarTab, onClose: () => void, onOpen: () => void) => React$1.ReactNode;
|
|
1640
|
+
/**
|
|
1641
|
+
* @internal Marks this instance as a secondary sidebar for context-broadcasting
|
|
1642
|
+
* purposes. Set automatically by `<SecondarySidebar>` — do not pass this directly.
|
|
1643
|
+
* Default: false
|
|
1644
|
+
*/
|
|
1645
|
+
isSecondary?: boolean;
|
|
1588
1646
|
/** Main workspace content rendered alongside the sidebar. */
|
|
1589
1647
|
children?: React$1.ReactNode;
|
|
1590
1648
|
}
|
|
@@ -1611,6 +1669,10 @@ interface SidebarContextValue {
|
|
|
1611
1669
|
openTab: (tabId: string) => void;
|
|
1612
1670
|
closeDrawer: () => void;
|
|
1613
1671
|
getActiveTab: () => string | null;
|
|
1672
|
+
/** Which side this Sidebar instance is rendering on. */
|
|
1673
|
+
position: 'left' | 'right';
|
|
1674
|
+
/** True if this instance is a `<SecondarySidebar>`, false for a primary `<Sidebar>`. */
|
|
1675
|
+
isSecondary: boolean;
|
|
1614
1676
|
}
|
|
1615
1677
|
/**
|
|
1616
1678
|
* Value provided by `useSidebarTab()`. Available only to components rendered
|
|
@@ -1623,6 +1685,23 @@ interface SidebarTabContextValue {
|
|
|
1623
1685
|
openTab: (tabId: string) => void;
|
|
1624
1686
|
}
|
|
1625
1687
|
declare const Sidebar: React$1.ForwardRefExoticComponent<SidebarProps & React$1.RefAttributes<SidebarHandle>>;
|
|
1688
|
+
/**
|
|
1689
|
+
* Props for {@link SecondarySidebar} — identical to {@link SidebarProps} except
|
|
1690
|
+
* `position` (always the opposite of whatever primary `Sidebar` it's nested inside)
|
|
1691
|
+
* and `isSecondary` (always `true`) are not settable.
|
|
1692
|
+
*/
|
|
1693
|
+
type SecondarySidebarProps = Omit<SidebarProps, 'position' | 'isSecondary'>;
|
|
1694
|
+
/**
|
|
1695
|
+
* A second, independent `Sidebar` instance for the opposite edge of the screen —
|
|
1696
|
+
* same component, same behavior, zero forked code. Must be rendered inside a
|
|
1697
|
+
* primary `Sidebar`'s `children`; automatically takes whichever side that primary
|
|
1698
|
+
* isn't using, so the side is never specified directly.
|
|
1699
|
+
*
|
|
1700
|
+
* @throws Error if rendered without an ancestor `Sidebar`, or nested inside another
|
|
1701
|
+
* `SecondarySidebar` — this library supports exactly one primary and one secondary,
|
|
1702
|
+
* nothing deeper.
|
|
1703
|
+
*/
|
|
1704
|
+
declare const SecondarySidebar: React$1.ForwardRefExoticComponent<SecondarySidebarProps & React$1.RefAttributes<SidebarHandle>>;
|
|
1626
1705
|
/**
|
|
1627
1706
|
* Returns sidebar control functions from anywhere inside a `<Sidebar>` tree,
|
|
1628
1707
|
* including floating panels rendered via `{children}`.
|
|
@@ -2240,7 +2319,8 @@ declare function usePanelContribution(contribution: PanelContribution): void;
|
|
|
2240
2319
|
declare function useActivePanelContribution(): PanelContribution | null;
|
|
2241
2320
|
/**
|
|
2242
2321
|
* Converts a contributed sidebar section into a `SidebarTab` for `<Sidebar tabs={...}>`.
|
|
2243
|
-
* `SidebarTab.icon` is
|
|
2322
|
+
* `SidebarTab.icon` is optional but recommended unless the tab is `hidden`; supply
|
|
2323
|
+
* `fallbackIcon` for sections that omit one.
|
|
2244
2324
|
* `eagerMount`/`preserveState` have no contribution-side equivalent — a contribution
|
|
2245
2325
|
* only exists while its owning panel is mounted and active, so both are left unset.
|
|
2246
2326
|
*/
|
|
@@ -2340,4 +2420,4 @@ declare function computeResizedRect(dir: ResizeDir, dx: number, dy: number, star
|
|
|
2340
2420
|
*/
|
|
2341
2421
|
declare function useColorScheme(): 'dark' | 'light';
|
|
2342
2422
|
|
|
2343
|
-
export { type BuiltInPanelEvents, type ButtonVariant, type CloseOptions, ConfirmationForm, type ConfirmationFormProps, ContextMenu, type ContextMenuAdapter, type ContextMenuCheckbox, type ContextMenuHandle, type ContextMenuItem, type ContextMenuLabel, type ContextMenuPredefinedMessage, type ContextMenuProps, ContextMenuProvider, type ContextMenuSeparator, type ContextMenuSimpleItem, type ContextMenuSubMenu, DefaultContextMenuAdapter, DockableDesktopProvider, type DockableDesktopProviderProps, type DropPosition, type DropTarget, type FloatAnchor, type FloatingWindow, FormContainerContext, type FormContainerContract, FormContainerProvider, type LayoutGridNode, type LayoutLeafNode, type LayoutNode, LeftPanelRenderer, type ManagedWindowConfig, type MenuItemAction, type MessageFormatter, type ModalOptions, ModalStackRenderer, type OpenPanelOptions, type PanelActions, type PanelContribution, PanelContributionProvider, type PanelDefinition, PanelFloatingWindow, type PanelFloatingWindowManagerHandle, type PanelFloatingWindowProps, type PanelInfo, type PanelInstance, type PanelInstanceId, PanelOverlayRoot, type PanelOverlayRootProps, PanelProvider, PanelRegistry, PanelRegistryClass, type PanelRegistryEntry, type PanelSidebarSection, type PanelState, type PanelTitle, PanelToolbar, ToolbarItem as PanelToolbarItem, type PanelToolbarProps, ToolbarSeparator as PanelToolbarSeparator, type PointerDragConfig, type PredefinedMessageKey, type ResizeConstraints, type ResizeDir, type ResizeRect, type ResolvedToastOptions, RightPanelRenderer, type SearchResult, type SerializedLayout, type ShowContextMenuOptions, type SidePanelOptions, SidePanelRenderer, type SidePanelRendererProps, Sidebar, type SidebarContextValue, type SidebarHandle, type SidebarHeaderAction, type SidebarHeaderActionButton, type SidebarHeaderActionCustom, type SidebarProps, type SidebarTab, type SidebarTabContextValue, type SplitDirection, type SplitOrientation, type StyleClasses, type TaskbarVisibility, type ToastAdapter, ToastContainer, type ToastContainerProps, type ToastFunction, type ToastOptions, type ToastPosition, type ToastPromiseMessages, type ToastType, Toolbar, type ToolbarActionItem, ToolbarButton, type ToolbarButtonProps, ToolbarCenter, type ToolbarContextValue, type ToolbarGroupEntry, type ToolbarGroupItem, type ToolbarGroupSubItem, type ToolbarHandle, type ToolbarItem$1 as ToolbarItem, type ToolbarPosition, type ToolbarProps, ToolbarProvider, type ToolbarRadioItem, ToolbarSearchInput, type ToolbarSearchInputProps, type ToolbarSeparator$1 as ToolbarSeparator, ToolbarSpacer, ToolbarToggle, type ToolbarToggleItem, type ToolbarToggleProps, type ToolbarVariant, type UsePanelFloatingWindowReturn, type WindowActions, WindowManager, type WindowManagerProps, WindowManagerProvider, type WindowManagerProviderProps, type WindowState, WorkspaceClient, type WorkspaceClientConfig, computeResizedRect, defaultPredefinedMessages, formatLabel, isSerializable, sidebarSectionToTab, startPointerDrag, toast, useActivePanelContribution, useColorScheme, useFormContainer, useFormatMessage, useMergedSidebarTabs, useMergedToolbarItems, usePanelActions, usePanelContext, usePanelContextMenu, usePanelContribution, usePanelFloatingWindow, usePanelFloatingWindowManager, usePanelId, usePanelSize, usePanelState, usePredefinedMessages, useRegistry, useShowContextMenu, useSidebar, useSidebarTab, useStyleClasses, useToolbar, useWindowManagerActions, useWindowManagerState };
|
|
2423
|
+
export { type BuiltInPanelEvents, type ButtonVariant, type CloseOptions, ConfirmationForm, type ConfirmationFormProps, ContextMenu, type ContextMenuAdapter, type ContextMenuCheckbox, type ContextMenuHandle, type ContextMenuItem, type ContextMenuLabel, type ContextMenuPredefinedMessage, type ContextMenuProps, ContextMenuProvider, type ContextMenuSeparator, type ContextMenuSimpleItem, type ContextMenuSubMenu, DefaultContextMenuAdapter, DockableDesktopProvider, type DockableDesktopProviderProps, type DropPosition, type DropTarget, type FloatAnchor, type FloatingWindow, FormContainerContext, type FormContainerContract, FormContainerProvider, type LayoutGridNode, type LayoutLeafNode, type LayoutNode, LeftPanelRenderer, type ManagedWindowConfig, type MenuItemAction, type MessageFormatter, type ModalOptions, ModalStackRenderer, type OpenPanelOptions, type PanelActions, type PanelContribution, PanelContributionProvider, type PanelDefinition, PanelFloatingWindow, type PanelFloatingWindowManagerHandle, type PanelFloatingWindowProps, type PanelInfo, type PanelInstance, type PanelInstanceId, PanelOverlayRoot, type PanelOverlayRootProps, PanelProvider, PanelRegistry, PanelRegistryClass, type PanelRegistryEntry, type PanelSidebarSection, type PanelState, type PanelTitle, PanelToolbar, ToolbarItem as PanelToolbarItem, type PanelToolbarProps, ToolbarSeparator as PanelToolbarSeparator, type PointerDragConfig, type PredefinedMessageKey, type ResizeConstraints, type ResizeDir, type ResizeRect, type ResolvedToastOptions, RightPanelRenderer, type SearchResult, SecondarySidebar, type SecondarySidebarProps, type SerializedLayout, type ShowContextMenuOptions, type SidePanelOptions, SidePanelRenderer, type SidePanelRendererProps, Sidebar, type SidebarContextValue, type SidebarHandle, type SidebarHeaderAction, type SidebarHeaderActionButton, type SidebarHeaderActionCustom, type SidebarProps, type SidebarTab, type SidebarTabContextValue, type SplitDirection, type SplitOrientation, type StyleClasses, type TaskbarVisibility, type ToastAdapter, ToastContainer, type ToastContainerProps, type ToastFunction, type ToastOptions, type ToastPosition, type ToastPromiseMessages, type ToastType, Toolbar, type ToolbarActionItem, ToolbarButton, type ToolbarButtonProps, ToolbarCenter, type ToolbarContextValue, type ToolbarGroupEntry, type ToolbarGroupItem, type ToolbarGroupSubItem, type ToolbarHandle, type ToolbarItem$1 as ToolbarItem, type ToolbarPosition, type ToolbarProps, ToolbarProvider, type ToolbarRadioItem, ToolbarSearchInput, type ToolbarSearchInputProps, type ToolbarSeparator$1 as ToolbarSeparator, ToolbarSpacer, ToolbarToggle, type ToolbarToggleItem, type ToolbarToggleProps, type ToolbarVariant, type UsePanelFloatingWindowReturn, type WindowActions, WindowManager, type WindowManagerProps, WindowManagerProvider, type WindowManagerProviderProps, type WindowState, WorkspaceClient, type WorkspaceClientConfig, computeResizedRect, defaultPredefinedMessages, formatLabel, isSerializable, sidebarSectionToTab, startPointerDrag, toast, useActivePanelContribution, useColorScheme, useFormContainer, useFormatMessage, useMergedSidebarTabs, useMergedToolbarItems, usePanelActions, usePanelContext, usePanelContextMenu, usePanelContribution, usePanelFloatingWindow, usePanelFloatingWindowManager, usePanelId, usePanelSize, usePanelState, usePredefinedMessages, useRegistry, useShowContextMenu, useSidebar, useSidebarTab, useStyleClasses, useToolbar, useWindowManagerActions, useWindowManagerState };
|