@vestra-player/sdk 1.7.1 → 1.7.2
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 +10 -0
- package/README.md +6 -9
- package/bin/vestra-plugin.mjs +4 -4
- package/dist/api-requests.d.ts +8 -8
- package/dist/api-requests.js +8 -8
- package/dist/capability-check.d.ts +15 -15
- package/dist/capability-check.js +4 -4
- package/dist/capability-rules.d.ts +4 -5
- package/dist/capability-rules.js +4 -5
- package/dist/commands.d.ts +34 -44
- package/dist/commands.js +21 -27
- package/dist/docs-tree.json.gz +0 -0
- package/dist/docs.d.ts +1 -1
- package/dist/docs.js +13 -3
- package/dist/i18n-tools.js +1 -1
- package/dist/i18n.js +1 -1
- package/dist/media.d.ts +7 -7
- package/dist/palettes.d.ts +5 -5
- package/dist/palettes.js +5 -5
- package/dist/plugin/appearance.js +1 -1
- package/dist/plugin/bindings.d.ts +2 -3
- package/dist/plugin/bindings.js +2 -3
- package/dist/plugin/commands.js +10 -11
- package/dist/plugin/connection.d.ts +18 -19
- package/dist/plugin/connection.js +23 -24
- package/dist/plugin/index.d.ts +5 -5
- package/dist/plugin/index.js +1 -1
- package/dist/plugin/osd.d.ts +1 -1
- package/dist/plugin/osd.js +1 -1
- package/dist/plugin/passes.d.ts +4 -4
- package/dist/plugin/passes.js +4 -4
- package/dist/plugin/patch.d.ts +8 -8
- package/dist/plugin/patch.js +12 -12
- package/dist/plugin/player/events.js +5 -5
- package/dist/plugin/resolvers.js +3 -3
- package/dist/plugin/scope.d.ts +4 -4
- package/dist/plugin/scope.js +4 -4
- package/dist/plugin/services.d.ts +2 -3
- package/dist/plugin/services.js +2 -3
- package/dist/plugin/shaders.js +5 -6
- package/dist/plugin/state.js +10 -10
- package/dist/plugin/testing/commands.d.ts +4 -5
- package/dist/plugin/testing/commands.js +4 -5
- package/dist/plugin/testing/i18n.d.ts +1 -1
- package/dist/plugin/testing/i18n.js +1 -1
- package/dist/plugin/testing/index.d.ts +147 -165
- package/dist/plugin/testing/index.js +137 -155
- package/dist/plugin/testing/internals.d.ts +2 -2
- package/dist/plugin/testing/internals.js +2 -2
- package/dist/plugin/timeline.d.ts +1 -1
- package/dist/plugin/timeline.js +2 -2
- package/dist/plugin/types/base.d.ts +90 -111
- package/dist/plugin/types/commands.d.ts +142 -174
- package/dist/plugin/types/packages.d.ts +48 -63
- package/dist/plugin/types/playback.d.ts +45 -59
- package/dist/plugin/types/plugin-wire.d.ts +38 -45
- package/dist/plugin/types/processing.d.ts +52 -65
- package/dist/plugin/types/services.d.ts +18 -25
- package/dist/plugin/types/snapshots.d.ts +34 -46
- package/dist/plugin/types/sources.d.ts +14 -16
- package/dist/plugin/types/subtitles.d.ts +7 -8
- package/dist/plugin/types/ui-content.d.ts +111 -116
- package/dist/plugin/types/ui-layout.d.ts +52 -63
- package/dist/plugin/types/ui-locale.d.ts +41 -45
- package/dist/plugin/types/ui-shell.d.ts +69 -87
- package/dist/plugin/values.d.ts +15 -18
- package/dist/plugin/values.js +16 -19
- package/dist/plugin/view/base.d.ts +2 -2
- package/dist/plugin/view/base.js +7 -8
- package/dist/plugin/view/layout.d.ts +2 -2
- package/dist/plugin/view/panel.js +2 -4
- package/dist/plugin/view/writer.d.ts +8 -8
- package/dist/plugin/view/writer.js +37 -39
- package/dist/plugin/when.d.ts +3 -3
- package/dist/plugin/wire-facade.js +6 -7
- package/dist/processing.d.ts +26 -30
- package/dist/processing.js +4 -4
- package/dist/source-resolvers.d.ts +2 -2
- package/dist/source.d.ts +1 -2
- package/dist/subtitles.d.ts +1 -1
- package/dist/ts-plugin.d.ts +5 -5
- package/dist/wire.d.ts +63 -70
- package/dist/wire.js +21 -25
- package/llms.txt +7 -10
- package/package.json +1 -1
- package/slint/vestra/bar-buttons.slint +6 -8
- package/slint/vestra/focus.slint +1 -1
- package/slint/vestra/widgets.slint +2 -4
package/dist/palettes.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The colours of the player's palettes, by `Theme` colour token (without the
|
|
3
|
-
* `Theme.` prefix): `vestra`, the dark default, and `vestra-light
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
3
|
+
* `Theme.` prefix): `vestra`, the dark default, and `vestra-light`. The player
|
|
4
|
+
* sets one of them on every view; a plugin reads the colours through `Theme` in
|
|
5
|
+
* its Slint files and never needs these values. They are here for the
|
|
6
|
+
* documentation (Reference: theme) and for tests that check a design against
|
|
7
|
+
* both palettes.
|
|
8
8
|
*
|
|
9
9
|
* Current values: a later player may adjust them, a token keeps its
|
|
10
10
|
* meaning. The `vestra` values are also the defaults of the SDK's copy of
|
|
@@ -55,7 +55,7 @@ class AppearanceService {
|
|
|
55
55
|
this.#runtime.on("appearance.changed", (data) => {
|
|
56
56
|
const event = data;
|
|
57
57
|
const language = preference(event?.language);
|
|
58
|
-
//
|
|
58
|
+
// An event without a language is a theme change.
|
|
59
59
|
const languageChanged = language !== undefined && language !== this.#eventLanguage;
|
|
60
60
|
if (language)
|
|
61
61
|
this.#eventLanguage = language;
|
|
@@ -68,9 +68,8 @@ export declare const BINDING_INPUTS: Readonly<{
|
|
|
68
68
|
/**
|
|
69
69
|
* Mouse inputs on the video area; the side buttons `Mouse:X1` (back) and
|
|
70
70
|
* `Mouse:X2` (forward) anywhere in the main window or the floating sidebar
|
|
71
|
-
* window, except while a menu is open
|
|
72
|
-
*
|
|
73
|
-
* double click.
|
|
71
|
+
* window, except while a menu is open. `:LeftHalf` and `:RightHalf` tell the
|
|
72
|
+
* halves of the video apart for a double click.
|
|
74
73
|
*/
|
|
75
74
|
readonly mouse: readonly ["Mouse:LeftClick", "Mouse:LeftDoubleClick", "Mouse:LeftDoubleClick:LeftHalf", "Mouse:LeftDoubleClick:RightHalf", "Mouse:MiddleClick", "Mouse:X1", "Mouse:X2", "Mouse:WheelUp", "Mouse:WheelDown", "Mouse:WheelLeft", "Mouse:WheelRight"];
|
|
76
75
|
}>;
|
package/dist/plugin/bindings.js
CHANGED
|
@@ -99,9 +99,8 @@ export const BINDING_INPUTS = Object.freeze({
|
|
|
99
99
|
/**
|
|
100
100
|
* Mouse inputs on the video area; the side buttons `Mouse:X1` (back) and
|
|
101
101
|
* `Mouse:X2` (forward) anywhere in the main window or the floating sidebar
|
|
102
|
-
* window, except while a menu is open
|
|
103
|
-
*
|
|
104
|
-
* double click.
|
|
102
|
+
* window, except while a menu is open. `:LeftHalf` and `:RightHalf` tell the
|
|
103
|
+
* halves of the video apart for a double click.
|
|
105
104
|
*/
|
|
106
105
|
mouse: [
|
|
107
106
|
"Mouse:LeftClick",
|
package/dist/plugin/commands.js
CHANGED
|
@@ -9,7 +9,7 @@ import { conditionJson, isCondition } from "./when.js";
|
|
|
9
9
|
const value = (item) => typeof item === "function" ? item() : item;
|
|
10
10
|
/**
|
|
11
11
|
* A state field given as a function: the command is evaluated in the update
|
|
12
|
-
* passes. Constants and `plugin.when` conditions are not
|
|
12
|
+
* passes. Constants and `plugin.when` conditions are not.
|
|
13
13
|
*/
|
|
14
14
|
const tracks = (spec) => Object.values(spec).some((field) => typeof field === "function");
|
|
15
15
|
/** A field's value, or `fallback` (and its condition noted) for a condition. */
|
|
@@ -223,10 +223,10 @@ class CommandHandle {
|
|
|
223
223
|
this.#pump.push(state).catch((error) => this.#scope.report(error));
|
|
224
224
|
}
|
|
225
225
|
/**
|
|
226
|
-
* This command's state alone (
|
|
227
|
-
*
|
|
228
|
-
*
|
|
229
|
-
*
|
|
226
|
+
* This command's state alone (before, a full update pass): a bound command is
|
|
227
|
+
* evaluated in the next pass, a command of constants sends its new state
|
|
228
|
+
* through its own `Latest` in a microtask (several `set()` calls in one turn
|
|
229
|
+
* send one update). A function field binds it.
|
|
230
230
|
*/
|
|
231
231
|
set(state) {
|
|
232
232
|
Object.assign(this.#spec, state);
|
|
@@ -277,11 +277,10 @@ const NONE = Object.freeze([]);
|
|
|
277
277
|
const KEYS = "commands.keys";
|
|
278
278
|
/**
|
|
279
279
|
* One per plugin: the SDK's copy of the key labels of the plugin's own
|
|
280
|
-
* commands
|
|
281
|
-
*
|
|
282
|
-
*
|
|
283
|
-
*
|
|
284
|
-
* an older one than what the copy has is dropped.
|
|
280
|
+
* commands. Started by the first `keys` read or `onKeysChange`: it subscribes
|
|
281
|
+
* to `commands.keys` (a mirror, unless a listener or a binding holds it), then
|
|
282
|
+
* asks once; the player pushes every later change. Answers and events carry the
|
|
283
|
+
* binding table's revision, and an older one than what the copy has is dropped.
|
|
285
284
|
*/
|
|
286
285
|
class KeysService {
|
|
287
286
|
#runtime;
|
|
@@ -303,7 +302,7 @@ class KeysService {
|
|
|
303
302
|
runtime.on(KEYS, (data) => this.#accept(data), "commands", true);
|
|
304
303
|
// Subscribed first: a change after this answer comes as an event.
|
|
305
304
|
runtime.host.commands.keys().then((answer) => this.#accept(answer),
|
|
306
|
-
//
|
|
305
|
+
// `unsupported`: no keys, as without a binding.
|
|
307
306
|
() => { });
|
|
308
307
|
}
|
|
309
308
|
#accept(data) {
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import type { Json, LocalServices, Transport, Wire } from "../wire.ts";
|
|
2
2
|
import type { App, Disposable, Locale, StopReason, SystemInfo } from "./types.ts";
|
|
3
3
|
/**
|
|
4
|
-
* Why something listens, for the player's log line that says why a plugin
|
|
5
|
-
*
|
|
6
|
-
* only when the player is told.
|
|
4
|
+
* Why something listens, for the player's log line that says why a plugin keeps
|
|
5
|
+
* running (`events.subscribe { why }`): computed only when the player is told.
|
|
7
6
|
*/
|
|
8
7
|
export type Why = () => string;
|
|
9
8
|
/**
|
|
10
|
-
* Events the player wakes a stopped plugin for
|
|
11
|
-
*
|
|
12
|
-
*
|
|
9
|
+
* Events the player wakes a stopped plugin for: a listener of one does not keep
|
|
10
|
+
* the plugin running. They follow deliberate changes (an install, a key edit,
|
|
11
|
+
* the palette, a resolver), not playback.
|
|
13
12
|
*/
|
|
14
13
|
export declare const WAKE_EVENTS: readonly string[];
|
|
15
14
|
export interface PluginManifest {
|
|
@@ -88,8 +87,8 @@ export declare class Connection {
|
|
|
88
87
|
readonly locale: Locale;
|
|
89
88
|
/**
|
|
90
89
|
* Protocol additions the player advertises at start-up (`features` in the
|
|
91
|
-
* handshake's app data
|
|
92
|
-
*
|
|
90
|
+
* handshake's app data): `ui.patch` (row patches of property writes). Not
|
|
91
|
+
* part of the plugin API.
|
|
93
92
|
*/
|
|
94
93
|
readonly features: ReadonlySet<string>;
|
|
95
94
|
constructor(transport: Transport, manifest: PluginManifest, directory: string, dataDirectory?: string, app?: unknown, options?: RuntimeOptions);
|
|
@@ -104,13 +103,13 @@ export declare class Connection {
|
|
|
104
103
|
*/
|
|
105
104
|
starting<T>(work: Promise<T>, report: (error: unknown) => void): Promise<T>;
|
|
106
105
|
/**
|
|
107
|
-
* A declaration the player checks on its own (`what`: "command x"),
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
*
|
|
106
|
+
* A declaration the player checks on its own (`what`: "command x"), started
|
|
107
|
+
* like `starting`. In the player's runner a refusal of it during activation
|
|
108
|
+
* (`invalid`, `conflict`, `limit`) does not fail the plugin: it is logged,
|
|
109
|
+
* skipped and reported to the scope once activation completes, so an
|
|
110
|
+
* `onError` added anywhere in `activate` hears it (VS Code logs a bad
|
|
111
|
+
* contribution and activates the extension). Under `strictDeclarations`
|
|
112
|
+
* (TestHost) it fails activation as before.
|
|
114
113
|
*/
|
|
115
114
|
declaring<T>(work: Promise<T>, what: string, report: (error: unknown) => void): Promise<T>;
|
|
116
115
|
activated(): Promise<void>;
|
|
@@ -142,10 +141,10 @@ export declare class Connection {
|
|
|
142
141
|
*/
|
|
143
142
|
listening(): Map<string, string[]>;
|
|
144
143
|
/**
|
|
145
|
-
* One request by its method name, as given (`plugin.wire.request
|
|
146
|
-
*
|
|
147
|
-
*
|
|
148
|
-
*
|
|
144
|
+
* One request by its method name, as given (`plugin.wire.request`): nothing
|
|
145
|
+
* added, nothing checked here, the player checks the capability. Every other
|
|
146
|
+
* part of the SDK uses the typed clients (`host`); `scripts/check-layers.mjs`
|
|
147
|
+
* keeps it so.
|
|
149
148
|
*/
|
|
150
149
|
request<T>(method: string, params?: Json): Promise<T>;
|
|
151
150
|
/** Raw transport events the host pushes without a subscription. */
|
|
@@ -14,9 +14,9 @@ import { fileURLToPath } from "node:url";
|
|
|
14
14
|
/** The SDK's own files (`src/` or `dist/`): left out of a call site. */
|
|
15
15
|
const SDK_DIRECTORY = fileURLToPath(new URL("..", import.meta.url));
|
|
16
16
|
/**
|
|
17
|
-
* Events the player wakes a stopped plugin for
|
|
18
|
-
*
|
|
19
|
-
*
|
|
17
|
+
* Events the player wakes a stopped plugin for: a listener of one does not keep
|
|
18
|
+
* the plugin running. They follow deliberate changes (an install, a key edit,
|
|
19
|
+
* the palette, a resolver), not playback.
|
|
20
20
|
*/
|
|
21
21
|
export const WAKE_EVENTS = [
|
|
22
22
|
"packages.changed",
|
|
@@ -29,9 +29,9 @@ export const WAKE_EVENTS = [
|
|
|
29
29
|
"resolvers.fileTypes",
|
|
30
30
|
];
|
|
31
31
|
/**
|
|
32
|
-
* The player's answers to a declaration that refuse that one declaration
|
|
33
|
-
*
|
|
34
|
-
*
|
|
32
|
+
* The player's answers to a declaration that refuse that one declaration (a
|
|
33
|
+
* command's path, texts or count): during activation they skip it instead of
|
|
34
|
+
* failing the plugin (`Connection.declaring`).
|
|
35
35
|
*/
|
|
36
36
|
const DECLARATION_REFUSALS = new Set([
|
|
37
37
|
"invalid",
|
|
@@ -112,8 +112,8 @@ export class Connection {
|
|
|
112
112
|
locale;
|
|
113
113
|
/**
|
|
114
114
|
* Protocol additions the player advertises at start-up (`features` in the
|
|
115
|
-
* handshake's app data
|
|
116
|
-
*
|
|
115
|
+
* handshake's app data): `ui.patch` (row patches of property writes). Not
|
|
116
|
+
* part of the plugin API.
|
|
117
117
|
*/
|
|
118
118
|
features;
|
|
119
119
|
constructor(transport, manifest, directory, dataDirectory, app, options = {}) {
|
|
@@ -178,13 +178,13 @@ export class Connection {
|
|
|
178
178
|
return work;
|
|
179
179
|
}
|
|
180
180
|
/**
|
|
181
|
-
* A declaration the player checks on its own (`what`: "command x"),
|
|
182
|
-
*
|
|
183
|
-
*
|
|
184
|
-
*
|
|
185
|
-
*
|
|
186
|
-
*
|
|
187
|
-
*
|
|
181
|
+
* A declaration the player checks on its own (`what`: "command x"), started
|
|
182
|
+
* like `starting`. In the player's runner a refusal of it during activation
|
|
183
|
+
* (`invalid`, `conflict`, `limit`) does not fail the plugin: it is logged,
|
|
184
|
+
* skipped and reported to the scope once activation completes, so an
|
|
185
|
+
* `onError` added anywhere in `activate` hears it (VS Code logs a bad
|
|
186
|
+
* contribution and activates the extension). Under `strictDeclarations`
|
|
187
|
+
* (TestHost) it fails activation as before.
|
|
188
188
|
*/
|
|
189
189
|
declaring(work, what, report) {
|
|
190
190
|
if (!this.#activating || this.#strict)
|
|
@@ -341,11 +341,10 @@ export class Connection {
|
|
|
341
341
|
};
|
|
342
342
|
}
|
|
343
343
|
/**
|
|
344
|
-
* A development warning, once per plugin, no behaviour change
|
|
345
|
-
*
|
|
346
|
-
*
|
|
347
|
-
*
|
|
348
|
-
* only after its own calls.
|
|
344
|
+
* A development warning, once per plugin, no behaviour change: the plugin
|
|
345
|
+
* follows `event` (an `onChange`, a `bind` that reads the state) without the
|
|
346
|
+
* `events` capability, so changes made elsewhere (the user, the player,
|
|
347
|
+
* another plugin) never reach it; the state moves only after its own calls.
|
|
349
348
|
*/
|
|
350
349
|
#warnUnheard(event) {
|
|
351
350
|
if (this.#warnedEvents)
|
|
@@ -389,10 +388,10 @@ export class Connection {
|
|
|
389
388
|
return result;
|
|
390
389
|
}
|
|
391
390
|
/**
|
|
392
|
-
* One request by its method name, as given (`plugin.wire.request
|
|
393
|
-
*
|
|
394
|
-
*
|
|
395
|
-
*
|
|
391
|
+
* One request by its method name, as given (`plugin.wire.request`): nothing
|
|
392
|
+
* added, nothing checked here, the player checks the capability. Every other
|
|
393
|
+
* part of the SDK uses the typed clients (`host`); `scripts/check-layers.mjs`
|
|
394
|
+
* keeps it so.
|
|
396
395
|
*/
|
|
397
396
|
request(method, params) {
|
|
398
397
|
return this.#transport.request(method, params);
|
package/dist/plugin/index.d.ts
CHANGED
|
@@ -21,11 +21,11 @@ export interface PluginInstance {
|
|
|
21
21
|
activated(): Promise<void>;
|
|
22
22
|
/**
|
|
23
23
|
* Stop the plugin: dispose the root scope, then stop the runtime.
|
|
24
|
-
* `info.reason`
|
|
25
|
-
* `
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
24
|
+
* `info.reason` is why: the runner passes `runtime.stop`'s `data.reason`, or
|
|
25
|
+
* `"host-lost"` when its input closed without a `runtime.stop`. It reaches
|
|
26
|
+
* `plugin.stopReason` and every `onDispose` cleanup; a reason the SDK does
|
|
27
|
+
* not know reads as `undefined`. A second call runs no cleanup again and
|
|
28
|
+
* keeps the first reason.
|
|
29
29
|
*/
|
|
30
30
|
dispose(info?: {
|
|
31
31
|
reason?: unknown;
|
package/dist/plugin/index.js
CHANGED
|
@@ -31,7 +31,7 @@ options) {
|
|
|
31
31
|
// Failures the plugin did not ask about: a property the player could not
|
|
32
32
|
// show when it rebuilt a panel or the Options window (an image removed
|
|
33
33
|
// since), a callback whose arguments it could not convert, a detached
|
|
34
|
-
// sidebar that could not be prepared.
|
|
34
|
+
// sidebar that could not be prepared. A warning may come without a code.
|
|
35
35
|
root.add(runtime.raw("ui.error", (data) => {
|
|
36
36
|
const { code, message } = (data ?? {});
|
|
37
37
|
root.report(failure(code ?? "ui", message ?? "user interface error"));
|
package/dist/plugin/osd.d.ts
CHANGED
|
@@ -46,7 +46,7 @@ export declare const OSD_LIMITS: Readonly<{
|
|
|
46
46
|
readonly minColumns: 8;
|
|
47
47
|
/** The largest `OsdPanelOptions.maxColumns` (1000). */
|
|
48
48
|
readonly maxColumns: 1000;
|
|
49
|
-
/** Action buttons of one `osd.show` message (`OsdShowOptions.actions
|
|
49
|
+
/** Action buttons of one `osd.show` message (`OsdShowOptions.actions`) (2). */
|
|
50
50
|
readonly actions: 2;
|
|
51
51
|
/** Characters of an action's title, as shown (40; at least 1 that is not white space). */
|
|
52
52
|
readonly actionChars: 40;
|
package/dist/plugin/osd.js
CHANGED
|
@@ -47,7 +47,7 @@ export const OSD_LIMITS = Object.freeze({
|
|
|
47
47
|
minColumns: 8,
|
|
48
48
|
/** The largest `OsdPanelOptions.maxColumns` (1000). */
|
|
49
49
|
maxColumns: 1000,
|
|
50
|
-
/** Action buttons of one `osd.show` message (`OsdShowOptions.actions
|
|
50
|
+
/** Action buttons of one `osd.show` message (`OsdShowOptions.actions`) (2). */
|
|
51
51
|
actions: 2,
|
|
52
52
|
/** Characters of an action's title, as shown (40; at least 1 that is not white space). */
|
|
53
53
|
actionChars: 40,
|
package/dist/plugin/passes.d.ts
CHANGED
|
@@ -77,10 +77,10 @@ export declare class Passes {
|
|
|
77
77
|
readonly counts: PassCounts;
|
|
78
78
|
constructor(connection: Connection);
|
|
79
79
|
/**
|
|
80
|
-
* Register a binding: `evaluate` runs in a full pass now and in every
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
80
|
+
* Register a binding: `evaluate` runs in a full pass now and in every pass
|
|
81
|
+
* that concerns it. Only what calls this takes part in the passes: a view on
|
|
82
|
+
* its first `bind()`, a command with a function field, a sequence provider
|
|
83
|
+
* (before, every view and command).
|
|
84
84
|
*/
|
|
85
85
|
bind(evaluate: () => void, slot?: number): BindingHandle;
|
|
86
86
|
/**
|
package/dist/plugin/passes.js
CHANGED
|
@@ -116,10 +116,10 @@ export class Passes {
|
|
|
116
116
|
this.#connection = connection;
|
|
117
117
|
}
|
|
118
118
|
/**
|
|
119
|
-
* Register a binding: `evaluate` runs in a full pass now and in every
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
*
|
|
119
|
+
* Register a binding: `evaluate` runs in a full pass now and in every pass
|
|
120
|
+
* that concerns it. Only what calls this takes part in the passes: a view on
|
|
121
|
+
* its first `bind()`, a command with a function field, a sequence provider
|
|
122
|
+
* (before, every view and command).
|
|
123
123
|
*/
|
|
124
124
|
bind(evaluate, slot = this.slot()) {
|
|
125
125
|
const held = new Map();
|
package/dist/plugin/patch.d.ts
CHANGED
|
@@ -3,9 +3,9 @@ export declare const PATCH_FEATURE = "ui.patch";
|
|
|
3
3
|
/** The most operations one patch carries (the player's `MAX_PATCH_OPS`). */
|
|
4
4
|
export declare const PATCH_OPS = 1024;
|
|
5
5
|
/**
|
|
6
|
-
* The most operations one diff plans
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* The most operations one diff plans: its patch is sent as several of at most
|
|
7
|
+
* {@link PATCH_OPS} each (`chunkOps`); more is sent whole (in parts, which the
|
|
8
|
+
* player writes at once).
|
|
9
9
|
*/
|
|
10
10
|
export declare const DIFF_OPS: number;
|
|
11
11
|
/**
|
|
@@ -107,11 +107,11 @@ export declare function applyOps<T>(rows: T[], ops: readonly ({
|
|
|
107
107
|
to: number;
|
|
108
108
|
})[]): T[];
|
|
109
109
|
/**
|
|
110
|
-
* The bytes of rows one write carries at most
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
* patches
|
|
114
|
-
*
|
|
110
|
+
* The bytes of rows one write carries at most: half the 1 MiB protocol line,
|
|
111
|
+
* which leaves room for the request around them. A larger whole write is sent
|
|
112
|
+
* as its first rows and `insert` patches of the rest; a larger patch as several
|
|
113
|
+
* patches, each applying on the one before (the player's
|
|
114
|
+
* doc/architecture/large-lists.md §4).
|
|
115
115
|
*/
|
|
116
116
|
export declare const CHUNK_BYTES: number;
|
|
117
117
|
/** The bytes a row adds to a write (its JSON and a separator). */
|
package/dist/plugin/patch.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Row patches of array properties (
|
|
3
|
-
*
|
|
4
|
-
* `
|
|
5
|
-
*
|
|
2
|
+
* Row patches of array properties (feature `ui.patch`): the diff between the
|
|
3
|
+
* rows last sent and the rows bound now, as `set`, `insert`, `remove` and
|
|
4
|
+
* `move` operations by index. Internal; plugins see none of it (the player's
|
|
5
|
+
* doc/architecture/large-lists.md §2).
|
|
6
6
|
*/
|
|
7
7
|
import { UI_VALUE_LIMITS } from "./values.js";
|
|
8
8
|
/** The player feature that takes row patches. */
|
|
@@ -10,9 +10,9 @@ export const PATCH_FEATURE = "ui.patch";
|
|
|
10
10
|
/** The most operations one patch carries (the player's `MAX_PATCH_OPS`). */
|
|
11
11
|
export const PATCH_OPS = 1024;
|
|
12
12
|
/**
|
|
13
|
-
* The most operations one diff plans
|
|
14
|
-
*
|
|
15
|
-
*
|
|
13
|
+
* The most operations one diff plans: its patch is sent as several of at most
|
|
14
|
+
* {@link PATCH_OPS} each (`chunkOps`); more is sent whole (in parts, which the
|
|
15
|
+
* player writes at once).
|
|
16
16
|
*/
|
|
17
17
|
export const DIFF_OPS = 16 * PATCH_OPS;
|
|
18
18
|
/**
|
|
@@ -346,11 +346,11 @@ export function applyOps(rows, ops) {
|
|
|
346
346
|
return out;
|
|
347
347
|
}
|
|
348
348
|
/**
|
|
349
|
-
* The bytes of rows one write carries at most
|
|
350
|
-
*
|
|
351
|
-
*
|
|
352
|
-
* patches
|
|
353
|
-
*
|
|
349
|
+
* The bytes of rows one write carries at most: half the 1 MiB protocol line,
|
|
350
|
+
* which leaves room for the request around them. A larger whole write is sent
|
|
351
|
+
* as its first rows and `insert` patches of the rest; a larger patch as several
|
|
352
|
+
* patches, each applying on the one before (the player's
|
|
353
|
+
* doc/architecture/large-lists.md §4).
|
|
354
354
|
*/
|
|
355
355
|
export const CHUNK_BYTES = 512 * 1024;
|
|
356
356
|
/** About what an operation adds to a request besides its rows. */
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `plugin.player.on` (L1, refactor plan §2.2
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
2
|
+
* `plugin.player.on` (L1, refactor plan §2.2): one listener of one player
|
|
3
|
+
* event, with the event's data as the player sent it. It is a plain
|
|
4
|
+
* subscription of the connection (counted as a listener, its `why` naming where
|
|
5
|
+
* the plugin added it), never a state copy: nothing is kept, nothing is
|
|
6
|
+
* compared.
|
|
7
7
|
*/
|
|
8
8
|
import { failure } from "../errors.js";
|
|
9
9
|
/**
|
package/dist/plugin/resolvers.js
CHANGED
|
@@ -8,9 +8,9 @@ import { windowOf } from "./window.js";
|
|
|
8
8
|
const isFiles = (options) => "extensions" in options;
|
|
9
9
|
const sameTypes = (a, b) => a.length === b.length && a.every((type, i) => type === b[i]);
|
|
10
10
|
/**
|
|
11
|
-
* One per plugin: the list comes with the `window.state` read before
|
|
12
|
-
*
|
|
13
|
-
*
|
|
11
|
+
* One per plugin: the list comes with the `window.state` read before activation
|
|
12
|
+
* and is read again when the plugin first uses it; with `events`,
|
|
13
|
+
* `resolvers.fileTypes` keeps it current.
|
|
14
14
|
*/
|
|
15
15
|
class FileTypesService {
|
|
16
16
|
#runtime;
|
package/dist/plugin/scope.d.ts
CHANGED
|
@@ -66,10 +66,10 @@ export declare class ScopeImpl implements Plugin {
|
|
|
66
66
|
*/
|
|
67
67
|
runOn(change: Change, handler: (...args: never[]) => unknown, ...args: unknown[]): void;
|
|
68
68
|
/**
|
|
69
|
-
* Run a listener that pushes its own values (`player.on`,
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
69
|
+
* Run a listener that pushes its own values (`player.on`) like `run`, except
|
|
70
|
+
* that no full pass follows it: what it writes to `plugin.state` runs the
|
|
71
|
+
* passes for its readers, and for anything else the plugin calls `update()`.
|
|
72
|
+
* Its reads are not counted as a binding's.
|
|
73
73
|
*/
|
|
74
74
|
runQuiet(handler: (...args: never[]) => unknown, ...args: unknown[]): void;
|
|
75
75
|
update(): void;
|
package/dist/plugin/scope.js
CHANGED
|
@@ -184,10 +184,10 @@ export class ScopeImpl {
|
|
|
184
184
|
this.update();
|
|
185
185
|
}
|
|
186
186
|
/**
|
|
187
|
-
* Run a listener that pushes its own values (`player.on`,
|
|
188
|
-
*
|
|
189
|
-
*
|
|
190
|
-
*
|
|
187
|
+
* Run a listener that pushes its own values (`player.on`) like `run`, except
|
|
188
|
+
* that no full pass follows it: what it writes to `plugin.state` runs the
|
|
189
|
+
* passes for its readers, and for anything else the plugin calls `update()`.
|
|
190
|
+
* Its reads are not counted as a binding's.
|
|
191
191
|
*/
|
|
192
192
|
runQuiet(handler, ...args) {
|
|
193
193
|
if (this.disposed)
|
|
@@ -114,8 +114,7 @@ export declare const SECRET_LIMITS: Readonly<{
|
|
|
114
114
|
export declare const secrets: (scope: ScopeImpl) => Secrets;
|
|
115
115
|
export declare const rendering: (scope: ScopeImpl) => Rendering;
|
|
116
116
|
/**
|
|
117
|
-
* `plugin.video.upscaling
|
|
118
|
-
*
|
|
119
|
-
* call starts it).
|
|
117
|
+
* `plugin.video.upscaling`: both requests need `video.upscaling`; the player
|
|
118
|
+
* answers once its GPU check ran (the first call starts it).
|
|
120
119
|
*/
|
|
121
120
|
export declare const videoUpscaling: (scope: ScopeImpl) => VideoUpscaling;
|
package/dist/plugin/services.js
CHANGED
|
@@ -498,9 +498,8 @@ export const rendering = (scope) => {
|
|
|
498
498
|
};
|
|
499
499
|
};
|
|
500
500
|
/**
|
|
501
|
-
* `plugin.video.upscaling
|
|
502
|
-
*
|
|
503
|
-
* call starts it).
|
|
501
|
+
* `plugin.video.upscaling`: both requests need `video.upscaling`; the player
|
|
502
|
+
* answers once its GPU check ran (the first call starts it).
|
|
504
503
|
*/
|
|
505
504
|
export const videoUpscaling = (scope) => {
|
|
506
505
|
const declared = () => {
|
package/dist/plugin/shaders.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The shader channel `plugin.video.shaders(id)
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* media), or a failure.
|
|
2
|
+
* The shader channel `plugin.video.shaders(id)`: this plugin's own mpv user
|
|
3
|
+
* shaders, joined by the player with every other plugin's in a stable order.
|
|
4
|
+
* Unlike `video.render()` any number of plugins hold one at a time; each handle
|
|
5
|
+
* sends its whole list (last write wins) and the player answers `applied`,
|
|
6
|
+
* `waiting` (no ready media), or a failure.
|
|
8
7
|
*/
|
|
9
8
|
import { isAbsolute } from "node:path";
|
|
10
9
|
import { Latest } from "./latest.js";
|
package/dist/plugin/state.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `plugin.state(initial)` (L2, the framework; refactor plan §3.5
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* `
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
2
|
+
* `plugin.state(initial)` (L2, the framework; refactor plan §3.5): plugin-owned
|
|
3
|
+
* state the update passes follow like the SDK's own state copies. A read of a
|
|
4
|
+
* field inside what a pass evaluates records `(store, field)` through
|
|
5
|
+
* `Runtime.depends`, the mechanism `plugin.player.state` uses; a write of a
|
|
6
|
+
* field that changes it (`Object.is`) reports
|
|
7
|
+
* `Runtime.changed(store, [field])`, so the next pass is a precise one that
|
|
8
|
+
* evaluates only that field's readers. One level: the value of a field is
|
|
9
|
+
* compared by identity, nothing inside it is tracked. It belongs to the calling
|
|
10
|
+
* scope: once that scope is disposed the object is a plain one, read and
|
|
11
|
+
* written without tracking.
|
|
12
12
|
*/
|
|
13
13
|
import { failure } from "./errors.js";
|
|
14
14
|
/** Each store's key in the passes' field tracking (`state:1`, `state:2`…). */
|
|
@@ -8,11 +8,10 @@ export declare function bindingClaims(host: TestHost, inner: Internals): Map<str
|
|
|
8
8
|
/** `host/<id>` for core commands, `<manifest id>/<id>` for the plugin's. */
|
|
9
9
|
export declare function bindingKey(host: TestHost, _inner: Internals, id: string): string;
|
|
10
10
|
/**
|
|
11
|
-
* `commands.keys` as the player answers it: each of the plugin's own
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* `systemInfo.os`.
|
|
11
|
+
* `commands.keys` as the player answers it: each of the plugin's own commands,
|
|
12
|
+
* and the player's core commands as `host/<id>`, with the labels of the keys it
|
|
13
|
+
* holds now (the overlay, else its defaults; not a key an earlier command
|
|
14
|
+
* holds), as menus write them on `systemInfo.os`.
|
|
16
15
|
*/
|
|
17
16
|
export declare function commandKeys(host: TestHost, inner: Internals): {
|
|
18
17
|
keys: Record<string, string[]>;
|
|
@@ -42,11 +42,10 @@ export function bindingKey(host, _inner, id) {
|
|
|
42
42
|
return host.coreCommands.has(id) ? id : `${host.manifestId}/${id}`;
|
|
43
43
|
}
|
|
44
44
|
/**
|
|
45
|
-
* `commands.keys` as the player answers it: each of the plugin's own
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* `systemInfo.os`.
|
|
45
|
+
* `commands.keys` as the player answers it: each of the plugin's own commands,
|
|
46
|
+
* and the player's core commands as `host/<id>`, with the labels of the keys it
|
|
47
|
+
* holds now (the overlay, else its defaults; not a key an earlier command
|
|
48
|
+
* holds), as menus write them on `systemInfo.os`.
|
|
50
49
|
*/
|
|
51
50
|
export function commandKeys(host, inner) {
|
|
52
51
|
const claims = bindingClaims(host, inner);
|
|
@@ -2,7 +2,7 @@ import type { TemplateArgs, TextValue } from "../types.ts";
|
|
|
2
2
|
import type { TextJson } from "../../i18n.ts";
|
|
3
3
|
import type { TestHost } from "./index.ts";
|
|
4
4
|
import type { Handler, Internals } from "./internals.ts";
|
|
5
|
-
/** Texts only the test host uses, with their Chinese
|
|
5
|
+
/** Texts only the test host uses, with their Chinese. */
|
|
6
6
|
export declare const TEST_ZH_HANS: Readonly<Record<string, string>>;
|
|
7
7
|
/**
|
|
8
8
|
* A text of a request as the player shows it, refused as the player
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import { HostError } from "../../wire.js";
|
|
10
10
|
import { THEMES } from "../appearance.js";
|
|
11
11
|
import { format as formatTemplate, HOST_GROUPS, HOST_ZH_HANS, LOCALES, isTextValue, menuKeys, renderTemplateArgs, renderText, resolveTexts, textKey, textProblem, } from "../../i18n.js";
|
|
12
|
-
/** Texts only the test host uses, with their Chinese
|
|
12
|
+
/** Texts only the test host uses, with their Chinese. */
|
|
13
13
|
export const TEST_ZH_HANS = {
|
|
14
14
|
"this site": "这个网站",
|
|
15
15
|
"External SRT": "外部 SRT",
|