@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.
- package/CHANGELOG.md +39 -0
- package/README.md +4 -1
- package/bin/vestra-plugin.mjs +170 -7
- package/dist/commands.d.ts +7 -4
- package/dist/i18n-tools.d.ts +67 -0
- package/dist/i18n-tools.js +787 -0
- package/dist/i18n.d.ts +222 -0
- package/dist/i18n.js +972 -0
- package/dist/player-runtime.d.ts +2 -0
- package/dist/player-runtime.js +2 -0
- package/dist/plugin/appearance.js +27 -1
- package/dist/plugin/bindings.js +1 -0
- package/dist/plugin/commands.js +24 -4
- package/dist/plugin/index.js +9 -1
- package/dist/plugin/language.d.ts +8 -0
- package/dist/plugin/language.js +79 -0
- package/dist/plugin/osd.d.ts +11 -0
- package/dist/plugin/osd.js +64 -9
- package/dist/plugin/packages.js +10 -0
- package/dist/plugin/runtime.d.ts +3 -1
- package/dist/plugin/runtime.js +6 -0
- package/dist/plugin/scope.d.ts +1 -0
- package/dist/plugin/scope.js +2 -0
- package/dist/plugin/subtitles.js +9 -1
- package/dist/plugin/testing.d.ts +184 -5
- package/dist/plugin/testing.js +459 -67
- package/dist/plugin/timeline.js +3 -1
- package/dist/plugin/types.d.ts +523 -54
- package/dist/plugin/ui.js +29 -10
- package/dist/plugin/values.d.ts +55 -0
- package/dist/plugin/values.js +117 -0
- package/dist/plugin/window.d.ts +2 -0
- package/dist/plugin/window.js +4 -0
- package/dist/source-resolvers.d.ts +0 -1
- package/dist/source-resolvers.js +9 -1
- package/dist/subtitles.d.ts +3 -1
- package/dist/wire.d.ts +38 -6
- package/dist/wire.js +13 -2
- package/llms-full.txt +646 -58
- package/llms.txt +44 -40
- package/package.json +1 -1
- package/slint/vestra/markdown.slint +5 -5
- 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.
|
|
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–
|
|
154
|
-
- [API: @vestra-player/sdk/testing](https://vestrasys.github.io/vestra-player-sdk/modules/_vestra-player_sdk_testing.html) (TestHost, startPlugin):
|
|
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
|
|
161
|
-
- plugin.commands: Commands
|
|
162
|
-
- plugin.windows: Windows
|
|
163
|
-
- plugin.panels: Panels
|
|
164
|
-
- plugin.dialogs: Dialogs
|
|
165
|
-
- plugin.player: Player
|
|
166
|
-
- plugin.video: VideoFilter
|
|
167
|
-
- plugin.audio: AudioFilter
|
|
168
|
-
- plugin.subtitles: Subtitles
|
|
169
|
-
- plugin.media: MediaCapture
|
|
170
|
-
- plugin.resolvers: Resolvers
|
|
171
|
-
- plugin.packages: Packages
|
|
172
|
-
- plugin.osd: Osd
|
|
173
|
-
- plugin.host: Host
|
|
174
|
-
- plugin.clipboard: Clipboard
|
|
175
|
-
- plugin.power: Power
|
|
176
|
-
- plugin.tools: Tools
|
|
177
|
-
- plugin.storage: Storage
|
|
178
|
-
- plugin.system: System
|
|
179
|
-
- plugin.secrets: Secrets
|
|
180
|
-
- plugin.window: MainWindow
|
|
181
|
-
- plugin.app: App
|
|
182
|
-
- plugin.bindings: Bindings
|
|
183
|
-
- plugin.ui: Ui
|
|
184
|
-
- plugin.timeline: Timeline
|
|
185
|
-
- plugin.drops: Drops
|
|
186
|
-
- plugin.appearance: Appearance
|
|
187
|
-
- plugin.
|
|
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.
|
|
194
|
-
- blur: A tool window with one slider that blurs the playing video.
|
|
195
|
-
- signal-generator: Generates its own video and audio: colour bars and a 1 kHz tone.
|
|
196
|
-
- bookmark: A tool window bound to the playback state: remember the position and jump back to it.
|
|
197
|
-
- panel-menu: A sidebar panel with its own right-click menu.
|
|
198
|
-
- menus: Radio menu items, separator groups and a menu item whose title changes.
|
|
199
|
-
- theme-widgets: A tool window drawn with the player's theme and widgets.
|
|
200
|
-
- markdown: A window that shows a Markdown document.
|
|
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
|
@@ -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
|
|
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 == "" ? "[
|
|
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
|
|
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
|
|
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 [
|
|
187
|
-
// confirm button accepts (Shift+Enter starts a new line), Esc or
|
|
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();
|