react-dockable-desktop 7.4.0 → 7.4.1

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
  /**
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
  /**