@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.
Files changed (39) hide show
  1. package/onmark-release.json +94 -64
  2. package/package.json +4 -4
  3. package/packages/authoring/dist/src/frame-motion.d.ts +10 -2
  4. package/packages/authoring/dist/src/frame-motion.js +29 -6
  5. package/packages/authoring/dist/src/index.d.ts +2 -2
  6. package/packages/authoring/dist/src/motion.d.ts +16 -4
  7. package/packages/authoring/dist/src/presentation.js +160 -6
  8. package/packages/authoring/dist/src/types.d.ts +1 -1
  9. package/packages/bundler/dist/src/authored_html.d.ts +19 -7
  10. package/packages/bundler/dist/src/authored_html.js +109 -21
  11. package/packages/bundler/dist/src/bundle_projection.d.ts +9 -0
  12. package/packages/bundler/dist/src/bundle_projection.js +66 -0
  13. package/packages/bundler/dist/src/command.js +38 -14
  14. package/packages/bundler/dist/src/generated/bundle-manifest.d.ts +4 -5
  15. package/packages/bundler/dist/src/generated/bundle-manifest.js +1 -0
  16. package/packages/bundler/dist/src/generated/bundle-projection-validator.d.ts +7 -0
  17. package/packages/bundler/dist/src/generated/bundle-projection-validator.js +432 -0
  18. package/packages/bundler/dist/src/generated/bundle-projection.d.ts +25 -0
  19. package/packages/bundler/dist/src/generated/bundle-projection.js +2 -0
  20. package/packages/bundler/dist/src/index.d.ts +1 -1
  21. package/packages/bundler/dist/src/presentation.d.ts +14 -7
  22. package/packages/bundler/dist/src/presentation.js +71 -30
  23. package/packages/motion-gsap/dist/src/index.d.ts +10 -2
  24. package/packages/motion-gsap/dist/src/index.js +27 -5
  25. package/packages/runtime/dist/src/generated/browser-request.d.ts +19 -2
  26. package/packages/runtime/dist/src/generated/browser-response.d.ts +46 -1
  27. package/packages/runtime/dist/src/generated/bundle-layout.d.ts +1 -1
  28. package/packages/runtime/dist/src/generated/bundle-layout.js +1 -0
  29. package/packages/runtime/dist/src/generated/runtime-contract.d.ts +4 -0
  30. package/packages/runtime/dist/src/generated/runtime-contract.js +4 -0
  31. package/packages/runtime/dist/src/generated/validators.d.ts +2 -2
  32. package/packages/runtime/dist/src/generated/validators.js +1482 -572
  33. package/packages/runtime/dist/src/index.d.ts +4 -4
  34. package/packages/runtime/dist/src/index.js +1 -1
  35. package/packages/runtime/dist/src/presentation.d.ts +18 -3
  36. package/packages/runtime/dist/src/presentation.js +112 -7
  37. package/packages/runtime/dist/src/session.d.ts +7 -3
  38. package/packages/runtime/dist/src/session.js +77 -20
  39. package/packages/runtime/dist/src/types.d.ts +3 -2
@@ -25,11 +25,10 @@ export type BundleVersion = 1;
25
25
  /**
26
26
  * Proven relationship between browser presentation pixels and primary media.
27
27
  *
28
- * Unknown presentation code requires `BrowserComposite`. A separable overlay
29
- * is an explicit claim that the browser output is a transparent foreground
30
- * independent of the primary video beneath it.
28
+ * Unknown presentation code requires `BrowserComposite`. A separable layer
29
+ * explicitly limits browser ownership to one side of native media.
31
30
  */
32
- export type PresentationVisualCapability = "browserComposite" | "separableOverlay";
31
+ export type PresentationVisualCapability = "browserComposite" | "separableBackdrop" | "separableOverlay";
33
32
  /**
34
33
  * Stable description of one immutable presentation artifact.
35
34
  */
@@ -57,7 +56,7 @@ export interface BundleFile {
57
56
  }
58
57
  export declare const BUNDLE_VERSION: 1;
59
58
  export declare const BUNDLE_TEMPORAL_CAPABILITIES: readonly ["sequential", "randomAccess"];
60
- export declare const BUNDLE_VISUAL_CAPABILITIES: readonly ["browserComposite", "separableOverlay"];
59
+ export declare const BUNDLE_VISUAL_CAPABILITIES: readonly ["browserComposite", "separableBackdrop", "separableOverlay"];
61
60
  export declare const BUNDLE_FRAME_BEHAVIORS: readonly ["perFrame", "placementBounded"];
62
61
  export declare const BUNDLE_ENTRY_POINT: "index.html";
63
62
  export declare const BUNDLE_MANIFEST_FILE: "manifest.json";
@@ -6,6 +6,7 @@ export const BUNDLE_TEMPORAL_CAPABILITIES = Object.freeze([
6
6
  ]);
7
7
  export const BUNDLE_VISUAL_CAPABILITIES = Object.freeze([
8
8
  "browserComposite",
9
+ "separableBackdrop",
9
10
  "separableOverlay",
10
11
  ]);
11
12
  export const BUNDLE_FRAME_BEHAVIORS = Object.freeze([
@@ -0,0 +1,7 @@
1
+ export declare const validateBundleProjection: typeof validate20;
2
+ declare function validate20(data: any, { instancePath, parentData, parentDataProperty, rootData, dynamicAnchors, }?: {
3
+ dynamicAnchors?: {} | undefined;
4
+ instancePath?: string | undefined;
5
+ rootData?: any;
6
+ }): boolean;
7
+ export {};
@@ -0,0 +1,432 @@
1
+ // Generated by `cargo xtask schema`; do not edit.
2
+ "use strict";
3
+ export const validateBundleProjection = validate20;
4
+ const schema31 = {
5
+ $defs: {
6
+ BundleProjectionRegion: {
7
+ additionalProperties: false,
8
+ description: "Dense screenplay-order shots retained by one render region.",
9
+ properties: {
10
+ shotIndices: {
11
+ items: { format: "uint32", minimum: 0, type: "integer" },
12
+ maxItems: 10000,
13
+ minItems: 1,
14
+ type: "array",
15
+ },
16
+ },
17
+ required: ["shotIndices"],
18
+ type: "object",
19
+ },
20
+ BundleProjectionVersion: {
21
+ const: 1,
22
+ description: "Current immutable projection-plan version.",
23
+ format: "uint16",
24
+ maximum: 65535,
25
+ minimum: 0,
26
+ type: "integer",
27
+ },
28
+ },
29
+ $id: "https://onmark.dev/schemas/bundle-projection-v1.schema.json",
30
+ $schema: "https://json-schema.org/draft/2020-12/schema",
31
+ additionalProperties: false,
32
+ description: "Exact shot dependencies for every render region in output order.",
33
+ properties: {
34
+ regions: {
35
+ items: { $ref: "#/$defs/BundleProjectionRegion" },
36
+ maxItems: 10000,
37
+ minItems: 1,
38
+ type: "array",
39
+ },
40
+ version: { $ref: "#/$defs/BundleProjectionVersion" },
41
+ },
42
+ required: ["version", "regions"],
43
+ title: "BundleProjection",
44
+ type: "object",
45
+ };
46
+ const schema32 = {
47
+ additionalProperties: false,
48
+ description: "Dense screenplay-order shots retained by one render region.",
49
+ properties: {
50
+ shotIndices: {
51
+ items: { format: "uint32", minimum: 0, type: "integer" },
52
+ maxItems: 10000,
53
+ minItems: 1,
54
+ type: "array",
55
+ },
56
+ },
57
+ required: ["shotIndices"],
58
+ type: "object",
59
+ };
60
+ const schema33 = {
61
+ const: 1,
62
+ description: "Current immutable projection-plan version.",
63
+ format: "uint16",
64
+ maximum: 65535,
65
+ minimum: 0,
66
+ type: "integer",
67
+ };
68
+ function validate20(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {}, } = {}) {
69
+ /*# sourceURL="https://onmark.dev/schemas/bundle-projection-v1.schema.json" */ let vErrors = null;
70
+ let errors = 0;
71
+ const evaluated0 = validate20.evaluated;
72
+ if (evaluated0.dynamicProps) {
73
+ evaluated0.props = undefined;
74
+ }
75
+ if (evaluated0.dynamicItems) {
76
+ evaluated0.items = undefined;
77
+ }
78
+ if (data && typeof data == "object" && !Array.isArray(data)) {
79
+ if (data.version === undefined) {
80
+ const err0 = {
81
+ instancePath,
82
+ schemaPath: "#/required",
83
+ keyword: "required",
84
+ params: { missingProperty: "version" },
85
+ message: "must have required property '" + "version" + "'",
86
+ };
87
+ if (vErrors === null) {
88
+ vErrors = [err0];
89
+ }
90
+ else {
91
+ vErrors.push(err0);
92
+ }
93
+ errors++;
94
+ }
95
+ if (data.regions === undefined) {
96
+ const err1 = {
97
+ instancePath,
98
+ schemaPath: "#/required",
99
+ keyword: "required",
100
+ params: { missingProperty: "regions" },
101
+ message: "must have required property '" + "regions" + "'",
102
+ };
103
+ if (vErrors === null) {
104
+ vErrors = [err1];
105
+ }
106
+ else {
107
+ vErrors.push(err1);
108
+ }
109
+ errors++;
110
+ }
111
+ for (const key0 in data) {
112
+ if (!(key0 === "regions" || key0 === "version")) {
113
+ const err2 = {
114
+ instancePath,
115
+ schemaPath: "#/additionalProperties",
116
+ keyword: "additionalProperties",
117
+ params: { additionalProperty: key0 },
118
+ message: "must NOT have additional properties",
119
+ };
120
+ if (vErrors === null) {
121
+ vErrors = [err2];
122
+ }
123
+ else {
124
+ vErrors.push(err2);
125
+ }
126
+ errors++;
127
+ }
128
+ }
129
+ if (data.regions !== undefined) {
130
+ let data0 = data.regions;
131
+ if (Array.isArray(data0)) {
132
+ if (data0.length > 10000) {
133
+ const err3 = {
134
+ instancePath: instancePath + "/regions",
135
+ schemaPath: "#/properties/regions/maxItems",
136
+ keyword: "maxItems",
137
+ params: { limit: 10000 },
138
+ message: "must NOT have more than 10000 items",
139
+ };
140
+ if (vErrors === null) {
141
+ vErrors = [err3];
142
+ }
143
+ else {
144
+ vErrors.push(err3);
145
+ }
146
+ errors++;
147
+ }
148
+ if (data0.length < 1) {
149
+ const err4 = {
150
+ instancePath: instancePath + "/regions",
151
+ schemaPath: "#/properties/regions/minItems",
152
+ keyword: "minItems",
153
+ params: { limit: 1 },
154
+ message: "must NOT have fewer than 1 items",
155
+ };
156
+ if (vErrors === null) {
157
+ vErrors = [err4];
158
+ }
159
+ else {
160
+ vErrors.push(err4);
161
+ }
162
+ errors++;
163
+ }
164
+ const len0 = data0.length;
165
+ for (let i0 = 0; i0 < len0; i0++) {
166
+ let data1 = data0[i0];
167
+ if (data1 && typeof data1 == "object" && !Array.isArray(data1)) {
168
+ if (data1.shotIndices === undefined) {
169
+ const err5 = {
170
+ instancePath: instancePath + "/regions/" + i0,
171
+ schemaPath: "#/$defs/BundleProjectionRegion/required",
172
+ keyword: "required",
173
+ params: { missingProperty: "shotIndices" },
174
+ message: "must have required property '" + "shotIndices" + "'",
175
+ };
176
+ if (vErrors === null) {
177
+ vErrors = [err5];
178
+ }
179
+ else {
180
+ vErrors.push(err5);
181
+ }
182
+ errors++;
183
+ }
184
+ for (const key1 in data1) {
185
+ if (!(key1 === "shotIndices")) {
186
+ const err6 = {
187
+ instancePath: instancePath + "/regions/" + i0,
188
+ schemaPath: "#/$defs/BundleProjectionRegion/additionalProperties",
189
+ keyword: "additionalProperties",
190
+ params: { additionalProperty: key1 },
191
+ message: "must NOT have additional properties",
192
+ };
193
+ if (vErrors === null) {
194
+ vErrors = [err6];
195
+ }
196
+ else {
197
+ vErrors.push(err6);
198
+ }
199
+ errors++;
200
+ }
201
+ }
202
+ if (data1.shotIndices !== undefined) {
203
+ let data2 = data1.shotIndices;
204
+ if (Array.isArray(data2)) {
205
+ if (data2.length > 10000) {
206
+ const err7 = {
207
+ instancePath: instancePath + "/regions/" + i0 + "/shotIndices",
208
+ schemaPath: "#/$defs/BundleProjectionRegion/properties/shotIndices/maxItems",
209
+ keyword: "maxItems",
210
+ params: { limit: 10000 },
211
+ message: "must NOT have more than 10000 items",
212
+ };
213
+ if (vErrors === null) {
214
+ vErrors = [err7];
215
+ }
216
+ else {
217
+ vErrors.push(err7);
218
+ }
219
+ errors++;
220
+ }
221
+ if (data2.length < 1) {
222
+ const err8 = {
223
+ instancePath: instancePath + "/regions/" + i0 + "/shotIndices",
224
+ schemaPath: "#/$defs/BundleProjectionRegion/properties/shotIndices/minItems",
225
+ keyword: "minItems",
226
+ params: { limit: 1 },
227
+ message: "must NOT have fewer than 1 items",
228
+ };
229
+ if (vErrors === null) {
230
+ vErrors = [err8];
231
+ }
232
+ else {
233
+ vErrors.push(err8);
234
+ }
235
+ errors++;
236
+ }
237
+ const len1 = data2.length;
238
+ for (let i1 = 0; i1 < len1; i1++) {
239
+ let data3 = data2[i1];
240
+ if (!(typeof data3 == "number" &&
241
+ !(data3 % 1) &&
242
+ !isNaN(data3) &&
243
+ isFinite(data3))) {
244
+ const err9 = {
245
+ instancePath: instancePath + "/regions/" + i0 + "/shotIndices/" + i1,
246
+ schemaPath: "#/$defs/BundleProjectionRegion/properties/shotIndices/items/type",
247
+ keyword: "type",
248
+ params: { type: "integer" },
249
+ message: "must be integer",
250
+ };
251
+ if (vErrors === null) {
252
+ vErrors = [err9];
253
+ }
254
+ else {
255
+ vErrors.push(err9);
256
+ }
257
+ errors++;
258
+ }
259
+ if (typeof data3 == "number" && isFinite(data3)) {
260
+ if (data3 < 0 || isNaN(data3)) {
261
+ const err10 = {
262
+ instancePath: instancePath +
263
+ "/regions/" +
264
+ i0 +
265
+ "/shotIndices/" +
266
+ i1,
267
+ schemaPath: "#/$defs/BundleProjectionRegion/properties/shotIndices/items/minimum",
268
+ keyword: "minimum",
269
+ params: { comparison: ">=", limit: 0 },
270
+ message: "must be >= 0",
271
+ };
272
+ if (vErrors === null) {
273
+ vErrors = [err10];
274
+ }
275
+ else {
276
+ vErrors.push(err10);
277
+ }
278
+ errors++;
279
+ }
280
+ }
281
+ }
282
+ }
283
+ else {
284
+ const err11 = {
285
+ instancePath: instancePath + "/regions/" + i0 + "/shotIndices",
286
+ schemaPath: "#/$defs/BundleProjectionRegion/properties/shotIndices/type",
287
+ keyword: "type",
288
+ params: { type: "array" },
289
+ message: "must be array",
290
+ };
291
+ if (vErrors === null) {
292
+ vErrors = [err11];
293
+ }
294
+ else {
295
+ vErrors.push(err11);
296
+ }
297
+ errors++;
298
+ }
299
+ }
300
+ }
301
+ else {
302
+ const err12 = {
303
+ instancePath: instancePath + "/regions/" + i0,
304
+ schemaPath: "#/$defs/BundleProjectionRegion/type",
305
+ keyword: "type",
306
+ params: { type: "object" },
307
+ message: "must be object",
308
+ };
309
+ if (vErrors === null) {
310
+ vErrors = [err12];
311
+ }
312
+ else {
313
+ vErrors.push(err12);
314
+ }
315
+ errors++;
316
+ }
317
+ }
318
+ }
319
+ else {
320
+ const err13 = {
321
+ instancePath: instancePath + "/regions",
322
+ schemaPath: "#/properties/regions/type",
323
+ keyword: "type",
324
+ params: { type: "array" },
325
+ message: "must be array",
326
+ };
327
+ if (vErrors === null) {
328
+ vErrors = [err13];
329
+ }
330
+ else {
331
+ vErrors.push(err13);
332
+ }
333
+ errors++;
334
+ }
335
+ }
336
+ if (data.version !== undefined) {
337
+ let data4 = data.version;
338
+ if (!(typeof data4 == "number" &&
339
+ !(data4 % 1) &&
340
+ !isNaN(data4) &&
341
+ isFinite(data4))) {
342
+ const err14 = {
343
+ instancePath: instancePath + "/version",
344
+ schemaPath: "#/$defs/BundleProjectionVersion/type",
345
+ keyword: "type",
346
+ params: { type: "integer" },
347
+ message: "must be integer",
348
+ };
349
+ if (vErrors === null) {
350
+ vErrors = [err14];
351
+ }
352
+ else {
353
+ vErrors.push(err14);
354
+ }
355
+ errors++;
356
+ }
357
+ if (1 !== data4) {
358
+ const err15 = {
359
+ instancePath: instancePath + "/version",
360
+ schemaPath: "#/$defs/BundleProjectionVersion/const",
361
+ keyword: "const",
362
+ params: { allowedValue: 1 },
363
+ message: "must be equal to constant",
364
+ };
365
+ if (vErrors === null) {
366
+ vErrors = [err15];
367
+ }
368
+ else {
369
+ vErrors.push(err15);
370
+ }
371
+ errors++;
372
+ }
373
+ if (typeof data4 == "number" && isFinite(data4)) {
374
+ if (data4 > 65535 || isNaN(data4)) {
375
+ const err16 = {
376
+ instancePath: instancePath + "/version",
377
+ schemaPath: "#/$defs/BundleProjectionVersion/maximum",
378
+ keyword: "maximum",
379
+ params: { comparison: "<=", limit: 65535 },
380
+ message: "must be <= 65535",
381
+ };
382
+ if (vErrors === null) {
383
+ vErrors = [err16];
384
+ }
385
+ else {
386
+ vErrors.push(err16);
387
+ }
388
+ errors++;
389
+ }
390
+ if (data4 < 0 || isNaN(data4)) {
391
+ const err17 = {
392
+ instancePath: instancePath + "/version",
393
+ schemaPath: "#/$defs/BundleProjectionVersion/minimum",
394
+ keyword: "minimum",
395
+ params: { comparison: ">=", limit: 0 },
396
+ message: "must be >= 0",
397
+ };
398
+ if (vErrors === null) {
399
+ vErrors = [err17];
400
+ }
401
+ else {
402
+ vErrors.push(err17);
403
+ }
404
+ errors++;
405
+ }
406
+ }
407
+ }
408
+ }
409
+ else {
410
+ const err18 = {
411
+ instancePath,
412
+ schemaPath: "#/type",
413
+ keyword: "type",
414
+ params: { type: "object" },
415
+ message: "must be object",
416
+ };
417
+ if (vErrors === null) {
418
+ vErrors = [err18];
419
+ }
420
+ else {
421
+ vErrors.push(err18);
422
+ }
423
+ errors++;
424
+ }
425
+ validate20.errors = vErrors;
426
+ return errors === 0;
427
+ }
428
+ validate20.evaluated = {
429
+ props: true,
430
+ dynamicProps: false,
431
+ dynamicItems: false,
432
+ };
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Current immutable projection-plan version.
3
+ */
4
+ export type BundleProjectionVersion = 1;
5
+ /**
6
+ * Exact shot dependencies for every render region in output order.
7
+ */
8
+ export interface BundleProjection {
9
+ /**
10
+ * @minItems 1
11
+ * @maxItems 10000
12
+ */
13
+ regions: [BundleProjectionRegion, ...BundleProjectionRegion[]];
14
+ version: BundleProjectionVersion;
15
+ }
16
+ /**
17
+ * Dense screenplay-order shots retained by one render region.
18
+ */
19
+ export interface BundleProjectionRegion {
20
+ /**
21
+ * @minItems 1
22
+ * @maxItems 10000
23
+ */
24
+ shotIndices: [number, ...number[]];
25
+ }
@@ -0,0 +1,2 @@
1
+ // Generated by `cargo xtask schema`; edit Rust protocol types instead.
2
+ export {};
@@ -1,2 +1,2 @@
1
- export { BundleError, bundlePresentation, type BundleArtifact, type BundleErrorKind, type BundleFile, type BundleManifest, type BundleOptions, } from "./presentation.js";
1
+ export { BundleError, bundlePresentation, type BundleArtifact, type BundleErrorKind, type BundleFile, type BundleManifest, type BundleOptions, type BundleProjection, } from "./presentation.js";
2
2
  export { BUNDLE_ASSET_DIRECTORY, BUNDLE_ENTRY_POINT, BUNDLE_MANIFEST_FILE, BUNDLE_REGION_DIRECTORY, BUNDLE_TEMPORAL_CAPABILITIES, BUNDLE_VERSION, } from "./generated/bundle-manifest.js";
@@ -1,5 +1,6 @@
1
- import type { PresentationFrameBehavior, PresentationTemporalCapability, PresentationVisualCapability } from "../../../runtime/dist/src/index.js";
1
+ import type { PresentationFrameBehavior, PresentationVisualCapability } from "../../../runtime/dist/src/index.js";
2
2
  import { type BundleFile as WireBundleFile, type BundleManifest as WireBundleManifest } from "./generated/bundle-manifest.js";
3
+ import type { BundleProjection as WireBundleProjection } from "./generated/bundle-projection.js";
3
4
  type Immutable<T> = T extends object ? {
4
5
  readonly [Key in keyof T]: Immutable<T[Key]>;
5
6
  } : T;
@@ -7,18 +8,24 @@ type Immutable<T> = T extends object ? {
7
8
  export type BundleFile = Immutable<WireBundleFile>;
8
9
  /** Immutable view of the versioned Rust-owned bundle manifest. */
9
10
  export type BundleManifest = Immutable<WireBundleManifest>;
10
- /** Explicit inputs for one authored HTML document. */
11
- export interface BundleOptions {
12
- /** Authored document or a private snapshot containing its exact bytes. */
11
+ /** Immutable view of Rust-owned render-region shot selection. */
12
+ export type BundleProjection = Immutable<WireBundleProjection>;
13
+ interface BundleControls {
13
14
  readonly document: string;
14
- /** Base for inline-module imports when `document` is a private snapshot. */
15
15
  readonly resolveDirectory?: string;
16
16
  readonly outputDirectory: string;
17
17
  readonly maxOutputBytes: number;
18
- readonly temporalCapability: PresentationTemporalCapability;
19
- readonly visualCapability: PresentationVisualCapability;
18
+ readonly visualCapability?: PresentationVisualCapability;
20
19
  readonly frameBehavior: PresentationFrameBehavior;
21
20
  }
21
+ /** Explicit inputs for one authored HTML document. */
22
+ export type BundleOptions = BundleControls & ({
23
+ readonly temporalCapability: "sequential";
24
+ readonly projection?: never;
25
+ } | {
26
+ readonly temporalCapability: "randomAccess";
27
+ readonly projection: BundleProjection;
28
+ });
22
29
  /** Published directory and its owned immutable manifest snapshot. */
23
30
  export interface BundleArtifact {
24
31
  readonly directory: string;