react-dockable-desktop 3.2.0 → 4.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/README.md +50 -16
- package/dist/index.cjs +5 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +674 -210
- package/dist/index.d.ts +674 -210
- package/dist/index.js +5 -6
- package/dist/index.js.map +1 -1
- package/dist/styles.css +876 -237
- package/package.json +6 -5
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# React Dockable Desktop
|
|
1
|
+
# React Dockable Desktop
|
|
2
2
|
|
|
3
|
-
[](https://www.npmjs.com/package/react-dockable-desktop)
|
|
4
4
|
[](https://www.typescriptlang.org/)
|
|
5
5
|
[](#touch--mobile)
|
|
6
6
|
[](#license)
|
|
@@ -19,7 +19,8 @@ A premium dockable layout engine for React. Build desktop-class applications wit
|
|
|
19
19
|
|
|
20
20
|
- **Split-Docking Grid** — drag panels to split any zone into rows/columns or group into tabbed containers
|
|
21
21
|
- **Workspace Edge Docking** — drag to the outer edges to dock a panel as a full-width or full-height strip
|
|
22
|
-
- **Floating Windows** — pop panels into freely resizable floating windows; 8-direction resize handles (N/NE/E/SE/S/SW/W/NW), maximize, minimize
|
|
22
|
+
- **Floating Windows** — pop panels into freely resizable floating windows; 8-direction resize handles (N/NE/E/SE/S/SW/W/NW), maximize, minimize; drag to a workspace corner to anchor it there — anchored windows stack with 8 px gaps and reposition when the viewport resizes
|
|
23
|
+
- **Panel Overlay** — per-panel overlay layer with anchored toolbars (`PanelToolbar`, `ToolbarButton`, `ToolbarToggle`, async search) and corner-anchored floating windows that stack, drag, and dock; `usePanelFloatingWindowManager()` opens N named windows dynamically from data or event handlers
|
|
23
24
|
- **Touch & Mobile Ready** — full iPad and Android support: long-press to drag tabs, touch resize, 44px coarse-pointer targets throughout
|
|
24
25
|
- **Zero-Unmount DOM Persistence** — panel DOM nodes are moved, never destroyed; WebGL, maps, terminals, and forms retain full state
|
|
25
26
|
- **i18n & RTL** — full Right-to-Left layout support; `dir="rtl"` flips every control, tab order, and drop zone automatically
|
|
@@ -27,6 +28,8 @@ A premium dockable layout engine for React. Build desktop-class applications wit
|
|
|
27
28
|
- **Imperative API** — `WorkspaceClient` opens, closes, focuses, and serializes panels from anywhere — inside or outside React
|
|
28
29
|
- **Layout Serialization** — save and restore the full workspace as a JSON string; survives page reloads
|
|
29
30
|
- **7 Built-in Skins** — VSCode, macOS, Chrome, Slate, Nord, Obsidian, Tokyo — all fully themeable via CSS variables
|
|
31
|
+
- **Toast Notifications** — imperative singleton `toast.info/success/warning/error/promise()` with queue, pause-on-hover, progress bar, and a `ToastAdapter` interface for delegating to a third-party notification library
|
|
32
|
+
- **Zero extra dependencies** — no runtime dependencies beyond React itself; everything is bundled in
|
|
30
33
|
- **TypeScript-first** — complete type definitions included; no separate `@types/` package needed
|
|
31
34
|
|
|
32
35
|
---
|
|
@@ -34,17 +37,16 @@ A premium dockable layout engine for React. Build desktop-class applications wit
|
|
|
34
37
|
## Installation
|
|
35
38
|
|
|
36
39
|
```bash
|
|
37
|
-
npm install react-dockable-desktop
|
|
40
|
+
npm install react-dockable-desktop
|
|
38
41
|
```
|
|
39
42
|
|
|
40
|
-
Import styles in your app entry file
|
|
43
|
+
Import styles in your app entry file:
|
|
41
44
|
|
|
42
45
|
```ts
|
|
43
|
-
import 'replace-react-contexify/styles.css';
|
|
44
46
|
import 'react-dockable-desktop/styles.css';
|
|
45
47
|
```
|
|
46
48
|
|
|
47
|
-
**Requirements:** React ≥ 16.8 · Node ≥ 18
|
|
49
|
+
**Requirements:** React ≥ 16.8 · Node ≥ 18 · No other runtime dependencies
|
|
48
50
|
|
|
49
51
|
---
|
|
50
52
|
|
|
@@ -150,6 +152,7 @@ Call these inside any component within the `DockableDesktopProvider` tree:
|
|
|
150
152
|
| `useSidebar()` | `SidebarContextValue` | Open/close Sidebar tabs from any component in the Sidebar tree |
|
|
151
153
|
| `useSidebarTab()` | `SidebarTabContext` | Self-control for content inside a Sidebar tab |
|
|
152
154
|
| `usePanelContextMenu(items)` | `void` | Inject dynamic context menu items into this panel's right-click menu |
|
|
155
|
+
| `usePanelFloatingWindowManager()` | `PanelFloatingWindowManagerHandle` | Open/close N named floating windows inside a panel overlay at runtime; each independently anchored, dockable, and resizable |
|
|
153
156
|
| `useRegistry()` | `PanelRegistryClass` | The scoped panel registry for the current provider |
|
|
154
157
|
| `useFormatMessage()` | `MessageFormatter` | i18n formatter matching the current provider's locale |
|
|
155
158
|
|
|
@@ -169,10 +172,10 @@ const panelCount = useWindowManagerState(s => Object.keys(s.panels).length);
|
|
|
169
172
|
const workspace = new WorkspaceClient({ panels, initialState?, formatMessage?, dir? });
|
|
170
173
|
|
|
171
174
|
// Panel lifecycle
|
|
172
|
-
workspace.openPanel(id, component, options?) // options: title, initialTarget,
|
|
175
|
+
workspace.openPanel(id, component, options?) // options: title, initialTarget, anchor
|
|
173
176
|
workspace.closePanel(id)
|
|
174
177
|
workspace.focusPanel(id) // raises floating / selects tab for docked
|
|
175
|
-
workspace.floatPanel(id, rect?)
|
|
178
|
+
workspace.floatPanel(id, rect?, anchor?) // detach to a floating window; optional corner anchor
|
|
176
179
|
workspace.dockPanel(id) // return floating to the grid
|
|
177
180
|
workspace.minimizePanel(id)
|
|
178
181
|
workspace.restorePanel(id)
|
|
@@ -260,19 +263,28 @@ Touch support is built in for v3.1.0+. No extra setup required:
|
|
|
260
263
|
|
|
261
264
|
## i18n & RTL
|
|
262
265
|
|
|
266
|
+
The library does **not** auto-detect direction — the consuming app owns it. Two things must be wired together:
|
|
267
|
+
|
|
263
268
|
```tsx
|
|
269
|
+
// 1. Keep html[dir] in sync for portals (ContextMenu, flyout, Toast)
|
|
270
|
+
// that render into document.body and need CSS direction inheritance.
|
|
271
|
+
useEffect(() => {
|
|
272
|
+
document.documentElement.dir = isRtl ? 'rtl' : 'ltr';
|
|
273
|
+
}, [isRtl]);
|
|
274
|
+
|
|
275
|
+
// 2. Pass dir prop to the provider — controls workspace layout engine.
|
|
264
276
|
<DockableDesktopProvider
|
|
265
|
-
dir=
|
|
277
|
+
dir={isRtl ? 'rtl' : 'ltr'}
|
|
266
278
|
formatMessage={(msg) => intl.formatMessage({ id: msg.id, defaultMessage: msg.defaultMessage })}
|
|
267
279
|
predefinedMessages={customMessages}
|
|
268
280
|
>
|
|
269
281
|
```
|
|
270
282
|
|
|
271
|
-
`dir` can be `'ltr'` (default) or `'rtl'`. All layout, split directions, tab ordering, drop zones, and context menus flip automatically.
|
|
283
|
+
`dir` can be `'ltr'` (default) or `'rtl'`. All layout, split directions, tab ordering, floating window controls, drop zones, sidebars, and context menus flip automatically.
|
|
272
284
|
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
285
|
+
Direction is **independent of locale** — you can have Arabic translations with LTR layout, or RTL without locale changes.
|
|
286
|
+
|
|
287
|
+
See the [RTL Support guide](https://felipecarrillo100.github.io/react-dockable-desktop/guide/rtl) for the complete wiring pattern and macOS skin notes.
|
|
276
288
|
|
|
277
289
|
---
|
|
278
290
|
|
|
@@ -301,6 +313,26 @@ All built-in skins include dark and light variants. Create your own skin by over
|
|
|
301
313
|
|
|
302
314
|
## What's New
|
|
303
315
|
|
|
316
|
+
### v4.3.0
|
|
317
|
+
- **Workspace corner anchor zones** — drag any panel (floating or docked tab) to a workspace corner to pin it there. Four 80×80 px snap zones appear during drag; same visual style as the inner panel drop zones. Anchored windows stack with 8 px gaps, uncapped, and reposition automatically on viewport resize.
|
|
318
|
+
- **`anchor` option on `openPanel` and `floatPanel`** — spawn a new floating window pre-anchored: `openPanel('id', 'comp', { initialTarget: 'floating', anchor: 'top-right' })` or `floatPanel('id', undefined, 'bottom-left')`.
|
|
319
|
+
- **`defaultAnchor` in panel registry** — set `defaultAnchor: 'top-left'` in `PanelRegistryEntry.defaultOptions` so every instance of that component opens anchored.
|
|
320
|
+
- **Full RTL support** — floating window drop zones, edge triggers, and corner snap zones all mirror correctly when `dir="rtl"`.
|
|
321
|
+
- **Removed:** `openPanel` options `stickyRight` / `stickyBottom` (replaced by `anchor`). Saved layouts are automatically migrated.
|
|
322
|
+
|
|
323
|
+
### v4.2.0
|
|
324
|
+
- **Toast Notifications** — zero-dependency `toast.info/success/warning/error/promise()` singleton. `<ToastContainer>` renders via `createPortal`; supports configurable position, width, max-visible queue, pause-on-hover, opt-in progress bar, and auto-dismiss. `ToastAdapter` lets you delegate to Ant Design, MUI, Sonner, or any other notification library without changing call sites. All colors inherit the active skin automatically.
|
|
325
|
+
|
|
326
|
+
### v4.1.0
|
|
327
|
+
- **Panel Overlay system** — `PanelOverlayRoot`, `PanelToolbar`, `PanelFloatingWindow`, and `usePanelFloatingWindowManager` bring per-panel toolbars and dynamically-spawned corner-anchored floating info windows to any panel.
|
|
328
|
+
- **`usePanelFloatingWindowManager()`** — imperative hook for opening N named floating windows from data or event handlers; all windows share z-ordering, drag, and corner-docking infrastructure.
|
|
329
|
+
- **Toolbar primitives** — `ToolbarButton`, `ToolbarToggle`, `PanelToolbarSeparator`, `ToolbarSpacer`, `ToolbarCenter`, `ToolbarSearchInput` compose panel toolbar content.
|
|
330
|
+
|
|
331
|
+
### v4.0.0
|
|
332
|
+
- **Built-in `<ContextMenu>`** — zero-dependency context menu, portal-rendered and styled with design tokens. No extra package or CSS import needed.
|
|
333
|
+
- **`ContextMenuAdapter` interface** — swap the default menu for your own design-system implementation via `<WindowManager contextMenuAdapter={...} />`.
|
|
334
|
+
- **New exports** — `ContextMenu`, `DefaultContextMenuAdapter`, `ContextMenuHandle`, `ContextMenuAdapter`, `ShowContextMenuOptions`.
|
|
335
|
+
|
|
304
336
|
### v3.2.0
|
|
305
337
|
- **Per-skin active state design language** — Sidebar tabs and Toolbar buttons now use a per-skin visual pattern (transparent bar, floating chip, pill, line, neon glow), driven by new CSS design tokens — fully overridable in custom skins. CSS-only, no API changes.
|
|
306
338
|
- **Documentation overhaul** — All guides updated to cover the full v3.1.0 API surface.
|
|
@@ -331,7 +363,7 @@ All built-in skins include dark and light variants. Create your own skin by over
|
|
|
331
363
|
| `bringToFront(id)` | `focusPanel(id)` — works for both floating and docked panels |
|
|
332
364
|
| `setActivePanel(id)` | `focusPanel(id)` |
|
|
333
365
|
|
|
334
|
-
Full details in the [Migration Guide](https://felipecarrillo100.github.io/react-dockable-desktop/guide/migration).
|
|
366
|
+
Full details in the [Migration Guide](https://felipecarrillo100.github.io/react-dockable-desktop/guide/migration) and the [Changelog](https://github.com/felipecarrillo100/react-dockable-desktop/releases).
|
|
335
367
|
|
|
336
368
|
---
|
|
337
369
|
|
|
@@ -354,7 +386,9 @@ Complete guides, API reference, and interactive demo at:
|
|
|
354
386
|
| [Theming](https://felipecarrillo100.github.io/react-dockable-desktop/guide/theming) | CSS variables, custom skins, dark/light modes |
|
|
355
387
|
| [Advanced Topics](https://felipecarrillo100.github.io/react-dockable-desktop/guide/advanced) | RTL, multiple workspaces, custom header actions |
|
|
356
388
|
| [Best Practices](https://felipecarrillo100.github.io/react-dockable-desktop/guide/best-practices) | Patterns for production-ready implementations |
|
|
357
|
-
| [
|
|
389
|
+
| [Panel Overlay](https://felipecarrillo100.github.io/react-dockable-desktop/guide/panel-overlay) | `PanelOverlayRoot`, panel toolbars, `PanelFloatingWindow`, `usePanelFloatingWindowManager` |
|
|
390
|
+
| [Toast Notifications](https://felipecarrillo100.github.io/react-dockable-desktop/guide/toast) | `toast` singleton, `<ToastContainer>`, queue behaviour, theming, `ToastAdapter` |
|
|
391
|
+
| [Migration Guide](https://felipecarrillo100.github.io/react-dockable-desktop/guide/migration) | Upgrade from v1 → v2 → v3 → v4 |
|
|
358
392
|
| [API Reference](https://felipecarrillo100.github.io/react-dockable-desktop/api/) | Full type-level reference for all exports |
|
|
359
393
|
|
|
360
394
|
---
|