@remotion/studio 4.0.504 → 4.0.506
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 -3
- package/dist/api/install-package.js +1 -3
- package/dist/api/visual-control.d.ts +3 -0
- package/dist/api/visual-control.js +3 -0
- package/dist/components/AssetSelectorItem.js +3 -3
- package/dist/components/AudioWaveform.d.ts +1 -1
- package/dist/components/AudioWaveform.js +36 -3
- package/dist/components/Canvas.js +2 -0
- package/dist/components/CompositionContextButton.d.ts +1 -1
- package/dist/components/CompositionContextButton.js +2 -2
- package/dist/components/CompositionSelector.js +3 -3
- package/dist/components/CompositionSelectorItem.js +5 -5
- package/dist/components/ConfigureDefaultEditorModal.d.ts +3 -1
- package/dist/components/ConfigureDefaultEditorModal.js +90 -32
- package/dist/components/ConfigureLicenseModal.d.ts +2 -1
- package/dist/components/ConfigureLicenseModal.js +40 -32
- package/dist/components/ConfirmationDialog.js +2 -2
- package/dist/components/ContextMenu.d.ts +5 -7
- package/dist/components/ContextMenu.js +54 -21
- package/dist/components/Editor.js +2 -0
- package/dist/components/EditorGuides/Guide.js +2 -2
- package/dist/components/EffectPickerModal.js +3 -3
- package/dist/components/GlobalKeybindings.js +3 -2
- package/dist/components/InlineAction.d.ts +1 -1
- package/dist/components/InlineAction.js +14 -13
- package/dist/components/InlineCaptionInspector.d.ts +2 -2
- package/dist/components/InlineDropdown.d.ts +4 -2
- package/dist/components/InlineDropdown.js +23 -6
- package/dist/components/InspectorOpenInEditor.d.ts +1 -0
- package/dist/components/InspectorOpenInEditor.js +33 -9
- package/dist/components/InspectorPanel/AlignmentControls.js +5 -2
- package/dist/components/InspectorPanel/CompositionInspector.js +15 -1
- package/dist/components/InspectorPanel/ConnectedCompositionsSection.js +3 -3
- package/dist/components/InspectorPanel/EasingInspector.js +7 -4
- package/dist/components/InspectorPanel/KeyframeInspector.js +5 -1
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +1 -1
- package/dist/components/InspectorPanel/common.d.ts +1 -0
- package/dist/components/InspectorPanel/common.js +25 -35
- package/dist/components/InspectorPanel/use-composition-actions.js +4 -1
- package/dist/components/InspectorSequenceSection.js +5 -5
- package/dist/components/InstallPackage.js +1 -1
- package/dist/components/Menu/MenuItem.js +16 -12
- package/dist/components/MenuBuildIndicator.js +12 -58
- package/dist/components/MenuCompositionName.js +3 -63
- package/dist/components/MenuToolbar.js +22 -2
- package/dist/components/ModalFooter.d.ts +1 -0
- package/dist/components/ModalFooter.js +6 -2
- package/dist/components/ModalHeader.js +1 -1
- package/dist/components/Modals.js +18 -7
- package/dist/components/ModalsProvider.js +5 -6
- package/dist/components/NewComposition/CodemodFooter.js +1 -1
- package/dist/components/NewComposition/DismissableModal.js +1 -1
- package/dist/components/NewComposition/InputDragger.d.ts +1 -0
- package/dist/components/NewComposition/InputDragger.js +5 -4
- package/dist/components/NewComposition/MenuContent.d.ts +1 -1
- package/dist/components/NewComposition/RenameStaticFile.js +1 -1
- package/dist/components/NewComposition/menu-typeahead.d.ts +1 -1
- package/dist/components/OverrideInputProps.js +1 -1
- package/dist/components/PlayPause.js +3 -2
- package/dist/components/PlaybackKeyboardShortcutsManager.js +7 -5
- package/dist/components/PlaybackRateSelector.js +3 -9
- package/dist/components/PreviewToolbar.js +7 -4
- package/dist/components/PreviewToolbarOverflowButton.js +4 -2
- package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +1 -1
- package/dist/components/QuickSwitcher/QuickSwitcherContent.js +1 -1
- package/dist/components/RenderButton.d.ts +3 -2
- package/dist/components/RenderButton.js +95 -43
- package/dist/components/RenderModal/RenderStatusModal.js +1 -1
- package/dist/components/RenderModal/ServerRenderModal.js +1 -1
- package/dist/components/RenderModal/WebRenderModal.js +3 -2
- package/dist/components/RenderQueue/RenderQueueError.js +1 -1
- package/dist/components/RenderQueue/RenderQueueItemStatus.js +1 -1
- package/dist/components/RenderQueue/RenderQueueProgressMessage.js +1 -1
- package/dist/components/RenderQueue/RenderQueueRepeat.js +1 -1
- package/dist/components/SelectedOutlineElement.js +10 -11
- package/dist/components/SelectedOutlineOverlay.js +67 -20
- package/dist/components/SettingsModal.d.ts +7 -0
- package/dist/components/SettingsModal.js +50 -0
- package/dist/components/SettingsModalFooter.d.ts +4 -0
- package/dist/components/SettingsModalFooter.js +46 -0
- package/dist/components/SidebarRenderButton.js +1 -1
- package/dist/components/SizeSelector.js +3 -9
- package/dist/components/SvgImportDialog.js +2 -2
- package/dist/components/TimeValue.js +1 -1
- package/dist/components/Timeline/Timeline.js +5 -4
- package/dist/components/Timeline/TimelineAssetField.js +1 -1
- package/dist/components/Timeline/TimelineDragHandler.js +6 -3
- package/dist/components/Timeline/TimelineEffectItem.js +6 -2
- package/dist/components/Timeline/TimelineEffectPropItem.js +11 -6
- package/dist/components/Timeline/TimelineExpandedKeyframeRow.d.ts +6 -6
- package/dist/components/Timeline/TimelineExpandedKeyframeRow.js +32 -1
- package/dist/components/Timeline/TimelineExpandedRow.d.ts +4 -2
- package/dist/components/Timeline/TimelineExpandedRow.js +2 -2
- package/dist/components/Timeline/TimelineFontFamilyField.js +3 -1
- 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/TimelineKeyframeControls.js +1 -0
- package/dist/components/Timeline/TimelineKeyframeEasingLine.d.ts +4 -2
- package/dist/components/Timeline/TimelineKeyframeEasingLine.js +30 -28
- 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 +1 -0
- package/dist/components/Timeline/TimelineSequence.js +34 -28
- package/dist/components/Timeline/TimelineSequenceItem.d.ts +3 -3
- package/dist/components/Timeline/TimelineSequenceItem.js +61 -56
- 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 +39 -6
- 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 +2 -2
- package/dist/components/Timeline/TimelineZoomControls.js +39 -12
- package/dist/components/Timeline/reset-selected-timeline-props.js +1 -1
- package/dist/components/Timeline/should-subscribe-to-sequence-props.d.ts +1 -1
- package/dist/components/Timeline/timeline-asset-link.d.ts +2 -2
- package/dist/components/Timeline/timeline-asset-link.js +2 -2
- package/dist/components/Timeline/use-expanded-track-keyframe-rows.js +4 -0
- 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 +1 -0
- package/dist/components/Timeline/use-timeline-expanded-tree.d.ts +1 -0
- package/dist/components/Timeline/use-timeline-expanded-tree.js +5 -0
- package/dist/components/Timeline/use-timeline-height.d.ts +2 -1
- package/dist/components/Timeline/use-timeline-height.js +23 -2
- package/dist/components/TimelineCombobox.d.ts +11 -0
- package/dist/components/TimelineCombobox.js +181 -0
- package/dist/components/TimelineInOutToggle.js +5 -1
- package/dist/components/TopPanel.js +22 -7
- package/dist/components/UpdateCheck.js +1 -1
- package/dist/components/effect-drag-and-drop.js +1 -1
- package/dist/components/handle-drop.d.ts +2 -1
- package/dist/components/handle-drop.js +12 -2
- package/dist/components/import-assets.d.ts +18 -6
- package/dist/components/import-assets.js +76 -32
- package/dist/components/selected-outline-types.d.ts +1 -1
- package/dist/esm/{chunk-43m68z1k.js → chunk-b49ec3nz.js} +12436 -11482
- package/dist/esm/internals.mjs +12436 -11482
- package/dist/esm/previewEntry.mjs +9671 -8717
- package/dist/esm/renderEntry.mjs +1 -1
- package/dist/helpers/client-id.d.ts +3 -1
- package/dist/helpers/client-id.js +21 -4
- package/dist/helpers/hoverable.d.ts +11 -0
- package/dist/helpers/hoverable.js +70 -0
- package/dist/helpers/inject-css.js +3 -0
- package/dist/helpers/install-required-package.d.ts +3 -3
- package/dist/helpers/install-required-package.js +1 -6
- package/dist/helpers/studio-fit-padding.d.ts +1 -1
- package/dist/helpers/studio-fit-padding.js +1 -1
- package/dist/helpers/timeline-layout.d.ts +2 -1
- package/dist/helpers/timeline-layout.js +5 -2
- 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 +26 -43
- package/dist/helpers/use-runtime-values.d.ts +11 -0
- package/dist/helpers/use-runtime-values.js +76 -0
- package/dist/icons/apps.d.ts +2 -0
- package/dist/icons/apps.js +7 -0
- package/dist/icons/browse-elements.d.ts +4 -0
- package/dist/icons/browse-elements.js +10 -0
- package/dist/icons/canvas-zoom.d.ts +10 -0
- package/dist/icons/canvas-zoom.js +21 -0
- package/dist/icons/playback-rate.d.ts +5 -0
- package/dist/icons/playback-rate.js +31 -0
- package/dist/icons/search.d.ts +5 -0
- package/dist/icons/search.js +10 -0
- package/dist/state/modals.d.ts +5 -6
- package/dist/state/modals.js +5 -3
- package/package.json +12 -12
|
@@ -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,9 +53,6 @@ const container = {
|
|
|
21
53
|
const buttonStyle = {
|
|
22
54
|
fontSize: 24,
|
|
23
55
|
};
|
|
24
|
-
const iconStyle = {
|
|
25
|
-
width: 14,
|
|
26
|
-
};
|
|
27
56
|
const TimelineZoomSlider = ({ maxWidth }) => {
|
|
28
57
|
var _a;
|
|
29
58
|
const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
@@ -47,10 +76,9 @@ const TimelineZoomSlider = ({ maxWidth }) => {
|
|
|
47
76
|
const zoom = (_a = zoomMap[canvasContent.compositionId]) !== null && _a !== void 0 ? _a : timeline_zoom_1.TIMELINE_MIN_ZOOM;
|
|
48
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 }));
|
|
49
78
|
};
|
|
50
|
-
const
|
|
51
|
-
var _a;
|
|
79
|
+
const TimelineZoomControlsInner = ({ sliderMaxWidth }) => {
|
|
52
80
|
const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
53
|
-
const { setZoom
|
|
81
|
+
const { setZoom } = (0, react_1.useContext)(timeline_zoom_1.TimelineZoomCtx);
|
|
54
82
|
const onMinusClicked = (0, react_1.useCallback)(() => {
|
|
55
83
|
if (canvasContent === null || canvasContent.type !== 'composition') {
|
|
56
84
|
return;
|
|
@@ -69,9 +97,8 @@ const TimelineZoomControls = ({ sliderMaxWidth }) => {
|
|
|
69
97
|
canvasContent.type !== 'composition') {
|
|
70
98
|
return null;
|
|
71
99
|
}
|
|
72
|
-
const zoom = (_a = zoomMap[canvasContent.compositionId]) !== null && _a !== void 0 ? _a : timeline_zoom_1.TIMELINE_MIN_ZOOM;
|
|
73
100
|
return (jsx_runtime_1.jsxs("div", { style: container, children: [
|
|
74
|
-
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 }) })
|
|
75
102
|
] }));
|
|
76
103
|
};
|
|
77
|
-
exports.TimelineZoomControls =
|
|
104
|
+
exports.TimelineZoomControls = react_1.default.memo(TimelineZoomControlsInner);
|
|
@@ -71,7 +71,7 @@ const getTimelinePropResetTargets = ({ selections, sequences, overrideIdsToNodeP
|
|
|
71
71
|
const sequencePropStatus = remotion_1.Internals.getPropStatusesCtx(propStatuses, nodePath);
|
|
72
72
|
const { merged: sequenceValuesDotNotation } = remotion_1.Internals.computeEffectiveSchemaValuesDotNotation({
|
|
73
73
|
schema: sequence.controls.schema,
|
|
74
|
-
currentValue: sequence.controls.
|
|
74
|
+
currentValue: sequence.controls.runtimeValues.getSnapshot(),
|
|
75
75
|
overrideValues: {},
|
|
76
76
|
propStatus: sequencePropStatus,
|
|
77
77
|
frame: null,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { TSequence } from 'remotion';
|
|
2
2
|
export declare const shouldSubscribeToSequenceProps: (sequence: TSequence, previewConnected: boolean) => sequence is TSequence & {
|
|
3
|
-
readonly controls: import("remotion").
|
|
3
|
+
readonly controls: import("remotion").SequenceRegistrationControls;
|
|
4
4
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SequenceRegistrationControls } from 'remotion';
|
|
2
2
|
type LinkInfo = {
|
|
3
3
|
kind: 'local';
|
|
4
4
|
assetPath: string;
|
|
@@ -13,7 +13,7 @@ export declare const splitRemoteSourceForMiddleEllipsis: (src: string) => {
|
|
|
13
13
|
leading: string;
|
|
14
14
|
trailing: string;
|
|
15
15
|
};
|
|
16
|
-
export declare const getTimelineAssetSrcFromSchema: (controls:
|
|
16
|
+
export declare const getTimelineAssetSrcFromSchema: (controls: SequenceRegistrationControls | null, runtimeValues?: Readonly<Record<string, unknown>> | undefined) => string | null;
|
|
17
17
|
export declare const getTimelineAssetLinkInfo: (src: string) => LinkInfo;
|
|
18
18
|
export declare const openTimelineAssetLink: (linkInfo: TimelineAssetLinkInfo, selectAsset: (asset: string) => void) => void;
|
|
19
19
|
export {};
|
|
@@ -21,11 +21,11 @@ const splitRemoteSourceForMiddleEllipsis = (src) => {
|
|
|
21
21
|
};
|
|
22
22
|
};
|
|
23
23
|
exports.splitRemoteSourceForMiddleEllipsis = splitRemoteSourceForMiddleEllipsis;
|
|
24
|
-
const getTimelineAssetSrcFromSchema = (controls) => {
|
|
24
|
+
const getTimelineAssetSrcFromSchema = (controls, runtimeValues = controls === null || controls === void 0 ? void 0 : controls.runtimeValues.getSnapshot()) => {
|
|
25
25
|
if (!controls || !(0, studio_shared_1.getAssetSchemaKeys)(controls.schema).includes('src')) {
|
|
26
26
|
return null;
|
|
27
27
|
}
|
|
28
|
-
const { src } =
|
|
28
|
+
const { src } = runtimeValues !== null && runtimeValues !== void 0 ? runtimeValues : {};
|
|
29
29
|
return typeof src === 'string' ? src : null;
|
|
30
30
|
};
|
|
31
31
|
exports.getTimelineAssetSrcFromSchema = getTimelineAssetSrcFromSchema;
|
|
@@ -6,6 +6,7 @@ const react_1 = require("react");
|
|
|
6
6
|
const remotion_1 = require("remotion");
|
|
7
7
|
const timeline_layout_1 = require("../../helpers/timeline-layout");
|
|
8
8
|
const timeline_node_path_key_1 = require("../../helpers/timeline-node-path-key");
|
|
9
|
+
const use_runtime_values_1 = require("../../helpers/use-runtime-values");
|
|
9
10
|
const ExpandedTracksProvider_1 = require("../ExpandedTracksProvider");
|
|
10
11
|
const get_node_keyframes_1 = require("./get-node-keyframes");
|
|
11
12
|
const imperative_state_1 = require("./imperative-state");
|
|
@@ -37,6 +38,7 @@ const useExpandedTrackKeyframeRows = ({ sequence, nodePathInfo, keyframeDisplayO
|
|
|
37
38
|
const { propStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesContext);
|
|
38
39
|
const { getDragOverrides, getEffectDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeDragOverridesContext);
|
|
39
40
|
const { selectedItems } = (0, TimelineSelection_1.useTimelineSelection)();
|
|
41
|
+
const runtimeValues = (0, use_runtime_values_1.useRuntimeValues)(sequence.controls);
|
|
40
42
|
const tree = (0, react_1.useMemo)(() => (0, timeline_layout_1.buildTimelineTree)({
|
|
41
43
|
sequence,
|
|
42
44
|
nodePathInfo,
|
|
@@ -45,12 +47,14 @@ const useExpandedTrackKeyframeRows = ({ sequence, nodePathInfo, keyframeDisplayO
|
|
|
45
47
|
propStatuses,
|
|
46
48
|
includeTextContent: false,
|
|
47
49
|
includeSourceControls: false,
|
|
50
|
+
runtimeValues,
|
|
48
51
|
}), [
|
|
49
52
|
propStatuses,
|
|
50
53
|
getDragOverrides,
|
|
51
54
|
getEffectDragOverrides,
|
|
52
55
|
nodePathInfo,
|
|
53
56
|
sequence,
|
|
57
|
+
runtimeValues,
|
|
54
58
|
]);
|
|
55
59
|
const selectedRowKeys = (0, react_1.useMemo)(() => (0, timeline_expanded_filter_1.getSelectedTimelineExpandedRowKeys)(selectedItems), [selectedItems]);
|
|
56
60
|
const filteredTree = (0, react_1.useMemo)(() => (0, timeline_expanded_filter_1.filterTimelineExpandedTree)({
|
|
@@ -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;
|
|
@@ -9,6 +9,7 @@ export declare const useTimelineExpandedTree: ({ sequence, nodePathInfo, include
|
|
|
9
9
|
filteredTree: import("../../helpers/timeline-layout").TimelineTreeNode[];
|
|
10
10
|
getIsExpanded: import("../ExpandedTracksProvider").GetIsExpanded;
|
|
11
11
|
propStatuses: import("remotion").PropStatuses;
|
|
12
|
+
runtimeValues: Readonly<Record<string, unknown>>;
|
|
12
13
|
toggleTrack: (nodePathInfo: SequenceNodePathInfo) => void;
|
|
13
14
|
tree: import("../../helpers/timeline-layout").TimelineTreeNode[];
|
|
14
15
|
};
|
|
@@ -4,6 +4,7 @@ exports.useTimelineExpandedTree = void 0;
|
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const remotion_1 = require("remotion");
|
|
6
6
|
const timeline_layout_1 = require("../../helpers/timeline-layout");
|
|
7
|
+
const use_runtime_values_1 = require("../../helpers/use-runtime-values");
|
|
7
8
|
const ExpandedTracksProvider_1 = require("../ExpandedTracksProvider");
|
|
8
9
|
const get_node_keyframes_1 = require("./get-node-keyframes");
|
|
9
10
|
const timeline_expanded_filter_1 = require("./timeline-expanded-filter");
|
|
@@ -14,6 +15,7 @@ const useTimelineExpandedTree = ({ sequence, nodePathInfo, includeTextContent, i
|
|
|
14
15
|
const { propStatuses: visualModePropStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesContext);
|
|
15
16
|
const { getDragOverrides, getEffectDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeDragOverridesContext);
|
|
16
17
|
const { selectedItems } = (0, TimelineSelection_1.useTimelineSelection)();
|
|
18
|
+
const runtimeValues = (0, use_runtime_values_1.useRuntimeValues)(sequence.controls);
|
|
17
19
|
const tree = (0, react_1.useMemo)(() => (0, timeline_layout_1.buildTimelineTree)({
|
|
18
20
|
sequence,
|
|
19
21
|
nodePathInfo,
|
|
@@ -22,6 +24,7 @@ const useTimelineExpandedTree = ({ sequence, nodePathInfo, includeTextContent, i
|
|
|
22
24
|
propStatuses: visualModePropStatuses,
|
|
23
25
|
includeTextContent,
|
|
24
26
|
includeSourceControls,
|
|
27
|
+
runtimeValues,
|
|
25
28
|
}), [
|
|
26
29
|
sequence,
|
|
27
30
|
nodePathInfo,
|
|
@@ -30,6 +33,7 @@ const useTimelineExpandedTree = ({ sequence, nodePathInfo, includeTextContent, i
|
|
|
30
33
|
visualModePropStatuses,
|
|
31
34
|
includeTextContent,
|
|
32
35
|
includeSourceControls,
|
|
36
|
+
runtimeValues,
|
|
33
37
|
]);
|
|
34
38
|
const selectedRowKeys = (0, react_1.useMemo)(() => (0, timeline_expanded_filter_1.getSelectedTimelineExpandedRowKeys)(selectedItems), [selectedItems]);
|
|
35
39
|
const filteredTree = (0, react_1.useMemo)(() => (0, timeline_expanded_filter_1.filterTimelineExpandedTree)({
|
|
@@ -57,6 +61,7 @@ const useTimelineExpandedTree = ({ sequence, nodePathInfo, includeTextContent, i
|
|
|
57
61
|
filteredTree,
|
|
58
62
|
getIsExpanded,
|
|
59
63
|
propStatuses: visualModePropStatuses,
|
|
64
|
+
runtimeValues,
|
|
60
65
|
toggleTrack,
|
|
61
66
|
tree,
|
|
62
67
|
};
|
|
@@ -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;
|
|
@@ -5,13 +5,14 @@ const react_1 = require("react");
|
|
|
5
5
|
const remotion_1 = require("remotion");
|
|
6
6
|
const client_id_1 = require("../../helpers/client-id");
|
|
7
7
|
const timeline_layout_1 = require("../../helpers/timeline-layout");
|
|
8
|
+
const use_runtime_values_1 = require("../../helpers/use-runtime-values");
|
|
8
9
|
const ExpandedTracksProvider_1 = require("../ExpandedTracksProvider");
|
|
9
10
|
const get_node_keyframes_1 = require("./get-node-keyframes");
|
|
10
11
|
const MaxTimelineTracks_1 = require("./MaxTimelineTracks");
|
|
11
12
|
const timeline_expanded_filter_1 = require("./timeline-expanded-filter");
|
|
12
13
|
const TimelineSelection_1 = require("./TimelineSelection");
|
|
13
14
|
const TimelineTimeIndicators_1 = require("./TimelineTimeIndicators");
|
|
14
|
-
const useTimelineHeight = ({ shown, hasBeenCut, }) => {
|
|
15
|
+
const useTimelineHeight = ({ shown, hasBeenCut, isStill, }) => {
|
|
15
16
|
const { getIsExpanded } = (0, react_1.useContext)(ExpandedTracksProvider_1.ExpandedTracksGetterContext);
|
|
16
17
|
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
17
18
|
const { propStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesContext);
|
|
@@ -19,6 +20,20 @@ const useTimelineHeight = ({ shown, hasBeenCut, }) => {
|
|
|
19
20
|
const { selectedItems } = (0, TimelineSelection_1.useTimelineSelection)();
|
|
20
21
|
const previewServerConnected = previewServerState.type === 'connected';
|
|
21
22
|
const selectedRowKeys = (0, react_1.useMemo)(() => (0, timeline_expanded_filter_1.getSelectedTimelineExpandedRowKeys)(selectedItems), [selectedItems]);
|
|
23
|
+
const expandedControls = (0, react_1.useMemo)(() => shown.flatMap((track) => {
|
|
24
|
+
if (!previewServerConnected ||
|
|
25
|
+
track.nodePathInfo === null ||
|
|
26
|
+
!getIsExpanded(track.nodePathInfo) ||
|
|
27
|
+
track.sequence.controls === null) {
|
|
28
|
+
return [];
|
|
29
|
+
}
|
|
30
|
+
return [track.sequence.controls];
|
|
31
|
+
}), [getIsExpanded, previewServerConnected, shown]);
|
|
32
|
+
const runtimeValueSnapshots = (0, use_runtime_values_1.useRuntimeValueSnapshots)(expandedControls);
|
|
33
|
+
const runtimeValuesByStore = (0, react_1.useMemo)(() => new Map(expandedControls.map((controls, index) => [
|
|
34
|
+
controls.runtimeValues,
|
|
35
|
+
runtimeValueSnapshots[index],
|
|
36
|
+
])), [expandedControls, runtimeValueSnapshots]);
|
|
22
37
|
return (0, react_1.useMemo)(() => {
|
|
23
38
|
const tracksHeight = shown.reduce((acc, track) => {
|
|
24
39
|
const isExpanded = previewServerConnected &&
|
|
@@ -27,6 +42,7 @@ const useTimelineHeight = ({ shown, hasBeenCut, }) => {
|
|
|
27
42
|
const layerHeight = (0, timeline_layout_1.getTimelineLayerHeight)(track.sequence.type) +
|
|
28
43
|
timeline_layout_1.TIMELINE_ITEM_BORDER_BOTTOM;
|
|
29
44
|
const expandedHeight = (() => {
|
|
45
|
+
var _a;
|
|
30
46
|
if (!isExpanded || track.nodePathInfo === null) {
|
|
31
47
|
return 0;
|
|
32
48
|
}
|
|
@@ -39,6 +55,9 @@ const useTimelineHeight = ({ shown, hasBeenCut, }) => {
|
|
|
39
55
|
propStatuses,
|
|
40
56
|
includeTextContent: false,
|
|
41
57
|
includeSourceControls: false,
|
|
58
|
+
runtimeValues: track.sequence.controls
|
|
59
|
+
? ((_a = runtimeValuesByStore.get(track.sequence.controls.runtimeValues)) !== null && _a !== void 0 ? _a : null)
|
|
60
|
+
: null,
|
|
42
61
|
});
|
|
43
62
|
const filteredTree = (0, timeline_expanded_filter_1.filterTimelineExpandedTree)({
|
|
44
63
|
nodes: tree,
|
|
@@ -70,16 +89,18 @@ const useTimelineHeight = ({ shown, hasBeenCut, }) => {
|
|
|
70
89
|
return (tracksHeight +
|
|
71
90
|
timeline_layout_1.TIMELINE_ITEM_BORDER_BOTTOM +
|
|
72
91
|
(hasBeenCut ? MaxTimelineTracks_1.MAX_TIMELINE_TRACKS_NOTICE_HEIGHT : 0) +
|
|
73
|
-
TimelineTimeIndicators_1.TIMELINE_TIME_INDICATOR_HEIGHT);
|
|
92
|
+
(isStill ? 0 : TimelineTimeIndicators_1.TIMELINE_TIME_INDICATOR_HEIGHT));
|
|
74
93
|
}, [
|
|
75
94
|
shown,
|
|
76
95
|
hasBeenCut,
|
|
96
|
+
isStill,
|
|
77
97
|
previewServerConnected,
|
|
78
98
|
getIsExpanded,
|
|
79
99
|
propStatuses,
|
|
80
100
|
getDragOverrides,
|
|
81
101
|
getEffectDragOverrides,
|
|
82
102
|
selectedRowKeys,
|
|
103
|
+
runtimeValuesByStore,
|
|
83
104
|
]);
|
|
84
105
|
};
|
|
85
106
|
exports.useTimelineHeight = useTimelineHeight;
|
|
@@ -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;
|
|
@@ -25,11 +25,15 @@ const style = {
|
|
|
25
25
|
exports.inOutHandles = (0, react_1.createRef)();
|
|
26
26
|
exports.defaultInOutValue = { inFrame: null, outFrame: null };
|
|
27
27
|
const TimelineInOutPointToggle = () => {
|
|
28
|
+
var _a;
|
|
28
29
|
const { inFrame, outFrame } = (0, in_out_1.useTimelineInOutFramePosition)();
|
|
29
30
|
const { setInAndOutFrames } = (0, in_out_1.useTimelineSetInOutFramePosition)();
|
|
30
31
|
const videoConfig = remotion_1.Internals.useUnsafeVideoConfig();
|
|
31
32
|
const keybindings = (0, use_keybinding_1.useKeybinding)();
|
|
32
|
-
const { getCurrentFrame
|
|
33
|
+
const { getCurrentFrame } = player_1.PlayerInternals.usePlayerMethods();
|
|
34
|
+
const timelinePosition = remotion_1.Internals.Timeline.useTimelinePosition();
|
|
35
|
+
const isFirstFrame = timelinePosition === 0;
|
|
36
|
+
const isLastFrame = timelinePosition === ((_a = videoConfig === null || videoConfig === void 0 ? void 0 : videoConfig.durationInFrames) !== null && _a !== void 0 ? _a : 1) - 1;
|
|
33
37
|
const onInOutClear = (0, react_1.useCallback)((composition) => {
|
|
34
38
|
setInAndOutFrames((prev) => {
|
|
35
39
|
return {
|