remotion 4.0.0-webhook.27 → 4.1.0-alpha2
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/LICENSE.md +8 -8
- package/README.md +7 -7
- package/dist/{AbsoluteFill.d.ts → cjs/AbsoluteFill.d.ts} +2 -2
- package/dist/{AbsoluteFill.js → cjs/AbsoluteFill.js} +2 -2
- package/dist/cjs/AssetManager.d.ts +11 -0
- package/dist/cjs/AssetManager.js +40 -0
- package/dist/{CanUseRemotionHooks.d.ts → cjs/CanUseRemotionHooks.d.ts} +0 -0
- package/dist/{CanUseRemotionHooks.js → cjs/CanUseRemotionHooks.js} +0 -0
- package/dist/cjs/Clipper.d.ts +7 -0
- package/dist/cjs/Clipper.js +24 -0
- package/dist/cjs/Composition.d.ts +41 -0
- package/dist/cjs/Composition.js +132 -0
- package/dist/cjs/CompositionManager.d.ts +75 -0
- package/dist/{CompositionManager.js → cjs/CompositionManager.js} +29 -66
- package/dist/cjs/CompositionManagerContext.d.ts +18 -0
- package/dist/cjs/CompositionManagerContext.js +16 -0
- package/dist/cjs/EditorProps.d.ts +15 -0
- package/dist/cjs/EditorProps.js +53 -0
- package/dist/{Folder.d.ts → cjs/Folder.d.ts} +6 -2
- package/dist/{Folder.js → cjs/Folder.js} +10 -6
- package/dist/{IFrame.d.ts → cjs/IFrame.d.ts} +4 -0
- package/dist/{IFrame.js → cjs/IFrame.js} +8 -4
- package/dist/cjs/Img.d.ts +9 -0
- package/dist/cjs/Img.js +100 -0
- package/dist/cjs/NativeLayers.d.ts +13 -0
- package/dist/cjs/NativeLayers.js +29 -0
- package/dist/cjs/Null.d.ts +2 -0
- package/dist/cjs/Null.js +25 -0
- package/dist/{RemotionRoot.d.ts → cjs/RemotionRoot.d.ts} +1 -0
- package/dist/cjs/RemotionRoot.js +72 -0
- package/dist/cjs/ResolveCompositionConfig.d.ts +24 -0
- package/dist/cjs/ResolveCompositionConfig.js +192 -0
- package/dist/cjs/Sequence.d.ts +22 -0
- package/dist/{Sequence.js → cjs/Sequence.js} +27 -29
- package/dist/cjs/SequenceContext.d.ts +9 -0
- package/dist/cjs/SequenceContext.js +5 -0
- package/dist/cjs/SequenceManager.d.ts +11 -0
- package/dist/cjs/SequenceManager.js +57 -0
- package/dist/cjs/Still.d.ts +8 -0
- package/dist/cjs/Still.js +22 -0
- package/dist/{absolute-src.d.ts → cjs/absolute-src.d.ts} +0 -0
- package/dist/{absolute-src.js → cjs/absolute-src.js} +0 -0
- package/dist/{asset-types.d.ts → cjs/asset-types.d.ts} +0 -0
- package/dist/{asset-types.js → cjs/asset-types.js} +0 -0
- package/dist/{audio → cjs/audio}/Audio.d.ts +10 -4
- package/dist/cjs/audio/Audio.js +58 -0
- package/dist/cjs/audio/AudioForDevelopment.d.ts +11 -0
- package/dist/cjs/audio/AudioForDevelopment.js +101 -0
- package/dist/cjs/audio/AudioForRendering.d.ts +10 -0
- package/dist/cjs/audio/AudioForRendering.js +111 -0
- package/dist/cjs/audio/index.d.ts +2 -0
- package/dist/{audio → cjs/audio}/index.js +2 -2
- package/dist/cjs/audio/props.d.ts +12 -0
- package/dist/{audio → cjs/audio}/props.js +0 -0
- package/dist/{audio → cjs/audio}/shared-audio-tags.d.ts +10 -4
- package/dist/{audio → cjs/audio}/shared-audio-tags.js +35 -13
- package/dist/{audio → cjs/audio}/use-audio-frame.d.ts +0 -0
- package/dist/{audio → cjs/audio}/use-audio-frame.js +4 -4
- package/dist/{bezier.d.ts → cjs/bezier.d.ts} +0 -0
- package/dist/{bezier.js → cjs/bezier.js} +0 -0
- package/dist/cjs/cancel-render.d.ts +5 -0
- package/dist/cjs/cancel-render.js +47 -0
- package/dist/{config → cjs/config}/input-props.d.ts +0 -0
- package/dist/{config → cjs/config}/input-props.js +3 -3
- package/dist/{default-css.d.ts → cjs/default-css.d.ts} +0 -0
- package/dist/{default-css.js → cjs/default-css.js} +0 -0
- package/dist/{delay-render.d.ts → cjs/delay-render.d.ts} +4 -4
- package/dist/{delay-render.js → cjs/delay-render.js} +12 -12
- package/dist/{easing.d.ts → cjs/easing.d.ts} +4 -0
- package/dist/{easing.js → cjs/easing.js} +6 -2
- package/dist/cjs/freeze.d.ts +11 -0
- package/dist/{freeze.js → cjs/freeze.js} +8 -4
- package/dist/{get-asset-file-name.d.ts → cjs/get-asset-file-name.d.ts} +0 -0
- package/dist/{get-asset-file-name.js → cjs/get-asset-file-name.js} +0 -0
- package/dist/cjs/get-environment.d.ts +3 -0
- package/dist/{get-environment.js → cjs/get-environment.js} +14 -2
- package/dist/cjs/get-preview-dom-element.d.ts +2 -0
- package/dist/cjs/get-preview-dom-element.js +8 -0
- package/dist/cjs/get-static-files.d.ts +21 -0
- package/dist/cjs/get-static-files.js +35 -0
- package/dist/{get-timeline-clip-name.d.ts → cjs/get-timeline-clip-name.d.ts} +0 -0
- package/dist/{get-timeline-clip-name.js → cjs/get-timeline-clip-name.js} +0 -0
- package/dist/cjs/index.d.ts +102 -0
- package/dist/cjs/index.js +105 -0
- package/dist/cjs/internals.d.ts +131 -0
- package/dist/cjs/internals.js +120 -0
- package/dist/{interpolate-colors.d.ts → cjs/interpolate-colors.d.ts} +5 -0
- package/dist/{interpolate-colors.js → cjs/interpolate-colors.js} +10 -10
- package/dist/{interpolate.d.ts → cjs/interpolate.d.ts} +11 -7
- package/dist/{interpolate.js → cjs/interpolate.js} +0 -0
- package/dist/{is-approximately-the-same.d.ts → cjs/is-approximately-the-same.d.ts} +0 -0
- package/dist/{is-approximately-the-same.js → cjs/is-approximately-the-same.js} +0 -0
- package/dist/cjs/is-player.d.ts +3 -0
- package/dist/cjs/is-player.js +14 -0
- package/dist/{loading-indicator.d.ts → cjs/loading-indicator.d.ts} +0 -0
- package/dist/{loading-indicator.js → cjs/loading-indicator.js} +4 -4
- package/dist/cjs/loop/index.d.ts +13 -0
- package/dist/cjs/loop/index.js +46 -0
- package/dist/{multiple-versions-warning.d.ts → cjs/multiple-versions-warning.d.ts} +0 -0
- package/dist/{multiple-versions-warning.js → cjs/multiple-versions-warning.js} +11 -6
- package/dist/{nonce.d.ts → cjs/nonce.d.ts} +1 -1
- package/dist/{nonce.js → cjs/nonce.js} +6 -0
- package/dist/{play-and-handle-not-allowed-error.d.ts → cjs/play-and-handle-not-allowed-error.d.ts} +0 -0
- package/dist/{play-and-handle-not-allowed-error.js → cjs/play-and-handle-not-allowed-error.js} +4 -0
- package/dist/{portal-node.d.ts → cjs/portal-node.d.ts} +0 -0
- package/dist/{portal-node.js → cjs/portal-node.js} +0 -0
- package/dist/cjs/prefetch-state.d.ts +8 -0
- package/dist/cjs/prefetch-state.js +27 -0
- package/dist/cjs/prefetch.d.ts +13 -0
- package/dist/{prefetch.js → cjs/prefetch.js} +43 -17
- package/dist/cjs/props-if-has-props.d.ts +10 -0
- package/dist/{video-config.js → cjs/props-if-has-props.js} +0 -0
- package/dist/cjs/random.d.ts +6 -0
- package/dist/{random.js → cjs/random.js} +3 -3
- package/dist/{register-root.d.ts → cjs/register-root.d.ts} +4 -0
- package/dist/{register-root.js → cjs/register-root.js} +4 -0
- package/dist/cjs/resolve-video-config.d.ts +8 -0
- package/dist/cjs/resolve-video-config.js +89 -0
- package/dist/cjs/series/flatten-children.d.ts +2 -0
- package/dist/{series → cjs/series}/flatten-children.js +0 -0
- package/dist/cjs/series/index.d.ts +17 -0
- package/dist/{series → cjs/series}/index.js +22 -8
- package/dist/cjs/setup-env-variables.d.ts +1 -0
- package/dist/{setup-env-variables.js → cjs/setup-env-variables.js} +7 -9
- package/dist/{spring → cjs/spring}/index.d.ts +10 -6
- package/dist/cjs/spring/index.js +75 -0
- package/dist/cjs/spring/measure-spring.d.ts +12 -0
- package/dist/{spring → cjs/spring}/measure-spring.js +8 -4
- package/dist/{spring → cjs/spring}/spring-utils.d.ts +2 -2
- package/dist/{spring → cjs/spring}/spring-utils.js +0 -0
- package/dist/cjs/static-file.d.ts +33 -0
- package/dist/cjs/static-file.js +87 -0
- package/dist/{timeline-position-state.d.ts → cjs/timeline-position-state.d.ts} +4 -4
- package/dist/{timeline-position-state.js → cjs/timeline-position-state.js} +9 -1
- package/dist/cjs/truthy.d.ts +3 -0
- package/dist/{truthy.js → cjs/truthy.js} +0 -0
- package/dist/cjs/use-current-frame.d.ts +5 -0
- package/dist/{use-current-frame.js → cjs/use-current-frame.js} +8 -9
- package/dist/cjs/use-lazy-component.d.ts +7 -0
- package/dist/{use-lazy-component.js → cjs/use-lazy-component.js} +0 -0
- package/dist/{use-media-in-timeline.d.ts → cjs/use-media-in-timeline.d.ts} +3 -2
- package/dist/{use-media-in-timeline.js → cjs/use-media-in-timeline.js} +29 -25
- package/dist/{use-media-playback.d.ts → cjs/use-media-playback.d.ts} +3 -1
- package/dist/cjs/use-media-playback.js +86 -0
- package/dist/{use-media-tag-volume.d.ts → cjs/use-media-tag-volume.d.ts} +0 -0
- package/dist/{use-media-tag-volume.js → cjs/use-media-tag-volume.js} +0 -0
- package/dist/{use-sync-volume-with-media-tag.d.ts → cjs/use-sync-volume-with-media-tag.d.ts} +2 -2
- package/dist/{use-sync-volume-with-media-tag.js → cjs/use-sync-volume-with-media-tag.js} +5 -4
- package/dist/{use-unsafe-video-config.d.ts → cjs/use-unsafe-video-config.d.ts} +1 -1
- package/dist/{use-unsafe-video-config.js → cjs/use-unsafe-video-config.js} +4 -4
- package/dist/cjs/use-video-config.d.ts +8 -0
- package/dist/cjs/use-video-config.js +34 -0
- package/dist/cjs/use-video.d.ts +7 -0
- package/dist/cjs/use-video.js +38 -0
- package/dist/cjs/validate-frame.d.ts +5 -0
- package/dist/cjs/validate-frame.js +24 -0
- package/dist/cjs/validate-media-props.d.ts +4 -0
- package/dist/{validate-media-props.js → cjs/validate-media-props.js} +0 -0
- package/dist/{validate-start-from-props.d.ts → cjs/validate-start-from-props.d.ts} +0 -0
- package/dist/{validate-start-from-props.js → cjs/validate-start-from-props.js} +0 -0
- package/dist/{validation → cjs/validation}/validate-composition-id.d.ts +0 -0
- package/dist/{validation → cjs/validation}/validate-composition-id.js +0 -0
- package/dist/cjs/validation/validate-default-props.d.ts +1 -0
- package/dist/cjs/validation/validate-default-props.js +15 -0
- package/dist/{validation → cjs/validation}/validate-dimensions.d.ts +0 -0
- package/dist/{validation → cjs/validation}/validate-dimensions.js +0 -0
- package/dist/cjs/validation/validate-duration-in-frames.d.ts +5 -0
- package/dist/{validation → cjs/validation}/validate-duration-in-frames.js +5 -2
- package/dist/{validation → cjs/validation}/validate-folder-name.d.ts +0 -0
- package/dist/{validation → cjs/validation}/validate-folder-name.js +0 -0
- package/dist/{validation → cjs/validation}/validate-fps.d.ts +0 -0
- package/dist/{validation → cjs/validation}/validate-fps.js +0 -0
- package/dist/{validation → cjs/validation}/validation-spring-duration.d.ts +0 -0
- package/dist/{validation → cjs/validation}/validation-spring-duration.js +0 -0
- package/dist/cjs/version.d.ts +1 -0
- package/dist/{version.js → cjs/version.js} +1 -1
- package/dist/cjs/video/OffthreadVideo.d.ts +7 -0
- package/dist/cjs/video/OffthreadVideo.js +38 -0
- package/dist/{video → cjs/video}/OffthreadVideoForRendering.d.ts +1 -1
- package/dist/cjs/video/OffthreadVideoForRendering.js +103 -0
- package/dist/cjs/video/Video.d.ts +12 -0
- package/dist/cjs/video/Video.js +55 -0
- package/dist/{video → cjs/video}/VideoForDevelopment.d.ts +5 -2
- package/dist/cjs/video/VideoForDevelopment.js +117 -0
- package/dist/cjs/video/VideoForRendering.d.ts +10 -0
- package/dist/cjs/video/VideoForRendering.js +208 -0
- package/dist/cjs/video/duration-state.d.ts +17 -0
- package/dist/cjs/video/duration-state.js +35 -0
- package/dist/{video → cjs/video}/get-current-time.d.ts +0 -0
- package/dist/{video → cjs/video}/get-current-time.js +12 -11
- package/dist/cjs/video/index.d.ts +3 -0
- package/dist/{video → cjs/video}/index.js +4 -4
- package/dist/cjs/video/props.d.ts +32 -0
- package/dist/cjs/video/props.js +2 -0
- package/dist/cjs/video/video-fragment.d.ts +12 -0
- package/dist/cjs/video/video-fragment.js +60 -0
- package/dist/{video-config.d.ts → cjs/video-config.d.ts} +2 -2
- package/dist/{video/props.js → cjs/video-config.js} +0 -0
- package/dist/{volume-position-state.d.ts → cjs/volume-position-state.d.ts} +4 -4
- package/dist/{volume-position-state.js → cjs/volume-position-state.js} +0 -0
- package/dist/{volume-prop.d.ts → cjs/volume-prop.d.ts} +3 -2
- package/dist/{volume-prop.js → cjs/volume-prop.js} +4 -3
- package/dist/{warn-about-non-seekable-media.d.ts → cjs/warn-about-non-seekable-media.d.ts} +0 -0
- package/dist/{warn-about-non-seekable-media.js → cjs/warn-about-non-seekable-media.js} +2 -2
- package/dist/cjs/wrap-remotion-context.d.ts +31 -0
- package/dist/cjs/wrap-remotion-context.js +85 -0
- package/dist/esm/index.mjs +4623 -0
- package/dist/esm/version.mjs +4 -0
- package/package.json +80 -57
- package/version.js +2 -1
- package/.prettierrc.js +0 -14
- package/.turbo/turbo-build.log +0 -5
- package/dist/Composition.d.ts +0 -22
- package/dist/Composition.js +0 -98
- package/dist/CompositionManager.d.ts +0 -79
- package/dist/Img.d.ts +0 -2
- package/dist/Img.js +0 -51
- package/dist/RemotionRoot.js +0 -71
- package/dist/Sequence.d.ts +0 -29
- package/dist/Still.d.ts +0 -3
- package/dist/Still.js +0 -9
- package/dist/audio/Audio.js +0 -32
- package/dist/audio/AudioForDevelopment.d.ts +0 -8
- package/dist/audio/AudioForDevelopment.js +0 -71
- package/dist/audio/AudioForRendering.d.ts +0 -6
- package/dist/audio/AudioForRendering.js +0 -75
- package/dist/audio/index.d.ts +0 -2
- package/dist/audio/props.d.ts +0 -10
- package/dist/config.d.ts +0 -218
- package/dist/config.js +0 -21
- package/dist/freeze.d.ts +0 -7
- package/dist/get-environment.d.ts +0 -2
- package/dist/get-preview-dom-element.d.ts +0 -1
- package/dist/get-preview-dom-element.js +0 -7
- package/dist/index.d.ts +0 -72
- package/dist/index.js +0 -58
- package/dist/internals.d.ts +0 -88
- package/dist/internals.js +0 -93
- package/dist/loop/index.d.ts +0 -9
- package/dist/loop/index.js +0 -28
- package/dist/prefetch-state.d.ts +0 -13
- package/dist/prefetch-state.js +0 -26
- package/dist/prefetch.d.ts +0 -7
- package/dist/random.d.ts +0 -6
- package/dist/series/flatten-children.d.ts +0 -2
- package/dist/series/index.d.ts +0 -13
- package/dist/setup-env-variables.d.ts +0 -2
- package/dist/spring/index.js +0 -51
- package/dist/spring/measure-spring.d.ts +0 -8
- package/dist/static-file.d.ts +0 -1
- package/dist/static-file.js +0 -29
- package/dist/truthy.d.ts +0 -3
- package/dist/use-current-frame.d.ts +0 -6
- package/dist/use-lazy-component.d.ts +0 -7
- package/dist/use-media-playback.js +0 -75
- package/dist/use-video-config.d.ts +0 -7
- package/dist/use-video-config.js +0 -26
- package/dist/use-video.d.ts +0 -13
- package/dist/use-video.js +0 -28
- package/dist/validate-media-props.d.ts +0 -4
- package/dist/validation/validate-duration-in-frames.d.ts +0 -1
- package/dist/validation/validate-offthreadvideo-image-format.d.ts +0 -1
- package/dist/validation/validate-offthreadvideo-image-format.js +0 -15
- package/dist/version.d.ts +0 -1
- package/dist/video/LoopedVideo.d.ts +0 -3
- package/dist/video/LoopedVideo.js +0 -16
- package/dist/video/OffthreadVideo.d.ts +0 -3
- package/dist/video/OffthreadVideo.js +0 -27
- package/dist/video/OffthreadVideoForRendering.js +0 -101
- package/dist/video/Video.d.ts +0 -6
- package/dist/video/Video.js +0 -29
- package/dist/video/VideoForDevelopment.js +0 -69
- package/dist/video/VideoForRendering.d.ts +0 -6
- package/dist/video/VideoForRendering.js +0 -168
- package/dist/video/duration-state.d.ts +0 -8
- package/dist/video/duration-state.js +0 -15
- package/dist/video/index.d.ts +0 -3
- package/dist/video/props.d.ts +0 -21
- package/dist/wrap-remotion-context.d.ts +0 -14
- package/dist/wrap-remotion-context.js +0 -65
- package/ensure-correct-version.js +0 -24
- package/tsconfig.json +0 -12
- package/version.d.ts +0 -1
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Loop = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const Sequence_js_1 = require("../Sequence.js");
|
|
7
|
+
const use_current_frame_js_1 = require("../use-current-frame.js");
|
|
8
|
+
const use_video_config_js_1 = require("../use-video-config.js");
|
|
9
|
+
const validate_duration_in_frames_js_1 = require("../validation/validate-duration-in-frames.js");
|
|
10
|
+
/**
|
|
11
|
+
* @description This component allows you to quickly lay out an animation so it repeats itself.
|
|
12
|
+
* @see [Documentation](https://www.remotion.dev/docs/loop)
|
|
13
|
+
*/
|
|
14
|
+
const Loop = ({ durationInFrames, times = Infinity, children, name, ...props }) => {
|
|
15
|
+
const currentFrame = (0, use_current_frame_js_1.useCurrentFrame)();
|
|
16
|
+
const { durationInFrames: compDuration } = (0, use_video_config_js_1.useVideoConfig)();
|
|
17
|
+
(0, validate_duration_in_frames_js_1.validateDurationInFrames)({
|
|
18
|
+
durationInFrames,
|
|
19
|
+
component: 'of the <Loop /> component',
|
|
20
|
+
allowFloats: true,
|
|
21
|
+
});
|
|
22
|
+
if (typeof times !== 'number') {
|
|
23
|
+
throw new TypeError(`You passed to "times" an argument of type ${typeof times}, but it must be a number.`);
|
|
24
|
+
}
|
|
25
|
+
if (times !== Infinity && times % 1 !== 0) {
|
|
26
|
+
throw new TypeError(`The "times" prop of a loop must be an integer, but got ${times}.`);
|
|
27
|
+
}
|
|
28
|
+
if (times < 0) {
|
|
29
|
+
throw new TypeError(`The "times" prop of a loop must be at least 0, but got ${times}`);
|
|
30
|
+
}
|
|
31
|
+
const maxTimes = Math.ceil(compDuration / durationInFrames);
|
|
32
|
+
const actualTimes = Math.min(maxTimes, times);
|
|
33
|
+
const style = props.layout === 'none' ? undefined : props.style;
|
|
34
|
+
const maxFrame = durationInFrames * (actualTimes - 1);
|
|
35
|
+
const start = Math.floor(currentFrame / durationInFrames) * durationInFrames;
|
|
36
|
+
const from = Math.min(start, maxFrame);
|
|
37
|
+
const loopDisplay = (0, react_1.useMemo)(() => {
|
|
38
|
+
return {
|
|
39
|
+
numberOfTimes: actualTimes,
|
|
40
|
+
startOffset: -from,
|
|
41
|
+
durationInFrames,
|
|
42
|
+
};
|
|
43
|
+
}, [actualTimes, durationInFrames, from]);
|
|
44
|
+
return ((0, jsx_runtime_1.jsx)(Sequence_js_1.Sequence, { durationInFrames: durationInFrames, from: from, name: name, loopDisplay: loopDisplay, layout: props.layout, style: style, children: children }));
|
|
45
|
+
};
|
|
46
|
+
exports.Loop = Loop;
|
|
File without changes
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.checkMultipleRemotionVersions = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
4
|
+
const truthy_js_1 = require("./truthy.js");
|
|
5
|
+
const version_js_1 = require("./version.js");
|
|
6
6
|
const checkMultipleRemotionVersions = () => {
|
|
7
7
|
if (typeof globalThis === 'undefined') {
|
|
8
8
|
return;
|
|
@@ -10,18 +10,23 @@ const checkMultipleRemotionVersions = () => {
|
|
|
10
10
|
const alreadyImported = globalThis.remotion_imported ||
|
|
11
11
|
(typeof window !== 'undefined' && window.remotion_imported);
|
|
12
12
|
if (alreadyImported) {
|
|
13
|
+
if (alreadyImported === version_js_1.VERSION) {
|
|
14
|
+
// Next.JS will reload the package and cause a server-side warning.
|
|
15
|
+
// It's okay if this happens during SSR in developement
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
13
18
|
throw new TypeError(`🚨 Multiple versions of Remotion detected: ${[
|
|
14
|
-
|
|
19
|
+
version_js_1.VERSION,
|
|
15
20
|
typeof alreadyImported === 'string'
|
|
16
21
|
? alreadyImported
|
|
17
22
|
: 'an older version',
|
|
18
23
|
]
|
|
19
|
-
.filter(
|
|
24
|
+
.filter(truthy_js_1.truthy)
|
|
20
25
|
.join(' and ')}. This will cause things to break in an unexpected way.\nCheck that all your Remotion packages are on the same version. If your dependencies depend on Remotion, make them peer dependencies. You can also run \`npx remotion versions\` from your terminal to see which versions are mismatching.`);
|
|
21
26
|
}
|
|
22
|
-
globalThis.remotion_imported =
|
|
27
|
+
globalThis.remotion_imported = version_js_1.VERSION;
|
|
23
28
|
if (typeof window !== 'undefined') {
|
|
24
|
-
window.remotion_imported =
|
|
29
|
+
window.remotion_imported = version_js_1.VERSION;
|
|
25
30
|
}
|
|
26
31
|
};
|
|
27
32
|
exports.checkMultipleRemotionVersions = checkMultipleRemotionVersions;
|
|
@@ -9,7 +9,13 @@ exports.NonceContext = (0, react_1.createContext)({
|
|
|
9
9
|
const useNonce = () => {
|
|
10
10
|
const context = (0, react_1.useContext)(exports.NonceContext);
|
|
11
11
|
const [nonce, setNonce] = (0, react_1.useState)(() => context.getNonce());
|
|
12
|
+
const lastContext = (0, react_1.useRef)(context);
|
|
13
|
+
// Only if context changes, but not initially
|
|
12
14
|
(0, react_1.useEffect)(() => {
|
|
15
|
+
if (lastContext.current === context) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
lastContext.current = context;
|
|
13
19
|
setNonce(context.getNonce);
|
|
14
20
|
}, [context]);
|
|
15
21
|
return nonce;
|
package/dist/{play-and-handle-not-allowed-error.d.ts → cjs/play-and-handle-not-allowed-error.d.ts}
RENAMED
|
File without changes
|
package/dist/{play-and-handle-not-allowed-error.js → cjs/play-and-handle-not-allowed-error.js}
RENAMED
|
@@ -28,6 +28,10 @@ const playAndHandleNotAllowedError = (mediaRef, mediaType) => {
|
|
|
28
28
|
if (err.message.includes('request was interrupted by a new load request')) {
|
|
29
29
|
return;
|
|
30
30
|
}
|
|
31
|
+
// Audio tag got unmounted
|
|
32
|
+
if (err.message.includes('because the media was removed from the document')) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
31
35
|
console.log(`Could not play ${mediaType} due to following error: `, err);
|
|
32
36
|
if (!current.muted) {
|
|
33
37
|
console.log(`The video will be muted and we'll retry playing it.`, err);
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type Value = Record<string, string>;
|
|
3
|
+
export declare const PreloadContext: React.Context<Value>;
|
|
4
|
+
export declare const setPreloads: (updater: (p: Value) => Value) => void;
|
|
5
|
+
export declare const PrefetchProvider: React.FC<{
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
}>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PrefetchProvider = exports.setPreloads = exports.PreloadContext = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
exports.PreloadContext = (0, react_1.createContext)({});
|
|
7
|
+
let preloads = {};
|
|
8
|
+
let updaters = [];
|
|
9
|
+
const setPreloads = (updater) => {
|
|
10
|
+
preloads = updater(preloads);
|
|
11
|
+
updaters.forEach((u) => u());
|
|
12
|
+
};
|
|
13
|
+
exports.setPreloads = setPreloads;
|
|
14
|
+
const PrefetchProvider = ({ children }) => {
|
|
15
|
+
const [_preloads, _setPreloads] = (0, react_1.useState)(() => preloads);
|
|
16
|
+
(0, react_1.useEffect)(() => {
|
|
17
|
+
const updaterFunction = () => {
|
|
18
|
+
_setPreloads(preloads);
|
|
19
|
+
};
|
|
20
|
+
updaters.push(updaterFunction);
|
|
21
|
+
return () => {
|
|
22
|
+
updaters = updaters.filter((u) => u !== updaterFunction);
|
|
23
|
+
};
|
|
24
|
+
}, []);
|
|
25
|
+
return ((0, jsx_runtime_1.jsx)(exports.PreloadContext.Provider, { value: _preloads, children: children }));
|
|
26
|
+
};
|
|
27
|
+
exports.PrefetchProvider = PrefetchProvider;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const usePreload: (src: string) => string;
|
|
2
|
+
type FetchAndPreload = {
|
|
3
|
+
free: () => void;
|
|
4
|
+
waitUntilDone: () => Promise<string>;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* @description When you call the preFetch() function, an asset will be fetched and kept in memory so it is ready when you want to play it in a <Player>.
|
|
8
|
+
* @see [Documentation](https://www.remotion.dev/docs/prefetch)
|
|
9
|
+
*/
|
|
10
|
+
export declare const prefetch: (src: string, options?: {
|
|
11
|
+
method?: 'blob-url' | 'base64';
|
|
12
|
+
}) => FetchAndPreload;
|
|
13
|
+
export {};
|
|
@@ -2,16 +2,35 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.prefetch = exports.usePreload = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
5
|
+
const get_environment_js_1 = require("./get-environment.js");
|
|
6
|
+
const prefetch_state_js_1 = require("./prefetch-state.js");
|
|
7
7
|
const usePreload = (src) => {
|
|
8
8
|
var _a;
|
|
9
|
-
const
|
|
9
|
+
const preloads = (0, react_1.useContext)(prefetch_state_js_1.PreloadContext);
|
|
10
10
|
return (_a = preloads[src]) !== null && _a !== void 0 ? _a : src;
|
|
11
11
|
};
|
|
12
12
|
exports.usePreload = usePreload;
|
|
13
|
-
const
|
|
14
|
-
|
|
13
|
+
const blobToBase64 = function (blob) {
|
|
14
|
+
const reader = new FileReader();
|
|
15
|
+
return new Promise((resolve, reject) => {
|
|
16
|
+
reader.onload = function () {
|
|
17
|
+
const dataUrl = reader.result;
|
|
18
|
+
resolve(dataUrl);
|
|
19
|
+
};
|
|
20
|
+
reader.onerror = (err) => {
|
|
21
|
+
return reject(err);
|
|
22
|
+
};
|
|
23
|
+
reader.readAsDataURL(blob);
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* @description When you call the preFetch() function, an asset will be fetched and kept in memory so it is ready when you want to play it in a <Player>.
|
|
28
|
+
* @see [Documentation](https://www.remotion.dev/docs/prefetch)
|
|
29
|
+
*/
|
|
30
|
+
const prefetch = (src, options) => {
|
|
31
|
+
var _a;
|
|
32
|
+
const method = (_a = options === null || options === void 0 ? void 0 : options.method) !== null && _a !== void 0 ? _a : 'blob-url';
|
|
33
|
+
if ((0, get_environment_js_1.getRemotionEnvironment)() === 'rendering') {
|
|
15
34
|
return {
|
|
16
35
|
free: () => undefined,
|
|
17
36
|
waitUntilDone: () => Promise.resolve(src),
|
|
@@ -41,28 +60,35 @@ const prefetch = (src) => {
|
|
|
41
60
|
return res.blob();
|
|
42
61
|
})
|
|
43
62
|
.then((buf) => {
|
|
44
|
-
|
|
45
|
-
if (canceled) {
|
|
63
|
+
if (!buf) {
|
|
46
64
|
return;
|
|
47
65
|
}
|
|
48
|
-
if (
|
|
49
|
-
|
|
50
|
-
(_a = prefetch_state_1.preloadRef.current) === null || _a === void 0 ? void 0 : _a.setPreloads((p) => ({
|
|
51
|
-
...p,
|
|
52
|
-
[src]: objectUrl,
|
|
53
|
-
}));
|
|
54
|
-
resolve(objectUrl);
|
|
66
|
+
if (method === 'base64') {
|
|
67
|
+
return blobToBase64(buf);
|
|
55
68
|
}
|
|
69
|
+
return URL.createObjectURL(buf);
|
|
70
|
+
})
|
|
71
|
+
.then((url) => {
|
|
72
|
+
if (canceled) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
objectUrl = url;
|
|
76
|
+
(0, prefetch_state_js_1.setPreloads)((p) => ({
|
|
77
|
+
...p,
|
|
78
|
+
[src]: objectUrl,
|
|
79
|
+
}));
|
|
80
|
+
resolve(objectUrl);
|
|
56
81
|
})
|
|
57
82
|
.catch((err) => {
|
|
58
83
|
reject(err);
|
|
59
84
|
});
|
|
60
85
|
return {
|
|
61
86
|
free: () => {
|
|
62
|
-
var _a;
|
|
63
87
|
if (objectUrl) {
|
|
64
|
-
|
|
65
|
-
|
|
88
|
+
if (method === 'blob-url') {
|
|
89
|
+
URL.revokeObjectURL(objectUrl);
|
|
90
|
+
}
|
|
91
|
+
(0, prefetch_state_js_1.setPreloads)((p) => {
|
|
66
92
|
const copy = { ...p };
|
|
67
93
|
delete copy[src];
|
|
68
94
|
return copy;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { AnyZodObject, z } from 'zod';
|
|
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> | undefined> = And<AnyZodObject extends Schema ? true : false, {} extends Props ? true : false> extends true ? {
|
|
4
|
+
defaultProps?: {};
|
|
5
|
+
} : {
|
|
6
|
+
defaultProps: InferProps<Schema, Props>;
|
|
7
|
+
};
|
|
8
|
+
export type InferProps<Schema extends AnyZodObject, Props extends Record<string, unknown> | undefined> = AnyZodObject extends Schema ? {} extends Props ? Record<string, unknown> : Props : {} extends Props ? z.infer<Schema> : // Props and schema specified
|
|
9
|
+
z.infer<Schema> & Props;
|
|
10
|
+
export {};
|
|
File without changes
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type RandomSeed = number | string | null;
|
|
2
|
+
/**
|
|
3
|
+
* @description A deterministic pseudo-random number generator. Pass in the same seed and get the same pseudorandom number.
|
|
4
|
+
* @see [Documentation](https://remotion.dev/docs/random)
|
|
5
|
+
*/
|
|
6
|
+
export declare const random: (seed: RandomSeed, dummy?: unknown) => number;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.random = void 0;
|
|
4
|
+
/* eslint-disable no-bitwise */
|
|
4
5
|
function mulberry32(a) {
|
|
5
6
|
let t = a + 0x6d2b79f5;
|
|
6
7
|
t = Math.imul(t ^ (t >>> 15), t | 1);
|
|
@@ -19,9 +20,8 @@ function hashCode(str) {
|
|
|
19
20
|
return hash;
|
|
20
21
|
}
|
|
21
22
|
/**
|
|
22
|
-
* A deterministic pseudo-random number generator.
|
|
23
|
-
*
|
|
24
|
-
* See: https://remotion.dev/docs/random
|
|
23
|
+
* @description A deterministic pseudo-random number generator. Pass in the same seed and get the same pseudorandom number.
|
|
24
|
+
* @see [Documentation](https://remotion.dev/docs/random)
|
|
25
25
|
*/
|
|
26
26
|
const random = (seed, dummy) => {
|
|
27
27
|
if (dummy !== undefined) {
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* @description This function registers the root component of the Remotion project
|
|
4
|
+
* @see [Documentation](https://www.remotion.dev/docs/register-root)
|
|
5
|
+
*/
|
|
2
6
|
export declare const registerRoot: (comp: React.FC) => void;
|
|
3
7
|
export declare const getRoot: () => React.FC<{}> | null;
|
|
4
8
|
export declare const waitForRoot: (fn: (comp: React.FC) => void) => (() => void);
|
|
@@ -3,6 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.waitForRoot = exports.getRoot = exports.registerRoot = void 0;
|
|
4
4
|
let Root = null;
|
|
5
5
|
let listeners = [];
|
|
6
|
+
/**
|
|
7
|
+
* @description This function registers the root component of the Remotion project
|
|
8
|
+
* @see [Documentation](https://www.remotion.dev/docs/register-root)
|
|
9
|
+
*/
|
|
6
10
|
const registerRoot = (comp) => {
|
|
7
11
|
if (!comp) {
|
|
8
12
|
throw new Error(`You must pass a React component to registerRoot(), but ${JSON.stringify(comp)} was passed.`);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AnyZodObject } from 'zod';
|
|
2
|
+
import type { TCompMetadataWithCalcFunction } from './CompositionManager.js';
|
|
3
|
+
import type { VideoConfig } from './video-config.js';
|
|
4
|
+
export declare const resolveVideoConfig: ({ composition, editorProps: editorPropsOrUndefined, signal, }: {
|
|
5
|
+
composition: TCompMetadataWithCalcFunction<AnyZodObject, Record<string, unknown> | undefined>;
|
|
6
|
+
editorProps: object;
|
|
7
|
+
signal: AbortSignal;
|
|
8
|
+
}) => VideoConfig | Promise<VideoConfig>;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveVideoConfig = void 0;
|
|
4
|
+
const input_props_js_1 = require("./config/input-props.js");
|
|
5
|
+
const get_environment_js_1 = require("./get-environment.js");
|
|
6
|
+
const validate_dimensions_js_1 = require("./validation/validate-dimensions.js");
|
|
7
|
+
const validate_duration_in_frames_js_1 = require("./validation/validate-duration-in-frames.js");
|
|
8
|
+
const resolveVideoConfig = ({ composition, editorProps: editorPropsOrUndefined, signal, }) => {
|
|
9
|
+
var _a, _b, _c, _d, _e, _f;
|
|
10
|
+
const calculatedProm = composition.calculateMetadata
|
|
11
|
+
? composition.calculateMetadata({
|
|
12
|
+
defaultProps: (_a = composition.defaultProps) !== null && _a !== void 0 ? _a : {},
|
|
13
|
+
props: {
|
|
14
|
+
...((_b = composition.defaultProps) !== null && _b !== void 0 ? _b : {}),
|
|
15
|
+
...(editorPropsOrUndefined !== null && editorPropsOrUndefined !== void 0 ? editorPropsOrUndefined : {}),
|
|
16
|
+
...(typeof window === 'undefined' ||
|
|
17
|
+
(0, get_environment_js_1.getRemotionEnvironment)() === 'player-development' ||
|
|
18
|
+
(0, get_environment_js_1.getRemotionEnvironment)() === 'player-production'
|
|
19
|
+
? {}
|
|
20
|
+
: (_c = (0, input_props_js_1.getInputProps)()) !== null && _c !== void 0 ? _c : {}),
|
|
21
|
+
},
|
|
22
|
+
abortSignal: signal,
|
|
23
|
+
})
|
|
24
|
+
: null;
|
|
25
|
+
if (calculatedProm !== null &&
|
|
26
|
+
typeof calculatedProm === 'object' &&
|
|
27
|
+
'then' in calculatedProm) {
|
|
28
|
+
return calculatedProm.then((c) => {
|
|
29
|
+
var _a, _b;
|
|
30
|
+
const { height, width, durationInFrames, fps } = validateCalculated({
|
|
31
|
+
calculated: c,
|
|
32
|
+
composition,
|
|
33
|
+
});
|
|
34
|
+
return {
|
|
35
|
+
width,
|
|
36
|
+
height,
|
|
37
|
+
fps,
|
|
38
|
+
durationInFrames,
|
|
39
|
+
id: composition.id,
|
|
40
|
+
defaultProps: (_b = (_a = c.props) !== null && _a !== void 0 ? _a : composition.defaultProps) !== null && _b !== void 0 ? _b : {},
|
|
41
|
+
};
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
const data = validateCalculated({
|
|
45
|
+
calculated: calculatedProm,
|
|
46
|
+
composition,
|
|
47
|
+
});
|
|
48
|
+
if (calculatedProm === null) {
|
|
49
|
+
return {
|
|
50
|
+
...data,
|
|
51
|
+
id: composition.id,
|
|
52
|
+
defaultProps: (_d = composition === null || composition === void 0 ? void 0 : composition.defaultProps) !== null && _d !== void 0 ? _d : {},
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
return {
|
|
56
|
+
...data,
|
|
57
|
+
id: composition.id,
|
|
58
|
+
defaultProps: (_f = (_e = calculatedProm === null || calculatedProm === void 0 ? void 0 : calculatedProm.props) !== null && _e !== void 0 ? _e : composition.defaultProps) !== null && _f !== void 0 ? _f : {},
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
exports.resolveVideoConfig = resolveVideoConfig;
|
|
62
|
+
const validateCalculated = ({ composition, calculated, }) => {
|
|
63
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
64
|
+
const potentialErrorLocation = `calculated by calculateMetadata() for the composition "${composition.id}"`;
|
|
65
|
+
const width = (_b = (_a = calculated === null || calculated === void 0 ? void 0 : calculated.width) !== null && _a !== void 0 ? _a : composition.width) !== null && _b !== void 0 ? _b : null;
|
|
66
|
+
if (!width) {
|
|
67
|
+
throw new TypeError('Composition width was neither specified via the `width` prop nor the `calculateMetadata()` function.');
|
|
68
|
+
}
|
|
69
|
+
(0, validate_dimensions_js_1.validateDimension)(width, 'width', potentialErrorLocation);
|
|
70
|
+
const height = (_d = (_c = calculated === null || calculated === void 0 ? void 0 : calculated.height) !== null && _c !== void 0 ? _c : composition.height) !== null && _d !== void 0 ? _d : null;
|
|
71
|
+
if (!height) {
|
|
72
|
+
throw new TypeError('Composition height was neither specified via the `height` prop nor the `calculateMetadata()` function.');
|
|
73
|
+
}
|
|
74
|
+
(0, validate_dimensions_js_1.validateDimension)(width, 'height', potentialErrorLocation);
|
|
75
|
+
const fps = (_f = (_e = calculated === null || calculated === void 0 ? void 0 : calculated.fps) !== null && _e !== void 0 ? _e : composition.fps) !== null && _f !== void 0 ? _f : null;
|
|
76
|
+
if (!fps) {
|
|
77
|
+
throw new TypeError('Composition fps was neither specified via the `fps` prop nor the `calculateMetadata()` function.');
|
|
78
|
+
}
|
|
79
|
+
const durationInFrames = (_h = (_g = calculated === null || calculated === void 0 ? void 0 : calculated.durationInFrames) !== null && _g !== void 0 ? _g : composition.durationInFrames) !== null && _h !== void 0 ? _h : null;
|
|
80
|
+
if (!durationInFrames) {
|
|
81
|
+
throw new TypeError('Composition durationInFrames was neither specified via the `durationInFrames` prop nor the `calculateMetadata()` function.');
|
|
82
|
+
}
|
|
83
|
+
(0, validate_duration_in_frames_js_1.validateDurationInFrames)({
|
|
84
|
+
durationInFrames,
|
|
85
|
+
component: potentialErrorLocation,
|
|
86
|
+
allowFloats: false,
|
|
87
|
+
});
|
|
88
|
+
return { width, height, fps, durationInFrames };
|
|
89
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { FC, PropsWithChildren } from 'react';
|
|
2
|
+
import type { LayoutAndStyle, SequenceProps } from '../Sequence.js';
|
|
3
|
+
type SeriesSequenceProps = PropsWithChildren<{
|
|
4
|
+
durationInFrames: number;
|
|
5
|
+
offset?: number;
|
|
6
|
+
} & Pick<SequenceProps, 'layout' | 'name'> & LayoutAndStyle>;
|
|
7
|
+
declare const SeriesSequence: import("react").ForwardRefExoticComponent<SeriesSequenceProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
8
|
+
/**
|
|
9
|
+
* @description with this component, you can easily stitch together scenes that should play sequentially after another.
|
|
10
|
+
* @see [Documentation](https://www.remotion.dev/docs/series)
|
|
11
|
+
*/
|
|
12
|
+
declare const Series: FC<{
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
}> & {
|
|
15
|
+
Sequence: typeof SeriesSequence;
|
|
16
|
+
};
|
|
17
|
+
export { Series };
|
|
@@ -3,17 +3,24 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Series = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
6
|
+
const Sequence_js_1 = require("../Sequence.js");
|
|
7
|
+
const validate_duration_in_frames_js_1 = require("../validation/validate-duration-in-frames.js");
|
|
8
|
+
const flatten_children_js_1 = require("./flatten-children.js");
|
|
9
|
+
const SeriesSequenceRefForwardingFunction = ({ children }, _ref) => {
|
|
10
|
+
// Discard ref
|
|
10
11
|
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
11
12
|
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children });
|
|
12
13
|
};
|
|
14
|
+
const SeriesSequence = (0, react_1.forwardRef)(SeriesSequenceRefForwardingFunction);
|
|
15
|
+
/**
|
|
16
|
+
* @description with this component, you can easily stitch together scenes that should play sequentially after another.
|
|
17
|
+
* @see [Documentation](https://www.remotion.dev/docs/series)
|
|
18
|
+
*/
|
|
13
19
|
const Series = ({ children }) => {
|
|
14
20
|
const childrenValue = (0, react_1.useMemo)(() => {
|
|
15
21
|
let startFrame = 0;
|
|
16
|
-
|
|
22
|
+
const flattenedChildren = (0, flatten_children_js_1.flattenChildren)(children);
|
|
23
|
+
return react_1.Children.map(flattenedChildren, (child, i) => {
|
|
17
24
|
var _a;
|
|
18
25
|
const castedChild = child;
|
|
19
26
|
if (typeof castedChild === 'string') {
|
|
@@ -27,12 +34,19 @@ const Series = ({ children }) => {
|
|
|
27
34
|
throw new TypeError(`The <Series /> component only accepts a list of <Series.Sequence /> components as it's children, but got ${castedChild} instead`);
|
|
28
35
|
}
|
|
29
36
|
const debugInfo = `index = ${i}, duration = ${castedChild.props.durationInFrames}`;
|
|
30
|
-
if (!castedChild ||
|
|
37
|
+
if (!(castedChild === null || castedChild === void 0 ? void 0 : castedChild.props.children)) {
|
|
31
38
|
throw new TypeError(`A <Series.Sequence /> component (${debugInfo}) was detected to not have any children. Delete it to fix this error.`);
|
|
32
39
|
}
|
|
33
40
|
const durationInFramesProp = castedChild.props.durationInFrames;
|
|
34
41
|
const { durationInFrames, children: _children, ...passedProps } = castedChild.props;
|
|
35
|
-
|
|
42
|
+
if (i !== flattenedChildren.length - 1 ||
|
|
43
|
+
durationInFramesProp !== Infinity) {
|
|
44
|
+
(0, validate_duration_in_frames_js_1.validateDurationInFrames)({
|
|
45
|
+
durationInFrames: durationInFramesProp,
|
|
46
|
+
component: `of a <Series.Sequence /> component`,
|
|
47
|
+
allowFloats: true,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
36
50
|
const offset = (_a = castedChild.props.offset) !== null && _a !== void 0 ? _a : 0;
|
|
37
51
|
if (Number.isNaN(offset)) {
|
|
38
52
|
throw new TypeError(`The "offset" property of a <Series.Sequence /> must not be NaN, but got NaN (${debugInfo}).`);
|
|
@@ -45,7 +59,7 @@ const Series = ({ children }) => {
|
|
|
45
59
|
}
|
|
46
60
|
const currentStartFrame = startFrame + offset;
|
|
47
61
|
startFrame += durationInFramesProp + offset;
|
|
48
|
-
return ((0, jsx_runtime_1.jsx)(
|
|
62
|
+
return ((0, jsx_runtime_1.jsx)(Sequence_js_1.Sequence, { from: currentStartFrame, durationInFrames: durationInFramesProp, ...passedProps, ref: castedChild.ref, children: child }));
|
|
49
63
|
});
|
|
50
64
|
}, [children]);
|
|
51
65
|
/* eslint-disable react/jsx-no-useless-fragment */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const setupEnvVariables: () => void;
|
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setupEnvVariables =
|
|
4
|
-
const
|
|
5
|
-
exports.ENV_VARIABLES_ENV_NAME = 'ENV_VARIABLES';
|
|
3
|
+
exports.setupEnvVariables = void 0;
|
|
4
|
+
const get_environment_js_1 = require("./get-environment.js");
|
|
6
5
|
const getEnvVariables = () => {
|
|
7
|
-
if ((0,
|
|
6
|
+
if ((0, get_environment_js_1.getRemotionEnvironment)() === 'rendering') {
|
|
8
7
|
const param = window.remotion_envVariables;
|
|
9
8
|
if (!param) {
|
|
10
9
|
return {};
|
|
11
10
|
}
|
|
12
11
|
return { ...JSON.parse(param), NODE_ENV: process.env.NODE_ENV };
|
|
13
12
|
}
|
|
14
|
-
if ((0,
|
|
15
|
-
//
|
|
16
|
-
//
|
|
13
|
+
if ((0, get_environment_js_1.getRemotionEnvironment)() === 'preview') {
|
|
14
|
+
// For the Preview, we already set the environment variables in index-html.ts.
|
|
15
|
+
// We just add NODE_ENV here.
|
|
17
16
|
return {
|
|
18
|
-
|
|
19
|
-
NODE_ENV: process.env.NODE_ENV,
|
|
17
|
+
NODE_ENV: 'development',
|
|
20
18
|
};
|
|
21
19
|
}
|
|
22
20
|
throw new Error('Can only call getEnvVariables() if environment is `rendering` or `preview`');
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import type { SpringConfig } from './spring-utils';
|
|
1
|
+
import type { SpringConfig } from './spring-utils.js';
|
|
2
2
|
/**
|
|
3
|
-
* Calculates a position based on physical parameters, start and end value, and time.
|
|
4
|
-
* @
|
|
3
|
+
* @description Calculates a position based on physical parameters, start and end value, and time.
|
|
4
|
+
* @see [Documentation](https://www.remotion.dev/docs/spring)
|
|
5
5
|
* @param {number} frame The current time value. Most of the time you want to pass in the return value of useCurrentFrame.
|
|
6
6
|
* @param {number} fps The framerate at which the animation runs. Pass in the value obtained by `useVideoConfig()`.
|
|
7
|
+
* @param {?boolean} reverse Whether the animation plays in reverse or not. Default `false`.
|
|
7
8
|
* @param {?Object} config optional object that allows you to customize the physical properties of the animation.
|
|
8
9
|
* @param {number} [config.mass=1] The weight of the spring. If you reduce the mass, the animation becomes faster!
|
|
9
10
|
* @param {number} [config.damping=10] How hard the animation decelerates.
|
|
@@ -13,8 +14,9 @@ import type { SpringConfig } from './spring-utils';
|
|
|
13
14
|
* @param {?number} [config.to] The end value of the animation. Default `1`
|
|
14
15
|
* @param {?number} [config.durationInFrames] Stretch the duration of an animation to a set value.. Default `undefined`
|
|
15
16
|
* @param {?number} [config.durationThreshold] How close to the end the animation is considered to be done. Default `0.005`
|
|
17
|
+
* @param {?number} [config.delay] Delay the animation for this amount of frames. Default `0`
|
|
16
18
|
*/
|
|
17
|
-
export declare function spring({ frame, fps, config, from, to, durationInFrames, durationRestThreshold, }: {
|
|
19
|
+
export declare function spring({ frame: passedFrame, fps, config, from, to, durationInFrames: passedDurationInFrames, durationRestThreshold, delay, reverse, }: {
|
|
18
20
|
frame: number;
|
|
19
21
|
fps: number;
|
|
20
22
|
config?: Partial<SpringConfig>;
|
|
@@ -22,6 +24,8 @@ export declare function spring({ frame, fps, config, from, to, durationInFrames,
|
|
|
22
24
|
to?: number;
|
|
23
25
|
durationInFrames?: number;
|
|
24
26
|
durationRestThreshold?: number;
|
|
27
|
+
delay?: number;
|
|
28
|
+
reverse?: boolean;
|
|
25
29
|
}): number;
|
|
26
|
-
export { measureSpring } from './measure-spring';
|
|
27
|
-
export { SpringConfig } from './spring-utils';
|
|
30
|
+
export { measureSpring } from './measure-spring.js';
|
|
31
|
+
export { SpringConfig } from './spring-utils.js';
|