remotion 4.0.468 → 4.0.470

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 (46) hide show
  1. package/dist/cjs/CompositionManager.d.ts +1 -0
  2. package/dist/cjs/Img.d.ts +34 -1
  3. package/dist/cjs/Img.js +70 -17
  4. package/dist/cjs/RemotionRoot.d.ts +1 -0
  5. package/dist/cjs/RemotionRoot.js +2 -2
  6. package/dist/cjs/Sequence.d.ts +4 -0
  7. package/dist/cjs/Sequence.js +5 -1
  8. package/dist/cjs/audio/AudioForPreview.js +1 -0
  9. package/dist/cjs/audio/shared-audio-tags.d.ts +2 -2
  10. package/dist/cjs/audio/shared-audio-tags.js +9 -1
  11. package/dist/cjs/audio/use-audio-context.d.ts +2 -1
  12. package/dist/cjs/audio/use-audio-context.js +7 -3
  13. package/dist/cjs/canvas-image/CanvasImage.d.ts +44 -1
  14. package/dist/cjs/canvas-image/CanvasImage.js +12 -12
  15. package/dist/cjs/canvas-image/props.d.ts +6 -1
  16. package/dist/cjs/effects/Solid.js +12 -7
  17. package/dist/cjs/effects/effect-types.d.ts +2 -2
  18. package/dist/cjs/effects/run-effect-chain.d.ts +1 -1
  19. package/dist/cjs/effects/run-effect-chain.js +15 -5
  20. package/dist/cjs/index.d.ts +10 -9
  21. package/dist/cjs/index.js +8 -11
  22. package/dist/cjs/internals.d.ts +14 -4
  23. package/dist/cjs/internals.js +4 -0
  24. package/dist/cjs/interpolate-colors.d.ts +4 -1
  25. package/dist/cjs/interpolate-colors.js +4 -3
  26. package/dist/cjs/interpolate-keyframed-status.d.ts +5 -0
  27. package/dist/cjs/interpolate-keyframed-status.js +58 -0
  28. package/dist/cjs/interpolate.d.ts +2 -0
  29. package/dist/cjs/interpolate.js +22 -4
  30. package/dist/cjs/no-react.d.ts +1 -1
  31. package/dist/cjs/no-react.js +2 -1
  32. package/dist/cjs/sequence-field-schema.d.ts +9 -1
  33. package/dist/cjs/truncate-src-for-label.d.ts +1 -0
  34. package/dist/cjs/truncate-src-for-label.js +11 -0
  35. package/dist/cjs/use-media-in-timeline.d.ts +2 -1
  36. package/dist/cjs/use-media-in-timeline.js +3 -1
  37. package/dist/cjs/use-schema.d.ts +20 -3
  38. package/dist/cjs/use-schema.js +21 -4
  39. package/dist/cjs/version.d.ts +1 -1
  40. package/dist/cjs/version.js +1 -1
  41. package/dist/cjs/video/VideoForPreview.js +1 -0
  42. package/dist/cjs/wrap-in-schema.js +5 -0
  43. package/dist/esm/index.mjs +7394 -7131
  44. package/dist/esm/no-react.mjs +18 -4
  45. package/dist/esm/version.mjs +1 -1
  46. package/package.json +2 -2
@@ -2,7 +2,7 @@ import { CanvasPool } from './canvas-pool.js';
2
2
  import type { EffectDefinition, EffectDefinitionAndStack } from './effect-types.js';
3
3
  export type EffectChainState = {
4
4
  pool: CanvasPool;
5
- setupCache: WeakMap<EffectDefinition<unknown, unknown>, unknown>;
5
+ setupCache: WeakMap<EffectDefinition<unknown, unknown>, WeakMap<HTMLCanvasElement, unknown>>;
6
6
  cleanupRegistry: Array<{
7
7
  definition: EffectDefinition<unknown, unknown>;
8
8
  state: unknown;
@@ -20,11 +20,16 @@ const cleanupEffectChainState = (state) => {
20
20
  exports.cleanupEffectChainState = cleanupEffectChainState;
21
21
  const ensureSetup = (state, def, target) => {
22
22
  const widened = def;
23
- if (state.setupCache.has(widened)) {
24
- return state.setupCache.get(widened);
23
+ let cacheForDefinition = state.setupCache.get(widened);
24
+ if (!cacheForDefinition) {
25
+ cacheForDefinition = new WeakMap();
26
+ state.setupCache.set(widened, cacheForDefinition);
27
+ }
28
+ if (cacheForDefinition.has(target)) {
29
+ return cacheForDefinition.get(target);
25
30
  }
26
31
  const setupState = def.setup(target);
27
- state.setupCache.set(widened, setupState);
32
+ cacheForDefinition.set(target, setupState);
28
33
  state.cleanupRegistry.push({ definition: widened, state: setupState });
29
34
  return setupState;
30
35
  };
@@ -68,7 +73,9 @@ const runEffectChain = async ({ state, source, effects, output, width, height, }
68
73
  if (isCancelled()) {
69
74
  return false;
70
75
  }
71
- // Raw component sources are 2D frame canvases (Gif, WrappedCanvas.canvas, …).
76
+ // Canvas sources are DOM-oriented. Flip them when uploading into WebGL so
77
+ // texture coordinates match clip-space output. `ImageBitmap` bridges below
78
+ // opt out because they are already oriented for upload.
72
79
  let flipWebGLSourceY = true;
73
80
  for (let runIndex = 0; runIndex < runs.length; runIndex++) {
74
81
  const run = runs[runIndex];
@@ -88,7 +95,10 @@ const runEffectChain = async ({ state, source, effects, output, width, height, }
88
95
  flipSourceY: run.backend === 'webgl2' ? flipWebGLSourceY : false,
89
96
  });
90
97
  if (run.backend === 'webgl2') {
91
- flipWebGLSourceY = false;
98
+ // Same-backend ping-pong passes feed the previous WebGL canvas back
99
+ // through `texImage2D()`. That source is still a DOM canvas, so the
100
+ // next upload also needs to be flipped.
101
+ flipWebGLSourceY = true;
92
102
  state.pool.assertContextNotLost(dst);
93
103
  }
94
104
  currentImage = dst;
@@ -55,7 +55,8 @@ declare global {
55
55
  remotion_envVariables: string;
56
56
  remotion_isMainTab: boolean;
57
57
  remotion_mediaCacheSizeInBytes: number | null;
58
- remotion_sampleRate: number;
58
+ remotion_sampleRate: number | null;
59
+ remotion_previewSampleRate: number | null;
59
60
  remotion_initialMemoryAvailable: number | null;
60
61
  remotion_collectAssets: () => TRenderAsset[];
61
62
  remotion_isPlayer: boolean;
@@ -92,20 +93,20 @@ export type BundleEvaluationState = {
92
93
  export type BundleState = BundleIndexState | BundleEvaluationState | BundleCompositionState;
93
94
  export * from './AbsoluteFill.js';
94
95
  export * from './animated-image/index.js';
95
- export type { EffectDefinitionAndStack, EffectDescriptor, EffectsProp, EffectDefinition, EffectFactory, } from './effects/index.js';
96
+ export type { EffectDefinition, EffectDefinitionAndStack, EffectDescriptor, EffectFactory, EffectsProp, } from './effects/index.js';
96
97
  /**
97
98
  * @description Renders a solid-color rectangle on a `<canvas>`.
98
99
  * @see [Documentation](https://www.remotion.dev/docs/solid)
99
100
  */
100
- export { Solid } from './effects/Solid.js';
101
- export type { SolidProps } from './effects/Solid.js';
102
- export { HtmlInCanvas, HTML_IN_CANVAS_UNSUPPORTED_MESSAGE, isHtmlInCanvasSupported, type HtmlInCanvasOnInit, type HtmlInCanvasOnInitCleanup, type HtmlInCanvasOnPaint, } from './HtmlInCanvas.js';
103
- export type { HtmlInCanvasOnPaintParams, HtmlInCanvasProps, } from './HtmlInCanvas.js';
104
101
  export type { AnyZodObject } from './any-zod-type.js';
105
102
  export { Artifact } from './Artifact.js';
106
103
  export { Audio, Html5Audio, RemotionAudioProps } from './audio/index.js';
107
104
  export type { LoopVolumeCurveBehavior } from './audio/use-audio-frame.js';
108
105
  export { cancelRender } from './cancel-render.js';
106
+ export { Solid } from './effects/Solid.js';
107
+ export type { SolidProps } from './effects/Solid.js';
108
+ export { HTML_IN_CANVAS_UNSUPPORTED_MESSAGE, HtmlInCanvas, isHtmlInCanvasSupported, type HtmlInCanvasOnInit, type HtmlInCanvasOnInitCleanup, type HtmlInCanvasOnPaint, } from './HtmlInCanvas.js';
109
+ export type { HtmlInCanvasOnPaintParams, HtmlInCanvasProps, } from './HtmlInCanvas.js';
109
110
  /**
110
111
  * @description Renders a static image to a `<canvas>` and applies Remotion effects.
111
112
  * @see [Documentation](https://www.remotion.dev/docs/canvasimage)
@@ -121,16 +122,16 @@ export { DownloadBehavior } from './download-behavior.js';
121
122
  export * from './easing.js';
122
123
  export * from './Folder.js';
123
124
  export * from './freeze.js';
124
- export type { NonceHistory } from './nonce.js';
125
125
  export { getRemotionEnvironment } from './get-remotion-environment.js';
126
126
  export { getStaticFiles, StaticFile } from './get-static-files.js';
127
127
  export * from './IFrame.js';
128
128
  export { Img, ImgProps } from './Img.js';
129
129
  export * from './internals.js';
130
- export { interpolateColors } from './interpolate-colors.js';
130
+ export { interpolateColors, type InterpolateColorsOptions, } from './interpolate-colors.js';
131
131
  export { LogLevel } from './log.js';
132
132
  export { Loop } from './loop/index.js';
133
- export { assertValidInterpolateEasingOption, EasingFunction, ExtrapolateType, interpolate, InterpolateOptions, random, RandomSeed, } from './no-react';
133
+ export { assertValidInterpolateEasingOption, assertValidInterpolatePosterizeOption, EasingFunction, ExtrapolateType, interpolate, InterpolateOptions, random, RandomSeed, } from './no-react';
134
+ export type { NonceHistory } from './nonce.js';
134
135
  export { prefetch, PrefetchOnProgress } from './prefetch.js';
135
136
  export { registerRoot } from './register-root.js';
136
137
  export type { PixelFormat, VideoImageFormat } from './render-types.js';
package/dist/cjs/index.js CHANGED
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.Config = exports.Experimental = exports.watchStaticFile = exports.MediaPlaybackError = exports.Video = exports.OffthreadVideo = exports.Html5Video = exports.useRemotionEnvironment = exports.useDelayRender = exports.useCurrentScale = exports.useCurrentFrame = exports.useBufferState = exports.staticFile = exports.Series = exports.Sequence = exports.registerRoot = exports.prefetch = exports.random = exports.interpolate = exports.assertValidInterpolateEasingOption = exports.Loop = exports.interpolateColors = exports.Img = exports.getStaticFiles = exports.getRemotionEnvironment = exports.delayRender = exports.continueRender = exports.getInputProps = exports.Composition = exports.CanvasImage = exports.cancelRender = exports.Html5Audio = exports.Audio = exports.Artifact = exports.isHtmlInCanvasSupported = exports.HTML_IN_CANVAS_UNSUPPORTED_MESSAGE = exports.HtmlInCanvas = exports.Solid = void 0;
17
+ exports.Config = exports.Experimental = exports.watchStaticFile = exports.MediaPlaybackError = exports.Video = exports.OffthreadVideo = exports.Html5Video = exports.useRemotionEnvironment = exports.useDelayRender = exports.useCurrentScale = exports.useCurrentFrame = exports.useBufferState = exports.staticFile = exports.Series = exports.Sequence = exports.registerRoot = exports.prefetch = exports.random = exports.interpolate = exports.assertValidInterpolatePosterizeOption = exports.assertValidInterpolateEasingOption = exports.Loop = exports.interpolateColors = exports.Img = exports.getStaticFiles = exports.getRemotionEnvironment = exports.delayRender = exports.continueRender = exports.getInputProps = exports.Composition = exports.CanvasImage = exports.isHtmlInCanvasSupported = exports.HtmlInCanvas = exports.HTML_IN_CANVAS_UNSUPPORTED_MESSAGE = exports.Solid = exports.cancelRender = exports.Html5Audio = exports.Audio = exports.Artifact = void 0;
18
18
  require("./_check-rsc.js");
19
19
  require("./asset-types.js");
20
20
  const Clipper_js_1 = require("./Clipper.js");
@@ -27,16 +27,6 @@ const Sequence_js_1 = require("./Sequence.js");
27
27
  (0, multiple_versions_warning_js_1.checkMultipleRemotionVersions)();
28
28
  __exportStar(require("./AbsoluteFill.js"), exports);
29
29
  __exportStar(require("./animated-image/index.js"), exports);
30
- /**
31
- * @description Renders a solid-color rectangle on a `<canvas>`.
32
- * @see [Documentation](https://www.remotion.dev/docs/solid)
33
- */
34
- var Solid_js_1 = require("./effects/Solid.js");
35
- Object.defineProperty(exports, "Solid", { enumerable: true, get: function () { return Solid_js_1.Solid; } });
36
- var HtmlInCanvas_js_1 = require("./HtmlInCanvas.js");
37
- Object.defineProperty(exports, "HtmlInCanvas", { enumerable: true, get: function () { return HtmlInCanvas_js_1.HtmlInCanvas; } });
38
- Object.defineProperty(exports, "HTML_IN_CANVAS_UNSUPPORTED_MESSAGE", { enumerable: true, get: function () { return HtmlInCanvas_js_1.HTML_IN_CANVAS_UNSUPPORTED_MESSAGE; } });
39
- Object.defineProperty(exports, "isHtmlInCanvasSupported", { enumerable: true, get: function () { return HtmlInCanvas_js_1.isHtmlInCanvasSupported; } });
40
30
  var Artifact_js_1 = require("./Artifact.js");
41
31
  Object.defineProperty(exports, "Artifact", { enumerable: true, get: function () { return Artifact_js_1.Artifact; } });
42
32
  var index_js_1 = require("./audio/index.js");
@@ -44,6 +34,12 @@ Object.defineProperty(exports, "Audio", { enumerable: true, get: function () { r
44
34
  Object.defineProperty(exports, "Html5Audio", { enumerable: true, get: function () { return index_js_1.Html5Audio; } });
45
35
  var cancel_render_js_1 = require("./cancel-render.js");
46
36
  Object.defineProperty(exports, "cancelRender", { enumerable: true, get: function () { return cancel_render_js_1.cancelRender; } });
37
+ var Solid_js_1 = require("./effects/Solid.js");
38
+ Object.defineProperty(exports, "Solid", { enumerable: true, get: function () { return Solid_js_1.Solid; } });
39
+ var HtmlInCanvas_js_1 = require("./HtmlInCanvas.js");
40
+ Object.defineProperty(exports, "HTML_IN_CANVAS_UNSUPPORTED_MESSAGE", { enumerable: true, get: function () { return HtmlInCanvas_js_1.HTML_IN_CANVAS_UNSUPPORTED_MESSAGE; } });
41
+ Object.defineProperty(exports, "HtmlInCanvas", { enumerable: true, get: function () { return HtmlInCanvas_js_1.HtmlInCanvas; } });
42
+ Object.defineProperty(exports, "isHtmlInCanvasSupported", { enumerable: true, get: function () { return HtmlInCanvas_js_1.isHtmlInCanvasSupported; } });
47
43
  /**
48
44
  * @description Renders a static image to a `<canvas>` and applies Remotion effects.
49
45
  * @see [Documentation](https://www.remotion.dev/docs/canvasimage)
@@ -74,6 +70,7 @@ var index_js_3 = require("./loop/index.js");
74
70
  Object.defineProperty(exports, "Loop", { enumerable: true, get: function () { return index_js_3.Loop; } });
75
71
  var no_react_1 = require("./no-react");
76
72
  Object.defineProperty(exports, "assertValidInterpolateEasingOption", { enumerable: true, get: function () { return no_react_1.assertValidInterpolateEasingOption; } });
73
+ Object.defineProperty(exports, "assertValidInterpolatePosterizeOption", { enumerable: true, get: function () { return no_react_1.assertValidInterpolatePosterizeOption; } });
77
74
  Object.defineProperty(exports, "interpolate", { enumerable: true, get: function () { return no_react_1.interpolate; } });
78
75
  Object.defineProperty(exports, "random", { enumerable: true, get: function () { return no_react_1.random; } });
79
76
  var prefetch_js_1 = require("./prefetch.js");
@@ -18,7 +18,7 @@ import { type CanUpdateEffectPropsResponse, type CanUpdateEffectPropsResponseFal
18
18
  import * as TimelinePosition from './timeline-position-state.js';
19
19
  import { type PlaybackRateContextValue, type SetTimelineContextValue, type TimelineContextValue } from './TimelineContext.js';
20
20
  import { truthy } from './truthy.js';
21
- import type { CanUpdateSequencePropStatusFalse, CanUpdateSequencePropStatusTrue, GetCodeValues, GetDragOverrides, GetEffectCodeValues, GetEffectDragOverrides } from './use-schema.js';
21
+ import type { CanUpdateSequencePropStatusFalse, CanUpdateSequencePropStatusKeyframed, CanUpdateSequencePropStatusTrue, GetCodeValues, GetDragOverrides, GetEffectCodeValues, GetEffectDragOverrides } from './use-schema.js';
22
22
  import { type CanUpdateSequencePropStatus, type CodeValues, type DragOverrides, type EffectDragOverrides } from './use-schema.js';
23
23
  import type { MediaVolumeContextValue, SetMediaVolumeContextValue } from './volume-position-state.js';
24
24
  import type { WatchRemotionStaticFilesPayload } from './watch-static-file.js';
@@ -253,6 +253,7 @@ export declare const Internals: {
253
253
  readonly numberOfAudioTags: number;
254
254
  readonly logLevel: import("./log.js").LogLevel;
255
255
  readonly audioLatencyHint: AudioContextLatencyCategory;
256
+ readonly previewSampleRate: number | null;
256
257
  readonly videoEnabled: boolean;
257
258
  readonly audioEnabled: boolean;
258
259
  readonly frameState: Record<string, number> | null;
@@ -270,7 +271,7 @@ export declare const Internals: {
270
271
  readonly getRoot: () => import("react").FC<{}> | null;
271
272
  readonly useMediaVolumeState: () => readonly [number, (u: number) => void];
272
273
  readonly useMediaMutedState: () => readonly [boolean, (u: React.SetStateAction<boolean>) => void];
273
- readonly useMediaInTimeline: ({ volume, mediaVolume, src, mediaType, playbackRate, displayName, id, getStack, showInTimeline, premountDisplay, postmountDisplay, loopDisplay, documentationLink, }: {
274
+ readonly useMediaInTimeline: ({ volume, mediaVolume, src, mediaType, playbackRate, displayName, id, getStack, showInTimeline, premountDisplay, postmountDisplay, loopDisplay, documentationLink, refForOutline, }: {
274
275
  volume: import("./volume-prop.js").VolumeProp | undefined;
275
276
  mediaVolume: number;
276
277
  src: string | undefined;
@@ -284,6 +285,7 @@ export declare const Internals: {
284
285
  postmountDisplay: number | null;
285
286
  loopDisplay: import("./CompositionManager.js").LoopDisplay | undefined;
286
287
  documentationLink: string | null;
288
+ refForOutline: React.RefObject<HTMLElement | null> | null;
287
289
  }) => void;
288
290
  readonly useLazyComponent: <Props>({ compProps, componentName, noSuspense, }: {
289
291
  compProps: CompProps<Props>;
@@ -320,6 +322,7 @@ export declare const Internals: {
320
322
  readonly children: React.ReactNode;
321
323
  readonly audioLatencyHint: AudioContextLatencyCategory;
322
324
  readonly audioEnabled: boolean;
325
+ readonly previewSampleRate: number | null;
323
326
  }>;
324
327
  readonly SharedAudioTagsContext: import("react").Context<{
325
328
  registerAudio: (options: {
@@ -622,6 +625,8 @@ export declare const Internals: {
622
625
  readonly useEffectChainState: () => {
623
626
  get: (width: number, height: number) => import("./effects/run-effect-chain.js").EffectChainState | null;
624
627
  };
628
+ readonly createEffectChainState: (width: number, height: number) => import("./effects/run-effect-chain.js").EffectChainState;
629
+ readonly cleanupEffectChainState: (state: import("./effects/run-effect-chain.js").EffectChainState) => void;
625
630
  readonly runEffectChain: ({ state, source, effects, output, width, height, }: import("./effects/run-effect-chain.js").RunEffectChainOptions) => Promise<boolean>;
626
631
  readonly useMemoizedEffects: ({ effects, overrideId, }: {
627
632
  effects: readonly import("./index.js").EffectDescriptor<unknown>[];
@@ -631,15 +636,20 @@ export declare const Internals: {
631
636
  readonly createEffect: <P, S>(definition: import("./index.js").EffectDefinition<P, S>) => import("./index.js").EffectFactory<P>;
632
637
  readonly createWebGLContextError: (effectName: string) => Error;
633
638
  readonly createWebGL2ContextError: (effectName: string) => Error;
634
- readonly computeEffectiveSchemaValuesDotNotation: ({ schema, currentValue, overrideValues, propStatus, }: {
639
+ readonly computeEffectiveSchemaValuesDotNotation: ({ schema, currentValue, overrideValues, propStatus, frame, }: {
635
640
  schema: SequenceSchema;
636
641
  currentValue: Record<string, unknown>;
637
642
  overrideValues: Record<string, unknown>;
638
643
  propStatus: Record<string, CanUpdateSequencePropStatus> | undefined;
644
+ frame: number | null;
639
645
  }) => {
640
646
  merged: Record<string, unknown>;
641
647
  propsToDelete: Set<string>;
642
648
  };
649
+ readonly interpolateKeyframedStatus: ({ frame, status, }: {
650
+ frame: number;
651
+ status: CanUpdateSequencePropStatusKeyframed;
652
+ }) => number | string | null;
643
653
  readonly OverrideIdsToNodePathsGettersContext: import("react").Context<OverrideToNodePathGetters>;
644
654
  readonly OverrideIdsToNodePathsSettersContext: import("react").Context<OverrideToNodeSetters>;
645
655
  readonly findPropsToDelete: ({ schema, key, value, }: {
@@ -665,4 +675,4 @@ export declare const Internals: {
665
675
  };
666
676
  readonly hiddenField: SequenceFieldSchema;
667
677
  };
668
- export type { CannotUpdateSequenceReason, CanUpdateEffectPropsResponse, CanUpdateEffectPropsResponseFalse, CanUpdateEffectPropsResponseTrue, CanUpdateSequencePropsResponse, CanUpdateSequencePropsResponseFalse, CanUpdateSequencePropsResponseTrue, CanUpdateSequencePropStatus, CanUpdateSequencePropStatusFalse, CanUpdateSequencePropStatusTrue, CodeValues, CompositionManagerContext, CompProps, DragOverrides, EffectDragOverrides, GetCodeValues, GetDragOverrides, GetEffectCodeValues, GetEffectDragOverrides, LoggingContextValue, MediaVolumeContextValue, NonceHistory, OverrideIdsToNodePathsGettersContext, OverrideIdsToNodePathsSettersContext, OverrideIdToNodePaths, OverrideToNodePathGetters, OverrideToNodeSetters, PlaybackRateContextValue, RemotionEnvironment, ResolvedStackLocation, ScheduleAudioNodeOptions, ScheduleAudioNodeResult, SequenceFieldSchema, SequenceNodePath, SequencePropsSubscriptionKey, SequenceSchema, SerializedJSONWithCustomFields, SetMediaVolumeContextValue, SetTimelineContextValue, TCompMetadata, TComposition, TimelineContextValue, TRenderAsset, TSequence, VisibleFieldSchema, WatchRemotionStaticFilesPayload, RemotionAudioContextState, };
678
+ export type { CannotUpdateSequenceReason, CanUpdateEffectPropsResponse, CanUpdateEffectPropsResponseFalse, CanUpdateEffectPropsResponseTrue, CanUpdateSequencePropsResponse, CanUpdateSequencePropsResponseFalse, CanUpdateSequencePropsResponseTrue, CanUpdateSequencePropStatus, CanUpdateSequencePropStatusFalse, CanUpdateSequencePropStatusKeyframed, CanUpdateSequencePropStatusTrue, CodeValues, CompositionManagerContext, CompProps, DragOverrides, EffectDragOverrides, GetCodeValues, GetDragOverrides, GetEffectCodeValues, GetEffectDragOverrides, LoggingContextValue, MediaVolumeContextValue, NonceHistory, OverrideIdsToNodePathsGettersContext, OverrideIdsToNodePathsSettersContext, OverrideIdToNodePaths, OverrideToNodePathGetters, OverrideToNodeSetters, PlaybackRateContextValue, RemotionAudioContextState, RemotionEnvironment, ResolvedStackLocation, ScheduleAudioNodeOptions, ScheduleAudioNodeResult, SequenceFieldSchema, SequenceNodePath, SequencePropsSubscriptionKey, SequenceSchema, SerializedJSONWithCustomFields, SetMediaVolumeContextValue, SetTimelineContextValue, TCompMetadata, TComposition, TimelineContextValue, TRenderAsset, TSequence, VisibleFieldSchema, WatchRemotionStaticFilesPayload, };
@@ -62,6 +62,7 @@ const get_effective_visual_mode_value_js_1 = require("./get-effective-visual-mod
62
62
  const get_preview_dom_element_js_1 = require("./get-preview-dom-element.js");
63
63
  const get_remotion_environment_js_1 = require("./get-remotion-environment.js");
64
64
  const input_props_override_js_1 = require("./input-props-override.js");
65
+ const interpolate_keyframed_status_js_1 = require("./interpolate-keyframed-status.js");
65
66
  const is_player_js_1 = require("./is-player.js");
66
67
  const log_level_context_js_1 = require("./log-level-context.js");
67
68
  const log_js_1 = require("./log.js");
@@ -230,6 +231,8 @@ exports.Internals = {
230
231
  getEffectiveVisualModeValue: get_effective_visual_mode_value_js_1.getEffectiveVisualModeValue,
231
232
  CompositionRenderErrorContext: composition_render_error_context_js_1.CompositionRenderErrorContext,
232
233
  useEffectChainState: use_effect_chain_state_js_1.useEffectChainState,
234
+ createEffectChainState: run_effect_chain_js_1.createEffectChainState,
235
+ cleanupEffectChainState: run_effect_chain_js_1.cleanupEffectChainState,
233
236
  runEffectChain: run_effect_chain_js_1.runEffectChain,
234
237
  useMemoizedEffects: use_memoized_effects_js_1.useMemoizedEffects,
235
238
  useMemoizedEffectDefinitions: use_memoized_effects_js_1.useMemoizedEffectDefinitions,
@@ -237,6 +240,7 @@ exports.Internals = {
237
240
  createWebGLContextError: webgl2_context_error_js_1.createWebGLContextError,
238
241
  createWebGL2ContextError: webgl2_context_error_js_1.createWebGL2ContextError,
239
242
  computeEffectiveSchemaValuesDotNotation: use_schema_js_1.computeEffectiveSchemaValuesDotNotation,
243
+ interpolateKeyframedStatus: interpolate_keyframed_status_js_1.interpolateKeyframedStatus,
240
244
  OverrideIdsToNodePathsGettersContext: sequence_node_path_js_1.OverrideIdsToNodePathsGettersContext,
241
245
  OverrideIdsToNodePathsSettersContext: sequence_node_path_js_1.OverrideIdsToNodePathsSettersContext,
242
246
  findPropsToDelete: find_props_to_delete_js_1.findPropsToDelete,
@@ -2,8 +2,11 @@
2
2
  * Copied from:
3
3
  * https://github.com/software-mansion/react-native-reanimated/blob/master/src/reanimated2/Colors.ts
4
4
  */
5
+ export type InterpolateColorsOptions = {
6
+ posterize: number | undefined;
7
+ };
5
8
  export declare const colorNames: {
6
9
  [key: string]: number;
7
10
  };
8
11
  export declare function processColor(color: string): number;
9
- export declare const interpolateColors: (input: number, inputRange: readonly number[], outputRange: readonly string[]) => string;
12
+ export declare const interpolateColors: (input: number, inputRange: readonly number[], outputRange: readonly string[], options?: InterpolateColorsOptions) => string;
@@ -536,11 +536,12 @@ function processColor(color) {
536
536
  const normalizedColor = normalizeColor(color);
537
537
  return ((normalizedColor << 24) | (normalizedColor >>> 8)) >>> 0; // argb
538
538
  }
539
- const interpolateColorsRGB = (value, inputRange, colors) => {
539
+ const interpolateColorsRGB = (value, inputRange, colors, options) => {
540
540
  const [r, g, b, a] = [red, green, blue, opacity].map((f) => {
541
541
  const unrounded = (0, interpolate_js_1.interpolate)(value, inputRange, colors.map((c) => f(c)), {
542
542
  extrapolateLeft: 'clamp',
543
543
  extrapolateRight: 'clamp',
544
+ posterize: options === null || options === void 0 ? void 0 : options.posterize,
544
545
  });
545
546
  if (f === opacity) {
546
547
  return Number(unrounded.toFixed(3));
@@ -553,7 +554,7 @@ const interpolateColorsRGB = (value, inputRange, colors) => {
553
554
  * @description Allows you to map a range of values to colors using a concise syntax.
554
555
  * @see [Documentation](https://remotion.dev/docs/interpolate-colors)
555
556
  */
556
- const interpolateColors = (input, inputRange, outputRange) => {
557
+ const interpolateColors = (input, inputRange, outputRange, options) => {
557
558
  if (typeof input === 'undefined') {
558
559
  throw new TypeError('input can not be undefined');
559
560
  }
@@ -571,6 +572,6 @@ const interpolateColors = (input, inputRange, outputRange) => {
571
572
  ' values provided) must have the same length');
572
573
  }
573
574
  const processedOutputRange = outputRange.map((c) => processColor(c));
574
- return interpolateColorsRGB(input, inputRange, processedOutputRange);
575
+ return interpolateColorsRGB(input, inputRange, processedOutputRange, options);
575
576
  };
576
577
  exports.interpolateColors = interpolateColors;
@@ -0,0 +1,5 @@
1
+ import type { CanUpdateSequencePropStatusKeyframed } from './use-schema.js';
2
+ export declare const interpolateKeyframedStatus: ({ frame, status, }: {
3
+ frame: number;
4
+ status: CanUpdateSequencePropStatusKeyframed;
5
+ }) => number | string | null;
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.interpolateKeyframedStatus = void 0;
4
+ const bezier_js_1 = require("./bezier.js");
5
+ const easing_js_1 = require("./easing.js");
6
+ const interpolate_colors_js_1 = require("./interpolate-colors.js");
7
+ const interpolate_js_1 = require("./interpolate.js");
8
+ const easingToFn = (e) => {
9
+ if (e === 'linear') {
10
+ return easing_js_1.Easing.linear;
11
+ }
12
+ return (0, bezier_js_1.bezier)(e[0], e[1], e[2], e[3]);
13
+ };
14
+ const interpolateKeyframedStatus = ({ frame, status, }) => {
15
+ const { keyframes, easing, clamping, interpolationFunction } = status;
16
+ if (keyframes.length === 0) {
17
+ return null;
18
+ }
19
+ const inputRange = keyframes.map((k) => k.frame);
20
+ const outputs = keyframes.map((k) => k.value);
21
+ if (interpolationFunction === 'interpolateColors') {
22
+ if (!outputs.every((v) => typeof v === 'string')) {
23
+ return null;
24
+ }
25
+ if (keyframes.length === 1) {
26
+ return outputs[0];
27
+ }
28
+ try {
29
+ return (0, interpolate_colors_js_1.interpolateColors)(frame, inputRange, outputs, {
30
+ posterize: status.posterize,
31
+ });
32
+ }
33
+ catch (_a) {
34
+ return null;
35
+ }
36
+ }
37
+ if (interpolationFunction !== 'interpolate') {
38
+ return null;
39
+ }
40
+ if (!outputs.every((v) => typeof v === 'number')) {
41
+ return null;
42
+ }
43
+ if (keyframes.length === 1) {
44
+ return outputs[0];
45
+ }
46
+ try {
47
+ return (0, interpolate_js_1.interpolate)(frame, inputRange, outputs, {
48
+ easing: easing.map(easingToFn),
49
+ extrapolateLeft: clamping.left,
50
+ extrapolateRight: clamping.right,
51
+ posterize: status.posterize,
52
+ });
53
+ }
54
+ catch (_b) {
55
+ return null;
56
+ }
57
+ };
58
+ exports.interpolateKeyframedStatus = interpolateKeyframedStatus;
@@ -8,6 +8,8 @@ export type InterpolateOptions = Partial<{
8
8
  easing: EasingFunction | readonly EasingFunction[];
9
9
  extrapolateLeft: ExtrapolateType;
10
10
  extrapolateRight: ExtrapolateType;
11
+ posterize: number;
11
12
  }>;
12
13
  export declare function assertValidInterpolateEasingOption(easing: EasingFunction | readonly EasingFunction[] | undefined, inputRangeLength: number): void;
14
+ export declare function assertValidInterpolatePosterizeOption(posterize: number | undefined): void;
13
15
  export declare function interpolate(input: number, inputRange: readonly number[], outputRange: readonly number[], options?: InterpolateOptions): number;
@@ -2,6 +2,7 @@
2
2
  // Taken from https://github.com/facebook/react-native/blob/0b9ea60b4fee8cacc36e7160e31b91fc114dbc0d/Libraries/Animated/src/nodes/AnimatedInterpolation.js
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.assertValidInterpolateEasingOption = assertValidInterpolateEasingOption;
5
+ exports.assertValidInterpolatePosterizeOption = assertValidInterpolatePosterizeOption;
5
6
  exports.interpolate = interpolate;
6
7
  function interpolateFunction(input, inputRange, outputRange, options) {
7
8
  const { extrapolateLeft, extrapolateRight, easing } = options;
@@ -66,8 +67,8 @@ function checkValidInputRange(arr) {
66
67
  }
67
68
  }
68
69
  function checkInfiniteRange(name, arr) {
69
- if (arr.length < 2) {
70
- throw new Error(name + ' must have at least 2 elements');
70
+ if (arr.length < 1) {
71
+ throw new Error(name + ' must have at least 1 element');
71
72
  }
72
73
  for (const element of arr) {
73
74
  if (typeof element !== 'number') {
@@ -95,6 +96,16 @@ function assertValidInterpolateEasingOption(easing, inputRangeLength) {
95
96
  }
96
97
  }
97
98
  }
99
+ function assertValidInterpolatePosterizeOption(posterize) {
100
+ if (posterize === undefined) {
101
+ return;
102
+ }
103
+ if (typeof posterize !== 'number' ||
104
+ !Number.isFinite(posterize) ||
105
+ posterize <= 0) {
106
+ throw new Error(`posterize must be a positive finite number, but got ${posterize}`);
107
+ }
108
+ }
98
109
  /*
99
110
  * @description Allows you to map a range of values to another using a concise syntax.
100
111
  * @see [Documentation](https://remotion.dev/docs/interpolate)
@@ -120,6 +131,7 @@ function interpolate(input, inputRange, outputRange, options) {
120
131
  checkInfiniteRange('outputRange', outputRange);
121
132
  checkValidInputRange(inputRange);
122
133
  assertValidInterpolateEasingOption(options === null || options === void 0 ? void 0 : options.easing, inputRange.length);
134
+ assertValidInterpolatePosterizeOption(options === null || options === void 0 ? void 0 : options.posterize);
123
135
  const easingOption = options === null || options === void 0 ? void 0 : options.easing;
124
136
  const defaultEasing = (num) => num;
125
137
  const resolveEasingForSegment = (segmentIndex) => {
@@ -143,8 +155,14 @@ function interpolate(input, inputRange, outputRange, options) {
143
155
  if (typeof input !== 'number') {
144
156
  throw new TypeError('Cannot interpolate an input which is not a number');
145
157
  }
146
- const range = findRange(input, inputRange);
147
- return interpolateFunction(input, [inputRange[range], inputRange[range + 1]], [outputRange[range], outputRange[range + 1]], {
158
+ if (inputRange.length === 1) {
159
+ return outputRange[0];
160
+ }
161
+ const posterizedInput = (options === null || options === void 0 ? void 0 : options.posterize) === undefined
162
+ ? input
163
+ : Math.floor(input / options.posterize) * options.posterize;
164
+ const range = findRange(posterizedInput, inputRange);
165
+ return interpolateFunction(posterizedInput, [inputRange[range], inputRange[range + 1]], [outputRange[range], outputRange[range + 1]], {
148
166
  easing: resolveEasingForSegment(range),
149
167
  extrapolateLeft,
150
168
  extrapolateRight,
@@ -1,6 +1,6 @@
1
1
  export type { ArtifactAsset, AudioOrVideoAsset, InlineAudioAsset, TRenderAsset, } from './CompositionManager';
2
2
  export type { DownloadBehavior } from './download-behavior';
3
- export { assertValidInterpolateEasingOption, interpolate } from './interpolate';
3
+ export { assertValidInterpolateEasingOption, assertValidInterpolatePosterizeOption, interpolate, } from './interpolate';
4
4
  export type { EasingFunction, ExtrapolateType, InterpolateOptions, } from './interpolate';
5
5
  export { random } from './random.js';
6
6
  export type { RandomSeed } from './random.js';
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NoReactInternals = exports.random = exports.interpolate = exports.assertValidInterpolateEasingOption = void 0;
3
+ exports.NoReactInternals = exports.random = exports.interpolate = exports.assertValidInterpolatePosterizeOption = exports.assertValidInterpolateEasingOption = void 0;
4
4
  var interpolate_1 = require("./interpolate");
5
5
  Object.defineProperty(exports, "assertValidInterpolateEasingOption", { enumerable: true, get: function () { return interpolate_1.assertValidInterpolateEasingOption; } });
6
+ Object.defineProperty(exports, "assertValidInterpolatePosterizeOption", { enumerable: true, get: function () { return interpolate_1.assertValidInterpolatePosterizeOption; } });
6
7
  Object.defineProperty(exports, "interpolate", { enumerable: true, get: function () { return interpolate_1.interpolate; } });
7
8
  var random_js_1 = require("./random.js");
8
9
  Object.defineProperty(exports, "random", { enumerable: true, get: function () { return random_js_1.random; } });
@@ -26,6 +26,14 @@ export type TranslateFieldSchema = {
26
26
  default: string | undefined;
27
27
  description?: string;
28
28
  };
29
+ export type UvCoordinateFieldSchema = {
30
+ type: 'uv-coordinate';
31
+ min?: number;
32
+ max?: number;
33
+ step?: number;
34
+ default: readonly [number, number] | undefined;
35
+ description?: string;
36
+ };
29
37
  export type ColorFieldSchema = {
30
38
  type: 'color';
31
39
  default: string | undefined;
@@ -37,7 +45,7 @@ export type EnumFieldSchema = {
37
45
  description?: string;
38
46
  variants: Record<string, SequenceSchema>;
39
47
  };
40
- export type VisibleFieldSchema = NumberFieldSchema | BooleanFieldSchema | RotationFieldSchema | TranslateFieldSchema | ColorFieldSchema | EnumFieldSchema;
48
+ export type VisibleFieldSchema = NumberFieldSchema | BooleanFieldSchema | RotationFieldSchema | TranslateFieldSchema | UvCoordinateFieldSchema | ColorFieldSchema | EnumFieldSchema;
41
49
  export type SequenceFieldSchema = VisibleFieldSchema | HiddenFieldSchema;
42
50
  export type SequenceSchema = {
43
51
  [key: string]: SequenceFieldSchema;
@@ -0,0 +1 @@
1
+ export declare function truncateSrcForLabel(src: string): string;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.truncateSrcForLabel = truncateSrcForLabel;
4
+ // Data URLs like the ones from canvas.toDataURL() can be many megabytes, which makes the delayRender() label
5
+ // unreadable and bloats log output
6
+ function truncateSrcForLabel(src) {
7
+ if (src.startsWith('data:') && src.length > 100) {
8
+ return src.slice(0, 60) + '...[' + src.length + ' chars total]';
9
+ }
10
+ return src;
11
+ }
@@ -24,7 +24,7 @@ export declare const useBasicMediaInTimeline: ({ volume, mediaVolume, mediaType,
24
24
  playbackRate: number;
25
25
  };
26
26
  export type BasicMediaInTimelineReturnType = ReturnType<typeof useBasicMediaInTimeline>;
27
- export declare const useMediaInTimeline: ({ volume, mediaVolume, src, mediaType, playbackRate, displayName, id, getStack, showInTimeline, premountDisplay, postmountDisplay, loopDisplay, documentationLink, }: {
27
+ export declare const useMediaInTimeline: ({ volume, mediaVolume, src, mediaType, playbackRate, displayName, id, getStack, showInTimeline, premountDisplay, postmountDisplay, loopDisplay, documentationLink, refForOutline, }: {
28
28
  volume: VolumeProp | undefined;
29
29
  mediaVolume: number;
30
30
  src: string | undefined;
@@ -38,4 +38,5 @@ export declare const useMediaInTimeline: ({ volume, mediaVolume, src, mediaType,
38
38
  postmountDisplay: number | null;
39
39
  loopDisplay: LoopDisplay | undefined;
40
40
  documentationLink: string | null;
41
+ refForOutline: React.RefObject<HTMLElement | null> | null;
41
42
  }) => void;
@@ -86,7 +86,7 @@ const useBasicMediaInTimeline = ({ volume, mediaVolume, mediaType, src, displayN
86
86
  return memoizedResult;
87
87
  };
88
88
  exports.useBasicMediaInTimeline = useBasicMediaInTimeline;
89
- const useMediaInTimeline = ({ volume, mediaVolume, src, mediaType, playbackRate, displayName, id, getStack, showInTimeline, premountDisplay, postmountDisplay, loopDisplay, documentationLink, }) => {
89
+ const useMediaInTimeline = ({ volume, mediaVolume, src, mediaType, playbackRate, displayName, id, getStack, showInTimeline, premountDisplay, postmountDisplay, loopDisplay, documentationLink, refForOutline, }) => {
90
90
  const parentSequence = (0, react_1.useContext)(SequenceContext_js_1.SequenceContext);
91
91
  const startsAt = (0, use_audio_frame_js_1.useMediaStartsAt)();
92
92
  const { registerSequence, unregisterSequence } = (0, react_1.useContext)(SequenceManager_js_1.SequenceManager);
@@ -139,6 +139,7 @@ const useMediaInTimeline = ({ volume, mediaVolume, src, mediaType, playbackRate,
139
139
  postmountDisplay,
140
140
  controls: null,
141
141
  effects: [],
142
+ refForOutline,
142
143
  });
143
144
  return () => {
144
145
  unregisterSequence(id);
@@ -165,6 +166,7 @@ const useMediaInTimeline = ({ volume, mediaVolume, src, mediaType, playbackRate,
165
166
  rootId,
166
167
  finalDisplayName,
167
168
  isStudio,
169
+ refForOutline,
168
170
  ]);
169
171
  };
170
172
  exports.useMediaInTimeline = useMediaInTimeline;
@@ -1,3 +1,4 @@
1
+ import type { ExtrapolateType } from './interpolate.js';
1
2
  import type { SequenceSchema } from './sequence-field-schema.js';
2
3
  import type { CanUpdateSequencePropsResponse, SequencePropsSubscriptionKey } from './SequenceManager.js';
3
4
  export type CanUpdateSequencePropStatusTrue = {
@@ -8,11 +9,26 @@ export type CanUpdateSequencePropStatusKeyframe = {
8
9
  frame: number;
9
10
  value: unknown;
10
11
  };
11
- export type CanUpdateSequencePropStatusFalse = {
12
+ export type CanUpdateSequencePropStatusEasing = 'linear' | [number, number, number, number];
13
+ export type CanUpdateSequencePropStatusClamping = {
14
+ left: ExtrapolateType;
15
+ right: ExtrapolateType;
16
+ };
17
+ export type CanUpdateSequencePropStatusInterpolationFunction = 'interpolate' | 'interpolateColors';
18
+ export type CanUpdateSequencePropStatusComputed = {
12
19
  canUpdate: false;
13
20
  reason: 'computed';
14
- keyframes?: CanUpdateSequencePropStatusKeyframe[];
15
21
  };
22
+ export type CanUpdateSequencePropStatusKeyframed = {
23
+ canUpdate: false;
24
+ reason: 'keyframed';
25
+ interpolationFunction: CanUpdateSequencePropStatusInterpolationFunction;
26
+ keyframes: CanUpdateSequencePropStatusKeyframe[];
27
+ easing: CanUpdateSequencePropStatusEasing[];
28
+ clamping: CanUpdateSequencePropStatusClamping;
29
+ posterize: number | undefined;
30
+ };
31
+ export type CanUpdateSequencePropStatusFalse = CanUpdateSequencePropStatusComputed | CanUpdateSequencePropStatusKeyframed;
16
32
  export type CanUpdateSequencePropStatus = CanUpdateSequencePropStatusTrue | CanUpdateSequencePropStatusFalse;
17
33
  export type DragOverrides = Record<string, Record<string, unknown>>;
18
34
  export type EffectDragOverrides = Record<string, Record<string, unknown>>;
@@ -21,11 +37,12 @@ export type GetCodeValues = (nodePath: SequencePropsSubscriptionKey) => Record<s
21
37
  export type GetEffectCodeValues = (nodePath: SequencePropsSubscriptionKey, effectIndex: number) => Record<string, CanUpdateSequencePropStatus> | undefined;
22
38
  export type GetDragOverrides = (nodePath: SequencePropsSubscriptionKey) => DragOverrides[string];
23
39
  export type GetEffectDragOverrides = (nodePath: SequencePropsSubscriptionKey, effectIndex: number) => Record<string, unknown>;
24
- export declare const computeEffectiveSchemaValuesDotNotation: ({ schema, currentValue, overrideValues, propStatus, }: {
40
+ export declare const computeEffectiveSchemaValuesDotNotation: ({ schema, currentValue, overrideValues, propStatus, frame, }: {
25
41
  schema: SequenceSchema;
26
42
  currentValue: Record<string, unknown>;
27
43
  overrideValues: Record<string, unknown>;
28
44
  propStatus: Record<string, CanUpdateSequencePropStatus> | undefined;
45
+ frame: number | null;
29
46
  }) => {
30
47
  merged: Record<string, unknown>;
31
48
  propsToDelete: Set<string>;