remotion 4.1.0-alpha4 → 4.1.0-alpha7
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/cjs/Composition.d.ts +24 -9
- package/dist/cjs/Composition.js +6 -17
- package/dist/cjs/CompositionManager.d.ts +11 -12
- package/dist/cjs/CompositionManagerContext.d.ts +4 -3
- package/dist/cjs/Img.d.ts +1 -1
- package/dist/cjs/RemotionRoot.js +6 -4
- package/dist/cjs/ResolveCompositionConfig.js +24 -7
- package/dist/cjs/Still.d.ts +1 -1
- package/dist/cjs/audio/Audio.d.ts +1 -1
- package/dist/cjs/audio/shared-audio-tags.d.ts +1 -1
- package/dist/cjs/freeze.js +6 -2
- package/dist/cjs/index.d.ts +6 -6
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/internals.d.ts +62 -60
- package/dist/cjs/internals.js +3 -0
- package/dist/cjs/loop/index.js +1 -2
- package/dist/cjs/props-if-has-props.d.ts +2 -2
- package/dist/cjs/resolve-video-config.d.ts +3 -2
- package/dist/cjs/resolve-video-config.js +23 -33
- package/dist/cjs/series/index.js +2 -3
- package/dist/cjs/spring/index.js +1 -1
- package/dist/cjs/static-file.js +11 -2
- package/dist/cjs/timeline-position-state.d.ts +5 -3
- package/dist/cjs/timeline-position-state.js +25 -7
- package/dist/cjs/use-unsafe-video-config.js +2 -1
- package/dist/cjs/use-video.d.ts +1 -1
- package/dist/cjs/use-video.js +3 -3
- package/dist/cjs/validation/validate-dimensions.d.ts +1 -1
- package/dist/cjs/validation/validate-dimensions.js +2 -2
- package/dist/cjs/validation/validate-duration-in-frames.d.ts +2 -3
- package/dist/cjs/validation/validate-duration-in-frames.js +6 -2
- package/dist/cjs/validation/validate-fps.d.ts +1 -1
- package/dist/cjs/validation/validate-fps.js +2 -2
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/video/OffthreadVideo.js +4 -2
- package/dist/cjs/video-config.d.ts +2 -1
- package/dist/esm/index.mjs +136 -99
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
|
@@ -10,32 +10,47 @@ export type CompProps<Props> = {
|
|
|
10
10
|
} | {
|
|
11
11
|
component: LooseComponentType<Props>;
|
|
12
12
|
};
|
|
13
|
-
export type CalcMetadataReturnType<T extends Record<string, unknown
|
|
13
|
+
export type CalcMetadataReturnType<T extends Record<string, unknown>> = {
|
|
14
14
|
durationInFrames?: number;
|
|
15
15
|
fps?: number;
|
|
16
16
|
width?: number;
|
|
17
17
|
height?: number;
|
|
18
18
|
props?: T;
|
|
19
19
|
};
|
|
20
|
-
export type CalculateMetadataFunction<T extends Record<string, unknown
|
|
20
|
+
export type CalculateMetadataFunction<T extends Record<string, unknown>> = (options: {
|
|
21
21
|
defaultProps: T;
|
|
22
22
|
props: T;
|
|
23
23
|
abortSignal: AbortSignal;
|
|
24
24
|
}) => Promise<CalcMetadataReturnType<T>> | CalcMetadataReturnType<T>;
|
|
25
|
-
|
|
25
|
+
type OptionalDimensions<Schema extends AnyZodObject, Props extends Record<string, unknown>> = {
|
|
26
|
+
width?: number;
|
|
27
|
+
height?: number;
|
|
28
|
+
calculateMetadata: CalculateMetadataFunction<InferProps<Schema, Props>>;
|
|
29
|
+
};
|
|
30
|
+
type MandatoryDimensions<Schema extends AnyZodObject, Props extends Record<string, unknown>> = {
|
|
26
31
|
width: number;
|
|
27
32
|
height: number;
|
|
28
|
-
id: string;
|
|
29
33
|
calculateMetadata?: CalculateMetadataFunction<InferProps<Schema, Props>>;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
34
|
+
};
|
|
35
|
+
type StillCalculateMetadataOrExplicit<Schema extends AnyZodObject, Props extends Record<string, unknown>> = OptionalDimensions<Schema, Props> | MandatoryDimensions<Schema, Props>;
|
|
36
|
+
type CompositionCalculateMetadataOrExplicit<Schema extends AnyZodObject, Props extends Record<string, unknown>> = (OptionalDimensions<Schema, Props> & {
|
|
37
|
+
fps?: number;
|
|
38
|
+
durationInFrames?: number;
|
|
39
|
+
}) | (MandatoryDimensions<Schema, Props> & {
|
|
33
40
|
fps: number;
|
|
34
41
|
durationInFrames: number;
|
|
35
|
-
};
|
|
42
|
+
});
|
|
43
|
+
export type StillProps<Schema extends AnyZodObject, Props extends Record<string, unknown>> = {
|
|
44
|
+
id: string;
|
|
45
|
+
schema?: Schema;
|
|
46
|
+
} & StillCalculateMetadataOrExplicit<Schema, Props> & CompProps<Props> & PropsIfHasProps<Schema, Props>;
|
|
47
|
+
export type CompositionProps<Schema extends AnyZodObject, Props extends Record<string, unknown>> = {
|
|
48
|
+
id: string;
|
|
49
|
+
schema?: Schema;
|
|
50
|
+
} & CompositionCalculateMetadataOrExplicit<Schema, Props> & CompProps<Props> & PropsIfHasProps<Schema, Props>;
|
|
36
51
|
/**
|
|
37
52
|
* @description This component is used to register a video to make it renderable and make it show in the sidebar, in dev mode.
|
|
38
53
|
* @see [Documentation](https://www.remotion.dev/docs/composition)
|
|
39
54
|
*/
|
|
40
|
-
export declare const Composition: <Schema extends AnyZodObject, Props extends Record<string, unknown
|
|
55
|
+
export declare const Composition: <Schema extends AnyZodObject, Props extends Record<string, unknown>>({ width, height, fps, durationInFrames, id, defaultProps, schema, ...compProps }: CompositionProps<Schema, Props>) => React.ReactPortal | null;
|
|
41
56
|
export {};
|
package/dist/cjs/Composition.js
CHANGED
|
@@ -19,9 +19,6 @@ const use_lazy_component_js_1 = require("./use-lazy-component.js");
|
|
|
19
19
|
const use_video_js_1 = require("./use-video.js");
|
|
20
20
|
const validate_composition_id_js_1 = require("./validation/validate-composition-id.js");
|
|
21
21
|
const validate_default_props_js_1 = require("./validation/validate-default-props.js");
|
|
22
|
-
const validate_dimensions_js_1 = require("./validation/validate-dimensions.js");
|
|
23
|
-
const validate_duration_in_frames_js_1 = require("./validation/validate-duration-in-frames.js");
|
|
24
|
-
const validate_fps_js_1 = require("./validation/validate-fps.js");
|
|
25
22
|
const Fallback = () => {
|
|
26
23
|
(0, react_1.useEffect)(() => {
|
|
27
24
|
const fallback = (0, delay_render_js_1.delayRender)('Waiting for Root component to unsuspend');
|
|
@@ -56,20 +53,12 @@ const Composition = ({ width, height, fps, durationInFrames, id, defaultProps, s
|
|
|
56
53
|
throw new Error('No id for composition passed.');
|
|
57
54
|
}
|
|
58
55
|
(0, validate_composition_id_js_1.validateCompositionId)(id);
|
|
59
|
-
(0, validate_dimensions_js_1.validateDimension)(width, 'width', 'of the <Composition/> component');
|
|
60
|
-
(0, validate_dimensions_js_1.validateDimension)(height, 'height', 'of the <Composition/> component');
|
|
61
|
-
(0, validate_duration_in_frames_js_1.validateDurationInFrames)({
|
|
62
|
-
durationInFrames,
|
|
63
|
-
component: 'of the <Composition/> component',
|
|
64
|
-
allowFloats: false,
|
|
65
|
-
});
|
|
66
|
-
(0, validate_fps_js_1.validateFps)(fps, 'as a prop of the <Composition/> component', false);
|
|
67
56
|
(0, validate_default_props_js_1.validateDefaultAndInputProps)(defaultProps, 'defaultProps', id);
|
|
68
57
|
registerComposition({
|
|
69
|
-
durationInFrames,
|
|
70
|
-
fps,
|
|
71
|
-
height,
|
|
72
|
-
width,
|
|
58
|
+
durationInFrames: durationInFrames !== null && durationInFrames !== void 0 ? durationInFrames : undefined,
|
|
59
|
+
fps: fps !== null && fps !== void 0 ? fps : undefined,
|
|
60
|
+
height: height !== null && height !== void 0 ? height : undefined,
|
|
61
|
+
width: width !== null && width !== void 0 ? width : undefined,
|
|
73
62
|
id,
|
|
74
63
|
folderName,
|
|
75
64
|
component: lazy,
|
|
@@ -104,14 +93,14 @@ const Composition = ({ width, height, fps, durationInFrames, id, defaultProps, s
|
|
|
104
93
|
if (resolved === null || resolved.type !== 'success') {
|
|
105
94
|
return null;
|
|
106
95
|
}
|
|
107
|
-
return (0, react_dom_1.createPortal)((0, jsx_runtime_1.jsx)(ClipComposition, { children: (0, jsx_runtime_1.jsx)(CanUseRemotionHooks_js_1.CanUseRemotionHooksProvider, { children: (0, jsx_runtime_1.jsx)(react_1.Suspense, { fallback: (0, jsx_runtime_1.jsx)(loading_indicator_js_1.Loading, {}), children: (0, jsx_runtime_1.jsx)(Comp, { ...((_a = resolved.result.
|
|
96
|
+
return (0, react_dom_1.createPortal)((0, jsx_runtime_1.jsx)(ClipComposition, { children: (0, jsx_runtime_1.jsx)(CanUseRemotionHooks_js_1.CanUseRemotionHooksProvider, { children: (0, jsx_runtime_1.jsx)(react_1.Suspense, { fallback: (0, jsx_runtime_1.jsx)(loading_indicator_js_1.Loading, {}), children: (0, jsx_runtime_1.jsx)(Comp, { ...((_a = resolved.result.props) !== null && _a !== void 0 ? _a : {}) }) }) }) }), (0, portal_node_js_1.portalNode)());
|
|
108
97
|
}
|
|
109
98
|
if (environment === 'rendering' && video && video.component === lazy) {
|
|
110
99
|
const Comp = lazy;
|
|
111
100
|
if (resolved === null || resolved.type !== 'success') {
|
|
112
101
|
return null;
|
|
113
102
|
}
|
|
114
|
-
return (0, react_dom_1.createPortal)((0, jsx_runtime_1.jsx)(CanUseRemotionHooks_js_1.CanUseRemotionHooksProvider, { children: (0, jsx_runtime_1.jsx)(react_1.Suspense, { fallback: (0, jsx_runtime_1.jsx)(Fallback, {}), children: (0, jsx_runtime_1.jsx)(Comp, { ...((_b = resolved.result.
|
|
103
|
+
return (0, react_dom_1.createPortal)((0, jsx_runtime_1.jsx)(CanUseRemotionHooks_js_1.CanUseRemotionHooksProvider, { children: (0, jsx_runtime_1.jsx)(react_1.Suspense, { fallback: (0, jsx_runtime_1.jsx)(Fallback, {}), children: (0, jsx_runtime_1.jsx)(Comp, { ...((_b = resolved.result.props) !== null && _b !== void 0 ? _b : {}) }) }) }), (0, portal_node_js_1.portalNode)());
|
|
115
104
|
}
|
|
116
105
|
return null;
|
|
117
106
|
};
|
|
@@ -3,11 +3,11 @@ import React from 'react';
|
|
|
3
3
|
import type { AnyZodObject } from 'zod';
|
|
4
4
|
import type { CalculateMetadataFunction } from './Composition.js';
|
|
5
5
|
import type { InferProps, PropsIfHasProps } from './props-if-has-props.js';
|
|
6
|
-
export type TComposition<Schema extends AnyZodObject, Props extends Record<string, unknown
|
|
7
|
-
width: number;
|
|
8
|
-
height: number;
|
|
9
|
-
fps: number;
|
|
10
|
-
durationInFrames: number;
|
|
6
|
+
export type TComposition<Schema extends AnyZodObject, Props extends Record<string, unknown>> = {
|
|
7
|
+
width: number | undefined;
|
|
8
|
+
height: number | undefined;
|
|
9
|
+
fps: number | undefined;
|
|
10
|
+
durationInFrames: number | undefined;
|
|
11
11
|
id: string;
|
|
12
12
|
folderName: string | null;
|
|
13
13
|
parentFolderName: string | null;
|
|
@@ -16,12 +16,11 @@ export type TComposition<Schema extends AnyZodObject, Props extends Record<strin
|
|
|
16
16
|
schema: Schema | null;
|
|
17
17
|
calculateMetadata: CalculateMetadataFunction<InferProps<Schema, Props>> | null;
|
|
18
18
|
} & PropsIfHasProps<Schema, Props>;
|
|
19
|
-
export type AnyComposition = TComposition<AnyZodObject, Record<string, unknown
|
|
20
|
-
export type TCompMetadataWithCalcFunction<Schema extends AnyZodObject, Props extends Record<string, unknown
|
|
21
|
-
export type TCompMetadata<Schema extends AnyZodObject, Props extends Record<string, unknown
|
|
22
|
-
export type AnyCompMetadata = TCompMetadata<AnyZodObject, Record<string, unknown
|
|
23
|
-
export type SmallTCompMetadata<T extends AnyZodObject, Props extends Record<string, unknown
|
|
24
|
-
export type AnySmallCompMetadata = SmallTCompMetadata<AnyZodObject, Record<string, unknown> | undefined>;
|
|
19
|
+
export type AnyComposition = TComposition<AnyZodObject, Record<string, unknown>>;
|
|
20
|
+
export type TCompMetadataWithCalcFunction<Schema extends AnyZodObject, Props extends Record<string, unknown>> = Pick<TComposition<Schema, Props>, 'id' | 'height' | 'width' | 'fps' | 'durationInFrames' | 'defaultProps' | 'calculateMetadata'>;
|
|
21
|
+
export type TCompMetadata<Schema extends AnyZodObject, Props extends Record<string, unknown>> = Pick<TComposition<Schema, Props>, 'id' | 'height' | 'width' | 'fps' | 'durationInFrames' | 'defaultProps'>;
|
|
22
|
+
export type AnyCompMetadata = TCompMetadata<AnyZodObject, Record<string, unknown>>;
|
|
23
|
+
export type SmallTCompMetadata<T extends AnyZodObject, Props extends Record<string, unknown>> = Pick<TComposition<T, Props>, 'id' | 'height' | 'width' | 'fps' | 'durationInFrames'> & Partial<Pick<TComposition<T, Props>, 'defaultProps'>>;
|
|
25
24
|
type EnhancedTSequenceData = {
|
|
26
25
|
type: 'sequence';
|
|
27
26
|
} | {
|
|
@@ -66,7 +65,7 @@ export type TAsset = {
|
|
|
66
65
|
allowAmplificationDuringRender: boolean;
|
|
67
66
|
};
|
|
68
67
|
export declare const compositionsRef: React.RefObject<{
|
|
69
|
-
getCompositions: () => TCompMetadataWithCalcFunction<AnyZodObject, Record<string, unknown
|
|
68
|
+
getCompositions: () => TCompMetadataWithCalcFunction<AnyZodObject, Record<string, unknown>>[];
|
|
70
69
|
}>;
|
|
71
70
|
export declare const CompositionManagerProvider: React.FC<{
|
|
72
71
|
children: React.ReactNode;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { AnyZodObject } from 'zod';
|
|
3
|
-
import type {
|
|
3
|
+
import type { AnyComposition, TComposition } from './CompositionManager.js';
|
|
4
4
|
import type { TFolder } from './Folder.js';
|
|
5
|
-
|
|
5
|
+
import type { VideoConfig } from './video-config.js';
|
|
6
|
+
export type BaseMetadata = Pick<VideoConfig, 'durationInFrames' | 'fps' | 'props' | 'height' | 'width'>;
|
|
6
7
|
export type CompositionManagerContext = {
|
|
7
8
|
compositions: AnyComposition[];
|
|
8
|
-
registerComposition: <Schema extends AnyZodObject, Props extends Record<string, unknown
|
|
9
|
+
registerComposition: <Schema extends AnyZodObject, Props extends Record<string, unknown>>(comp: TComposition<Schema, Props>) => void;
|
|
9
10
|
unregisterComposition: (name: string) => void;
|
|
10
11
|
registerFolder: (name: string, parent: string | null) => void;
|
|
11
12
|
unregisterFolder: (name: string, parent: string | null) => void;
|
package/dist/cjs/Img.d.ts
CHANGED
|
@@ -6,4 +6,4 @@ import React from 'react';
|
|
|
6
6
|
export declare const Img: React.ForwardRefExoticComponent<Pick<Omit<React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, "src"> & {
|
|
7
7
|
maxRetries?: number | undefined;
|
|
8
8
|
src: string;
|
|
9
|
-
}, "
|
|
9
|
+
}, "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "crossOrigin" | "src" | "height" | "width" | "loading" | "referrerPolicy" | "alt" | "decoding" | "sizes" | "srcSet" | "useMap" | "maxRetries"> & React.RefAttributes<HTMLImageElement>>;
|
package/dist/cjs/RemotionRoot.js
CHANGED
|
@@ -13,9 +13,8 @@ const random_js_1 = require("./random.js");
|
|
|
13
13
|
const timeline_position_state_js_1 = require("./timeline-position-state.js");
|
|
14
14
|
const duration_state_js_1 = require("./video/duration-state.js");
|
|
15
15
|
const RemotionRoot = ({ children, numberOfAudioTags }) => {
|
|
16
|
-
var _a;
|
|
17
16
|
const [remotionRootId] = (0, react_1.useState)(() => String((0, random_js_1.random)(null)));
|
|
18
|
-
const [frame, setFrame] = (0, react_1.useState)(
|
|
17
|
+
const [frame, setFrame] = (0, react_1.useState)({});
|
|
19
18
|
const [playing, setPlaying] = (0, react_1.useState)(false);
|
|
20
19
|
const imperativePlaying = (0, react_1.useRef)(false);
|
|
21
20
|
const [fastRefreshes, setFastRefreshes] = (0, react_1.useState)(0);
|
|
@@ -24,9 +23,12 @@ const RemotionRoot = ({ children, numberOfAudioTags }) => {
|
|
|
24
23
|
if (typeof window !== 'undefined') {
|
|
25
24
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
26
25
|
(0, react_1.useLayoutEffect)(() => {
|
|
27
|
-
window.remotion_setFrame = (f) => {
|
|
26
|
+
window.remotion_setFrame = (f, composition) => {
|
|
28
27
|
const id = (0, delay_render_js_1.delayRender)(`Setting the current frame to ${f}`);
|
|
29
|
-
setFrame(
|
|
28
|
+
setFrame((s) => ({
|
|
29
|
+
...s,
|
|
30
|
+
[composition]: f,
|
|
31
|
+
}));
|
|
30
32
|
requestAnimationFrame(() => (0, delay_render_js_1.continueRender)(id));
|
|
31
33
|
};
|
|
32
34
|
window.remotion_isPlayer = false;
|
|
@@ -30,12 +30,23 @@ const ResolveCompositionConfig = ({ children }) => {
|
|
|
30
30
|
: {};
|
|
31
31
|
}, [allEditorProps, renderModalComposition]);
|
|
32
32
|
const doResolution = (0, react_1.useCallback)((composition, editorProps) => {
|
|
33
|
+
var _a;
|
|
33
34
|
const controller = new AbortController();
|
|
34
35
|
if (currentCompositionMetadata) {
|
|
35
36
|
return controller;
|
|
36
37
|
}
|
|
38
|
+
const inputProps = typeof window === 'undefined' ||
|
|
39
|
+
(0, get_environment_js_1.getRemotionEnvironment)() === 'player-development' ||
|
|
40
|
+
(0, get_environment_js_1.getRemotionEnvironment)() === 'player-production'
|
|
41
|
+
? {}
|
|
42
|
+
: (_a = (0, input_props_js_1.getInputProps)()) !== null && _a !== void 0 ? _a : {};
|
|
37
43
|
const { signal } = controller;
|
|
38
|
-
const promOrNot = (0, resolve_video_config_js_1.resolveVideoConfig)({
|
|
44
|
+
const promOrNot = (0, resolve_video_config_js_1.resolveVideoConfig)({
|
|
45
|
+
composition,
|
|
46
|
+
editorProps,
|
|
47
|
+
inputProps,
|
|
48
|
+
signal,
|
|
49
|
+
});
|
|
39
50
|
if (typeof promOrNot === 'object' && 'then' in promOrNot) {
|
|
40
51
|
setResolvedConfigs((r) => ({
|
|
41
52
|
...r,
|
|
@@ -152,7 +163,7 @@ const useResolvedVideoConfig = (preferredCompositionId) => {
|
|
|
152
163
|
return composition ? (_a = allEditorProps[composition.id]) !== null && _a !== void 0 ? _a : {} : {};
|
|
153
164
|
}, [allEditorProps, composition]);
|
|
154
165
|
return (0, react_1.useMemo)(() => {
|
|
155
|
-
var _a, _b, _c;
|
|
166
|
+
var _a, _b, _c, _d;
|
|
156
167
|
if (!composition) {
|
|
157
168
|
return null;
|
|
158
169
|
}
|
|
@@ -162,7 +173,8 @@ const useResolvedVideoConfig = (preferredCompositionId) => {
|
|
|
162
173
|
result: {
|
|
163
174
|
...currentCompositionMetadata,
|
|
164
175
|
id: composition.id,
|
|
165
|
-
|
|
176
|
+
props: currentCompositionMetadata.props,
|
|
177
|
+
defaultProps: (_a = composition.defaultProps) !== null && _a !== void 0 ? _a : {},
|
|
166
178
|
},
|
|
167
179
|
};
|
|
168
180
|
}
|
|
@@ -170,15 +182,20 @@ const useResolvedVideoConfig = (preferredCompositionId) => {
|
|
|
170
182
|
return {
|
|
171
183
|
type: 'success',
|
|
172
184
|
result: {
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
185
|
+
width: composition.width,
|
|
186
|
+
height: composition.height,
|
|
187
|
+
fps: composition.fps,
|
|
188
|
+
id: composition.id,
|
|
189
|
+
durationInFrames: composition.durationInFrames,
|
|
190
|
+
defaultProps: (_b = composition.defaultProps) !== null && _b !== void 0 ? _b : {},
|
|
191
|
+
props: {
|
|
192
|
+
...((_c = composition.defaultProps) !== null && _c !== void 0 ? _c : {}),
|
|
176
193
|
...(selectedEditorProps !== null && selectedEditorProps !== void 0 ? selectedEditorProps : {}),
|
|
177
194
|
...(typeof window === 'undefined' ||
|
|
178
195
|
(0, get_environment_js_1.getRemotionEnvironment)() === 'player-development' ||
|
|
179
196
|
(0, get_environment_js_1.getRemotionEnvironment)() === 'player-production'
|
|
180
197
|
? {}
|
|
181
|
-
: (
|
|
198
|
+
: (_d = (0, input_props_js_1.getInputProps)()) !== null && _d !== void 0 ? _d : {}),
|
|
182
199
|
},
|
|
183
200
|
},
|
|
184
201
|
};
|
package/dist/cjs/Still.d.ts
CHANGED
|
@@ -5,4 +5,4 @@ import type { StillProps } from './Composition.js';
|
|
|
5
5
|
* @description A `<Still />` is a `<Composition />` that is only 1 frame long.
|
|
6
6
|
* @see [Documentation](https://www.remotion.dev/docs/still)
|
|
7
7
|
*/
|
|
8
|
-
export declare const Still: <Schema extends AnyZodObject, Props extends Record<string, unknown
|
|
8
|
+
export declare const Still: <Schema extends AnyZodObject, Props extends Record<string, unknown>>(props: StillProps<Schema, Props>) => React.DetailedReactHTMLElement<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
|
|
@@ -9,4 +9,4 @@ export declare const Audio: React.ForwardRefExoticComponent<Pick<Omit<React.Deta
|
|
|
9
9
|
playbackRate?: number | undefined;
|
|
10
10
|
acceptableTimeShiftInSeconds?: number | undefined;
|
|
11
11
|
allowAmplificationDuringRender?: boolean | undefined;
|
|
12
|
-
} & RemotionMainAudioProps, "
|
|
12
|
+
} & RemotionMainAudioProps, "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "volume" | "allowAmplificationDuringRender" | "controlsList" | "crossOrigin" | "loop" | "mediaGroup" | "muted" | "playsInline" | "preload" | "src" | "playbackRate" | "acceptableTimeShiftInSeconds" | keyof RemotionMainAudioProps> & React.RefAttributes<HTMLAudioElement>>;
|
|
@@ -33,7 +33,7 @@ export declare const SharedAudioContext: React.Context<SharedContext | null>;
|
|
|
33
33
|
export declare const SharedAudioContextProvider: React.FC<{
|
|
34
34
|
numberOfAudioTags: number;
|
|
35
35
|
children: React.ReactNode;
|
|
36
|
-
component: LazyExoticComponent<ComponentType<Record<string, unknown
|
|
36
|
+
component: LazyExoticComponent<ComponentType<Record<string, unknown>>> | null;
|
|
37
37
|
}>;
|
|
38
38
|
export declare const useSharedAudio: (aud: RemotionAudioProps, audioId: string) => AudioElem;
|
|
39
39
|
export {};
|
package/dist/cjs/freeze.js
CHANGED
|
@@ -5,11 +5,13 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const SequenceContext_js_1 = require("./SequenceContext.js");
|
|
7
7
|
const timeline_position_state_js_1 = require("./timeline-position-state.js");
|
|
8
|
+
const use_video_config_js_1 = require("./use-video-config.js");
|
|
8
9
|
/**
|
|
9
10
|
* @description This method freezes all of its children to the frame that you specify as a prop
|
|
10
11
|
* @see [Documentation](https://www.remotion.dev/docs/freeze)
|
|
11
12
|
*/
|
|
12
13
|
const Freeze = ({ frame, children }) => {
|
|
14
|
+
const videoConfig = (0, use_video_config_js_1.useVideoConfig)();
|
|
13
15
|
if (typeof frame === 'undefined') {
|
|
14
16
|
throw new Error(`The <Freeze /> component requires a 'frame' prop, but none was passed.`);
|
|
15
17
|
}
|
|
@@ -30,9 +32,11 @@ const Freeze = ({ frame, children }) => {
|
|
|
30
32
|
imperativePlaying: {
|
|
31
33
|
current: false,
|
|
32
34
|
},
|
|
33
|
-
frame
|
|
35
|
+
frame: {
|
|
36
|
+
[videoConfig.id]: frame,
|
|
37
|
+
},
|
|
34
38
|
};
|
|
35
|
-
}, [context, frame]);
|
|
39
|
+
}, [context, frame, videoConfig.id]);
|
|
36
40
|
return ((0, jsx_runtime_1.jsx)(timeline_position_state_js_1.TimelineContext.Provider, { value: value, children: (0, jsx_runtime_1.jsx)(SequenceContext_js_1.SequenceContext.Provider, { value: null, children: children }) }));
|
|
37
41
|
};
|
|
38
42
|
exports.Freeze = Freeze;
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import './asset-types.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { TAsset } from './CompositionManager.js';
|
|
3
3
|
import type { StaticFile } from './get-static-files.js';
|
|
4
4
|
import type { ClipRegion } from './NativeLayers.js';
|
|
5
5
|
import type { VideoConfig } from './video-config.js';
|
|
@@ -8,7 +8,7 @@ declare global {
|
|
|
8
8
|
remotion_renderReady: boolean;
|
|
9
9
|
remotion_cancelledError: string | undefined;
|
|
10
10
|
remotion_getCompositionNames: () => string[];
|
|
11
|
-
getStaticCompositions: () => Promise<
|
|
11
|
+
getStaticCompositions: () => Promise<VideoConfig[]>;
|
|
12
12
|
remotion_calculateComposition: (compId: string) => Promise<VideoConfig>;
|
|
13
13
|
remotion_setBundleMode: (bundleMode: BundleState) => void;
|
|
14
14
|
remotion_staticBase: string;
|
|
@@ -18,7 +18,7 @@ declare global {
|
|
|
18
18
|
remotion_projectName: string;
|
|
19
19
|
remotion_cwd: string;
|
|
20
20
|
remotion_studioServerCommand: string;
|
|
21
|
-
remotion_setFrame: (frame: number) => void;
|
|
21
|
+
remotion_setFrame: (frame: number, composition: string) => void;
|
|
22
22
|
remotion_initialFrame: number;
|
|
23
23
|
remotion_proxyPort: number;
|
|
24
24
|
remotion_audioEnabled: boolean;
|
|
@@ -31,7 +31,7 @@ declare global {
|
|
|
31
31
|
remotion_isPlayer: boolean;
|
|
32
32
|
remotion_isBuilding: undefined | (() => void);
|
|
33
33
|
remotion_finishedBuilding: undefined | (() => void);
|
|
34
|
-
siteVersion: '
|
|
34
|
+
siteVersion: '7';
|
|
35
35
|
remotion_version: string;
|
|
36
36
|
remotion_imported: string | boolean;
|
|
37
37
|
}
|
|
@@ -43,7 +43,7 @@ export type BundleState = {
|
|
|
43
43
|
} | {
|
|
44
44
|
type: 'composition';
|
|
45
45
|
compositionName: string;
|
|
46
|
-
|
|
46
|
+
props: Record<string, unknown>;
|
|
47
47
|
compositionHeight: number;
|
|
48
48
|
compositionDurationInFrames: number;
|
|
49
49
|
compositionWidth: number;
|
|
@@ -53,7 +53,7 @@ export * from './AbsoluteFill.js';
|
|
|
53
53
|
export * from './audio/index.js';
|
|
54
54
|
export { cancelRender } from './cancel-render.js';
|
|
55
55
|
export { CalculateMetadataFunction, Composition, CompositionProps, CompProps, StillProps, } from './Composition.js';
|
|
56
|
-
export { AnyCompMetadata, AnyComposition,
|
|
56
|
+
export { AnyCompMetadata, AnyComposition, SmallTCompMetadata, TAsset, TCompMetadata, } from './CompositionManager.js';
|
|
57
57
|
export { getInputProps } from './config/input-props.js';
|
|
58
58
|
export { continueRender, delayRender } from './delay-render.js';
|
|
59
59
|
export * from './easing.js';
|
package/dist/cjs/index.js
CHANGED
|
@@ -98,7 +98,7 @@ exports.Config = new Proxy(proxyObj, {
|
|
|
98
98
|
console.warn('+ Replace:');
|
|
99
99
|
console.warn('import {Config} from "@remotion/cli/config";');
|
|
100
100
|
console.warn();
|
|
101
|
-
console.warn('For more information, see https://
|
|
101
|
+
console.warn('For more information, see https://www.remotion.dev/docs/4-0-migration.');
|
|
102
102
|
process.exit(1);
|
|
103
103
|
};
|
|
104
104
|
},
|