@hyperframes/core 0.8.159 → 0.8.161

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 (63) hide show
  1. package/dist/adapters/gsap.d.ts +1 -1
  2. package/dist/adapters/index.d.ts +3 -3
  3. package/dist/audioAnalysis.d.ts +121 -0
  4. package/dist/audioAnalysis.js +466 -0
  5. package/dist/audioAnalysisLadder.d.ts +52 -0
  6. package/dist/audioAnalysisLadder.js +78 -0
  7. package/dist/audioCarve.js +1 -36
  8. package/dist/audioResample.d.ts +2 -0
  9. package/dist/audioResample.js +37 -0
  10. package/dist/audioRhythm.d.ts +48 -0
  11. package/dist/audioRhythm.js +407 -0
  12. package/dist/audioSections.d.ts +21 -0
  13. package/dist/audioSections.js +117 -0
  14. package/dist/audioSnap.d.ts +18 -0
  15. package/dist/audioSnap.js +41 -0
  16. package/dist/beats/beatDetection.d.ts +6 -8
  17. package/dist/beats/beatDetection.js +25 -217
  18. package/dist/colorGrading.d.ts +3 -3
  19. package/dist/compiler/htmlBundler.d.ts +2 -2
  20. package/dist/compiler/index.d.ts +19 -19
  21. package/dist/compiler/inlineSubCompositions.d.ts +4 -4
  22. package/dist/compiler/svgIdNamespacing.d.ts +1 -1
  23. package/dist/fft.d.ts +2 -0
  24. package/dist/fft.js +36 -0
  25. package/dist/figma/assetSnippet.d.ts +1 -1
  26. package/dist/figma/client.d.ts +1 -1
  27. package/dist/figma/emitTimelineScript.d.ts +1 -1
  28. package/dist/figma/index.d.ts +22 -22
  29. package/dist/figma/manifest.d.ts +1 -1
  30. package/dist/figma/motionContextToDocs.d.ts +1 -1
  31. package/dist/figma/motionEase.d.ts +1 -1
  32. package/dist/figma/motionToGsap.d.ts +1 -1
  33. package/dist/figma/nodeDocument.d.ts +1 -1
  34. package/dist/figma/nodeToHtml.d.ts +3 -3
  35. package/dist/figma/parseFigmaRef.d.ts +1 -1
  36. package/dist/figma/resolveBindings.d.ts +2 -2
  37. package/dist/figma/tokensToVariables.d.ts +2 -2
  38. package/dist/generated/runtime-inline.js +1 -1
  39. package/dist/generators/hyperframes.d.ts +1 -1
  40. package/dist/hyperframe.runtime.iife.js +55 -55
  41. package/dist/index.d.ts +37 -37
  42. package/dist/inline-scripts/hyperframe.d.ts +1 -1
  43. package/dist/projects.d.ts +1 -1
  44. package/dist/runtime/bridge.d.ts +2 -2
  45. package/dist/runtime/clipTree.d.ts +1 -1
  46. package/dist/runtime/compositionLength.d.ts +2 -2
  47. package/dist/runtime/media.d.ts +1 -0
  48. package/dist/runtime/media.js +35 -0
  49. package/dist/runtime/mediaVolumeEnvelope.d.ts +1 -1
  50. package/dist/runtime/playbackRate.d.ts +1 -1
  51. package/dist/runtime/startResolver.d.ts +3 -3
  52. package/dist/runtime/state.d.ts +3 -3
  53. package/dist/runtime/timeline.d.ts +2 -2
  54. package/dist/runtime/timelineDuration.d.ts +1 -1
  55. package/dist/runtime/types.d.ts +2 -2
  56. package/dist/runtime/validateVariables.d.ts +1 -1
  57. package/dist/templates/base.d.ts +1 -1
  58. package/dist/vfx/refs/displacementMap.d.ts +1 -1
  59. package/dist/vfx/refs/fractalNoise.d.ts +1 -1
  60. package/dist/vfx/refs/lumaMatte.d.ts +1 -1
  61. package/dist/vfx/refs/noise.d.ts +1 -1
  62. package/dist/vfx/refs/waveWarp.d.ts +1 -1
  63. package/package.json +9 -6
package/dist/index.d.ts CHANGED
@@ -1,49 +1,49 @@
1
1
  export type { RuntimeTimelineClipIdentity } from "./runtime/types.js";
2
- export type { ExecutionMode, Orientation, Asset, TimelineElement, TimelineElementBase, TimelineMediaElement, TimelineTextElement, TimelineCompositionElement, TimelineElementType, MediaElementType, CanvasResolution, Fps, FpsInput, FpsParseResult, MediaFile, CompositionAPI, PlayerAPI, AddElementData, ValidationResult, CompositionAsset, Keyframe, KeyframeProperties, ElementKeyframes, StageZoom, StageZoomKeyframe, CompositionVariableType, CompositionVariableBase, StringVariable, NumberVariable, ColorVariable, BooleanVariable, EnumVariable, CompositionVariable, CompositionSpec, WaveformData, OutputResolutionCompatibility, OutputResolutionIssueKind, } from "./core.types";
2
+ export type { ExecutionMode, Orientation, Asset, TimelineElement, TimelineElementBase, TimelineMediaElement, TimelineTextElement, TimelineCompositionElement, TimelineElementType, MediaElementType, CanvasResolution, Fps, FpsInput, FpsParseResult, MediaFile, CompositionAPI, PlayerAPI, AddElementData, ValidationResult, CompositionAsset, Keyframe, KeyframeProperties, ElementKeyframes, StageZoom, StageZoomKeyframe, CompositionVariableType, CompositionVariableBase, StringVariable, NumberVariable, ColorVariable, BooleanVariable, EnumVariable, CompositionVariable, CompositionSpec, WaveformData, OutputResolutionCompatibility, OutputResolutionIssueKind, } from "./core.types.js";
3
3
  export type { SlideshowManifest, SlideRef, SlideHotspot, SlideSequence, ResolvedSlide, ResolvedSlideSequence, ResolvedSlideshow, } from "./slideshow/index.js";
4
4
  export { parseSlideshowManifest, resolveSlideshow } from "./slideshow/index.js";
5
5
  export type { AuthoredTimingValue, RawAuthoredTiming, AuthoredTimingWindow, } from "./runtime/authoredTiming.js";
6
6
  export { resolveAuthoredTimingWindow } from "./runtime/authoredTiming.js";
7
- export { CANVAS_DIMENSIONS, VALID_CANVAS_RESOLUTIONS, normalizeResolutionFlag, isAspectAgnosticResolutionAlias, resolveResolutionFlagPair, checkOutputResolutionCompatibility, suggestMatchingPreset, parseFps, parseFpsWithDefault, toFps, fpsToNumber, fpsToFfmpegArg, TIMELINE_COLORS, DEFAULT_DURATIONS, COMPOSITION_VARIABLE_TYPES, isTextElement, isMediaElement, isCompositionElement, getDefaultStageZoom, } from "./core.types";
8
- export { generateBaseHtml, getStageStyles } from "./templates/base";
9
- export { GSAP_CDN, BASE_STYLES, ELEMENT_BASE_STYLES, MEDIA_STYLES, TEXT_STYLES, ZOOM_CONTAINER_STYLES, } from "./templates/constants";
7
+ export { CANVAS_DIMENSIONS, VALID_CANVAS_RESOLUTIONS, normalizeResolutionFlag, isAspectAgnosticResolutionAlias, resolveResolutionFlagPair, checkOutputResolutionCompatibility, suggestMatchingPreset, parseFps, parseFpsWithDefault, toFps, fpsToNumber, fpsToFfmpegArg, TIMELINE_COLORS, DEFAULT_DURATIONS, COMPOSITION_VARIABLE_TYPES, isTextElement, isMediaElement, isCompositionElement, getDefaultStageZoom, } from "./core.types.js";
8
+ export { generateBaseHtml, getStageStyles } from "./templates/base.js";
9
+ export { GSAP_CDN, BASE_STYLES, ELEMENT_BASE_STYLES, MEDIA_STYLES, TEXT_STYLES, ZOOM_CONTAINER_STYLES, } from "./templates/constants.js";
10
10
  export type { GsapAnimation, GsapMethod, ParsedGsap } from "@hyperframes/parsers";
11
11
  export { serializeGsapAnimations, getAnimationsForElementId, validateCompositionGsap, keyframesToGsapAnimations, gsapAnimationsToKeyframes, } from "@hyperframes/parsers";
12
12
  export type { ParsedHtml, CompositionMetadata } from "@hyperframes/parsers";
13
13
  export { parseHtml, updateElementInHtml, addElementToHtml, removeElementFromHtml, validateCompositionHtml, extractCompositionMetadata, } from "@hyperframes/parsers";
14
- export type { SerializeOptions } from "./generators/hyperframes";
15
- export { generateHyperframesHtml, generateGsapTimelineScript, generateHyperframesStyles, } from "./generators/hyperframes";
16
- export type { UnresolvedElement, ResolvedDuration, ResolvedMediaElement, CompilationResult, } from "./compiler/timingCompiler";
17
- export type { WordTiming, ElementAnchor, AuthoredTiming, ResolvedTiming, ResolveTimingsInput, ResolveTimingsResult, } from "./compiler/timingResolver";
18
- export { resolveTimings } from "./compiler/timingResolver";
19
- export { compileTimingAttrs, injectDurations, extractResolvedMedia, clampDurations, shouldClampMediaDuration, shouldClampResolvedMediaDuration, MEDIA_DURATION_CLAMP_EPSILON_SECONDS, } from "./compiler/timingCompiler";
20
- export { AUDIO_GROUP_RENDER_ID_ATTR, MEDIA_RENDER_ID_ATTR, assignMediaRenderIds, } from "./compiler/mediaRenderIds";
21
- export { RENDER_FRAME_ID_PREFIX, RENDER_FRAME_ID_SUFFIX, renderFrameIdForRenderId, } from "./runtime/renderFrameSibling";
22
- export { rewriteAssetPaths, rewriteAssetPath, rewriteCssAssetUrls, rewriteInlineStyleAssetUrls, } from "./compiler/rewriteSubCompPaths";
23
- export { CSS_URL_RE, isNonRelativeUrl, isPathInside } from "./compiler/assetPaths";
24
- export { checkSubCompositionUsability, type ParsableDocumentLike, type SubCompositionValidity, type SubCompositionValidityReason, } from "./compiler/subCompositionValidity";
25
- export { RUNTIME_BOOTSTRAP_ATTR, stripEmbeddedRuntimeScripts } from "./compiler/htmlDocument";
26
- export { COMPOSITION_SOURCE_URL } from "./compiler/scriptRuns";
27
- export { queryByAttr } from "./utils/cssSelector";
28
- export { AUDIBLE_MEDIA_SELECTOR, audibleVideoNeedsWebAudio, isAudibleVideoElement, } from "./audibleVideo";
29
- export { decodeUrlPathVariants } from "./utils/urlPath";
30
- export { clearGifFramesBeforeNext, gifClearsAfterLeavingFrameInPlace, parseAnimatedGifMetadata, type AnimatedGifMetadata, } from "./media/gif";
31
- export { HF_COLOR_GRADING_ATTR, HF_COLOR_GRADING_ADJUST_KEYS, HF_COLOR_GRADING_ACTIVE_EFFECT_KEYS, HF_COLOR_GRADING_ANIMATABLE_PROPERTIES, HF_COLOR_GRADING_CANVAS_ID_PREFIX, HF_COLOR_GRADING_COLOR_SPACE, HF_COLOR_GRADING_CURVE_KEYS, HF_COLOR_GRADING_DETAIL_KEYS, HF_COLOR_GRADING_EFFECT_APPLY_DEFAULTS, HF_COLOR_GRADING_EFFECT_KEYS, HF_COLOR_GRADING_EFFECT_PRESETS, HF_COLOR_GRADING_GRADE_PRESETS, HF_COLOR_GRADING_HUE_CURVE_KEYS, HF_COLOR_GRADING_LUT_KEYS, HF_COLOR_GRADING_PALETTES, HF_COLOR_GRADING_PRESETS, HF_COLOR_GRADING_TOP_LEVEL_KEYS, HF_COLOR_GRADING_WHEEL_KEYS, getHfColorGradingCapabilities, hasHfColorGradingAuthoredValues, isHfColorGradingActive, normalizeHfColorGrading, normalizeHfColorGradingWithVariables, resolveHfColorGradingVariables, serializeHfColorGrading, type HfColorGrading, type HfColorGradingAdjust, type HfColorGradingAdjustKey, type HfColorGradingAnimatablePath, type HfColorGradingActiveEffectKey, type HfColorGradingDetailKey, type HfColorGradingDetails, type HfColorGradingEffectKey, type HfColorGradingEffects, type HfColorGradingLutRef, type HfColorGradingPreset, type HfColorGradingPresetId, type HfColorGradingTarget, type HfColorGradingVariableMap, type HfColorGradingCapabilities, type HfColorGradingCurveKey, type HfColorGradingCurves, type HfColorGradingHueCurveKey, type HfColorGradingHueCurves, type HfColorGradingHueRange, type HfColorGradingSecondary, type HfColorGradingSecondaryCorrection, type HfColorGradingSoftRange, type HfColorGradingTonalWheel, type HfColorGradingWheelKey, type HfColorGradingWheels, type HfColorCurvePoint, type HfHueCurvePoint, type NormalizedHfColorGrading, type NormalizedHfColorGradingCurves, type NormalizedHfColorGradingHueCurves, type NormalizedHfColorGradingSecondary, type NormalizedHfColorGradingWheels, type ResolvedHfColorGrading, } from "./colorGrading";
32
- export { parseCubeLut, CubeLutParseError, type ParseCubeLutOptions } from "./colorLuts";
33
- export { firstFrameColourArgs, hdrToSdrToneMapFilter, parseFirstFrameColour, type ToneMapSourceColour, } from "./hdrToneMap";
34
- export { PREVIEW_PROXY_BOX_PARAM, formatPreviewProxyBox, parsePreviewProxyBox, type PreviewProxyBox, } from "./previewProxyBox";
35
- export { HYPERFRAME_RUNTIME_ARTIFACTS, HYPERFRAME_RUNTIME_CONTRACT, loadHyperframeRuntimeSource, type HyperframeRuntimeContract, } from "./inline-scripts/hyperframe";
36
- export { HYPERFRAME_RUNTIME_GLOBALS, HYPERFRAME_BRIDGE_SOURCES, HYPERFRAME_CONTROL_ACTIONS, type HyperframeControlAction, } from "./inline-scripts/runtimeContract";
37
- export { getHyperframeRuntimeScript } from "./generated/runtime-inline";
38
- export { buildHyperframesRuntimeScript, type HyperframesRuntimeBuildOptions, } from "./inline-scripts/hyperframesRuntime.engine";
39
- export { MEDIA_VISUAL_STYLE_PROPERTIES, copyMediaVisualStyles, exportClipWindow, quantizeSeekTime, quantizeTimeToFrame, type MediaVisualStyleProperty, } from "./inline-scripts/parityContract";
40
- export { redactKnownPaths, redactTelemetryString } from "./telemetryRedaction";
41
- export { folderGone, isProjectRootMissing, isSafePath, mkdirWithinProject, ProjectRootMissingError, realpath, realProjectRoot, resolveWithinProject, } from "./safePath";
42
- export { isHyperframesProject, PROJECT_MARKER_FILES } from "./projectRule";
43
- export type { HyperframePickerApi, HyperframePickerBoundingBox, HyperframePickerElementInfo, } from "./inline-scripts/pickerApi";
44
- export type { FrameAdapter, FrameAdapterContext } from "./adapters/types";
45
- export type { GSAPTimelineLike, CreateGSAPFrameAdapterOptions } from "./adapters/gsap";
46
- export { createGSAPFrameAdapter } from "./adapters/gsap";
14
+ export type { SerializeOptions } from "./generators/hyperframes.js";
15
+ export { generateHyperframesHtml, generateGsapTimelineScript, generateHyperframesStyles, } from "./generators/hyperframes.js";
16
+ export type { UnresolvedElement, ResolvedDuration, ResolvedMediaElement, CompilationResult, } from "./compiler/timingCompiler.js";
17
+ export type { WordTiming, ElementAnchor, AuthoredTiming, ResolvedTiming, ResolveTimingsInput, ResolveTimingsResult, } from "./compiler/timingResolver.js";
18
+ export { resolveTimings } from "./compiler/timingResolver.js";
19
+ export { compileTimingAttrs, injectDurations, extractResolvedMedia, clampDurations, shouldClampMediaDuration, shouldClampResolvedMediaDuration, MEDIA_DURATION_CLAMP_EPSILON_SECONDS, } from "./compiler/timingCompiler.js";
20
+ export { AUDIO_GROUP_RENDER_ID_ATTR, MEDIA_RENDER_ID_ATTR, assignMediaRenderIds, } from "./compiler/mediaRenderIds.js";
21
+ export { RENDER_FRAME_ID_PREFIX, RENDER_FRAME_ID_SUFFIX, renderFrameIdForRenderId, } from "./runtime/renderFrameSibling.js";
22
+ export { rewriteAssetPaths, rewriteAssetPath, rewriteCssAssetUrls, rewriteInlineStyleAssetUrls, } from "./compiler/rewriteSubCompPaths.js";
23
+ export { CSS_URL_RE, isNonRelativeUrl, isPathInside } from "./compiler/assetPaths.js";
24
+ export { checkSubCompositionUsability, type ParsableDocumentLike, type SubCompositionValidity, type SubCompositionValidityReason, } from "./compiler/subCompositionValidity.js";
25
+ export { RUNTIME_BOOTSTRAP_ATTR, stripEmbeddedRuntimeScripts } from "./compiler/htmlDocument.js";
26
+ export { COMPOSITION_SOURCE_URL } from "./compiler/scriptRuns.js";
27
+ export { queryByAttr } from "./utils/cssSelector.js";
28
+ export { AUDIBLE_MEDIA_SELECTOR, audibleVideoNeedsWebAudio, isAudibleVideoElement, } from "./audibleVideo.js";
29
+ export { decodeUrlPathVariants } from "./utils/urlPath.js";
30
+ export { clearGifFramesBeforeNext, gifClearsAfterLeavingFrameInPlace, parseAnimatedGifMetadata, type AnimatedGifMetadata, } from "./media/gif.js";
31
+ export { HF_COLOR_GRADING_ATTR, HF_COLOR_GRADING_ADJUST_KEYS, HF_COLOR_GRADING_ACTIVE_EFFECT_KEYS, HF_COLOR_GRADING_ANIMATABLE_PROPERTIES, HF_COLOR_GRADING_CANVAS_ID_PREFIX, HF_COLOR_GRADING_COLOR_SPACE, HF_COLOR_GRADING_CURVE_KEYS, HF_COLOR_GRADING_DETAIL_KEYS, HF_COLOR_GRADING_EFFECT_APPLY_DEFAULTS, HF_COLOR_GRADING_EFFECT_KEYS, HF_COLOR_GRADING_EFFECT_PRESETS, HF_COLOR_GRADING_GRADE_PRESETS, HF_COLOR_GRADING_HUE_CURVE_KEYS, HF_COLOR_GRADING_LUT_KEYS, HF_COLOR_GRADING_PALETTES, HF_COLOR_GRADING_PRESETS, HF_COLOR_GRADING_TOP_LEVEL_KEYS, HF_COLOR_GRADING_WHEEL_KEYS, getHfColorGradingCapabilities, hasHfColorGradingAuthoredValues, isHfColorGradingActive, normalizeHfColorGrading, normalizeHfColorGradingWithVariables, resolveHfColorGradingVariables, serializeHfColorGrading, type HfColorGrading, type HfColorGradingAdjust, type HfColorGradingAdjustKey, type HfColorGradingAnimatablePath, type HfColorGradingActiveEffectKey, type HfColorGradingDetailKey, type HfColorGradingDetails, type HfColorGradingEffectKey, type HfColorGradingEffects, type HfColorGradingLutRef, type HfColorGradingPreset, type HfColorGradingPresetId, type HfColorGradingTarget, type HfColorGradingVariableMap, type HfColorGradingCapabilities, type HfColorGradingCurveKey, type HfColorGradingCurves, type HfColorGradingHueCurveKey, type HfColorGradingHueCurves, type HfColorGradingHueRange, type HfColorGradingSecondary, type HfColorGradingSecondaryCorrection, type HfColorGradingSoftRange, type HfColorGradingTonalWheel, type HfColorGradingWheelKey, type HfColorGradingWheels, type HfColorCurvePoint, type HfHueCurvePoint, type NormalizedHfColorGrading, type NormalizedHfColorGradingCurves, type NormalizedHfColorGradingHueCurves, type NormalizedHfColorGradingSecondary, type NormalizedHfColorGradingWheels, type ResolvedHfColorGrading, } from "./colorGrading.js";
32
+ export { parseCubeLut, CubeLutParseError, type ParseCubeLutOptions } from "./colorLuts.js";
33
+ export { firstFrameColourArgs, hdrToSdrToneMapFilter, parseFirstFrameColour, type ToneMapSourceColour, } from "./hdrToneMap.js";
34
+ export { PREVIEW_PROXY_BOX_PARAM, formatPreviewProxyBox, parsePreviewProxyBox, type PreviewProxyBox, } from "./previewProxyBox.js";
35
+ export { HYPERFRAME_RUNTIME_ARTIFACTS, HYPERFRAME_RUNTIME_CONTRACT, loadHyperframeRuntimeSource, type HyperframeRuntimeContract, } from "./inline-scripts/hyperframe.js";
36
+ export { HYPERFRAME_RUNTIME_GLOBALS, HYPERFRAME_BRIDGE_SOURCES, HYPERFRAME_CONTROL_ACTIONS, type HyperframeControlAction, } from "./inline-scripts/runtimeContract.js";
37
+ export { getHyperframeRuntimeScript } from "./generated/runtime-inline.js";
38
+ export { buildHyperframesRuntimeScript, type HyperframesRuntimeBuildOptions, } from "./inline-scripts/hyperframesRuntime.engine.js";
39
+ export { MEDIA_VISUAL_STYLE_PROPERTIES, copyMediaVisualStyles, exportClipWindow, quantizeSeekTime, quantizeTimeToFrame, type MediaVisualStyleProperty, } from "./inline-scripts/parityContract.js";
40
+ export { redactKnownPaths, redactTelemetryString } from "./telemetryRedaction.js";
41
+ export { folderGone, isProjectRootMissing, isSafePath, mkdirWithinProject, ProjectRootMissingError, realpath, realProjectRoot, resolveWithinProject, } from "./safePath.js";
42
+ export { isHyperframesProject, PROJECT_MARKER_FILES } from "./projectRule.js";
43
+ export type { HyperframePickerApi, HyperframePickerBoundingBox, HyperframePickerElementInfo, } from "./inline-scripts/pickerApi.js";
44
+ export type { FrameAdapter, FrameAdapterContext } from "./adapters/types.js";
45
+ export type { GSAPTimelineLike, CreateGSAPFrameAdapterOptions } from "./adapters/gsap.js";
46
+ export { createGSAPFrameAdapter } from "./adapters/gsap.js";
47
47
  export { fitTextFontSize } from "./text/index.js";
48
48
  export type { FitTextOptions, FitTextResult } from "./text/index.js";
49
49
  export { formatRenderOutputTimestamp } from "./utils/renderOutputTimestamp.js";
@@ -1,4 +1,4 @@
1
- import { HYPERFRAME_BRIDGE_SOURCES, HYPERFRAME_RUNTIME_GLOBALS } from "./runtimeContract";
1
+ import { HYPERFRAME_BRIDGE_SOURCES, HYPERFRAME_RUNTIME_GLOBALS } from "./runtimeContract.js";
2
2
  export declare const HYPERFRAME_RUNTIME_ARTIFACTS: {
3
3
  readonly iife: "hyperframe.runtime.iife.js";
4
4
  readonly esm: "hyperframe.runtime.mjs";
@@ -1,4 +1,4 @@
1
- import { isHyperframesProject, PROJECT_MARKER_FILES } from "./projectRule";
1
+ import { isHyperframesProject, PROJECT_MARKER_FILES } from "./projectRule.js";
2
2
  export { isHyperframesProject, PROJECT_MARKER_FILES };
3
3
  export interface FoundProject {
4
4
  path: string;
@@ -1,5 +1,5 @@
1
- import type { HfColorGradingTarget } from "../colorGrading";
2
- import type { RuntimeOutboundMessage } from "./types";
1
+ import type { HfColorGradingTarget } from "../colorGrading.js";
2
+ import type { RuntimeOutboundMessage } from "./types.js";
3
3
  type BridgeDeps = {
4
4
  onPlay: () => void;
5
5
  onPause: () => void;
@@ -9,7 +9,7 @@
9
9
  * (id/parentId/children) plus the backing element. Add fields (label, kind,
10
10
  * absolute start) when a caller needs them.
11
11
  */
12
- import type { RuntimeTimelineLike } from "./types";
12
+ import type { RuntimeTimelineLike } from "./types.js";
13
13
  export interface ClipNode {
14
14
  readonly id: string;
15
15
  readonly element: Element;
@@ -1,6 +1,6 @@
1
1
  import { type CompositionDurationResult } from "@hyperframes/parsers/composition-duration";
2
- import { findRootCompositionElement } from "./compositionDimension";
3
- import { createRuntimeStartTimeResolver } from "./startResolver";
2
+ import { findRootCompositionElement } from "./compositionDimension.js";
3
+ import { createRuntimeStartTimeResolver } from "./startResolver.js";
4
4
  export { findRootCompositionElement };
5
5
  export declare const LOOP_INFLATED_TIMELINE_SECONDS = 7200;
6
6
  /** One frame at 60 fps: a timeline, floor or fallback this short or shorter is no length at all. */
@@ -80,6 +80,7 @@ export declare function evictMediaSyncState(el: HTMLMediaElement): void;
80
80
  /** Test-only seam: whether any per-source sync state is still tracked for `el`. */
81
81
  export declare function hasMediaSyncStateForTest(el: HTMLMediaElement): boolean;
82
82
  export declare const MEDIA_HARD_SYNC_SECONDS = 0.5;
83
+ export declare const VIDEO_PRESEEK_SECONDS = 1.5;
83
84
  /** Drift a playing audio element may carry before sync pulls it back onto the playhead. */
84
85
  export declare const MEDIA_SYNC_TOLERANCE_SECONDS = 0.04;
85
86
  export declare function syncRuntimeMedia(params: {
@@ -191,6 +191,40 @@ export function hasMediaSyncStateForTest(el) {
191
191
  videoSteering.has(el));
192
192
  }
193
193
  export const MEDIA_HARD_SYNC_SECONDS = 0.5;
194
+ export const VIDEO_PRESEEK_SECONDS = 1.5;
195
+ function prepareUpcomingVideo(clip, time, playing, rate) {
196
+ const { el } = clip;
197
+ const dueIn = clip.start - time;
198
+ if (!playing ||
199
+ el.tagName !== "VIDEO" ||
200
+ dueIn <= 0 ||
201
+ dueIn > VIDEO_PRESEEK_SECONDS * rate ||
202
+ !el.paused ||
203
+ el.seeking ||
204
+ el.readyState < el.HAVE_METADATA ||
205
+ findInjectedRenderFrame(el) ||
206
+ ("__HF_EXPORT_RENDER_SEEK_CONFIG" in window && window.__HF_EXPORT_RENDER_SEEK_CONFIG))
207
+ return;
208
+ let target = clip.mediaStart +
209
+ sourceTimeAt(clip.rate ?? clip.playbackRate, clip.start - (clip.origin ?? clip.start));
210
+ if (clip.sourceDuration != null) {
211
+ const loopLength = clip.sourceDuration - clip.mediaStart;
212
+ if (clip.loop && loopLength > 0 && target >= clip.sourceDuration)
213
+ target = clip.mediaStart + ((target - clip.mediaStart) % loopLength);
214
+ else if (!clip.loop)
215
+ target = Math.min(target, clip.sourceDuration);
216
+ }
217
+ if (!Number.isFinite(target) || target < 0 || Math.abs(el.currentTime - target) <= 0.001)
218
+ return;
219
+ try {
220
+ // A trimmed video exposed during its in-point seek has no current frame at the cut.
221
+ // Hidden preparation must not hold the visible-frame seek barrier.
222
+ el.currentTime = target;
223
+ }
224
+ catch (err) {
225
+ swallow("runtime.media.preseek", err);
226
+ }
227
+ }
194
228
  /** Drift a playing audio element may carry before sync pulls it back onto the playhead. */
195
229
  export const MEDIA_SYNC_TOLERANCE_SECONDS = 0.04;
196
230
  // Chromium refuses a slower playbackRate (NotSupportedError).
@@ -535,5 +569,6 @@ export function syncRuntimeMedia(params) {
535
569
  lastRelativeTime.set(el, relTime);
536
570
  if (!el.paused)
537
571
  el.pause();
572
+ prepareUpcomingVideo(clip, params.timeSeconds, params.playing, params.playbackRate);
538
573
  }
539
574
  }
@@ -1,4 +1,4 @@
1
- import type { RuntimeTimelineLike } from "./types";
1
+ import type { RuntimeTimelineLike } from "./types.js";
2
2
  /**
3
3
  * Shared volume-automation utilities used by both the renderer (offline PCM
4
4
  * baking in audioVolumeEnvelope.ts) and the preview runtime (per-tick gain
@@ -1,5 +1,5 @@
1
1
  import { clampPlaybackRate } from "@hyperframes/parsers/media-duration";
2
- import { type RateSpec } from "../speedRamp";
2
+ import { type RateSpec } from "../speedRamp.js";
3
3
  export declare const normalizePlaybackRate: typeof clampPlaybackRate;
4
4
  /** Parse a literal numeric timing attribute without accepting trailing units or garbage. */
5
5
  export declare function parseStrictFiniteTimingNumber(raw: string | null | undefined): number | null;
@@ -1,5 +1,5 @@
1
- import type { RuntimeTimelineLike } from "./types";
2
- import { type HostSlot } from "../mediaTiming";
1
+ import type { RuntimeTimelineLike } from "./types.js";
2
+ import { type HostSlot } from "../mediaTiming.js";
3
3
  export declare function createRuntimeStartTimeResolver(params: {
4
4
  timelineRegistry?: Record<string, Pick<RuntimeTimelineLike, "duration"> | undefined>;
5
5
  includeAuthoredTimingAttrs?: boolean;
@@ -18,4 +18,4 @@ export declare function createRuntimeStartTimeResolver(params: {
18
18
  resolveHostSlotsForElement: (element: Element) => HostSlot[];
19
19
  isRootGlobalMediaStartForElement: (element: Element) => boolean;
20
20
  };
21
- export type { RuntimeTimelineLike } from "./types";
21
+ export type { RuntimeTimelineLike } from "./types.js";
@@ -1,6 +1,6 @@
1
- import type { RuntimeDeterministicAdapter, RuntimeTimelineLike } from "./types";
2
- import type { RuntimeMediaClip } from "./media";
3
- import type { TransportClock } from "./clock";
1
+ import type { RuntimeDeterministicAdapter, RuntimeTimelineLike } from "./types.js";
2
+ import type { RuntimeMediaClip } from "./media.js";
3
+ import type { TransportClock } from "./clock.js";
4
4
  export type RuntimeState = {
5
5
  capturedTimeline: RuntimeTimelineLike | null;
6
6
  isPlaying: boolean;
@@ -1,5 +1,5 @@
1
- import type { RuntimeTimelineMessage, RuntimeTimelineLike } from "./types";
2
- import { createRuntimeStartTimeResolver } from "./startResolver";
1
+ import type { RuntimeTimelineMessage, RuntimeTimelineLike } from "./types.js";
2
+ import { createRuntimeStartTimeResolver } from "./startResolver.js";
3
3
  export declare function isRuntimeElementVisibleAt(rawNode: HTMLElement, options: {
4
4
  currentTime: number;
5
5
  compositionDuration: number;
@@ -1,3 +1,3 @@
1
- import type { RuntimeTimelineLike } from "./types";
1
+ import type { RuntimeTimelineLike } from "./types.js";
2
2
  /** A registered timeline's finite duration(); a partial, throwing or non-numeric entry reads as null. */
3
3
  export declare function readTimelineDurationSeconds(timeline: Pick<RuntimeTimelineLike, "duration"> | null | undefined): number | null;
@@ -1,5 +1,5 @@
1
- import type { HfColorGradingTarget } from "../colorGrading";
2
- import type { RuntimeAnalyticsEvent } from "./analytics";
1
+ import type { HfColorGradingTarget } from "../colorGrading.js";
2
+ import type { RuntimeAnalyticsEvent } from "./analytics.js";
3
3
  export type RuntimeJson = string | number | boolean | null | RuntimeJson[] | {
4
4
  [key: string]: RuntimeJson;
5
5
  };
@@ -1,4 +1,4 @@
1
- import type { CompositionVariable } from "../core.types";
1
+ import type { CompositionVariable } from "../core.types.js";
2
2
  export type VariableValidationIssue = {
3
3
  kind: "undeclared";
4
4
  variableId: string;
@@ -1,3 +1,3 @@
1
- import { type CanvasResolution } from "../core.types";
1
+ import { type CanvasResolution } from "../core.types.js";
2
2
  export declare function generateBaseHtml(resolution?: CanvasResolution): string;
3
3
  export declare function getStageStyles(resolution?: CanvasResolution): string;
@@ -10,7 +10,7 @@
10
10
  * rather than being implied. Its values are **premultiplied**, matching the
11
11
  * capture texture the runtime uploads.
12
12
  */
13
- import { type HfVfxParamValues } from "../../vfx";
13
+ import { type HfVfxParamValues } from "../../vfx.js";
14
14
  export interface MapTexel {
15
15
  r: number;
16
16
  g: number;
@@ -10,7 +10,7 @@
10
10
  * shader samples fragment centres, so a caller comparing against pixel
11
11
  * `(i, j)` should pass `(i + 0.5, j + 0.5)`.
12
12
  */
13
- import { type HfVfxParamValues } from "../../vfx";
13
+ import { type HfVfxParamValues } from "../../vfx.js";
14
14
  /**
15
15
  * The shader's `hfHashUnit`. `Math.imul` + `>>> 0` reproduce GLSL's 32-bit
16
16
  * `uint` wrap-around exactly; without them JS would carry the products into
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * Both texels are **premultiplied**, matching the textures the runtime uploads.
8
8
  */
9
- import { type HfVfxParamValues } from "../../vfx";
9
+ import { type HfVfxParamValues } from "../../vfx.js";
10
10
  export interface Rgba {
11
11
  r: number;
12
12
  g: number;
@@ -8,7 +8,7 @@
8
8
  * the entirety of what the kernel computes, and the add-and-clip around it is
9
9
  * two lines a caller can apply itself.
10
10
  */
11
- import { type HfVfxParamValues } from "../../vfx";
11
+ import { type HfVfxParamValues } from "../../vfx.js";
12
12
  /** The hash's 15-bit output byte for one channel index `a`. */
13
13
  export declare function noiseByteRef(a: number, y: number, seed: number): number;
14
14
  /**
@@ -7,7 +7,7 @@
7
7
  * Coordinates are device pixels with y measured from the bottom — the shader's
8
8
  * `v_uv * u_size`, and the order `gl.readPixels` returns rows in.
9
9
  */
10
- import { type HfVfxParamValues } from "../../vfx";
10
+ import { type HfVfxParamValues } from "../../vfx.js";
11
11
  /** Where the kernel reads from to paint `(x, y)`, in the same pixel space. */
12
12
  export declare function waveWarpSampleRef(p: {
13
13
  x: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperframes/core",
3
- "version": "0.8.159",
3
+ "version": "0.8.161",
4
4
  "description": "",
5
5
  "repository": {
6
6
  "type": "git",
@@ -184,6 +184,10 @@
184
184
  "import": "./dist/audibleVideo.js",
185
185
  "types": "./dist/audibleVideo.d.ts"
186
186
  },
187
+ "./audio-analysis": {
188
+ "import": "./dist/audioAnalysis.js",
189
+ "types": "./dist/audioAnalysis.d.ts"
190
+ },
187
191
  "./audio-gain": {
188
192
  "import": "./dist/audioGain.js",
189
193
  "types": "./dist/audioGain.d.ts"
@@ -370,13 +374,12 @@
370
374
  "dependencies": {
371
375
  "@chenglou/pretext": "^0.0.5",
372
376
  "acorn": "^8.17.0",
373
- "bpm-detective": "^2.0.5",
374
377
  "linkedom": "^0.18.12",
375
378
  "postcss": "^8.5.8",
376
379
  "wawoff2": "^2.0.1",
377
- "@hyperframes/lint": "0.8.159",
378
- "@hyperframes/studio-server": "0.8.159",
379
- "@hyperframes/parsers": "0.8.159"
380
+ "@hyperframes/lint": "0.8.161",
381
+ "@hyperframes/studio-server": "0.8.161",
382
+ "@hyperframes/parsers": "0.8.161"
380
383
  },
381
384
  "devDependencies": {
382
385
  "@fontsource/archivo-black": "^5.2.8",
@@ -410,7 +413,7 @@
410
413
  "esbuild": "^0.25.12"
411
414
  },
412
415
  "scripts": {
413
- "build": "bun run build:fonts && bun run build:svg-selector-aliases && bun run build:hyperframes-runtime && bun run build:position-edits-render && bun run build:audio-fx-runtime && tsc && tsx scripts/rewrite-esm-extensions.ts",
416
+ "build": "bun run build:fonts && bun run build:svg-selector-aliases && bun run build:hyperframes-runtime && bun run build:position-edits-render && bun run build:audio-fx-runtime && tsc && node ../../scripts/rewrite-relative-import-extensions.mjs dist",
414
417
  "build:fonts": "node scripts/build-fonts.mjs",
415
418
  "test": "bun run check:position-edits-render && bun run check:svg-selector-aliases && bun run build:audio-fx-runtime && vitest run",
416
419
  "test:watch": "vitest",