react-dockable-desktop 7.4.0 → 7.5.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.d.cts CHANGED
@@ -824,6 +824,29 @@ interface WorkspaceCore {
824
824
  zIndexBase?: number;
825
825
  }) => void;
826
826
  }
827
+ /**
828
+ * The live workspace state. The component re-renders whenever it changes — or, given a selector,
829
+ * only when the selected value changes.
830
+ *
831
+ * For reads without a subscription, call the workspace's `isOpen()` or `getOpenPanelIds()`.
832
+ *
833
+ * The selector must return a value that stays the same while the state does — a primitive, or a
834
+ * part of the state as it is (`s => s.panels[id]`). A selector that builds a new object or array
835
+ * on each call (`s => ({ n: s.floating.length })`, `s => s.floating.map(...)`) is a new value
836
+ * every time React asks, and React stops with "Maximum update depth exceeded". Select the parts
837
+ * separately, or
838
+ * derive the object with `useMemo` from what you selected.
839
+ *
840
+ * @returns The current workspace state, or the selector's result.
841
+ * @throws Error if used outside `<DockableDesktopProvider>`.
842
+ * @example
843
+ * ```tsx
844
+ * function PanelCount() {
845
+ * const count = useWorkspaceState(s => Object.keys(s.panels).length);
846
+ * return <span>{count} open</span>;
847
+ * }
848
+ * ```
849
+ */
827
850
  declare function useWindowManagerState(): WorkspaceState;
828
851
  declare function useWindowManagerState<T>(selector: (state: WorkspaceState) => T): T;
829
852
  /**
@@ -1516,6 +1539,24 @@ interface RddDesktopProps {
1516
1539
  /** Enables the library's own transitions/animations (tab hover, dock preview, etc.). Never affects the consumer's own page. @default true */
1517
1540
  animations?: boolean;
1518
1541
  }
1542
+ /**
1543
+ * The desktop itself: the docked grid of tab groups, the floating windows, the taskbar of
1544
+ * minimized panels, and the drop targets while a panel is dragged. Render it inside
1545
+ * `<DockableDesktopProvider>`, in a container that gives it a size (`rdd-fill-viewport` fills the
1546
+ * page), and import `react-dockable-desktop/styles.css` once.
1547
+ *
1548
+ * Exported as `RddDesktop`.
1549
+ *
1550
+ * @example
1551
+ * ```tsx
1552
+ * <DockableDesktopProvider workspace={workspace}>
1553
+ * <div className="rdd-fill-viewport">
1554
+ * <RddDesktop skin="vscode" taskbarVisibility="autohide" />
1555
+ * </div>
1556
+ * <RddModals />
1557
+ * </DockableDesktopProvider>
1558
+ * ```
1559
+ */
1519
1560
  declare const WindowManager: React$1.FC<RddDesktopProps>;
1520
1561
 
1521
1562
  /**
@@ -2182,7 +2223,7 @@ interface RddPanelToolbarProps {
2182
2223
  variant?: ToolbarVariant;
2183
2224
  /** Default button style inherited by `ToolbarButton` and `ToolbarToggle` children. @default 'ghost' */
2184
2225
  buttonVariant?: ButtonVariant;
2185
- /** Icon size in pixels for all buttons in this toolbar. Falls back to CSS default when unset. */
2226
+ /** Button size in pixels for all buttons in this toolbar (sets `--rdd-panel-toolbar-btn-size`). The icon inside follows `--rdd-panel-toolbar-icon-size`. Falls back to the stylesheet when unset. */
2186
2227
  buttonSize?: number;
2187
2228
  style?: React$1.CSSProperties;
2188
2229
  className?: string;
@@ -2201,7 +2242,7 @@ interface RddPanelToolbarProps {
2201
2242
  declare function PanelToolbar({ position, variant, buttonVariant, buttonSize, style, className, children }: RddPanelToolbarProps): React$1.ReactElement;
2202
2243
  /** Props for `<RddToolbarButton>`. */
2203
2244
  interface RddToolbarButtonProps {
2204
- /** Button icon — typically a small SVG component. */
2245
+ /** Button icon: an SVG, an icon component or an icon-font glyph. Pass no size: the library sizes it with `--rdd-panel-toolbar-icon-size`. */
2205
2246
  icon: React$1.ReactNode;
2206
2247
  /** Click handler. */
2207
2248
  onClick(): void;
@@ -2215,7 +2256,7 @@ interface RddToolbarButtonProps {
2215
2256
  declare function ToolbarButton({ icon, onClick, disabled, title, variant }: RddToolbarButtonProps): React$1.ReactElement;
2216
2257
  /** Props for `<RddToolbarToggle>`. */
2217
2258
  interface RddToolbarToggleProps {
2218
- /** Button icon — typically a small SVG component. */
2259
+ /** Button icon: an SVG, an icon component or an icon-font glyph. Pass no size: the library sizes it with `--rdd-panel-toolbar-icon-size`. */
2219
2260
  icon: React$1.ReactNode;
2220
2261
  /** Whether the toggle is in the active/pressed state. Sets `aria-pressed` automatically. */
2221
2262
  active: boolean;
package/dist/index.d.ts CHANGED
@@ -824,6 +824,29 @@ interface WorkspaceCore {
824
824
  zIndexBase?: number;
825
825
  }) => void;
826
826
  }
827
+ /**
828
+ * The live workspace state. The component re-renders whenever it changes — or, given a selector,
829
+ * only when the selected value changes.
830
+ *
831
+ * For reads without a subscription, call the workspace's `isOpen()` or `getOpenPanelIds()`.
832
+ *
833
+ * The selector must return a value that stays the same while the state does — a primitive, or a
834
+ * part of the state as it is (`s => s.panels[id]`). A selector that builds a new object or array
835
+ * on each call (`s => ({ n: s.floating.length })`, `s => s.floating.map(...)`) is a new value
836
+ * every time React asks, and React stops with "Maximum update depth exceeded". Select the parts
837
+ * separately, or
838
+ * derive the object with `useMemo` from what you selected.
839
+ *
840
+ * @returns The current workspace state, or the selector's result.
841
+ * @throws Error if used outside `<DockableDesktopProvider>`.
842
+ * @example
843
+ * ```tsx
844
+ * function PanelCount() {
845
+ * const count = useWorkspaceState(s => Object.keys(s.panels).length);
846
+ * return <span>{count} open</span>;
847
+ * }
848
+ * ```
849
+ */
827
850
  declare function useWindowManagerState(): WorkspaceState;
828
851
  declare function useWindowManagerState<T>(selector: (state: WorkspaceState) => T): T;
829
852
  /**
@@ -1516,6 +1539,24 @@ interface RddDesktopProps {
1516
1539
  /** Enables the library's own transitions/animations (tab hover, dock preview, etc.). Never affects the consumer's own page. @default true */
1517
1540
  animations?: boolean;
1518
1541
  }
1542
+ /**
1543
+ * The desktop itself: the docked grid of tab groups, the floating windows, the taskbar of
1544
+ * minimized panels, and the drop targets while a panel is dragged. Render it inside
1545
+ * `<DockableDesktopProvider>`, in a container that gives it a size (`rdd-fill-viewport` fills the
1546
+ * page), and import `react-dockable-desktop/styles.css` once.
1547
+ *
1548
+ * Exported as `RddDesktop`.
1549
+ *
1550
+ * @example
1551
+ * ```tsx
1552
+ * <DockableDesktopProvider workspace={workspace}>
1553
+ * <div className="rdd-fill-viewport">
1554
+ * <RddDesktop skin="vscode" taskbarVisibility="autohide" />
1555
+ * </div>
1556
+ * <RddModals />
1557
+ * </DockableDesktopProvider>
1558
+ * ```
1559
+ */
1519
1560
  declare const WindowManager: React$1.FC<RddDesktopProps>;
1520
1561
 
1521
1562
  /**
@@ -2182,7 +2223,7 @@ interface RddPanelToolbarProps {
2182
2223
  variant?: ToolbarVariant;
2183
2224
  /** Default button style inherited by `ToolbarButton` and `ToolbarToggle` children. @default 'ghost' */
2184
2225
  buttonVariant?: ButtonVariant;
2185
- /** Icon size in pixels for all buttons in this toolbar. Falls back to CSS default when unset. */
2226
+ /** Button size in pixels for all buttons in this toolbar (sets `--rdd-panel-toolbar-btn-size`). The icon inside follows `--rdd-panel-toolbar-icon-size`. Falls back to the stylesheet when unset. */
2186
2227
  buttonSize?: number;
2187
2228
  style?: React$1.CSSProperties;
2188
2229
  className?: string;
@@ -2201,7 +2242,7 @@ interface RddPanelToolbarProps {
2201
2242
  declare function PanelToolbar({ position, variant, buttonVariant, buttonSize, style, className, children }: RddPanelToolbarProps): React$1.ReactElement;
2202
2243
  /** Props for `<RddToolbarButton>`. */
2203
2244
  interface RddToolbarButtonProps {
2204
- /** Button icon — typically a small SVG component. */
2245
+ /** Button icon: an SVG, an icon component or an icon-font glyph. Pass no size: the library sizes it with `--rdd-panel-toolbar-icon-size`. */
2205
2246
  icon: React$1.ReactNode;
2206
2247
  /** Click handler. */
2207
2248
  onClick(): void;
@@ -2215,7 +2256,7 @@ interface RddToolbarButtonProps {
2215
2256
  declare function ToolbarButton({ icon, onClick, disabled, title, variant }: RddToolbarButtonProps): React$1.ReactElement;
2216
2257
  /** Props for `<RddToolbarToggle>`. */
2217
2258
  interface RddToolbarToggleProps {
2218
- /** Button icon — typically a small SVG component. */
2259
+ /** Button icon: an SVG, an icon component or an icon-font glyph. Pass no size: the library sizes it with `--rdd-panel-toolbar-icon-size`. */
2219
2260
  icon: React$1.ReactNode;
2220
2261
  /** Whether the toggle is in the active/pressed state. Sets `aria-pressed` automatically. */
2221
2262
  active: boolean;