@remotion/cli 3.3.33 → 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.
- package/dist/convert-entry-point-to-serve-url.d.ts +1 -0
- package/dist/convert-entry-point-to-serve-url.js +15 -0
- package/dist/editor/components/CollapsableOptions.d.ts +6 -0
- package/dist/editor/components/CollapsableOptions.js +35 -0
- package/dist/editor/components/InlineAction.d.ts +5 -0
- package/dist/editor/components/InlineAction.js +34 -0
- package/dist/editor/components/Modals.d.ts +2 -0
- package/dist/editor/components/Modals.js +23 -0
- package/dist/editor/components/RenderButton.d.ts +6 -0
- package/dist/editor/components/RenderButton.js +46 -0
- package/dist/editor/components/RenderModal/RenderErrorModal.d.ts +5 -0
- package/dist/editor/components/RenderModal/RenderErrorModal.js +64 -0
- package/dist/editor/components/RenderModal/RenderModal.d.ts +14 -0
- package/dist/editor/components/RenderModal/RenderModal.js +377 -0
- package/dist/editor/components/RenderQueue/CircularProgress.d.ts +5 -0
- package/dist/editor/components/RenderQueue/CircularProgress.js +18 -0
- package/dist/editor/components/RenderQueue/RenderQueueError.d.ts +5 -0
- package/dist/editor/components/RenderQueue/RenderQueueError.js +26 -0
- package/dist/editor/components/RenderQueue/RenderQueueItem.d.ts +5 -0
- package/dist/editor/components/RenderQueue/RenderQueueItem.js +39 -0
- package/dist/editor/components/RenderQueue/RenderQueueItemCancelButton.d.ts +5 -0
- package/dist/editor/components/RenderQueue/RenderQueueItemCancelButton.js +22 -0
- package/dist/editor/components/RenderQueue/RenderQueueItemStatus.d.ts +5 -0
- package/dist/editor/components/RenderQueue/RenderQueueItemStatus.js +27 -0
- package/dist/editor/components/RenderQueue/RenderQueueOutputName.d.ts +5 -0
- package/dist/editor/components/RenderQueue/RenderQueueOutputName.js +24 -0
- package/dist/editor/components/RenderQueue/RenderQueueProgressMessage.d.ts +5 -0
- package/dist/editor/components/RenderQueue/RenderQueueProgressMessage.js +27 -0
- package/dist/editor/components/RenderQueue/RenderQueueRemoveItem.d.ts +5 -0
- package/dist/editor/components/RenderQueue/RenderQueueRemoveItem.js +22 -0
- package/dist/editor/components/RenderQueue/RenderQueueRepeat.d.ts +5 -0
- package/dist/editor/components/RenderQueue/RenderQueueRepeat.js +22 -0
- package/dist/editor/components/RenderQueue/actions.d.ts +35 -0
- package/dist/editor/components/RenderQueue/actions.js +84 -0
- package/dist/editor/components/RenderQueue/context.d.ts +19 -0
- package/dist/editor/components/RenderQueue/context.js +56 -0
- package/dist/editor/components/RenderQueue/index.d.ts +2 -0
- package/dist/editor/components/RenderQueue/index.js +18 -0
- package/dist/editor/components/RenderQueue/item-style.d.ts +2 -0
- package/dist/editor/components/RenderQueue/item-style.js +21 -0
- package/dist/editor/components/RenderToolbarIcon.d.ts +2 -0
- package/dist/editor/components/RenderToolbarIcon.js +56 -0
- package/dist/editor/components/RendersTab.d.ts +6 -0
- package/dist/editor/components/RendersTab.js +43 -0
- package/dist/editor/components/SegmentedControl.d.ts +16 -0
- package/dist/editor/components/SegmentedControl.js +63 -0
- package/dist/editor/components/SidebarContent.d.ts +5 -0
- package/dist/editor/components/SidebarContent.js +51 -0
- package/dist/editor/components/Tabs/index.d.ts +11 -0
- package/dist/editor/components/Tabs/index.js +51 -0
- package/dist/editor/components/Timeline/Timeline.js +11 -5
- package/dist/editor/helpers/client-id.d.ts +17 -0
- package/dist/editor/helpers/client-id.js +46 -0
- package/dist/editor/helpers/use-file-existence.d.ts +1 -0
- package/dist/editor/helpers/use-file-existence.js +66 -0
- package/dist/editor/icons/RenderStillIcon.d.ts +3 -0
- package/dist/editor/icons/RenderStillIcon.js +8 -0
- package/dist/editor/icons/render.d.ts +5 -0
- package/dist/editor/icons/render.js +8 -0
- package/dist/editor/icons/video.d.ts +5 -0
- package/dist/editor/icons/video.js +8 -0
- package/dist/file-watcher.d.ts +9 -0
- package/dist/file-watcher.js +35 -0
- package/dist/get-default-out-name.d.ts +5 -0
- package/dist/get-default-out-name.js +10 -0
- package/dist/preview-server/api-routes.d.ts +4 -0
- package/dist/preview-server/api-routes.js +17 -0
- package/dist/preview-server/api-types.d.ts +27 -0
- package/dist/preview-server/api-types.js +2 -0
- package/dist/preview-server/file-existence-watchers.d.ts +13 -0
- package/dist/preview-server/file-existence-watchers.js +62 -0
- package/dist/preview-server/handler.d.ts +9 -0
- package/dist/preview-server/handler.js +34 -0
- package/dist/preview-server/parse-body.d.ts +2 -0
- package/dist/preview-server/parse-body.js +16 -0
- package/dist/preview-server/render-queue/job.d.ts +86 -0
- package/dist/preview-server/render-queue/job.js +2 -0
- package/dist/preview-server/render-queue/make-retry-payload.d.ts +3 -0
- package/dist/preview-server/render-queue/make-retry-payload.js +37 -0
- package/dist/preview-server/render-queue/open-directory-in-finder.d.ts +1 -0
- package/dist/preview-server/render-queue/open-directory-in-finder.js +34 -0
- package/dist/preview-server/render-queue/process-still.d.ts +8 -0
- package/dist/preview-server/render-queue/process-still.js +50 -0
- package/dist/preview-server/render-queue/process-video.d.ts +8 -0
- package/dist/preview-server/render-queue/process-video.js +59 -0
- package/dist/preview-server/render-queue/queue.d.ts +21 -0
- package/dist/preview-server/render-queue/queue.js +185 -0
- package/dist/preview-server/routes/add-render.d.ts +3 -0
- package/dist/preview-server/routes/add-render.js +54 -0
- package/dist/preview-server/routes/cancel-render.d.ts +3 -0
- package/dist/preview-server/routes/cancel-render.js +9 -0
- package/dist/preview-server/routes/open-in-file-explorer.d.ts +3 -0
- package/dist/preview-server/routes/open-in-file-explorer.js +14 -0
- package/dist/preview-server/routes/remove-render.d.ts +3 -0
- package/dist/preview-server/routes/remove-render.js +9 -0
- package/dist/preview-server/routes/subscribe-to-file-existence.d.ts +3 -0
- package/dist/preview-server/routes/subscribe-to-file-existence.js +13 -0
- package/dist/preview-server/routes/unsubscribe-from-file-existence.d.ts +3 -0
- package/dist/preview-server/routes/unsubscribe-from-file-existence.js +13 -0
- package/dist/render-flows/render.d.ts +38 -0
- package/dist/render-flows/render.js +256 -0
- package/dist/render-flows/still.d.ts +32 -0
- package/dist/render-flows/still.js +170 -0
- package/dist/render.js +1 -1
- package/package.json +7 -7
|
@@ -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,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,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,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;
|
|
@@ -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,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
|
+
}>;
|
|
@@ -0,0 +1,377 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RenderModal = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const client_1 = require("@remotion/renderer/client");
|
|
6
|
+
const react_1 = require("react");
|
|
7
|
+
const remotion_1 = require("remotion");
|
|
8
|
+
const Button_1 = require("../../../preview-server/error-overlay/remotion-overlay/Button");
|
|
9
|
+
const colors_1 = require("../../helpers/colors");
|
|
10
|
+
const use_file_existence_1 = require("../../helpers/use-file-existence");
|
|
11
|
+
const modals_1 = require("../../state/modals");
|
|
12
|
+
const CollapsableOptions_1 = require("../CollapsableOptions");
|
|
13
|
+
const layout_1 = require("../layout");
|
|
14
|
+
const ModalContainer_1 = require("../ModalContainer");
|
|
15
|
+
const ModalHeader_1 = require("../ModalHeader");
|
|
16
|
+
const InputDragger_1 = require("../NewComposition/InputDragger");
|
|
17
|
+
const RemInput_1 = require("../NewComposition/RemInput");
|
|
18
|
+
const ValidationMessage_1 = require("../NewComposition/ValidationMessage");
|
|
19
|
+
const actions_1 = require("../RenderQueue/actions");
|
|
20
|
+
const SegmentedControl_1 = require("../SegmentedControl");
|
|
21
|
+
const SidebarContent_1 = require("../SidebarContent");
|
|
22
|
+
const initialState = { type: 'idle' };
|
|
23
|
+
const reducer = (state, action) => {
|
|
24
|
+
if (action.type === 'start') {
|
|
25
|
+
return {
|
|
26
|
+
type: 'load',
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
if (action.type === 'fail') {
|
|
30
|
+
return {
|
|
31
|
+
type: 'error',
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
if (action.type === 'succeed') {
|
|
35
|
+
return {
|
|
36
|
+
type: 'success',
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
return state;
|
|
40
|
+
};
|
|
41
|
+
const container = {
|
|
42
|
+
display: 'flex',
|
|
43
|
+
flexDirection: 'row',
|
|
44
|
+
alignItems: 'center',
|
|
45
|
+
padding: '12px 16px',
|
|
46
|
+
width: '100%',
|
|
47
|
+
borderBottom: '1px solid black',
|
|
48
|
+
};
|
|
49
|
+
const optionRow = {
|
|
50
|
+
display: 'flex',
|
|
51
|
+
flexDirection: 'row',
|
|
52
|
+
alignItems: 'flex-start',
|
|
53
|
+
minHeight: 40,
|
|
54
|
+
paddingLeft: 16,
|
|
55
|
+
paddingRight: 16,
|
|
56
|
+
};
|
|
57
|
+
const label = {
|
|
58
|
+
width: 150,
|
|
59
|
+
fontSize: 14,
|
|
60
|
+
lineHeight: '40px',
|
|
61
|
+
color: colors_1.LIGHT_TEXT,
|
|
62
|
+
};
|
|
63
|
+
const rightRow = {
|
|
64
|
+
display: 'flex',
|
|
65
|
+
flexDirection: 'row',
|
|
66
|
+
justifyContent: 'flex-end',
|
|
67
|
+
alignSelf: 'center',
|
|
68
|
+
flex: 1,
|
|
69
|
+
};
|
|
70
|
+
const buttonRow = {
|
|
71
|
+
display: 'flex',
|
|
72
|
+
flexDirection: 'row',
|
|
73
|
+
justifyContent: 'flex-end',
|
|
74
|
+
borderTop: '1px solid black',
|
|
75
|
+
paddingTop: 8,
|
|
76
|
+
paddingBottom: 8,
|
|
77
|
+
paddingLeft: 16,
|
|
78
|
+
paddingRight: 16,
|
|
79
|
+
};
|
|
80
|
+
const input = {
|
|
81
|
+
minWidth: 250,
|
|
82
|
+
textAlign: 'right',
|
|
83
|
+
};
|
|
84
|
+
const MIN_QUALITY = 1;
|
|
85
|
+
const MAX_QUALITY = 100;
|
|
86
|
+
const MIN_SCALE = 0.1;
|
|
87
|
+
const MAX_SCALE = 10;
|
|
88
|
+
const RenderModal = ({ compositionId, initialFrame, initialImageFormat, initialQuality, initialScale, initialVerbose, initialOutName, initialRenderType, initialCodec, }) => {
|
|
89
|
+
const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
90
|
+
const onQuit = (0, react_1.useCallback)(() => {
|
|
91
|
+
setSelectedModal(null);
|
|
92
|
+
}, [setSelectedModal]);
|
|
93
|
+
const isMounted = (0, react_1.useRef)(true);
|
|
94
|
+
const [state, dispatch] = (0, react_1.useReducer)(reducer, initialState);
|
|
95
|
+
const [frame, setFrame] = (0, react_1.useState)(() => initialFrame);
|
|
96
|
+
const [imageFormat, setImageFormat] = (0, react_1.useState)(() => initialImageFormat);
|
|
97
|
+
const [videoCodec, setVideoCodec] = (0, react_1.useState)(initialCodec);
|
|
98
|
+
const [videoImageFormat, setVideoImageFormat] = (0, react_1.useState)('jpeg');
|
|
99
|
+
const [renderMode, setRenderMode] = (0, react_1.useState)(initialRenderType);
|
|
100
|
+
const [quality, setQuality] = (0, react_1.useState)(() => initialQuality !== null && initialQuality !== void 0 ? initialQuality : 80);
|
|
101
|
+
const [scale, setScale] = (0, react_1.useState)(() => initialScale);
|
|
102
|
+
const [verbose, setVerboseLogging] = (0, react_1.useState)(() => initialVerbose);
|
|
103
|
+
const [outName, setOutName] = (0, react_1.useState)(() => initialOutName);
|
|
104
|
+
const dispatchIfMounted = (0, react_1.useCallback)((payload) => {
|
|
105
|
+
if (isMounted.current === false)
|
|
106
|
+
return;
|
|
107
|
+
dispatch(payload);
|
|
108
|
+
}, []);
|
|
109
|
+
const onValueChange = (0, react_1.useCallback)((e) => {
|
|
110
|
+
setOutName(e.target.value);
|
|
111
|
+
}, []);
|
|
112
|
+
const { compositions } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
113
|
+
const currentComposition = (0, react_1.useMemo)(() => {
|
|
114
|
+
for (const composition of compositions) {
|
|
115
|
+
if (composition.id === compositionId) {
|
|
116
|
+
return composition;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return null;
|
|
120
|
+
}, [compositionId, compositions]);
|
|
121
|
+
if (currentComposition === null) {
|
|
122
|
+
throw new Error('This composition does not exist');
|
|
123
|
+
}
|
|
124
|
+
const getStringBeforeSuffix = (0, react_1.useCallback)((fileName) => {
|
|
125
|
+
const dotPos = fileName.lastIndexOf('.');
|
|
126
|
+
const bitBeforeDot = fileName.substring(0, dotPos);
|
|
127
|
+
return bitBeforeDot;
|
|
128
|
+
}, []);
|
|
129
|
+
const setCodec = (0, react_1.useCallback)((codec) => {
|
|
130
|
+
setVideoCodec(codec);
|
|
131
|
+
setOutName((prev) => {
|
|
132
|
+
// TODO: Check file extension for h264-mkv (render throws error atm)
|
|
133
|
+
const codecSuffix = client_1.BrowserSafeApis.getFileExtensionFromCodec(codec, 'final');
|
|
134
|
+
const newFileName = getStringBeforeSuffix(prev) + '.' + codecSuffix;
|
|
135
|
+
return newFileName;
|
|
136
|
+
});
|
|
137
|
+
}, [getStringBeforeSuffix]);
|
|
138
|
+
const setStillFormat = (0, react_1.useCallback)((format) => {
|
|
139
|
+
setImageFormat(format);
|
|
140
|
+
setOutName((prev) => {
|
|
141
|
+
const newFileName = getStringBeforeSuffix(prev) + '.' + format;
|
|
142
|
+
return newFileName;
|
|
143
|
+
});
|
|
144
|
+
}, [getStringBeforeSuffix]);
|
|
145
|
+
const onClickStill = (0, react_1.useCallback)(() => {
|
|
146
|
+
var _a;
|
|
147
|
+
(_a = SidebarContent_1.leftSidebarTabs.current) === null || _a === void 0 ? void 0 : _a.selectRendersPanel();
|
|
148
|
+
dispatchIfMounted({ type: 'start' });
|
|
149
|
+
(0, actions_1.addStillRenderJob)({
|
|
150
|
+
compositionId,
|
|
151
|
+
outName,
|
|
152
|
+
imageFormat,
|
|
153
|
+
quality: imageFormat === 'jpeg' ? quality : null,
|
|
154
|
+
frame,
|
|
155
|
+
scale,
|
|
156
|
+
verbose,
|
|
157
|
+
})
|
|
158
|
+
.then(() => {
|
|
159
|
+
dispatchIfMounted({ type: 'succeed' });
|
|
160
|
+
setSelectedModal(null);
|
|
161
|
+
})
|
|
162
|
+
.catch(() => {
|
|
163
|
+
dispatchIfMounted({ type: 'fail' });
|
|
164
|
+
});
|
|
165
|
+
}, [
|
|
166
|
+
compositionId,
|
|
167
|
+
dispatchIfMounted,
|
|
168
|
+
frame,
|
|
169
|
+
imageFormat,
|
|
170
|
+
outName,
|
|
171
|
+
quality,
|
|
172
|
+
scale,
|
|
173
|
+
setSelectedModal,
|
|
174
|
+
verbose,
|
|
175
|
+
]);
|
|
176
|
+
const onClickVideo = (0, react_1.useCallback)(() => {
|
|
177
|
+
var _a;
|
|
178
|
+
(_a = SidebarContent_1.leftSidebarTabs.current) === null || _a === void 0 ? void 0 : _a.selectRendersPanel();
|
|
179
|
+
dispatchIfMounted({ type: 'start' });
|
|
180
|
+
(0, actions_1.addVideoRenderJob)({
|
|
181
|
+
compositionId,
|
|
182
|
+
outName,
|
|
183
|
+
imageFormat: videoImageFormat,
|
|
184
|
+
quality: imageFormat === 'jpeg' ? quality : null,
|
|
185
|
+
scale,
|
|
186
|
+
verbose,
|
|
187
|
+
// TODO: Make this configurable
|
|
188
|
+
codec: videoCodec,
|
|
189
|
+
})
|
|
190
|
+
.then(() => {
|
|
191
|
+
dispatchIfMounted({ type: 'succeed' });
|
|
192
|
+
setSelectedModal(null);
|
|
193
|
+
})
|
|
194
|
+
.catch(() => {
|
|
195
|
+
dispatchIfMounted({ type: 'fail' });
|
|
196
|
+
});
|
|
197
|
+
}, [
|
|
198
|
+
compositionId,
|
|
199
|
+
dispatchIfMounted,
|
|
200
|
+
imageFormat,
|
|
201
|
+
outName,
|
|
202
|
+
quality,
|
|
203
|
+
scale,
|
|
204
|
+
setSelectedModal,
|
|
205
|
+
verbose,
|
|
206
|
+
videoCodec,
|
|
207
|
+
videoImageFormat,
|
|
208
|
+
]);
|
|
209
|
+
const onQualityChangedDirectly = (0, react_1.useCallback)((newQuality) => {
|
|
210
|
+
setQuality(newQuality);
|
|
211
|
+
}, []);
|
|
212
|
+
const onQualityChanged = (0, react_1.useCallback)((e) => {
|
|
213
|
+
setQuality((q) => {
|
|
214
|
+
const newQuality = parseInt(e, 10);
|
|
215
|
+
if (Number.isNaN(newQuality)) {
|
|
216
|
+
return q;
|
|
217
|
+
}
|
|
218
|
+
const newQualityClamped = Math.min(MAX_QUALITY, Math.max(newQuality, MIN_QUALITY));
|
|
219
|
+
return newQualityClamped;
|
|
220
|
+
});
|
|
221
|
+
}, []);
|
|
222
|
+
const onScaleSetDirectly = (0, react_1.useCallback)((newScale) => {
|
|
223
|
+
setScale(newScale);
|
|
224
|
+
}, []);
|
|
225
|
+
const onScaleChanged = (0, react_1.useCallback)((e) => {
|
|
226
|
+
setScale((q) => {
|
|
227
|
+
const newScale = parseFloat(e);
|
|
228
|
+
if (Number.isNaN(newScale)) {
|
|
229
|
+
return q;
|
|
230
|
+
}
|
|
231
|
+
const newScaleClamped = Math.min(MAX_SCALE, Math.max(newScale, MIN_SCALE));
|
|
232
|
+
return newScaleClamped;
|
|
233
|
+
});
|
|
234
|
+
}, []);
|
|
235
|
+
const onFrameSetDirectly = (0, react_1.useCallback)((newFrame) => {
|
|
236
|
+
console.log(newFrame);
|
|
237
|
+
if (newFrame > currentComposition.durationInFrames - 1) {
|
|
238
|
+
setFrame(currentComposition.durationInFrames - 1);
|
|
239
|
+
}
|
|
240
|
+
else {
|
|
241
|
+
setFrame(newFrame);
|
|
242
|
+
}
|
|
243
|
+
}, [currentComposition.durationInFrames, setFrame]);
|
|
244
|
+
const onFrameChanged = (0, react_1.useCallback)((e) => {
|
|
245
|
+
setFrame((q) => {
|
|
246
|
+
const newFrame = parseFloat(e);
|
|
247
|
+
if (Number.isNaN(newFrame)) {
|
|
248
|
+
return q;
|
|
249
|
+
}
|
|
250
|
+
// TODO: User could change frame inbetween 😈
|
|
251
|
+
return newFrame > currentComposition.durationInFrames - 1
|
|
252
|
+
? currentComposition.durationInFrames - 1
|
|
253
|
+
: newFrame;
|
|
254
|
+
});
|
|
255
|
+
}, []);
|
|
256
|
+
(0, react_1.useEffect)(() => {
|
|
257
|
+
return () => {
|
|
258
|
+
isMounted.current = false;
|
|
259
|
+
};
|
|
260
|
+
}, []);
|
|
261
|
+
const existence = (0, use_file_existence_1.useFileExistence)(outName);
|
|
262
|
+
const imageFormatOptions = (0, react_1.useMemo)(() => {
|
|
263
|
+
return [
|
|
264
|
+
{
|
|
265
|
+
label: 'PNG',
|
|
266
|
+
onClick: renderMode === 'still'
|
|
267
|
+
? () => setStillFormat('png')
|
|
268
|
+
: () => setVideoImageFormat('png'),
|
|
269
|
+
key: 'png',
|
|
270
|
+
selected: renderMode === 'still'
|
|
271
|
+
? imageFormat === 'png'
|
|
272
|
+
: videoImageFormat === 'png',
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
label: 'JPEG',
|
|
276
|
+
onClick: renderMode === 'still'
|
|
277
|
+
? () => setStillFormat('jpeg')
|
|
278
|
+
: () => setVideoImageFormat('jpeg'),
|
|
279
|
+
key: 'jpeg',
|
|
280
|
+
selected: renderMode === 'still'
|
|
281
|
+
? imageFormat === 'jpeg'
|
|
282
|
+
: videoImageFormat === 'jpeg',
|
|
283
|
+
},
|
|
284
|
+
];
|
|
285
|
+
}, [imageFormat, renderMode, setStillFormat, videoImageFormat]);
|
|
286
|
+
const videoCodecOptions = (0, react_1.useMemo)(() => {
|
|
287
|
+
const codecs = [
|
|
288
|
+
'h264',
|
|
289
|
+
'h265',
|
|
290
|
+
'vp8',
|
|
291
|
+
'vp9',
|
|
292
|
+
'mp3',
|
|
293
|
+
'aac',
|
|
294
|
+
'wav',
|
|
295
|
+
'prores',
|
|
296
|
+
'gif',
|
|
297
|
+
];
|
|
298
|
+
return codecs.map((codec) => {
|
|
299
|
+
return {
|
|
300
|
+
label: codec,
|
|
301
|
+
onClick: () => setCodec(codec),
|
|
302
|
+
key: codec,
|
|
303
|
+
selected: videoCodec === codec,
|
|
304
|
+
};
|
|
305
|
+
});
|
|
306
|
+
}, [setCodec, videoCodec]);
|
|
307
|
+
const renderTabOptions = (0, react_1.useMemo)(() => {
|
|
308
|
+
if ((currentComposition === null || currentComposition === void 0 ? void 0 : currentComposition.durationInFrames) < 2) {
|
|
309
|
+
return [
|
|
310
|
+
{
|
|
311
|
+
label: 'Still',
|
|
312
|
+
onClick: () => {
|
|
313
|
+
setRenderMode('still');
|
|
314
|
+
setStillFormat(imageFormat);
|
|
315
|
+
},
|
|
316
|
+
key: 'still',
|
|
317
|
+
selected: renderMode === 'still',
|
|
318
|
+
},
|
|
319
|
+
];
|
|
320
|
+
}
|
|
321
|
+
return [
|
|
322
|
+
{
|
|
323
|
+
label: 'Still',
|
|
324
|
+
onClick: () => {
|
|
325
|
+
setRenderMode('still');
|
|
326
|
+
setStillFormat(imageFormat);
|
|
327
|
+
},
|
|
328
|
+
key: 'still',
|
|
329
|
+
selected: renderMode === 'still',
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
label: 'Video',
|
|
333
|
+
onClick: () => {
|
|
334
|
+
setRenderMode('video');
|
|
335
|
+
setCodec(videoCodec);
|
|
336
|
+
},
|
|
337
|
+
key: 'video',
|
|
338
|
+
selected: renderMode === 'video',
|
|
339
|
+
},
|
|
340
|
+
];
|
|
341
|
+
}, [
|
|
342
|
+
currentComposition === null || currentComposition === void 0 ? void 0 : currentComposition.durationInFrames,
|
|
343
|
+
imageFormat,
|
|
344
|
+
renderMode,
|
|
345
|
+
setCodec,
|
|
346
|
+
setStillFormat,
|
|
347
|
+
videoCodec,
|
|
348
|
+
]);
|
|
349
|
+
const onVerboseLoggingChanged = (0, react_1.useCallback)((e) => {
|
|
350
|
+
setVerboseLogging(e.target.checked);
|
|
351
|
+
}, []);
|
|
352
|
+
if (renderMode === 'still') {
|
|
353
|
+
return ((0, jsx_runtime_1.jsxs)(ModalContainer_1.ModalContainer, { onOutsideClick: onQuit, onEscape: onQuit, children: [(0, jsx_runtime_1.jsx)(ModalHeader_1.NewCompHeader, { title: `Render ${compositionId}` }), (0, jsx_runtime_1.jsx)("div", { style: container, children: (0, jsx_runtime_1.jsx)(SegmentedControl_1.SegmentedControl, { items: renderTabOptions, needsWrapping: false }) }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(layout_1.Spacing, { block: true, y: 0.5 }), (0, jsx_runtime_1.jsxs)("div", { style: optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: label, children: "Format" }), (0, jsx_runtime_1.jsx)("div", { style: rightRow, children: (0, jsx_runtime_1.jsx)(SegmentedControl_1.SegmentedControl, { items: imageFormatOptions, needsWrapping: true }) })] }), (0, jsx_runtime_1.jsxs)("div", { style: optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: label, children: "Output name" }), (0, jsx_runtime_1.jsx)("div", { style: rightRow, children: (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(RemInput_1.RemotionInput
|
|
354
|
+
// TODO: Validate and reject folders or weird file names
|
|
355
|
+
, {
|
|
356
|
+
// TODO: Validate and reject folders or weird file names
|
|
357
|
+
warning: existence, style: input, type: "text", value: outName, onChange: onValueChange }), existence ? ((0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { align: "flex-end", message: "Will be overwritten" })) : null] }) })] }), currentComposition.durationInFrames > 1 ? ((0, jsx_runtime_1.jsxs)("div", { style: optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: label, children: "Frame" }), (0, jsx_runtime_1.jsxs)("div", { style: rightRow, children: [(0, jsx_runtime_1.jsx)(InputDragger_1.InputDragger, { value: frame, onTextChange: onFrameChanged,
|
|
358
|
+
// TODO: Actual frame
|
|
359
|
+
placeholder: "0-100",
|
|
360
|
+
// TODO: Debug the number input field
|
|
361
|
+
onValueChange: onFrameSetDirectly, name: "frame", step: 1, min: 0,
|
|
362
|
+
// TODO: Add actual frame
|
|
363
|
+
max: currentComposition.durationInFrames - 1 }), ' '] })] })) : null, (0, jsx_runtime_1.jsxs)(CollapsableOptions_1.CollapsableOptions, { showLabel: "Show advanced settings", hideLabel: "Hide advanced settings", children: [(0, jsx_runtime_1.jsxs)("div", { style: optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: label, children: "Scale" }), (0, jsx_runtime_1.jsx)("div", { style: rightRow, children: (0, jsx_runtime_1.jsx)(InputDragger_1.InputDragger, { value: scale, onTextChange: onScaleChanged, placeholder: "0.1-10",
|
|
364
|
+
// TODO: Does not allow non-integer steps
|
|
365
|
+
// TODO: Cannot click and type in 0.2
|
|
366
|
+
onValueChange: onScaleSetDirectly, name: "scale", step: 0.1, min: MIN_SCALE, max: MAX_SCALE }) })] }), (0, jsx_runtime_1.jsxs)("div", { style: optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: label, children: "Verbose logging" }), (0, jsx_runtime_1.jsx)("div", { style: rightRow, children: (0, jsx_runtime_1.jsx)("input", { type: 'checkbox', checked: verbose, onChange: onVerboseLoggingChanged }) })] }), imageFormat === 'jpeg' && ((0, jsx_runtime_1.jsxs)("div", { style: optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: label, children: "JPEG Quality" }), (0, jsx_runtime_1.jsx)("div", { style: rightRow, children: (0, jsx_runtime_1.jsx)(InputDragger_1.InputDragger, { value: quality, onTextChange: onQualityChanged, placeholder: "0-100", onValueChange: onQualityChangedDirectly, name: "quality", step: 1, min: MIN_QUALITY, max: MAX_QUALITY }) })] }))] }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { block: true, y: 0.5 }), (0, jsx_runtime_1.jsx)("div", { style: buttonRow, children: (0, jsx_runtime_1.jsx)(Button_1.Button, { autoFocus: true, onClick: onClickStill, disabled: state.type === 'load', children: state.type === 'idle' ? 'Render still' : 'Rendering...' }) })] })] }));
|
|
367
|
+
}
|
|
368
|
+
return ((0, jsx_runtime_1.jsxs)(ModalContainer_1.ModalContainer, { onOutsideClick: onQuit, onEscape: onQuit, children: [(0, jsx_runtime_1.jsx)(ModalHeader_1.NewCompHeader, { title: `Render ${compositionId}` }), (0, jsx_runtime_1.jsx)("div", { style: container, children: (0, jsx_runtime_1.jsx)(SegmentedControl_1.SegmentedControl, { items: renderTabOptions, needsWrapping: false }) }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(layout_1.Spacing, { block: true, y: 0.5 }), (0, jsx_runtime_1.jsxs)("div", { style: optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: label, children: "Codec" }), (0, jsx_runtime_1.jsx)("div", { style: rightRow, children: (0, jsx_runtime_1.jsx)(SegmentedControl_1.SegmentedControl, { items: videoCodecOptions, needsWrapping: true }) })] }), (0, jsx_runtime_1.jsxs)("div", { style: optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: label, children: "Output name" }), (0, jsx_runtime_1.jsx)("div", { style: rightRow, children: (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(RemInput_1.RemotionInput
|
|
369
|
+
// TODO: Validate and reject folders or weird file names
|
|
370
|
+
, {
|
|
371
|
+
// TODO: Validate and reject folders or weird file names
|
|
372
|
+
warning: existence, style: input, type: "text", value: outName, onChange: onValueChange }), existence ? ((0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { align: "flex-end", message: "Will be overwritten" })) : null] }) })] }), (0, jsx_runtime_1.jsxs)(CollapsableOptions_1.CollapsableOptions, { showLabel: "Show advanced settings", hideLabel: "Hide advanced settings", children: [(0, jsx_runtime_1.jsxs)("div", { style: optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: label, children: "Scale" }), (0, jsx_runtime_1.jsx)("div", { style: rightRow, children: (0, jsx_runtime_1.jsx)(InputDragger_1.InputDragger, { value: scale, onTextChange: onScaleChanged, placeholder: "0.1-10",
|
|
373
|
+
// TODO: Direct input does not allow non-integer steps
|
|
374
|
+
// TODO: Cannot click and type in 0.2
|
|
375
|
+
onValueChange: onScaleSetDirectly, name: "scale", step: 0.1, min: MIN_SCALE, max: MAX_SCALE }) })] }), (0, jsx_runtime_1.jsxs)("div", { style: optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: label, children: "Verbose logging" }), (0, jsx_runtime_1.jsx)("div", { style: rightRow, children: (0, jsx_runtime_1.jsx)("input", { type: 'checkbox', checked: verbose, onChange: onVerboseLoggingChanged }) })] }), (0, jsx_runtime_1.jsxs)("div", { style: optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: label, children: "Image Format" }), (0, jsx_runtime_1.jsx)("div", { style: rightRow, children: (0, jsx_runtime_1.jsx)(SegmentedControl_1.SegmentedControl, { items: imageFormatOptions, needsWrapping: false }) })] }), videoImageFormat === 'jpeg' && ((0, jsx_runtime_1.jsxs)("div", { style: optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: label, children: "JPEG Quality" }), (0, jsx_runtime_1.jsx)("div", { style: rightRow, children: (0, jsx_runtime_1.jsx)(InputDragger_1.InputDragger, { value: quality, onTextChange: onQualityChanged, placeholder: "0-100", onValueChange: onQualityChangedDirectly, name: "quality", step: 1, min: MIN_QUALITY, max: MAX_QUALITY }) })] }))] }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { block: true, y: 0.5 }), (0, jsx_runtime_1.jsx)("div", { style: buttonRow, children: (0, jsx_runtime_1.jsx)(Button_1.Button, { autoFocus: true, onClick: onClickVideo, disabled: state.type === 'load', children: state.type === 'idle' ? 'Render video' : 'Rendering...' }) })] })] }));
|
|
376
|
+
};
|
|
377
|
+
exports.RenderModal = RenderModal;
|