@remotion/cli 4.1.0-alpha1 → 4.1.0-alpha11

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 (108) hide show
  1. package/dist/benchmark.js +16 -7
  2. package/dist/chalk/index.d.ts +2 -1
  3. package/dist/codemods/stringify-with-path.js +24 -19
  4. package/dist/compositions.js +9 -4
  5. package/dist/config/index.d.ts +24 -0
  6. package/dist/config/index.js +19 -1
  7. package/dist/editor/components/Canvas.js +4 -4
  8. package/dist/editor/components/CanvasOrLoading.js +20 -1
  9. package/dist/editor/components/CopyButton.js +5 -2
  10. package/dist/editor/components/Editor.js +1 -3
  11. package/dist/editor/components/FramePersistor.d.ts +0 -2
  12. package/dist/editor/components/FramePersistor.js +4 -24
  13. package/dist/editor/components/FullscreenToggle.d.ts +2 -0
  14. package/dist/editor/components/FullscreenToggle.js +25 -0
  15. package/dist/editor/components/GlobalKeybindings.js +1 -1
  16. package/dist/editor/components/InitialCompositionLoader.js +1 -22
  17. package/dist/editor/components/KeyboardShortcutsExplainer.js +1 -1
  18. package/dist/editor/components/NewComposition/InputDragger.js +13 -1
  19. package/dist/editor/components/NewComposition/RemInput.d.ts +2 -2
  20. package/dist/editor/components/NewComposition/RemInputTypeColor.d.ts +1 -1
  21. package/dist/editor/components/NewComposition/RemTextarea.d.ts +1 -1
  22. package/dist/editor/components/OpenEditorButton.js +5 -2
  23. package/dist/editor/components/PlayPause.js +4 -4
  24. package/dist/editor/components/PlaybackRateSelector.js +1 -1
  25. package/dist/editor/components/PreviewToolbar.js +3 -1
  26. package/dist/editor/components/QuickSwitcher/QuickSwitcherResult.js +3 -3
  27. package/dist/editor/components/RenderModal/DataEditor.d.ts +2 -0
  28. package/dist/editor/components/RenderModal/DataEditor.js +13 -10
  29. package/dist/editor/components/RenderModal/FrameRangeSetting.js +9 -25
  30. package/dist/editor/components/RenderModal/MultiRangeSlider.d.ts +12 -0
  31. package/dist/editor/components/RenderModal/MultiRangeSlider.js +50 -0
  32. package/dist/editor/components/RenderModal/RenderModal.js +7 -3
  33. package/dist/editor/components/RenderModal/RenderModalBasic.d.ts +2 -3
  34. package/dist/editor/components/RenderModal/RenderModalJSONPropsEditor.d.ts +1 -2
  35. package/dist/editor/components/RenderModal/RenderModalJSONPropsEditor.js +10 -11
  36. package/dist/editor/components/RenderModal/SchemaEditor/SchemaEditor.d.ts +2 -2
  37. package/dist/editor/components/RenderModal/SchemaEditor/SchemaEditor.js +26 -0
  38. package/dist/editor/components/RenderModal/SchemaEditor/SchemaErrorMessages.js +1 -3
  39. package/dist/editor/components/RenderModal/SchemaEditor/SchemaLabel.js +1 -2
  40. package/dist/editor/components/RenderModal/SchemaEditor/SchemaSaveButton.js +2 -1
  41. package/dist/editor/components/RenderModal/SchemaEditor/ZodArrayEditor.js +7 -7
  42. package/dist/editor/components/RenderModal/SchemaEditor/ZodBooleanEditor.d.ts +1 -1
  43. package/dist/editor/components/RenderModal/SchemaEditor/ZodBooleanEditor.js +1 -1
  44. package/dist/editor/components/RenderModal/SchemaEditor/ZodColorEditor.js +1 -1
  45. package/dist/editor/components/RenderModal/SchemaEditor/ZodDateEditor.js +1 -1
  46. package/dist/editor/components/RenderModal/SchemaEditor/ZodEffectEditor.js +2 -2
  47. package/dist/editor/components/RenderModal/SchemaEditor/ZodEnumEditor.js +1 -1
  48. package/dist/editor/components/RenderModal/SchemaEditor/ZodFieldValidation.js +1 -1
  49. package/dist/editor/components/RenderModal/SchemaEditor/ZodNonEditableValue.js +1 -1
  50. package/dist/editor/components/RenderModal/SchemaEditor/ZodNumberEditor.js +1 -1
  51. package/dist/editor/components/RenderModal/SchemaEditor/ZodObjectEditor.js +29 -10
  52. package/dist/editor/components/RenderModal/SchemaEditor/ZodOrNullishEditor.js +2 -2
  53. package/dist/editor/components/RenderModal/SchemaEditor/ZodStaticFileEditor.js +1 -1
  54. package/dist/editor/components/RenderModal/SchemaEditor/ZodStringEditor.js +1 -1
  55. package/dist/editor/components/RenderModal/SchemaEditor/ZodSwitch.js +0 -1
  56. package/dist/editor/components/RenderModal/SchemaEditor/local-state.js +9 -3
  57. package/dist/editor/components/RenderModal/human-readable-codec.d.ts +1 -1
  58. package/dist/editor/components/RenderQueue/actions.d.ts +1 -1
  59. package/dist/editor/components/RenderQueue/actions.js +12 -4
  60. package/dist/editor/components/RightPanel.js +45 -12
  61. package/dist/editor/components/SetTimelineInOutProvider.js +5 -4
  62. package/dist/editor/components/SidebarRenderButton.js +3 -1
  63. package/dist/editor/components/Timeline/TimelineDragHandler.js +45 -19
  64. package/dist/editor/components/TimelineInOutToggle.d.ts +2 -1
  65. package/dist/editor/components/TimelineInOutToggle.js +82 -67
  66. package/dist/editor/helpers/colors.d.ts +1 -1
  67. package/dist/editor/helpers/is-composition-still.d.ts +1 -1
  68. package/dist/editor/helpers/is-current-selected-still.js +5 -6
  69. package/dist/editor/helpers/use-menu-structure.js +25 -1
  70. package/dist/editor/icons/keys.js +1 -0
  71. package/dist/editor/state/canvas-ref.d.ts +2 -0
  72. package/dist/editor/state/canvas-ref.js +5 -0
  73. package/dist/editor/state/in-out.d.ts +3 -2
  74. package/dist/editor/state/in-out.js +22 -5
  75. package/dist/editor/state/marks.d.ts +3 -2
  76. package/dist/editor/state/marks.js +6 -6
  77. package/dist/get-composition-id.d.ts +6 -6
  78. package/dist/get-composition-id.js +13 -6
  79. package/dist/get-composition-with-dimension-override.d.ts +6 -6
  80. package/dist/get-composition-with-dimension-override.js +3 -3
  81. package/dist/handle-common-errors.js +8 -0
  82. package/dist/index.d.ts +13 -7
  83. package/dist/index.js +5 -2
  84. package/dist/log.d.ts +6 -1
  85. package/dist/parse-command-line.js +1 -1
  86. package/dist/preview-server/dev-middleware/range-parser.d.ts +1 -1
  87. package/dist/preview-server/dev-middleware/setup-hooks.js +1 -1
  88. package/dist/preview-server/render-queue/job.d.ts +2 -2
  89. package/dist/preview-server/render-queue/make-retry-payload.js +3 -2
  90. package/dist/preview-server/render-queue/open-directory-in-finder.js +11 -5
  91. package/dist/preview-server/render-queue/process-still.js +1 -1
  92. package/dist/preview-server/render-queue/process-video.js +1 -1
  93. package/dist/preview-server/routes/add-render.js +2 -2
  94. package/dist/preview-server/routes/update-default-props.js +1 -2
  95. package/dist/print-compositions.d.ts +2 -2
  96. package/dist/print-error.js +6 -3
  97. package/dist/progress-bar.js +2 -5
  98. package/dist/render-flows/render.d.ts +2 -2
  99. package/dist/render-flows/render.js +31 -22
  100. package/dist/render-flows/still.d.ts +2 -2
  101. package/dist/render-flows/still.js +20 -14
  102. package/dist/render.js +6 -1
  103. package/dist/setup-cache.js +1 -1
  104. package/dist/still.js +6 -1
  105. package/package.json +11 -11
  106. package/styles/styles.css +53 -0
  107. package/dist/editor/components/RenderModal/SchemaEditor/input-props-serialization.d.ts +0 -14
  108. package/dist/editor/components/RenderModal/SchemaEditor/input-props-serialization.js +0 -42
package/dist/benchmark.js CHANGED
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.benchmarkCommand = void 0;
4
4
  const renderer_1 = require("@remotion/renderer");
5
+ const remotion_1 = require("remotion");
5
6
  const chalk_1 = require("./chalk");
6
7
  const cleanup_before_quit_1 = require("./cleanup-before-quit");
7
8
  const config_1 = require("./config");
@@ -103,11 +104,11 @@ const benchmarkCommand = async (remotionRoot, args) => {
103
104
  const browserInstance = renderer_1.RenderInternals.internalOpenBrowser({
104
105
  browser,
105
106
  browserExecutable,
106
- shouldDumpIo: renderer_1.RenderInternals.isEqualOrBelowLogLevel(config_1.ConfigInternals.Logging.getLogLevel(), 'verbose'),
107
107
  chromiumOptions,
108
108
  forceDeviceScaleFactor: scale,
109
109
  indent: false,
110
110
  viewport: null,
111
+ logLevel,
111
112
  });
112
113
  const { urlOrBundle: bundleLocation, cleanup: cleanupBundle } = await (0, setup_cache_1.bundleOnCliOrTakeServeUrl)({
113
114
  fullPath: fullEntryPoint,
@@ -125,10 +126,14 @@ const benchmarkCommand = async (remotionRoot, args) => {
125
126
  });
126
127
  (0, cleanup_before_quit_1.registerCleanupJob)(() => cleanupBundle());
127
128
  const puppeteerInstance = await browserInstance;
128
- const verbose = renderer_1.RenderInternals.isEqualOrBelowLogLevel(config_1.ConfigInternals.Logging.getLogLevel(), 'verbose');
129
+ const serializedInputPropsWithCustomSchema = remotion_1.Internals.serializeJSONWithDate({
130
+ data: inputProps !== null && inputProps !== void 0 ? inputProps : {},
131
+ indent: undefined,
132
+ staticBase: null,
133
+ }).serializedString;
129
134
  const comps = await renderer_1.RenderInternals.internalGetCompositions({
130
135
  serveUrlOrWebpackUrl: bundleLocation,
131
- inputProps,
136
+ serializedInputPropsWithCustomSchema,
132
137
  envVariables,
133
138
  chromiumOptions,
134
139
  timeoutInMilliseconds: puppeteerTimeout,
@@ -139,7 +144,7 @@ const benchmarkCommand = async (remotionRoot, args) => {
139
144
  onBrowserLog: null,
140
145
  // Intentionally disabling server to not cache results
141
146
  server: undefined,
142
- verbose,
147
+ logLevel,
143
148
  });
144
149
  const ids = (remainingArgs[0]
145
150
  ? remainingArgs[0]
@@ -192,19 +197,18 @@ const benchmarkCommand = async (remotionRoot, args) => {
192
197
  codec,
193
198
  uiImageFormat: null,
194
199
  }),
195
- inputProps,
200
+ serializedInputPropsWithCustomSchema,
196
201
  overwrite,
197
202
  pixelFormat,
198
203
  proResProfile,
199
204
  jpegQuality,
200
- dumpBrowserLogs: verbose,
201
205
  chromiumOptions,
202
206
  timeoutInMilliseconds: config_1.ConfigInternals.getCurrentPuppeteerTimeout(),
203
207
  scale: configFileScale,
204
208
  port,
205
209
  numberOfGifLoops,
206
210
  everyNthFrame,
207
- verbose,
211
+ logLevel,
208
212
  muted,
209
213
  enforceAudioTrack,
210
214
  browserExecutable,
@@ -225,6 +229,11 @@ const benchmarkCommand = async (remotionRoot, args) => {
225
229
  onStart: () => undefined,
226
230
  preferLossless: false,
227
231
  server: undefined,
232
+ serializedResolvedPropsWithCustomSchema: remotion_1.Internals.serializeJSONWithDate({
233
+ data: composition.props,
234
+ indent: undefined,
235
+ staticBase: null,
236
+ }).serializedString,
228
237
  }, (run, progress) => {
229
238
  benchmarkProgress.update(makeBenchmarkProgressBar({
230
239
  totalRuns: runs,
@@ -1,5 +1,5 @@
1
1
  export declare const chalk: {
2
- enabled: boolean;
2
+ enabled: () => boolean;
3
3
  visible: boolean;
4
4
  styles: Record<string, {
5
5
  codes: [number, number];
@@ -23,6 +23,7 @@ export declare const chalk: {
23
23
  yellow: (str: string) => string;
24
24
  blue: (str: string) => string;
25
25
  magenta: (str: string) => string;
26
+ cyan: (str: string) => string;
26
27
  white: (str: string) => string;
27
28
  gray: (str: string) => string;
28
29
  bgBlack: (str: string) => string;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.stringifyDefaultProps = void 0;
4
- const input_props_serialization_1 = require("../editor/components/RenderModal/SchemaEditor/input-props-serialization");
4
+ const remotion_1 = require("remotion");
5
5
  const doesMatchPath = (path1, enumPaths) => {
6
6
  return enumPaths.some((p) => path1.every((item, index) => {
7
7
  if (p[index] === '[]' && !Number.isNaN(Number(item))) {
@@ -13,24 +13,29 @@ const doesMatchPath = (path1, enumPaths) => {
13
13
  return item === p[index];
14
14
  }));
15
15
  };
16
- const stringifyDefaultProps = ({ props, enumPaths, }) => JSON.stringify(props, replacerWithPath(function (key, value, path) {
17
- /* Don't replace with arrow function */ const item = this[key];
18
- if (item instanceof Date) {
19
- return `__REMOVEQUOTE__new Date('${item.toISOString()}')__REMOVEQUOTE__`;
20
- }
21
- if (typeof item === 'string' && doesMatchPath(path, enumPaths)) {
22
- return `${item}__ADD_AS_CONST__`;
23
- }
24
- if (typeof item === 'string' && item.startsWith(input_props_serialization_1.FILE_TOKEN)) {
25
- return `__REMOVEQUOTE____WRAP_IN_STATIC_FILE_START__${decodeURIComponent(item.replace(input_props_serialization_1.FILE_TOKEN, ''))}__WRAP_IN_STATIC_FILE_END____REMOVEQUOTE__`;
26
- }
27
- return value;
28
- }))
29
- .replace(/"__REMOVEQUOTE__/g, '')
30
- .replace(/__REMOVEQUOTE__"/g, '')
31
- .replace(/__ADD_AS_CONST__"/g, '" as const')
32
- .replace(/__WRAP_IN_STATIC_FILE_START__/g, 'staticFile("')
33
- .replace(/__WRAP_IN_STATIC_FILE_END__/g, '")');
16
+ const stringifyDefaultProps = ({ props, enumPaths, }) => {
17
+ return JSON.stringify(props, replacerWithPath(function (key, value, path) {
18
+ /* Don't replace with arrow function! This function uses `this` */
19
+ const item = this[key];
20
+ if (typeof item === 'string' && doesMatchPath(path, enumPaths)) {
21
+ return `${item}__ADD_AS_CONST__`;
22
+ }
23
+ if (typeof item === 'string' && item.startsWith(remotion_1.Internals.FILE_TOKEN)) {
24
+ return `__REMOVEQUOTE____WRAP_IN_STATIC_FILE_START__${decodeURIComponent(item.replace(remotion_1.Internals.FILE_TOKEN, ''))}__WRAP_IN_STATIC_FILE_END____REMOVEQUOTE__`;
25
+ }
26
+ if (typeof item === 'string' && item.startsWith(remotion_1.Internals.DATE_TOKEN)) {
27
+ return `__REMOVEQUOTE____WRAP_IN_DATE_START__${decodeURIComponent(item.replace(remotion_1.Internals.DATE_TOKEN, ''))}__WRAP_IN_DATE_END____REMOVEQUOTE__`;
28
+ }
29
+ return value;
30
+ }))
31
+ .replace(/"__REMOVEQUOTE__/g, '')
32
+ .replace(/__REMOVEQUOTE__"/g, '')
33
+ .replace(/__ADD_AS_CONST__"/g, '" as const')
34
+ .replace(/__WRAP_IN_STATIC_FILE_START__/g, 'staticFile("')
35
+ .replace(/__WRAP_IN_STATIC_FILE_END__/g, '")')
36
+ .replace(/__WRAP_IN_DATE_START__/g, 'new Date("')
37
+ .replace(/__WRAP_IN_DATE_END__/g, '")');
38
+ };
34
39
  exports.stringifyDefaultProps = stringifyDefaultProps;
35
40
  function replacerWithPath(replacer) {
36
41
  const m = new Map();
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.listCompositionsCommand = void 0;
4
4
  const renderer_1 = require("@remotion/renderer");
5
+ const remotion_1 = require("remotion");
5
6
  const cleanup_before_quit_1 = require("./cleanup-before-quit");
6
7
  const config_1 = require("./config");
7
8
  const entry_point_1 = require("./entry-point");
@@ -17,7 +18,7 @@ const listCompositionsCommand = async (remotionRoot, args) => {
17
18
  log_1.Log.error('See https://www.remotion.dev/docs/register-root for more information.');
18
19
  process.exit(1);
19
20
  }
20
- const verbose = renderer_1.RenderInternals.isEqualOrBelowLogLevel(config_1.ConfigInternals.Logging.getLogLevel(), 'verbose');
21
+ const logLevel = config_1.ConfigInternals.Logging.getLogLevel();
21
22
  log_1.Log.verbose('Entry point:', file, 'reason:', reason);
22
23
  const { browserExecutable, chromiumOptions, envVariables, inputProps, puppeteerTimeout, port, publicDir, } = await (0, get_cli_options_1.getCliOptions)({
23
24
  isLambda: false,
@@ -30,7 +31,7 @@ const listCompositionsCommand = async (remotionRoot, args) => {
30
31
  publicDir,
31
32
  onProgress: () => undefined,
32
33
  indentOutput: false,
33
- logLevel: config_1.ConfigInternals.Logging.getLogLevel(),
34
+ logLevel,
34
35
  bundlingStep: 0,
35
36
  steps: 1,
36
37
  onDirectoryCreated: (dir) => {
@@ -44,13 +45,17 @@ const listCompositionsCommand = async (remotionRoot, args) => {
44
45
  browserExecutable,
45
46
  chromiumOptions,
46
47
  envVariables,
47
- inputProps,
48
+ serializedInputPropsWithCustomSchema: remotion_1.Internals.serializeJSONWithDate({
49
+ data: inputProps,
50
+ staticBase: null,
51
+ indent: undefined,
52
+ }).serializedString,
48
53
  timeoutInMilliseconds: puppeteerTimeout,
49
54
  port,
50
55
  indent: false,
51
56
  onBrowserLog: null,
52
57
  puppeteerInstance: undefined,
53
- verbose,
58
+ logLevel,
54
59
  server: undefined,
55
60
  });
56
61
  (0, print_compositions_1.printCompositions)(compositions);
@@ -245,6 +245,30 @@ type FlatConfig = RemotionConfigObject & RemotionBundlingOptions & {
245
245
  * See the Encoding guide in the docs for defaults and available options.
246
246
  */
247
247
  setAudioCodec: (codec: 'pcm-16' | 'aac' | 'mp3' | 'opus') => void;
248
+ /**
249
+ * @deprecated 'The config format has changed. Change `Config.Bundling.*()` calls to `Config.*()` in your config file.'
250
+ */
251
+ Bundling: void;
252
+ /**
253
+ * @deprecated 'The config format has changed. Change `Config.Preview.*()` calls to `Config.*()` in your config file.'
254
+ */
255
+ Preview: void;
256
+ /**
257
+ * @deprecated 'The config format has changed. Change `Config.Log.*()` calls to `Config.*()` in your config file.'
258
+ */
259
+ Log: void;
260
+ /**
261
+ * @deprecated 'The config format has changed. Change `Config.Puppeteer.*()` calls to `Config.*()` in your config file.'
262
+ */
263
+ Puppeteer: void;
264
+ /**
265
+ * @deprecated 'The config format has changed. Change `Config.Rendering.*()` calls to `Config.*()` in your config file.'
266
+ */
267
+ Rendering: void;
268
+ /**
269
+ * @deprecated 'The config format has changed. Change `Config.Output.*()` calls to `Config.*()` in your config file.'
270
+ */
271
+ Output: void;
248
272
  };
249
273
  export declare const Config: FlatConfig;
250
274
  export type { Concurrency, WebpackConfiguration, WebpackOverrideFn };
@@ -83,6 +83,24 @@ const webpack_caching_2 = require("./webpack-caching");
83
83
  const webpack_poll_1 = require("./webpack-poll");
84
84
  const width_1 = require("./width");
85
85
  exports.Config = {
86
+ get Bundling() {
87
+ throw new Error('The config format has changed. Change `Config.Bundling.*()` calls to `Config.*()` in your config file.');
88
+ },
89
+ get Rendering() {
90
+ throw new Error('The config format has changed. Change `Config.Rendering.*()` calls to `Config.*()` in your config file.');
91
+ },
92
+ get Output() {
93
+ throw new Error('The config format has changed. Change `Config.Output.*()` calls to `Config.*()` in your config file.');
94
+ },
95
+ get Log() {
96
+ throw new Error('The config format has changed. Change `Config.Log.*()` calls to `Config.*()` in your config file.');
97
+ },
98
+ get Preview() {
99
+ throw new Error('The config format has changed. Change `Config.Preview.*()` calls to `Config.*()` in your config file.');
100
+ },
101
+ get Puppeteer() {
102
+ throw new Error('The config format has changed. Change `Config.Puppeteer.*()` calls to `Config.*()` in your config file.');
103
+ },
86
104
  setMaxTimelineTracks: max_timeline_tracks_2.setMaxTimelineTracks,
87
105
  setKeyboardShortcutsEnabled: keyboard_shortcuts_1.setKeyboardShortcutsEnabled,
88
106
  setNumberOfSharedAudioTags: number_of_shared_audio_tags_1.setNumberOfSharedAudioTags,
@@ -108,7 +126,7 @@ exports.Config = {
108
126
  throw new Error('setQuality() has been renamed - use setJpegQuality() instead.');
109
127
  },
110
128
  setImageFormat: () => {
111
- throw new Error('setImageFormat() has been renamed - use setVideoImageFormat() or setStillImageFormat() instead.');
129
+ throw new Error('Config.setImageFormat() has been renamed - use Config.setVideoImageFormat() instead (default "jpeg"). For rendering stills, use Config.setStillImageFormat() (default "png")');
112
130
  },
113
131
  setJpegQuality: jpeg_quality_2.setJpegQuality,
114
132
  setStillImageFormat: image_format_1.setStillImageFormat,
@@ -9,6 +9,7 @@ const colors_1 = require("../helpers/colors");
9
9
  const get_effective_translation_1 = require("../helpers/get-effective-translation");
10
10
  const is_current_selected_still_1 = require("../helpers/is-current-selected-still");
11
11
  const use_keybinding_1 = require("../helpers/use-keybinding");
12
+ const canvas_ref_1 = require("../state/canvas-ref");
12
13
  const editor_zoom_gestures_1 = require("../state/editor-zoom-gestures");
13
14
  const preview_size_1 = require("../state/preview-size");
14
15
  const layout_1 = require("./layout");
@@ -29,11 +30,10 @@ const resetZoom = {
29
30
  const ZOOM_PX_FACTOR = 0.003;
30
31
  const Canvas = () => {
31
32
  const dimensions = (0, is_current_selected_still_1.useDimensions)();
32
- const ref = (0, react_1.useRef)(null);
33
33
  const { setSize, size: previewSize } = (0, react_1.useContext)(preview_size_1.PreviewSizeContext);
34
34
  const { editorZoomGestures } = (0, react_1.useContext)(editor_zoom_gestures_1.EditorZoomGesturesContext);
35
35
  const keybindings = (0, use_keybinding_1.useKeybinding)();
36
- const size = player_1.PlayerInternals.useElementSize(ref, {
36
+ const size = player_1.PlayerInternals.useElementSize(canvas_ref_1.canvasRef, {
37
37
  triggerOnWindowResize: false,
38
38
  shouldApplyCssTransforms: true,
39
39
  });
@@ -120,7 +120,7 @@ const Canvas = () => {
120
120
  });
121
121
  }, [editorZoomGestures, dimensions, isFit, setSize, size]);
122
122
  (0, react_1.useEffect)(() => {
123
- const { current } = ref;
123
+ const { current } = canvas_ref_1.canvasRef;
124
124
  if (!current) {
125
125
  return;
126
126
  }
@@ -219,6 +219,6 @@ const Canvas = () => {
219
219
  zoomOut.unregister();
220
220
  };
221
221
  }, [keybindings, onReset, onZoomIn, onZoomOut]);
222
- return ((0, jsx_runtime_1.jsxs)("div", { ref: ref, style: container, children: [size ? (0, jsx_runtime_1.jsx)(Preview_1.VideoPreview, { canvasSize: size }) : null, isFit ? null : ((0, jsx_runtime_1.jsx)("div", { style: resetZoom, className: "css-reset", children: (0, jsx_runtime_1.jsx)(ResetZoomButton_1.ResetZoomButton, { onClick: onReset }) }))] }));
222
+ return ((0, jsx_runtime_1.jsxs)("div", { ref: canvas_ref_1.canvasRef, style: container, children: [size ? (0, jsx_runtime_1.jsx)(Preview_1.VideoPreview, { canvasSize: size }) : null, isFit ? null : ((0, jsx_runtime_1.jsx)("div", { style: resetZoom, className: "css-reset", children: (0, jsx_runtime_1.jsx)(ResetZoomButton_1.ResetZoomButton, { onClick: onReset }) }))] }));
223
223
  };
224
224
  exports.Canvas = Canvas;
@@ -6,10 +6,15 @@ const react_1 = require("react");
6
6
  const remotion_1 = require("remotion");
7
7
  const ErrorLoader_1 = require("../../preview-server/error-overlay/remotion-overlay/ErrorLoader");
8
8
  const colors_1 = require("../helpers/colors");
9
+ const timeline_zoom_1 = require("../state/timeline-zoom");
9
10
  const Canvas_1 = require("./Canvas");
11
+ const FramePersistor_1 = require("./FramePersistor");
10
12
  const layout_1 = require("./layout");
11
13
  const styles_1 = require("./Menu/styles");
12
14
  const Spinner_1 = require("./Spinner");
15
+ const imperative_state_1 = require("./Timeline/imperative-state");
16
+ const timeline_scroll_logic_1 = require("./Timeline/timeline-scroll-logic");
17
+ const ZoomPersistor_1 = require("./ZoomPersistor");
13
18
  const container = {
14
19
  color: 'white',
15
20
  flex: 1,
@@ -22,6 +27,7 @@ const container = {
22
27
  const CanvasOrLoading = () => {
23
28
  const resolved = remotion_1.Internals.useResolvedVideoConfig(null);
24
29
  const [takesALongTime, setTakesALongTime] = (0, react_1.useState)(false);
30
+ const { setZoom } = (0, react_1.useContext)(timeline_zoom_1.TimelineZoomCtx);
25
31
  (0, react_1.useEffect)(() => {
26
32
  const timeout = setTimeout(() => {
27
33
  setTakesALongTime(true);
@@ -30,6 +36,19 @@ const CanvasOrLoading = () => {
30
36
  clearTimeout(timeout);
31
37
  };
32
38
  }, []);
39
+ (0, react_1.useEffect)(() => {
40
+ if ((resolved === null || resolved === void 0 ? void 0 : resolved.type) !== 'success') {
41
+ return;
42
+ }
43
+ const c = resolved.result;
44
+ setTimeout(() => {
45
+ (0, timeline_scroll_logic_1.ensureFrameIsInViewport)({
46
+ direction: 'center',
47
+ frame: (0, imperative_state_1.getCurrentFrame)(),
48
+ durationInFrames: c.durationInFrames,
49
+ });
50
+ });
51
+ }, [resolved, setZoom]);
33
52
  const style = (0, react_1.useMemo)(() => {
34
53
  return {
35
54
  ...loaderLabel,
@@ -46,7 +65,7 @@ const CanvasOrLoading = () => {
46
65
  if (resolved.type === 'error') {
47
66
  return (0, jsx_runtime_1.jsx)(exports.ErrorLoading, { error: resolved.error });
48
67
  }
49
- return (0, jsx_runtime_1.jsx)(Canvas_1.Canvas, {});
68
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(FramePersistor_1.FramePersistor, {}), (0, jsx_runtime_1.jsx)(ZoomPersistor_1.ZoomPersistor, {}), (0, jsx_runtime_1.jsx)(Canvas_1.Canvas, {})] }));
50
69
  };
51
70
  exports.CanvasOrLoading = CanvasOrLoading;
52
71
  const loaderLabel = {
@@ -10,7 +10,10 @@ const iconStyle = {
10
10
  width: 16,
11
11
  height: 16,
12
12
  color: 'white',
13
- verticalAlign: 'sub',
13
+ };
14
+ const buttonContainerStyle = {
15
+ display: 'flex',
16
+ minWidth: '114px',
14
17
  };
15
18
  const copyIcon = ((0, jsx_runtime_1.jsx)("svg", { "aria-hidden": "true", focusable: "false", "data-prefix": "far", "data-icon": "clipboard", className: "svg-inline--fa fa-clipboard fa-w-12", role: "img", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 384 512", style: iconStyle, children: (0, jsx_runtime_1.jsx)("path", { fill: "currentColor", d: "M336 64h-80c0-35.3-28.7-64-64-64s-64 28.7-64 64H48C21.5 64 0 85.5 0 112v352c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V112c0-26.5-21.5-48-48-48zM192 40c13.3 0 24 10.7 24 24s-10.7 24-24 24-24-10.7-24-24 10.7-24 24-24zm144 418c0 3.3-2.7 6-6 6H54c-3.3 0-6-2.7-6-6V118c0-3.3 2.7-6 6-6h42v36c0 6.6 5.4 12 12 12h168c6.6 0 12-5.4 12-12v-36h42c3.3 0 6 2.7 6 6z" }) }));
16
19
  const labelStyle = {
@@ -29,6 +32,6 @@ const CopyButton = ({ textToCopy, label, labelWhenCopied }) => {
29
32
  const to = setTimeout(() => setCopied(false), 2000);
30
33
  return () => clearTimeout(to);
31
34
  }, [copied]);
32
- return ((0, jsx_runtime_1.jsxs)(Button_1.Button, { onClick: onClick, children: [copyIcon, (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1.5 }), ' ', (0, jsx_runtime_1.jsx)("span", { style: labelStyle, children: copied ? labelWhenCopied : label })] }));
35
+ return ((0, jsx_runtime_1.jsxs)(Button_1.Button, { onClick: onClick, style: {}, buttonContainerStyle: buttonContainerStyle, children: [copyIcon, (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1.5 }), ' ', (0, jsx_runtime_1.jsx)("span", { style: labelStyle, children: copied ? labelWhenCopied : label })] }));
33
36
  };
34
37
  exports.CopyButton = CopyButton;
@@ -9,12 +9,10 @@ const noop_1 = require("../helpers/noop");
9
9
  const timeline_zoom_1 = require("../state/timeline-zoom");
10
10
  const z_index_1 = require("../state/z-index");
11
11
  const EditorContent_1 = require("./EditorContent");
12
- const FramePersistor_1 = require("./FramePersistor");
13
12
  const GlobalKeybindings_1 = require("./GlobalKeybindings");
14
13
  const Modals_1 = require("./Modals");
15
14
  const NoRegisterRoot_1 = require("./NoRegisterRoot");
16
15
  const NotificationCenter_1 = require("./Notifications/NotificationCenter");
17
- const ZoomPersistor_1 = require("./ZoomPersistor");
18
16
  const background = {
19
17
  backgroundColor: colors_1.BACKGROUND,
20
18
  display: 'flex',
@@ -41,6 +39,6 @@ const Editor = () => {
41
39
  });
42
40
  return () => cleanup();
43
41
  }, [Root, waitForRoot]);
44
- return ((0, jsx_runtime_1.jsx)(z_index_1.HigherZIndex, { onEscape: noop_1.noop, onOutsideClick: noop_1.noop, children: (0, jsx_runtime_1.jsxs)(timeline_zoom_1.TimelineZoomContext, { children: [(0, jsx_runtime_1.jsxs)("div", { style: background, children: [Root === null ? null : (0, jsx_runtime_1.jsx)(Root, {}), (0, jsx_runtime_1.jsxs)(remotion_1.Internals.CanUseRemotionHooksProvider, { children: [(0, jsx_runtime_1.jsx)(FramePersistor_1.FramePersistor, {}), (0, jsx_runtime_1.jsx)(ZoomPersistor_1.ZoomPersistor, {}), Root === null ? (0, jsx_runtime_1.jsx)(NoRegisterRoot_1.NoRegisterRoot, {}) : (0, jsx_runtime_1.jsx)(EditorContent_1.EditorContent, {}), (0, jsx_runtime_1.jsx)(GlobalKeybindings_1.GlobalKeybindings, {})] }), (0, jsx_runtime_1.jsx)(NotificationCenter_1.NotificationCenter, {})] }), (0, jsx_runtime_1.jsx)(Modals_1.Modals, {})] }) }));
42
+ return ((0, jsx_runtime_1.jsx)(z_index_1.HigherZIndex, { onEscape: noop_1.noop, onOutsideClick: noop_1.noop, children: (0, jsx_runtime_1.jsxs)(timeline_zoom_1.TimelineZoomContext, { children: [(0, jsx_runtime_1.jsxs)("div", { style: background, children: [Root === null ? null : (0, jsx_runtime_1.jsx)(Root, {}), (0, jsx_runtime_1.jsxs)(remotion_1.Internals.CanUseRemotionHooksProvider, { children: [Root === null ? (0, jsx_runtime_1.jsx)(NoRegisterRoot_1.NoRegisterRoot, {}) : (0, jsx_runtime_1.jsx)(EditorContent_1.EditorContent, {}), (0, jsx_runtime_1.jsx)(GlobalKeybindings_1.GlobalKeybindings, {})] }), (0, jsx_runtime_1.jsx)(NotificationCenter_1.NotificationCenter, {})] }), (0, jsx_runtime_1.jsx)(Modals_1.Modals, {})] }) }));
45
43
  };
46
44
  exports.Editor = Editor;
@@ -1,5 +1,3 @@
1
1
  import type React from 'react';
2
2
  export declare const getCurrentCompositionFromUrl: () => string;
3
- export declare const persistCurrentFrame: (frame: number) => void;
4
- export declare const getFrameForComposition: (composition: string) => number;
5
3
  export declare const FramePersistor: React.FC;
@@ -1,41 +1,21 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FramePersistor = exports.getFrameForComposition = exports.persistCurrentFrame = exports.getCurrentCompositionFromUrl = void 0;
3
+ exports.FramePersistor = exports.getCurrentCompositionFromUrl = void 0;
4
4
  const react_1 = require("react");
5
5
  const remotion_1 = require("remotion");
6
6
  const getCurrentCompositionFromUrl = () => {
7
7
  return window.location.pathname.substr(1);
8
8
  };
9
9
  exports.getCurrentCompositionFromUrl = getCurrentCompositionFromUrl;
10
- const makeKey = (composition) => {
11
- return `remotion.time.${composition}`;
12
- };
13
- const persistCurrentFrame = (frame) => {
14
- const currentComposition = (0, exports.getCurrentCompositionFromUrl)();
15
- if (!currentComposition) {
16
- return;
17
- }
18
- localStorage.setItem(makeKey(currentComposition), String(frame));
19
- };
20
- exports.persistCurrentFrame = persistCurrentFrame;
21
- const getFrameForComposition = (composition) => {
22
- const frame = localStorage.getItem(makeKey(composition));
23
- return frame ? Number(frame) : 0;
24
- };
25
- exports.getFrameForComposition = getFrameForComposition;
26
10
  const FramePersistor = () => {
27
11
  const [playing] = remotion_1.Internals.Timeline.usePlayingState();
12
+ const config = (0, remotion_1.useVideoConfig)();
28
13
  const frame = remotion_1.Internals.Timeline.useTimelinePosition();
29
- const { currentComposition } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
30
- const isActive = currentComposition === (0, exports.getCurrentCompositionFromUrl)();
31
14
  (0, react_1.useEffect)(() => {
32
- if (!isActive) {
33
- return;
34
- }
35
15
  if (!playing) {
36
- (0, exports.persistCurrentFrame)(frame);
16
+ remotion_1.Internals.persistCurrentFrame(frame, config.id);
37
17
  }
38
- }, [frame, isActive, playing]);
18
+ }, [config.id, frame, playing]);
39
19
  return null;
40
20
  };
41
21
  exports.FramePersistor = FramePersistor;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const FullScreenToggle: React.FC<{}>;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FullScreenToggle = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const canvas_ref_1 = require("../state/canvas-ref");
7
+ const preview_size_1 = require("../state/preview-size");
8
+ const ControlButton_1 = require("./ControlButton");
9
+ const FullScreenToggle = () => {
10
+ const { setSize } = (0, react_1.useContext)(preview_size_1.PreviewSizeContext);
11
+ const onClick = (0, react_1.useCallback)(() => {
12
+ var _a;
13
+ (_a = canvas_ref_1.canvasRef.current) === null || _a === void 0 ? void 0 : _a.requestFullscreen();
14
+ if (document.fullscreenElement)
15
+ setSize(() => ({
16
+ size: 'auto',
17
+ translation: {
18
+ x: 0,
19
+ y: 0,
20
+ },
21
+ }));
22
+ }, [setSize]);
23
+ return ((0, jsx_runtime_1.jsx)(ControlButton_1.ControlButton, { title: "Enter fullscreen preview", "aria-label": "Enter fullscreen preview", onClick: onClick, children: (0, jsx_runtime_1.jsx)("svg", { style: { width: 18, height: 18 }, viewBox: "0 0 448 512", fill: "#fff", children: (0, jsx_runtime_1.jsx)("path", { d: "M0 180V56c0-13.3 10.7-24 24-24h124c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12H64v84c0 6.6-5.4 12-12 12H12c-6.6 0-12-5.4-12-12zM288 44v40c0 6.6 5.4 12 12 12h84v84c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12V56c0-13.3-10.7-24-24-24H300c-6.6 0-12 5.4-12 12zm148 276h-40c-6.6 0-12 5.4-12 12v84h-84c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h124c13.3 0 24-10.7 24-24V332c0-6.6-5.4-12-12-12zM160 468v-40c0-6.6-5.4-12-12-12H64v-84c0-6.6-5.4-12-12-12H12c-6.6 0-12 5.4-12 12v124c0 13.3 10.7 24 24 24h124c6.6 0 12-5.4 12-12z" }) }) }));
24
+ };
25
+ exports.FullScreenToggle = FullScreenToggle;
@@ -43,7 +43,7 @@ const GlobalKeybindings = () => {
43
43
  callback: () => {
44
44
  setCheckerboard((c) => !c);
45
45
  },
46
- commandCtrlKey: true,
46
+ commandCtrlKey: false,
47
47
  preventDefault: true,
48
48
  triggerIfInputFieldFocused: false,
49
49
  });
@@ -4,37 +4,16 @@ exports.InitialCompositionLoader = exports.useSelectComposition = void 0;
4
4
  const react_1 = require("react");
5
5
  const remotion_1 = require("remotion");
6
6
  const folders_1 = require("../state/folders");
7
- const marks_1 = require("../state/marks");
8
- const timeline_zoom_1 = require("../state/timeline-zoom");
9
7
  const CompositionSelector_1 = require("./CompositionSelector");
10
8
  const FramePersistor_1 = require("./FramePersistor");
11
- const timeline_scroll_logic_1 = require("./Timeline/timeline-scroll-logic");
12
- const TimelineInOutToggle_1 = require("./TimelineInOutToggle");
13
- const ZoomPersistor_1 = require("./ZoomPersistor");
14
9
  const useSelectComposition = () => {
15
- const setCurrentFrame = remotion_1.Internals.Timeline.useTimelineSetFrame();
16
- const { setCurrentComposition } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
17
10
  const { setFoldersExpanded } = (0, react_1.useContext)(folders_1.FolderContext);
18
- const { setZoom } = (0, react_1.useContext)(timeline_zoom_1.TimelineZoomCtx);
11
+ const { setCurrentComposition } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
19
12
  return (c, push) => {
20
- var _a;
21
- (_a = TimelineInOutToggle_1.inOutHandles.current) === null || _a === void 0 ? void 0 : _a.setMarks((0, marks_1.loadMarks)(c.id, c.durationInFrames));
22
13
  if (push) {
23
14
  window.history.pushState({}, 'Studio', `/${c.id}`);
24
15
  }
25
- const frame = (0, FramePersistor_1.getFrameForComposition)(c.id);
26
- const zoom = (0, ZoomPersistor_1.getZoomForComposition)(c.id);
27
- const frameInBounds = Math.min(c.durationInFrames - 1, frame);
28
- setCurrentFrame(frameInBounds);
29
16
  setCurrentComposition(c.id);
30
- setZoom(() => zoom);
31
- setTimeout(() => {
32
- (0, timeline_scroll_logic_1.ensureFrameIsInViewport)({
33
- direction: 'center',
34
- frame,
35
- durationInFrames: c.durationInFrames,
36
- });
37
- });
38
17
  const { folderName, parentFolderName } = c;
39
18
  if (folderName !== null) {
40
19
  setFoldersExpanded((ex) => {
@@ -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.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" })] })] })] })] }));
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.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" })] }), ' ', (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)("div", { style: title, children: "Props Editor" }), (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: "S" })] }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Save" })] })] })] })] }));
56
56
  };
57
57
  exports.KeyboardShortcutsExplainer = KeyboardShortcutsExplainer;
@@ -9,6 +9,9 @@ const noop_1 = require("../../helpers/noop");
9
9
  const input_dragger_click_lock_1 = require("../../state/input-dragger-click-lock");
10
10
  const z_index_1 = require("../../state/z-index");
11
11
  const RemInput_1 = require("./RemInput");
12
+ const isInt = (num) => {
13
+ return num % 1 === 0;
14
+ };
12
15
  const InputDragger = ({ onValueChange, min: _min, max: _max, step: _step, value, onTextChange, formatter = (q) => String(q), status, rightAlign, ...props }) => {
13
16
  const [inputFallback, setInputFallback] = (0, react_1.useState)(false);
14
17
  const fallbackRef = (0, react_1.useRef)(null);
@@ -99,8 +102,17 @@ const InputDragger = ({ onValueChange, min: _min, max: _max, step: _step, value,
99
102
  (_a = fallbackRef.current) === null || _a === void 0 ? void 0 : _a.select();
100
103
  }
101
104
  }, [inputFallback]);
105
+ const deriveStep = (0, react_1.useMemo)(() => {
106
+ if (_step !== undefined) {
107
+ return _step;
108
+ }
109
+ if (typeof _min === 'number' && isInt(_min)) {
110
+ return 1;
111
+ }
112
+ return 0.0001;
113
+ }, [_min, _step]);
102
114
  if (inputFallback) {
103
- return ((0, jsx_runtime_1.jsx)(z_index_1.HigherZIndex, { onEscape: onEscape, onOutsideClick: noop_1.noop, children: (0, jsx_runtime_1.jsx)(RemInput_1.RemotionInput, { ref: fallbackRef, autoFocus: true, onKeyPress: onKeyPress, onBlur: onBlur, min: _min, step: _step, defaultValue: value, status: status, pattern: '[0-9]*[.]?[0-9]*', rightAlign: rightAlign, ...props }) }));
115
+ return ((0, jsx_runtime_1.jsx)(z_index_1.HigherZIndex, { onEscape: onEscape, onOutsideClick: noop_1.noop, children: (0, jsx_runtime_1.jsx)(RemInput_1.RemotionInput, { ref: fallbackRef, autoFocus: true, onKeyPress: onKeyPress, onBlur: onBlur, min: _min, max: _max, step: deriveStep, defaultValue: value, status: status, pattern: '[0-9]*[.]?[0-9]*', rightAlign: rightAlign, ...props }) }));
104
116
  }
105
117
  return ((0, jsx_runtime_1.jsx)("button", { type: "button", style: style, onClick: onClick, onPointerDown: onPointerDown, children: (0, jsx_runtime_1.jsx)("span", { style: span, children: formatter(value) }) }));
106
118
  };
@@ -12,6 +12,6 @@ export declare const getInputBorderColor: ({ status, isFocused, isHovered, }: {
12
12
  status: 'error' | 'warning' | 'ok';
13
13
  isFocused: boolean;
14
14
  isHovered: boolean;
15
- }) => "hsla(0, 0%, 100%, 0.15)" | "rgba(0, 0, 0, 0.6)" | "rgba(255, 255, 255, 0.05)" | "#ff3232" | "#f1c40f";
16
- export declare const RemotionInput: React.ForwardRefExoticComponent<Pick<Props, "status" | "key" | "rightAlign" | keyof React.InputHTMLAttributes<HTMLInputElement>> & React.RefAttributes<HTMLInputElement>>;
15
+ }) => "#ff3232" | "hsla(0, 0%, 100%, 0.15)" | "rgba(0, 0, 0, 0.6)" | "rgba(255, 255, 255, 0.05)" | "#f1c40f";
16
+ export declare const RemotionInput: React.ForwardRefExoticComponent<Pick<Props, "key" | "status" | "rightAlign" | keyof React.InputHTMLAttributes<HTMLInputElement>> & React.RefAttributes<HTMLInputElement>>;
17
17
  export {};