@remotion/cli 4.0.42 → 4.0.44
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/editor/components/AssetSelector.js +19 -3
- package/dist/editor/components/AssetSelectorItem.d.ts +6 -4
- package/dist/editor/components/AssetSelectorItem.js +48 -23
- package/dist/editor/components/Canvas.d.ts +4 -1
- package/dist/editor/components/Canvas.js +72 -30
- package/dist/editor/components/CanvasOrLoading.js +9 -1
- package/dist/editor/components/CheckboardToggle.js +5 -0
- package/dist/editor/components/CompositionSelector.js +8 -6
- package/dist/editor/components/CompositionSelectorItem.d.ts +1 -1
- package/dist/editor/components/CopyButton.js +1 -1
- package/dist/editor/components/CurrentCompositionSideEffects.js +11 -4
- package/dist/editor/components/EditorContent.js +4 -1
- package/dist/editor/components/ExplorerPanel.js +0 -13
- package/dist/editor/components/FilePreview.d.ts +8 -0
- package/dist/editor/components/FilePreview.js +33 -0
- package/dist/editor/components/FramePersistor.d.ts +0 -1
- package/dist/editor/components/FramePersistor.js +1 -5
- package/dist/editor/components/InitialCompositionLoader.js +61 -18
- package/dist/editor/components/JSONViewer.d.ts +4 -0
- package/dist/editor/components/JSONViewer.js +26 -0
- package/dist/editor/components/KnownBugs.js +5 -1
- package/dist/editor/components/LoopToggle.js +3 -1
- package/dist/editor/components/Modals.js +1 -1
- package/dist/editor/components/MuteToggle.js +3 -1
- package/dist/editor/components/OptionsPanel.js +7 -7
- package/dist/editor/components/PlayPause.js +2 -1
- package/dist/editor/components/PlaybackRateSelector.js +3 -1
- package/dist/editor/components/Preview.d.ts +7 -0
- package/dist/editor/components/Preview.js +156 -30
- package/dist/editor/components/RenderPreview.d.ts +4 -0
- package/dist/editor/components/RenderPreview.js +30 -0
- package/dist/editor/components/RenderQueue/index.js +40 -2
- package/dist/editor/components/RendersTab.js +9 -1
- package/dist/editor/components/SizeSelector.js +15 -0
- package/dist/editor/components/StaticFilePreview.d.ts +4 -0
- package/dist/editor/components/StaticFilePreview.js +47 -0
- package/dist/editor/components/TextViewer.d.ts +4 -0
- package/dist/editor/components/TextViewer.js +26 -0
- package/dist/editor/components/Timeline/TimelineZoomControls.js +3 -1
- package/dist/editor/components/TimelineInOutToggle.js +2 -1
- package/dist/editor/components/UpdateCheck.d.ts +6 -0
- package/dist/editor/components/UpdateCheck.js +36 -5
- package/dist/editor/components/UpdateModal/UpdateModal.d.ts +2 -1
- package/dist/editor/components/UpdateModal/UpdateModal.js +27 -11
- package/dist/editor/components/ZoomPersistor.d.ts +2 -0
- package/dist/editor/components/ZoomPersistor.js +29 -7
- package/dist/editor/helpers/create-folder-tree.d.ts +4 -3
- package/dist/editor/helpers/create-folder-tree.js +6 -3
- package/dist/editor/helpers/document-title.d.ts +1 -1
- package/dist/editor/helpers/document-title.js +14 -8
- package/dist/editor/helpers/is-current-selected-still.d.ts +3 -3
- package/dist/editor/helpers/is-current-selected-still.js +1 -15
- package/dist/editor/helpers/persist-open-folders.d.ts +4 -2
- package/dist/editor/helpers/persist-open-folders.js +7 -5
- package/dist/editor/state/folders.d.ts +4 -2
- package/dist/editor/state/folders.js +13 -6
- package/dist/editor/state/modals.d.ts +2 -1
- package/dist/index.js +10 -1
- package/package.json +8 -8
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RenderPreview = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const client_id_1 = require("../helpers/client-id");
|
|
7
|
+
const colors_1 = require("../helpers/colors");
|
|
8
|
+
const FilePreview_1 = require("./FilePreview");
|
|
9
|
+
const Preview_1 = require("./Preview");
|
|
10
|
+
const msgStyle = {
|
|
11
|
+
fontSize: 13,
|
|
12
|
+
color: 'white',
|
|
13
|
+
fontFamily: 'sans-serif',
|
|
14
|
+
display: 'flex',
|
|
15
|
+
justifyContent: 'center',
|
|
16
|
+
};
|
|
17
|
+
const errMsgStyle = {
|
|
18
|
+
...msgStyle,
|
|
19
|
+
color: colors_1.LIGHT_TEXT,
|
|
20
|
+
};
|
|
21
|
+
const RenderPreview = ({ path }) => {
|
|
22
|
+
const fileType = (0, Preview_1.getPreviewFileType)(path);
|
|
23
|
+
const src = window.remotion_staticBase.replace('static', 'outputs') + path;
|
|
24
|
+
const connectionStatus = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx).type;
|
|
25
|
+
if (connectionStatus === 'disconnected') {
|
|
26
|
+
return (0, jsx_runtime_1.jsx)("div", { style: errMsgStyle, children: "Studio server disconnected" });
|
|
27
|
+
}
|
|
28
|
+
return ((0, jsx_runtime_1.jsx)(FilePreview_1.FilePreview, { currentAsset: path, fileSize: null, fileType: fileType, src: src }));
|
|
29
|
+
};
|
|
30
|
+
exports.RenderPreview = RenderPreview;
|
|
@@ -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.RenderQueue = 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 client_id_1 = require("../../helpers/client-id");
|
|
7
30
|
const colors_1 = require("../../helpers/colors");
|
|
8
31
|
const layout_1 = require("../layout");
|
|
@@ -36,14 +59,29 @@ const renderQueue = {
|
|
|
36
59
|
const RenderQueue = () => {
|
|
37
60
|
const connectionStatus = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx).type;
|
|
38
61
|
const { jobs } = (0, react_1.useContext)(context_1.RenderQueueContext);
|
|
62
|
+
const previousJobCount = react_1.default.useRef(jobs.length);
|
|
39
63
|
const jobCount = jobs.length;
|
|
64
|
+
const divRef = react_1.default.useRef(null);
|
|
65
|
+
(0, react_1.useEffect)(() => {
|
|
66
|
+
if (!divRef.current) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
// Scroll down to bottom of render queue if new jobs have been added
|
|
70
|
+
if (jobCount > previousJobCount.current) {
|
|
71
|
+
divRef.current.scrollTo({
|
|
72
|
+
top: divRef.current.scrollHeight,
|
|
73
|
+
behavior: 'smooth',
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
previousJobCount.current = jobCount;
|
|
77
|
+
}, [jobCount]);
|
|
40
78
|
if (connectionStatus === 'disconnected') {
|
|
41
79
|
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 })] }));
|
|
42
80
|
}
|
|
43
81
|
if (jobCount === 0) {
|
|
44
82
|
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 })] }));
|
|
45
83
|
}
|
|
46
|
-
return ((0, jsx_runtime_1.jsx)("div", { style: renderQueue, className: ['css-reset', is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME].join(' '), children: jobs.map((j, index) => {
|
|
84
|
+
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) => {
|
|
47
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));
|
|
48
86
|
}) }));
|
|
49
87
|
};
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.RendersTab = 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");
|
|
7
8
|
const layout_1 = require("./layout");
|
|
8
9
|
const context_1 = require("./RenderQueue/context");
|
|
@@ -26,8 +27,15 @@ const badge = {
|
|
|
26
27
|
};
|
|
27
28
|
const RendersTab = ({ selected, onClick }) => {
|
|
28
29
|
const { jobs } = (0, react_1.useContext)(context_1.RenderQueueContext);
|
|
30
|
+
const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
29
31
|
const failedJobs = jobs.filter((j) => j.status === 'failed').length;
|
|
30
32
|
const jobCount = jobs.length;
|
|
33
|
+
const isActuallySelected = (0, react_1.useMemo)(() => {
|
|
34
|
+
if (!canvasContent || canvasContent.type !== 'composition') {
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
return selected;
|
|
38
|
+
}, [canvasContent, selected]);
|
|
31
39
|
const badgeStyle = (0, react_1.useMemo)(() => {
|
|
32
40
|
return {
|
|
33
41
|
...badge,
|
|
@@ -38,6 +46,6 @@ const RendersTab = ({ selected, onClick }) => {
|
|
|
38
46
|
borderColor: colors_1.LIGHT_TEXT,
|
|
39
47
|
};
|
|
40
48
|
}, [failedJobs]);
|
|
41
|
-
return ((0, jsx_runtime_1.jsx)(Tabs_1.Tab, { selected:
|
|
49
|
+
return ((0, jsx_runtime_1.jsx)(Tabs_1.Tab, { selected: isActuallySelected, onClick: onClick, children: (0, jsx_runtime_1.jsxs)("div", { style: row, children: ["Renders", jobCount > 0 ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(layout_1.Flex, {}), (0, jsx_runtime_1.jsx)("div", { style: badgeStyle, children: jobCount })] })) : null] }) }));
|
|
42
50
|
};
|
|
43
51
|
exports.RendersTab = RendersTab;
|
|
@@ -3,10 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.SizeSelector = exports.getUniqueSizes = exports.getPreviewSizeLabel = 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 Checkmark_1 = require("../icons/Checkmark");
|
|
7
8
|
const preview_size_1 = require("../state/preview-size");
|
|
8
9
|
const ControlButton_1 = require("./ControlButton");
|
|
9
10
|
const ComboBox_1 = require("./NewComposition/ComboBox");
|
|
11
|
+
const Preview_1 = require("./Preview");
|
|
10
12
|
const commonPreviewSizes = [
|
|
11
13
|
{
|
|
12
14
|
size: 'auto',
|
|
@@ -66,12 +68,22 @@ const getUniqueSizes = (size) => {
|
|
|
66
68
|
};
|
|
67
69
|
exports.getUniqueSizes = getUniqueSizes;
|
|
68
70
|
const SizeSelector = () => {
|
|
71
|
+
const zoomableFileTypes = ['video', 'image'];
|
|
69
72
|
const { size, setSize } = (0, react_1.useContext)(preview_size_1.PreviewSizeContext);
|
|
73
|
+
const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
70
74
|
const style = (0, react_1.useMemo)(() => {
|
|
71
75
|
return {
|
|
72
76
|
padding: ControlButton_1.CONTROL_BUTTON_PADDING,
|
|
73
77
|
};
|
|
74
78
|
}, []);
|
|
79
|
+
const zoomable = (0, react_1.useMemo)(() => {
|
|
80
|
+
if ((canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) === 'asset') {
|
|
81
|
+
if (zoomableFileTypes.includes((0, Preview_1.getPreviewFileType)(canvasContent.asset))) {
|
|
82
|
+
return true;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return false;
|
|
86
|
+
}, [canvasContent, zoomableFileTypes]);
|
|
75
87
|
const items = (0, react_1.useMemo)(() => {
|
|
76
88
|
return (0, exports.getUniqueSizes)(size).map((newSize) => {
|
|
77
89
|
return {
|
|
@@ -91,6 +103,9 @@ const SizeSelector = () => {
|
|
|
91
103
|
};
|
|
92
104
|
});
|
|
93
105
|
}, [setSize, size]);
|
|
106
|
+
if (!zoomable) {
|
|
107
|
+
return null;
|
|
108
|
+
}
|
|
94
109
|
return ((0, jsx_runtime_1.jsx)("div", { style: style, "aria-label": accessibilityLabel, children: (0, jsx_runtime_1.jsx)(ComboBox_1.Combobox, { title: accessibilityLabel, style: comboStyle, selectedId: String(size.size), values: items }) }));
|
|
95
110
|
};
|
|
96
111
|
exports.SizeSelector = SizeSelector;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StaticFilePreview = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const remotion_1 = require("remotion");
|
|
7
|
+
const format_bytes_1 = require("../../format-bytes");
|
|
8
|
+
const client_id_1 = require("../helpers/client-id");
|
|
9
|
+
const colors_1 = require("../helpers/colors");
|
|
10
|
+
const FilePreview_1 = require("./FilePreview");
|
|
11
|
+
const Preview_1 = require("./Preview");
|
|
12
|
+
const msgStyle = {
|
|
13
|
+
fontSize: 13,
|
|
14
|
+
color: 'white',
|
|
15
|
+
fontFamily: 'sans-serif',
|
|
16
|
+
display: 'flex',
|
|
17
|
+
justifyContent: 'center',
|
|
18
|
+
};
|
|
19
|
+
const errMsgStyle = {
|
|
20
|
+
...msgStyle,
|
|
21
|
+
color: colors_1.LIGHT_TEXT,
|
|
22
|
+
};
|
|
23
|
+
const StaticFilePreview = ({ currentAsset, }) => {
|
|
24
|
+
const fileType = (0, Preview_1.getPreviewFileType)(currentAsset);
|
|
25
|
+
const staticFileSrc = (0, remotion_1.staticFile)(currentAsset);
|
|
26
|
+
const staticFiles = (0, remotion_1.getStaticFiles)();
|
|
27
|
+
const connectionStatus = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx).type;
|
|
28
|
+
const exists = staticFiles.find((file) => file.name === currentAsset);
|
|
29
|
+
if (connectionStatus === 'disconnected') {
|
|
30
|
+
return (0, jsx_runtime_1.jsx)("div", { style: errMsgStyle, children: "Studio server disconnected" });
|
|
31
|
+
}
|
|
32
|
+
if (!exists) {
|
|
33
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: errMsgStyle, children: [currentAsset, " does not exist in your public folder."] }));
|
|
34
|
+
}
|
|
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
|
+
if (!currentAsset) {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
return ((0, jsx_runtime_1.jsx)(FilePreview_1.FilePreview, { currentAsset: currentAsset, fileSize: fileSize, fileType: fileType, src: staticFileSrc }));
|
|
46
|
+
};
|
|
47
|
+
exports.StaticFilePreview = StaticFilePreview;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TextViewer = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const textStyle = {
|
|
7
|
+
margin: 14,
|
|
8
|
+
fontFamily: 'monospace',
|
|
9
|
+
flex: 1,
|
|
10
|
+
color: 'white',
|
|
11
|
+
whiteSpace: 'pre-wrap',
|
|
12
|
+
};
|
|
13
|
+
const TextViewer = ({ src }) => {
|
|
14
|
+
const [txt, setTxt] = (0, react_1.useState)('');
|
|
15
|
+
(0, react_1.useEffect)(() => {
|
|
16
|
+
fetch(src).then(async (res) => {
|
|
17
|
+
if (!res.ok || !res.body) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
const text = await res.text();
|
|
21
|
+
setTxt(text);
|
|
22
|
+
});
|
|
23
|
+
}, [src]);
|
|
24
|
+
return (0, jsx_runtime_1.jsxs)("div", { style: textStyle, children: [txt, " "] });
|
|
25
|
+
};
|
|
26
|
+
exports.TextViewer = TextViewer;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.TimelineZoomControls = 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 is_current_selected_still_1 = require("../../helpers/is-current-selected-still");
|
|
7
8
|
const minus_1 = require("../../icons/minus");
|
|
8
9
|
const plus_1 = require("../../icons/plus");
|
|
@@ -24,6 +25,7 @@ const iconStyle = {
|
|
|
24
25
|
width: 14,
|
|
25
26
|
};
|
|
26
27
|
const TimelineZoomControls = () => {
|
|
28
|
+
const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
27
29
|
const { setZoom, zoom } = (0, react_1.useContext)(timeline_zoom_1.TimelineZoomCtx);
|
|
28
30
|
const { tabIndex } = (0, z_index_1.useZIndex)();
|
|
29
31
|
const onMinusClicked = (0, react_1.useCallback)(() => {
|
|
@@ -36,7 +38,7 @@ const TimelineZoomControls = () => {
|
|
|
36
38
|
setZoom(() => Number(e.target.value));
|
|
37
39
|
}, [setZoom]);
|
|
38
40
|
const isStill = (0, is_current_selected_still_1.useIsStill)();
|
|
39
|
-
if (isStill) {
|
|
41
|
+
if (isStill || canvasContent === null || canvasContent.type === 'asset') {
|
|
40
42
|
return null;
|
|
41
43
|
}
|
|
42
44
|
return ((0, jsx_runtime_1.jsxs)("div", { style: container, children: [(0, jsx_runtime_1.jsx)(ControlButton_1.ControlButton, { onClick: onMinusClicked, style: buttonStyle, title: "Zoom out timeline", role: 'ControlButton', type: "button", disabled: timeline_zoom_1.TIMELINE_MIN_ZOOM === zoom, children: (0, jsx_runtime_1.jsx)(minus_1.Minus, { style: iconStyle }) }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.5 }), (0, jsx_runtime_1.jsx)("input", { title: `Timeline zoom (${zoom}x)`, alt: `Timeline zoom (${zoom}x)`, type: 'range', min: timeline_zoom_1.TIMELINE_MIN_ZOOM, step: 0.1, value: zoom, max: timeline_zoom_1.TIMELINE_MAX_ZOOM, onChange: onChange, className: "__remotion-timeline-slider", tabIndex: tabIndex }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.5 }), (0, jsx_runtime_1.jsx)(ControlButton_1.ControlButton, { onClick: onPlusClicked, style: buttonStyle, title: "Zoom in timeline", role: 'button', type: "button", disabled: timeline_zoom_1.TIMELINE_MAX_ZOOM === zoom, children: (0, jsx_runtime_1.jsx)(plus_1.Plus, { color: "currentcolor", style: iconStyle }) })] }));
|
|
@@ -27,6 +27,7 @@ exports.defaultInOutValue = { inFrame: null, outFrame: null };
|
|
|
27
27
|
const TimelineInOutPointToggle = () => {
|
|
28
28
|
const timelinePosition = remotion_1.Internals.Timeline.useTimelinePosition();
|
|
29
29
|
const { inFrame, outFrame } = (0, in_out_1.useTimelineInOutFramePosition)();
|
|
30
|
+
const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
30
31
|
const { setInAndOutFrames } = (0, in_out_1.useTimelineSetInOutFramePosition)();
|
|
31
32
|
const isStill = (0, is_current_selected_still_1.useIsStill)();
|
|
32
33
|
const videoConfig = remotion_1.Internals.useUnsafeVideoConfig();
|
|
@@ -234,7 +235,7 @@ const TimelineInOutPointToggle = () => {
|
|
|
234
235
|
outMarkClick: onOutMark,
|
|
235
236
|
};
|
|
236
237
|
}, [confId, onInMark, onInOutClear, onOutMark]);
|
|
237
|
-
if (isStill) {
|
|
238
|
+
if (isStill || canvasContent === null || canvasContent.type === 'asset') {
|
|
238
239
|
return null;
|
|
239
240
|
}
|
|
240
241
|
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 }) })] }));
|
|
@@ -7,4 +7,10 @@ export type UpdateInfo = {
|
|
|
7
7
|
timedOut: boolean;
|
|
8
8
|
packageManager: PackageManager | 'unknown';
|
|
9
9
|
};
|
|
10
|
+
export type Bug = {
|
|
11
|
+
title: string;
|
|
12
|
+
description: string;
|
|
13
|
+
link: string;
|
|
14
|
+
versions: string[];
|
|
15
|
+
};
|
|
10
16
|
export declare const UpdateCheck: () => JSX.Element | null;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.UpdateCheck = 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");
|
|
7
8
|
const modals_1 = require("../state/modals");
|
|
8
9
|
const z_index_1 = require("../state/z-index");
|
|
@@ -20,6 +21,10 @@ const UpdateCheck = () => {
|
|
|
20
21
|
const [info, setInfo] = (0, react_1.useState)(null);
|
|
21
22
|
const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
22
23
|
const { tabIndex } = (0, z_index_1.useZIndex)();
|
|
24
|
+
const [knownBugs, setKnownBugs] = (0, react_1.useState)(null);
|
|
25
|
+
const hasKnownBugs = (0, react_1.useMemo)(() => {
|
|
26
|
+
return knownBugs && knownBugs.length > 0;
|
|
27
|
+
}, [knownBugs]);
|
|
23
28
|
const checkForUpdates = (0, react_1.useCallback)(() => {
|
|
24
29
|
const controller = new AbortController();
|
|
25
30
|
(0, actions_1.updateAvailable)(controller.signal)
|
|
@@ -34,24 +39,50 @@ const UpdateCheck = () => {
|
|
|
34
39
|
});
|
|
35
40
|
return controller;
|
|
36
41
|
}, []);
|
|
42
|
+
const checkForBugs = (0, react_1.useCallback)(() => {
|
|
43
|
+
const controller = new AbortController();
|
|
44
|
+
fetch(`https://bugs.remotion.dev/api/${remotion_1.VERSION}`, {
|
|
45
|
+
signal: controller.signal,
|
|
46
|
+
})
|
|
47
|
+
.then(async (res) => {
|
|
48
|
+
const body = await res.json();
|
|
49
|
+
setKnownBugs(body.bugs);
|
|
50
|
+
})
|
|
51
|
+
.catch((err) => {
|
|
52
|
+
if (err.message.includes('aborted')) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
console.log('Could not check for bugs in this version', err);
|
|
56
|
+
});
|
|
57
|
+
return controller;
|
|
58
|
+
}, []);
|
|
37
59
|
(0, react_1.useEffect)(() => {
|
|
38
|
-
const
|
|
60
|
+
const abortUpdate = checkForUpdates();
|
|
61
|
+
const abortBugs = checkForBugs();
|
|
39
62
|
return () => {
|
|
40
|
-
|
|
63
|
+
abortUpdate.abort();
|
|
64
|
+
abortBugs.abort();
|
|
41
65
|
};
|
|
42
|
-
}, [checkForUpdates]);
|
|
66
|
+
}, [checkForBugs, checkForUpdates]);
|
|
43
67
|
const openModal = (0, react_1.useCallback)(() => {
|
|
44
68
|
setSelectedModal({
|
|
45
69
|
type: 'update',
|
|
46
70
|
info: info,
|
|
71
|
+
knownBugs: knownBugs,
|
|
47
72
|
});
|
|
48
|
-
}, [info, setSelectedModal]);
|
|
73
|
+
}, [info, knownBugs, setSelectedModal]);
|
|
74
|
+
const dynButtonStyle = (0, react_1.useMemo)(() => {
|
|
75
|
+
return {
|
|
76
|
+
...buttonStyle,
|
|
77
|
+
color: hasKnownBugs ? colors_1.WARNING_COLOR : colors_1.BLUE,
|
|
78
|
+
};
|
|
79
|
+
}, [hasKnownBugs]);
|
|
49
80
|
if (!info) {
|
|
50
81
|
return null;
|
|
51
82
|
}
|
|
52
83
|
if (!info.updateAvailable) {
|
|
53
84
|
return null;
|
|
54
85
|
}
|
|
55
|
-
return ((0, jsx_runtime_1.jsx)("button", { tabIndex: tabIndex, style:
|
|
86
|
+
return ((0, jsx_runtime_1.jsx)("button", { tabIndex: tabIndex, style: dynButtonStyle, onClick: openModal, type: "button", children: hasKnownBugs ? 'Bugfixes available' : 'Update available' }));
|
|
56
87
|
};
|
|
57
88
|
exports.UpdateCheck = UpdateCheck;
|
|
@@ -7,6 +7,7 @@ const colors_1 = require("../../helpers/colors");
|
|
|
7
7
|
const copy_text_1 = require("../../helpers/copy-text");
|
|
8
8
|
const modals_1 = require("../../state/modals");
|
|
9
9
|
const CopyButton_1 = require("../CopyButton");
|
|
10
|
+
const KnownBugs_1 = require("../KnownBugs");
|
|
10
11
|
const layout_1 = require("../layout");
|
|
11
12
|
const ModalContainer_1 = require("../ModalContainer");
|
|
12
13
|
const ModalHeader_1 = require("../ModalHeader");
|
|
@@ -15,33 +16,48 @@ const container = {
|
|
|
15
16
|
padding: 20,
|
|
16
17
|
paddingTop: 0,
|
|
17
18
|
};
|
|
19
|
+
const text = {
|
|
20
|
+
fontSize: 14,
|
|
21
|
+
};
|
|
22
|
+
const title = {
|
|
23
|
+
paddingTop: 12,
|
|
24
|
+
paddingBottom: 8,
|
|
25
|
+
...text,
|
|
26
|
+
};
|
|
18
27
|
const code = {
|
|
19
28
|
background: colors_1.SELECTED_BACKGROUND,
|
|
20
29
|
padding: '12px 10px',
|
|
21
|
-
fontSize:
|
|
30
|
+
fontSize: 14,
|
|
22
31
|
marginTop: 10,
|
|
23
32
|
marginBottom: 10,
|
|
24
33
|
};
|
|
25
34
|
const link = {
|
|
26
35
|
fontWeight: 'bold',
|
|
27
|
-
color:
|
|
36
|
+
color: colors_1.BLUE,
|
|
28
37
|
textDecoration: 'none',
|
|
38
|
+
...text,
|
|
29
39
|
};
|
|
30
40
|
const commands = {
|
|
31
|
-
npm: '
|
|
32
|
-
yarn: 'yarn upgrade',
|
|
33
|
-
pnpm: 'pnpm
|
|
34
|
-
bun: 'bun
|
|
35
|
-
unknown: '
|
|
41
|
+
npm: 'npx remotion upgrade',
|
|
42
|
+
yarn: 'yarn remotion upgrade',
|
|
43
|
+
pnpm: 'pnpm exec remotion upgrade',
|
|
44
|
+
bun: 'bun remotion upgrade',
|
|
45
|
+
unknown: 'npx remotion upgrade',
|
|
36
46
|
};
|
|
37
|
-
const UpdateModal = ({ info }) => {
|
|
47
|
+
const UpdateModal = ({ info, knownBugs }) => {
|
|
38
48
|
const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
39
49
|
const onQuit = (0, react_1.useCallback)(() => {
|
|
40
50
|
setSelectedModal(null);
|
|
41
51
|
}, [setSelectedModal]);
|
|
52
|
+
const hasKnownBugs = (0, react_1.useMemo)(() => {
|
|
53
|
+
return knownBugs && (knownBugs === null || knownBugs === void 0 ? void 0 : knownBugs.length) > 0;
|
|
54
|
+
}, [knownBugs]);
|
|
42
55
|
const command = commands[info.packageManager];
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
56
|
+
const onClick = (0, react_1.useCallback)(() => {
|
|
57
|
+
(0, copy_text_1.copyText)(command).catch((err) => {
|
|
58
|
+
(0, NotificationCenter_1.sendErrorNotification)(`Could not copy: ${err.message}`);
|
|
59
|
+
});
|
|
60
|
+
}, [command]);
|
|
61
|
+
return ((0, jsx_runtime_1.jsxs)(ModalContainer_1.ModalContainer, { onOutsideClick: onQuit, onEscape: onQuit, children: [(0, jsx_runtime_1.jsx)(ModalHeader_1.NewCompHeader, { title: "Update available" }), (0, jsx_runtime_1.jsxs)("div", { style: container, children: [hasKnownBugs ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { style: title, children: ["The currently installed version ", info.currentVersion, " has the following known bugs:"] }), (0, jsx_runtime_1.jsx)(KnownBugs_1.KnownBugs, { bugs: knownBugs }), (0, jsx_runtime_1.jsx)("div", { style: { height: '20px' } }), (0, jsx_runtime_1.jsx)("div", { style: text, children: "To upgrade, run the following command:" })] })) : ((0, jsx_runtime_1.jsx)("div", { style: text, children: "A new update for Remotion is available! Run the following command:" })), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)(layout_1.Flex, { children: (0, jsx_runtime_1.jsx)("pre", { onClick: onClick, style: code, children: command }) }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1 }), (0, jsx_runtime_1.jsx)(CopyButton_1.CopyButton, { textToCopy: command, label: "Copy", labelWhenCopied: "Copied!" })] }), (0, jsx_runtime_1.jsxs)("div", { style: text, children: ["This will upgrade Remotion from ", info.currentVersion, " to", ' ', info.latestVersion, "."] }), (0, jsx_runtime_1.jsxs)("div", { style: text, children: ["Read the", ' ', (0, jsx_runtime_1.jsx)("a", { style: link, target: "_blank", href: "https://github.com/remotion-dev/remotion/releases", children: "Release notes" }), ' ', "to know what", "'s", " new in Remotion."] })] })] }));
|
|
46
62
|
};
|
|
47
63
|
exports.UpdateModal = UpdateModal;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
+
import type { CanvasContent } from 'remotion';
|
|
2
3
|
export declare const getZoomForComposition: (composition: string) => number;
|
|
4
|
+
export declare const deriveCanvasContentFromUrl: () => CanvasContent | null;
|
|
3
5
|
export declare const ZoomPersistor: React.FC;
|
|
@@ -1,30 +1,52 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ZoomPersistor = exports.getZoomForComposition = void 0;
|
|
3
|
+
exports.ZoomPersistor = exports.deriveCanvasContentFromUrl = exports.getZoomForComposition = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const remotion_1 = require("remotion");
|
|
6
6
|
const timeline_zoom_1 = require("../state/timeline-zoom");
|
|
7
|
-
const FramePersistor_1 = require("./FramePersistor");
|
|
8
7
|
const makeKey = (composition) => {
|
|
9
8
|
return `remotion.zoom.${composition}`;
|
|
10
9
|
};
|
|
11
10
|
const persistCurrentZoom = (zoom) => {
|
|
12
|
-
const currentComposition = (0,
|
|
13
|
-
if (!currentComposition) {
|
|
11
|
+
const currentComposition = (0, exports.deriveCanvasContentFromUrl)();
|
|
12
|
+
if (!currentComposition || currentComposition.type !== 'composition') {
|
|
14
13
|
return;
|
|
15
14
|
}
|
|
16
|
-
localStorage.setItem(makeKey(currentComposition), String(zoom));
|
|
15
|
+
localStorage.setItem(makeKey(currentComposition.compositionId), String(zoom));
|
|
17
16
|
};
|
|
18
17
|
const getZoomForComposition = (composition) => {
|
|
19
18
|
const zoom = localStorage.getItem(makeKey(composition));
|
|
20
19
|
return zoom ? Number(zoom) : 0;
|
|
21
20
|
};
|
|
22
21
|
exports.getZoomForComposition = getZoomForComposition;
|
|
22
|
+
const deriveCanvasContentFromUrl = () => {
|
|
23
|
+
const substrings = window.location.pathname.split('/');
|
|
24
|
+
const lastPart = substrings[substrings.length - 1];
|
|
25
|
+
if (substrings.includes('assets')) {
|
|
26
|
+
return {
|
|
27
|
+
type: 'asset',
|
|
28
|
+
asset: decodeURIComponent(window.location.pathname.substring(8)),
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
if (lastPart) {
|
|
32
|
+
return {
|
|
33
|
+
type: 'composition',
|
|
34
|
+
compositionId: lastPart,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
return null;
|
|
38
|
+
};
|
|
39
|
+
exports.deriveCanvasContentFromUrl = deriveCanvasContentFromUrl;
|
|
23
40
|
const ZoomPersistor = () => {
|
|
24
41
|
const [playing] = remotion_1.Internals.Timeline.usePlayingState();
|
|
25
42
|
const { zoom } = (0, react_1.useContext)(timeline_zoom_1.TimelineZoomCtx);
|
|
26
|
-
const {
|
|
27
|
-
const
|
|
43
|
+
const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
44
|
+
const urlState = (0, exports.deriveCanvasContentFromUrl)();
|
|
45
|
+
const isActive = urlState &&
|
|
46
|
+
urlState.type === 'composition' &&
|
|
47
|
+
canvasContent &&
|
|
48
|
+
canvasContent.type === 'composition' &&
|
|
49
|
+
urlState.compositionId === canvasContent.compositionId;
|
|
28
50
|
(0, react_1.useEffect)(() => {
|
|
29
51
|
if (!isActive) {
|
|
30
52
|
return;
|
|
@@ -2,13 +2,14 @@ import type { AnyComposition, StaticFile, TFolder } from 'remotion';
|
|
|
2
2
|
import type { CompositionSelectorItemType } from '../components/CompositionSelectorItem';
|
|
3
3
|
export type AssetFolder = {
|
|
4
4
|
name: string;
|
|
5
|
-
items:
|
|
5
|
+
items: AssetStructure;
|
|
6
|
+
expanded: boolean;
|
|
6
7
|
};
|
|
7
|
-
export type
|
|
8
|
+
export type AssetStructure = {
|
|
8
9
|
files: StaticFile[];
|
|
9
10
|
folders: AssetFolder[];
|
|
10
11
|
};
|
|
11
|
-
export declare const buildAssetFolderStructure: (files: StaticFile[]) =>
|
|
12
|
+
export declare const buildAssetFolderStructure: (files: StaticFile[], parentFolderName: string | null, foldersExpanded: Record<string, boolean>) => AssetStructure;
|
|
12
13
|
export declare const splitParentIntoNameAndParent: (name: string | null) => {
|
|
13
14
|
name: string | null;
|
|
14
15
|
parent: string | null;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createFolderTree = exports.splitParentIntoNameAndParent = exports.buildAssetFolderStructure = void 0;
|
|
4
4
|
const persist_open_folders_1 = require("./persist-open-folders");
|
|
5
|
-
const buildAssetFolderStructure = (files) => {
|
|
5
|
+
const buildAssetFolderStructure = (files, parentFolderName, foldersExpanded) => {
|
|
6
6
|
const notInFolder = files.filter((f) => !f.name.includes('/'));
|
|
7
7
|
const inFolder = files.filter((f) => f.name.includes('/'));
|
|
8
8
|
const groupedByFolder = {};
|
|
@@ -16,6 +16,7 @@ const buildAssetFolderStructure = (files) => {
|
|
|
16
16
|
return {
|
|
17
17
|
files: notInFolder,
|
|
18
18
|
folders: Object.keys(groupedByFolder).map((folderName) => {
|
|
19
|
+
var _a;
|
|
19
20
|
const filesInFolder = groupedByFolder[folderName];
|
|
20
21
|
const filesWithoutFolderName = filesInFolder.map((f) => {
|
|
21
22
|
return {
|
|
@@ -23,10 +24,12 @@ const buildAssetFolderStructure = (files) => {
|
|
|
23
24
|
name: f.name.substring(folderName.length + 1),
|
|
24
25
|
};
|
|
25
26
|
});
|
|
27
|
+
const key = [parentFolderName, folderName].filter(Boolean).join('/');
|
|
28
|
+
const isExpanded = (_a = foldersExpanded[key]) !== null && _a !== void 0 ? _a : false;
|
|
26
29
|
return {
|
|
27
30
|
name: folderName,
|
|
28
|
-
items: (0, exports.buildAssetFolderStructure)(filesWithoutFolderName),
|
|
29
|
-
expanded:
|
|
31
|
+
items: (0, exports.buildAssetFolderStructure)(filesWithoutFolderName, [parentFolderName, folderName].filter(Boolean).join('/'), foldersExpanded),
|
|
32
|
+
expanded: isExpanded,
|
|
30
33
|
};
|
|
31
34
|
}),
|
|
32
35
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { RenderJob } from '../../preview-server/render-queue/job';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const setCurrentCanvasContentId: (id: string | null) => void;
|
|
3
3
|
export declare const setUnsavedProps: (unsaved: boolean) => void;
|
|
4
4
|
export declare const setRenderJobs: (jobs: RenderJob[]) => void;
|
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setRenderJobs = exports.setUnsavedProps = exports.
|
|
3
|
+
exports.setRenderJobs = exports.setUnsavedProps = exports.setCurrentCanvasContentId = void 0;
|
|
4
4
|
const truthy_1 = require("../../truthy");
|
|
5
|
-
let
|
|
5
|
+
let currentItemName = null;
|
|
6
6
|
let unsavedProps = false;
|
|
7
7
|
let tabInactive = false;
|
|
8
8
|
let renderJobs = [];
|
|
9
|
-
const
|
|
10
|
-
|
|
9
|
+
const setCurrentCanvasContentId = (id) => {
|
|
10
|
+
if (!id) {
|
|
11
|
+
currentItemName = id;
|
|
12
|
+
updateTitle();
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
const idWithoutFolder = id.split('/').pop();
|
|
16
|
+
currentItemName = idWithoutFolder;
|
|
11
17
|
updateTitle();
|
|
12
18
|
};
|
|
13
|
-
exports.
|
|
19
|
+
exports.setCurrentCanvasContentId = setCurrentCanvasContentId;
|
|
14
20
|
const setUnsavedProps = (unsaved) => {
|
|
15
21
|
window.remotion_unsavedProps = unsaved;
|
|
16
22
|
unsavedProps = unsaved;
|
|
@@ -28,13 +34,13 @@ document.addEventListener('visibilitychange', () => {
|
|
|
28
34
|
const productName = 'Remotion Studio';
|
|
29
35
|
const suffix = `- ${productName}`;
|
|
30
36
|
const updateTitle = () => {
|
|
31
|
-
if (!
|
|
37
|
+
if (!currentItemName) {
|
|
32
38
|
document.title = productName;
|
|
33
39
|
return;
|
|
34
40
|
}
|
|
35
|
-
const currentCompTitle = `${
|
|
41
|
+
const currentCompTitle = `${currentItemName} / ${window.remotion_projectName}`;
|
|
36
42
|
document.title = [
|
|
37
|
-
getProgressInBrackets(
|
|
43
|
+
getProgressInBrackets(currentItemName, renderJobs),
|
|
38
44
|
unsavedProps && tabInactive ? '✏️' : null,
|
|
39
45
|
`${currentCompTitle} ${suffix}`,
|
|
40
46
|
]
|