vue-dockable-desktop 1.5.1 → 1.7.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 CHANGED
@@ -11,6 +11,118 @@ correspondence lives, alongside the feature-by-feature map in [docs/PARITY.md](d
11
11
 
12
12
  ## [Unreleased]
13
13
 
14
+ ## [1.7.0] — 2026-10-04
15
+
16
+ **Parity: react-dockable-desktop 7.6.0.** Context menus open with nothing highlighted, the same
17
+ every time.
18
+
19
+ ### Changed
20
+
21
+ - **A context menu opens with focus on the menu itself, no item highlighted.** It used to focus
22
+ its first item, and whether the browser then drew a focus ring depended on the user's previous
23
+ interaction: a menu opened from script (a map library's right-click calling `showContextMenu`,
24
+ say) showed a ring after a page load or a key press and none after a mouse click. ArrowDown
25
+ reaches the first item and ArrowUp the last.
26
+ - **A keyboard `contextmenu` event** (the ContextMenu key or Shift+F10, which report no pointer
27
+ position) **still opens on the first item**, and so does `initialFocus: 'first-item'`.
28
+
29
+ ### Added
30
+
31
+ - **`initialFocus?: 'menu' | 'first-item'`** on `ShowContextMenuOptions`
32
+ (`ws.showContextMenu`, `useContextMenu()`).
33
+ - **Home and End** in context menus, as in rdd.
34
+ - **`--vdd-context-menu-focus-ring`**: the outline on a menu item with keyboard focus, by default
35
+ `--vdd-focus-ring` (the skin's accent). Both are now documented in the theming chapter; they are
36
+ read with a fallback rather than declared, so they follow the skin's or your brand's accent.
37
+
38
+ ### Fixed
39
+
40
+ - **Menu items drew the browser's default focus ring** instead of the skin's.
41
+ - **ArrowUp from a menu with nothing highlighted would have gone to the second-to-last item**; it
42
+ goes to the last.
43
+
44
+ ### Upgrading
45
+
46
+ - Nothing to change for menus opened with the mouse or from script. If you open a menu from your
47
+ own keyboard shortcut, pass `initialFocus: 'first-item'` so it starts on an item.
48
+ - Tests that expected the first item to have focus right after `showContextMenu` should press
49
+ ArrowDown first, or open the menu with `initialFocus: 'first-item'`.
50
+
51
+ ### Tests
52
+
53
+ - `test/components/contextMenu.test.ts`: the menu itself is focused on open; `initialFocus`;
54
+ keyboard and mouse `contextmenu` events; ArrowDown/ArrowUp from the menu; Home and End. Each was
55
+ seen failing with its part of the fix removed.
56
+
57
+ ### Documentation
58
+
59
+ - Overlays chapter: initial focus, the option, keys, the focus ring. Theming chapter: a "Focus
60
+ rings" table with `--vdd-focus-ring` and `--vdd-context-menu-focus-ring`.
61
+
62
+ ## [1.6.0] — 2026-10-04
63
+
64
+ **Parity: react-dockable-desktop 7.5.0.** Toolbar buttons: the library sizes the icon inside its
65
+ own buttons, and a toggle that is on can be told from one that is off at a glance, on chrome and
66
+ over panel content alike. No props were added or removed; everything new is a CSS custom property.
67
+
68
+ ### Added
69
+
70
+ - **Icon size tokens.** `--vdd-panel-toolbar-icon-size` (`20px`) sizes icons in
71
+ `<VddPanelToolbar>` buttons and toggles; `--vdd-chrome-icon-size` (`22px`) sizes them in the
72
+ workspace toolbar and the sidebar rail. Icon fonts follow the button's `font-size`; SVG icons
73
+ follow the token's width and height, even when the SVG has its own `width`/`height` attributes.
74
+ - **`soft` chip tokens**: `--vdd-panel-toolbar-btn-bg`, `--vdd-panel-toolbar-btn-bg-hover`,
75
+ `--vdd-panel-toolbar-btn-border`.
76
+ - **Workspace toolbar toggle tokens**: `--vdd-toolbar-btn-toggle-active-color` and
77
+ `--vdd-toolbar-btn-toggle-active-border`.
78
+
79
+ ### Changed
80
+
81
+ - **Panel toolbar "on" state** is a solid chip with a white icon, the same in every
82
+ `buttonVariant`: in dark the accent mixed 65% with black, in light the plain accent. The icon is
83
+ `--vdd-brand-on-accent` when a brand sets it. It clears WCAG's 3:1 non-text contrast. Before, it
84
+ was a 14–15% accent tint.
85
+ - **`buttonVariant="soft"`** is a near-opaque chip with a hairline edge, readable over panel
86
+ content. Before, it was a 6% (dark) / 4% (light) wash.
87
+ - **Workspace toolbar toggle "on"**: the accent tint goes from 6–8% to 22% (dark) / 16% (light),
88
+ with a 1px accent edge and the accent icon.
89
+ - **Icons in toolbar and rail buttons are larger by default**: 20px in panel toolbars, 22px in
90
+ the workspace toolbar and rail.
91
+
92
+ ### Fixed
93
+
94
+ - **Keyboard focus was invisible on toolbar and rail buttons**: `.vdd-toolbar-btn` and
95
+ `.vdd-sidebar-tab-btn` removed the outline with nothing in its place. They, and panel toolbar
96
+ buttons, show a focus ring for keyboard focus now (`--vdd-focus-ring`, default a 2px accent
97
+ outline), as rdd does.
98
+ - **`filled` toggles looked the same on and off**; it now rests on an accent tint with an accent
99
+ edge, and "on" is the solid chip.
100
+ - **vscode and macos painted a white hover tint in light mode** on panel toolbar buttons; it now
101
+ applies in dark only.
102
+ - **`buttonSize` was documented as the icon size.** It sets the button size.
103
+ - The theming chapter no longer claims a coarse-pointer rule enlarges panel toolbar buttons.
104
+
105
+ ### Upgrading
106
+
107
+ - Remove per-icon sizes inside toolbar and rail buttons (`width`/`height` props, inline sizes):
108
+ set `--vdd-panel-toolbar-icon-size` / `--vdd-chrome-icon-size` instead. An inline `style` size
109
+ still wins over the tokens.
110
+ - If you added shadows to keep toolbar icons readable over panel content, remove them and use
111
+ `button-variant="soft"` or a `frosted`/`solid` toolbar.
112
+ - To restyle "on", set `--vdd-panel-toolbar-btn-active-bg` and `--vdd-panel-toolbar-btn-active-color`
113
+ (recipes in the panel overlay chapter).
114
+
115
+ ### Documentation
116
+
117
+ - Panel overlay chapter: "Styling toolbar buttons" (what the library owns, icon sizes, variants,
118
+ the "on" tokens, recipes); corrected `buttonSize`.
119
+ - Theming chapter: new icon and toggle tokens; panel toolbar defaults updated.
120
+
121
+ ### Demo
122
+
123
+ - "Toolbar Buttons" panel (Control Center → open): every `buttonVariant` in every state over
124
+ light, dark and busy content, with icon-size sliders.
125
+
14
126
  ## [1.5.1] — 2026-10-01
15
127
 
16
128
  **Parity: react-dockable-desktop 7.4.1 fixes.** From a review of 1.5.0. No API changes.
@@ -5,7 +5,7 @@ type __VLS_Props = {
5
5
  variant?: ToolbarVariant;
6
6
  /** Inherited by this toolbar's buttons unless they override it. @default 'ghost' */
7
7
  buttonVariant?: ButtonVariant;
8
- /** Icon button size in pixels. Left to the stylesheet when unset. */
8
+ /** Button size in pixels (sets `--vdd-panel-toolbar-btn-size`). The icon inside follows `--vdd-panel-toolbar-icon-size`. Left to the stylesheet when unset. */
9
9
  buttonSize?: number;
10
10
  };
11
11
  declare var __VLS_1: {};
@@ -1,4 +1,4 @@
1
- /** An icon button for a `<VddPanelToolbar>`. The icon is a slot, so anything renders. */
1
+ /** An icon button for a `<VddPanelToolbar>`. The icon is a slot, so anything renders; pass it no size, the library sizes it with `--vdd-panel-toolbar-icon-size`. */
2
2
  type __VLS_Props = {
3
3
  /** Tooltip and accessible name. */
4
4
  title?: string;
@@ -46,7 +46,25 @@ export interface ShowContextMenuOptions {
46
46
  x?: number;
47
47
  y?: number;
48
48
  items: ContextMenuItem[];
49
+ /**
50
+ * Where focus goes when the menu opens. `'menu'` (the default) focuses the menu itself, with no
51
+ * item highlighted: ArrowDown then reaches the first item and ArrowUp the last. `'first-item'`
52
+ * focuses the first enabled item, for a menu opened from the keyboard. When this is left out, a
53
+ * keyboard `contextmenu` event (the ContextMenu key or Shift+F10, which report no pointer
54
+ * position) opens on the first item and everything else, including a call with no event, on
55
+ * the menu: the same view every time, whatever the user did before.
56
+ */
57
+ initialFocus?: 'menu' | 'first-item';
49
58
  }
59
+ /** A menu request as the workspace holds it. */
60
+ export interface ContextMenuRequest {
61
+ x: number;
62
+ y: number;
63
+ items: ContextMenuItem[];
64
+ initialFocus: 'menu' | 'first-item';
65
+ }
66
+ /** The menu's initial focus, from what the caller passed (see `ShowContextMenuOptions.initialFocus`). */
67
+ export declare function menuInitialFocus(options: ShowContextMenuOptions): 'menu' | 'first-item';
50
68
  export declare const isSeparator: (item: ContextMenuItem) => item is ContextMenuSeparator;
51
69
  export declare const isSubMenu: (item: ContextMenuItem) => item is ContextMenuSubMenu;
52
70
  /** Where a menu should open, from whatever the caller supplied. */
@@ -2,7 +2,7 @@ import type { App, Component, ComputedRef, InjectionKey } from 'vue';
2
2
  import type { DirtyStateOptions, DropPosition, FloatAnchor, FloatingWindow, Label, LayoutNode, MessageDescriptor, MessageFormatter, PanelInfo, SplitDirection } from '../types';
3
3
  import { PanelRegistry } from './registry';
4
4
  import type { PanelDefaultOptions } from './registry';
5
- import type { ContextMenuItem, ShowContextMenuOptions } from './contextMenu';
5
+ import type { ContextMenuItem, ContextMenuRequest, ShowContextMenuOptions } from './contextMenu';
6
6
  import type { BuiltInEvents } from './eventBus';
7
7
  import { defaultMessages } from './messages';
8
8
  import type { ToolbarState } from './toolbarState';
@@ -168,11 +168,7 @@ export interface Workspace<TEvents extends object = Record<string, unknown>> {
168
168
  /** Dismiss the open menu, if any. */
169
169
  closeContextMenu(): void;
170
170
  /** The pending menu request, or `null`. @internal */
171
- readonly contextMenu: ComputedRef<{
172
- x: number;
173
- y: number;
174
- items: ContextMenuItem[];
175
- } | null>;
171
+ readonly contextMenu: ComputedRef<ContextMenuRequest | null>;
176
172
  /**
177
173
  * Toolbar selection state, for items that are not controlled by the caller.
178
174
  *