@vestra-player/sdk 1.7.14 → 1.7.15
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,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.7.15
|
|
4
|
+
|
|
5
|
+
**Who must change: nobody.** One optional field on an existing call (Ask Vestra UX, step 2: the status strip); `apiVersion` stays `vestra/1`, no new capability or message; the API surface snapshot gains the field.
|
|
6
|
+
|
|
7
|
+
- **`PaletteLeadOptions.status.state`** (`palette.lead.set`'s `status.state`): `"working"` (the default) or an end state, `"done"`, `"failed"` or `"note"`. While the palette is closed the player shows the status in a strip at the top of the main window: `working` with a moving line and a Stop button, until the status changes; an end state with a check, in the danger colour or plain, removed by the player after a few seconds and never shown again (not kept while the plugin is stopped), so the plugin needs no timer. Once `commands.run` has shown a step of the ticket in the strip, a `working` text changes only the palette's status row. The SDK sends `state` only when set; any other value is `invalid` (through `ready`, or `update` rejects). Players before the strip refuse the field with `invalid`; a built-in plugin ships with its player. Docs: [Reference: commands](docs/reference/commands.md#running-commands-for-the-user).
|
|
8
|
+
- **`TestHost`** checks `status.state` like the player (absent or `null` is `working`, any other value than the four is `invalid`) and keeps it in `host.paletteLead`; the end state's timing is the player's and is not modelled. Test: `test/builtin-only.test.ts`.
|
|
9
|
+
- **Docs, Windows confirmations** (player main 7cc5d648): `Dialogs.confirm` and [Platforms](docs/reference/platforms.md) say what the player now shows: `message` is the main instruction with `detail` below it, the `checkbox` is the dialog's own verification box (no second dialog), `checked` is reported on cancel too, and no system sound plays.
|
|
10
|
+
|
|
3
11
|
## 1.7.14
|
|
4
12
|
|
|
5
13
|
**Who must change: nobody.** A product-data refresh and a `TestHost` follow-up to player 0.8.0: no API change, `apiVersion` stays `vestra/1`, the API surface snapshot is unchanged.
|
package/dist/docs-tree.json.gz
CHANGED
|
Binary file
|
package/dist/plugin/commands.js
CHANGED
|
@@ -407,12 +407,15 @@ function leadJson(options) {
|
|
|
407
407
|
out.status = null;
|
|
408
408
|
else if (status !== undefined) {
|
|
409
409
|
if (typeof status !== "object")
|
|
410
|
-
throw failure("invalid", "status is { text, note? } or null");
|
|
410
|
+
throw failure("invalid", "status is { text, note?, state? } or null");
|
|
411
411
|
out.status = {
|
|
412
412
|
text: text(status.text, "status.text"),
|
|
413
413
|
...(status.note === undefined
|
|
414
414
|
? {}
|
|
415
415
|
: { note: text(status.note, "status.note") }),
|
|
416
|
+
// Sent only when set (players before it refuse the field); the
|
|
417
|
+
// player checks the value.
|
|
418
|
+
...(status.state === undefined ? {} : { state: status.state }),
|
|
416
419
|
};
|
|
417
420
|
}
|
|
418
421
|
return out;
|
|
@@ -522,6 +522,8 @@ const LEAD_TEXTS = {
|
|
|
522
522
|
"status.text": 80,
|
|
523
523
|
"status.note": 40,
|
|
524
524
|
};
|
|
525
|
+
/** `palette.lead.set`'s `status.state` (absent or null: `working`). */
|
|
526
|
+
const LEAD_STATES = ["working", "done", "failed", "note"];
|
|
525
527
|
/** The default handlers of `commands.run` and `palette.lead`. */
|
|
526
528
|
export function builtinHandlers(host, inner) {
|
|
527
529
|
return {
|
|
@@ -612,6 +614,12 @@ export function builtinHandlers(host, inner) {
|
|
|
612
614
|
}
|
|
613
615
|
if (typeof p.icon !== "string" && host.imagePath(p.icon) === null)
|
|
614
616
|
throw new HostError("invalid", "icon is an icon name or an image");
|
|
617
|
+
const state = p.status
|
|
618
|
+
?.state;
|
|
619
|
+
if (state !== undefined &&
|
|
620
|
+
state !== null &&
|
|
621
|
+
!LEAD_STATES.includes(state))
|
|
622
|
+
throw new HostError("invalid", `status.state is one of ${LEAD_STATES.join(", ")}`);
|
|
615
623
|
host.paletteLead = { ...p };
|
|
616
624
|
},
|
|
617
625
|
"palette.lead.clear": () => {
|
|
@@ -1116,12 +1116,41 @@ export interface PaletteLeadOptions {
|
|
|
1116
1116
|
/**
|
|
1117
1117
|
* Replaces the row while nothing is typed (a running request; the cursor
|
|
1118
1118
|
* starts on it); `null` or absent: none. Its run event has `status: true`.
|
|
1119
|
+
* While the palette is closed the player shows it in a status strip at
|
|
1120
|
+
* the top of the main window, as its `state` says.
|
|
1119
1121
|
*/
|
|
1120
1122
|
status?: {
|
|
1121
1123
|
/** The status text (up to 80 characters). */
|
|
1122
1124
|
text: string | Text;
|
|
1123
1125
|
/** On the right of the row (up to 40 characters). */
|
|
1124
1126
|
note?: string | Text;
|
|
1127
|
+
/**
|
|
1128
|
+
* Still working or ended. Absent: `"working"`.
|
|
1129
|
+
*
|
|
1130
|
+
* - `"working"`: the work goes on. The strip shows the text with a
|
|
1131
|
+
* moving line and a Stop button (Stop is Enter on the status row)
|
|
1132
|
+
* and stays until the status changes or is removed.
|
|
1133
|
+
* - `"done"`, `"failed"`, `"note"`: an end state (finished; failed; a
|
|
1134
|
+
* sentence for the user, such as an answer). The player shows it
|
|
1135
|
+
* with a check, in the danger colour, or plain, then removes it by
|
|
1136
|
+
* itself after a few seconds (about 2 s, 6 s, and 4–10 s by length;
|
|
1137
|
+
* longer while the pointer is on it). It is shown once: not kept,
|
|
1138
|
+
* not shown again later (when the plugin is stopped or woken), and
|
|
1139
|
+
* the row goes back to its usual form. The plugin needs no timer of
|
|
1140
|
+
* its own and may call {@link PaletteLead.done} right after setting
|
|
1141
|
+
* it.
|
|
1142
|
+
*
|
|
1143
|
+
* Once {@link Commands.run} has shown a step of the ticket in the
|
|
1144
|
+
* strip, a `"working"` text changes only the palette's status row,
|
|
1145
|
+
* until an end state, `status: null` or the end of the ticket.
|
|
1146
|
+
*
|
|
1147
|
+
* Players before the status strip refuse the field (`invalid`); a
|
|
1148
|
+
* built-in plugin ships with its player. Any other value: `invalid`
|
|
1149
|
+
* (through `ready`, or `update` rejects).
|
|
1150
|
+
*
|
|
1151
|
+
* @since 1.7.15
|
|
1152
|
+
*/
|
|
1153
|
+
state?: "working" | "done" | "failed" | "note";
|
|
1125
1154
|
} | null;
|
|
1126
1155
|
}
|
|
1127
1156
|
/**
|
|
@@ -613,9 +613,10 @@ export interface Dialogs {
|
|
|
613
613
|
* tool window the user just clicked in), else on the main window.
|
|
614
614
|
*
|
|
615
615
|
* **Windows:** a task dialog owned by the active player window, titled
|
|
616
|
-
* "Vestra Player"
|
|
617
|
-
* `
|
|
618
|
-
*
|
|
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.
|
|
619
620
|
*
|
|
620
621
|
* Remembering "Don't ask again" is up to the plugin (see
|
|
621
622
|
* {@link Scope.storage}).
|
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.15: 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
|
|