remotion 4.1.0-alpha4 → 4.1.0-alpha5
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 +5 -5
- package/dist/cjs/Composition.js +2 -2
- package/dist/cjs/CompositionManager.d.ts +7 -8
- package/dist/cjs/CompositionManagerContext.d.ts +4 -3
- package/dist/cjs/Img.d.ts +1 -1
- package/dist/cjs/ResolveCompositionConfig.js +7 -5
- 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/index.d.ts +5 -5
- package/dist/cjs/internals.d.ts +4 -4
- package/dist/cjs/props-if-has-props.d.ts +2 -2
- package/dist/cjs/resolve-video-config.d.ts +1 -1
- package/dist/cjs/resolve-video-config.js +8 -5
- package/dist/cjs/series/index.js +1 -1
- 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/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 +23 -17
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
|
@@ -10,26 +10,26 @@ 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
|
-
export type StillProps<Schema extends AnyZodObject, Props extends Record<string, unknown
|
|
25
|
+
export type StillProps<Schema extends AnyZodObject, Props extends Record<string, unknown>> = {
|
|
26
26
|
width: number;
|
|
27
27
|
height: number;
|
|
28
28
|
id: string;
|
|
29
29
|
calculateMetadata?: CalculateMetadataFunction<InferProps<Schema, Props>>;
|
|
30
30
|
schema?: Schema;
|
|
31
31
|
} & CompProps<Props> & PropsIfHasProps<Schema, Props>;
|
|
32
|
-
export type CompositionProps<Schema extends AnyZodObject, Props extends Record<string, unknown
|
|
32
|
+
export type CompositionProps<Schema extends AnyZodObject, Props extends Record<string, unknown>> = StillProps<Schema, Props> & {
|
|
33
33
|
fps: number;
|
|
34
34
|
durationInFrames: number;
|
|
35
35
|
};
|
|
@@ -37,5 +37,5 @@ export type CompositionProps<Schema extends AnyZodObject, Props extends Record<s
|
|
|
37
37
|
* @description This component is used to register a video to make it renderable and make it show in the sidebar, in dev mode.
|
|
38
38
|
* @see [Documentation](https://www.remotion.dev/docs/composition)
|
|
39
39
|
*/
|
|
40
|
-
export declare const Composition: <Schema extends AnyZodObject, Props extends Record<string, unknown
|
|
40
|
+
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
41
|
export {};
|
package/dist/cjs/Composition.js
CHANGED
|
@@ -104,14 +104,14 @@ const Composition = ({ width, height, fps, durationInFrames, id, defaultProps, s
|
|
|
104
104
|
if (resolved === null || resolved.type !== 'success') {
|
|
105
105
|
return null;
|
|
106
106
|
}
|
|
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.
|
|
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.props) !== null && _a !== void 0 ? _a : {}) }) }) }) }), (0, portal_node_js_1.portalNode)());
|
|
108
108
|
}
|
|
109
109
|
if (environment === 'rendering' && video && video.component === lazy) {
|
|
110
110
|
const Comp = lazy;
|
|
111
111
|
if (resolved === null || resolved.type !== 'success') {
|
|
112
112
|
return null;
|
|
113
113
|
}
|
|
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.
|
|
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.props) !== null && _b !== void 0 ? _b : {}) }) }) }), (0, portal_node_js_1.portalNode)());
|
|
115
115
|
}
|
|
116
116
|
return null;
|
|
117
117
|
};
|
|
@@ -3,7 +3,7 @@ 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
|
|
6
|
+
export type TComposition<Schema extends AnyZodObject, Props extends Record<string, unknown>> = {
|
|
7
7
|
width: number;
|
|
8
8
|
height: number;
|
|
9
9
|
fps: number;
|
|
@@ -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>>;
|
|
@@ -152,7 +152,7 @@ const useResolvedVideoConfig = (preferredCompositionId) => {
|
|
|
152
152
|
return composition ? (_a = allEditorProps[composition.id]) !== null && _a !== void 0 ? _a : {} : {};
|
|
153
153
|
}, [allEditorProps, composition]);
|
|
154
154
|
return (0, react_1.useMemo)(() => {
|
|
155
|
-
var _a, _b, _c;
|
|
155
|
+
var _a, _b, _c, _d;
|
|
156
156
|
if (!composition) {
|
|
157
157
|
return null;
|
|
158
158
|
}
|
|
@@ -162,7 +162,8 @@ const useResolvedVideoConfig = (preferredCompositionId) => {
|
|
|
162
162
|
result: {
|
|
163
163
|
...currentCompositionMetadata,
|
|
164
164
|
id: composition.id,
|
|
165
|
-
|
|
165
|
+
props: currentCompositionMetadata.props,
|
|
166
|
+
defaultProps: (_a = composition.defaultProps) !== null && _a !== void 0 ? _a : {},
|
|
166
167
|
},
|
|
167
168
|
};
|
|
168
169
|
}
|
|
@@ -171,14 +172,15 @@ const useResolvedVideoConfig = (preferredCompositionId) => {
|
|
|
171
172
|
type: 'success',
|
|
172
173
|
result: {
|
|
173
174
|
...composition,
|
|
174
|
-
defaultProps: {
|
|
175
|
-
|
|
175
|
+
defaultProps: (_b = composition.defaultProps) !== null && _b !== void 0 ? _b : {},
|
|
176
|
+
props: {
|
|
177
|
+
...((_c = composition.defaultProps) !== null && _c !== void 0 ? _c : {}),
|
|
176
178
|
...(selectedEditorProps !== null && selectedEditorProps !== void 0 ? selectedEditorProps : {}),
|
|
177
179
|
...(typeof window === 'undefined' ||
|
|
178
180
|
(0, get_environment_js_1.getRemotionEnvironment)() === 'player-development' ||
|
|
179
181
|
(0, get_environment_js_1.getRemotionEnvironment)() === 'player-production'
|
|
180
182
|
? {}
|
|
181
|
-
: (
|
|
183
|
+
: (_d = (0, input_props_js_1.getInputProps)()) !== null && _d !== void 0 ? _d : {}),
|
|
182
184
|
},
|
|
183
185
|
},
|
|
184
186
|
};
|
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/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;
|
|
@@ -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: '6';
|
|
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/internals.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ export declare const Internals: {
|
|
|
21
21
|
numberOfAudioTags: number;
|
|
22
22
|
}>;
|
|
23
23
|
useVideo: () => (import("./video-config.js").VideoConfig & {
|
|
24
|
-
component: import("react").LazyExoticComponent<import("react").ComponentType<Record<string, unknown
|
|
24
|
+
component: import("react").LazyExoticComponent<import("react").ComponentType<Record<string, unknown>>>;
|
|
25
25
|
}) | null;
|
|
26
26
|
getRoot: () => import("react").FC<{}> | null;
|
|
27
27
|
useMediaVolumeState: () => readonly [number, (u: number) => void];
|
|
@@ -65,13 +65,13 @@ export declare const Internals: {
|
|
|
65
65
|
SharedAudioContextProvider: import("react").FC<{
|
|
66
66
|
numberOfAudioTags: number;
|
|
67
67
|
children: import("react").ReactNode;
|
|
68
|
-
component: import("react").LazyExoticComponent<import("react").ComponentType<Record<string, unknown
|
|
68
|
+
component: import("react").LazyExoticComponent<import("react").ComponentType<Record<string, unknown>>> | null;
|
|
69
69
|
}>;
|
|
70
70
|
invalidCompositionErrorMessage: string;
|
|
71
71
|
isCompositionIdValid: (id: string) => RegExpMatchArray | null;
|
|
72
72
|
getPreviewDomElement: () => HTMLElement | null;
|
|
73
73
|
compositionsRef: import("react").RefObject<{
|
|
74
|
-
getCompositions: () => import("./CompositionManager.js").TCompMetadataWithCalcFunction<import("zod").AnyZodObject, Record<string, unknown
|
|
74
|
+
getCompositions: () => import("./CompositionManager.js").TCompMetadataWithCalcFunction<import("zod").AnyZodObject, Record<string, unknown>>[];
|
|
75
75
|
}>;
|
|
76
76
|
DELAY_RENDER_CALLSTACK_TOKEN: string;
|
|
77
77
|
portalNode: () => HTMLElement;
|
|
@@ -104,7 +104,7 @@ export declare const Internals: {
|
|
|
104
104
|
processColor: typeof processColor;
|
|
105
105
|
NonceContext: import("react").Context<import("./nonce.js").TNonceContext>;
|
|
106
106
|
resolveVideoConfig: ({ composition, editorProps: editorPropsOrUndefined, signal, }: {
|
|
107
|
-
composition: import("./CompositionManager.js").TCompMetadataWithCalcFunction<import("zod").AnyZodObject, Record<string, unknown
|
|
107
|
+
composition: import("./CompositionManager.js").TCompMetadataWithCalcFunction<import("zod").AnyZodObject, Record<string, unknown>>;
|
|
108
108
|
editorProps: object;
|
|
109
109
|
signal: AbortSignal;
|
|
110
110
|
}) => import("./video-config.js").VideoConfig | Promise<import("./video-config.js").VideoConfig>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { AnyZodObject, z } from 'zod';
|
|
2
2
|
type And<A extends boolean, B extends boolean> = A extends true ? B extends true ? true : false : false;
|
|
3
|
-
export type PropsIfHasProps<Schema extends AnyZodObject, Props extends Record<string, unknown
|
|
3
|
+
export type PropsIfHasProps<Schema extends AnyZodObject, Props extends Record<string, unknown>> = And<AnyZodObject extends Schema ? true : false, {} extends Props ? true : false> extends true ? {
|
|
4
4
|
defaultProps?: {};
|
|
5
5
|
} : {
|
|
6
6
|
defaultProps: InferProps<Schema, Props>;
|
|
7
7
|
};
|
|
8
|
-
export type InferProps<Schema extends AnyZodObject, Props extends Record<string, unknown
|
|
8
|
+
export type InferProps<Schema extends AnyZodObject, Props extends Record<string, unknown>> = AnyZodObject extends Schema ? {} extends Props ? Record<string, unknown> : Props : {} extends Props ? z.infer<Schema> : // Props and schema specified
|
|
9
9
|
z.infer<Schema> & Props;
|
|
10
10
|
export {};
|
|
@@ -2,7 +2,7 @@ import type { AnyZodObject } from 'zod';
|
|
|
2
2
|
import type { TCompMetadataWithCalcFunction } from './CompositionManager.js';
|
|
3
3
|
import type { VideoConfig } from './video-config.js';
|
|
4
4
|
export declare const resolveVideoConfig: ({ composition, editorProps: editorPropsOrUndefined, signal, }: {
|
|
5
|
-
composition: TCompMetadataWithCalcFunction<AnyZodObject, Record<string, unknown
|
|
5
|
+
composition: TCompMetadataWithCalcFunction<AnyZodObject, Record<string, unknown>>;
|
|
6
6
|
editorProps: object;
|
|
7
7
|
signal: AbortSignal;
|
|
8
8
|
}) => VideoConfig | Promise<VideoConfig>;
|
|
@@ -6,7 +6,7 @@ const get_environment_js_1 = require("./get-environment.js");
|
|
|
6
6
|
const validate_dimensions_js_1 = require("./validation/validate-dimensions.js");
|
|
7
7
|
const validate_duration_in_frames_js_1 = require("./validation/validate-duration-in-frames.js");
|
|
8
8
|
const resolveVideoConfig = ({ composition, editorProps: editorPropsOrUndefined, signal, }) => {
|
|
9
|
-
var _a, _b, _c, _d, _e, _f;
|
|
9
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
10
10
|
const calculatedProm = composition.calculateMetadata
|
|
11
11
|
? composition.calculateMetadata({
|
|
12
12
|
defaultProps: (_a = composition.defaultProps) !== null && _a !== void 0 ? _a : {},
|
|
@@ -26,7 +26,7 @@ const resolveVideoConfig = ({ composition, editorProps: editorPropsOrUndefined,
|
|
|
26
26
|
typeof calculatedProm === 'object' &&
|
|
27
27
|
'then' in calculatedProm) {
|
|
28
28
|
return calculatedProm.then((c) => {
|
|
29
|
-
var _a, _b;
|
|
29
|
+
var _a, _b, _c;
|
|
30
30
|
const { height, width, durationInFrames, fps } = validateCalculated({
|
|
31
31
|
calculated: c,
|
|
32
32
|
composition,
|
|
@@ -37,7 +37,8 @@ const resolveVideoConfig = ({ composition, editorProps: editorPropsOrUndefined,
|
|
|
37
37
|
fps,
|
|
38
38
|
durationInFrames,
|
|
39
39
|
id: composition.id,
|
|
40
|
-
defaultProps: (
|
|
40
|
+
defaultProps: (_a = composition.defaultProps) !== null && _a !== void 0 ? _a : {},
|
|
41
|
+
props: (_c = (_b = c.props) !== null && _b !== void 0 ? _b : composition.defaultProps) !== null && _c !== void 0 ? _c : {},
|
|
41
42
|
};
|
|
42
43
|
});
|
|
43
44
|
}
|
|
@@ -49,13 +50,15 @@ const resolveVideoConfig = ({ composition, editorProps: editorPropsOrUndefined,
|
|
|
49
50
|
return {
|
|
50
51
|
...data,
|
|
51
52
|
id: composition.id,
|
|
52
|
-
defaultProps: (_d = composition
|
|
53
|
+
defaultProps: (_d = composition.defaultProps) !== null && _d !== void 0 ? _d : {},
|
|
54
|
+
props: (_e = composition.defaultProps) !== null && _e !== void 0 ? _e : {},
|
|
53
55
|
};
|
|
54
56
|
}
|
|
55
57
|
return {
|
|
56
58
|
...data,
|
|
57
59
|
id: composition.id,
|
|
58
|
-
defaultProps: (_f =
|
|
60
|
+
defaultProps: (_f = composition.defaultProps) !== null && _f !== void 0 ? _f : {},
|
|
61
|
+
props: (_h = (_g = calculatedProm.props) !== null && _g !== void 0 ? _g : composition.defaultProps) !== null && _h !== void 0 ? _h : {},
|
|
59
62
|
};
|
|
60
63
|
};
|
|
61
64
|
exports.resolveVideoConfig = resolveVideoConfig;
|
package/dist/cjs/series/index.js
CHANGED
|
@@ -38,7 +38,7 @@ const Series = ({ children }) => {
|
|
|
38
38
|
throw new TypeError(`A <Series.Sequence /> component (${debugInfo}) was detected to not have any children. Delete it to fix this error.`);
|
|
39
39
|
}
|
|
40
40
|
const durationInFramesProp = castedChild.props.durationInFrames;
|
|
41
|
-
const { durationInFrames, children: _children, ...passedProps } = castedChild.props;
|
|
41
|
+
const { durationInFrames, children: _children, from, ...passedProps } = castedChild.props; // `from` is not accepted and must be filtered out if used in JS
|
|
42
42
|
if (i !== flattenedChildren.length - 1 ||
|
|
43
43
|
durationInFramesProp !== Infinity) {
|
|
44
44
|
(0, validate_duration_in_frames_js_1.validateDurationInFrames)({
|
|
@@ -13,7 +13,7 @@ const useUnsafeVideoConfig = () => {
|
|
|
13
13
|
if (!video) {
|
|
14
14
|
return null;
|
|
15
15
|
}
|
|
16
|
-
const { id, durationInFrames, fps, height, width, defaultProps } = video;
|
|
16
|
+
const { id, durationInFrames, fps, height, width, defaultProps, props } = video;
|
|
17
17
|
return {
|
|
18
18
|
id,
|
|
19
19
|
width,
|
|
@@ -21,6 +21,7 @@ const useUnsafeVideoConfig = () => {
|
|
|
21
21
|
fps,
|
|
22
22
|
durationInFrames: ctxDuration !== null && ctxDuration !== void 0 ? ctxDuration : durationInFrames,
|
|
23
23
|
defaultProps,
|
|
24
|
+
props,
|
|
24
25
|
};
|
|
25
26
|
}, [ctxDuration, video]);
|
|
26
27
|
};
|
package/dist/cjs/use-video.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ComponentType, LazyExoticComponent } from 'react';
|
|
2
2
|
import type { VideoConfig } from './video-config.js';
|
|
3
3
|
type ReturnType = (VideoConfig & {
|
|
4
|
-
component: LazyExoticComponent<ComponentType<Record<string, unknown
|
|
4
|
+
component: LazyExoticComponent<ComponentType<Record<string, unknown>>>;
|
|
5
5
|
}) | null;
|
|
6
6
|
export declare const useVideo: () => ReturnType;
|
|
7
7
|
export {};
|
package/dist/cjs/use-video.js
CHANGED
|
@@ -11,7 +11,7 @@ const useVideo = () => {
|
|
|
11
11
|
});
|
|
12
12
|
const resolved = (0, ResolveCompositionConfig_js_1.useResolvedVideoConfig)(context.currentComposition);
|
|
13
13
|
return (0, react_1.useMemo)(() => {
|
|
14
|
-
var _a;
|
|
14
|
+
var _a, _b;
|
|
15
15
|
if (!resolved) {
|
|
16
16
|
return null;
|
|
17
17
|
}
|
|
@@ -26,11 +26,11 @@ const useVideo = () => {
|
|
|
26
26
|
}
|
|
27
27
|
return {
|
|
28
28
|
...resolved.result,
|
|
29
|
-
defaultProps: selected.defaultProps,
|
|
29
|
+
defaultProps: (_a = selected.defaultProps) !== null && _a !== void 0 ? _a : {},
|
|
30
30
|
id: selected.id,
|
|
31
31
|
// We override the selected metadata with the metadata that was passed to renderMedia(),
|
|
32
32
|
// and don't allow it to be changed during render anymore
|
|
33
|
-
...((
|
|
33
|
+
...((_b = context.currentCompositionMetadata) !== null && _b !== void 0 ? _b : {}),
|
|
34
34
|
component: selected.component,
|
|
35
35
|
};
|
|
36
36
|
}, [context.currentCompositionMetadata, resolved, selected]);
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "4.1.0-
|
|
1
|
+
export declare const VERSION = "4.1.0-alpha5";
|
package/dist/cjs/version.js
CHANGED
|
@@ -14,7 +14,9 @@ const VideoForDevelopment_js_1 = require("./VideoForDevelopment.js");
|
|
|
14
14
|
* @see [Documentation](https://www.remotion.dev/docs/offthreadvideo)
|
|
15
15
|
*/
|
|
16
16
|
const OffthreadVideo = (props) => {
|
|
17
|
-
|
|
17
|
+
// Should only destruct `startFrom` and `endAt` from props,
|
|
18
|
+
// rest gets drilled down
|
|
19
|
+
const { startFrom, endAt, ...otherProps } = props;
|
|
18
20
|
const environment = (0, get_environment_js_1.useRemotionEnvironment)();
|
|
19
21
|
const onDuration = (0, react_1.useCallback)(() => undefined, []);
|
|
20
22
|
if (typeof props.src !== 'string') {
|
|
@@ -31,7 +33,7 @@ const OffthreadVideo = (props) => {
|
|
|
31
33
|
}
|
|
32
34
|
(0, validate_media_props_js_1.validateMediaProps)(props, 'Video');
|
|
33
35
|
if (environment === 'rendering') {
|
|
34
|
-
return (
|
|
36
|
+
return (0, jsx_runtime_1.jsx)(OffthreadVideoForRendering_js_1.OffthreadVideoForRendering, { ...otherProps });
|
|
35
37
|
}
|
|
36
38
|
return ((0, jsx_runtime_1.jsx)(VideoForDevelopment_js_1.VideoForDevelopment, { onDuration: onDuration, onlyWarnForMediaSeekingError: true, ...otherProps }));
|
|
37
39
|
};
|
package/dist/esm/index.mjs
CHANGED
|
@@ -58,7 +58,7 @@ function truthy(value) {
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
// Automatically generated on publish
|
|
61
|
-
const VERSION = '4.1.0-
|
|
61
|
+
const VERSION = '4.1.0-alpha5';
|
|
62
62
|
|
|
63
63
|
const checkMultipleRemotionVersions = () => {
|
|
64
64
|
if (typeof globalThis === 'undefined') {
|
|
@@ -378,7 +378,7 @@ const validateDurationInFrames = ({ allowFloats, component, durationInFrames, })
|
|
|
378
378
|
};
|
|
379
379
|
|
|
380
380
|
const resolveVideoConfig = ({ composition, editorProps: editorPropsOrUndefined, signal, }) => {
|
|
381
|
-
var _a, _b, _c, _d, _e, _f;
|
|
381
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
382
382
|
const calculatedProm = composition.calculateMetadata
|
|
383
383
|
? composition.calculateMetadata({
|
|
384
384
|
defaultProps: (_a = composition.defaultProps) !== null && _a !== void 0 ? _a : {},
|
|
@@ -398,7 +398,7 @@ const resolveVideoConfig = ({ composition, editorProps: editorPropsOrUndefined,
|
|
|
398
398
|
typeof calculatedProm === 'object' &&
|
|
399
399
|
'then' in calculatedProm) {
|
|
400
400
|
return calculatedProm.then((c) => {
|
|
401
|
-
var _a, _b;
|
|
401
|
+
var _a, _b, _c;
|
|
402
402
|
const { height, width, durationInFrames, fps } = validateCalculated({
|
|
403
403
|
calculated: c,
|
|
404
404
|
composition,
|
|
@@ -409,7 +409,8 @@ const resolveVideoConfig = ({ composition, editorProps: editorPropsOrUndefined,
|
|
|
409
409
|
fps,
|
|
410
410
|
durationInFrames,
|
|
411
411
|
id: composition.id,
|
|
412
|
-
defaultProps: (
|
|
412
|
+
defaultProps: (_a = composition.defaultProps) !== null && _a !== void 0 ? _a : {},
|
|
413
|
+
props: (_c = (_b = c.props) !== null && _b !== void 0 ? _b : composition.defaultProps) !== null && _c !== void 0 ? _c : {},
|
|
413
414
|
};
|
|
414
415
|
});
|
|
415
416
|
}
|
|
@@ -421,13 +422,15 @@ const resolveVideoConfig = ({ composition, editorProps: editorPropsOrUndefined,
|
|
|
421
422
|
return {
|
|
422
423
|
...data,
|
|
423
424
|
id: composition.id,
|
|
424
|
-
defaultProps: (_d = composition
|
|
425
|
+
defaultProps: (_d = composition.defaultProps) !== null && _d !== void 0 ? _d : {},
|
|
426
|
+
props: (_e = composition.defaultProps) !== null && _e !== void 0 ? _e : {},
|
|
425
427
|
};
|
|
426
428
|
}
|
|
427
429
|
return {
|
|
428
430
|
...data,
|
|
429
431
|
id: composition.id,
|
|
430
|
-
defaultProps: (_f =
|
|
432
|
+
defaultProps: (_f = composition.defaultProps) !== null && _f !== void 0 ? _f : {},
|
|
433
|
+
props: (_h = (_g = calculatedProm.props) !== null && _g !== void 0 ? _g : composition.defaultProps) !== null && _h !== void 0 ? _h : {},
|
|
431
434
|
};
|
|
432
435
|
};
|
|
433
436
|
const validateCalculated = ({ composition, calculated, }) => {
|
|
@@ -601,7 +604,7 @@ const useResolvedVideoConfig = (preferredCompositionId) => {
|
|
|
601
604
|
return composition ? (_a = allEditorProps[composition.id]) !== null && _a !== void 0 ? _a : {} : {};
|
|
602
605
|
}, [allEditorProps, composition]);
|
|
603
606
|
return useMemo(() => {
|
|
604
|
-
var _a, _b, _c;
|
|
607
|
+
var _a, _b, _c, _d;
|
|
605
608
|
if (!composition) {
|
|
606
609
|
return null;
|
|
607
610
|
}
|
|
@@ -611,7 +614,8 @@ const useResolvedVideoConfig = (preferredCompositionId) => {
|
|
|
611
614
|
result: {
|
|
612
615
|
...currentCompositionMetadata,
|
|
613
616
|
id: composition.id,
|
|
614
|
-
|
|
617
|
+
props: currentCompositionMetadata.props,
|
|
618
|
+
defaultProps: (_a = composition.defaultProps) !== null && _a !== void 0 ? _a : {},
|
|
615
619
|
},
|
|
616
620
|
};
|
|
617
621
|
}
|
|
@@ -620,14 +624,15 @@ const useResolvedVideoConfig = (preferredCompositionId) => {
|
|
|
620
624
|
type: 'success',
|
|
621
625
|
result: {
|
|
622
626
|
...composition,
|
|
623
|
-
defaultProps: {
|
|
624
|
-
|
|
627
|
+
defaultProps: (_b = composition.defaultProps) !== null && _b !== void 0 ? _b : {},
|
|
628
|
+
props: {
|
|
629
|
+
...((_c = composition.defaultProps) !== null && _c !== void 0 ? _c : {}),
|
|
625
630
|
...(selectedEditorProps !== null && selectedEditorProps !== void 0 ? selectedEditorProps : {}),
|
|
626
631
|
...(typeof window === 'undefined' ||
|
|
627
632
|
getRemotionEnvironment() === 'player-development' ||
|
|
628
633
|
getRemotionEnvironment() === 'player-production'
|
|
629
634
|
? {}
|
|
630
|
-
: (
|
|
635
|
+
: (_d = getInputProps()) !== null && _d !== void 0 ? _d : {}),
|
|
631
636
|
},
|
|
632
637
|
},
|
|
633
638
|
};
|
|
@@ -646,7 +651,7 @@ const useVideo = () => {
|
|
|
646
651
|
});
|
|
647
652
|
const resolved = useResolvedVideoConfig(context.currentComposition);
|
|
648
653
|
return useMemo(() => {
|
|
649
|
-
var _a;
|
|
654
|
+
var _a, _b;
|
|
650
655
|
if (!resolved) {
|
|
651
656
|
return null;
|
|
652
657
|
}
|
|
@@ -661,11 +666,11 @@ const useVideo = () => {
|
|
|
661
666
|
}
|
|
662
667
|
return {
|
|
663
668
|
...resolved.result,
|
|
664
|
-
defaultProps: selected.defaultProps,
|
|
669
|
+
defaultProps: (_a = selected.defaultProps) !== null && _a !== void 0 ? _a : {},
|
|
665
670
|
id: selected.id,
|
|
666
671
|
// We override the selected metadata with the metadata that was passed to renderMedia(),
|
|
667
672
|
// and don't allow it to be changed during render anymore
|
|
668
|
-
...((
|
|
673
|
+
...((_b = context.currentCompositionMetadata) !== null && _b !== void 0 ? _b : {}),
|
|
669
674
|
component: selected.component,
|
|
670
675
|
};
|
|
671
676
|
}, [context.currentCompositionMetadata, resolved, selected]);
|
|
@@ -736,7 +741,7 @@ const useUnsafeVideoConfig = () => {
|
|
|
736
741
|
if (!video) {
|
|
737
742
|
return null;
|
|
738
743
|
}
|
|
739
|
-
const { id, durationInFrames, fps, height, width, defaultProps } = video;
|
|
744
|
+
const { id, durationInFrames, fps, height, width, defaultProps, props } = video;
|
|
740
745
|
return {
|
|
741
746
|
id,
|
|
742
747
|
width,
|
|
@@ -744,6 +749,7 @@ const useUnsafeVideoConfig = () => {
|
|
|
744
749
|
fps,
|
|
745
750
|
durationInFrames: ctxDuration !== null && ctxDuration !== void 0 ? ctxDuration : durationInFrames,
|
|
746
751
|
defaultProps,
|
|
752
|
+
props,
|
|
747
753
|
};
|
|
748
754
|
}, [ctxDuration, video]);
|
|
749
755
|
};
|
|
@@ -2493,14 +2499,14 @@ const Composition = ({ width, height, fps, durationInFrames, id, defaultProps, s
|
|
|
2493
2499
|
if (resolved === null || resolved.type !== 'success') {
|
|
2494
2500
|
return null;
|
|
2495
2501
|
}
|
|
2496
|
-
return createPortal(jsx(ClipComposition, { children: jsx(CanUseRemotionHooksProvider, { children: jsx(Suspense, { fallback: jsx(Loading, {}), children: jsx(Comp, { ...((_a = resolved.result.
|
|
2502
|
+
return createPortal(jsx(ClipComposition, { children: jsx(CanUseRemotionHooksProvider, { children: jsx(Suspense, { fallback: jsx(Loading, {}), children: jsx(Comp, { ...((_a = resolved.result.props) !== null && _a !== void 0 ? _a : {}) }) }) }) }), portalNode());
|
|
2497
2503
|
}
|
|
2498
2504
|
if (environment === 'rendering' && video && video.component === lazy) {
|
|
2499
2505
|
const Comp = lazy;
|
|
2500
2506
|
if (resolved === null || resolved.type !== 'success') {
|
|
2501
2507
|
return null;
|
|
2502
2508
|
}
|
|
2503
|
-
return createPortal(jsx(CanUseRemotionHooksProvider, { children: jsx(Suspense, { fallback: jsx(Fallback, {}), children: jsx(Comp, { ...((_b = resolved.result.
|
|
2509
|
+
return createPortal(jsx(CanUseRemotionHooksProvider, { children: jsx(Suspense, { fallback: jsx(Fallback, {}), children: jsx(Comp, { ...((_b = resolved.result.props) !== null && _b !== void 0 ? _b : {}) }) }) }), portalNode());
|
|
2504
2510
|
}
|
|
2505
2511
|
return null;
|
|
2506
2512
|
};
|
package/dist/esm/version.mjs
CHANGED