@remotion/cli 3.1.11 → 3.2.2

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 (106) hide show
  1. package/dist/bundle.d.ts +1 -1
  2. package/dist/bundle.js +3 -2
  3. package/dist/config/bundle-out-dir.d.ts +2 -0
  4. package/dist/config/bundle-out-dir.js +12 -0
  5. package/dist/config/enforce-audio-track.d.ts +2 -0
  6. package/dist/config/enforce-audio-track.js +13 -0
  7. package/dist/config/get-public-path.d.ts +2 -0
  8. package/dist/config/get-public-path.js +12 -0
  9. package/dist/config/index.d.ts +4 -0
  10. package/dist/config/index.js +8 -0
  11. package/dist/config/muted.d.ts +2 -0
  12. package/dist/config/muted.js +13 -0
  13. package/dist/editor/components/Editor.js +3 -1
  14. package/dist/editor/components/InitialCompositionLoader.js +13 -0
  15. package/dist/editor/components/Notifications/ServerDisconnected.d.ts +5 -0
  16. package/dist/editor/components/Notifications/ServerDisconnected.js +56 -0
  17. package/dist/editor/components/PlayPause.js +41 -23
  18. package/dist/editor/components/PreviewToolbar.js +2 -2
  19. package/dist/editor/components/Splitter/SplitterElement.js +1 -0
  20. package/dist/editor/components/TimeValue.js +9 -5
  21. package/dist/editor/components/Timeline/MaxTimelineTracks.d.ts +1 -0
  22. package/dist/editor/components/Timeline/MaxTimelineTracks.js +5 -3
  23. package/dist/editor/components/Timeline/Timeline.js +11 -4
  24. package/dist/editor/components/Timeline/TimelineDragHandler.js +120 -23
  25. package/dist/editor/components/Timeline/TimelineList.js +5 -4
  26. package/dist/editor/components/Timeline/TimelineListItem.d.ts +1 -0
  27. package/dist/editor/components/Timeline/TimelineListItem.js +8 -4
  28. package/dist/editor/components/Timeline/TimelinePlayCursorSyncer.d.ts +2 -0
  29. package/dist/editor/components/Timeline/TimelinePlayCursorSyncer.js +76 -0
  30. package/dist/editor/components/Timeline/TimelineScrollable.js +4 -2
  31. package/dist/editor/components/Timeline/TimelineSlider.d.ts +3 -0
  32. package/dist/editor/components/Timeline/TimelineSlider.js +35 -2
  33. package/dist/editor/components/Timeline/TimelineSliderHandle.js +1 -3
  34. package/dist/editor/components/Timeline/TimelineTimeIndicators.d.ts +5 -0
  35. package/dist/editor/components/Timeline/TimelineTimeIndicators.js +168 -0
  36. package/dist/editor/components/Timeline/TimelineTracks.js +14 -9
  37. package/dist/editor/components/Timeline/TimelineZoomControls.js +18 -2
  38. package/dist/editor/components/Timeline/imperative-state.d.ts +12 -0
  39. package/dist/editor/components/Timeline/imperative-state.js +39 -0
  40. package/dist/editor/components/Timeline/timeline-refs.d.ts +2 -0
  41. package/dist/editor/components/Timeline/timeline-refs.js +3 -1
  42. package/dist/editor/components/Timeline/timeline-scroll-logic.d.ts +40 -0
  43. package/dist/editor/components/Timeline/timeline-scroll-logic.js +206 -1
  44. package/dist/editor/components/ZoomPersistor.d.ts +4 -0
  45. package/dist/editor/components/ZoomPersistor.js +37 -0
  46. package/dist/editor/helpers/colors.d.ts +2 -1
  47. package/dist/editor/helpers/colors.js +2 -1
  48. package/dist/editor/helpers/get-left-of-timeline-slider.d.ts +1 -0
  49. package/dist/editor/helpers/get-left-of-timeline-slider.js +7 -4
  50. package/dist/editor/helpers/get-timeline-sequence-layout.js +29 -9
  51. package/dist/editor/icons/minus.d.ts +3 -0
  52. package/dist/editor/icons/minus.js +8 -0
  53. package/dist/editor/icons/plus.d.ts +3 -0
  54. package/dist/editor/icons/plus.js +8 -0
  55. package/dist/editor/state/timeline-zoom.d.ts +1 -1
  56. package/dist/editor/state/timeline-zoom.js +15 -1
  57. package/dist/event-source.js +6 -0
  58. package/dist/get-cli-options.d.ts +2 -0
  59. package/dist/get-cli-options.js +2 -0
  60. package/dist/handle-common-errors.js +5 -0
  61. package/dist/index.d.ts +2 -0
  62. package/dist/parse-command-line.d.ts +2 -0
  63. package/dist/parse-command-line.js +8 -0
  64. package/dist/prepare-entry-point.d.ts +3 -2
  65. package/dist/prepare-entry-point.js +3 -2
  66. package/dist/preview-server/error-overlay/react-overlay/listen-to-runtime-errors.js +9 -1
  67. package/dist/preview-server/error-overlay/remotion-overlay/Button.js +1 -1
  68. package/dist/preview-server/error-overlay/remotion-overlay/CodeFrame.js +2 -0
  69. package/dist/preview-server/error-overlay/remotion-overlay/ErrorMessage.js +4 -2
  70. package/dist/preview-server/error-overlay/remotion-overlay/ErrorTitle.js +1 -1
  71. package/dist/preview-server/error-overlay/remotion-overlay/StackFrame.js +3 -1
  72. package/dist/preview-server/get-package-manager.d.ts +1 -0
  73. package/dist/preview-server/get-package-manager.js +8 -1
  74. package/dist/preview-server/live-events.js +4 -0
  75. package/dist/preview-server/routes.js +19 -2
  76. package/dist/preview-server/start-server.js +1 -1
  77. package/dist/previewEntry.js +6 -0
  78. package/dist/progress-bar.js +7 -2
  79. package/dist/render.js +3 -1
  80. package/dist/upgrade.js +1 -0
  81. package/dist/versions.js +1 -0
  82. package/package.json +7 -7
  83. package/dist/bundle-on-cli.d.ts +0 -2
  84. package/dist/bundle-on-cli.js +0 -41
  85. package/dist/chalk/symbols.d.ts +0 -111
  86. package/dist/chalk/symbols.js +0 -75
  87. package/dist/chalk/utilities.d.ts +0 -2
  88. package/dist/chalk/utilities.js +0 -37
  89. package/dist/editor/components/CompositionManager.d.ts +0 -4
  90. package/dist/editor/components/CompositionManager.js +0 -60
  91. package/dist/editor/components/LoadingIndicator.d.ts +0 -2
  92. package/dist/editor/components/LoadingIndicator.js +0 -35
  93. package/dist/preview-server/fast-refresh/helpers.d.ts +0 -39
  94. package/dist/preview-server/fast-refresh/helpers.js +0 -145
  95. package/dist/preview-server/fast-refresh/index.d.ts +0 -30
  96. package/dist/preview-server/fast-refresh/index.js +0 -86
  97. package/dist/preview-server/fast-refresh/loader.d.ts +0 -35
  98. package/dist/preview-server/fast-refresh/loader.js +0 -81
  99. package/dist/preview-server/fast-refresh/runtime.d.ts +0 -35
  100. package/dist/preview-server/fast-refresh/runtime.js +0 -32
  101. package/dist/preview-server/static-preview.d.ts +0 -1
  102. package/dist/preview-server/static-preview.js +0 -40
  103. package/dist/preview-server/webpack-cache.d.ts +0 -12
  104. package/dist/preview-server/webpack-cache.js +0 -66
  105. package/dist/webpack-cache.d.ts +0 -12
  106. package/dist/webpack-cache.js +0 -66
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useGetXPositionOfItemInTimeline = void 0;
3
+ exports.getXPositionOfItemInTimelineImperatively = exports.useGetXPositionOfItemInTimeline = void 0;
4
4
  const player_1 = require("@remotion/player");
5
5
  const react_1 = require("react");
6
6
  const remotion_1 = require("remotion");
@@ -18,12 +18,15 @@ const useGetXPositionOfItemInTimeline = () => {
18
18
  if (!videoConfig) {
19
19
  return 0;
20
20
  }
21
- return ((frame / (videoConfig.durationInFrames - 1)) *
22
- (width - timeline_layout_1.TIMELINE_PADDING * 2) +
23
- timeline_layout_1.TIMELINE_PADDING);
21
+ return (0, exports.getXPositionOfItemInTimelineImperatively)(frame, videoConfig.durationInFrames, width);
24
22
  }, [videoConfig, width]);
25
23
  return (0, react_1.useMemo)(() => {
26
24
  return { get, width };
27
25
  }, [get, width]);
28
26
  };
29
27
  exports.useGetXPositionOfItemInTimeline = useGetXPositionOfItemInTimeline;
28
+ const getXPositionOfItemInTimelineImperatively = (frame, duration, width) => {
29
+ const proportion = frame / (duration - 1);
30
+ return proportion * (width - timeline_layout_1.TIMELINE_PADDING * 2) + timeline_layout_1.TIMELINE_PADDING;
31
+ };
32
+ exports.getXPositionOfItemInTimelineImperatively = getXPositionOfItemInTimelineImperatively;
@@ -3,23 +3,43 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getTimelineSequenceLayout = exports.SEQUENCE_BORDER_WIDTH = void 0;
4
4
  const timeline_layout_1 = require("./timeline-layout");
5
5
  exports.SEQUENCE_BORDER_WIDTH = 1;
6
+ const getWidthOfTrack = ({ durationInFrames, lastFrame, windowWidth, spatialDuration, nonNegativeMarginLeft, }) => {
7
+ const fullWidth = windowWidth - timeline_layout_1.TIMELINE_PADDING * 2;
8
+ const base = durationInFrames === Infinity || lastFrame === 0
9
+ ? fullWidth
10
+ : (spatialDuration / lastFrame) * fullWidth;
11
+ return base - exports.SEQUENCE_BORDER_WIDTH + nonNegativeMarginLeft;
12
+ };
6
13
  const getTimelineSequenceLayout = ({ durationInFrames, startFrom, maxMediaDuration, startFromMedia, video, windowWidth, }) => {
7
14
  var _a;
8
15
  const maxMediaSequenceDuration = (maxMediaDuration !== null && maxMediaDuration !== void 0 ? maxMediaDuration : Infinity) - startFromMedia;
9
- const spatialDuration = Math.min(maxMediaSequenceDuration, durationInFrames - 1);
16
+ let spatialDuration = Math.min(maxMediaSequenceDuration, durationInFrames - 1);
10
17
  const lastFrame = ((_a = video.durationInFrames) !== null && _a !== void 0 ? _a : 1) - 1;
18
+ const shouldAddHalfAFrameAtEnd = startFrom + durationInFrames < lastFrame;
19
+ const shouldAddHalfAFrameAtStart = startFrom > 0;
20
+ if (shouldAddHalfAFrameAtEnd) {
21
+ spatialDuration += 0.5;
22
+ }
23
+ if (shouldAddHalfAFrameAtStart) {
24
+ spatialDuration += 0.5;
25
+ }
26
+ const startFromWithOffset = shouldAddHalfAFrameAtStart
27
+ ? startFrom - 0.5
28
+ : startFrom;
11
29
  const marginLeft = lastFrame === 0
12
30
  ? 0
13
- : (startFrom / lastFrame) * (windowWidth - timeline_layout_1.TIMELINE_PADDING * 2);
14
- const negativeMarginLeft = Math.min(marginLeft, 0);
15
- const width = (durationInFrames === Infinity || lastFrame === 0
16
- ? windowWidth - timeline_layout_1.TIMELINE_PADDING * 2
17
- : (spatialDuration / lastFrame) * (windowWidth - timeline_layout_1.TIMELINE_PADDING * 2)) -
18
- exports.SEQUENCE_BORDER_WIDTH +
19
- negativeMarginLeft;
31
+ : (startFromWithOffset / lastFrame) *
32
+ (windowWidth - timeline_layout_1.TIMELINE_PADDING * 2);
33
+ const nonNegativeMarginLeft = Math.min(marginLeft, 0);
20
34
  return {
21
35
  marginLeft: Math.round(Math.max(marginLeft, 0)),
22
- width: Math.floor(width),
36
+ width: Math.floor(getWidthOfTrack({
37
+ durationInFrames,
38
+ lastFrame,
39
+ nonNegativeMarginLeft,
40
+ spatialDuration,
41
+ windowWidth,
42
+ })),
23
43
  };
24
44
  };
25
45
  exports.getTimelineSequenceLayout = getTimelineSequenceLayout;
@@ -0,0 +1,3 @@
1
+ import type { SVGProps } from 'react';
2
+ import React from 'react';
3
+ export declare const Minus: React.FC<SVGProps<SVGSVGElement>>;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Minus = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const Minus = (props) => {
6
+ return ((0, jsx_runtime_1.jsx)("svg", { ...props, xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 448 512", children: (0, jsx_runtime_1.jsx)("path", { fill: "currentColor", d: "M400 288h-352c-17.69 0-32-14.32-32-32.01s14.31-31.99 32-31.99h352c17.69 0 32 14.3 32 31.99S417.7 288 400 288z" }) }));
7
+ };
8
+ exports.Minus = Minus;
@@ -0,0 +1,3 @@
1
+ import type { SVGProps } from 'react';
2
+ import React from 'react';
3
+ export declare const Plus: React.FC<SVGProps<SVGSVGElement>>;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Plus = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const Plus = (props) => {
6
+ return ((0, jsx_runtime_1.jsx)("svg", { ...props, xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 448 512", children: (0, jsx_runtime_1.jsx)("path", { fill: "currentColor", d: "M432 256c0 17.69-14.33 32.01-32 32.01H256v144c0 17.69-14.33 31.99-32 31.99s-32-14.3-32-31.99v-144H48c-17.67 0-32-14.32-32-32.01s14.33-31.99 32-31.99H192v-144c0-17.69 14.33-32.01 32-32.01s32 14.32 32 32.01v144h144C417.7 224 432 238.3 432 256z" }) }));
7
+ };
8
+ exports.Plus = Plus;
@@ -3,7 +3,7 @@ export declare const TIMELINE_MIN_ZOOM = 1;
3
3
  export declare const TIMELINE_MAX_ZOOM = 5;
4
4
  export declare const TimelineZoomCtx: React.Context<{
5
5
  zoom: number;
6
- setZoom: React.Dispatch<React.SetStateAction<number>>;
6
+ setZoom: (prev: (prevZoom: number) => number) => void;
7
7
  }>;
8
8
  export declare const TimelineZoomContext: React.FC<{
9
9
  children: React.ReactNode;
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TimelineZoomContext = exports.TimelineZoomCtx = exports.TIMELINE_MAX_ZOOM = exports.TIMELINE_MIN_ZOOM = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
+ const imperative_state_1 = require("../components/Timeline/imperative-state");
7
+ const timeline_scroll_logic_1 = require("../components/Timeline/timeline-scroll-logic");
6
8
  exports.TIMELINE_MIN_ZOOM = 1;
7
9
  exports.TIMELINE_MAX_ZOOM = 5;
8
10
  exports.TimelineZoomCtx = (0, react_1.createContext)({
@@ -16,7 +18,19 @@ const TimelineZoomContext = ({ children }) => {
16
18
  const value = (0, react_1.useMemo)(() => {
17
19
  return {
18
20
  zoom,
19
- setZoom,
21
+ setZoom: (callback) => {
22
+ setZoom((prevZoom) => {
23
+ const newZoomWithFloatingPointErrors = Math.min(exports.TIMELINE_MAX_ZOOM, Math.max(exports.TIMELINE_MIN_ZOOM, callback(prevZoom)));
24
+ const newZoom = Math.round(newZoomWithFloatingPointErrors * 10) / 10;
25
+ (0, timeline_scroll_logic_1.zoomAndPreserveCursor)({
26
+ oldZoom: prevZoom,
27
+ newZoom,
28
+ currentDurationInFrames: (0, imperative_state_1.getCurrentDuration)(),
29
+ currentFrame: (0, imperative_state_1.getCurrentFrame)(),
30
+ });
31
+ return newZoom;
32
+ });
33
+ },
20
34
  };
21
35
  }, [zoom]);
22
36
  return ((0, jsx_runtime_1.jsx)(exports.TimelineZoomCtx.Provider, { value: value, children: children }));
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.openEventSource = void 0;
4
+ const ServerDisconnected_1 = require("./editor/components/Notifications/ServerDisconnected");
4
5
  let source = null;
5
6
  const openEventSource = () => {
6
7
  source = new EventSource('/events');
@@ -10,5 +11,10 @@ const openEventSource = () => {
10
11
  window.location.reload();
11
12
  }
12
13
  });
14
+ source.addEventListener('error', () => {
15
+ var _a;
16
+ // Display an error message that the preview server has disconnected.
17
+ (_a = ServerDisconnected_1.serverDisconnectedRef.current) === null || _a === void 0 ? void 0 : _a.setServerDisconnected();
18
+ });
13
19
  };
14
20
  exports.openEventSource = openEventSource;
@@ -28,4 +28,6 @@ export declare const getCliOptions: (options: {
28
28
  chromiumOptions: ChromiumOptions;
29
29
  overwrite: boolean;
30
30
  port: number | null;
31
+ muted: boolean;
32
+ enforceAudioTrack: boolean;
31
33
  }>;
@@ -179,6 +179,8 @@ const getCliOptions = async (options) => {
179
179
  chromiumOptions,
180
180
  overwrite,
181
181
  port: port !== null && port !== void 0 ? port : null,
182
+ muted: config_1.ConfigInternals.getMuted(),
183
+ enforceAudioTrack: config_1.ConfigInternals.getEnforceAudioTrack(),
182
184
  };
183
185
  };
184
186
  exports.getCliOptions = getCliOptions;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.handleCommonError = void 0;
4
+ const chalk_1 = require("./chalk");
4
5
  const log_1 = require("./log");
5
6
  const print_error_1 = require("./print-error");
6
7
  const handleCommonError = async (err) => {
@@ -21,5 +22,9 @@ const handleCommonError = async (err) => {
21
22
  log_1.Log.info();
22
23
  log_1.Log.info('💡 Get help for this issue at https://remotion.dev/docs/enametoolong');
23
24
  }
25
+ if (err.message.includes('The bucket does not allow ACLs')) {
26
+ log_1.Log.info();
27
+ log_1.Log.info(chalk_1.chalk.green('💡 Fix this issue https://remotion.dev/docs/lambda/troubleshooting/bucket-disallows-acl'));
28
+ }
24
29
  };
25
30
  exports.handleCommonError = handleCommonError;
package/dist/index.d.ts CHANGED
@@ -95,6 +95,8 @@ export declare const CliInternals: {
95
95
  chromiumOptions: import("@remotion/renderer").ChromiumOptions;
96
96
  overwrite: boolean;
97
97
  port: number | null;
98
+ muted: boolean;
99
+ enforceAudioTrack: boolean;
98
100
  }>;
99
101
  parseCommandLine: (type: "sequence" | "still" | "lambda" | "preview" | "versions") => void;
100
102
  loadConfig: (remotionRoot: string) => Promise<string | null>;
@@ -33,6 +33,8 @@ export declare type CommandLineOptions = {
33
33
  port: number;
34
34
  frame: string | number;
35
35
  ['disable-headless']: boolean;
36
+ muted: boolean;
37
+ ['enforce-audio-track']: boolean;
36
38
  gl: OpenGlRenderer;
37
39
  };
38
40
  export declare const BooleanFlags: string[];
@@ -16,6 +16,8 @@ exports.BooleanFlags = [
16
16
  'help',
17
17
  'quiet',
18
18
  'q',
19
+ 'muted',
20
+ 'enforce-audio-track',
19
21
  // Lambda flags
20
22
  'force',
21
23
  'disable-chunk-optimization',
@@ -126,6 +128,12 @@ const parseCommandLine = (type) => {
126
128
  if (typeof exports.parsedCli.port !== 'undefined') {
127
129
  config_1.Config.Bundling.setPort(exports.parsedCli.port);
128
130
  }
131
+ if (typeof exports.parsedCli.muted !== 'undefined') {
132
+ config_1.Config.Rendering.setMuted(exports.parsedCli.muted);
133
+ }
134
+ if (typeof exports.parsedCli['enforce-audio-track'] !== 'undefined') {
135
+ config_1.Config.Rendering.setEnforceAudioTrack(exports.parsedCli['enforce-audio-track']);
136
+ }
129
137
  };
130
138
  exports.parseCommandLine = parseCommandLine;
131
139
  const quietFlagProvided = () => exports.parsedCli.quiet || exports.parsedCli.q;
@@ -1,9 +1,10 @@
1
- import { RenderStep } from './step';
2
- export declare const prepareEntryPoint: ({ file, otherSteps, publicPath, outDir, }: {
1
+ import type { RenderStep } from './step';
2
+ export declare const prepareEntryPoint: ({ file, otherSteps, publicPath, outDir, remotionRoot, }: {
3
3
  file: string;
4
4
  otherSteps: RenderStep[];
5
5
  outDir: string | null;
6
6
  publicPath: string | null;
7
+ remotionRoot: string;
7
8
  }) => Promise<{
8
9
  urlOrBundle: string;
9
10
  steps: RenderStep[];
@@ -10,7 +10,7 @@ const path_1 = __importDefault(require("path"));
10
10
  const process_1 = require("process");
11
11
  const log_1 = require("./log");
12
12
  const setup_cache_1 = require("./setup-cache");
13
- const prepareEntryPoint = async ({ file, otherSteps, publicPath, outDir, }) => {
13
+ const prepareEntryPoint = async ({ file, otherSteps, publicPath, outDir, remotionRoot, }) => {
14
14
  if (renderer_1.RenderInternals.isServeUrl(file)) {
15
15
  return { urlOrBundle: file, steps: otherSteps, shouldDelete: false };
16
16
  }
@@ -25,11 +25,12 @@ const prepareEntryPoint = async ({ file, otherSteps, publicPath, outDir, }) => {
25
25
  log_1.Log.error(`No file or directory exists at ${joined}.`);
26
26
  (0, process_1.exit)(1);
27
27
  }
28
- const urlOrBundle = await (0, setup_cache_1.bundleOnCli)({
28
+ const urlOrBundle = await (0, setup_cache_1.bundleOnCliOrTakeServeUrl)({
29
29
  fullPath: joined,
30
30
  steps: ['bundling', ...otherSteps],
31
31
  outDir,
32
32
  publicPath,
33
+ remotionRoot,
33
34
  });
34
35
  return { urlOrBundle, steps: ['bundling', ...otherSteps], shouldDelete: true };
35
36
  };
@@ -31,7 +31,15 @@ const crashWithFrames = (crash) => (error) => {
31
31
  var _a;
32
32
  const didHookOrderChange = error.message.startsWith('Rendered fewer hooks') ||
33
33
  error.message.startsWith('Rendered more hooks');
34
- if (didHookOrderChange) {
34
+ const key = 'remotion.lastCrashBecauseOfHooks';
35
+ const previousCrashWasBecauseOfHooks = window.localStorage.getItem(key);
36
+ // When rendering conditional hooks, refreshing does not help.
37
+ // So we only refresh once.
38
+ const justRefreshedBecauseOfHooks = previousCrashWasBecauseOfHooks
39
+ ? Date.now() - Number(previousCrashWasBecauseOfHooks) < 5000
40
+ : false;
41
+ window.localStorage.setItem('remotion.lastCrashBecauseOfHooks', String(Date.now()));
42
+ if (didHookOrderChange && !justRefreshedBecauseOfHooks) {
35
43
  // eslint-disable-next-line no-console
36
44
  console.log('Hook order changed. Reloading app...');
37
45
  window.location.reload();
@@ -26,6 +26,6 @@ const Button = ({ children, onClick, disabled, style }) => {
26
26
  ...(style !== null && style !== void 0 ? style : {}),
27
27
  };
28
28
  }, [style]);
29
- return ((0, jsx_runtime_1.jsx)("button", { style: combined, type: "button", disabled: disabled, onClick: onClick, children: (0, jsx_runtime_1.jsx)("div", { style: buttonContainer, children: children }) }));
29
+ return ((0, jsx_runtime_1.jsx)("button", { style: combined, type: "button", disabled: disabled, onClick: onClick, children: (0, jsx_runtime_1.jsx)("div", { className: "css-reset", style: buttonContainer, children: children }) }));
30
30
  };
31
31
  exports.Button = Button;
@@ -13,6 +13,8 @@ const lineNumber = {
13
13
  paddingLeft: 10,
14
14
  paddingRight: 12,
15
15
  marginRight: 12,
16
+ color: 'inherit',
17
+ fontSize: 14,
16
18
  };
17
19
  const CodeFrame = ({ source, lineNumberWidth }) => {
18
20
  return ((0, jsx_runtime_1.jsx)("div", { style: frame, children: source.map((s, j) => {
@@ -16,9 +16,11 @@ const container = {
16
16
  marginBottom: 15,
17
17
  };
18
18
  const messageContainer = {
19
+ overflow: 'hidden',
20
+ };
21
+ const textContainer = {
19
22
  fontSize,
20
23
  lineHeight,
21
- overflow: 'hidden',
22
24
  };
23
25
  const moreLine = {
24
26
  width: '100%',
@@ -62,6 +64,6 @@ const ErrorMessage = ({ message }) => {
62
64
  const toggle = (0, react_1.useCallback)(() => {
63
65
  setExpanded((e) => !e);
64
66
  }, []);
65
- return ((0, jsx_runtime_1.jsxs)("div", { style: container, children: [(0, jsx_runtime_1.jsx)("div", { style: style, children: (0, jsx_runtime_1.jsx)("div", { ref: ref, children: message }) }), errorLines !== null && errorLines > maxLines ? ((0, jsx_runtime_1.jsx)("div", { style: moreLine, children: (0, jsx_runtime_1.jsx)("button", { type: "button", onClick: toggle, style: moreButton, children: (0, jsx_runtime_1.jsx)(carets_1.CaretDown, { invert: expanded }) }) })) : null] }));
67
+ return ((0, jsx_runtime_1.jsxs)("div", { style: container, children: [(0, jsx_runtime_1.jsx)("div", { style: style, children: (0, jsx_runtime_1.jsx)("div", { ref: ref, style: textContainer, children: message }) }), errorLines !== null && errorLines > maxLines ? ((0, jsx_runtime_1.jsx)("div", { style: moreLine, children: (0, jsx_runtime_1.jsx)("button", { type: "button", onClick: toggle, style: moreButton, children: (0, jsx_runtime_1.jsx)(carets_1.CaretDown, { invert: expanded }) }) })) : null] }));
66
68
  };
67
69
  exports.ErrorMessage = ErrorMessage;
@@ -32,6 +32,6 @@ const spacer = {
32
32
  width: 5,
33
33
  };
34
34
  const ErrorTitle = ({ name, message, symbolicating }) => {
35
- return ((0, jsx_runtime_1.jsxs)("div", { style: title, children: [(0, jsx_runtime_1.jsxs)("div", { style: left, children: [(0, jsx_runtime_1.jsx)("span", { style: errName, children: name }), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsxs)("div", { style: row, children: [symbolicating ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Symbolicating_1.Symbolicating, {}), (0, jsx_runtime_1.jsx)("div", { style: spacer })] })) : null, (0, jsx_runtime_1.jsx)(ErrorMessage_1.ErrorMessage, { message: message })] })] }), (0, react_overlay_1.didUnmountReactApp)() ? null : (0, jsx_runtime_1.jsx)(DismissButton_1.DismissButton, {})] }));
35
+ return ((0, jsx_runtime_1.jsxs)("div", { style: title, className: "css-reset", children: [(0, jsx_runtime_1.jsxs)("div", { style: left, children: [(0, jsx_runtime_1.jsx)("span", { style: errName, children: name }), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsxs)("div", { style: row, children: [symbolicating ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Symbolicating_1.Symbolicating, {}), (0, jsx_runtime_1.jsx)("div", { style: spacer })] })) : null, (0, jsx_runtime_1.jsx)(ErrorMessage_1.ErrorMessage, { message: message })] })] }), (0, react_overlay_1.didUnmountReactApp)() ? null : (0, jsx_runtime_1.jsx)(DismissButton_1.DismissButton, {})] }));
36
36
  };
37
37
  exports.ErrorTitle = ErrorTitle;
@@ -10,6 +10,7 @@ const format_location_1 = require("./format-location");
10
10
  const location = {
11
11
  color: 'rgba(255, 255, 255, 0.6)',
12
12
  fontFamily: 'monospace',
13
+ fontSize: 14,
13
14
  };
14
15
  const header = {
15
16
  paddingLeft: 14,
@@ -28,6 +29,7 @@ const left = {
28
29
  };
29
30
  const fnName = {
30
31
  fontSize: 14,
32
+ lineHeight: 1.5,
31
33
  marginBottom: 3,
32
34
  };
33
35
  const StackElement = ({ s, lineNumberWidth, isFirst, defaultFunctionName }) => {
@@ -41,7 +43,7 @@ const StackElement = ({ s, lineNumberWidth, isFirst, defaultFunctionName }) => {
41
43
  const toggleCodeFrame = (0, react_1.useCallback)(() => {
42
44
  setShowCodeFrame((f) => !f);
43
45
  }, []);
44
- return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("div", { style: header, children: [(0, jsx_runtime_1.jsxs)("div", { style: left, children: [(0, jsx_runtime_1.jsx)("div", { style: fnName, children: (_a = s.originalFunctionName) !== null && _a !== void 0 ? _a : defaultFunctionName }), s.originalFileName ? ((0, jsx_runtime_1.jsxs)("div", { style: location, children: [(0, format_location_1.formatLocation)(s.originalFileName), ":", s.originalLineNumber] })) : null] }), s.originalScriptCode && s.originalScriptCode.length > 0 ? ((0, jsx_runtime_1.jsx)(Button_1.Button, { onClick: toggleCodeFrame, children: showCodeFrame ? (0, jsx_runtime_1.jsx)(carets_1.CaretDown, { invert: false }) : (0, jsx_runtime_1.jsx)(carets_1.CaretRight, {}) })) : null] }), (0, jsx_runtime_1.jsx)("div", { children: s.originalScriptCode &&
46
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "css-reset", children: [(0, jsx_runtime_1.jsxs)("div", { style: header, children: [(0, jsx_runtime_1.jsxs)("div", { style: left, children: [(0, jsx_runtime_1.jsx)("div", { style: fnName, children: (_a = s.originalFunctionName) !== null && _a !== void 0 ? _a : defaultFunctionName }), s.originalFileName ? ((0, jsx_runtime_1.jsxs)("div", { style: location, children: [(0, format_location_1.formatLocation)(s.originalFileName), ":", s.originalLineNumber] })) : null] }), s.originalScriptCode && s.originalScriptCode.length > 0 ? ((0, jsx_runtime_1.jsx)(Button_1.Button, { onClick: toggleCodeFrame, children: showCodeFrame ? (0, jsx_runtime_1.jsx)(carets_1.CaretDown, { invert: false }) : (0, jsx_runtime_1.jsx)(carets_1.CaretRight, {}) })) : null] }), (0, jsx_runtime_1.jsx)("div", { children: s.originalScriptCode &&
45
47
  s.originalScriptCode.length > 0 &&
46
48
  showCodeFrame ? ((0, jsx_runtime_1.jsx)(CodeFrame_1.CodeFrame, { lineNumberWidth: lineNumberWidth, source: s.originalScriptCode })) : null })] }));
47
49
  };
@@ -3,6 +3,7 @@ declare type LockfilePath = {
3
3
  manager: PackageManager;
4
4
  path: string;
5
5
  installCommand: string;
6
+ startCommand: string;
6
7
  };
7
8
  export declare const lockFilePaths: LockfilePath[];
8
9
  export declare const getPackageManager: (remotionRoot: string) => LockfilePath | 'unknown';
@@ -7,16 +7,23 @@ exports.getPackageManager = exports.lockFilePaths = void 0;
7
7
  const fs_1 = __importDefault(require("fs"));
8
8
  const path_1 = __importDefault(require("path"));
9
9
  exports.lockFilePaths = [
10
- { path: 'package-lock.json', manager: 'npm', installCommand: 'npm i' },
10
+ {
11
+ path: 'package-lock.json',
12
+ manager: 'npm',
13
+ installCommand: 'npm i',
14
+ startCommand: 'npm start',
15
+ },
11
16
  {
12
17
  path: 'yarn.lock',
13
18
  manager: 'yarn',
14
19
  installCommand: 'yarn add',
20
+ startCommand: 'yarn start',
15
21
  },
16
22
  {
17
23
  path: 'pnpm-lock.yaml',
18
24
  manager: 'pnpm',
19
25
  installCommand: 'pnpm i',
26
+ startCommand: 'pnpm start',
20
27
  },
21
28
  ];
22
29
  const getPackageManager = (remotionRoot) => {
@@ -13,6 +13,10 @@ const makeLiveEventsRouter = () => {
13
13
  'cache-control': 'no-cache',
14
14
  };
15
15
  response.writeHead(200, headers);
16
+ if (request.method === 'OPTIONS') {
17
+ response.end();
18
+ return;
19
+ }
16
20
  response.write(serializeMessage({ type: 'init' }));
17
21
  const clientId = String(Math.random());
18
22
  const newClient = {
@@ -10,6 +10,7 @@ const path_1 = __importDefault(require("path"));
10
10
  const url_1 = require("url");
11
11
  const get_file_source_1 = require("./error-overlay/react-overlay/utils/get-file-source");
12
12
  const open_in_editor_1 = require("./error-overlay/react-overlay/utils/open-in-editor");
13
+ const get_package_manager_1 = require("./get-package-manager");
13
14
  const project_info_1 = require("./project-info");
14
15
  const serve_static_1 = require("./serve-static");
15
16
  const update_available_1 = require("./update-available");
@@ -29,12 +30,14 @@ const handleFallback = async ({ remotionRoot, hash, response, getCurrentInputPro
29
30
  const displayName = (0, open_in_editor_1.getDisplayNameForEditor)(edit ? edit.command : null);
30
31
  response.setHeader('content-type', 'text/html');
31
32
  response.writeHead(200);
33
+ const packageManager = (0, get_package_manager_1.getPackageManager)(remotionRoot);
32
34
  response.end(bundler_1.BundlerInternals.indexHtml({
33
35
  staticHash: hash,
34
36
  baseDir: '/',
35
37
  editorName: displayName,
36
38
  inputProps: getCurrentInputProps(),
37
39
  remotionRoot,
40
+ previewServerCommand: packageManager === 'unknown' ? null : packageManager.startCommand,
38
41
  }));
39
42
  };
40
43
  const handleProjectInfo = async (remotionRoot, _, response) => {
@@ -43,7 +46,12 @@ const handleProjectInfo = async (remotionRoot, _, response) => {
43
46
  response.writeHead(200);
44
47
  response.end(JSON.stringify(data));
45
48
  };
46
- const handleFileSource = async (remotionRoot, search, _, response) => {
49
+ const handleFileSource = async ({ method, remotionRoot, search, response, }) => {
50
+ if (method === 'OPTIONS') {
51
+ response.writeHead(200);
52
+ response.end();
53
+ return;
54
+ }
47
55
  if (!search.startsWith('?')) {
48
56
  throw new Error('query must start with ?');
49
57
  }
@@ -58,6 +66,10 @@ const handleFileSource = async (remotionRoot, search, _, response) => {
58
66
  return response.end();
59
67
  };
60
68
  const handleOpenInEditor = async (remotionRoot, req, res) => {
69
+ if (req.method === 'OPTIONS') {
70
+ res.statusCode = 200;
71
+ res.end();
72
+ }
61
73
  try {
62
74
  const b = await new Promise((_resolve) => {
63
75
  let data = '';
@@ -114,7 +126,12 @@ const handleRoutes = ({ hash, hashPrefix, request, response, liveEventsServer, g
114
126
  return handleProjectInfo(remotionRoot, request, response);
115
127
  }
116
128
  if (url.pathname === '/api/file-source') {
117
- return handleFileSource(remotionRoot, url.search, request, response);
129
+ return handleFileSource({
130
+ remotionRoot,
131
+ search: url.search,
132
+ method: request.method,
133
+ response,
134
+ });
118
135
  }
119
136
  if (url.pathname === '/api/open-in-editor') {
120
137
  return handleOpenInEditor(remotionRoot, request, response);
@@ -53,7 +53,7 @@ const startServer = async (entry, userDefinedComponent, options) => {
53
53
  });
54
54
  })
55
55
  .then(() => {
56
- (0, routes_1.handleRoutes)({
56
+ return (0, routes_1.handleRoutes)({
57
57
  hash,
58
58
  hashPrefix,
59
59
  request,
@@ -9,13 +9,19 @@ const client_1 = __importDefault(require("react-dom/client"));
9
9
  const remotion_1 = require("remotion");
10
10
  require("../styles/styles.css");
11
11
  const Editor_1 = require("./editor/components/Editor");
12
+ const ServerDisconnected_1 = require("./editor/components/Notifications/ServerDisconnected");
12
13
  const event_source_1 = require("./event-source");
13
14
  remotion_1.Internals.CSSUtils.injectCSS(remotion_1.Internals.CSSUtils.makeDefaultCSS(null, '#1f2428'));
15
+ const getServerDisconnectedDomElement = () => {
16
+ return document.getElementById('server-disconnected-overlay');
17
+ };
14
18
  const content = ((0, jsx_runtime_1.jsx)(remotion_1.Internals.RemotionRoot, { children: (0, jsx_runtime_1.jsx)(Editor_1.Editor, {}) }));
15
19
  if (client_1.default.createRoot) {
16
20
  client_1.default.createRoot(remotion_1.Internals.getPreviewDomElement()).render(content);
21
+ client_1.default.createRoot(getServerDisconnectedDomElement()).render((0, jsx_runtime_1.jsx)(ServerDisconnected_1.ServerDisconnected, {}));
17
22
  }
18
23
  else {
19
24
  client_1.default.render((0, jsx_runtime_1.jsx)(remotion_1.Internals.RemotionRoot, { children: (0, jsx_runtime_1.jsx)(Editor_1.Editor, {}) }), remotion_1.Internals.getPreviewDomElement());
25
+ client_1.default.render((0, jsx_runtime_1.jsx)(ServerDisconnected_1.ServerDisconnected, {}), getServerDisconnectedDomElement());
20
26
  }
21
27
  (0, event_source_1.openEventSource)();
@@ -50,12 +50,17 @@ const makeRenderingProgress = ({ frames, totalFrames, steps, concurrency, doneIn
50
50
  exports.makeRenderingProgress = makeRenderingProgress;
51
51
  const makeStitchingProgress = ({ frames, totalFrames, steps, doneIn, stage, codec, }) => {
52
52
  const progress = frames / totalFrames;
53
+ const mediaType = codec === 'gif'
54
+ ? 'GIF'
55
+ : renderer_1.RenderInternals.isAudioCodec(codec)
56
+ ? 'audio'
57
+ : 'video';
53
58
  return [
54
59
  `(${steps.indexOf('stitching') + 1}/${steps.length})`,
55
60
  (0, make_progress_bar_1.makeProgressBar)(progress),
56
61
  stage === 'muxing' && renderer_1.RenderInternals.canUseParallelEncoding(codec)
57
- ? `${doneIn ? 'Muxed' : 'Muxing'} audio`
58
- : `${doneIn ? 'Encoded' : 'Encoding'} ${codec === 'gif' ? 'GIF' : 'video'}`,
62
+ ? `${doneIn ? 'Muxed' : 'Muxing'} ${mediaType}`
63
+ : `${doneIn ? 'Encoded' : 'Encoding'} ${mediaType}`,
59
64
  doneIn === null ? `${frames}/${totalFrames}` : chalk_1.chalk.gray(`${doneIn}ms`),
60
65
  ].join(' ');
61
66
  };
package/dist/render.js CHANGED
@@ -36,7 +36,7 @@ const render = async (remotionRoot) => {
36
36
  const downloadMap = renderer_1.RenderInternals.makeDownloadMap();
37
37
  await (0, initialize_render_cli_1.initializeRenderCli)(remotionRoot, 'sequence');
38
38
  log_1.Log.verbose('Asset dirs', downloadMap.assetDir);
39
- const { codec, proResProfile, parallelism, frameRange, shouldOutputImageSequence, overwrite, inputProps, envVariables, quality, browser, crf, pixelFormat, imageFormat, browserExecutable, ffmpegExecutable, ffprobeExecutable, scale, chromiumOptions, port, numberOfGifLoops, everyNthFrame, puppeteerTimeout, } = await (0, get_cli_options_1.getCliOptions)({
39
+ const { codec, proResProfile, parallelism, frameRange, shouldOutputImageSequence, overwrite, inputProps, envVariables, quality, browser, crf, pixelFormat, imageFormat, browserExecutable, ffmpegExecutable, ffprobeExecutable, scale, chromiumOptions, port, numberOfGifLoops, everyNthFrame, puppeteerTimeout, muted, enforceAudioTrack, } = await (0, get_cli_options_1.getCliOptions)({
40
40
  isLambda: false,
41
41
  type: 'series',
42
42
  });
@@ -232,6 +232,8 @@ const render = async (remotionRoot) => {
232
232
  everyNthFrame,
233
233
  verbose: renderer_1.RenderInternals.isEqualOrBelowLogLevel(config_1.ConfigInternals.Logging.getLogLevel(), 'verbose'),
234
234
  downloadMap,
235
+ muted,
236
+ enforceAudioTrack,
235
237
  });
236
238
  log_1.Log.info();
237
239
  log_1.Log.info();
package/dist/upgrade.js CHANGED
@@ -37,6 +37,7 @@ const upgrade = async (remotionRoot) => {
37
37
  '@remotion/eslint-config',
38
38
  '@remotion/renderer',
39
39
  '@remotion/skia',
40
+ '@remotion/lottie',
40
41
  '@remotion/media-utils',
41
42
  '@remotion/babel-loader',
42
43
  '@remotion/lambda',
package/dist/versions.js CHANGED
@@ -16,6 +16,7 @@ const packages = [
16
16
  '@remotion/eslint-config',
17
17
  '@remotion/renderer',
18
18
  '@remotion/skia',
19
+ '@remotion/lottie',
19
20
  '@remotion/media-utils',
20
21
  '@remotion/babel-loader',
21
22
  '@remotion/lambda',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/cli",
3
- "version": "3.1.11",
3
+ "version": "3.2.2",
4
4
  "description": "CLI for Remotion",
5
5
  "main": "dist/index.js",
6
6
  "sideEffects": false,
@@ -23,15 +23,15 @@
23
23
  "author": "Jonny Burger <jonny@remotion.dev>",
24
24
  "license": "SEE LICENSE IN LICENSE.md",
25
25
  "dependencies": {
26
- "@remotion/bundler": "3.1.11",
27
- "@remotion/media-utils": "3.1.11",
28
- "@remotion/player": "3.1.11",
29
- "@remotion/renderer": "3.1.11",
26
+ "@remotion/bundler": "3.2.2",
27
+ "@remotion/media-utils": "3.2.2",
28
+ "@remotion/player": "3.2.2",
29
+ "@remotion/renderer": "3.2.2",
30
30
  "better-opn": "2.1.1",
31
31
  "dotenv": "9.0.2",
32
32
  "memfs": "3.4.3",
33
33
  "minimist": "1.2.6",
34
- "remotion": "3.1.11",
34
+ "remotion": "3.2.2",
35
35
  "semver": "7.3.5",
36
36
  "source-map": "0.6.1"
37
37
  },
@@ -71,5 +71,5 @@
71
71
  "publishConfig": {
72
72
  "access": "public"
73
73
  },
74
- "gitHead": "bc4184c9faf944a3bac2fd56bdf990cc74e3ec94"
74
+ "gitHead": "8e5f2d05adf7ddd3824ea734fa888b4b4761f364"
75
75
  }
@@ -1,2 +0,0 @@
1
- import { RenderStep } from './step';
2
- export declare const bundleOnCli: (fullPath: string, steps: RenderStep[]) => Promise<string>;