@vestra-player/sdk 1.5.9 → 1.5.12
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 +35 -0
- package/README.md +1 -1
- package/bin/vestra-plugin.mjs +4 -2
- package/dist/commands.d.ts +7 -4
- package/dist/i18n-tools.js +120 -12
- package/dist/i18n.d.ts +92 -0
- package/dist/i18n.js +299 -0
- package/dist/player-runtime.d.ts +2 -1
- package/dist/player-runtime.js +2 -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 +6 -2
- package/dist/plugin/language.js +74 -0
- package/dist/plugin/osd.d.ts +10 -2
- package/dist/plugin/osd.js +35 -16
- package/dist/plugin/subtitles.js +9 -1
- package/dist/plugin/testing.d.ts +69 -11
- package/dist/plugin/testing.js +234 -58
- package/dist/plugin/timeline.js +3 -1
- package/dist/plugin/types.d.ts +338 -43
- package/dist/plugin/ui.js +26 -10
- package/dist/plugin/values.d.ts +55 -0
- package/dist/plugin/values.js +117 -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 +17 -9
- package/dist/wire.js +2 -1
- package/llms-full.txt +298 -49
- package/llms.txt +42 -42
- package/package.json +1 -1
- package/slint/vestra/widgets.slint +6 -2
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.12: 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
|
|
|
@@ -121,7 +121,7 @@ test("shows the position", async () => {
|
|
|
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
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
|
|
124
|
+
- `vestra-plugin i18n check [dir...]`: Translation coverage and untranslatable text; fails on stale catalogs.
|
|
125
125
|
- `vestra-player --plugin <dir>` runs a plugin from source, no build needed.
|
|
126
126
|
|
|
127
127
|
**Error codes** (`error.code`; branch on it, never on `message`)
|
|
@@ -137,7 +137,7 @@ test("shows the position", async () => {
|
|
|
137
137
|
- `failed`: The operation ran and failed
|
|
138
138
|
- `aborted`: An `AbortSignal` fired
|
|
139
139
|
- `timeout`: A time limit ran out
|
|
140
|
-
- `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
|
|
141
141
|
- `reserved`: Packages.validate, PackageCandidate.install: the id is `vestra` or starts with `vestra.`, which only the player's built-in plugins use
|
|
142
142
|
- `versionMismatch`: The package needs a newer player or another `apiVersion`
|
|
143
143
|
- `ui-prepare`: The player could not prepare a mounted panel or a settings page
|
|
@@ -152,56 +152,56 @@ test("shows the position", async () => {
|
|
|
152
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
|
|
153
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
|
|
154
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
|
|
155
|
-
- [API: @vestra-player/sdk](https://vestrasys.github.io/vestra-player-sdk/modules/_vestra-player_sdk.html): L932–
|
|
156
|
-
- [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–5538
|
|
157
157
|
|
|
158
158
|
## API
|
|
159
159
|
|
|
160
160
|
Where each module of `plugin` is declared:
|
|
161
161
|
|
|
162
162
|
- Plugin L1153, Scope L1022, PluginError L974, Disposable L947
|
|
163
|
-
- plugin.commands: Commands
|
|
164
|
-
- plugin.windows: Windows
|
|
165
|
-
- plugin.panels: Panels
|
|
166
|
-
- plugin.dialogs: Dialogs
|
|
167
|
-
- plugin.player: Player
|
|
168
|
-
- plugin.video: VideoFilter
|
|
169
|
-
- plugin.audio: AudioFilter
|
|
170
|
-
- plugin.subtitles: Subtitles
|
|
171
|
-
- plugin.media: MediaCapture
|
|
172
|
-
- plugin.resolvers: Resolvers
|
|
173
|
-
- plugin.packages: Packages
|
|
174
|
-
- plugin.osd: Osd
|
|
175
|
-
- plugin.host: Host
|
|
176
|
-
- plugin.clipboard: Clipboard
|
|
177
|
-
- plugin.power: Power
|
|
178
|
-
- plugin.tools: Tools
|
|
179
|
-
- plugin.storage: Storage
|
|
180
|
-
- plugin.system: System
|
|
181
|
-
- plugin.secrets: Secrets
|
|
182
|
-
- plugin.window: MainWindow
|
|
183
|
-
- plugin.app: App
|
|
184
|
-
- plugin.bindings: Bindings
|
|
185
|
-
- plugin.ui: Ui
|
|
186
|
-
- plugin.timeline: Timeline
|
|
187
|
-
- plugin.drops: Drops
|
|
188
|
-
- plugin.appearance: Appearance
|
|
189
|
-
- plugin.i18n: I18n
|
|
190
|
-
- plugin.settings: Settings
|
|
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
|
|
191
191
|
|
|
192
192
|
## Examples
|
|
193
193
|
|
|
194
194
|
Complete plugins with tests, in [examples/](https://github.com/vestrasys/vestra-player-sdk/tree/main/examples) and in llms-full.txt:
|
|
195
195
|
|
|
196
|
-
- hello: The README Quick start: one menu command and an on-screen message.
|
|
197
|
-
- blur: A tool window with one slider that blurs the playing video.
|
|
198
|
-
- signal-generator: Generates its own video and audio: colour bars and a 1 kHz tone.
|
|
199
|
-
- bookmark: A tool window bound to the playback state: remember the position and jump back to it.
|
|
200
|
-
- panel-menu: A sidebar panel with its own right-click menu.
|
|
201
|
-
- menus: Radio menu items, separator groups and a menu item whose title changes.
|
|
202
|
-
- theme-widgets: A tool window drawn with the player's theme and widgets.
|
|
203
|
-
- markdown: A window that shows a Markdown document.
|
|
204
|
-
- i18n: A plugin in the player's language: English source text, a Chinese translation.
|
|
196
|
+
- hello: The README Quick start: one menu command and an on-screen message. L5955–6044
|
|
197
|
+
- blur: A tool window with one slider that blurs the playing video. L6045–6306
|
|
198
|
+
- signal-generator: Generates its own video and audio: colour bars and a 1 kHz tone. L6307–6639
|
|
199
|
+
- bookmark: A tool window bound to the playback state: remember the position and jump back to it. L6640–6824
|
|
200
|
+
- panel-menu: A sidebar panel with its own right-click menu. L6825–7030
|
|
201
|
+
- menus: Radio menu items, separator groups and a menu item whose title changes. L7031–7190
|
|
202
|
+
- theme-widgets: A tool window drawn with the player's theme and widgets. L7191–7354
|
|
203
|
+
- markdown: A window that shows a Markdown document. L7355–7548
|
|
204
|
+
- i18n: A plugin in the player's language: English source text, a Chinese translation. L7549–7716
|
|
205
205
|
|
|
206
206
|
## Optional
|
|
207
207
|
|
package/package.json
CHANGED
|
@@ -81,13 +81,17 @@ export component Button {
|
|
|
81
81
|
min-height: root.icon-only ? root.icon-height : root.small ? Theme.button-small-height : Theme.button-height;
|
|
82
82
|
min-width: root.icon-only ? root.icon-width : root.small ? Theme.button-small-min-width : Theme.button-min-width;
|
|
83
83
|
preferred-height: self.min-height;
|
|
84
|
+
// A longer (translated) label widens the button instead of overflowing it.
|
|
85
|
+
preferred-width: root.icon-only ? self.min-width
|
|
86
|
+
: max(self.min-width, label.preferred-width + 2 * Theme.button-padding);
|
|
84
87
|
accessible-role: button;
|
|
85
88
|
accessible-label: root.text;
|
|
86
89
|
accessible-enabled: root.enabled;
|
|
87
90
|
accessible-checkable: root.icon-only;
|
|
88
91
|
accessible-checked: root.checked;
|
|
89
92
|
accessible-action-default => { if root.enabled { root.clicked(); } }
|
|
90
|
-
|
|
93
|
+
Rectangle {
|
|
94
|
+
visible: !root.icon-only;
|
|
91
95
|
border-radius: Theme.radius-control;
|
|
92
96
|
background: !root.enabled ? Theme.button-disabled
|
|
93
97
|
: touch.pressed ? Theme.button-press
|
|
@@ -96,7 +100,7 @@ export component Button {
|
|
|
96
100
|
padding-left: Theme.button-padding;
|
|
97
101
|
padding-right: Theme.button-padding;
|
|
98
102
|
alignment: center;
|
|
99
|
-
Text {
|
|
103
|
+
label := Text {
|
|
100
104
|
text: root.text;
|
|
101
105
|
color: root.enabled ? Theme.text-list : Theme.text-dim;
|
|
102
106
|
font-size: Theme.font-body;
|