@remotion/cli 4.0.44 → 4.0.45
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/config/presets-profile.d.ts +3 -0
- package/dist/config/presets-profile.js +12 -0
- package/dist/editor/components/Canvas.js +10 -28
- package/dist/editor/components/CanvasOrLoading.js +1 -1
- package/dist/editor/components/CheckboardToggle.js +0 -5
- package/dist/editor/components/CompositionSelectorItem.js +1 -7
- package/dist/editor/components/CurrentCompositionSideEffects.js +4 -0
- package/dist/editor/components/DownloadButton.d.ts +0 -0
- package/dist/editor/components/DownloadButton.js +1 -0
- package/dist/editor/components/EditorContent.js +3 -1
- package/dist/editor/components/FilePreview.d.ts +2 -1
- package/dist/editor/components/FilePreview.js +10 -3
- package/dist/editor/components/InitialCompositionLoader.js +9 -2
- package/dist/editor/components/LoopToggle.js +0 -7
- package/dist/editor/components/MuteToggle.js +0 -7
- package/dist/editor/components/PlayPause.js +0 -4
- package/dist/editor/components/Preview.d.ts +3 -2
- package/dist/editor/components/Preview.js +13 -72
- package/dist/editor/components/PreviewToolbar.js +4 -1
- package/dist/editor/components/RenderPreview.d.ts +2 -0
- package/dist/editor/components/RenderPreview.js +4 -3
- package/dist/editor/components/RenderQueue/RenderQueueCopyToClipboard.js +3 -2
- package/dist/editor/components/RenderQueue/RenderQueueItem.d.ts +1 -0
- package/dist/editor/components/RenderQueue/RenderQueueItem.js +55 -2
- package/dist/editor/components/RenderQueue/RenderQueueItemCancelButton.js +2 -1
- package/dist/editor/components/RenderQueue/RenderQueueItemStatus.js +35 -4
- package/dist/editor/components/RenderQueue/RenderQueueOpenInFolder.js +3 -2
- package/dist/editor/components/RenderQueue/RenderQueueOutputName.js +3 -11
- package/dist/editor/components/RenderQueue/RenderQueueRemoveItem.js +2 -1
- package/dist/editor/components/RenderQueue/RenderQueueRepeat.js +2 -1
- package/dist/editor/components/RenderQueue/index.js +16 -1
- package/dist/editor/components/SizeSelector.js +15 -6
- package/dist/editor/components/StaticFilePreview.d.ts +2 -0
- package/dist/editor/components/StaticFilePreview.js +2 -10
- package/dist/editor/components/TimelineInOutToggle.js +0 -6
- package/dist/editor/components/ZoomPersistor.js +9 -3
- package/dist/editor/components/layout.d.ts +2 -1
- package/dist/editor/components/layout.js +2 -2
- package/dist/editor/helpers/get-asset-metadata.d.ts +11 -0
- package/dist/editor/helpers/get-asset-metadata.js +64 -0
- package/dist/editor/helpers/is-current-selected-still.d.ts +1 -0
- package/dist/editor/helpers/is-current-selected-still.js +14 -1
- package/dist/handle-common-errors.d.ts +2 -0
- package/dist/handle-common-errors.js +60 -0
- package/dist/preview-server/routes.d.ts +5 -3
- package/dist/preview-server/routes.js +52 -8
- package/dist/preview-server/serve-static.d.ts +6 -1
- package/dist/preview-server/serve-static.js +1 -4
- package/dist/preview-server/start-server.d.ts +4 -2
- package/dist/preview-server/start-server.js +4 -2
- package/dist/studio.js +9 -4
- package/package.json +8 -8
|
@@ -7,7 +7,8 @@ const InlineAction_1 = require("../InlineAction");
|
|
|
7
7
|
const NotificationCenter_1 = require("../Notifications/NotificationCenter");
|
|
8
8
|
const actions_1 = require("./actions");
|
|
9
9
|
const RenderQueueCancelButton = ({ job }) => {
|
|
10
|
-
const onClick = (0, react_1.useCallback)(() => {
|
|
10
|
+
const onClick = (0, react_1.useCallback)((e) => {
|
|
11
|
+
e.stopPropagation();
|
|
11
12
|
(0, actions_1.cancelRenderJob)(job).catch((err) => {
|
|
12
13
|
(0, NotificationCenter_1.sendErrorNotification)(`Could not cancel job: ${err.message}`);
|
|
13
14
|
});
|
|
@@ -1,8 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
2
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
26
|
exports.RenderQueueItemStatus = void 0;
|
|
4
27
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 = require("react");
|
|
28
|
+
const react_1 = __importStar(require("react"));
|
|
6
29
|
const colors_1 = require("../../helpers/colors");
|
|
7
30
|
const modals_1 = require("../../state/modals");
|
|
8
31
|
const CircularProgress_1 = require("./CircularProgress");
|
|
@@ -19,7 +42,15 @@ const invisibleStyle = {
|
|
|
19
42
|
};
|
|
20
43
|
const RenderQueueItemStatus = ({ job }) => {
|
|
21
44
|
const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
22
|
-
const
|
|
45
|
+
const [hovered, setHovered] = react_1.default.useState(false);
|
|
46
|
+
const onPointerEnter = (0, react_1.useCallback)(() => {
|
|
47
|
+
setHovered(true);
|
|
48
|
+
}, []);
|
|
49
|
+
const onPointerLeave = (0, react_1.useCallback)(() => {
|
|
50
|
+
setHovered(false);
|
|
51
|
+
}, []);
|
|
52
|
+
const onClick = (0, react_1.useCallback)((e) => {
|
|
53
|
+
e.stopPropagation();
|
|
23
54
|
setSelectedModal({
|
|
24
55
|
type: 'render-progress',
|
|
25
56
|
jobId: job.id,
|
|
@@ -32,11 +63,11 @@ const RenderQueueItemStatus = ({ job }) => {
|
|
|
32
63
|
return ((0, jsx_runtime_1.jsx)("svg", { style: iconStyle, viewBox: "0 0 512 512", children: (0, jsx_runtime_1.jsx)("path", { fill: colors_1.LIGHT_TEXT, d: "M256 512C114.6 512 0 397.4 0 256S114.6 0 256 0S512 114.6 512 256s-114.6 256-256 256zM232 120V256c0 8 4 15.5 10.7 20l96 64c11 7.4 25.9 4.4 33.3-6.7s4.4-25.9-6.7-33.3L280 243.2V120c0-13.3-10.7-24-24-24s-24 10.7-24 24z" }) }));
|
|
33
64
|
}
|
|
34
65
|
if (job.status === 'done') {
|
|
35
|
-
return ((0, jsx_runtime_1.jsx)("button", { type: "button", style: invisibleStyle, onClick:
|
|
66
|
+
return ((0, jsx_runtime_1.jsx)("button", { type: "button", style: invisibleStyle, onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, onClick: onClick, children: (0, jsx_runtime_1.jsx)("svg", { style: iconStyle, viewBox: "0 0 512 512", children: (0, jsx_runtime_1.jsx)("path", { fill: hovered ? 'white' : colors_1.LIGHT_TEXT, d: "M256 512c141.4 0 256-114.6 256-256S397.4 0 256 0S0 114.6 0 256S114.6 512 256 512zM369 209L241 337l-17 17-17-17-64-64-17-17L160 222.1l17 17 47 47L335 175l17-17L385.9 192l-17 17z" }) }) }));
|
|
36
67
|
}
|
|
37
68
|
if (job.status === 'running') {
|
|
38
69
|
// Add a minimum progress to avoid the progress bar from disappearing
|
|
39
|
-
return ((0, jsx_runtime_1.jsx)("button", { type: "button", style: invisibleStyle, onClick:
|
|
70
|
+
return ((0, jsx_runtime_1.jsx)("button", { type: "button", style: invisibleStyle, onClick: onClick, children: (0, jsx_runtime_1.jsx)(CircularProgress_1.CircularProgress, { progress: Math.max(0.07, job.progress.value) }) }));
|
|
40
71
|
}
|
|
41
72
|
throw new Error('Unknown job status');
|
|
42
73
|
};
|
|
@@ -7,8 +7,9 @@ const folder_1 = require("../../icons/folder");
|
|
|
7
7
|
const InlineAction_1 = require("../InlineAction");
|
|
8
8
|
const NotificationCenter_1 = require("../Notifications/NotificationCenter");
|
|
9
9
|
const actions_1 = require("./actions");
|
|
10
|
-
const RenderQueueOpenInFinderItem = ({ job
|
|
11
|
-
const onClick = (0, react_1.useCallback)(() => {
|
|
10
|
+
const RenderQueueOpenInFinderItem = ({ job }) => {
|
|
11
|
+
const onClick = (0, react_1.useCallback)((e) => {
|
|
12
|
+
e.stopPropagation();
|
|
12
13
|
(0, actions_1.openInFileExplorer)({ directory: job.outName }).catch((err) => {
|
|
13
14
|
(0, NotificationCenter_1.sendErrorNotification)(`Could not open file: ${err.message}`);
|
|
14
15
|
});
|
|
@@ -3,24 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.RenderQueueOutputName = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
-
const NotificationCenter_1 = require("../Notifications/NotificationCenter");
|
|
7
|
-
const actions_1 = require("./actions");
|
|
8
6
|
const item_style_1 = require("./item-style");
|
|
9
7
|
const RenderQueueOutputName = ({ job }) => {
|
|
10
|
-
const onClick = (0, react_1.useCallback)(() => {
|
|
11
|
-
if (job.deletedOutputLocation)
|
|
12
|
-
return;
|
|
13
|
-
(0, actions_1.openInFileExplorer)({ directory: job.outName }).catch((err) => {
|
|
14
|
-
(0, NotificationCenter_1.sendErrorNotification)(err.message);
|
|
15
|
-
});
|
|
16
|
-
}, [job]);
|
|
17
8
|
const style = (0, react_1.useMemo)(() => {
|
|
18
9
|
return {
|
|
19
10
|
...item_style_1.renderQueueItemSubtitleStyle,
|
|
20
|
-
cursor: job.deletedOutputLocation ? 'inherit' : 'pointer',
|
|
21
11
|
textDecoration: job.deletedOutputLocation ? 'line-through' : 'none',
|
|
12
|
+
color: item_style_1.renderQueueItemSubtitleStyle.color,
|
|
13
|
+
cursor: 'inherit',
|
|
22
14
|
};
|
|
23
15
|
}, [job.deletedOutputLocation]);
|
|
24
|
-
return ((0, jsx_runtime_1.jsx)("
|
|
16
|
+
return ((0, jsx_runtime_1.jsx)("span", { style: style, title: job.deletedOutputLocation ? 'File was deleted' : job.outName, children: job.outName }));
|
|
25
17
|
};
|
|
26
18
|
exports.RenderQueueOutputName = RenderQueueOutputName;
|
|
@@ -7,7 +7,8 @@ const InlineAction_1 = require("../InlineAction");
|
|
|
7
7
|
const NotificationCenter_1 = require("../Notifications/NotificationCenter");
|
|
8
8
|
const actions_1 = require("./actions");
|
|
9
9
|
const RenderQueueRemoveItem = ({ job }) => {
|
|
10
|
-
const onClick = (0, react_1.useCallback)(() => {
|
|
10
|
+
const onClick = (0, react_1.useCallback)((e) => {
|
|
11
|
+
e.stopPropagation();
|
|
11
12
|
(0, actions_1.removeRenderJob)(job)
|
|
12
13
|
.then(() => {
|
|
13
14
|
var _a;
|
|
@@ -8,7 +8,8 @@ const modals_1 = require("../../state/modals");
|
|
|
8
8
|
const InlineAction_1 = require("../InlineAction");
|
|
9
9
|
const RenderQueueRepeatItem = ({ job }) => {
|
|
10
10
|
const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
11
|
-
const onClick = (0, react_1.useCallback)(() => {
|
|
11
|
+
const onClick = (0, react_1.useCallback)((e) => {
|
|
12
|
+
e.stopPropagation();
|
|
12
13
|
const retryPayload = (0, make_retry_payload_1.makeRetryPayload)(job);
|
|
13
14
|
setSelectedModal(retryPayload);
|
|
14
15
|
}, [job, setSelectedModal]);
|
|
@@ -26,6 +26,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
26
26
|
exports.RenderQueue = void 0;
|
|
27
27
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
28
28
|
const react_1 = __importStar(require("react"));
|
|
29
|
+
const remotion_1 = require("remotion");
|
|
29
30
|
const client_id_1 = require("../../helpers/client-id");
|
|
30
31
|
const colors_1 = require("../../helpers/colors");
|
|
31
32
|
const layout_1 = require("../layout");
|
|
@@ -59,6 +60,7 @@ const renderQueue = {
|
|
|
59
60
|
const RenderQueue = () => {
|
|
60
61
|
const connectionStatus = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx).type;
|
|
61
62
|
const { jobs } = (0, react_1.useContext)(context_1.RenderQueueContext);
|
|
63
|
+
const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
62
64
|
const previousJobCount = react_1.default.useRef(jobs.length);
|
|
63
65
|
const jobCount = jobs.length;
|
|
64
66
|
const divRef = react_1.default.useRef(null);
|
|
@@ -75,6 +77,19 @@ const RenderQueue = () => {
|
|
|
75
77
|
}
|
|
76
78
|
previousJobCount.current = jobCount;
|
|
77
79
|
}, [jobCount]);
|
|
80
|
+
const selectedJob = (0, react_1.useMemo)(() => {
|
|
81
|
+
let selectedIndex = -1;
|
|
82
|
+
for (let i = 0; i < jobs.length; i++) {
|
|
83
|
+
const job = jobs[i];
|
|
84
|
+
if (canvasContent &&
|
|
85
|
+
canvasContent.type === 'output' &&
|
|
86
|
+
canvasContent.path === `/${job.outName}` &&
|
|
87
|
+
job.status === 'done') {
|
|
88
|
+
selectedIndex = i;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return selectedIndex;
|
|
92
|
+
}, [canvasContent, jobs]);
|
|
78
93
|
if (connectionStatus === 'disconnected') {
|
|
79
94
|
return ((0, jsx_runtime_1.jsxs)("div", { style: explainer, children: [(0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 5 }), (0, jsx_runtime_1.jsx)("div", { style: errorExplanation, children: "The studio server has disconnected." }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 2, block: true })] }));
|
|
80
95
|
}
|
|
@@ -82,7 +97,7 @@ const RenderQueue = () => {
|
|
|
82
97
|
return ((0, jsx_runtime_1.jsxs)("div", { style: explainer, children: [(0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 5 }), (0, jsx_runtime_1.jsx)("div", { style: errorExplanation, children: "No renders in the queue." }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 2, block: true })] }));
|
|
83
98
|
}
|
|
84
99
|
return ((0, jsx_runtime_1.jsx)("div", { ref: divRef, style: renderQueue, className: ['css-reset', is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME].join(' '), children: jobs.map((j, index) => {
|
|
85
|
-
return ((0, jsx_runtime_1.jsx)("div", { style: index === jobs.length - 1 ? undefined : separatorStyle, children: (0, jsx_runtime_1.jsx)(RenderQueueItem_1.RenderQueueItem, { job: j }) }, j.id));
|
|
100
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: index === jobs.length - 1 ? undefined : separatorStyle, children: (0, jsx_runtime_1.jsx)(RenderQueueItem_1.RenderQueueItem, { selected: selectedJob === index, job: j }) }, j.id));
|
|
86
101
|
}) }));
|
|
87
102
|
};
|
|
88
103
|
exports.RenderQueue = RenderQueue;
|
|
@@ -67,8 +67,8 @@ const getUniqueSizes = (size) => {
|
|
|
67
67
|
});
|
|
68
68
|
};
|
|
69
69
|
exports.getUniqueSizes = getUniqueSizes;
|
|
70
|
+
const zoomableFileTypes = ['video', 'image'];
|
|
70
71
|
const SizeSelector = () => {
|
|
71
|
-
const zoomableFileTypes = ['video', 'image'];
|
|
72
72
|
const { size, setSize } = (0, react_1.useContext)(preview_size_1.PreviewSizeContext);
|
|
73
73
|
const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
74
74
|
const style = (0, react_1.useMemo)(() => {
|
|
@@ -77,13 +77,22 @@ const SizeSelector = () => {
|
|
|
77
77
|
};
|
|
78
78
|
}, []);
|
|
79
79
|
const zoomable = (0, react_1.useMemo)(() => {
|
|
80
|
-
if (
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
80
|
+
if (!canvasContent) {
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
if (canvasContent.type === 'composition') {
|
|
84
|
+
return true;
|
|
85
|
+
}
|
|
86
|
+
if (canvasContent.type === 'asset' &&
|
|
87
|
+
zoomableFileTypes.includes((0, Preview_1.getPreviewFileType)(canvasContent.asset))) {
|
|
88
|
+
return true;
|
|
89
|
+
}
|
|
90
|
+
if (canvasContent.type === 'output' &&
|
|
91
|
+
zoomableFileTypes.includes((0, Preview_1.getPreviewFileType)(canvasContent.path))) {
|
|
92
|
+
return true;
|
|
84
93
|
}
|
|
85
94
|
return false;
|
|
86
|
-
}, [canvasContent
|
|
95
|
+
}, [canvasContent]);
|
|
87
96
|
const items = (0, react_1.useMemo)(() => {
|
|
88
97
|
return (0, exports.getUniqueSizes)(size).map((newSize) => {
|
|
89
98
|
return {
|
|
@@ -4,7 +4,6 @@ exports.StaticFilePreview = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const remotion_1 = require("remotion");
|
|
7
|
-
const format_bytes_1 = require("../../format-bytes");
|
|
8
7
|
const client_id_1 = require("../helpers/client-id");
|
|
9
8
|
const colors_1 = require("../helpers/colors");
|
|
10
9
|
const FilePreview_1 = require("./FilePreview");
|
|
@@ -20,7 +19,7 @@ const errMsgStyle = {
|
|
|
20
19
|
...msgStyle,
|
|
21
20
|
color: colors_1.LIGHT_TEXT,
|
|
22
21
|
};
|
|
23
|
-
const StaticFilePreview = ({ currentAsset, }) => {
|
|
22
|
+
const StaticFilePreview = ({ currentAsset, assetMetadata }) => {
|
|
24
23
|
const fileType = (0, Preview_1.getPreviewFileType)(currentAsset);
|
|
25
24
|
const staticFileSrc = (0, remotion_1.staticFile)(currentAsset);
|
|
26
25
|
const staticFiles = (0, remotion_1.getStaticFiles)();
|
|
@@ -32,16 +31,9 @@ const StaticFilePreview = ({ currentAsset, }) => {
|
|
|
32
31
|
if (!exists) {
|
|
33
32
|
return ((0, jsx_runtime_1.jsxs)("div", { style: errMsgStyle, children: [currentAsset, " does not exist in your public folder."] }));
|
|
34
33
|
}
|
|
35
|
-
const fileSize = (() => {
|
|
36
|
-
const fileFromStaticFiles = staticFiles.find((file) => file.name === currentAsset);
|
|
37
|
-
if (fileFromStaticFiles) {
|
|
38
|
-
return (0, format_bytes_1.formatBytes)(fileFromStaticFiles === null || fileFromStaticFiles === void 0 ? void 0 : fileFromStaticFiles.sizeInBytes);
|
|
39
|
-
}
|
|
40
|
-
return null;
|
|
41
|
-
})();
|
|
42
34
|
if (!currentAsset) {
|
|
43
35
|
return null;
|
|
44
36
|
}
|
|
45
|
-
return ((0, jsx_runtime_1.jsx)(FilePreview_1.FilePreview, { currentAsset: currentAsset,
|
|
37
|
+
return ((0, jsx_runtime_1.jsx)(FilePreview_1.FilePreview, { currentAsset: currentAsset, fileType: fileType, src: staticFileSrc, assetMetadata: assetMetadata }));
|
|
46
38
|
};
|
|
47
39
|
exports.StaticFilePreview = StaticFilePreview;
|
|
@@ -6,7 +6,6 @@ const react_1 = require("react");
|
|
|
6
6
|
const remotion_1 = require("remotion");
|
|
7
7
|
const truthy_1 = require("../../truthy");
|
|
8
8
|
const colors_1 = require("../helpers/colors");
|
|
9
|
-
const is_current_selected_still_1 = require("../helpers/is-current-selected-still");
|
|
10
9
|
const use_keybinding_1 = require("../helpers/use-keybinding");
|
|
11
10
|
const timelineInOutPointer_1 = require("../icons/timelineInOutPointer");
|
|
12
11
|
const in_out_1 = require("../state/in-out");
|
|
@@ -27,9 +26,7 @@ exports.defaultInOutValue = { inFrame: null, outFrame: null };
|
|
|
27
26
|
const TimelineInOutPointToggle = () => {
|
|
28
27
|
const timelinePosition = remotion_1.Internals.Timeline.useTimelinePosition();
|
|
29
28
|
const { inFrame, outFrame } = (0, in_out_1.useTimelineInOutFramePosition)();
|
|
30
|
-
const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
31
29
|
const { setInAndOutFrames } = (0, in_out_1.useTimelineSetInOutFramePosition)();
|
|
32
|
-
const isStill = (0, is_current_selected_still_1.useIsStill)();
|
|
33
30
|
const videoConfig = remotion_1.Internals.useUnsafeVideoConfig();
|
|
34
31
|
const keybindings = (0, use_keybinding_1.useKeybinding)();
|
|
35
32
|
const onInOutClear = (0, react_1.useCallback)((composition) => {
|
|
@@ -235,9 +232,6 @@ const TimelineInOutPointToggle = () => {
|
|
|
235
232
|
outMarkClick: onOutMark,
|
|
236
233
|
};
|
|
237
234
|
}, [confId, onInMark, onInOutClear, onOutMark]);
|
|
238
|
-
if (isStill || canvasContent === null || canvasContent.type === 'asset') {
|
|
239
|
-
return null;
|
|
240
|
-
}
|
|
241
235
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ControlButton_1.ControlButton, { title: getTooltipText('In', 'I'), "aria-label": getTooltipText('In', 'I'), onClick: (e) => onInMark(e), onContextMenu: clearInMark, disabled: !videoConfig || timelinePosition === 0, children: (0, jsx_runtime_1.jsx)(timelineInOutPointer_1.TimelineInPointer, { color: inFrame === null ? 'white' : colors_1.BLUE, style: style }) }), (0, jsx_runtime_1.jsx)(ControlButton_1.ControlButton, { title: getTooltipText('Out', 'O'), "aria-label": getTooltipText('Out', 'O'), onClick: onOutMark, onContextMenu: clearOutMark, disabled: !videoConfig || timelinePosition === videoConfig.durationInFrames - 1, children: (0, jsx_runtime_1.jsx)(timelineInOutPointer_1.TimelineOutPointer, { color: outFrame === null ? 'white' : colors_1.BLUE, style: style }) })] }));
|
|
242
236
|
};
|
|
243
237
|
exports.TimelineInOutPointToggle = TimelineInOutPointToggle;
|
|
@@ -20,12 +20,18 @@ const getZoomForComposition = (composition) => {
|
|
|
20
20
|
};
|
|
21
21
|
exports.getZoomForComposition = getZoomForComposition;
|
|
22
22
|
const deriveCanvasContentFromUrl = () => {
|
|
23
|
-
const substrings = window.location.pathname.split('/');
|
|
23
|
+
const substrings = window.location.pathname.split('/').filter(Boolean);
|
|
24
24
|
const lastPart = substrings[substrings.length - 1];
|
|
25
|
-
if (substrings
|
|
25
|
+
if (substrings[0] === 'assets') {
|
|
26
26
|
return {
|
|
27
27
|
type: 'asset',
|
|
28
|
-
asset: decodeURIComponent(window.location.pathname.substring(
|
|
28
|
+
asset: decodeURIComponent(window.location.pathname.substring('/assets/'.length)),
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
if (substrings[0] === 'outputs') {
|
|
32
|
+
return {
|
|
33
|
+
type: 'output',
|
|
34
|
+
path: decodeURIComponent(window.location.pathname.substring('/outputs/'.length)),
|
|
29
35
|
};
|
|
30
36
|
}
|
|
31
37
|
if (lastPart) {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'react';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
export declare const SPACING_UNIT = 8;
|
|
3
4
|
export declare const Spacing: React.FC<{
|
|
@@ -15,7 +16,7 @@ export declare const Row: React.FC<{
|
|
|
15
16
|
flex?: number;
|
|
16
17
|
className?: string;
|
|
17
18
|
children: React.ReactNode;
|
|
18
|
-
}
|
|
19
|
+
} & HTMLAttributes<HTMLDivElement>>;
|
|
19
20
|
export declare const Column: React.FC<{
|
|
20
21
|
justify?: 'center';
|
|
21
22
|
align?: 'center';
|
|
@@ -19,7 +19,7 @@ exports.Spacing = Spacing;
|
|
|
19
19
|
const flexCss = { flex: 1 };
|
|
20
20
|
const Flex = ({ children }) => (0, jsx_runtime_1.jsx)("div", { style: flexCss, children: children });
|
|
21
21
|
exports.Flex = Flex;
|
|
22
|
-
const Row = ({ children, justify, className, align, flex, style = {} }) => {
|
|
22
|
+
const Row = ({ children, justify, className, align, flex, style = {}, ...other }) => {
|
|
23
23
|
const finalStyle = (0, react_1.useMemo)(() => {
|
|
24
24
|
return {
|
|
25
25
|
...style,
|
|
@@ -30,7 +30,7 @@ const Row = ({ children, justify, className, align, flex, style = {} }) => {
|
|
|
30
30
|
flex: flex !== null && flex !== void 0 ? flex : undefined,
|
|
31
31
|
};
|
|
32
32
|
}, [align, flex, justify, style]);
|
|
33
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: className, style: finalStyle, children: children }));
|
|
33
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: className, style: finalStyle, ...other, children: children }));
|
|
34
34
|
};
|
|
35
35
|
exports.Row = Row;
|
|
36
36
|
const Column = ({ children, justify, className, align, style = {} }) => {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { CanvasContent } from 'remotion';
|
|
2
|
+
import type { Dimensions } from './is-current-selected-still';
|
|
3
|
+
export declare const remotion_outputsBase: string;
|
|
4
|
+
export type AssetMetadata = {
|
|
5
|
+
type: 'not-found';
|
|
6
|
+
} | {
|
|
7
|
+
type: 'found';
|
|
8
|
+
size: number;
|
|
9
|
+
dimensions: Dimensions | 'none' | null;
|
|
10
|
+
};
|
|
11
|
+
export declare const getAssetMetadata: (canvasContent: CanvasContent) => Promise<AssetMetadata>;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAssetMetadata = exports.remotion_outputsBase = void 0;
|
|
4
|
+
const media_utils_1 = require("@remotion/media-utils");
|
|
5
|
+
const remotion_1 = require("remotion");
|
|
6
|
+
const Preview_1 = require("../components/Preview");
|
|
7
|
+
exports.remotion_outputsBase = window.remotion_staticBase.replace('static', 'outputs');
|
|
8
|
+
const getSrcFromCanvasContent = (canvasContent) => {
|
|
9
|
+
if (canvasContent.type === 'asset') {
|
|
10
|
+
return (0, remotion_1.staticFile)(canvasContent.asset);
|
|
11
|
+
}
|
|
12
|
+
if (canvasContent.type === 'composition') {
|
|
13
|
+
throw new Error('cannot get dimensions for composition');
|
|
14
|
+
}
|
|
15
|
+
return exports.remotion_outputsBase + canvasContent.path;
|
|
16
|
+
};
|
|
17
|
+
const getAssetMetadata = async (canvasContent) => {
|
|
18
|
+
const src = getSrcFromCanvasContent(canvasContent);
|
|
19
|
+
const file = await fetch(src, {
|
|
20
|
+
method: 'HEAD',
|
|
21
|
+
});
|
|
22
|
+
if (file.status === 404) {
|
|
23
|
+
return { type: 'not-found' };
|
|
24
|
+
}
|
|
25
|
+
if (file.status !== 200) {
|
|
26
|
+
throw new Error(`Expected status code 200 or 404 for file, got ${file.status}`);
|
|
27
|
+
}
|
|
28
|
+
const size = file.headers.get('content-length');
|
|
29
|
+
if (!size) {
|
|
30
|
+
throw new Error('Unexpected error: content-length is null');
|
|
31
|
+
}
|
|
32
|
+
const fileType = (0, Preview_1.getPreviewFileType)(src);
|
|
33
|
+
if (fileType === 'video') {
|
|
34
|
+
const resolution = await (0, media_utils_1.getVideoMetadata)(src);
|
|
35
|
+
return {
|
|
36
|
+
type: 'found',
|
|
37
|
+
size: Number(size),
|
|
38
|
+
dimensions: { width: resolution.width, height: resolution.height },
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
if (fileType === 'image') {
|
|
42
|
+
const resolution = await new Promise((resolve, reject) => {
|
|
43
|
+
const img = new Image();
|
|
44
|
+
img.onload = () => {
|
|
45
|
+
resolve({
|
|
46
|
+
type: 'found',
|
|
47
|
+
size: Number(size),
|
|
48
|
+
dimensions: { width: img.width, height: img.height },
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
img.onerror = () => {
|
|
52
|
+
reject(new Error('Failed to load image'));
|
|
53
|
+
};
|
|
54
|
+
img.src = src;
|
|
55
|
+
});
|
|
56
|
+
return resolution;
|
|
57
|
+
}
|
|
58
|
+
return {
|
|
59
|
+
type: 'found',
|
|
60
|
+
dimensions: 'none',
|
|
61
|
+
size: Number(size),
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
exports.getAssetMetadata = getAssetMetadata;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useIsStill = void 0;
|
|
3
|
+
exports.useIsVideoComposition = exports.useIsStill = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
4
5
|
const remotion_1 = require("remotion");
|
|
5
6
|
const is_composition_still_1 = require("./is-composition-still");
|
|
6
7
|
const useIsStill = () => {
|
|
@@ -11,3 +12,15 @@ const useIsStill = () => {
|
|
|
11
12
|
return (0, is_composition_still_1.isCompositionStill)(resolved.result);
|
|
12
13
|
};
|
|
13
14
|
exports.useIsStill = useIsStill;
|
|
15
|
+
const useIsVideoComposition = () => {
|
|
16
|
+
const isStill = (0, exports.useIsStill)();
|
|
17
|
+
const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
18
|
+
if (canvasContent === null) {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
if (isStill) {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
return canvasContent.type === 'composition';
|
|
25
|
+
};
|
|
26
|
+
exports.useIsVideoComposition = useIsVideoComposition;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.handleCommonError = void 0;
|
|
4
|
+
const chalk_1 = require("./chalk");
|
|
5
|
+
const log_1 = require("./log");
|
|
6
|
+
const print_error_1 = require("./print-error");
|
|
7
|
+
const truthy_1 = require("./truthy");
|
|
8
|
+
const handleCommonError = async (err, logLevel) => {
|
|
9
|
+
var _a;
|
|
10
|
+
await (0, print_error_1.printError)(err, logLevel);
|
|
11
|
+
if (err.message.includes('Could not play video with')) {
|
|
12
|
+
log_1.Log.info();
|
|
13
|
+
log_1.Log.info('💡 Get help for this issue at https://remotion.dev/docs/media-playback-error');
|
|
14
|
+
}
|
|
15
|
+
if (err.message.includes('A delayRender()') &&
|
|
16
|
+
err.message.includes('was called but not cleared after')) {
|
|
17
|
+
log_1.Log.info();
|
|
18
|
+
log_1.Log.info('💡 Get help for this issue at https://remotion.dev/docs/timeout');
|
|
19
|
+
}
|
|
20
|
+
if (err.message.includes('Target closed')) {
|
|
21
|
+
log_1.Log.info();
|
|
22
|
+
log_1.Log.info('💡 Get help for this issue at https://remotion.dev/docs/target-closed');
|
|
23
|
+
}
|
|
24
|
+
if (err.message.includes('ENAMETOOLONG')) {
|
|
25
|
+
log_1.Log.info();
|
|
26
|
+
log_1.Log.info('💡 Get help for this issue at https://remotion.dev/docs/enametoolong');
|
|
27
|
+
}
|
|
28
|
+
if (err.message.includes('Error creating WebGL context')) {
|
|
29
|
+
log_1.Log.info();
|
|
30
|
+
log_1.Log.warn('💡 You might need to set the OpenGL renderer to "angle" (or "swangle" if rendering on lambda). Learn why at https://www.remotion.dev/docs/three');
|
|
31
|
+
log_1.Log.warn("💡 Check how it's done at https://www.remotion.dev/docs/chromium-flags#--gl");
|
|
32
|
+
}
|
|
33
|
+
if (err.message.includes('The bucket does not allow ACLs')) {
|
|
34
|
+
log_1.Log.info();
|
|
35
|
+
log_1.Log.info(chalk_1.chalk.green('💡 Fix this issue https://remotion.dev/docs/lambda/troubleshooting/bucket-disallows-acl'));
|
|
36
|
+
}
|
|
37
|
+
if (err.message.includes('Minified React error #306')) {
|
|
38
|
+
const componentName = (_a = err.message.match(/<\w+>/)) === null || _a === void 0 ? void 0 : _a[0];
|
|
39
|
+
log_1.Log.info([
|
|
40
|
+
'💡 This error indicates that the component',
|
|
41
|
+
componentName ? `(${componentName})` : null,
|
|
42
|
+
'you are trying to render is not imported correctly.',
|
|
43
|
+
]
|
|
44
|
+
.filter(truthy_1.truthy)
|
|
45
|
+
.join(' '));
|
|
46
|
+
log_1.Log.info();
|
|
47
|
+
log_1.Log.info(' Check the root file and ensure that the component is not undefined.');
|
|
48
|
+
log_1.Log.info(' Oftentimes, this happens if the component is missing the `export` keyword');
|
|
49
|
+
log_1.Log.info(' or if the component was renamed and the import statement not properly adjusted.');
|
|
50
|
+
}
|
|
51
|
+
if (err.message.includes('GLIBC_')) {
|
|
52
|
+
log_1.Log.info('💡 Remotion requires at least Libc 2.35.');
|
|
53
|
+
log_1.Log.info('💡 Get help for this issue: https://github.com/remotion-dev/remotion/issues/2439');
|
|
54
|
+
}
|
|
55
|
+
if (err.message.includes('EBADF')) {
|
|
56
|
+
log_1.Log.info('💡 This error might be fixed by changing your Node version:');
|
|
57
|
+
log_1.Log.info(' https://github.com/remotion-dev/remotion/issues/2452');
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
exports.handleCommonError = handleCommonError;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import type { IncomingMessage, ServerResponse } from 'node:http';
|
|
3
3
|
import type { LiveEventsServer } from './live-events';
|
|
4
|
-
export declare const handleRoutes: ({
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
export declare const handleRoutes: ({ staticHash, staticHashPrefix, outputHash, outputHashPrefix, request, response, liveEventsServer, getCurrentInputProps, getEnvVariables, remotionRoot, entryPoint, publicDir, }: {
|
|
5
|
+
staticHash: string;
|
|
6
|
+
staticHashPrefix: string;
|
|
7
|
+
outputHash: string;
|
|
8
|
+
outputHashPrefix: string;
|
|
7
9
|
request: IncomingMessage;
|
|
8
10
|
response: ServerResponse;
|
|
9
11
|
liveEventsServer: LiveEventsServer;
|
|
@@ -1,13 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
4
24
|
};
|
|
5
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
26
|
exports.handleRoutes = void 0;
|
|
7
27
|
const bundler_1 = require("@remotion/bundler");
|
|
8
28
|
const renderer_1 = require("@remotion/renderer");
|
|
9
29
|
const node_fs_1 = require("node:fs");
|
|
10
|
-
const node_path_1 =
|
|
30
|
+
const node_path_1 = __importStar(require("node:path"));
|
|
11
31
|
const node_url_1 = require("node:url");
|
|
12
32
|
const config_1 = require("../config");
|
|
13
33
|
const number_of_shared_audio_tags_1 = require("../config/number-of-shared-audio-tags");
|
|
@@ -27,6 +47,10 @@ const static404 = (response) => {
|
|
|
27
47
|
response.writeHead(404);
|
|
28
48
|
response.end('The static/ prefix has been changed, this URL is no longer valid.');
|
|
29
49
|
};
|
|
50
|
+
const output404 = (response) => {
|
|
51
|
+
response.writeHead(404);
|
|
52
|
+
response.end('The outputs/ prefix has been changed, this URL is no longer valid.');
|
|
53
|
+
};
|
|
30
54
|
const handleFallback = async ({ remotionRoot, hash, response, getCurrentInputProps, getEnvVariables, publicDir, }) => {
|
|
31
55
|
var _a, _b, _c;
|
|
32
56
|
const [edit] = await editorGuess;
|
|
@@ -176,7 +200,7 @@ const handleFavicon = (_, response) => {
|
|
|
176
200
|
const readStream = (0, node_fs_1.createReadStream)(filePath);
|
|
177
201
|
readStream.pipe(response);
|
|
178
202
|
};
|
|
179
|
-
const handleRoutes = ({
|
|
203
|
+
const handleRoutes = ({ staticHash, staticHashPrefix, outputHash, outputHashPrefix, request, response, liveEventsServer, getCurrentInputProps, getEnvVariables, remotionRoot, entryPoint, publicDir, }) => {
|
|
180
204
|
const url = new URL(request.url, 'http://localhost');
|
|
181
205
|
if (url.pathname === '/api/project-info') {
|
|
182
206
|
return handleProjectInfo(remotionRoot, request, response);
|
|
@@ -209,15 +233,35 @@ const handleRoutes = ({ hash, hashPrefix, request, response, liveEventsServer, g
|
|
|
209
233
|
if (url.pathname === '/events') {
|
|
210
234
|
return liveEventsServer.router(request, response);
|
|
211
235
|
}
|
|
212
|
-
if (url.pathname.startsWith(
|
|
213
|
-
|
|
236
|
+
if (url.pathname.startsWith(staticHash)) {
|
|
237
|
+
const filename = new URL(request.url, 'http://localhost').pathname.replace(new RegExp(`^${staticHash}`), '');
|
|
238
|
+
const filePath = (0, node_path_1.join)(publicDir, decodeURIComponent(filename));
|
|
239
|
+
return (0, serve_static_1.serveStatic)({
|
|
240
|
+
root: publicDir,
|
|
241
|
+
path: filePath,
|
|
242
|
+
req: request,
|
|
243
|
+
res: response,
|
|
244
|
+
});
|
|
214
245
|
}
|
|
215
|
-
if (url.pathname.startsWith(
|
|
246
|
+
if (url.pathname.startsWith(staticHashPrefix)) {
|
|
216
247
|
return static404(response);
|
|
217
248
|
}
|
|
249
|
+
if (url.pathname.startsWith(outputHash)) {
|
|
250
|
+
const filename = new URL(request.url, 'http://localhost').pathname.replace(new RegExp(`^${outputHash}`), '');
|
|
251
|
+
const filePath = (0, node_path_1.join)(remotionRoot, decodeURIComponent(filename));
|
|
252
|
+
return (0, serve_static_1.serveStatic)({
|
|
253
|
+
root: remotionRoot,
|
|
254
|
+
path: filePath,
|
|
255
|
+
req: request,
|
|
256
|
+
res: response,
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
if (url.pathname.startsWith(outputHashPrefix)) {
|
|
260
|
+
return output404(response);
|
|
261
|
+
}
|
|
218
262
|
return handleFallback({
|
|
219
263
|
remotionRoot,
|
|
220
|
-
hash,
|
|
264
|
+
hash: staticHash,
|
|
221
265
|
response,
|
|
222
266
|
getCurrentInputProps,
|
|
223
267
|
getEnvVariables,
|