@remotion/cli 3.1.6 → 3.1.7
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/code-frame.js +3 -3
- package/dist/compositions.d.ts +1 -1
- package/dist/compositions.js +9 -3
- package/dist/config/browser-executable.d.ts +3 -0
- package/dist/config/browser-executable.js +12 -0
- package/dist/config/browser.d.ts +3 -0
- package/dist/config/browser.js +18 -0
- package/dist/config/chromium-flags.d.ts +9 -0
- package/dist/config/chromium-flags.js +33 -0
- package/dist/config/codec.d.ts +7 -0
- package/dist/config/codec.js +40 -0
- package/dist/config/concurrency.d.ts +3 -0
- package/dist/config/concurrency.js +12 -0
- package/dist/config/crf.d.ts +4 -0
- package/dist/config/crf.js +23 -0
- package/dist/config/env-file.d.ts +2 -0
- package/dist/config/env-file.js +10 -0
- package/dist/config/every-nth-frame.d.ts +3 -0
- package/dist/config/every-nth-frame.js +20 -0
- package/dist/config/ffmpeg-executable.d.ts +5 -0
- package/dist/config/ffmpeg-executable.js +21 -0
- package/dist/config/frame-range.d.ts +4 -0
- package/dist/config/frame-range.js +35 -0
- package/dist/config/image-format.d.ts +3 -0
- package/dist/config/image-format.js +20 -0
- package/dist/config/image-sequence.d.ts +3 -0
- package/dist/config/image-sequence.js +15 -0
- package/dist/config/index.d.ts +43 -0
- package/dist/config/index.js +162 -0
- package/dist/config/log.d.ts +3 -0
- package/dist/config/log.js +12 -0
- package/dist/config/max-timeline-tracks.d.ts +2 -0
- package/dist/config/max-timeline-tracks.js +24 -0
- package/dist/config/number-of-gif-loops.d.ts +4 -0
- package/dist/config/number-of-gif-loops.js +21 -0
- package/dist/config/output-location.d.ts +2 -0
- package/dist/config/output-location.js +16 -0
- package/dist/config/override-webpack.d.ts +5 -0
- package/dist/config/override-webpack.js +14 -0
- package/dist/config/overwrite.d.ts +2 -0
- package/dist/config/overwrite.js +14 -0
- package/dist/config/pixel-format.d.ts +3 -0
- package/dist/config/pixel-format.js +16 -0
- package/dist/config/preview-server.d.ts +2 -0
- package/dist/config/preview-server.js +20 -0
- package/dist/config/prores-profile.d.ts +3 -0
- package/dist/config/prores-profile.js +12 -0
- package/dist/config/quality.d.ts +2 -0
- package/dist/config/quality.js +17 -0
- package/dist/config/scale.d.ts +3 -0
- package/dist/config/scale.js +15 -0
- package/dist/config/still-frame.d.ts +2 -0
- package/dist/config/still-frame.js +12 -0
- package/dist/config/timeout.d.ts +2 -0
- package/dist/config/timeout.js +17 -0
- package/dist/config/webpack-caching.d.ts +3 -0
- package/dist/config/webpack-caching.js +16 -0
- package/dist/editor/components/CompositionSelectorItem.d.ts +1 -1
- package/dist/editor/components/CompositionSelectorItem.js +2 -1
- package/dist/editor/components/Editor.js +2 -1
- package/dist/editor/components/InitialCompositionLoader.d.ts +1 -1
- package/dist/editor/components/InitialCompositionLoader.js +17 -4
- package/dist/editor/components/PlayPause.js +4 -0
- package/dist/editor/components/Timeline/TimelineDragHandler.js +3 -2
- package/dist/editor/components/Timeline/TimelineInOutPointer.js +2 -1
- package/dist/editor/components/Timeline/TimelineListItem.js +1 -0
- package/dist/editor/components/TimelineInOutToggle.js +3 -2
- package/dist/editor/state/in-out.d.ts +12 -0
- package/dist/editor/state/in-out.js +23 -0
- package/dist/find-closest-package-json.d.ts +2 -0
- package/dist/find-closest-package-json.js +35 -0
- package/dist/get-cli-options.d.ts +4 -5
- package/dist/get-cli-options.js +35 -32
- package/dist/get-config-file-name.d.ts +1 -1
- package/dist/get-config-file-name.js +9 -6
- package/dist/get-env.js +6 -4
- package/dist/get-filename.d.ts +1 -1
- package/dist/get-final-output-codec.d.ts +6 -0
- package/dist/get-final-output-codec.js +63 -0
- package/dist/image-formats.d.ts +3 -3
- package/dist/image-formats.js +4 -3
- package/dist/index.d.ts +10 -8
- package/dist/index.js +17 -9
- package/dist/initialize-render-cli.d.ts +1 -1
- package/dist/initialize-render-cli.js +8 -3
- package/dist/lambda-command.d.ts +1 -1
- package/dist/lambda-command.js +4 -4
- package/dist/load-config.d.ts +1 -1
- package/dist/load-config.js +16 -5
- package/dist/log.js +7 -6
- package/dist/parse-command-line.d.ts +1 -1
- package/dist/parse-command-line.js +31 -30
- package/dist/preview-server/error-overlay/react-overlay/effects/map-error-to-react-stack.js +2 -2
- package/dist/preview-server/error-overlay/react-overlay/utils/get-file-source.d.ts +1 -1
- package/dist/preview-server/error-overlay/react-overlay/utils/get-file-source.js +3 -3
- package/dist/preview-server/get-package-manager.d.ts +1 -1
- package/dist/preview-server/get-package-manager.js +2 -2
- package/dist/preview-server/project-info.d.ts +1 -1
- package/dist/preview-server/project-info.js +3 -3
- package/dist/preview-server/routes.d.ts +2 -1
- package/dist/preview-server/routes.js +28 -17
- package/dist/preview-server/start-server.d.ts +1 -0
- package/dist/preview-server/start-server.js +4 -2
- package/dist/preview-server/update-available.d.ts +1 -1
- package/dist/preview-server/update-available.js +8 -5
- package/dist/preview.d.ts +1 -1
- package/dist/preview.js +5 -4
- package/dist/previewEntry.js +1 -0
- package/dist/progress-bar.d.ts +1 -2
- package/dist/progress-bar.js +5 -4
- package/dist/render.d.ts +1 -1
- package/dist/render.js +17 -10
- package/dist/setup-cache.d.ts +2 -1
- package/dist/setup-cache.js +16 -9
- package/dist/still.d.ts +1 -1
- package/dist/still.js +15 -10
- package/dist/truthy.d.ts +3 -0
- package/dist/truthy.js +7 -0
- package/dist/upgrade.d.ts +1 -1
- package/dist/upgrade.js +5 -10
- package/dist/user-passed-output-location.js +2 -2
- package/dist/versions.d.ts +2 -2
- package/dist/versions.js +13 -12
- package/dist/webpack-cache.d.ts +2 -2
- package/dist/webpack-cache.js +10 -10
- package/package.json +7 -7
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getMaxTimelineTracks = exports.setMaxTimelineTracks = void 0;
|
|
4
|
+
let maxTimelineTracks = 15;
|
|
5
|
+
const setMaxTimelineTracks = (maxTracks) => {
|
|
6
|
+
if (typeof maxTracks !== 'number') {
|
|
7
|
+
throw new Error(`Need to pass a number to Config.Preview.setMaxTimelineTracks(), got ${typeof maxTracks}`);
|
|
8
|
+
}
|
|
9
|
+
if (Number.isNaN(maxTracks)) {
|
|
10
|
+
throw new Error(`Need to pass a real number to Config.Preview.setMaxTimelineTracks(), got NaN`);
|
|
11
|
+
}
|
|
12
|
+
if (!Number.isFinite(maxTracks)) {
|
|
13
|
+
throw new Error(`Need to pass a real number to Config.Preview.setMaxTimelineTracks(), got ${maxTracks}`);
|
|
14
|
+
}
|
|
15
|
+
if (maxTracks < 0) {
|
|
16
|
+
throw new Error(`Need to pass a non-negative number to Config.Preview.setMaxTimelineTracks(), got ${maxTracks}`);
|
|
17
|
+
}
|
|
18
|
+
maxTimelineTracks = maxTracks;
|
|
19
|
+
};
|
|
20
|
+
exports.setMaxTimelineTracks = setMaxTimelineTracks;
|
|
21
|
+
const getMaxTimelineTracks = () => {
|
|
22
|
+
return maxTimelineTracks;
|
|
23
|
+
};
|
|
24
|
+
exports.getMaxTimelineTracks = getMaxTimelineTracks;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAndValidateNumberOfGifLoops = exports.setNumberOfGifLoops = void 0;
|
|
4
|
+
let currentLoop = null;
|
|
5
|
+
const setNumberOfGifLoops = (newLoop) => {
|
|
6
|
+
if (newLoop !== null && typeof newLoop !== 'number') {
|
|
7
|
+
throw new Error('--number-of-gif-loops flag must be a number.');
|
|
8
|
+
}
|
|
9
|
+
currentLoop = newLoop;
|
|
10
|
+
};
|
|
11
|
+
exports.setNumberOfGifLoops = setNumberOfGifLoops;
|
|
12
|
+
const getAndValidateNumberOfGifLoops = (codec) => {
|
|
13
|
+
if (currentLoop === null) {
|
|
14
|
+
return currentLoop;
|
|
15
|
+
}
|
|
16
|
+
if (codec !== 'gif') {
|
|
17
|
+
throw new Error(`The "numberOfGifLoops" setting can only be used for GIFs. The codec is set to ${codec}`);
|
|
18
|
+
}
|
|
19
|
+
return currentLoop;
|
|
20
|
+
};
|
|
21
|
+
exports.getAndValidateNumberOfGifLoops = getAndValidateNumberOfGifLoops;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getOutputLocation = exports.setOutputLocation = void 0;
|
|
4
|
+
let currentOutputLocation = null;
|
|
5
|
+
const setOutputLocation = (newOutputLocation) => {
|
|
6
|
+
if (typeof newOutputLocation !== 'string') {
|
|
7
|
+
throw new Error(`outputLocation must be a string but got ${typeof newOutputLocation} (${JSON.stringify(newOutputLocation)})`);
|
|
8
|
+
}
|
|
9
|
+
if (newOutputLocation.trim() === '') {
|
|
10
|
+
throw new Error(`outputLocation must not be an empty string`);
|
|
11
|
+
}
|
|
12
|
+
currentOutputLocation = newOutputLocation;
|
|
13
|
+
};
|
|
14
|
+
exports.setOutputLocation = setOutputLocation;
|
|
15
|
+
const getOutputLocation = () => currentOutputLocation;
|
|
16
|
+
exports.getOutputLocation = getOutputLocation;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { WebpackConfiguration } from '@remotion/bundler';
|
|
2
|
+
export declare type WebpackOverrideFn = (currentConfiguration: WebpackConfiguration) => WebpackConfiguration;
|
|
3
|
+
export declare const defaultOverrideFunction: WebpackOverrideFn;
|
|
4
|
+
export declare const getWebpackOverrideFn: () => WebpackOverrideFn;
|
|
5
|
+
export declare const overrideWebpackConfig: (fn: WebpackOverrideFn) => void;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.overrideWebpackConfig = exports.getWebpackOverrideFn = exports.defaultOverrideFunction = void 0;
|
|
4
|
+
const defaultOverrideFunction = (config) => config;
|
|
5
|
+
exports.defaultOverrideFunction = defaultOverrideFunction;
|
|
6
|
+
let overrideFn = exports.defaultOverrideFunction;
|
|
7
|
+
const getWebpackOverrideFn = () => {
|
|
8
|
+
return overrideFn;
|
|
9
|
+
};
|
|
10
|
+
exports.getWebpackOverrideFn = getWebpackOverrideFn;
|
|
11
|
+
const overrideWebpackConfig = (fn) => {
|
|
12
|
+
overrideFn = fn;
|
|
13
|
+
};
|
|
14
|
+
exports.overrideWebpackConfig = overrideWebpackConfig;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getShouldOverwrite = exports.setOverwriteOutput = void 0;
|
|
4
|
+
const renderer_1 = require("@remotion/renderer");
|
|
5
|
+
let shouldOverwrite = renderer_1.RenderInternals.DEFAULT_OVERWRITE;
|
|
6
|
+
const setOverwriteOutput = (newOverwrite) => {
|
|
7
|
+
if (typeof newOverwrite !== 'boolean') {
|
|
8
|
+
throw new Error(`overwriteExisting must be a boolean but got ${typeof newOverwrite} (${JSON.stringify(newOverwrite)})`);
|
|
9
|
+
}
|
|
10
|
+
shouldOverwrite = newOverwrite;
|
|
11
|
+
};
|
|
12
|
+
exports.setOverwriteOutput = setOverwriteOutput;
|
|
13
|
+
const getShouldOverwrite = () => shouldOverwrite;
|
|
14
|
+
exports.getShouldOverwrite = getShouldOverwrite;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { PixelFormat } from '@remotion/renderer';
|
|
2
|
+
export declare const setPixelFormat: (format: PixelFormat) => void;
|
|
3
|
+
export declare const getPixelFormat: () => "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getPixelFormat = exports.setPixelFormat = void 0;
|
|
4
|
+
const renderer_1 = require("@remotion/renderer");
|
|
5
|
+
let currentPixelFormat = renderer_1.RenderInternals.DEFAULT_PIXEL_FORMAT;
|
|
6
|
+
const setPixelFormat = (format) => {
|
|
7
|
+
if (!renderer_1.RenderInternals.validPixelFormats.includes(format)) {
|
|
8
|
+
throw new TypeError(`Value ${format} is not valid as a pixel format.`);
|
|
9
|
+
}
|
|
10
|
+
currentPixelFormat = format;
|
|
11
|
+
};
|
|
12
|
+
exports.setPixelFormat = setPixelFormat;
|
|
13
|
+
const getPixelFormat = () => {
|
|
14
|
+
return currentPixelFormat;
|
|
15
|
+
};
|
|
16
|
+
exports.getPixelFormat = getPixelFormat;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getServerPort = exports.setPort = void 0;
|
|
4
|
+
let serverPort;
|
|
5
|
+
const setPort = (port) => {
|
|
6
|
+
if (!['number', 'undefined'].includes(typeof port)) {
|
|
7
|
+
throw new Error(`Preview server port should be a number. Got ${typeof port} (${JSON.stringify(port)})`);
|
|
8
|
+
}
|
|
9
|
+
if (port === undefined) {
|
|
10
|
+
serverPort = undefined;
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
if (port < 1 || port > 65535) {
|
|
14
|
+
throw new Error(`Preview server port should be a number between 1 and 65535. Got ${port}`);
|
|
15
|
+
}
|
|
16
|
+
serverPort = port;
|
|
17
|
+
};
|
|
18
|
+
exports.setPort = setPort;
|
|
19
|
+
const getServerPort = () => serverPort;
|
|
20
|
+
exports.getServerPort = getServerPort;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setProResProfile = exports.getProResProfile = void 0;
|
|
4
|
+
let proResProfile;
|
|
5
|
+
const getProResProfile = () => {
|
|
6
|
+
return proResProfile;
|
|
7
|
+
};
|
|
8
|
+
exports.getProResProfile = getProResProfile;
|
|
9
|
+
const setProResProfile = (profile) => {
|
|
10
|
+
proResProfile = profile;
|
|
11
|
+
};
|
|
12
|
+
exports.setProResProfile = setProResProfile;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getQuality = exports.setQuality = void 0;
|
|
4
|
+
const renderer_1 = require("@remotion/renderer");
|
|
5
|
+
const defaultValue = undefined;
|
|
6
|
+
let quality = defaultValue;
|
|
7
|
+
const setQuality = (q) => {
|
|
8
|
+
renderer_1.RenderInternals.validateQuality(q);
|
|
9
|
+
if (q === 0 || q === undefined) {
|
|
10
|
+
quality = defaultValue;
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
quality = q;
|
|
14
|
+
};
|
|
15
|
+
exports.setQuality = setQuality;
|
|
16
|
+
const getQuality = () => quality;
|
|
17
|
+
exports.getQuality = getQuality;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getScale = exports.setScale = void 0;
|
|
4
|
+
let currentScale = 1;
|
|
5
|
+
const setScale = (newScale) => {
|
|
6
|
+
if (typeof newScale !== 'number') {
|
|
7
|
+
throw new Error('--scale flag must be a number.');
|
|
8
|
+
}
|
|
9
|
+
currentScale = newScale;
|
|
10
|
+
};
|
|
11
|
+
exports.setScale = setScale;
|
|
12
|
+
const getScale = () => {
|
|
13
|
+
return currentScale;
|
|
14
|
+
};
|
|
15
|
+
exports.getScale = getScale;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getStillFrame = exports.setStillFrame = void 0;
|
|
4
|
+
const renderer_1 = require("@remotion/renderer");
|
|
5
|
+
let stillFrame = 0;
|
|
6
|
+
const setStillFrame = (frame) => {
|
|
7
|
+
renderer_1.RenderInternals.validateFrame(frame, Infinity);
|
|
8
|
+
stillFrame = frame;
|
|
9
|
+
};
|
|
10
|
+
exports.setStillFrame = setStillFrame;
|
|
11
|
+
const getStillFrame = () => stillFrame;
|
|
12
|
+
exports.getStillFrame = getStillFrame;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getCurrentPuppeteerTimeout = exports.setPuppeteerTimeout = void 0;
|
|
4
|
+
const renderer_1 = require("@remotion/renderer");
|
|
5
|
+
let currentTimeout = renderer_1.RenderInternals.DEFAULT_TIMEOUT;
|
|
6
|
+
const setPuppeteerTimeout = (newPuppeteerTimeout) => {
|
|
7
|
+
if (typeof newPuppeteerTimeout !== 'number') {
|
|
8
|
+
throw new Error('--timeout flag / setTimeoutInMilliseconds() must be a number, but got ' +
|
|
9
|
+
JSON.stringify(newPuppeteerTimeout));
|
|
10
|
+
}
|
|
11
|
+
currentTimeout = newPuppeteerTimeout;
|
|
12
|
+
};
|
|
13
|
+
exports.setPuppeteerTimeout = setPuppeteerTimeout;
|
|
14
|
+
const getCurrentPuppeteerTimeout = () => {
|
|
15
|
+
return currentTimeout;
|
|
16
|
+
};
|
|
17
|
+
exports.getCurrentPuppeteerTimeout = getCurrentPuppeteerTimeout;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getWebpackCaching = exports.setWebpackCaching = exports.DEFAULT_WEBPACK_CACHE_ENABLED = void 0;
|
|
4
|
+
exports.DEFAULT_WEBPACK_CACHE_ENABLED = true;
|
|
5
|
+
let webpackCaching = exports.DEFAULT_WEBPACK_CACHE_ENABLED;
|
|
6
|
+
const setWebpackCaching = (flag) => {
|
|
7
|
+
if (typeof flag !== 'boolean') {
|
|
8
|
+
throw new TypeError('Caching flag must be a boolean.');
|
|
9
|
+
}
|
|
10
|
+
webpackCaching = flag;
|
|
11
|
+
};
|
|
12
|
+
exports.setWebpackCaching = setWebpackCaching;
|
|
13
|
+
const getWebpackCaching = () => {
|
|
14
|
+
return webpackCaching;
|
|
15
|
+
};
|
|
16
|
+
exports.getWebpackCaching = getWebpackCaching;
|
|
@@ -16,7 +16,7 @@ export declare const CompositionSelectorItem: React.FC<{
|
|
|
16
16
|
item: CompositionSelectorItemType;
|
|
17
17
|
currentComposition: string | null;
|
|
18
18
|
tabIndex: number;
|
|
19
|
-
selectComposition: (c: TComposition) => void;
|
|
19
|
+
selectComposition: (c: TComposition, push: boolean) => void;
|
|
20
20
|
toggleFolder: (folderName: string, parentName: string | null) => void;
|
|
21
21
|
level: number;
|
|
22
22
|
}>;
|
|
@@ -22,6 +22,7 @@ const itemStyle = {
|
|
|
22
22
|
appearance: 'none',
|
|
23
23
|
border: 'none',
|
|
24
24
|
width: '100%',
|
|
25
|
+
textAlign: 'left',
|
|
25
26
|
};
|
|
26
27
|
const iconStyle = {
|
|
27
28
|
width: 18,
|
|
@@ -58,7 +59,7 @@ const CompositionSelectorItem = ({ item, level, currentComposition, tabIndex, se
|
|
|
58
59
|
const onClick = (0, react_1.useCallback)((evt) => {
|
|
59
60
|
evt.preventDefault();
|
|
60
61
|
if (item.type === 'composition') {
|
|
61
|
-
selectComposition(item.composition);
|
|
62
|
+
selectComposition(item.composition, true);
|
|
62
63
|
}
|
|
63
64
|
else {
|
|
64
65
|
toggleFolder(item.folderName, item.parentName);
|
|
@@ -13,6 +13,7 @@ const noop_1 = require("../helpers/noop");
|
|
|
13
13
|
const checkerboard_1 = require("../state/checkerboard");
|
|
14
14
|
const folders_1 = require("../state/folders");
|
|
15
15
|
const highest_z_index_1 = require("../state/highest-z-index");
|
|
16
|
+
const in_out_1 = require("../state/in-out");
|
|
16
17
|
const keybindings_1 = require("../state/keybindings");
|
|
17
18
|
const modals_1 = require("../state/modals");
|
|
18
19
|
const mute_1 = require("../state/mute");
|
|
@@ -130,7 +131,7 @@ const Editor = () => {
|
|
|
130
131
|
});
|
|
131
132
|
return () => cleanup();
|
|
132
133
|
}, [Root, waitForRoot]);
|
|
133
|
-
return ((0, jsx_runtime_1.jsx)(keybindings_1.KeybindingContextProvider, { children: (0, jsx_runtime_1.jsx)(rich_timeline_1.RichTimelineContext.Provider, { value: richTimelineCtx, children: (0, jsx_runtime_1.jsx)(checkerboard_1.CheckerboardContext.Provider, { value: checkerboardCtx, children: (0, jsx_runtime_1.jsx)(preview_size_1.PreviewSizeContext.Provider, { value: previewSizeCtx, children: (0, jsx_runtime_1.jsx)(modals_1.ModalsContext.Provider, { value: modalsContext, children: (0, jsx_runtime_1.jsx)(
|
|
134
|
+
return ((0, jsx_runtime_1.jsx)(keybindings_1.KeybindingContextProvider, { children: (0, jsx_runtime_1.jsx)(rich_timeline_1.RichTimelineContext.Provider, { value: richTimelineCtx, children: (0, jsx_runtime_1.jsx)(checkerboard_1.CheckerboardContext.Provider, { value: checkerboardCtx, children: (0, jsx_runtime_1.jsx)(preview_size_1.PreviewSizeContext.Provider, { value: previewSizeCtx, children: (0, jsx_runtime_1.jsx)(modals_1.ModalsContext.Provider, { value: modalsContext, children: (0, jsx_runtime_1.jsx)(in_out_1.TimelineInOutContext.Provider, { value: timelineInOutContextValue, children: (0, jsx_runtime_1.jsx)(in_out_1.SetTimelineInOutContext.Provider, { value: setTimelineInOutContextValue, children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.MediaVolumeContext.Provider, { value: mediaVolumeContextValue, children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.SetMediaVolumeContext.Provider, { value: setMediaVolumeContextValue, children: (0, jsx_runtime_1.jsx)(player_1.PlayerInternals.PlayerEventEmitterContext.Provider, { value: emitter, children: (0, jsx_runtime_1.jsx)(sidebar_1.SidebarContextProvider, { children: (0, jsx_runtime_1.jsx)(folders_1.FolderContextProvider, { children: (0, jsx_runtime_1.jsx)(highest_z_index_1.HighestZIndexProvider, { children: (0, jsx_runtime_1.jsxs)(z_index_1.HigherZIndex, { onEscape: noop_1.noop, onOutsideClick: noop_1.noop, children: [(0, jsx_runtime_1.jsxs)("div", { style: background, children: [Root === null ? null : (0, jsx_runtime_1.jsx)(Root, {}), (0, jsx_runtime_1.jsxs)(remotion_1.Internals.CanUseRemotionHooksProvider, { children: [(0, jsx_runtime_1.jsx)(FramePersistor_1.FramePersistor, {}), Root === null ? ((0, jsx_runtime_1.jsx)(NoRegisterRoot_1.NoRegisterRoot, {})) : ((0, jsx_runtime_1.jsx)(EditorContent_1.EditorContent, {})), (0, jsx_runtime_1.jsx)(GlobalKeybindings_1.GlobalKeybindings, {})] })] }), (0, jsx_runtime_1.jsx)(NotificationCenter_1.NotificationCenter, {}), modalContextType &&
|
|
134
135
|
modalContextType.type === 'new-comp' && ((0, jsx_runtime_1.jsx)(NewComposition_1.default, { initialCompType: modalContextType.compType })), modalContextType &&
|
|
135
136
|
modalContextType.type === 'update' && ((0, jsx_runtime_1.jsx)(UpdateModal_1.UpdateModal, { info: modalContextType.info })), modalContextType &&
|
|
136
137
|
modalContextType.type === 'shortcuts' && ((0, jsx_runtime_1.jsx)(KeyboardShortcutsModal_1.KeyboardShortcuts, {}))] }) }) }) }) }) }) }) }) }) }) }) }) }) }));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import type { TComposition } from 'remotion';
|
|
3
|
-
export declare const useSelectComposition: () => (c: TComposition) => void;
|
|
3
|
+
export declare const useSelectComposition: () => (c: TComposition, push: boolean) => void;
|
|
4
4
|
export declare const InitialCompositionLoader: React.FC;
|
|
@@ -12,10 +12,12 @@ const useSelectComposition = () => {
|
|
|
12
12
|
const setCurrentFrame = remotion_1.Internals.Timeline.useTimelineSetFrame();
|
|
13
13
|
const { setCurrentComposition } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
14
14
|
const { setFoldersExpanded } = (0, react_1.useContext)(folders_1.FolderContext);
|
|
15
|
-
return (c) => {
|
|
15
|
+
return (c, push) => {
|
|
16
16
|
var _a;
|
|
17
17
|
(_a = TimelineInOutToggle_1.inOutHandles.current) === null || _a === void 0 ? void 0 : _a.setMarks((0, marks_1.loadMarks)(c.id, c.durationInFrames));
|
|
18
|
-
|
|
18
|
+
if (push) {
|
|
19
|
+
window.history.pushState({}, 'Preview', `/${c.id}`);
|
|
20
|
+
}
|
|
19
21
|
const frame = (0, FramePersistor_1.getFrameForComposition)(c.id);
|
|
20
22
|
const frameInBounds = Math.min(c.durationInFrames - 1, frame);
|
|
21
23
|
setCurrentFrame(frameInBounds);
|
|
@@ -47,14 +49,25 @@ const InitialCompositionLoader = () => {
|
|
|
47
49
|
if (compositionFromUrl) {
|
|
48
50
|
const exists = compositions.find((c) => c.id === compositionFromUrl);
|
|
49
51
|
if (exists) {
|
|
50
|
-
selectComposition(exists);
|
|
52
|
+
selectComposition(exists, true);
|
|
51
53
|
return;
|
|
52
54
|
}
|
|
53
55
|
}
|
|
54
56
|
if (compositions.length > 0) {
|
|
55
|
-
selectComposition(compositions[0]);
|
|
57
|
+
selectComposition(compositions[0], true);
|
|
56
58
|
}
|
|
57
59
|
}, [compositions, currentComposition, selectComposition]);
|
|
60
|
+
(0, react_1.useEffect)(() => {
|
|
61
|
+
const onchange = () => {
|
|
62
|
+
const newComp = window.location.pathname.substring(1);
|
|
63
|
+
const exists = compositions.find((c) => c.id === newComp);
|
|
64
|
+
if (exists) {
|
|
65
|
+
selectComposition(exists, false);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
window.addEventListener('popstate', onchange);
|
|
69
|
+
return () => window.removeEventListener('popstate', onchange);
|
|
70
|
+
}, [compositions, selectComposition]);
|
|
58
71
|
return null;
|
|
59
72
|
};
|
|
60
73
|
exports.InitialCompositionLoader = InitialCompositionLoader;
|
|
@@ -12,6 +12,7 @@ const pause_1 = require("../icons/pause");
|
|
|
12
12
|
const play_1 = require("../icons/play");
|
|
13
13
|
const step_back_1 = require("../icons/step-back");
|
|
14
14
|
const step_forward_1 = require("../icons/step-forward");
|
|
15
|
+
const in_out_1 = require("../state/in-out");
|
|
15
16
|
const ControlButton_1 = require("./ControlButton");
|
|
16
17
|
const forwardBackStyle = {
|
|
17
18
|
height: 16,
|
|
@@ -19,12 +20,15 @@ const forwardBackStyle = {
|
|
|
19
20
|
};
|
|
20
21
|
const PlayPause = ({ playbackRate, loop }) => {
|
|
21
22
|
var _a;
|
|
23
|
+
const { inFrame, outFrame } = (0, in_out_1.useTimelineInOutFramePosition)();
|
|
22
24
|
const frame = remotion_1.Internals.Timeline.useTimelinePosition();
|
|
23
25
|
const video = remotion_1.Internals.useVideo();
|
|
24
26
|
player_1.PlayerInternals.usePlayback({
|
|
25
27
|
loop,
|
|
26
28
|
playbackRate,
|
|
27
29
|
moveToBeginningWhenEnded: true,
|
|
30
|
+
inFrame,
|
|
31
|
+
outFrame,
|
|
28
32
|
});
|
|
29
33
|
const { playing, play, pause, pauseAndReturnToPlayStart, frameBack, seek, frameForward, isLastFrame, } = player_1.PlayerInternals.usePlayer();
|
|
30
34
|
const isStill = (0, is_current_selected_still_1.useIsStill)();
|
|
@@ -7,6 +7,7 @@ const react_1 = require("react");
|
|
|
7
7
|
const remotion_1 = require("remotion");
|
|
8
8
|
const get_left_of_timeline_slider_1 = require("../../helpers/get-left-of-timeline-slider");
|
|
9
9
|
const timeline_layout_1 = require("../../helpers/timeline-layout");
|
|
10
|
+
const in_out_1 = require("../../state/in-out");
|
|
10
11
|
const FramePersistor_1 = require("../FramePersistor");
|
|
11
12
|
const timeline_refs_1 = require("./timeline-refs");
|
|
12
13
|
const TimelineInOutPointer_1 = require("./TimelineInOutPointer");
|
|
@@ -42,8 +43,8 @@ const TimelineDragHandler = () => {
|
|
|
42
43
|
});
|
|
43
44
|
const width = (_a = size === null || size === void 0 ? void 0 : size.width) !== null && _a !== void 0 ? _a : 0;
|
|
44
45
|
const left = (_b = size === null || size === void 0 ? void 0 : size.left) !== null && _b !== void 0 ? _b : 0;
|
|
45
|
-
const { inFrame, outFrame } =
|
|
46
|
-
const { setInAndOutFrames } =
|
|
46
|
+
const { inFrame, outFrame } = (0, in_out_1.useTimelineInOutFramePosition)();
|
|
47
|
+
const { setInAndOutFrames } = (0, in_out_1.useTimelineSetInOutFramePosition)();
|
|
47
48
|
const { get } = (0, get_left_of_timeline_slider_1.useGetXPositionOfItemInTimeline)();
|
|
48
49
|
const [dragging, setDragging] = (0, react_1.useState)({
|
|
49
50
|
dragging: false,
|
|
@@ -5,6 +5,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const remotion_1 = require("remotion");
|
|
7
7
|
const get_left_of_timeline_slider_1 = require("../../helpers/get-left-of-timeline-slider");
|
|
8
|
+
const in_out_1 = require("../../state/in-out");
|
|
8
9
|
const areaHighlight = {
|
|
9
10
|
position: 'absolute',
|
|
10
11
|
backgroundColor: 'rgba(0, 0, 0, 0.5)',
|
|
@@ -15,7 +16,7 @@ const areaHighlight = {
|
|
|
15
16
|
exports.inMarkerAreaRef = (0, react_1.createRef)();
|
|
16
17
|
exports.outMarkerAreaRef = (0, react_1.createRef)();
|
|
17
18
|
const TimelineInOutPointer = () => {
|
|
18
|
-
const { inFrame, outFrame } =
|
|
19
|
+
const { inFrame, outFrame } = (0, in_out_1.useTimelineInOutFramePosition)();
|
|
19
20
|
const videoConfig = remotion_1.Internals.useUnsafeVideoConfig();
|
|
20
21
|
const { get, width } = (0, get_left_of_timeline_slider_1.useGetXPositionOfItemInTimeline)();
|
|
21
22
|
if (!videoConfig) {
|
|
@@ -7,6 +7,7 @@ const remotion_1 = require("remotion");
|
|
|
7
7
|
const is_current_selected_still_1 = require("../helpers/is-current-selected-still");
|
|
8
8
|
const use_keybinding_1 = require("../helpers/use-keybinding");
|
|
9
9
|
const timelineInOutPointer_1 = require("../icons/timelineInOutPointer");
|
|
10
|
+
const in_out_1 = require("../state/in-out");
|
|
10
11
|
const marks_1 = require("../state/marks");
|
|
11
12
|
const ControlButton_1 = require("./ControlButton");
|
|
12
13
|
const getTooltipText = (pointType) => `Mark ${pointType}`;
|
|
@@ -17,8 +18,8 @@ const style = {
|
|
|
17
18
|
exports.inOutHandles = (0, react_1.createRef)();
|
|
18
19
|
const TimelineInOutPointToggle = () => {
|
|
19
20
|
const timelinePosition = remotion_1.Internals.Timeline.useTimelinePosition();
|
|
20
|
-
const { inFrame, outFrame } =
|
|
21
|
-
const { setInAndOutFrames } =
|
|
21
|
+
const { inFrame, outFrame } = (0, in_out_1.useTimelineInOutFramePosition)();
|
|
22
|
+
const { setInAndOutFrames } = (0, in_out_1.useTimelineSetInOutFramePosition)();
|
|
22
23
|
const { currentComposition } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
23
24
|
const isStill = (0, is_current_selected_still_1.useIsStill)();
|
|
24
25
|
const videoConfig = remotion_1.Internals.useUnsafeVideoConfig();
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
export declare type TimelineInOutContextValue = {
|
|
3
|
+
inFrame: number | null;
|
|
4
|
+
outFrame: number | null;
|
|
5
|
+
};
|
|
6
|
+
export declare type SetTimelineInOutContextValue = {
|
|
7
|
+
setInAndOutFrames: (u: React.SetStateAction<TimelineInOutContextValue>) => void;
|
|
8
|
+
};
|
|
9
|
+
export declare const TimelineInOutContext: React.Context<TimelineInOutContextValue>;
|
|
10
|
+
export declare const SetTimelineInOutContext: React.Context<SetTimelineInOutContextValue>;
|
|
11
|
+
export declare const useTimelineInOutFramePosition: () => TimelineInOutContextValue;
|
|
12
|
+
export declare const useTimelineSetInOutFramePosition: () => SetTimelineInOutContextValue;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useTimelineSetInOutFramePosition = exports.useTimelineInOutFramePosition = exports.SetTimelineInOutContext = exports.TimelineInOutContext = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
exports.TimelineInOutContext = (0, react_1.createContext)({
|
|
6
|
+
inFrame: null,
|
|
7
|
+
outFrame: null,
|
|
8
|
+
});
|
|
9
|
+
exports.SetTimelineInOutContext = (0, react_1.createContext)({
|
|
10
|
+
setInAndOutFrames: () => {
|
|
11
|
+
throw new Error('default');
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
const useTimelineInOutFramePosition = () => {
|
|
15
|
+
const state = (0, react_1.useContext)(exports.TimelineInOutContext);
|
|
16
|
+
return state;
|
|
17
|
+
};
|
|
18
|
+
exports.useTimelineInOutFramePosition = useTimelineInOutFramePosition;
|
|
19
|
+
const useTimelineSetInOutFramePosition = () => {
|
|
20
|
+
const { setInAndOutFrames } = (0, react_1.useContext)(exports.SetTimelineInOutContext);
|
|
21
|
+
return { setInAndOutFrames };
|
|
22
|
+
};
|
|
23
|
+
exports.useTimelineSetInOutFramePosition = useTimelineSetInOutFramePosition;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.findRemotionRoot = exports.findClosestPackageJson = void 0;
|
|
7
|
+
const fs_1 = __importDefault(require("fs"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const log_1 = require("./log");
|
|
10
|
+
const recursionLimit = 5;
|
|
11
|
+
const findClosestPackageJson = () => {
|
|
12
|
+
let currentDir = process.cwd();
|
|
13
|
+
let possiblePackageJson = '';
|
|
14
|
+
for (let i = 0; i < recursionLimit; i++) {
|
|
15
|
+
possiblePackageJson = path_1.default.join(currentDir, 'package.json');
|
|
16
|
+
const exists = fs_1.default.existsSync(possiblePackageJson);
|
|
17
|
+
if (exists) {
|
|
18
|
+
return possiblePackageJson;
|
|
19
|
+
}
|
|
20
|
+
currentDir = path_1.default.dirname(currentDir);
|
|
21
|
+
}
|
|
22
|
+
return null;
|
|
23
|
+
};
|
|
24
|
+
exports.findClosestPackageJson = findClosestPackageJson;
|
|
25
|
+
const findRemotionRoot = () => {
|
|
26
|
+
const closestPackageJson = (0, exports.findClosestPackageJson)();
|
|
27
|
+
if (closestPackageJson === null) {
|
|
28
|
+
log_1.Log.error('Could not find a package.json in the current directory or any of the ' +
|
|
29
|
+
recursionLimit +
|
|
30
|
+
' parent directories. Is this a Remotion project?');
|
|
31
|
+
process.exit(1);
|
|
32
|
+
}
|
|
33
|
+
return path_1.default.dirname(closestPackageJson);
|
|
34
|
+
};
|
|
35
|
+
exports.findRemotionRoot = findRemotionRoot;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { ChromiumOptions } from '@remotion/renderer';
|
|
2
|
-
import type { BrowserExecutable, FrameRange } from 'remotion';
|
|
1
|
+
import type { BrowserExecutable, ChromiumOptions, FrameRange } from '@remotion/renderer';
|
|
3
2
|
export declare const getAndValidateAbsoluteOutputFile: (relativeOutputLocation: string, overwrite: boolean) => string;
|
|
4
3
|
export declare const getCliOptions: (options: {
|
|
5
4
|
isLambda: boolean;
|
|
@@ -13,7 +12,7 @@ export declare const getCliOptions: (options: {
|
|
|
13
12
|
inputProps: object;
|
|
14
13
|
envVariables: Record<string, string>;
|
|
15
14
|
quality: number | undefined;
|
|
16
|
-
browser: import("remotion").Browser;
|
|
15
|
+
browser: import("@remotion/renderer").Browser;
|
|
17
16
|
crf: number | null;
|
|
18
17
|
pixelFormat: "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le";
|
|
19
18
|
imageFormat: "png" | "jpeg" | "none";
|
|
@@ -22,8 +21,8 @@ export declare const getCliOptions: (options: {
|
|
|
22
21
|
numberOfGifLoops: number | null;
|
|
23
22
|
stillFrame: number;
|
|
24
23
|
browserExecutable: BrowserExecutable;
|
|
25
|
-
ffmpegExecutable: import("remotion").FfmpegExecutable;
|
|
26
|
-
ffprobeExecutable: import("remotion").FfmpegExecutable;
|
|
24
|
+
ffmpegExecutable: import("@remotion/renderer").FfmpegExecutable;
|
|
25
|
+
ffprobeExecutable: import("@remotion/renderer").FfmpegExecutable;
|
|
27
26
|
logLevel: "verbose" | "info" | "warn" | "error";
|
|
28
27
|
scale: number;
|
|
29
28
|
chromiumOptions: ChromiumOptions;
|