@vestra-player/sdk 1.7.11 → 1.7.12

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,14 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.7.12
4
+
5
+ **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).
6
+
7
+ - **Tools menu** (user ruling, 2026-11-11, the short menu): the right-click menu's top level becomes Open ▸, Close, Play/Pause, the domain menus, Tools ▸, Options… and Quit. `["@tools", "Screen Ruler…"]` (or the key `["Tools", …]`) puts a command into the player's new built-in top-level menu **Tools** (order 820, after the domain menus and before Options…), the home of the player's tools and of any plugin's own. Tools ▸ and Settings ▸ are always drawn in the separator group of Options… and Quit (`settings-main`), whatever groups the items inside declare; an item without an `order` goes after the player's (after About Vestra Player…). Its title is the player's (工具 in Simplified Chinese).
8
+ - **`TestHost`** accepts `@tools`, shows Tools in the player's words (`MENU_KEYS`, `HOST_GROUPS`, `HOST_ZH_HANS`), lists it in its refusal of an unknown menu id (`… @settings, @reset, @tools`), and refuses a plugin command at Tools ▸ Command Palette… (`conflict`), the player's own place now; Toggle Fullscreen, Sidebar and Adjustments and Effects, out of the menu, no longer hold their top-level paths. Tests: `test/command-declarations.test.ts`, `test/i18n-host.test.ts`.
9
+ - **Product data, the final state of the short menu** (the built-in plugins follow with the player release that uses this SDK; until then the player's agreement test reports their rows as advisories): `BUILTIN_COMMANDS` puts Open File… in Open ▸ (first), the track, Snapshot, chapter list, Vestra Player AI…, Plugin Store…, Command Palette… and About Vestra Player… items in Tools ▸, and Adjustments and Effects, Sidebar and Toggle Fullscreen outside the menu (the bottom bar, `Escape` and the palette keep them); it gains Ask Vestra's palette-only `vestra.workshop` commands `askvestra.undo` (Undo Last Request) and `askvestra.stop` (Stop). `BUILTIN_SUBMENUS`: Tools ▸ Audio Track, Tools ▸ Subtitle Track, Tools ▸ Snapshot (top-level before). The Slint library copy already matched the player.
10
+ - **Docs**: [Reference: commands](docs/reference/commands.md#the-top-level) shows the short top level with Tools ▸ open, its groups and `order` ranges and the groups inside Tools ▸; `CommandOptions` gives Tools' fixed order and group; [Design rules](docs/guides/design-rules.md) keeps the top level short and puts a tool into Tools ▸. The generated menu-id, submenu and built-in command tables follow.
11
+
3
12
  ## 1.7.11
4
13
 
5
14
  **Who must change: nobody; the table follows player #271.** A data refresh of `BUILTIN_COMMANDS`: no API change, `apiVersion` stays `vestra/1`, the API surface snapshot is unchanged.
@@ -106,8 +106,11 @@ export declare const COMMAND_LIMITS: {
106
106
  * to put a command into that menu whatever language the player's menus are in.
107
107
  * Later segments are titles.
108
108
  * `reset`: the Reset menu, directly below Settings, gathers every command that
109
- * puts something back to its default. The player's tests check that this list
110
- * agrees with the player's.
109
+ * puts something back to its default. `tools` (SDK 1.7.12): the Tools menu,
110
+ * after the domain menus and before Options…, the home of the player's tools
111
+ * (tracks, snapshot, Vestra Player AI, the store, the command palette) and of
112
+ * any plugin's own. The player's tests check that this list agrees with the
113
+ * player's.
111
114
  *
112
115
  * @example Put a command into the built-in Video menu
113
116
  * "Blur" appears in the player's Video menu in every interface language.
@@ -129,7 +132,7 @@ export declare const COMMAND_LIMITS: {
129
132
  * @since 1.3.0
130
133
  * @category Testing
131
134
  */
132
- export declare const MENU_IDS: readonly ["open", "playback", "subtitles", "video", "audio", "screen", "settings", "reset"];
135
+ export declare const MENU_IDS: readonly ["open", "playback", "subtitles", "video", "audio", "screen", "settings", "reset", "tools"];
133
136
  /**
134
137
  * The icons a bottom-bar button may name (`CommandOptions.button.icon`): every
135
138
  * icon of the player's V-Line set, `@vestra/icons.slint` (draw one in your own
@@ -208,11 +211,10 @@ export interface BuiltinSubmenu {
208
211
  * released.
209
212
  *
210
213
  * @example Add an item to the built-in Snapshot submenu
211
- * "Copy Snapshot" appears in Snapshot ▸ next to the built-in capture
212
- * plugin's items. Paths merge by their English keys, so a command whose
213
- * path starts with the submenu's keys (`["Snapshot"]`, a top-level submenu)
214
- * lands in the same submenu whatever the interface
215
- * language.
214
+ * "Copy Snapshot" appears in Tools ▸ Snapshot ▸ next to the built-in
215
+ * capture plugin's items. Paths merge by their English keys, so a command
216
+ * whose path starts with the submenu's keys (`["Tools", "Snapshot"]`) lands
217
+ * in the same submenu whatever the interface language.
216
218
  * ```ts
217
219
  * import type { Plugin } from "@vestra-player/sdk";
218
220
  * declare const plugin: Plugin;
@@ -223,7 +225,7 @@ export interface BuiltinSubmenu {
223
225
  * const snapshot = BUILTIN_SUBMENUS.find((menu) => menu.path.at(-1) === "Snapshot")!;
224
226
  * plugin.commands.add({
225
227
  * id: "snapshot-to-clipboard",
226
- * // ["Snapshot", "Copy Snapshot"]
228
+ * // ["Tools", "Snapshot", "Copy Snapshot"]
227
229
  * path: [...snapshot.path, "Copy Snapshot"],
228
230
  * run: copySnapshot,
229
231
  * });
package/dist/commands.js CHANGED
@@ -101,8 +101,11 @@ export const COMMAND_LIMITS = {
101
101
  * to put a command into that menu whatever language the player's menus are in.
102
102
  * Later segments are titles.
103
103
  * `reset`: the Reset menu, directly below Settings, gathers every command that
104
- * puts something back to its default. The player's tests check that this list
105
- * agrees with the player's.
104
+ * puts something back to its default. `tools` (SDK 1.7.12): the Tools menu,
105
+ * after the domain menus and before Options…, the home of the player's tools
106
+ * (tracks, snapshot, Vestra Player AI, the store, the command palette) and of
107
+ * any plugin's own. The player's tests check that this list agrees with the
108
+ * player's.
106
109
  *
107
110
  * @example Put a command into the built-in Video menu
108
111
  * "Blur" appears in the player's Video menu in every interface language.
@@ -133,6 +136,7 @@ export const MENU_IDS = [
133
136
  "screen",
134
137
  "settings",
135
138
  "reset",
139
+ "tools",
136
140
  ];
137
141
  /**
138
142
  * The icons a bottom-bar button may name (`CommandOptions.button.icon`): every
@@ -234,11 +238,10 @@ export const BAR_BUTTON_LIMITS = {
234
238
  * released.
235
239
  *
236
240
  * @example Add an item to the built-in Snapshot submenu
237
- * "Copy Snapshot" appears in Snapshot ▸ next to the built-in capture
238
- * plugin's items. Paths merge by their English keys, so a command whose
239
- * path starts with the submenu's keys (`["Snapshot"]`, a top-level submenu)
240
- * lands in the same submenu whatever the interface
241
- * language.
241
+ * "Copy Snapshot" appears in Tools ▸ Snapshot ▸ next to the built-in
242
+ * capture plugin's items. Paths merge by their English keys, so a command
243
+ * whose path starts with the submenu's keys (`["Tools", "Snapshot"]`) lands
244
+ * in the same submenu whatever the interface language.
242
245
  * ```ts
243
246
  * import type { Plugin } from "@vestra-player/sdk";
244
247
  * declare const plugin: Plugin;
@@ -249,7 +252,7 @@ export const BAR_BUTTON_LIMITS = {
249
252
  * const snapshot = BUILTIN_SUBMENUS.find((menu) => menu.path.at(-1) === "Snapshot")!;
250
253
  * plugin.commands.add({
251
254
  * id: "snapshot-to-clipboard",
252
- * // ["Snapshot", "Copy Snapshot"]
255
+ * // ["Tools", "Snapshot", "Copy Snapshot"]
253
256
  * path: [...snapshot.path, "Copy Snapshot"],
254
257
  * run: copySnapshot,
255
258
  * });
@@ -261,13 +264,13 @@ export const BAR_BUTTON_LIMITS = {
261
264
  */
262
265
  export const BUILTIN_SUBMENUS = Object.freeze([
263
266
  { path: ["Open", "Recently Played"], plugins: ["vestra.history"] },
264
- { path: ["Audio Track"], plugins: ["vestra.audio"] },
265
- { path: ["Subtitle Track"], plugins: ["vestra.subtitles"] },
266
- { path: ["Snapshot"], plugins: ["vestra.capture"] },
267
+ { path: ["Tools", "Audio Track"], plugins: ["vestra.audio"] },
268
+ { path: ["Tools", "Subtitle Track"], plugins: ["vestra.subtitles"] },
269
+ { path: ["Tools", "Snapshot"], plugins: ["vestra.capture"] },
267
270
  ]);
268
271
  /** owner | id | key path, or (title) outside the menu | bindings | panel */
269
272
  const BUILTIN_COMMAND_TABLE = `
270
- vestra.playback | open | Open File… | Ctrl+O, F3
273
+ vestra.playback | open | Open ▸ Open File… | Ctrl+O, F3
271
274
  vestra.playback | open-url | Open ▸ Open URL… | Ctrl+U
272
275
  vestra.playlist | playlist.open-folder | Open ▸ Open Folder… | F2
273
276
  vestra.subtitles | load | Open ▸ Open Subtitle… | Alt+O
@@ -280,21 +283,21 @@ vestra.history | recent.clear | Open ▸ Recently Played ▸ Clear Entries
280
283
  vestra.history | recent.enabled | Open ▸ Recently Played ▸ Record Playback History
281
284
  host | stop | Close | F4
282
285
  host | play-pause | Play/Pause | Space, Mouse:LeftClick
283
- vestra.audio | audio.track.none | Audio Track ▸ No Audio Tracks
284
- vestra.subtitles | track-off | Subtitle Track ▸ Off
285
- vestra.capture | capture.save | Snapshot ▸ Save Current Frame | Ctrl+E
286
- vestra.capture | capture.copy | Snapshot ▸ Copy Current Frame | Ctrl+C
287
- vestra.capture | capture.burst | Snapshot ▸ Burst | Ctrl+G
288
- host | adjust | Adjustments and Effects
289
- host | sidebar | Sidebar
290
- vestra.marks | marks.list | Chapter and Bookmark List… | H
291
- host | fullscreen | Toggle Fullscreen | Escape
292
- vestra.workshop | workshop.open | Vestra Player AI…
293
- vestra.store | open | Plugin Store…
294
- host | palette | Command Palette… | Ctrl+Shift+P
286
+ vestra.audio | audio.track.none | Tools ▸ Audio Track ▸ No Audio Tracks
287
+ vestra.subtitles | track-off | Tools ▸ Subtitle Track ▸ Off
288
+ vestra.capture | capture.save | Tools ▸ Snapshot ▸ Save Current Frame | Ctrl+E
289
+ vestra.capture | capture.copy | Tools ▸ Snapshot ▸ Copy Current Frame | Ctrl+C
290
+ vestra.capture | capture.burst | Tools ▸ Snapshot ▸ Burst | Ctrl+G
291
+ vestra.marks | marks.list | Tools ▸ Chapter and Bookmark List… | H
292
+ vestra.workshop | workshop.open | Tools ▸ Vestra Player AI…
293
+ vestra.store | open | Tools ▸ Plugin Store…
294
+ host | palette | Tools ▸ Command Palette… | Ctrl+Shift+P
295
+ vestra.info | info.about | Tools ▸ About Vestra Player… | F1
295
296
  vestra.preferences | options | Options… | F5
296
- vestra.info | info.about | About Vestra Player… | F1
297
297
  host | quit | Quit | Cmd+Q
298
+ host | adjust | (Adjustments and Effects)
299
+ host | sidebar | (Sidebar)
300
+ host | fullscreen | (Toggle Fullscreen) | Escape
298
301
  host | previous | (Previous) | PageUp, Mouse:X2
299
302
  host | next | (Next) | PageDown, Mouse:X1
300
303
  host | enter-fullscreen | (Enter Fullscreen)
@@ -598,6 +601,8 @@ vestra.video | video.hue.down | (Hue -1%) | I
598
601
  vestra.video | video.hue.up | (Hue +1%) | O
599
602
  vestra.video | video.gpu-rendering | (GPU Rendering)
600
603
  vestra.video | video.upscaling | (AI Upscaling)
604
+ vestra.workshop | askvestra.undo | (Undo Last Request)
605
+ vestra.workshop | askvestra.stop | (Stop)
601
606
  `;
602
607
  /**
603
608
  * The commands the player and its built-in plugins register when the
Binary file
package/dist/i18n.js CHANGED
@@ -847,6 +847,7 @@ export const MENU_KEYS = {
847
847
  screen: "Screen",
848
848
  settings: "Settings",
849
849
  reset: "Reset",
850
+ tools: "Tools",
850
851
  };
851
852
  /** The player's old Chinese titles of its own menus: parent, title, key. */
852
853
  const LEGACY_MENUS = [
@@ -872,6 +873,7 @@ export const HOST_GROUPS = [
872
873
  "Screen",
873
874
  "Settings",
874
875
  "Reset",
876
+ "Tools",
875
877
  "Playback/Speed",
876
878
  "Playback/Seek",
877
879
  ];
@@ -909,6 +911,7 @@ export const HOST_ZH_HANS = {
909
911
  Screen: "屏幕",
910
912
  Settings: "设置",
911
913
  Reset: "复位",
914
+ Tools: "工具",
912
915
  Speed: "速度",
913
916
  Seek: "跳转",
914
917
  Close: "关闭",
@@ -302,9 +302,10 @@ export function commandsHandlers(host, inner) {
302
302
  if (host.commands.has(id))
303
303
  throw commandConflict("owner/localId already registered");
304
304
  // The player's own commands beside the core actions (host/actions.rs
305
- // `host_declarations`: Adjustments and Effects, Sidebar, Toggle
306
- // Fullscreen, Command Palette…, Quit and two outside the menu), which
307
- // take part in conflicts and the total like any other.
305
+ // `host_declarations`: Command Palette… and Quit in the menu,
306
+ // Adjustments and Effects, Sidebar, Toggle Fullscreen and two more
307
+ // outside it), which take part in conflicts and the total like any
308
+ // other.
308
309
  const hostOnly = BUILTIN_COMMANDS.filter((row) => row.owner === "host" && !host.coreCommands.has(`host/${row.id}`));
309
310
  // A path may not repeat another command's (the player's own
310
311
  // included) nor be a submenu of one, or one of its submenus.
@@ -267,14 +267,16 @@ export interface When {
267
267
  /**
268
268
  * A built-in top-level menu of the player, named in a command path as `@<id>`
269
269
  * or by its English key (see {@link CommandOptions.path}): Open, Playback,
270
- * Subtitles, Video, Audio, Screen, Settings, Reset. The list is `MENU_IDS` in
271
- * `@vestra-player/sdk/testing`. Reset (`@reset`) gathers every command that
272
- * puts something back to its default.
270
+ * Subtitles, Video, Audio, Screen, Settings, Reset, Tools. The list is
271
+ * `MENU_IDS` in `@vestra-player/sdk/testing`. Reset (`@reset`) gathers every
272
+ * command that puts something back to its default; Tools (`@tools`, since
273
+ * 1.7.12) holds the player's tools (tracks, snapshot, Vestra Player AI, the
274
+ * store, the command palette, About) and any plugin's own.
273
275
  *
274
276
  * @since 1.3.0
275
277
  * @category Commands
276
278
  */
277
- export type MenuId = "open" | "playback" | "subtitles" | "video" | "audio" | "screen" | "settings" | "reset";
279
+ export type MenuId = "open" | "playback" | "subtitles" | "video" | "audio" | "screen" | "settings" | "reset" | "tools";
278
280
  /**
279
281
  * An icon of the player's V-Line set (`@vestra/icons.slint`), by name: what
280
282
  * a bottom-bar button may show. The list is `BAR_BUTTON_ICONS` in
@@ -360,13 +362,17 @@ export interface CommandButton {
360
362
  * plugin id, then declaration order, never by title. `group` only draws
361
363
  * separators, so keep a group's orders contiguous. Recommended top-level
362
364
  * ranges: `open` 100–199, `domain` 200–699 (playback, subtitles, video,
363
- * audio…), `screen` 700–799, `windows` 800–899, `exit` 900–999.
365
+ * audio…), `screen` 700–799, `windows` 800–819, `settings-main` 820–999
366
+ * (Tools ▸, Options…, Quit); put a tool into Tools ▸ (`@tools`) rather than
367
+ * the top level.
364
368
  *
365
369
  * Built-in menus keep their place. The built-in top-level menus
366
370
  * ({@link MenuId}) sit at fixed orders, whatever is inside them: Open 110,
367
- * Playback 200, Subtitles 300, Video 400, Audio 500, Screen 710, Settings 830,
368
- * Reset 840 (directly below Settings and in its separator group). Like every
369
- * built-in menu, Reset shows only when a command is in it. This holds whether
371
+ * Playback 200, Subtitles 300, Video 400, Audio 500, Screen 710, Tools 820,
372
+ * Settings 830, Reset 840. Tools and Settings are drawn in the separator group
373
+ * of Options… and Quit (`settings-main`) and Reset in Settings' group, whatever
374
+ * groups the items inside declare. Like every built-in menu, Tools, Settings
375
+ * and Reset show only when a command is in them. This holds whether
370
376
  * the path names the menu by id (`["@video", "Blur"]`) or by its key
371
377
  * (`["Video", "Blur"]`), so a plugin's item never moves the player's menu.
372
378
  * Directly inside a built-in menu, `order` 0 (the default) sorts after every
@@ -400,10 +406,10 @@ export interface CommandOptions {
400
406
  * player shows each segment and the title in the interface language from the
401
407
  * declaring plugin's catalog (`locales/<lang>.po`, see the [i18n
402
408
  * guide](../../../docs/guides/i18n.md)); the player's own menus (Open,
403
- * Playback, Subtitles, Video, Audio, Screen, Settings, Reset, and Playback ▸
409
+ * Playback, Subtitles, Video, Audio, Screen, Settings, Reset, Tools, and Playback ▸
404
410
  * Speed, Playback ▸ Seek) always show the player's words. A built-in menu can
405
411
  * also be named by its id, `@` plus a {@link MenuId}: `@open`, `@playback`,
406
- * `@subtitles`, `@video`, `@audio`, `@screen`, `@settings` or `@reset`. Only
412
+ * `@subtitles`, `@video`, `@audio`, `@screen`, `@settings`, `@reset` or `@tools`. Only
407
413
  * the first segment is read as an id; an unknown id, or an id with nothing
408
414
  * after it, fails with `invalid`.
409
415
  *
package/llms.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  # Vestra Player SDK
2
2
 
3
- > @vestra-player/sdk 1.7.11: 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.12: 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.11",
3
+ "version": "1.7.12",
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": {