@remotion/studio 4.0.516 → 4.0.517
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 +1 -1
- 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/CheckboardToggle.js +1 -1
- package/dist/components/Checkbox.d.ts +0 -1
- package/dist/components/Checkbox.js +2 -19
- 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 +5 -2
- 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/ElementLibraryModal.d.ts +5 -0
- package/dist/components/ElementLibraryModal.js +38 -0
- package/dist/components/FilePreview.js +71 -0
- 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 +2 -1
- package/dist/components/PlaybackRateSelector.js +1 -1
- 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/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/SelectedOutlinePolygon.d.ts +1 -2
- package/dist/components/SelectedOutlineRenderer.d.ts +1 -2
- 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/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/canvas-capture-drop.d.ts +4 -0
- package/dist/components/canvas-capture-drop.js +22 -0
- package/dist/components/selected-outline-measurement.d.ts +7 -8
- package/dist/esm/{chunk-w4244j4n.js → chunk-gzqm3g2m.js} +15184 -8344
- package/dist/esm/internals.mjs +15184 -8344
- package/dist/esm/previewEntry.mjs +15096 -8256
- 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/editor-ruler.js +6 -5
- 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-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/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/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/package.json +14 -12
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useTimelineRowHighlightBackground = exports.useTimelineRowContainsSelection = exports.useTimelineGuideSelection = exports.useTimelineEasingSelection = exports.useTimelineKeyframeSelection = exports.useTimelineRowSelection = exports.useTimelineMarqueeSelectableItem = exports.useTimelineMarqueeSelection = exports.useCurrentTimelineSelectionStateAsRef = exports.TIMELINE_SCRUBBER_ATTR = exports.TIMELINE_MARQUEE_ITEM_ATTR = exports.useTimelineSelection = exports.TimelineSelectionProvider = exports.TimelineSelectableItemsProvider = exports.getTimelineSequenceSelectionForEscape = exports.TimelineSelectAllKeybindings = exports.getTimelineSequenceSelectionKey = exports.getSelectableTimelineItems = exports.getSelectableTimelineSequenceSelections = exports.getTimelineSelectionKey = exports.getTimelineSelectionFromNodePathInfo = exports.TimelineSelectionOrderProvider = exports.extendTimelineMarqueeSelection = exports.getTimelineMarqueeSelection = exports.timelineMarqueeRectsIntersect = exports.getClampedTimelineMarqueePoint = exports.getNormalizedTimelineMarqueeRect = exports.getAvailableTimelineSelectionState = exports.getTimelineSelectionAfterInteraction = exports.EMPTY_TIMELINE_SELECTION_STATE = exports.shouldSelectTimelineRowOnPointerDown = exports.isTimelineSelectionModifierEvent = exports.TIMELINE_TICKS_BACKGROUND = exports.TIMELINE_BACKGROUND = exports.getTimelineRowHighlightBackground = exports.getTimelineSelectedTrackHighlightStyle = exports.getTimelineColor = exports.getTimelineSelectedLabelStyle = exports.TIMELINE_SELECTED_LABEL_HORIZONTAL_PADDING = exports.TIMELINE_SELECTED_LABEL_TEXT = exports.TIMELINE_SELECTED_LABEL_BACKGROUND = exports.TIMELINE_HOVER_BACKGROUND = exports.TIMELINE_EXPANDED_SELECTED_BACKGROUND = exports.TIMELINE_SELECTED_BACKGROUND = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const canvas_1 = require("@remotion/canvas");
|
|
5
6
|
const studio_shared_1 = require("@remotion/studio-shared");
|
|
6
7
|
const react_1 = require("react");
|
|
7
8
|
const remotion_1 = require("remotion");
|
|
@@ -78,98 +79,8 @@ const shouldSelectTimelineRowOnPointerDown = ({ selected, shiftKey, metaKey, ctr
|
|
|
78
79
|
return (!selected || (0, exports.isTimelineSelectionModifierEvent)({ shiftKey, metaKey, ctrlKey }));
|
|
79
80
|
};
|
|
80
81
|
exports.shouldSelectTimelineRowOnPointerDown = shouldSelectTimelineRowOnPointerDown;
|
|
81
|
-
exports.EMPTY_TIMELINE_SELECTION_STATE =
|
|
82
|
-
|
|
83
|
-
anchor: null,
|
|
84
|
-
};
|
|
85
|
-
const getTimelineSelectionType = (item) => item.type;
|
|
86
|
-
const areTimelineSelectionTypesCompatible = (firstType, secondType) => {
|
|
87
|
-
if (firstType === secondType) {
|
|
88
|
-
return true;
|
|
89
|
-
}
|
|
90
|
-
return ((firstType === 'sequence-prop' && secondType === 'sequence-effect-prop') ||
|
|
91
|
-
(firstType === 'sequence-effect-prop' && secondType === 'sequence-prop') ||
|
|
92
|
-
(firstType === 'keyframe' && secondType === 'easing') ||
|
|
93
|
-
(firstType === 'easing' && secondType === 'keyframe'));
|
|
94
|
-
};
|
|
95
|
-
const isTimelineSelectionCompatibleWithType = (item, type) => areTimelineSelectionTypesCompatible(getTimelineSelectionType(item), type);
|
|
96
|
-
const getTimelineSelectionAnchor = (selectedItems, previousAnchor, targetType) => {
|
|
97
|
-
if (previousAnchor &&
|
|
98
|
-
getTimelineSelectionType(previousAnchor) === targetType) {
|
|
99
|
-
return previousAnchor;
|
|
100
|
-
}
|
|
101
|
-
for (let i = selectedItems.length - 1; i >= 0; i--) {
|
|
102
|
-
const candidate = selectedItems[i];
|
|
103
|
-
if (getTimelineSelectionType(candidate) === targetType) {
|
|
104
|
-
return candidate;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
return null;
|
|
108
|
-
};
|
|
109
|
-
const getRangeSelection = ({ anchor, clickedItem, allSelectableItems, }) => {
|
|
110
|
-
const anchorKey = (0, exports.getTimelineSelectionKey)(anchor);
|
|
111
|
-
const clickedKey = (0, exports.getTimelineSelectionKey)(clickedItem);
|
|
112
|
-
const orderedOfType = allSelectableItems.filter((item) => getTimelineSelectionType(item) === clickedItem.type);
|
|
113
|
-
const anchorIndex = orderedOfType.findIndex((item) => (0, exports.getTimelineSelectionKey)(item) === anchorKey);
|
|
114
|
-
const clickedIndex = orderedOfType.findIndex((item) => (0, exports.getTimelineSelectionKey)(item) === clickedKey);
|
|
115
|
-
if (anchorIndex === -1 || clickedIndex === -1) {
|
|
116
|
-
return [clickedItem];
|
|
117
|
-
}
|
|
118
|
-
const [from, to] = anchorIndex < clickedIndex
|
|
119
|
-
? [anchorIndex, clickedIndex]
|
|
120
|
-
: [clickedIndex, anchorIndex];
|
|
121
|
-
return orderedOfType.slice(from, to + 1);
|
|
122
|
-
};
|
|
123
|
-
const getTimelineSelectionAfterInteraction = ({ currentState, clickedItem, interaction, allSelectableItems, }) => {
|
|
124
|
-
const { selectedItems, anchor: previousAnchor } = currentState;
|
|
125
|
-
const clickedType = getTimelineSelectionType(clickedItem);
|
|
126
|
-
if (clickedType === 'guide') {
|
|
127
|
-
return {
|
|
128
|
-
selectedItems: [clickedItem],
|
|
129
|
-
anchor: clickedItem,
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
const nextAnchor = getTimelineSelectionAnchor(selectedItems, previousAnchor, clickedType);
|
|
133
|
-
const clickedKey = (0, exports.getTimelineSelectionKey)(clickedItem);
|
|
134
|
-
if (interaction.shiftKey && nextAnchor) {
|
|
135
|
-
return {
|
|
136
|
-
selectedItems: getRangeSelection({
|
|
137
|
-
anchor: nextAnchor,
|
|
138
|
-
clickedItem,
|
|
139
|
-
allSelectableItems,
|
|
140
|
-
}),
|
|
141
|
-
anchor: nextAnchor,
|
|
142
|
-
};
|
|
143
|
-
}
|
|
144
|
-
if (interaction.toggleKey) {
|
|
145
|
-
const compatibleItems = selectedItems.filter((item) => isTimelineSelectionCompatibleWithType(item, clickedType));
|
|
146
|
-
const existingKeySet = new Set(compatibleItems.map(exports.getTimelineSelectionKey));
|
|
147
|
-
if (existingKeySet.has(clickedKey)) {
|
|
148
|
-
const toggledSelection = compatibleItems.filter((item) => (0, exports.getTimelineSelectionKey)(item) !== clickedKey);
|
|
149
|
-
return {
|
|
150
|
-
selectedItems: toggledSelection,
|
|
151
|
-
anchor: toggledSelection.length === 0 ? null : clickedItem,
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
|
-
const selectableOrderMap = new Map(allSelectableItems
|
|
155
|
-
.filter((item) => isTimelineSelectionCompatibleWithType(item, clickedType))
|
|
156
|
-
.map((item, index) => [(0, exports.getTimelineSelectionKey)(item), index]));
|
|
157
|
-
const extendedSelection = [...compatibleItems, clickedItem].sort((a, b) => {
|
|
158
|
-
var _a, _b;
|
|
159
|
-
return (((_a = selectableOrderMap.get((0, exports.getTimelineSelectionKey)(a))) !== null && _a !== void 0 ? _a : 0) -
|
|
160
|
-
((_b = selectableOrderMap.get((0, exports.getTimelineSelectionKey)(b))) !== null && _b !== void 0 ? _b : 0));
|
|
161
|
-
});
|
|
162
|
-
return {
|
|
163
|
-
selectedItems: extendedSelection,
|
|
164
|
-
anchor: clickedItem,
|
|
165
|
-
};
|
|
166
|
-
}
|
|
167
|
-
return {
|
|
168
|
-
selectedItems: [clickedItem],
|
|
169
|
-
anchor: clickedItem,
|
|
170
|
-
};
|
|
171
|
-
};
|
|
172
|
-
exports.getTimelineSelectionAfterInteraction = getTimelineSelectionAfterInteraction;
|
|
82
|
+
exports.EMPTY_TIMELINE_SELECTION_STATE = canvas_1.EMPTY_CANVAS_SELECTION;
|
|
83
|
+
exports.getTimelineSelectionAfterInteraction = canvas_1.getCanvasSelectionAfterInteraction;
|
|
173
84
|
const getAvailableTimelineSelectionState = ({ availableKeys, availableItemsByKey, state, }) => {
|
|
174
85
|
if (state.selectedItems.length === 0 && state.anchor === null) {
|
|
175
86
|
return state;
|
|
@@ -361,29 +272,7 @@ const getTimelineSelectionFromNodePathInfo = (nodePathInfo) => {
|
|
|
361
272
|
return null;
|
|
362
273
|
};
|
|
363
274
|
exports.getTimelineSelectionFromNodePathInfo = getTimelineSelectionFromNodePathInfo;
|
|
364
|
-
|
|
365
|
-
switch (item.type) {
|
|
366
|
-
case 'guide':
|
|
367
|
-
return `guide.${item.guideId}`;
|
|
368
|
-
case 'sequence':
|
|
369
|
-
return `${(0, exports.getTimelineSequenceSelectionKey)(item.nodePathInfo)}.sequence`;
|
|
370
|
-
case 'sequence-prop':
|
|
371
|
-
return `${(0, exports.getTimelineSequenceSelectionKey)(item.nodePathInfo)}.sequence-prop.${item.key}`;
|
|
372
|
-
case 'sequence-all-effects':
|
|
373
|
-
return `${(0, exports.getTimelineSequenceSelectionKey)(item.nodePathInfo)}.sequence-all-effects`;
|
|
374
|
-
case 'sequence-effect':
|
|
375
|
-
return `${(0, exports.getTimelineSequenceSelectionKey)(item.nodePathInfo)}.sequence-effect.${item.i}`;
|
|
376
|
-
case 'sequence-effect-prop':
|
|
377
|
-
return `${(0, exports.getTimelineSequenceSelectionKey)(item.nodePathInfo)}.sequence-effect-prop.${item.i}.${item.key}`;
|
|
378
|
-
case 'keyframe':
|
|
379
|
-
return `${(0, timeline_node_path_key_1.timelineNodePathInfoToKey)(item.nodePathInfo)}.keyframe.${item.frame}`;
|
|
380
|
-
case 'easing':
|
|
381
|
-
return `${(0, timeline_node_path_key_1.timelineNodePathInfoToKey)(item.nodePathInfo)}.easing.${item.segmentIndex}`;
|
|
382
|
-
default:
|
|
383
|
-
throw new Error(`Unexpected timeline selection type: ${item}`);
|
|
384
|
-
}
|
|
385
|
-
};
|
|
386
|
-
exports.getTimelineSelectionKey = getTimelineSelectionKey;
|
|
275
|
+
exports.getTimelineSelectionKey = canvas_1.getCanvasSelectionItemKey;
|
|
387
276
|
const nodePathDescendsFrom = (descendant, ancestor) => {
|
|
388
277
|
if ((0, studio_shared_1.stringifySequenceExpandedRowKey)(descendant.sequenceSubscriptionKey) !==
|
|
389
278
|
(0, studio_shared_1.stringifySequenceExpandedRowKey)(ancestor.sequenceSubscriptionKey)) {
|
|
@@ -511,8 +400,7 @@ const getSelectableTimelineItems = ({ getDragOverrides, getEffectDragOverrides,
|
|
|
511
400
|
});
|
|
512
401
|
};
|
|
513
402
|
exports.getSelectableTimelineItems = getSelectableTimelineItems;
|
|
514
|
-
|
|
515
|
-
exports.getTimelineSequenceSelectionKey = getTimelineSequenceSelectionKey;
|
|
403
|
+
exports.getTimelineSequenceSelectionKey = canvas_1.getCanvasSequenceSelectionKey;
|
|
516
404
|
const TimelineSelectAllKeybindings = ({ timeline }) => {
|
|
517
405
|
const keybindings = (0, use_keybinding_1.useKeybinding)();
|
|
518
406
|
const { canSelect } = (0, exports.useTimelineSelection)();
|
|
@@ -647,8 +535,8 @@ const TimelineSelectionProvider = ({ children }) => {
|
|
|
647
535
|
(previewServerState.type === 'connected' ||
|
|
648
536
|
window.remotion_isReadOnlyStudio);
|
|
649
537
|
const keyframeOperationsAvailable = (0, browser_studio_operations_1.canUseKeyframeOperations)();
|
|
650
|
-
const
|
|
651
|
-
const
|
|
538
|
+
const selectionController = (0, canvas_1.useCanvasSelectionController)();
|
|
539
|
+
const selectionState = (0, canvas_1.useCanvasSelection)(selectionController);
|
|
652
540
|
const selectionScope = (0, react_1.useRef)(null);
|
|
653
541
|
const marqueeSelectableItems = (0, react_1.useRef)(new Map());
|
|
654
542
|
const marqueeRegistrationCounter = (0, react_1.useRef)(0);
|
|
@@ -656,25 +544,17 @@ const TimelineSelectionProvider = ({ children }) => {
|
|
|
656
544
|
(0, react_1.useEffect)(() => {
|
|
657
545
|
if (!canSelect) {
|
|
658
546
|
selectionScope.current = null;
|
|
659
|
-
selectionAnchor.current = null;
|
|
660
547
|
setRevealRequest(null);
|
|
661
|
-
|
|
548
|
+
selectionController.clear();
|
|
662
549
|
}
|
|
663
|
-
}, [canSelect]);
|
|
550
|
+
}, [canSelect, selectionController]);
|
|
664
551
|
const canSelectItem = (0, react_1.useCallback)((item) => canSelect &&
|
|
665
552
|
(!window.remotion_isReadOnlyStudio ||
|
|
666
553
|
keyframeOperationsAvailable ||
|
|
667
554
|
item.type === 'sequence'), [canSelect, keyframeOperationsAvailable]);
|
|
668
|
-
const
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
}
|
|
672
|
-
return {
|
|
673
|
-
selectedItems: currentSelectedItems,
|
|
674
|
-
anchor: selectionAnchor.current,
|
|
675
|
-
};
|
|
676
|
-
}, [timelineSelectionScope]);
|
|
677
|
-
const availableSelectionState = getCurrentAvailableSelectionState(selectedItems);
|
|
555
|
+
const availableSelectionState = selectionScope.current === timelineSelectionScope
|
|
556
|
+
? selectionState
|
|
557
|
+
: exports.EMPTY_TIMELINE_SELECTION_STATE;
|
|
678
558
|
const availableSelectedItems = availableSelectionState.selectedItems;
|
|
679
559
|
const requestRevealSelectionItem = (0, react_1.useCallback)((item) => {
|
|
680
560
|
setRevealRequest((previousRequest) => {
|
|
@@ -700,22 +580,12 @@ const TimelineSelectionProvider = ({ children }) => {
|
|
|
700
580
|
expandParentTracks(item.nodePathInfo);
|
|
701
581
|
}, [expandParentTracks]);
|
|
702
582
|
(0, react_1.useEffect)(() => {
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
: exports.EMPTY_TIMELINE_SELECTION_STATE;
|
|
710
|
-
selectionScope.current = timelineSelectionScope;
|
|
711
|
-
selectionAnchor.current = nextState.anchor;
|
|
712
|
-
if (nextState.selectedItems.length === currentSelectedItems.length &&
|
|
713
|
-
nextState.selectedItems.every((item, index) => item === currentSelectedItems[index])) {
|
|
714
|
-
return currentSelectedItems;
|
|
715
|
-
}
|
|
716
|
-
return nextState.selectedItems;
|
|
717
|
-
});
|
|
718
|
-
}, [timelineSelectionScope]);
|
|
583
|
+
if (selectionScope.current === timelineSelectionScope) {
|
|
584
|
+
return;
|
|
585
|
+
}
|
|
586
|
+
selectionScope.current = timelineSelectionScope;
|
|
587
|
+
selectionController.clear();
|
|
588
|
+
}, [selectionController, timelineSelectionScope]);
|
|
719
589
|
const selectedKeys = (0, react_1.useMemo)(() => new Set(availableSelectedItems.map(exports.getTimelineSelectionKey)), [availableSelectedItems]);
|
|
720
590
|
const isSelected = (0, react_1.useCallback)((item) => {
|
|
721
591
|
return selectedKeys.has((0, exports.getTimelineSelectionKey)(item));
|
|
@@ -732,26 +602,16 @@ const TimelineSelectionProvider = ({ children }) => {
|
|
|
732
602
|
if (options.reveal) {
|
|
733
603
|
requestRevealSelectionItem(item);
|
|
734
604
|
}
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
anchor: currentSelectionState.anchor,
|
|
741
|
-
},
|
|
742
|
-
clickedItem: item,
|
|
743
|
-
interaction,
|
|
744
|
-
allSelectableItems,
|
|
745
|
-
});
|
|
746
|
-
selectionScope.current = timelineSelectionScope;
|
|
747
|
-
selectionAnchor.current = nextState.anchor;
|
|
748
|
-
return nextState.selectedItems;
|
|
749
|
-
});
|
|
605
|
+
if (selectionScope.current !== timelineSelectionScope) {
|
|
606
|
+
selectionController.clear();
|
|
607
|
+
}
|
|
608
|
+
selectionScope.current = timelineSelectionScope;
|
|
609
|
+
selectionController.select(item, interaction, allSelectableItems);
|
|
750
610
|
}, [
|
|
751
611
|
canSelectItem,
|
|
752
612
|
expandParentsForSelectionItem,
|
|
753
|
-
getCurrentAvailableSelectionState,
|
|
754
613
|
requestRevealSelectionItem,
|
|
614
|
+
selectionController,
|
|
755
615
|
timelineSelectionScope,
|
|
756
616
|
]);
|
|
757
617
|
const selectItems = (0, react_1.useCallback)((items, options = {}) => {
|
|
@@ -762,17 +622,16 @@ const TimelineSelectionProvider = ({ children }) => {
|
|
|
762
622
|
(0, options_sidebar_tabs_1.selectOptionsSidebarInspectorPanel)();
|
|
763
623
|
}
|
|
764
624
|
selectionScope.current = timelineSelectionScope;
|
|
765
|
-
selectionAnchor.current =
|
|
766
|
-
items.length === 0 ? null : items[items.length - 1];
|
|
767
625
|
expandParentsForSelectionItems(items);
|
|
768
626
|
if (options.reveal && items.length === 1) {
|
|
769
627
|
requestRevealSelectionItem(items[0]);
|
|
770
628
|
}
|
|
771
|
-
setSelectedItems(items);
|
|
629
|
+
selectionController.setSelectedItems(items);
|
|
772
630
|
}, [
|
|
773
631
|
canSelectItem,
|
|
774
632
|
expandParentsForSelectionItems,
|
|
775
633
|
requestRevealSelectionItem,
|
|
634
|
+
selectionController,
|
|
776
635
|
timelineSelectionScope,
|
|
777
636
|
]);
|
|
778
637
|
const registerMarqueeSelectableItem = (0, react_1.useCallback)((item, getRect) => {
|
|
@@ -819,9 +678,8 @@ const TimelineSelectionProvider = ({ children }) => {
|
|
|
819
678
|
}, [canSelectItem]);
|
|
820
679
|
const clearSelection = (0, react_1.useCallback)(() => {
|
|
821
680
|
selectionScope.current = null;
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
}, []);
|
|
681
|
+
selectionController.clear();
|
|
682
|
+
}, [selectionController]);
|
|
825
683
|
const containsSelection = (0, react_1.useCallback)((nodePathInfo) => {
|
|
826
684
|
return availableSelectedItems.some((selected) => selected.type !== 'guide' &&
|
|
827
685
|
nodePathDescendsFrom(selected.nodePathInfo, nodePathInfo));
|
|
@@ -982,7 +840,9 @@ const useTimelineMarqueeSelection = () => {
|
|
|
982
840
|
: nextSelection.selectedItems);
|
|
983
841
|
};
|
|
984
842
|
const autoScroll = (0, timeline_scroll_logic_1.startTimelineEdgeAutoScroll)({
|
|
843
|
+
includeHorizontal: true,
|
|
985
844
|
includeVertical: true,
|
|
845
|
+
verticalTopOffset: 0,
|
|
986
846
|
onTick: (directions) => {
|
|
987
847
|
if (scrollable && directions.x !== null) {
|
|
988
848
|
scrollable.scrollLeft +=
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { TSequence } from 'remotion';
|
|
3
3
|
import type { SequenceNodePathInfo } from '../../helpers/get-timeline-sequence-sort-key';
|
|
4
|
+
export declare const SEQUENCE_REORDER_MIME_TYPE = "application/remotion-sequence-reorder";
|
|
4
5
|
export declare const TimelineSequenceItem: React.NamedExoticComponent<{
|
|
5
6
|
readonly afterDropLineOffset: number;
|
|
6
7
|
readonly sequence: TSequence;
|
|
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.TimelineSequenceItem = void 0;
|
|
36
|
+
exports.TimelineSequenceItem = exports.SEQUENCE_REORDER_MIME_TYPE = void 0;
|
|
37
37
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
38
|
const react_1 = __importStar(require("react"));
|
|
39
39
|
const remotion_1 = require("remotion");
|
|
@@ -98,7 +98,7 @@ const effectDropHighlight = {
|
|
|
98
98
|
outline: colors_1.BORDER_TIMELINE_DROP_BLUE,
|
|
99
99
|
outlineOffset: -1,
|
|
100
100
|
};
|
|
101
|
-
|
|
101
|
+
exports.SEQUENCE_REORDER_MIME_TYPE = 'application/remotion-sequence-reorder';
|
|
102
102
|
let currentSequenceDrag = null;
|
|
103
103
|
const TimelineSequenceExpandArrowInner = ({ disabled, isExpanded, nodePathInfo, sequence }) => {
|
|
104
104
|
const { toggleTrack } = (0, react_1.useContext)(ExpandedTracksProvider_1.ExpandedTracksSetterContext);
|
|
@@ -146,7 +146,7 @@ const sequenceReorderAfterLine = {
|
|
|
146
146
|
top: -1,
|
|
147
147
|
};
|
|
148
148
|
const hasSequenceReorderDragType = (dataTransfer) => {
|
|
149
|
-
return Array.from(dataTransfer.types).includes(SEQUENCE_REORDER_MIME_TYPE);
|
|
149
|
+
return Array.from(dataTransfer.types).includes(exports.SEQUENCE_REORDER_MIME_TYPE);
|
|
150
150
|
};
|
|
151
151
|
const isSequenceReorderDrag = (dataTransfer) => {
|
|
152
152
|
return (currentSequenceDrag !== null || hasSequenceReorderDragType(dataTransfer));
|
|
@@ -155,7 +155,7 @@ const getSequenceReorderDragData = (dataTransfer) => {
|
|
|
155
155
|
if (currentSequenceDrag) {
|
|
156
156
|
return currentSequenceDrag;
|
|
157
157
|
}
|
|
158
|
-
const value = dataTransfer.getData(SEQUENCE_REORDER_MIME_TYPE);
|
|
158
|
+
const value = dataTransfer.getData(exports.SEQUENCE_REORDER_MIME_TYPE);
|
|
159
159
|
if (!value) {
|
|
160
160
|
return null;
|
|
161
161
|
}
|
|
@@ -378,7 +378,7 @@ const TimelineSequenceItemInner = ({ afterDropLineOffset, connectedCompositions,
|
|
|
378
378
|
};
|
|
379
379
|
currentSequenceDrag = dragData;
|
|
380
380
|
e.dataTransfer.effectAllowed = 'move';
|
|
381
|
-
e.dataTransfer.setData(SEQUENCE_REORDER_MIME_TYPE, JSON.stringify(dragData));
|
|
381
|
+
e.dataTransfer.setData(exports.SEQUENCE_REORDER_MIME_TYPE, JSON.stringify(dragData));
|
|
382
382
|
e.stopPropagation();
|
|
383
383
|
}, [
|
|
384
384
|
canReorderSequence,
|
|
@@ -913,7 +913,9 @@ const TimelineSequenceItemInner = ({ afterDropLineOffset, connectedCompositions,
|
|
|
913
913
|
}, [canDropEffect, nodePath, previewServerState, validatedLocation]);
|
|
914
914
|
const trackRow = (jsx_runtime_1.jsx(TimelineRowChrome_1.TimelineRowChrome, { depth: nestedDepth, eye: canToggleVisibility ? (jsx_runtime_1.jsx(TimelineLayerEye_1.TimelineLayerEye, { type: sequence.type === 'audio' ? 'speaker' : 'eye', hidden: isItemHidden, onInvoked: onToggleVisibility })) : (jsx_runtime_1.jsx(TimelineLayerEye_1.TimelineLayerEyeSpacer, {})), arrow: jsx_runtime_1.jsx(TimelineExpandArrowButton_1.TimelineExpandArrowSpacer, {}), style: rowStyle, selected: selected, selectable: selectable, onSelect: onSelect, showSelectedBackground: true, containsSelection: containsSelection, hovered: hovered, outerHeight: outerHeight, onDragLeave: canDropEffect ? onEffectDragLeave : undefined, onDragOver: canDropEffect ? onEffectDragOver : undefined, onDrop: canDropEffect ? onEffectDrop : undefined, onDoubleClick: canHandleSequenceDoubleClick ? onSequenceDoubleClick : undefined, onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, children: jsx_runtime_1.jsxs("div", { style: labelContainerStyle, children: [connectedCompositions.length > 0 ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
915
915
|
jsx_runtime_1.jsx(CompositionOrStillIcon_1.CompositionOrStillIcon, { color: (0, TimelineSelection_1.getTimelineColor)(false, false), composition: connectedCompositions[0], style: connectedCompositionIconStyle }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 })
|
|
916
|
-
] })) : null, jsx_runtime_1.jsx(TimelineSequenceName_1.TimelineSequenceName, { displayName: timelineDisplayName, fallbackDisplayName: fallbackDisplayName, selected: selected, containsSelection: containsSelection, editing: isRenaming, onCancelEditing: onCancelRenaming, onSaveName: onSaveName }), hasExpandableContent && nodePathInfo !== null ? (jsx_runtime_1.
|
|
916
|
+
] })) : null, jsx_runtime_1.jsx(TimelineSequenceName_1.TimelineSequenceName, { displayName: timelineDisplayName, fallbackDisplayName: fallbackDisplayName, selected: selected, containsSelection: containsSelection, editing: isRenaming, onCancelEditing: onCancelRenaming, onSaveName: onSaveName }), hasExpandableContent && nodePathInfo !== null ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
917
|
+
jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }), jsx_runtime_1.jsx(TimelineSequenceExpandArrow, { disabled: !previewInteractive, isExpanded: isExpanded, nodePathInfo: nodePathInfo, sequence: sequence })
|
|
918
|
+
] })) : null, numberOfHiddenDuplicates > 0 ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
917
919
|
jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }), jsx_runtime_1.jsx(TimelineDuplicateCount_1.TimelineDuplicateCount, { count: numberOfHiddenDuplicates })
|
|
918
920
|
] })) : null, mediaSrc ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
919
921
|
jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }),
|
|
@@ -3,7 +3,6 @@ import type { CanUpdateSequencePropStatus, CanUpdateSequencePropStatusKeyframed,
|
|
|
3
3
|
import type { SequenceNodePathInfo } from '../../helpers/get-timeline-sequence-sort-key';
|
|
4
4
|
import type { MoveEffectKeyframeChange, MoveSequenceKeyframeChange } from './call-move-keyframe';
|
|
5
5
|
import { type SaveSequencePropChange } from './save-sequence-prop';
|
|
6
|
-
import { type TimelineSelection } from './TimelineSelection';
|
|
7
6
|
export declare const timelineSequenceFromDragSnapThresholdPx = 10;
|
|
8
7
|
export type TimelineSequenceDurationDragTarget = {
|
|
9
8
|
readonly fileName: string;
|
|
@@ -105,21 +104,21 @@ export declare const getTimelineSequenceFromDragKeyframeMoves: ({ targets, delta
|
|
|
105
104
|
};
|
|
106
105
|
export declare const getTimelineSequenceDurationDragTargets: ({ draggedNodePathInfo, selectedItems, sequences, overrideIdsToNodePaths, propStatuses, }: {
|
|
107
106
|
readonly draggedNodePathInfo: SequenceNodePathInfo;
|
|
108
|
-
readonly selectedItems: readonly
|
|
107
|
+
readonly selectedItems: readonly import("@remotion/canvas").CanvasSelectionItem[];
|
|
109
108
|
readonly sequences: TSequence[];
|
|
110
109
|
readonly overrideIdsToNodePaths: OverrideIdToNodePaths;
|
|
111
110
|
readonly propStatuses: PropStatuses;
|
|
112
111
|
}) => TimelineSequenceDurationDragTarget[] | null;
|
|
113
112
|
export declare const getTimelineSequenceLeftEdgeDragTargets: ({ draggedNodePathInfo, selectedItems, sequences, overrideIdsToNodePaths, propStatuses, }: {
|
|
114
113
|
readonly draggedNodePathInfo: SequenceNodePathInfo;
|
|
115
|
-
readonly selectedItems: readonly
|
|
114
|
+
readonly selectedItems: readonly import("@remotion/canvas").CanvasSelectionItem[];
|
|
116
115
|
readonly sequences: TSequence[];
|
|
117
116
|
readonly overrideIdsToNodePaths: OverrideIdToNodePaths;
|
|
118
117
|
readonly propStatuses: PropStatuses;
|
|
119
118
|
}) => TimelineSequenceLeftEdgeDragTarget[] | null;
|
|
120
119
|
export declare const getTimelineSequenceFromDragTargets: ({ draggedNodePathInfo, selectedItems, sequences, overrideIdsToNodePaths, propStatuses, }: {
|
|
121
120
|
readonly draggedNodePathInfo: SequenceNodePathInfo;
|
|
122
|
-
readonly selectedItems: readonly
|
|
121
|
+
readonly selectedItems: readonly import("@remotion/canvas").CanvasSelectionItem[];
|
|
123
122
|
readonly sequences: TSequence[];
|
|
124
123
|
readonly overrideIdsToNodePaths: OverrideIdToNodePaths;
|
|
125
124
|
readonly propStatuses: PropStatuses;
|
|
@@ -2,17 +2,16 @@ import type { OverrideIdToNodePaths, PropStatuses, TSequence } from 'remotion';
|
|
|
2
2
|
import type { SequenceNodePathInfo } from '../../helpers/get-timeline-sequence-sort-key';
|
|
3
3
|
import type { ConfirmationDialogFunction } from '../ConfirmationDialog-types';
|
|
4
4
|
import type { SetPropStatuses } from './save-sequence-prop';
|
|
5
|
-
import { type TimelineSelection } from './TimelineSelection';
|
|
6
5
|
export declare const deleteSequencesFromSource: (nodePathInfos: SequenceNodePathInfo[], confirm: ConfirmationDialogFunction) => Promise<boolean>;
|
|
7
6
|
export declare const getTimelineSelectionAfterDeletingItems: ({ selections, sequences, overrideIdsToNodePaths, propStatuses, timelinePosition, }: {
|
|
8
|
-
readonly selections: readonly
|
|
7
|
+
readonly selections: readonly import("@remotion/canvas").CanvasSelectionItem[];
|
|
9
8
|
readonly sequences?: TSequence[] | undefined;
|
|
10
9
|
readonly overrideIdsToNodePaths?: OverrideIdToNodePaths | undefined;
|
|
11
10
|
readonly propStatuses?: PropStatuses | undefined;
|
|
12
11
|
readonly timelinePosition?: number | undefined;
|
|
13
|
-
}) => readonly
|
|
12
|
+
}) => readonly import("@remotion/canvas").CanvasSelectionItem[];
|
|
14
13
|
export declare const deleteSelectedTimelineItems: ({ selections, sequences, overrideIdsToNodePaths, setPropStatuses, clientId, confirm, propStatuses, timelinePosition, }: {
|
|
15
|
-
selections: readonly
|
|
14
|
+
selections: readonly import("@remotion/canvas").CanvasSelectionItem[];
|
|
16
15
|
sequences: TSequence[];
|
|
17
16
|
overrideIdsToNodePaths: OverrideIdToNodePaths;
|
|
18
17
|
setPropStatuses: SetPropStatuses;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import type { SequenceNodePathInfo } from '../../helpers/get-timeline-sequence-sort-key';
|
|
2
2
|
import type { ConfirmationDialogFunction } from '../ConfirmationDialog-types';
|
|
3
|
-
import type { TimelineSelection } from './TimelineSelection';
|
|
4
3
|
export declare const duplicateSequencesFromSource: (nodePathInfos: readonly SequenceNodePathInfo[], confirm: ConfirmationDialogFunction) => Promise<void>;
|
|
5
|
-
export declare const isDuplicatableSequenceRowSelection: (selection:
|
|
4
|
+
export declare const isDuplicatableSequenceRowSelection: (selection: import("@remotion/canvas").CanvasSelectionItem) => selection is {
|
|
6
5
|
readonly type: "sequence";
|
|
7
6
|
readonly nodePathInfo: SequenceNodePathInfo;
|
|
8
7
|
} & {
|
|
9
8
|
type: "sequence";
|
|
10
9
|
};
|
|
11
|
-
export declare const isDuplicatableEffectSelection: (selection:
|
|
10
|
+
export declare const isDuplicatableEffectSelection: (selection: import("@remotion/canvas").CanvasSelectionItem) => selection is {
|
|
12
11
|
readonly type: "sequence-effect";
|
|
13
12
|
readonly nodePathInfo: SequenceNodePathInfo;
|
|
14
13
|
readonly i: number;
|
|
@@ -16,6 +15,6 @@ export declare const isDuplicatableEffectSelection: (selection: TimelineSelectio
|
|
|
16
15
|
type: "sequence-effect";
|
|
17
16
|
};
|
|
18
17
|
export declare const duplicateSelectedTimelineItems: ({ selections, confirm, }: {
|
|
19
|
-
selections: readonly
|
|
18
|
+
selections: readonly import("@remotion/canvas").CanvasSelectionItem[];
|
|
20
19
|
confirm: ConfirmationDialogFunction;
|
|
21
20
|
}) => Promise<void> | null;
|
|
@@ -4,4 +4,4 @@ export declare const findTrackForNodePathInfo: ({ sequences, overrideIdsToNodePa
|
|
|
4
4
|
sequences: TSequence[];
|
|
5
5
|
overrideIdsToNodePaths: OverrideIdToNodePaths;
|
|
6
6
|
nodePathInfo: SequenceNodePathInfo;
|
|
7
|
-
}) => import("
|
|
7
|
+
}) => import("@remotion/canvas").TimelineTrackData | undefined;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { KeyframeClipboardData, KeyframeClipboardFieldType } from '@remotion/studio-shared';
|
|
2
2
|
import { type InteractivitySchema, type OverrideIdToNodePaths, type PropStatuses, type SequencePropsSubscriptionKey, type TSequence } from 'remotion';
|
|
3
|
-
import type { TimelineSelection } from './TimelineSelection';
|
|
4
3
|
export declare const getKeyframeClipboardDataFromSelections: ({ selections, sequences, overrideIdsToNodePaths, propStatuses, }: {
|
|
5
|
-
readonly selections: readonly
|
|
4
|
+
readonly selections: readonly import("@remotion/canvas").CanvasSelectionItem[];
|
|
6
5
|
readonly sequences: TSequence[];
|
|
7
6
|
readonly overrideIdsToNodePaths: OverrideIdToNodePaths;
|
|
8
7
|
readonly propStatuses: PropStatuses;
|
|
@@ -29,7 +28,7 @@ export declare const isKeyframeValueCompatible: ({ value, fieldType, }: {
|
|
|
29
28
|
readonly fieldType: KeyframeClipboardFieldType | null;
|
|
30
29
|
}) => boolean;
|
|
31
30
|
export declare const getPasteKeyframeTarget: ({ selectedItems, payload, timelinePosition, sequences, overrideIdsToNodePaths, propStatuses, }: {
|
|
32
|
-
readonly selectedItems: readonly
|
|
31
|
+
readonly selectedItems: readonly import("@remotion/canvas").CanvasSelectionItem[];
|
|
33
32
|
readonly payload: KeyframeClipboardData;
|
|
34
33
|
readonly timelinePosition: number;
|
|
35
34
|
readonly sequences: TSequence[];
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { OverrideIdToNodePaths, PropStatuses, SequencePropsSubscriptionKey, InteractivitySchema, TSequence } from 'remotion';
|
|
2
2
|
import type { SetPropStatuses } from './save-sequence-prop';
|
|
3
|
-
import type { TimelineSelection } from './TimelineSelection';
|
|
4
3
|
type SequencePropResetTarget = {
|
|
5
4
|
readonly type: 'sequence-prop';
|
|
6
5
|
readonly fileName: string;
|
|
@@ -22,13 +21,13 @@ type EffectPropResetTarget = {
|
|
|
22
21
|
};
|
|
23
22
|
type TimelinePropResetTarget = SequencePropResetTarget | EffectPropResetTarget;
|
|
24
23
|
export declare const getTimelinePropResetTargets: ({ selections, sequences, overrideIdsToNodePaths, propStatuses, }: {
|
|
25
|
-
readonly selections: readonly
|
|
24
|
+
readonly selections: readonly import("@remotion/canvas").CanvasSelectionItem[];
|
|
26
25
|
readonly sequences: TSequence[];
|
|
27
26
|
readonly overrideIdsToNodePaths: OverrideIdToNodePaths;
|
|
28
27
|
readonly propStatuses: PropStatuses;
|
|
29
28
|
}) => TimelinePropResetTarget[] | null;
|
|
30
29
|
export declare const resetSelectedTimelineProps: ({ selections, sequences, overrideIdsToNodePaths, propStatuses, setPropStatuses, clientId, }: {
|
|
31
|
-
readonly selections: readonly
|
|
30
|
+
readonly selections: readonly import("@remotion/canvas").CanvasSelectionItem[];
|
|
32
31
|
readonly sequences: TSequence[];
|
|
33
32
|
readonly overrideIdsToNodePaths: OverrideIdToNodePaths;
|
|
34
33
|
readonly propStatuses: PropStatuses;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { type EffectClipboardParam, type SequencePropClipboardData } from '@remotion/studio-shared';
|
|
2
2
|
import { type CanUpdateSequencePropStatus, type InteractivitySchema, type OverrideIdToNodePaths, type PropStatuses, type SequencePropsSubscriptionKey, type TSequence } from 'remotion';
|
|
3
|
-
import type { TimelineSelection } from './TimelineSelection';
|
|
4
3
|
export declare const propStatusToClipboardParam: (prop: CanUpdateSequencePropStatus) => EffectClipboardParam | null;
|
|
5
4
|
export declare const getSequencePropClipboardDataFromSelection: ({ selection, propStatuses, sequences, overrideIdsToNodePaths, }: {
|
|
6
|
-
readonly selection:
|
|
5
|
+
readonly selection: import("@remotion/canvas").CanvasSelectionItem;
|
|
7
6
|
readonly propStatuses: PropStatuses;
|
|
8
7
|
readonly sequences: TSequence[];
|
|
9
8
|
readonly overrideIdsToNodePaths: OverrideIdToNodePaths;
|
|
@@ -22,7 +21,7 @@ export type PasteSequencePropTarget = {
|
|
|
22
21
|
readonly type: 'none' | 'prop-mismatch' | 'uncopyable' | 'incompatible';
|
|
23
22
|
};
|
|
24
23
|
export declare const getPasteSequencePropTarget: ({ selectedItems, payload, propStatuses, sequences, overrideIdsToNodePaths, }: {
|
|
25
|
-
readonly selectedItems: readonly
|
|
24
|
+
readonly selectedItems: readonly import("@remotion/canvas").CanvasSelectionItem[];
|
|
26
25
|
readonly payload: SequencePropClipboardData;
|
|
27
26
|
readonly propStatuses: PropStatuses;
|
|
28
27
|
readonly sequences: TSequence[];
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { CanUpdateSequencePropStatus, OverrideIdToNodePaths, PropStatuses, TSequence } from 'remotion';
|
|
2
2
|
import type { SequenceNodePathInfo } from '../../helpers/get-timeline-sequence-sort-key';
|
|
3
|
-
import type { TimelineSelection } from './TimelineSelection';
|
|
4
3
|
export type SplitTimelineSequenceEligibility = {
|
|
5
4
|
canSplit: true;
|
|
6
5
|
nodePathInfo: SequenceNodePathInfo;
|
|
@@ -9,7 +8,7 @@ export type SplitTimelineSequenceEligibility = {
|
|
|
9
8
|
reason: string;
|
|
10
9
|
};
|
|
11
10
|
export declare const getTimelineSequenceSplitEligibility: ({ selection, sequence, splitFrame, propStatuses, }: {
|
|
12
|
-
selection:
|
|
11
|
+
selection: import("@remotion/canvas").CanvasSelectionItem;
|
|
13
12
|
sequence: TSequence | null;
|
|
14
13
|
splitFrame: number;
|
|
15
14
|
propStatuses?: Partial<Record<"durationInFrames" | "from" | "trimBefore", CanUpdateSequencePropStatus>> | undefined;
|
|
@@ -25,7 +24,7 @@ export declare const shouldHandleTimelineSplitShortcut: ({ shiftKey, }: {
|
|
|
25
24
|
readonly shiftKey: boolean;
|
|
26
25
|
}) => boolean;
|
|
27
26
|
export declare const splitSelectedTimelineItems: ({ selections, sequences, overrideIdsToNodePaths, propStatuses, splitFrame, splitSequence, }: {
|
|
28
|
-
selections: readonly
|
|
27
|
+
selections: readonly import("@remotion/canvas").CanvasSelectionItem[];
|
|
29
28
|
sequences: TSequence[];
|
|
30
29
|
overrideIdsToNodePaths: OverrideIdToNodePaths;
|
|
31
30
|
propStatuses: PropStatuses | undefined;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import type { SequenceNodePathInfo } from '../../helpers/get-timeline-sequence-sort-key';
|
|
2
2
|
import type { TimelineTreeNode } from '../../helpers/timeline-layout';
|
|
3
|
-
import type { TimelineSelection } from './TimelineSelection';
|
|
4
3
|
export declare const filterTimelineExpandedTree: ({ nodes, shouldShowNode, }: {
|
|
5
4
|
readonly nodes: readonly TimelineTreeNode[];
|
|
6
5
|
readonly shouldShowNode: (node: TimelineTreeNode) => boolean;
|
|
7
6
|
}) => TimelineTreeNode[];
|
|
8
|
-
export declare const getSelectedTimelineExpandedRowKeys: (selectedItems: readonly
|
|
7
|
+
export declare const getSelectedTimelineExpandedRowKeys: (selectedItems: readonly import("@remotion/canvas").CanvasSelectionItem[]) => ReadonlySet<string>;
|
|
9
8
|
export declare const isTimelineExpandedNodeSelected: ({ nodePathInfo, selectedRowKeys, }: {
|
|
10
9
|
readonly nodePathInfo: SequenceNodePathInfo;
|
|
11
10
|
readonly selectedRowKeys: ReadonlySet<string>;
|
|
@@ -17,13 +17,15 @@ export type TimelineEdgeAutoScroller = {
|
|
|
17
17
|
};
|
|
18
18
|
/**
|
|
19
19
|
* Shared edge auto-scroll loop for drag gestures on the timeline (playhead
|
|
20
|
-
* scrubbing, marquee selection). Detects when the pointer
|
|
21
|
-
* and repeatedly invokes `onTick` while it stays there. The
|
|
22
|
-
* the actual scrolling (and any dependent updates) inside
|
|
23
|
-
* read a settled scroll position afterwards.
|
|
20
|
+
* scrubbing, marquee selection, sequence reordering). Detects when the pointer
|
|
21
|
+
* is in an edge zone and repeatedly invokes `onTick` while it stays there. The
|
|
22
|
+
* consumer performs the actual scrolling (and any dependent updates) inside
|
|
23
|
+
* `onTick`, so it can read a settled scroll position afterwards.
|
|
24
24
|
*/
|
|
25
|
-
export declare const startTimelineEdgeAutoScroll: ({ includeVertical, onTick, }: {
|
|
25
|
+
export declare const startTimelineEdgeAutoScroll: ({ includeHorizontal, includeVertical, verticalTopOffset, onTick, }: {
|
|
26
|
+
includeHorizontal: boolean;
|
|
26
27
|
includeVertical: boolean;
|
|
28
|
+
verticalTopOffset: number;
|
|
27
29
|
onTick: (directions: TimelineEdgeScrollDirections) => void;
|
|
28
30
|
}) => TimelineEdgeAutoScroller;
|
|
29
31
|
export declare const getFrameWhileScrollingLeft: ({ durationInFrames, width, }: {
|
|
@@ -36,10 +36,10 @@ const canScrollTimelineVerticallyIntoDirection = () => {
|
|
|
36
36
|
canScrollDown: scrollHeight - scrollTop - clientHeight > 0,
|
|
37
37
|
};
|
|
38
38
|
};
|
|
39
|
-
const getEdgeScrollDirections = ({ clientX, clientY, includeVertical, active, }) => {
|
|
39
|
+
const getEdgeScrollDirections = ({ clientX, clientY, includeHorizontal, includeVertical, verticalTopOffset, active, }) => {
|
|
40
40
|
let x = null;
|
|
41
41
|
const scrollable = timeline_refs_1.scrollableRef.current;
|
|
42
|
-
if (scrollable) {
|
|
42
|
+
if (includeHorizontal && scrollable) {
|
|
43
43
|
const rect = scrollable.getBoundingClientRect();
|
|
44
44
|
const leftThreshold = rect.left + (active.x === 'left' ? EDGE_SCROLL_EXIT_HYSTERESIS : 0);
|
|
45
45
|
const rightThreshold = rect.left +
|
|
@@ -59,6 +59,7 @@ const getEdgeScrollDirections = ({ clientX, clientY, includeVertical, active, })
|
|
|
59
59
|
if (includeVertical && vertical) {
|
|
60
60
|
const rect = vertical.getBoundingClientRect();
|
|
61
61
|
const topThreshold = rect.top +
|
|
62
|
+
verticalTopOffset +
|
|
62
63
|
EDGE_SCROLL_VERTICAL_INSET +
|
|
63
64
|
(active.y === 'up' ? EDGE_SCROLL_EXIT_HYSTERESIS : 0);
|
|
64
65
|
const bottomThreshold = rect.bottom -
|
|
@@ -76,12 +77,12 @@ const getEdgeScrollDirections = ({ clientX, clientY, includeVertical, active, })
|
|
|
76
77
|
};
|
|
77
78
|
/**
|
|
78
79
|
* Shared edge auto-scroll loop for drag gestures on the timeline (playhead
|
|
79
|
-
* scrubbing, marquee selection). Detects when the pointer
|
|
80
|
-
* and repeatedly invokes `onTick` while it stays there. The
|
|
81
|
-
* the actual scrolling (and any dependent updates) inside
|
|
82
|
-
* read a settled scroll position afterwards.
|
|
80
|
+
* scrubbing, marquee selection, sequence reordering). Detects when the pointer
|
|
81
|
+
* is in an edge zone and repeatedly invokes `onTick` while it stays there. The
|
|
82
|
+
* consumer performs the actual scrolling (and any dependent updates) inside
|
|
83
|
+
* `onTick`, so it can read a settled scroll position afterwards.
|
|
83
84
|
*/
|
|
84
|
-
const startTimelineEdgeAutoScroll = ({ includeVertical, onTick, }) => {
|
|
85
|
+
const startTimelineEdgeAutoScroll = ({ includeHorizontal, includeVertical, verticalTopOffset, onTick, }) => {
|
|
85
86
|
let active = { x: null, y: null };
|
|
86
87
|
let lastPointer = null;
|
|
87
88
|
let interval = null;
|
|
@@ -98,7 +99,9 @@ const startTimelineEdgeAutoScroll = ({ includeVertical, onTick, }) => {
|
|
|
98
99
|
active = getEdgeScrollDirections({
|
|
99
100
|
clientX: lastPointer.clientX,
|
|
100
101
|
clientY: lastPointer.clientY,
|
|
102
|
+
includeHorizontal,
|
|
101
103
|
includeVertical,
|
|
104
|
+
verticalTopOffset,
|
|
102
105
|
active,
|
|
103
106
|
});
|
|
104
107
|
if (active.x === null && active.y === null) {
|
|
@@ -112,7 +115,9 @@ const startTimelineEdgeAutoScroll = ({ includeVertical, onTick, }) => {
|
|
|
112
115
|
active = getEdgeScrollDirections({
|
|
113
116
|
clientX: e.clientX,
|
|
114
117
|
clientY: e.clientY,
|
|
118
|
+
includeHorizontal,
|
|
115
119
|
includeVertical,
|
|
120
|
+
verticalTopOffset,
|
|
116
121
|
active,
|
|
117
122
|
});
|
|
118
123
|
if (active.x !== null || active.y !== null) {
|