@remotion/cli 3.1.11 → 3.2.2
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/bundle.d.ts +1 -1
- package/dist/bundle.js +3 -2
- package/dist/config/bundle-out-dir.d.ts +2 -0
- package/dist/config/bundle-out-dir.js +12 -0
- package/dist/config/enforce-audio-track.d.ts +2 -0
- package/dist/config/enforce-audio-track.js +13 -0
- package/dist/config/get-public-path.d.ts +2 -0
- package/dist/config/get-public-path.js +12 -0
- package/dist/config/index.d.ts +4 -0
- package/dist/config/index.js +8 -0
- package/dist/config/muted.d.ts +2 -0
- package/dist/config/muted.js +13 -0
- package/dist/editor/components/Editor.js +3 -1
- package/dist/editor/components/InitialCompositionLoader.js +13 -0
- package/dist/editor/components/Notifications/ServerDisconnected.d.ts +5 -0
- package/dist/editor/components/Notifications/ServerDisconnected.js +56 -0
- package/dist/editor/components/PlayPause.js +41 -23
- package/dist/editor/components/PreviewToolbar.js +2 -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 +5 -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 +2 -1
- 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/event-source.js +6 -0
- package/dist/get-cli-options.d.ts +2 -0
- package/dist/get-cli-options.js +2 -0
- package/dist/handle-common-errors.js +5 -0
- package/dist/index.d.ts +2 -0
- package/dist/parse-command-line.d.ts +2 -0
- package/dist/parse-command-line.js +8 -0
- package/dist/prepare-entry-point.d.ts +3 -2
- package/dist/prepare-entry-point.js +3 -2
- package/dist/preview-server/error-overlay/react-overlay/listen-to-runtime-errors.js +9 -1
- package/dist/preview-server/error-overlay/remotion-overlay/Button.js +1 -1
- package/dist/preview-server/error-overlay/remotion-overlay/CodeFrame.js +2 -0
- package/dist/preview-server/error-overlay/remotion-overlay/ErrorMessage.js +4 -2
- package/dist/preview-server/error-overlay/remotion-overlay/ErrorTitle.js +1 -1
- package/dist/preview-server/error-overlay/remotion-overlay/StackFrame.js +3 -1
- package/dist/preview-server/get-package-manager.d.ts +1 -0
- package/dist/preview-server/get-package-manager.js +8 -1
- package/dist/preview-server/live-events.js +4 -0
- package/dist/preview-server/routes.js +19 -2
- package/dist/preview-server/start-server.js +1 -1
- package/dist/previewEntry.js +6 -0
- package/dist/progress-bar.js +7 -2
- package/dist/render.js +3 -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/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/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/bundle.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const bundleCommand: () => Promise<void>;
|
|
1
|
+
export declare const bundleCommand: (remotionRoot: string) => Promise<void>;
|
package/dist/bundle.js
CHANGED
|
@@ -6,7 +6,7 @@ const initialize_render_cli_1 = require("./initialize-render-cli");
|
|
|
6
6
|
const log_1 = require("./log");
|
|
7
7
|
const parse_command_line_1 = require("./parse-command-line");
|
|
8
8
|
const prepare_entry_point_1 = require("./prepare-entry-point");
|
|
9
|
-
const bundleCommand = async () => {
|
|
9
|
+
const bundleCommand = async (remotionRoot) => {
|
|
10
10
|
const file = parse_command_line_1.parsedCli._[1];
|
|
11
11
|
if (!file) {
|
|
12
12
|
log_1.Log.error('No entry point specified. Pass more arguments:');
|
|
@@ -14,7 +14,7 @@ const bundleCommand = async () => {
|
|
|
14
14
|
log_1.Log.error('Documentation: https://www.remotion.dev/docs/render');
|
|
15
15
|
process.exit(1);
|
|
16
16
|
}
|
|
17
|
-
await (0, initialize_render_cli_1.initializeRenderCli)('bundle');
|
|
17
|
+
await (0, initialize_render_cli_1.initializeRenderCli)(remotionRoot, 'bundle');
|
|
18
18
|
const { publicPath, bundleOutDir } = await (0, get_cli_options_1.getCliOptions)({
|
|
19
19
|
isLambda: false,
|
|
20
20
|
type: 'get-compositions-or-bundle',
|
|
@@ -24,6 +24,7 @@ const bundleCommand = async () => {
|
|
|
24
24
|
otherSteps: [],
|
|
25
25
|
outDir: bundleOutDir,
|
|
26
26
|
publicPath,
|
|
27
|
+
remotionRoot,
|
|
27
28
|
});
|
|
28
29
|
log_1.Log.info();
|
|
29
30
|
log_1.Log.info(urlOrBundle);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setBundleOutDir = exports.getBundleOutDir = void 0;
|
|
4
|
+
let bundleOutDir = null;
|
|
5
|
+
const getBundleOutDir = () => {
|
|
6
|
+
return bundleOutDir;
|
|
7
|
+
};
|
|
8
|
+
exports.getBundleOutDir = getBundleOutDir;
|
|
9
|
+
const setBundleOutDir = (path) => {
|
|
10
|
+
bundleOutDir = path;
|
|
11
|
+
};
|
|
12
|
+
exports.setBundleOutDir = setBundleOutDir;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getEnforceAudioTrack = exports.setEnforceAudioTrack = void 0;
|
|
4
|
+
const DEFAULT_ENFORCE_AUDIO_TRACK = true;
|
|
5
|
+
let enforceAudioTrackState = DEFAULT_ENFORCE_AUDIO_TRACK;
|
|
6
|
+
const setEnforceAudioTrack = (enforceAudioTrack) => {
|
|
7
|
+
enforceAudioTrackState = enforceAudioTrack;
|
|
8
|
+
};
|
|
9
|
+
exports.setEnforceAudioTrack = setEnforceAudioTrack;
|
|
10
|
+
const getEnforceAudioTrack = () => {
|
|
11
|
+
return enforceAudioTrackState;
|
|
12
|
+
};
|
|
13
|
+
exports.getEnforceAudioTrack = getEnforceAudioTrack;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setPublicPath = exports.getPublicPath = void 0;
|
|
4
|
+
let publicPath = null;
|
|
5
|
+
const getPublicPath = () => {
|
|
6
|
+
return publicPath;
|
|
7
|
+
};
|
|
8
|
+
exports.getPublicPath = getPublicPath;
|
|
9
|
+
const setPublicPath = (path) => {
|
|
10
|
+
publicPath = path;
|
|
11
|
+
};
|
|
12
|
+
exports.setPublicPath = setPublicPath;
|
package/dist/config/index.d.ts
CHANGED
|
@@ -39,5 +39,9 @@ export declare const ConfigInternals: {
|
|
|
39
39
|
setStillFrame: (frame: number) => void;
|
|
40
40
|
getMaxTimelineTracks: () => number;
|
|
41
41
|
defaultOverrideFunction: WebpackOverrideFn;
|
|
42
|
+
setMuted: (muted: boolean) => void;
|
|
43
|
+
getMuted: () => boolean;
|
|
44
|
+
getEnforceAudioTrack: () => boolean;
|
|
45
|
+
setEnforceAudioTrack: (enforceAudioTrack: boolean) => void;
|
|
42
46
|
};
|
|
43
47
|
export declare const overrideRemotion: () => void;
|
package/dist/config/index.js
CHANGED
|
@@ -57,6 +57,7 @@ const chromium_flags_2 = require("./chromium-flags");
|
|
|
57
57
|
const codec_2 = require("./codec");
|
|
58
58
|
const concurrency_2 = require("./concurrency");
|
|
59
59
|
const crf_2 = require("./crf");
|
|
60
|
+
const enforce_audio_track_1 = require("./enforce-audio-track");
|
|
60
61
|
const env_file_2 = require("./env-file");
|
|
61
62
|
const every_nth_frame_2 = require("./every-nth-frame");
|
|
62
63
|
const ffmpeg_executable_2 = require("./ffmpeg-executable");
|
|
@@ -65,6 +66,7 @@ const image_format_2 = require("./image-format");
|
|
|
65
66
|
const image_sequence_2 = require("./image-sequence");
|
|
66
67
|
const log_1 = require("./log");
|
|
67
68
|
const max_timeline_tracks_2 = require("./max-timeline-tracks");
|
|
69
|
+
const muted_1 = require("./muted");
|
|
68
70
|
const number_of_gif_loops_2 = require("./number-of-gif-loops");
|
|
69
71
|
const output_location_2 = require("./output-location");
|
|
70
72
|
const override_webpack_2 = require("./override-webpack");
|
|
@@ -107,6 +109,8 @@ exports.Config = {
|
|
|
107
109
|
setScale: scale_2.setScale,
|
|
108
110
|
setEveryNthFrame: every_nth_frame_2.setEveryNthFrame,
|
|
109
111
|
setNumberOfGifLoops: number_of_gif_loops_2.setNumberOfGifLoops,
|
|
112
|
+
setMuted: muted_1.setMuted,
|
|
113
|
+
setEnforceAudioTrack: enforce_audio_track_1.setEnforceAudioTrack,
|
|
110
114
|
},
|
|
111
115
|
Output: {
|
|
112
116
|
setOutputLocation: output_location_2.setOutputLocation,
|
|
@@ -154,6 +158,10 @@ exports.ConfigInternals = {
|
|
|
154
158
|
setStillFrame: still_frame_1.setStillFrame,
|
|
155
159
|
getMaxTimelineTracks: max_timeline_tracks_1.getMaxTimelineTracks,
|
|
156
160
|
defaultOverrideFunction: override_webpack_1.defaultOverrideFunction,
|
|
161
|
+
setMuted: muted_1.setMuted,
|
|
162
|
+
getMuted: muted_1.getMuted,
|
|
163
|
+
getEnforceAudioTrack: enforce_audio_track_1.getEnforceAudioTrack,
|
|
164
|
+
setEnforceAudioTrack: enforce_audio_track_1.setEnforceAudioTrack,
|
|
157
165
|
};
|
|
158
166
|
const overrideRemotion = () => {
|
|
159
167
|
Object.assign(remotion_1.Config, exports.Config);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getMuted = exports.setMuted = void 0;
|
|
4
|
+
const DEFAULT_MUTED_STATE = false;
|
|
5
|
+
let mutedState = DEFAULT_MUTED_STATE;
|
|
6
|
+
const setMuted = (muted) => {
|
|
7
|
+
mutedState = muted;
|
|
8
|
+
};
|
|
9
|
+
exports.setMuted = setMuted;
|
|
10
|
+
const getMuted = () => {
|
|
11
|
+
return mutedState;
|
|
12
|
+
};
|
|
13
|
+
exports.getMuted = getMuted;
|
|
@@ -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) => {
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ServerDisconnected = exports.serverDisconnectedRef = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const container = {
|
|
7
|
+
position: 'fixed',
|
|
8
|
+
justifyContent: 'flex-end',
|
|
9
|
+
alignItems: 'flex-start',
|
|
10
|
+
display: 'flex',
|
|
11
|
+
width: '100%',
|
|
12
|
+
height: '100%',
|
|
13
|
+
flexDirection: 'column',
|
|
14
|
+
padding: 30,
|
|
15
|
+
pointerEvents: 'none',
|
|
16
|
+
backgroundColor: 'transparent',
|
|
17
|
+
fontFamily: 'SF Pro, Arial, Helvetica, sans-serif',
|
|
18
|
+
};
|
|
19
|
+
const message = {
|
|
20
|
+
backgroundColor: '#e74c3c',
|
|
21
|
+
color: 'white',
|
|
22
|
+
paddingLeft: 20,
|
|
23
|
+
paddingRight: 20,
|
|
24
|
+
paddingTop: 12,
|
|
25
|
+
paddingBottom: 12,
|
|
26
|
+
borderRadius: 4,
|
|
27
|
+
boxShadow: '0 2px 4px rgba(0, 0, 0, 0.4)',
|
|
28
|
+
lineHeight: 1.5,
|
|
29
|
+
};
|
|
30
|
+
const inlineCode = {
|
|
31
|
+
fontSize: 16,
|
|
32
|
+
fontFamily: 'monospace',
|
|
33
|
+
};
|
|
34
|
+
exports.serverDisconnectedRef = (0, react_1.createRef)();
|
|
35
|
+
let pageIsGoingToReload = false;
|
|
36
|
+
window.addEventListener('beforeunload', () => {
|
|
37
|
+
pageIsGoingToReload = true;
|
|
38
|
+
});
|
|
39
|
+
const ServerDisconnected = () => {
|
|
40
|
+
const [serverDisconnected, setServerDisconnected] = (0, react_1.useState)(false);
|
|
41
|
+
(0, react_1.useImperativeHandle)(exports.serverDisconnectedRef, () => {
|
|
42
|
+
return {
|
|
43
|
+
setServerDisconnected: () => {
|
|
44
|
+
setServerDisconnected(true);
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
}, []);
|
|
48
|
+
if (!serverDisconnected) {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
if (pageIsGoingToReload) {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: container, className: "css-reset", children: (0, jsx_runtime_1.jsxs)("div", { style: message, children: ["The preview server has disconnected. ", (0, jsx_runtime_1.jsx)("br", {}), window.remotion_previewServerCommand ? ((0, jsx_runtime_1.jsxs)("span", { children: ["Run", ' ', (0, jsx_runtime_1.jsx)("code", { style: inlineCode, children: window.remotion_previewServerCommand }), ' ', "to run it again."] })) : ((0, jsx_runtime_1.jsx)("span", { children: "Fast refresh will not work." }))] }) }));
|
|
55
|
+
};
|
|
56
|
+
exports.ServerDisconnected = ServerDisconnected;
|
|
@@ -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',
|
|
@@ -18,8 +18,8 @@ const PlaybackRateSelector_1 = require("./PlaybackRateSelector");
|
|
|
18
18
|
const PlayPause_1 = require("./PlayPause");
|
|
19
19
|
const RichTimelineToggle_1 = require("./RichTimelineToggle");
|
|
20
20
|
const SizeSelector_1 = require("./SizeSelector");
|
|
21
|
+
const TimelineZoomControls_1 = require("./Timeline/TimelineZoomControls");
|
|
21
22
|
const TimelineInOutToggle_1 = require("./TimelineInOutToggle");
|
|
22
|
-
const TimeValue_1 = require("./TimeValue");
|
|
23
23
|
const container = {
|
|
24
24
|
display: 'flex',
|
|
25
25
|
justifyContent: 'center',
|
|
@@ -45,6 +45,6 @@ const PreviewToolbar = () => {
|
|
|
45
45
|
const { mediaMuted } = (0, react_1.useContext)(remotion_1.Internals.MediaVolumeContext);
|
|
46
46
|
const { setMediaMuted } = (0, react_1.useContext)(remotion_1.Internals.SetMediaVolumeContext);
|
|
47
47
|
const [loop, setLoop] = (0, react_1.useState)((0, loop_1.loadLoopOption)());
|
|
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)(
|
|
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, {})] }));
|
|
49
49
|
};
|
|
50
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;
|