@vestra-player/sdk 1.5.7 → 1.5.9

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/llms.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  # Vestra Player SDK
2
2
 
3
- > @vestra-player/sdk 1.5.7: 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.9: 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`)
@@ -136,7 +138,7 @@ test("shows the position", async () => {
136
138
  - `aborted`: An `AbortSignal` fired
137
139
  - `timeout`: A time limit ran out
138
140
  - `limit`: A player-wide limit was reached
139
- - `reserved`: Packages.validate, PackageCandidate.trial, PackageCandidate.install: the id is `vestra` or starts with `vestra.`, which only the player's built-in plugins use
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
142
144
  - `ui`: The player could not apply a property to a tool window or a settings page, or could not build the Options window
@@ -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–4172
154
- - [API: @vestra-player/sdk/testing](https://vestrasys.github.io/vestra-player-sdk/modules/_vestra-player_sdk_testing.html) (TestHost, startPlugin): L4173–5113
155
+ - [API: @vestra-player/sdk](https://vestrasys.github.io/vestra-player-sdk/modules/_vestra-player_sdk.html): L932–4268
156
+ - [API: @vestra-player/sdk/testing](https://vestrasys.github.io/vestra-player-sdk/modules/_vestra-player_sdk_testing.html) (TestHost, startPlugin): L4269–5290
155
157
 
156
158
  ## API
157
159
 
158
160
  Where each module of `plugin` is declared:
159
161
 
160
- - Plugin L1152, Scope L1023, PluginError L974, Disposable L947
161
- - plugin.commands: Commands L1349
162
- - plugin.windows: Windows L1554
163
- - plugin.panels: Panels L2005
164
- - plugin.dialogs: Dialogs L2287
165
- - plugin.player: Player L2726
166
- - plugin.video: VideoFilter L2975, VideoView L3038, RenderOptions L3080
167
- - plugin.audio: AudioFilter L2999
168
- - plugin.subtitles: Subtitles L3178
169
- - plugin.media: MediaCapture L3336
170
- - plugin.resolvers: Resolvers L3441
171
- - plugin.packages: Packages L3662
172
- - plugin.osd: Osd L2912
173
- - plugin.host: Host L2875
174
- - plugin.clipboard: Clipboard L3769
175
- - plugin.power: Power L3789
176
- - plugin.tools: Tools L3822
177
- - plugin.storage: Storage L3865
178
- - plugin.system: System L3888
179
- - plugin.secrets: Secrets L3906
180
- - plugin.window: MainWindow L2128
181
- - plugin.app: App L2209
182
- - plugin.bindings: Bindings L3739
183
- - plugin.ui: Ui L1441
184
- - plugin.timeline: Timeline L2085
185
- - plugin.drops: Drops L1851
186
- - plugin.appearance: Appearance L1880
187
- - plugin.settings: Settings L1938
162
+ - Plugin L1153, Scope L1022, PluginError L974, Disposable L947
163
+ - plugin.commands: Commands L1356
164
+ - plugin.windows: Windows L1561
165
+ - plugin.panels: Panels L2070
166
+ - plugin.dialogs: Dialogs L2356
167
+ - plugin.player: Player L2795
168
+ - plugin.video: VideoFilter L3046, VideoView L3109, RenderOptions L3151
169
+ - plugin.audio: AudioFilter L3070
170
+ - plugin.subtitles: Subtitles L3249
171
+ - plugin.media: MediaCapture L3407
172
+ - plugin.resolvers: Resolvers L3512
173
+ - plugin.packages: Packages L3752
174
+ - plugin.osd: Osd L2982
175
+ - plugin.host: Host L2944
176
+ - plugin.clipboard: Clipboard L3865
177
+ - plugin.power: Power L3885
178
+ - plugin.tools: Tools L3918
179
+ - plugin.storage: Storage L3961
180
+ - plugin.system: System L3984
181
+ - plugin.secrets: Secrets L4002
182
+ - plugin.window: MainWindow L2193
183
+ - plugin.app: App L2274
184
+ - plugin.bindings: Bindings L3835
185
+ - plugin.ui: Ui L1448
186
+ - plugin.timeline: Timeline L2150
187
+ - plugin.drops: Drops L1858
188
+ - plugin.appearance: Appearance L1887
189
+ - plugin.i18n: I18n L1959
190
+ - plugin.settings: Settings L2003
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. L5527–5616
194
- - blur: A tool window with one slider that blurs the playing video. L5617–5878
195
- - signal-generator: Generates its own video and audio: colour bars and a 1 kHz tone. L5879–6211
196
- - bookmark: A tool window bound to the playback state: remember the position and jump back to it. L6212–6396
197
- - panel-menu: A sidebar panel with its own right-click menu. L6397–6602
198
- - menus: Radio menu items, separator groups and a menu item whose title changes. L6603–6762
199
- - theme-widgets: A tool window drawn with the player's theme and widgets. L6763–6926
200
- - markdown: A window that shows a Markdown document. L6927–7120
196
+ - hello: The README Quick start: one menu command and an on-screen message. L5706–5795
197
+ - blur: A tool window with one slider that blurs the playing video. L5796–6057
198
+ - signal-generator: Generates its own video and audio: colour bars and a 1 kHz tone. L6058–6390
199
+ - bookmark: A tool window bound to the playback state: remember the position and jump back to it. L6391–6575
200
+ - panel-menu: A sidebar panel with its own right-click menu. L6576–6781
201
+ - menus: Radio menu items, separator groups and a menu item whose title changes. L6782–6941
202
+ - theme-widgets: A tool window drawn with the player's theme and widgets. L6942–7105
203
+ - markdown: A window that shows a Markdown document. L7106–7299
204
+ - i18n: A plugin in the player's language: English source text, a Chinese translation. L7300–7467
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.7",
3
+ "version": "1.5.9",
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();