@remotion/studio 4.0.503 → 4.0.505
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/api/install-package.d.ts +2 -1
- package/dist/api/install-package.js +6 -2
- package/dist/components/AssetSelectorItem.js +4 -16
- package/dist/components/AudioWaveform.d.ts +1 -1
- package/dist/components/AudioWaveform.js +36 -3
- package/dist/components/Canvas.js +12 -5
- package/dist/components/CheckboardToggle.js +3 -1
- package/dist/components/CompositionContextButton.d.ts +1 -1
- package/dist/components/CompositionContextButton.js +2 -2
- package/dist/components/CompositionSelector.js +2 -2
- package/dist/components/CompositionSelectorItem.js +6 -7
- package/dist/components/ContextMenu.d.ts +5 -7
- package/dist/components/ContextMenu.js +54 -21
- package/dist/components/ControlButton.d.ts +4 -2
- package/dist/components/ControlButton.js +6 -20
- package/dist/components/EditorContent.js +1 -1
- package/dist/components/EditorGuides/Guide.js +2 -2
- package/dist/components/EffectPickerModal.js +70 -9
- package/dist/components/FullscreenToggle.js +1 -2
- package/dist/components/InitialCompositionLoader.js +1 -14
- package/dist/components/InlineAction.d.ts +3 -4
- package/dist/components/InlineAction.js +16 -13
- package/dist/components/InlineDropdown.d.ts +3 -2
- package/dist/components/InlineDropdown.js +16 -5
- package/dist/components/InspectorPanel/CompositionMetadata.js +7 -6
- package/dist/components/InspectorPanel/ConnectedCompositionsSection.js +2 -2
- package/dist/components/InspectorPanel/KeyframeInspector.js +2 -3
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +1 -1
- package/dist/components/InspectorPanel/common.js +24 -34
- package/dist/components/InspectorPanel/styles.js +4 -0
- package/dist/components/InspectorSequenceSection.js +1 -1
- package/dist/components/LoopToggle.js +1 -1
- package/dist/components/Menu/MenuItem.js +16 -12
- package/dist/components/MenuBuildIndicator.d.ts +3 -1
- package/dist/components/MenuBuildIndicator.js +14 -59
- package/dist/components/MenuCompositionName.js +3 -63
- package/dist/components/MenuToolbar.js +23 -3
- package/dist/components/MobilePanel.d.ts +1 -2
- package/dist/components/MobilePanel.js +6 -10
- package/dist/components/MuteToggle.js +2 -1
- package/dist/components/NewComposition/ComboBox.d.ts +1 -0
- package/dist/components/NewComposition/ComboBox.js +2 -2
- package/dist/components/NewComposition/InputDragger.d.ts +5 -0
- package/dist/components/NewComposition/InputDragger.js +11 -6
- package/dist/components/NewComposition/MenuContent.d.ts +1 -1
- package/dist/components/NewComposition/menu-typeahead.d.ts +1 -1
- package/dist/components/Notifications/NotificationCenter.js +12 -2
- package/dist/components/OutlineToggle.js +10 -2
- package/dist/components/PlayPause.js +2 -6
- package/dist/components/PlaybackRateSelector.js +4 -9
- package/dist/components/PreviewToolbar.js +12 -8
- package/dist/components/PreviewToolbarOverflowButton.d.ts +0 -1
- package/dist/components/PreviewToolbarOverflowButton.js +2 -75
- package/dist/components/QuickSwitcher/QuickSwitcherContent.js +1 -2
- package/dist/components/RenderButton.d.ts +1 -1
- package/dist/components/RenderButton.js +55 -37
- package/dist/components/RenderModal/FrameRangeSetting.js +6 -1
- package/dist/components/RenderModal/MultiRangeSlider.js +8 -8
- package/dist/components/RenderModal/RenderModalEnvironmentVariables.js +1 -9
- package/dist/components/RenderModal/RenderModalOutputName.js +11 -2
- package/dist/components/RenderModal/ServerRenderModal.js +2 -17
- package/dist/components/RenderModal/WebRenderModal.js +3 -17
- package/dist/components/RenderModal/layout.js +7 -5
- package/dist/components/RenderModal/render-modals.js +18 -15
- package/dist/components/RenderQueue/RenderQueueRepeat.js +1 -14
- package/dist/components/SelectedOutlineElement.js +13 -22
- package/dist/components/SelectedOutlineOverlay.js +5 -1
- package/dist/components/SidebarRenderButton.js +1 -15
- package/dist/components/SizeSelector.js +4 -9
- package/dist/components/SnappingToggle.js +1 -2
- package/dist/components/Spinner.d.ts +1 -0
- package/dist/components/Spinner.js +2 -2
- package/dist/components/Splitter/SplitterContainer.d.ts +1 -0
- package/dist/components/Splitter/SplitterContainer.js +4 -1
- package/dist/components/Splitter/SplitterContext.d.ts +4 -3
- package/dist/components/Splitter/SplitterContext.js +3 -2
- package/dist/components/Splitter/SplitterElement.js +6 -1
- package/dist/components/Splitter/SplitterHandle.js +1 -0
- package/dist/components/Tabs/vertical.d.ts +1 -0
- package/dist/components/Tabs/vertical.js +8 -10
- package/dist/components/TimeValue.js +26 -8
- package/dist/components/Timeline/Timeline.js +5 -5
- package/dist/components/Timeline/TimelineClipboardKeybindings.js +3 -6
- package/dist/components/Timeline/TimelineDeleteKeybindings.js +5 -7
- package/dist/components/Timeline/TimelineDragHandler.js +3 -0
- package/dist/components/Timeline/TimelineEffectItem.js +6 -2
- package/dist/components/Timeline/TimelineEffectPropItem.js +6 -3
- package/dist/components/Timeline/TimelineExpandedKeyframeRow.d.ts +6 -6
- package/dist/components/Timeline/TimelineExpandedKeyframeRow.js +34 -2
- package/dist/components/Timeline/TimelineHeightContainer.d.ts +1 -0
- package/dist/components/Timeline/TimelineHeightContainer.js +2 -2
- package/dist/components/Timeline/TimelineInOutDragHandler.js +3 -3
- package/dist/components/Timeline/TimelineKeyframeEasingLine.d.ts +5 -3
- package/dist/components/Timeline/TimelineKeyframeEasingLine.js +32 -30
- package/dist/components/Timeline/TimelineList.d.ts +1 -0
- package/dist/components/Timeline/TimelineList.js +2 -3
- package/dist/components/Timeline/TimelineScaleField.js +1 -1
- package/dist/components/Timeline/TimelineSelection.js +2 -3
- package/dist/components/Timeline/TimelineSequence.js +34 -28
- package/dist/components/Timeline/TimelineSequenceItem.d.ts +3 -3
- package/dist/components/Timeline/TimelineSequenceItem.js +34 -23
- package/dist/components/Timeline/TimelineSequencePropItem.d.ts +10 -2
- package/dist/components/Timeline/TimelineSequencePropItem.js +64 -12
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +2 -2
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +38 -5
- package/dist/components/Timeline/TimelineTimeIndicators.js +36 -3
- package/dist/components/Timeline/TimelineVideoInfo.d.ts +1 -1
- package/dist/components/Timeline/TimelineVideoInfo.js +36 -3
- package/dist/components/Timeline/TimelineZoomControls.d.ts +3 -1
- package/dist/components/Timeline/TimelineZoomControls.js +59 -20
- package/dist/components/Timeline/use-expanded-track-keyframe-rows.js +2 -3
- package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.d.ts +1 -1
- package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.js +7 -18
- package/dist/components/Timeline/use-timeline-asset-drop.js +3 -3
- package/dist/components/Timeline/use-timeline-height.d.ts +2 -1
- package/dist/components/Timeline/use-timeline-height.js +3 -2
- package/dist/components/TimelineCombobox.d.ts +11 -0
- package/dist/components/TimelineCombobox.js +181 -0
- package/dist/components/TimelineInOutToggle.js +3 -3
- package/dist/components/TopPanel.js +8 -8
- package/dist/components/UndoRedoButtons.js +6 -5
- package/dist/components/UpdateCheck.js +18 -5
- package/dist/components/UpdateModal/UpdateModal.js +35 -12
- package/dist/components/composition-menu-items.d.ts +2 -4
- package/dist/components/composition-menu-items.js +31 -54
- package/dist/components/import-assets.d.ts +2 -1
- package/dist/components/import-assets.js +1 -1
- package/dist/components/selected-outline-types.d.ts +1 -1
- package/dist/esm/{chunk-bj1r1hh5.js → chunk-7pgk8h5m.js} +9174 -8486
- package/dist/esm/internals.mjs +9174 -8486
- package/dist/esm/previewEntry.mjs +8991 -8303
- package/dist/esm/renderEntry.mjs +1 -1
- package/dist/helpers/hoverable.d.ts +11 -0
- package/dist/helpers/hoverable.js +70 -0
- package/dist/helpers/inject-css.js +43 -23
- package/dist/helpers/install-required-package.d.ts +3 -2
- package/dist/helpers/install-required-package.js +20 -15
- package/dist/helpers/use-is-fullscreen.d.ts +1 -0
- package/dist/helpers/use-is-fullscreen.js +25 -0
- package/dist/helpers/use-menu-structure.js +88 -59
- package/dist/icons/audio.d.ts +1 -1
- package/dist/icons/audio.js +1 -1
- package/dist/icons/canvas-zoom.d.ts +10 -0
- package/dist/icons/canvas-zoom.js +21 -0
- package/dist/icons/caret.js +1 -1
- package/dist/icons/certificate.d.ts +1 -1
- package/dist/icons/certificate.js +1 -1
- package/dist/icons/data.d.ts +1 -1
- package/dist/icons/data.js +2 -2
- package/dist/icons/effects.d.ts +5 -0
- package/dist/icons/effects.js +8 -0
- package/dist/icons/ellipsis.js +1 -1
- package/dist/icons/external-link.d.ts +5 -0
- package/dist/icons/external-link.js +10 -0
- package/dist/icons/fullscreen.js +1 -1
- package/dist/icons/gear.d.ts +1 -1
- package/dist/icons/gear.js +1 -1
- package/dist/icons/gif.d.ts +1 -1
- package/dist/icons/gif.js +1 -1
- package/dist/icons/input-props.d.ts +2 -0
- package/dist/icons/input-props.js +9 -0
- package/dist/icons/jump-to-start.js +2 -2
- package/dist/icons/magnet.d.ts +3 -1
- package/dist/icons/magnet.js +2 -2
- package/dist/icons/media-volume.d.ts +6 -2
- package/dist/icons/media-volume.js +8 -6
- package/dist/icons/minus.d.ts +3 -1
- package/dist/icons/minus.js +2 -2
- package/dist/icons/pause.js +1 -1
- package/dist/icons/play.js +1 -1
- package/dist/icons/playback-rate.d.ts +5 -0
- package/dist/icons/playback-rate.js +31 -0
- package/dist/icons/plus.js +1 -1
- package/dist/icons/redo.js +2 -2
- package/dist/icons/search.d.ts +5 -0
- package/dist/icons/search.js +10 -0
- package/dist/icons/step-back.js +2 -2
- package/dist/icons/step-forward.js +2 -2
- package/dist/icons/timelineInOutPointer.js +2 -2
- package/dist/icons/undo.js +2 -2
- package/package.json +12 -12
|
@@ -1,8 +1,41 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
36
|
exports.TimelineTimeIndicators = exports.getTimelineTickScale = exports.getNiceSecondInterval = exports.TimelineTimePadding = exports.TimelineTimePlaceholders = exports.TIMELINE_TIME_INDICATOR_HEIGHT = void 0;
|
|
4
37
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 = require("react");
|
|
38
|
+
const react_1 = __importStar(require("react"));
|
|
6
39
|
const remotion_1 = require("remotion");
|
|
7
40
|
const colors_1 = require("../../helpers/colors");
|
|
8
41
|
const timeline_layout_1 = require("../../helpers/timeline-layout");
|
|
@@ -171,7 +204,7 @@ const TimelineTimeIndicators = () => {
|
|
|
171
204
|
return (jsx_runtime_1.jsx(TimelineTimeIndicatorsInner, { durationInFrames: video.durationInFrames, fps: video.fps, windowWidth: sliderTrack }));
|
|
172
205
|
};
|
|
173
206
|
exports.TimelineTimeIndicators = TimelineTimeIndicators;
|
|
174
|
-
const TimelineTimeIndicatorsInner = ({ windowWidth, durationInFrames, fps }) => {
|
|
207
|
+
const TimelineTimeIndicatorsInner = react_1.default.memo(({ windowWidth, durationInFrames, fps }) => {
|
|
175
208
|
const ref = (0, react_1.useRef)(null);
|
|
176
209
|
(0, react_1.useEffect)(() => {
|
|
177
210
|
const currentRef = ref.current;
|
|
@@ -271,4 +304,4 @@ const TimelineTimeIndicatorsInner = ({ windowWidth, durationInFrames, fps }) =>
|
|
|
271
304
|
return (jsx_runtime_1.jsx("div", { ref: ref, style: style, children: ticks.map((t) => {
|
|
272
305
|
return (jsx_runtime_1.jsx("div", { style: t.style, children: t.showTime ? (jsx_runtime_1.jsx("div", { style: tickLabel, children: (0, render_frame_1.renderFrame)(t.frame, fps) })) : null }, t.frame));
|
|
273
306
|
}) }));
|
|
274
|
-
};
|
|
307
|
+
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { LoopDisplay } from 'remotion';
|
|
3
|
-
export declare const TimelineVideoInfo: React.
|
|
3
|
+
export declare const TimelineVideoInfo: React.NamedExoticComponent<{
|
|
4
4
|
readonly src: string;
|
|
5
5
|
readonly visualizationWidth: number;
|
|
6
6
|
readonly naturalWidth: number;
|
|
@@ -1,9 +1,42 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
36
|
exports.TimelineVideoInfo = void 0;
|
|
4
37
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
38
|
const timeline_utils_1 = require("@remotion/timeline-utils");
|
|
6
|
-
const react_1 = require("react");
|
|
39
|
+
const react_1 = __importStar(require("react"));
|
|
7
40
|
const remotion_1 = require("remotion");
|
|
8
41
|
const colors_1 = require("../../helpers/colors");
|
|
9
42
|
const timeline_layout_1 = require("../../helpers/timeline-layout");
|
|
@@ -26,7 +59,7 @@ const filmstripContainerStyle = {
|
|
|
26
59
|
fontFamily: 'Arial, Helvetica',
|
|
27
60
|
};
|
|
28
61
|
const MAX_FROZEN_FRAME_CACHE_DEVIATION = timeline_utils_1.WEBCODECS_TIMESCALE * 0.05;
|
|
29
|
-
const
|
|
62
|
+
const TimelineVideoInfoInner = ({ src, visualizationWidth, naturalWidth, startMediaFrom, mediaFrameAtSequenceZero, sequenceFrameOffset, durationInFrames, playbackRate, volume, doesVolumeChange, premountWidth, postmountWidth, loopDisplay, frozenMediaFrame, extendLastFrame, }) => {
|
|
30
63
|
const { fps } = (0, remotion_1.useVideoConfig)();
|
|
31
64
|
const ref = (0, react_1.useRef)(null);
|
|
32
65
|
const [error, setError] = (0, react_1.useState)(null);
|
|
@@ -338,4 +371,4 @@ const TimelineVideoInfo = ({ src, visualizationWidth, naturalWidth, startMediaFr
|
|
|
338
371
|
jsx_runtime_1.jsx("div", { ref: ref, style: filmstripStyle }), jsx_runtime_1.jsx("div", { style: audioStyle, children: jsx_runtime_1.jsx(AudioWaveform_1.AudioWaveform, { src: src, height: timeline_layout_1.TIMELINE_VIDEO_INFO_WAVEFORM_HEIGHT, visualizationWidth: audioWidth, startFrom: mediaStartFrame, durationInFrames: durationInFrames, volume: volume, doesVolumeChange: doesVolumeChange, playbackRate: playbackRate, loopDisplay: loopDisplay }) })
|
|
339
372
|
] }));
|
|
340
373
|
};
|
|
341
|
-
exports.TimelineVideoInfo =
|
|
374
|
+
exports.TimelineVideoInfo = react_1.default.memo(TimelineVideoInfoInner);
|
|
@@ -1,13 +1,45 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
36
|
exports.TimelineZoomControls = void 0;
|
|
4
37
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 = require("react");
|
|
38
|
+
const react_1 = __importStar(require("react"));
|
|
6
39
|
const remotion_1 = require("remotion");
|
|
7
40
|
const colors_1 = require("../../helpers/colors");
|
|
8
41
|
const is_current_selected_still_1 = require("../../helpers/is-current-selected-still");
|
|
9
|
-
const
|
|
10
|
-
const plus_1 = require("../../icons/plus");
|
|
42
|
+
const canvas_zoom_1 = require("../../icons/canvas-zoom");
|
|
11
43
|
const timeline_zoom_1 = require("../../state/timeline-zoom");
|
|
12
44
|
const z_index_1 = require("../../state/z-index");
|
|
13
45
|
const ControlButton_1 = require("../ControlButton");
|
|
@@ -21,35 +53,43 @@ const container = {
|
|
|
21
53
|
const buttonStyle = {
|
|
22
54
|
fontSize: 24,
|
|
23
55
|
};
|
|
24
|
-
const
|
|
25
|
-
color: colors_1.WHITE,
|
|
26
|
-
width: 14,
|
|
27
|
-
};
|
|
28
|
-
const TimelineZoomControls = () => {
|
|
56
|
+
const TimelineZoomSlider = ({ maxWidth }) => {
|
|
29
57
|
var _a;
|
|
30
58
|
const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
31
59
|
const { setZoom, zoom: zoomMap } = (0, react_1.useContext)(timeline_zoom_1.TimelineZoomCtx);
|
|
32
60
|
const { tabIndex } = (0, z_index_1.useZIndex)();
|
|
33
|
-
const
|
|
61
|
+
const isStill = (0, is_current_selected_still_1.useIsStill)();
|
|
62
|
+
const onChange = (0, react_1.useCallback)((e) => {
|
|
34
63
|
if (canvasContent === null || canvasContent.type !== 'composition') {
|
|
35
64
|
return;
|
|
36
65
|
}
|
|
37
|
-
setZoom(canvasContent.compositionId, (
|
|
66
|
+
setZoom(canvasContent.compositionId, () => Number(e.target.value), {
|
|
67
|
+
anchorFrame: null,
|
|
68
|
+
anchorContentX: null,
|
|
69
|
+
});
|
|
38
70
|
}, [canvasContent, setZoom]);
|
|
39
|
-
|
|
71
|
+
if (isStill ||
|
|
72
|
+
canvasContent === null ||
|
|
73
|
+
canvasContent.type !== 'composition') {
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
const zoom = (_a = zoomMap[canvasContent.compositionId]) !== null && _a !== void 0 ? _a : timeline_zoom_1.TIMELINE_MIN_ZOOM;
|
|
77
|
+
return (jsx_runtime_1.jsx("input", { style: maxWidth === undefined ? undefined : { maxWidth }, title: `Timeline zoom (${zoom}x)`, alt: `Timeline zoom (${zoom}x)`, type: "range", min: timeline_zoom_1.TIMELINE_MIN_ZOOM, step: 0.1, value: zoom, max: timeline_zoom_1.TIMELINE_MAX_ZOOM, onChange: onChange, className: "__remotion-timeline-slider", tabIndex: tabIndex }));
|
|
78
|
+
};
|
|
79
|
+
const TimelineZoomControlsInner = ({ sliderMaxWidth }) => {
|
|
80
|
+
const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
81
|
+
const { setZoom } = (0, react_1.useContext)(timeline_zoom_1.TimelineZoomCtx);
|
|
82
|
+
const onMinusClicked = (0, react_1.useCallback)(() => {
|
|
40
83
|
if (canvasContent === null || canvasContent.type !== 'composition') {
|
|
41
84
|
return;
|
|
42
85
|
}
|
|
43
|
-
setZoom(canvasContent.compositionId, (z) => Math.
|
|
86
|
+
setZoom(canvasContent.compositionId, (z) => Math.max(timeline_zoom_1.TIMELINE_MIN_ZOOM, z - 0.2), { anchorFrame: null, anchorContentX: null });
|
|
44
87
|
}, [canvasContent, setZoom]);
|
|
45
|
-
const
|
|
88
|
+
const onPlusClicked = (0, react_1.useCallback)(() => {
|
|
46
89
|
if (canvasContent === null || canvasContent.type !== 'composition') {
|
|
47
90
|
return;
|
|
48
91
|
}
|
|
49
|
-
setZoom(canvasContent.compositionId, () =>
|
|
50
|
-
anchorFrame: null,
|
|
51
|
-
anchorContentX: null,
|
|
52
|
-
});
|
|
92
|
+
setZoom(canvasContent.compositionId, (z) => Math.min(timeline_zoom_1.TIMELINE_MAX_ZOOM, z + 0.2), { anchorFrame: null, anchorContentX: null });
|
|
53
93
|
}, [canvasContent, setZoom]);
|
|
54
94
|
const isStill = (0, is_current_selected_still_1.useIsStill)();
|
|
55
95
|
if (isStill ||
|
|
@@ -57,9 +97,8 @@ const TimelineZoomControls = () => {
|
|
|
57
97
|
canvasContent.type !== 'composition') {
|
|
58
98
|
return null;
|
|
59
99
|
}
|
|
60
|
-
const zoom = (_a = zoomMap[canvasContent.compositionId]) !== null && _a !== void 0 ? _a : timeline_zoom_1.TIMELINE_MIN_ZOOM;
|
|
61
100
|
return (jsx_runtime_1.jsxs("div", { style: container, children: [
|
|
62
|
-
jsx_runtime_1.jsx(ControlButton_1.ControlButton, { onClick: onMinusClicked, style: buttonStyle, title: "Zoom out timeline", role: 'ControlButton', type: "button",
|
|
101
|
+
jsx_runtime_1.jsx(ControlButton_1.ControlButton, { onClick: onMinusClicked, style: buttonStyle, title: "Zoom out timeline", role: 'ControlButton', type: "button", children: (color) => jsx_runtime_1.jsx(canvas_zoom_1.CanvasZoomOutIcon, { color: color }) }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }), jsx_runtime_1.jsx(TimelineZoomSlider, { maxWidth: sliderMaxWidth }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }), jsx_runtime_1.jsx(ControlButton_1.ControlButton, { onClick: onPlusClicked, style: buttonStyle, title: "Zoom in timeline", role: 'button', type: "button", children: (color) => jsx_runtime_1.jsx(canvas_zoom_1.CanvasZoomIcon, { color: color }) })
|
|
63
102
|
] }));
|
|
64
103
|
};
|
|
65
|
-
exports.TimelineZoomControls =
|
|
104
|
+
exports.TimelineZoomControls = react_1.default.memo(TimelineZoomControlsInner);
|
|
@@ -8,6 +8,7 @@ const timeline_layout_1 = require("../../helpers/timeline-layout");
|
|
|
8
8
|
const timeline_node_path_key_1 = require("../../helpers/timeline-node-path-key");
|
|
9
9
|
const ExpandedTracksProvider_1 = require("../ExpandedTracksProvider");
|
|
10
10
|
const get_node_keyframes_1 = require("./get-node-keyframes");
|
|
11
|
+
const imperative_state_1 = require("./imperative-state");
|
|
11
12
|
const timeline_expanded_filter_1 = require("./timeline-expanded-filter");
|
|
12
13
|
const TimelineSelection_1 = require("./TimelineSelection");
|
|
13
14
|
const getNodeCanEditEasing = ({ node, nodePath, propStatuses, }) => {
|
|
@@ -36,7 +37,6 @@ const useExpandedTrackKeyframeRows = ({ sequence, nodePathInfo, keyframeDisplayO
|
|
|
36
37
|
const { propStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesContext);
|
|
37
38
|
const { getDragOverrides, getEffectDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeDragOverridesContext);
|
|
38
39
|
const { selectedItems } = (0, TimelineSelection_1.useTimelineSelection)();
|
|
39
|
-
const timelinePosition = remotion_1.Internals.Timeline.useTimelinePosition();
|
|
40
40
|
const tree = (0, react_1.useMemo)(() => (0, timeline_layout_1.buildTimelineTree)({
|
|
41
41
|
sequence,
|
|
42
42
|
nodePathInfo,
|
|
@@ -89,7 +89,7 @@ const useExpandedTrackKeyframeRows = ({ sequence, nodePathInfo, keyframeDisplayO
|
|
|
89
89
|
keyframeDisplayOffset,
|
|
90
90
|
getDragOverrides,
|
|
91
91
|
getEffectDragOverrides,
|
|
92
|
-
timelinePosition,
|
|
92
|
+
timelinePosition: (0, imperative_state_1.getCurrentFrame)(),
|
|
93
93
|
}),
|
|
94
94
|
])), [
|
|
95
95
|
flat,
|
|
@@ -98,7 +98,6 @@ const useExpandedTrackKeyframeRows = ({ sequence, nodePathInfo, keyframeDisplayO
|
|
|
98
98
|
keyframeDisplayOffset,
|
|
99
99
|
nodePathInfo.sequenceSubscriptionKey,
|
|
100
100
|
propStatuses,
|
|
101
|
-
timelinePosition,
|
|
102
101
|
]);
|
|
103
102
|
const rows = (0, react_1.useMemo)(() => flat.map(({ node }) => {
|
|
104
103
|
var _a;
|
|
@@ -11,7 +11,7 @@ export declare const calculateSequenceFreezeFrame: ({ sequence, sequenceFrameOff
|
|
|
11
11
|
readonly sequenceFrameOffset: number;
|
|
12
12
|
readonly timelinePosition: number;
|
|
13
13
|
}) => number;
|
|
14
|
-
export declare const
|
|
14
|
+
export declare const getSequenceFreezeFrameMenuItem: ({ clientId, nodePath, propStatusesForOverride, sequence, sequenceFrameOffset, setPropStatuses, timelinePosition, validatedSource, }: {
|
|
15
15
|
readonly clientId: string | null;
|
|
16
16
|
readonly nodePath: SequencePropsSubscriptionKey | null;
|
|
17
17
|
readonly propStatusesForOverride: Record<string, CanUpdateSequencePropStatus> | undefined;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
const react_1 = require("react");
|
|
3
|
+
exports.getSequenceFreezeFrameMenuItem = exports.calculateSequenceFreezeFrame = exports.isSequenceVisibleAtTimelinePosition = exports.shouldShowFreezeFrameMenuItem = void 0;
|
|
5
4
|
const save_sequence_prop_1 = require("./save-sequence-prop");
|
|
6
5
|
const shouldShowFreezeFrameMenuItem = (sequence) => {
|
|
7
6
|
return sequence.type !== 'audio';
|
|
@@ -21,7 +20,7 @@ const calculateSequenceFreezeFrame = ({ sequence, sequenceFrameOffset, timelineP
|
|
|
21
20
|
return Math.min(Math.max(minFrame, rawFreezeFrame), maxFrame);
|
|
22
21
|
};
|
|
23
22
|
exports.calculateSequenceFreezeFrame = calculateSequenceFreezeFrame;
|
|
24
|
-
const
|
|
23
|
+
const getSequenceFreezeFrameMenuItem = ({ clientId, nodePath, propStatusesForOverride, sequence, sequenceFrameOffset, setPropStatuses, timelinePosition, validatedSource, }) => {
|
|
25
24
|
const freezeStatus = propStatusesForOverride === null || propStatusesForOverride === void 0 ? void 0 : propStatusesForOverride.freeze;
|
|
26
25
|
const isFrozen = (freezeStatus === null || freezeStatus === void 0 ? void 0 : freezeStatus.status) === 'static' &&
|
|
27
26
|
typeof freezeStatus.codeValue === 'number';
|
|
@@ -33,7 +32,7 @@ const useSequenceFreezeFrameMenuItem = ({ clientId, nodePath, propStatusesForOve
|
|
|
33
32
|
freezeStatus !== undefined &&
|
|
34
33
|
freezeStatus !== null &&
|
|
35
34
|
freezeStatus.status === 'static';
|
|
36
|
-
const onToggleFreezeFrame = (
|
|
35
|
+
const onToggleFreezeFrame = () => {
|
|
37
36
|
if (!canToggleFreeze ||
|
|
38
37
|
!sequence.controls ||
|
|
39
38
|
nodePath === null ||
|
|
@@ -65,18 +64,8 @@ const useSequenceFreezeFrameMenuItem = ({ clientId, nodePath, propStatusesForOve
|
|
|
65
64
|
undoLabel: remove ? 'Unfreeze sequence' : 'Freeze sequence',
|
|
66
65
|
redoLabel: remove ? 'Freeze sequence again' : 'Unfreeze sequence again',
|
|
67
66
|
});
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
clientId,
|
|
71
|
-
isFrozen,
|
|
72
|
-
nodePath,
|
|
73
|
-
sequence,
|
|
74
|
-
sequenceFrameOffset,
|
|
75
|
-
setPropStatuses,
|
|
76
|
-
timelinePosition,
|
|
77
|
-
validatedSource,
|
|
78
|
-
]);
|
|
79
|
-
return (0, react_1.useMemo)(() => (0, exports.shouldShowFreezeFrameMenuItem)(sequence)
|
|
67
|
+
};
|
|
68
|
+
return (0, exports.shouldShowFreezeFrameMenuItem)(sequence)
|
|
80
69
|
? {
|
|
81
70
|
type: 'item',
|
|
82
71
|
id: 'toggle-freeze-frame',
|
|
@@ -89,6 +78,6 @@ const useSequenceFreezeFrameMenuItem = ({ clientId, nodePath, propStatusesForOve
|
|
|
89
78
|
subMenu: null,
|
|
90
79
|
value: 'toggle-freeze-frame',
|
|
91
80
|
}
|
|
92
|
-
: null
|
|
81
|
+
: null;
|
|
93
82
|
};
|
|
94
|
-
exports.
|
|
83
|
+
exports.getSequenceFreezeFrameMenuItem = getSequenceFreezeFrameMenuItem;
|
|
@@ -11,6 +11,7 @@ const effect_drag_and_drop_1 = require("../effect-drag-and-drop");
|
|
|
11
11
|
const handle_drop_1 = require("../handle-drop");
|
|
12
12
|
const NotificationCenter_1 = require("../Notifications/NotificationCenter");
|
|
13
13
|
const SvgImportDialog_1 = require("../SvgImportDialog");
|
|
14
|
+
const imperative_state_1 = require("./imperative-state");
|
|
14
15
|
const timeline_refs_1 = require("./timeline-refs");
|
|
15
16
|
const timeline_scroll_logic_1 = require("./timeline-scroll-logic");
|
|
16
17
|
const use_resolved_stack_1 = require("./use-resolved-stack");
|
|
@@ -28,7 +29,6 @@ const useTimelineAssetDrop = () => {
|
|
|
28
29
|
var _a, _b;
|
|
29
30
|
const { canvasContent, compositions } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
30
31
|
const videoConfig = remotion_1.Internals.useUnsafeVideoConfig();
|
|
31
|
-
const timelinePosition = remotion_1.Internals.Timeline.useTimelinePosition();
|
|
32
32
|
const chooseSvgImportMode = (0, SvgImportDialog_1.useSvgImportDialog)();
|
|
33
33
|
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
34
34
|
const [isAddingAsset, setIsAddingAsset] = (0, react_1.useState)(false);
|
|
@@ -65,8 +65,8 @@ const useTimelineAssetDrop = () => {
|
|
|
65
65
|
timelineLeft: scrollable.getBoundingClientRect().left,
|
|
66
66
|
timelineWidth: scrollable.scrollWidth,
|
|
67
67
|
})
|
|
68
|
-
:
|
|
69
|
-
}, [
|
|
68
|
+
: (0, imperative_state_1.getCurrentFrame)();
|
|
69
|
+
}, [videoConfig]);
|
|
70
70
|
const onAssetDragOver = (0, react_1.useCallback)((event) => {
|
|
71
71
|
const timeline = timeline_refs_1.timelineVerticalScroll.current;
|
|
72
72
|
const { dataTransfer } = event;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { TimelineTrackData } from '../../helpers/get-timeline-sequence-sort-key';
|
|
2
|
-
export declare const useTimelineHeight: ({ shown, hasBeenCut, }: {
|
|
2
|
+
export declare const useTimelineHeight: ({ shown, hasBeenCut, isStill, }: {
|
|
3
3
|
shown: TimelineTrackData[];
|
|
4
4
|
hasBeenCut: boolean;
|
|
5
|
+
isStill: boolean;
|
|
5
6
|
}) => number;
|
|
@@ -11,7 +11,7 @@ const MaxTimelineTracks_1 = require("./MaxTimelineTracks");
|
|
|
11
11
|
const timeline_expanded_filter_1 = require("./timeline-expanded-filter");
|
|
12
12
|
const TimelineSelection_1 = require("./TimelineSelection");
|
|
13
13
|
const TimelineTimeIndicators_1 = require("./TimelineTimeIndicators");
|
|
14
|
-
const useTimelineHeight = ({ shown, hasBeenCut, }) => {
|
|
14
|
+
const useTimelineHeight = ({ shown, hasBeenCut, isStill, }) => {
|
|
15
15
|
const { getIsExpanded } = (0, react_1.useContext)(ExpandedTracksProvider_1.ExpandedTracksGetterContext);
|
|
16
16
|
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
17
17
|
const { propStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesContext);
|
|
@@ -70,10 +70,11 @@ const useTimelineHeight = ({ shown, hasBeenCut, }) => {
|
|
|
70
70
|
return (tracksHeight +
|
|
71
71
|
timeline_layout_1.TIMELINE_ITEM_BORDER_BOTTOM +
|
|
72
72
|
(hasBeenCut ? MaxTimelineTracks_1.MAX_TIMELINE_TRACKS_NOTICE_HEIGHT : 0) +
|
|
73
|
-
TimelineTimeIndicators_1.TIMELINE_TIME_INDICATOR_HEIGHT);
|
|
73
|
+
(isStill ? 0 : TimelineTimeIndicators_1.TIMELINE_TIME_INDICATOR_HEIGHT));
|
|
74
74
|
}, [
|
|
75
75
|
shown,
|
|
76
76
|
hasBeenCut,
|
|
77
|
+
isStill,
|
|
77
78
|
previewServerConnected,
|
|
78
79
|
getIsExpanded,
|
|
79
80
|
propStatuses,
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { RenderInlineAction } from './InlineAction';
|
|
3
|
+
import type { ComboboxValue } from './NewComposition/ComboBox';
|
|
4
|
+
export declare const TimelineCombobox: React.FC<{
|
|
5
|
+
readonly values: ComboboxValue[];
|
|
6
|
+
readonly selectedId: string | number;
|
|
7
|
+
readonly title: string;
|
|
8
|
+
readonly labelWidth?: number;
|
|
9
|
+
readonly renderLeftItem?: RenderInlineAction;
|
|
10
|
+
readonly unhoveredIconColor?: string;
|
|
11
|
+
}>;
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.TimelineCombobox = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const player_1 = require("@remotion/player");
|
|
9
|
+
const react_1 = require("react");
|
|
10
|
+
const react_dom_1 = __importDefault(require("react-dom"));
|
|
11
|
+
const colors_1 = require("../helpers/colors");
|
|
12
|
+
const mobile_layout_1 = require("../helpers/mobile-layout");
|
|
13
|
+
const noop_1 = require("../helpers/noop");
|
|
14
|
+
const caret_1 = require("../icons/caret");
|
|
15
|
+
const z_index_1 = require("../state/z-index");
|
|
16
|
+
const layout_1 = require("./layout");
|
|
17
|
+
const is_menu_item_1 = require("./Menu/is-menu-item");
|
|
18
|
+
const portals_1 = require("./Menu/portals");
|
|
19
|
+
const styles_1 = require("./Menu/styles");
|
|
20
|
+
const MenuContent_1 = require("./NewComposition/MenuContent");
|
|
21
|
+
const container = {
|
|
22
|
+
boxSizing: 'border-box',
|
|
23
|
+
border: 'none',
|
|
24
|
+
borderRadius: 3,
|
|
25
|
+
height: 24,
|
|
26
|
+
padding: '0 4px',
|
|
27
|
+
fontFamily: 'inherit',
|
|
28
|
+
maxWidth: '100%',
|
|
29
|
+
};
|
|
30
|
+
const label = {
|
|
31
|
+
flex: 'none',
|
|
32
|
+
overflow: 'hidden',
|
|
33
|
+
textOverflow: 'ellipsis',
|
|
34
|
+
fontFamily: 'inherit',
|
|
35
|
+
fontSize: 12,
|
|
36
|
+
lineHeight: '16px',
|
|
37
|
+
color: colors_1.WHITE_ALPHA_80,
|
|
38
|
+
minWidth: 0,
|
|
39
|
+
textAlign: 'left',
|
|
40
|
+
whiteSpace: 'nowrap',
|
|
41
|
+
};
|
|
42
|
+
const TimelineCombobox = ({ values, selectedId, title, labelWidth = 32, renderLeftItem, unhoveredIconColor = colors_1.LIGHT_TEXT, }) => {
|
|
43
|
+
const [hovered, setIsHovered] = (0, react_1.useState)(false);
|
|
44
|
+
const [opened, setOpened] = (0, react_1.useState)(false);
|
|
45
|
+
const ref = (0, react_1.useRef)(null);
|
|
46
|
+
const { tabIndex, currentZIndex } = (0, z_index_1.useZIndex)();
|
|
47
|
+
const size = player_1.PlayerInternals.useElementSize(ref, {
|
|
48
|
+
triggerOnWindowResize: true,
|
|
49
|
+
shouldApplyCssTransforms: true,
|
|
50
|
+
});
|
|
51
|
+
const refresh = size === null || size === void 0 ? void 0 : size.refresh;
|
|
52
|
+
const onHide = (0, react_1.useCallback)(() => {
|
|
53
|
+
setOpened(false);
|
|
54
|
+
}, []);
|
|
55
|
+
const onOverlayPointerDown = (0, react_1.useCallback)((e) => {
|
|
56
|
+
e.stopPropagation();
|
|
57
|
+
}, []);
|
|
58
|
+
(0, react_1.useEffect)(() => {
|
|
59
|
+
const { current } = ref;
|
|
60
|
+
if (!current) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
const onMouseEnter = () => setIsHovered(true);
|
|
64
|
+
const onMouseLeave = () => setIsHovered(false);
|
|
65
|
+
const onPointerDown = (e) => {
|
|
66
|
+
e.stopPropagation();
|
|
67
|
+
return setOpened((isOpened) => {
|
|
68
|
+
if (!isOpened) {
|
|
69
|
+
refresh === null || refresh === void 0 ? void 0 : refresh();
|
|
70
|
+
}
|
|
71
|
+
return !isOpened;
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
const onClick = (e) => {
|
|
75
|
+
e.stopPropagation();
|
|
76
|
+
const isKeyboardInitiated = e.detail === 0;
|
|
77
|
+
if (!isKeyboardInitiated) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
return setOpened((isOpened) => {
|
|
81
|
+
if (!isOpened) {
|
|
82
|
+
refresh === null || refresh === void 0 ? void 0 : refresh();
|
|
83
|
+
window.addEventListener('pointerup', (evt) => {
|
|
84
|
+
if (!(0, is_menu_item_1.isMenuItem)(evt.target)) {
|
|
85
|
+
setOpened(false);
|
|
86
|
+
}
|
|
87
|
+
}, { once: true });
|
|
88
|
+
}
|
|
89
|
+
return !isOpened;
|
|
90
|
+
});
|
|
91
|
+
};
|
|
92
|
+
current.addEventListener('mouseenter', onMouseEnter);
|
|
93
|
+
current.addEventListener('mouseleave', onMouseLeave);
|
|
94
|
+
current.addEventListener('pointerdown', onPointerDown);
|
|
95
|
+
current.addEventListener('click', onClick);
|
|
96
|
+
return () => {
|
|
97
|
+
current.removeEventListener('mouseenter', onMouseEnter);
|
|
98
|
+
current.removeEventListener('mouseleave', onMouseLeave);
|
|
99
|
+
current.removeEventListener('pointerdown', onPointerDown);
|
|
100
|
+
current.removeEventListener('click', onClick);
|
|
101
|
+
};
|
|
102
|
+
}, [refresh]);
|
|
103
|
+
const spaceToBottom = (0, react_1.useMemo)(() => {
|
|
104
|
+
const margin = 10;
|
|
105
|
+
if (size && opened) {
|
|
106
|
+
return size.windowSize.height - (size.top + size.height) - margin;
|
|
107
|
+
}
|
|
108
|
+
return 0;
|
|
109
|
+
}, [opened, size]);
|
|
110
|
+
const spaceToTop = (0, react_1.useMemo)(() => {
|
|
111
|
+
const margin = 10;
|
|
112
|
+
if (size && opened) {
|
|
113
|
+
return size.top - margin;
|
|
114
|
+
}
|
|
115
|
+
return 0;
|
|
116
|
+
}, [opened, size]);
|
|
117
|
+
const derivedMaxHeight = (0, react_1.useMemo)(() => {
|
|
118
|
+
return spaceToTop > spaceToBottom ? spaceToTop : spaceToBottom;
|
|
119
|
+
}, [spaceToBottom, spaceToTop]);
|
|
120
|
+
const isMobileLayout = (0, mobile_layout_1.useMobileLayout)();
|
|
121
|
+
const portalStyle = (0, react_1.useMemo)(() => {
|
|
122
|
+
if (!opened || !size) {
|
|
123
|
+
return null;
|
|
124
|
+
}
|
|
125
|
+
const spaceToRight = size.windowSize.width - size.left;
|
|
126
|
+
const spaceToLeft = size.left + size.width;
|
|
127
|
+
const minSpaceRequired = isMobileLayout
|
|
128
|
+
? styles_1.MAX_MOBILE_MENU_WIDTH
|
|
129
|
+
: styles_1.MAX_MENU_WIDTH;
|
|
130
|
+
const verticalLayout = spaceToTop > spaceToBottom ? 'bottom' : 'top';
|
|
131
|
+
const canOpenOnLeft = spaceToLeft >= minSpaceRequired;
|
|
132
|
+
const canOpenOnRight = spaceToRight >= minSpaceRequired;
|
|
133
|
+
const horizontalLayout = canOpenOnRight ? 'left' : 'right';
|
|
134
|
+
return {
|
|
135
|
+
...(verticalLayout === 'top'
|
|
136
|
+
? {
|
|
137
|
+
...styles_1.menuContainerTowardsBottom,
|
|
138
|
+
top: size.top + size.height,
|
|
139
|
+
}
|
|
140
|
+
: {
|
|
141
|
+
...styles_1.menuContainerTowardsTop,
|
|
142
|
+
bottom: size.windowSize.height - size.top,
|
|
143
|
+
}),
|
|
144
|
+
...(horizontalLayout === 'left'
|
|
145
|
+
? { left: size.left }
|
|
146
|
+
: canOpenOnLeft
|
|
147
|
+
? { right: size.windowSize.width - size.left - size.width }
|
|
148
|
+
: { left: 0 }),
|
|
149
|
+
};
|
|
150
|
+
}, [isMobileLayout, opened, size, spaceToBottom, spaceToTop]);
|
|
151
|
+
const selected = values.find((value) => value.id === selectedId);
|
|
152
|
+
const style = (0, react_1.useMemo)(() => {
|
|
153
|
+
return {
|
|
154
|
+
...container,
|
|
155
|
+
userSelect: 'none',
|
|
156
|
+
WebkitUserSelect: 'none',
|
|
157
|
+
display: 'inline-flex',
|
|
158
|
+
flexDirection: 'row',
|
|
159
|
+
alignItems: 'center',
|
|
160
|
+
backgroundColor: (0, colors_1.getBackgroundFromHoverState)({
|
|
161
|
+
hovered,
|
|
162
|
+
selected: opened,
|
|
163
|
+
}),
|
|
164
|
+
};
|
|
165
|
+
}, [hovered, opened]);
|
|
166
|
+
const foregroundColor = hovered || opened ? colors_1.WHITE : colors_1.WHITE_ALPHA_80;
|
|
167
|
+
const labelStyle = (0, react_1.useMemo)(() => {
|
|
168
|
+
return {
|
|
169
|
+
...label,
|
|
170
|
+
width: labelWidth,
|
|
171
|
+
color: foregroundColor,
|
|
172
|
+
};
|
|
173
|
+
}, [foregroundColor, labelWidth]);
|
|
174
|
+
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
175
|
+
jsx_runtime_1.jsxs("button", { ref: ref, title: title, "aria-label": title, tabIndex: tabIndex, type: "button", style: style, className: is_menu_item_1.MENU_INITIATOR_CLASSNAME, children: [renderLeftItem ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [renderLeftItem(foregroundColor), jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 })
|
|
176
|
+
] })) : null, selected ? (jsx_runtime_1.jsx("div", { title: typeof selected.label === 'string' ? selected.label : undefined, style: labelStyle, children: selected.label })) : null, jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }), jsx_runtime_1.jsx(caret_1.CaretDown, { color: hovered || opened ? colors_1.WHITE : unhoveredIconColor })
|
|
177
|
+
] }), portalStyle
|
|
178
|
+
? react_dom_1.default.createPortal(jsx_runtime_1.jsx("div", { style: styles_1.fullScreenOverlay, onPointerDown: onOverlayPointerDown, children: jsx_runtime_1.jsx("div", { style: styles_1.outerPortal, className: "css-reset", children: jsx_runtime_1.jsx(z_index_1.HigherZIndex, { onOutsideClick: onHide, onEscape: onHide, children: jsx_runtime_1.jsx("div", { style: portalStyle, children: jsx_runtime_1.jsx(MenuContent_1.MenuContent, { onNextMenu: noop_1.noop, onPreviousMenu: noop_1.noop, values: values, onHide: onHide, leaveLeftSpace: true, preselectIndex: values.findIndex((value) => selected && value.id === selected.id), topItemCanBeUnselected: false, fixedHeight: derivedMaxHeight }) }) }) }) }), (0, portals_1.getPortal)(currentZIndex))
|
|
179
|
+
: null] }));
|
|
180
|
+
};
|
|
181
|
+
exports.TimelineCombobox = TimelineCombobox;
|
|
@@ -19,8 +19,8 @@ const getTooltipText = (pointType, key) => [
|
|
|
19
19
|
.filter(no_react_1.NoReactInternals.truthy)
|
|
20
20
|
.join(' ');
|
|
21
21
|
const style = {
|
|
22
|
-
width:
|
|
23
|
-
height:
|
|
22
|
+
width: 17,
|
|
23
|
+
height: 17,
|
|
24
24
|
};
|
|
25
25
|
exports.inOutHandles = (0, react_1.createRef)();
|
|
26
26
|
exports.defaultInOutValue = { inFrame: null, outFrame: null };
|
|
@@ -239,7 +239,7 @@ const TimelineInOutPointToggle = () => {
|
|
|
239
239
|
};
|
|
240
240
|
}, [confId, onInMark, onInOutClear, onOutMark]);
|
|
241
241
|
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
242
|
-
jsx_runtime_1.jsx(ControlButton_1.ControlButton, { title: getTooltipText('In', 'I'), "aria-label": getTooltipText('In', 'I'), onClick: onInMark, onContextMenu: clearInMark, disabled: !videoConfig || isFirstFrame, children: jsx_runtime_1.jsx(timelineInOutPointer_1.TimelineInPointer, { color: inFrame === null ?
|
|
242
|
+
jsx_runtime_1.jsx(ControlButton_1.ControlButton, { title: getTooltipText('In', 'I'), "aria-label": getTooltipText('In', 'I'), onClick: onInMark, onContextMenu: clearInMark, disabled: !videoConfig || isFirstFrame, children: (color) => (jsx_runtime_1.jsx(timelineInOutPointer_1.TimelineInPointer, { color: inFrame === null ? color : colors_1.BLUE, style: style })) }), jsx_runtime_1.jsx(ControlButton_1.ControlButton, { title: getTooltipText('Out', 'O'), "aria-label": getTooltipText('Out', 'O'), onClick: onOutMark, onContextMenu: clearOutMark, disabled: !videoConfig || isLastFrame, children: (color) => (jsx_runtime_1.jsx(timelineInOutPointer_1.TimelineOutPointer, { color: outFrame === null ? color : colors_1.BLUE, style: style })) })
|
|
243
243
|
] }));
|
|
244
244
|
};
|
|
245
245
|
exports.TimelineInOutPointToggle = TimelineInOutPointToggle;
|