@remotion/cli 4.0.0-alpha.130 → 4.0.0-alpha.185

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 (141) hide show
  1. package/dist/benchmark.js +2 -2
  2. package/dist/codemods/update-default-props.js +7 -8
  3. package/dist/color-math.d.ts +1 -0
  4. package/dist/color-math.js +12 -0
  5. package/dist/config/ffmpeg-executable.d.ts +5 -0
  6. package/dist/config/ffmpeg-executable.js +21 -0
  7. package/dist/config/image-format.d.ts +1 -1
  8. package/dist/config/index.d.ts +7 -3
  9. package/dist/config/index.js +7 -4
  10. package/dist/config/jpeg-quality.d.ts +2 -0
  11. package/dist/config/jpeg-quality.js +17 -0
  12. package/dist/config/log.d.ts +1 -1
  13. package/dist/editor/components/Canvas.js +1 -4
  14. package/dist/editor/components/CheckerboardProvider.d.ts +4 -0
  15. package/dist/editor/components/CheckerboardProvider.js +24 -0
  16. package/dist/editor/components/CollapsedCompositionSelector.d.ts +4 -0
  17. package/dist/editor/components/CollapsedCompositionSelector.js +39 -0
  18. package/dist/editor/components/EditorContexts.js +7 -71
  19. package/dist/editor/components/KeyboardShortcutsExplainer.js +1 -1
  20. package/dist/editor/components/MediaVolumeProvider.d.ts +4 -0
  21. package/dist/editor/components/MediaVolumeProvider.js +25 -0
  22. package/dist/editor/components/Menu/MenuSubItem.js +14 -1
  23. package/dist/editor/components/Menu/styles.d.ts +2 -0
  24. package/dist/editor/components/Menu/styles.js +9 -2
  25. package/dist/editor/components/MenuToolbar.js +2 -1
  26. package/dist/editor/components/Modals.js +1 -1
  27. package/dist/editor/components/ModalsProvider.d.ts +4 -0
  28. package/dist/editor/components/ModalsProvider.js +17 -0
  29. package/dist/editor/components/NewComposition/ComboBox.js +22 -13
  30. package/dist/editor/components/NewComposition/InputDragger.js +1 -1
  31. package/dist/editor/components/NewComposition/MenuContent.js +7 -1
  32. package/dist/editor/components/NewComposition/RemInput.d.ts +1 -1
  33. package/dist/editor/components/NewComposition/RemInputTypeColor.d.ts +8 -0
  34. package/dist/editor/components/NewComposition/RemInputTypeColor.js +53 -0
  35. package/dist/editor/components/PlayerEmitterContext.d.ts +4 -0
  36. package/dist/editor/components/PlayerEmitterContext.js +11 -0
  37. package/dist/editor/components/QuickSwitcher/QuickSwitcherContent.js +1 -0
  38. package/dist/editor/components/RenderButton.js +2 -3
  39. package/dist/editor/components/RenderModal/JpegQualitySetting.d.ts +2 -2
  40. package/dist/editor/components/RenderModal/JpegQualitySetting.js +4 -4
  41. package/dist/editor/components/RenderModal/RenderModal.d.ts +1 -1
  42. package/dist/editor/components/RenderModal/RenderModal.js +13 -13
  43. package/dist/editor/components/RenderModal/RenderModalAdvanced.js +2 -0
  44. package/dist/editor/components/RenderModal/RenderModalAudio.js +0 -2
  45. package/dist/editor/components/RenderModal/RenderModalData.d.ts +1 -1
  46. package/dist/editor/components/RenderModal/RenderModalData.js +52 -6
  47. package/dist/editor/components/RenderModal/RenderModalJSONInputPropsEditor.d.ts +2 -0
  48. package/dist/editor/components/RenderModal/RenderModalJSONInputPropsEditor.js +25 -3
  49. package/dist/editor/components/RenderModal/RenderModalPicture.d.ts +2 -2
  50. package/dist/editor/components/RenderModal/RenderModalPicture.js +2 -2
  51. package/dist/editor/components/RenderModal/SchemaEditor/SchemaEditor.js +2 -0
  52. package/dist/editor/components/RenderModal/SchemaEditor/SchemaLabel.js +1 -4
  53. package/dist/editor/components/RenderModal/SchemaEditor/ZodArrayEditor.js +12 -3
  54. package/dist/editor/components/RenderModal/SchemaEditor/ZodColorEditor.d.ts +14 -0
  55. package/dist/editor/components/RenderModal/SchemaEditor/ZodColorEditor.js +108 -0
  56. package/dist/editor/components/RenderModal/SchemaEditor/ZodEnumEditor.js +0 -1
  57. package/dist/editor/components/RenderModal/SchemaEditor/ZodNonEditableValue.js +5 -1
  58. package/dist/editor/components/RenderModal/SchemaEditor/ZodObjectEditor.js +4 -1
  59. package/dist/editor/components/RenderModal/SchemaEditor/ZodOrNullishEditor.d.ts +15 -0
  60. package/dist/editor/components/RenderModal/SchemaEditor/ZodOrNullishEditor.js +45 -0
  61. package/dist/editor/components/RenderModal/SchemaEditor/ZodSwitch.js +8 -0
  62. package/dist/editor/components/RenderModal/SchemaEditor/ZodUnionEditor.d.ts +14 -0
  63. package/dist/editor/components/RenderModal/SchemaEditor/ZodUnionEditor.js +45 -0
  64. package/dist/editor/components/RenderModal/SchemaEditor/create-zod-values.d.ts +2 -0
  65. package/dist/editor/components/RenderModal/SchemaEditor/create-zod-values.js +153 -0
  66. package/dist/editor/components/RenderModal/human-readable-codec.d.ts +1 -1
  67. package/dist/editor/components/RenderModal/out-name-checker.js +2 -1
  68. package/dist/editor/components/RenderQueue/actions.d.ts +5 -4
  69. package/dist/editor/components/RenderQueue/actions.js +11 -5
  70. package/dist/editor/components/RenderToolbarIcon.js +4 -2
  71. package/dist/editor/components/RendersTab.js +3 -3
  72. package/dist/editor/components/RichTimelineToggle.d.ts +2 -0
  73. package/dist/editor/components/RichTimelineToggle.js +29 -0
  74. package/dist/editor/components/RightPanel.js +3 -9
  75. package/dist/editor/components/SetTimelineInOutProvider.d.ts +4 -0
  76. package/dist/editor/components/SetTimelineInOutProvider.js +19 -0
  77. package/dist/editor/components/SidebarCollapserControls.d.ts +2 -0
  78. package/dist/editor/components/SidebarCollapserControls.js +122 -0
  79. package/dist/editor/components/SidebarContent.d.ts +5 -0
  80. package/dist/editor/components/SidebarContent.js +53 -0
  81. package/dist/editor/components/SizeSelector.js +1 -1
  82. package/dist/editor/components/Tabs/index.d.ts +1 -0
  83. package/dist/editor/components/Tabs/index.js +12 -5
  84. package/dist/editor/components/Tabs/vertical.d.ts +12 -0
  85. package/dist/editor/components/Tabs/vertical.js +57 -0
  86. package/dist/editor/components/Thumbnail.d.ts +8 -0
  87. package/dist/editor/components/Thumbnail.js +76 -0
  88. package/dist/editor/components/TopPanel.d.ts +1 -0
  89. package/dist/editor/components/TopPanel.js +19 -24
  90. package/dist/editor/components/ZoomGesturesProvider.d.ts +4 -0
  91. package/dist/editor/components/ZoomGesturesProvider.js +24 -0
  92. package/dist/editor/components/layout.d.ts +1 -0
  93. package/dist/editor/components/layout.js +5 -4
  94. package/dist/editor/helpers/colors.d.ts +1 -1
  95. package/dist/editor/helpers/use-compact-ui.d.ts +1 -0
  96. package/dist/editor/helpers/use-compact-ui.js +18 -0
  97. package/dist/editor/helpers/use-menu-structure.js +10 -22
  98. package/dist/editor/icons/film.d.ts +3 -0
  99. package/dist/editor/icons/film.js +8 -0
  100. package/dist/editor/icons/render.d.ts +3 -0
  101. package/dist/editor/icons/render.js +5 -1
  102. package/dist/editor/icons/save.d.ts +2 -0
  103. package/dist/editor/icons/save.js +8 -0
  104. package/dist/editor/icons/timeline.d.ts +3 -0
  105. package/dist/editor/icons/timeline.js +9 -0
  106. package/dist/editor/state/modals.d.ts +1 -1
  107. package/dist/editor/state/rich-timeline.d.ts +9 -0
  108. package/dist/editor/state/rich-timeline.js +17 -0
  109. package/dist/editor/state/sidebar.d.ts +6 -5
  110. package/dist/editor/state/sidebar.js +35 -21
  111. package/dist/get-cli-options.d.ts +3 -3
  112. package/dist/get-cli-options.js +1 -1
  113. package/dist/get-render-media-options.d.ts +8 -0
  114. package/dist/get-render-media-options.js +55 -0
  115. package/dist/index.d.ts +9 -9
  116. package/dist/install.d.ts +2 -0
  117. package/dist/install.js +36 -0
  118. package/dist/parse-command-line.d.ts +1 -0
  119. package/dist/parse-command-line.js +5 -1
  120. package/dist/preview-server/api-routes.js +2 -0
  121. package/dist/preview-server/api-types.d.ts +2 -1
  122. package/dist/preview-server/render-queue/job.d.ts +13 -4
  123. package/dist/preview-server/render-queue/make-retry-payload.js +2 -2
  124. package/dist/preview-server/render-queue/process-still.js +1 -1
  125. package/dist/preview-server/render-queue/process-video.js +1 -1
  126. package/dist/preview-server/routes/add-render.js +2 -2
  127. package/dist/preview-server/routes/can-update-default-props.d.ts +4 -0
  128. package/dist/preview-server/routes/can-update-default-props.js +39 -0
  129. package/dist/preview-server/routes/update-default-props.js +3 -1
  130. package/dist/preview-server/routes.js +2 -2
  131. package/dist/print-help.js +2 -2
  132. package/dist/render-flows/render.d.ts +2 -2
  133. package/dist/render-flows/render.js +3 -3
  134. package/dist/render-flows/still.d.ts +2 -2
  135. package/dist/render-flows/still.js +2 -2
  136. package/dist/render.js +2 -2
  137. package/dist/still.js +2 -2
  138. package/package.json +7 -7
  139. package/styles/styles.css +6 -0
  140. package/dist/editor/components/RenderModal/SchemaEditor/schema-serialization.d.ts +0 -2
  141. package/dist/editor/components/RenderModal/SchemaEditor/schema-serialization.js +0 -21
package/dist/benchmark.js CHANGED
@@ -151,7 +151,7 @@ const benchmarkCommand = async (remotionRoot, args) => {
151
151
  uiCodec: null,
152
152
  });
153
153
  for (const composition of compositions) {
154
- const { proResProfile, frameRange: defaultFrameRange, overwrite, quality, crf: configFileCrf, pixelFormat, scale: configFileScale, numberOfGifLoops, everyNthFrame, muted, enforceAudioTrack, ffmpegOverride, audioBitrate, videoBitrate, height, width, concurrency: unparsedConcurrency, } = await (0, get_cli_options_1.getCliOptions)({
154
+ const { proResProfile, frameRange: defaultFrameRange, overwrite, jpegQuality, crf: configFileCrf, pixelFormat, scale: configFileScale, numberOfGifLoops, everyNthFrame, muted, enforceAudioTrack, ffmpegOverride, audioBitrate, videoBitrate, height, width, concurrency: unparsedConcurrency, } = await (0, get_cli_options_1.getCliOptions)({
155
155
  isLambda: false,
156
156
  type: 'series',
157
157
  remotionRoot,
@@ -183,7 +183,7 @@ const benchmarkCommand = async (remotionRoot, args) => {
183
183
  overwrite,
184
184
  pixelFormat,
185
185
  proResProfile,
186
- quality,
186
+ jpegQuality,
187
187
  dumpBrowserLogs: renderer_1.RenderInternals.isEqualOrBelowLogLevel(config_1.ConfigInternals.Logging.getLogLevel(), 'verbose'),
188
188
  chromiumOptions,
189
189
  timeoutInMilliseconds: config_1.ConfigInternals.getCurrentPuppeteerTimeout(),
@@ -61,7 +61,7 @@ const findEndPosition = (input, currentPosition) => {
61
61
  }
62
62
  throw new Error('Could not find end of defaultProps');
63
63
  };
64
- const findEnder = (input, position, maxPosition) => {
64
+ const findEnder = (input, position, maxPosition, compositionId) => {
65
65
  let currentPosition = position;
66
66
  while (currentPosition < maxPosition) {
67
67
  const next = findEndPosition(input, currentPosition);
@@ -72,7 +72,7 @@ const findEnder = (input, position, maxPosition) => {
72
72
  }
73
73
  return [position, currentPosition + 1];
74
74
  }
75
- throw new Error('did not find string');
75
+ throw new Error(`No \`defaultProps\` prop found in the <Composition/> tag with the ID "${compositionId}".`);
76
76
  };
77
77
  const findTerminators = (input, position) => {
78
78
  const nextComposition = input.indexOf('<Composition', position);
@@ -101,23 +101,22 @@ const stringifyDefaultProps = (props) => {
101
101
  .replace(/__ADD_AS_CONST__"/g, '" as const');
102
102
  };
103
103
  // TODO: Add more sanity checks
104
- // TODO: better error messages
105
104
  const updateDefaultProps = async ({ input, compositionId, newDefaultProps, }) => {
106
105
  const starter = findStarter({ input, compositionId });
107
106
  const START_TOKEN = 'defaultProps={';
108
107
  const start = input.indexOf(START_TOKEN, starter);
109
108
  if (start === -1) {
110
- throw new Error('Could not find defaultProps in <Composition> tag');
109
+ throw new Error(`No \`defaultProps\` prop found in the <Composition/> tag with the ID "${compositionId}".`);
111
110
  }
112
111
  const maxEnd = findTerminators(input, starter);
113
- const [startPos, endPos] = findEnder(input, start + START_TOKEN.length, maxEnd);
112
+ const [startPos, endPos] = findEnder(input, start + START_TOKEN.length, maxEnd, compositionId);
114
113
  // eslint-disable-next-line @typescript-eslint/consistent-type-imports
115
114
  let prettier = null;
116
115
  try {
117
116
  prettier = await Promise.resolve().then(() => __importStar(require('prettier')));
118
117
  }
119
118
  catch (err) {
120
- throw new Error('Cannot save default props because Prettier cannot be found in the current project.');
119
+ throw new Error('Prettier cannot be found in the current project.');
121
120
  }
122
121
  const { format, resolveConfig, resolveConfigFile } = prettier;
123
122
  const newFile = input.substring(0, startPos) +
@@ -125,11 +124,11 @@ const updateDefaultProps = async ({ input, compositionId, newDefaultProps, }) =>
125
124
  input.substring(endPos);
126
125
  const configFilePath = await resolveConfigFile();
127
126
  if (!configFilePath) {
128
- throw new Error('prettier config file not found');
127
+ throw new Error('The Prettier config file was not found');
129
128
  }
130
129
  const prettierConfig = await resolveConfig(configFilePath);
131
130
  if (!prettierConfig) {
132
- throw new Error('Prettier config not found');
131
+ throw new Error(`The Prettier config at ${configFilePath} could not be read`);
133
132
  }
134
133
  const prettified = format(newFile, {
135
134
  ...prettierConfig,
@@ -0,0 +1 @@
1
+ export declare const colorWithNewOpacity: (color: string, opacity: number) => string;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.colorWithNewOpacity = void 0;
4
+ const remotion_1 = require("remotion");
5
+ const colorWithNewOpacity = (color, opacity) => {
6
+ const { r, g, b } = remotion_1.Internals.parseColor(color);
7
+ if (opacity >= 255) {
8
+ return `#${r.toString(16)}${g.toString(16)}${b.toString(16)}`;
9
+ }
10
+ return `rgba(${r}, ${g}, ${b}, ${(opacity / 255).toFixed(2)})`;
11
+ };
12
+ exports.colorWithNewOpacity = colorWithNewOpacity;
@@ -0,0 +1,5 @@
1
+ import type { FfmpegExecutable } from '@remotion/renderer';
2
+ export declare const setFfmpegExecutable: (ffmpegPath: FfmpegExecutable) => void;
3
+ export declare const getCustomFfmpegExecutable: () => FfmpegExecutable;
4
+ export declare const setFfprobeExecutable: (ffprobePath: FfmpegExecutable) => void;
5
+ export declare const getCustomFfprobeExecutable: () => FfmpegExecutable;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getCustomFfprobeExecutable = exports.setFfprobeExecutable = exports.getCustomFfmpegExecutable = exports.setFfmpegExecutable = void 0;
4
+ let currentFfmpegExecutablePath = null;
5
+ let currentFfprobeExecutablePath = null;
6
+ const setFfmpegExecutable = (ffmpegPath) => {
7
+ currentFfmpegExecutablePath = ffmpegPath;
8
+ };
9
+ exports.setFfmpegExecutable = setFfmpegExecutable;
10
+ const getCustomFfmpegExecutable = () => {
11
+ return currentFfmpegExecutablePath;
12
+ };
13
+ exports.getCustomFfmpegExecutable = getCustomFfmpegExecutable;
14
+ const setFfprobeExecutable = (ffprobePath) => {
15
+ currentFfprobeExecutablePath = ffprobePath;
16
+ };
17
+ exports.setFfprobeExecutable = setFfprobeExecutable;
18
+ const getCustomFfprobeExecutable = () => {
19
+ return currentFfprobeExecutablePath;
20
+ };
21
+ exports.getCustomFfprobeExecutable = getCustomFfprobeExecutable;
@@ -2,4 +2,4 @@ import type { StillImageFormat, VideoImageFormat } from '@remotion/renderer';
2
2
  export declare const setStillImageFormat: (format: StillImageFormat) => void;
3
3
  export declare const setVideoImageFormat: (format: VideoImageFormat) => void;
4
4
  export declare const getUserPreferredStillImageFormat: () => "png" | "jpeg" | "pdf" | "webp" | undefined;
5
- export declare const getUserPreferredVideoImageFormat: () => "none" | "png" | "jpeg" | undefined;
5
+ export declare const getUserPreferredVideoImageFormat: () => "png" | "jpeg" | "none" | undefined;
@@ -116,13 +116,17 @@ declare global {
116
116
  * Default: `null`, meaning half of the threads available on your CPU.
117
117
  */
118
118
  readonly setConcurrency: (newConcurrency: Concurrency) => void;
119
+ /**
120
+ * @deprecated Renamed to `setJpegQuality`.
121
+ */
122
+ readonly setQuality: (q: never) => void;
119
123
  /**
120
124
  * Set the JPEG quality for the frames.
121
125
  * Must be between 0 and 100.
122
126
  * Must be between 0 and 100.
123
127
  * Default: 80
124
128
  */
125
- readonly setQuality: (q: number | undefined) => void;
129
+ readonly setJpegQuality: (q: number | undefined) => void;
126
130
  /** Decide the image format for still renders.
127
131
  */
128
132
  readonly setStillImageFormat: (format: StillImageFormat) => void;
@@ -255,13 +259,13 @@ export declare const ConfigInternals: {
255
259
  getEveryNthFrame: () => number;
256
260
  getConcurrency: () => string | number | null;
257
261
  getCurrentPuppeteerTimeout: () => number;
258
- getQuality: () => number | undefined;
262
+ getJpegQuality: () => number | undefined;
259
263
  getAudioCodec: () => "mp3" | "aac" | "pcm-16" | "opus" | null;
260
264
  getStillFrame: () => number;
261
265
  getShouldOutputImageSequence: (frameRange: FrameRange | null) => boolean;
262
266
  getDotEnvLocation: () => string | null;
263
267
  getUserPreferredStillImageFormat: () => "png" | "jpeg" | "pdf" | "webp" | undefined;
264
- getUserPreferredVideoImageFormat: () => "none" | "png" | "jpeg" | undefined;
268
+ getUserPreferredVideoImageFormat: () => "png" | "jpeg" | "none" | undefined;
265
269
  getWebpackOverrideFn: () => WebpackOverrideFn;
266
270
  getWebpackCaching: () => boolean;
267
271
  getOutputLocation: () => string | null;
@@ -33,6 +33,7 @@ const env_file_1 = require("./env-file");
33
33
  const frame_range_1 = require("./frame-range");
34
34
  const image_format_1 = require("./image-format");
35
35
  const image_sequence_1 = require("./image-sequence");
36
+ const jpeg_quality_1 = require("./jpeg-quality");
36
37
  const Logging = __importStar(require("./log"));
37
38
  const max_timeline_tracks_1 = require("./max-timeline-tracks");
38
39
  const output_location_1 = require("./output-location");
@@ -41,7 +42,6 @@ const overwrite_1 = require("./overwrite");
41
42
  const pixel_format_1 = require("./pixel-format");
42
43
  const preview_server_1 = require("./preview-server");
43
44
  const prores_profile_1 = require("./prores-profile");
44
- const quality_1 = require("./quality");
45
45
  const scale_1 = require("./scale");
46
46
  const still_frame_1 = require("./still-frame");
47
47
  const timeout_1 = require("./timeout");
@@ -61,6 +61,7 @@ const ffmpeg_override_1 = require("./ffmpeg-override");
61
61
  const frame_range_2 = require("./frame-range");
62
62
  const height_1 = require("./height");
63
63
  const image_sequence_2 = require("./image-sequence");
64
+ const jpeg_quality_2 = require("./jpeg-quality");
64
65
  const keyboard_shortcuts_1 = require("./keyboard-shortcuts");
65
66
  const log_1 = require("./log");
66
67
  const max_timeline_tracks_2 = require("./max-timeline-tracks");
@@ -75,7 +76,6 @@ const pixel_format_2 = require("./pixel-format");
75
76
  const preview_server_2 = require("./preview-server");
76
77
  const prores_profile_2 = require("./prores-profile");
77
78
  const public_dir_1 = require("./public-dir");
78
- const quality_2 = require("./quality");
79
79
  const scale_2 = require("./scale");
80
80
  const timeout_2 = require("./timeout");
81
81
  const webpack_caching_2 = require("./webpack-caching");
@@ -102,7 +102,10 @@ exports.Config = {
102
102
  setChromiumOpenGlRenderer: chromium_flags_2.setChromiumOpenGlRenderer,
103
103
  setDotEnvLocation: env_file_2.setDotEnvLocation,
104
104
  setConcurrency: concurrency_2.setConcurrency,
105
- setQuality: quality_2.setQuality,
105
+ setQuality: () => {
106
+ throw new Error('setQuality() has been renamed - use setJpegQuality() instead.');
107
+ },
108
+ setJpegQuality: jpeg_quality_2.setJpegQuality,
106
109
  setStillImageFormat: image_format_1.setStillImageFormat,
107
110
  setVideoImageFormat: image_format_1.setVideoImageFormat,
108
111
  setFrameRange: frame_range_2.setFrameRange,
@@ -143,7 +146,7 @@ exports.ConfigInternals = {
143
146
  getEveryNthFrame: every_nth_frame_1.getEveryNthFrame,
144
147
  getConcurrency: concurrency_1.getConcurrency,
145
148
  getCurrentPuppeteerTimeout: timeout_1.getCurrentPuppeteerTimeout,
146
- getQuality: quality_1.getQuality,
149
+ getJpegQuality: jpeg_quality_1.getJpegQuality,
147
150
  getAudioCodec: audio_codec_1.getAudioCodec,
148
151
  getStillFrame: still_frame_1.getStillFrame,
149
152
  getShouldOutputImageSequence: image_sequence_1.getShouldOutputImageSequence,
@@ -0,0 +1,2 @@
1
+ export declare const setJpegQuality: (q: number | undefined) => void;
2
+ export declare const getJpegQuality: () => number | undefined;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getJpegQuality = exports.setJpegQuality = void 0;
4
+ const renderer_1 = require("@remotion/renderer");
5
+ const defaultValue = undefined;
6
+ let quality = defaultValue;
7
+ const setJpegQuality = (q) => {
8
+ renderer_1.RenderInternals.validateJpegQuality(q);
9
+ if (q === 0 || q === undefined) {
10
+ quality = defaultValue;
11
+ return;
12
+ }
13
+ quality = q;
14
+ };
15
+ exports.setJpegQuality = setJpegQuality;
16
+ const getJpegQuality = () => quality;
17
+ exports.getJpegQuality = getJpegQuality;
@@ -1,3 +1,3 @@
1
1
  import type { LogLevel } from '@remotion/renderer';
2
- export declare const getLogLevel: () => "error" | "verbose" | "info" | "warn";
2
+ export declare const getLogLevel: () => "verbose" | "info" | "warn" | "error";
3
3
  export declare const setLogLevel: (newLogLevel: LogLevel) => void;
@@ -37,10 +37,7 @@ const Canvas = () => {
37
37
  triggerOnWindowResize: false,
38
38
  shouldApplyCssTransforms: true,
39
39
  });
40
- const isFit = previewSize.size === 'auto' ||
41
- (previewSize.size === 1 &&
42
- previewSize.translation.x === 0 &&
43
- previewSize.translation.y === 0);
40
+ const isFit = previewSize.size === 'auto';
44
41
  const onWheel = (0, react_1.useCallback)((e) => {
45
42
  if (!editorZoomGestures) {
46
43
  return;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ export declare const CheckerboardProvider: React.FC<{
3
+ children: React.ReactNode;
4
+ }>;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CheckerboardProvider = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const checkerboard_1 = require("../state/checkerboard");
7
+ const CheckerboardProvider = ({ children }) => {
8
+ const [checkerboard, setCheckerboardState] = (0, react_1.useState)(() => (0, checkerboard_1.loadCheckerboardOption)());
9
+ const setCheckerboard = (0, react_1.useCallback)((newValue) => {
10
+ setCheckerboardState((prevState) => {
11
+ const newVal = newValue(prevState);
12
+ (0, checkerboard_1.persistCheckerboardOption)(newVal);
13
+ return newVal;
14
+ });
15
+ }, []);
16
+ const checkerboardCtx = (0, react_1.useMemo)(() => {
17
+ return {
18
+ checkerboard,
19
+ setCheckerboard,
20
+ };
21
+ }, [checkerboard, setCheckerboard]);
22
+ return ((0, jsx_runtime_1.jsx)(checkerboard_1.CheckerboardContext.Provider, { value: checkerboardCtx, children: children }));
23
+ };
24
+ exports.CheckerboardProvider = CheckerboardProvider;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ export declare const CollapsedCompositionSelector: React.FC<{
3
+ onExpand: () => void;
4
+ }>;
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CollapsedCompositionSelector = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const colors_1 = require("../helpers/colors");
7
+ const caret_1 = require("../icons/caret");
8
+ const z_index_1 = require("../state/z-index");
9
+ const CollapsedCompositionSelector = ({ onExpand }) => {
10
+ const [hovered, setHovered] = (0, react_1.useState)(false);
11
+ const { tabIndex } = (0, z_index_1.useZIndex)();
12
+ const onPointerEnter = (0, react_1.useCallback)(() => {
13
+ setHovered(true);
14
+ }, []);
15
+ const onPointerLeave = (0, react_1.useCallback)(() => {
16
+ setHovered(false);
17
+ }, []);
18
+ const style = (0, react_1.useMemo)(() => {
19
+ return {
20
+ border: 'none',
21
+ borderRight: '2px solid black',
22
+ cursor: 'pointer',
23
+ color: 'white',
24
+ display: 'flex',
25
+ justifyContent: 'center',
26
+ alignItems: 'center',
27
+ paddingLeft: 7,
28
+ paddingRight: 4,
29
+ backgroundColor: (0, colors_1.getBackgroundFromHoverState)({
30
+ hovered,
31
+ selected: false,
32
+ }),
33
+ appearance: 'none',
34
+ WebkitAppearance: 'none',
35
+ };
36
+ }, [hovered]);
37
+ return ((0, jsx_runtime_1.jsx)("button", { style: style, onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, type: "button", role: "button", tabIndex: tabIndex, onClick: onExpand, children: (0, jsx_runtime_1.jsx)(caret_1.CaretRight, {}) }));
38
+ };
39
+ exports.CollapsedCompositionSelector = CollapsedCompositionSelector;
@@ -2,84 +2,20 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.EditorContexts = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
- const player_1 = require("@remotion/player");
6
- const react_1 = require("react");
7
- const remotion_1 = require("remotion");
8
5
  const client_id_1 = require("../helpers/client-id");
9
- const checkerboard_1 = require("../state/checkerboard");
10
- const editor_zoom_gestures_1 = require("../state/editor-zoom-gestures");
11
6
  const folders_1 = require("../state/folders");
12
7
  const highest_z_index_1 = require("../state/highest-z-index");
13
- const in_out_1 = require("../state/in-out");
14
8
  const keybindings_1 = require("../state/keybindings");
15
- const modals_1 = require("../state/modals");
16
- const mute_1 = require("../state/mute");
17
9
  const preview_size_1 = require("../state/preview-size");
18
10
  const sidebar_1 = require("../state/sidebar");
11
+ const CheckerboardProvider_1 = require("./CheckerboardProvider");
12
+ const MediaVolumeProvider_1 = require("./MediaVolumeProvider");
13
+ const ModalsProvider_1 = require("./ModalsProvider");
14
+ const PlayerEmitterContext_1 = require("./PlayerEmitterContext");
19
15
  const context_1 = require("./RenderQueue/context");
16
+ const SetTimelineInOutProvider_1 = require("./SetTimelineInOutProvider");
17
+ const ZoomGesturesProvider_1 = require("./ZoomGesturesProvider");
20
18
  const EditorContexts = ({ children }) => {
21
- const [inAndOutFrames, setInAndOutFrames] = (0, react_1.useState)({
22
- inFrame: null,
23
- outFrame: null,
24
- });
25
- const timelineInOutContextValue = (0, react_1.useMemo)(() => {
26
- return inAndOutFrames;
27
- }, [inAndOutFrames]);
28
- const [emitter] = (0, react_1.useState)(() => new player_1.PlayerInternals.PlayerEmitter());
29
- const setTimelineInOutContextValue = (0, react_1.useMemo)(() => {
30
- return {
31
- setInAndOutFrames,
32
- };
33
- }, []);
34
- const [checkerboard, setCheckerboardState] = (0, react_1.useState)(() => (0, checkerboard_1.loadCheckerboardOption)());
35
- const setCheckerboard = (0, react_1.useCallback)((newValue) => {
36
- setCheckerboardState((prevState) => {
37
- const newVal = newValue(prevState);
38
- (0, checkerboard_1.persistCheckerboardOption)(newVal);
39
- return newVal;
40
- });
41
- }, []);
42
- const [editorZoomGestures, setEditorZoomGesturesState] = (0, react_1.useState)(() => (0, editor_zoom_gestures_1.loadEditorZoomGesturesOption)());
43
- const setEditorZoomGestures = (0, react_1.useCallback)((newValue) => {
44
- setEditorZoomGesturesState((prevState) => {
45
- const newVal = newValue(prevState);
46
- (0, editor_zoom_gestures_1.persistEditorZoomGesturesOption)(newVal);
47
- return newVal;
48
- });
49
- }, []);
50
- const [mediaMuted, setMediaMuted] = (0, react_1.useState)(() => (0, mute_1.loadMuteOption)());
51
- const [mediaVolume, setMediaVolume] = (0, react_1.useState)(1);
52
- const [modalContextType, setModalContextType] = (0, react_1.useState)(null);
53
- const checkerboardCtx = (0, react_1.useMemo)(() => {
54
- return {
55
- checkerboard,
56
- setCheckerboard,
57
- };
58
- }, [checkerboard, setCheckerboard]);
59
- const editorZoomGesturesCtx = (0, react_1.useMemo)(() => {
60
- return {
61
- editorZoomGestures,
62
- setEditorZoomGestures,
63
- };
64
- }, [editorZoomGestures, setEditorZoomGestures]);
65
- const mediaVolumeContextValue = (0, react_1.useMemo)(() => {
66
- return {
67
- mediaMuted,
68
- mediaVolume,
69
- };
70
- }, [mediaMuted, mediaVolume]);
71
- const setMediaVolumeContextValue = (0, react_1.useMemo)(() => {
72
- return {
73
- setMediaMuted,
74
- setMediaVolume,
75
- };
76
- }, []);
77
- const modalsContext = (0, react_1.useMemo)(() => {
78
- return {
79
- selectedModal: modalContextType,
80
- setSelectedModal: setModalContextType,
81
- };
82
- }, [modalContextType]);
83
- return ((0, jsx_runtime_1.jsx)(client_id_1.PreviewServerConnection, { children: (0, jsx_runtime_1.jsx)(context_1.RenderQueueContextProvider, { children: (0, jsx_runtime_1.jsx)(keybindings_1.KeybindingContextProvider, { children: (0, jsx_runtime_1.jsx)(checkerboard_1.CheckerboardContext.Provider, { value: checkerboardCtx, children: (0, jsx_runtime_1.jsx)(editor_zoom_gestures_1.EditorZoomGesturesContext.Provider, { value: editorZoomGesturesCtx, children: (0, jsx_runtime_1.jsx)(preview_size_1.PreviewSizeProvider, { children: (0, jsx_runtime_1.jsx)(modals_1.ModalsContext.Provider, { value: modalsContext, 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.jsx)(in_out_1.TimelineInOutContext.Provider, { value: timelineInOutContextValue, children: (0, jsx_runtime_1.jsx)(in_out_1.SetTimelineInOutContext.Provider, { value: setTimelineInOutContextValue, children: children }) }) }) }) }) }) }) }) }) }) }) }) }) }) }));
19
+ return ((0, jsx_runtime_1.jsx)(client_id_1.PreviewServerConnection, { children: (0, jsx_runtime_1.jsx)(context_1.RenderQueueContextProvider, { children: (0, jsx_runtime_1.jsx)(keybindings_1.KeybindingContextProvider, { children: (0, jsx_runtime_1.jsx)(CheckerboardProvider_1.CheckerboardProvider, { children: (0, jsx_runtime_1.jsx)(ZoomGesturesProvider_1.ZoomGesturesProvider, { children: (0, jsx_runtime_1.jsx)(preview_size_1.PreviewSizeProvider, { children: (0, jsx_runtime_1.jsx)(ModalsProvider_1.ModalsProvider, { children: (0, jsx_runtime_1.jsx)(MediaVolumeProvider_1.MediaVolumeProvider, { children: (0, jsx_runtime_1.jsx)(PlayerEmitterContext_1.PlayerEmitterContext, { 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.jsx)(SetTimelineInOutProvider_1.SetTimelineInOutProvider, { children: children }) }) }) }) }) }) }) }) }) }) }) }) }));
84
20
  };
85
21
  exports.EditorContexts = EditorContexts;
@@ -52,6 +52,6 @@ const li = {
52
52
  fontSize: 14,
53
53
  };
54
54
  const KeyboardShortcutsExplainer = () => {
55
- return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, use_keybinding_1.areKeyboardShortcutsDisabled)() ? ((0, jsx_runtime_1.jsxs)("div", { style: keyboardShortcutsDisabled, children: ["Keyboard shortcuts disabled either due to:", (0, jsx_runtime_1.jsxs)("ul", { style: ul, children: [(0, jsx_runtime_1.jsx)("li", { style: li, children: "a) --disable-keyboard-shortcuts being passed" }), (0, jsx_runtime_1.jsx)("li", { style: li, children: "b) Config.Preview.setKeyboardShortcutsEnabled(false) being set or" }), (0, jsx_runtime_1.jsx)("li", { style: li, children: " c) a Remotion version mismatch." })] })] })) : null, (0, jsx_runtime_1.jsxs)(layout_1.Row, { style: container, children: [(0, jsx_runtime_1.jsxs)(layout_1.Column, { children: [(0, jsx_runtime_1.jsx)("div", { style: title, children: "Playback" }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsxs)("div", { style: left, children: [(0, jsx_runtime_1.jsx)("kbd", { style: key, children: (0, jsx_runtime_1.jsx)(keys_1.ShiftIcon, {}) }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.3 }), (0, jsx_runtime_1.jsx)("kbd", { style: key, children: (0, jsx_runtime_1.jsx)(keys_1.ArrowLeft, {}) })] }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "1 second back" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: (0, jsx_runtime_1.jsx)(keys_1.ArrowLeft, {}) }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Previous frame" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "Space" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Play / Pause" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: (0, jsx_runtime_1.jsx)(keys_1.ArrowRight, {}) }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Next frame" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsxs)("div", { style: left, children: [(0, jsx_runtime_1.jsx)("kbd", { style: key, children: (0, jsx_runtime_1.jsx)(keys_1.ShiftIcon, {}) }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.3 }), (0, jsx_runtime_1.jsx)("kbd", { style: key, children: (0, jsx_runtime_1.jsx)(keys_1.ArrowRight, {}) })] }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "1 second forward" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "A" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Jump to beginning" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "E" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Jump to end" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "J" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Reverse playback" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "K" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Pause" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "L" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Play / Speed up" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "Enter" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Pause & return to playback start" })] }), (0, jsx_runtime_1.jsx)("br", {})] }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 8 }), (0, jsx_runtime_1.jsxs)(layout_1.Column, { children: [(0, jsx_runtime_1.jsx)("div", { style: title, children: "Navigation" }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "N" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "New composition" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "R" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Render composition" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "T" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Toggle checkerboard transparency" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "?" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Show keyboard shortcuts" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsxs)("div", { style: left, children: [(0, jsx_runtime_1.jsx)("kbd", { style: key, children: ShortcutHint_1.cmdOrCtrlCharacter }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.3 }), (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "K" })] }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Quick Switcher" })] }), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)("div", { style: title, children: "Playback range" }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "I" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Set In Point" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "O" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Set Out Point" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "X" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Clear In/Out Points" })] }), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)("div", { style: title, children: "Zoom" }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "+" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Zoom in" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "-" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Zoom out" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "0" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Reset zoom" })] })] })] })] }));
55
+ return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, use_keybinding_1.areKeyboardShortcutsDisabled)() ? ((0, jsx_runtime_1.jsxs)("div", { style: keyboardShortcutsDisabled, children: ["Keyboard shortcuts disabled either due to:", (0, jsx_runtime_1.jsxs)("ul", { style: ul, children: [(0, jsx_runtime_1.jsx)("li", { style: li, children: "a) --disable-keyboard-shortcuts being passed" }), (0, jsx_runtime_1.jsx)("li", { style: li, children: "b) Config.Preview.setKeyboardShortcutsEnabled(false) being set or" }), (0, jsx_runtime_1.jsx)("li", { style: li, children: " c) a Remotion version mismatch." })] })] })) : null, (0, jsx_runtime_1.jsxs)(layout_1.Row, { style: container, children: [(0, jsx_runtime_1.jsxs)(layout_1.Column, { children: [(0, jsx_runtime_1.jsx)("div", { style: title, children: "Playback" }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsxs)("div", { style: left, children: [(0, jsx_runtime_1.jsx)("kbd", { style: key, children: (0, jsx_runtime_1.jsx)(keys_1.ShiftIcon, {}) }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.3 }), (0, jsx_runtime_1.jsx)("kbd", { style: key, children: (0, jsx_runtime_1.jsx)(keys_1.ArrowLeft, {}) })] }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "1 second back" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: (0, jsx_runtime_1.jsx)(keys_1.ArrowLeft, {}) }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Previous frame" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "Space" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Play / Pause" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: (0, jsx_runtime_1.jsx)(keys_1.ArrowRight, {}) }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Next frame" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsxs)("div", { style: left, children: [(0, jsx_runtime_1.jsx)("kbd", { style: key, children: (0, jsx_runtime_1.jsx)(keys_1.ShiftIcon, {}) }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.3 }), (0, jsx_runtime_1.jsx)("kbd", { style: key, children: (0, jsx_runtime_1.jsx)(keys_1.ArrowRight, {}) })] }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "1 second forward" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "A" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Jump to beginning" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "E" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Jump to end" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "J" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Reverse playback" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "K" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Pause" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "L" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Play / Speed up" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "Enter" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Pause & return to playback start" })] }), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)("div", { style: title, children: "Sidebar" }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsxs)("div", { style: left, children: [(0, jsx_runtime_1.jsx)("kbd", { style: key, children: ShortcutHint_1.cmdOrCtrlCharacter }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.3 }), (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "B" })] }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Toggle left sidebar" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsxs)("div", { style: left, children: [(0, jsx_runtime_1.jsx)("kbd", { style: key, children: ShortcutHint_1.cmdOrCtrlCharacter }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.3 }), (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "J" })] }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Toggle right sidebar" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsxs)("div", { style: left, children: [(0, jsx_runtime_1.jsx)("kbd", { style: key, children: ShortcutHint_1.cmdOrCtrlCharacter }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.3 }), (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "G" })] }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Toggle both sidebars" })] }), (0, jsx_runtime_1.jsx)("br", {})] }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 8 }), (0, jsx_runtime_1.jsxs)(layout_1.Column, { children: [(0, jsx_runtime_1.jsx)("div", { style: title, children: "Navigation" }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "N" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "New composition" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "R" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Render composition" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "T" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Toggle checkerboard transparency" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "?" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Show keyboard shortcuts" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsxs)("div", { style: left, children: [(0, jsx_runtime_1.jsx)("kbd", { style: key, children: ShortcutHint_1.cmdOrCtrlCharacter }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.3 }), (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "K" })] }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Quick Switcher" })] }), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)("div", { style: title, children: "Playback range" }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "I" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Set In Point" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "O" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Set Out Point" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "X" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Clear In/Out Points" })] }), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)("div", { style: title, children: "Zoom" }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "+" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Zoom in" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "-" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Zoom out" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "0" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Reset zoom" })] })] })] })] }));
56
56
  };
57
57
  exports.KeyboardShortcutsExplainer = KeyboardShortcutsExplainer;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ export declare const MediaVolumeProvider: React.FC<{
3
+ children: React.ReactNode;
4
+ }>;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MediaVolumeProvider = 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 mute_1 = require("../state/mute");
8
+ const MediaVolumeProvider = ({ children }) => {
9
+ const [mediaMuted, setMediaMuted] = (0, react_1.useState)(() => (0, mute_1.loadMuteOption)());
10
+ const [mediaVolume, setMediaVolume] = (0, react_1.useState)(1);
11
+ const mediaVolumeContextValue = (0, react_1.useMemo)(() => {
12
+ return {
13
+ mediaMuted,
14
+ mediaVolume,
15
+ };
16
+ }, [mediaMuted, mediaVolume]);
17
+ const setMediaVolumeContextValue = (0, react_1.useMemo)(() => {
18
+ return {
19
+ setMediaMuted,
20
+ setMediaVolume,
21
+ };
22
+ }, []);
23
+ return ((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: children }) }));
24
+ };
25
+ exports.MediaVolumeProvider = MediaVolumeProvider;
@@ -27,6 +27,10 @@ const container = {
27
27
  exports.MENU_SUBMENU_BUTTON_CLASS_NAME = 'remotion-submenu-button';
28
28
  const labelStyle = {
29
29
  fontSize: 13,
30
+ overflow: 'hidden',
31
+ textOverflow: 'ellipsis',
32
+ whiteSpace: 'nowrap',
33
+ flex: 1,
30
34
  };
31
35
  const keyHintCss = {
32
36
  flexDirection: 'row',
@@ -86,7 +90,16 @@ const MenuSubItem = ({ label, leaveLeftSpace, leftItem, onActionChosen, id, sele
86
90
  }, 100);
87
91
  return () => clearTimeout(hi);
88
92
  }, [hovered, selected, setSubMenuActivated, subMenu]);
89
- return ((0, jsx_runtime_1.jsx)("div", { ref: ref, onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, style: style, onPointerUp: onItemTriggered, role: "button", className: is_menu_item_1.MENU_ITEM_CLASSNAME, children: (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [leaveLeftSpace ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { style: leftSpace, children: leftItem }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1 })] })) : null, (0, jsx_runtime_1.jsx)("div", { style: labelStyle, children: label }), " ", (0, jsx_runtime_1.jsx)(layout_1.Flex, {}), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 2 }), subMenu ? (0, jsx_runtime_1.jsx)(caret_1.CaretRight, {}) : null, keyHint && !(0, use_keybinding_1.areKeyboardShortcutsDisabled)() ? ((0, jsx_runtime_1.jsx)("span", { style: keyHintCss, children: keyHint })) : null, portalStyle && subMenu
93
+ (0, react_1.useEffect)(() => {
94
+ var _a;
95
+ if (selected) {
96
+ (_a = ref.current) === null || _a === void 0 ? void 0 : _a.scrollIntoView({
97
+ // block is vertical alignment, inline is horizontal alignment. So we use "block"
98
+ block: 'nearest',
99
+ });
100
+ }
101
+ }, [selected]);
102
+ return ((0, jsx_runtime_1.jsx)("div", { ref: ref, onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, style: style, onPointerUp: onItemTriggered, role: "button", className: is_menu_item_1.MENU_ITEM_CLASSNAME, children: (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [leaveLeftSpace ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { style: leftSpace, children: leftItem }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1 })] })) : null, (0, jsx_runtime_1.jsx)("div", { style: labelStyle, ...{ title: typeof label === 'string' ? label : undefined }, children: label }), ' ', (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 2 }), subMenu ? (0, jsx_runtime_1.jsx)(caret_1.CaretRight, {}) : null, keyHint && !(0, use_keybinding_1.areKeyboardShortcutsDisabled)() ? ((0, jsx_runtime_1.jsx)("span", { style: keyHintCss, children: keyHint })) : null, portalStyle && subMenu
90
103
  ? react_dom_1.default.createPortal((0, jsx_runtime_1.jsx)(SubMenu_1.SubMenuComponent, { onQuitFullMenu: onQuitMenu, subMenu: subMenu, onQuitSubMenu: onQuitSubmenu, portalStyle: portalStyle, subMenuActivated: subMenuActivated }), (0, portals_1.getPortal)(currentZIndex))
91
104
  : null] }) }));
92
105
  };
@@ -1,8 +1,10 @@
1
1
  import type React from 'react';
2
2
  export declare const MENU_VERTICAL_PADDING = 4;
3
3
  export declare const SUBMENU_LEFT_INSET = -8;
4
+ export declare const MAX_MENU_WIDTH = 400;
4
5
  export declare const SHADOW_TOWARDS_BOTTOM = "0 2px 8px rgba(0, 0, 0, 0.5)";
5
6
  export declare const SHADOW_TOWARDS_TOP = "0 -2px 8px rgba(0, 0, 0, 0.5)";
6
7
  export declare const menuContainerTowardsBottom: React.CSSProperties;
7
8
  export declare const menuContainerTowardsTop: React.CSSProperties;
9
+ export declare const fullScreenOverlay: React.CSSProperties;
8
10
  export declare const outerPortal: React.CSSProperties;
@@ -1,15 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.outerPortal = exports.menuContainerTowardsTop = exports.menuContainerTowardsBottom = exports.SHADOW_TOWARDS_TOP = exports.SHADOW_TOWARDS_BOTTOM = exports.SUBMENU_LEFT_INSET = exports.MENU_VERTICAL_PADDING = void 0;
3
+ exports.outerPortal = exports.fullScreenOverlay = exports.menuContainerTowardsTop = exports.menuContainerTowardsBottom = exports.SHADOW_TOWARDS_TOP = exports.SHADOW_TOWARDS_BOTTOM = exports.MAX_MENU_WIDTH = exports.SUBMENU_LEFT_INSET = exports.MENU_VERTICAL_PADDING = void 0;
4
4
  const colors_1 = require("../../helpers/colors");
5
5
  exports.MENU_VERTICAL_PADDING = 4;
6
6
  exports.SUBMENU_LEFT_INSET = -8;
7
+ exports.MAX_MENU_WIDTH = 400;
7
8
  const menuContainer = {
8
9
  backgroundColor: colors_1.BACKGROUND,
9
10
  position: 'fixed',
10
11
  color: 'white',
11
12
  userSelect: 'none',
12
- minWidth: 200,
13
13
  };
14
14
  exports.SHADOW_TOWARDS_BOTTOM = '0 2px 8px rgba(0, 0, 0, 0.5)';
15
15
  exports.SHADOW_TOWARDS_TOP = '0 -2px 8px rgba(0, 0, 0, 0.5)';
@@ -21,6 +21,13 @@ exports.menuContainerTowardsTop = {
21
21
  ...menuContainer,
22
22
  boxShadow: exports.SHADOW_TOWARDS_TOP,
23
23
  };
24
+ exports.fullScreenOverlay = {
25
+ position: 'fixed',
26
+ top: 0,
27
+ left: 0,
28
+ right: 0,
29
+ bottom: 0,
30
+ };
24
31
  exports.outerPortal = {
25
32
  position: 'fixed',
26
33
  };
@@ -8,6 +8,7 @@ const use_menu_structure_1 = require("../helpers/use-menu-structure");
8
8
  const layout_1 = require("./layout");
9
9
  const MenuItem_1 = require("./Menu/MenuItem");
10
10
  const MenuBuildIndicator_1 = require("./MenuBuildIndicator");
11
+ const SidebarCollapserControls_1 = require("./SidebarCollapserControls");
11
12
  const UpdateCheck_1 = require("./UpdateCheck");
12
13
  const row = {
13
14
  alignItems: 'center',
@@ -64,6 +65,6 @@ const MenuToolbar = () => {
64
65
  }, [setSelected]);
65
66
  return ((0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", className: "css-reset", style: row, children: [structure.map((s) => {
66
67
  return ((0, jsx_runtime_1.jsx)(MenuItem_1.MenuItem, { selected: selected === s.id, onItemSelected: itemClicked, onItemHovered: itemHovered, id: s.id, label: s.label, onItemQuit: onItemQuit, menu: s, onPreviousMenu: onPreviousMenu, onNextMenu: onNextMenu, leaveLeftPadding: s.leaveLeftPadding }, s.id));
67
- }), (0, jsx_runtime_1.jsx)(UpdateCheck_1.UpdateCheck, {}), (0, jsx_runtime_1.jsx)("div", { style: flex }), (0, jsx_runtime_1.jsx)(MenuBuildIndicator_1.MenuBuildIndicator, {})] }));
68
+ }), (0, jsx_runtime_1.jsx)(UpdateCheck_1.UpdateCheck, {}), (0, jsx_runtime_1.jsx)("div", { style: flex }), (0, jsx_runtime_1.jsx)(MenuBuildIndicator_1.MenuBuildIndicator, {}), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1 }), (0, jsx_runtime_1.jsx)(SidebarCollapserControls_1.SidebarCollapserControls, {})] }));
68
69
  };
69
70
  exports.MenuToolbar = MenuToolbar;