@vestra-player/sdk 1.7.0 → 1.7.2

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.
Files changed (88) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +6 -9
  3. package/bin/vestra-plugin.mjs +4 -4
  4. package/dist/api-requests.d.ts +8 -8
  5. package/dist/api-requests.js +8 -8
  6. package/dist/capability-check.d.ts +15 -15
  7. package/dist/capability-check.js +4 -4
  8. package/dist/capability-rules.d.ts +4 -5
  9. package/dist/capability-rules.js +4 -5
  10. package/dist/commands.d.ts +34 -44
  11. package/dist/commands.js +32 -38
  12. package/dist/docs-tree.json.gz +0 -0
  13. package/dist/docs.d.ts +1 -1
  14. package/dist/docs.js +13 -3
  15. package/dist/i18n-tools.js +1 -1
  16. package/dist/i18n.js +1 -1
  17. package/dist/media.d.ts +7 -7
  18. package/dist/palettes.d.ts +5 -5
  19. package/dist/palettes.js +5 -5
  20. package/dist/plugin/appearance.js +1 -1
  21. package/dist/plugin/bindings.d.ts +2 -3
  22. package/dist/plugin/bindings.js +2 -3
  23. package/dist/plugin/commands.js +10 -11
  24. package/dist/plugin/connection.d.ts +18 -19
  25. package/dist/plugin/connection.js +23 -24
  26. package/dist/plugin/index.d.ts +5 -5
  27. package/dist/plugin/index.js +1 -1
  28. package/dist/plugin/osd.d.ts +1 -1
  29. package/dist/plugin/osd.js +1 -1
  30. package/dist/plugin/passes.d.ts +4 -4
  31. package/dist/plugin/passes.js +4 -4
  32. package/dist/plugin/patch.d.ts +8 -8
  33. package/dist/plugin/patch.js +12 -12
  34. package/dist/plugin/player/events.js +5 -5
  35. package/dist/plugin/resolvers.js +3 -3
  36. package/dist/plugin/scope.d.ts +4 -4
  37. package/dist/plugin/scope.js +4 -4
  38. package/dist/plugin/services.d.ts +2 -3
  39. package/dist/plugin/services.js +2 -3
  40. package/dist/plugin/shaders.js +5 -6
  41. package/dist/plugin/state.js +10 -10
  42. package/dist/plugin/testing/commands.d.ts +4 -5
  43. package/dist/plugin/testing/commands.js +4 -5
  44. package/dist/plugin/testing/i18n.d.ts +1 -1
  45. package/dist/plugin/testing/i18n.js +1 -1
  46. package/dist/plugin/testing/index.d.ts +147 -165
  47. package/dist/plugin/testing/index.js +137 -155
  48. package/dist/plugin/testing/internals.d.ts +2 -2
  49. package/dist/plugin/testing/internals.js +2 -2
  50. package/dist/plugin/timeline.d.ts +1 -1
  51. package/dist/plugin/timeline.js +2 -2
  52. package/dist/plugin/types/base.d.ts +90 -111
  53. package/dist/plugin/types/commands.d.ts +142 -174
  54. package/dist/plugin/types/packages.d.ts +48 -63
  55. package/dist/plugin/types/playback.d.ts +45 -59
  56. package/dist/plugin/types/plugin-wire.d.ts +38 -45
  57. package/dist/plugin/types/processing.d.ts +52 -65
  58. package/dist/plugin/types/services.d.ts +18 -25
  59. package/dist/plugin/types/snapshots.d.ts +34 -46
  60. package/dist/plugin/types/sources.d.ts +14 -16
  61. package/dist/plugin/types/subtitles.d.ts +7 -8
  62. package/dist/plugin/types/ui-content.d.ts +111 -116
  63. package/dist/plugin/types/ui-layout.d.ts +52 -63
  64. package/dist/plugin/types/ui-locale.d.ts +41 -45
  65. package/dist/plugin/types/ui-shell.d.ts +69 -87
  66. package/dist/plugin/values.d.ts +15 -18
  67. package/dist/plugin/values.js +16 -19
  68. package/dist/plugin/view/base.d.ts +2 -2
  69. package/dist/plugin/view/base.js +7 -8
  70. package/dist/plugin/view/layout.d.ts +2 -2
  71. package/dist/plugin/view/panel.js +2 -4
  72. package/dist/plugin/view/writer.d.ts +8 -8
  73. package/dist/plugin/view/writer.js +37 -39
  74. package/dist/plugin/when.d.ts +3 -3
  75. package/dist/plugin/wire-facade.js +6 -7
  76. package/dist/processing.d.ts +26 -30
  77. package/dist/processing.js +4 -4
  78. package/dist/source-resolvers.d.ts +2 -2
  79. package/dist/source.d.ts +1 -2
  80. package/dist/subtitles.d.ts +1 -1
  81. package/dist/ts-plugin.d.ts +5 -5
  82. package/dist/wire.d.ts +63 -70
  83. package/dist/wire.js +21 -25
  84. package/llms.txt +7 -10
  85. package/package.json +1 -1
  86. package/slint/vestra/bar-buttons.slint +6 -8
  87. package/slint/vestra/focus.slint +1 -1
  88. package/slint/vestra/widgets.slint +2 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.7.2
4
+
5
+ **Who must change: nobody.** A documentation release: no API change, `apiVersion` stays `vestra/1`, the API surface snapshot is unchanged. The documentation goes from seven groups to four, and the remarks about players that were never released are gone.
6
+
7
+ - **Four groups**: **Tutorial** (one page: what a plugin is, the three ways to write one with `examples/three-ways`, where things live, running, testing and publishing), **Guides** (one task per page: the former how-to guides, plus Open a tool window and remember its state, Add settings and translations, Process video with a shader or a filter, and Design rules, which folds in the former guidelines), **Reference** and **Examples**. The Explanation, Upgrading and Guidelines groups and the five tutorials are gone; their content is in the Tutorial, the Guides or the Reference, or was dropped. `docs/how-to/` is now `docs/guides/`, with the same file names.
8
+ - **Old addresses keep working**: every removed or renamed page (Explanation, Concepts, How-to guides, Tutorials, Upgrading, Guidelines, each explanation, tutorial, guideline and upgrading page, Translate a plugin) redirects to the closest new page on the site, and its old title stays a name of that page in the documentation tree (`vestra-plugin docs /Guides/Concepts` opens the Tutorial). Paths in the tree: `/Guides/Tutorial`, `/Guides/Guides/<page>`, `/Guides/Reference/<page>`, `/Guides/Examples/<page>`.
9
+ - **No version history in the documentation**: sentences about older players, earlier SDKs and what changed in which release are removed from the pages and from the doc comments (`@since` and `@player` tags stay); `minPlayerVersion` is described in one sentence ("set it to the player you tested with"). The CHANGELOG keeps the history.
10
+ - **Reference trimmed**: the hand-written text of the Reference pages is about a third shorter; the Manifest page's "Player versions" table and its generator are gone, as are the "Introduced in" columns of Events and Messages (they held only "—") and the release-notes generator of the Upgrading group. Platforms lists current facts only.
11
+ - **Checks** (`npm run docs:check`): page shapes `tutorial`, `guide` (`**Goal:**`, `## Steps`, an optional `## Complete example`, `## See also`), `troubleshooting`, `reference` and `example`; line limits tutorial 400, guide 220. The rules are in `docs/maintaining.md`, "Documentation structure".
12
+
13
+ ## 1.7.1
14
+
15
+ **Who must change: nobody.** Tables follow the playlist's trimmed list keys: a data refresh of `BUILTIN_COMMANDS`; no API change, `apiVersion` stays `vestra/1`. A plugin whose tests compare a key against the table sees the player's current one.
16
+
17
+ - **`BUILTIN_COMMANDS`**: the built-in playlist (0.2.6) no longer gives its list commands keys that shadow a player key while the list has focus. Play (`vestra.playlist/playlist.play`) keeps `Enter` and loses `P`; Remove Selected (`playlist.remove`) keeps `Delete` and loses `Backspace`; Add Files… (`playlist.list-add`, was `Ctrl+I`), Add Folder… (`playlist.list-add-folder`, `Ctrl+O`), Add Link… (`playlist.list-link`, `Ctrl+U`), Remove Invalid Items (`playlist.remove-invalid`, `Ctrl+T`), Move to Top (`playlist.move-top`, `Ctrl+Home`), Open List File… (`playlist.list-open-list`, `F3`), Save List… (`playlist.list-save-list`, `F2`), Close List (`playlist.close`, `F6`) and Playlist Settings… (`playlist.settings`, `F5`) have no default key, and so no panel scope. Ids, titles and the other list keys are unchanged; `BUILTIN_SUBMENUS` is unchanged. The table in [Reference: commands](docs/reference/commands.md#built-in-commands) follows.
18
+
3
19
  ## 1.7.0
4
20
 
5
21
  **Who must change: nobody.** The one change a plugin can observe is `Command.set`, which now re-evaluates only its own command instead of running a full update pass: a binding that reads a variable changed together with `cmd.set(…)` outside a handler the SDK runs (a timer, a socket) needs `plugin.update()` after the change, or the variable in `plugin.state` (details under Step 2). Steps 2 and 3 of the SDK refactor (`doc/specs/sdk-refactor.md` §4 in the player repository) and the documentation refactor for the three ways to write a plugin. `apiVersion` stays `vestra/1`, no new capability, no player version needed; every existing golden trace keeps its wire lines and subscriptions, only the update-pass counts drop.
package/README.md CHANGED
@@ -10,7 +10,7 @@
10
10
  </p>
11
11
  <p align="center">
12
12
  <a href="https://vestrasys.github.io/vestra-player-sdk/">Documentation</a> ·
13
- <a href="https://vestrasys.github.io/vestra-player-sdk/documents/Getting_started.html">Getting started</a> ·
13
+ <a href="https://vestrasys.github.io/vestra-player-sdk/documents/Tutorial.html">Tutorial</a> ·
14
14
  <a href="https://github.com/vestrasys/vestra-player-sdk/tree/main/examples">Examples</a> ·
15
15
  <a href="https://github.com/vestrasys/vestra-player-sdk/blob/main/CHANGELOG.md">Changelog</a> ·
16
16
  <a href="https://vestrasys.github.io/vestra-player-sdk/llms.txt">llms.txt</a>
@@ -57,7 +57,7 @@ export default async function activate(plugin: Plugin) {
57
57
  }
58
58
  ```
59
59
 
60
- Run `npx vestra-plugin pack` to check and package it, or start the player with `--plugin <folder>` to try it right away. This is [`examples/hello`](https://github.com/vestrasys/vestra-player-sdk/tree/main/examples/hello); the [Tutorials](https://vestrasys.github.io/vestra-player-sdk/documents/Tutorials.html) build a plugin in four lessons: [Getting started](https://vestrasys.github.io/vestra-player-sdk/documents/Getting_started.html) (a menu item and an on-screen message), then a window, settings and translations, and tests, packing and publishing.
60
+ Run `npx vestra-plugin pack` to check and package it, or start the player with `--plugin <folder>` to try it right away. This is [`examples/hello`](https://github.com/vestrasys/vestra-player-sdk/tree/main/examples/hello); the [Tutorial](https://vestrasys.github.io/vestra-player-sdk/documents/Tutorial.html) explains what a plugin is, shows the three ways to write one, and runs, tests and publishes it.
61
61
 
62
62
  ## Examples
63
63
 
@@ -79,18 +79,15 @@ Complete, tested plugins in [`examples/`](https://github.com/vestrasys/vestra-pl
79
79
 
80
80
  The [documentation site](https://vestrasys.github.io/vestra-player-sdk/) is the one place for everything a plugin author needs:
81
81
 
82
- - **[Tutorials](https://vestrasys.github.io/vestra-player-sdk/documents/Tutorials.html)**: four lessons that build one plugin, starting with [Getting started](https://vestrasys.github.io/vestra-player-sdk/documents/Getting_started.html): a menu item, a window, settings and translations, tests and the store; then a lesson on writing your own blur kernel (a GPU shader and a convolution node).
83
- - **[How-to guides](https://vestrasys.github.io/vestra-player-sdk/documents/How-to_guides.html)**: one task each (goal, steps, complete example): playback, storage, subtitles, sliders, window state, the GPU switch, menu state that needs no running plugin (`plugin.when`), translating, testing, publishing; and troubleshooting.
84
- - **[Reference](https://vestrasys.github.io/vestra-player-sdk/documents/Reference.html)**: capabilities, manifest fields, limits, menus and bindings, platforms, theme, error codes, translations, the test host, and the [command line](https://vestrasys.github.io/vestra-player-sdk/documents/Command_line.html) (`vestra-plugin check`, `test`, `build`, `pack`, `i18n extract`, `i18n check`).
85
- - **[Explanation](https://vestrasys.github.io/vestra-player-sdk/documents/Explanation.html)**: how a plugin runs, commands and key bindings, playback, video and audio processing, the interface, GPU and software rendering, the player's Rust core and how it runs and talks to plugins.
86
- - **[Guidelines](https://vestrasys.github.io/vestra-player-sdk/documents/Guidelines.html)**: rules for every plugin, the interface and the menus.
82
+ - **[Tutorial](https://vestrasys.github.io/vestra-player-sdk/documents/Tutorial.html)**: one page: what a plugin is (a process that talks to the player), the three ways to write one with an example each, where things live, and running, testing and publishing.
83
+ - **[Guides](https://vestrasys.github.io/vestra-player-sdk/documents/Guides.html)**: one task each (goal, steps, often a complete example): windows, settings and translations, playback, storage, window state, sliders, subtitles, video filters, the GPU switch, menu state that needs no running plugin (`plugin.when`), testing, publishing, your own store, documentation for coding agents; the design rules every plugin follows; and troubleshooting.
84
+ - **[Reference](https://vestrasys.github.io/vestra-player-sdk/documents/Reference.html)**: capabilities, manifest fields, limits, menus and bindings, platforms, theme, error codes, events, messages, translations, the test host, and the [command line](https://vestrasys.github.io/vestra-player-sdk/documents/Command_line.html) (`vestra-plugin check`, `test`, `build`, `pack`, `i18n extract`, `i18n check`).
87
85
  - **[Examples](https://vestrasys.github.io/vestra-player-sdk/documents/Examples.html)**: the walkthroughs above.
88
- - **[Upgrading](https://vestrasys.github.io/vestra-player-sdk/documents/Upgrading.html)**: what to change when a release deprecates or removes something, with the migration checklists and every release's "who must change".
89
86
  - **[API](https://vestrasys.github.io/vestra-player-sdk/modules/_vestra-player_sdk.html)**: every type and member of `@vestra-player/sdk` and `@vestra-player/sdk/testing`.
90
87
 
91
88
  ## Compatibility
92
89
 
93
- Every 1.x release implements the plugin API `vestra/1`: minor releases only add backwards-compatible API, and a breaking change gets a new `apiVersion` and a new major version. Plugins run on the Node.js 26 that the player ships. API added after SDK 1.0 may need a newer player; [Player versions](https://vestrasys.github.io/vestra-player-sdk/documents/Manifest.html#player-versions) lists which API needs which player, for the manifest's `minPlayerVersion`. `@vestra-player/sdk/runtime` is for the player only and not covered by semver.
90
+ Every 1.x release implements the plugin API `vestra/1`: minor releases only add backwards-compatible API, and a breaking change gets a new `apiVersion` and a new major version. Plugins run on the Node.js 26 that the player ships. Set the manifest's `minPlayerVersion` to the player you tested with. `@vestra-player/sdk/runtime` is for the player only and not covered by semver.
94
91
 
95
92
  ## Contributing · License
96
93
 
@@ -28,7 +28,7 @@
28
28
  * one member's whole documentation; --search <query> lists
29
29
  * matching paths; at most 8 KB per answer, --page N for the rest
30
30
  *
31
- * Translations (docs/how-to/i18n.md). English is the source text; each
31
+ * Translations (docs/guides/i18n.md). English is the source text; each
32
32
  * language is a gettext file locales/<lang>.po:
33
33
  *
34
34
  * i18n extract find the texts to translate (@tr in .slint files, the
@@ -452,9 +452,9 @@ function slintCode(text) {
452
452
  /**
453
453
  * A `for` over an array the plugin binds (an `in` or `in-out` property of
454
454
  * array type of a component or global in the same file), outside a
455
- * `ListView`, in the plugin's .slint files: a reminder, not a failure
456
- * (SDK 1.5.46). Such a `for` builds every row of the array up front; since
457
- * player 0.6.0 a plugin may bind a whole long list, which belongs in a
455
+ * `ListView`, in the plugin's .slint files: a reminder, not a failure.
456
+ * Such a `for` builds every row of the array up front; a plugin may bind a
457
+ * whole long list, which belongs in a
458
458
  * `ListView` (it builds only the rows on screen). A text scan: imported
459
459
  * components and `@children` are not followed.
460
460
  */
@@ -44,14 +44,14 @@ export declare const API_REQUESTS: Readonly<Record<string, readonly ApiRequest[]
44
44
  */
45
45
  export declare const SUBSCRIBED_EVENTS: readonly string[];
46
46
  /**
47
- * Members whose requests depend on an argument (SDK 1.7.0), which
48
- * `API_REQUESTS` cannot list: the event name of a listener (`event`: a
49
- * subscribed event's `events.subscribe`, nothing for the others) or the
50
- * method name of a request (`method`: that method, with the string
51
- * fields of the second argument as its parameters). The capability check
52
- * reads the argument when its type is one string (a literal, a constant),
53
- * and reports the call as unchecked otherwise (a computed name, a union of
54
- * several, the member taken by destructuring or as a value).
47
+ * Members whose requests depend on an argument, which `API_REQUESTS` cannot
48
+ * list: the event name of a listener (`event`: a subscribed event's
49
+ * `events.subscribe`, nothing for the others) or the method name of a request
50
+ * (`method`: that method, with the string fields of the second argument as its
51
+ * parameters). The capability check reads the argument when its type is one
52
+ * string (a literal, a constant), and reports the call as unchecked otherwise
53
+ * (a computed name, a union of several, the member taken by destructuring or as
54
+ * a value).
55
55
  *
56
56
  * @internal
57
57
  */
@@ -176,14 +176,14 @@ export const SUBSCRIBED_EVENTS = Object.freeze([
176
176
  "video.upscaling.changed",
177
177
  ]);
178
178
  /**
179
- * Members whose requests depend on an argument (SDK 1.7.0), which
180
- * `API_REQUESTS` cannot list: the event name of a listener (`event`: a
181
- * subscribed event's `events.subscribe`, nothing for the others) or the
182
- * method name of a request (`method`: that method, with the string
183
- * fields of the second argument as its parameters). The capability check
184
- * reads the argument when its type is one string (a literal, a constant),
185
- * and reports the call as unchecked otherwise (a computed name, a union of
186
- * several, the member taken by destructuring or as a value).
179
+ * Members whose requests depend on an argument, which `API_REQUESTS` cannot
180
+ * list: the event name of a listener (`event`: a subscribed event's
181
+ * `events.subscribe`, nothing for the others) or the method name of a request
182
+ * (`method`: that method, with the string fields of the second argument as its
183
+ * parameters). The capability check reads the argument when its type is one
184
+ * string (a literal, a constant), and reports the call as unchecked otherwise
185
+ * (a computed name, a union of several, the member taken by destructuring or as
186
+ * a value).
187
187
  *
188
188
  * @internal
189
189
  */
@@ -15,13 +15,13 @@
15
15
  * (their object comes from a call that is checked) and options that need
16
16
  * more (a `processed` capture, a file resolver).
17
17
  *
18
- * Members whose capability depends on an argument (SDK 1.7.0:
19
- * `plugin.player.on` and `plugin.wire.on` by event name,
20
- * `plugin.wire.request` by method name, `ARGUMENT_APIS`) are checked by
21
- * that argument when its type fixes it to one string (a literal, a
22
- * constant); otherwise (a computed name, a union of several, the member
23
- * taken by destructuring or as a value) the call is reported as unchecked
24
- * ({@link checkCapabilities}), and the player still checks it.
18
+ * Members whose capability depends on an argument (`plugin.player.on` and
19
+ * `plugin.wire.on` by event name, `plugin.wire.request` by method name,
20
+ * `ARGUMENT_APIS`) are checked by that argument when its type fixes it to one
21
+ * string (a literal, a constant); otherwise (a computed name, a union of
22
+ * several, the member taken by destructuring or as a value) the call is
23
+ * reported as unchecked ({@link checkCapabilities}), and the player still
24
+ * checks it.
25
25
  *
26
26
  * The TypeScript module is passed in, never imported: the CLI uses the
27
27
  * SDK's own compiler, the editor its TypeScript server's.
@@ -70,10 +70,10 @@ export interface CheckOptions {
70
70
  readonly rules?: CapabilityRules;
71
71
  }
72
72
  /**
73
- * @internal A call whose capability the checker cannot tell (SDK 1.7.0): a
74
- * member of `ARGUMENT_APIS` (`plugin.wire.request`, `player.on`,
75
- * `wire.on`) whose name argument is not a string the types fix, or a method
76
- * the player's table does not know. The player still checks it at run time.
73
+ * @internal A call whose capability the checker cannot tell: a member of
74
+ * `ARGUMENT_APIS` (`plugin.wire.request`, `player.on`, `wire.on`) whose name
75
+ * argument is not a string the types fix, or a method the player's table does
76
+ * not know. The player still checks it at run time.
77
77
  */
78
78
  export interface UncheckedCall {
79
79
  readonly file: string;
@@ -96,10 +96,10 @@ export interface UncheckedCall {
96
96
  */
97
97
  export declare function findUndeclaredCapabilities(ts: typeof TS, program: TS.Program, options: CheckOptions): CapabilityFinding[];
98
98
  /**
99
- * The capability check (SDK 1.7.0): the uses of members whose capability
100
- * the manifest does not declare (`findings`, as
101
- * {@link findUndeclaredCapabilities}), and the calls whose capability
102
- * depends on a name the checker cannot read (`unchecked`).
99
+ * The capability check: the uses of members whose capability the manifest does
100
+ * not declare (`findings`, as {@link findUndeclaredCapabilities}), and the
101
+ * calls whose capability depends on a name the checker cannot read
102
+ * (`unchecked`).
103
103
  *
104
104
  * A call of `plugin.player.on` or `plugin.wire.on` is checked by its event
105
105
  * name, one of `plugin.wire.request` by its method name and the string
@@ -134,10 +134,10 @@ export function findUndeclaredCapabilities(ts, program, options) {
134
134
  return checkCapabilities(ts, program, options).findings;
135
135
  }
136
136
  /**
137
- * The capability check (SDK 1.7.0): the uses of members whose capability
138
- * the manifest does not declare (`findings`, as
139
- * {@link findUndeclaredCapabilities}), and the calls whose capability
140
- * depends on a name the checker cannot read (`unchecked`).
137
+ * The capability check: the uses of members whose capability the manifest does
138
+ * not declare (`findings`, as {@link findUndeclaredCapabilities}), and the
139
+ * calls whose capability depends on a name the checker cannot read
140
+ * (`unchecked`).
141
141
  *
142
142
  * A call of `plugin.player.on` or `plugin.wire.on` is checked by its event
143
143
  * name, one of `plugin.wire.request` by its method name and the string
@@ -87,11 +87,10 @@ export interface MemberNeed {
87
87
  */
88
88
  export declare function memberNeeds(api: string, capabilities: readonly string[], rules?: CapabilityRules): MemberNeed[] | undefined;
89
89
  /**
90
- * The requests of a call to a member of `ARGUMENT_APIS` (SDK 1.7.0), given
91
- * the value of its first argument and the string fields of its second:
92
- * a subscribed event's `events.subscribe`, nothing for an event that
93
- * arrives unasked, or the named method. `undefined`: a method the player's
94
- * table does not know (not checked).
90
+ * The requests of a call to a member of `ARGUMENT_APIS`, given the value of its
91
+ * first argument and the string fields of its second: a subscribed event's
92
+ * `events.subscribe`, nothing for an event that arrives unasked, or the named
93
+ * method. `undefined`: a method the player's table does not know (not checked).
95
94
  *
96
95
  * @param kind - What the argument names (`ARGUMENT_APIS`).
97
96
  * @param name - The event or method name.
@@ -73,11 +73,10 @@ export function memberNeeds(api, capabilities, rules = RULES) {
73
73
  return requestsNeed(requests, capabilities, rules);
74
74
  }
75
75
  /**
76
- * The requests of a call to a member of `ARGUMENT_APIS` (SDK 1.7.0), given
77
- * the value of its first argument and the string fields of its second:
78
- * a subscribed event's `events.subscribe`, nothing for an event that
79
- * arrives unasked, or the named method. `undefined`: a method the player's
80
- * table does not know (not checked).
76
+ * The requests of a call to a member of `ARGUMENT_APIS`, given the value of its
77
+ * first argument and the string fields of its second: a subscribed event's
78
+ * `events.subscribe`, nothing for an event that arrives unasked, or the named
79
+ * method. `undefined`: a method the player's table does not know (not checked).
81
80
  *
82
81
  * @param kind - What the argument names (`ARGUMENT_APIS`).
83
82
  * @param name - The event or method name.
@@ -101,15 +101,12 @@ export declare const COMMAND_LIMITS: {
101
101
  };
102
102
  /**
103
103
  * The player's built-in top-level menus, by id. Write `@<id>` as the first
104
- * segment of a command path (`["@video", "Blur"]`, see `CommandOptions.path`) to put a
105
- * command into that menu whatever language the player's menus are in. The
106
- * player stores the menu's title (视频 today); later segments are titles.
107
- * Needs player 0.3.0 (`"minPlayerVersion": "0.3.0"`); older players show
108
- * `@video` as a menu of its own. `reset` (SDK 1.5.51) needs player 0.6.3:
109
- * the Reset menu, directly below Settings, gathers every command that puts
110
- * something back to its default; older players refuse `@reset` with
111
- * `invalid`. The player's tests check that this list agrees with the
112
- * player's.
104
+ * segment of a command path (`["@video", "Blur"]`, see `CommandOptions.path`)
105
+ * to put a command into that menu whatever language the player's menus are in.
106
+ * Later segments are titles.
107
+ * `reset`: the Reset menu, directly below Settings, gathers every command that
108
+ * puts something back to its default. The player's tests check that this list
109
+ * agrees with the player's.
113
110
  *
114
111
  * @example Put a command into the built-in Video menu
115
112
  * "Blur" appears in the player's Video menu in every interface language.
@@ -133,12 +130,11 @@ export declare const COMMAND_LIMITS: {
133
130
  */
134
131
  export declare const MENU_IDS: readonly ["open", "playback", "subtitles", "video", "audio", "screen", "settings", "reset"];
135
132
  /**
136
- * The icons a bottom-bar button may name (`CommandOptions.button.icon`):
137
- * every icon of the player's V-Line set, `@vestra/icons.slint` (draw one
138
- * in your own Slint with `Icon { name: "store"; }`). The player's tests check
139
- * that this list is its icon set. `"sliders"` (three sliders, the player's
140
- * Adjustments and Effects button) is new in player 0.7.6 (SDK 1.6.11); older players refuse
141
- * it as a button icon with `invalid`.
133
+ * The icons a bottom-bar button may name (`CommandOptions.button.icon`): every
134
+ * icon of the player's V-Line set, `@vestra/icons.slint` (draw one in your own
135
+ * Slint with `Icon { name: "store"; }`). The player's tests check that this
136
+ * list is its icon set. `"sliders"` (three sliders, the player's Adjustments
137
+ * and Effects button).
142
138
  *
143
139
  * @example Check in a test that the button's icon exists
144
140
  * The test fails before release if the plugin's bar button names an icon
@@ -158,13 +154,11 @@ export declare const MENU_IDS: readonly ["open", "playback", "subtitles", "video
158
154
  */
159
155
  export declare const BAR_BUTTON_ICONS: readonly ["play", "pause", "stop", "back", "forward", "open", "volume", "mute", "playlist", "detach", "attach", "close", "failed", "move-top", "move-up", "move-down", "move-bottom", "search", "chapter", "bookmark", "check-task", "check-box", "menu-check", "submenu", "scroll-up", "scroll-down", "caret-down", "sort-asc", "sort-desc", "tag-remove", "preview-play", "add", "remove", "sort", "fullscreen", "exit-fullscreen", "store", "ai", "sliders"];
160
156
  /**
161
- * The player's limits on bottom-bar buttons (`CommandOptions.button`), the
162
- * same values as the player's (its tests check that they agree). A button
163
- * past `perPlugin` has none (its command still registers and its menu entry
164
- * stays). `total` is what the strip holds: the `total` lowest by order,
165
- * plugin id and declaration order; the rest are in the strip's » menu, in
166
- * the same order (older players keep the `total` highest and leave the
167
- * others out).
157
+ * The player's limits on bottom-bar buttons (`CommandOptions.button`), the same
158
+ * values as the player's (its tests check that they agree). A button past
159
+ * `perPlugin` has none (its command still registers and its menu entry stays).
160
+ * `total` is what the strip holds: the `total` lowest by order, plugin id and
161
+ * declaration order; the rest are in the strip's » menu, in the same order.
168
162
  *
169
163
  * @since 1.5.29
170
164
  *
@@ -210,8 +204,8 @@ export interface BuiltinSubmenu {
210
204
  * @example Add an item to the built-in Snapshot submenu
211
205
  * "Copy Snapshot" appears in Snapshot ▸ next to the built-in capture
212
206
  * 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
- * since player 0.7.6) lands in the same submenu whatever the interface
207
+ * path starts with the submenu's keys (`["Snapshot"]`, a top-level submenu)
208
+ * lands in the same submenu whatever the interface
215
209
  * language.
216
210
  * ```ts
217
211
  * import type { Plugin } from "@vestra-player/sdk";
@@ -297,22 +291,21 @@ export type CommandState = {
297
291
  enabled: boolean;
298
292
  checked: boolean | null;
299
293
  busy: boolean;
300
- /** Source text, or a text value (player 0.4.3). */
294
+ /** Source text, or a text value. */
301
295
  reason: string | TextJson | ListJson | null;
302
296
  };
303
297
  /**
304
- * A command's conditions (SDK 1.5.40, player 0.5.21): `enabled` and
305
- * `checked` evaluated by the player (`plugin.when`). Older players ignore
306
- * the field and show the state as sent.
298
+ * A command's conditions: `enabled` and `checked` evaluated by the player
299
+ * (`plugin.when`).
307
300
  */
308
301
  export type CommandWhen = {
309
302
  enabled?: ConditionJson;
310
303
  checked?: ConditionJson;
311
304
  };
312
305
  export type CommandDeclaration = {
313
- /** Source text, or a text value (player 0.4.3). */
306
+ /** Source text, or a text value. */
314
307
  title: string | TextJson;
315
- /** Complete primary menu path INCLUDING its leaf; empty = not in the main menu. Segments may be text values (player 0.4.3). */
308
+ /** Complete primary menu path INCLUDING its leaf; empty = not in the main menu. Segments may be text values. */
316
309
  path: (string | TextJson)[];
317
310
  /** Sibling order, ascending; a submenu takes its first command's order (a built-in menu keeps a fixed one). */
318
311
  order: number;
@@ -327,30 +320,27 @@ export type CommandDeclaration = {
327
320
  /** Fire again on keyboard auto-repeat while held. */
328
321
  repeat: boolean;
329
322
  /**
330
- * A bottom-bar button (player 0.5.10): an icon name, or an image in the
331
- * `plugin.ui.image` wire form. Sent only when set: older players refuse
332
- * unknown declaration fields.
323
+ * A bottom-bar button: an icon name, or an image in the `plugin.ui.image`
324
+ * wire form.
333
325
  */
334
326
  button?: {
335
327
  icon: string | Json;
336
328
  order: number;
337
329
  };
338
330
  /**
339
- * The command's category, source text or a text value (player 0.7.6).
340
- * Sent only when set: older players refuse unknown declaration fields.
331
+ * The command's category, source text or a text value.
341
332
  */
342
333
  category?: string | TextJson;
343
334
  /**
344
- * The local id of the command that opens where this one lives (player
345
- * 0.7.6). Sent only when set, like `category`.
335
+ * The local id of the command that opens where this one lives. Sent only when
336
+ * set, like `category`.
346
337
  */
347
338
  home?: string;
348
339
  };
349
340
  /**
350
- * `commands.keys` (player 0.7.6): each of the plugin's own commands, by
351
- * local id, and (SDK 1.6.16) each of the player's own as `host/<id>`, with
352
- * the labels of its current keys; the answer to the request and the data of
353
- * the event of that name.
341
+ * `commands.keys`: each of the plugin's own commands, by local id, and each of
342
+ * the player's own as `host/<id>`, with the labels of its current keys; the
343
+ * answer to the request and the data of the event of that name.
354
344
  *
355
345
  * @remarks
356
346
  * The player's wire shape (`commands.keys`), part of the protocol, which is not
@@ -372,9 +362,9 @@ export declare function commandClient(transport: Transport): {
372
362
  /** Remove the command from the menu and the binding table; the id is free again. */
373
363
  unregister: (id: string) => Promise<void>;
374
364
  /**
375
- * The key labels of the plugin's own commands, as menus show them
376
- * (player 0.7.6); later changes come as the `commands.keys` event, in
377
- * the same shape. `revision` orders answers and events.
365
+ * The key labels of the plugin's own commands, as menus show them; later
366
+ * changes come as the `commands.keys` event, in the same shape. `revision`
367
+ * orders answers and events.
378
368
  */
379
369
  keys: () => Promise<CommandKeys>;
380
370
  update: (id: string, revision: number, state: CommandState, when?: CommandWhen) => Promise<{
package/dist/commands.js CHANGED
@@ -97,15 +97,12 @@ export const COMMAND_LIMITS = {
97
97
  };
98
98
  /**
99
99
  * The player's built-in top-level menus, by id. Write `@<id>` as the first
100
- * segment of a command path (`["@video", "Blur"]`, see `CommandOptions.path`) to put a
101
- * command into that menu whatever language the player's menus are in. The
102
- * player stores the menu's title (视频 today); later segments are titles.
103
- * Needs player 0.3.0 (`"minPlayerVersion": "0.3.0"`); older players show
104
- * `@video` as a menu of its own. `reset` (SDK 1.5.51) needs player 0.6.3:
105
- * the Reset menu, directly below Settings, gathers every command that puts
106
- * something back to its default; older players refuse `@reset` with
107
- * `invalid`. The player's tests check that this list agrees with the
108
- * player's.
100
+ * segment of a command path (`["@video", "Blur"]`, see `CommandOptions.path`)
101
+ * to put a command into that menu whatever language the player's menus are in.
102
+ * Later segments are titles.
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.
109
106
  *
110
107
  * @example Put a command into the built-in Video menu
111
108
  * "Blur" appears in the player's Video menu in every interface language.
@@ -138,12 +135,11 @@ export const MENU_IDS = [
138
135
  "reset",
139
136
  ];
140
137
  /**
141
- * The icons a bottom-bar button may name (`CommandOptions.button.icon`):
142
- * every icon of the player's V-Line set, `@vestra/icons.slint` (draw one
143
- * in your own Slint with `Icon { name: "store"; }`). The player's tests check
144
- * that this list is its icon set. `"sliders"` (three sliders, the player's
145
- * Adjustments and Effects button) is new in player 0.7.6 (SDK 1.6.11); older players refuse
146
- * it as a button icon with `invalid`.
138
+ * The icons a bottom-bar button may name (`CommandOptions.button.icon`): every
139
+ * icon of the player's V-Line set, `@vestra/icons.slint` (draw one in your own
140
+ * Slint with `Icon { name: "store"; }`). The player's tests check that this
141
+ * list is its icon set. `"sliders"` (three sliders, the player's Adjustments
142
+ * and Effects button).
147
143
  *
148
144
  * @example Check in a test that the button's icon exists
149
145
  * The test fails before release if the plugin's bar button names an icon
@@ -203,13 +199,11 @@ export const BAR_BUTTON_ICONS = [
203
199
  "sliders",
204
200
  ];
205
201
  /**
206
- * The player's limits on bottom-bar buttons (`CommandOptions.button`), the
207
- * same values as the player's (its tests check that they agree). A button
208
- * past `perPlugin` has none (its command still registers and its menu entry
209
- * stays). `total` is what the strip holds: the `total` lowest by order,
210
- * plugin id and declaration order; the rest are in the strip's » menu, in
211
- * the same order (older players keep the `total` highest and leave the
212
- * others out).
202
+ * The player's limits on bottom-bar buttons (`CommandOptions.button`), the same
203
+ * values as the player's (its tests check that they agree). A button past
204
+ * `perPlugin` has none (its command still registers and its menu entry stays).
205
+ * `total` is what the strip holds: the `total` lowest by order, plugin id and
206
+ * declaration order; the rest are in the strip's » menu, in the same order.
213
207
  *
214
208
  * @since 1.5.29
215
209
  *
@@ -236,8 +230,8 @@ export const BAR_BUTTON_LIMITS = {
236
230
  * @example Add an item to the built-in Snapshot submenu
237
231
  * "Copy Snapshot" appears in Snapshot ▸ next to the built-in capture
238
232
  * 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
- * since player 0.7.6) lands in the same submenu whatever the interface
233
+ * path starts with the submenu's keys (`["Snapshot"]`, a top-level submenu)
234
+ * lands in the same submenu whatever the interface
241
235
  * language.
242
236
  * ```ts
243
237
  * import type { Plugin } from "@vestra-player/sdk";
@@ -464,16 +458,16 @@ vestra.playback | backward-3 | (Back 60 s) | Shift+ArrowLeft
464
458
  vestra.playback | forward-3 | (Forward 60 s) | Shift+ArrowRight
465
459
  vestra.playback | backward-4 | (Back 300 s) | Ctrl+Alt+ArrowLeft
466
460
  vestra.playback | forward-4 | (Forward 300 s) | Ctrl+Alt+ArrowRight
467
- vestra.playlist | playlist.play | (Play) | Enter, P | panel
468
- vestra.playlist | playlist.list-add | (Add Files…) | Ctrl+I | panel
469
- vestra.playlist | playlist.list-add-folder | (Add Folder…) | Ctrl+O | panel
470
- vestra.playlist | playlist.list-link | (Add Link…) | Ctrl+U | panel
471
- vestra.playlist | playlist.remove | (Remove Selected) | Delete, Backspace | panel
461
+ vestra.playlist | playlist.play | (Play) | Enter | panel
462
+ vestra.playlist | playlist.list-add | (Add Files…)
463
+ vestra.playlist | playlist.list-add-folder | (Add Folder…)
464
+ vestra.playlist | playlist.list-link | (Add Link…)
465
+ vestra.playlist | playlist.remove | (Remove Selected) | Delete | panel
472
466
  vestra.playlist | playlist.remove-unselected | (Remove Unselected) | Ctrl+Delete | panel
473
- vestra.playlist | playlist.remove-invalid | (Remove Invalid Items) | Ctrl+T | panel
467
+ vestra.playlist | playlist.remove-invalid | (Remove Invalid Items)
474
468
  vestra.playlist | playlist.clear | (Remove All) | Alt+Delete | panel
475
469
  vestra.playlist | playlist.reveal | (Show in Finder) | Ctrl+F | panel
476
- vestra.playlist | playlist.move-top | (Move to Top) | Ctrl+Home | panel
470
+ vestra.playlist | playlist.move-top | (Move to Top)
477
471
  vestra.playlist | playlist.move-up | (Move Up) | Ctrl+ArrowUp | panel
478
472
  vestra.playlist | playlist.move-down | (Move Down) | Ctrl+ArrowDown | panel
479
473
  vestra.playlist | playlist.move-bottom | (Move to Bottom) | Ctrl+End | panel
@@ -491,10 +485,10 @@ vestra.playlist | playlist.sort-path | (Sort by Path)
491
485
  vestra.playlist | playlist.sort-reverse | (Reverse Current Order)
492
486
  vestra.playlist | playlist.select-all | (Select All) | Ctrl+A | panel
493
487
  vestra.playlist | playlist.search | (Search) | Ctrl+S | panel
494
- vestra.playlist | playlist.list-open-list | (Open List File…) | F3 | panel
495
- vestra.playlist | playlist.list-save-list | (Save List…) | F2 | panel
496
- vestra.playlist | playlist.close | (Close List) | F6 | panel
497
- vestra.playlist | playlist.settings | (Playlist Settings…) | F5 | panel
488
+ vestra.playlist | playlist.list-open-list | (Open List File…)
489
+ vestra.playlist | playlist.list-save-list | (Save List…)
490
+ vestra.playlist | playlist.close | (Close List)
491
+ vestra.playlist | playlist.settings | (Playlist Settings…)
498
492
  vestra.subtitles | show | (Show Subtitles) | Alt+H
499
493
  vestra.subtitles | second-off | (Off)
500
494
  vestra.subtitles | second-position-top | (Top)
@@ -663,9 +657,9 @@ export function commandClient(transport) {
663
657
  /** Remove the command from the menu and the binding table; the id is free again. */
664
658
  unregister: (id) => transport.request("commands.unregister", { id }),
665
659
  /**
666
- * The key labels of the plugin's own commands, as menus show them
667
- * (player 0.7.6); later changes come as the `commands.keys` event, in
668
- * the same shape. `revision` orders answers and events.
660
+ * The key labels of the plugin's own commands, as menus show them; later
661
+ * changes come as the `commands.keys` event, in the same shape. `revision`
662
+ * orders answers and events.
669
663
  */
670
664
  keys: () => transport.request("commands.keys", {}),
671
665
  update: (id, revision, state, when) => transport.request("commands.update", {
Binary file
package/dist/docs.d.ts CHANGED
@@ -19,7 +19,7 @@ export interface DocsOptions {
19
19
  *
20
20
  * `/` lists Overview, Guides and API. `/Guides/<group>/<page title>` is a
21
21
  * page of the documentation site (its file name works too:
22
- * `/Guides/How-to/testing`); `/API/<category>/<symbol>/<member>` is a
22
+ * `/Guides/Guides/testing`); `/API/<category>/<symbol>/<member>` is a
23
23
  * declaration with its signature, parameters, return value, errors,
24
24
  * capability, player version and examples. Matching ignores case, spaces
25
25
  * and punctuation; a leading `/` and a `.md` suffix are optional; `.`
package/dist/docs.js CHANGED
@@ -8,7 +8,7 @@
8
8
  * docs("/") the top level
9
9
  * docs("/API/Media") a category: its symbols
10
10
  * docs("/API/Media/Snapshot/dispose") a member: its whole documentation
11
- * docs("/Guides/How-to/Test a plugin") a guide page
11
+ * docs("/Guides/Guides/Test a plugin") a guide page
12
12
  * searchDocs("snapshot export") matching paths
13
13
  * ```
14
14
  *
@@ -71,7 +71,8 @@ function tree() {
71
71
  };
72
72
  const root = nodes[0];
73
73
  assign(root);
74
- loaded = { version: data.version, root, nodes };
74
+ const moved = new Map(Object.entries(data.m ?? {}).map(([key, index]) => [key, nodes[index]]));
75
+ loaded = { version: data.version, root, nodes, moved };
75
76
  return loaded;
76
77
  }
77
78
  const bytes = (text) => Buffer.byteLength(text, "utf8");
@@ -193,6 +194,15 @@ function resolve(segments) {
193
194
  const none = { node: root, jumps: 0, inexact: 0, dropped: 0 };
194
195
  if (!segments.length)
195
196
  return { node: root, jumped: false };
197
+ // A page of an old group (`/Guides/How-to/testing`, `/Guides/Explanation/plugins`)
198
+ // opens the page it moved to, as the site's redirects do.
199
+ const old = loose(segments[0]) === "guides" ? segments.slice(1) : segments;
200
+ if (old.length === 2) {
201
+ const page = old[1].replace(/\.md$/i, "");
202
+ const moved = tree().moved.get(`${loose(old[0])}/${loose(page)}`);
203
+ if (moved)
204
+ return { node: moved, jumped: false };
205
+ }
196
206
  const attempts = [segments];
197
207
  const dotted = segments.flatMap((segment) => segment.split(".").filter(Boolean));
198
208
  if (dotted.length !== segments.length)
@@ -438,7 +448,7 @@ function notFound(asked, segments, page) {
438
448
  *
439
449
  * `/` lists Overview, Guides and API. `/Guides/<group>/<page title>` is a
440
450
  * page of the documentation site (its file name works too:
441
- * `/Guides/How-to/testing`); `/API/<category>/<symbol>/<member>` is a
451
+ * `/Guides/Guides/testing`); `/API/<category>/<symbol>/<member>` is a
442
452
  * declaration with its signature, parameters, return value, errors,
443
453
  * capability, player version and examples. Matching ignores case, spaces
444
454
  * and punctuation; a leading `/` and a `.md` suffix are optional; `.`
@@ -8,7 +8,7 @@ var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExte
8
8
  };
9
9
  /**
10
10
  * `vestra-plugin i18n extract` and `vestra-plugin i18n check`, and the
11
- * catalog step of `vestra-plugin build` (docs/how-to/i18n.md): find the
11
+ * catalog step of `vestra-plugin build` (docs/guides/i18n.md): find the
12
12
  * translatable texts of a plugin, keep `locales/messages.pot` and
13
13
  * `locales/<lang>.po` up to date, warn about what cannot be translated, and
14
14
  * compile the `.po` files the player reads.
package/dist/i18n.js CHANGED
@@ -4,7 +4,7 @@
4
4
  * `locales/<lang>.json` a package carries, template formatting and the
5
5
  * Slint `@tr` scanner. Used by `vestra-plugin i18n`, `vestra-plugin build`
6
6
  * and {@link TestHost}; not part of the plugin API (plugins write no
7
- * translation code: see docs/how-to/i18n.md).
7
+ * translation code: see docs/guides/i18n.md).
8
8
  * Internal: the player's runner and tests reach it through
9
9
  * `@vestra-player/sdk/runtime`, `LOCALES` through `./testing`.
10
10
  */