@vestra-player/sdk 1.7.16 → 1.7.18
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 +12 -0
- package/dist/commands.js +1 -0
- package/dist/docs-tree.json.gz +0 -0
- package/dist/plugin/types/commands.d.ts +2 -2
- package/dist/plugin/types/ui-shell.d.ts +57 -33
- package/dist/wire.d.ts +1 -1
- package/llms.txt +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.7.18
|
|
4
|
+
|
|
5
|
+
**Who must change: nobody.** A docs-only patch following the player (Ask Vestra UX, step 5: main-window confirmations drawn in the player): no API change, `apiVersion` stays `vestra/1`, the API surface snapshot is unchanged. `dialogs.confirm` keeps its parameters and its answer `{ confirmed, checked }`.
|
|
6
|
+
|
|
7
|
+
- **`Dialogs.confirm`** (player b38b2316, 31a3170f): a confirmation for the main window (no tool window has the focus) is drawn in the player in the style of its approval sheet: the message, the detail (a long one scrolls and the buttons stay in view), the checkbox at the footer's left, confirm (Enter) and cancel (Esc) at its right; presses in its first 0.5 s are ignored and a click outside it is Cancel. One raised while a tool window has the focus stays the system's dialog on that window (Windows: the quiet task dialog; macOS: an `NSAlert` sheet). On other systems with a window it is drawn in the player instead of rejecting with `unsupported` (which only older players there still give); headless is still `unavailable`. A new `busy` case: another confirmation or the approval sheet is waiting for the user's answer (`Commands.run`'s confirmation too). `destructive` now draws nothing in the player (no red text, no warning icon); the Windows task dialog still shows its warning icon and macOS's alert its red button. The TSDoc of `Dialogs`, `ConfirmOptions` and `Commands.run`, [Platforms](docs/reference/platforms.md) and [Troubleshooting](docs/guides/troubleshooting.md) follow.
|
|
8
|
+
|
|
9
|
+
## 1.7.17
|
|
10
|
+
|
|
11
|
+
**Who must change: nobody.** A product-data refresh (Ask Vestra UX, step 4): no API change, `apiVersion` stays `vestra/1`, the API surface snapshot is unchanged.
|
|
12
|
+
|
|
13
|
+
- **`BUILTIN_COMMANDS`** (player 5c1773be): the player's new `host/ask-again` (**Ask Again Before Plugin Commands**, category Command Palette, in the palette only, no default key) forgets every "Don't ask again" of the approval sheet. `TestHost` counts it among the player's own commands toward `COMMAND_LIMITS.total`. The table in [Reference: commands](docs/reference/commands.md#built-in-commands) and the list of the player's own commands there follow.
|
|
14
|
+
|
|
3
15
|
## 1.7.16
|
|
4
16
|
|
|
5
17
|
**Who must change: nobody.** One optional field on an existing call (Ask Vestra UX, step 3: one approval for the whole request); `apiVersion` stays `vestra/1`, no new capability or message; the API surface snapshot gains the field. The field is an option of `commands.run`, not a separate `commands.plan`: the plan only matters for the run that starts it, a separate call would be a second request whose ordering against the first the player would have to tie together, and an option keeps an older player's behaviour (it ignores the field and asks per command) without a version check.
|
package/dist/commands.js
CHANGED
|
@@ -337,6 +337,7 @@ host | previous | (Previous) | PageUp, Mouse:X2
|
|
|
337
337
|
host | next | (Next) | PageDown, Mouse:X1
|
|
338
338
|
host | enter-fullscreen | (Enter Fullscreen)
|
|
339
339
|
host | exit-fullscreen | (Leave Fullscreen)
|
|
340
|
+
host | ask-again | (Ask Again Before Plugin Commands)
|
|
340
341
|
host | volume-up | (Volume +) | ArrowUp, Mouse:WheelUp
|
|
341
342
|
host | volume-down | (Volume −) | ArrowDown, Mouse:WheelDown
|
|
342
343
|
host | mute | (Mute) | M
|
package/dist/docs-tree.json.gz
CHANGED
|
Binary file
|
|
@@ -955,8 +955,8 @@ export interface Commands {
|
|
|
955
955
|
* the ids of `then`.
|
|
956
956
|
* @throws `disabled` (rejects) The command is disabled now; `message` has
|
|
957
957
|
* its reason.
|
|
958
|
-
* @throws `busy` (rejects) The command is busy, or
|
|
959
|
-
*
|
|
958
|
+
* @throws `busy` (rejects) The command is busy, or another confirmation
|
|
959
|
+
* or approval sheet is waiting for the user's answer.
|
|
960
960
|
* @throws `limit` (rejects) Over the rate limits above.
|
|
961
961
|
* @throws `invalid` (rejects) Only one of `step` and `of`, or not
|
|
962
962
|
* whole numbers with 1 ≤ `step` ≤ `of` ≤ 99; `then` is not an array
|
|
@@ -523,7 +523,11 @@ export interface Panels {
|
|
|
523
523
|
export interface ConfirmOptions {
|
|
524
524
|
/** The question, shown in bold; 1–200 characters. */
|
|
525
525
|
message: TextValue;
|
|
526
|
-
/**
|
|
526
|
+
/**
|
|
527
|
+
* More text under the message; at most 2000 characters. In the
|
|
528
|
+
* confirmation drawn in the player a long detail scrolls and the buttons
|
|
529
|
+
* stay in view.
|
|
530
|
+
*/
|
|
527
531
|
detail?: TextValue;
|
|
528
532
|
/** The confirm button's text (the default button: Enter picks it); 1–40 characters. */
|
|
529
533
|
confirm: TextValue;
|
|
@@ -534,13 +538,18 @@ export interface ConfirmOptions {
|
|
|
534
538
|
*/
|
|
535
539
|
cancel?: TextValue;
|
|
536
540
|
/**
|
|
537
|
-
* Mark the confirm button as destructive
|
|
538
|
-
* icon on Windows
|
|
541
|
+
* Mark the confirm button as destructive. Only a tool window's system
|
|
542
|
+
* dialog shows it (a warning icon on Windows, red button text on
|
|
543
|
+
* macOS); the confirmation drawn in the player marks nothing, as its
|
|
544
|
+
* approval sheet marks no destructive step. Enter confirms either way.
|
|
539
545
|
*
|
|
540
546
|
* @defaultValue `false`
|
|
541
547
|
*/
|
|
542
548
|
destructive?: boolean;
|
|
543
|
-
/**
|
|
549
|
+
/**
|
|
550
|
+
* A checkbox, such as "Don't ask again" (in the player, at the left of
|
|
551
|
+
* the buttons); 1–40 characters.
|
|
552
|
+
*/
|
|
544
553
|
checkbox?: TextValue;
|
|
545
554
|
/**
|
|
546
555
|
* Values for the placeholders of `message` and `detail`. Any of the texts may
|
|
@@ -555,20 +564,22 @@ export interface ConfirmOptions {
|
|
|
555
564
|
args?: TemplateArgs;
|
|
556
565
|
}
|
|
557
566
|
/**
|
|
558
|
-
*
|
|
559
|
-
*
|
|
567
|
+
* Confirmations and the system's open and save file dialogs.
|
|
568
|
+
* `plugin.dialogs`.
|
|
560
569
|
*
|
|
561
570
|
* @remarks
|
|
562
|
-
* The plugin passes text and gets the answer
|
|
563
|
-
*
|
|
564
|
-
*
|
|
565
|
-
*
|
|
566
|
-
*
|
|
567
|
-
*
|
|
571
|
+
* The plugin passes text and gets the answer. A confirmation for the main
|
|
572
|
+
* window is drawn in the player; one asked while a tool window has the
|
|
573
|
+
* focus, and every file dialog, is the system's own (see
|
|
574
|
+
* {@link Dialogs.confirm}). Each call resolves when the user answers; there
|
|
575
|
+
* is no time limit and no way to close a dialog from code. Only one system
|
|
576
|
+
* dialog (of any kind, from any plugin) is open at a time: another call
|
|
577
|
+
* meanwhile rejects with `busy`. A confirmation is also `busy` while
|
|
578
|
+
* another confirmation or the player's approval sheet waits for the
|
|
579
|
+
* user's answer; the file dialogs are not. Playback continues while a dialog is open; command key bindings pause.
|
|
568
580
|
*
|
|
569
|
-
* **Platforms:**
|
|
570
|
-
*
|
|
571
|
-
* system.
|
|
581
|
+
* **Platforms:** every system with a window; a player without one
|
|
582
|
+
* (headless) rejects every call with `unavailable`.
|
|
572
583
|
*
|
|
573
584
|
* For anything more than a question or a path, use a {@link Windows | tool
|
|
574
585
|
* window}.
|
|
@@ -576,9 +587,8 @@ export interface ConfirmOptions {
|
|
|
576
587
|
* @capability ui.dialog
|
|
577
588
|
*
|
|
578
589
|
* @example Ask before deleting, remembering "Don't ask again"
|
|
579
|
-
* Deleting asks for confirmation
|
|
580
|
-
*
|
|
581
|
-
* asking. `confirm` resolves with the button and the checkbox when the
|
|
590
|
+
* Deleting asks for confirmation with a "Don't ask again" box; once the
|
|
591
|
+
* user ticks it, later deletes go ahead without asking. `confirm` resolves with the button and the checkbox when the
|
|
582
592
|
* user answers; the texts are templates the player translates, so the
|
|
583
593
|
* count goes in `args`. Remembering the box is up to the plugin.
|
|
584
594
|
* ```ts
|
|
@@ -606,17 +616,29 @@ export interface ConfirmOptions {
|
|
|
606
616
|
*/
|
|
607
617
|
export interface Dialogs {
|
|
608
618
|
/**
|
|
609
|
-
* Ask the user to confirm something
|
|
619
|
+
* Ask the user to confirm something.
|
|
610
620
|
*
|
|
611
621
|
* @remarks
|
|
612
|
-
* **
|
|
613
|
-
*
|
|
614
|
-
*
|
|
615
|
-
*
|
|
616
|
-
*
|
|
617
|
-
* and
|
|
618
|
-
*
|
|
619
|
-
*
|
|
622
|
+
* **For the main window** (no tool window has the focus, also while the
|
|
623
|
+
* player is not in the foreground, which then takes no focus): drawn in
|
|
624
|
+
* the player in the style of its approval sheet, the same on every
|
|
625
|
+
* system: `message`, then `detail` (a long one scrolls; the sheet stays
|
|
626
|
+
* inside the window and its buttons in view), the `checkbox` at the
|
|
627
|
+
* footer's left and the confirm (Enter) and cancel (Esc) buttons at its
|
|
628
|
+
* right. Presses in its first 0.5 s are ignored, and a click outside it
|
|
629
|
+
* is Cancel. A click toggles the checkbox (Space does not).
|
|
630
|
+
* `destructive` draws nothing different.
|
|
631
|
+
*
|
|
632
|
+
* **For a tool window** (a plugin's window, Options or the floating
|
|
633
|
+
* sidebar has the focus): the system's dialog on that window. macOS: an
|
|
634
|
+
* `NSAlert` sheet with the custom buttons and the checkbox. Windows: a
|
|
635
|
+
* task dialog titled "Vestra Player" and centred on the window: `message`
|
|
636
|
+
* is the main instruction and `detail` the text below it; a `checkbox`
|
|
637
|
+
* is the dialog's own verification box (no second dialog); no system
|
|
638
|
+
* sound plays; `destructive` shows a warning icon. Other systems have no
|
|
639
|
+
* system alerts, so it is drawn in the player there too.
|
|
640
|
+
*
|
|
641
|
+
* Either way `checked` is the checkbox's state on cancel too.
|
|
620
642
|
*
|
|
621
643
|
* Remembering "Don't ask again" is up to the plugin (see
|
|
622
644
|
* {@link Scope.storage}).
|
|
@@ -630,16 +652,18 @@ export interface Dialogs {
|
|
|
630
652
|
*
|
|
631
653
|
* @throws `invalid` (rejects) A text is empty or too long, or `destructive`
|
|
632
654
|
* is not a boolean.
|
|
633
|
-
* @throws `busy` (rejects) Another dialog is open
|
|
655
|
+
* @throws `busy` (rejects) Another dialog is open, or another
|
|
656
|
+
* confirmation or the approval sheet is waiting for the user's answer.
|
|
634
657
|
* @throws `unavailable` (rejects) The player runs without a user interface.
|
|
635
|
-
* @throws `unsupported` (rejects)
|
|
658
|
+
* @throws `unsupported` (rejects) Only players before the confirmation
|
|
659
|
+
* drawn in the player, on a system other than macOS and Windows.
|
|
636
660
|
* @throws `capability` (rejects) The manifest does not declare `ui.dialog`.
|
|
637
661
|
*
|
|
638
662
|
* @example Confirm before replacing the playlist
|
|
639
663
|
* The user sees "Replace the current playlist?" with a Replace button and
|
|
640
|
-
* the playlist is replaced only after a yes. The
|
|
641
|
-
*
|
|
642
|
-
*
|
|
664
|
+
* the playlist is replaced only after a yes. The promise resolves when
|
|
665
|
+
* the user answers; only one dialog waits for the user at a time, so a
|
|
666
|
+
* second one meanwhile rejects with `busy`.
|
|
643
667
|
* ```ts
|
|
644
668
|
* try {
|
|
645
669
|
* const { confirmed } = await plugin.dialogs.confirm({
|
|
@@ -649,7 +673,7 @@ export interface Dialogs {
|
|
|
649
673
|
* if (confirmed) await plugin.osd.show("Playlist replaced");
|
|
650
674
|
* } catch (error) {
|
|
651
675
|
* if ((error as PluginError).code !== "busy") throw error;
|
|
652
|
-
* // Another dialog is
|
|
676
|
+
* // Another dialog is waiting: let the user finish that one.
|
|
653
677
|
* }
|
|
654
678
|
* ```
|
|
655
679
|
*
|
package/dist/wire.d.ts
CHANGED
|
@@ -696,7 +696,7 @@ export declare function createWire(transport: Transport): {
|
|
|
696
696
|
id: string;
|
|
697
697
|
ticket: string;
|
|
698
698
|
step?: number;
|
|
699
|
-
of
|
|
699
|
+
of?: number;
|
|
700
700
|
then?: string[];
|
|
701
701
|
}) => Promise<import("./index.ts").CommandRunResult>;
|
|
702
702
|
};
|
package/llms.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Vestra Player SDK
|
|
2
2
|
|
|
3
|
-
> @vestra-player/sdk 1.7.
|
|
3
|
+
> @vestra-player/sdk 1.7.18: write plugins for Vestra Player in TypeScript (plugin API `vestra/1`). A plugin is a folder with `manifest.json` and an entry module whose default export `activate(plugin)` the player calls. The documentation is a tree of short pages read by path, like `go doc`: the same pages and API as https://vestrasys.github.io/vestra-player-sdk/.
|
|
4
4
|
|
|
5
5
|
## Read the documentation
|
|
6
6
|
|