@onmark/cli 0.3.0 → 0.4.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 +83 -53
- 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 +34 -1
- package/packages/authoring/dist/src/types.d.ts +1 -1
- package/packages/bundler/dist/src/authored_html.d.ts +17 -7
- package/packages/bundler/dist/src/authored_html.js +79 -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 +28 -8
- 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 +13 -6
- package/packages/bundler/dist/src/presentation.js +58 -28
- 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 +15 -2
- package/packages/runtime/dist/src/generated/browser-response.d.ts +1 -1
- package/packages/runtime/dist/src/generated/runtime-contract.d.ts +2 -0
- package/packages/runtime/dist/src/generated/runtime-contract.js +2 -0
- package/packages/runtime/dist/src/generated/validators.d.ts +2 -2
- package/packages/runtime/dist/src/generated/validators.js +331 -128
- package/packages/runtime/dist/src/index.d.ts +2 -2
- package/packages/runtime/dist/src/index.js +1 -1
- package/packages/runtime/dist/src/presentation.d.ts +10 -0
- package/packages/runtime/dist/src/presentation.js +18 -3
- package/packages/runtime/dist/src/session.js +61 -12
- package/packages/runtime/dist/src/types.d.ts +1 -1
package/onmark-release.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"packageName": "@onmark/cli",
|
|
4
|
-
"version": "0.
|
|
5
|
-
"sourceRevision": "
|
|
4
|
+
"version": "0.4.0",
|
|
5
|
+
"sourceRevision": "2e7e548ab5e309264477239e8c7ca1f4c15cc462",
|
|
6
6
|
"files": [
|
|
7
7
|
{
|
|
8
8
|
"path": "LICENSE",
|
|
@@ -17,22 +17,22 @@
|
|
|
17
17
|
{
|
|
18
18
|
"path": "package.json",
|
|
19
19
|
"bytes": 1406,
|
|
20
|
-
"sha256": "
|
|
20
|
+
"sha256": "0b8c9e832be7f92fdf4a635aba18306806fc63a723f0f8cc320a9d33ba2c7bc8"
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
23
|
"path": "packages/authoring/dist/src/frame-motion.d.ts",
|
|
24
|
-
"bytes":
|
|
25
|
-
"sha256": "
|
|
24
|
+
"bytes": 1476,
|
|
25
|
+
"sha256": "fade0e486ba8fc3013b29ee5ee1467b5f464b3dcd2c28e5d7a06387131ca4427"
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
28
|
"path": "packages/authoring/dist/src/frame-motion.js",
|
|
29
|
-
"bytes":
|
|
30
|
-
"sha256": "
|
|
29
|
+
"bytes": 3603,
|
|
30
|
+
"sha256": "9d227cdaf4880ac434ca1666f2e5bfa88f81f20402c68f0efd3e335ceffe341e"
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
33
|
"path": "packages/authoring/dist/src/index.d.ts",
|
|
34
|
-
"bytes":
|
|
35
|
-
"sha256": "
|
|
34
|
+
"bytes": 948,
|
|
35
|
+
"sha256": "f399c899ff4550dd103f21655bf150deaa516ad20b8e08795ccf2cd9a3500b88"
|
|
36
36
|
},
|
|
37
37
|
{
|
|
38
38
|
"path": "packages/authoring/dist/src/index.js",
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
},
|
|
52
52
|
{
|
|
53
53
|
"path": "packages/authoring/dist/src/motion.d.ts",
|
|
54
|
-
"bytes":
|
|
55
|
-
"sha256": "
|
|
54
|
+
"bytes": 2034,
|
|
55
|
+
"sha256": "f6696a6b9174dead62622fb3f0333106c77b2487e893abb3531fdbb0d5768341"
|
|
56
56
|
},
|
|
57
57
|
{
|
|
58
58
|
"path": "packages/authoring/dist/src/motion.js",
|
|
@@ -66,8 +66,8 @@
|
|
|
66
66
|
},
|
|
67
67
|
{
|
|
68
68
|
"path": "packages/authoring/dist/src/presentation.js",
|
|
69
|
-
"bytes":
|
|
70
|
-
"sha256": "
|
|
69
|
+
"bytes": 10584,
|
|
70
|
+
"sha256": "4d4ec19ded892ea0372ad76c18cb6e2175b172300164d030f4c26fdc1bfde7bb"
|
|
71
71
|
},
|
|
72
72
|
{
|
|
73
73
|
"path": "packages/authoring/dist/src/resource.d.ts",
|
|
@@ -91,8 +91,8 @@
|
|
|
91
91
|
},
|
|
92
92
|
{
|
|
93
93
|
"path": "packages/authoring/dist/src/types.d.ts",
|
|
94
|
-
"bytes":
|
|
95
|
-
"sha256": "
|
|
94
|
+
"bytes": 221,
|
|
95
|
+
"sha256": "913524b928d11c2c9af64d2f4f4d7fc5df3b3e20f0015e0389bde7f76625e93a"
|
|
96
96
|
},
|
|
97
97
|
{
|
|
98
98
|
"path": "packages/authoring/dist/src/types.js",
|
|
@@ -101,13 +101,23 @@
|
|
|
101
101
|
},
|
|
102
102
|
{
|
|
103
103
|
"path": "packages/bundler/dist/src/authored_html.d.ts",
|
|
104
|
-
"bytes":
|
|
105
|
-
"sha256": "
|
|
104
|
+
"bytes": 2117,
|
|
105
|
+
"sha256": "02f8a7256bd35bbb8aaffe1d2a56fbe901aa32f1e3ae383e311696bc14b393bd"
|
|
106
106
|
},
|
|
107
107
|
{
|
|
108
108
|
"path": "packages/bundler/dist/src/authored_html.js",
|
|
109
|
-
"bytes":
|
|
110
|
-
"sha256": "
|
|
109
|
+
"bytes": 15985,
|
|
110
|
+
"sha256": "485c622b295bc7b33dba2af2ca98800ed0e8a691baa7fef22cfd9ccb470be1ec"
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"path": "packages/bundler/dist/src/bundle_projection.d.ts",
|
|
114
|
+
"bytes": 584,
|
|
115
|
+
"sha256": "fb5f3437d5c3945fe88eb636d47e078abcec6df40acccdc2d38741e1ba1ad653"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"path": "packages/bundler/dist/src/bundle_projection.js",
|
|
119
|
+
"bytes": 2504,
|
|
120
|
+
"sha256": "9aa0933b636d6326197f73ef25d4f1a99533a26ce132c3ee06128bec8cd91c9d"
|
|
111
121
|
},
|
|
112
122
|
{
|
|
113
123
|
"path": "packages/bundler/dist/src/command.d.ts",
|
|
@@ -116,8 +126,8 @@
|
|
|
116
126
|
},
|
|
117
127
|
{
|
|
118
128
|
"path": "packages/bundler/dist/src/command.js",
|
|
119
|
-
"bytes":
|
|
120
|
-
"sha256": "
|
|
129
|
+
"bytes": 5931,
|
|
130
|
+
"sha256": "03292a60d8989e5abbf17a34dc46736d1549689963a73e9f2cb26c531dedee1c"
|
|
121
131
|
},
|
|
122
132
|
{
|
|
123
133
|
"path": "packages/bundler/dist/src/generated/bundle-manifest.d.ts",
|
|
@@ -129,6 +139,26 @@
|
|
|
129
139
|
"bytes": 621,
|
|
130
140
|
"sha256": "d3f7d430ebbc045db575d648e61f459848bac3c936acf9a6ec5f825260ef2458"
|
|
131
141
|
},
|
|
142
|
+
{
|
|
143
|
+
"path": "packages/bundler/dist/src/generated/bundle-projection-validator.d.ts",
|
|
144
|
+
"bytes": 305,
|
|
145
|
+
"sha256": "86cb81c6de82addd637fd8fa92c51d2c541b22d434ec05eefa221bc51ead05cf"
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"path": "packages/bundler/dist/src/generated/bundle-projection-validator.js",
|
|
149
|
+
"bytes": 18179,
|
|
150
|
+
"sha256": "0694b9888e27ba633c0ec73c4999f3c34edad3b09badd63ee04525e76ca88a19"
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"path": "packages/bundler/dist/src/generated/bundle-projection.d.ts",
|
|
154
|
+
"bytes": 586,
|
|
155
|
+
"sha256": "a34237f3538de87ba5ac2c6e45d99c8a9043022dcde820b3915c67f210c043aa"
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"path": "packages/bundler/dist/src/generated/bundle-projection.js",
|
|
159
|
+
"bytes": 83,
|
|
160
|
+
"sha256": "edf68d2007e1ca8c5aa32394cd7c3131e37265fef1c71bf390f2cc02ff02f559"
|
|
161
|
+
},
|
|
132
162
|
{
|
|
133
163
|
"path": "packages/bundler/dist/src/html_image.d.ts",
|
|
134
164
|
"bytes": 967,
|
|
@@ -151,8 +181,8 @@
|
|
|
151
181
|
},
|
|
152
182
|
{
|
|
153
183
|
"path": "packages/bundler/dist/src/index.d.ts",
|
|
154
|
-
"bytes":
|
|
155
|
-
"sha256": "
|
|
184
|
+
"bytes": 381,
|
|
185
|
+
"sha256": "b88d6252d7a66b9cca0990ffa4d0f51474bd6a3715e795b42d932059620b9d1d"
|
|
156
186
|
},
|
|
157
187
|
{
|
|
158
188
|
"path": "packages/bundler/dist/src/index.js",
|
|
@@ -161,13 +191,13 @@
|
|
|
161
191
|
},
|
|
162
192
|
{
|
|
163
193
|
"path": "packages/bundler/dist/src/presentation.d.ts",
|
|
164
|
-
"bytes":
|
|
165
|
-
"sha256": "
|
|
194
|
+
"bytes": 2311,
|
|
195
|
+
"sha256": "50dea00d649ef252a7529e36f0e9f4d829022d38064ed64693dc621ff4c64fcd"
|
|
166
196
|
},
|
|
167
197
|
{
|
|
168
198
|
"path": "packages/bundler/dist/src/presentation.js",
|
|
169
|
-
"bytes":
|
|
170
|
-
"sha256": "
|
|
199
|
+
"bytes": 20046,
|
|
200
|
+
"sha256": "053c22902c3d758e9dbd27857be910c8f6b982001d7924833f077d237c83eb43"
|
|
171
201
|
},
|
|
172
202
|
{
|
|
173
203
|
"path": "packages/launcher/dist/desktop-release.json",
|
|
@@ -256,13 +286,13 @@
|
|
|
256
286
|
},
|
|
257
287
|
{
|
|
258
288
|
"path": "packages/motion-gsap/dist/src/index.d.ts",
|
|
259
|
-
"bytes":
|
|
260
|
-
"sha256": "
|
|
289
|
+
"bytes": 1373,
|
|
290
|
+
"sha256": "ba8d7eb2017457cb59456aead7c09b04097ca744e935415db1d7880f02244b79"
|
|
261
291
|
},
|
|
262
292
|
{
|
|
263
293
|
"path": "packages/motion-gsap/dist/src/index.js",
|
|
264
|
-
"bytes":
|
|
265
|
-
"sha256": "
|
|
294
|
+
"bytes": 5806,
|
|
295
|
+
"sha256": "4041d9b2bd3736d4c72c21ed298d65258f8e5703d3e54986f8706553c5c2f354"
|
|
266
296
|
},
|
|
267
297
|
{
|
|
268
298
|
"path": "packages/runtime/dist/src/clock.d.ts",
|
|
@@ -276,8 +306,8 @@
|
|
|
276
306
|
},
|
|
277
307
|
{
|
|
278
308
|
"path": "packages/runtime/dist/src/generated/browser-request.d.ts",
|
|
279
|
-
"bytes":
|
|
280
|
-
"sha256": "
|
|
309
|
+
"bytes": 4883,
|
|
310
|
+
"sha256": "15861c41b4713352e6b75bdf71c4ad165d8084d9f1031db58b563f984d618f0b"
|
|
281
311
|
},
|
|
282
312
|
{
|
|
283
313
|
"path": "packages/runtime/dist/src/generated/browser-request.js",
|
|
@@ -287,7 +317,7 @@
|
|
|
287
317
|
{
|
|
288
318
|
"path": "packages/runtime/dist/src/generated/browser-response.d.ts",
|
|
289
319
|
"bytes": 1368,
|
|
290
|
-
"sha256": "
|
|
320
|
+
"sha256": "adfd72031e58b5774ebdd62578d2f3bd17009d16bf1881d48330bc42689f77fc"
|
|
291
321
|
},
|
|
292
322
|
{
|
|
293
323
|
"path": "packages/runtime/dist/src/generated/browser-response.js",
|
|
@@ -316,23 +346,23 @@
|
|
|
316
346
|
},
|
|
317
347
|
{
|
|
318
348
|
"path": "packages/runtime/dist/src/generated/runtime-contract.d.ts",
|
|
319
|
-
"bytes":
|
|
320
|
-
"sha256": "
|
|
349
|
+
"bytes": 496,
|
|
350
|
+
"sha256": "4595ac4a096d79a3f153db88a4e19fd20be23db896b83e54527b26605e2f214c"
|
|
321
351
|
},
|
|
322
352
|
{
|
|
323
353
|
"path": "packages/runtime/dist/src/generated/runtime-contract.js",
|
|
324
|
-
"bytes":
|
|
325
|
-
"sha256": "
|
|
354
|
+
"bytes": 505,
|
|
355
|
+
"sha256": "48aff07bb36ec9f8edad25f597b985ff6a5dea9d44fbd2458e63cc4957026ece"
|
|
326
356
|
},
|
|
327
357
|
{
|
|
328
358
|
"path": "packages/runtime/dist/src/generated/validators.d.ts",
|
|
329
359
|
"bytes": 594,
|
|
330
|
-
"sha256": "
|
|
360
|
+
"sha256": "def2eb2646ee3084b86e3871fae68581ab51f0a1af917e7cdf8913567d9d4667"
|
|
331
361
|
},
|
|
332
362
|
{
|
|
333
363
|
"path": "packages/runtime/dist/src/generated/validators.js",
|
|
334
|
-
"bytes":
|
|
335
|
-
"sha256": "
|
|
364
|
+
"bytes": 234626,
|
|
365
|
+
"sha256": "fdfb7d5ebac40c9845c8998dda53d4d231f8affbb1e3a2a94868415b0862351b"
|
|
336
366
|
},
|
|
337
367
|
{
|
|
338
368
|
"path": "packages/runtime/dist/src/host.d.ts",
|
|
@@ -346,13 +376,13 @@
|
|
|
346
376
|
},
|
|
347
377
|
{
|
|
348
378
|
"path": "packages/runtime/dist/src/index.d.ts",
|
|
349
|
-
"bytes":
|
|
350
|
-
"sha256": "
|
|
379
|
+
"bytes": 1770,
|
|
380
|
+
"sha256": "de8c076c1aea98cb88bd49f90acd38b882e0240334b88174be53e6085c2ae1e8"
|
|
351
381
|
},
|
|
352
382
|
{
|
|
353
383
|
"path": "packages/runtime/dist/src/index.js",
|
|
354
|
-
"bytes":
|
|
355
|
-
"sha256": "
|
|
384
|
+
"bytes": 1094,
|
|
385
|
+
"sha256": "146654c7bdc89e1e1815545af22577744eeb00ec95106f81cb13a41a87690938"
|
|
356
386
|
},
|
|
357
387
|
{
|
|
358
388
|
"path": "packages/runtime/dist/src/media.d.ts",
|
|
@@ -366,13 +396,13 @@
|
|
|
366
396
|
},
|
|
367
397
|
{
|
|
368
398
|
"path": "packages/runtime/dist/src/presentation.d.ts",
|
|
369
|
-
"bytes":
|
|
370
|
-
"sha256": "
|
|
399
|
+
"bytes": 3560,
|
|
400
|
+
"sha256": "8a27e87ae90d27f2fd7ab20b4048e88f344b59262ac47c5e7ba19bfda8d1dffc"
|
|
371
401
|
},
|
|
372
402
|
{
|
|
373
403
|
"path": "packages/runtime/dist/src/presentation.js",
|
|
374
|
-
"bytes":
|
|
375
|
-
"sha256": "
|
|
404
|
+
"bytes": 14443,
|
|
405
|
+
"sha256": "4052fe152744acc35981ba60c68822750187a28728dd26312a9b789714e60251"
|
|
376
406
|
},
|
|
377
407
|
{
|
|
378
408
|
"path": "packages/runtime/dist/src/resource.d.ts",
|
|
@@ -391,13 +421,13 @@
|
|
|
391
421
|
},
|
|
392
422
|
{
|
|
393
423
|
"path": "packages/runtime/dist/src/session.js",
|
|
394
|
-
"bytes":
|
|
395
|
-
"sha256": "
|
|
424
|
+
"bytes": 20157,
|
|
425
|
+
"sha256": "d2c7cc8cf073af64ff5dda45bdec3b3aca8bb8e693243ad037c84dce0165eaa6"
|
|
396
426
|
},
|
|
397
427
|
{
|
|
398
428
|
"path": "packages/runtime/dist/src/types.d.ts",
|
|
399
|
-
"bytes":
|
|
400
|
-
"sha256": "
|
|
429
|
+
"bytes": 636,
|
|
430
|
+
"sha256": "eb75c5eacb50cc83d5bf4b27a3ebc904c4af4a33113d0aa2772dfb54493757f8"
|
|
401
431
|
},
|
|
402
432
|
{
|
|
403
433
|
"path": "packages/runtime/dist/src/types.js",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onmark/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Screenplay-first deterministic browser video compiler",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"yauzl": "3.4.0"
|
|
46
46
|
},
|
|
47
47
|
"optionalDependencies": {
|
|
48
|
-
"@onmark/cli-darwin-arm64": "0.
|
|
49
|
-
"@onmark/cli-linux-x64": "0.
|
|
50
|
-
"@onmark/cli-win32-x64": "0.
|
|
48
|
+
"@onmark/cli-darwin-arm64": "0.4.0",
|
|
49
|
+
"@onmark/cli-linux-x64": "0.4.0",
|
|
50
|
+
"@onmark/cli-win32-x64": "0.4.0"
|
|
51
51
|
}
|
|
52
52
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PresentationExtension, PresentationExtensionContext,
|
|
1
|
+
import type { PresentationExtension, PresentationExtensionContext, PresentationElementTargetKind } from "./motion.js";
|
|
2
2
|
/** One immutable sample inside a semantic element's solved interval. */
|
|
3
3
|
export interface FrameMotionContext {
|
|
4
4
|
readonly durationFrames: number;
|
|
@@ -9,9 +9,17 @@ export interface FrameMotionContext {
|
|
|
9
9
|
}
|
|
10
10
|
/** Applies browser-owned visual state for one exact local frame. */
|
|
11
11
|
export type FrameMotionHandler = (context: FrameMotionContext) => void;
|
|
12
|
+
/** Exact-frame transition sample with both related shot elements. */
|
|
13
|
+
export interface TransitionFrameMotionContext extends FrameMotionContext {
|
|
14
|
+
readonly incomingElement: HTMLElement;
|
|
15
|
+
readonly outgoingElement: HTMLElement;
|
|
16
|
+
}
|
|
17
|
+
/** Applies browser-owned transition state for one exact overlap frame. */
|
|
18
|
+
export type TransitionFrameMotionHandler = (context: TransitionFrameMotionContext) => void;
|
|
12
19
|
/** Semantic handlers and optional selector handlers for exact-frame motion. */
|
|
13
|
-
export type FrameMotionDefinition = Readonly<Partial<Record<
|
|
20
|
+
export type FrameMotionDefinition = Readonly<Partial<Record<PresentationElementTargetKind, FrameMotionHandler>> & {
|
|
14
21
|
readonly selectors?: Readonly<Record<string, FrameMotionHandler>>;
|
|
22
|
+
readonly transition?: TransitionFrameMotionHandler;
|
|
15
23
|
}>;
|
|
16
24
|
/** Creates local browser effects driven directly by exact runtime frames. */
|
|
17
25
|
export declare function frameMotion(definition: FrameMotionDefinition): PresentationExtension;
|
|
@@ -16,7 +16,7 @@ function bindEffects(rules, context) {
|
|
|
16
16
|
const effects = [];
|
|
17
17
|
for (const target of context.targets) {
|
|
18
18
|
const handlers = matchingHandlers(rules, target);
|
|
19
|
-
if (handlers.length > 0) {
|
|
19
|
+
if (handlers.elements.length > 0 || handlers.transition !== undefined) {
|
|
20
20
|
effects.push(bindEffect(target, handlers, context.frameRate));
|
|
21
21
|
}
|
|
22
22
|
}
|
|
@@ -35,9 +35,12 @@ function bindEffect(target, handlers, frameRate) {
|
|
|
35
35
|
element: target.element,
|
|
36
36
|
frameRate,
|
|
37
37
|
localFrame,
|
|
38
|
-
progress: localFrame
|
|
38
|
+
progress: targetProgress(target, localFrame, durationFrames),
|
|
39
39
|
});
|
|
40
|
-
|
|
40
|
+
if (target.kind === "transition" && handlers.transition !== undefined) {
|
|
41
|
+
handlers.transition(transitionSample(sample, target));
|
|
42
|
+
}
|
|
43
|
+
for (const handler of handlers.elements) {
|
|
41
44
|
handler(sample);
|
|
42
45
|
}
|
|
43
46
|
},
|
|
@@ -57,7 +60,11 @@ function ownRules(definition) {
|
|
|
57
60
|
caption: definition.caption,
|
|
58
61
|
});
|
|
59
62
|
const selectors = Object.freeze(Object.entries(definition.selectors ?? {}).map(ownSelector));
|
|
60
|
-
return Object.freeze({
|
|
63
|
+
return Object.freeze({
|
|
64
|
+
kinds,
|
|
65
|
+
selectors,
|
|
66
|
+
transition: definition.transition,
|
|
67
|
+
});
|
|
61
68
|
}
|
|
62
69
|
function ownSelector([selector, apply]) {
|
|
63
70
|
if (selector.trim().length === 0) {
|
|
@@ -67,7 +74,7 @@ function ownSelector([selector, apply]) {
|
|
|
67
74
|
}
|
|
68
75
|
function matchingHandlers(rules, target) {
|
|
69
76
|
const handlers = [];
|
|
70
|
-
const kind = rules.kinds[target.kind];
|
|
77
|
+
const kind = target.kind === "transition" ? undefined : rules.kinds[target.kind];
|
|
71
78
|
if (kind !== undefined) {
|
|
72
79
|
handlers.push(kind);
|
|
73
80
|
}
|
|
@@ -76,5 +83,21 @@ function matchingHandlers(rules, target) {
|
|
|
76
83
|
handlers.push(rule.apply);
|
|
77
84
|
}
|
|
78
85
|
}
|
|
79
|
-
return
|
|
86
|
+
return Object.freeze({
|
|
87
|
+
elements: Object.freeze(handlers),
|
|
88
|
+
transition: target.kind === "transition" ? rules.transition : undefined,
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
function targetProgress(target, localFrame, durationFrames) {
|
|
92
|
+
if (target.kind !== "transition") {
|
|
93
|
+
return localFrame / durationFrames;
|
|
94
|
+
}
|
|
95
|
+
return durationFrames === 1 ? 1 : localFrame / (durationFrames - 1);
|
|
96
|
+
}
|
|
97
|
+
function transitionSample(sample, target) {
|
|
98
|
+
return Object.freeze({
|
|
99
|
+
...sample,
|
|
100
|
+
incomingElement: target.incomingElement,
|
|
101
|
+
outgoingElement: target.outgoingElement,
|
|
102
|
+
});
|
|
80
103
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { frameMotion, type FrameMotionContext, type FrameMotionDefinition, type FrameMotionHandler, } from "./frame-motion.js";
|
|
1
|
+
export { frameMotion, type FrameMotionContext, type FrameMotionDefinition, type FrameMotionHandler, type TransitionFrameMotionContext, type TransitionFrameMotionHandler, } from "./frame-motion.js";
|
|
2
2
|
export { easing, interpolate, type EasingFunction, type Extrapolation, type InterpolationOptions, } from "./interpolation.js";
|
|
3
3
|
export { spring, type SpringFrame, type SpringOptions } from "./spring.js";
|
|
4
|
-
export { combineMotion, type PresentationExtension, type PresentationExtensionContext, type PresentationTarget, type PresentationTargetKind, } from "./motion.js";
|
|
4
|
+
export { combineMotion, type PresentationExtension, type PresentationExtensionContext, type PresentationElementTarget, type PresentationElementTargetKind, type PresentationTarget, type PresentationTargetKind, type PresentationTransitionTarget, } from "./motion.js";
|
|
5
5
|
export { createDomPresentationBindings, type DomPresentationOptions, type VideoSource, } from "./presentation.js";
|
|
6
6
|
export { createFontResource, createImageResource, type FontResource, type FontResourceOptions, type ImageResource, type ImageResourceOptions, } from "./resource.js";
|
|
@@ -1,12 +1,23 @@
|
|
|
1
1
|
import type { PresentationExtensions, RuntimeNode, RuntimePlan } from "../../../runtime/dist/src/index.js";
|
|
2
|
-
export type
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
readonly kind: PresentationTargetKind;
|
|
2
|
+
export type PresentationElementTargetKind = "film" | "scene" | "shot" | "video" | "title" | "callToAction" | "caption";
|
|
3
|
+
export type PresentationTargetKind = PresentationElementTargetKind | "transition";
|
|
4
|
+
interface PresentationTargetBase {
|
|
6
5
|
readonly element: HTMLElement;
|
|
7
6
|
readonly interval: RuntimePlan["evaluation"];
|
|
8
7
|
readonly node: RuntimeNode;
|
|
9
8
|
}
|
|
9
|
+
/** One semantic element and its compiler-owned active interval. */
|
|
10
|
+
export interface PresentationElementTarget extends PresentationTargetBase {
|
|
11
|
+
readonly kind: PresentationElementTargetKind;
|
|
12
|
+
}
|
|
13
|
+
/** One transition marker and the exact adjacent elements it relates. */
|
|
14
|
+
export interface PresentationTransitionTarget extends PresentationTargetBase {
|
|
15
|
+
readonly kind: "transition";
|
|
16
|
+
readonly incomingElement: HTMLElement;
|
|
17
|
+
readonly outgoingElement: HTMLElement;
|
|
18
|
+
}
|
|
19
|
+
/** Closed browser-owned view of one compiler-projected semantic target. */
|
|
20
|
+
export type PresentationTarget = PresentationElementTarget | PresentationTransitionTarget;
|
|
10
21
|
/** Complete immutable DOM view delivered after all solved facts are bound. */
|
|
11
22
|
export interface PresentationExtensionContext {
|
|
12
23
|
readonly frameRate: RuntimePlan["frameRate"];
|
|
@@ -21,3 +32,4 @@ export declare function combineMotion(...extensions: readonly PresentationExtens
|
|
|
21
32
|
export declare const EMPTY_PRESENTATION_EXTENSIONS: PresentationExtensions;
|
|
22
33
|
export declare function ownExtension(extension: PresentationExtension): PresentationExtension;
|
|
23
34
|
export declare function ownExtensions(extensions: PresentationExtensions): PresentationExtensions;
|
|
35
|
+
export {};
|
|
@@ -9,6 +9,7 @@ const ELEMENTS = Object.freeze({
|
|
|
9
9
|
scene: "om-scene",
|
|
10
10
|
shot: "om-shot",
|
|
11
11
|
title: "om-title",
|
|
12
|
+
transition: "om-transition",
|
|
12
13
|
video: "video",
|
|
13
14
|
});
|
|
14
15
|
// Whole-film artifacts may contain semantic nodes absent from a projected
|
|
@@ -17,6 +18,7 @@ const VISIBILITY_RULE = [
|
|
|
17
18
|
"[data-om-node][hidden],",
|
|
18
19
|
"om-film > om-scene:not([data-om-node]),",
|
|
19
20
|
"om-scene > om-shot:not([data-om-node]),",
|
|
21
|
+
"om-scene > om-transition,",
|
|
20
22
|
"om-shot > :is(video, om-title, om-cta):not([data-om-node]) {",
|
|
21
23
|
" display: none !important;",
|
|
22
24
|
"}",
|
|
@@ -32,6 +34,7 @@ export function createDomPresentationBindings(options) {
|
|
|
32
34
|
bindFilm: document.bindFilm.bind(document),
|
|
33
35
|
bindScene: document.bindScene.bind(document),
|
|
34
36
|
bindShot: document.bindShot.bind(document),
|
|
37
|
+
bindTransition: document.bindTransition.bind(document),
|
|
35
38
|
bindVideo: document.bindVideo.bind(document),
|
|
36
39
|
bindOverlay: document.bindOverlay.bind(document),
|
|
37
40
|
async bindExtensions(plan) {
|
|
@@ -97,6 +100,27 @@ class AuthoredDocument {
|
|
|
97
100
|
source: this.#videoSource(placement),
|
|
98
101
|
};
|
|
99
102
|
}
|
|
103
|
+
bindTransition(placement) {
|
|
104
|
+
const nodes = this.#nodeIndex();
|
|
105
|
+
const element = requiredNode(nodes, placement.node, "transition", ELEMENTS.transition);
|
|
106
|
+
const outgoingElement = requiredNodeId(nodes, placement.outgoingShotId, "outgoing shot", ELEMENTS.shot);
|
|
107
|
+
const incomingElement = requiredNodeId(nodes, placement.incomingShotId, "incoming shot", ELEMENTS.shot);
|
|
108
|
+
const bound = bindElement(element, placement.node);
|
|
109
|
+
this.#targets.push(Object.freeze({
|
|
110
|
+
element,
|
|
111
|
+
incomingElement,
|
|
112
|
+
interval: placement.interval,
|
|
113
|
+
kind: "transition",
|
|
114
|
+
node: placement.node,
|
|
115
|
+
outgoingElement,
|
|
116
|
+
}));
|
|
117
|
+
return Object.freeze({
|
|
118
|
+
dispose: bound.dispose,
|
|
119
|
+
element,
|
|
120
|
+
incomingElement,
|
|
121
|
+
outgoingElement,
|
|
122
|
+
});
|
|
123
|
+
}
|
|
100
124
|
bindOverlay(placement) {
|
|
101
125
|
if (placement.kind === "caption") {
|
|
102
126
|
return this.#bindCaption(placement);
|
|
@@ -157,7 +181,13 @@ function collectAuthoredNodes(document, plan) {
|
|
|
157
181
|
const browserVideoShots = new Set(plan.videos.map(({ shotId }) => shotId));
|
|
158
182
|
for (const scene of semanticChildren(film, ELEMENTS.scene)) {
|
|
159
183
|
indexed.push(scene);
|
|
160
|
-
|
|
184
|
+
const structure = semanticChildren(scene, `${ELEMENTS.shot}, ${ELEMENTS.transition}`);
|
|
185
|
+
for (const element of structure) {
|
|
186
|
+
if (element.matches(ELEMENTS.transition)) {
|
|
187
|
+
indexed.push(element);
|
|
188
|
+
continue;
|
|
189
|
+
}
|
|
190
|
+
const shot = element;
|
|
161
191
|
indexed.push(shot);
|
|
162
192
|
// Browser Plans assign dense semantic preorder IDs. The shot just
|
|
163
193
|
// admitted is therefore the parent ID carried by projected videos.
|
|
@@ -170,6 +200,9 @@ function collectAuthoredNodes(document, plan) {
|
|
|
170
200
|
}
|
|
171
201
|
return Object.freeze({ film, elements: Object.freeze(indexed) });
|
|
172
202
|
}
|
|
203
|
+
function requiredNodeId(nodes, nodeId, role, selector) {
|
|
204
|
+
return requiredNode(nodes, { nodeId }, role, selector);
|
|
205
|
+
}
|
|
173
206
|
function requiredNode(nodes, node, role, selector) {
|
|
174
207
|
const element = nodes.elements[node.nodeId];
|
|
175
208
|
if (element === undefined) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type { PresentationExtension, PresentationExtensionContext, PresentationTarget, PresentationTargetKind, } from "./motion.js";
|
|
1
|
+
export type { PresentationExtension, PresentationExtensionContext, PresentationElementTarget, PresentationElementTargetKind, PresentationTarget, PresentationTargetKind, PresentationTransitionTarget, } from "./motion.js";
|
|
@@ -4,13 +4,13 @@ export interface AuthoredHtml {
|
|
|
4
4
|
readonly document: string;
|
|
5
5
|
readonly motion: string | undefined;
|
|
6
6
|
readonly resources: readonly HtmlImageResource[];
|
|
7
|
-
readonly
|
|
7
|
+
readonly shots: readonly AuthoredHtmlShot[];
|
|
8
8
|
readonly regionStructure: AuthoredHtmlRegionStructure;
|
|
9
9
|
readonly resolveDirectory: string;
|
|
10
10
|
readonly runtimeOffset: number;
|
|
11
11
|
}
|
|
12
|
-
/** One shot
|
|
13
|
-
export interface
|
|
12
|
+
/** One dense screenplay-order shot within the authored document. */
|
|
13
|
+
export interface AuthoredHtmlShot {
|
|
14
14
|
readonly scene: number;
|
|
15
15
|
readonly shot: number;
|
|
16
16
|
}
|
|
@@ -20,9 +20,19 @@ export interface AuthoredHtmlRegionStructure {
|
|
|
20
20
|
}
|
|
21
21
|
export interface AuthoredHtmlScene {
|
|
22
22
|
readonly range: SourceRange;
|
|
23
|
-
readonly shots: readonly
|
|
23
|
+
readonly shots: readonly AuthoredHtmlShotRange[];
|
|
24
|
+
readonly transitions: readonly AuthoredHtmlTransitionRange[];
|
|
24
25
|
}
|
|
25
|
-
|
|
26
|
+
export interface AuthoredHtmlShotRange {
|
|
27
|
+
readonly index: number;
|
|
28
|
+
readonly range: SourceRange;
|
|
29
|
+
}
|
|
30
|
+
export interface AuthoredHtmlTransitionRange {
|
|
31
|
+
readonly incomingShot: number;
|
|
32
|
+
readonly outgoingShot: number;
|
|
33
|
+
readonly range: SourceRange;
|
|
34
|
+
}
|
|
35
|
+
/** One materialized render-region browser document. */
|
|
26
36
|
export interface AuthoredHtmlRegionDocument {
|
|
27
37
|
readonly document: string;
|
|
28
38
|
readonly runtimeOffset: number;
|
|
@@ -33,8 +43,8 @@ export declare class AuthoredHtmlError extends Error {
|
|
|
33
43
|
}
|
|
34
44
|
/** Reads one bounded UTF-8 document and isolates its motion module. */
|
|
35
45
|
export declare function readAuthoredHtml(path: string, maxOutputBytes: number, resolveDirectory?: string): Promise<AuthoredHtml>;
|
|
36
|
-
/** Materializes one
|
|
37
|
-
export declare function
|
|
46
|
+
/** Materializes one Rust-planned region without retaining every projection. */
|
|
47
|
+
export declare function projectRegionDocument(html: AuthoredHtml, shotIndices: readonly number[]): AuthoredHtmlRegionDocument;
|
|
38
48
|
export interface SourceRange {
|
|
39
49
|
readonly end: number;
|
|
40
50
|
readonly start: number;
|