vue-dockable-desktop 1.9.0 → 1.10.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/CHANGELOG.md +42 -0
- package/dist/core/dockRules.d.ts +9 -0
- package/dist/core/panelMenu.d.ts +5 -0
- package/dist/core/registry.d.ts +13 -0
- package/dist/core/workspace.d.ts +9 -1
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +512 -429
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +25 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -11,6 +11,48 @@ correspondence lives, alongside the feature-by-feature map in [docs/PARITY.md](d
|
|
|
11
11
|
|
|
12
12
|
## [Unreleased]
|
|
13
13
|
|
|
14
|
+
## [1.10.0] — 2026-10-06
|
|
15
|
+
|
|
16
|
+
**Parity: react-dockable-desktop 7.9.0.** Control over where users can move panels: per-kind rules and
|
|
17
|
+
an app-wide veto, all opt-in. Without them nothing changes, and the app's own calls are never
|
|
18
|
+
restricted. Same names as rdd 7.9.0.
|
|
19
|
+
|
|
20
|
+
### Added
|
|
21
|
+
|
|
22
|
+
- **`canFloat` and `canDock` per kind**, next to `canDrag`, `canMinimize` and `canClose`.
|
|
23
|
+
`canFloat: false` keeps a panel in the grid: a tab drag can't end in a floating window, and
|
|
24
|
+
"Float Window" and the taskbar's "Maximize" are hidden. `canDock: false` keeps a panel floating:
|
|
25
|
+
dragging it offers no group, tab or edge targets.
|
|
26
|
+
- **`canDrop`, an app-wide veto.** `createWorkspace({ canDrop: ({ panelId, component, to }) => boolean })`
|
|
27
|
+
is asked for every place a dragged panel could go, and for the "Float" and "Maximize" menu items;
|
|
28
|
+
`to` is a `PanelDropTarget` (a group, an edge, or a float). A forbidden target isn't offered, and
|
|
29
|
+
it's asked again at release. Positions and corners are the ones the move applies, mirrored under
|
|
30
|
+
RTL. If it throws, the move is allowed and the error is logged. New types: `PanelDrop`,
|
|
31
|
+
`PanelDropTarget`.
|
|
32
|
+
- Both apply only to what the user does; the app's own calls always work.
|
|
33
|
+
|
|
34
|
+
### Fixed
|
|
35
|
+
|
|
36
|
+
- **A drag built on `startPointerDrag` could outlive its element.** It ended on pointerup,
|
|
37
|
+
pointercancel and window blur, but not when the capturing element was removed mid-drag (an
|
|
38
|
+
overlay widget closed during its own drag), which left its listeners attached and its classes on
|
|
39
|
+
the page. It now also ends on a lost pointer capture, listened for on the document, where browsers
|
|
40
|
+
fire it; `onCancel` runs if given.
|
|
41
|
+
|
|
42
|
+
### Docs
|
|
43
|
+
|
|
44
|
+
- Layout (Chapter 4): **Controlling where users can move panels**. Panels (Chapter 3) and the API
|
|
45
|
+
reference: the new options. `PARITY.md`: the rdd 7.9.0 trace.
|
|
46
|
+
|
|
47
|
+
### Tests
|
|
48
|
+
|
|
49
|
+
- `test/components/releaseB.test.ts` (12 tests): `canFloat` (no float on nothing, no corners, no
|
|
50
|
+
"Float Window" or "Maximize" from a group, the app's `floatPanel` still works), `canDock` (no group
|
|
51
|
+
or edge targets, only corners), `canDrop` (its argument, vetoed zones and edges not offered, RTL
|
|
52
|
+
positions, tab insertion into a vetoed group, rules changed mid-drag for zones and tabs, a throwing
|
|
53
|
+
`canDrop`, no rules meaning every target), and `startPointerDrag` ending on a lost capture. Each
|
|
54
|
+
rule was seen failing with it broken. `api-surface.json` gains the two types.
|
|
55
|
+
|
|
14
56
|
## [1.9.0] — 2026-10-06
|
|
15
57
|
|
|
16
58
|
**Parity: react-dockable-desktop 7.8.0.** More control over how the desktop looks and where panels
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Docking rules (1.10.0): what the *user* may do with a panel. The kind's own `canFloat` /
|
|
3
|
+
* `canDock` first, then the workspace's `canDrop`. Never consulted by the app's own calls.
|
|
4
|
+
*/
|
|
5
|
+
import type { PanelDropTarget } from '../types';
|
|
6
|
+
import type { Workspace } from './workspace';
|
|
7
|
+
type RuleHost = Pick<Workspace<never>, 'state' | 'registry' | 'config'>;
|
|
8
|
+
export declare function isDropAllowed(ws: RuleHost, panelId: string, to: PanelDropTarget): boolean;
|
|
9
|
+
export {};
|
package/dist/core/panelMenu.d.ts
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
import type { ContextMenuItem } from './contextMenu';
|
|
9
9
|
import type { PanelDefaultOptions } from './registry';
|
|
10
10
|
import type { Label, MessageDescriptor } from '../types';
|
|
11
|
+
import type { Workspace } from './workspace';
|
|
11
12
|
/**
|
|
12
13
|
* Just enough of the workspace to build a menu, so this module does not depend on the store.
|
|
13
14
|
*
|
|
@@ -19,6 +20,10 @@ interface MenuHost {
|
|
|
19
20
|
format: (label: Label | undefined) => string;
|
|
20
21
|
messages: Record<string, MessageDescriptor>;
|
|
21
22
|
panelMenuItems: (id: string) => ContextMenuItem[];
|
|
23
|
+
/** For the docking rules (1.10.0): floating is a move they decide. */
|
|
24
|
+
state: Workspace<never>['state'];
|
|
25
|
+
registry: Workspace<never>['registry'];
|
|
26
|
+
config: Workspace<never>['config'];
|
|
22
27
|
}
|
|
23
28
|
export interface PanelMenuActions {
|
|
24
29
|
float: () => void;
|
package/dist/core/registry.d.ts
CHANGED
|
@@ -23,6 +23,19 @@ export interface PanelDefaultOptions {
|
|
|
23
23
|
canMinimize?: boolean;
|
|
24
24
|
/** Allow dragging the tab, which is also what allows floating by drag. @default true */
|
|
25
25
|
canDrag?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* `false`: the user can't make this panel floating. A tab drag can't end in a floating window
|
|
28
|
+
* (dropped on nothing or on a corner, it stays where it was), and "Float Window" and the taskbar's
|
|
29
|
+
* "Maximize" are hidden. A window the app floated itself can still be moved. The app's own
|
|
30
|
+
* `floatPanel` always works. @default true (1.10.0)
|
|
31
|
+
*/
|
|
32
|
+
canFloat?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* `false`: the user can't dock this panel. Dragging it offers no group, tab or edge targets
|
|
35
|
+
* (corners still pin a floating window), so it stays floating. The app's own docking calls always
|
|
36
|
+
* work; give the kind `initialTarget: 'floating'` so it opens floating. @default true (1.10.0)
|
|
37
|
+
*/
|
|
38
|
+
canDock?: boolean;
|
|
26
39
|
/** Show a letter tile instead of a live thumbnail in the taskbar hover preview. @default false */
|
|
27
40
|
disableLivePreview?: boolean;
|
|
28
41
|
/**
|
package/dist/core/workspace.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { App, Component, ComputedRef, InjectionKey } from 'vue';
|
|
2
|
-
import type { DirtyStateOptions, DropPosition, FloatAnchor, FloatingWindow, Label, LayoutNode, MessageDescriptor, MessageFormatter, PanelInfo, SplitDirection } from '../types';
|
|
2
|
+
import type { DirtyStateOptions, DropPosition, FloatAnchor, PanelDrop, FloatingWindow, Label, LayoutNode, MessageDescriptor, MessageFormatter, PanelInfo, SplitDirection } from '../types';
|
|
3
3
|
import { PanelRegistry } from './registry';
|
|
4
4
|
import type { PanelDefaultOptions } from './registry';
|
|
5
5
|
import type { ContextMenuItem, ContextMenuRequest, ShowContextMenuOptions } from './contextMenu';
|
|
@@ -43,6 +43,14 @@ export interface WorkspaceConfig {
|
|
|
43
43
|
* rendered elements, which is the part that can actually break.
|
|
44
44
|
*/
|
|
45
45
|
classes?: HostClasses;
|
|
46
|
+
/**
|
|
47
|
+
* Veto where users can move panels (1.10.0). Called for each place a dragged panel could go, and
|
|
48
|
+
* for the built-in "Float" and "Maximize" menu items: return `false` and that target isn't offered
|
|
49
|
+
* and the move doesn't happen. It runs after the kind's own `canFloat` / `canDock`, and only for
|
|
50
|
+
* what the user does: the app's own calls always work. Keep it fast and pure; it runs while the
|
|
51
|
+
* pointer moves.
|
|
52
|
+
*/
|
|
53
|
+
canDrop?: (drop: PanelDrop) => boolean;
|
|
46
54
|
}
|
|
47
55
|
/** Consumer classes added to the library's chrome. Every field is optional. */
|
|
48
56
|
export interface HostClasses {
|