@remotion/cli 4.0.43 → 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/config/index.d.ts +1 -1
- package/dist/config/log.d.ts +1 -1
- 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/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/LoopToggle.js +3 -1
- package/dist/editor/components/MuteToggle.js +3 -1
- package/dist/editor/components/NewComposition/RemInput.d.ts +2 -2
- package/dist/editor/components/NewComposition/RemInputTypeColor.d.ts +1 -1
- package/dist/editor/components/NewComposition/RemTextarea.d.ts +1 -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/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/ZoomPersistor.d.ts +2 -0
- package/dist/editor/components/ZoomPersistor.js +29 -7
- package/dist/editor/helpers/checkerboard-background.d.ts +1 -1
- package/dist/editor/helpers/colors.d.ts +1 -1
- 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/get-cli-options.d.ts +2 -2
- package/dist/index.d.ts +10 -10
- package/dist/log.d.ts +4 -4
- package/package.json +8 -8
- package/dist/config/presets-profile.d.ts +0 -3
- package/dist/config/presets-profile.js +0 -12
- package/dist/handle-common-errors.d.ts +0 -2
- package/dist/handle-common-errors.js +0 -60
|
@@ -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;
|
|
@@ -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 }) })] }));
|
|
@@ -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;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare const getCheckerboardBackgroundSize: (size: number) => string;
|
|
2
2
|
export declare const getCheckerboardBackgroundPos: (size: number) => string;
|
|
3
|
-
export declare const checkerboardBackgroundColor: (checkerboard: boolean) => "
|
|
3
|
+
export declare const checkerboardBackgroundColor: (checkerboard: boolean) => "black" | "white";
|
|
4
4
|
export declare const checkerboardBackgroundImage: (checkerboard: boolean) => "\n linear-gradient(\n 45deg,\n rgba(0, 0, 0, 0.1) 25%,\n transparent 25%\n ),\n linear-gradient(135deg, rgba(0, 0, 0, 0.1) 25%, transparent 25%),\n linear-gradient(45deg, transparent 75%, rgba(0, 0, 0, 0.1) 75%),\n linear-gradient(135deg, transparent 75%, rgba(0, 0, 0, 0.1) 75%)\n " | undefined;
|
|
@@ -16,4 +16,4 @@ export declare const BLUE_DISABLED = "#284f73";
|
|
|
16
16
|
export declare const getBackgroundFromHoverState: ({ selected, hovered, }: {
|
|
17
17
|
selected: boolean;
|
|
18
18
|
hovered: boolean;
|
|
19
|
-
}) => "transparent" | "
|
|
19
|
+
}) => "transparent" | "hsla(0, 0%, 100%, 0.15)" | "hsla(0, 0%, 100%, 0.25)" | "rgba(255, 255, 255, 0.06)";
|
|
@@ -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
|
]
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
const react_1 = require("react");
|
|
3
|
+
exports.useIsStill = void 0;
|
|
5
4
|
const remotion_1 = require("remotion");
|
|
6
5
|
const is_composition_still_1 = require("./is-composition-still");
|
|
7
6
|
const useIsStill = () => {
|
|
@@ -12,16 +11,3 @@ const useIsStill = () => {
|
|
|
12
11
|
return (0, is_composition_still_1.isCompositionStill)(resolved.result);
|
|
13
12
|
};
|
|
14
13
|
exports.useIsStill = useIsStill;
|
|
15
|
-
const useDimensions = () => {
|
|
16
|
-
const config = remotion_1.Internals.useUnsafeVideoConfig();
|
|
17
|
-
return (0, react_1.useMemo)(() => {
|
|
18
|
-
if (!config) {
|
|
19
|
-
return null;
|
|
20
|
-
}
|
|
21
|
-
return {
|
|
22
|
-
width: config.width,
|
|
23
|
-
height: config.height,
|
|
24
|
-
};
|
|
25
|
-
}, [config]);
|
|
26
|
-
};
|
|
27
|
-
exports.useDimensions = useDimensions;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export declare const openFolderKey: (folderName: string, parentName: string | null) => string;
|
|
2
2
|
export type ExpandedFoldersState = Record<string, boolean>;
|
|
3
|
-
|
|
4
|
-
export declare const
|
|
3
|
+
type PersistanceType = 'assets' | 'compositions';
|
|
4
|
+
export declare const persistExpandedFolders: (type: PersistanceType, state: ExpandedFoldersState) => void;
|
|
5
|
+
export declare const loadExpandedFolders: (type: PersistanceType) => ExpandedFoldersState;
|
|
6
|
+
export {};
|
|
@@ -5,13 +5,15 @@ const openFolderKey = (folderName, parentName) => {
|
|
|
5
5
|
return [parentName !== null && parentName !== void 0 ? parentName : 'no-parent', folderName].join('/');
|
|
6
6
|
};
|
|
7
7
|
exports.openFolderKey = openFolderKey;
|
|
8
|
-
const localStorageKey = '
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
const localStorageKey = (type) => type === 'compositions'
|
|
9
|
+
? 'remotion.expandedFolders'
|
|
10
|
+
: 'remotion.expandedAssetFolders';
|
|
11
|
+
const persistExpandedFolders = (type, state) => {
|
|
12
|
+
window.localStorage.setItem(localStorageKey(type), JSON.stringify(state));
|
|
11
13
|
};
|
|
12
14
|
exports.persistExpandedFolders = persistExpandedFolders;
|
|
13
|
-
const loadExpandedFolders = () => {
|
|
14
|
-
const item = window.localStorage.getItem(localStorageKey);
|
|
15
|
+
const loadExpandedFolders = (type) => {
|
|
16
|
+
const item = window.localStorage.getItem(localStorageKey(type));
|
|
15
17
|
if (item === null) {
|
|
16
18
|
return {};
|
|
17
19
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ExpandedFoldersState } from '../helpers/persist-open-folders';
|
|
3
3
|
type TFolderContext = {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
compositionFoldersExpanded: ExpandedFoldersState;
|
|
5
|
+
setCompositionFoldersExpanded: React.Dispatch<React.SetStateAction<ExpandedFoldersState>>;
|
|
6
|
+
assetFoldersExpanded: ExpandedFoldersState;
|
|
7
|
+
setAssetFoldersExpanded: React.Dispatch<React.SetStateAction<ExpandedFoldersState>>;
|
|
6
8
|
};
|
|
7
9
|
export declare const FolderContext: React.Context<TFolderContext>;
|
|
8
10
|
export declare const FolderContextProvider: React.FC<{
|
|
@@ -5,19 +5,26 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const persist_open_folders_1 = require("../helpers/persist-open-folders");
|
|
7
7
|
exports.FolderContext = (0, react_1.createContext)({
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
compositionFoldersExpanded: {},
|
|
9
|
+
setCompositionFoldersExpanded: () => {
|
|
10
|
+
throw new Error('default state');
|
|
11
|
+
},
|
|
12
|
+
assetFoldersExpanded: {},
|
|
13
|
+
setAssetFoldersExpanded: () => {
|
|
10
14
|
throw new Error('default state');
|
|
11
15
|
},
|
|
12
16
|
});
|
|
13
17
|
const FolderContextProvider = ({ children }) => {
|
|
14
|
-
const [
|
|
18
|
+
const [compositionFoldersExpanded, setCompositionFoldersExpanded] = (0, react_1.useState)(() => (0, persist_open_folders_1.loadExpandedFolders)('compositions'));
|
|
19
|
+
const [assetFoldersExpanded, setAssetFoldersExpanded] = (0, react_1.useState)(() => (0, persist_open_folders_1.loadExpandedFolders)('assets'));
|
|
15
20
|
const value = (0, react_1.useMemo)(() => {
|
|
16
21
|
return {
|
|
17
|
-
|
|
18
|
-
|
|
22
|
+
compositionFoldersExpanded,
|
|
23
|
+
setCompositionFoldersExpanded,
|
|
24
|
+
assetFoldersExpanded,
|
|
25
|
+
setAssetFoldersExpanded,
|
|
19
26
|
};
|
|
20
|
-
}, [
|
|
27
|
+
}, [assetFoldersExpanded, compositionFoldersExpanded]);
|
|
21
28
|
return ((0, jsx_runtime_1.jsx)(exports.FolderContext.Provider, { value: value, children: children }));
|
|
22
29
|
};
|
|
23
30
|
exports.FolderContextProvider = FolderContextProvider;
|
|
@@ -15,13 +15,13 @@ export declare const getCliOptions: (options: {
|
|
|
15
15
|
browser: "chrome";
|
|
16
16
|
crf: import("@remotion/renderer").Crf | null;
|
|
17
17
|
pixelFormat: "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le";
|
|
18
|
-
proResProfile: "
|
|
18
|
+
proResProfile: "4444-xq" | "4444" | "hq" | "standard" | "light" | "proxy" | undefined;
|
|
19
19
|
x264Preset: "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "slow" | "slower" | "veryslow" | "placebo" | undefined;
|
|
20
20
|
everyNthFrame: number;
|
|
21
21
|
numberOfGifLoops: import("./config/number-of-gif-loops").Loop;
|
|
22
22
|
stillFrame: number;
|
|
23
23
|
browserExecutable: BrowserExecutable;
|
|
24
|
-
logLevel: "
|
|
24
|
+
logLevel: "verbose" | "info" | "warn" | "error";
|
|
25
25
|
scale: number;
|
|
26
26
|
chromiumOptions: ChromiumOptions;
|
|
27
27
|
overwrite: boolean;
|