@vestra-player/sdk 1.7.17 → 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 CHANGED
@@ -1,5 +1,11 @@
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
+
3
9
  ## 1.7.17
4
10
 
5
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.
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 its confirmation
959
- * cannot be shown while another alert is open.
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
- /** More text under the message; at most 2000 characters. */
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: red text on macOS, a warning
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
- /** A checkbox under the text, such as "Don't ask again"; 1–40 characters. */
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
- * The system's own dialogs: a confirmation alert and the open and save file
559
- * dialogs. `plugin.dialogs`.
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; the system draws the dialog,
563
- * so it looks and behaves like every other dialog on the system. Each call
564
- * resolves when the user answers; there is no time limit and no way to close
565
- * a dialog from code. Only one dialog (of any kind, from any plugin) is open
566
- * at a time: another call meanwhile rejects with `busy`. Playback continues
567
- * while a dialog is open; command key bindings pause.
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:** {@link Dialogs.confirm} needs macOS or Windows (other
570
- * systems reject it with `unsupported`); the file dialogs work on every
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 in a system alert with a "Don't ask
580
- * again" box; once the user ticks it, later deletes go ahead without
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, in a system alert.
619
+ * Ask the user to confirm something.
610
620
  *
611
621
  * @remarks
612
- * **macOS:** an `NSAlert` sheet on the active player window (usually the
613
- * tool window the user just clicked in), else on the main window.
614
- *
615
- * **Windows:** a task dialog owned by the active player window, titled
616
- * "Vestra Player" and centred on it: `message` is the main instruction
617
- * and `detail` the text below it. A `checkbox` is the dialog's own
618
- * verification box (no second dialog); `checked` is its state on cancel
619
- * too. No system sound plays; `destructive` shows a warning icon.
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) A system other than macOS and Windows.
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 system draws the alert
641
- * and the promise resolves when the user answers; only one dialog is
642
- * open at a time, so a second one meanwhile rejects with `busy`.
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 already open: let the user finish that one.
676
+ * // Another dialog is waiting: let the user finish that one.
653
677
  * }
654
678
  * ```
655
679
  *
package/llms.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  # Vestra Player SDK
2
2
 
3
- > @vestra-player/sdk 1.7.17: 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/.
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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vestra-player/sdk",
3
- "version": "1.7.17",
3
+ "version": "1.7.18",
4
4
  "description": "Plugin API types, test host and plugin CLI for Vestra Player (apiVersion vestra/1)",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {