@remotion/cli 4.0.0-alpha11 → 4.0.0-alpha13

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.
Files changed (66) hide show
  1. package/dist/config/image-format.d.ts +1 -1
  2. package/dist/config/index.d.ts +1 -1
  3. package/dist/config/max-timeline-tracks.js +2 -1
  4. package/dist/editor/components/AudioWaveform.d.ts +0 -1
  5. package/dist/editor/components/AudioWaveform.js +11 -6
  6. package/dist/editor/components/NewComposition/RemInput.d.ts +1 -1
  7. package/dist/editor/components/NewComposition/RemInputTypeColor.d.ts +1 -1
  8. package/dist/editor/components/NewComposition/RemTextarea.d.ts +1 -1
  9. package/dist/editor/components/RenderModal/RenderModalData.d.ts +2 -3
  10. package/dist/editor/components/RenderModal/RenderModalData.js +34 -23
  11. package/dist/editor/components/RenderModal/human-readable-codec.d.ts +1 -1
  12. package/dist/editor/components/Splitter/SplitterContainer.js +1 -0
  13. package/dist/editor/components/Timeline/MaxTimelineTracks.d.ts +1 -0
  14. package/dist/editor/components/Timeline/MaxTimelineTracks.js +3 -2
  15. package/dist/editor/components/Timeline/Timeline.js +4 -5
  16. package/dist/editor/components/Timeline/TimelineDragHandler.js +26 -11
  17. package/dist/editor/components/Timeline/TimelineInOutPointer.js +7 -5
  18. package/dist/editor/components/Timeline/TimelineInOutPointerHandle.js +9 -3
  19. package/dist/editor/components/Timeline/TimelineSequence.d.ts +0 -1
  20. package/dist/editor/components/Timeline/TimelineSequence.js +23 -21
  21. package/dist/editor/components/Timeline/TimelineSlider.js +17 -4
  22. package/dist/editor/components/Timeline/TimelineTimeIndicators.js +21 -23
  23. package/dist/editor/components/Timeline/TimelineTracks.d.ts +0 -1
  24. package/dist/editor/components/Timeline/TimelineTracks.js +2 -2
  25. package/dist/editor/components/Timeline/TimelineWidthProvider.d.ts +7 -0
  26. package/dist/editor/components/Timeline/TimelineWidthProvider.js +17 -0
  27. package/dist/editor/helpers/get-left-of-timeline-slider.d.ts +0 -4
  28. package/dist/editor/helpers/get-left-of-timeline-slider.js +1 -24
  29. package/dist/get-cli-options.d.ts +1 -1
  30. package/dist/index.d.ts +5 -5
  31. package/dist/preview-server/dev-middleware/range-parser.d.ts +1 -1
  32. package/dist/preview-server/start-server.js +4 -4
  33. package/dist/preview.js +0 -2
  34. package/package.json +8 -8
  35. package/dist/ansi/ansi-regex.d.ts +0 -2
  36. package/dist/ansi/ansi-regex.js +0 -18
  37. package/dist/config/ffmpeg-executable.d.ts +0 -5
  38. package/dist/config/ffmpeg-executable.js +0 -21
  39. package/dist/config/quality.d.ts +0 -2
  40. package/dist/config/quality.js +0 -17
  41. package/dist/editor/components/ClipboardIcon.d.ts +0 -2
  42. package/dist/editor/components/ClipboardIcon.js +0 -12
  43. package/dist/editor/components/CollapsedCompositionSelector.d.ts +0 -4
  44. package/dist/editor/components/CollapsedCompositionSelector.js +0 -39
  45. package/dist/editor/components/RichTimelineToggle.d.ts +0 -2
  46. package/dist/editor/components/RichTimelineToggle.js +0 -29
  47. package/dist/editor/components/Thumbnail.d.ts +0 -8
  48. package/dist/editor/components/Thumbnail.js +0 -76
  49. package/dist/editor/helpers/use-compact-ui.d.ts +0 -1
  50. package/dist/editor/helpers/use-compact-ui.js +0 -18
  51. package/dist/editor/icons/film.d.ts +0 -3
  52. package/dist/editor/icons/film.js +0 -8
  53. package/dist/editor/icons/timeline.d.ts +0 -3
  54. package/dist/editor/icons/timeline.js +0 -9
  55. package/dist/editor/state/rich-timeline.d.ts +0 -9
  56. package/dist/editor/state/rich-timeline.js +0 -17
  57. package/dist/get-render-media-options.d.ts +0 -8
  58. package/dist/get-render-media-options.js +0 -55
  59. package/dist/install.d.ts +0 -2
  60. package/dist/install.js +0 -36
  61. package/dist/is-javascript.d.ts +0 -2
  62. package/dist/is-javascript.js +0 -9
  63. package/dist/preview-server/dev-middleware/is-color-supported.d.ts +0 -1
  64. package/dist/preview-server/dev-middleware/is-color-supported.js +0 -37
  65. package/dist/preview-server/hot-middleware/strip-ansi.d.ts +0 -1
  66. package/dist/preview-server/hot-middleware/strip-ansi.js +0 -21
@@ -1,76 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Thumbnail = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_1 = require("react");
6
- const remotion_1 = require("remotion");
7
- const checkerboard_background_1 = require("../helpers/checkerboard-background");
8
- const checkerboard_1 = require("../state/checkerboard");
9
- const Thumbnail = ({ composition, targetHeight, targetWidth, frameToDisplay }) => {
10
- const { height, width } = composition;
11
- const heightRatio = targetHeight / height;
12
- const widthRatio = targetWidth / width;
13
- const ratio = Math.min(heightRatio, widthRatio);
14
- const scale = ratio;
15
- const actualWidth = width * scale;
16
- const actualHeight = height * scale;
17
- const correction = 0 - (1 - scale) / 2;
18
- const xCorrection = correction * width;
19
- const yCorrection = correction * height;
20
- const [thumbnailId] = (0, react_1.useState)(() => String((0, remotion_1.random)(null)));
21
- const { checkerboard } = (0, react_1.useContext)(checkerboard_1.CheckerboardContext);
22
- const container = (0, react_1.useMemo)(() => {
23
- return {
24
- width: targetWidth,
25
- height: targetHeight,
26
- backgroundColor: 'rgba(0, 0, 0, 0.4)',
27
- display: 'flex',
28
- justifyContent: 'center',
29
- alignItems: 'center',
30
- };
31
- }, [targetHeight, targetWidth]);
32
- const outer = (0, react_1.useMemo)(() => {
33
- return {
34
- width: actualWidth,
35
- height: actualHeight,
36
- backgroundColor: (0, checkerboard_background_1.checkerboardBackgroundColor)(checkerboard),
37
- backgroundImage: (0, checkerboard_background_1.checkerboardBackgroundImage)(checkerboard),
38
- backgroundPosition: (0, checkerboard_background_1.getCheckerboardBackgroundPos)(25),
39
- backgroundSize: (0, checkerboard_background_1.getCheckerboardBackgroundPos)(25),
40
- };
41
- }, [actualHeight, actualWidth, checkerboard]);
42
- const inner = (0, react_1.useMemo)(() => {
43
- return {
44
- width,
45
- height,
46
- transform: `scale(${scale}) `,
47
- overflow: 'hidden',
48
- marginLeft: xCorrection,
49
- marginTop: yCorrection,
50
- display: 'flex',
51
- color: 'black',
52
- };
53
- }, [height, scale, width, xCorrection, yCorrection]);
54
- const timelineState = (0, react_1.useMemo)(() => {
55
- return {
56
- playing: false,
57
- frame: frameToDisplay,
58
- rootId: thumbnailId,
59
- imperativePlaying: {
60
- current: false,
61
- },
62
- playbackRate: 1,
63
- setPlaybackRate: () => {
64
- throw new Error('thumbnail');
65
- },
66
- audioAndVideoTags: { current: [] },
67
- };
68
- }, [frameToDisplay, thumbnailId]);
69
- const props = (0, react_1.useMemo)(() => {
70
- var _a;
71
- return (_a = composition.defaultProps) !== null && _a !== void 0 ? _a : {};
72
- }, [composition.defaultProps]);
73
- const ThumbnailComponent = composition.component;
74
- return ((0, jsx_runtime_1.jsx)("div", { style: container, children: (0, jsx_runtime_1.jsx)(react_1.Suspense, { fallback: null, children: (0, jsx_runtime_1.jsx)("div", { style: outer, children: (0, jsx_runtime_1.jsx)("div", { style: inner, children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.Timeline.TimelineContext.Provider, { value: timelineState, children: (0, jsx_runtime_1.jsx)(ThumbnailComponent, { ...props }) }) }) }) }) }));
75
- };
76
- exports.Thumbnail = Thumbnail;
@@ -1 +0,0 @@
1
- export declare function useCompactUI(): boolean;
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useCompactUI = void 0;
4
- const react_1 = require("react");
5
- const breakpoint = 1200;
6
- function useCompactUI() {
7
- const [compactUI, setCompactUI] = (0, react_1.useState)(window.innerWidth < breakpoint);
8
- (0, react_1.useEffect)(() => {
9
- function handleResize() {
10
- setCompactUI(window.innerWidth < breakpoint);
11
- }
12
- window.addEventListener('resize', handleResize);
13
- handleResize();
14
- return () => window.removeEventListener('resize', handleResize);
15
- }, []);
16
- return compactUI;
17
- }
18
- exports.useCompactUI = useCompactUI;
@@ -1,3 +0,0 @@
1
- import type { SVGProps } from 'react';
2
- import React from 'react';
3
- export declare const FilmIcon: React.FC<SVGProps<SVGSVGElement>>;
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FilmIcon = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const FilmIcon = (props) => {
6
- return ((0, jsx_runtime_1.jsx)("svg", { viewBox: "0 0 512 512", ...props, children: (0, jsx_runtime_1.jsx)("path", { fill: "currentColor", d: "M488 64h-8v20c0 6.6-5.4 12-12 12h-40c-6.6 0-12-5.4-12-12V64H96v20c0 6.6-5.4 12-12 12H44c-6.6 0-12-5.4-12-12V64h-8C10.7 64 0 74.7 0 88v336c0 13.3 10.7 24 24 24h8v-20c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v20h320v-20c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v20h8c13.3 0 24-10.7 24-24V88c0-13.3-10.7-24-24-24zM96 372c0 6.6-5.4 12-12 12H44c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40zm0-96c0 6.6-5.4 12-12 12H44c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40zm0-96c0 6.6-5.4 12-12 12H44c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40zm280 208c0 6.6-5.4 12-12 12H148c-6.6 0-12-5.4-12-12V124c0-6.6 5.4-12 12-12h216c6.6 0 12 5.4 12 12v264zm104-16c0 6.6-5.4 12-12 12h-40c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40zm0-96c0 6.6-5.4 12-12 12h-40c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40zm0-96c0 6.6-5.4 12-12 12h-40c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40z" }) }));
7
- };
8
- exports.FilmIcon = FilmIcon;
@@ -1,3 +0,0 @@
1
- import type { SVGProps } from 'react';
2
- import React from 'react';
3
- export declare const TimelineIcon: React.FC<SVGProps<SVGSVGElement>>;
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TimelineIcon = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const TimelineIcon = (props) => {
6
- var _a;
7
- return ((0, jsx_runtime_1.jsx)("svg", { "aria-hidden": "true", focusable: "false", "data-prefix": "fas", "data-icon": "stream", className: "svg-inline--fa fa-stream fa-w-16", role: "img", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512", ...props, children: (0, jsx_runtime_1.jsx)("path", { fill: (_a = props.style) === null || _a === void 0 ? void 0 : _a.color, d: "M16 128h416c8.84 0 16-7.16 16-16V48c0-8.84-7.16-16-16-16H16C7.16 32 0 39.16 0 48v64c0 8.84 7.16 16 16 16zm480 80H80c-8.84 0-16 7.16-16 16v64c0 8.84 7.16 16 16 16h416c8.84 0 16-7.16 16-16v-64c0-8.84-7.16-16-16-16zm-64 176H16c-8.84 0-16 7.16-16 16v64c0 8.84 7.16 16 16 16h416c8.84 0 16-7.16 16-16v-64c0-8.84-7.16-16-16-16z" }) }));
8
- };
9
- exports.TimelineIcon = TimelineIcon;
@@ -1,9 +0,0 @@
1
- /// <reference types="react" />
2
- declare type State = {
3
- richTimeline: boolean;
4
- setRichTimeline: (cb: (prevState: boolean) => boolean) => void;
5
- };
6
- export declare const persistRichTimelineOption: (option: boolean) => void;
7
- export declare const loadRichTimelineOption: () => boolean;
8
- export declare const RichTimelineContext: import("react").Context<State>;
9
- export {};
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RichTimelineContext = exports.loadRichTimelineOption = exports.persistRichTimelineOption = void 0;
4
- const react_1 = require("react");
5
- const persistRichTimelineOption = (option) => {
6
- localStorage.setItem('richTimeline', String(option));
7
- };
8
- exports.persistRichTimelineOption = persistRichTimelineOption;
9
- const loadRichTimelineOption = () => {
10
- const item = localStorage.getItem('richTimeline');
11
- return item === 'true';
12
- };
13
- exports.loadRichTimelineOption = loadRichTimelineOption;
14
- exports.RichTimelineContext = (0, react_1.createContext)({
15
- richTimeline: (0, exports.loadRichTimelineOption)(),
16
- setRichTimeline: () => undefined,
17
- });
@@ -1,8 +0,0 @@
1
- import type { Codec, RenderMediaOptions } from '@remotion/renderer';
2
- export declare const getRenderMediaOptions: ({ outputLocation, config, serveUrl, codec, remotionRoot, }: {
3
- outputLocation: RenderMediaOptions['outputLocation'];
4
- config: RenderMediaOptions['composition'];
5
- serveUrl: string;
6
- codec: Codec;
7
- remotionRoot: string;
8
- }) => Promise<RenderMediaOptions>;
@@ -1,55 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getRenderMediaOptions = void 0;
4
- const renderer_1 = require("@remotion/renderer");
5
- const config_1 = require("./config");
6
- const get_audio_codec_1 = require("./get-audio-codec");
7
- const get_cli_options_1 = require("./get-cli-options");
8
- const image_formats_1 = require("./image-formats");
9
- const getRenderMediaOptions = async ({ outputLocation, config, serveUrl, codec, remotionRoot, }) => {
10
- const { proResProfile, concurrency, frameRange, overwrite, inputProps, envVariables, quality, crf, pixelFormat, browserExecutable, ffmpegExecutable, ffprobeExecutable, scale, chromiumOptions, port, numberOfGifLoops, everyNthFrame, muted, enforceAudioTrack, ffmpegOverride, audioBitrate, videoBitrate, height, width, } = await (0, get_cli_options_1.getCliOptions)({
11
- isLambda: false,
12
- type: 'series',
13
- remotionRoot,
14
- });
15
- const imageFormat = (0, image_formats_1.getImageFormat)(codec);
16
- const audioCodec = (0, get_audio_codec_1.getResolvedAudioCodec)();
17
- return {
18
- outputLocation,
19
- composition: {
20
- ...config,
21
- width: width !== null && width !== void 0 ? width : config.width,
22
- height: height !== null && height !== void 0 ? height : config.height,
23
- },
24
- crf,
25
- envVariables,
26
- ffmpegExecutable,
27
- ffprobeExecutable,
28
- frameRange,
29
- imageFormat,
30
- inputProps,
31
- overwrite,
32
- pixelFormat,
33
- proResProfile,
34
- quality,
35
- dumpBrowserLogs: renderer_1.RenderInternals.isEqualOrBelowLogLevel(config_1.ConfigInternals.Logging.getLogLevel(), 'verbose'),
36
- chromiumOptions,
37
- timeoutInMilliseconds: config_1.ConfigInternals.getCurrentPuppeteerTimeout(),
38
- scale,
39
- port,
40
- numberOfGifLoops,
41
- everyNthFrame,
42
- verbose: renderer_1.RenderInternals.isEqualOrBelowLogLevel(config_1.ConfigInternals.Logging.getLogLevel(), 'verbose'),
43
- muted,
44
- enforceAudioTrack,
45
- browserExecutable,
46
- ffmpegOverride,
47
- concurrency,
48
- serveUrl,
49
- codec,
50
- audioBitrate,
51
- videoBitrate,
52
- audioCodec,
53
- };
54
- };
55
- exports.getRenderMediaOptions = getRenderMediaOptions;
package/dist/install.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export declare const INSTALL_COMMAND: "install";
2
- export declare const installCommand: (remotionRoot: string, args: string[]) => Promise<void>;
package/dist/install.js DELETED
@@ -1,36 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.installCommand = exports.INSTALL_COMMAND = void 0;
4
- const renderer_1 = require("@remotion/renderer");
5
- const log_1 = require("./log");
6
- exports.INSTALL_COMMAND = 'install';
7
- const installCommand = async (remotionRoot, args) => {
8
- const firstArg = args[0];
9
- if (firstArg === 'ffmpeg') {
10
- const { wasAlreadyInstalled } = await (0, renderer_1.ensureFfmpeg)({ remotionRoot });
11
- if (wasAlreadyInstalled) {
12
- log_1.Log.info('FFmpeg is already installed');
13
- }
14
- else {
15
- log_1.Log.info('Successfully installed FFmpeg');
16
- }
17
- return;
18
- }
19
- if (firstArg === 'ffprobe') {
20
- const { wasAlreadyInstalled } = await (0, renderer_1.ensureFfprobe)({ remotionRoot });
21
- if (wasAlreadyInstalled) {
22
- log_1.Log.info('FFmpeg is already installed');
23
- }
24
- else {
25
- log_1.Log.info('Successfully installed FFmpeg');
26
- }
27
- return;
28
- }
29
- log_1.Log.error('Please specify either "ffmpeg" or "ffprobe" as the first argument to the install command');
30
- log_1.Log.error();
31
- log_1.Log.info('Example Usage: ');
32
- log_1.Log.info(' remotion install ffmpeg');
33
- log_1.Log.info(' remotion install ffprobe');
34
- process.exit(1);
35
- };
36
- exports.installCommand = installCommand;
@@ -1,2 +0,0 @@
1
- declare const isJavascript: (fullPath: string) => boolean;
2
- export { isJavascript };
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isJavascript = void 0;
4
- const isJavascript = (fullPath) => {
5
- const splitFullPath = fullPath.split('.');
6
- const extension = splitFullPath[splitFullPath.length - 1];
7
- return extension === 'jsx' || extension === 'js';
8
- };
9
- exports.isJavascript = isJavascript;
@@ -1 +0,0 @@
1
- export declare const isColorSupported: boolean;
@@ -1,37 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var _a;
26
- Object.defineProperty(exports, "__esModule", { value: true });
27
- exports.isColorSupported = void 0;
28
- const tty = __importStar(require("tty"));
29
- const argv = process.argv || [];
30
- const env = process.env || {};
31
- const isDisabled = 'NO_COLOR' in env || argv.includes('--no-color');
32
- const isForced = 'FORCE_COLOR' in env || argv.includes('--color');
33
- const isWindows = process.platform === 'win32';
34
- const isCompatibleTerminal = ((_a = tty === null || tty === void 0 ? void 0 : tty.isatty) === null || _a === void 0 ? void 0 : _a.call(tty, 1)) && env.TERM && env.TERM !== 'dumb';
35
- const isCI = 'CI' in env &&
36
- ('GITHUB_ACTIONS' in env || 'GITLAB_CI' in env || 'CIRCLECI' in env);
37
- exports.isColorSupported = !isDisabled && (isForced || isWindows || isCompatibleTerminal || isCI);
@@ -1 +0,0 @@
1
- export declare const stripAnsi: (str: string) => string;
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.stripAnsi = void 0;
4
- /**
5
- * Code inlined from https://github.com/chalk/strip-ansi#readme
6
- * This file is MIT licensed.
7
- */
8
- const ansiRegex = () => {
9
- const pattern = [
10
- '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)',
11
- '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))',
12
- ].join('|');
13
- return new RegExp(pattern, 'g');
14
- };
15
- const stripAnsi = (str) => {
16
- if (typeof str !== 'string') {
17
- throw new TypeError(`Expected a \`string\`, got \`${typeof str}\``);
18
- }
19
- return str.replace(ansiRegex(), '');
20
- };
21
- exports.stripAnsi = stripAnsi;