@remotion/cli 3.1.8 → 3.2.0
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/code-frame.js +2 -1
- package/dist/editor/components/Canvas.js +2 -0
- package/dist/editor/components/CompositionSelector.js +2 -0
- package/dist/editor/components/CompositionSelectorItem.js +1 -0
- package/dist/editor/components/CurrentComposition.js +5 -0
- package/dist/editor/components/Editor.js +3 -1
- package/dist/editor/components/InitialCompositionLoader.js +13 -0
- package/dist/editor/components/MenuToolbar.js +2 -0
- package/dist/editor/components/Notifications/Notification.js +1 -1
- package/dist/editor/components/Notifications/NotificationCenter.js +1 -0
- package/dist/editor/components/PlayPause.js +41 -23
- package/dist/editor/components/PreviewToolbar.js +4 -2
- package/dist/editor/components/Splitter/SplitterElement.js +1 -0
- package/dist/editor/components/TimeValue.js +9 -5
- package/dist/editor/components/Timeline/MaxTimelineTracks.d.ts +1 -0
- package/dist/editor/components/Timeline/MaxTimelineTracks.js +5 -3
- package/dist/editor/components/Timeline/Timeline.js +11 -4
- package/dist/editor/components/Timeline/TimelineDragHandler.js +120 -23
- package/dist/editor/components/Timeline/TimelineList.js +7 -4
- package/dist/editor/components/Timeline/TimelineListItem.d.ts +1 -0
- package/dist/editor/components/Timeline/TimelineListItem.js +8 -4
- package/dist/editor/components/Timeline/TimelinePlayCursorSyncer.d.ts +2 -0
- package/dist/editor/components/Timeline/TimelinePlayCursorSyncer.js +76 -0
- package/dist/editor/components/Timeline/TimelineScrollable.js +4 -2
- package/dist/editor/components/Timeline/TimelineSlider.d.ts +3 -0
- package/dist/editor/components/Timeline/TimelineSlider.js +35 -2
- package/dist/editor/components/Timeline/TimelineSliderHandle.js +1 -3
- package/dist/editor/components/Timeline/TimelineTimeIndicators.d.ts +5 -0
- package/dist/editor/components/Timeline/TimelineTimeIndicators.js +168 -0
- package/dist/editor/components/Timeline/TimelineTracks.js +14 -9
- package/dist/editor/components/Timeline/TimelineZoomControls.js +18 -2
- package/dist/editor/components/Timeline/imperative-state.d.ts +12 -0
- package/dist/editor/components/Timeline/imperative-state.js +39 -0
- package/dist/editor/components/Timeline/timeline-refs.d.ts +2 -0
- package/dist/editor/components/Timeline/timeline-refs.js +3 -1
- package/dist/editor/components/Timeline/timeline-scroll-logic.d.ts +40 -0
- package/dist/editor/components/Timeline/timeline-scroll-logic.js +206 -1
- package/dist/editor/components/ZoomPersistor.d.ts +4 -0
- package/dist/editor/components/ZoomPersistor.js +37 -0
- package/dist/editor/helpers/colors.d.ts +1 -0
- package/dist/editor/helpers/colors.js +2 -1
- package/dist/editor/helpers/get-left-of-timeline-slider.d.ts +1 -0
- package/dist/editor/helpers/get-left-of-timeline-slider.js +7 -4
- package/dist/editor/helpers/get-timeline-sequence-layout.js +29 -9
- package/dist/editor/icons/minus.d.ts +3 -0
- package/dist/editor/icons/minus.js +8 -0
- package/dist/editor/icons/plus.d.ts +3 -0
- package/dist/editor/icons/plus.js +8 -0
- package/dist/editor/state/timeline-zoom.d.ts +1 -1
- package/dist/editor/state/timeline-zoom.js +15 -1
- package/dist/handle-common-errors.js +5 -0
- package/dist/preview-server/error-overlay/remotion-overlay/Button.d.ts +1 -0
- package/dist/preview-server/error-overlay/remotion-overlay/Button.js +9 -2
- package/dist/preview-server/error-overlay/remotion-overlay/HelpLink.js +5 -1
- package/dist/preview-server/error-overlay/remotion-overlay/get-help-link.js +24 -0
- package/dist/preview-server/live-events.js +4 -0
- package/dist/preview-server/routes.js +16 -2
- package/dist/preview-server/start-server.js +1 -1
- package/dist/upgrade.js +1 -0
- package/dist/versions.js +1 -0
- package/package.json +7 -7
- package/dist/bundle-on-cli.d.ts +0 -2
- package/dist/bundle-on-cli.js +0 -41
- package/dist/bundle.d.ts +0 -1
- package/dist/bundle.js +0 -31
- package/dist/chalk/symbols.d.ts +0 -111
- package/dist/chalk/symbols.js +0 -75
- package/dist/chalk/utilities.d.ts +0 -2
- package/dist/chalk/utilities.js +0 -37
- package/dist/editor/components/CompositionManager.d.ts +0 -4
- package/dist/editor/components/CompositionManager.js +0 -60
- package/dist/editor/components/LoadingIndicator.d.ts +0 -2
- package/dist/editor/components/LoadingIndicator.js +0 -35
- package/dist/prepare-entry-point.d.ts +0 -11
- package/dist/prepare-entry-point.js +0 -36
- package/dist/preview-server/fast-refresh/helpers.d.ts +0 -39
- package/dist/preview-server/fast-refresh/helpers.js +0 -145
- package/dist/preview-server/fast-refresh/index.d.ts +0 -30
- package/dist/preview-server/fast-refresh/index.js +0 -86
- package/dist/preview-server/fast-refresh/loader.d.ts +0 -35
- package/dist/preview-server/fast-refresh/loader.js +0 -81
- package/dist/preview-server/fast-refresh/runtime.d.ts +0 -35
- package/dist/preview-server/fast-refresh/runtime.js +0 -32
- package/dist/preview-server/static-preview.d.ts +0 -1
- package/dist/preview-server/static-preview.js +0 -40
- package/dist/preview-server/webpack-cache.d.ts +0 -12
- package/dist/preview-server/webpack-cache.js +0 -66
- package/dist/webpack-cache.d.ts +0 -12
- package/dist/webpack-cache.js +0 -66
package/dist/code-frame.js
CHANGED
|
@@ -41,7 +41,8 @@ const logLine = (frame) => {
|
|
|
41
41
|
};
|
|
42
42
|
const printCodeFrameAndStack = (err) => {
|
|
43
43
|
var _a, _b, _c;
|
|
44
|
-
if (!err.symbolicatedStackFrames
|
|
44
|
+
if (!err.symbolicatedStackFrames ||
|
|
45
|
+
err.symbolicatedStackFrames.length === 0) {
|
|
45
46
|
log_1.Log.error(err.stack);
|
|
46
47
|
return;
|
|
47
48
|
}
|
|
@@ -4,12 +4,14 @@ exports.Canvas = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const player_1 = require("@remotion/player");
|
|
6
6
|
const react_1 = require("react");
|
|
7
|
+
const colors_1 = require("../helpers/colors");
|
|
7
8
|
const Preview_1 = require("./Preview");
|
|
8
9
|
const container = {
|
|
9
10
|
flex: 1,
|
|
10
11
|
display: 'flex',
|
|
11
12
|
overflow: 'hidden',
|
|
12
13
|
position: 'relative',
|
|
14
|
+
backgroundColor: colors_1.BACKGROUND,
|
|
13
15
|
};
|
|
14
16
|
const Canvas = () => {
|
|
15
17
|
const ref = (0, react_1.useRef)(null);
|
|
@@ -4,6 +4,7 @@ exports.CompositionSelector = exports.getKeysToExpand = 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 colors_1 = require("../helpers/colors");
|
|
7
8
|
const create_folder_tree_1 = require("../helpers/create-folder-tree");
|
|
8
9
|
const persist_open_folders_1 = require("../helpers/persist-open-folders");
|
|
9
10
|
const z_index_1 = require("../state/z-index");
|
|
@@ -16,6 +17,7 @@ const container = {
|
|
|
16
17
|
height: '100%',
|
|
17
18
|
width: '100%',
|
|
18
19
|
flex: 1,
|
|
20
|
+
backgroundColor: colors_1.BACKGROUND,
|
|
19
21
|
};
|
|
20
22
|
const list = {
|
|
21
23
|
padding: 5,
|
|
@@ -4,6 +4,7 @@ exports.CurrentComposition = 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 colors_1 = require("../helpers/colors");
|
|
7
8
|
const is_composition_still_1 = require("../helpers/is-composition-still");
|
|
8
9
|
const render_frame_1 = require("../state/render-frame");
|
|
9
10
|
const rich_timeline_1 = require("../state/rich-timeline");
|
|
@@ -15,23 +16,27 @@ const container = {
|
|
|
15
16
|
borderBottom: '1px solid black',
|
|
16
17
|
padding: 16,
|
|
17
18
|
color: 'white',
|
|
19
|
+
backgroundColor: colors_1.BACKGROUND,
|
|
18
20
|
};
|
|
19
21
|
const title = {
|
|
20
22
|
fontWeight: 'bold',
|
|
21
23
|
fontSize: 12,
|
|
22
24
|
whiteSpace: 'nowrap',
|
|
23
25
|
lineHeight: '18px',
|
|
26
|
+
backgroundColor: colors_1.BACKGROUND,
|
|
24
27
|
};
|
|
25
28
|
const subtitle = {
|
|
26
29
|
fontSize: 12,
|
|
27
30
|
opacity: 0.8,
|
|
28
31
|
whiteSpace: 'nowrap',
|
|
29
32
|
lineHeight: '18px',
|
|
33
|
+
backgroundColor: colors_1.BACKGROUND,
|
|
30
34
|
};
|
|
31
35
|
const row = {
|
|
32
36
|
display: 'flex',
|
|
33
37
|
flexDirection: 'row',
|
|
34
38
|
lineHeight: '18px',
|
|
39
|
+
backgroundColor: colors_1.BACKGROUND,
|
|
35
40
|
};
|
|
36
41
|
const targetHeight = 60;
|
|
37
42
|
const targetWidth = (targetHeight * 16) / 9;
|
|
@@ -20,6 +20,7 @@ const mute_1 = require("../state/mute");
|
|
|
20
20
|
const preview_size_1 = require("../state/preview-size");
|
|
21
21
|
const rich_timeline_1 = require("../state/rich-timeline");
|
|
22
22
|
const sidebar_1 = require("../state/sidebar");
|
|
23
|
+
const timeline_zoom_1 = require("../state/timeline-zoom");
|
|
23
24
|
const z_index_1 = require("../state/z-index");
|
|
24
25
|
const EditorContent_1 = require("./EditorContent");
|
|
25
26
|
const FramePersistor_1 = require("./FramePersistor");
|
|
@@ -29,6 +30,7 @@ const NewComposition_1 = __importDefault(require("./NewComposition/NewCompositio
|
|
|
29
30
|
const NoRegisterRoot_1 = require("./NoRegisterRoot");
|
|
30
31
|
const NotificationCenter_1 = require("./Notifications/NotificationCenter");
|
|
31
32
|
const UpdateModal_1 = require("./UpdateModal/UpdateModal");
|
|
33
|
+
const ZoomPersistor_1 = require("./ZoomPersistor");
|
|
32
34
|
const background = {
|
|
33
35
|
backgroundColor: colors_1.BACKGROUND,
|
|
34
36
|
display: 'flex',
|
|
@@ -131,7 +133,7 @@ const Editor = () => {
|
|
|
131
133
|
});
|
|
132
134
|
return () => cleanup();
|
|
133
135
|
}, [Root, waitForRoot]);
|
|
134
|
-
return ((0, jsx_runtime_1.jsx)(keybindings_1.KeybindingContextProvider, { children: (0, jsx_runtime_1.jsx)(rich_timeline_1.RichTimelineContext.Provider, { value: richTimelineCtx, children: (0, jsx_runtime_1.jsx)(checkerboard_1.CheckerboardContext.Provider, { value: checkerboardCtx, children: (0, jsx_runtime_1.jsx)(preview_size_1.PreviewSizeContext.Provider, { value: previewSizeCtx, children: (0, jsx_runtime_1.jsx)(modals_1.ModalsContext.Provider, { value: modalsContext, children: (0, jsx_runtime_1.jsx)(in_out_1.TimelineInOutContext.Provider, { value: timelineInOutContextValue, children: (0, jsx_runtime_1.jsx)(in_out_1.SetTimelineInOutContext.Provider, { value: setTimelineInOutContextValue, children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.MediaVolumeContext.Provider, { value: mediaVolumeContextValue, children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.SetMediaVolumeContext.Provider, { value: setMediaVolumeContextValue, children: (0, jsx_runtime_1.jsx)(player_1.PlayerInternals.PlayerEventEmitterContext.Provider, { value: emitter, children: (0, jsx_runtime_1.jsx)(sidebar_1.SidebarContextProvider, { children: (0, jsx_runtime_1.jsx)(folders_1.FolderContextProvider, { children: (0, jsx_runtime_1.jsx)(highest_z_index_1.HighestZIndexProvider, { children: (0, jsx_runtime_1.jsxs)(z_index_1.HigherZIndex, { onEscape: noop_1.noop, onOutsideClick: noop_1.noop, children: [(0, jsx_runtime_1.jsxs)("div", { style: background, children: [Root === null ? null : (0, jsx_runtime_1.jsx)(Root, {}), (0, jsx_runtime_1.jsxs)(remotion_1.Internals.CanUseRemotionHooksProvider, { children: [(0, jsx_runtime_1.jsx)(FramePersistor_1.FramePersistor, {}), Root === null ? ((0, jsx_runtime_1.jsx)(NoRegisterRoot_1.NoRegisterRoot, {})) : ((0, jsx_runtime_1.jsx)(EditorContent_1.EditorContent, {})), (0, jsx_runtime_1.jsx)(GlobalKeybindings_1.GlobalKeybindings, {})] })] }), (0, jsx_runtime_1.jsx)(NotificationCenter_1.NotificationCenter, {}), modalContextType &&
|
|
136
|
+
return ((0, jsx_runtime_1.jsx)(keybindings_1.KeybindingContextProvider, { children: (0, jsx_runtime_1.jsx)(rich_timeline_1.RichTimelineContext.Provider, { value: richTimelineCtx, children: (0, jsx_runtime_1.jsx)(checkerboard_1.CheckerboardContext.Provider, { value: checkerboardCtx, children: (0, jsx_runtime_1.jsx)(preview_size_1.PreviewSizeContext.Provider, { value: previewSizeCtx, children: (0, jsx_runtime_1.jsx)(modals_1.ModalsContext.Provider, { value: modalsContext, children: (0, jsx_runtime_1.jsx)(in_out_1.TimelineInOutContext.Provider, { value: timelineInOutContextValue, children: (0, jsx_runtime_1.jsx)(in_out_1.SetTimelineInOutContext.Provider, { value: setTimelineInOutContextValue, children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.MediaVolumeContext.Provider, { value: mediaVolumeContextValue, children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.SetMediaVolumeContext.Provider, { value: setMediaVolumeContextValue, children: (0, jsx_runtime_1.jsx)(player_1.PlayerInternals.PlayerEventEmitterContext.Provider, { value: emitter, children: (0, jsx_runtime_1.jsx)(sidebar_1.SidebarContextProvider, { children: (0, jsx_runtime_1.jsx)(folders_1.FolderContextProvider, { children: (0, jsx_runtime_1.jsx)(highest_z_index_1.HighestZIndexProvider, { children: (0, jsx_runtime_1.jsxs)(z_index_1.HigherZIndex, { onEscape: noop_1.noop, onOutsideClick: noop_1.noop, children: [(0, jsx_runtime_1.jsx)(timeline_zoom_1.TimelineZoomContext, { children: (0, jsx_runtime_1.jsxs)("div", { style: background, children: [Root === null ? null : (0, jsx_runtime_1.jsx)(Root, {}), (0, jsx_runtime_1.jsxs)(remotion_1.Internals.CanUseRemotionHooksProvider, { children: [(0, jsx_runtime_1.jsx)(FramePersistor_1.FramePersistor, {}), (0, jsx_runtime_1.jsx)(ZoomPersistor_1.ZoomPersistor, {}), Root === null ? ((0, jsx_runtime_1.jsx)(NoRegisterRoot_1.NoRegisterRoot, {})) : ((0, jsx_runtime_1.jsx)(EditorContent_1.EditorContent, {})), (0, jsx_runtime_1.jsx)(GlobalKeybindings_1.GlobalKeybindings, {})] })] }) }), (0, jsx_runtime_1.jsx)(NotificationCenter_1.NotificationCenter, {}), modalContextType &&
|
|
135
137
|
modalContextType.type === 'new-comp' && ((0, jsx_runtime_1.jsx)(NewComposition_1.default, { initialCompType: modalContextType.compType })), modalContextType &&
|
|
136
138
|
modalContextType.type === 'update' && ((0, jsx_runtime_1.jsx)(UpdateModal_1.UpdateModal, { info: modalContextType.info })), modalContextType &&
|
|
137
139
|
modalContextType.type === 'shortcuts' && ((0, jsx_runtime_1.jsx)(KeyboardShortcutsModal_1.KeyboardShortcuts, {}))] }) }) }) }) }) }) }) }) }) }) }) }) }) }));
|
|
@@ -5,13 +5,17 @@ const react_1 = require("react");
|
|
|
5
5
|
const remotion_1 = require("remotion");
|
|
6
6
|
const folders_1 = require("../state/folders");
|
|
7
7
|
const marks_1 = require("../state/marks");
|
|
8
|
+
const timeline_zoom_1 = require("../state/timeline-zoom");
|
|
8
9
|
const CompositionSelector_1 = require("./CompositionSelector");
|
|
9
10
|
const FramePersistor_1 = require("./FramePersistor");
|
|
11
|
+
const timeline_scroll_logic_1 = require("./Timeline/timeline-scroll-logic");
|
|
10
12
|
const TimelineInOutToggle_1 = require("./TimelineInOutToggle");
|
|
13
|
+
const ZoomPersistor_1 = require("./ZoomPersistor");
|
|
11
14
|
const useSelectComposition = () => {
|
|
12
15
|
const setCurrentFrame = remotion_1.Internals.Timeline.useTimelineSetFrame();
|
|
13
16
|
const { setCurrentComposition } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
14
17
|
const { setFoldersExpanded } = (0, react_1.useContext)(folders_1.FolderContext);
|
|
18
|
+
const { setZoom } = (0, react_1.useContext)(timeline_zoom_1.TimelineZoomCtx);
|
|
15
19
|
return (c, push) => {
|
|
16
20
|
var _a;
|
|
17
21
|
(_a = TimelineInOutToggle_1.inOutHandles.current) === null || _a === void 0 ? void 0 : _a.setMarks((0, marks_1.loadMarks)(c.id, c.durationInFrames));
|
|
@@ -19,9 +23,18 @@ const useSelectComposition = () => {
|
|
|
19
23
|
window.history.pushState({}, 'Preview', `/${c.id}`);
|
|
20
24
|
}
|
|
21
25
|
const frame = (0, FramePersistor_1.getFrameForComposition)(c.id);
|
|
26
|
+
const zoom = (0, ZoomPersistor_1.getZoomForComposition)(c.id);
|
|
22
27
|
const frameInBounds = Math.min(c.durationInFrames - 1, frame);
|
|
23
28
|
setCurrentFrame(frameInBounds);
|
|
24
29
|
setCurrentComposition(c.id);
|
|
30
|
+
setZoom(() => zoom);
|
|
31
|
+
setTimeout(() => {
|
|
32
|
+
(0, timeline_scroll_logic_1.ensureFrameIsInViewport)({
|
|
33
|
+
direction: 'center',
|
|
34
|
+
frame,
|
|
35
|
+
durationInFrames: c.durationInFrames,
|
|
36
|
+
});
|
|
37
|
+
});
|
|
25
38
|
const { folderName, parentFolderName } = c;
|
|
26
39
|
if (folderName !== null) {
|
|
27
40
|
setFoldersExpanded((ex) => {
|
|
@@ -4,6 +4,7 @@ exports.MenuToolbar = 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 colors_1 = require("../helpers/colors");
|
|
7
8
|
const pick_color_1 = require("../helpers/pick-color");
|
|
8
9
|
const Checkmark_1 = require("../icons/Checkmark");
|
|
9
10
|
const checkerboard_1 = require("../state/checkerboard");
|
|
@@ -27,6 +28,7 @@ const row = {
|
|
|
27
28
|
fontSize: 13,
|
|
28
29
|
paddingLeft: 6,
|
|
29
30
|
paddingRight: 10,
|
|
31
|
+
backgroundColor: colors_1.BACKGROUND,
|
|
30
32
|
};
|
|
31
33
|
const flex = {
|
|
32
34
|
flex: 1,
|
|
@@ -26,6 +26,6 @@ const Notification = ({ children, id, duration, created, onRemove }) => {
|
|
|
26
26
|
clearTimeout(timeout);
|
|
27
27
|
};
|
|
28
28
|
}, [created, duration, id, onRemove]);
|
|
29
|
-
return (0, jsx_runtime_1.jsx)("div", { style: notification, children: children });
|
|
29
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: "css-reset", style: notification, children: children }));
|
|
30
30
|
};
|
|
31
31
|
exports.Notification = Notification;
|
|
@@ -4,7 +4,6 @@ exports.PlayPause = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const player_1 = require("@remotion/player");
|
|
6
6
|
const react_1 = require("react");
|
|
7
|
-
const remotion_1 = require("remotion");
|
|
8
7
|
const is_current_selected_still_1 = require("../helpers/is-current-selected-still");
|
|
9
8
|
const use_keybinding_1 = require("../helpers/use-keybinding");
|
|
10
9
|
const jump_to_start_1 = require("../icons/jump-to-start");
|
|
@@ -14,15 +13,14 @@ const step_back_1 = require("../icons/step-back");
|
|
|
14
13
|
const step_forward_1 = require("../icons/step-forward");
|
|
15
14
|
const in_out_1 = require("../state/in-out");
|
|
16
15
|
const ControlButton_1 = require("./ControlButton");
|
|
16
|
+
const imperative_state_1 = require("./Timeline/imperative-state");
|
|
17
|
+
const timeline_scroll_logic_1 = require("./Timeline/timeline-scroll-logic");
|
|
17
18
|
const forwardBackStyle = {
|
|
18
19
|
height: 16,
|
|
19
20
|
color: 'white',
|
|
20
21
|
};
|
|
21
22
|
const PlayPause = ({ playbackRate, loop }) => {
|
|
22
|
-
var _a;
|
|
23
23
|
const { inFrame, outFrame } = (0, in_out_1.useTimelineInOutFramePosition)();
|
|
24
|
-
const frame = remotion_1.Internals.Timeline.useTimelinePosition();
|
|
25
|
-
const video = remotion_1.Internals.useVideo();
|
|
26
24
|
player_1.PlayerInternals.usePlayback({
|
|
27
25
|
loop,
|
|
28
26
|
playbackRate,
|
|
@@ -30,7 +28,7 @@ const PlayPause = ({ playbackRate, loop }) => {
|
|
|
30
28
|
inFrame,
|
|
31
29
|
outFrame,
|
|
32
30
|
});
|
|
33
|
-
const { playing, play, pause, pauseAndReturnToPlayStart, frameBack, seek, frameForward, isLastFrame, } = player_1.PlayerInternals.usePlayer();
|
|
31
|
+
const { playing, play, pause, pauseAndReturnToPlayStart, frameBack, seek, frameForward, isLastFrame, isFirstFrame, } = player_1.PlayerInternals.usePlayer();
|
|
34
32
|
const isStill = (0, is_current_selected_still_1.useIsStill)();
|
|
35
33
|
(0, react_1.useEffect)(() => {
|
|
36
34
|
if (isStill) {
|
|
@@ -52,37 +50,60 @@ const PlayPause = ({ playbackRate, loop }) => {
|
|
|
52
50
|
}
|
|
53
51
|
e.preventDefault();
|
|
54
52
|
}, [pauseAndReturnToPlayStart, playing]);
|
|
55
|
-
const videoFps = (_a = video === null || video === void 0 ? void 0 : video.fps) !== null && _a !== void 0 ? _a : null;
|
|
56
53
|
const onArrowLeft = (0, react_1.useCallback)((e) => {
|
|
57
|
-
if (!videoFps) {
|
|
58
|
-
return null;
|
|
59
|
-
}
|
|
60
54
|
e.preventDefault();
|
|
61
55
|
if (e.altKey) {
|
|
62
56
|
seek(0);
|
|
57
|
+
(0, timeline_scroll_logic_1.ensureFrameIsInViewport)({
|
|
58
|
+
direction: 'fit-left',
|
|
59
|
+
durationInFrames: (0, imperative_state_1.getCurrentDuration)(),
|
|
60
|
+
frame: 0,
|
|
61
|
+
});
|
|
63
62
|
}
|
|
64
63
|
else if (e.shiftKey) {
|
|
65
|
-
frameBack(
|
|
64
|
+
frameBack((0, imperative_state_1.getCurrentFps)());
|
|
65
|
+
(0, timeline_scroll_logic_1.ensureFrameIsInViewport)({
|
|
66
|
+
direction: 'fit-left',
|
|
67
|
+
durationInFrames: (0, imperative_state_1.getCurrentDuration)(),
|
|
68
|
+
frame: Math.max(0, (0, imperative_state_1.getCurrentFrame)() - (0, imperative_state_1.getCurrentFps)()),
|
|
69
|
+
});
|
|
66
70
|
}
|
|
67
71
|
else {
|
|
68
72
|
frameBack(1);
|
|
73
|
+
(0, timeline_scroll_logic_1.ensureFrameIsInViewport)({
|
|
74
|
+
direction: 'fit-left',
|
|
75
|
+
durationInFrames: (0, imperative_state_1.getCurrentDuration)(),
|
|
76
|
+
frame: Math.max(0, (0, imperative_state_1.getCurrentFrame)() - 1),
|
|
77
|
+
});
|
|
69
78
|
}
|
|
70
|
-
}, [frameBack, seek
|
|
79
|
+
}, [frameBack, seek]);
|
|
71
80
|
const onArrowRight = (0, react_1.useCallback)((e) => {
|
|
72
|
-
if (!video) {
|
|
73
|
-
return null;
|
|
74
|
-
}
|
|
75
81
|
if (e.altKey) {
|
|
76
|
-
seek(
|
|
82
|
+
seek((0, imperative_state_1.getCurrentDuration)() - 1);
|
|
83
|
+
(0, timeline_scroll_logic_1.ensureFrameIsInViewport)({
|
|
84
|
+
direction: 'fit-right',
|
|
85
|
+
durationInFrames: (0, imperative_state_1.getCurrentDuration)() - 1,
|
|
86
|
+
frame: (0, imperative_state_1.getCurrentDuration)() - 1,
|
|
87
|
+
});
|
|
77
88
|
}
|
|
78
89
|
else if (e.shiftKey) {
|
|
79
|
-
frameForward(
|
|
90
|
+
frameForward((0, imperative_state_1.getCurrentFps)());
|
|
91
|
+
(0, timeline_scroll_logic_1.ensureFrameIsInViewport)({
|
|
92
|
+
direction: 'fit-right',
|
|
93
|
+
durationInFrames: (0, imperative_state_1.getCurrentDuration)(),
|
|
94
|
+
frame: Math.min((0, imperative_state_1.getCurrentDuration)() - 1, (0, imperative_state_1.getCurrentFrame)() + (0, imperative_state_1.getCurrentFps)()),
|
|
95
|
+
});
|
|
80
96
|
}
|
|
81
97
|
else {
|
|
82
98
|
frameForward(1);
|
|
99
|
+
(0, timeline_scroll_logic_1.ensureFrameIsInViewport)({
|
|
100
|
+
direction: 'fit-right',
|
|
101
|
+
durationInFrames: (0, imperative_state_1.getCurrentDuration)(),
|
|
102
|
+
frame: (0, imperative_state_1.getCurrentFrame)() + 1,
|
|
103
|
+
});
|
|
83
104
|
}
|
|
84
105
|
e.preventDefault();
|
|
85
|
-
}, [frameForward, seek
|
|
106
|
+
}, [frameForward, seek]);
|
|
86
107
|
const oneFrameBack = (0, react_1.useCallback)(() => {
|
|
87
108
|
frameBack(1);
|
|
88
109
|
}, [frameBack]);
|
|
@@ -93,11 +114,8 @@ const PlayPause = ({ playbackRate, loop }) => {
|
|
|
93
114
|
seek(0);
|
|
94
115
|
}, [seek]);
|
|
95
116
|
const jumpToEnd = (0, react_1.useCallback)(() => {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}
|
|
99
|
-
seek(video.durationInFrames - 1);
|
|
100
|
-
}, [seek, video]);
|
|
117
|
+
seek((0, imperative_state_1.getCurrentDuration)() - 1);
|
|
118
|
+
}, [seek]);
|
|
101
119
|
const keybindings = (0, use_keybinding_1.useKeybinding)();
|
|
102
120
|
(0, react_1.useEffect)(() => {
|
|
103
121
|
const arrowLeft = keybindings.registerKeybinding({
|
|
@@ -156,7 +174,7 @@ const PlayPause = ({ playbackRate, loop }) => {
|
|
|
156
174
|
if (isStill) {
|
|
157
175
|
return null;
|
|
158
176
|
}
|
|
159
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ControlButton_1.ControlButton, { "aria-label": "Jump to beginning", title: "Jump to beginning", disabled:
|
|
177
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ControlButton_1.ControlButton, { "aria-label": "Jump to beginning", title: "Jump to beginning", disabled: isFirstFrame, onClick: jumpToStart, children: (0, jsx_runtime_1.jsx)(jump_to_start_1.JumpToStart, { style: forwardBackStyle }) }), (0, jsx_runtime_1.jsx)(ControlButton_1.ControlButton, { "aria-label": "Step back one frame", title: "Step back one frame", disabled: isFirstFrame, onClick: oneFrameBack, children: (0, jsx_runtime_1.jsx)(step_back_1.StepBack, { style: forwardBackStyle }) }), (0, jsx_runtime_1.jsx)(ControlButton_1.ControlButton, { "aria-label": playing ? 'Pause' : 'Play', title: playing ? 'Pause' : 'Play', onClick: playing ? pause : play, children: playing ? ((0, jsx_runtime_1.jsx)(pause_1.Pause, { style: {
|
|
160
178
|
height: 14,
|
|
161
179
|
width: 14,
|
|
162
180
|
color: 'white',
|
|
@@ -4,6 +4,7 @@ exports.PreviewToolbar = 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 colors_1 = require("../helpers/colors");
|
|
7
8
|
const timeline_layout_1 = require("../helpers/timeline-layout");
|
|
8
9
|
const loop_1 = require("../state/loop");
|
|
9
10
|
const CheckboardToggle_1 = require("./CheckboardToggle");
|
|
@@ -17,8 +18,8 @@ const PlaybackRateSelector_1 = require("./PlaybackRateSelector");
|
|
|
17
18
|
const PlayPause_1 = require("./PlayPause");
|
|
18
19
|
const RichTimelineToggle_1 = require("./RichTimelineToggle");
|
|
19
20
|
const SizeSelector_1 = require("./SizeSelector");
|
|
21
|
+
const TimelineZoomControls_1 = require("./Timeline/TimelineZoomControls");
|
|
20
22
|
const TimelineInOutToggle_1 = require("./TimelineInOutToggle");
|
|
21
|
-
const TimeValue_1 = require("./TimeValue");
|
|
22
23
|
const container = {
|
|
23
24
|
display: 'flex',
|
|
24
25
|
justifyContent: 'center',
|
|
@@ -27,6 +28,7 @@ const container = {
|
|
|
27
28
|
paddingBottom: 2,
|
|
28
29
|
alignItems: 'center',
|
|
29
30
|
flexDirection: 'row',
|
|
31
|
+
background: colors_1.BACKGROUND,
|
|
30
32
|
};
|
|
31
33
|
const sideContainer = {
|
|
32
34
|
width: 300,
|
|
@@ -43,6 +45,6 @@ const PreviewToolbar = () => {
|
|
|
43
45
|
const { mediaMuted } = (0, react_1.useContext)(remotion_1.Internals.MediaVolumeContext);
|
|
44
46
|
const { setMediaMuted } = (0, react_1.useContext)(remotion_1.Internals.SetMediaVolumeContext);
|
|
45
47
|
const [loop, setLoop] = (0, react_1.useState)((0, loop_1.loadLoopOption)());
|
|
46
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: container, className: "css-reset", children: [(0, jsx_runtime_1.jsxs)("div", { style: sideContainer, children: [(0, jsx_runtime_1.jsx)("div", { style: padding }), (0, jsx_runtime_1.jsx)(
|
|
48
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: container, className: "css-reset", children: [(0, jsx_runtime_1.jsxs)("div", { style: sideContainer, children: [(0, jsx_runtime_1.jsx)("div", { style: padding }), (0, jsx_runtime_1.jsx)(TimelineZoomControls_1.TimelineZoomControls, {})] }), (0, jsx_runtime_1.jsx)(layout_1.Flex, {}), (0, jsx_runtime_1.jsx)(SizeSelector_1.SizeSelector, {}), (0, jsx_runtime_1.jsx)(PlaybackRateSelector_1.PlaybackRateSelector, { setPlaybackRate: setPlaybackRate, playbackRate: playbackRate }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 2 }), (0, jsx_runtime_1.jsx)(PlayPause_1.PlayPause, { loop: loop, playbackRate: playbackRate }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 2 }), (0, jsx_runtime_1.jsx)(LoopToggle_1.LoopToggle, { loop: loop, setLoop: setLoop }), (0, jsx_runtime_1.jsx)(CheckboardToggle_1.CheckboardToggle, {}), (0, jsx_runtime_1.jsx)(RichTimelineToggle_1.RichTimelineToggle, {}), (0, jsx_runtime_1.jsx)(TimelineInOutToggle_1.TimelineInOutPointToggle, {}), (0, jsx_runtime_1.jsx)(MuteToggle_1.MuteToggle, { muted: mediaMuted, setMuted: setMediaMuted }), (0, jsx_runtime_1.jsx)(layout_1.Flex, {}), (0, jsx_runtime_1.jsxs)("div", { style: sideContainer, children: [(0, jsx_runtime_1.jsx)(layout_1.Flex, {}), (0, jsx_runtime_1.jsx)(FpsCounter_1.FpsCounter, { playbackSpeed: playbackRate }), (0, jsx_runtime_1.jsx)("div", { style: padding })] }), (0, jsx_runtime_1.jsx)(PlaybackKeyboardShortcutsManager_1.PlaybackKeyboardShortcutsManager, { setPlaybackRate: setPlaybackRate }), (0, jsx_runtime_1.jsx)(PlaybackRatePersistor_1.PlaybackRatePersistor, {})] }));
|
|
47
49
|
};
|
|
48
50
|
exports.PreviewToolbar = PreviewToolbar;
|
|
@@ -13,6 +13,7 @@ const SplitterElement = ({ children, type }) => {
|
|
|
13
13
|
(type === 'flexer' ? context.flexValue : 1 - context.flexValue) * 1000,
|
|
14
14
|
display: 'flex',
|
|
15
15
|
position: 'relative',
|
|
16
|
+
overflow: 'hidden',
|
|
16
17
|
};
|
|
17
18
|
}, [context.flexValue, type]);
|
|
18
19
|
return (0, jsx_runtime_1.jsx)("div", { style: style, children: children });
|
|
@@ -5,24 +5,28 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const remotion_1 = require("remotion");
|
|
6
6
|
const is_current_selected_still_1 = require("../helpers/is-current-selected-still");
|
|
7
7
|
const render_frame_1 = require("../state/render-frame");
|
|
8
|
+
const layout_1 = require("./layout");
|
|
8
9
|
const text = {
|
|
9
10
|
color: 'white',
|
|
10
|
-
fontSize:
|
|
11
|
+
fontSize: 18,
|
|
11
12
|
display: 'flex',
|
|
12
|
-
flexDirection: '
|
|
13
|
-
|
|
13
|
+
flexDirection: 'row',
|
|
14
|
+
alignItems: 'flex-end',
|
|
14
15
|
fontVariantNumeric: 'tabular-nums',
|
|
15
16
|
lineHeight: 1,
|
|
16
17
|
};
|
|
17
18
|
const time = {
|
|
18
19
|
display: 'inline-block',
|
|
19
|
-
fontSize:
|
|
20
|
+
fontSize: 18,
|
|
20
21
|
};
|
|
21
22
|
const frameStyle = {
|
|
22
23
|
color: '#ccc',
|
|
23
24
|
fontSize: 10,
|
|
24
25
|
fontWeight: 500,
|
|
25
26
|
};
|
|
27
|
+
const spacer = {
|
|
28
|
+
width: layout_1.SPACING_UNIT,
|
|
29
|
+
};
|
|
26
30
|
const TimeValue = () => {
|
|
27
31
|
const frame = (0, remotion_1.useCurrentFrame)();
|
|
28
32
|
const config = remotion_1.Internals.useUnsafeVideoConfig();
|
|
@@ -33,6 +37,6 @@ const TimeValue = () => {
|
|
|
33
37
|
if (isStill) {
|
|
34
38
|
return null;
|
|
35
39
|
}
|
|
36
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: text, children: [(0, jsx_runtime_1.jsx)("div", { style: time, children: (0, render_frame_1.renderFrame)(frame, config.fps) }), ' ', (0, jsx_runtime_1.jsxs)("div", { style: frameStyle, children: [frame, " ", (0, jsx_runtime_1.jsxs)("span", { style: frameStyle, children: ["(", config.fps, " fps)"] })] })] }));
|
|
40
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: text, children: [(0, jsx_runtime_1.jsx)("div", { style: time, children: (0, render_frame_1.renderFrame)(frame, config.fps) }), ' ', (0, jsx_runtime_1.jsx)("div", { style: spacer }), (0, jsx_runtime_1.jsxs)("div", { style: frameStyle, children: [frame, " ", (0, jsx_runtime_1.jsxs)("span", { style: frameStyle, children: ["(", config.fps, " fps)"] })] })] }));
|
|
37
41
|
};
|
|
38
42
|
exports.TimeValue = TimeValue;
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MaxTimelineTracksReached = exports.MAX_TIMELINE_TRACKS = void 0;
|
|
3
|
+
exports.MaxTimelineTracksReached = exports.MAX_TIMELINE_TRACKS_NOTICE_HEIGHT = exports.MAX_TIMELINE_TRACKS = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const timeline_layout_1 = require("../../helpers/timeline-layout");
|
|
6
6
|
exports.MAX_TIMELINE_TRACKS = typeof process.env.MAX_TIMELINE_TRACKS === 'undefined'
|
|
7
7
|
? 15
|
|
8
8
|
: Number(process.env.MAX_TIMELINE_TRACKS);
|
|
9
|
+
exports.MAX_TIMELINE_TRACKS_NOTICE_HEIGHT = 24;
|
|
9
10
|
const container = {
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
height: exports.MAX_TIMELINE_TRACKS_NOTICE_HEIGHT,
|
|
12
|
+
display: 'flex',
|
|
13
|
+
alignItems: 'center',
|
|
12
14
|
color: 'rgba(255, 255, 255, 0.6)',
|
|
13
15
|
fontFamily: 'sans-serif',
|
|
14
16
|
fontSize: 12,
|
|
@@ -12,18 +12,22 @@ const SplitterElement_1 = require("../Splitter/SplitterElement");
|
|
|
12
12
|
const SplitterHandle_1 = require("../Splitter/SplitterHandle");
|
|
13
13
|
const is_collapsed_1 = require("./is-collapsed");
|
|
14
14
|
const MaxTimelineTracks_1 = require("./MaxTimelineTracks");
|
|
15
|
+
const timeline_refs_1 = require("./timeline-refs");
|
|
15
16
|
const timeline_state_reducer_1 = require("./timeline-state-reducer");
|
|
16
17
|
const TimelineDragHandler_1 = require("./TimelineDragHandler");
|
|
17
18
|
const TimelineInOutPointer_1 = require("./TimelineInOutPointer");
|
|
18
19
|
const TimelineList_1 = require("./TimelineList");
|
|
20
|
+
const TimelinePlayCursorSyncer_1 = require("./TimelinePlayCursorSyncer");
|
|
21
|
+
const TimelineScrollable_1 = require("./TimelineScrollable");
|
|
19
22
|
const TimelineSlider_1 = require("./TimelineSlider");
|
|
23
|
+
const TimelineTimeIndicators_1 = require("./TimelineTimeIndicators");
|
|
20
24
|
const TimelineTracks_1 = require("./TimelineTracks");
|
|
21
25
|
const container = {
|
|
22
26
|
minHeight: '100%',
|
|
23
27
|
flex: 1,
|
|
24
28
|
display: 'flex',
|
|
25
29
|
height: 0,
|
|
26
|
-
|
|
30
|
+
overflowY: 'auto',
|
|
27
31
|
};
|
|
28
32
|
const noop = () => undefined;
|
|
29
33
|
const Timeline = () => {
|
|
@@ -61,18 +65,21 @@ const Timeline = () => {
|
|
|
61
65
|
return timeline.filter((t) => !(0, is_collapsed_1.isTrackHidden)(t, timeline, state));
|
|
62
66
|
}, [state, timeline]);
|
|
63
67
|
const shown = withoutHidden.slice(0, MaxTimelineTracks_1.MAX_TIMELINE_TRACKS);
|
|
68
|
+
const hasBeenCut = withoutHidden.length > shown.length;
|
|
64
69
|
const inner = (0, react_1.useMemo)(() => {
|
|
65
70
|
return {
|
|
66
|
-
height: shown.length * (timeline_layout_1.TIMELINE_LAYER_HEIGHT + timeline_layout_1.TIMELINE_BORDER * 2)
|
|
71
|
+
height: shown.length * (timeline_layout_1.TIMELINE_LAYER_HEIGHT + timeline_layout_1.TIMELINE_BORDER * 2) +
|
|
72
|
+
(hasBeenCut ? MaxTimelineTracks_1.MAX_TIMELINE_TRACKS_NOTICE_HEIGHT : 0) +
|
|
73
|
+
TimelineTimeIndicators_1.TIMELINE_TIME_INDICATOR_HEIGHT,
|
|
67
74
|
display: 'flex',
|
|
68
75
|
flex: 1,
|
|
69
76
|
minHeight: '100%',
|
|
70
77
|
overflowX: 'hidden',
|
|
71
78
|
};
|
|
72
|
-
}, [shown.length]);
|
|
79
|
+
}, [hasBeenCut, shown.length]);
|
|
73
80
|
if (!videoConfig) {
|
|
74
81
|
return null;
|
|
75
82
|
}
|
|
76
|
-
return ((0, jsx_runtime_1.jsx)("div", { style: container, className: "css-reset", children: (0, jsx_runtime_1.jsx)("div", { style: inner, children: (0, jsx_runtime_1.jsxs)(SplitterContainer_1.SplitterContainer, { orientation: "vertical", defaultFlex: 0.2, id: "names-to-timeline", maxFlex: 0.5, minFlex: 0.15, children: [(0, jsx_runtime_1.jsx)(SplitterElement_1.SplitterElement, { type: "flexer", children: (0, jsx_runtime_1.jsx)(TimelineList_1.TimelineList, { dispatchStateChange: dispatch, viewState: state, timeline: shown }) }), (0, jsx_runtime_1.jsx)(SplitterHandle_1.SplitterHandle, { onCollapse: noop, allowToCollapse: false }), (0, jsx_runtime_1.
|
|
83
|
+
return ((0, jsx_runtime_1.jsx)("div", { ref: timeline_refs_1.timelineVerticalScroll, style: container, className: "css-reset", children: (0, jsx_runtime_1.jsx)("div", { style: inner, children: (0, jsx_runtime_1.jsxs)(SplitterContainer_1.SplitterContainer, { orientation: "vertical", defaultFlex: 0.2, id: "names-to-timeline", maxFlex: 0.5, minFlex: 0.15, children: [(0, jsx_runtime_1.jsx)(SplitterElement_1.SplitterElement, { type: "flexer", children: (0, jsx_runtime_1.jsx)(TimelineList_1.TimelineList, { dispatchStateChange: dispatch, viewState: state, timeline: shown }) }), (0, jsx_runtime_1.jsx)(SplitterHandle_1.SplitterHandle, { onCollapse: noop, allowToCollapse: false }), (0, jsx_runtime_1.jsx)(SplitterElement_1.SplitterElement, { type: "anti-flexer", children: (0, jsx_runtime_1.jsxs)(TimelineScrollable_1.TimelineScrollable, { children: [(0, jsx_runtime_1.jsx)(TimelineTracks_1.TimelineTracks, { viewState: state, timeline: shown, fps: videoConfig.fps, hasBeenCut: hasBeenCut }), (0, jsx_runtime_1.jsx)(TimelineInOutPointer_1.TimelineInOutPointer, {}), (0, jsx_runtime_1.jsx)(TimelineDragHandler_1.TimelineDragHandler, {}), (0, jsx_runtime_1.jsx)(TimelineSlider_1.TimelineSlider, {}), (0, jsx_runtime_1.jsx)(TimelinePlayCursorSyncer_1.TimelinePlayCursorSyncer, {})] }) })] }) }) }));
|
|
77
84
|
};
|
|
78
85
|
exports.Timeline = Timeline;
|