@remotion/studio 4.0.454 → 4.0.456
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/components/CompSelectorRef.js +21 -23
- package/dist/components/CompositionSelector.d.ts +0 -1
- package/dist/components/CompositionSelector.js +1 -13
- package/dist/components/InitialCompositionLoader.js +4 -2
- package/dist/components/PlayPause.d.ts +1 -0
- package/dist/components/PlayPause.js +2 -1
- package/dist/components/PreviewToolbar.js +1 -1
- package/dist/components/Timeline/Timeline.js +1 -1
- package/dist/components/Timeline/TimelineExpandArrowButton.d.ts +8 -0
- package/dist/components/Timeline/TimelineExpandArrowButton.js +39 -0
- package/dist/components/Timeline/TimelineExpandedSection.d.ts +0 -2
- package/dist/components/Timeline/TimelineExpandedSection.js +65 -16
- package/dist/components/Timeline/TimelineFieldRow.d.ts +1 -1
- package/dist/components/Timeline/TimelineFieldRow.js +5 -9
- package/dist/components/Timeline/TimelineListItem.js +15 -31
- package/dist/components/Timeline/TimelineStack/index.js +2 -0
- package/dist/components/Timeline/TimelineTracks.js +4 -3
- package/dist/error-overlay/remotion-overlay/CopyStackTrace.d.ts +0 -1
- package/dist/error-overlay/remotion-overlay/CopyStackTrace.js +2 -20
- package/dist/error-overlay/remotion-overlay/ErrorDisplay.js +1 -1
- package/dist/error-overlay/remotion-overlay/StackFrame.js +22 -1
- package/dist/esm/{chunk-g39hwn0a.js → chunk-0y1jhm8s.js} +5147 -4987
- package/dist/esm/internals.mjs +5147 -4987
- package/dist/esm/previewEntry.mjs +5222 -5062
- package/dist/esm/renderEntry.mjs +1 -1
- package/dist/helpers/create-folder-tree.d.ts +5 -0
- package/dist/helpers/create-folder-tree.js +17 -1
- package/dist/helpers/timeline-layout.d.ts +29 -2
- package/dist/helpers/timeline-layout.js +87 -6
- package/package.json +9 -9
|
@@ -4,14 +4,16 @@ exports.CompSelectorRef = 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 create_folder_tree_1 = require("../helpers/create-folder-tree");
|
|
7
8
|
const persist_open_folders_1 = require("../helpers/persist-open-folders");
|
|
9
|
+
const folders_1 = require("../state/folders");
|
|
8
10
|
const InitialCompositionLoader_1 = require("./InitialCompositionLoader");
|
|
9
11
|
const CompSelectorRef = ({ children }) => {
|
|
10
12
|
const { compositions } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
11
|
-
const
|
|
13
|
+
const { compositionFoldersExpanded, setCompositionFoldersExpanded } = (0, react_1.useContext)(folders_1.FolderContext);
|
|
12
14
|
const selectComposition = (0, InitialCompositionLoader_1.useSelectComposition)();
|
|
13
15
|
const toggleFolder = (0, react_1.useCallback)((folderName, parentName) => {
|
|
14
|
-
|
|
16
|
+
setCompositionFoldersExpanded((p) => {
|
|
15
17
|
var _a;
|
|
16
18
|
const key = (0, persist_open_folders_1.openFolderKey)({ folderName, parentName });
|
|
17
19
|
const prev = (_a = p[key]) !== null && _a !== void 0 ? _a : false;
|
|
@@ -22,7 +24,7 @@ const CompSelectorRef = ({ children }) => {
|
|
|
22
24
|
(0, persist_open_folders_1.persistExpandedFolders)('compositions', foldersExpandedState);
|
|
23
25
|
return foldersExpandedState;
|
|
24
26
|
});
|
|
25
|
-
}, []);
|
|
27
|
+
}, [setCompositionFoldersExpanded]);
|
|
26
28
|
(0, react_1.useImperativeHandle)(remotion_1.Internals.compositionSelectorRef, () => {
|
|
27
29
|
return {
|
|
28
30
|
expandComposition: (compName) => {
|
|
@@ -34,25 +36,13 @@ const CompSelectorRef = ({ children }) => {
|
|
|
34
36
|
if (folderName === null) {
|
|
35
37
|
return;
|
|
36
38
|
}
|
|
37
|
-
|
|
39
|
+
setCompositionFoldersExpanded((previousState) => {
|
|
40
|
+
const keysToExpand = (0, create_folder_tree_1.getKeysToExpand)(folderName, parentFolderName);
|
|
38
41
|
const foldersExpandedState = {
|
|
39
42
|
...previousState,
|
|
40
43
|
};
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
const key = (0, persist_open_folders_1.openFolderKey)({
|
|
44
|
-
folderName: currentFolder,
|
|
45
|
-
parentName: currentParentName,
|
|
46
|
-
});
|
|
47
|
-
const splitted = key.split('/');
|
|
48
|
-
for (let i = 0; i < splitted.length - 1; i++) {
|
|
49
|
-
const allExceptLast = i === 0
|
|
50
|
-
? (0, persist_open_folders_1.openFolderKey)({
|
|
51
|
-
folderName: splitted.filter((s) => s !== 'no-parent')[0],
|
|
52
|
-
parentName: null,
|
|
53
|
-
})
|
|
54
|
-
: splitted.slice(0, i + 1).join('/');
|
|
55
|
-
foldersExpandedState[allExceptLast] = true;
|
|
44
|
+
for (const key of keysToExpand) {
|
|
45
|
+
foldersExpandedState[key] = true;
|
|
56
46
|
}
|
|
57
47
|
(0, persist_open_folders_1.persistExpandedFolders)('compositions', foldersExpandedState);
|
|
58
48
|
return foldersExpandedState;
|
|
@@ -69,14 +59,22 @@ const CompSelectorRef = ({ children }) => {
|
|
|
69
59
|
toggleFolder(folderName, parentName);
|
|
70
60
|
},
|
|
71
61
|
};
|
|
72
|
-
}, [
|
|
62
|
+
}, [
|
|
63
|
+
compositions,
|
|
64
|
+
selectComposition,
|
|
65
|
+
setCompositionFoldersExpanded,
|
|
66
|
+
toggleFolder,
|
|
67
|
+
]);
|
|
73
68
|
const contextValue = (0, react_1.useMemo)(() => {
|
|
74
69
|
return {
|
|
75
|
-
foldersExpanded,
|
|
76
|
-
setFoldersExpanded
|
|
70
|
+
foldersExpanded: compositionFoldersExpanded,
|
|
71
|
+
setFoldersExpanded: (foldersExpanded) => {
|
|
72
|
+
setCompositionFoldersExpanded(foldersExpanded);
|
|
73
|
+
(0, persist_open_folders_1.persistExpandedFolders)('compositions', foldersExpanded);
|
|
74
|
+
},
|
|
77
75
|
toggleFolder,
|
|
78
76
|
};
|
|
79
|
-
}, [
|
|
77
|
+
}, [compositionFoldersExpanded, setCompositionFoldersExpanded, toggleFolder]);
|
|
80
78
|
return (jsx_runtime_1.jsx(persist_open_folders_1.ExpandedFoldersContext.Provider, { value: contextValue, children: children }));
|
|
81
79
|
};
|
|
82
80
|
exports.CompSelectorRef = CompSelectorRef;
|
|
@@ -3,5 +3,4 @@ export declare const useCompositionNavigation: () => {
|
|
|
3
3
|
navigateToNextComposition: () => void;
|
|
4
4
|
navigateToPreviousComposition: () => void;
|
|
5
5
|
};
|
|
6
|
-
export declare const getKeysToExpand: (initialFolderName: string, parentFolderName: string | null, initial?: string[]) => string[];
|
|
7
6
|
export declare const CompositionSelector: React.FC;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CompositionSelector = exports.
|
|
3
|
+
exports.CompositionSelector = exports.useCompositionNavigation = 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");
|
|
@@ -82,18 +82,6 @@ const shortcutLabel = {
|
|
|
82
82
|
fontSize: 11,
|
|
83
83
|
opacity: 0.6,
|
|
84
84
|
};
|
|
85
|
-
const getKeysToExpand = (initialFolderName, parentFolderName, initial = []) => {
|
|
86
|
-
initial.push((0, persist_open_folders_1.openFolderKey)({
|
|
87
|
-
folderName: initialFolderName,
|
|
88
|
-
parentName: parentFolderName,
|
|
89
|
-
}));
|
|
90
|
-
const { name, parent } = (0, create_folder_tree_1.splitParentIntoNameAndParent)(parentFolderName);
|
|
91
|
-
if (!name) {
|
|
92
|
-
return initial;
|
|
93
|
-
}
|
|
94
|
-
return (0, exports.getKeysToExpand)(name, parent, initial);
|
|
95
|
-
};
|
|
96
|
-
exports.getKeysToExpand = getKeysToExpand;
|
|
97
85
|
const CompositionSelector = () => {
|
|
98
86
|
const { compositions, canvasContent, folders } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
99
87
|
const { foldersExpanded } = (0, react_1.useContext)(persist_open_folders_1.ExpandedFoldersContext);
|
|
@@ -3,11 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.InitialCompositionLoader = exports.useSelectComposition = exports.useSelectAsset = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const remotion_1 = require("remotion");
|
|
6
|
+
const create_folder_tree_1 = require("../helpers/create-folder-tree");
|
|
6
7
|
const mobile_layout_1 = require("../helpers/mobile-layout");
|
|
8
|
+
const persist_open_folders_1 = require("../helpers/persist-open-folders");
|
|
7
9
|
const url_state_1 = require("../helpers/url-state");
|
|
8
10
|
const folders_1 = require("../state/folders");
|
|
9
11
|
const sidebar_1 = require("../state/sidebar");
|
|
10
|
-
const CompositionSelector_1 = require("./CompositionSelector");
|
|
11
12
|
const ExplorerPanel_1 = require("./ExplorerPanel");
|
|
12
13
|
const load_canvas_content_from_url_1 = require("./load-canvas-content-from-url");
|
|
13
14
|
const use_static_files_1 = require("./use-static-files");
|
|
@@ -49,13 +50,14 @@ const useSelectComposition = () => {
|
|
|
49
50
|
const { folderName, parentFolderName } = c;
|
|
50
51
|
if (folderName !== null) {
|
|
51
52
|
setCompositionFoldersExpanded((ex) => {
|
|
52
|
-
const keysToExpand = (0,
|
|
53
|
+
const keysToExpand = (0, create_folder_tree_1.getKeysToExpand)(folderName, parentFolderName);
|
|
53
54
|
const newState = {
|
|
54
55
|
...ex,
|
|
55
56
|
};
|
|
56
57
|
for (const key of keysToExpand) {
|
|
57
58
|
newState[key] = true;
|
|
58
59
|
}
|
|
60
|
+
(0, persist_open_folders_1.persistExpandedFolders)('compositions', newState);
|
|
59
61
|
return newState;
|
|
60
62
|
});
|
|
61
63
|
if (isMobileLayout) {
|
|
@@ -29,7 +29,7 @@ const iconButton = {
|
|
|
29
29
|
width: 14,
|
|
30
30
|
color: 'white',
|
|
31
31
|
};
|
|
32
|
-
const PlayPause = ({ playbackRate, loop, bufferStateDelayInMilliseconds }) => {
|
|
32
|
+
const PlayPause = ({ playbackRate, loop, bufferStateDelayInMilliseconds, muted }) => {
|
|
33
33
|
const { inFrame, outFrame } = (0, in_out_1.useTimelineInOutFramePosition)();
|
|
34
34
|
const videoConfig = remotion_1.Internals.useUnsafeVideoConfig();
|
|
35
35
|
const [showBufferIndicator, setShowBufferState] = (0, react_1.useState)(false);
|
|
@@ -44,6 +44,7 @@ const PlayPause = ({ playbackRate, loop, bufferStateDelayInMilliseconds }) => {
|
|
|
44
44
|
browserMediaControlsBehavior: {
|
|
45
45
|
mode: 'register-media-session',
|
|
46
46
|
},
|
|
47
|
+
muted,
|
|
47
48
|
});
|
|
48
49
|
const isStill = (0, is_current_selected_still_1.useIsStill)();
|
|
49
50
|
(0, react_1.useEffect)(() => {
|
|
@@ -140,7 +140,7 @@ const PreviewToolbar = ({ readOnlyStudio, bufferStateDelayInMilliseconds }) => {
|
|
|
140
140
|
jsx_runtime_1.jsxs("div", { style: sideContainer, children: [
|
|
141
141
|
jsx_runtime_1.jsx("div", { style: padding }), jsx_runtime_1.jsx(TimelineZoomControls_1.TimelineZoomControls, {})
|
|
142
142
|
] }), jsx_runtime_1.jsx(layout_1.Flex, {}), jsx_runtime_1.jsx(SizeSelector_1.SizeSelector, {}), isStill || isVideoComposition ? (jsx_runtime_1.jsx(PlaybackRateSelector_1.PlaybackRateSelector, { setPlaybackRate: setPlaybackRate, playbackRate: playbackRate })) : null] })), isVideoComposition ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
143
|
-
jsx_runtime_1.jsx(layout_1.Spacing, { x: 2 }), jsx_runtime_1.jsx(PlayPause_1.PlayPause, { bufferStateDelayInMilliseconds: bufferStateDelayInMilliseconds, loop: loop, playbackRate: playbackRate }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 2 }), jsx_runtime_1.jsx(LoopToggle_1.LoopToggle, { loop: loop, setLoop: setLoop }), jsx_runtime_1.jsx(MuteToggle_1.MuteToggle, { muted: mediaMuted, setMuted: setMediaMuted }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 2 }), jsx_runtime_1.jsx(TimelineInOutToggle_1.TimelineInOutPointToggle, {}), jsx_runtime_1.jsx(layout_1.Spacing, { x: 2 })
|
|
143
|
+
jsx_runtime_1.jsx(layout_1.Spacing, { x: 2 }), jsx_runtime_1.jsx(PlayPause_1.PlayPause, { bufferStateDelayInMilliseconds: bufferStateDelayInMilliseconds, loop: loop, playbackRate: playbackRate, muted: mediaMuted }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 2 }), jsx_runtime_1.jsx(LoopToggle_1.LoopToggle, { loop: loop, setLoop: setLoop }), jsx_runtime_1.jsx(MuteToggle_1.MuteToggle, { muted: mediaMuted, setMuted: setMediaMuted }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 2 }), jsx_runtime_1.jsx(TimelineInOutToggle_1.TimelineInOutPointToggle, {}), jsx_runtime_1.jsx(layout_1.Spacing, { x: 2 })
|
|
144
144
|
] })) : null, (canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) === 'composition' ? jsx_runtime_1.jsx(CheckboardToggle_1.CheckboardToggle, {}) : null, jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), canvasContent && isFullscreenSupported ? jsx_runtime_1.jsx(FullscreenToggle_1.FullScreenToggle, {}) : null, jsx_runtime_1.jsx(layout_1.Flex, {}), isMobileLayout && (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
145
145
|
jsx_runtime_1.jsx(layout_1.Flex, {}), jsx_runtime_1.jsx(SizeSelector_1.SizeSelector, {}), isStill || isVideoComposition ? (jsx_runtime_1.jsx(PlaybackRateSelector_1.PlaybackRateSelector, { setPlaybackRate: setPlaybackRate, playbackRate: playbackRate })) : null] })), jsx_runtime_1.jsxs("div", { style: sideContainer, children: [
|
|
146
146
|
jsx_runtime_1.jsx(layout_1.Flex, {}), !isMobileLayout && jsx_runtime_1.jsx(FpsCounter_1.FpsCounter, { playbackSpeed: playbackRate }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 2 }), jsx_runtime_1.jsx(RenderButton_1.RenderButton, { readOnlyStudio: readOnlyStudio }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1.5 })
|
|
@@ -104,7 +104,7 @@ const TimelineInner = () => {
|
|
|
104
104
|
(0, timeline_layout_1.getTimelineLayerHeight)(track.sequence.type) +
|
|
105
105
|
Number(timeline_layout_1.TIMELINE_ITEM_BORDER_BOTTOM) +
|
|
106
106
|
(isExpanded
|
|
107
|
-
? (0, timeline_layout_1.getExpandedTrackHeight)(track.sequence
|
|
107
|
+
? (0, timeline_layout_1.getExpandedTrackHeight)(track.sequence, expandedTracks) +
|
|
108
108
|
timeline_layout_1.TIMELINE_ITEM_BORDER_BOTTOM
|
|
109
109
|
: 0));
|
|
110
110
|
}, 0) +
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const TimelineExpandArrowButton: React.FC<{
|
|
3
|
+
readonly isExpanded: boolean;
|
|
4
|
+
readonly onClick: () => void;
|
|
5
|
+
readonly label: string;
|
|
6
|
+
readonly hasExpandableContent: boolean;
|
|
7
|
+
}>;
|
|
8
|
+
export declare const TimelineExpandArrowSpacer: React.FC;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TimelineExpandArrowSpacer = exports.TimelineExpandArrowButton = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const arrowButton = {
|
|
7
|
+
background: 'none',
|
|
8
|
+
border: 'none',
|
|
9
|
+
color: 'white',
|
|
10
|
+
cursor: 'pointer',
|
|
11
|
+
padding: 0,
|
|
12
|
+
display: 'flex',
|
|
13
|
+
alignItems: 'center',
|
|
14
|
+
justifyContent: 'center',
|
|
15
|
+
width: 12,
|
|
16
|
+
height: 12,
|
|
17
|
+
flexShrink: 0,
|
|
18
|
+
fontSize: 8,
|
|
19
|
+
marginRight: 4,
|
|
20
|
+
userSelect: 'none',
|
|
21
|
+
outline: 'none',
|
|
22
|
+
lineHeight: 1,
|
|
23
|
+
};
|
|
24
|
+
const svgStyle = { display: 'block' };
|
|
25
|
+
const TimelineExpandArrowButton = ({ isExpanded, onClick, label, hasExpandableContent }) => {
|
|
26
|
+
const style = (0, react_1.useMemo)(() => {
|
|
27
|
+
return {
|
|
28
|
+
...arrowButton,
|
|
29
|
+
transform: isExpanded ? 'rotate(90deg)' : 'rotate(0deg)',
|
|
30
|
+
opacity: hasExpandableContent ? 1 : 0.2,
|
|
31
|
+
};
|
|
32
|
+
}, [isExpanded, hasExpandableContent]);
|
|
33
|
+
return (jsx_runtime_1.jsx("button", { type: "button", style: style, onClick: onClick, disabled: !hasExpandableContent, "aria-expanded": isExpanded, "aria-label": `${isExpanded ? 'Collapse' : 'Expand'} ${label}`, children: jsx_runtime_1.jsx("svg", { width: "12", height: "12", viewBox: "0 0 8 8", style: svgStyle, children: jsx_runtime_1.jsx("path", { d: "M2 1L6 4L2 7Z", fill: "white" }) }) }));
|
|
34
|
+
};
|
|
35
|
+
exports.TimelineExpandArrowButton = TimelineExpandArrowButton;
|
|
36
|
+
const TimelineExpandArrowSpacer = () => {
|
|
37
|
+
return jsx_runtime_1.jsx("div", { style: arrowButton });
|
|
38
|
+
};
|
|
39
|
+
exports.TimelineExpandArrowSpacer = TimelineExpandArrowSpacer;
|
|
@@ -2,8 +2,6 @@ import type { SequenceNodePath } from '@remotion/studio-shared';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import type { TSequence } from 'remotion';
|
|
4
4
|
import type { OriginalPosition } from '../../error-overlay/react-overlay/utils/get-source-map';
|
|
5
|
-
export declare const EXPANDED_SECTION_PADDING_LEFT = 28;
|
|
6
|
-
export declare const EXPANDED_SECTION_PADDING_RIGHT = 10;
|
|
7
5
|
export declare const TimelineExpandedSection: React.FC<{
|
|
8
6
|
readonly sequence: TSequence;
|
|
9
7
|
readonly originalLocation: OriginalPosition | null;
|
|
@@ -33,14 +33,15 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.TimelineExpandedSection =
|
|
36
|
+
exports.TimelineExpandedSection = void 0;
|
|
37
37
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
38
|
const react_1 = __importStar(require("react"));
|
|
39
39
|
const colors_1 = require("../../helpers/colors");
|
|
40
40
|
const timeline_layout_1 = require("../../helpers/timeline-layout");
|
|
41
|
+
const ExpandedTracksProvider_1 = require("../ExpandedTracksProvider");
|
|
42
|
+
const TimelineExpandArrowButton_1 = require("./TimelineExpandArrowButton");
|
|
41
43
|
const TimelineFieldRow_1 = require("./TimelineFieldRow");
|
|
42
|
-
|
|
43
|
-
exports.EXPANDED_SECTION_PADDING_RIGHT = 10;
|
|
44
|
+
const TimelineListItem_1 = require("./TimelineListItem");
|
|
44
45
|
const expandedSectionBase = {
|
|
45
46
|
color: 'white',
|
|
46
47
|
fontFamily: 'Arial, Helvetica, sans-serif',
|
|
@@ -53,11 +54,27 @@ const separator = {
|
|
|
53
54
|
height: 1,
|
|
54
55
|
backgroundColor: colors_1.TIMELINE_TRACK_SEPARATOR,
|
|
55
56
|
};
|
|
57
|
+
const groupRowBase = {
|
|
58
|
+
height: timeline_layout_1.TREE_GROUP_ROW_HEIGHT,
|
|
59
|
+
display: 'flex',
|
|
60
|
+
alignItems: 'center',
|
|
61
|
+
paddingRight: timeline_layout_1.EXPANDED_SECTION_PADDING_RIGHT,
|
|
62
|
+
};
|
|
63
|
+
const rowLabel = {
|
|
64
|
+
fontSize: 12,
|
|
65
|
+
color: 'rgba(255, 255, 255, 0.8)',
|
|
66
|
+
userSelect: 'none',
|
|
67
|
+
};
|
|
68
|
+
const labelOnlyRowBase = {
|
|
69
|
+
display: 'flex',
|
|
70
|
+
alignItems: 'center',
|
|
71
|
+
paddingRight: timeline_layout_1.EXPANDED_SECTION_PADDING_RIGHT,
|
|
72
|
+
};
|
|
56
73
|
const TimelineExpandedSection = ({ sequence, originalLocation, nestedDepth, nodePath }) => {
|
|
57
74
|
var _a;
|
|
58
75
|
var _b;
|
|
76
|
+
const { expandedTracks, toggleTrack } = (0, react_1.useContext)(ExpandedTracksProvider_1.ExpandedTracksContext);
|
|
59
77
|
const overrideId = (_b = (_a = sequence.controls) === null || _a === void 0 ? void 0 : _a.overrideId) !== null && _b !== void 0 ? _b : sequence.id;
|
|
60
|
-
const schemaFields = (0, react_1.useMemo)(() => (0, timeline_layout_1.getSchemaFields)(sequence.controls), [sequence.controls]);
|
|
61
78
|
const validatedLocation = (0, react_1.useMemo)(() => {
|
|
62
79
|
var _a;
|
|
63
80
|
if (!originalLocation ||
|
|
@@ -71,24 +88,56 @@ const TimelineExpandedSection = ({ sequence, originalLocation, nestedDepth, node
|
|
|
71
88
|
column: (_a = originalLocation.column) !== null && _a !== void 0 ? _a : 0,
|
|
72
89
|
};
|
|
73
90
|
}, [originalLocation]);
|
|
74
|
-
const
|
|
91
|
+
const tree = (0, react_1.useMemo)(() => (0, timeline_layout_1.buildTimelineTree)(sequence), [sequence]);
|
|
92
|
+
const flat = (0, react_1.useMemo)(() => (0, timeline_layout_1.flattenVisibleTreeNodes)(tree, expandedTracks), [tree, expandedTracks]);
|
|
93
|
+
const expandedHeight = (0, react_1.useMemo)(() => (0, timeline_layout_1.getExpandedTrackHeight)(sequence, expandedTracks), [sequence, expandedTracks]);
|
|
94
|
+
const sequenceOffsetPx = TimelineListItem_1.SPACING * 3 * nestedDepth;
|
|
95
|
+
const keysToObserve = (0, react_1.useMemo)(() => {
|
|
96
|
+
const fields = (0, timeline_layout_1.getSchemaFields)(sequence.controls);
|
|
97
|
+
if (!fields) {
|
|
98
|
+
return [];
|
|
99
|
+
}
|
|
100
|
+
return fields.map((f) => f.key);
|
|
101
|
+
}, [sequence.controls]);
|
|
75
102
|
const style = (0, react_1.useMemo)(() => {
|
|
76
103
|
return {
|
|
77
104
|
...expandedSectionBase,
|
|
78
105
|
height: expandedHeight,
|
|
79
106
|
};
|
|
80
107
|
}, [expandedHeight]);
|
|
81
|
-
const
|
|
82
|
-
|
|
83
|
-
|
|
108
|
+
const renderRow = (0, react_1.useCallback)((node, depth) => {
|
|
109
|
+
var _a;
|
|
110
|
+
const paddingLeft = timeline_layout_1.EXPANDED_SECTION_PADDING_LEFT +
|
|
111
|
+
depth * timeline_layout_1.TREE_INDENT_PER_LEVEL +
|
|
112
|
+
sequenceOffsetPx;
|
|
113
|
+
if (node.kind === 'group') {
|
|
114
|
+
const isExpanded = (_a = expandedTracks[node.id]) !== null && _a !== void 0 ? _a : false;
|
|
115
|
+
return (jsx_runtime_1.jsxs("div", { style: { ...groupRowBase, paddingLeft }, children: [
|
|
116
|
+
jsx_runtime_1.jsx(TimelineExpandArrowButton_1.TimelineExpandArrowButton, { isExpanded: isExpanded, onClick: () => toggleTrack(node.id), label: `${node.label} section`, hasExpandableContent: true }), jsx_runtime_1.jsx("span", { style: rowLabel, children: node.label })
|
|
117
|
+
] }));
|
|
118
|
+
}
|
|
119
|
+
if (node.field) {
|
|
120
|
+
return (jsx_runtime_1.jsx(TimelineFieldRow_1.TimelineFieldRow, { field: node.field, overrideId: overrideId, validatedLocation: validatedLocation, paddingLeft: paddingLeft, nodePath: nodePath, keysToObserve: keysToObserve }));
|
|
84
121
|
}
|
|
85
|
-
return
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
122
|
+
return (jsx_runtime_1.jsx("div", { style: {
|
|
123
|
+
...labelOnlyRowBase,
|
|
124
|
+
height: (0, timeline_layout_1.getTreeRowHeight)(node),
|
|
125
|
+
paddingLeft,
|
|
126
|
+
}, children: jsx_runtime_1.jsx("span", { style: rowLabel, children: node.label }) }));
|
|
127
|
+
}, [
|
|
128
|
+
expandedTracks,
|
|
129
|
+
keysToObserve,
|
|
130
|
+
nodePath,
|
|
131
|
+
overrideId,
|
|
132
|
+
sequenceOffsetPx,
|
|
133
|
+
toggleTrack,
|
|
134
|
+
validatedLocation,
|
|
135
|
+
]);
|
|
136
|
+
if (flat.length === 0) {
|
|
137
|
+
return jsx_runtime_1.jsx("div", { style: style, children: "No schema" });
|
|
138
|
+
}
|
|
139
|
+
return (jsx_runtime_1.jsx("div", { style: style, children: flat.map(({ node, depth }, i) => {
|
|
140
|
+
return (jsx_runtime_1.jsxs(react_1.default.Fragment, { children: [i > 0 ? jsx_runtime_1.jsx("div", { style: separator }) : null, renderRow(node, depth)] }, node.id));
|
|
141
|
+
}) }));
|
|
93
142
|
};
|
|
94
143
|
exports.TimelineExpandedSection = TimelineExpandedSection;
|
|
@@ -6,7 +6,7 @@ export declare const TimelineFieldRow: React.FC<{
|
|
|
6
6
|
readonly field: SchemaFieldInfo;
|
|
7
7
|
readonly overrideId: string;
|
|
8
8
|
readonly validatedLocation: CodePosition | null;
|
|
9
|
-
readonly
|
|
9
|
+
readonly paddingLeft: number;
|
|
10
10
|
readonly nodePath: SequenceNodePath | null;
|
|
11
11
|
readonly keysToObserve: string[];
|
|
12
12
|
}>;
|
|
@@ -4,16 +4,14 @@ exports.TimelineFieldRow = 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 timeline_layout_1 = require("../../helpers/timeline-layout");
|
|
7
8
|
const call_api_1 = require("../call-api");
|
|
8
|
-
const TimelineExpandedSection_1 = require("./TimelineExpandedSection");
|
|
9
|
-
const TimelineListItem_1 = require("./TimelineListItem");
|
|
10
9
|
const TimelineSchemaField_1 = require("./TimelineSchemaField");
|
|
11
|
-
const FIELD_ROW_PADDING_LEFT = 24;
|
|
12
10
|
const fieldRowBase = {
|
|
13
11
|
display: 'flex',
|
|
14
12
|
alignItems: 'center',
|
|
15
13
|
gap: 8,
|
|
16
|
-
paddingRight:
|
|
14
|
+
paddingRight: timeline_layout_1.EXPANDED_SECTION_PADDING_RIGHT,
|
|
17
15
|
};
|
|
18
16
|
const fieldName = {
|
|
19
17
|
fontSize: 12,
|
|
@@ -27,7 +25,7 @@ const fieldLabelRow = {
|
|
|
27
25
|
alignItems: 'center',
|
|
28
26
|
gap: 6,
|
|
29
27
|
};
|
|
30
|
-
const TimelineFieldRow = ({ field, overrideId, validatedLocation,
|
|
28
|
+
const TimelineFieldRow = ({ field, overrideId, validatedLocation, paddingLeft, nodePath, keysToObserve, }) => {
|
|
31
29
|
var _a, _b, _c, _d;
|
|
32
30
|
const { setDragOverrides, clearDragOverrides, dragOverrides, codeValues: allPropStatuses, } = (0, react_1.useContext)(remotion_1.Internals.VisualModeOverridesContext);
|
|
33
31
|
const propStatuses = ((_a = allPropStatuses[overrideId]) !== null && _a !== void 0 ? _a : null);
|
|
@@ -93,11 +91,9 @@ const TimelineFieldRow = ({ field, overrideId, validatedLocation, nestedDepth, n
|
|
|
93
91
|
return {
|
|
94
92
|
...fieldRowBase,
|
|
95
93
|
height: field.rowHeight,
|
|
96
|
-
paddingLeft
|
|
97
|
-
FIELD_ROW_PADDING_LEFT +
|
|
98
|
-
TimelineListItem_1.SPACING * 3 * nestedDepth,
|
|
94
|
+
paddingLeft,
|
|
99
95
|
};
|
|
100
|
-
}, [field.rowHeight,
|
|
96
|
+
}, [field.rowHeight, paddingLeft]);
|
|
101
97
|
return (jsx_runtime_1.jsxs("div", { style: style, children: [
|
|
102
98
|
jsx_runtime_1.jsx("div", { style: fieldLabelRow, children: jsx_runtime_1.jsx("span", { style: fieldName, children: (_c = field.description) !== null && _c !== void 0 ? _c : field.key }) }), jsx_runtime_1.jsx(TimelineSchemaField_1.TimelineFieldValue, { field: field, propStatus: propStatus, onSave: onSave, onDragValueChange: onDragValueChange, onDragEnd: onDragEnd, canUpdate: (_d = propStatus === null || propStatus === void 0 ? void 0 : propStatus.canUpdate) !== null && _d !== void 0 ? _d : false, effectiveValue: effectiveValue, codeValue: propStatus })
|
|
103
99
|
] }));
|
|
@@ -11,6 +11,7 @@ const call_api_1 = require("../call-api");
|
|
|
11
11
|
const ContextMenu_1 = require("../ContextMenu");
|
|
12
12
|
const ExpandedTracksProvider_1 = require("../ExpandedTracksProvider");
|
|
13
13
|
const NotificationCenter_1 = require("../Notifications/NotificationCenter");
|
|
14
|
+
const TimelineExpandArrowButton_1 = require("./TimelineExpandArrowButton");
|
|
14
15
|
const TimelineExpandedSection_1 = require("./TimelineExpandedSection");
|
|
15
16
|
const TimelineLayerEye_1 = require("./TimelineLayerEye");
|
|
16
17
|
const TimelineStack_1 = require("./TimelineStack");
|
|
@@ -21,24 +22,6 @@ const space = {
|
|
|
21
22
|
width: exports.SPACING,
|
|
22
23
|
flexShrink: 0,
|
|
23
24
|
};
|
|
24
|
-
const arrowButton = {
|
|
25
|
-
background: 'none',
|
|
26
|
-
border: 'none',
|
|
27
|
-
color: 'white',
|
|
28
|
-
cursor: 'pointer',
|
|
29
|
-
padding: 0,
|
|
30
|
-
display: 'flex',
|
|
31
|
-
alignItems: 'center',
|
|
32
|
-
justifyContent: 'center',
|
|
33
|
-
width: 12,
|
|
34
|
-
height: 12,
|
|
35
|
-
flexShrink: 0,
|
|
36
|
-
fontSize: 8,
|
|
37
|
-
marginRight: 4,
|
|
38
|
-
userSelect: 'none',
|
|
39
|
-
outline: 'none',
|
|
40
|
-
lineHeight: 1,
|
|
41
|
-
};
|
|
42
25
|
const TimelineListItem = ({ nestedDepth, sequence, isCompact }) => {
|
|
43
26
|
var _a, _b;
|
|
44
27
|
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
@@ -165,7 +148,7 @@ const TimelineListItem = ({ nestedDepth, sequence, isCompact }) => {
|
|
|
165
148
|
}, [sequence.id, toggleTrack]);
|
|
166
149
|
const padder = (0, react_1.useMemo)(() => {
|
|
167
150
|
return {
|
|
168
|
-
width: Number(exports.SPACING
|
|
151
|
+
width: Number(exports.SPACING) * nestedDepth,
|
|
169
152
|
flexShrink: 0,
|
|
170
153
|
};
|
|
171
154
|
}, [nestedDepth]);
|
|
@@ -184,6 +167,13 @@ const TimelineListItem = ({ nestedDepth, sequence, isCompact }) => {
|
|
|
184
167
|
const outer = (0, react_1.useMemo)(() => {
|
|
185
168
|
return {
|
|
186
169
|
height: (0, timeline_layout_1.getTimelineLayerHeight)(sequence.type) + timeline_layout_1.TIMELINE_ITEM_BORDER_BOTTOM,
|
|
170
|
+
borderBottom: `1px solid ${colors_1.TIMELINE_TRACK_SEPARATOR}`,
|
|
171
|
+
};
|
|
172
|
+
}, [sequence.type]);
|
|
173
|
+
const inner = (0, react_1.useMemo)(() => {
|
|
174
|
+
return {
|
|
175
|
+
// TODO: Not so small
|
|
176
|
+
height: timeline_layout_1.TIMELINE_LAYER_HEIGHT_AUDIO,
|
|
187
177
|
color: 'white',
|
|
188
178
|
fontFamily: 'Arial, Helvetica, sans-serif',
|
|
189
179
|
display: 'flex',
|
|
@@ -192,18 +182,12 @@ const TimelineListItem = ({ nestedDepth, sequence, isCompact }) => {
|
|
|
192
182
|
wordBreak: 'break-all',
|
|
193
183
|
textAlign: 'left',
|
|
194
184
|
paddingLeft: exports.SPACING,
|
|
195
|
-
borderBottom: `1px solid ${colors_1.TIMELINE_TRACK_SEPARATOR}`,
|
|
196
|
-
};
|
|
197
|
-
}, [sequence.type]);
|
|
198
|
-
const arrowStyle = (0, react_1.useMemo)(() => {
|
|
199
|
-
return {
|
|
200
|
-
...arrowButton,
|
|
201
|
-
transform: isExpanded ? 'rotate(90deg)' : 'rotate(0deg)',
|
|
202
185
|
};
|
|
203
|
-
}, [
|
|
204
|
-
const
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
186
|
+
}, []);
|
|
187
|
+
const hasExpandableContent = Boolean(sequence.controls) || sequence.effects.length > 0;
|
|
188
|
+
const trackRow = (jsx_runtime_1.jsx("div", { style: outer, children: jsx_runtime_1.jsxs("div", { style: inner, children: [
|
|
189
|
+
jsx_runtime_1.jsx(TimelineLayerEye_1.TimelineLayerEye, { type: sequence.type === 'audio' ? 'speaker' : 'eye', hidden: isItemHidden, onInvoked: onToggleVisibility }), jsx_runtime_1.jsx("div", { style: padder }), sequence.parent && nestedDepth > 0 ? jsx_runtime_1.jsx("div", { style: space }) : null, visualModeActive ? (jsx_runtime_1.jsx(TimelineExpandArrowButton_1.TimelineExpandArrowButton, { isExpanded: isExpanded, onClick: onToggleExpand, label: "track properties", hasExpandableContent: hasExpandableContent })) : null, jsx_runtime_1.jsx(TimelineStack_1.TimelineStack, { sequence: sequence, isCompact: isCompact, originalLocation: originalLocation })
|
|
190
|
+
] }) }));
|
|
191
|
+
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [visualModeEnvEnabled ? (jsx_runtime_1.jsx(ContextMenu_1.ContextMenu, { values: contextMenuValues, children: trackRow })) : (trackRow), visualModeActive && isExpanded && hasExpandableContent ? (jsx_runtime_1.jsx(TimelineExpandedSection_1.TimelineExpandedSection, { sequence: sequence, originalLocation: originalLocation, nestedDepth: nestedDepth, nodePath: nodePath })) : null] }));
|
|
208
192
|
};
|
|
209
193
|
exports.TimelineListItem = TimelineListItem;
|
|
@@ -136,6 +136,8 @@ const TimelineStack = ({ isCompact, sequence, originalLocation }) => {
|
|
|
136
136
|
textOverflow: 'ellipsis',
|
|
137
137
|
overflow: 'hidden',
|
|
138
138
|
flexShrink: 100000,
|
|
139
|
+
userSelect: 'none',
|
|
140
|
+
WebkitUserSelect: 'none',
|
|
139
141
|
};
|
|
140
142
|
}, [opening, stackHovered, stackHoverable]);
|
|
141
143
|
const titleStyle = (0, react_1.useMemo)(() => {
|
|
@@ -18,8 +18,9 @@ const content = {
|
|
|
18
18
|
const timelineContent = {
|
|
19
19
|
minHeight: '100%',
|
|
20
20
|
};
|
|
21
|
-
const getExpandedPlaceholderStyle = (
|
|
22
|
-
height: (0, timeline_layout_1.getExpandedTrackHeight)(
|
|
21
|
+
const getExpandedPlaceholderStyle = (sequence, expandedTracks) => ({
|
|
22
|
+
height: (0, timeline_layout_1.getExpandedTrackHeight)(sequence, expandedTracks) +
|
|
23
|
+
timeline_layout_1.TIMELINE_ITEM_BORDER_BOTTOM,
|
|
23
24
|
});
|
|
24
25
|
const TimelineTracks = ({ timeline, hasBeenCut }) => {
|
|
25
26
|
const { expandedTracks } = (0, react_1.useContext)(ExpandedTracksProvider_1.ExpandedTracksContext);
|
|
@@ -44,7 +45,7 @@ const TimelineTracks = ({ timeline, hasBeenCut }) => {
|
|
|
44
45
|
jsx_runtime_1.jsx("div", { style: {
|
|
45
46
|
height: (0, timeline_layout_1.getTimelineLayerHeight)(track.sequence.type),
|
|
46
47
|
marginBottom: timeline_layout_1.TIMELINE_ITEM_BORDER_BOTTOM,
|
|
47
|
-
}, children: jsx_runtime_1.jsx(TimelineSequence_1.TimelineSequence, { s: track.sequence }) }), visualModeEnabled && isExpanded ? (jsx_runtime_1.jsx("div", { style: getExpandedPlaceholderStyle(track.sequence
|
|
48
|
+
}, children: jsx_runtime_1.jsx(TimelineSequence_1.TimelineSequence, { s: track.sequence }) }), visualModeEnabled && isExpanded ? (jsx_runtime_1.jsx("div", { style: getExpandedPlaceholderStyle(track.sequence, expandedTracks) })) : null] }, track.sequence.id));
|
|
48
49
|
})] }), hasBeenCut ? jsx_runtime_1.jsx(MaxTimelineTracks_1.MaxTimelineTracksReached, {}) : null] }));
|
|
49
50
|
};
|
|
50
51
|
exports.TimelineTracks = TimelineTracks;
|
|
@@ -4,9 +4,7 @@ exports.CopyStackTrace = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const Button_1 = require("../../components/Button");
|
|
7
|
-
const
|
|
8
|
-
const ShortcutHint_1 = require("./ShortcutHint");
|
|
9
|
-
const CopyStackTrace = ({ canHaveKeyboardShortcuts, errorText }) => {
|
|
7
|
+
const CopyStackTrace = ({ errorText }) => {
|
|
10
8
|
const [copyState, setCopyState] = (0, react_1.useState)('idle');
|
|
11
9
|
const handleCopyToClipboard = (0, react_1.useCallback)(() => {
|
|
12
10
|
navigator.clipboard
|
|
@@ -20,22 +18,6 @@ const CopyStackTrace = ({ canHaveKeyboardShortcuts, errorText }) => {
|
|
|
20
18
|
setTimeout(() => setCopyState('idle'), 2000);
|
|
21
19
|
});
|
|
22
20
|
}, [errorText]);
|
|
23
|
-
const { registerKeybinding } = (0, use_keybinding_1.useKeybinding)();
|
|
24
|
-
(0, react_1.useEffect)(() => {
|
|
25
|
-
if (!canHaveKeyboardShortcuts) {
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
const { unregister } = registerKeybinding({
|
|
29
|
-
event: 'keydown',
|
|
30
|
-
key: 't',
|
|
31
|
-
callback: handleCopyToClipboard,
|
|
32
|
-
commandCtrlKey: true,
|
|
33
|
-
preventDefault: true,
|
|
34
|
-
triggerIfInputFieldFocused: false,
|
|
35
|
-
keepRegisteredWhenNotHighestContext: false,
|
|
36
|
-
});
|
|
37
|
-
return () => unregister();
|
|
38
|
-
}, [canHaveKeyboardShortcuts, handleCopyToClipboard, registerKeybinding]);
|
|
39
21
|
const label = (0, react_1.useMemo)(() => {
|
|
40
22
|
if (copyState === 'copied') {
|
|
41
23
|
return 'Copied!';
|
|
@@ -45,6 +27,6 @@ const CopyStackTrace = ({ canHaveKeyboardShortcuts, errorText }) => {
|
|
|
45
27
|
}
|
|
46
28
|
return 'Copy Stacktrace';
|
|
47
29
|
}, [copyState]);
|
|
48
|
-
return
|
|
30
|
+
return jsx_runtime_1.jsx(Button_1.Button, { onClick: handleCopyToClipboard, children: label });
|
|
49
31
|
};
|
|
50
32
|
exports.CopyStackTrace = CopyStackTrace;
|
|
@@ -64,7 +64,7 @@ const ErrorDisplay = ({ display, keyboardShortcuts, onRetry, canHaveDismissButto
|
|
|
64
64
|
jsx_runtime_1.jsx(HelpLink_1.HelpLink, { link: helpLink, canHaveKeyboardShortcuts: keyboardShortcuts }), jsx_runtime_1.jsx("div", { style: spacer })
|
|
65
65
|
] })) : null, display.stackFrames.length > 0 && window.remotion_editorName ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
66
66
|
jsx_runtime_1.jsx(OpenInEditor_1.OpenInEditor, { canHaveKeyboardShortcuts: keyboardShortcuts, stack: display.stackFrames[0] }), jsx_runtime_1.jsx("div", { style: spacer })
|
|
67
|
-
] })) : null, jsx_runtime_1.jsx(CopyStackTrace_1.CopyStackTrace, {
|
|
67
|
+
] })) : null, jsx_runtime_1.jsx(CopyStackTrace_1.CopyStackTrace, { errorText: errorTextForCopy }), jsx_runtime_1.jsx("div", { style: spacer }), jsx_runtime_1.jsx(SearchGitHubIssues_1.SearchGithubIssues, { canHaveKeyboardShortcuts: keyboardShortcuts, message: display.error.message }), jsx_runtime_1.jsx("div", { style: spacer }), jsx_runtime_1.jsx(AskOnDiscord_1.AskOnDiscord, { canHaveKeyboardShortcuts: keyboardShortcuts }), onRetry ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
68
68
|
jsx_runtime_1.jsx("div", { style: spacer }), jsx_runtime_1.jsx(Retry_1.RetryButton, { onClick: onRetry, label: calculateMetadata ? 'Retry calculateMetadata()' : 'Retry' })
|
|
69
69
|
] })) : null, calculateMetadata ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
70
70
|
jsx_runtime_1.jsx("br", {}), jsx_runtime_1.jsx(layout_1.Spacing, { y: 0.5 }), jsx_runtime_1.jsx(CalculateMetadataErrorExplainer_1.CalculateMetadataErrorExplainer, {})
|