remotion 4.0.42 → 4.0.44
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/CompositionManager.js +8 -5
- package/dist/cjs/CompositionManagerContext.d.ts +9 -2
- package/dist/cjs/CompositionManagerContext.js +2 -2
- package/dist/cjs/Img.d.ts +5 -4
- package/dist/cjs/RenderAssetManager.js +1 -0
- package/dist/cjs/ResolveCompositionConfig.js +7 -3
- package/dist/cjs/Sequence.d.ts +1 -1
- package/dist/cjs/Sequence.js +1 -1
- package/dist/cjs/index.d.ts +3 -2
- package/dist/cjs/index.js +3 -2
- package/dist/cjs/interpolate.d.ts +2 -1
- package/dist/cjs/use-video.js +9 -7
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/video/Video.js +1 -1
- package/dist/esm/index.mjs +30 -20
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
|
@@ -38,8 +38,8 @@ const CompositionManagerProvider = ({ children, numberOfAudioTags }) => {
|
|
|
38
38
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
39
39
|
const [compositions, setCompositions] = (0, react_1.useState)([]);
|
|
40
40
|
const currentcompositionsRef = (0, react_1.useRef)(compositions);
|
|
41
|
-
const [currentComposition, setCurrentComposition] = (0, react_1.useState)(null);
|
|
42
41
|
const [folders, setFolders] = (0, react_1.useState)([]);
|
|
42
|
+
const [canvasContent, setCanvasContent] = (0, react_1.useState)(null);
|
|
43
43
|
const [currentCompositionMetadata, setCurrentCompositionMetadata] = (0, react_1.useState)(null);
|
|
44
44
|
const updateCompositions = (0, react_1.useCallback)((
|
|
45
45
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -88,29 +88,32 @@ const CompositionManagerProvider = ({ children, numberOfAudioTags }) => {
|
|
|
88
88
|
getCompositions: () => currentcompositionsRef.current,
|
|
89
89
|
};
|
|
90
90
|
}, []);
|
|
91
|
-
const composition = compositions.find((c) =>
|
|
91
|
+
const composition = compositions.find((c) => (canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) === 'composition'
|
|
92
|
+
? c.id === canvasContent.compositionId
|
|
93
|
+
: null);
|
|
92
94
|
const contextValue = (0, react_1.useMemo)(() => {
|
|
93
95
|
return {
|
|
94
96
|
compositions,
|
|
95
97
|
registerComposition,
|
|
96
98
|
unregisterComposition,
|
|
97
|
-
currentComposition,
|
|
98
|
-
setCurrentComposition,
|
|
99
99
|
folders,
|
|
100
100
|
registerFolder,
|
|
101
101
|
unregisterFolder,
|
|
102
102
|
currentCompositionMetadata,
|
|
103
103
|
setCurrentCompositionMetadata,
|
|
104
|
+
canvasContent,
|
|
105
|
+
setCanvasContent,
|
|
104
106
|
};
|
|
105
107
|
}, [
|
|
106
108
|
compositions,
|
|
107
109
|
registerComposition,
|
|
108
110
|
unregisterComposition,
|
|
109
|
-
currentComposition,
|
|
110
111
|
folders,
|
|
111
112
|
registerFolder,
|
|
112
113
|
unregisterFolder,
|
|
113
114
|
currentCompositionMetadata,
|
|
115
|
+
canvasContent,
|
|
116
|
+
setCanvasContent,
|
|
114
117
|
]);
|
|
115
118
|
return ((0, jsx_runtime_1.jsx)(CompositionManagerContext_js_1.CompositionManager.Provider, { value: contextValue, children: (0, jsx_runtime_1.jsx)(SequenceManager_js_1.SequenceManagerProvider, { children: (0, jsx_runtime_1.jsx)(RenderAssetManager_js_1.RenderAssetManagerProvider, { children: (0, jsx_runtime_1.jsx)(ResolveCompositionConfig_js_1.ResolveCompositionConfig, { children: (0, jsx_runtime_1.jsx)(shared_audio_tags_js_1.SharedAudioContextProvider, { numberOfAudioTags: numberOfAudioTags, component: (_a = composition === null || composition === void 0 ? void 0 : composition.component) !== null && _a !== void 0 ? _a : null, children: children }) }) }) }) }));
|
|
116
119
|
};
|
|
@@ -4,16 +4,23 @@ 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
6
|
export type BaseMetadata = Pick<VideoConfig, 'durationInFrames' | 'fps' | 'props' | 'height' | 'width'>;
|
|
7
|
+
export type CanvasContent = {
|
|
8
|
+
type: 'composition';
|
|
9
|
+
compositionId: string;
|
|
10
|
+
} | {
|
|
11
|
+
type: 'asset';
|
|
12
|
+
asset: string;
|
|
13
|
+
};
|
|
7
14
|
export type CompositionManagerContext = {
|
|
8
15
|
compositions: AnyComposition[];
|
|
9
16
|
registerComposition: <Schema extends AnyZodObject, Props extends Record<string, unknown>>(comp: TComposition<Schema, Props>) => void;
|
|
10
17
|
unregisterComposition: (name: string) => void;
|
|
11
18
|
registerFolder: (name: string, parent: string | null) => void;
|
|
12
19
|
unregisterFolder: (name: string, parent: string | null) => void;
|
|
13
|
-
currentComposition: string | null;
|
|
14
|
-
setCurrentComposition: (curr: string) => void;
|
|
15
20
|
setCurrentCompositionMetadata: (metadata: BaseMetadata) => void;
|
|
16
21
|
currentCompositionMetadata: BaseMetadata | null;
|
|
17
22
|
folders: TFolder[];
|
|
23
|
+
canvasContent: CanvasContent | null;
|
|
24
|
+
setCanvasContent: (canvasContent: CanvasContent | null) => void;
|
|
18
25
|
};
|
|
19
26
|
export declare const CompositionManager: import("react").Context<CompositionManagerContext>;
|
|
@@ -8,9 +8,9 @@ exports.CompositionManager = (0, react_1.createContext)({
|
|
|
8
8
|
unregisterComposition: () => undefined,
|
|
9
9
|
registerFolder: () => undefined,
|
|
10
10
|
unregisterFolder: () => undefined,
|
|
11
|
-
currentComposition: null,
|
|
12
|
-
setCurrentComposition: () => undefined,
|
|
13
11
|
setCurrentCompositionMetadata: () => undefined,
|
|
14
12
|
folders: [],
|
|
15
13
|
currentCompositionMetadata: null,
|
|
14
|
+
canvasContent: null,
|
|
15
|
+
setCanvasContent: () => undefined,
|
|
16
16
|
});
|
package/dist/cjs/Img.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
export type ImgProps = Omit<React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, 'src'> & {
|
|
3
|
+
maxRetries?: number;
|
|
4
|
+
src: string;
|
|
5
|
+
};
|
|
2
6
|
/**
|
|
3
7
|
* @description Works just like a regular HTML img tag. When you use the <Img> tag, Remotion will ensure that the image is loaded before rendering the frame.
|
|
4
8
|
* @see [Documentation](https://www.remotion.dev/docs/img)
|
|
5
9
|
*/
|
|
6
|
-
export declare const Img: React.ForwardRefExoticComponent<Pick<
|
|
7
|
-
maxRetries?: number | undefined;
|
|
8
|
-
src: string;
|
|
9
|
-
}, "width" | "height" | "id" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "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" | "loading" | "referrerPolicy" | "alt" | "decoding" | "sizes" | "srcSet" | "useMap" | "maxRetries"> & React.RefAttributes<HTMLImageElement>>;
|
|
10
|
+
export declare const Img: React.ForwardRefExoticComponent<Pick<ImgProps, "width" | "height" | "id" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "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" | "loading" | "referrerPolicy" | "alt" | "decoding" | "sizes" | "srcSet" | "useMap" | "maxRetries"> & React.RefAttributes<HTMLImageElement>>;
|
|
@@ -4,6 +4,7 @@ exports.RenderAssetManagerProvider = exports.RenderAssetManager = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
exports.RenderAssetManager = (0, react_1.createContext)({
|
|
7
|
+
// Must be undefined, otherwise error in Player
|
|
7
8
|
registerRenderAsset: () => undefined,
|
|
8
9
|
unregisterRenderAsset: () => undefined,
|
|
9
10
|
renderAssets: [],
|
|
@@ -12,8 +12,10 @@ exports.ResolveCompositionContext = (0, react_1.createContext)(null);
|
|
|
12
12
|
exports.resolveCompositionsRef = (0, react_1.createRef)();
|
|
13
13
|
const ResolveCompositionConfig = ({ children }) => {
|
|
14
14
|
const [currentRenderModalComposition, setCurrentRenderModalComposition] = (0, react_1.useState)(null);
|
|
15
|
-
const { compositions,
|
|
16
|
-
const selectedComposition = compositions.find((c) =>
|
|
15
|
+
const { compositions, canvasContent, currentCompositionMetadata } = (0, react_1.useContext)(CompositionManagerContext_js_1.CompositionManager);
|
|
16
|
+
const selectedComposition = compositions.find((c) => canvasContent &&
|
|
17
|
+
canvasContent.type === 'composition' &&
|
|
18
|
+
canvasContent.compositionId === c.id);
|
|
17
19
|
const renderModalComposition = compositions.find((c) => c.id === currentRenderModalComposition);
|
|
18
20
|
const { props: allEditorProps } = (0, react_1.useContext)(EditorProps_js_1.EditorPropsContext);
|
|
19
21
|
const [resolvedConfigs, setResolvedConfigs] = (0, react_1.useState)({});
|
|
@@ -89,6 +91,7 @@ const ResolveCompositionConfig = ({ children }) => {
|
|
|
89
91
|
}
|
|
90
92
|
return controller;
|
|
91
93
|
}, [currentCompositionMetadata]);
|
|
94
|
+
const currentComposition = (canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) === 'composition' ? canvasContent.compositionId : null;
|
|
92
95
|
(0, react_1.useImperativeHandle)(exports.resolveCompositionsRef, () => {
|
|
93
96
|
return {
|
|
94
97
|
setCurrentRenderModalComposition: (id) => {
|
|
@@ -153,7 +156,8 @@ exports.needsResolution = needsResolution;
|
|
|
153
156
|
const useResolvedVideoConfig = (preferredCompositionId) => {
|
|
154
157
|
const context = (0, react_1.useContext)(exports.ResolveCompositionContext);
|
|
155
158
|
const { props: allEditorProps } = (0, react_1.useContext)(EditorProps_js_1.EditorPropsContext);
|
|
156
|
-
const { compositions,
|
|
159
|
+
const { compositions, canvasContent, currentCompositionMetadata } = (0, react_1.useContext)(CompositionManagerContext_js_1.CompositionManager);
|
|
160
|
+
const currentComposition = (canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) === 'composition' ? canvasContent.compositionId : null;
|
|
157
161
|
const compositionId = preferredCompositionId !== null && preferredCompositionId !== void 0 ? preferredCompositionId : currentComposition;
|
|
158
162
|
const composition = compositions.find((c) => c.id === compositionId);
|
|
159
163
|
const selectedEditorProps = (0, react_1.useMemo)(() => {
|
package/dist/cjs/Sequence.d.ts
CHANGED
|
@@ -23,6 +23,6 @@ export type SequenceProps = {
|
|
|
23
23
|
} & LayoutAndStyle;
|
|
24
24
|
/**
|
|
25
25
|
* @description A component that time-shifts its children and wraps them in an absolutely positioned <div>.
|
|
26
|
-
* @see [Documentation](https://www.remotion.dev/docs/sequence
|
|
26
|
+
* @see [Documentation](https://www.remotion.dev/docs/sequence)
|
|
27
27
|
*/
|
|
28
28
|
export declare const Sequence: React.ForwardRefExoticComponent<SequenceProps & React.RefAttributes<HTMLDivElement>>;
|
package/dist/cjs/Sequence.js
CHANGED
|
@@ -120,6 +120,6 @@ const SequenceRefForwardingFunction = ({ from = 0, durationInFrames = Infinity,
|
|
|
120
120
|
};
|
|
121
121
|
/**
|
|
122
122
|
* @description A component that time-shifts its children and wraps them in an absolutely positioned <div>.
|
|
123
|
-
* @see [Documentation](https://www.remotion.dev/docs/sequence
|
|
123
|
+
* @see [Documentation](https://www.remotion.dev/docs/sequence)
|
|
124
124
|
*/
|
|
125
125
|
exports.Sequence = (0, react_1.forwardRef)(SequenceRefForwardingFunction);
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -67,6 +67,7 @@ export * from './audio/index.js';
|
|
|
67
67
|
export { cancelRender } from './cancel-render.js';
|
|
68
68
|
export { CalculateMetadataFunction, Composition, CompositionProps, CompProps, StillProps, } from './Composition.js';
|
|
69
69
|
export { AnyCompMetadata, AnyComposition, SmallTCompMetadata, TCompMetadata, TRenderAsset, } from './CompositionManager.js';
|
|
70
|
+
export type { CanvasContent } from './CompositionManagerContext.js';
|
|
70
71
|
export { getInputProps } from './config/input-props.js';
|
|
71
72
|
export { continueRender, delayRender } from './delay-render.js';
|
|
72
73
|
export * from './easing.js';
|
|
@@ -75,10 +76,10 @@ export * from './freeze.js';
|
|
|
75
76
|
export { getRemotionEnvironment } from './get-remotion-environment.js';
|
|
76
77
|
export { getStaticFiles, StaticFile } from './get-static-files.js';
|
|
77
78
|
export * from './IFrame.js';
|
|
78
|
-
export
|
|
79
|
+
export { Img, ImgProps } from './Img.js';
|
|
79
80
|
export * from './internals.js';
|
|
80
81
|
export { interpolateColors } from './interpolate-colors.js';
|
|
81
|
-
export { ExtrapolateType, interpolate, InterpolateOptions, } from './interpolate.js';
|
|
82
|
+
export { EasingFunction, ExtrapolateType, interpolate, InterpolateOptions, } from './interpolate.js';
|
|
82
83
|
export { Loop } from './loop/index.js';
|
|
83
84
|
export { ClipRegion } from './NativeLayers.js';
|
|
84
85
|
export { prefetch } from './prefetch.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.useCurrentFrame = exports.staticFile = exports.Series = exports.Sequence = exports.registerRoot = exports.random = exports.prefetch = exports.Loop = exports.interpolate = exports.interpolateColors = exports.getStaticFiles = exports.getRemotionEnvironment = exports.delayRender = exports.continueRender = exports.getInputProps = exports.Composition = exports.cancelRender = void 0;
|
|
17
|
+
exports.Config = exports.Experimental = exports.useCurrentFrame = exports.staticFile = exports.Series = exports.Sequence = exports.registerRoot = exports.random = exports.prefetch = exports.Loop = exports.interpolate = exports.interpolateColors = exports.Img = exports.getStaticFiles = exports.getRemotionEnvironment = exports.delayRender = exports.continueRender = exports.getInputProps = exports.Composition = exports.cancelRender = void 0;
|
|
18
18
|
require("./asset-types.js");
|
|
19
19
|
const Clipper_js_1 = require("./Clipper.js");
|
|
20
20
|
const is_player_js_1 = require("./is-player.js");
|
|
@@ -40,7 +40,8 @@ Object.defineProperty(exports, "getRemotionEnvironment", { enumerable: true, get
|
|
|
40
40
|
var get_static_files_js_1 = require("./get-static-files.js");
|
|
41
41
|
Object.defineProperty(exports, "getStaticFiles", { enumerable: true, get: function () { return get_static_files_js_1.getStaticFiles; } });
|
|
42
42
|
__exportStar(require("./IFrame.js"), exports);
|
|
43
|
-
|
|
43
|
+
var Img_js_1 = require("./Img.js");
|
|
44
|
+
Object.defineProperty(exports, "Img", { enumerable: true, get: function () { return Img_js_1.Img; } });
|
|
44
45
|
__exportStar(require("./internals.js"), exports);
|
|
45
46
|
var interpolate_colors_js_1 = require("./interpolate-colors.js");
|
|
46
47
|
Object.defineProperty(exports, "interpolateColors", { enumerable: true, get: function () { return interpolate_colors_js_1.interpolateColors; } });
|
|
@@ -3,8 +3,9 @@ export type ExtrapolateType = 'extend' | 'identity' | 'clamp';
|
|
|
3
3
|
* @description This function allows you to map a range of values to another with a conside syntax
|
|
4
4
|
* @see [Documentation](https://www.remotion.dev/docs/interpolate)
|
|
5
5
|
*/
|
|
6
|
+
export type EasingFunction = (input: number) => number;
|
|
6
7
|
export type InterpolateOptions = Partial<{
|
|
7
|
-
easing:
|
|
8
|
+
easing: EasingFunction;
|
|
8
9
|
extrapolateLeft: ExtrapolateType;
|
|
9
10
|
extrapolateRight: ExtrapolateType;
|
|
10
11
|
}>;
|
package/dist/cjs/use-video.js
CHANGED
|
@@ -5,13 +5,15 @@ const react_1 = require("react");
|
|
|
5
5
|
const CompositionManagerContext_js_1 = require("./CompositionManagerContext.js");
|
|
6
6
|
const ResolveCompositionConfig_js_1 = require("./ResolveCompositionConfig.js");
|
|
7
7
|
const useVideo = () => {
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
|
|
8
|
+
var _a;
|
|
9
|
+
const { canvasContent, compositions, currentCompositionMetadata } = (0, react_1.useContext)(CompositionManagerContext_js_1.CompositionManager);
|
|
10
|
+
const selected = compositions.find((c) => {
|
|
11
|
+
return ((canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) === 'composition' &&
|
|
12
|
+
c.id === canvasContent.compositionId);
|
|
11
13
|
});
|
|
12
|
-
const resolved = (0, ResolveCompositionConfig_js_1.useResolvedVideoConfig)(
|
|
14
|
+
const resolved = (0, ResolveCompositionConfig_js_1.useResolvedVideoConfig)((_a = selected === null || selected === void 0 ? void 0 : selected.id) !== null && _a !== void 0 ? _a : null);
|
|
13
15
|
return (0, react_1.useMemo)(() => {
|
|
14
|
-
var _a
|
|
16
|
+
var _a;
|
|
15
17
|
if (!resolved) {
|
|
16
18
|
return null;
|
|
17
19
|
}
|
|
@@ -30,9 +32,9 @@ const useVideo = () => {
|
|
|
30
32
|
id: selected.id,
|
|
31
33
|
// We override the selected metadata with the metadata that was passed to renderMedia(),
|
|
32
34
|
// and don't allow it to be changed during render anymore
|
|
33
|
-
...(
|
|
35
|
+
...(currentCompositionMetadata !== null && currentCompositionMetadata !== void 0 ? currentCompositionMetadata : {}),
|
|
34
36
|
component: selected.component,
|
|
35
37
|
};
|
|
36
|
-
}, [
|
|
38
|
+
}, [currentCompositionMetadata, resolved, selected]);
|
|
37
39
|
};
|
|
38
40
|
exports.useVideo = useVideo;
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "4.0.
|
|
1
|
+
export declare const VERSION = "4.0.44";
|
package/dist/cjs/version.js
CHANGED
package/dist/cjs/video/Video.js
CHANGED
|
@@ -37,7 +37,7 @@ const VideoForwardingFunction = (props, ref) => {
|
|
|
37
37
|
mediaDuration,
|
|
38
38
|
playbackRate: (_a = props.playbackRate) !== null && _a !== void 0 ? _a : 1,
|
|
39
39
|
startFrom,
|
|
40
|
-
}), children: (0, jsx_runtime_1.jsx)(exports.Video, { ...propsOtherThanLoop, ref: ref }) }));
|
|
40
|
+
}), layout: "none", children: (0, jsx_runtime_1.jsx)(exports.Video, { ...propsOtherThanLoop, ref: ref }) }));
|
|
41
41
|
}
|
|
42
42
|
if (typeof startFrom !== 'undefined' || typeof endAt !== 'undefined') {
|
|
43
43
|
(0, validate_start_from_props_js_1.validateStartFromProps)(startFrom, endAt);
|
package/dist/esm/index.mjs
CHANGED
|
@@ -59,7 +59,7 @@ function truthy(value) {
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
// Automatically generated on publish
|
|
62
|
-
const VERSION = '4.0.
|
|
62
|
+
const VERSION = '4.0.44';
|
|
63
63
|
|
|
64
64
|
const checkMultipleRemotionVersions = () => {
|
|
65
65
|
if (typeof globalThis === 'undefined') {
|
|
@@ -318,11 +318,11 @@ const CompositionManager = createContext({
|
|
|
318
318
|
unregisterComposition: () => undefined,
|
|
319
319
|
registerFolder: () => undefined,
|
|
320
320
|
unregisterFolder: () => undefined,
|
|
321
|
-
currentComposition: null,
|
|
322
|
-
setCurrentComposition: () => undefined,
|
|
323
321
|
setCurrentCompositionMetadata: () => undefined,
|
|
324
322
|
folders: [],
|
|
325
323
|
currentCompositionMetadata: null,
|
|
324
|
+
canvasContent: null,
|
|
325
|
+
setCanvasContent: () => undefined,
|
|
326
326
|
});
|
|
327
327
|
|
|
328
328
|
const problematicCharacters = {
|
|
@@ -648,8 +648,10 @@ const ResolveCompositionContext = createContext(null);
|
|
|
648
648
|
const resolveCompositionsRef = createRef();
|
|
649
649
|
const ResolveCompositionConfig = ({ children }) => {
|
|
650
650
|
const [currentRenderModalComposition, setCurrentRenderModalComposition] = useState(null);
|
|
651
|
-
const { compositions,
|
|
652
|
-
const selectedComposition = compositions.find((c) =>
|
|
651
|
+
const { compositions, canvasContent, currentCompositionMetadata } = useContext(CompositionManager);
|
|
652
|
+
const selectedComposition = compositions.find((c) => canvasContent &&
|
|
653
|
+
canvasContent.type === 'composition' &&
|
|
654
|
+
canvasContent.compositionId === c.id);
|
|
653
655
|
const renderModalComposition = compositions.find((c) => c.id === currentRenderModalComposition);
|
|
654
656
|
const { props: allEditorProps } = useContext(EditorPropsContext);
|
|
655
657
|
const [resolvedConfigs, setResolvedConfigs] = useState({});
|
|
@@ -725,6 +727,7 @@ const ResolveCompositionConfig = ({ children }) => {
|
|
|
725
727
|
}
|
|
726
728
|
return controller;
|
|
727
729
|
}, [currentCompositionMetadata]);
|
|
730
|
+
const currentComposition = (canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) === 'composition' ? canvasContent.compositionId : null;
|
|
728
731
|
useImperativeHandle(resolveCompositionsRef, () => {
|
|
729
732
|
return {
|
|
730
733
|
setCurrentRenderModalComposition: (id) => {
|
|
@@ -787,7 +790,8 @@ const needsResolution = (composition) => {
|
|
|
787
790
|
const useResolvedVideoConfig = (preferredCompositionId) => {
|
|
788
791
|
const context = useContext(ResolveCompositionContext);
|
|
789
792
|
const { props: allEditorProps } = useContext(EditorPropsContext);
|
|
790
|
-
const { compositions,
|
|
793
|
+
const { compositions, canvasContent, currentCompositionMetadata } = useContext(CompositionManager);
|
|
794
|
+
const currentComposition = (canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) === 'composition' ? canvasContent.compositionId : null;
|
|
791
795
|
const compositionId = preferredCompositionId !== null && preferredCompositionId !== void 0 ? preferredCompositionId : currentComposition;
|
|
792
796
|
const composition = compositions.find((c) => c.id === compositionId);
|
|
793
797
|
const selectedEditorProps = useMemo(() => {
|
|
@@ -839,13 +843,15 @@ const useResolvedVideoConfig = (preferredCompositionId) => {
|
|
|
839
843
|
};
|
|
840
844
|
|
|
841
845
|
const useVideo = () => {
|
|
842
|
-
|
|
843
|
-
const
|
|
844
|
-
|
|
846
|
+
var _a;
|
|
847
|
+
const { canvasContent, compositions, currentCompositionMetadata } = useContext(CompositionManager);
|
|
848
|
+
const selected = compositions.find((c) => {
|
|
849
|
+
return ((canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) === 'composition' &&
|
|
850
|
+
c.id === canvasContent.compositionId);
|
|
845
851
|
});
|
|
846
|
-
const resolved = useResolvedVideoConfig(
|
|
852
|
+
const resolved = useResolvedVideoConfig((_a = selected === null || selected === void 0 ? void 0 : selected.id) !== null && _a !== void 0 ? _a : null);
|
|
847
853
|
return useMemo(() => {
|
|
848
|
-
var _a
|
|
854
|
+
var _a;
|
|
849
855
|
if (!resolved) {
|
|
850
856
|
return null;
|
|
851
857
|
}
|
|
@@ -864,10 +870,10 @@ const useVideo = () => {
|
|
|
864
870
|
id: selected.id,
|
|
865
871
|
// We override the selected metadata with the metadata that was passed to renderMedia(),
|
|
866
872
|
// and don't allow it to be changed during render anymore
|
|
867
|
-
...(
|
|
873
|
+
...(currentCompositionMetadata !== null && currentCompositionMetadata !== void 0 ? currentCompositionMetadata : {}),
|
|
868
874
|
component: selected.component,
|
|
869
875
|
};
|
|
870
|
-
}, [
|
|
876
|
+
}, [currentCompositionMetadata, resolved, selected]);
|
|
871
877
|
};
|
|
872
878
|
|
|
873
879
|
const TimelineContext = createContext({
|
|
@@ -1102,7 +1108,7 @@ const SequenceRefForwardingFunction = ({ from = 0, durationInFrames = Infinity,
|
|
|
1102
1108
|
};
|
|
1103
1109
|
/**
|
|
1104
1110
|
* @description A component that time-shifts its children and wraps them in an absolutely positioned <div>.
|
|
1105
|
-
* @see [Documentation](https://www.remotion.dev/docs/sequence
|
|
1111
|
+
* @see [Documentation](https://www.remotion.dev/docs/sequence)
|
|
1106
1112
|
*/
|
|
1107
1113
|
const Sequence = forwardRef(SequenceRefForwardingFunction);
|
|
1108
1114
|
|
|
@@ -2397,6 +2403,7 @@ const continueRender = (handle) => {
|
|
|
2397
2403
|
};
|
|
2398
2404
|
|
|
2399
2405
|
const RenderAssetManager = createContext({
|
|
2406
|
+
// Must be undefined, otherwise error in Player
|
|
2400
2407
|
registerRenderAsset: () => undefined,
|
|
2401
2408
|
unregisterRenderAsset: () => undefined,
|
|
2402
2409
|
renderAssets: [],
|
|
@@ -3199,8 +3206,8 @@ const CompositionManagerProvider = ({ children, numberOfAudioTags }) => {
|
|
|
3199
3206
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3200
3207
|
const [compositions, setCompositions] = useState([]);
|
|
3201
3208
|
const currentcompositionsRef = useRef(compositions);
|
|
3202
|
-
const [currentComposition, setCurrentComposition] = useState(null);
|
|
3203
3209
|
const [folders, setFolders] = useState([]);
|
|
3210
|
+
const [canvasContent, setCanvasContent] = useState(null);
|
|
3204
3211
|
const [currentCompositionMetadata, setCurrentCompositionMetadata] = useState(null);
|
|
3205
3212
|
const updateCompositions = useCallback((
|
|
3206
3213
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -3249,29 +3256,32 @@ const CompositionManagerProvider = ({ children, numberOfAudioTags }) => {
|
|
|
3249
3256
|
getCompositions: () => currentcompositionsRef.current,
|
|
3250
3257
|
};
|
|
3251
3258
|
}, []);
|
|
3252
|
-
const composition = compositions.find((c) =>
|
|
3259
|
+
const composition = compositions.find((c) => (canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) === 'composition'
|
|
3260
|
+
? c.id === canvasContent.compositionId
|
|
3261
|
+
: null);
|
|
3253
3262
|
const contextValue = useMemo(() => {
|
|
3254
3263
|
return {
|
|
3255
3264
|
compositions,
|
|
3256
3265
|
registerComposition,
|
|
3257
3266
|
unregisterComposition,
|
|
3258
|
-
currentComposition,
|
|
3259
|
-
setCurrentComposition,
|
|
3260
3267
|
folders,
|
|
3261
3268
|
registerFolder,
|
|
3262
3269
|
unregisterFolder,
|
|
3263
3270
|
currentCompositionMetadata,
|
|
3264
3271
|
setCurrentCompositionMetadata,
|
|
3272
|
+
canvasContent,
|
|
3273
|
+
setCanvasContent,
|
|
3265
3274
|
};
|
|
3266
3275
|
}, [
|
|
3267
3276
|
compositions,
|
|
3268
3277
|
registerComposition,
|
|
3269
3278
|
unregisterComposition,
|
|
3270
|
-
currentComposition,
|
|
3271
3279
|
folders,
|
|
3272
3280
|
registerFolder,
|
|
3273
3281
|
unregisterFolder,
|
|
3274
3282
|
currentCompositionMetadata,
|
|
3283
|
+
canvasContent,
|
|
3284
|
+
setCanvasContent,
|
|
3275
3285
|
]);
|
|
3276
3286
|
return (jsx(CompositionManager.Provider, { value: contextValue, children: jsx(SequenceManagerProvider, { children: jsx(RenderAssetManagerProvider, { children: jsx(ResolveCompositionConfig, { children: jsx(SharedAudioContextProvider, { numberOfAudioTags: numberOfAudioTags, component: (_a = composition === null || composition === void 0 ? void 0 : composition.component) !== null && _a !== void 0 ? _a : null, children: children }) }) }) }) }));
|
|
3277
3287
|
};
|
|
@@ -4751,7 +4761,7 @@ const VideoForwardingFunction = (props, ref) => {
|
|
|
4751
4761
|
mediaDuration,
|
|
4752
4762
|
playbackRate: (_a = props.playbackRate) !== null && _a !== void 0 ? _a : 1,
|
|
4753
4763
|
startFrom,
|
|
4754
|
-
}), children: jsx(Video, { ...propsOtherThanLoop, ref: ref }) }));
|
|
4764
|
+
}), layout: "none", children: jsx(Video, { ...propsOtherThanLoop, ref: ref }) }));
|
|
4755
4765
|
}
|
|
4756
4766
|
if (typeof startFrom !== 'undefined' || typeof endAt !== 'undefined') {
|
|
4757
4767
|
validateStartFromProps(startFrom, endAt);
|
package/dist/esm/version.mjs
CHANGED