@remotion/cli 4.0.0-alpha.127 → 4.0.0-alpha.179
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.
- package/dist/benchmark.js +2 -2
- package/dist/codemods/update-default-props.js +13 -10
- package/dist/config/ffmpeg-executable.d.ts +5 -0
- package/dist/config/ffmpeg-executable.js +21 -0
- package/dist/config/index.d.ts +6 -2
- package/dist/config/index.js +7 -4
- package/dist/config/jpeg-quality.d.ts +2 -0
- package/dist/config/jpeg-quality.js +17 -0
- package/dist/editor/components/CheckerboardProvider.d.ts +4 -0
- package/dist/editor/components/CheckerboardProvider.js +24 -0
- package/dist/editor/components/CollapsedCompositionSelector.d.ts +4 -0
- package/dist/editor/components/{CollapsedSidebarExpander.js → CollapsedCompositionSelector.js} +8 -9
- package/dist/editor/components/EditorContexts.js +7 -71
- package/dist/editor/components/KeyboardShortcutsExplainer.js +1 -1
- package/dist/editor/components/MediaVolumeProvider.d.ts +4 -0
- package/dist/editor/components/MediaVolumeProvider.js +25 -0
- package/dist/editor/components/Menu/MenuSubItem.js +14 -1
- package/dist/editor/components/Menu/styles.d.ts +2 -0
- package/dist/editor/components/Menu/styles.js +9 -2
- package/dist/editor/components/MenuToolbar.js +2 -1
- package/dist/editor/components/Modals.js +1 -1
- package/dist/editor/components/ModalsProvider.d.ts +4 -0
- package/dist/editor/components/ModalsProvider.js +17 -0
- package/dist/editor/components/NewComposition/ComboBox.js +22 -13
- package/dist/editor/components/NewComposition/InputDragger.js +1 -1
- package/dist/editor/components/NewComposition/MenuContent.js +7 -1
- package/dist/editor/components/PlayerEmitterContext.d.ts +4 -0
- package/dist/editor/components/PlayerEmitterContext.js +11 -0
- package/dist/editor/components/QuickSwitcher/QuickSwitcherContent.js +1 -0
- package/dist/editor/components/RenderButton.js +2 -3
- package/dist/editor/components/RenderModal/JpegQualitySetting.d.ts +2 -2
- package/dist/editor/components/RenderModal/JpegQualitySetting.js +4 -4
- package/dist/editor/components/RenderModal/RenderModal.d.ts +1 -1
- package/dist/editor/components/RenderModal/RenderModal.js +13 -13
- package/dist/editor/components/RenderModal/RenderModalAdvanced.js +2 -0
- package/dist/editor/components/RenderModal/RenderModalAudio.js +0 -2
- package/dist/editor/components/RenderModal/RenderModalData.d.ts +1 -1
- package/dist/editor/components/RenderModal/RenderModalData.js +52 -6
- package/dist/editor/components/RenderModal/RenderModalJSONInputPropsEditor.d.ts +2 -0
- package/dist/editor/components/RenderModal/RenderModalJSONInputPropsEditor.js +25 -3
- package/dist/editor/components/RenderModal/RenderModalPicture.d.ts +2 -2
- package/dist/editor/components/RenderModal/RenderModalPicture.js +2 -2
- package/dist/editor/components/RenderModal/SchemaEditor/SchemaEditor.js +2 -0
- package/dist/editor/components/RenderModal/SchemaEditor/SchemaLabel.js +1 -4
- package/dist/editor/components/RenderModal/SchemaEditor/ZodArrayEditor.js +12 -3
- package/dist/editor/components/RenderModal/SchemaEditor/ZodEnumEditor.js +0 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodNonEditableValue.js +5 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodObjectEditor.js +4 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodOrNullishEditor.d.ts +15 -0
- package/dist/editor/components/RenderModal/SchemaEditor/ZodOrNullishEditor.js +45 -0
- package/dist/editor/components/RenderModal/SchemaEditor/ZodSwitch.js +4 -0
- package/dist/editor/components/RenderModal/SchemaEditor/ZodUnionEditor.d.ts +14 -0
- package/dist/editor/components/RenderModal/SchemaEditor/ZodUnionEditor.js +45 -0
- package/dist/editor/components/RenderModal/SchemaEditor/create-zod-values.d.ts +2 -0
- package/dist/editor/components/RenderModal/SchemaEditor/create-zod-values.js +150 -0
- package/dist/editor/components/RenderModal/out-name-checker.js +2 -1
- package/dist/editor/components/RenderQueue/actions.d.ts +5 -4
- package/dist/editor/components/RenderQueue/actions.js +11 -5
- package/dist/editor/components/RenderToolbarIcon.js +4 -2
- package/dist/editor/components/RendersTab.js +3 -3
- package/dist/editor/components/RichTimelineToggle.d.ts +2 -0
- package/dist/editor/components/RichTimelineToggle.js +29 -0
- package/dist/editor/components/RightPanel.js +3 -9
- package/dist/editor/components/SetTimelineInOutProvider.d.ts +4 -0
- package/dist/editor/components/SetTimelineInOutProvider.js +19 -0
- package/dist/editor/components/SidebarCollapserControls.d.ts +2 -0
- package/dist/editor/components/SidebarCollapserControls.js +122 -0
- package/dist/editor/components/Tabs/index.d.ts +1 -0
- package/dist/editor/components/Tabs/index.js +12 -5
- package/dist/editor/components/Tabs/vertical.d.ts +12 -0
- package/dist/editor/components/Tabs/vertical.js +57 -0
- package/dist/editor/components/Thumbnail.d.ts +8 -0
- package/dist/editor/components/Thumbnail.js +76 -0
- package/dist/editor/components/TopPanel.d.ts +1 -0
- package/dist/editor/components/TopPanel.js +19 -24
- package/dist/editor/components/ZoomGesturesProvider.d.ts +4 -0
- package/dist/editor/components/ZoomGesturesProvider.js +24 -0
- package/dist/editor/components/layout.d.ts +1 -0
- package/dist/editor/components/layout.js +5 -4
- package/dist/editor/helpers/use-compact-ui.d.ts +1 -0
- package/dist/editor/helpers/use-compact-ui.js +18 -0
- package/dist/editor/helpers/use-menu-structure.js +10 -22
- package/dist/editor/icons/film.d.ts +3 -0
- package/dist/editor/icons/film.js +8 -0
- package/dist/editor/icons/render.d.ts +3 -0
- package/dist/editor/icons/render.js +5 -1
- package/dist/editor/icons/timeline.d.ts +3 -0
- package/dist/editor/icons/timeline.js +9 -0
- package/dist/editor/state/modals.d.ts +1 -1
- package/dist/editor/state/rich-timeline.d.ts +9 -0
- package/dist/editor/state/rich-timeline.js +17 -0
- package/dist/editor/state/sidebar.d.ts +6 -5
- package/dist/editor/state/sidebar.js +35 -21
- package/dist/get-cli-options.d.ts +1 -1
- package/dist/get-cli-options.js +1 -1
- package/dist/get-render-media-options.d.ts +8 -0
- package/dist/get-render-media-options.js +53 -0
- package/dist/index.d.ts +1 -1
- package/dist/install.d.ts +2 -0
- package/dist/install.js +36 -0
- package/dist/parse-command-line.d.ts +1 -0
- package/dist/parse-command-line.js +5 -1
- package/dist/preview-server/api-routes.js +2 -0
- package/dist/preview-server/api-types.d.ts +2 -1
- package/dist/preview-server/render-queue/job.d.ts +13 -4
- package/dist/preview-server/render-queue/make-retry-payload.js +2 -2
- package/dist/preview-server/render-queue/process-still.js +1 -1
- package/dist/preview-server/render-queue/process-video.js +1 -1
- package/dist/preview-server/routes/add-render.js +2 -2
- package/dist/preview-server/routes/can-update-default-props.d.ts +4 -0
- package/dist/preview-server/routes/can-update-default-props.js +39 -0
- package/dist/preview-server/routes/update-default-props.js +3 -1
- package/dist/preview-server/routes.js +2 -2
- package/dist/print-help.js +2 -2
- package/dist/render-flows/render.d.ts +2 -2
- package/dist/render-flows/render.js +3 -3
- package/dist/render-flows/still.d.ts +2 -2
- package/dist/render-flows/still.js +2 -2
- package/dist/render.js +2 -2
- package/dist/still.js +2 -2
- package/package.json +7 -7
- package/dist/editor/components/CollapsedSidebarExpander.d.ts +0 -5
- package/dist/editor/components/RenderModal/SchemaEditor/schema-serialization.d.ts +0 -2
- package/dist/editor/components/RenderModal/SchemaEditor/schema-serialization.js +0 -21
|
@@ -21,9 +21,16 @@ const container = {
|
|
|
21
21
|
padding: '8px 10px',
|
|
22
22
|
display: 'inline-block',
|
|
23
23
|
backgroundColor: colors_1.INPUT_BACKGROUND,
|
|
24
|
-
fontSize: 14,
|
|
25
24
|
borderWidth: 1,
|
|
26
25
|
borderStyle: 'solid',
|
|
26
|
+
maxWidth: '100%',
|
|
27
|
+
};
|
|
28
|
+
const label = {
|
|
29
|
+
flex: 1,
|
|
30
|
+
overflow: 'hidden',
|
|
31
|
+
textOverflow: 'ellipsis',
|
|
32
|
+
fontSize: 14,
|
|
33
|
+
textAlign: 'left',
|
|
27
34
|
};
|
|
28
35
|
const Combobox = ({ values, selectedId, style: customStyle, title }) => {
|
|
29
36
|
const [hovered, setIsHovered] = (0, react_1.useState)(false);
|
|
@@ -49,13 +56,6 @@ const Combobox = ({ values, selectedId, style: customStyle, title }) => {
|
|
|
49
56
|
return setOpened((o) => {
|
|
50
57
|
if (!o) {
|
|
51
58
|
refresh === null || refresh === void 0 ? void 0 : refresh();
|
|
52
|
-
window.addEventListener('pointerup', (evt) => {
|
|
53
|
-
if (!(0, is_menu_item_1.isMenuItem)(evt.target)) {
|
|
54
|
-
setOpened(false);
|
|
55
|
-
}
|
|
56
|
-
}, {
|
|
57
|
-
once: true,
|
|
58
|
-
});
|
|
59
59
|
}
|
|
60
60
|
return !o;
|
|
61
61
|
});
|
|
@@ -97,9 +97,12 @@ const Combobox = ({ values, selectedId, style: customStyle, title }) => {
|
|
|
97
97
|
}
|
|
98
98
|
const spaceToBottom = size.windowSize.height - (size.top + size.height);
|
|
99
99
|
const spaceToTop = size.top;
|
|
100
|
-
const
|
|
100
|
+
const spaceToRight = size.windowSize.width - (size.left + size.width);
|
|
101
|
+
const minSpaceToRightRequired = styles_1.MAX_MENU_WIDTH;
|
|
102
|
+
const verticalLayout = spaceToTop > spaceToBottom ? 'bottom' : 'top';
|
|
103
|
+
const horizontalLayout = spaceToRight >= minSpaceToRightRequired ? 'left' : 'right';
|
|
101
104
|
return {
|
|
102
|
-
...(
|
|
105
|
+
...(verticalLayout === 'top'
|
|
103
106
|
? {
|
|
104
107
|
...styles_1.menuContainerTowardsBottom,
|
|
105
108
|
top: size.top + size.height,
|
|
@@ -108,7 +111,13 @@ const Combobox = ({ values, selectedId, style: customStyle, title }) => {
|
|
|
108
111
|
...styles_1.menuContainerTowardsTop,
|
|
109
112
|
bottom: size.windowSize.height - size.top,
|
|
110
113
|
}),
|
|
111
|
-
|
|
114
|
+
...(horizontalLayout === 'left'
|
|
115
|
+
? {
|
|
116
|
+
left: size.left,
|
|
117
|
+
}
|
|
118
|
+
: {
|
|
119
|
+
right: size.windowSize.width - size.left - size.width,
|
|
120
|
+
}),
|
|
112
121
|
};
|
|
113
122
|
}, [opened, size]);
|
|
114
123
|
const selected = values.find((v) => v.id === selectedId);
|
|
@@ -128,8 +137,8 @@ const Combobox = ({ values, selectedId, style: customStyle, title }) => {
|
|
|
128
137
|
: colors_1.INPUT_BORDER_COLOR_UNHOVERED,
|
|
129
138
|
};
|
|
130
139
|
}, [customStyle, hovered, opened]);
|
|
131
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("button", { ref: ref, title: title, tabIndex: tabIndex, type: "button", style: style, className: is_menu_item_1.MENU_INITIATOR_CLASSNAME, children: [selected === null || selected === void 0 ? void 0 : selected.label
|
|
132
|
-
? react_dom_1.default.createPortal((0, jsx_runtime_1.jsx)("div", { style: styles_1.outerPortal, className: "css-reset", children: (0, jsx_runtime_1.jsx)(z_index_1.HigherZIndex, { onOutsideClick: onHide, onEscape: onHide, children: (0, jsx_runtime_1.jsx)("div", { style: portalStyle, children: (0, jsx_runtime_1.jsx)(MenuContent_1.MenuContent, { onNextMenu: noop_1.noop, onPreviousMenu: noop_1.noop, values: values, onHide: onHide, leaveLeftSpace: true, preselectIndex: values.findIndex((v) => v.id === selected.id), topItemCanBeUnselected: false }) }) }) }), (0, portals_1.getPortal)(currentZIndex))
|
|
140
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("button", { ref: ref, title: title, tabIndex: tabIndex, type: "button", style: style, className: is_menu_item_1.MENU_INITIATOR_CLASSNAME, children: [(0, jsx_runtime_1.jsx)("div", { title: typeof selected.label === 'string' ? selected.label : undefined, style: label, children: selected === null || selected === void 0 ? void 0 : selected.label }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1 }), " ", (0, jsx_runtime_1.jsx)(caret_1.CaretDown, {})] }), portalStyle
|
|
141
|
+
? react_dom_1.default.createPortal((0, jsx_runtime_1.jsx)("div", { style: styles_1.fullScreenOverlay, children: (0, jsx_runtime_1.jsx)("div", { style: styles_1.outerPortal, className: "css-reset", children: (0, jsx_runtime_1.jsx)(z_index_1.HigherZIndex, { onOutsideClick: onHide, onEscape: onHide, children: (0, jsx_runtime_1.jsx)("div", { style: portalStyle, children: (0, jsx_runtime_1.jsx)(MenuContent_1.MenuContent, { onNextMenu: noop_1.noop, onPreviousMenu: noop_1.noop, values: values, onHide: onHide, leaveLeftSpace: true, preselectIndex: values.findIndex((v) => v.id === selected.id), topItemCanBeUnselected: false }) }) }) }) }), (0, portals_1.getPortal)(currentZIndex))
|
|
133
142
|
: null] }));
|
|
134
143
|
};
|
|
135
144
|
exports.Combobox = Combobox;
|
|
@@ -99,7 +99,7 @@ const InputDragger = ({ onValueChange, min: _min, max: _max, step: _step, value,
|
|
|
99
99
|
}
|
|
100
100
|
}, [inputFallback]);
|
|
101
101
|
if (inputFallback) {
|
|
102
|
-
return ((0, jsx_runtime_1.jsx)(z_index_1.HigherZIndex, { onEscape: onEscape, onOutsideClick: noop_1.noop, children: (0, jsx_runtime_1.jsx)(RemInput_1.RemotionInput, { ref: fallbackRef, autoFocus: true, onKeyPress: onKeyPress, onBlur: onBlur, min: _min, step: _step, defaultValue: value, status: status, ...props }) }));
|
|
102
|
+
return ((0, jsx_runtime_1.jsx)(z_index_1.HigherZIndex, { onEscape: onEscape, onOutsideClick: noop_1.noop, children: (0, jsx_runtime_1.jsx)(RemInput_1.RemotionInput, { ref: fallbackRef, autoFocus: true, onKeyPress: onKeyPress, onBlur: onBlur, min: _min, step: _step, defaultValue: value, status: status, pattern: '[0-9]*[.]?[0-9]*', ...props }) }));
|
|
103
103
|
}
|
|
104
104
|
return ((0, jsx_runtime_1.jsx)("button", { type: "button", style: style, onClick: onClick, onPointerDown: onPointerDown, children: (0, jsx_runtime_1.jsx)("span", { style: span, children: formatter(value) }) }));
|
|
105
105
|
};
|
|
@@ -5,6 +5,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const colors_1 = require("../../helpers/colors");
|
|
7
7
|
const use_keybinding_1 = require("../../helpers/use-keybinding");
|
|
8
|
+
const is_menu_item_1 = require("../Menu/is-menu-item");
|
|
8
9
|
const MenuDivider_1 = require("../Menu/MenuDivider");
|
|
9
10
|
const MenuSubItem_1 = require("../Menu/MenuSubItem");
|
|
10
11
|
const styles_1 = require("../Menu/styles");
|
|
@@ -14,6 +15,11 @@ const container = {
|
|
|
14
15
|
paddingBottom: styles_1.MENU_VERTICAL_PADDING,
|
|
15
16
|
border: `${BORDER_SIZE}px solid ${colors_1.INPUT_BORDER_COLOR_UNHOVERED}`,
|
|
16
17
|
marginLeft: 0 - BORDER_SIZE,
|
|
18
|
+
overflowY: 'auto',
|
|
19
|
+
overflowX: 'hidden',
|
|
20
|
+
minWidth: 200,
|
|
21
|
+
maxWidth: styles_1.MAX_MENU_WIDTH,
|
|
22
|
+
maxHeight: 600,
|
|
17
23
|
};
|
|
18
24
|
const MenuContent = ({ onHide, values, preselectIndex, onNextMenu, onPreviousMenu, leaveLeftSpace, topItemCanBeUnselected, }) => {
|
|
19
25
|
const keybindings = (0, use_keybinding_1.useKeybinding)();
|
|
@@ -210,7 +216,7 @@ const MenuContent = ({ onHide, values, preselectIndex, onNextMenu, onPreviousMen
|
|
|
210
216
|
current.addEventListener('pointerleave', onPointerLeave);
|
|
211
217
|
return () => current.removeEventListener('pointerleave', onPointerLeave);
|
|
212
218
|
}, [onHide, subMenuActivated]);
|
|
213
|
-
return ((0, jsx_runtime_1.jsx)("div", { ref: containerRef, style: container, children: values.map((item) => {
|
|
219
|
+
return ((0, jsx_runtime_1.jsx)("div", { ref: containerRef, style: container, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: values.map((item) => {
|
|
214
220
|
if (item.type === 'divider') {
|
|
215
221
|
return (0, jsx_runtime_1.jsx)(MenuDivider_1.MenuDivider, {}, item.id);
|
|
216
222
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PlayerEmitterContext = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const player_1 = require("@remotion/player");
|
|
6
|
+
const react_1 = require("react");
|
|
7
|
+
const PlayerEmitterContext = ({ children }) => {
|
|
8
|
+
const [emitter] = (0, react_1.useState)(() => new player_1.PlayerInternals.PlayerEmitter());
|
|
9
|
+
return ((0, jsx_runtime_1.jsx)(player_1.PlayerInternals.PlayerEventEmitterContext.Provider, { value: emitter, children: children }));
|
|
10
|
+
};
|
|
11
|
+
exports.PlayerEmitterContext = PlayerEmitterContext;
|
|
@@ -34,7 +34,7 @@ const RenderButton = ({ composition, visible }) => {
|
|
|
34
34
|
initialFrame: 0,
|
|
35
35
|
initialVideoImageFormat: defaults.videoImageFormat,
|
|
36
36
|
initialStillImageFormat: defaults.stillImageFormat,
|
|
37
|
-
|
|
37
|
+
initialJpegQuality: defaults.jpegQuality,
|
|
38
38
|
initialScale: defaults.scale,
|
|
39
39
|
initialVerbose: defaults.logLevel === 'verbose',
|
|
40
40
|
initialOutName: (0, get_default_out_name_1.getDefaultOutLocation)({
|
|
@@ -68,7 +68,6 @@ const RenderButton = ({ composition, visible }) => {
|
|
|
68
68
|
if (!visible) {
|
|
69
69
|
return null;
|
|
70
70
|
}
|
|
71
|
-
|
|
72
|
-
return ((0, jsx_runtime_1.jsx)(InlineAction_1.InlineAction, { onClick: onClick, children: (0, jsx_runtime_1.jsx)(render_1.RenderIcon, { svgProps: iconStyle }) }));
|
|
71
|
+
return ((0, jsx_runtime_1.jsx)(InlineAction_1.InlineAction, { onClick: onClick, children: (0, jsx_runtime_1.jsx)(render_1.ThinRenderIcon, { svgProps: iconStyle }) }));
|
|
73
72
|
};
|
|
74
73
|
exports.RenderButton = RenderButton;
|
|
@@ -4,9 +4,9 @@ exports.JpegQualitySetting = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const client_1 = require("@remotion/renderer/client");
|
|
6
6
|
const NumberSetting_1 = require("./NumberSetting");
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const JpegQualitySetting = ({
|
|
10
|
-
return ((0, jsx_runtime_1.jsx)(NumberSetting_1.NumberSetting, { min:
|
|
7
|
+
const MIN_JPEG_QUALITY = 1;
|
|
8
|
+
const MAX_JPEG_QUALITY = 100;
|
|
9
|
+
const JpegQualitySetting = ({ jpegQuality, setJpegQuality }) => {
|
|
10
|
+
return ((0, jsx_runtime_1.jsx)(NumberSetting_1.NumberSetting, { min: MIN_JPEG_QUALITY, max: MAX_JPEG_QUALITY, step: 1, name: "JPEG Quality", onValueChanged: setJpegQuality, value: jpegQuality, hint: client_1.BrowserSafeApis.options.jpegQualityOption }));
|
|
11
11
|
};
|
|
12
12
|
exports.JpegQualitySetting = JpegQualitySetting;
|
|
@@ -6,7 +6,7 @@ export declare const RenderModal: React.FC<{
|
|
|
6
6
|
initialFrame: number;
|
|
7
7
|
initialVideoImageFormat: VideoImageFormat;
|
|
8
8
|
initialStillImageFormat: StillImageFormat;
|
|
9
|
-
|
|
9
|
+
initialJpegQuality: number;
|
|
10
10
|
initialScale: number;
|
|
11
11
|
initialVerbose: boolean;
|
|
12
12
|
initialOutName: string;
|
|
@@ -24,7 +24,7 @@ const ModalHeader_1 = require("../ModalHeader");
|
|
|
24
24
|
const actions_1 = require("../RenderQueue/actions");
|
|
25
25
|
const RightPanel_1 = require("../RightPanel");
|
|
26
26
|
const SegmentedControl_1 = require("../SegmentedControl");
|
|
27
|
-
const
|
|
27
|
+
const vertical_1 = require("../Tabs/vertical");
|
|
28
28
|
const CrfSetting_1 = require("./CrfSetting");
|
|
29
29
|
const out_name_checker_1 = require("./out-name-checker");
|
|
30
30
|
const RenderModalAdvanced_1 = require("./RenderModalAdvanced");
|
|
@@ -103,7 +103,7 @@ const buttonStyle = {
|
|
|
103
103
|
const flexer = {
|
|
104
104
|
flex: 1,
|
|
105
105
|
};
|
|
106
|
-
const RenderModal = ({ compositionId, initialFrame, initialVideoImageFormat, initialStillImageFormat,
|
|
106
|
+
const RenderModal = ({ compositionId, initialFrame, initialVideoImageFormat, initialStillImageFormat, initialJpegQuality, initialScale, initialVerbose, initialOutName, initialRenderType, initialVideoCodecForAudioTab, initialVideoCodecForVideoTab, initialConcurrency, maxConcurrency, minConcurrency, initialMuted, initialEnforceAudioTrack, initialProResProfile, initialPixelFormat, initialVideoBitrate, initialAudioBitrate, initialEveryNthFrame, initialNumberOfGifLoops, initialDelayRenderTimeout, initialAudioCodec, initialEnvVariables, initialDisableWebSecurity, initialGl, initialHeadless, initialIgnoreCertificateErrors, }) => {
|
|
107
107
|
const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
108
108
|
const onQuit = (0, react_1.useCallback)(() => {
|
|
109
109
|
setSelectedModal(null);
|
|
@@ -121,7 +121,7 @@ const RenderModal = ({ compositionId, initialFrame, initialVideoImageFormat, ini
|
|
|
121
121
|
const [mutedState, setMuted] = (0, react_1.useState)(() => initialMuted);
|
|
122
122
|
const [enforceAudioTrackState, setEnforceAudioTrackState] = (0, react_1.useState)(() => initialEnforceAudioTrack);
|
|
123
123
|
const [renderMode, setRenderModeState] = (0, react_1.useState)(initialRenderType);
|
|
124
|
-
const [
|
|
124
|
+
const [jpegQuality, setJpegQuality] = (0, react_1.useState)(() => initialJpegQuality);
|
|
125
125
|
const [scale, setScale] = (0, react_1.useState)(() => initialScale);
|
|
126
126
|
const [verbose, setVerboseLogging] = (0, react_1.useState)(() => initialVerbose);
|
|
127
127
|
const [disallowParallelEncoding, setDisallowParallelEncoding] = (0, react_1.useState)(false);
|
|
@@ -284,10 +284,10 @@ const RenderModal = ({ compositionId, initialFrame, initialVideoImageFormat, ini
|
|
|
284
284
|
setStillImageFormat(format);
|
|
285
285
|
setDefaultOutName({ type: 'still', imageFormat: format });
|
|
286
286
|
}, [setDefaultOutName]);
|
|
287
|
-
const {
|
|
287
|
+
const { setSidebarCollapsedState } = (0, react_1.useContext)(sidebar_1.SidebarContext);
|
|
288
288
|
const onClickStill = (0, react_1.useCallback)(() => {
|
|
289
289
|
var _a;
|
|
290
|
-
|
|
290
|
+
setSidebarCollapsedState({ left: null, right: 'expanded' });
|
|
291
291
|
(0, RightPanel_1.persistSelectedPanel)('renders');
|
|
292
292
|
(_a = RightPanel_1.rightSidebarTabs.current) === null || _a === void 0 ? void 0 : _a.selectRendersPanel();
|
|
293
293
|
dispatchIfMounted({ type: 'start' });
|
|
@@ -295,7 +295,7 @@ const RenderModal = ({ compositionId, initialFrame, initialVideoImageFormat, ini
|
|
|
295
295
|
compositionId,
|
|
296
296
|
outName,
|
|
297
297
|
imageFormat: stillImageFormat,
|
|
298
|
-
|
|
298
|
+
jpegQuality: stillImageFormat === 'jpeg' ? jpegQuality : null,
|
|
299
299
|
frame,
|
|
300
300
|
scale,
|
|
301
301
|
verbose,
|
|
@@ -312,12 +312,12 @@ const RenderModal = ({ compositionId, initialFrame, initialVideoImageFormat, ini
|
|
|
312
312
|
dispatchIfMounted({ type: 'fail' });
|
|
313
313
|
});
|
|
314
314
|
}, [
|
|
315
|
-
|
|
315
|
+
setSidebarCollapsedState,
|
|
316
316
|
dispatchIfMounted,
|
|
317
317
|
compositionId,
|
|
318
318
|
outName,
|
|
319
319
|
stillImageFormat,
|
|
320
|
-
|
|
320
|
+
jpegQuality,
|
|
321
321
|
frame,
|
|
322
322
|
scale,
|
|
323
323
|
verbose,
|
|
@@ -337,7 +337,7 @@ const RenderModal = ({ compositionId, initialFrame, initialVideoImageFormat, ini
|
|
|
337
337
|
const audioCodec = deriveFinalAudioCodec(codec, userSelectedAudioCodec);
|
|
338
338
|
const onClickVideo = (0, react_1.useCallback)(() => {
|
|
339
339
|
var _a;
|
|
340
|
-
|
|
340
|
+
setSidebarCollapsedState({ left: null, right: 'expanded' });
|
|
341
341
|
(0, RightPanel_1.persistSelectedPanel)('renders');
|
|
342
342
|
(_a = RightPanel_1.rightSidebarTabs.current) === null || _a === void 0 ? void 0 : _a.selectRendersPanel();
|
|
343
343
|
dispatchIfMounted({ type: 'start' });
|
|
@@ -345,7 +345,7 @@ const RenderModal = ({ compositionId, initialFrame, initialVideoImageFormat, ini
|
|
|
345
345
|
compositionId,
|
|
346
346
|
outName,
|
|
347
347
|
imageFormat: videoImageFormat,
|
|
348
|
-
|
|
348
|
+
jpegQuality: stillImageFormat === 'jpeg' ? jpegQuality : null,
|
|
349
349
|
scale,
|
|
350
350
|
verbose,
|
|
351
351
|
codec,
|
|
@@ -376,13 +376,13 @@ const RenderModal = ({ compositionId, initialFrame, initialVideoImageFormat, ini
|
|
|
376
376
|
dispatchIfMounted({ type: 'fail' });
|
|
377
377
|
});
|
|
378
378
|
}, [
|
|
379
|
-
|
|
379
|
+
setSidebarCollapsedState,
|
|
380
380
|
dispatchIfMounted,
|
|
381
381
|
compositionId,
|
|
382
382
|
outName,
|
|
383
383
|
videoImageFormat,
|
|
384
384
|
stillImageFormat,
|
|
385
|
-
|
|
385
|
+
jpegQuality,
|
|
386
386
|
scale,
|
|
387
387
|
verbose,
|
|
388
388
|
codec,
|
|
@@ -561,6 +561,6 @@ const RenderModal = ({ compositionId, initialFrame, initialVideoImageFormat, ini
|
|
|
561
561
|
backgroundColor: outnameValidation.valid
|
|
562
562
|
? 'var(--blue)'
|
|
563
563
|
: 'var(--blue-disabled)',
|
|
564
|
-
}, children: [state.type === 'idle' ? `Render ${renderMode}` : 'Rendering...', (0, jsx_runtime_1.jsx)(ShortcutHint_1.ShortcutHint, { keyToPress: "\u21B5", cmdOrCtrl: true })] })] }), (0, jsx_runtime_1.jsxs)("div", { style: horizontalLayout, children: [(0, jsx_runtime_1.jsxs)("div", { style: leftSidebar, children: [shownTabs.includes('general') ? ((0, jsx_runtime_1.jsxs)(
|
|
564
|
+
}, children: [state.type === 'idle' ? `Render ${renderMode}` : 'Rendering...', (0, jsx_runtime_1.jsx)(ShortcutHint_1.ShortcutHint, { keyToPress: "\u21B5", cmdOrCtrl: true })] })] }), (0, jsx_runtime_1.jsxs)("div", { style: horizontalLayout, children: [(0, jsx_runtime_1.jsxs)("div", { style: leftSidebar, children: [shownTabs.includes('general') ? ((0, jsx_runtime_1.jsxs)(vertical_1.VerticalTab, { style: horizontalTab, selected: tab === 'general', onClick: () => setTab('general'), children: [(0, jsx_runtime_1.jsx)("div", { style: iconContainer, children: (0, jsx_runtime_1.jsx)(file_1.FileIcon, { style: icon }) }), "General"] })) : null, shownTabs.includes('data') ? ((0, jsx_runtime_1.jsxs)(vertical_1.VerticalTab, { style: horizontalTab, selected: tab === 'data', onClick: () => setTab('data'), children: [(0, jsx_runtime_1.jsx)("div", { style: iconContainer, children: (0, jsx_runtime_1.jsx)(data_1.DataIcon, { style: icon }) }), "Input Props"] })) : null, shownTabs.includes('picture') ? ((0, jsx_runtime_1.jsxs)(vertical_1.VerticalTab, { style: horizontalTab, selected: tab === 'picture', onClick: () => setTab('picture'), children: [(0, jsx_runtime_1.jsx)("div", { style: iconContainer, children: (0, jsx_runtime_1.jsx)(frame_1.PicIcon, { style: icon }) }), "Picture"] })) : null, shownTabs.includes('audio') ? ((0, jsx_runtime_1.jsxs)(vertical_1.VerticalTab, { style: horizontalTab, selected: tab === 'audio', onClick: () => setTab('audio'), children: [(0, jsx_runtime_1.jsx)("div", { style: iconContainer, children: (0, jsx_runtime_1.jsx)(audio_1.AudioIcon, { style: icon }) }), "Audio"] })) : null, shownTabs.includes('gif') ? ((0, jsx_runtime_1.jsxs)(vertical_1.VerticalTab, { style: horizontalTab, selected: tab === 'gif', onClick: () => setTab('gif'), children: [(0, jsx_runtime_1.jsx)("div", { style: iconContainer, children: (0, jsx_runtime_1.jsx)(gif_1.GifIcon, { style: icon }) }), "GIF"] })) : null, shownTabs.includes('advanced') ? ((0, jsx_runtime_1.jsxs)(vertical_1.VerticalTab, { style: horizontalTab, selected: tab === 'advanced', onClick: () => setTab('advanced'), children: [(0, jsx_runtime_1.jsx)("div", { style: iconContainer, children: (0, jsx_runtime_1.jsx)(gear_1.GearIcon, { style: icon }) }), "Other"] })) : null] }), (0, jsx_runtime_1.jsx)("div", { style: rightPanel, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: tab === 'general' ? ((0, jsx_runtime_1.jsx)(RenderModalBasic_1.RenderModalBasic, { codec: codec, currentComposition: currentComposition, frame: frame, imageFormatOptions: imageFormatOptions, outName: outName, proResProfile: proResProfile, renderMode: renderMode, setVideoCodec: setCodec, setFrame: setFrame, setOutName: setOutName, setProResProfile: setProResProfile, endFrame: endFrame, setEndFrame: setEndFrame, setStartFrame: setStartFrame, startFrame: startFrame, validationMessage: outnameValidation.valid ? null : outnameValidation.error.message })) : tab === 'picture' ? ((0, jsx_runtime_1.jsx)(RenderModalPicture_1.RenderModalPicture, { renderMode: renderMode, scale: scale, setScale: setScale, pixelFormat: pixelFormat, setPixelFormat: setPixelFormat, imageFormatOptions: imageFormatOptions, crf: crf, setCrf: setCrf, customTargetVideoBitrate: customTargetVideoBitrate, maxCrf: maxCrf, minCrf: minCrf, jpegQuality: jpegQuality, qualityControlType: qualityControlType, setJpegQuality: setJpegQuality, setCustomTargetVideoBitrateValue: setCustomTargetVideoBitrateValue, setQualityControl: setQualityControl, shouldDisplayCrfOption: shouldDisplayCrfOption, videoImageFormat: videoImageFormat, stillImageFormat: stillImageFormat })) : tab === 'audio' ? ((0, jsx_runtime_1.jsx)(RenderModalAudio_1.RenderModalAudio, { muted: muted, renderMode: renderMode, setMuted: setMuted, codec: codec, audioCodec: audioCodec, setAudioCodec: setAudioCodec, enforceAudioTrack: enforceAudioTrack, setEnforceAudioTrackState: setEnforceAudioTrackState, customTargetAudioBitrate: customTargetAudioBitrate, setCustomTargetAudioBitrateValue: setCustomTargetAudioBitrateValue, setShouldHaveCustomTargetAudioBitrate: setShouldHaveCustomTargetAudioBitrate, shouldHaveCustomTargetAudioBitrate: shouldHaveCustomTargetAudioBitrate })) : tab === 'gif' ? ((0, jsx_runtime_1.jsx)(RenderModalGif_1.RenderModalGif, { everyNthFrame: everyNthFrame, limitNumberOfGifLoops: limitNumberOfGifLoops, numberOfGifLoopsSetting: numberOfGifLoopsSetting, setEveryNthFrameSetting: setEveryNthFrameSetting, setLimitNumberOfGifLoops: setLimitNumberOfGifLoops, setNumberOfGifLoopsSetting: setNumberOfGifLoopsSetting })) : tab === 'data' ? ((0, jsx_runtime_1.jsx)(RenderModalData_1.RenderModalData, { inputProps: inputProps, setInputProps: setInputProps, composition: currentComposition, compact: false, mayShowSaveButton: false })) : ((0, jsx_runtime_1.jsx)(RenderModalAdvanced_1.RenderModalAdvanced, { concurrency: concurrency, maxConcurrency: maxConcurrency, minConcurrency: minConcurrency, renderMode: renderMode, setConcurrency: setConcurrency, setVerboseLogging: setVerboseLogging, verbose: verbose, delayRenderTimeout: delayRenderTimeout, setDelayRenderTimeout: setDelayRenderTimeout, disallowParallelEncoding: disallowParallelEncoding, setDisallowParallelEncoding: setDisallowParallelEncoding, setDisableWebSecurity: setDisableWebSecurity, setIgnoreCertificateErrors: setIgnoreCertificateErrors, setHeadless: setHeadless, headless: headless, ignoreCertificateErrors: ignoreCertificateErrors, disableWebSecurity: disableWebSecurity, openGlOption: openGlOption, setOpenGlOption: setOpenGlOption, setEnvVariables: setEnvVariables, envVariables: envVariables })) })] })] }));
|
|
565
565
|
};
|
|
566
566
|
exports.RenderModal = RenderModal;
|
|
@@ -51,8 +51,10 @@ const RenderModalAdvanced = ({ renderMode, maxConcurrency, minConcurrency, setCo
|
|
|
51
51
|
});
|
|
52
52
|
}, [extendedOpenGlOptions, openGlOption, setOpenGlOption]);
|
|
53
53
|
return ((0, jsx_runtime_1.jsxs)("div", { style: container, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: [renderMode === 'still' ? null : ((0, jsx_runtime_1.jsx)(NumberSetting_1.NumberSetting, { min: minConcurrency, max: maxConcurrency, step: 1, name: "Concurrency", formatter: (w) => `${w}x`, onValueChanged: setConcurrency, value: concurrency })), (0, jsx_runtime_1.jsx)(NumberSetting_1.NumberSetting
|
|
54
|
+
// TODO: Should be right aligned
|
|
54
55
|
// Also appears in packages/renderer/src/validate-puppeteer-timeout.ts
|
|
55
56
|
, {
|
|
57
|
+
// TODO: Should be right aligned
|
|
56
58
|
// Also appears in packages/renderer/src/validate-puppeteer-timeout.ts
|
|
57
59
|
min: 7000, max: 900000, name: "delayRender() timeout", onValueChanged: setDelayRenderTimeout, formatter: (w) => `${w}ms`, step: 1000, value: delayRenderTimeout }), (0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "No parallel encoding" }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(Checkbox_1.Checkbox, { checked: disallowParallelEncoding, onChange: onDisallowParallelEncodingChanged }) })] }), (0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Verbose logging" }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(Checkbox_1.Checkbox, { checked: verbose, onChange: onVerboseLoggingChanged }) })] }), (0, jsx_runtime_1.jsx)(RenderModalHr_1.RenderModalHr, {}), (0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Disable web security" }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(Checkbox_1.Checkbox, { checked: disableWebSecurity, onChange: onDisableWebSecurityChanged }) })] }), (0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Ignore certificate errors " }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(Checkbox_1.Checkbox, { checked: ignoreCertificateErrors, onChange: onIgnoreCertificatErrors }) })] }), (0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Headless mode" }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(Checkbox_1.Checkbox, { checked: headless, onChange: onHeadless }) })] }), (0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "OpenGL render backend" }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(ComboBox_1.Combobox, { values: openGlOptions, selectedId: openGlOption, title: "OpenGl option" }) })] }), (0, jsx_runtime_1.jsx)(RenderModalHr_1.RenderModalHr, {}), (0, jsx_runtime_1.jsx)(RenderModalEnvironmentVariables_1.RenderModalEnvironmentVariables, { envVariables: envVariables, setEnvVariables: setEnvVariables })] }));
|
|
58
60
|
};
|
|
@@ -41,8 +41,6 @@ const RenderModalAudio = ({ muted, setMuted, renderMode, enforceAudioTrack, setE
|
|
|
41
41
|
};
|
|
42
42
|
});
|
|
43
43
|
}, [codec, setAudioCodec]);
|
|
44
|
-
// TODO: Bug - select rive-vehicle to render, then select GIF codec
|
|
45
|
-
// Error: Audio codec null is not supported for codec gif
|
|
46
44
|
return ((0, jsx_runtime_1.jsxs)("div", { style: container, children: [renderMode === 'video' && audioCodecOptions(codec).length >= 2 ? ((0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Audio Codec" }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(ComboBox_1.Combobox, { values: audioCodecOptions(codec), selectedId: audioCodec, title: "AudioCodec" }) })] })) : null, renderMode === 'video' && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(MutedSetting_1.MutedSetting, { enforceAudioTrack: enforceAudioTrack, muted: muted, setMuted: setMuted, hint: client_1.BrowserSafeApis.options.muteOption }), (0, jsx_runtime_1.jsx)(EnforceAudioTrackSetting_1.EnforceAudioTrackSetting, { muted: muted, enforceAudioTrack: enforceAudioTrack, setEnforceAudioTrack: setEnforceAudioTrackState, option: client_1.BrowserSafeApis.options.enforceAudioOption }), (0, jsx_runtime_1.jsx)(RenderModalHr_1.RenderModalHr, {})] })), renderMode === 'still' ? null : ((0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Custom audio bitrate" }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(Checkbox_1.Checkbox, { checked: shouldHaveCustomTargetAudioBitrate, onChange: onShouldHaveTargetAudioBitrateChanged }) })] })), shouldHaveCustomTargetAudioBitrate && renderMode !== 'still' ? ((0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Target audio bitrate" }), (0, jsx_runtime_1.jsx)(InfoBubble_1.InfoBubble, { title: "Learn more about this option", children: (0, jsx_runtime_1.jsx)(OptionExplainer_1.OptionExplainer, { option: client_1.BrowserSafeApis.options.audioBitrateOption }) }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(RemInput_1.RemotionInput, { style: layout_1.input, value: customTargetAudioBitrate, onChange: onTargetAudioBitrateChanged, status: "ok" }) }) })] })) : null] }));
|
|
47
45
|
};
|
|
48
46
|
exports.RenderModalAudio = RenderModalAudio;
|
|
@@ -3,7 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.RenderModalData = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
+
const remotion_1 = require("remotion");
|
|
6
7
|
const colors_1 = require("../../helpers/colors");
|
|
8
|
+
const ValidationMessage_1 = require("../NewComposition/ValidationMessage");
|
|
9
|
+
const layout_1 = require("../layout");
|
|
7
10
|
const actions_1 = require("../RenderQueue/actions");
|
|
8
11
|
const SegmentedControl_1 = require("../SegmentedControl");
|
|
9
12
|
const RenderModalJSONInputPropsEditor_1 = require("./RenderModalJSONInputPropsEditor");
|
|
@@ -15,18 +18,59 @@ const outer = {
|
|
|
15
18
|
overflow: 'hidden',
|
|
16
19
|
};
|
|
17
20
|
const controlContainer = {
|
|
18
|
-
flexDirection: '
|
|
21
|
+
flexDirection: 'column',
|
|
19
22
|
display: 'flex',
|
|
20
|
-
|
|
21
|
-
paddingTop: 12,
|
|
22
|
-
paddingBottom: 12,
|
|
23
|
+
padding: 12,
|
|
23
24
|
borderBottom: `1px solid ${colors_1.BORDER_COLOR}`,
|
|
24
25
|
};
|
|
25
|
-
const
|
|
26
|
+
const tabWrapper = {
|
|
27
|
+
display: 'flex',
|
|
28
|
+
marginBottom: '4px',
|
|
29
|
+
flexDirection: 'row',
|
|
30
|
+
};
|
|
31
|
+
const spacer = {
|
|
32
|
+
flex: 1,
|
|
33
|
+
};
|
|
34
|
+
const RenderModalData = ({ composition, inputProps, setInputProps, compact, mayShowSaveButton }) => {
|
|
26
35
|
const [mode, setMode] = (0, react_1.useState)('schema');
|
|
36
|
+
const [valBeforeSafe, setValBeforeSafe] = (0, react_1.useState)(inputProps);
|
|
27
37
|
const zodValidationResult = (0, react_1.useMemo)(() => {
|
|
28
38
|
return composition.schema.safeParse(inputProps);
|
|
29
39
|
}, [composition.schema, inputProps]);
|
|
40
|
+
const cliProps = (0, remotion_1.getInputProps)();
|
|
41
|
+
const [canSaveDefaultProps, setCanSaveDefaultProps] = (0, react_1.useState)({
|
|
42
|
+
canUpdate: false,
|
|
43
|
+
reason: 'Loading...',
|
|
44
|
+
determined: false,
|
|
45
|
+
});
|
|
46
|
+
const showSaveButton = mayShowSaveButton && canSaveDefaultProps.canUpdate;
|
|
47
|
+
// TODO: Disable if Preview Server is disconnected
|
|
48
|
+
// TODO: Update if root file is updated
|
|
49
|
+
// TODO: Segment the state for different compositions
|
|
50
|
+
(0, react_1.useEffect)(() => {
|
|
51
|
+
(0, actions_1.canUpdateDefaultProps)(composition.id)
|
|
52
|
+
.then((can) => {
|
|
53
|
+
if (can.canUpdate) {
|
|
54
|
+
setCanSaveDefaultProps({
|
|
55
|
+
canUpdate: true,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
setCanSaveDefaultProps({
|
|
60
|
+
canUpdate: false,
|
|
61
|
+
reason: can.reason,
|
|
62
|
+
determined: true,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
})
|
|
66
|
+
.catch((err) => {
|
|
67
|
+
setCanSaveDefaultProps({
|
|
68
|
+
canUpdate: false,
|
|
69
|
+
reason: err.message,
|
|
70
|
+
determined: true,
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
}, [composition.id]);
|
|
30
74
|
const modeItems = (0, react_1.useMemo)(() => {
|
|
31
75
|
return [
|
|
32
76
|
{
|
|
@@ -51,11 +95,13 @@ const RenderModalData = ({ composition, inputProps, setInputProps, compact, show
|
|
|
51
95
|
setMode('schema');
|
|
52
96
|
}, []);
|
|
53
97
|
const onUpdate = (0, react_1.useCallback)(() => {
|
|
98
|
+
setValBeforeSafe(inputProps);
|
|
54
99
|
(0, actions_1.updateDefaultProps)(composition.id, inputProps);
|
|
55
100
|
}, [composition.id, inputProps]);
|
|
56
101
|
const onSave = (0, react_1.useCallback)((updater) => {
|
|
57
102
|
(0, actions_1.updateDefaultProps)(composition.id, updater(composition.defaultProps));
|
|
58
103
|
}, [composition.defaultProps, composition.id]);
|
|
59
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: outer, children: [(0, jsx_runtime_1.
|
|
104
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: outer, children: [(0, jsx_runtime_1.jsxs)("div", { style: controlContainer, children: [(0, jsx_runtime_1.jsxs)("div", { style: tabWrapper, children: [(0, jsx_runtime_1.jsx)(SegmentedControl_1.SegmentedControl, { items: modeItems, needsWrapping: false }), (0, jsx_runtime_1.jsx)("div", { style: spacer })] }), Object.keys(cliProps).length > 0 ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1 }), (0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { message: "The data that was passed using --props takes priority over the data you enter here.", align: "flex-start", type: "warning" })] })) : null, canSaveDefaultProps.canUpdate === false &&
|
|
105
|
+
canSaveDefaultProps.determined ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1 }), (0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { message: `Can't save default props: ${canSaveDefaultProps.reason}`, align: "flex-start", type: "warning" })] })) : null] }), mode === 'schema' ? ((0, jsx_runtime_1.jsx)(SchemaEditor_1.SchemaEditor, { value: inputProps, setValue: setInputProps, schema: composition.schema, zodValidationResult: zodValidationResult, compact: compact, defaultProps: composition.defaultProps, onSave: onSave, showSaveButton: showSaveButton })) : ((0, jsx_runtime_1.jsx)(RenderModalJSONInputPropsEditor_1.RenderModalJSONInputPropsEditor, { value: inputProps !== null && inputProps !== void 0 ? inputProps : {}, setValue: setInputProps, zodValidationResult: zodValidationResult, switchToSchema: switchToSchema, onSave: onUpdate, valBeforeSafe: valBeforeSafe, showSaveButton: showSaveButton }))] }));
|
|
60
106
|
};
|
|
61
107
|
exports.RenderModalData = RenderModalData;
|
|
@@ -27,6 +27,7 @@ exports.RenderModalJSONInputPropsEditor = void 0;
|
|
|
27
27
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
28
28
|
const react_1 = __importStar(require("react"));
|
|
29
29
|
const Button_1 = require("../../../preview-server/error-overlay/remotion-overlay/Button");
|
|
30
|
+
const use_keybinding_1 = require("../../helpers/use-keybinding");
|
|
30
31
|
const layout_1 = require("../layout");
|
|
31
32
|
const RemTextarea_1 = require("../NewComposition/RemTextarea");
|
|
32
33
|
const ValidationMessage_1 = require("../NewComposition/ValidationMessage");
|
|
@@ -58,7 +59,8 @@ const scrollable = {
|
|
|
58
59
|
flex: 1,
|
|
59
60
|
};
|
|
60
61
|
// TODO: Note if custom 'remotion-date:' pattern has been used
|
|
61
|
-
const RenderModalJSONInputPropsEditor = ({ setValue, value, zodValidationResult, switchToSchema, onSave }) => {
|
|
62
|
+
const RenderModalJSONInputPropsEditor = ({ setValue, value, zodValidationResult, switchToSchema, onSave, valBeforeSafe, showSaveButton, }) => {
|
|
63
|
+
const keybindings = (0, use_keybinding_1.useKeybinding)();
|
|
62
64
|
const [localValue, setLocalValue] = react_1.default.useState(() => {
|
|
63
65
|
return parseJSON((0, date_serialization_1.serializeJSONWithDate)(value, 2));
|
|
64
66
|
});
|
|
@@ -89,8 +91,28 @@ const RenderModalJSONInputPropsEditor = ({ setValue, value, zodValidationResult,
|
|
|
89
91
|
setValue(parsed.value);
|
|
90
92
|
}
|
|
91
93
|
}, [setValue]);
|
|
92
|
-
|
|
94
|
+
const hasChanged = (0, react_1.useMemo)(() => {
|
|
95
|
+
return value && JSON.stringify(value) !== JSON.stringify(valBeforeSafe);
|
|
96
|
+
}, [valBeforeSafe, value]);
|
|
97
|
+
const onQuickSave = (0, react_1.useCallback)(() => {
|
|
98
|
+
if (hasChanged) {
|
|
99
|
+
onSave();
|
|
100
|
+
}
|
|
101
|
+
}, [hasChanged, onSave]);
|
|
102
|
+
(0, react_1.useEffect)(() => {
|
|
103
|
+
const save = keybindings.registerKeybinding({
|
|
104
|
+
event: 'keydown',
|
|
105
|
+
key: 's',
|
|
106
|
+
commandCtrlKey: true,
|
|
107
|
+
callback: onQuickSave,
|
|
108
|
+
preventDefault: true,
|
|
109
|
+
triggerIfInputFieldFocused: true,
|
|
110
|
+
});
|
|
111
|
+
return () => {
|
|
112
|
+
save.unregister();
|
|
113
|
+
};
|
|
114
|
+
}, [keybindings, onQuickSave, onSave]);
|
|
93
115
|
// TODO: Indicate saving progress
|
|
94
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: scrollable, children: [(0, jsx_runtime_1.jsx)(RemTextarea_1.RemTextarea, { onChange: onChange, value: localValue.str, status: localValue.validJSON ? 'ok' : 'error', style: style }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1 }), localValue.validJSON === false ? ((0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: localValue.error, type: "error" })) : zodValidationResult.success === false ? ((0, jsx_runtime_1.jsx)("button", { type: "button", style: schemaButton, onClick: switchToSchema, children: (0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: "Does not match schema", type: "warning" }) })) : null, (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1 }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { children: [(0, jsx_runtime_1.jsx)(Button_1.Button, { disabled: !localValue.validJSON, onClick: onPretty, children: "Format JSON" }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1 }), (0, jsx_runtime_1.jsx)(Button_1.Button, { onClick: onSave, disabled: !zodValidationResult.success, children: "Save" })] })] }));
|
|
116
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: scrollable, children: [(0, jsx_runtime_1.jsx)(RemTextarea_1.RemTextarea, { onChange: onChange, value: localValue.str, status: localValue.validJSON ? 'ok' : 'error', style: style }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1 }), localValue.validJSON === false ? ((0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: localValue.error, type: "error" })) : zodValidationResult.success === false ? ((0, jsx_runtime_1.jsx)("button", { type: "button", style: schemaButton, onClick: switchToSchema, children: (0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: "Does not match schema", type: "warning" }) })) : null, (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1 }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { children: [(0, jsx_runtime_1.jsx)(Button_1.Button, { disabled: !localValue.validJSON, onClick: onPretty, children: "Format JSON" }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1 }), (0, jsx_runtime_1.jsx)(Button_1.Button, { onClick: onSave, disabled: !zodValidationResult.success || !hasChanged || !showSaveButton, children: "Save" })] })] }));
|
|
95
117
|
};
|
|
96
118
|
exports.RenderModalJSONInputPropsEditor = RenderModalJSONInputPropsEditor;
|
|
@@ -15,8 +15,8 @@ export declare const RenderModalPicture: React.FC<{
|
|
|
15
15
|
qualityControlType: QualityControl;
|
|
16
16
|
videoImageFormat: VideoImageFormat;
|
|
17
17
|
stillImageFormat: StillImageFormat;
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
setJpegQuality: React.Dispatch<React.SetStateAction<number>>;
|
|
19
|
+
jpegQuality: number;
|
|
20
20
|
maxCrf: number;
|
|
21
21
|
minCrf: number;
|
|
22
22
|
setCrf: React.Dispatch<React.SetStateAction<number>>;
|
|
@@ -19,7 +19,7 @@ const qualityControlModes = ['crf', 'bitrate'];
|
|
|
19
19
|
const container = {
|
|
20
20
|
flex: 1,
|
|
21
21
|
};
|
|
22
|
-
const RenderModalPicture = ({ renderMode, scale, setScale, pixelFormat, setPixelFormat, imageFormatOptions, setQualityControl, qualityControlType, videoImageFormat,
|
|
22
|
+
const RenderModalPicture = ({ renderMode, scale, setScale, pixelFormat, setPixelFormat, imageFormatOptions, setQualityControl, qualityControlType, videoImageFormat, setJpegQuality, jpegQuality, maxCrf, minCrf, setCrf, shouldDisplayCrfOption, setCustomTargetVideoBitrateValue, crf, customTargetVideoBitrate, stillImageFormat, }) => {
|
|
23
23
|
const pixelFormatOptions = (0, react_1.useMemo)(() => {
|
|
24
24
|
return client_1.BrowserSafeApis.validPixelFormats.map((option) => {
|
|
25
25
|
return {
|
|
@@ -49,7 +49,7 @@ const RenderModalPicture = ({ renderMode, scale, setScale, pixelFormat, setPixel
|
|
|
49
49
|
const onTargetVideoBitrateChanged = (0, react_1.useCallback)((e) => {
|
|
50
50
|
setCustomTargetVideoBitrateValue(e.target.value);
|
|
51
51
|
}, [setCustomTargetVideoBitrateValue]);
|
|
52
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: container, children: [renderMode === 'video' ? ((0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Image Format" }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(SegmentedControl_1.SegmentedControl, { items: imageFormatOptions, needsWrapping: false }) })] })) : null, renderMode === 'video' && videoImageFormat === 'jpeg' && ((0, jsx_runtime_1.jsx)(JpegQualitySetting_1.JpegQualitySetting, {
|
|
52
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: container, children: [renderMode === 'video' ? ((0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Image Format" }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(SegmentedControl_1.SegmentedControl, { items: imageFormatOptions, needsWrapping: false }) })] })) : null, renderMode === 'video' && videoImageFormat === 'jpeg' && ((0, jsx_runtime_1.jsx)(JpegQualitySetting_1.JpegQualitySetting, { jpegQuality: jpegQuality, setJpegQuality: setJpegQuality })), renderMode === 'still' && stillImageFormat === 'jpeg' && ((0, jsx_runtime_1.jsx)(JpegQualitySetting_1.JpegQualitySetting, { jpegQuality: jpegQuality, setJpegQuality: setJpegQuality })), renderMode === 'video' ? (0, jsx_runtime_1.jsx)(RenderModalHr_1.RenderModalHr, {}) : null, renderMode === 'video' ? ((0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Quality control" }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(SegmentedControl_1.SegmentedControl, { items: qualityControlOptions, needsWrapping: true }) })] })) : null, shouldDisplayCrfOption &&
|
|
53
53
|
qualityControlType === 'crf' &&
|
|
54
54
|
renderMode !== 'still' ? ((0, jsx_runtime_1.jsx)(CrfSetting_1.CrfSetting, { crf: crf, min: minCrf, max: maxCrf, setCrf: setCrf, option: client_1.BrowserSafeApis.options.crfOption })) : null, qualityControlType === 'bitrate' && renderMode !== 'still' ? ((0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Target video bitrate" }), (0, jsx_runtime_1.jsx)(InfoBubble_1.InfoBubble, { title: "Learn more about this option", children: (0, jsx_runtime_1.jsx)(OptionExplainer_1.OptionExplainer, { option: client_1.BrowserSafeApis.options.videoBitrate }) }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(RemInput_1.RemotionInput, { style: layout_1.input, value: customTargetVideoBitrate, onChange: onTargetVideoBitrateChanged, status: "ok" }) }) })] })) : null, renderMode === 'video' ? (0, jsx_runtime_1.jsx)(RenderModalHr_1.RenderModalHr, {}) : null, (0, jsx_runtime_1.jsx)(ScaleSetting_1.ScaleSetting, { scale: scale, setScale: setScale }), renderMode === 'video' ? (0, jsx_runtime_1.jsx)(RenderModalHr_1.RenderModalHr, {}) : null, renderMode === 'video' ? ((0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Pixel format" }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(ComboBox_1.Combobox, { values: pixelFormatOptions, selectedId: pixelFormat, title: "Pixel Format" }) })] })) : null] }));
|
|
55
55
|
};
|
|
@@ -58,6 +58,8 @@ const SchemaEditor = ({ schema, value, setValue, zodValidationResult, compact, d
|
|
|
58
58
|
}
|
|
59
59
|
const defaultPropsValid = schema.safeParse(defaultProps);
|
|
60
60
|
if (!defaultPropsValid.success) {
|
|
61
|
+
// TODO: Layout is not nice
|
|
62
|
+
// TODO: Does not react to when schema is updated
|
|
61
63
|
return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("div", { style: errorExplanation, children: ["The schema can not be edited because the", ' ', (0, jsx_runtime_1.jsx)("code", { style: codeSnippet, children: "defaultProps" }), " prop in the", ' ', (0, jsx_runtime_1.jsx)("code", { style: codeSnippet, children: '<Composition>' }), " is not valid:"] }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1, block: true }), (0, jsx_runtime_1.jsx)(ZodErrorMessages_1.ZodErrorMessages, { zodValidationResult: zodValidationResult }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1, block: true }), (0, jsx_runtime_1.jsxs)("div", { style: errorExplanation, children: ["Fix the schema by changing the", ' ', (0, jsx_runtime_1.jsx)("code", { style: codeSnippet, children: "defaultProps" }), " prop in your composition so it does not give a type error."] })] }));
|
|
62
64
|
}
|
|
63
65
|
return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { style: errorExplanation, children: "The data does not satisfy the schema:" }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1, block: true }), (0, jsx_runtime_1.jsx)(ZodErrorMessages_1.ZodErrorMessages, { zodValidationResult: zodValidationResult }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1, block: true }), (0, jsx_runtime_1.jsx)("div", { style: errorExplanation, children: "Fix the schema using the JSON editor." }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1, block: true }), (0, jsx_runtime_1.jsxs)("div", { style: errorExplanation, children: ["Alternatively, reset the data to the ", (0, jsx_runtime_1.jsx)("code", { children: "defaultProps" }), " that you have defined."] }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1, block: true }), (0, jsx_runtime_1.jsx)(Button_1.Button, { onClick: reset, children: "Reset props" })] }));
|
|
@@ -13,7 +13,6 @@ const commonStyles = {
|
|
|
13
13
|
fontSize: 15,
|
|
14
14
|
color: colors_1.LIGHT_TEXT,
|
|
15
15
|
fontFamily: 'sans-serif',
|
|
16
|
-
lineHeight: '40px',
|
|
17
16
|
};
|
|
18
17
|
const compactStyles = {
|
|
19
18
|
...commonStyles,
|
|
@@ -24,14 +23,12 @@ const compactStyles = {
|
|
|
24
23
|
const wideStyles = {
|
|
25
24
|
...commonStyles,
|
|
26
25
|
width: layout_2.label.width,
|
|
27
|
-
display: 'flex',
|
|
28
|
-
flexDirection: 'row',
|
|
29
|
-
alignItems: 'center',
|
|
30
26
|
};
|
|
31
27
|
const labelStyle = {
|
|
32
28
|
fontFamily: 'monospace',
|
|
33
29
|
fontSize: 14,
|
|
34
30
|
color: colors_1.LIGHT_TEXT,
|
|
31
|
+
lineHeight: '40px',
|
|
35
32
|
};
|
|
36
33
|
const SchemaLabel = ({ jsonPath, isDefaultValue, onReset, onSave, showSaveButton, compact, onRemove, }) => {
|
|
37
34
|
return ((0, jsx_runtime_1.jsxs)("div", { style: compact ? compactStyles : wideStyles, children: [(0, jsx_runtime_1.jsx)("span", { style: labelStyle, children: (0, get_schema_label_1.getSchemaLabel)(jsonPath) }), compact ? (0, jsx_runtime_1.jsx)(layout_1.Flex, {}) : (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1 }), isDefaultValue ? null : (0, jsx_runtime_1.jsx)(SchemaResetButton_1.SchemaResetButton, { onClick: onReset }), isDefaultValue ? null : showSaveButton ? ((0, jsx_runtime_1.jsx)(SchemaSaveButton_1.SchemaSaveButton, { onClick: onSave })) : null, onRemove ? (0, jsx_runtime_1.jsx)(InlineRemoveButton_1.InlineRemoveButton, { onClick: onRemove }) : null] }));
|