@remotion/cli 3.3.32 → 3.3.34

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 (114) hide show
  1. package/dist/config/log.d.ts +1 -1
  2. package/dist/convert-entry-point-to-serve-url.d.ts +1 -0
  3. package/dist/convert-entry-point-to-serve-url.js +15 -0
  4. package/dist/editor/components/CollapsableOptions.d.ts +6 -0
  5. package/dist/editor/components/CollapsableOptions.js +35 -0
  6. package/dist/editor/components/InlineAction.d.ts +5 -0
  7. package/dist/editor/components/InlineAction.js +34 -0
  8. package/dist/editor/components/Modals.d.ts +2 -0
  9. package/dist/editor/components/Modals.js +23 -0
  10. package/dist/editor/components/NewComposition/InputDragger.d.ts +1 -0
  11. package/dist/editor/components/NewComposition/InputDragger.js +22 -4
  12. package/dist/editor/components/NewComposition/NewCompDuration.js +5 -3
  13. package/dist/editor/components/NewComposition/NewComposition.js +5 -5
  14. package/dist/editor/components/RenderButton.d.ts +6 -0
  15. package/dist/editor/components/RenderButton.js +46 -0
  16. package/dist/editor/components/RenderModal/RenderErrorModal.d.ts +5 -0
  17. package/dist/editor/components/RenderModal/RenderErrorModal.js +64 -0
  18. package/dist/editor/components/RenderModal/RenderModal.d.ts +14 -0
  19. package/dist/editor/components/RenderModal/RenderModal.js +377 -0
  20. package/dist/editor/components/RenderQueue/CircularProgress.d.ts +5 -0
  21. package/dist/editor/components/RenderQueue/CircularProgress.js +18 -0
  22. package/dist/editor/components/RenderQueue/RenderQueueError.d.ts +5 -0
  23. package/dist/editor/components/RenderQueue/RenderQueueError.js +26 -0
  24. package/dist/editor/components/RenderQueue/RenderQueueItem.d.ts +5 -0
  25. package/dist/editor/components/RenderQueue/RenderQueueItem.js +39 -0
  26. package/dist/editor/components/RenderQueue/RenderQueueItemCancelButton.d.ts +5 -0
  27. package/dist/editor/components/RenderQueue/RenderQueueItemCancelButton.js +22 -0
  28. package/dist/editor/components/RenderQueue/RenderQueueItemStatus.d.ts +5 -0
  29. package/dist/editor/components/RenderQueue/RenderQueueItemStatus.js +27 -0
  30. package/dist/editor/components/RenderQueue/RenderQueueOutputName.d.ts +5 -0
  31. package/dist/editor/components/RenderQueue/RenderQueueOutputName.js +24 -0
  32. package/dist/editor/components/RenderQueue/RenderQueueProgressMessage.d.ts +5 -0
  33. package/dist/editor/components/RenderQueue/RenderQueueProgressMessage.js +27 -0
  34. package/dist/editor/components/RenderQueue/RenderQueueRemoveItem.d.ts +5 -0
  35. package/dist/editor/components/RenderQueue/RenderQueueRemoveItem.js +22 -0
  36. package/dist/editor/components/RenderQueue/RenderQueueRepeat.d.ts +5 -0
  37. package/dist/editor/components/RenderQueue/RenderQueueRepeat.js +22 -0
  38. package/dist/editor/components/RenderQueue/actions.d.ts +35 -0
  39. package/dist/editor/components/RenderQueue/actions.js +84 -0
  40. package/dist/editor/components/RenderQueue/context.d.ts +19 -0
  41. package/dist/editor/components/RenderQueue/context.js +56 -0
  42. package/dist/editor/components/RenderQueue/index.d.ts +2 -0
  43. package/dist/editor/components/RenderQueue/index.js +18 -0
  44. package/dist/editor/components/RenderQueue/item-style.d.ts +2 -0
  45. package/dist/editor/components/RenderQueue/item-style.js +21 -0
  46. package/dist/editor/components/RenderToolbarIcon.d.ts +2 -0
  47. package/dist/editor/components/RenderToolbarIcon.js +56 -0
  48. package/dist/editor/components/RendersTab.d.ts +6 -0
  49. package/dist/editor/components/RendersTab.js +43 -0
  50. package/dist/editor/components/SegmentedControl.d.ts +16 -0
  51. package/dist/editor/components/SegmentedControl.js +63 -0
  52. package/dist/editor/components/SidebarContent.d.ts +5 -0
  53. package/dist/editor/components/SidebarContent.js +51 -0
  54. package/dist/editor/components/Tabs/index.d.ts +11 -0
  55. package/dist/editor/components/Tabs/index.js +51 -0
  56. package/dist/editor/components/Timeline/Timeline.js +11 -5
  57. package/dist/editor/helpers/client-id.d.ts +17 -0
  58. package/dist/editor/helpers/client-id.js +46 -0
  59. package/dist/editor/helpers/use-file-existence.d.ts +1 -0
  60. package/dist/editor/helpers/use-file-existence.js +66 -0
  61. package/dist/editor/icons/RenderStillIcon.d.ts +3 -0
  62. package/dist/editor/icons/RenderStillIcon.js +8 -0
  63. package/dist/editor/icons/render.d.ts +5 -0
  64. package/dist/editor/icons/render.js +8 -0
  65. package/dist/editor/icons/video.d.ts +5 -0
  66. package/dist/editor/icons/video.js +8 -0
  67. package/dist/editor/state/z-index.js +24 -11
  68. package/dist/file-watcher.d.ts +9 -0
  69. package/dist/file-watcher.js +35 -0
  70. package/dist/get-cli-options.d.ts +1 -1
  71. package/dist/get-default-out-name.d.ts +5 -0
  72. package/dist/get-default-out-name.js +10 -0
  73. package/dist/index.d.ts +1 -1
  74. package/dist/preview-server/api-routes.d.ts +4 -0
  75. package/dist/preview-server/api-routes.js +17 -0
  76. package/dist/preview-server/api-types.d.ts +27 -0
  77. package/dist/preview-server/api-types.js +2 -0
  78. package/dist/preview-server/file-existence-watchers.d.ts +13 -0
  79. package/dist/preview-server/file-existence-watchers.js +62 -0
  80. package/dist/preview-server/handler.d.ts +9 -0
  81. package/dist/preview-server/handler.js +34 -0
  82. package/dist/preview-server/parse-body.d.ts +2 -0
  83. package/dist/preview-server/parse-body.js +16 -0
  84. package/dist/preview-server/render-queue/job.d.ts +86 -0
  85. package/dist/preview-server/render-queue/job.js +2 -0
  86. package/dist/preview-server/render-queue/make-retry-payload.d.ts +3 -0
  87. package/dist/preview-server/render-queue/make-retry-payload.js +37 -0
  88. package/dist/preview-server/render-queue/open-directory-in-finder.d.ts +1 -0
  89. package/dist/preview-server/render-queue/open-directory-in-finder.js +34 -0
  90. package/dist/preview-server/render-queue/process-still.d.ts +8 -0
  91. package/dist/preview-server/render-queue/process-still.js +50 -0
  92. package/dist/preview-server/render-queue/process-video.d.ts +8 -0
  93. package/dist/preview-server/render-queue/process-video.js +59 -0
  94. package/dist/preview-server/render-queue/queue.d.ts +21 -0
  95. package/dist/preview-server/render-queue/queue.js +185 -0
  96. package/dist/preview-server/routes/add-render.d.ts +3 -0
  97. package/dist/preview-server/routes/add-render.js +54 -0
  98. package/dist/preview-server/routes/cancel-render.d.ts +3 -0
  99. package/dist/preview-server/routes/cancel-render.js +9 -0
  100. package/dist/preview-server/routes/open-in-file-explorer.d.ts +3 -0
  101. package/dist/preview-server/routes/open-in-file-explorer.js +14 -0
  102. package/dist/preview-server/routes/remove-render.d.ts +3 -0
  103. package/dist/preview-server/routes/remove-render.js +9 -0
  104. package/dist/preview-server/routes/subscribe-to-file-existence.d.ts +3 -0
  105. package/dist/preview-server/routes/subscribe-to-file-existence.js +13 -0
  106. package/dist/preview-server/routes/unsubscribe-from-file-existence.d.ts +3 -0
  107. package/dist/preview-server/routes/unsubscribe-from-file-existence.js +13 -0
  108. package/dist/preview-server/start-server.js +2 -1
  109. package/dist/render-flows/render.d.ts +38 -0
  110. package/dist/render-flows/render.js +256 -0
  111. package/dist/render-flows/still.d.ts +32 -0
  112. package/dist/render-flows/still.js +170 -0
  113. package/dist/render.js +1 -1
  114. package/package.json +7 -7
@@ -1,3 +1,3 @@
1
1
  import type { LogLevel } from '@remotion/renderer';
2
- export declare const getLogLevel: () => "verbose" | "error" | "info" | "warn";
2
+ export declare const getLogLevel: () => "verbose" | "info" | "warn" | "error";
3
3
  export declare const setLogLevel: (newLogLevel: LogLevel) => void;
@@ -0,0 +1 @@
1
+ export declare const convertEntryPointToServeUrl: (entryPoint: string) => string;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.convertEntryPointToServeUrl = void 0;
7
+ const renderer_1 = require("@remotion/renderer");
8
+ const path_1 = __importDefault(require("path"));
9
+ const convertEntryPointToServeUrl = (entryPoint) => {
10
+ const fullPath = renderer_1.RenderInternals.isServeUrl(entryPoint)
11
+ ? entryPoint
12
+ : path_1.default.resolve(process.cwd(), entryPoint);
13
+ return fullPath;
14
+ };
15
+ exports.convertEntryPointToServeUrl = convertEntryPointToServeUrl;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ export declare const CollapsableOptions: React.FC<{
3
+ children: React.ReactNode;
4
+ showLabel: string;
5
+ hideLabel: string;
6
+ }>;
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CollapsableOptions = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const colors_1 = require("../helpers/colors");
7
+ const z_index_1 = require("../state/z-index");
8
+ const layout_1 = require("./layout");
9
+ const TimelineCollapseToggle_1 = require("./Timeline/TimelineCollapseToggle");
10
+ const container = {
11
+ marginLeft: 16,
12
+ height: 40,
13
+ display: 'flex',
14
+ flexDirection: 'row',
15
+ alignItems: 'center',
16
+ };
17
+ const buttonStyle = {
18
+ border: 'none',
19
+ padding: 0,
20
+ appearance: 'none',
21
+ display: 'flex',
22
+ flexDirection: 'row',
23
+ alignItems: 'center',
24
+ fontSize: 14,
25
+ color: colors_1.LIGHT_TEXT,
26
+ };
27
+ const CollapsableOptions = ({ children, showLabel, hideLabel }) => {
28
+ const [show, setShow] = (0, react_1.useState)(false);
29
+ const { tabIndex } = (0, z_index_1.useZIndex)();
30
+ const onClick = (0, react_1.useCallback)(() => {
31
+ setShow((s) => !s);
32
+ }, []);
33
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { style: container, children: (0, jsx_runtime_1.jsxs)("button", { style: buttonStyle, tabIndex: tabIndex, onClick: onClick, type: "button", children: [(0, jsx_runtime_1.jsx)(TimelineCollapseToggle_1.TimelineCollapseToggle, { color: colors_1.LIGHT_TEXT, collapsed: !show }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { block: true, x: 1 }), show ? hideLabel : showLabel] }) }), show ? children : null] }));
34
+ };
35
+ exports.CollapsableOptions = CollapsableOptions;
@@ -0,0 +1,5 @@
1
+ import type { PropsWithChildren } from 'react';
2
+ import React from 'react';
3
+ export declare const InlineAction: React.FC<PropsWithChildren<{
4
+ onClick: React.MouseEventHandler<HTMLAnchorElement> | undefined;
5
+ }>>;
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InlineAction = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const colors_1 = require("../helpers/colors");
7
+ const z_index_1 = require("../state/z-index");
8
+ const InlineAction = ({ children, onClick }) => {
9
+ const { tabIndex } = (0, z_index_1.useZIndex)();
10
+ const [hovered, setHovered] = (0, react_1.useState)(false);
11
+ const onPointerEnter = (0, react_1.useCallback)(() => {
12
+ setHovered(true);
13
+ }, []);
14
+ const onPointerLeave = (0, react_1.useCallback)(() => {
15
+ setHovered(false);
16
+ }, []);
17
+ const style = (0, react_1.useMemo)(() => {
18
+ return {
19
+ border: 'none',
20
+ background: hovered ? colors_1.CLEAR_HOVER : 'transparent',
21
+ height: 24,
22
+ width: 24,
23
+ display: 'inline-flex',
24
+ justifyContent: 'center',
25
+ alignItems: 'center',
26
+ borderRadius: 3,
27
+ opacity: hovered ? 1 : 0.6,
28
+ };
29
+ }, [hovered]);
30
+ return (
31
+ // <div> because cannot use button inside a button
32
+ (0, jsx_runtime_1.jsx)("a", { onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, onClick: onClick, style: style, tabIndex: tabIndex, children: children }));
33
+ };
34
+ exports.InlineAction = InlineAction;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const Modals: React.FC;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.Modals = void 0;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const react_1 = require("react");
9
+ const client_id_1 = require("../helpers/client-id");
10
+ const modals_1 = require("../state/modals");
11
+ const NewComposition_1 = __importDefault(require("./NewComposition/NewComposition"));
12
+ const QuickSwitcher_1 = __importDefault(require("./QuickSwitcher/QuickSwitcher"));
13
+ const RenderErrorModal_1 = require("./RenderModal/RenderErrorModal");
14
+ const RenderModal_1 = require("./RenderModal/RenderModal");
15
+ const UpdateModal_1 = require("./UpdateModal/UpdateModal");
16
+ const Modals = () => {
17
+ const { selectedModal: modalContextType } = (0, react_1.useContext)(modals_1.ModalsContext);
18
+ const canRender = (0, react_1.useContext)(client_id_1.PreviewServerConnectionCtx).type === 'connected';
19
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [modalContextType && modalContextType.type === 'new-comp' && ((0, jsx_runtime_1.jsx)(NewComposition_1.default, { initialCompType: modalContextType.compType })), modalContextType && canRender && modalContextType.type === 'render' && ((0, jsx_runtime_1.jsx)(RenderModal_1.RenderModal, { initialFrame: modalContextType.initialFrame, compositionId: modalContextType.compositionId, initialImageFormat: modalContextType.initialImageFormat, initialQuality: modalContextType.initialQuality, initialOutName: modalContextType.initialOutName, initialScale: modalContextType.initialScale, initialVerbose: modalContextType.initialVerbose, initialRenderType: modalContextType.initialRenderType, initialCodec: modalContextType.initialCodec })), modalContextType &&
20
+ canRender &&
21
+ modalContextType.type === 'render-error' && ((0, jsx_runtime_1.jsx)(RenderErrorModal_1.RenderErrorModal, { job: modalContextType.job })), modalContextType && modalContextType.type === 'update' && ((0, jsx_runtime_1.jsx)(UpdateModal_1.UpdateModal, { info: modalContextType.info })), modalContextType && modalContextType.type === 'quick-switcher' && ((0, jsx_runtime_1.jsx)(QuickSwitcher_1.default, { invocationTimestamp: modalContextType.invocationTimestamp, initialMode: modalContextType.mode }))] }));
22
+ };
23
+ exports.Modals = Modals;
@@ -2,6 +2,7 @@ import type { InputHTMLAttributes } from 'react';
2
2
  import React from 'react';
3
3
  declare type Props = InputHTMLAttributes<HTMLInputElement> & {
4
4
  onValueChange: (newVal: number) => void;
5
+ onTextChange: (newVal: string) => void;
5
6
  };
6
7
  export declare const InputDragger: React.FC<Props>;
7
8
  export {};
@@ -8,7 +8,7 @@ const noop_1 = require("../../helpers/noop");
8
8
  const input_dragger_click_lock_1 = require("../../state/input-dragger-click-lock");
9
9
  const z_index_1 = require("../../state/z-index");
10
10
  const RemInput_1 = require("./RemInput");
11
- const InputDragger = ({ onValueChange, min: _min, step: _step, value, ...props }) => {
11
+ const InputDragger = ({ onValueChange, min: _min, step: _step, value, onTextChange, ...props }) => {
12
12
  const [inputFallback, setInputFallback] = (0, react_1.useState)(false);
13
13
  const fallbackRef = (0, react_1.useRef)(null);
14
14
  const style = (0, react_1.useMemo)(() => {
@@ -35,12 +35,30 @@ const InputDragger = ({ onValueChange, min: _min, step: _step, value, ...props }
35
35
  }
36
36
  setInputFallback(true);
37
37
  }, []);
38
- const onBlur = (0, react_1.useCallback)(() => {
38
+ const onEscape = (0, react_1.useCallback)(() => {
39
39
  setInputFallback(false);
40
40
  }, []);
41
+ const onBlur = (0, react_1.useCallback)(() => {
42
+ if (!fallbackRef.current) {
43
+ return;
44
+ }
45
+ const newValue = fallbackRef.current.value;
46
+ if (newValue.trim() === '') {
47
+ onEscape();
48
+ return;
49
+ }
50
+ if (fallbackRef.current.checkValidity()) {
51
+ onTextChange === null || onTextChange === void 0 ? void 0 : onTextChange(newValue);
52
+ setInputFallback(false);
53
+ }
54
+ else {
55
+ fallbackRef.current.reportValidity();
56
+ }
57
+ }, [onEscape, onTextChange]);
41
58
  const onKeyPress = (0, react_1.useCallback)((e) => {
59
+ var _a;
42
60
  if (e.key === 'Enter') {
43
- setInputFallback(false);
61
+ (_a = fallbackRef.current) === null || _a === void 0 ? void 0 : _a.blur();
44
62
  }
45
63
  }, []);
46
64
  const onPointerDown = (0, react_1.useCallback)((e) => {
@@ -75,7 +93,7 @@ const InputDragger = ({ onValueChange, min: _min, step: _step, value, ...props }
75
93
  }
76
94
  }, [inputFallback]);
77
95
  if (inputFallback) {
78
- return ((0, jsx_runtime_1.jsx)(z_index_1.HigherZIndex, { onEscape: onBlur, onOutsideClick: noop_1.noop, children: (0, jsx_runtime_1.jsx)(RemInput_1.RemotionInput, { ref: fallbackRef, autoFocus: true, onKeyPress: onKeyPress, onBlur: onBlur, value: value, min: _min, step: _step, ...props }) }));
96
+ 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, ...props }) }));
79
97
  }
80
98
  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: value }) }));
81
99
  };
@@ -9,13 +9,15 @@ const InputDragger_1 = require("./InputDragger");
9
9
  const new_comp_layout_1 = require("./new-comp-layout");
10
10
  const ValidationMessage_1 = require("./ValidationMessage");
11
11
  const NewCompDuration = ({ durationInFrames, setDurationInFrames, fps }) => {
12
- const onDurationInFramesChanged = (0, react_1.useCallback)((e) => {
13
- setDurationInFrames(String(Number(e.target.value)));
12
+ const onDurationInFramesChanged = (0, react_1.useCallback)((newValue) => {
13
+ setDurationInFrames(String(Number(newValue)));
14
14
  }, [setDurationInFrames]);
15
15
  const onDurationChangedDirectly = (0, react_1.useCallback)((newVal) => {
16
16
  setDurationInFrames(String(newVal));
17
17
  }, [setDurationInFrames]);
18
18
  const compDurationErrMessage = (0, validate_new_comp_data_1.validateCompositionDuration)(durationInFrames);
19
- return ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("label", { children: (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: new_comp_layout_1.leftLabel, children: " Duration in frames" }), (0, jsx_runtime_1.jsxs)("div", { style: new_comp_layout_1.inputArea, children: [(0, jsx_runtime_1.jsx)(InputDragger_1.InputDragger, { type: "number", value: durationInFrames, onChange: onDurationInFramesChanged, placeholder: "Duration (frames)", name: "durationInFrames", min: 1, step: 1, max: 100000000, onValueChange: onDurationChangedDirectly }), compDurationErrMessage ? ((0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { message: compDurationErrMessage })) : null] }), (0, jsx_runtime_1.jsxs)("span", { style: new_comp_layout_1.rightLabel, children: [(Number(durationInFrames) / Number(fps)).toFixed(2), "sec"] })] }) }) }));
19
+ return ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("label", { children: (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: new_comp_layout_1.leftLabel, children: " Duration in frames" }), (0, jsx_runtime_1.jsxs)("div", { style: new_comp_layout_1.inputArea, children: [(0, jsx_runtime_1.jsx)(InputDragger_1.InputDragger, { type: "number", value: durationInFrames, onTextChange: onDurationInFramesChanged, placeholder: "Duration (frames)", name: "durationInFrames", min: 1, step: 1, required: true,
20
+ // Hitting Promise.all() limit in Chrome
21
+ max: 300000, onValueChange: onDurationChangedDirectly }), compDurationErrMessage ? ((0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { message: compDurationErrMessage })) : null] }), (0, jsx_runtime_1.jsxs)("span", { style: new_comp_layout_1.rightLabel, children: [(Number(durationInFrames) / Number(fps)).toFixed(2), "sec"] })] }) }) }));
20
22
  };
21
23
  exports.NewCompDuration = NewCompDuration;
@@ -84,10 +84,10 @@ const NewComposition = (props) => {
84
84
  const onTypeChanged = (0, react_1.useCallback)((newType) => {
85
85
  setType(newType);
86
86
  }, []);
87
- const onWidthChanged = (0, react_1.useCallback)((e) => {
87
+ const onWidthChanged = (0, react_1.useCallback)((newValue) => {
88
88
  setSize((s) => {
89
89
  const { height } = s;
90
- const newWidth = Number(e.target.value);
90
+ const newWidth = Number(newValue);
91
91
  return {
92
92
  height: lockedAspectRatio === null
93
93
  ? height
@@ -118,10 +118,10 @@ const NewComposition = (props) => {
118
118
  };
119
119
  });
120
120
  }, [lockedAspectRatio]);
121
- const onHeightChanged = (0, react_1.useCallback)((e) => {
121
+ const onHeightChanged = (0, react_1.useCallback)((newValue) => {
122
122
  setSize((s) => {
123
123
  const { width } = s;
124
- const newHeight = Number(e.target.value);
124
+ const newHeight = Number(newValue);
125
125
  return {
126
126
  width: lockedAspectRatio === null
127
127
  ? width
@@ -180,7 +180,7 @@ const NewComposition = (props) => {
180
180
  },
181
181
  ];
182
182
  }, [onTypeChanged]);
183
- return ((0, jsx_runtime_1.jsxs)(ModalContainer_1.ModalContainer, { onOutsideClick: onQuit, onEscape: onQuit, children: [(0, jsx_runtime_1.jsx)(ModalHeader_1.NewCompHeader, { title: "New composition" }), (0, jsx_runtime_1.jsxs)("div", { style: panelContent, children: [(0, jsx_runtime_1.jsxs)("div", { style: left, children: [(0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 3 }), (0, jsx_runtime_1.jsxs)("form", { children: [(0, jsx_runtime_1.jsxs)("label", { children: [(0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: new_comp_layout_1.leftLabel, children: "Type" }), (0, jsx_runtime_1.jsx)("div", { style: new_comp_layout_1.inputArea, children: (0, jsx_runtime_1.jsx)(ComboBox_1.Combobox, { title: "Type of composition", style: comboBoxStyle, values: typeValues, selectedId: type }) })] }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1 }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: new_comp_layout_1.leftLabel, children: "Name" }), (0, jsx_runtime_1.jsxs)("div", { style: new_comp_layout_1.inputArea, children: [(0, jsx_runtime_1.jsx)(RemInput_1.RemotionInput, { value: name, onChange: onNameChange, type: "text", placeholder: "Composition name" }), compNameErrMessage ? ((0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { message: compNameErrMessage })) : null] })] })] }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1 }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("label", { children: (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: new_comp_layout_1.leftLabel, children: "Width" }), (0, jsx_runtime_1.jsxs)("div", { style: new_comp_layout_1.inputArea, children: [(0, jsx_runtime_1.jsx)(InputDragger_1.InputDragger, { type: "number", value: size.width, placeholder: "Width (px)", onChange: onWidthChanged, name: "width", step: 2, min: 2, max: 100000000, onValueChange: onWidthDirectlyChanged }), compWidthErrMessage ? ((0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { message: compWidthErrMessage })) : null] })] }) }) }), (0, jsx_runtime_1.jsx)("div", {}), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1 }), (0, jsx_runtime_1.jsx)("div", {}), (0, jsx_runtime_1.jsx)("label", { children: (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: new_comp_layout_1.leftLabel, children: "Height" }), (0, jsx_runtime_1.jsxs)("div", { style: new_comp_layout_1.inputArea, children: [(0, jsx_runtime_1.jsx)(InputDragger_1.InputDragger, { type: "number", value: size.height, onChange: onHeightChanged, placeholder: "Height (px)", name: "height", step: 2, min: 2, max: 100000000, onValueChange: onHeightDirectlyChanged }), compHeightErrMessage ? ((0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { message: compHeightErrMessage })) : null] })] }) })] }), (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(NewCompAspectRatio_1.NewCompAspectRatio, { width: Number(size.width), height: Number(size.height), aspectRatioLocked: lockedAspectRatio, setAspectRatioLocked: setAspectRatioLocked }) })] }), (0, jsx_runtime_1.jsx)("div", {}), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1 }), type === 'composition' ? ((0, jsx_runtime_1.jsx)(NewCompDuration_1.NewCompDuration, { durationInFrames: durationInFrames, fps: selectedFrameRate, setDurationInFrames: setDurationInFrames })) : null, (0, jsx_runtime_1.jsx)("div", {}), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)("div", {}), type === 'composition' ? ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", {}), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1 }), (0, jsx_runtime_1.jsxs)("label", { children: [(0, jsx_runtime_1.jsx)("div", { style: new_comp_layout_1.leftLabel, children: "Framerate" }), (0, jsx_runtime_1.jsx)(ComboBox_1.Combobox, { title: "Framerate", style: comboBoxStyle, values: items, selectedId: selectedFrameRate })] })] })) : null] })] }), (0, jsx_runtime_1.jsxs)("div", { style: panelRight, children: [(0, jsx_runtime_1.jsx)("pre", { style: pre, children: (0, NewCompCode_1.getNewCompositionCode)({
183
+ return ((0, jsx_runtime_1.jsxs)(ModalContainer_1.ModalContainer, { onOutsideClick: onQuit, onEscape: onQuit, children: [(0, jsx_runtime_1.jsx)(ModalHeader_1.NewCompHeader, { title: "New composition" }), (0, jsx_runtime_1.jsxs)("div", { style: panelContent, children: [(0, jsx_runtime_1.jsxs)("div", { style: left, children: [(0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 3 }), (0, jsx_runtime_1.jsxs)("form", { children: [(0, jsx_runtime_1.jsxs)("label", { children: [(0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: new_comp_layout_1.leftLabel, children: "Type" }), (0, jsx_runtime_1.jsx)("div", { style: new_comp_layout_1.inputArea, children: (0, jsx_runtime_1.jsx)(ComboBox_1.Combobox, { title: "Type of composition", style: comboBoxStyle, values: typeValues, selectedId: type }) })] }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1 }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: new_comp_layout_1.leftLabel, children: "Name" }), (0, jsx_runtime_1.jsxs)("div", { style: new_comp_layout_1.inputArea, children: [(0, jsx_runtime_1.jsx)(RemInput_1.RemotionInput, { value: name, onChange: onNameChange, type: "text", placeholder: "Composition name" }), compNameErrMessage ? ((0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { message: compNameErrMessage })) : null] })] })] }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1 }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("label", { children: (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: new_comp_layout_1.leftLabel, children: "Width" }), (0, jsx_runtime_1.jsxs)("div", { style: new_comp_layout_1.inputArea, children: [(0, jsx_runtime_1.jsx)(InputDragger_1.InputDragger, { type: "number", value: size.width, placeholder: "Width (px)", onTextChange: onWidthChanged, name: "width", step: 2, min: 2, required: true, max: 100000000, onValueChange: onWidthDirectlyChanged }), compWidthErrMessage ? ((0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { message: compWidthErrMessage })) : null] })] }) }) }), (0, jsx_runtime_1.jsx)("div", {}), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1 }), (0, jsx_runtime_1.jsx)("div", {}), (0, jsx_runtime_1.jsx)("label", { children: (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: new_comp_layout_1.leftLabel, children: "Height" }), (0, jsx_runtime_1.jsxs)("div", { style: new_comp_layout_1.inputArea, children: [(0, jsx_runtime_1.jsx)(InputDragger_1.InputDragger, { type: "number", value: size.height, onTextChange: onHeightChanged, placeholder: "Height (px)", name: "height", step: 2, required: true, min: 2, max: 100000000, onValueChange: onHeightDirectlyChanged }), compHeightErrMessage ? ((0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { message: compHeightErrMessage })) : null] })] }) })] }), (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(NewCompAspectRatio_1.NewCompAspectRatio, { width: Number(size.width), height: Number(size.height), aspectRatioLocked: lockedAspectRatio, setAspectRatioLocked: setAspectRatioLocked }) })] }), (0, jsx_runtime_1.jsx)("div", {}), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1 }), type === 'composition' ? ((0, jsx_runtime_1.jsx)(NewCompDuration_1.NewCompDuration, { durationInFrames: durationInFrames, fps: selectedFrameRate, setDurationInFrames: setDurationInFrames })) : null, (0, jsx_runtime_1.jsx)("div", {}), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)("div", {}), type === 'composition' ? ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", {}), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1 }), (0, jsx_runtime_1.jsxs)("label", { children: [(0, jsx_runtime_1.jsx)("div", { style: new_comp_layout_1.leftLabel, children: "Framerate" }), (0, jsx_runtime_1.jsx)(ComboBox_1.Combobox, { title: "Framerate", style: comboBoxStyle, values: items, selectedId: selectedFrameRate })] })] })) : null] })] }), (0, jsx_runtime_1.jsxs)("div", { style: panelRight, children: [(0, jsx_runtime_1.jsx)("pre", { style: pre, children: (0, NewCompCode_1.getNewCompositionCode)({
184
184
  type,
185
185
  durationInFrames: Number(durationInFrames),
186
186
  fps: Number(selectedFrameRate),
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import type { TCompMetadata } from 'remotion';
3
+ export declare const RenderButton: React.FC<{
4
+ composition: TCompMetadata;
5
+ visible: boolean;
6
+ }>;
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RenderButton = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const get_default_out_name_1 = require("../../get-default-out-name");
7
+ const render_1 = require("../icons/render");
8
+ const modals_1 = require("../state/modals");
9
+ const InlineAction_1 = require("./InlineAction");
10
+ const RenderButton = ({ composition, visible }) => {
11
+ const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
12
+ const iconStyle = (0, react_1.useMemo)(() => {
13
+ return {
14
+ style: {
15
+ height: 12,
16
+ },
17
+ };
18
+ }, []);
19
+ const isVideo = composition.durationInFrames > 1;
20
+ const onClick = (0, react_1.useCallback)((e) => {
21
+ var _a, _b, _c, _d, _e;
22
+ e.stopPropagation();
23
+ setSelectedModal({
24
+ type: 'render',
25
+ compositionId: composition.id,
26
+ initialFrame: 0,
27
+ initialImageFormat: isVideo ? 'jpeg' : 'png',
28
+ // TODO: Determine defaults from config file
29
+ initialQuality: (_b = (_a = window.remotion_renderDefaults) === null || _a === void 0 ? void 0 : _a.quality) !== null && _b !== void 0 ? _b : 80,
30
+ initialScale: (_d = (_c = window.remotion_renderDefaults) === null || _c === void 0 ? void 0 : _c.scale) !== null && _d !== void 0 ? _d : 1,
31
+ initialVerbose: ((_e = window.remotion_renderDefaults) === null || _e === void 0 ? void 0 : _e.logLevel) === 'verbose',
32
+ initialOutName: (0, get_default_out_name_1.getDefaultOutLocation)({
33
+ compositionName: composition.id,
34
+ defaultExtension: isVideo ? 'mp4' : 'png',
35
+ type: 'asset',
36
+ }),
37
+ initialRenderType: isVideo ? 'video' : 'still',
38
+ initialCodec: 'h264',
39
+ });
40
+ }, [composition.id, isVideo, setSelectedModal]);
41
+ if (!visible) {
42
+ return null;
43
+ }
44
+ return ((0, jsx_runtime_1.jsx)(InlineAction_1.InlineAction, { onClick: onClick, children: (0, jsx_runtime_1.jsx)(render_1.RenderIcon, { svgProps: iconStyle }) }));
45
+ };
46
+ exports.RenderButton = RenderButton;
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import type { RenderJob } from '../../../preview-server/render-queue/job';
3
+ export declare const RenderErrorModal: React.FC<{
4
+ job: RenderJob;
5
+ }>;
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RenderErrorModal = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const Button_1 = require("../../../preview-server/error-overlay/remotion-overlay/Button");
7
+ const make_retry_payload_1 = require("../../../preview-server/render-queue/make-retry-payload");
8
+ const modals_1 = require("../../state/modals");
9
+ const layout_1 = require("../layout");
10
+ const ModalContainer_1 = require("../ModalContainer");
11
+ const ModalHeader_1 = require("../ModalHeader");
12
+ const NotificationCenter_1 = require("../Notifications/NotificationCenter");
13
+ const actions_1 = require("../RenderQueue/actions");
14
+ const container = {
15
+ padding: 20,
16
+ maxWidth: 1200,
17
+ paddingTop: 0,
18
+ };
19
+ const codeBlock = {
20
+ backgroundColor: 'black',
21
+ whiteSpace: 'pre',
22
+ padding: 12,
23
+ borderRadius: 4,
24
+ fontFamily: 'monospace',
25
+ overflow: 'auto',
26
+ maxHeight: 300,
27
+ };
28
+ const spacer = {
29
+ height: layout_1.SPACING_UNIT,
30
+ width: layout_1.SPACING_UNIT,
31
+ };
32
+ const buttonRow = {
33
+ display: 'flex',
34
+ flexDirection: 'row',
35
+ justifyContent: 'flex-end',
36
+ };
37
+ const RenderErrorModal = ({ job }) => {
38
+ const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
39
+ const onQuit = (0, react_1.useCallback)(() => {
40
+ setSelectedModal(null);
41
+ }, [setSelectedModal]);
42
+ const onRetry = (0, react_1.useCallback)(() => {
43
+ const retryPayload = (0, make_retry_payload_1.makeRetryPayload)(job);
44
+ setSelectedModal(retryPayload);
45
+ }, [job, setSelectedModal]);
46
+ const onClickOnRemove = (0, react_1.useCallback)(() => {
47
+ setSelectedModal(null);
48
+ (0, actions_1.removeRenderJob)(job).catch((err) => {
49
+ var _a;
50
+ (_a = NotificationCenter_1.notificationCenter.current) === null || _a === void 0 ? void 0 : _a.addNotification({
51
+ content: 'Failed to remove render job: ' + err.message,
52
+ created: Date.now(),
53
+ duration: 2000,
54
+ id: String(Math.random()),
55
+ });
56
+ console.log(err);
57
+ });
58
+ }, [job, setSelectedModal]);
59
+ if (job.status !== 'failed') {
60
+ throw new Error('should not have rendered this modal');
61
+ }
62
+ return ((0, jsx_runtime_1.jsxs)(ModalContainer_1.ModalContainer, { onOutsideClick: onQuit, onEscape: onQuit, children: [(0, jsx_runtime_1.jsx)(ModalHeader_1.NewCompHeader, { title: `Render ${job.compositionId}` }), (0, jsx_runtime_1.jsxs)("div", { style: container, children: [(0, jsx_runtime_1.jsx)("p", { children: "The render failed because of the following error:" }), (0, jsx_runtime_1.jsx)("div", { style: codeBlock, children: job.error.stack }), (0, jsx_runtime_1.jsx)("div", { style: spacer }), (0, jsx_runtime_1.jsxs)("div", { style: buttonRow, children: [(0, jsx_runtime_1.jsx)(Button_1.Button, { onClick: onClickOnRemove, children: "Remove render" }), (0, jsx_runtime_1.jsx)(layout_1.Flex, {}), (0, jsx_runtime_1.jsx)(Button_1.Button, { onClick: onRetry, children: "Retry" }), (0, jsx_runtime_1.jsx)("div", { style: spacer }), (0, jsx_runtime_1.jsx)(Button_1.Button, { onClick: onQuit, children: "Close" })] })] })] }));
63
+ };
64
+ exports.RenderErrorModal = RenderErrorModal;
@@ -0,0 +1,14 @@
1
+ import type { Codec, StillImageFormat } from '@remotion/renderer';
2
+ import React from 'react';
3
+ export declare type RenderType = 'still' | 'video';
4
+ export declare const RenderModal: React.FC<{
5
+ compositionId: string;
6
+ initialFrame: number;
7
+ initialImageFormat: StillImageFormat;
8
+ initialQuality: number | null;
9
+ initialScale: number;
10
+ initialVerbose: boolean;
11
+ initialOutName: string;
12
+ initialRenderType: RenderType;
13
+ initialCodec: Codec;
14
+ }>;