@vestra-player/sdk 1.7.12 → 1.7.14
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 +13 -0
- package/dist/commands.d.ts +2 -2
- package/dist/commands.js +3 -3
- package/dist/docs-tree.json.gz +0 -0
- package/dist/plugin/testing/commands.d.ts +12 -0
- package/dist/plugin/testing/commands.js +29 -9
- package/dist/plugin/testing/index.js +2 -1
- package/dist/plugin/types/commands.d.ts +5 -0
- package/llms.txt +1 -1
- package/package.json +1 -1
- package/slint/vestra/icons.slint +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.7.14
|
|
4
|
+
|
|
5
|
+
**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.
|
|
6
|
+
|
|
7
|
+
- **`BUILTIN_COMMANDS`** (`vestra.workshop`, player a08759b0: Ask Vestra runs commands only): `askvestra.undo` (Undo Last Request) is gone; `askvestra.working` (Vestra is working) is new, `focus: "panel"`, in no menu, palette or bar (the plugin keeps itself busy with it while a request runs). The table in [Reference: commands](docs/reference/commands.md#built-in-commands) follows.
|
|
8
|
+
- **`bindings.list`** (player 0.8.0): a `focus: "panel"` command of a plugin whose manifest declares no `ui.mount` is left out, since no key can reach it; it stays declared, so its stored binding is not an orphan and `bindings.set` accepts it. `Bindings.list` says so, and `TestHost` follows for the plugin under test (from its manifest; a `TestHost` used without `startPlugin` lists every command as before). Test: `test/round3a.test.ts`.
|
|
9
|
+
|
|
10
|
+
## 1.7.13
|
|
11
|
+
|
|
12
|
+
**Who must change: nobody.** A product-data refresh of the Slint library copy: no API change, `apiVersion` stays `vestra/1`, the API surface snapshot is unchanged.
|
|
13
|
+
|
|
14
|
+
- **`@vestra/icons.slint`** follows the player (main 20d4d542): the palette button's `search-ai` icon is a speech bubble open at its top right with the AI icon's sparkle (design B; it was the magnifier with the AI icon's cross). Same name, box (14 × 12) and line width; `BAR_BUTTON_ICONS` describes it so. 1.7.12 shipped without it: its sync compared against a player checkout that did not have the icon yet.
|
|
15
|
+
|
|
3
16
|
## 1.7.12
|
|
4
17
|
|
|
5
18
|
**Who must change: nobody; additions only.** `MENU_IDS` and `MenuId` gain `tools`, `apiVersion` stays `vestra/1`, no new capability; the API surface snapshot gains the new id. A plugin may now put commands in `@tools`; one that does needs the first player with the short menu as its `minPlayerVersion`: older players refuse `@tools` with `invalid` (since SDK 1.5.49 that command is skipped and the rest of the plugin activates). `["Tools", …]` by key works on every player (older ones show a plugin's own Tools submenu).
|
package/dist/commands.d.ts
CHANGED
|
@@ -138,8 +138,8 @@ export declare const MENU_IDS: readonly ["open", "playback", "subtitles", "video
|
|
|
138
138
|
* icon of the player's V-Line set, `@vestra/icons.slint` (draw one in your own
|
|
139
139
|
* Slint with `Icon { name: "store"; }`). The player's tests check that this
|
|
140
140
|
* list is its icon set. `"sliders"` (three sliders, the player's Adjustments
|
|
141
|
-
* and Effects button); `"search-ai"` (
|
|
142
|
-
*
|
|
141
|
+
* and Effects button); `"search-ai"` (a speech bubble with the AI icon's
|
|
142
|
+
* sparkle, the palette's button while a plugin holds its lead row).
|
|
143
143
|
*
|
|
144
144
|
* @example Check in a test that the button's icon exists
|
|
145
145
|
* The test fails before release if the plugin's bar button names an icon
|
package/dist/commands.js
CHANGED
|
@@ -143,8 +143,8 @@ export const MENU_IDS = [
|
|
|
143
143
|
* icon of the player's V-Line set, `@vestra/icons.slint` (draw one in your own
|
|
144
144
|
* Slint with `Icon { name: "store"; }`). The player's tests check that this
|
|
145
145
|
* list is its icon set. `"sliders"` (three sliders, the player's Adjustments
|
|
146
|
-
* and Effects button); `"search-ai"` (
|
|
147
|
-
*
|
|
146
|
+
* and Effects button); `"search-ai"` (a speech bubble with the AI icon's
|
|
147
|
+
* sparkle, the palette's button while a plugin holds its lead row).
|
|
148
148
|
*
|
|
149
149
|
* @example Check in a test that the button's icon exists
|
|
150
150
|
* The test fails before release if the plugin's bar button names an icon
|
|
@@ -601,8 +601,8 @@ vestra.video | video.hue.down | (Hue -1%) | I
|
|
|
601
601
|
vestra.video | video.hue.up | (Hue +1%) | O
|
|
602
602
|
vestra.video | video.gpu-rendering | (GPU Rendering)
|
|
603
603
|
vestra.video | video.upscaling | (AI Upscaling)
|
|
604
|
-
vestra.workshop | askvestra.undo | (Undo Last Request)
|
|
605
604
|
vestra.workshop | askvestra.stop | (Stop)
|
|
605
|
+
vestra.workshop | askvestra.working | (Vestra is working) | | panel
|
|
606
606
|
`;
|
|
607
607
|
/**
|
|
608
608
|
* The commands the player and its built-in plugins register when the
|
package/dist/docs-tree.json.gz
CHANGED
|
Binary file
|
|
@@ -23,6 +23,18 @@ export declare function splitCommandKey(_host: TestHost, _inner: Internals, key:
|
|
|
23
23
|
plugin: string;
|
|
24
24
|
command: string;
|
|
25
25
|
};
|
|
26
|
+
/**
|
|
27
|
+
* The capabilities of the plugin under test's manifest, set by
|
|
28
|
+
* `startPlugin`; a host without an entry (requests sent by hand) lists
|
|
29
|
+
* every command in `bindings.list`.
|
|
30
|
+
*/
|
|
31
|
+
export declare const pluginCapabilities: WeakMap<TestHost, readonly string[]>;
|
|
32
|
+
/**
|
|
33
|
+
* `bindings.list`, as the player's (binding_manager.rs `list`, player
|
|
34
|
+
* 0.8.0): a `focus: "panel"` command of a plugin whose manifest declares no
|
|
35
|
+
* `ui.mount` can never fire from a key, so it is left out; it stays declared
|
|
36
|
+
* (its stored binding is no orphan, `bindings.set` accepts it).
|
|
37
|
+
*/
|
|
26
38
|
export declare function bindingTable(host: TestHost, inner: Internals): {
|
|
27
39
|
commands: {
|
|
28
40
|
title: string;
|
|
@@ -87,7 +87,34 @@ export function splitCommandKey(_host, _inner, key) {
|
|
|
87
87
|
const at = key.indexOf("/");
|
|
88
88
|
return { plugin: key.slice(0, at), command: key.slice(at + 1) };
|
|
89
89
|
}
|
|
90
|
+
/**
|
|
91
|
+
* The capabilities of the plugin under test's manifest, set by
|
|
92
|
+
* `startPlugin`; a host without an entry (requests sent by hand) lists
|
|
93
|
+
* every command in `bindings.list`.
|
|
94
|
+
*/
|
|
95
|
+
export const pluginCapabilities = new WeakMap();
|
|
96
|
+
/**
|
|
97
|
+
* `bindings.list`, as the player's (binding_manager.rs `list`, player
|
|
98
|
+
* 0.8.0): a `focus: "panel"` command of a plugin whose manifest declares no
|
|
99
|
+
* `ui.mount` can never fire from a key, so it is left out; it stays declared
|
|
100
|
+
* (its stored binding is no orphan, `bindings.set` accepts it).
|
|
101
|
+
*/
|
|
90
102
|
export function bindingTable(host, inner) {
|
|
103
|
+
const all = bindingRows(host, inner);
|
|
104
|
+
const capabilities = pluginCapabilities.get(host);
|
|
105
|
+
const hidden = capabilities !== undefined && !capabilities.includes("ui.mount");
|
|
106
|
+
const declared = new Set(all.map((c) => `${c.plugin}/${c.command}`));
|
|
107
|
+
const commands = all.filter((c) => !(hidden && c.scope === "panel" && c.plugin === host.manifestId));
|
|
108
|
+
const orphans = [...host.bindings.overlay]
|
|
109
|
+
.filter(([key]) => !declared.has(key))
|
|
110
|
+
.map(([key, inputs]) => ({
|
|
111
|
+
ref: splitCommandKey(host, inner, key),
|
|
112
|
+
inputs,
|
|
113
|
+
}));
|
|
114
|
+
return { commands, orphans };
|
|
115
|
+
}
|
|
116
|
+
/** Every command's row of the binding table, bindable or not. */
|
|
117
|
+
function bindingRows(host, inner) {
|
|
91
118
|
const claims = bindingClaims(host, inner);
|
|
92
119
|
const commands = [...host.coreCommands, ...host.commands].map(([id, { declaration }]) => {
|
|
93
120
|
const key = bindingKey(host, inner, id);
|
|
@@ -124,14 +151,7 @@ export function bindingTable(host, inner) {
|
|
|
124
151
|
labels: [...current],
|
|
125
152
|
};
|
|
126
153
|
});
|
|
127
|
-
|
|
128
|
-
const orphans = [...host.bindings.overlay]
|
|
129
|
-
.filter(([key]) => !declared.has(key))
|
|
130
|
-
.map(([key, inputs]) => ({
|
|
131
|
-
ref: splitCommandKey(host, inner, key),
|
|
132
|
-
inputs,
|
|
133
|
-
}));
|
|
134
|
-
return { commands, orphans };
|
|
154
|
+
return commands;
|
|
135
155
|
}
|
|
136
156
|
/** A command's state as the player shows it: its conditions evaluated. */
|
|
137
157
|
export function commandShown(host, _inner, sent, when) {
|
|
@@ -393,7 +413,7 @@ export function commandsHandlers(host, inner) {
|
|
|
393
413
|
"bindings.list": () => bindingTable(host, inner),
|
|
394
414
|
"bindings.set": (p) => {
|
|
395
415
|
const key = `${p.plugin}/${p.command}`;
|
|
396
|
-
const known =
|
|
416
|
+
const known = bindingRows(host, inner).some((c) => `${c.plugin}/${c.command}` === key);
|
|
397
417
|
if (!known && !host.bindings.overlay.has(key))
|
|
398
418
|
throw new HostError("missing", `no command ${key}`);
|
|
399
419
|
host.bindings.overlay.set(key, [...p.inputs]);
|
|
@@ -85,7 +85,7 @@ import { PATCH_FEATURE } from "../patch.js";
|
|
|
85
85
|
import { LOCALES, LIST_SEPARATORS, loadPackageCatalog, TEXT_LIMITS, } from "../../i18n.js";
|
|
86
86
|
import { Internals } from "./internals.js";
|
|
87
87
|
import { on, emit, settle, close, keepsRunning, transportHandlers, tick, takenErrors, tellResidency, } from "./transport.js";
|
|
88
|
-
import { bindingClaims, bindingKey, keysChanged, press, barButtons, commandsHandlers, builtinHandlers, runPaletteLead, } from "./commands.js";
|
|
88
|
+
import { bindingClaims, bindingKey, keysChanged, press, barButtons, commandsHandlers, builtinHandlers, runPaletteLead, pluginCapabilities, } from "./commands.js";
|
|
89
89
|
import { registerCoreActions, windowFacts, coreActionsHandlers, } from "./core-actions.js";
|
|
90
90
|
import { translate, i18nHandlers } from "./i18n.js";
|
|
91
91
|
import { mountOther, unmountOther, mounted, setTimelineRanges, setTimelineLayer, layoutHandlers, } from "./layout.js";
|
|
@@ -2840,6 +2840,7 @@ export async function startPlugin(activate, options = {}) {
|
|
|
2840
2840
|
manifest = { id: read.id, capabilities: read.capabilities };
|
|
2841
2841
|
}
|
|
2842
2842
|
host.manifestId = manifest.id;
|
|
2843
|
+
pluginCapabilities.set(host, manifest.capabilities);
|
|
2843
2844
|
if (options.builtin)
|
|
2844
2845
|
host.builtin = true;
|
|
2845
2846
|
host.loadCatalog(directory);
|
|
@@ -1471,6 +1471,11 @@ export interface Bindings {
|
|
|
1471
1471
|
/**
|
|
1472
1472
|
* Every declared command, and overrides whose command is gone.
|
|
1473
1473
|
*
|
|
1474
|
+
* A `focus: "panel"` command of a plugin whose manifest does not declare
|
|
1475
|
+
* `ui.mount` is left out (player 0.8.0): it has no panel, so no key can
|
|
1476
|
+
* reach it. It is still declared: its stored binding is not an orphan,
|
|
1477
|
+
* and `set` accepts it.
|
|
1478
|
+
*
|
|
1474
1479
|
* @capability bindings.manage
|
|
1475
1480
|
* @throws `capability` (rejects) The manifest does not declare
|
|
1476
1481
|
* `bindings.manage`.
|
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.14: 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
package/slint/vestra/icons.slint
CHANGED
|
@@ -55,10 +55,10 @@ export global Icons {
|
|
|
55
55
|
// Three sliders with their knobs (the adjust column, `host/adjust`),
|
|
56
56
|
// the default 14 × 12 box.
|
|
57
57
|
if name == "sliders" { return "M 1.5 2.5 H 7.6 M 10.4 2.5 H 12.5 M 10.4 2.5 A 1.4 1.4 0 1 1 7.6 2.5 A 1.4 1.4 0 1 1 10.4 2.5 Z M 1.5 6 H 3.1 M 5.9 6 H 12.5 M 5.9 6 A 1.4 1.4 0 1 1 3.1 6 A 1.4 1.4 0 1 1 5.9 6 Z M 1.5 9.5 H 6.6 M 9.4 9.5 H 12.5 M 9.4 9.5 A 1.4 1.4 0 1 1 6.6 9.5 A 1.4 1.4 0 1 1 9.4 9.5 Z"; }
|
|
58
|
-
//
|
|
59
|
-
// palette's strip cell while a plugin holds its
|
|
60
|
-
// `palette.lead`), the default 14 × 12 box.
|
|
61
|
-
if name == "search-ai" { return "M
|
|
58
|
+
// A speech bubble open at its top right, where the AI icon's sparkle
|
|
59
|
+
// breaks out ("ask": the palette's strip cell while a plugin holds its
|
|
60
|
+
// first row, `palette.lead`), the default 14 × 12 box.
|
|
61
|
+
if name == "search-ai" { return "M 7 3 H 3.25 Q 1.25 3 1.25 5 V 7.75 Q 1.25 9.75 3.25 9.75 V 11.25 L 5.5 9.75 H 8 Q 10 9.75 10 7.75 V 6.75 M 11 0.7 Q 11.29 2.61 13.2 2.9 Q 11.29 3.19 11 5.1 Q 10.71 3.19 8.8 2.9 Q 10.71 2.61 11 0.7 Z"; }
|
|
62
62
|
return "";
|
|
63
63
|
}
|
|
64
64
|
// Line width.
|