@remotion/cli 4.1.0-alpha4 → 4.1.0-alpha7

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 (47) hide show
  1. package/dist/chalk/index.d.ts +2 -1
  2. package/dist/config/image-format.d.ts +1 -1
  3. package/dist/config/index.d.ts +1 -1
  4. package/dist/config/log.d.ts +1 -1
  5. package/dist/editor/components/CanvasOrLoading.js +20 -1
  6. package/dist/editor/components/CopyButton.js +5 -2
  7. package/dist/editor/components/Editor.js +1 -3
  8. package/dist/editor/components/FramePersistor.d.ts +0 -2
  9. package/dist/editor/components/FramePersistor.js +4 -24
  10. package/dist/editor/components/InitialCompositionLoader.js +1 -22
  11. package/dist/editor/components/NewComposition/RemInput.d.ts +1 -1
  12. package/dist/editor/components/NewComposition/RemInputTypeColor.d.ts +1 -1
  13. package/dist/editor/components/NewComposition/RemTextarea.d.ts +1 -1
  14. package/dist/editor/components/OpenEditorButton.js +5 -2
  15. package/dist/editor/components/QuickSwitcher/QuickSwitcherResult.js +3 -3
  16. package/dist/editor/components/RenderModal/RenderModal.js +5 -2
  17. package/dist/editor/components/RenderModal/RenderModalBasic.d.ts +2 -3
  18. package/dist/editor/components/RenderModal/SchemaEditor/SchemaErrorMessages.js +1 -3
  19. package/dist/editor/components/RenderModal/SchemaEditor/ZodSwitch.js +0 -1
  20. package/dist/editor/components/RenderModal/SchemaEditor/local-state.js +9 -3
  21. package/dist/editor/components/RenderModal/human-readable-codec.d.ts +1 -1
  22. package/dist/editor/components/SetTimelineInOutProvider.js +5 -4
  23. package/dist/editor/components/SidebarRenderButton.js +3 -1
  24. package/dist/editor/components/Timeline/TimelineDragHandler.js +45 -19
  25. package/dist/editor/components/TimelineInOutToggle.d.ts +2 -1
  26. package/dist/editor/components/TimelineInOutToggle.js +82 -67
  27. package/dist/editor/helpers/colors.d.ts +1 -1
  28. package/dist/editor/helpers/is-composition-still.d.ts +1 -1
  29. package/dist/editor/helpers/is-current-selected-still.js +5 -6
  30. package/dist/editor/icons/keys.js +1 -0
  31. package/dist/editor/state/in-out.d.ts +3 -2
  32. package/dist/editor/state/in-out.js +22 -5
  33. package/dist/editor/state/marks.d.ts +3 -2
  34. package/dist/editor/state/marks.js +6 -6
  35. package/dist/get-cli-options.d.ts +2 -2
  36. package/dist/get-composition-id.d.ts +2 -2
  37. package/dist/get-composition-id.js +5 -1
  38. package/dist/get-composition-with-dimension-override.d.ts +2 -2
  39. package/dist/handle-common-errors.js +8 -0
  40. package/dist/index.d.ts +16 -15
  41. package/dist/log.d.ts +3 -3
  42. package/dist/parse-command-line.js +1 -1
  43. package/dist/preview-server/dev-middleware/setup-hooks.js +1 -1
  44. package/dist/preview-server/error-overlay/remotion-overlay/Button.js +1 -0
  45. package/dist/preview-server/render-queue/open-directory-in-finder.js +11 -5
  46. package/dist/print-compositions.d.ts +2 -2
  47. package/package.json +10 -10
@@ -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;
@@ -2,4 +2,4 @@ import type { StillImageFormat, VideoImageFormat } from '@remotion/renderer';
2
2
  export declare const setStillImageFormat: (format: StillImageFormat) => void;
3
3
  export declare const setVideoImageFormat: (format: VideoImageFormat) => void;
4
4
  export declare const getUserPreferredStillImageFormat: () => "png" | "jpeg" | "pdf" | "webp" | undefined;
5
- export declare const getUserPreferredVideoImageFormat: () => "none" | "png" | "jpeg" | undefined;
5
+ export declare const getUserPreferredVideoImageFormat: () => "png" | "jpeg" | "none" | undefined;
@@ -297,7 +297,7 @@ export declare const ConfigInternals: {
297
297
  getShouldOutputImageSequence: (frameRange: FrameRange | null) => boolean;
298
298
  getDotEnvLocation: () => string | null;
299
299
  getUserPreferredStillImageFormat: () => "png" | "jpeg" | "pdf" | "webp" | undefined;
300
- getUserPreferredVideoImageFormat: () => "none" | "png" | "jpeg" | undefined;
300
+ getUserPreferredVideoImageFormat: () => "png" | "jpeg" | "none" | undefined;
301
301
  getWebpackOverrideFn: () => WebpackOverrideFn;
302
302
  getWebpackCaching: () => boolean;
303
303
  getOutputLocation: () => string | null;
@@ -1 +1 @@
1
- export declare const getLogLevel: () => "error" | "verbose" | "info" | "warn", setLogLevel: (newLogLevel: "error" | "verbose" | "info" | "warn") => void;
1
+ export declare const getLogLevel: () => "verbose" | "info" | "warn" | "error", setLogLevel: (newLogLevel: "verbose" | "info" | "warn" | "error") => void;
@@ -10,6 +10,11 @@ const Canvas_1 = require("./Canvas");
10
10
  const layout_1 = require("./layout");
11
11
  const styles_1 = require("./Menu/styles");
12
12
  const Spinner_1 = require("./Spinner");
13
+ const FramePersistor_1 = require("./FramePersistor");
14
+ const ZoomPersistor_1 = require("./ZoomPersistor");
15
+ const timeline_scroll_logic_1 = require("./Timeline/timeline-scroll-logic");
16
+ const timeline_zoom_1 = require("../state/timeline-zoom");
17
+ const imperative_state_1 = require("./Timeline/imperative-state");
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;
@@ -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) => {
@@ -13,5 +13,5 @@ export declare const getInputBorderColor: ({ status, isFocused, isHovered, }: {
13
13
  isFocused: boolean;
14
14
  isHovered: boolean;
15
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, "key" | "status" | "rightAlign" | keyof React.InputHTMLAttributes<HTMLInputElement>> & React.RefAttributes<HTMLInputElement>>;
16
+ export declare const RemotionInput: React.ForwardRefExoticComponent<Pick<Props, "status" | "key" | "rightAlign" | keyof React.InputHTMLAttributes<HTMLInputElement>> & React.RefAttributes<HTMLInputElement>>;
17
17
  export {};
@@ -4,5 +4,5 @@ type Props = React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>
4
4
  status: RemInputStatus;
5
5
  name: string;
6
6
  };
7
- export declare const RemInputTypeColor: React.ForwardRefExoticComponent<Pick<Props, "key" | "status" | keyof React.InputHTMLAttributes<HTMLInputElement>> & React.RefAttributes<HTMLInputElement>>;
7
+ export declare const RemInputTypeColor: React.ForwardRefExoticComponent<Pick<Props, "status" | "key" | keyof React.InputHTMLAttributes<HTMLInputElement>> & React.RefAttributes<HTMLInputElement>>;
8
8
  export {};
@@ -3,5 +3,5 @@ type Props = React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLTextAreaEleme
3
3
  status: 'error' | 'warning' | 'ok';
4
4
  };
5
5
  export declare const inputBaseStyle: React.CSSProperties;
6
- export declare const RemTextarea: React.ForwardRefExoticComponent<Pick<Props, "key" | "status" | keyof React.InputHTMLAttributes<HTMLTextAreaElement>> & React.RefAttributes<HTMLTextAreaElement>>;
6
+ export declare const RemTextarea: React.ForwardRefExoticComponent<Pick<Props, "status" | "key" | keyof React.InputHTMLAttributes<HTMLTextAreaElement>> & React.RefAttributes<HTMLTextAreaElement>>;
7
7
  export {};
@@ -12,8 +12,11 @@ const svgStyle = {
12
12
  };
13
13
  const buttonStyle = {
14
14
  border: 'none',
15
- width: '25px',
16
- height: '25px',
15
+ width: '20px',
16
+ height: '20px',
17
+ display: 'flex',
18
+ justifyContent: 'center',
19
+ alignItems: 'center',
17
20
  };
18
21
  const OpenEditorButton = () => {
19
22
  const [hovered, setHovered] = (0, react_1.useState)(false);
@@ -98,14 +98,14 @@ const QuickSwitcherResult = ({ result, selected }) => {
98
98
  fontSize: 15,
99
99
  };
100
100
  }, [hovered, result.type, selected]);
101
- return ((0, jsx_runtime_1.jsxs)("div", { ref: ref, style: style, onClick: result.onSelected, children: [result.type === 'composition' ? (result.compositionType === 'still' ? ((0, jsx_runtime_1.jsx)(still_1.StillIcon, { color: selected ? 'white' : colors_1.LIGHT_TEXT, style: iconStyle })) : ((0, jsx_runtime_1.jsx)(video_1.FilmIcon, { color: selected ? 'white' : colors_1.LIGHT_TEXT, style: iconStyle }))) : null, (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1 }), (0, jsx_runtime_1.jsx)("div", { style: labelContainer, children: result.type === 'search-result' ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { style: labelStyle,
101
+ return ((0, jsx_runtime_1.jsxs)("div", { ref: ref, style: style, onClick: result.onSelected, children: [result.type === 'composition' ? (result.compositionType === 'still' ? ((0, jsx_runtime_1.jsx)(still_1.StillIcon, { color: selected ? 'white' : colors_1.LIGHT_TEXT, style: iconStyle })) : ((0, jsx_runtime_1.jsx)(video_1.FilmIcon, { color: selected ? 'white' : colors_1.LIGHT_TEXT, style: iconStyle }))) : null, (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1 }), (0, jsx_runtime_1.jsx)("div", { style: labelContainer, children: result.type === 'search-result' ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", {
102
102
  // eslint-disable-next-line react/no-danger
103
103
  dangerouslySetInnerHTML: {
104
104
  __html: result.titleLine,
105
- } }), (0, jsx_runtime_1.jsx)("div", { style: labelStyle,
105
+ }, style: labelStyle }), (0, jsx_runtime_1.jsx)("div", {
106
106
  // eslint-disable-next-line react/no-danger
107
107
  dangerouslySetInnerHTML: {
108
108
  __html: result.subtitleLine,
109
- } })] })) : ((0, jsx_runtime_1.jsx)("div", { style: labelStyle, children: result.title })) })] }, result.id));
109
+ }, style: labelStyle })] })) : ((0, jsx_runtime_1.jsx)("div", { style: labelStyle, children: result.title })) })] }, result.id));
110
110
  };
111
111
  exports.QuickSwitcherResult = QuickSwitcherResult;
@@ -567,7 +567,7 @@ const RenderModal = ({ initialFrame, initialVideoImageFormat, initialStillImageF
567
567
  }
568
568
  }, [onClickStill, onClickVideo, renderDisabled, renderMode]);
569
569
  (0, react_1.useEffect)(() => {
570
- registerKeybinding({
570
+ const enter = registerKeybinding({
571
571
  callback() {
572
572
  trigger();
573
573
  },
@@ -575,8 +575,11 @@ const RenderModal = ({ initialFrame, initialVideoImageFormat, initialStillImageF
575
575
  key: 'Enter',
576
576
  event: 'keydown',
577
577
  preventDefault: true,
578
- triggerIfInputFieldFocused: false,
578
+ triggerIfInputFieldFocused: true,
579
579
  });
580
+ return () => {
581
+ enter.unregister();
582
+ };
580
583
  }, [registerKeybinding, trigger]);
581
584
  return ((0, jsx_runtime_1.jsxs)("div", { style: outer, children: [(0, jsx_runtime_1.jsx)(ModalHeader_1.NewCompHeader, { title: `Render ${resolvedComposition.id}` }), (0, jsx_runtime_1.jsxs)("div", { style: container, children: [(0, jsx_runtime_1.jsx)(SegmentedControl_1.SegmentedControl, { items: renderTabOptions, needsWrapping: false }), (0, jsx_runtime_1.jsx)("div", { style: flexer }), (0, jsx_runtime_1.jsxs)(Button_1.Button, { autoFocus: true, onClick: trigger, disabled: renderDisabled, style: {
582
585
  ...buttonStyle,
@@ -1,9 +1,8 @@
1
1
  import type { Codec, ProResProfile } from '@remotion/renderer';
2
2
  import React from 'react';
3
- import type { TCompMetadata } from 'remotion';
4
- import type { AnyZodObject } from 'zod';
5
3
  import type { SegmentedControlItem } from '../SegmentedControl';
6
4
  import type { RenderType } from './RenderModalAdvanced';
5
+ import type { VideoConfig } from 'remotion';
7
6
  export declare const RenderModalBasic: React.FC<{
8
7
  renderMode: RenderType;
9
8
  imageFormatOptions: SegmentedControlItem[];
@@ -14,7 +13,7 @@ export declare const RenderModalBasic: React.FC<{
14
13
  setProResProfile: React.Dispatch<React.SetStateAction<ProResProfile>>;
15
14
  frame: number;
16
15
  setFrame: React.Dispatch<React.SetStateAction<number>>;
17
- resolvedComposition: TCompMetadata<AnyZodObject, Record<string, unknown> | undefined>;
16
+ resolvedComposition: VideoConfig;
18
17
  setOutName: (value: React.SetStateAction<string>) => void;
19
18
  setEndFrame: React.Dispatch<React.SetStateAction<number | null>>;
20
19
  startFrame: number;
@@ -32,9 +32,7 @@ const errorContainer = {
32
32
  overflowY: 'auto',
33
33
  };
34
34
  const openDocs = () => {
35
- window.open(
36
- // TODO: Make sure to update this link when we release v4
37
- 'https://v4.remotion.dev/docs/parametrized-rendering#define-a-schema-');
35
+ window.open('https://www.remotion.dev/docs/parameterized-rendering#define-a-schema-');
38
36
  };
39
37
  const ZodNotInstalled = () => {
40
38
  return ((0, jsx_runtime_1.jsxs)("div", { style: explainer, children: [(0, jsx_runtime_1.jsxs)("div", { style: errorExplanation, children: ["Install ", (0, jsx_runtime_1.jsx)("code", { style: styles_1.inlineCodeSnippet, children: "zod" }), " as a dependency to interactively control the props of the composition."] }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 2, block: true }), (0, jsx_runtime_1.jsx)(Button_1.Button, { onClick: openDocs, children: "Learn how" })] }));
@@ -27,7 +27,6 @@ const ZodSwitch = ({ schema, jsonPath, value, setValue, defaultValue, onSave, sh
27
27
  throw new Error('expected zod');
28
28
  }
29
29
  const zodTypes = (0, get_zod_if_possible_1.useZodTypesIfPossible)();
30
- // TODO: (Maybe?) enable saving of inserted input props by cmd+s /ctrl + s (also for JSON view)
31
30
  if (typeName === z.ZodFirstPartyTypeKind.ZodObject) {
32
31
  return ((0, jsx_runtime_1.jsx)(ZodObjectEditor_1.ZodObjectEditor, { setValue: setValue, value: value, defaultValue: defaultValue, jsonPath: jsonPath, schema: schema, onSave: onSave, showSaveButton: showSaveButton, onRemove: onRemove, saving: saving, saveDisabledByParent: saveDisabledByParent, mayPad: mayPad }));
33
32
  }
@@ -11,16 +11,22 @@ const useLocalState = ({ value, schema, setValue, defaultValue, }) => {
11
11
  const parentRevision = (0, react_1.useContext)(RevisionContext).childResetRevision;
12
12
  const [resetRevision, setResetRevision] = (0, react_1.useState)(0);
13
13
  const [localValue, setLocalValue] = (0, react_1.useState)(() => {
14
- return {};
14
+ return {
15
+ [parentRevision]: {
16
+ value,
17
+ keyStabilityRevision: 0,
18
+ zodValidation: schema.safeParse(value),
19
+ },
20
+ };
15
21
  });
16
22
  const currentLocalValue = (0, react_1.useMemo)(() => {
17
23
  var _a;
18
24
  return ((_a = localValue[parentRevision]) !== null && _a !== void 0 ? _a : {
19
25
  value: defaultValue,
20
26
  keyStabilityRevision: 0,
21
- zodValidation: schema.safeParse(value),
27
+ zodValidation: schema.safeParse(defaultValue),
22
28
  });
23
- }, [defaultValue, localValue, parentRevision, schema, value]);
29
+ }, [defaultValue, localValue, parentRevision, schema]);
24
30
  const stateRef = (0, react_1.useRef)(currentLocalValue);
25
31
  stateRef.current = currentLocalValue;
26
32
  const onChange = (0, react_1.useCallback)(
@@ -1,2 +1,2 @@
1
1
  import type { Codec } from '@remotion/renderer';
2
- export declare const humanReadableCodec: (codec: Codec) => "AAC" | "MP3" | "GIF" | "H.264" | "H.264 Matroska" | "H.265" | "ProRes" | "WebM VP8" | "WebM VP9" | "Waveform" | undefined;
2
+ export declare const humanReadableCodec: (codec: Codec) => "GIF" | "AAC" | "MP3" | "H.264" | "H.264 Matroska" | "H.265" | "ProRes" | "WebM VP8" | "WebM VP9" | "Waveform" | undefined;
@@ -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,7 +9,6 @@ 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");
14
13
  const timeline_refs_1 = require("./timeline-refs");
15
14
  const timeline_scroll_logic_1 = require("./timeline-scroll-logic");
@@ -17,6 +16,7 @@ const TimelineInOutPointer_1 = require("./TimelineInOutPointer");
17
16
  const TimelineInOutPointerHandle_1 = require("./TimelineInOutPointerHandle");
18
17
  const TimelineSlider_1 = require("./TimelineSlider");
19
18
  const TimelineWidthProvider_1 = require("./TimelineWidthProvider");
19
+ const TimelineInOutToggle_1 = require("../TimelineInOutToggle");
20
20
  const inner = {
21
21
  overflowY: 'auto',
22
22
  overflowX: 'hidden',
@@ -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;