@hyperframes/core 0.8.205 → 0.8.206
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/compiler/compositionScoping.d.ts +2 -0
- package/dist/compiler/compositionScoping.js +4 -0
- package/dist/compiler/htmlBundler.js +3 -1
- package/dist/compiler/inlineSubCompositions.js +2 -2
- package/dist/compiler/pngColourTags.d.ts +2 -0
- package/dist/compiler/pngColourTags.js +27 -0
- package/dist/generated/runtime-inline.js +1 -1
- package/dist/generators/hyperframes.js +4 -1
- package/dist/hyperframe.runtime.iife.js +66 -64
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/runtime/media.js +4 -3
- package/dist/runtime/mediaClock.d.ts +2 -0
- package/dist/runtime/mediaClock.js +4 -0
- package/dist/runtime/preloadMedia.js +2 -1
- package/dist/runtime/startResolver.js +6 -8
- package/package.json +12 -4
package/dist/index.d.ts
CHANGED
|
@@ -25,6 +25,7 @@ export { CSS_URL_RE, isNonRelativeUrl, isPathInside } from "./compiler/assetPath
|
|
|
25
25
|
export { rewriteSrcsetUrls } from "./compiler/srcset.js";
|
|
26
26
|
export { checkSubCompositionUsability, type ParsableDocumentLike, type SubCompositionValidity, type SubCompositionValidityReason, } from "./compiler/subCompositionValidity.js";
|
|
27
27
|
export { RUNTIME_BOOTSTRAP_ATTR, stripEmbeddedRuntimeScripts } from "./compiler/htmlDocument.js";
|
|
28
|
+
export { AUTHORED_SOURCE_BEGIN, AUTHORED_SOURCE_END } from "./compiler/compositionScoping.js";
|
|
28
29
|
export { COMPOSITION_SOURCE_URL } from "./compiler/scriptRuns.js";
|
|
29
30
|
export { queryByAttr } from "./utils/cssSelector.js";
|
|
30
31
|
export { AUDIBLE_MEDIA_SELECTOR, audibleVideoNeedsWebAudio, isAudibleVideoElement, } from "./audibleVideo.js";
|
|
@@ -55,6 +56,7 @@ export { parseStartExpression, parseNumeric, type ReferenceExpression, } from ".
|
|
|
55
56
|
export { COMPOSITION_CONTRACT_VERSION, COMPOSITION_ATTRIBUTES, CANONICAL_AUTHORED_TIMING_ATTRIBUTES, DERIVED_TIMING_ATTRIBUTES, LEGACY_TIMING_ATTRIBUTES, readClipTiming, writeClipTiming, ClipTimingWriteError, type ClipTiming, type ClipTimingDiagnostic, type ClipTimingDiagnosticCode, type ClipTimingUpdate, } from "./compositionContract.js";
|
|
56
57
|
export { createRuntimeStartTimeResolver } from "./runtime/startResolver.js";
|
|
57
58
|
export { hasClipStarted, isClipVisibleAt, isInClipWindow } from "./runtime/clipWindow.js";
|
|
59
|
+
export { MEDIA_ELEMENT_LEAD_SECONDS, mediaElementTime } from "./runtime/mediaClock.js";
|
|
58
60
|
export { normalizePlaybackRate, normalizeRateSpec, parseStrictFiniteTimingNumber, readElementPlaybackRate, readElementRateSpec, readMediaStart, resolveNaturalMediaTimelineDuration, resolveNaturalMediaTimelineDurationFromValues, } from "./runtime/playbackRate.js";
|
|
59
61
|
export { shiftRateLane, sourceTimeAt, timeAtSourceTime, type RateSpec } from "./speedRamp.js";
|
|
60
62
|
export { validateVariables, formatVariableValidationIssue, type VariableValidationIssue, } from "./runtime/validateVariables.js";
|
package/dist/index.js
CHANGED
|
@@ -21,6 +21,7 @@ export { CSS_URL_RE, isNonRelativeUrl, isPathInside } from "./compiler/assetPath
|
|
|
21
21
|
export { rewriteSrcsetUrls } from "./compiler/srcset.js";
|
|
22
22
|
export { checkSubCompositionUsability, } from "./compiler/subCompositionValidity.js";
|
|
23
23
|
export { RUNTIME_BOOTSTRAP_ATTR, stripEmbeddedRuntimeScripts } from "./compiler/htmlDocument.js";
|
|
24
|
+
export { AUTHORED_SOURCE_BEGIN, AUTHORED_SOURCE_END } from "./compiler/compositionScoping.js";
|
|
24
25
|
export { COMPOSITION_SOURCE_URL } from "./compiler/scriptRuns.js";
|
|
25
26
|
export { queryByAttr } from "./utils/cssSelector.js";
|
|
26
27
|
export { AUDIBLE_MEDIA_SELECTOR, audibleVideoNeedsWebAudio, isAudibleVideoElement, } from "./audibleVideo.js";
|
|
@@ -57,6 +58,7 @@ export { COMPOSITION_CONTRACT_VERSION, COMPOSITION_ATTRIBUTES, CANONICAL_AUTHORE
|
|
|
57
58
|
export { createRuntimeStartTimeResolver } from "./runtime/startResolver.js";
|
|
58
59
|
// Also exposed via the ./runtime/clip-window subpath; re-exported here for the same dist-emit reason.
|
|
59
60
|
export { hasClipStarted, isClipVisibleAt, isInClipWindow } from "./runtime/clipWindow.js";
|
|
61
|
+
export { MEDIA_ELEMENT_LEAD_SECONDS, mediaElementTime } from "./runtime/mediaClock.js";
|
|
60
62
|
export { normalizePlaybackRate, normalizeRateSpec, parseStrictFiniteTimingNumber, readElementPlaybackRate, readElementRateSpec, readMediaStart, resolveNaturalMediaTimelineDuration, resolveNaturalMediaTimelineDurationFromValues, } from "./runtime/playbackRate.js";
|
|
61
63
|
export { shiftRateLane, sourceTimeAt, timeAtSourceTime } from "./speedRamp.js";
|
|
62
64
|
// Variable validation (CLI / tooling-side)
|
package/dist/runtime/media.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { swallow } from "./diagnostics.js";
|
|
2
2
|
import { isClipVisibleAt, isInClipWindow } from "./clipWindow.js";
|
|
3
|
+
import { mediaElementTime } from "./mediaClock.js";
|
|
3
4
|
import { sameInstant } from "../clipFacts.js";
|
|
4
5
|
import { interpolateVolumeGain } from "./mediaVolumeEnvelope.js";
|
|
5
6
|
import { elementVolumeLaneGain } from "./audioAutomationVolume.js";
|
|
@@ -225,7 +226,7 @@ function prepareUpcomingVideo(clip, time, playing, rate) {
|
|
|
225
226
|
try {
|
|
226
227
|
// A trimmed video exposed during its in-point seek has no current frame at the cut.
|
|
227
228
|
// Hidden preparation must not hold the visible-frame seek barrier.
|
|
228
|
-
el.currentTime = target;
|
|
229
|
+
el.currentTime = mediaElementTime(target);
|
|
229
230
|
}
|
|
230
231
|
catch (err) {
|
|
231
232
|
swallow("runtime.media.preseek", err);
|
|
@@ -507,7 +508,7 @@ export function syncRuntimeMedia(params) {
|
|
|
507
508
|
const skipForInjectedVideo = el.tagName === "VIDEO" && !!findInjectedRenderFrame(el);
|
|
508
509
|
if (!skipForInjectedVideo) {
|
|
509
510
|
try {
|
|
510
|
-
el.currentTime = relTime;
|
|
511
|
+
el.currentTime = mediaElementTime(relTime);
|
|
511
512
|
}
|
|
512
513
|
catch (err) {
|
|
513
514
|
swallow("runtime.media.site2", err);
|
|
@@ -516,7 +517,7 @@ export function syncRuntimeMedia(params) {
|
|
|
516
517
|
seekLoadRetried.add(el);
|
|
517
518
|
el.load();
|
|
518
519
|
try {
|
|
519
|
-
el.currentTime = relTime;
|
|
520
|
+
el.currentTime = mediaElementTime(relTime);
|
|
520
521
|
}
|
|
521
522
|
catch (err) {
|
|
522
523
|
swallow("runtime.media.site3", err);
|
|
@@ -3,6 +3,7 @@ import { createRuntimeStartTimeResolver } from "./startResolver.js";
|
|
|
3
3
|
import { readMediaRenderId } from "./renderFrameSibling.js";
|
|
4
4
|
import { defersMedia } from "./timedClipHide.js";
|
|
5
5
|
import { swallow } from "./diagnostics.js";
|
|
6
|
+
import { mediaElementTime } from "./mediaClock.js";
|
|
6
7
|
export function isRenderFrameVideo(media) {
|
|
7
8
|
const ids = window
|
|
8
9
|
.__HF_RENDER_FRAME_VIDEO_IDS;
|
|
@@ -33,7 +34,7 @@ export function prepareUpcomingMedia(media, isUpcoming) {
|
|
|
33
34
|
if (Math.abs(media.currentTime - start) <= 0.02)
|
|
34
35
|
return;
|
|
35
36
|
try {
|
|
36
|
-
media.currentTime = start;
|
|
37
|
+
media.currentTime = mediaElementTime(start);
|
|
37
38
|
}
|
|
38
39
|
catch (error) {
|
|
39
40
|
swallow("runtime.preload.playbackStart", error);
|
|
@@ -60,18 +60,16 @@ export function createRuntimeStartTimeResolver(params) {
|
|
|
60
60
|
durationCache.set(element, resolved);
|
|
61
61
|
return resolved;
|
|
62
62
|
};
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
//
|
|
67
|
-
// loaded into: the host may use a different id than the file, or none (an anonymous host).
|
|
63
|
+
const COMPOSITION_HOST_SELECTOR = "[data-composition-src], [data-composition-id], [data-composition-file]";
|
|
64
|
+
const isCompositionHost = (element) => element.matches(COMPOSITION_HOST_SELECTOR);
|
|
65
|
+
// A mounted composition root without its own `data-start` takes its timing from the nearest host
|
|
66
|
+
// or timed wrapper above it, the clip that shows it; the host may use another id than the file.
|
|
68
67
|
const inheritedTimingHost = (element) => {
|
|
69
|
-
|
|
70
|
-
if (!parent || !element.hasAttribute("data-composition-id"))
|
|
68
|
+
if (!element.hasAttribute("data-composition-id"))
|
|
71
69
|
return null;
|
|
72
70
|
if (parseStartExpression(element.getAttribute("data-start")))
|
|
73
71
|
return null;
|
|
74
|
-
return
|
|
72
|
+
return element.parentElement?.closest(`[data-start], ${COMPOSITION_HOST_SELECTOR}`) ?? null;
|
|
75
73
|
};
|
|
76
74
|
const resolveCompositionOrigin = (compositionRoot, fallback) => compositionOriginSeconds(resolveStartForElementInternal(compositionRoot, fallback), inheritedTimingHost(compositionRoot) ?? compositionRoot);
|
|
77
75
|
const resolveHostOffsetForElement = (element, fallback) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hyperframes/core",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.206",
|
|
4
4
|
"description": "",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -269,6 +269,10 @@
|
|
|
269
269
|
"import": "./dist/runtime/clipWindow.js",
|
|
270
270
|
"types": "./dist/runtime/clipWindow.d.ts"
|
|
271
271
|
},
|
|
272
|
+
"./runtime/media-clock": {
|
|
273
|
+
"import": "./dist/runtime/mediaClock.js",
|
|
274
|
+
"types": "./dist/runtime/mediaClock.d.ts"
|
|
275
|
+
},
|
|
272
276
|
"./runtime/clip-reveal": {
|
|
273
277
|
"import": "./dist/runtime/clipReveal.js",
|
|
274
278
|
"types": "./dist/runtime/clipReveal.d.ts"
|
|
@@ -289,6 +293,10 @@
|
|
|
289
293
|
"import": "./dist/compiler/htmlDocument.js",
|
|
290
294
|
"types": "./dist/compiler/htmlDocument.d.ts"
|
|
291
295
|
},
|
|
296
|
+
"./compiler/png-colour-tags": {
|
|
297
|
+
"import": "./dist/compiler/pngColourTags.js",
|
|
298
|
+
"types": "./dist/compiler/pngColourTags.d.ts"
|
|
299
|
+
},
|
|
292
300
|
"./runtime/position-edits": {
|
|
293
301
|
"import": "./dist/runtime/positionEdits.js",
|
|
294
302
|
"types": "./dist/runtime/positionEdits.d.ts"
|
|
@@ -401,9 +409,9 @@
|
|
|
401
409
|
"linkedom": "^0.18.12",
|
|
402
410
|
"postcss": "^8.5.8",
|
|
403
411
|
"wawoff2": "^2.0.1",
|
|
404
|
-
"@hyperframes/lint": "0.8.
|
|
405
|
-
"@hyperframes/studio-server": "0.8.
|
|
406
|
-
"@hyperframes/parsers": "0.8.
|
|
412
|
+
"@hyperframes/lint": "0.8.206",
|
|
413
|
+
"@hyperframes/studio-server": "0.8.206",
|
|
414
|
+
"@hyperframes/parsers": "0.8.206"
|
|
407
415
|
},
|
|
408
416
|
"devDependencies": {
|
|
409
417
|
"@fontsource/archivo-black": "^5.2.8",
|