@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/CHANGELOG.md +22 -0
- package/README.md +4 -1
- package/bin/vestra-plugin.mjs +194 -17
- package/dist/commands.d.ts +1 -2
- package/dist/commands.js +1 -2
- package/dist/i18n-tools.d.ts +67 -0
- package/dist/i18n-tools.js +731 -0
- package/dist/i18n.d.ts +130 -0
- package/dist/i18n.js +673 -0
- package/dist/player-runtime.d.ts +1 -0
- package/dist/player-runtime.js +1 -0
- package/dist/plugin/appearance.js +27 -1
- package/dist/plugin/language.d.ts +4 -0
- package/dist/plugin/language.js +5 -0
- package/dist/plugin/osd.d.ts +3 -0
- package/dist/plugin/osd.js +45 -9
- package/dist/plugin/packages.js +11 -65
- package/dist/plugin/resolvers.js +64 -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/testing.d.ts +155 -4
- package/dist/plugin/testing.js +332 -50
- package/dist/plugin/types.d.ts +247 -46
- package/dist/plugin/ui.js +4 -1
- package/dist/plugin/window.d.ts +4 -0
- package/dist/plugin/window.js +8 -0
- package/dist/wire.d.ts +29 -14
- package/dist/wire.js +12 -12
- package/llms-full.txt +399 -52
- 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.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.
|
|
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–
|
|
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–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
|
|
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 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.
|
|
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. 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
|
@@ -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();
|