@vestra-player/sdk 1.5.8 → 1.5.11

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 (43) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/README.md +4 -1
  3. package/bin/vestra-plugin.mjs +170 -7
  4. package/dist/commands.d.ts +7 -4
  5. package/dist/i18n-tools.d.ts +67 -0
  6. package/dist/i18n-tools.js +787 -0
  7. package/dist/i18n.d.ts +222 -0
  8. package/dist/i18n.js +972 -0
  9. package/dist/player-runtime.d.ts +2 -0
  10. package/dist/player-runtime.js +2 -0
  11. package/dist/plugin/appearance.js +27 -1
  12. package/dist/plugin/bindings.js +1 -0
  13. package/dist/plugin/commands.js +24 -4
  14. package/dist/plugin/index.js +9 -1
  15. package/dist/plugin/language.d.ts +8 -0
  16. package/dist/plugin/language.js +79 -0
  17. package/dist/plugin/osd.d.ts +11 -0
  18. package/dist/plugin/osd.js +64 -9
  19. package/dist/plugin/packages.js +10 -0
  20. package/dist/plugin/runtime.d.ts +3 -1
  21. package/dist/plugin/runtime.js +6 -0
  22. package/dist/plugin/scope.d.ts +1 -0
  23. package/dist/plugin/scope.js +2 -0
  24. package/dist/plugin/subtitles.js +9 -1
  25. package/dist/plugin/testing.d.ts +184 -5
  26. package/dist/plugin/testing.js +459 -67
  27. package/dist/plugin/timeline.js +3 -1
  28. package/dist/plugin/types.d.ts +523 -54
  29. package/dist/plugin/ui.js +29 -10
  30. package/dist/plugin/values.d.ts +55 -0
  31. package/dist/plugin/values.js +117 -0
  32. package/dist/plugin/window.d.ts +2 -0
  33. package/dist/plugin/window.js +4 -0
  34. package/dist/source-resolvers.d.ts +0 -1
  35. package/dist/source-resolvers.js +9 -1
  36. package/dist/subtitles.d.ts +3 -1
  37. package/dist/wire.d.ts +38 -6
  38. package/dist/wire.js +13 -2
  39. package/llms-full.txt +646 -58
  40. package/llms.txt +44 -40
  41. package/package.json +1 -1
  42. package/slint/vestra/markdown.slint +5 -5
  43. package/slint/vestra/widgets.slint +4 -4
package/llms.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  # Vestra Player SDK
2
2
 
3
- > @vestra-player/sdk 1.5.8: 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; it runs in its own Node.js process. llms-full.txt, next to this file, has every declaration, the guides and the examples; L<n> below are its line numbers.
3
+ > @vestra-player/sdk 1.5.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; it runs in its own Node.js process. llms-full.txt, next to this file, has every declaration, the guides and the examples; L<n> below are its line numbers.
4
4
 
5
5
  **How plugins run**
6
6
 
@@ -120,6 +120,8 @@ test("shows the position", async () => {
120
120
  - `vestra-plugin test [dir...]`: Runs `node --test` on `tests/*.test.{ts,mjs}`.
121
121
  - `vestra-plugin build [dir...] [--version x.y.z]`: Writes `dist/`: types stripped, files copied, manifest versioned.
122
122
  - `vestra-plugin pack [dir...] [--version x.y.z] [--out dir]`: Builds, then packs `dist/` as `<id>-<version>.vxp`.
123
+ - `vestra-plugin i18n extract [dir...] [--locale lang]`: Collects the texts to translate into `locales/`, keeping translations.
124
+ - `vestra-plugin i18n check [dir...]`: Translation coverage and untranslatable text (warnings only).
123
125
  - `vestra-player --plugin <dir>` runs a plugin from source, no build needed.
124
126
 
125
127
  **Error codes** (`error.code`; branch on it, never on `message`)
@@ -135,7 +137,7 @@ test("shows the position", async () => {
135
137
  - `failed`: The operation ran and failed
136
138
  - `aborted`: An `AbortSignal` fired
137
139
  - `timeout`: A time limit ran out
138
- - `limit`: A player-wide limit was reached
140
+ - `limit`: A player-wide limit was reached, a property value is over the limits of PropValue, or a request is longer than the player's 1 MiB message
139
141
  - `reserved`: Packages.validate, PackageCandidate.install: the id is `vestra` or starts with `vestra.`, which only the player's built-in plugins use
140
142
  - `versionMismatch`: The package needs a newer player or another `apiVersion`
141
143
  - `ui-prepare`: The player could not prepare a mounted panel or a settings page
@@ -150,54 +152,56 @@ test("shows the position", async () => {
150
152
  - [Concept: Windows, panels, settings pages, dialogs and the OSD](https://vestrasys.github.io/vestra-player-sdk/documents/Windows__panels__settings_pages__dialogs_and_the_OSD.html): L281–626
151
153
  - [How-to: Keep a slider responsive while dragging](https://vestrasys.github.io/vestra-player-sdk/documents/Keep_a_slider_responsive_while_dragging.html): L627–801
152
154
  - [How-to: Remember a window's state between runs](https://vestrasys.github.io/vestra-player-sdk/documents/Remember_a_window_s_state_between_runs.html): L802–931
153
- - [API: @vestra-player/sdk](https://vestrasys.github.io/vestra-player-sdk/modules/_vestra-player_sdk.html): L932–4173
154
- - [API: @vestra-player/sdk/testing](https://vestrasys.github.io/vestra-player-sdk/modules/_vestra-player_sdk_testing.html) (TestHost, startPlugin): L4174–5120
155
+ - [API: @vestra-player/sdk](https://vestrasys.github.io/vestra-player-sdk/modules/_vestra-player_sdk.html): L932–4427
156
+ - [API: @vestra-player/sdk/testing](https://vestrasys.github.io/vestra-player-sdk/modules/_vestra-player_sdk_testing.html) (TestHost, startPlugin): L4428–5537
155
157
 
156
158
  ## API
157
159
 
158
160
  Where each module of `plugin` is declared:
159
161
 
160
- - Plugin L1151, Scope L1022, PluginError L974, Disposable L947
161
- - plugin.commands: Commands L1347
162
- - plugin.windows: Windows L1552
163
- - plugin.panels: Panels L2003
164
- - plugin.dialogs: Dialogs L2285
165
- - plugin.player: Player L2724
166
- - plugin.video: VideoFilter L2973, VideoView L3036, RenderOptions L3078
167
- - plugin.audio: AudioFilter L2997
168
- - plugin.subtitles: Subtitles L3176
169
- - plugin.media: MediaCapture L3334
170
- - plugin.resolvers: Resolvers L3439
171
- - plugin.packages: Packages L3657
172
- - plugin.osd: Osd L2910
173
- - plugin.host: Host L2873
174
- - plugin.clipboard: Clipboard L3770
175
- - plugin.power: Power L3790
176
- - plugin.tools: Tools L3823
177
- - plugin.storage: Storage L3866
178
- - plugin.system: System L3889
179
- - plugin.secrets: Secrets L3907
180
- - plugin.window: MainWindow L2126
181
- - plugin.app: App L2207
182
- - plugin.bindings: Bindings L3740
183
- - plugin.ui: Ui L1439
184
- - plugin.timeline: Timeline L2083
185
- - plugin.drops: Drops L1849
186
- - plugin.appearance: Appearance L1878
187
- - plugin.settings: Settings L1936
162
+ - Plugin L1153, Scope L1022, PluginError L974, Disposable L947
163
+ - plugin.commands: Commands L1361
164
+ - plugin.windows: Windows L1566
165
+ - plugin.panels: Panels L2207
166
+ - plugin.dialogs: Dialogs L2493
167
+ - plugin.player: Player L2934
168
+ - plugin.video: VideoFilter L3199, VideoView L3262, RenderOptions L3304
169
+ - plugin.audio: AudioFilter L3223
170
+ - plugin.subtitles: Subtitles L3402
171
+ - plugin.media: MediaCapture L3562
172
+ - plugin.resolvers: Resolvers L3667
173
+ - plugin.packages: Packages L3907
174
+ - plugin.osd: Osd L3135
175
+ - plugin.host: Host L3083
176
+ - plugin.clipboard: Clipboard L4024
177
+ - plugin.power: Power L4044
178
+ - plugin.tools: Tools L4077
179
+ - plugin.storage: Storage L4120
180
+ - plugin.system: System L4143
181
+ - plugin.secrets: Secrets L4161
182
+ - plugin.window: MainWindow L2330
183
+ - plugin.app: App L2411
184
+ - plugin.bindings: Bindings L3994
185
+ - plugin.ui: Ui L1453
186
+ - plugin.timeline: Timeline L2287
187
+ - plugin.drops: Drops L1863
188
+ - plugin.appearance: Appearance L1892
189
+ - plugin.i18n: I18n L2034
190
+ - plugin.settings: Settings L2140
188
191
 
189
192
  ## Examples
190
193
 
191
194
  Complete plugins with tests, in [examples/](https://github.com/vestrasys/vestra-player-sdk/tree/main/examples) and in llms-full.txt:
192
195
 
193
- - hello: The README Quick start: one menu command and an on-screen message. L5534–5623
194
- - blur: A tool window with one slider that blurs the playing video. L5624–5885
195
- - signal-generator: Generates its own video and audio: colour bars and a 1 kHz tone. L5886–6218
196
- - bookmark: A tool window bound to the playback state: remember the position and jump back to it. L6219–6403
197
- - panel-menu: A sidebar panel with its own right-click menu. L6404–6609
198
- - menus: Radio menu items, separator groups and a menu item whose title changes. L6610–6769
199
- - theme-widgets: A tool window drawn with the player's theme and widgets. L6770–6933
200
- - markdown: A window that shows a Markdown document. L6934–7127
196
+ - hello: The README Quick start: one menu command and an on-screen message. L5954–6043
197
+ - blur: A tool window with one slider that blurs the playing video. L6044–6305
198
+ - signal-generator: Generates its own video and audio: colour bars and a 1 kHz tone. L6306–6638
199
+ - bookmark: A tool window bound to the playback state: remember the position and jump back to it. L6639–6823
200
+ - panel-menu: A sidebar panel with its own right-click menu. L6824–7029
201
+ - menus: Radio menu items, separator groups and a menu item whose title changes. L7030–7189
202
+ - theme-widgets: A tool window drawn with the player's theme and widgets. L7190–7353
203
+ - markdown: A window that shows a Markdown document. L7354–7547
204
+ - i18n: A plugin in the player's language: English source text, a Chinese translation. L7548–7715
201
205
 
202
206
  ## Optional
203
207
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vestra-player/sdk",
3
- "version": "1.5.8",
3
+ "version": "1.5.11",
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": {
@@ -7,7 +7,7 @@
7
7
  // `MarkdownView` scrolls one document. `MarkdownBlocks` does not scroll and
8
8
  // is as tall as its content: put it in your own layout or in a `ListView`
9
9
  // row (a chat message: a `[MarkdownBlock]` field of the row's struct).
10
- // `code-copy: true` adds a 复制 button to code blocks that reports
10
+ // `code-copy: true` adds a Copy button to code blocks that reports
11
11
  // `copy-code(code)`; the plugin copies it (`plugin.clipboard`).
12
12
  import { ScrollView } from "std-widgets.slint";
13
13
  import { Theme } from "theme.slint";
@@ -139,7 +139,7 @@ component MarkdownBlockView {
139
139
  border-radius: Theme.radius-control;
140
140
  background: copy-touch.pressed ? Theme.button-press : copy-touch.has-hover ? Theme.button-hover : Theme.button-bg;
141
141
  copy-label := Text {
142
- text: "复制";
142
+ text: @tr("Copy");
143
143
  color: copy-touch.has-hover ? Theme.text : Theme.text-dim;
144
144
  font-size: Theme.font-body;
145
145
  vertical-alignment: center;
@@ -160,7 +160,7 @@ component MarkdownBlockView {
160
160
  }
161
161
  }
162
162
  if block.kind == "image" && !block.has-image: Text {
163
- text: block.alt == "" ? "[图片]" : "[图片] " + block.alt;
163
+ text: block.alt == "" ? @tr("[Image]") : @tr("[Image] {}", block.alt);
164
164
  color: Theme.text-dim;
165
165
  font-size: Theme.font-body;
166
166
  wrap: word-wrap;
@@ -214,7 +214,7 @@ component MarkdownBlockView {
214
214
  // Markdown blocks without scrolling, as tall as their content.
215
215
  export component MarkdownBlocks inherits Rectangle {
216
216
  in property <[MarkdownBlock]> blocks;
217
- // A 复制 button on code blocks, reporting `copy-code(code)`.
217
+ // A Copy button on code blocks, reporting `copy-code(code)`.
218
218
  in property <bool> code-copy: false;
219
219
  callback link-clicked(string);
220
220
  callback copy-code(string);
@@ -239,7 +239,7 @@ export component MarkdownView inherits Rectangle {
239
239
  in property <[MarkdownBlock]> blocks;
240
240
  // Space around the document.
241
241
  in property <length> inset: 10px;
242
- // A 复制 button on code blocks, reporting `copy-code(code)`.
242
+ // A Copy button on code blocks, reporting `copy-code(code)`.
243
243
  in property <bool> code-copy: false;
244
244
  callback link-clicked(string);
245
245
  callback copy-code(string);
@@ -183,14 +183,14 @@ export component Slider {
183
183
  }
184
184
  }
185
185
 
186
- // Link input (UI-DLG-02): a multi-line input and [打开] [取消]. Enter or the
187
- // confirm button accepts (Shift+Enter starts a new line), Esc or 取消 cancels.
186
+ // Link input (UI-DLG-02): a multi-line input and [Open] [Cancel]. Enter or the
187
+ // confirm button accepts (Shift+Enter starts a new line), Esc or Cancel cancels.
188
188
  // No validation here: the plugin checks the address.
189
189
  export component UrlInputRow {
190
190
  in-out property <string> text;
191
191
  in property <string> placeholder;
192
- in property <string> confirm-text: "打开";
193
- in property <string> cancel-text: "取消";
192
+ in property <string> confirm-text: @tr("Open");
193
+ in property <string> cancel-text: @tr("Cancel");
194
194
  in property <bool> enabled: true;
195
195
  callback accepted(string);
196
196
  callback cancelled();