@remotion/cli 3.1.4 → 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.
Files changed (156) hide show
  1. package/dist/code-frame.js +3 -3
  2. package/dist/compositions.d.ts +1 -1
  3. package/dist/compositions.js +13 -4
  4. package/dist/config/browser-executable.d.ts +3 -0
  5. package/dist/config/browser-executable.js +12 -0
  6. package/dist/config/browser.d.ts +3 -0
  7. package/dist/config/browser.js +18 -0
  8. package/dist/config/chromium-flags.d.ts +9 -0
  9. package/dist/config/chromium-flags.js +33 -0
  10. package/dist/config/codec.d.ts +7 -0
  11. package/dist/config/codec.js +40 -0
  12. package/dist/config/concurrency.d.ts +3 -0
  13. package/dist/config/concurrency.js +12 -0
  14. package/dist/config/crf.d.ts +4 -0
  15. package/dist/config/crf.js +23 -0
  16. package/dist/config/env-file.d.ts +2 -0
  17. package/dist/config/env-file.js +10 -0
  18. package/dist/config/every-nth-frame.d.ts +3 -0
  19. package/dist/config/every-nth-frame.js +20 -0
  20. package/dist/config/ffmpeg-executable.d.ts +5 -0
  21. package/dist/config/ffmpeg-executable.js +21 -0
  22. package/dist/config/frame-range.d.ts +4 -0
  23. package/dist/config/frame-range.js +35 -0
  24. package/dist/config/image-format.d.ts +3 -0
  25. package/dist/config/image-format.js +20 -0
  26. package/dist/config/image-sequence.d.ts +3 -0
  27. package/dist/config/image-sequence.js +15 -0
  28. package/dist/config/index.d.ts +43 -0
  29. package/dist/config/index.js +162 -0
  30. package/dist/config/log.d.ts +3 -0
  31. package/dist/config/log.js +12 -0
  32. package/dist/config/max-timeline-tracks.d.ts +2 -0
  33. package/dist/config/max-timeline-tracks.js +24 -0
  34. package/dist/config/number-of-gif-loops.d.ts +4 -0
  35. package/dist/config/number-of-gif-loops.js +21 -0
  36. package/dist/config/output-location.d.ts +2 -0
  37. package/dist/config/output-location.js +16 -0
  38. package/dist/config/override-webpack.d.ts +5 -0
  39. package/dist/config/override-webpack.js +14 -0
  40. package/dist/config/overwrite.d.ts +2 -0
  41. package/dist/config/overwrite.js +14 -0
  42. package/dist/config/pixel-format.d.ts +3 -0
  43. package/dist/config/pixel-format.js +16 -0
  44. package/dist/config/preview-server.d.ts +2 -0
  45. package/dist/config/preview-server.js +20 -0
  46. package/dist/config/prores-profile.d.ts +3 -0
  47. package/dist/config/prores-profile.js +12 -0
  48. package/dist/config/quality.d.ts +2 -0
  49. package/dist/config/quality.js +17 -0
  50. package/dist/config/scale.d.ts +3 -0
  51. package/dist/config/scale.js +15 -0
  52. package/dist/config/still-frame.d.ts +2 -0
  53. package/dist/config/still-frame.js +12 -0
  54. package/dist/config/timeout.d.ts +2 -0
  55. package/dist/config/timeout.js +17 -0
  56. package/dist/config/webpack-caching.d.ts +3 -0
  57. package/dist/config/webpack-caching.js +16 -0
  58. package/dist/editor/components/CompositionSelectorItem.d.ts +1 -1
  59. package/dist/editor/components/CompositionSelectorItem.js +2 -1
  60. package/dist/editor/components/Editor.js +2 -1
  61. package/dist/editor/components/InitialCompositionLoader.d.ts +1 -1
  62. package/dist/editor/components/InitialCompositionLoader.js +17 -4
  63. package/dist/editor/components/PlayPause.js +4 -0
  64. package/dist/editor/components/Timeline/TimelineDragHandler.js +3 -2
  65. package/dist/editor/components/Timeline/TimelineInOutPointer.js +2 -1
  66. package/dist/editor/components/Timeline/TimelineListItem.js +1 -0
  67. package/dist/editor/components/TimelineInOutToggle.js +3 -2
  68. package/dist/editor/state/in-out.d.ts +12 -0
  69. package/dist/editor/state/in-out.js +23 -0
  70. package/dist/find-closest-package-json.d.ts +2 -0
  71. package/dist/find-closest-package-json.js +35 -0
  72. package/dist/get-cli-options.d.ts +6 -7
  73. package/dist/get-cli-options.js +43 -48
  74. package/dist/get-composition-id.d.ts +1 -2
  75. package/dist/get-composition-id.js +2 -3
  76. package/dist/get-config-file-name.d.ts +1 -1
  77. package/dist/get-config-file-name.js +9 -6
  78. package/dist/get-env.js +6 -4
  79. package/dist/get-filename.d.ts +4 -3
  80. package/dist/get-filename.js +5 -5
  81. package/dist/get-final-output-codec.d.ts +6 -0
  82. package/dist/get-final-output-codec.js +63 -0
  83. package/dist/image-formats.d.ts +3 -3
  84. package/dist/image-formats.js +4 -3
  85. package/dist/index.d.ts +11 -10
  86. package/dist/index.js +17 -9
  87. package/dist/initialize-render-cli.d.ts +1 -1
  88. package/dist/initialize-render-cli.js +8 -3
  89. package/dist/lambda-command.d.ts +1 -1
  90. package/dist/lambda-command.js +4 -4
  91. package/dist/load-config.d.ts +1 -1
  92. package/dist/load-config.js +16 -5
  93. package/dist/log.js +7 -6
  94. package/dist/parse-command-line.d.ts +1 -1
  95. package/dist/parse-command-line.js +31 -30
  96. package/dist/preview-server/error-overlay/react-overlay/effects/map-error-to-react-stack.js +2 -2
  97. package/dist/preview-server/error-overlay/react-overlay/utils/get-file-source.d.ts +1 -1
  98. package/dist/preview-server/error-overlay/react-overlay/utils/get-file-source.js +3 -3
  99. package/dist/preview-server/get-package-manager.d.ts +1 -1
  100. package/dist/preview-server/get-package-manager.js +2 -2
  101. package/dist/preview-server/project-info.d.ts +1 -1
  102. package/dist/preview-server/project-info.js +3 -3
  103. package/dist/preview-server/routes.d.ts +2 -1
  104. package/dist/preview-server/routes.js +28 -17
  105. package/dist/preview-server/start-server.d.ts +1 -0
  106. package/dist/preview-server/start-server.js +4 -2
  107. package/dist/preview-server/update-available.d.ts +1 -1
  108. package/dist/preview-server/update-available.js +8 -5
  109. package/dist/preview.d.ts +1 -1
  110. package/dist/preview.js +5 -4
  111. package/dist/previewEntry.js +1 -0
  112. package/dist/progress-bar.d.ts +1 -2
  113. package/dist/progress-bar.js +5 -4
  114. package/dist/render.d.ts +1 -1
  115. package/dist/render.js +31 -15
  116. package/dist/setup-cache.d.ts +2 -1
  117. package/dist/setup-cache.js +16 -9
  118. package/dist/still.d.ts +1 -1
  119. package/dist/still.js +40 -25
  120. package/dist/truthy.d.ts +3 -0
  121. package/dist/truthy.js +7 -0
  122. package/dist/upgrade.d.ts +1 -1
  123. package/dist/upgrade.js +5 -10
  124. package/dist/user-passed-output-location.d.ts +5 -1
  125. package/dist/user-passed-output-location.js +14 -7
  126. package/dist/versions.d.ts +2 -2
  127. package/dist/versions.js +13 -12
  128. package/dist/webpack-cache.d.ts +2 -2
  129. package/dist/webpack-cache.js +10 -10
  130. package/package.json +7 -7
  131. package/dist/bundle-on-cli.d.ts +0 -2
  132. package/dist/bundle-on-cli.js +0 -41
  133. package/dist/bundle.d.ts +0 -1
  134. package/dist/bundle.js +0 -31
  135. package/dist/chalk/symbols.d.ts +0 -111
  136. package/dist/chalk/symbols.js +0 -75
  137. package/dist/chalk/utilities.d.ts +0 -2
  138. package/dist/chalk/utilities.js +0 -37
  139. package/dist/editor/components/CompositionManager.d.ts +0 -4
  140. package/dist/editor/components/CompositionManager.js +0 -60
  141. package/dist/editor/components/LoadingIndicator.d.ts +0 -2
  142. package/dist/editor/components/LoadingIndicator.js +0 -35
  143. package/dist/prepare-entry-point.d.ts +0 -11
  144. package/dist/prepare-entry-point.js +0 -36
  145. package/dist/preview-server/fast-refresh/helpers.d.ts +0 -39
  146. package/dist/preview-server/fast-refresh/helpers.js +0 -145
  147. package/dist/preview-server/fast-refresh/index.d.ts +0 -30
  148. package/dist/preview-server/fast-refresh/index.js +0 -86
  149. package/dist/preview-server/fast-refresh/loader.d.ts +0 -35
  150. package/dist/preview-server/fast-refresh/loader.js +0 -81
  151. package/dist/preview-server/fast-refresh/runtime.d.ts +0 -35
  152. package/dist/preview-server/fast-refresh/runtime.js +0 -32
  153. package/dist/preview-server/static-preview.d.ts +0 -1
  154. package/dist/preview-server/static-preview.js +0 -40
  155. package/dist/preview-server/webpack-cache.d.ts +0 -12
  156. package/dist/preview-server/webpack-cache.js +0 -66
@@ -0,0 +1,2 @@
1
+ export declare const setMaxTimelineTracks: (maxTracks: number) => void;
2
+ export declare const getMaxTimelineTracks: () => number;
@@ -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,4 @@
1
+ import type { Codec } from '@remotion/renderer';
2
+ export declare type Loop = number | null;
3
+ export declare const setNumberOfGifLoops: (newLoop: Loop | null) => void;
4
+ export declare const getAndValidateNumberOfGifLoops: (codec: Codec) => number | null;
@@ -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,2 @@
1
+ export declare const setOutputLocation: (newOutputLocation: string) => void;
2
+ export declare const getOutputLocation: () => string | null;
@@ -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,2 @@
1
+ export declare const setOverwriteOutput: (newOverwrite: boolean) => void;
2
+ export declare const getShouldOverwrite: () => boolean;
@@ -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,2 @@
1
+ export declare const setPort: (port: number | undefined) => void;
2
+ export declare const getServerPort: () => number | undefined;
@@ -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,3 @@
1
+ import type { ProResProfile } from '@remotion/renderer';
2
+ export declare const getProResProfile: () => ProResProfile | undefined;
3
+ export declare const setProResProfile: (profile: ProResProfile | undefined) => void;
@@ -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,2 @@
1
+ export declare const setQuality: (q: number | undefined) => void;
2
+ export declare const getQuality: () => number | undefined;
@@ -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,3 @@
1
+ export declare type Scale = number;
2
+ export declare const setScale: (newScale: Scale) => void;
3
+ export declare const getScale: () => number;
@@ -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,2 @@
1
+ export declare const setStillFrame: (frame: number) => void;
2
+ export declare const getStillFrame: () => number;
@@ -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,2 @@
1
+ export declare const setPuppeteerTimeout: (newPuppeteerTimeout: number) => void;
2
+ export declare const getCurrentPuppeteerTimeout: () => number;
@@ -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,3 @@
1
+ export declare const DEFAULT_WEBPACK_CACHE_ENABLED = true;
2
+ export declare const setWebpackCaching: (flag: boolean) => void;
3
+ export declare const getWebpackCaching: () => boolean;
@@ -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)(remotion_1.Internals.Timeline.TimelineInOutContext.Provider, { value: timelineInOutContextValue, children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.Timeline.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
+ 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
- window.history.pushState({}, 'Preview', `/${c.id}`);
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 } = remotion_1.Internals.Timeline.useTimelineInOutFramePosition();
46
- const { setInAndOutFrames } = remotion_1.Internals.Timeline.useTimelineSetInOutFramePosition();
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 } = remotion_1.Internals.Timeline.useTimelineInOutFramePosition();
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) {
@@ -22,6 +22,7 @@ const outer = {
22
22
  alignItems: 'center',
23
23
  paddingLeft: timeline_layout_1.TIMELINE_PADDING,
24
24
  wordBreak: 'break-all',
25
+ textAlign: 'left',
25
26
  };
26
27
  const hookContainer = {
27
28
  height: timeline_layout_1.TIMELINE_LAYER_HEIGHT,
@@ -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 } = remotion_1.Internals.Timeline.useTimelineInOutFramePosition();
21
- const { setInAndOutFrames } = remotion_1.Internals.Timeline.useTimelineSetInOutFramePosition();
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,2 @@
1
+ export declare const findClosestPackageJson: () => string | null;
2
+ export declare const findRemotionRoot: () => string;
@@ -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,5 @@
1
- import type { ChromiumOptions } from '@remotion/renderer';
2
- import type { BrowserExecutable, FrameRange } from 'remotion';
1
+ import type { BrowserExecutable, ChromiumOptions, FrameRange } from '@remotion/renderer';
2
+ export declare const getAndValidateAbsoluteOutputFile: (relativeOutputLocation: string, overwrite: boolean) => string;
3
3
  export declare const getCliOptions: (options: {
4
4
  isLambda: boolean;
5
5
  type: 'still' | 'series' | 'get-compositions';
@@ -9,12 +9,10 @@ export declare const getCliOptions: (options: {
9
9
  frameRange: FrameRange | null;
10
10
  shouldOutputImageSequence: boolean;
11
11
  codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif";
12
- overwrite: boolean;
13
12
  inputProps: object;
14
13
  envVariables: Record<string, string>;
15
14
  quality: number | undefined;
16
- absoluteOutputFile: string | null;
17
- browser: import("remotion").Browser;
15
+ browser: import("@remotion/renderer").Browser;
18
16
  crf: number | null;
19
17
  pixelFormat: "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le";
20
18
  imageFormat: "png" | "jpeg" | "none";
@@ -23,10 +21,11 @@ export declare const getCliOptions: (options: {
23
21
  numberOfGifLoops: number | null;
24
22
  stillFrame: number;
25
23
  browserExecutable: BrowserExecutable;
26
- ffmpegExecutable: import("remotion").FfmpegExecutable;
27
- ffprobeExecutable: import("remotion").FfmpegExecutable;
24
+ ffmpegExecutable: import("@remotion/renderer").FfmpegExecutable;
25
+ ffprobeExecutable: import("@remotion/renderer").FfmpegExecutable;
28
26
  logLevel: "verbose" | "info" | "warn" | "error";
29
27
  scale: number;
30
28
  chromiumOptions: ChromiumOptions;
29
+ overwrite: boolean;
31
30
  port: number | null;
32
31
  }>;