@onmark/cli 0.3.0 → 0.5.0
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/onmark-release.json +94 -64
- package/package.json +4 -4
- package/packages/authoring/dist/src/frame-motion.d.ts +10 -2
- package/packages/authoring/dist/src/frame-motion.js +29 -6
- package/packages/authoring/dist/src/index.d.ts +2 -2
- package/packages/authoring/dist/src/motion.d.ts +16 -4
- package/packages/authoring/dist/src/presentation.js +160 -6
- package/packages/authoring/dist/src/types.d.ts +1 -1
- package/packages/bundler/dist/src/authored_html.d.ts +19 -7
- package/packages/bundler/dist/src/authored_html.js +109 -21
- package/packages/bundler/dist/src/bundle_projection.d.ts +9 -0
- package/packages/bundler/dist/src/bundle_projection.js +66 -0
- package/packages/bundler/dist/src/command.js +38 -14
- package/packages/bundler/dist/src/generated/bundle-manifest.d.ts +4 -5
- package/packages/bundler/dist/src/generated/bundle-manifest.js +1 -0
- package/packages/bundler/dist/src/generated/bundle-projection-validator.d.ts +7 -0
- package/packages/bundler/dist/src/generated/bundle-projection-validator.js +432 -0
- package/packages/bundler/dist/src/generated/bundle-projection.d.ts +25 -0
- package/packages/bundler/dist/src/generated/bundle-projection.js +2 -0
- package/packages/bundler/dist/src/index.d.ts +1 -1
- package/packages/bundler/dist/src/presentation.d.ts +14 -7
- package/packages/bundler/dist/src/presentation.js +71 -30
- package/packages/motion-gsap/dist/src/index.d.ts +10 -2
- package/packages/motion-gsap/dist/src/index.js +27 -5
- package/packages/runtime/dist/src/generated/browser-request.d.ts +19 -2
- package/packages/runtime/dist/src/generated/browser-response.d.ts +46 -1
- package/packages/runtime/dist/src/generated/bundle-layout.d.ts +1 -1
- package/packages/runtime/dist/src/generated/bundle-layout.js +1 -0
- package/packages/runtime/dist/src/generated/runtime-contract.d.ts +4 -0
- package/packages/runtime/dist/src/generated/runtime-contract.js +4 -0
- package/packages/runtime/dist/src/generated/validators.d.ts +2 -2
- package/packages/runtime/dist/src/generated/validators.js +1482 -572
- package/packages/runtime/dist/src/index.d.ts +4 -4
- package/packages/runtime/dist/src/index.js +1 -1
- package/packages/runtime/dist/src/presentation.d.ts +18 -3
- package/packages/runtime/dist/src/presentation.js +112 -7
- package/packages/runtime/dist/src/session.d.ts +7 -3
- package/packages/runtime/dist/src/session.js +77 -20
- package/packages/runtime/dist/src/types.d.ts +3 -2
|
@@ -6,7 +6,8 @@ import { createRequire } from "node:module";
|
|
|
6
6
|
import { dirname, extname, isAbsolute, join, relative, resolve, sep, } from "node:path";
|
|
7
7
|
import { build, } from "esbuild";
|
|
8
8
|
import { BUNDLE_ENTRY_POINT, BUNDLE_FRAME_BEHAVIORS, BUNDLE_MANIFEST_FILE, BUNDLE_REGION_DIRECTORY, BUNDLE_TEMPORAL_CAPABILITIES, BUNDLE_VISUAL_CAPABILITIES, BUNDLE_VERSION, } from "./generated/bundle-manifest.js";
|
|
9
|
-
import { AuthoredHtmlError,
|
|
9
|
+
import { AuthoredHtmlError, projectRegionDocument, readAuthoredHtml, } from "./authored_html.js";
|
|
10
|
+
import { BundleProjectionError, decodeBundleProjection, } from "./bundle_projection.js";
|
|
10
11
|
import { HtmlImageError, HtmlImageLimitError, projectedImageResources, } from "./html_image.js";
|
|
11
12
|
import { hasAmbientImageAnimation } from "./image_admission.js";
|
|
12
13
|
// Authored files live outside the package tree, so public facades resolve from
|
|
@@ -46,10 +47,10 @@ export class BundleError extends Error {
|
|
|
46
47
|
// ── Build pipeline
|
|
47
48
|
/** Builds one HTML-authored presentation without a parallel entry file. */
|
|
48
49
|
export async function bundlePresentation(options) {
|
|
49
|
-
const
|
|
50
|
+
const controls = snapshotControls(options);
|
|
50
51
|
let html;
|
|
51
52
|
try {
|
|
52
|
-
html = await readAuthoredHtml(options.document, maxOutputBytes, options.resolveDirectory);
|
|
53
|
+
html = await readAuthoredHtml(options.document, controls.maxOutputBytes, options.resolveDirectory);
|
|
53
54
|
}
|
|
54
55
|
catch (error) {
|
|
55
56
|
if (error instanceof HtmlImageLimitError) {
|
|
@@ -60,17 +61,13 @@ export async function bundlePresentation(options) {
|
|
|
60
61
|
}
|
|
61
62
|
throw error;
|
|
62
63
|
}
|
|
63
|
-
return bundle({
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
visualCapability: options.visualCapability,
|
|
69
|
-
frameBehavior: options.frameBehavior,
|
|
70
|
-
});
|
|
64
|
+
return bundle(Object.freeze({
|
|
65
|
+
...controls,
|
|
66
|
+
html: Object.freeze({ ...html }),
|
|
67
|
+
visualCapability: resolveVisualCapability(controls.visualCapability, html.visualCapability),
|
|
68
|
+
}));
|
|
71
69
|
}
|
|
72
|
-
async function bundle(
|
|
73
|
-
const input = validateInput(options);
|
|
70
|
+
async function bundle(input) {
|
|
74
71
|
await requireAbsent(input.outputDirectory);
|
|
75
72
|
await mkdir(dirname(input.outputDirectory), { recursive: true });
|
|
76
73
|
const staging = await mkdtemp(join(dirname(input.outputDirectory), ".onmark-bundle-"));
|
|
@@ -105,7 +102,7 @@ async function buildArtifact(input, staging) {
|
|
|
105
102
|
}))),
|
|
106
103
|
});
|
|
107
104
|
}
|
|
108
|
-
function
|
|
105
|
+
function snapshotControls(options) {
|
|
109
106
|
if (options.outputDirectory.length === 0) {
|
|
110
107
|
throw new BundleError("configuration", "output directory cannot be empty");
|
|
111
108
|
}
|
|
@@ -114,26 +111,62 @@ function validateInput(options) {
|
|
|
114
111
|
throw new BundleError("configuration", "maximum output bytes must be a positive safe integer");
|
|
115
112
|
}
|
|
116
113
|
const temporalCapability = validateTemporalCapability(options.temporalCapability);
|
|
117
|
-
const visualCapability =
|
|
114
|
+
const visualCapability = options.visualCapability === undefined
|
|
115
|
+
? undefined
|
|
116
|
+
: validateVisualCapability(options.visualCapability);
|
|
118
117
|
const frameBehavior = validateFrameBehavior(options.frameBehavior);
|
|
119
118
|
if (frameBehavior === "placementBounded" &&
|
|
120
119
|
temporalCapability !== "randomAccess") {
|
|
121
120
|
throw new BundleError("configuration", "placement-bounded frames require random-access presentation timing");
|
|
122
121
|
}
|
|
123
|
-
|
|
122
|
+
const input = {
|
|
124
123
|
outputDirectory: resolve(options.outputDirectory),
|
|
125
124
|
maxOutputBytes: options.maxOutputBytes,
|
|
126
|
-
html: Object.freeze({ ...options.html }),
|
|
127
|
-
temporalCapability,
|
|
128
125
|
visualCapability,
|
|
129
126
|
frameBehavior,
|
|
130
|
-
}
|
|
127
|
+
};
|
|
128
|
+
return temporalCapability === "randomAccess"
|
|
129
|
+
? Object.freeze({
|
|
130
|
+
...input,
|
|
131
|
+
projection: snapshotProjection(requireProjection(options.projection)),
|
|
132
|
+
temporalCapability,
|
|
133
|
+
})
|
|
134
|
+
: Object.freeze({ ...input, temporalCapability });
|
|
131
135
|
}
|
|
132
|
-
function
|
|
133
|
-
if (
|
|
134
|
-
throw new BundleError("configuration", "
|
|
136
|
+
function requireProjection(projection) {
|
|
137
|
+
if (projection === undefined) {
|
|
138
|
+
throw new BundleError("configuration", "random-access presentation requires a bundle projection");
|
|
135
139
|
}
|
|
136
|
-
return
|
|
140
|
+
return projection;
|
|
141
|
+
}
|
|
142
|
+
function snapshotProjection(projection) {
|
|
143
|
+
try {
|
|
144
|
+
projection = decodeBundleProjection(projection);
|
|
145
|
+
}
|
|
146
|
+
catch (error) {
|
|
147
|
+
if (error instanceof BundleProjectionError) {
|
|
148
|
+
throw new BundleError("configuration", error.message, error);
|
|
149
|
+
}
|
|
150
|
+
throw error;
|
|
151
|
+
}
|
|
152
|
+
const [first, ...rest] = projection.regions;
|
|
153
|
+
const regions = [
|
|
154
|
+
snapshotProjectionRegion(first),
|
|
155
|
+
...rest.map(snapshotProjectionRegion),
|
|
156
|
+
];
|
|
157
|
+
return Object.freeze({
|
|
158
|
+
version: projection.version,
|
|
159
|
+
regions: Object.freeze(regions),
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
function snapshotProjectionRegion(region) {
|
|
163
|
+
return Object.freeze({
|
|
164
|
+
shotIndices: snapshotShotIndices(region.shotIndices),
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
function snapshotShotIndices(indices) {
|
|
168
|
+
const [first, ...rest] = indices;
|
|
169
|
+
return Object.freeze([first, ...rest]);
|
|
137
170
|
}
|
|
138
171
|
function validateTemporalCapability(capability) {
|
|
139
172
|
const admitted = BUNDLE_TEMPORAL_CAPABILITIES.find((candidate) => candidate === capability);
|
|
@@ -147,7 +180,15 @@ function validateVisualCapability(capability) {
|
|
|
147
180
|
if (admitted !== undefined) {
|
|
148
181
|
return admitted;
|
|
149
182
|
}
|
|
150
|
-
throw new BundleError("configuration", "visual capability must be browserComposite or separableOverlay");
|
|
183
|
+
throw new BundleError("configuration", "visual capability must be browserComposite, separableBackdrop, or separableOverlay");
|
|
184
|
+
}
|
|
185
|
+
function resolveVisualCapability(configured, authored) {
|
|
186
|
+
if (configured !== undefined &&
|
|
187
|
+
authored !== undefined &&
|
|
188
|
+
configured !== authored) {
|
|
189
|
+
throw new BundleError("configuration", "configured and authored visual capabilities disagree");
|
|
190
|
+
}
|
|
191
|
+
return configured ?? authored ?? "browserComposite";
|
|
151
192
|
}
|
|
152
193
|
function validateFrameBehavior(behavior) {
|
|
153
194
|
const admitted = BUNDLE_FRAME_BEHAVIORS.find((candidate) => candidate === behavior);
|
|
@@ -373,11 +414,11 @@ async function writeRegionArtifacts(staging, input, generated, resources, initia
|
|
|
373
414
|
if (input.temporalCapability !== "randomAccess") {
|
|
374
415
|
return [];
|
|
375
416
|
}
|
|
376
|
-
validateRegionCount(input.
|
|
417
|
+
validateRegionCount(input.projection.regions.length, generated.length + resources.length);
|
|
377
418
|
let remaining = initialBudget;
|
|
378
419
|
const regions = [];
|
|
379
|
-
for (const [index, region] of input.
|
|
380
|
-
const document =
|
|
420
|
+
for (const [index, region] of input.projection.regions.entries()) {
|
|
421
|
+
const document = projectRegionDocument(input.html, region.shotIndices);
|
|
381
422
|
const files = presentationFiles([
|
|
382
423
|
...generated,
|
|
383
424
|
...authoredResourceFiles(projectedImageResources(document.document, resources)),
|
|
@@ -386,7 +427,7 @@ async function writeRegionArtifacts(staging, input, generated, resources, initia
|
|
|
386
427
|
const manifestBytes = encodeManifest(manifest);
|
|
387
428
|
const entry = files.find((file) => file.path === BUNDLE_ENTRY_POINT);
|
|
388
429
|
if (entry === undefined) {
|
|
389
|
-
throw new BundleError("build", "
|
|
430
|
+
throw new BundleError("build", "render-region bundle has no entry point");
|
|
390
431
|
}
|
|
391
432
|
remaining = consumeOutputBudget(remaining, entry.contents.byteLength);
|
|
392
433
|
remaining = consumeOutputBudget(remaining, manifestBytes.byteLength);
|
|
@@ -411,11 +452,11 @@ async function writeRegionFiles(staging, directory, files) {
|
|
|
411
452
|
}
|
|
412
453
|
function validateRegionCount(regions, generated) {
|
|
413
454
|
if (regions > MAX_REGION_ARTIFACTS) {
|
|
414
|
-
throw new BundleError("outputLimit", "presentation exceeds the
|
|
455
|
+
throw new BundleError("outputLimit", "presentation exceeds the render-region bundle limit");
|
|
415
456
|
}
|
|
416
457
|
const links = regions * generated;
|
|
417
458
|
if (!Number.isSafeInteger(links) || links > MAX_REGION_LINKS) {
|
|
418
|
-
throw new BundleError("outputLimit", "presentation exceeds the
|
|
459
|
+
throw new BundleError("outputLimit", "presentation exceeds the render-region bundle file limit");
|
|
419
460
|
}
|
|
420
461
|
}
|
|
421
462
|
async function requireAbsent(outputDirectory) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { gsap } from "gsap";
|
|
2
|
-
import type { PresentationExtension,
|
|
2
|
+
import type { PresentationExtension, PresentationElementTargetKind } from "../../../authoring/dist/src/index.js";
|
|
3
3
|
/** Local GSAP authoring facts for one semantic screenplay element. */
|
|
4
4
|
export interface GsapMotionContext {
|
|
5
5
|
readonly durationSeconds: number;
|
|
@@ -8,9 +8,17 @@ export interface GsapMotionContext {
|
|
|
8
8
|
}
|
|
9
9
|
/** Adds local animation to one Onmark-owned paused timeline. */
|
|
10
10
|
export type GsapMotionHandler = (context: GsapMotionContext) => void;
|
|
11
|
+
/** Local GSAP transition facts with both adjacent shot elements. */
|
|
12
|
+
export interface GsapTransitionContext extends GsapMotionContext {
|
|
13
|
+
readonly incomingElement: HTMLElement;
|
|
14
|
+
readonly outgoingElement: HTMLElement;
|
|
15
|
+
}
|
|
16
|
+
/** Adds local animation across one compiler-owned shot overlap. */
|
|
17
|
+
export type GsapTransitionHandler = (context: GsapTransitionContext) => void;
|
|
11
18
|
/** Semantic handlers and optional selector handlers for local motion. */
|
|
12
|
-
export type GsapMotionDefinition = Readonly<Partial<Record<
|
|
19
|
+
export type GsapMotionDefinition = Readonly<Partial<Record<PresentationElementTargetKind, GsapMotionHandler>> & {
|
|
13
20
|
readonly selectors?: Readonly<Record<string, GsapMotionHandler>>;
|
|
21
|
+
readonly transition?: GsapTransitionHandler;
|
|
14
22
|
}>;
|
|
15
23
|
/** Creates exact-frame GSAP effects without exposing runtime lifecycle code. */
|
|
16
24
|
export declare function gsapMotion(definition: GsapMotionDefinition): PresentationExtension;
|
|
@@ -19,7 +19,7 @@ function bindGsapEffects(rules, context) {
|
|
|
19
19
|
try {
|
|
20
20
|
for (const target of context.targets) {
|
|
21
21
|
const handlers = matchingHandlers(rules, target);
|
|
22
|
-
if (handlers.length === 0) {
|
|
22
|
+
if (handlers.elements.length === 0 && handlers.transition === undefined) {
|
|
23
23
|
continue;
|
|
24
24
|
}
|
|
25
25
|
effects.push(bindGsapEffect(handlers, target, context));
|
|
@@ -43,7 +43,10 @@ function bindGsapEffect(handlers, target, context) {
|
|
|
43
43
|
element: target.element,
|
|
44
44
|
timeline,
|
|
45
45
|
});
|
|
46
|
-
|
|
46
|
+
if (target.kind === "transition" && handlers.transition !== undefined) {
|
|
47
|
+
handlers.transition(transitionContext(motion, target));
|
|
48
|
+
}
|
|
49
|
+
for (const handler of handlers.elements) {
|
|
47
50
|
handler(motion);
|
|
48
51
|
}
|
|
49
52
|
requireLocalTimeline(timeline, durationSeconds, target.kind);
|
|
@@ -88,7 +91,11 @@ function ownRules(definition) {
|
|
|
88
91
|
caption: definition.caption,
|
|
89
92
|
});
|
|
90
93
|
const selectors = Object.freeze(Object.entries(definition.selectors ?? {}).map(ownSelector));
|
|
91
|
-
return Object.freeze({
|
|
94
|
+
return Object.freeze({
|
|
95
|
+
kinds,
|
|
96
|
+
selectors,
|
|
97
|
+
transition: definition.transition,
|
|
98
|
+
});
|
|
92
99
|
}
|
|
93
100
|
function ownSelector([selector, animate]) {
|
|
94
101
|
if (selector.trim().length === 0) {
|
|
@@ -98,7 +105,7 @@ function ownSelector([selector, animate]) {
|
|
|
98
105
|
}
|
|
99
106
|
function matchingHandlers(rules, target) {
|
|
100
107
|
const handlers = [];
|
|
101
|
-
const kind = rules.kinds[target.kind];
|
|
108
|
+
const kind = target.kind === "transition" ? undefined : rules.kinds[target.kind];
|
|
102
109
|
if (kind !== undefined) {
|
|
103
110
|
handlers.push(kind);
|
|
104
111
|
}
|
|
@@ -107,7 +114,10 @@ function matchingHandlers(rules, target) {
|
|
|
107
114
|
handlers.push(rule.animate);
|
|
108
115
|
}
|
|
109
116
|
}
|
|
110
|
-
return
|
|
117
|
+
return Object.freeze({
|
|
118
|
+
elements: Object.freeze(handlers),
|
|
119
|
+
transition: target.kind === "transition" ? rules.transition : undefined,
|
|
120
|
+
});
|
|
111
121
|
}
|
|
112
122
|
// ── Exact-frame playheads ──
|
|
113
123
|
function intervalSeconds(target, context) {
|
|
@@ -117,8 +127,20 @@ function intervalSeconds(target, context) {
|
|
|
117
127
|
function localSeconds(frame, target, context) {
|
|
118
128
|
const durationFrames = target.interval.end - target.interval.start;
|
|
119
129
|
const localFrame = Math.max(0, Math.min(frame.index - target.interval.start, durationFrames));
|
|
130
|
+
if (target.kind === "transition") {
|
|
131
|
+
const finalFrame = durationFrames - 1;
|
|
132
|
+
const progress = finalFrame === 0 ? 1 : localFrame / finalFrame;
|
|
133
|
+
return intervalSeconds(target, context) * progress;
|
|
134
|
+
}
|
|
120
135
|
return ((localFrame / context.frameRate.numerator) * context.frameRate.denominator);
|
|
121
136
|
}
|
|
137
|
+
function transitionContext(context, target) {
|
|
138
|
+
return Object.freeze({
|
|
139
|
+
...context,
|
|
140
|
+
incomingElement: target.incomingElement,
|
|
141
|
+
outgoingElement: target.outgoingElement,
|
|
142
|
+
});
|
|
143
|
+
}
|
|
122
144
|
function requireLocalTimeline(timeline, durationSeconds, label) {
|
|
123
145
|
if (timeline.duration() <= durationSeconds) {
|
|
124
146
|
return;
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
* Closed commands understood by the browser runtime.
|
|
3
3
|
*/
|
|
4
4
|
export type BrowserCommand = {
|
|
5
|
+
/**
|
|
6
|
+
* Browser responsibility for primary-media elements.
|
|
7
|
+
*/
|
|
8
|
+
mediaMode: "decoded" | "omitted" | "layoutOnly";
|
|
5
9
|
plan: BrowserPlan;
|
|
6
10
|
type: "load";
|
|
7
11
|
} | {
|
|
@@ -66,7 +70,7 @@ export type RequestId = number;
|
|
|
66
70
|
/**
|
|
67
71
|
* Version of the native-to-browser message contract.
|
|
68
72
|
*/
|
|
69
|
-
export type ProtocolVersion =
|
|
73
|
+
export type ProtocolVersion = 5;
|
|
70
74
|
/**
|
|
71
75
|
* One versioned command sent from the native executor to the browser.
|
|
72
76
|
*/
|
|
@@ -96,7 +100,11 @@ export interface BrowserPlan {
|
|
|
96
100
|
*/
|
|
97
101
|
shots: BrowserShot[];
|
|
98
102
|
timeline: WireInterval;
|
|
99
|
-
timelineVersion:
|
|
103
|
+
timelineVersion: 3;
|
|
104
|
+
/**
|
|
105
|
+
* @maxItems 10000
|
|
106
|
+
*/
|
|
107
|
+
transitions: BrowserTransition[];
|
|
100
108
|
/**
|
|
101
109
|
* @maxItems 10000
|
|
102
110
|
*/
|
|
@@ -148,6 +156,15 @@ export interface BrowserShot {
|
|
|
148
156
|
node: BrowserNode;
|
|
149
157
|
sceneId: BrowserNodeId;
|
|
150
158
|
}
|
|
159
|
+
/**
|
|
160
|
+
* One solved transition between two adjacent browser shots.
|
|
161
|
+
*/
|
|
162
|
+
export interface BrowserTransition {
|
|
163
|
+
incomingShotId: BrowserNodeId;
|
|
164
|
+
interval: WireInterval;
|
|
165
|
+
node: BrowserNode;
|
|
166
|
+
outgoingShotId: BrowserNodeId;
|
|
167
|
+
}
|
|
151
168
|
/**
|
|
152
169
|
* One primary video placement consumed by the browser presentation adapter.
|
|
153
170
|
*/
|
|
@@ -8,6 +8,7 @@ export type BrowserEvent = {
|
|
|
8
8
|
* Frame at which preparation completed.
|
|
9
9
|
*/
|
|
10
10
|
evaluationStart: number;
|
|
11
|
+
mediaLayout: BrowserMediaLayout;
|
|
11
12
|
type: "prepared";
|
|
12
13
|
} | {
|
|
13
14
|
/**
|
|
@@ -40,6 +41,25 @@ export type BrowserEvent = {
|
|
|
40
41
|
} | {
|
|
41
42
|
type: "disposed";
|
|
42
43
|
};
|
|
44
|
+
/**
|
|
45
|
+
* Browser identity for one Timeline element or imported caption.
|
|
46
|
+
*
|
|
47
|
+
* IDs form dense renderable-semantic preorder within one Browser Plan.
|
|
48
|
+
*
|
|
49
|
+
* Authored IDs, rather than this unit-local key, retain cross-projection
|
|
50
|
+
* semantic identity.
|
|
51
|
+
*/
|
|
52
|
+
export type BrowserNodeId = number;
|
|
53
|
+
/**
|
|
54
|
+
* Closed CSS object-fit subset admitted by native media.
|
|
55
|
+
*/
|
|
56
|
+
export type BrowserObjectFit = "fill" | "contain" | "cover";
|
|
57
|
+
/**
|
|
58
|
+
* Exact static media layout observed by the browser.
|
|
59
|
+
*
|
|
60
|
+
* @maxItems 16
|
|
61
|
+
*/
|
|
62
|
+
export type BrowserMediaLayout = BrowserMediaPlacement[];
|
|
43
63
|
/**
|
|
44
64
|
* Correlation identity shared by one request and its response events.
|
|
45
65
|
*/
|
|
@@ -47,7 +67,7 @@ export type RequestId = number;
|
|
|
47
67
|
/**
|
|
48
68
|
* Version of the native-to-browser message contract.
|
|
49
69
|
*/
|
|
50
|
-
export type ProtocolVersion =
|
|
70
|
+
export type ProtocolVersion = 5;
|
|
51
71
|
/**
|
|
52
72
|
* One versioned event returned by the browser runtime.
|
|
53
73
|
*/
|
|
@@ -56,3 +76,28 @@ export interface BrowserResponse {
|
|
|
56
76
|
requestId: RequestId;
|
|
57
77
|
version: ProtocolVersion;
|
|
58
78
|
}
|
|
79
|
+
/**
|
|
80
|
+
* One video element's static, axis-aligned browser layout.
|
|
81
|
+
*/
|
|
82
|
+
export interface BrowserMediaPlacement {
|
|
83
|
+
nodeId: BrowserNodeId;
|
|
84
|
+
objectFit: BrowserObjectFit;
|
|
85
|
+
objectPosition: BrowserObjectPosition;
|
|
86
|
+
rectangle: BrowserPixelRectangle;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Fixed-point CSS object-position, where one million represents 100%.
|
|
90
|
+
*/
|
|
91
|
+
export interface BrowserObjectPosition {
|
|
92
|
+
x: number;
|
|
93
|
+
y: number;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Positive pixel rectangle relative to the output viewport.
|
|
97
|
+
*/
|
|
98
|
+
export interface BrowserPixelRectangle {
|
|
99
|
+
height: number;
|
|
100
|
+
width: number;
|
|
101
|
+
x: number;
|
|
102
|
+
y: number;
|
|
103
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const BUNDLE_ASSET_DIRECTORY: "assets/sha256";
|
|
2
2
|
export declare const PRESENTATION_TEMPORAL_CAPABILITIES: readonly ["sequential", "randomAccess"];
|
|
3
3
|
export type PresentationTemporalCapability = (typeof PRESENTATION_TEMPORAL_CAPABILITIES)[number];
|
|
4
|
-
export declare const PRESENTATION_VISUAL_CAPABILITIES: readonly ["browserComposite", "separableOverlay"];
|
|
4
|
+
export declare const PRESENTATION_VISUAL_CAPABILITIES: readonly ["browserComposite", "separableBackdrop", "separableOverlay"];
|
|
5
5
|
export type PresentationVisualCapability = (typeof PRESENTATION_VISUAL_CAPABILITIES)[number];
|
|
6
6
|
export declare const PRESENTATION_FRAME_BEHAVIORS: readonly ["perFrame", "placementBounded"];
|
|
7
7
|
export type PresentationFrameBehavior = (typeof PRESENTATION_FRAME_BEHAVIORS)[number];
|
|
@@ -6,6 +6,7 @@ export const PRESENTATION_TEMPORAL_CAPABILITIES = Object.freeze([
|
|
|
6
6
|
]);
|
|
7
7
|
export const PRESENTATION_VISUAL_CAPABILITIES = Object.freeze([
|
|
8
8
|
"browserComposite",
|
|
9
|
+
"separableBackdrop",
|
|
9
10
|
"separableOverlay",
|
|
10
11
|
]);
|
|
11
12
|
export const PRESENTATION_FRAME_BEHAVIORS = Object.freeze([
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
export declare const RUNTIME_HOST_NAME: "__ONMARK_RUNTIME__";
|
|
2
|
+
export declare const BROWSER_PROTOCOL_VERSION: 5;
|
|
2
3
|
export declare const MAX_BROWSER_VIDEOS: 10000;
|
|
4
|
+
export declare const MAX_BROWSER_MEDIA_LAYOUTS: 16;
|
|
5
|
+
export declare const BROWSER_OBJECT_POSITION_SCALE: 1000000;
|
|
6
|
+
export declare const MAX_BROWSER_TRANSITIONS: 10000;
|
|
3
7
|
export declare const MAX_BROWSER_OVERLAYS: 10000;
|
|
4
8
|
export declare const MAX_BROWSER_OVERLAY_TEXT_CHARACTERS: 65536;
|
|
5
9
|
export declare const MAX_FAILURE_MESSAGE_CHARACTERS: 4096;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
// Generated by `cargo xtask schema`; edit Rust protocol types instead.
|
|
2
2
|
export const RUNTIME_HOST_NAME = "__ONMARK_RUNTIME__";
|
|
3
|
+
export const BROWSER_PROTOCOL_VERSION = 5;
|
|
3
4
|
export const MAX_BROWSER_VIDEOS = 10000;
|
|
5
|
+
export const MAX_BROWSER_MEDIA_LAYOUTS = 16;
|
|
6
|
+
export const BROWSER_OBJECT_POSITION_SCALE = 1000000;
|
|
7
|
+
export const MAX_BROWSER_TRANSITIONS = 10000;
|
|
4
8
|
export const MAX_BROWSER_OVERLAYS = 10000;
|
|
5
9
|
export const MAX_BROWSER_OVERLAY_TEXT_CHARACTERS = 65536;
|
|
6
10
|
export const MAX_FAILURE_MESSAGE_CHARACTERS = 4096;
|
|
@@ -4,8 +4,8 @@ declare function validate20(data: any, { instancePath, parentData, parentDataPro
|
|
|
4
4
|
instancePath?: string | undefined;
|
|
5
5
|
rootData?: any;
|
|
6
6
|
}): boolean;
|
|
7
|
-
export declare const validateBrowserResponse: typeof
|
|
8
|
-
declare function
|
|
7
|
+
export declare const validateBrowserResponse: typeof validate55;
|
|
8
|
+
declare function validate55(data: any, { instancePath, parentData, parentDataProperty, rootData, dynamicAnchors }?: {
|
|
9
9
|
dynamicAnchors?: {} | undefined;
|
|
10
10
|
instancePath?: string | undefined;
|
|
11
11
|
rootData?: any;
|