remotion 4.0.442 → 4.0.443
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.js +6 -3
- package/dist/cjs/CompositionManager.d.ts +1 -0
- package/dist/cjs/Img.d.ts +14 -1
- package/dist/cjs/Img.js +34 -2
- package/dist/cjs/index.js +4 -2
- package/dist/cjs/series/index.d.ts +1 -6
- package/dist/cjs/series/index.js +2 -5
- package/dist/cjs/use-media-in-timeline.d.ts +3 -2
- package/dist/cjs/use-media-in-timeline.js +3 -2
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/index.mjs +1788 -1749
- package/dist/esm/version.mjs +1 -1
- package/package.json +2 -2
package/dist/cjs/Composition.js
CHANGED
|
@@ -28,7 +28,7 @@ const Fallback = () => {
|
|
|
28
28
|
return null;
|
|
29
29
|
};
|
|
30
30
|
const InnerComposition = ({ width, height, fps, durationInFrames, id, defaultProps, schema, ...compProps }) => {
|
|
31
|
-
var _a, _b, _c;
|
|
31
|
+
var _a, _b, _c, _d;
|
|
32
32
|
const compManager = (0, react_1.useContext)(CompositionManagerContext_js_1.CompositionSetters);
|
|
33
33
|
const { registerComposition, unregisterComposition } = compManager;
|
|
34
34
|
const video = (0, use_video_js_1.useVideo)();
|
|
@@ -52,6 +52,7 @@ const InnerComposition = ({ width, height, fps, durationInFrames, id, defaultPro
|
|
|
52
52
|
throw new Error('<Composition> mounted inside another composition. See https://remotion.dev/docs/wrong-composition-mount for help.');
|
|
53
53
|
}
|
|
54
54
|
const { folderName, parentName } = (0, react_1.useContext)(Folder_js_1.FolderContext);
|
|
55
|
+
const stack = (_b = compProps.stack) !== null && _b !== void 0 ? _b : null;
|
|
55
56
|
(0, react_1.useEffect)(() => {
|
|
56
57
|
var _a;
|
|
57
58
|
// Ensure it's a URL safe id
|
|
@@ -73,6 +74,7 @@ const InnerComposition = ({ width, height, fps, durationInFrames, id, defaultPro
|
|
|
73
74
|
parentFolderName: parentName,
|
|
74
75
|
schema: schema !== null && schema !== void 0 ? schema : null,
|
|
75
76
|
calculateMetadata: (_a = compProps.calculateMetadata) !== null && _a !== void 0 ? _a : null,
|
|
77
|
+
stack,
|
|
76
78
|
});
|
|
77
79
|
return () => {
|
|
78
80
|
unregisterComposition(id);
|
|
@@ -90,6 +92,7 @@ const InnerComposition = ({ width, height, fps, durationInFrames, id, defaultPro
|
|
|
90
92
|
parentName,
|
|
91
93
|
schema,
|
|
92
94
|
compProps.calculateMetadata,
|
|
95
|
+
stack,
|
|
93
96
|
registerComposition,
|
|
94
97
|
unregisterComposition,
|
|
95
98
|
]);
|
|
@@ -104,7 +107,7 @@ const InnerComposition = ({ width, height, fps, durationInFrames, id, defaultPro
|
|
|
104
107
|
resolved.type !== 'success-and-refreshing')) {
|
|
105
108
|
return null;
|
|
106
109
|
}
|
|
107
|
-
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)(loading_indicator_js_1.Loading, {}), children: (0, jsx_runtime_1.jsx)(Comp, { ...((
|
|
110
|
+
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)(loading_indicator_js_1.Loading, {}), children: (0, jsx_runtime_1.jsx)(Comp, { ...((_c = resolved.result.props) !== null && _c !== void 0 ? _c : {}) }) }) }), (0, portal_node_js_1.portalNode)());
|
|
108
111
|
}
|
|
109
112
|
if (environment.isRendering &&
|
|
110
113
|
video &&
|
|
@@ -116,7 +119,7 @@ const InnerComposition = ({ width, height, fps, durationInFrames, id, defaultPro
|
|
|
116
119
|
resolved.type !== 'success-and-refreshing')) {
|
|
117
120
|
return null;
|
|
118
121
|
}
|
|
119
|
-
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, { ...((
|
|
122
|
+
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, { ...((_d = resolved.result.props) !== null && _d !== void 0 ? _d : {}) }) }) }), (0, portal_node_js_1.portalNode)());
|
|
120
123
|
}
|
|
121
124
|
return null;
|
|
122
125
|
};
|
|
@@ -18,6 +18,7 @@ export type TComposition<Schema extends AnyZodObject, Props extends Record<strin
|
|
|
18
18
|
nonce: NonceHistory;
|
|
19
19
|
schema: Schema | null;
|
|
20
20
|
calculateMetadata: CalculateMetadataFunction<InferProps<Schema, Props>> | null;
|
|
21
|
+
stack: string | null;
|
|
21
22
|
} & PropsIfHasProps<Schema, Props>;
|
|
22
23
|
export type AnyComposition = TComposition<AnyZodObject, Record<string, unknown>>;
|
|
23
24
|
export type TCompMetadataWithCalcFunction<Schema extends AnyZodObject, Props extends Record<string, unknown>> = Pick<TComposition<Schema, Props>, 'id' | 'height' | 'width' | 'fps' | 'durationInFrames' | 'defaultProps' | 'calculateMetadata'>;
|
package/dist/cjs/Img.d.ts
CHANGED
|
@@ -14,5 +14,18 @@ export type ImgProps = NativeImgProps & {
|
|
|
14
14
|
*/
|
|
15
15
|
readonly stack?: string;
|
|
16
16
|
};
|
|
17
|
-
export declare const Img: React.
|
|
17
|
+
export declare const Img: React.ComponentType<NativeImgProps & {
|
|
18
|
+
readonly maxRetries?: number;
|
|
19
|
+
readonly pauseWhenLoading?: boolean;
|
|
20
|
+
readonly delayRenderRetries?: number;
|
|
21
|
+
readonly delayRenderTimeoutInMilliseconds?: number;
|
|
22
|
+
readonly onImageFrame?: (imageElement: HTMLImageElement) => void;
|
|
23
|
+
readonly src: string;
|
|
24
|
+
readonly showInTimeline?: boolean;
|
|
25
|
+
readonly name?: string;
|
|
26
|
+
/**
|
|
27
|
+
* @deprecated For internal use only
|
|
28
|
+
*/
|
|
29
|
+
readonly stack?: string;
|
|
30
|
+
}>;
|
|
18
31
|
export {};
|
package/dist/cjs/Img.js
CHANGED
|
@@ -11,10 +11,41 @@ const use_buffer_state_js_1 = require("./use-buffer-state.js");
|
|
|
11
11
|
const use_delay_render_js_1 = require("./use-delay-render.js");
|
|
12
12
|
const use_media_in_timeline_js_1 = require("./use-media-in-timeline.js");
|
|
13
13
|
const use_remotion_environment_js_1 = require("./use-remotion-environment.js");
|
|
14
|
+
const wrap_in_schema_js_1 = require("./wrap-in-schema.js");
|
|
14
15
|
function exponentialBackoff(errorCount) {
|
|
15
16
|
return 1000 * 2 ** (errorCount - 1);
|
|
16
17
|
}
|
|
17
|
-
const
|
|
18
|
+
const imgSchema = {
|
|
19
|
+
'style.translate': {
|
|
20
|
+
type: 'translate',
|
|
21
|
+
step: 1,
|
|
22
|
+
default: '0px 0px',
|
|
23
|
+
description: 'Position',
|
|
24
|
+
},
|
|
25
|
+
'style.scale': {
|
|
26
|
+
type: 'number',
|
|
27
|
+
min: 0.05,
|
|
28
|
+
max: 100,
|
|
29
|
+
step: 0.01,
|
|
30
|
+
default: 1,
|
|
31
|
+
description: 'Scale',
|
|
32
|
+
},
|
|
33
|
+
'style.rotate': {
|
|
34
|
+
type: 'rotation',
|
|
35
|
+
step: 1,
|
|
36
|
+
default: '0deg',
|
|
37
|
+
description: 'Rotation',
|
|
38
|
+
},
|
|
39
|
+
'style.opacity': {
|
|
40
|
+
type: 'number',
|
|
41
|
+
min: 0,
|
|
42
|
+
max: 1,
|
|
43
|
+
step: 0.01,
|
|
44
|
+
default: 1,
|
|
45
|
+
description: 'Opacity',
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
const ImgInner = ({ onError, maxRetries = 2, src, pauseWhenLoading, delayRenderRetries, delayRenderTimeoutInMilliseconds, onImageFrame, crossOrigin, showInTimeline, name, stack, ref, controls, ...props }) => {
|
|
18
49
|
var _a, _b;
|
|
19
50
|
const imageRef = (0, react_1.useRef)(null);
|
|
20
51
|
const errors = (0, react_1.useRef)({});
|
|
@@ -40,6 +71,7 @@ const ImgRefForwarding = ({ onError, maxRetries = 2, src, pauseWhenLoading, dela
|
|
|
40
71
|
premountDisplay: (_a = sequenceContext === null || sequenceContext === void 0 ? void 0 : sequenceContext.premountDisplay) !== null && _a !== void 0 ? _a : null,
|
|
41
72
|
postmountDisplay: (_b = sequenceContext === null || sequenceContext === void 0 ? void 0 : sequenceContext.postmountDisplay) !== null && _b !== void 0 ? _b : null,
|
|
42
73
|
loopDisplay: undefined,
|
|
74
|
+
controls: controls !== null && controls !== void 0 ? controls : null,
|
|
43
75
|
});
|
|
44
76
|
const actualSrc = (0, prefetch_js_1.usePreload)(src);
|
|
45
77
|
const retryIn = (0, react_1.useCallback)((timeout) => {
|
|
@@ -188,5 +220,5 @@ const ImgRefForwarding = ({ onError, maxRetries = 2, src, pauseWhenLoading, dela
|
|
|
188
220
|
* @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.
|
|
189
221
|
* @see [Documentation](https://remotion.dev/docs/img)
|
|
190
222
|
*/
|
|
191
|
-
exports.Img = (0,
|
|
223
|
+
exports.Img = (0, wrap_in_schema_js_1.wrapInSchema)(ImgInner, imgSchema);
|
|
192
224
|
(0, enable_sequence_stack_traces_js_1.addSequenceStackTraces)(exports.Img);
|
package/dist/cjs/index.js
CHANGED
|
@@ -18,6 +18,7 @@ exports.Config = exports.Experimental = exports.watchStaticFile = exports.Video
|
|
|
18
18
|
require("./_check-rsc.js");
|
|
19
19
|
require("./asset-types.js");
|
|
20
20
|
const Clipper_js_1 = require("./Clipper.js");
|
|
21
|
+
const Composition_js_1 = require("./Composition.js");
|
|
21
22
|
const enable_sequence_stack_traces_js_1 = require("./enable-sequence-stack-traces.js");
|
|
22
23
|
const is_player_js_1 = require("./is-player.js");
|
|
23
24
|
const multiple_versions_warning_js_1 = require("./multiple-versions-warning.js");
|
|
@@ -33,8 +34,8 @@ Object.defineProperty(exports, "Audio", { enumerable: true, get: function () { r
|
|
|
33
34
|
Object.defineProperty(exports, "Html5Audio", { enumerable: true, get: function () { return index_js_1.Html5Audio; } });
|
|
34
35
|
var cancel_render_js_1 = require("./cancel-render.js");
|
|
35
36
|
Object.defineProperty(exports, "cancelRender", { enumerable: true, get: function () { return cancel_render_js_1.cancelRender; } });
|
|
36
|
-
var
|
|
37
|
-
Object.defineProperty(exports, "Composition", { enumerable: true, get: function () { return
|
|
37
|
+
var Composition_js_2 = require("./Composition.js");
|
|
38
|
+
Object.defineProperty(exports, "Composition", { enumerable: true, get: function () { return Composition_js_2.Composition; } });
|
|
38
39
|
var input_props_js_1 = require("./config/input-props.js");
|
|
39
40
|
Object.defineProperty(exports, "getInputProps", { enumerable: true, get: function () { return input_props_js_1.getInputProps; } });
|
|
40
41
|
var delay_render_js_1 = require("./delay-render.js");
|
|
@@ -130,3 +131,4 @@ exports.Config = new Proxy(proxyObj, {
|
|
|
130
131
|
});
|
|
131
132
|
Sequence_js_1.Sequence.displayName = 'Sequence';
|
|
132
133
|
(0, enable_sequence_stack_traces_js_1.addSequenceStackTraces)(Sequence_js_1.Sequence);
|
|
134
|
+
(0, enable_sequence_stack_traces_js_1.addSequenceStackTraces)(Composition_js_1.Composition);
|
|
@@ -1,18 +1,13 @@
|
|
|
1
1
|
import type { FC, PropsWithChildren } from 'react';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import type { LayoutAndStyle, SequenceProps } from '../Sequence.js';
|
|
4
|
-
import { ENABLE_V5_BREAKING_CHANGES } from '../v5-flag.js';
|
|
5
4
|
type SeriesSequenceProps = PropsWithChildren<{
|
|
6
5
|
readonly durationInFrames: number;
|
|
7
6
|
readonly offset?: number;
|
|
8
7
|
readonly className?: string;
|
|
9
8
|
} & Pick<SequenceProps, 'layout' | 'name'> & LayoutAndStyle>;
|
|
10
9
|
declare const SeriesSequence: React.ForwardRefExoticComponent<SeriesSequenceProps & React.RefAttributes<HTMLDivElement>>;
|
|
11
|
-
type
|
|
12
|
-
children: React.ReactNode;
|
|
13
|
-
};
|
|
14
|
-
type V5Props = SequenceProps;
|
|
15
|
-
type SeriesProps = true extends typeof ENABLE_V5_BREAKING_CHANGES ? V5Props : V4Props;
|
|
10
|
+
type SeriesProps = SequenceProps;
|
|
16
11
|
/**
|
|
17
12
|
* @description with this component, you can easily stitch together scenes that should play sequentially after another.
|
|
18
13
|
* @see [Documentation](https://www.remotion.dev/docs/series)
|
package/dist/cjs/series/index.js
CHANGED
|
@@ -5,7 +5,6 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const enable_sequence_stack_traces_js_1 = require("../enable-sequence-stack-traces.js");
|
|
7
7
|
const Sequence_js_1 = require("../Sequence.js");
|
|
8
|
-
const v5_flag_js_1 = require("../v5-flag.js");
|
|
9
8
|
const validate_duration_in_frames_js_1 = require("../validation/validate-duration-in-frames.js");
|
|
10
9
|
const flatten_children_js_1 = require("./flatten-children.js");
|
|
11
10
|
const is_inside_series_js_1 = require("./is-inside-series.js");
|
|
@@ -64,11 +63,9 @@ const Series = (props) => {
|
|
|
64
63
|
return ((0, jsx_runtime_1.jsx)(Sequence_js_1.Sequence, { name: name || '<Series.Sequence>', from: currentStartFrame, durationInFrames: durationInFramesProp, ...passedProps, ref: castedChild.ref, children: child }));
|
|
65
64
|
});
|
|
66
65
|
}, [props.children]);
|
|
67
|
-
|
|
68
|
-
return ((0, jsx_runtime_1.jsx)(is_inside_series_js_1.IsInsideSeriesContainer, { children: (0, jsx_runtime_1.jsx)(Sequence_js_1.Sequence, { ...props, children: childrenValue }) }));
|
|
69
|
-
}
|
|
70
|
-
return (0, jsx_runtime_1.jsx)(is_inside_series_js_1.IsInsideSeriesContainer, { children: childrenValue });
|
|
66
|
+
return ((0, jsx_runtime_1.jsx)(is_inside_series_js_1.IsInsideSeriesContainer, { children: (0, jsx_runtime_1.jsx)(Sequence_js_1.Sequence, { layout: "none", name: "<Series>", ...props, children: childrenValue }) }));
|
|
71
67
|
};
|
|
72
68
|
exports.Series = Series;
|
|
73
69
|
Series.Sequence = SeriesSequence;
|
|
70
|
+
(0, enable_sequence_stack_traces_js_1.addSequenceStackTraces)(Series);
|
|
74
71
|
(0, enable_sequence_stack_traces_js_1.addSequenceStackTraces)(SeriesSequence);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { LoopDisplay } from './CompositionManager.js';
|
|
1
|
+
import type { LoopDisplay, SequenceControls } from './CompositionManager.js';
|
|
2
2
|
import type { VolumeProp } from './volume-prop.js';
|
|
3
3
|
export declare const useBasicMediaInTimeline: ({ volume, mediaVolume, mediaType, src, displayName, trimBefore, trimAfter, playbackRate, }: {
|
|
4
4
|
volume: VolumeProp | undefined;
|
|
@@ -18,7 +18,7 @@ export declare const useBasicMediaInTimeline: ({ volume, mediaVolume, mediaType,
|
|
|
18
18
|
isStudio: boolean;
|
|
19
19
|
finalDisplayName: string;
|
|
20
20
|
};
|
|
21
|
-
export declare const useImageInTimeline: ({ src, displayName, id, stack, showInTimeline, premountDisplay, postmountDisplay, loopDisplay, }: {
|
|
21
|
+
export declare const useImageInTimeline: ({ src, displayName, id, stack, showInTimeline, premountDisplay, postmountDisplay, loopDisplay, controls, }: {
|
|
22
22
|
src: string | undefined;
|
|
23
23
|
displayName: string | null;
|
|
24
24
|
id: string;
|
|
@@ -27,6 +27,7 @@ export declare const useImageInTimeline: ({ src, displayName, id, stack, showInT
|
|
|
27
27
|
premountDisplay: number | null;
|
|
28
28
|
postmountDisplay: number | null;
|
|
29
29
|
loopDisplay: LoopDisplay | undefined;
|
|
30
|
+
controls: SequenceControls | null;
|
|
30
31
|
}) => void;
|
|
31
32
|
export declare const useMediaInTimeline: ({ volume, mediaVolume, src, mediaType, playbackRate, displayName, id, stack, showInTimeline, premountDisplay, postmountDisplay, loopDisplay, }: {
|
|
32
33
|
volume: VolumeProp | undefined;
|
|
@@ -73,7 +73,7 @@ const useBasicMediaInTimeline = ({ volume, mediaVolume, mediaType, src, displayN
|
|
|
73
73
|
};
|
|
74
74
|
};
|
|
75
75
|
exports.useBasicMediaInTimeline = useBasicMediaInTimeline;
|
|
76
|
-
const useImageInTimeline = ({ src, displayName, id, stack, showInTimeline, premountDisplay, postmountDisplay, loopDisplay, }) => {
|
|
76
|
+
const useImageInTimeline = ({ src, displayName, id, stack, showInTimeline, premountDisplay, postmountDisplay, loopDisplay, controls, }) => {
|
|
77
77
|
const parentSequence = (0, react_1.useContext)(SequenceContext_js_1.SequenceContext);
|
|
78
78
|
const { registerSequence, unregisterSequence } = (0, react_1.useContext)(SequenceManager_js_1.SequenceManager);
|
|
79
79
|
const { duration, nonce, rootId, isStudio, finalDisplayName } = (0, exports.useBasicMediaInTimeline)({
|
|
@@ -112,7 +112,7 @@ const useImageInTimeline = ({ src, displayName, id, stack, showInTimeline, premo
|
|
|
112
112
|
stack,
|
|
113
113
|
premountDisplay,
|
|
114
114
|
postmountDisplay,
|
|
115
|
-
controls
|
|
115
|
+
controls,
|
|
116
116
|
});
|
|
117
117
|
return () => {
|
|
118
118
|
unregisterSequence(id);
|
|
@@ -133,6 +133,7 @@ const useImageInTimeline = ({ src, displayName, id, stack, showInTimeline, premo
|
|
|
133
133
|
loopDisplay,
|
|
134
134
|
rootId,
|
|
135
135
|
finalDisplayName,
|
|
136
|
+
controls,
|
|
136
137
|
]);
|
|
137
138
|
};
|
|
138
139
|
exports.useImageInTimeline = useImageInTimeline;
|
package/dist/cjs/version.d.ts
CHANGED
package/dist/cjs/version.js
CHANGED