@hyperframes/core 0.8.173 → 0.8.175
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/dist/clipFacts.d.ts +1 -7
- package/dist/clipFacts.js +1 -16
- package/dist/colorGrading.d.ts +1 -0
- package/dist/colorGrading.js +2 -1
- package/dist/editing/affordances.js +2 -1
- package/dist/fonts/fontCompression.d.ts +1 -0
- package/dist/fonts/fontCompression.js +2 -2
- package/dist/generated/runtime-inline.js +1 -1
- package/dist/hyperframe.runtime.iife.js +59 -59
- package/dist/runtime/adapters/seek-dispatch.d.ts +3 -0
- package/dist/runtime/adapters/seek-dispatch.js +9 -0
- package/dist/runtime/timeline.d.ts +7 -0
- package/dist/runtime/timeline.js +13 -5
- package/package.json +4 -4
|
@@ -26,6 +26,9 @@ export declare function dispatchSeekEvent(time: number): void;
|
|
|
26
26
|
*/
|
|
27
27
|
export declare function forceDispatchSeekEvent(time: number): void;
|
|
28
28
|
export declare function isSeekCompletionBarrierActive(): boolean;
|
|
29
|
+
/** Settles with every pending completion, without consuming a failure the barrier reports. */
|
|
30
|
+
export declare function seekCompletionsSettled(): Promise<void>;
|
|
31
|
+
export declare function hasPendingSeekCompletion(): boolean;
|
|
29
32
|
/** `videoFrames: false` skips only the video-frame holds: a geometry read needs every other completion. */
|
|
30
33
|
export declare function waitForSeekCompletion(options?: {
|
|
31
34
|
videoFrames?: boolean;
|
|
@@ -94,6 +94,15 @@ export function forceDispatchSeekEvent(time) {
|
|
|
94
94
|
export function isSeekCompletionBarrierActive() {
|
|
95
95
|
return _activeCompletionBarriers > 0;
|
|
96
96
|
}
|
|
97
|
+
/** Settles with every pending completion, without consuming a failure the barrier reports. */
|
|
98
|
+
export async function seekCompletionsSettled() {
|
|
99
|
+
for (let pending = [..._pendingCompletions]; pending.length > 0; pending = [..._pendingCompletions]) {
|
|
100
|
+
await Promise.all(pending);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
export function hasPendingSeekCompletion() {
|
|
104
|
+
return _pendingCompletions.size > 0;
|
|
105
|
+
}
|
|
97
106
|
/** `videoFrames: false` skips only the video-frame holds: a geometry read needs every other completion. */
|
|
98
107
|
export async function waitForSeekCompletion(options) {
|
|
99
108
|
const awaited = () => [..._pendingCompletions].filter((completion) => options?.videoFrames !== false || !_videoFrameCompletions.has(completion));
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import type { RuntimeTimelineMessage, RuntimeTimelineLike } from "./types.js";
|
|
2
2
|
import { createRuntimeStartTimeResolver } from "./startResolver.js";
|
|
3
|
+
export declare function runtimeElementWindow(rawNode: Element, options: {
|
|
4
|
+
timelineRegistry: Record<string, RuntimeTimelineLike | undefined>;
|
|
5
|
+
resolver: ReturnType<typeof createRuntimeStartTimeResolver>;
|
|
6
|
+
}): {
|
|
7
|
+
start: number;
|
|
8
|
+
end: number;
|
|
9
|
+
} | null;
|
|
3
10
|
export declare function isRuntimeElementVisibleAt(rawNode: Element, options: {
|
|
4
11
|
currentTime: number;
|
|
5
12
|
compositionDuration: number;
|
package/dist/runtime/timeline.js
CHANGED
|
@@ -15,10 +15,10 @@ import { runtimeProtocolMetadata } from "./protocol.js";
|
|
|
15
15
|
import { isElementNode, isMediaElement } from "./domRealm.js";
|
|
16
16
|
import { LOOP_INFLATED_TIMELINE_SECONDS } from "./compositionLength.js";
|
|
17
17
|
import { cutToHostSlots } from "../mediaTiming.js";
|
|
18
|
-
export function
|
|
18
|
+
export function runtimeElementWindow(rawNode, options) {
|
|
19
19
|
const tag = rawNode.tagName.toLowerCase();
|
|
20
20
|
if (tag === "script" || tag === "style" || tag === "link" || tag === "meta") {
|
|
21
|
-
return
|
|
21
|
+
return null;
|
|
22
22
|
}
|
|
23
23
|
const isMedia = tag === "video" || tag === "audio";
|
|
24
24
|
const start = isMedia
|
|
@@ -40,11 +40,19 @@ export function isRuntimeElementVisibleAt(rawNode, options) {
|
|
|
40
40
|
duration = liveDuration;
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
-
|
|
43
|
+
return {
|
|
44
|
+
start,
|
|
45
|
+
end: duration != null && duration > 0 ? start + duration : Number.POSITIVE_INFINITY,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
export function isRuntimeElementVisibleAt(rawNode, options) {
|
|
49
|
+
const span = runtimeElementWindow(rawNode, options);
|
|
50
|
+
if (!span)
|
|
51
|
+
return false;
|
|
44
52
|
// Export seeks snap to frame boundaries; interactive visibility uses authored seconds.
|
|
45
53
|
const clipWindow = options.exportRenderSeek
|
|
46
|
-
? exportClipWindow(start,
|
|
47
|
-
:
|
|
54
|
+
? exportClipWindow(span.start, span.end, options.canonicalFps)
|
|
55
|
+
: span;
|
|
48
56
|
return isClipVisibleAt(options.currentTime, clipWindow.start, clipWindow.end, options.compositionDuration);
|
|
49
57
|
}
|
|
50
58
|
function parseNum(value) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hyperframes/core",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.175",
|
|
4
4
|
"description": "",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -381,9 +381,9 @@
|
|
|
381
381
|
"linkedom": "^0.18.12",
|
|
382
382
|
"postcss": "^8.5.8",
|
|
383
383
|
"wawoff2": "^2.0.1",
|
|
384
|
-
"@hyperframes/
|
|
385
|
-
"@hyperframes/
|
|
386
|
-
"@hyperframes/
|
|
384
|
+
"@hyperframes/lint": "0.8.175",
|
|
385
|
+
"@hyperframes/parsers": "0.8.175",
|
|
386
|
+
"@hyperframes/studio-server": "0.8.175"
|
|
387
387
|
},
|
|
388
388
|
"devDependencies": {
|
|
389
389
|
"@fontsource/archivo-black": "^5.2.8",
|