@remotion/studio 4.0.516 → 4.0.518
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/AssetSelector.js +63 -22
- package/dist/components/AssetSelectorItem.d.ts +2 -1
- package/dist/components/AssetSelectorItem.js +41 -10
- package/dist/components/Canvas.js +15 -12
- package/dist/components/CanvasCaptureDropHandler.d.ts +4 -0
- package/dist/components/CanvasCaptureDropHandler.js +42 -0
- package/dist/components/CanvasOrLoading.js +4 -3
- package/dist/components/CaptionInspector.js +1 -1
- package/dist/components/CaptionTextEditor.js +32 -8
- package/dist/components/CheckboardToggle.js +1 -1
- package/dist/components/Checkbox.d.ts +0 -1
- package/dist/components/Checkbox.js +2 -19
- package/dist/components/CompositionContextButton.js +2 -1
- package/dist/components/CompositionSelector.js +1 -1
- package/dist/components/ConfigureLicenseModal.js +79 -46
- package/dist/components/CurrentAsset.d.ts +1 -1
- package/dist/components/CurrentAsset.js +9 -4
- package/dist/components/Editor.js +2 -1
- package/dist/components/EditorContent.js +11 -5
- package/dist/components/EditorContexts.js +2 -1
- package/dist/components/EditorRuler/Ruler.d.ts +1 -0
- package/dist/components/EditorRuler/Ruler.js +9 -8
- package/dist/components/EditorRuler/index.d.ts +1 -0
- package/dist/components/EditorRuler/index.js +3 -4
- package/dist/components/EditorRuler/use-is-ruler-visible.d.ts +1 -1
- package/dist/components/EditorRuler/use-is-ruler-visible.js +8 -2
- package/dist/components/ElementInstallConfirmation.d.ts +5 -0
- package/dist/components/ElementInstallConfirmation.js +25 -1
- package/dist/components/ElementLibraryModal.d.ts +5 -0
- package/dist/components/ElementLibraryModal.js +40 -0
- package/dist/components/FilePreview.js +71 -0
- package/dist/components/InlineCaptionInspector.js +13 -2
- package/dist/components/InlineEditableTitle.js +2 -2
- package/dist/components/InspectorPanel/CompositionInspector.js +11 -38
- package/dist/components/InspectorPanel/CompositionInspectorHeader.js +2 -2
- package/dist/components/InspectorPanel/CompositionMetadata.js +11 -4
- package/dist/components/InspectorPanel/EasingInspector.js +2 -2
- package/dist/components/InspectorPanel/ElementLibraryButton.d.ts +2 -0
- package/dist/components/InspectorPanel/ElementLibraryButton.js +139 -0
- package/dist/components/InspectorPanel/KeyframeInspector.js +1 -1
- package/dist/components/InspectorPanel/SequenceInspectorHeader.js +12 -5
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +1 -3
- package/dist/components/InspectorPanel/common.d.ts +0 -1
- package/dist/components/InspectorPanel/common.js +3 -7
- package/dist/components/InspectorPanel/inspector-selection.d.ts +2 -2
- package/dist/components/InspectorPanel/styles.d.ts +0 -1
- package/dist/components/InspectorPanel/styles.js +3 -4
- package/dist/components/InspectorPanel/use-track-for-selection.d.ts +1 -2
- package/dist/components/InspectorSequenceSection.d.ts +1 -2
- package/dist/components/InspectorSourceLocation.js +1 -1
- package/dist/components/Menu/MenuItem.js +15 -6
- package/dist/components/MenuToolbar.js +7 -3
- package/dist/components/Modals.js +51 -1
- package/dist/components/PlaybackRateSelector.js +3 -6
- package/dist/components/Preview.js +83 -5
- package/dist/components/PreviewToolbar.js +10 -4
- package/dist/components/PreviewToolbarOverflowButton.d.ts +1 -0
- package/dist/components/PreviewToolbarOverflowButton.js +9 -2
- package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.d.ts +2 -0
- package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +28 -8
- package/dist/components/RadioButton.d.ts +6 -0
- package/dist/components/RadioButton.js +62 -0
- package/dist/components/RenderButton.js +2 -1
- package/dist/components/RulersAndGuidesToggle.d.ts +3 -1
- package/dist/components/RulersAndGuidesToggle.js +18 -7
- package/dist/components/SelectedOutlineKeyboardControls.d.ts +2 -2
- package/dist/components/SelectedOutlineOverlay.d.ts +1 -3
- package/dist/components/SelectedOutlineOverlay.js +21 -17
- package/dist/components/SelectedOutlinePolygon.d.ts +1 -2
- package/dist/components/SelectedOutlineRenderer.d.ts +2 -3
- package/dist/components/SelectedOutlineRenderer.js +9 -78
- package/dist/components/SelectedOutlineUvControls.d.ts +1 -1
- package/dist/components/SettingsModal.js +1 -1
- package/dist/components/SettingsModalFooter.d.ts +3 -1
- package/dist/components/SettingsModalFooter.js +19 -4
- package/dist/components/ShowPixelGridProvider.d.ts +4 -0
- package/dist/components/ShowPixelGridProvider.js +24 -0
- package/dist/components/SidebarCollapserControls.js +2 -2
- package/dist/components/SidebarRenderButton.js +2 -1
- package/dist/components/Timeline/Timeline.js +41 -0
- package/dist/components/Timeline/TimelineClipboardKeybindings.d.ts +6 -7
- package/dist/components/Timeline/TimelineDragHandler.js +11 -4
- package/dist/components/Timeline/TimelineKeyframeControls.d.ts +1 -2
- package/dist/components/Timeline/TimelinePlayCursorSyncer.js +4 -2
- package/dist/components/Timeline/TimelineSelection.d.ts +29 -66
- package/dist/components/Timeline/TimelineSelection.js +30 -170
- package/dist/components/Timeline/TimelineSequenceItem.d.ts +1 -0
- package/dist/components/Timeline/TimelineSequenceItem.js +8 -6
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +3 -4
- package/dist/components/Timeline/delete-selected-timeline-item.d.ts +3 -4
- package/dist/components/Timeline/duplicate-selected-timeline-item.d.ts +3 -4
- package/dist/components/Timeline/find-track-for-node-path-info.d.ts +1 -1
- package/dist/components/Timeline/keyframe-clipboard.d.ts +2 -3
- package/dist/components/Timeline/reset-selected-timeline-props.d.ts +2 -3
- package/dist/components/Timeline/sequence-prop-clipboard.d.ts +2 -3
- package/dist/components/Timeline/split-selected-timeline-item.d.ts +2 -3
- package/dist/components/Timeline/timeline-expanded-filter.d.ts +1 -2
- package/dist/components/Timeline/timeline-scroll-logic.d.ts +7 -5
- package/dist/components/Timeline/timeline-scroll-logic.js +12 -7
- package/dist/components/Timeline/update-selected-easing.d.ts +7 -7
- package/dist/components/Timeline/use-timeline-asset-drop.js +24 -1
- package/dist/components/Timeline/use-timeline-keyframe-drag.d.ts +6 -7
- package/dist/components/WebMcp.d.ts +2 -0
- package/dist/components/WebMcp.js +945 -0
- package/dist/components/canvas-capture-drop.d.ts +4 -0
- package/dist/components/canvas-capture-drop.js +22 -0
- package/dist/components/composition-menu-items.js +26 -0
- package/dist/components/selected-outline-geometry.d.ts +2 -21
- package/dist/components/selected-outline-geometry.js +5 -16
- package/dist/components/selected-outline-measurement.d.ts +8 -37
- package/dist/components/selected-outline-measurement.js +1 -231
- package/dist/components/selected-outline-types.d.ts +2 -15
- package/dist/components/selected-outline-uv.js +3 -106
- package/dist/esm/{chunk-w4244j4n.js → chunk-7prjt5n5.js} +32831 -26820
- package/dist/esm/internals.mjs +32831 -26820
- package/dist/esm/previewEntry.mjs +17304 -11293
- package/dist/esm/renderEntry.mjs +1 -1
- package/dist/helpers/calculate-timeline.d.ts +1 -7
- package/dist/helpers/calculate-timeline.js +2 -146
- package/dist/helpers/create-folder-tree.js +16 -1
- package/dist/helpers/editor-ruler.js +6 -5
- package/dist/helpers/format-file-location.d.ts +8 -0
- package/dist/helpers/format-file-location.js +14 -3
- package/dist/helpers/get-asset-metadata.d.ts +19 -0
- package/dist/helpers/get-asset-metadata.js +51 -6
- package/dist/helpers/get-connected-compositions.d.ts +1 -6
- package/dist/helpers/get-connected-compositions.js +2 -8
- package/dist/helpers/get-sequence-visible-range.d.ts +1 -5
- package/dist/helpers/get-sequence-visible-range.js +6 -51
- package/dist/helpers/get-timeline-max-zoom.d.ts +8 -0
- package/dist/helpers/get-timeline-max-zoom.js +17 -6
- package/dist/helpers/get-timeline-nestedness.d.ts +1 -2
- package/dist/helpers/get-timeline-nestedness.js +2 -12
- package/dist/helpers/get-timeline-sequence-sort-key.d.ts +2 -22
- package/dist/helpers/get-timeline-sequence-sort-key.js +2 -16
- package/dist/helpers/hoverable.d.ts +1 -0
- package/dist/helpers/hoverable.js +4 -1
- package/dist/helpers/is-current-selected-still.js +4 -2
- package/dist/helpers/sort-by-nonce-history.d.ts +1 -5
- package/dist/helpers/sort-by-nonce-history.js +3 -148
- package/dist/helpers/timeline-node-path-key.d.ts +1 -2
- package/dist/helpers/timeline-node-path-key.js +2 -2
- package/dist/helpers/use-menu-structure.js +20 -0
- package/dist/icons/enter.d.ts +4 -0
- package/dist/icons/enter.js +10 -0
- package/dist/state/editor-pixel-grid.d.ts +8 -0
- package/dist/state/editor-pixel-grid.js +18 -0
- package/dist/state/modals.d.ts +4 -0
- package/dist/state/playbackrate.d.ts +1 -0
- package/dist/state/playbackrate.js +4 -1
- package/package.json +14 -12
- package/dist/components/selected-outline-order.d.ts +0 -12
- package/dist/components/selected-outline-order.js +0 -251
- package/dist/helpers/get-box-quads-polyfill-internals.d.ts +0 -82
- package/dist/helpers/get-box-quads-polyfill-internals.js +0 -2403
- package/dist/helpers/get-box-quads-ponyfill.d.ts +0 -10
- package/dist/helpers/get-box-quads-ponyfill.js +0 -23
|
@@ -62,6 +62,7 @@ const should_subscribe_to_sequence_props_1 = require("./should-subscribe-to-sequ
|
|
|
62
62
|
const SubscribeToNodePaths_1 = require("./SubscribeToNodePaths");
|
|
63
63
|
const timeline_asset_drop_context_1 = require("./timeline-asset-drop-context");
|
|
64
64
|
const timeline_refs_1 = require("./timeline-refs");
|
|
65
|
+
const timeline_scroll_logic_1 = require("./timeline-scroll-logic");
|
|
65
66
|
const TimelineDragHandler_1 = require("./TimelineDragHandler");
|
|
66
67
|
const TimelineHeightContainer_1 = require("./TimelineHeightContainer");
|
|
67
68
|
const TimelineInOutDragHandler_1 = require("./TimelineInOutDragHandler");
|
|
@@ -72,6 +73,7 @@ const TimelinePinchZoom_1 = require("./TimelinePinchZoom");
|
|
|
72
73
|
const TimelinePlayCursorSyncer_1 = require("./TimelinePlayCursorSyncer");
|
|
73
74
|
const TimelineScrollable_1 = require("./TimelineScrollable");
|
|
74
75
|
const TimelineSelection_1 = require("./TimelineSelection");
|
|
76
|
+
const TimelineSequenceItem_1 = require("./TimelineSequenceItem");
|
|
75
77
|
const TimelineSlider_1 = require("./TimelineSlider");
|
|
76
78
|
const TimelineTimeIndicators_1 = require("./TimelineTimeIndicators");
|
|
77
79
|
const TimelineTracks_1 = require("./TimelineTracks");
|
|
@@ -94,6 +96,7 @@ const TimelineContextMenuArea = ({ children }) => {
|
|
|
94
96
|
const assetDropFrame = (0, use_timeline_asset_drop_1.useTimelineAssetDrop)();
|
|
95
97
|
const { compositions, canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
96
98
|
const videoConfig = remotion_1.Internals.useUnsafeVideoConfig();
|
|
99
|
+
const isStill = (0, is_current_selected_still_1.useIsStill)();
|
|
97
100
|
const [isAddingSolid, setIsAddingSolid] = (0, react_1.useState)(false);
|
|
98
101
|
const [isAddingAsset, setIsAddingAsset] = (0, react_1.useState)(false);
|
|
99
102
|
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
@@ -101,6 +104,44 @@ const TimelineContextMenuArea = ({ children }) => {
|
|
|
101
104
|
const previewInteractive = previewConnected && (0, interactivity_enabled_1.isStudioInteractivityEnabled)();
|
|
102
105
|
const browserStudioOperations = (0, browser_studio_operations_1.getBrowserStudioOperations)();
|
|
103
106
|
const browserStudioCanInsertSolid = browserStudioOperations !== null;
|
|
107
|
+
(0, react_1.useEffect)(() => {
|
|
108
|
+
const verticalScroll = timeline_refs_1.timelineVerticalScroll.current;
|
|
109
|
+
if (!verticalScroll) {
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
const autoScroll = (0, timeline_scroll_logic_1.startTimelineEdgeAutoScroll)({
|
|
113
|
+
includeHorizontal: false,
|
|
114
|
+
includeVertical: true,
|
|
115
|
+
verticalTopOffset: isStill ? 0 : TimelineTimeIndicators_1.TIMELINE_TIME_INDICATOR_HEIGHT,
|
|
116
|
+
onTick: (directions) => {
|
|
117
|
+
if (directions.y === null) {
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
verticalScroll.scrollTop +=
|
|
121
|
+
directions.y === 'up'
|
|
122
|
+
? -timeline_scroll_logic_1.EDGE_SCROLL_VERTICAL_INCREMENT
|
|
123
|
+
: timeline_scroll_logic_1.EDGE_SCROLL_VERTICAL_INCREMENT;
|
|
124
|
+
},
|
|
125
|
+
});
|
|
126
|
+
const onDragOver = (event) => {
|
|
127
|
+
if (!event.dataTransfer ||
|
|
128
|
+
!Array.from(event.dataTransfer.types).includes(TimelineSequenceItem_1.SEQUENCE_REORDER_MIME_TYPE)) {
|
|
129
|
+
autoScroll.stop();
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
autoScroll.update(event);
|
|
133
|
+
};
|
|
134
|
+
const stopAutoScroll = () => autoScroll.stop();
|
|
135
|
+
verticalScroll.addEventListener('dragover', onDragOver, true);
|
|
136
|
+
document.addEventListener('dragend', stopAutoScroll, true);
|
|
137
|
+
document.addEventListener('drop', stopAutoScroll, true);
|
|
138
|
+
return () => {
|
|
139
|
+
autoScroll.stop();
|
|
140
|
+
verticalScroll.removeEventListener('dragover', onDragOver, true);
|
|
141
|
+
document.removeEventListener('dragend', stopAutoScroll, true);
|
|
142
|
+
document.removeEventListener('drop', stopAutoScroll, true);
|
|
143
|
+
};
|
|
144
|
+
}, [isStill]);
|
|
104
145
|
const currentCompositionId = (canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) === 'composition' ? canvasContent.compositionId : null;
|
|
105
146
|
const currentComposition = (0, react_1.useMemo)(() => {
|
|
106
147
|
var _a;
|
|
@@ -3,7 +3,6 @@ import type React from 'react';
|
|
|
3
3
|
import { type OverrideIdToNodePaths, type PropStatuses, type SequencePropsSubscriptionKey, type InteractivitySchema, type TSequence } from 'remotion';
|
|
4
4
|
import type { SequenceNodePathInfo } from '../../helpers/get-timeline-sequence-sort-key';
|
|
5
5
|
import { type EffectsClipboardEnvelope } from './effects-clipboard';
|
|
6
|
-
import { type TimelineSelection } from './TimelineSelection';
|
|
7
6
|
export type PasteEffectsTarget = {
|
|
8
7
|
readonly type: 'valid';
|
|
9
8
|
readonly nodePathInfo: SequenceNodePathInfo;
|
|
@@ -28,9 +27,9 @@ export type PasteEffectPropTarget = {
|
|
|
28
27
|
} | {
|
|
29
28
|
readonly type: 'none' | 'unsupported' | 'effect-type-mismatch' | 'prop-mismatch' | 'uncopyable';
|
|
30
29
|
};
|
|
31
|
-
export declare const getPasteEffectsTarget: (selectedItems: readonly
|
|
30
|
+
export declare const getPasteEffectsTarget: (selectedItems: readonly import("@remotion/canvas").CanvasSelectionItem[]) => PasteEffectsTarget;
|
|
32
31
|
export declare const getSnapshotsFromSelection: ({ selection, propStatuses, }: {
|
|
33
|
-
selection:
|
|
32
|
+
selection: import("@remotion/canvas").CanvasSelectionItem;
|
|
34
33
|
propStatuses: PropStatuses;
|
|
35
34
|
}) => EffectClipboardSnapshot[] | null;
|
|
36
35
|
export type EffectClipboardDataFromSelections = {
|
|
@@ -44,15 +43,15 @@ export type EffectClipboardDataFromSelections = {
|
|
|
44
43
|
readonly type: 'uncopyable';
|
|
45
44
|
};
|
|
46
45
|
export declare const getEffectClipboardDataFromSelections: ({ selectedItems, propStatuses, }: {
|
|
47
|
-
selectedItems: readonly
|
|
46
|
+
selectedItems: readonly import("@remotion/canvas").CanvasSelectionItem[];
|
|
48
47
|
propStatuses: PropStatuses;
|
|
49
48
|
}) => EffectClipboardDataFromSelections;
|
|
50
49
|
export declare const getEffectsClipboardEnvelopeFromSelections: ({ selectedItems, payload, }: {
|
|
51
|
-
selectedItems: readonly
|
|
50
|
+
selectedItems: readonly import("@remotion/canvas").CanvasSelectionItem[];
|
|
52
51
|
payload: EffectClipboardData;
|
|
53
52
|
}) => EffectsClipboardEnvelope;
|
|
54
53
|
export declare const getEffectPropClipboardDataFromSelection: ({ selection, propStatuses, }: {
|
|
55
|
-
selection:
|
|
54
|
+
selection: import("@remotion/canvas").CanvasSelectionItem;
|
|
56
55
|
propStatuses: PropStatuses;
|
|
57
56
|
}) => EffectPropClipboardData | null;
|
|
58
57
|
export declare const getEasingClipboardDataFromSelection: ({ selection, sequences, overrideIdsToNodePaths, propStatuses, }: {
|
|
@@ -68,7 +67,7 @@ export declare const getEasingClipboardDataFromSelection: ({ selection, sequence
|
|
|
68
67
|
propStatuses: PropStatuses;
|
|
69
68
|
}) => EasingClipboardData | null;
|
|
70
69
|
export declare const getPasteEffectPropTarget: ({ selectedItems, payload, propStatuses, sequences, overrideIdsToNodePaths, }: {
|
|
71
|
-
readonly selectedItems: readonly
|
|
70
|
+
readonly selectedItems: readonly import("@remotion/canvas").CanvasSelectionItem[];
|
|
72
71
|
readonly payload: EffectPropClipboardData;
|
|
73
72
|
readonly propStatuses: PropStatuses;
|
|
74
73
|
readonly sequences: TSequence[];
|
|
@@ -74,20 +74,25 @@ const getClientXWithScroll = (x) => {
|
|
|
74
74
|
const TimelineDragHandler = () => {
|
|
75
75
|
const video = remotion_1.Internals.useUnsafeVideoConfig();
|
|
76
76
|
const { zoom: zoomMap } = (0, react_1.useContext)(timeline_zoom_1.TimelineZoomCtx);
|
|
77
|
-
const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
77
|
+
const { canvasContent, currentAssetMetadata } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
78
78
|
const containerStyle = (0, react_1.useMemo)(() => {
|
|
79
79
|
var _a;
|
|
80
|
-
if (!canvasContent
|
|
80
|
+
if (!canvasContent) {
|
|
81
81
|
return {};
|
|
82
82
|
}
|
|
83
|
-
const zoom =
|
|
83
|
+
const zoom = canvasContent.type === 'composition'
|
|
84
|
+
? ((_a = zoomMap[canvasContent.compositionId]) !== null && _a !== void 0 ? _a : timeline_zoom_1.TIMELINE_MIN_ZOOM)
|
|
85
|
+
: timeline_zoom_1.TIMELINE_MIN_ZOOM;
|
|
84
86
|
return {
|
|
85
87
|
...container,
|
|
86
88
|
width: 100 * zoom + '%',
|
|
87
89
|
height: TimelineTimeIndicators_1.TIMELINE_TIME_INDICATOR_HEIGHT,
|
|
88
90
|
};
|
|
89
91
|
}, [canvasContent, zoomMap]);
|
|
90
|
-
|
|
92
|
+
const hasPlayableContent = (canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) === 'composition' ||
|
|
93
|
+
((canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) === 'asset' &&
|
|
94
|
+
(currentAssetMetadata === null || currentAssetMetadata === void 0 ? void 0 : currentAssetMetadata.asset) === canvasContent.asset);
|
|
95
|
+
if (!hasPlayableContent) {
|
|
91
96
|
return null;
|
|
92
97
|
}
|
|
93
98
|
return (jsx_runtime_1.jsx("div", { ref: timeline_refs_1.sliderAreaRef, style: containerStyle, [TimelineSelection_1.TIMELINE_SCRUBBER_ATTR]: true, children: video && (0, interactivity_enabled_1.isStudioSelectionEnabled)() ? (jsx_runtime_1.jsx(TimelineDragHandlerInnerMemo, {})) : null }));
|
|
@@ -248,7 +253,9 @@ const TimelineDragHandlerInner = () => {
|
|
|
248
253
|
return;
|
|
249
254
|
}
|
|
250
255
|
const scroller = (0, timeline_scroll_logic_1.startTimelineEdgeAutoScroll)({
|
|
256
|
+
includeHorizontal: true,
|
|
251
257
|
includeVertical: false,
|
|
258
|
+
verticalTopOffset: 0,
|
|
252
259
|
onTick: onEdgeScrollTick,
|
|
253
260
|
});
|
|
254
261
|
autoScroller.current = scroller;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { CanUpdateSequencePropStatus, DragOverrideValue, InteractivitySchema, SequencePropsSubscriptionKey } from 'remotion';
|
|
3
3
|
import type { SequenceNodePathInfo } from '../../helpers/get-timeline-sequence-sort-key';
|
|
4
|
-
import { type TimelineSelection } from './TimelineSelection';
|
|
5
4
|
export declare const getSelectedKeyframeControlNodePathInfos: ({ clickedNodePathInfo, selectedItems, }: {
|
|
6
5
|
readonly clickedNodePathInfo: SequenceNodePathInfo;
|
|
7
|
-
readonly selectedItems: readonly
|
|
6
|
+
readonly selectedItems: readonly import("@remotion/canvas").CanvasSelectionItem[];
|
|
8
7
|
}) => readonly SequenceNodePathInfo[];
|
|
9
8
|
export declare const shouldShowTimelineKeyframeControls: ({ propStatus, selected, keyframable, }: {
|
|
10
9
|
propStatus: CanUpdateSequencePropStatus | null;
|
|
@@ -19,10 +19,12 @@ const TimelinePlayCursorSyncer = () => {
|
|
|
19
19
|
const compositionId = canvasContent && canvasContent.type === 'composition'
|
|
20
20
|
? canvasContent.compositionId
|
|
21
21
|
: null;
|
|
22
|
+
// Asset previews have a synthetic video config, but no composition ID
|
|
23
|
+
// with which to look up a persisted timeline zoom.
|
|
22
24
|
const zoom = compositionId
|
|
23
25
|
? ((_a = zoomMap[compositionId]) !== null && _a !== void 0 ? _a : timeline_zoom_1.TIMELINE_MIN_ZOOM)
|
|
24
|
-
:
|
|
25
|
-
if (
|
|
26
|
+
: timeline_zoom_1.TIMELINE_MIN_ZOOM;
|
|
27
|
+
if (video) {
|
|
26
28
|
(0, imperative_state_1.setCurrentFrame)(timelinePosition);
|
|
27
29
|
(0, imperative_state_1.setCurrentZoom)(zoom);
|
|
28
30
|
(0, imperative_state_1.setCurrentDuration)(video.durationInFrames);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type CanvasSelectionInteraction, type CanvasSelectionItem, type CanvasSelectionSnapshot } from '@remotion/canvas';
|
|
1
2
|
import React, { type CSSProperties } from 'react';
|
|
2
3
|
import { type GetDragOverrides, type GetEffectDragOverrides, type PropStatuses } from 'remotion';
|
|
3
4
|
import type { SequenceNodePathInfo, TimelineTrackData } from '../../helpers/get-timeline-sequence-sort-key';
|
|
@@ -20,46 +21,11 @@ export declare const getTimelineRowHighlightBackground: ({ showSelectedBackgroun
|
|
|
20
21
|
}) => string | undefined;
|
|
21
22
|
export declare const TIMELINE_BACKGROUND = "#15181B";
|
|
22
23
|
export declare const TIMELINE_TICKS_BACKGROUND = "rgb(31,36,40)";
|
|
23
|
-
export type TimelineSelection =
|
|
24
|
-
readonly type: 'guide';
|
|
25
|
-
readonly guideId: string;
|
|
26
|
-
} | {
|
|
27
|
-
readonly type: 'sequence';
|
|
28
|
-
readonly nodePathInfo: SequenceNodePathInfo;
|
|
29
|
-
} | {
|
|
30
|
-
readonly type: 'sequence-prop';
|
|
31
|
-
readonly nodePathInfo: SequenceNodePathInfo;
|
|
32
|
-
readonly key: string;
|
|
33
|
-
} | {
|
|
34
|
-
readonly type: 'sequence-all-effects';
|
|
35
|
-
readonly nodePathInfo: SequenceNodePathInfo;
|
|
36
|
-
} | {
|
|
37
|
-
readonly type: 'sequence-effect';
|
|
38
|
-
readonly nodePathInfo: SequenceNodePathInfo;
|
|
39
|
-
readonly i: number;
|
|
40
|
-
} | {
|
|
41
|
-
readonly type: 'sequence-effect-prop';
|
|
42
|
-
readonly nodePathInfo: SequenceNodePathInfo;
|
|
43
|
-
readonly i: number;
|
|
44
|
-
readonly key: string;
|
|
45
|
-
} | {
|
|
46
|
-
readonly type: 'keyframe';
|
|
47
|
-
readonly nodePathInfo: SequenceNodePathInfo;
|
|
48
|
-
readonly frame: number;
|
|
49
|
-
} | {
|
|
50
|
-
readonly type: 'easing';
|
|
51
|
-
readonly nodePathInfo: SequenceNodePathInfo;
|
|
52
|
-
readonly fromFrame: number;
|
|
53
|
-
readonly toFrame: number;
|
|
54
|
-
readonly segmentIndex: number;
|
|
55
|
-
};
|
|
24
|
+
export type TimelineSelection = CanvasSelectionItem;
|
|
56
25
|
export type TimelineEasingSelection = Extract<TimelineSelection, {
|
|
57
26
|
type: 'easing';
|
|
58
27
|
}>;
|
|
59
|
-
export type TimelineSelectionInteraction =
|
|
60
|
-
readonly shiftKey: boolean;
|
|
61
|
-
readonly toggleKey: boolean;
|
|
62
|
-
};
|
|
28
|
+
export type TimelineSelectionInteraction = CanvasSelectionInteraction;
|
|
63
29
|
export declare const isTimelineSelectionModifierEvent: ({ shiftKey, metaKey, ctrlKey, }: {
|
|
64
30
|
readonly shiftKey: boolean;
|
|
65
31
|
readonly metaKey: boolean;
|
|
@@ -71,10 +37,7 @@ export declare const shouldSelectTimelineRowOnPointerDown: ({ selected, shiftKey
|
|
|
71
37
|
readonly metaKey: boolean;
|
|
72
38
|
readonly ctrlKey: boolean;
|
|
73
39
|
}) => boolean;
|
|
74
|
-
export type TimelineSelectionState =
|
|
75
|
-
readonly selectedItems: readonly TimelineSelection[];
|
|
76
|
-
readonly anchor: TimelineSelection | null;
|
|
77
|
-
};
|
|
40
|
+
export type TimelineSelectionState = CanvasSelectionSnapshot;
|
|
78
41
|
export declare const EMPTY_TIMELINE_SELECTION_STATE: TimelineSelectionState;
|
|
79
42
|
export type TimelineMarqueeRect = {
|
|
80
43
|
readonly left: number;
|
|
@@ -88,16 +51,16 @@ export type TimelineMarqueeSelectionCandidate = {
|
|
|
88
51
|
readonly rect: TimelineMarqueeRect;
|
|
89
52
|
};
|
|
90
53
|
export declare const getTimelineSelectionAfterInteraction: ({ currentState, clickedItem, interaction, allSelectableItems, }: {
|
|
91
|
-
readonly currentState:
|
|
92
|
-
readonly clickedItem:
|
|
93
|
-
readonly interaction:
|
|
94
|
-
readonly allSelectableItems: readonly
|
|
95
|
-
}) =>
|
|
54
|
+
readonly currentState: CanvasSelectionSnapshot;
|
|
55
|
+
readonly clickedItem: CanvasSelectionItem;
|
|
56
|
+
readonly interaction: CanvasSelectionInteraction;
|
|
57
|
+
readonly allSelectableItems: readonly CanvasSelectionItem[];
|
|
58
|
+
}) => CanvasSelectionSnapshot;
|
|
96
59
|
export declare const getAvailableTimelineSelectionState: ({ availableKeys, availableItemsByKey, state, }: {
|
|
97
60
|
readonly availableKeys: ReadonlySet<string>;
|
|
98
|
-
readonly availableItemsByKey?: ReadonlyMap<string,
|
|
99
|
-
readonly state:
|
|
100
|
-
}) =>
|
|
61
|
+
readonly availableItemsByKey?: ReadonlyMap<string, CanvasSelectionItem> | undefined;
|
|
62
|
+
readonly state: CanvasSelectionSnapshot;
|
|
63
|
+
}) => CanvasSelectionSnapshot;
|
|
101
64
|
export declare const getNormalizedTimelineMarqueeRect: ({ startX, startY, currentX, currentY, }: {
|
|
102
65
|
readonly startX: number;
|
|
103
66
|
readonly startY: number;
|
|
@@ -119,12 +82,12 @@ export declare const getTimelineMarqueeSelection: ({ candidates, lockedSelection
|
|
|
119
82
|
readonly marqueeRect: TimelineMarqueeRect;
|
|
120
83
|
}) => {
|
|
121
84
|
readonly lockedSelectionKind: TimelineMarqueeSelectionKind | null;
|
|
122
|
-
readonly selectedItems: readonly
|
|
85
|
+
readonly selectedItems: readonly CanvasSelectionItem[];
|
|
123
86
|
};
|
|
124
87
|
export declare const extendTimelineMarqueeSelection: ({ currentSelection, marqueeSelection, }: {
|
|
125
|
-
readonly currentSelection: readonly
|
|
126
|
-
readonly marqueeSelection: readonly
|
|
127
|
-
}) => readonly
|
|
88
|
+
readonly currentSelection: readonly CanvasSelectionItem[];
|
|
89
|
+
readonly marqueeSelection: readonly CanvasSelectionItem[];
|
|
90
|
+
}) => readonly CanvasSelectionItem[];
|
|
128
91
|
type TimelineSelectionContextValue = {
|
|
129
92
|
readonly canSelect: boolean;
|
|
130
93
|
readonly revealRequest: TimelineSelectionRevealRequest | null;
|
|
@@ -151,23 +114,23 @@ type TimelineSelectionRevealRequest = {
|
|
|
151
114
|
readonly item: TimelineSelection;
|
|
152
115
|
readonly token: number;
|
|
153
116
|
};
|
|
154
|
-
export declare const getTimelineSelectionFromNodePathInfo: (nodePathInfo: SequenceNodePathInfo | null) =>
|
|
155
|
-
export declare const getTimelineSelectionKey: (item:
|
|
156
|
-
export declare const getSelectableTimelineSequenceSelections: (tracks: readonly Pick<TimelineTrackData, "nodePathInfo">[]) =>
|
|
117
|
+
export declare const getTimelineSelectionFromNodePathInfo: (nodePathInfo: SequenceNodePathInfo | null) => CanvasSelectionItem | null;
|
|
118
|
+
export declare const getTimelineSelectionKey: (item: CanvasSelectionItem) => string;
|
|
119
|
+
export declare const getSelectableTimelineSequenceSelections: (tracks: readonly Pick<TimelineTrackData, "nodePathInfo">[]) => CanvasSelectionItem[];
|
|
157
120
|
export declare const getSelectableTimelineItems: ({ getDragOverrides, getEffectDragOverrides, getIsExpanded, propStatuses, selectedItems, timeline, timelinePosition, }: {
|
|
158
121
|
readonly getDragOverrides: GetDragOverrides;
|
|
159
122
|
readonly getEffectDragOverrides: GetEffectDragOverrides;
|
|
160
123
|
readonly getIsExpanded: GetIsExpanded;
|
|
161
124
|
readonly propStatuses: PropStatuses;
|
|
162
|
-
readonly selectedItems: readonly
|
|
125
|
+
readonly selectedItems: readonly CanvasSelectionItem[];
|
|
163
126
|
readonly timeline: readonly TimelineTrackData[];
|
|
164
127
|
readonly timelinePosition: number;
|
|
165
|
-
}) =>
|
|
128
|
+
}) => CanvasSelectionItem[];
|
|
166
129
|
export declare const getTimelineSequenceSelectionKey: (nodePathInfo: SequenceNodePathInfo) => string;
|
|
167
130
|
export declare const TimelineSelectAllKeybindings: React.FC<{
|
|
168
131
|
readonly timeline: readonly TimelineTrackData[];
|
|
169
132
|
}>;
|
|
170
|
-
export declare const getTimelineSequenceSelectionForEscape: (selectedItems: readonly
|
|
133
|
+
export declare const getTimelineSequenceSelectionForEscape: (selectedItems: readonly CanvasSelectionItem[]) => {
|
|
171
134
|
readonly type: "sequence";
|
|
172
135
|
readonly nodePathInfo: SequenceNodePathInfo;
|
|
173
136
|
} | null;
|
|
@@ -186,17 +149,17 @@ export declare const useTimelineMarqueeSelection: () => {
|
|
|
186
149
|
marqueeRect: TimelineMarqueeRect | null;
|
|
187
150
|
onPointerDownCapture: (event: React.PointerEvent<HTMLDivElement>) => void;
|
|
188
151
|
};
|
|
189
|
-
export declare const useTimelineMarqueeSelectableItem: (item:
|
|
152
|
+
export declare const useTimelineMarqueeSelectableItem: (item: CanvasSelectionItem | null, ref: React.RefObject<Element | null>) => void;
|
|
190
153
|
export declare const useTimelineRowSelection: (nodePathInfo: SequenceNodePathInfo | null) => {
|
|
191
|
-
onSelect: (interaction?:
|
|
154
|
+
onSelect: (interaction?: CanvasSelectionInteraction | undefined) => void;
|
|
192
155
|
selectable: boolean;
|
|
193
|
-
selectionItem:
|
|
156
|
+
selectionItem: CanvasSelectionItem | null;
|
|
194
157
|
selected: boolean;
|
|
195
158
|
};
|
|
196
159
|
export declare const useTimelineKeyframeSelection: (nodePathInfo: SequenceNodePathInfo, frame: number) => {
|
|
197
|
-
onSelect: (interaction?:
|
|
160
|
+
onSelect: (interaction?: CanvasSelectionInteraction | undefined) => void;
|
|
198
161
|
selectable: boolean;
|
|
199
|
-
selectionItem:
|
|
162
|
+
selectionItem: CanvasSelectionItem;
|
|
200
163
|
selected: boolean;
|
|
201
164
|
};
|
|
202
165
|
export declare const useTimelineEasingSelection: ({ nodePathInfo, fromFrame, toFrame, segmentIndex, }: {
|
|
@@ -205,7 +168,7 @@ export declare const useTimelineEasingSelection: ({ nodePathInfo, fromFrame, toF
|
|
|
205
168
|
readonly toFrame: number;
|
|
206
169
|
readonly segmentIndex: number;
|
|
207
170
|
}) => {
|
|
208
|
-
onSelect: (interaction?:
|
|
171
|
+
onSelect: (interaction?: CanvasSelectionInteraction | undefined) => void;
|
|
209
172
|
selectable: boolean;
|
|
210
173
|
selected: boolean;
|
|
211
174
|
selectionItem: {
|
|
@@ -221,7 +184,7 @@ export declare const useTimelineGuideSelection: (guideId: string) => {
|
|
|
221
184
|
onSelect: () => void;
|
|
222
185
|
selectable: boolean;
|
|
223
186
|
selected: boolean;
|
|
224
|
-
selectionItem:
|
|
187
|
+
selectionItem: CanvasSelectionItem;
|
|
225
188
|
};
|
|
226
189
|
export declare const useTimelineRowContainsSelection: (nodePathInfo: SequenceNodePathInfo | null) => boolean;
|
|
227
190
|
export declare const useTimelineRowHighlightBackground: (nodePathInfo: SequenceNodePathInfo | null, { hovered, selectedBackground, }: {
|