vue-dockable-desktop 1.3.0 → 1.5.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/CHANGELOG.md +134 -0
- package/README.md +13 -4
- package/dist/core/dragResize.d.ts +6 -1
- package/dist/core/layoutTree.d.ts +3 -2
- package/dist/core/messages.d.ts +4 -1
- package/dist/core/serialize.d.ts +7 -0
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +900 -838
- package/dist/index.js.map +1 -1
- package/dist/styles.css +446 -318
- package/dist/types.d.ts +7 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -11,6 +11,140 @@ correspondence lives, alongside the feature-by-feature map in [docs/PARITY.md](d
|
|
|
11
11
|
|
|
12
12
|
## [Unreleased]
|
|
13
13
|
|
|
14
|
+
## [1.5.1] — 2026-10-01
|
|
15
|
+
|
|
16
|
+
**Parity: react-dockable-desktop 7.4.1 fixes.** From a review of 1.5.0. No API changes.
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
|
|
20
|
+
- **A message's placeholder was replaced only once**: `'{n} of {n}'` read `'2 of {n}'`. The
|
|
21
|
+
default formatter replaces every `{key}` now, and the workspace's `format` uses the same
|
|
22
|
+
function instead of a copy of it.
|
|
23
|
+
- **The window losing focus mid-drag left the drag armed.** After an alt-tab, the pointer
|
|
24
|
+
listeners, the drop target and `vdd-dragging-active` stayed, and the next release docked the
|
|
25
|
+
panel into the target it had been over. A `blur` now ends a tab drag (mouse or touch) and a
|
|
26
|
+
floating window's title-bar drag as a `pointercancel` does. `startPointerDrag` ends on `blur`
|
|
27
|
+
too, and takes an optional `onCancel`; the floating window's title bar uses it, so a cancel
|
|
28
|
+
no longer docks the window into the target it was over.
|
|
29
|
+
- **Layout repair** drops a group's panel id that the layout's `panels` doesn't have, and gives
|
|
30
|
+
a split whose sizes don't match its children, or aren't finite positive numbers, even sizes
|
|
31
|
+
(they reached the style as `flex-basis: NaN%`). Each is named in the development warning.
|
|
32
|
+
- **A throwing event subscriber stopped delivery to the others**, and threw into the action
|
|
33
|
+
that published — `loadLayout`, `openPanel`, a close. Each subscriber's error is logged with
|
|
34
|
+
`console.error`, naming the event, and delivery goes on.
|
|
35
|
+
|
|
36
|
+
### Tests
|
|
37
|
+
|
|
38
|
+
- `test/store/reviewFixes.test.ts` (placeholders, layout repair, the event bus) and
|
|
39
|
+
`test/components/dragBlur.test.ts` (mouse, touch and title-bar drags, with uninterrupted
|
|
40
|
+
drags as controls), ported from rdd 7.4.1's `Patch741.test.ts` and `DragBlur.test.tsx`. Each
|
|
41
|
+
seen failing before its fix and with it removed.
|
|
42
|
+
|
|
43
|
+
## [1.5.0] — 2026-09-30
|
|
44
|
+
|
|
45
|
+
**Parity: react-dockable-desktop 6.3.1, plus react-dockable-desktop 7.2.0–7.4.0's skin branding
|
|
46
|
+
and field-report fixes.** From a consumer's field report: fixed dropdowns inside frosted windows,
|
|
47
|
+
direction for the sidebar and toasts, translated titles, and a quieter restore.
|
|
48
|
+
|
|
49
|
+
### Added
|
|
50
|
+
|
|
51
|
+
- **Title functions**: a title (a panel's, a window's, a drawer's, a modal's, a widget's) can be
|
|
52
|
+
`() => string`. The library calls it each time it renders the title, so a function that reads
|
|
53
|
+
your locale ref follows a language change on its own — a translated *string* is fixed in the
|
|
54
|
+
language active when the panel opened. A function isn't saved in a layout: the restored panel
|
|
55
|
+
takes the title its type is registered with. `Label` is now
|
|
56
|
+
`string | MessageDescriptor | (() => string)`.
|
|
57
|
+
- **Reduced motion**: the library's own transitions and animations stop when the user has asked
|
|
58
|
+
the system for reduced motion (`prefers-reduced-motion: reduce`), as with
|
|
59
|
+
`:animations="false"`. Your own are untouched.
|
|
60
|
+
|
|
61
|
+
### Fixed
|
|
62
|
+
|
|
63
|
+
- **A `position: fixed` element inside a frosted container was positioned against the
|
|
64
|
+
container, not the viewport** — so a dropdown, popover or date picker of yours inside a
|
|
65
|
+
floating window, a drawer, an overlay widget, a frosted panel toolbar or (in `macos`) a docked
|
|
66
|
+
panel opened in the wrong place, in some skins and not others. A `backdrop-filter` makes its
|
|
67
|
+
element the containing block for fixed content; the frost now sits on each container's
|
|
68
|
+
`::before` (with the background it tints, where the frost saturates). What is drawn is unchanged.
|
|
69
|
+
- **`setDirection('rtl')` did not mirror the sidebar or the toasts**: they followed only the
|
|
70
|
+
page's `dir`. They follow the workspace into RTL now, and so does everything inside the sidebar
|
|
71
|
+
(a toolbar, your own chrome); while the workspace is left-to-right they still follow the page,
|
|
72
|
+
as before.
|
|
73
|
+
- **A saved window with unusable geometry reached the window's style**: a `NaN` saved as `null`,
|
|
74
|
+
an `Infinity` or a missing size. Such values are replaced on load by the default a new floating
|
|
75
|
+
window gets, with a warning naming the window.
|
|
76
|
+
|
|
77
|
+
### Tests
|
|
78
|
+
|
|
79
|
+
- **M17 browser gate** (`scripts/gates/browser/m17.mjs`, real Chrome): a fixed child of each of
|
|
80
|
+
the 7 frosted cases lands on the viewport, and each renders as before within a small tolerance;
|
|
81
|
+
reduced motion stops every library transition and leaves the page's; the sidebar and toasts
|
|
82
|
+
follow `setDirection` and still follow the page while LTR.
|
|
83
|
+
- `test/components/fieldReport.test.ts` (title functions, finite geometry) and
|
|
84
|
+
`test/core/stylesheet.test.ts` (the consumer content contract), ported from rdd 7.4.0.
|
|
85
|
+
- The M15 colour and M16 corner baselines compare a frosted container's `::before` as its
|
|
86
|
+
element: where it is drawn changed, what is drawn did not.
|
|
87
|
+
- M17 rules (`scripts/gates/m17.mjs`) and two selftest cases.
|
|
88
|
+
|
|
89
|
+
### Documentation
|
|
90
|
+
|
|
91
|
+
- Theming: Frosted glass and your own overlays; reduced motion under Animations. i18n: title
|
|
92
|
+
functions; the sidebar and toasts follow `setDirection`. Panels: objects that cross into Vue's
|
|
93
|
+
reactivity (`markRaw`, `shallowRef`, getters). ADR 0019; PARITY.md; the plan's M17.
|
|
94
|
+
|
|
95
|
+
## [1.4.0] — 2026-09-30
|
|
96
|
+
|
|
97
|
+
**Parity: react-dockable-desktop 6.3.1, plus react-dockable-desktop 7.2.0 and 7.3.0's skin
|
|
98
|
+
branding.** Branding, part two: your own surfaces and corner shape on any built-in skin. See
|
|
99
|
+
[Your surfaces](docs/manual/10-theming.md#your-surfaces) and [Corners](docs/manual/10-theming.md#corners).
|
|
100
|
+
|
|
101
|
+
### Added
|
|
102
|
+
|
|
103
|
+
- **`--vdd-brand-surface`** and **`--vdd-brand-text`**: set per scheme on `:root`, they replace
|
|
104
|
+
every built-in skin's backgrounds and text — the workspace, panels, tab bar, sidebar, floating
|
|
105
|
+
windows, modals, drawers, the taskbar, toasts, borders and muted text are all derived from the
|
|
106
|
+
two. Set both or neither: with only one set, every skin keeps its own surfaces. A skin keeps
|
|
107
|
+
its shape and effects (macOS's glass, Chrome's tabs, the VS Code accent bar) and each
|
|
108
|
+
translucent surface keeps the skin's own transparency; the accent, status colours and shadows
|
|
109
|
+
are not affected.
|
|
110
|
+
- **`--vdd-radius-scale`**: multiplies every corner the library draws — `0` square, `1` each
|
|
111
|
+
skin's own (the default), `1.5` rounder. Circles and pills stay round. It also scales the
|
|
112
|
+
radius tokens you set yourself (`--vdd-panel-float-radius`, `--vdd-panel-toolbar-btn-radius`,
|
|
113
|
+
`--vdd-tab-btn-active-radius`).
|
|
114
|
+
- Manual: **Your surfaces** and **Corners** under Brand your app, the corner habit for custom
|
|
115
|
+
skins, and the three variables in the token reference.
|
|
116
|
+
|
|
117
|
+
### Fixed
|
|
118
|
+
|
|
119
|
+
- **The workspace-edge drop preview was Bootstrap blue** (`#007bff`) in every skin, instead of
|
|
120
|
+
the skin's accent. It follows `--vdd-accent-color` and `--vdd-brand-accent` now. It shows only
|
|
121
|
+
while you drag a panel to a workspace edge.
|
|
122
|
+
- **Colours no token reached**: the dock-target chips, the light-mode outline button (the
|
|
123
|
+
confirm dialog's Cancel) and the frosted panel toolbar painted literal colours in their own
|
|
124
|
+
rules. They read the surface tokens now, and follow a brand surface; unbranded they are
|
|
125
|
+
unchanged.
|
|
126
|
+
|
|
127
|
+
### Tests
|
|
128
|
+
|
|
129
|
+
- **M16 browser gate** (`scripts/gates/browser/m16.mjs`, real Chrome): the corner radii of every
|
|
130
|
+
library element and pseudo-element, in all 7 skins × dark/light, match a 1.3.0 baseline with
|
|
131
|
+
the scale unset, are `0px` at scale `0` and 1.5× at `1.5`, with circles and pills unchanged;
|
|
132
|
+
with a brand surface set, no colour of any skin's own palette remains — rendered, hovered or as
|
|
133
|
+
a token — the workspace, panel and tab bar stay distinct, and text on panels meets 4.5:1
|
|
134
|
+
(muted 3:1); with only one of the two set, a scene matches M15's baseline. M15's gate still
|
|
135
|
+
holds with no brand set.
|
|
136
|
+
- `test/core/stylesheet.test.ts`, ported from rdd 7.3.0: every corner length is scaled and the
|
|
137
|
+
library never declares the scale; every coloured surface reads a derived value first, declared
|
|
138
|
+
only on `:root` and built on the guarded base; no element rule paints a colour of its own.
|
|
139
|
+
- M16 rules (`scripts/gates/m16.mjs`) and two selftest cases. The M15 browser gate's scene
|
|
140
|
+
helpers moved to `scripts/gates/lib/branding-scenes.mjs`, shared with M16. The playground
|
|
141
|
+
takes `?bs=`, `?bt=` and `?rs=`.
|
|
142
|
+
|
|
143
|
+
### Documentation
|
|
144
|
+
|
|
145
|
+
- Theming chapter: Your surfaces, Corners, the fourth brandable-skin habit, token rows; README
|
|
146
|
+
snippet; ADR 0018; PARITY.md; the plan's M16.
|
|
147
|
+
|
|
14
148
|
## [1.3.0] — 2026-09-29
|
|
15
149
|
|
|
16
150
|
**Parity: react-dockable-desktop 6.3.1, plus react-dockable-desktop 7.2.0's skin branding**
|
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@ so a layout saved by either library loads in the other.
|
|
|
24
24
|
> matching the two numbers would be a promise that breaks the first time either library needs
|
|
25
25
|
> a breaking change the other does not. Which rdd release a given version corresponds to is
|
|
26
26
|
> stated per release in [CHANGELOG.md](CHANGELOG.md) — this one tracks **rdd 6.3.1**, plus
|
|
27
|
-
> rdd 7.2.0's skin branding — and feature by feature in [docs/PARITY.md](docs/PARITY.md).
|
|
27
|
+
> rdd 7.2.0 and 7.3.0's skin branding — and feature by feature in [docs/PARITY.md](docs/PARITY.md).
|
|
28
28
|
|
|
29
29
|
## Install
|
|
30
30
|
|
|
@@ -35,7 +35,7 @@ npm install vue-dockable-desktop
|
|
|
35
35
|
Requires Vue 3.4+, and a browser with CSS `color-mix()` (Chrome / Edge 111, Safari 16.2,
|
|
36
36
|
Firefox 113 or later). No other runtime dependencies. The published package is
|
|
37
37
|
[`vue-dockable-desktop`](https://www.npmjs.com/package/vue-dockable-desktop); the public API
|
|
38
|
-
is pinned by `api-surface.json` and covered by
|
|
38
|
+
is pinned by `api-surface.json` and covered by 851 tests.
|
|
39
39
|
|
|
40
40
|
## Quick start
|
|
41
41
|
|
|
@@ -117,8 +117,17 @@ localStorage.setItem('layout', ws.saveLayout())
|
|
|
117
117
|
```
|
|
118
118
|
|
|
119
119
|
Point them at your UI framework's theme to follow it — `var(--p-primary-color)` (PrimeVue),
|
|
120
|
-
`var(--bs-primary)` (Bootstrap).
|
|
121
|
-
|
|
120
|
+
`var(--bs-primary)` (Bootstrap). Your own surfaces and corner shape, too:
|
|
121
|
+
|
|
122
|
+
```css
|
|
123
|
+
:root:not([data-color-scheme="light"]) { /* dark: the attribute's absence */
|
|
124
|
+
--vdd-brand-surface: #0b1f3a; /* app background — panels, bars and borders derive from it */
|
|
125
|
+
--vdd-brand-text: #e8eef7; /* main text — set both, or neither */
|
|
126
|
+
}
|
|
127
|
+
:root { --vdd-radius-scale: 0; } /* 0 square · 1 each skin's own · 1.5 rounder */
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
See [Brand your app](docs/manual/10-theming.md#brand-your-app)
|
|
122
131
|
- **i18n and RTL** — every string is a message key; `dir="rtl"` flips the whole workspace
|
|
123
132
|
- **TypeScript-first** — complete types, no separate `@types` package
|
|
124
133
|
|
|
@@ -21,8 +21,13 @@ export interface PointerDragConfig<TStart> {
|
|
|
21
21
|
captureStart: () => TStart;
|
|
22
22
|
/** Called on every pointermove with the delta from the drag's start position. */
|
|
23
23
|
onMove: (dx: number, dy: number, start: TStart) => void;
|
|
24
|
-
/** Called once when the drag ends (pointerup or pointercancel). */
|
|
24
|
+
/** Called once when the drag ends (pointerup, or pointercancel and window blur when `onCancel` is absent). */
|
|
25
25
|
onEnd?: (start: TStart) => void;
|
|
26
|
+
/**
|
|
27
|
+
* Called instead of `onEnd` when the drag is cancelled — a pointercancel, or the window losing
|
|
28
|
+
* focus (1.5.1) — for a drag whose release does something a cancel must not.
|
|
29
|
+
*/
|
|
30
|
+
onCancel?: (start: TStart) => void;
|
|
26
31
|
/** Classes toggled on the given elements for the duration of the drag. */
|
|
27
32
|
activeClasses?: Array<{
|
|
28
33
|
el: HTMLElement;
|
|
@@ -67,9 +67,10 @@ export declare function findLeaf(node: LayoutNode | null, leafId: string): Layou
|
|
|
67
67
|
*/
|
|
68
68
|
export declare function isLoneOccupant(node: LayoutNode, leafId: string, panelId: string): boolean;
|
|
69
69
|
/**
|
|
70
|
-
* Heal a tree that lists a panel twice, or lists none of a docked panel.
|
|
70
|
+
* Heal a tree that lists a panel twice, or lists none of a docked panel — or, since 1.5.1, lists
|
|
71
|
+
* a panel the layout doesn't have, or gives a split sizes that don't fit its children.
|
|
71
72
|
*
|
|
72
|
-
*
|
|
73
|
+
* The first two are states this library once produced and then *saved*: a lone docked panel dropped
|
|
73
74
|
* on its own group left rdd with the panel in two leaves and vdd with it in none, and
|
|
74
75
|
* `saveLayout()` wrote the result out, so the fault returned on every reload. Repairing on
|
|
75
76
|
* read means a layout stored by an affected version loads clean with nothing asked of the
|
package/dist/core/messages.d.ts
CHANGED
|
@@ -121,5 +121,8 @@ export declare const defaultMessages: {
|
|
|
121
121
|
* that all keys are present and none are misspelled.
|
|
122
122
|
*/
|
|
123
123
|
export type MessageKey = keyof typeof defaultMessages;
|
|
124
|
-
/**
|
|
124
|
+
/**
|
|
125
|
+
* Resolve a label with a formatter, falling back to its `defaultMessage` then its `id`, with each
|
|
126
|
+
* `{key}` replaced by its value — every occurrence (1.5.1; it replaced only the first).
|
|
127
|
+
*/
|
|
125
128
|
export declare function formatLabel(label: Label | undefined, format?: MessageFormatter): string;
|
package/dist/core/serialize.d.ts
CHANGED
|
@@ -18,6 +18,13 @@ export interface ParsedLayout {
|
|
|
18
18
|
panels: Record<string, PanelInfo>;
|
|
19
19
|
activePanelId: string | null;
|
|
20
20
|
}
|
|
21
|
+
/** The geometry a newly floated panel gets, and what a saved window's unusable geometry is repaired to. */
|
|
22
|
+
export declare const DEFAULT_FLOAT_RECT: {
|
|
23
|
+
x: number;
|
|
24
|
+
y: number;
|
|
25
|
+
width: number;
|
|
26
|
+
height: number;
|
|
27
|
+
};
|
|
21
28
|
/**
|
|
22
29
|
* Validate and normalise a parsed JSON payload, or return `null` if it is not a layout.
|
|
23
30
|
*
|