vue-dockable-desktop 1.7.2 → 1.8.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,55 @@ correspondence lives, alongside the feature-by-feature map in [docs/PARITY.md](d
11
11
 
12
12
  ## [Unreleased]
13
13
 
14
+ ## [1.8.0] — 2026-10-05
15
+
16
+ **Parity: react-dockable-desktop 7.7.0.** Ready-made dialogs: the confirmation shows an icon,
17
+ a new alert dialog, and both as promises.
18
+
19
+ ### Added
20
+
21
+ - **`<VddConfirm>` shows an icon left of its message**: a question mark, coloured by
22
+ `alertType` (info, success, warning, danger) with the toast colour tokens. The new `icon` prop
23
+ replaces it with your own component; `icon: null` hides it.
24
+ - **`<VddAlert>`**: a message with a single OK button, for telling rather than asking. Its icon
25
+ follows `alertType`, with the same `icon` override. Props: `message`, `alertType`, `icon`,
26
+ `okLabel`, `onSettled`. Focus starts on OK and Enter presses it; Escape, the backdrop and the ×
27
+ acknowledge it too, unless the modal is `closable: false`. Button hook: `data-vdd-alert-ok`.
28
+ - **`useModals().confirm(options)` and `useModals().alert(options)`** open those dialogs (size
29
+ `small`) and return a promise: `confirm` resolves `true` for the confirm button and `false` for
30
+ cancel or any dismissal; `alert` resolves once it is closed. Option types: `ConfirmOptions`,
31
+ `AlertOptions`.
32
+ - **Message keys `confirmTitle`** ("Confirmation") **and `alertTitle`** ("Information"), the
33
+ helpers' default titles. A table typed `Record<MessageKey, string>` needs the two new keys.
34
+ - New classes: `vdd-dialog-content`, `vdd-dialog-icon`, `vdd-dialog-icon-{info|success|warning|danger}`.
35
+
36
+ rdd 7.7.0 also fixed an `RddConfirm` that never answered when dismissed, and one that overwrote
37
+ the modal's header icon. Neither applied here: `<VddConfirm>` already settled on unmount and
38
+ never set a header icon.
39
+
40
+ ### Upgrading
41
+
42
+ - A confirmation now draws a question mark beside its message. Pass `icon: null` to keep the
43
+ old look.
44
+ - The line under a confirmation's message is now the border of the new icon row,
45
+ `.vdd-dialog-content`, so it spans the icon too; it was `.vdd-confirmation-message`'s own
46
+ `border-bottom`. A stylesheet that restyled that border should target `.vdd-dialog-content`.
47
+
48
+ ### Tests
49
+
50
+ - `test/components/dialogs.test.ts`: settle-once for every exit of both dialogs (Escape,
51
+ backdrop, ×, `closeAllModals`, `close(id)`, the buttons); default, custom and hidden icons;
52
+ the header icon left alone; alert focus, label and `closable: false`; both promise helpers.
53
+ Each assertion was seen failing with its code removed.
54
+ - M10 checks that `<VddAlert>` settles on unmount and only once (with a selftest mutation). The
55
+ non-vacuity selftest now blanks `contributions.test.ts`: `useOverlays.ts` is reached by the new
56
+ dialog tests too, so blanking `useOverlays.test.ts` no longer leaves a module unexecuted.
57
+ - `test/core/stylesheet.test.ts`: every dialog-icon class has a rule coloured from a toast token,
58
+ and the separator is the icon row's border, not the message's (seen failing with each removed).
59
+ - The M15 colour baseline (`scripts/gates/browser/fixtures/m15-branding-baseline.json`, which M16
60
+ also reads) is regenerated on purpose: its scenes include a confirmation, whose message now sits
61
+ in the icon row. Nothing outside that modal changed.
62
+
14
63
  ## [1.7.2] — 2026-10-04
15
64
 
16
65
  **Parity: react-dockable-desktop 7.6.2.**
@@ -0,0 +1,19 @@
1
+ import type { Component } from 'vue';
2
+ import type { AlertType, Label } from '../types';
3
+ type __VLS_Props = {
4
+ message: Label;
5
+ /** Picks the built-in icon and its colour. */
6
+ alertType?: AlertType;
7
+ /** Omit it for the built-in icon of `alertType`, pass `null` for none, or pass a component. */
8
+ icon?: Component | null;
9
+ /** The button label. Defaults to the `ok` message. */
10
+ okLabel?: Label;
11
+ /** Called exactly once, whichever way the dialog closes. */
12
+ onSettled?: () => void;
13
+ };
14
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
15
+ icon: Component | null;
16
+ alertType: AlertType;
17
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
18
+ declare const _default: typeof __VLS_export;
19
+ export default _default;
@@ -1,3 +1,4 @@
1
+ import type { Component } from 'vue';
1
2
  import type { AlertType, Label } from '../types';
2
3
  type __VLS_Props = {
3
4
  message: Label;
@@ -10,8 +11,14 @@ type __VLS_Props = {
10
11
  onCancel?: () => void;
11
12
  /** Called exactly once, whichever way the dialog closes. `ok` says which. */
12
13
  onSettled?: (ok: boolean) => void;
14
+ /**
15
+ * The icon left of the message (1.8.0): omit it for the built-in question mark, pass `null`
16
+ * for none, or pass a component. Coloured by `alertType`.
17
+ */
18
+ icon?: Component | null;
13
19
  };
14
20
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
21
+ icon: Component | null;
15
22
  alertType: AlertType;
16
23
  yesNo: boolean;
17
24
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * The icon slot left of a dialog's message (1.8.0). `icon` undefined draws the built-in icon —
3
+ * a question mark for a confirmation, the type's icon for an alert — `null` draws nothing, and a
4
+ * component is drawn in its place. Coloured by `vdd-dialog-icon-${type}`; the glyphs use
5
+ * currentColor, on the same grid as the toast icons.
6
+ */
7
+ import type { Component } from 'vue';
8
+ import type { AlertType } from '../types';
9
+ type __VLS_Props = {
10
+ icon: Component | null | undefined;
11
+ type: AlertType;
12
+ question?: boolean;
13
+ };
14
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
15
+ declare const _default: typeof __VLS_export;
16
+ export default _default;
@@ -1,5 +1,28 @@
1
1
  import type { Component, ComputedRef } from 'vue';
2
2
  import type { ModalOptions, OverlayInstance, SidePanelOptions } from '../core/overlays';
3
+ import type { AlertType, Label } from '../types';
4
+ /** Options of `useModals().confirm()`. The title defaults to the `confirmTitle` message. */
5
+ export interface ConfirmOptions {
6
+ message: Label;
7
+ title?: Label;
8
+ alert?: string;
9
+ alertType?: AlertType;
10
+ icon?: Component | null;
11
+ /** Label the buttons "Yes"/"No" rather than "OK"/"Cancel". */
12
+ yesNo?: boolean;
13
+ /** @default 'small' */
14
+ size?: ModalOptions['size'];
15
+ }
16
+ /** Options of `useModals().alert()`. The title defaults to the `alertTitle` message. */
17
+ export interface AlertOptions {
18
+ message: Label;
19
+ title?: Label;
20
+ alertType?: AlertType;
21
+ icon?: Component | null;
22
+ okLabel?: Label;
23
+ /** @default 'small' */
24
+ size?: ModalOptions['size'];
25
+ }
3
26
  /**
4
27
  * The modal stack.
5
28
  *
@@ -25,6 +48,13 @@ export declare function useModals(): {
25
48
  force?: boolean;
26
49
  }) => Promise<void>;
27
50
  closeAll: () => void;
51
+ /**
52
+ * Open a `<VddConfirm>` (1.8.0). Resolves `true` for the confirm button, `false` for cancel and
53
+ * for any dismissal — Escape, the backdrop, the ×, or a close by code.
54
+ */
55
+ confirm: (options: ConfirmOptions) => Promise<boolean>;
56
+ /** Open a `<VddAlert>` (1.8.0). Resolves once it is closed, however. */
57
+ alert: (options: AlertOptions) => Promise<void>;
28
58
  };
29
59
  /**
30
60
  * The two side drawers.
@@ -87,6 +87,14 @@ export declare const defaultMessages: {
87
87
  readonly id: "vdd.ok";
88
88
  readonly defaultMessage: "OK";
89
89
  };
90
+ readonly confirmTitle: {
91
+ readonly id: "vdd.confirmTitle";
92
+ readonly defaultMessage: "Confirmation";
93
+ };
94
+ readonly alertTitle: {
95
+ readonly id: "vdd.alertTitle";
96
+ readonly defaultMessage: "Information";
97
+ };
90
98
  readonly closeTooltip: {
91
99
  readonly id: "vdd.closeTooltip";
92
100
  readonly defaultMessage: "Close";