@remotion/cli 4.1.0-alpha1 → 4.1.0-alpha10

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 (125) 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/AssetSelector.d.ts +2 -0
  8. package/dist/editor/components/AssetSelector.js +30 -0
  9. package/dist/editor/components/AssetSelectorItem.d.ts +6 -0
  10. package/dist/editor/components/AssetSelectorItem.js +109 -0
  11. package/dist/editor/components/Canvas.js +4 -4
  12. package/dist/editor/components/CanvasOrLoading.js +20 -1
  13. package/dist/editor/components/CopyButton.js +5 -2
  14. package/dist/editor/components/Editor.js +1 -3
  15. package/dist/editor/components/ExplorerPanel.d.ts +8 -0
  16. package/dist/editor/components/ExplorerPanel.js +67 -0
  17. package/dist/editor/components/FramePersistor.d.ts +0 -2
  18. package/dist/editor/components/FramePersistor.js +4 -24
  19. package/dist/editor/components/FullscreenToggle.d.ts +2 -0
  20. package/dist/editor/components/FullscreenToggle.js +25 -0
  21. package/dist/editor/components/GlobalKeybindings.js +1 -1
  22. package/dist/editor/components/InitialCompositionLoader.js +1 -22
  23. package/dist/editor/components/KeyboardShortcutsExplainer.js +1 -1
  24. package/dist/editor/components/NewComposition/InputDragger.js +13 -1
  25. package/dist/editor/components/NewComposition/RemInput.d.ts +1 -1
  26. package/dist/editor/components/NewComposition/RemInputTypeColor.d.ts +1 -1
  27. package/dist/editor/components/NewComposition/RemTextarea.d.ts +1 -1
  28. package/dist/editor/components/OpenEditorButton.js +5 -2
  29. package/dist/editor/components/OptionsPanel.d.ts +8 -0
  30. package/dist/editor/components/OptionsPanel.js +79 -0
  31. package/dist/editor/components/PlayPause.js +4 -4
  32. package/dist/editor/components/PlaybackRateSelector.js +1 -1
  33. package/dist/editor/components/PreviewToolbar.js +3 -1
  34. package/dist/editor/components/QuickSwitcher/QuickSwitcherResult.js +3 -3
  35. package/dist/editor/components/RenderModal/DataEditor.d.ts +2 -0
  36. package/dist/editor/components/RenderModal/DataEditor.js +13 -10
  37. package/dist/editor/components/RenderModal/FrameRangeSetting.js +9 -25
  38. package/dist/editor/components/RenderModal/MultiRangeSlider.d.ts +12 -0
  39. package/dist/editor/components/RenderModal/MultiRangeSlider.js +50 -0
  40. package/dist/editor/components/RenderModal/RenderModal.js +7 -3
  41. package/dist/editor/components/RenderModal/RenderModalBasic.d.ts +2 -3
  42. package/dist/editor/components/RenderModal/RenderModalJSONPropsEditor.d.ts +1 -2
  43. package/dist/editor/components/RenderModal/RenderModalJSONPropsEditor.js +10 -11
  44. package/dist/editor/components/RenderModal/SchemaEditor/SchemaEditor.d.ts +2 -2
  45. package/dist/editor/components/RenderModal/SchemaEditor/SchemaEditor.js +26 -0
  46. package/dist/editor/components/RenderModal/SchemaEditor/SchemaErrorMessages.js +1 -3
  47. package/dist/editor/components/RenderModal/SchemaEditor/SchemaLabel.js +1 -2
  48. package/dist/editor/components/RenderModal/SchemaEditor/SchemaSaveButton.js +2 -1
  49. package/dist/editor/components/RenderModal/SchemaEditor/ZodArrayEditor.js +7 -7
  50. package/dist/editor/components/RenderModal/SchemaEditor/ZodBooleanEditor.d.ts +1 -1
  51. package/dist/editor/components/RenderModal/SchemaEditor/ZodBooleanEditor.js +1 -1
  52. package/dist/editor/components/RenderModal/SchemaEditor/ZodColorEditor.js +1 -1
  53. package/dist/editor/components/RenderModal/SchemaEditor/ZodDateEditor.js +1 -1
  54. package/dist/editor/components/RenderModal/SchemaEditor/ZodEffectEditor.js +2 -2
  55. package/dist/editor/components/RenderModal/SchemaEditor/ZodEnumEditor.js +1 -1
  56. package/dist/editor/components/RenderModal/SchemaEditor/ZodFieldValidation.js +1 -1
  57. package/dist/editor/components/RenderModal/SchemaEditor/ZodNonEditableValue.js +1 -1
  58. package/dist/editor/components/RenderModal/SchemaEditor/ZodNumberEditor.js +1 -1
  59. package/dist/editor/components/RenderModal/SchemaEditor/ZodObjectEditor.js +29 -10
  60. package/dist/editor/components/RenderModal/SchemaEditor/ZodOrNullishEditor.js +2 -2
  61. package/dist/editor/components/RenderModal/SchemaEditor/ZodStaticFileEditor.js +1 -1
  62. package/dist/editor/components/RenderModal/SchemaEditor/ZodStringEditor.js +1 -1
  63. package/dist/editor/components/RenderModal/SchemaEditor/ZodSwitch.js +0 -1
  64. package/dist/editor/components/RenderModal/SchemaEditor/local-state.js +9 -3
  65. package/dist/editor/components/RenderModal/human-readable-codec.d.ts +1 -1
  66. package/dist/editor/components/RenderQueue/actions.d.ts +1 -1
  67. package/dist/editor/components/RenderQueue/actions.js +12 -4
  68. package/dist/editor/components/RightPanel.js +45 -12
  69. package/dist/editor/components/SetTimelineInOutProvider.js +5 -4
  70. package/dist/editor/components/SidebarRenderButton.js +3 -1
  71. package/dist/editor/components/Timeline/TimelineDragHandler.js +45 -19
  72. package/dist/editor/components/TimelineInOutToggle.d.ts +2 -1
  73. package/dist/editor/components/TimelineInOutToggle.js +82 -67
  74. package/dist/editor/helpers/is-composition-still.d.ts +1 -1
  75. package/dist/editor/helpers/is-current-selected-still.js +5 -6
  76. package/dist/editor/helpers/use-menu-structure.js +25 -1
  77. package/dist/editor/icons/keys.js +1 -0
  78. package/dist/editor/state/canvas-ref.d.ts +2 -0
  79. package/dist/editor/state/canvas-ref.js +5 -0
  80. package/dist/editor/state/in-out.d.ts +3 -2
  81. package/dist/editor/state/in-out.js +22 -5
  82. package/dist/editor/state/marks.d.ts +3 -2
  83. package/dist/editor/state/marks.js +6 -6
  84. package/dist/error-with-stack-frame.d.ts +19 -0
  85. package/dist/error-with-stack-frame.js +81 -0
  86. package/dist/get-composition-id.d.ts +6 -6
  87. package/dist/get-composition-id.js +13 -6
  88. package/dist/get-composition-with-dimension-override.d.ts +6 -6
  89. package/dist/get-composition-with-dimension-override.js +3 -3
  90. package/dist/handle-common-errors.js +8 -0
  91. package/dist/handle-javascript-error.d.ts +20 -0
  92. package/dist/handle-javascript-error.js +81 -0
  93. package/dist/index.d.ts +13 -7
  94. package/dist/index.js +5 -2
  95. package/dist/log.d.ts +6 -1
  96. package/dist/parse-command-line.js +1 -1
  97. package/dist/preview-server/dev-middleware/range-parser.d.ts +1 -1
  98. package/dist/preview-server/dev-middleware/setup-hooks.js +1 -1
  99. package/dist/preview-server/render-queue/job.d.ts +2 -2
  100. package/dist/preview-server/render-queue/make-retry-payload.js +3 -2
  101. package/dist/preview-server/render-queue/open-directory-in-finder.js +11 -5
  102. package/dist/preview-server/render-queue/process-still.js +1 -1
  103. package/dist/preview-server/render-queue/process-video.js +1 -1
  104. package/dist/preview-server/routes/add-render.js +2 -2
  105. package/dist/preview-server/routes/update-default-props.js +1 -2
  106. package/dist/print-compositions.d.ts +2 -2
  107. package/dist/print-error.js +6 -3
  108. package/dist/progress-bar.js +2 -5
  109. package/dist/render-flows/render.d.ts +2 -2
  110. package/dist/render-flows/render.js +31 -22
  111. package/dist/render-flows/still.d.ts +2 -2
  112. package/dist/render-flows/still.js +20 -14
  113. package/dist/render.js +6 -1
  114. package/dist/setup-cache.js +1 -1
  115. package/dist/still.js +6 -1
  116. package/dist/symbolicate-error.d.ts +3 -0
  117. package/dist/symbolicate-error.js +24 -0
  118. package/dist/symbolicate-errors.d.ts +7 -0
  119. package/dist/symbolicate-errors.js +90 -0
  120. package/dist/symbolicate-stacktrace.d.ts +28 -0
  121. package/dist/symbolicate-stacktrace.js +135 -0
  122. package/dist/symbolicateable-error.d.ts +16 -0
  123. package/dist/symbolicateable-error.js +18 -0
  124. package/package.json +11 -11
  125. package/styles/styles.css +53 -0
@@ -4,8 +4,10 @@ exports.RightPanel = exports.rightSidebarTabs = exports.persistSelectedPanel = v
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const remotion_1 = require("remotion");
7
+ const ShortcutHint_1 = require("../../preview-server/error-overlay/remotion-overlay/ShortcutHint");
7
8
  const colors_1 = require("../helpers/colors");
8
9
  const DataEditor_1 = require("./RenderModal/DataEditor");
10
+ const deep_equal_1 = require("./RenderModal/SchemaEditor/deep-equal");
9
11
  const RenderQueue_1 = require("./RenderQueue");
10
12
  const RendersTab_1 = require("./RendersTab");
11
13
  const Tabs_1 = require("./Tabs");
@@ -16,17 +18,10 @@ const container = {
16
18
  display: 'flex',
17
19
  flexDirection: 'column',
18
20
  };
19
- const PropsEditor = ({ composition }) => {
20
- const { props, updateProps } = (0, react_1.useContext)(remotion_1.Internals.EditorPropsContext);
21
- const setInputProps = (0, react_1.useCallback)((newProps) => {
22
- updateProps({
23
- id: composition.id,
24
- defaultProps: composition.defaultProps,
25
- newProps,
26
- });
27
- }, [composition.defaultProps, composition.id, updateProps]);
28
- const actualProps = (0, react_1.useMemo)(() => { var _a, _b; return (_b = (_a = props[composition.id]) !== null && _a !== void 0 ? _a : composition.defaultProps) !== null && _b !== void 0 ? _b : {}; }, [composition.defaultProps, composition.id, props]);
29
- return ((0, jsx_runtime_1.jsx)(DataEditor_1.DataEditor, { unresolvedComposition: composition, inputProps: actualProps, setInputProps: setInputProps, mayShowSaveButton: true, propsEditType: "default-props" }, composition.id));
21
+ const circle = {
22
+ width: 8,
23
+ height: 8,
24
+ borderRadius: 4,
30
25
  };
31
26
  const localStorageKey = 'remotion.sidebarPanel';
32
27
  const getSelectedPanel = () => {
@@ -45,6 +40,8 @@ const persistSelectedPanel = (panel) => {
45
40
  exports.persistSelectedPanel = persistSelectedPanel;
46
41
  exports.rightSidebarTabs = (0, react_1.createRef)();
47
42
  const RightPanel = () => {
43
+ const { props, updateProps } = (0, react_1.useContext)(remotion_1.Internals.EditorPropsContext);
44
+ const [saving, setSaving] = (0, react_1.useState)(false);
48
45
  const [panel, setPanel] = (0, react_1.useState)(() => getSelectedPanel());
49
46
  const onCompositionsSelected = (0, react_1.useCallback)(() => {
50
47
  setPanel('input-props');
@@ -63,6 +60,14 @@ const RightPanel = () => {
63
60
  };
64
61
  }, []);
65
62
  const { compositions, currentComposition } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
63
+ const circleStyle = (0, react_1.useMemo)(() => {
64
+ const onTabColor = saving ? colors_1.LIGHT_TEXT : 'white';
65
+ return {
66
+ ...circle,
67
+ backgroundColor: panel === 'input-props' ? onTabColor : colors_1.LIGHT_TEXT,
68
+ cursor: 'help',
69
+ };
70
+ }, [panel, saving]);
66
71
  const composition = (0, react_1.useMemo)(() => {
67
72
  for (const comp of compositions) {
68
73
  if (comp.id === currentComposition) {
@@ -71,9 +76,37 @@ const RightPanel = () => {
71
76
  }
72
77
  return null;
73
78
  }, [compositions, currentComposition]);
79
+ const saveToolTip = (0, react_1.useMemo)(() => {
80
+ return process.env.KEYBOARD_SHORTCUTS_ENABLED
81
+ ? `Save using ${ShortcutHint_1.cmdOrCtrlCharacter}+S`
82
+ : 'There are unsaved changes';
83
+ }, []);
84
+ const setInputProps = (0, react_1.useCallback)((newProps) => {
85
+ if (composition === null) {
86
+ return;
87
+ }
88
+ updateProps({
89
+ id: composition.id,
90
+ defaultProps: composition.defaultProps,
91
+ newProps,
92
+ });
93
+ }, [composition, updateProps]);
94
+ const actualProps = (0, react_1.useMemo)(() => {
95
+ var _a, _b;
96
+ if (composition === null) {
97
+ return {};
98
+ }
99
+ return (_b = (_a = props[composition.id]) !== null && _a !== void 0 ? _a : composition.defaultProps) !== null && _b !== void 0 ? _b : {};
100
+ }, [composition, props]);
101
+ const unsavedChangesExist = (0, react_1.useMemo)(() => {
102
+ if (composition === null || composition.defaultProps === undefined) {
103
+ return false;
104
+ }
105
+ return !(0, deep_equal_1.deepEqual)(composition.defaultProps, actualProps);
106
+ }, [actualProps, composition]);
74
107
  if (composition === null) {
75
108
  return null;
76
109
  }
77
- return ((0, jsx_runtime_1.jsxs)("div", { style: container, className: "css-reset", children: [(0, jsx_runtime_1.jsx)("div", { style: tabsContainer, children: (0, jsx_runtime_1.jsxs)(Tabs_1.Tabs, { children: [(0, jsx_runtime_1.jsx)(Tabs_1.Tab, { selected: panel === 'input-props', onClick: onCompositionsSelected, children: "Props" }), (0, jsx_runtime_1.jsx)(RendersTab_1.RendersTab, { onClick: onRendersSelected, selected: panel === 'renders' })] }) }), panel === 'renders' ? ((0, jsx_runtime_1.jsx)(RenderQueue_1.RenderQueue, {})) : ((0, jsx_runtime_1.jsx)(PropsEditor, { composition: composition }))] }));
110
+ return ((0, jsx_runtime_1.jsxs)("div", { style: container, className: "css-reset", children: [(0, jsx_runtime_1.jsx)("div", { style: tabsContainer, children: (0, jsx_runtime_1.jsxs)(Tabs_1.Tabs, { children: [(0, jsx_runtime_1.jsxs)(Tabs_1.Tab, { selected: panel === 'input-props', onClick: onCompositionsSelected, style: { justifyContent: 'space-between' }, children: ["Props", unsavedChangesExist ? ((0, jsx_runtime_1.jsx)("div", { title: saveToolTip, style: circleStyle })) : null] }), (0, jsx_runtime_1.jsx)(RendersTab_1.RendersTab, { onClick: onRendersSelected, selected: panel === 'renders' })] }) }), panel === 'renders' ? ((0, jsx_runtime_1.jsx)(RenderQueue_1.RenderQueue, {})) : ((0, jsx_runtime_1.jsx)(DataEditor_1.DataEditor, { unresolvedComposition: composition, inputProps: actualProps, setInputProps: setInputProps, mayShowSaveButton: true, propsEditType: "default-props", saving: saving, setSaving: setSaving }, composition.id))] }));
78
111
  };
79
112
  exports.RightPanel = RightPanel;
@@ -4,16 +4,17 @@ exports.SetTimelineInOutProvider = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const in_out_1 = require("../state/in-out");
7
+ const marks_1 = require("../state/marks");
7
8
  const SetTimelineInOutProvider = ({ children }) => {
8
- const [inAndOutFrames, setInAndOutFrames] = (0, react_1.useState)({
9
- inFrame: null,
10
- outFrame: null,
11
- });
9
+ const [inAndOutFrames, setInAndOutFrames] = (0, react_1.useState)(() => (0, marks_1.loadMarks)());
12
10
  const setTimelineInOutContextValue = (0, react_1.useMemo)(() => {
13
11
  return {
14
12
  setInAndOutFrames,
15
13
  };
16
14
  }, []);
15
+ (0, react_1.useEffect)(() => {
16
+ (0, marks_1.persistMarks)(inAndOutFrames);
17
+ }, [inAndOutFrames]);
17
18
  return ((0, jsx_runtime_1.jsx)(in_out_1.TimelineInOutContext.Provider, { value: inAndOutFrames, children: (0, jsx_runtime_1.jsx)(in_out_1.SetTimelineInOutContext.Provider, { value: setTimelineInOutContextValue, children: children }) }));
18
19
  };
19
20
  exports.SetTimelineInOutProvider = SetTimelineInOutProvider;
@@ -22,7 +22,9 @@ const SidebarRenderButton = ({ composition, visible }) => {
22
22
  }, []);
23
23
  const connectionStatus = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx).type;
24
24
  const { props } = (0, react_1.useContext)(remotion_1.Internals.EditorPropsContext);
25
- const isVideo = composition.durationInFrames > 1;
25
+ const isVideo = typeof composition.durationInFrames === 'undefined'
26
+ ? true
27
+ : composition.durationInFrames > 1;
26
28
  const onClick = (0, react_1.useCallback)((e) => {
27
29
  var _a;
28
30
  const defaults = window.remotion_renderDefaults;
@@ -9,8 +9,8 @@ const get_left_of_timeline_slider_1 = require("../../helpers/get-left-of-timelin
9
9
  const timeline_layout_1 = require("../../helpers/timeline-layout");
10
10
  const in_out_1 = require("../../state/in-out");
11
11
  const timeline_zoom_1 = require("../../state/timeline-zoom");
12
- const FramePersistor_1 = require("../FramePersistor");
13
12
  const is_menu_item_1 = require("../Menu/is-menu-item");
13
+ const TimelineInOutToggle_1 = require("../TimelineInOutToggle");
14
14
  const timeline_refs_1 = require("./timeline-refs");
15
15
  const timeline_scroll_logic_1 = require("./timeline-scroll-logic");
16
16
  const TimelineInOutPointer_1 = require("./TimelineInOutPointer");
@@ -50,6 +50,7 @@ const Inner = () => {
50
50
  triggerOnWindowResize: true,
51
51
  shouldApplyCssTransforms: true,
52
52
  });
53
+ const setFrame = remotion_1.Internals.useTimelineSetFrame();
53
54
  const [inOutDragging, setInOutDragging] = (0, react_1.useState)({
54
55
  dragging: false,
55
56
  });
@@ -254,11 +255,12 @@ const Inner = () => {
254
255
  width,
255
256
  extrapolate: 'clamp',
256
257
  });
257
- (0, FramePersistor_1.persistCurrentFrame)(frame);
258
+ remotion_1.Internals.persistCurrentFrame(frame, videoConfig.id);
259
+ setFrame((c) => ({ ...c, [videoConfig.id]: frame }));
258
260
  if (dragging.wasPlaying) {
259
261
  play();
260
262
  }
261
- }, [dragging, left, play, videoConfig, width]);
263
+ }, [dragging, left, play, videoConfig, setFrame, width]);
262
264
  const onPointerUpInOut = (0, react_1.useCallback)((e) => {
263
265
  if (!videoConfig) {
264
266
  return;
@@ -277,29 +279,53 @@ const Inner = () => {
277
279
  });
278
280
  if (inOutDragging.dragging === 'in') {
279
281
  if (frame < 1) {
280
- return setInAndOutFrames((prev) => ({
281
- ...prev,
282
- inFrame: null,
283
- }));
282
+ return setInAndOutFrames((prev) => {
283
+ var _a;
284
+ return ({
285
+ ...prev,
286
+ [videoConfig.id]: {
287
+ ...((_a = prev[videoConfig.id]) !== null && _a !== void 0 ? _a : TimelineInOutToggle_1.defaultInOutValue),
288
+ inFrame: null,
289
+ },
290
+ });
291
+ });
284
292
  }
285
293
  const maxFrame = outFrame === null ? Infinity : outFrame - 1;
286
- setInAndOutFrames((prev) => ({
287
- ...prev,
288
- inFrame: Math.min(maxFrame, frame),
289
- }));
294
+ setInAndOutFrames((prev) => {
295
+ var _a;
296
+ return ({
297
+ ...prev,
298
+ [videoConfig.id]: {
299
+ ...((_a = prev[videoConfig.id]) !== null && _a !== void 0 ? _a : TimelineInOutToggle_1.defaultInOutValue),
300
+ inFrame: Math.min(maxFrame, frame),
301
+ },
302
+ });
303
+ });
290
304
  }
291
305
  else {
292
306
  if (frame > videoConfig.durationInFrames - 2) {
293
- return setInAndOutFrames((prev) => ({
294
- ...prev,
295
- outFrame: null,
296
- }));
307
+ return setInAndOutFrames((prev) => {
308
+ var _a;
309
+ return ({
310
+ ...prev,
311
+ [videoConfig.id]: {
312
+ ...((_a = prev[videoConfig.id]) !== null && _a !== void 0 ? _a : TimelineInOutToggle_1.defaultInOutValue),
313
+ outFrame: null,
314
+ },
315
+ });
316
+ });
297
317
  }
298
318
  const minFrame = inFrame === null ? -Infinity : inFrame + 1;
299
- setInAndOutFrames((prev) => ({
300
- ...prev,
301
- outFrame: Math.max(minFrame, frame),
302
- }));
319
+ setInAndOutFrames((prev) => {
320
+ var _a;
321
+ return ({
322
+ ...prev,
323
+ [videoConfig.id]: {
324
+ ...((_a = prev[videoConfig.id]) !== null && _a !== void 0 ? _a : TimelineInOutToggle_1.defaultInOutValue),
325
+ outFrame: Math.max(minFrame, frame),
326
+ },
327
+ });
328
+ });
303
329
  }
304
330
  }, [
305
331
  inFrame,
@@ -1,8 +1,9 @@
1
1
  import React from 'react';
2
+ import type { InOutValue } from '../state/in-out';
2
3
  export declare const inOutHandles: React.RefObject<{
3
4
  inMarkClick: (e: KeyboardEvent | null) => void;
4
5
  outMarkClick: (e: KeyboardEvent | null) => void;
5
6
  clearMarks: () => void;
6
- setMarks: (marks: [number | null, number | null]) => void;
7
7
  }>;
8
+ export declare const defaultInOutValue: InOutValue;
8
9
  export declare const TimelineInOutPointToggle: React.FC;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TimelineInOutPointToggle = exports.inOutHandles = void 0;
3
+ exports.TimelineInOutPointToggle = exports.defaultInOutValue = exports.inOutHandles = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const remotion_1 = require("remotion");
@@ -10,7 +10,6 @@ const is_current_selected_still_1 = require("../helpers/is-current-selected-stil
10
10
  const use_keybinding_1 = require("../helpers/use-keybinding");
11
11
  const timelineInOutPointer_1 = require("../icons/timelineInOutPointer");
12
12
  const in_out_1 = require("../state/in-out");
13
- const marks_1 = require("../state/marks");
14
13
  const ControlButton_1 = require("./ControlButton");
15
14
  const getTooltipText = (pointType, key) => [
16
15
  `Mark ${pointType}`,
@@ -24,19 +23,22 @@ const style = {
24
23
  height: 16,
25
24
  };
26
25
  exports.inOutHandles = (0, react_1.createRef)();
26
+ exports.defaultInOutValue = { inFrame: null, outFrame: null };
27
27
  const TimelineInOutPointToggle = () => {
28
28
  const timelinePosition = remotion_1.Internals.Timeline.useTimelinePosition();
29
29
  const { inFrame, outFrame } = (0, in_out_1.useTimelineInOutFramePosition)();
30
30
  const { setInAndOutFrames } = (0, in_out_1.useTimelineSetInOutFramePosition)();
31
- const { currentComposition } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
32
31
  const isStill = (0, is_current_selected_still_1.useIsStill)();
33
32
  const videoConfig = remotion_1.Internals.useUnsafeVideoConfig();
34
33
  const keybindings = (0, use_keybinding_1.useKeybinding)();
35
- const onInOutClear = (0, react_1.useCallback)(() => {
36
- setInAndOutFrames(() => {
34
+ const onInOutClear = (0, react_1.useCallback)((composition) => {
35
+ setInAndOutFrames((prev) => {
37
36
  return {
38
- inFrame: null,
39
- outFrame: null,
37
+ ...prev,
38
+ [composition]: {
39
+ inFrame: null,
40
+ outFrame: null,
41
+ },
40
42
  };
41
43
  });
42
44
  }, [setInAndOutFrames]);
@@ -45,35 +47,51 @@ const TimelineInOutPointToggle = () => {
45
47
  return null;
46
48
  }
47
49
  if (e === null || e === void 0 ? void 0 : e.shiftKey) {
48
- setInAndOutFrames((f) => {
50
+ setInAndOutFrames((prev) => {
51
+ var _a;
49
52
  return {
50
- ...f,
51
- inFrame: null,
53
+ ...prev,
54
+ [videoConfig.id]: {
55
+ ...((_a = prev[videoConfig.id]) !== null && _a !== void 0 ? _a : exports.defaultInOutValue),
56
+ inFrame: null,
57
+ },
52
58
  };
53
59
  });
54
60
  return null;
55
61
  }
56
62
  setInAndOutFrames((prev) => {
57
- const biggestPossible = prev.outFrame === null ? Infinity : prev.outFrame - 1;
63
+ var _a, _b, _c, _d, _e;
64
+ const prevOut = (_a = prev[videoConfig.id]) === null || _a === void 0 ? void 0 : _a.outFrame;
65
+ const biggestPossible = prevOut === undefined || prevOut === null ? Infinity : prevOut - 1;
58
66
  const selected = Math.min(timelinePosition, biggestPossible);
59
67
  if (selected === 0) {
60
68
  return {
61
69
  ...prev,
62
- inFrame: null,
70
+ [videoConfig.id]: {
71
+ ...((_b = prev[videoConfig.id]) !== null && _b !== void 0 ? _b : exports.defaultInOutValue),
72
+ inFrame: null,
73
+ },
63
74
  };
64
75
  }
65
- if (prev.inFrame !== null) {
76
+ const prevIn = (_c = prev[videoConfig.id]) === null || _c === void 0 ? void 0 : _c.inFrame;
77
+ if (prevIn !== null && prevIn !== undefined) {
66
78
  // Disable if already at this position
67
- if (prev.inFrame === selected) {
79
+ if (prevIn === selected) {
68
80
  return {
69
81
  ...prev,
70
- inFrame: null,
82
+ [videoConfig.id]: {
83
+ ...((_d = prev[videoConfig.id]) !== null && _d !== void 0 ? _d : exports.defaultInOutValue),
84
+ inFrame: null,
85
+ },
71
86
  };
72
87
  }
73
88
  }
74
89
  return {
75
90
  ...prev,
76
- inFrame: selected,
91
+ [videoConfig.id]: {
92
+ ...((_e = prev[videoConfig.id]) !== null && _e !== void 0 ? _e : exports.defaultInOutValue),
93
+ inFrame: selected,
94
+ },
77
95
  };
78
96
  });
79
97
  }, [setInAndOutFrames, timelinePosition, videoConfig]);
@@ -83,9 +101,13 @@ const TimelineInOutPointToggle = () => {
83
101
  }
84
102
  e.preventDefault();
85
103
  setInAndOutFrames((f) => {
104
+ var _a;
86
105
  return {
87
106
  ...f,
88
- inFrame: null,
107
+ [videoConfig.id]: {
108
+ ...((_a = f[videoConfig.id]) !== null && _a !== void 0 ? _a : exports.defaultInOutValue),
109
+ inFrame: null,
110
+ },
89
111
  };
90
112
  });
91
113
  }, [setInAndOutFrames, videoConfig]);
@@ -95,9 +117,13 @@ const TimelineInOutPointToggle = () => {
95
117
  }
96
118
  e === null || e === void 0 ? void 0 : e.preventDefault();
97
119
  setInAndOutFrames((f) => {
120
+ var _a;
98
121
  return {
99
122
  ...f,
100
- outFrame: null,
123
+ [videoConfig.id]: {
124
+ ...((_a = f[videoConfig.id]) !== null && _a !== void 0 ? _a : exports.defaultInOutValue),
125
+ outFrame: null,
126
+ },
101
127
  };
102
128
  });
103
129
  }, [setInAndOutFrames, videoConfig]);
@@ -107,37 +133,59 @@ const TimelineInOutPointToggle = () => {
107
133
  }
108
134
  if (e === null || e === void 0 ? void 0 : e.shiftKey) {
109
135
  setInAndOutFrames((f) => {
136
+ var _a;
110
137
  return {
111
138
  ...f,
112
- outFrame: null,
139
+ [videoConfig.id]: {
140
+ ...((_a = f[videoConfig.id]) !== null && _a !== void 0 ? _a : exports.defaultInOutValue),
141
+ outFrame: null,
142
+ },
113
143
  };
114
144
  });
115
145
  return;
116
146
  }
117
147
  setInAndOutFrames((prev) => {
118
- const smallestPossible = prev.inFrame === null ? -Infinity : prev.inFrame + 1;
148
+ var _a, _b, _c, _d, _e;
149
+ const prevInFrame = (_a = prev[videoConfig.id]) === null || _a === void 0 ? void 0 : _a.inFrame;
150
+ const smallestPossible = prevInFrame === null || prevInFrame === undefined
151
+ ? -Infinity
152
+ : prevInFrame + 1;
119
153
  const selected = Math.max(timelinePosition, smallestPossible);
120
154
  if (selected === videoConfig.durationInFrames - 1) {
121
155
  return {
122
156
  ...prev,
123
- outFrame: null,
157
+ [videoConfig.id]: {
158
+ ...((_b = prev[videoConfig.id]) !== null && _b !== void 0 ? _b : exports.defaultInOutValue),
159
+ outFrame: null,
160
+ },
124
161
  };
125
162
  }
126
- if (prev.outFrame !== null) {
127
- if (prev.outFrame === selected) {
163
+ const prevOut = (_c = prev[videoConfig.id]) === null || _c === void 0 ? void 0 : _c.outFrame;
164
+ if (prevOut !== null && prevOut !== undefined) {
165
+ if (prevOut === selected) {
128
166
  return {
129
167
  ...prev,
130
- outFrame: null,
168
+ [videoConfig.id]: {
169
+ ...((_d = prev[videoConfig.id]) !== null && _d !== void 0 ? _d : exports.defaultInOutValue),
170
+ outFrame: null,
171
+ },
131
172
  };
132
173
  }
133
174
  }
134
175
  return {
135
176
  ...prev,
136
- outFrame: selected,
177
+ [videoConfig.id]: {
178
+ ...((_e = prev[videoConfig.id]) !== null && _e !== void 0 ? _e : exports.defaultInOutValue),
179
+ outFrame: selected,
180
+ },
137
181
  };
138
182
  });
139
183
  }, [setInAndOutFrames, timelinePosition, videoConfig]);
184
+ const confId = videoConfig === null || videoConfig === void 0 ? void 0 : videoConfig.id;
140
185
  (0, react_1.useEffect)(() => {
186
+ if (!confId) {
187
+ return;
188
+ }
141
189
  const iKey = keybindings.registerKeybinding({
142
190
  event: 'keypress',
143
191
  key: 'i',
@@ -162,7 +210,7 @@ const TimelineInOutPointToggle = () => {
162
210
  event: 'keypress',
163
211
  key: 'x',
164
212
  callback: () => {
165
- onInOutClear();
213
+ onInOutClear(confId);
166
214
  },
167
215
  commandCtrlKey: false,
168
216
  preventDefault: true,
@@ -173,52 +221,19 @@ const TimelineInOutPointToggle = () => {
173
221
  iKey.unregister();
174
222
  xKey.unregister();
175
223
  };
176
- }, [keybindings, onInMark, onInOutClear, onOutMark]);
177
- (0, react_1.useEffect)(() => {
178
- if (!currentComposition || !videoConfig) {
179
- return;
180
- }
181
- (0, marks_1.persistMarks)(currentComposition, videoConfig.durationInFrames, [
182
- inFrame,
183
- outFrame,
184
- ]);
185
- }, [currentComposition, inFrame, outFrame, videoConfig]);
186
- // If duration changes and it goes out of range, we reset
187
- (0, react_1.useEffect)(() => {
188
- if (outFrame === null) {
189
- return;
190
- }
191
- if (!videoConfig) {
192
- return;
193
- }
194
- if (outFrame >= videoConfig.durationInFrames - 1) {
195
- onInOutClear();
196
- }
197
- }, [onInOutClear, outFrame, videoConfig]);
198
- (0, react_1.useEffect)(() => {
199
- if (inFrame === null) {
200
- return;
201
- }
202
- if (!videoConfig) {
203
- return;
204
- }
205
- if (inFrame >= videoConfig.durationInFrames - 1) {
206
- onInOutClear();
207
- }
208
- }, [onInOutClear, inFrame, videoConfig]);
224
+ }, [confId, keybindings, onInMark, onInOutClear, onOutMark]);
209
225
  (0, react_1.useImperativeHandle)(exports.inOutHandles, () => {
210
226
  return {
211
- clearMarks: onInOutClear,
227
+ clearMarks: () => {
228
+ if (!confId) {
229
+ return;
230
+ }
231
+ onInOutClear(confId);
232
+ },
212
233
  inMarkClick: onInMark,
213
234
  outMarkClick: onOutMark,
214
- setMarks: ([newInFrame, newOutFrame]) => {
215
- setInAndOutFrames({
216
- inFrame: newInFrame,
217
- outFrame: newOutFrame,
218
- });
219
- },
220
235
  };
221
- }, [onInMark, onInOutClear, onOutMark, setInAndOutFrames]);
236
+ }, [confId, onInMark, onInOutClear, onOutMark]);
222
237
  if (isStill) {
223
238
  return null;
224
239
  }
@@ -1,3 +1,3 @@
1
1
  export declare const isCompositionStill: (comp: {
2
- durationInFrames: number;
2
+ durationInFrames: number | undefined;
3
3
  } | null) => boolean;
@@ -13,16 +13,15 @@ const useIsStill = () => {
13
13
  };
14
14
  exports.useIsStill = useIsStill;
15
15
  const useDimensions = () => {
16
- const { compositions, currentComposition } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
17
- const selected = (0, react_1.useMemo)(() => compositions.find((c) => c.id === currentComposition), [compositions, currentComposition]);
16
+ const config = remotion_1.Internals.useUnsafeVideoConfig();
18
17
  return (0, react_1.useMemo)(() => {
19
- if (!selected) {
18
+ if (!config) {
20
19
  return null;
21
20
  }
22
21
  return {
23
- width: selected.width,
24
- height: selected.height,
22
+ width: config.width,
23
+ height: config.height,
25
24
  };
26
- }, [selected]);
25
+ }, [config]);
27
26
  };
28
27
  exports.useDimensions = useDimensions;
@@ -11,6 +11,7 @@ const NotificationCenter_1 = require("../components/Notifications/NotificationCe
11
11
  const SizeSelector_1 = require("../components/SizeSelector");
12
12
  const TimelineInOutToggle_1 = require("../components/TimelineInOutToggle");
13
13
  const Checkmark_1 = require("../icons/Checkmark");
14
+ const canvas_ref_1 = require("../state/canvas-ref");
14
15
  const checkerboard_1 = require("../state/checkerboard");
15
16
  const editor_zoom_gestures_1 = require("../state/editor-zoom-gestures");
16
17
  const modals_1 = require("../state/modals");
@@ -36,6 +37,7 @@ const useMenuStructure = (closeMenu) => {
36
37
  const { type } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
37
38
  const { setSidebarCollapsedState, sidebarCollapsedStateLeft, sidebarCollapsedStateRight, } = (0, react_1.useContext)(sidebar_1.SidebarContext);
38
39
  const sizes = (0, SizeSelector_1.getUniqueSizes)(size);
40
+ const isFullscreenSupported = document.fullscreenEnabled || document.webkitFullscreenEnabled;
39
41
  const structure = (0, react_1.useMemo)(() => {
40
42
  const struct = [
41
43
  {
@@ -474,7 +476,28 @@ const useMenuStructure = (closeMenu) => {
474
476
  value: 'clear-marks',
475
477
  quickSwitcherLabel: 'Timeline: Clear In and Out Mark',
476
478
  },
477
- ],
479
+ {
480
+ id: 'fullscreen-divider',
481
+ type: 'divider',
482
+ },
483
+ isFullscreenSupported
484
+ ? {
485
+ id: 'fullscreen',
486
+ keyHint: null,
487
+ label: 'Fullscreen',
488
+ leftItem: null,
489
+ onClick: () => {
490
+ var _a;
491
+ closeMenu();
492
+ (_a = canvas_ref_1.canvasRef.current) === null || _a === void 0 ? void 0 : _a.requestFullscreen();
493
+ },
494
+ subMenu: null,
495
+ type: 'item',
496
+ value: 'fullscreen',
497
+ quickSwitcherLabel: 'Go Fullscreen',
498
+ }
499
+ : null,
500
+ ].filter(remotion_1.Internals.truthy),
478
501
  },
479
502
  'EyeDropper' in window
480
503
  ? {
@@ -639,6 +662,7 @@ const useMenuStructure = (closeMenu) => {
639
662
  sidebarCollapsedStateLeft,
640
663
  sidebarCollapsedStateRight,
641
664
  checkerboard,
665
+ isFullscreenSupported,
642
666
  closeMenu,
643
667
  setSelectedModal,
644
668
  type,
@@ -4,6 +4,7 @@ exports.ArrowRight = exports.ArrowLeft = exports.ShiftIcon = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const iconStyle = {
6
6
  width: 10,
7
+ display: 'inline',
7
8
  };
8
9
  const ShiftIcon = () => {
9
10
  return ((0, jsx_runtime_1.jsx)("svg", { style: iconStyle, viewBox: "0 0 448 512", children: (0, jsx_runtime_1.jsx)("path", { fill: "currentColor", d: "M48.048 304h73.798v128c0 26.51 21.49 48 48 48h108.308c26.51 0 48-21.49 48-48V304h73.789c42.638 0 64.151-51.731 33.941-81.941l-175.943-176c-18.745-18.745-49.137-18.746-67.882 0l-175.952 176C-16.042 252.208 5.325 304 48.048 304zM224 80l176 176H278.154v176H169.846V256H48L224 80z" }) }));
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const canvasRef: import("react").RefObject<HTMLDivElement>;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.canvasRef = void 0;
4
+ const react_1 = require("react");
5
+ exports.canvasRef = (0, react_1.createRef)();
@@ -1,12 +1,13 @@
1
1
  import type React from 'react';
2
- export type TimelineInOutContextValue = {
2
+ export type InOutValue = {
3
3
  inFrame: number | null;
4
4
  outFrame: number | null;
5
5
  };
6
+ export type TimelineInOutContextValue = Record<string, InOutValue>;
6
7
  export type SetTimelineInOutContextValue = {
7
8
  setInAndOutFrames: (u: React.SetStateAction<TimelineInOutContextValue>) => void;
8
9
  };
9
10
  export declare const TimelineInOutContext: React.Context<TimelineInOutContextValue>;
10
11
  export declare const SetTimelineInOutContext: React.Context<SetTimelineInOutContextValue>;
11
- export declare const useTimelineInOutFramePosition: () => TimelineInOutContextValue;
12
+ export declare const useTimelineInOutFramePosition: () => InOutValue;
12
13
  export declare const useTimelineSetInOutFramePosition: () => SetTimelineInOutContextValue;