@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.
Files changed (157) hide show
  1. package/dist/components/AssetSelector.js +63 -22
  2. package/dist/components/AssetSelectorItem.d.ts +2 -1
  3. package/dist/components/AssetSelectorItem.js +41 -10
  4. package/dist/components/Canvas.js +15 -12
  5. package/dist/components/CanvasCaptureDropHandler.d.ts +4 -0
  6. package/dist/components/CanvasCaptureDropHandler.js +42 -0
  7. package/dist/components/CanvasOrLoading.js +4 -3
  8. package/dist/components/CaptionInspector.js +1 -1
  9. package/dist/components/CaptionTextEditor.js +32 -8
  10. package/dist/components/CheckboardToggle.js +1 -1
  11. package/dist/components/Checkbox.d.ts +0 -1
  12. package/dist/components/Checkbox.js +2 -19
  13. package/dist/components/CompositionContextButton.js +2 -1
  14. package/dist/components/CompositionSelector.js +1 -1
  15. package/dist/components/ConfigureLicenseModal.js +79 -46
  16. package/dist/components/CurrentAsset.d.ts +1 -1
  17. package/dist/components/CurrentAsset.js +9 -4
  18. package/dist/components/Editor.js +2 -1
  19. package/dist/components/EditorContent.js +11 -5
  20. package/dist/components/EditorContexts.js +2 -1
  21. package/dist/components/EditorRuler/Ruler.d.ts +1 -0
  22. package/dist/components/EditorRuler/Ruler.js +9 -8
  23. package/dist/components/EditorRuler/index.d.ts +1 -0
  24. package/dist/components/EditorRuler/index.js +3 -4
  25. package/dist/components/EditorRuler/use-is-ruler-visible.d.ts +1 -1
  26. package/dist/components/EditorRuler/use-is-ruler-visible.js +8 -2
  27. package/dist/components/ElementInstallConfirmation.d.ts +5 -0
  28. package/dist/components/ElementInstallConfirmation.js +25 -1
  29. package/dist/components/ElementLibraryModal.d.ts +5 -0
  30. package/dist/components/ElementLibraryModal.js +40 -0
  31. package/dist/components/FilePreview.js +71 -0
  32. package/dist/components/InlineCaptionInspector.js +13 -2
  33. package/dist/components/InlineEditableTitle.js +2 -2
  34. package/dist/components/InspectorPanel/CompositionInspector.js +11 -38
  35. package/dist/components/InspectorPanel/CompositionInspectorHeader.js +2 -2
  36. package/dist/components/InspectorPanel/CompositionMetadata.js +11 -4
  37. package/dist/components/InspectorPanel/EasingInspector.js +2 -2
  38. package/dist/components/InspectorPanel/ElementLibraryButton.d.ts +2 -0
  39. package/dist/components/InspectorPanel/ElementLibraryButton.js +139 -0
  40. package/dist/components/InspectorPanel/KeyframeInspector.js +1 -1
  41. package/dist/components/InspectorPanel/SequenceInspectorHeader.js +12 -5
  42. package/dist/components/InspectorPanel/SequenceSelectionInspector.js +1 -3
  43. package/dist/components/InspectorPanel/common.d.ts +0 -1
  44. package/dist/components/InspectorPanel/common.js +3 -7
  45. package/dist/components/InspectorPanel/inspector-selection.d.ts +2 -2
  46. package/dist/components/InspectorPanel/styles.d.ts +0 -1
  47. package/dist/components/InspectorPanel/styles.js +3 -4
  48. package/dist/components/InspectorPanel/use-track-for-selection.d.ts +1 -2
  49. package/dist/components/InspectorSequenceSection.d.ts +1 -2
  50. package/dist/components/InspectorSourceLocation.js +1 -1
  51. package/dist/components/Menu/MenuItem.js +15 -6
  52. package/dist/components/MenuToolbar.js +7 -3
  53. package/dist/components/Modals.js +51 -1
  54. package/dist/components/PlaybackRateSelector.js +3 -6
  55. package/dist/components/Preview.js +83 -5
  56. package/dist/components/PreviewToolbar.js +10 -4
  57. package/dist/components/PreviewToolbarOverflowButton.d.ts +1 -0
  58. package/dist/components/PreviewToolbarOverflowButton.js +9 -2
  59. package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.d.ts +2 -0
  60. package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +28 -8
  61. package/dist/components/RadioButton.d.ts +6 -0
  62. package/dist/components/RadioButton.js +62 -0
  63. package/dist/components/RenderButton.js +2 -1
  64. package/dist/components/RulersAndGuidesToggle.d.ts +3 -1
  65. package/dist/components/RulersAndGuidesToggle.js +18 -7
  66. package/dist/components/SelectedOutlineKeyboardControls.d.ts +2 -2
  67. package/dist/components/SelectedOutlineOverlay.d.ts +1 -3
  68. package/dist/components/SelectedOutlineOverlay.js +21 -17
  69. package/dist/components/SelectedOutlinePolygon.d.ts +1 -2
  70. package/dist/components/SelectedOutlineRenderer.d.ts +2 -3
  71. package/dist/components/SelectedOutlineRenderer.js +9 -78
  72. package/dist/components/SelectedOutlineUvControls.d.ts +1 -1
  73. package/dist/components/SettingsModal.js +1 -1
  74. package/dist/components/SettingsModalFooter.d.ts +3 -1
  75. package/dist/components/SettingsModalFooter.js +19 -4
  76. package/dist/components/ShowPixelGridProvider.d.ts +4 -0
  77. package/dist/components/ShowPixelGridProvider.js +24 -0
  78. package/dist/components/SidebarCollapserControls.js +2 -2
  79. package/dist/components/SidebarRenderButton.js +2 -1
  80. package/dist/components/Timeline/Timeline.js +41 -0
  81. package/dist/components/Timeline/TimelineClipboardKeybindings.d.ts +6 -7
  82. package/dist/components/Timeline/TimelineDragHandler.js +11 -4
  83. package/dist/components/Timeline/TimelineKeyframeControls.d.ts +1 -2
  84. package/dist/components/Timeline/TimelinePlayCursorSyncer.js +4 -2
  85. package/dist/components/Timeline/TimelineSelection.d.ts +29 -66
  86. package/dist/components/Timeline/TimelineSelection.js +30 -170
  87. package/dist/components/Timeline/TimelineSequenceItem.d.ts +1 -0
  88. package/dist/components/Timeline/TimelineSequenceItem.js +8 -6
  89. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +3 -4
  90. package/dist/components/Timeline/delete-selected-timeline-item.d.ts +3 -4
  91. package/dist/components/Timeline/duplicate-selected-timeline-item.d.ts +3 -4
  92. package/dist/components/Timeline/find-track-for-node-path-info.d.ts +1 -1
  93. package/dist/components/Timeline/keyframe-clipboard.d.ts +2 -3
  94. package/dist/components/Timeline/reset-selected-timeline-props.d.ts +2 -3
  95. package/dist/components/Timeline/sequence-prop-clipboard.d.ts +2 -3
  96. package/dist/components/Timeline/split-selected-timeline-item.d.ts +2 -3
  97. package/dist/components/Timeline/timeline-expanded-filter.d.ts +1 -2
  98. package/dist/components/Timeline/timeline-scroll-logic.d.ts +7 -5
  99. package/dist/components/Timeline/timeline-scroll-logic.js +12 -7
  100. package/dist/components/Timeline/update-selected-easing.d.ts +7 -7
  101. package/dist/components/Timeline/use-timeline-asset-drop.js +24 -1
  102. package/dist/components/Timeline/use-timeline-keyframe-drag.d.ts +6 -7
  103. package/dist/components/WebMcp.d.ts +2 -0
  104. package/dist/components/WebMcp.js +945 -0
  105. package/dist/components/canvas-capture-drop.d.ts +4 -0
  106. package/dist/components/canvas-capture-drop.js +22 -0
  107. package/dist/components/composition-menu-items.js +26 -0
  108. package/dist/components/selected-outline-geometry.d.ts +2 -21
  109. package/dist/components/selected-outline-geometry.js +5 -16
  110. package/dist/components/selected-outline-measurement.d.ts +8 -37
  111. package/dist/components/selected-outline-measurement.js +1 -231
  112. package/dist/components/selected-outline-types.d.ts +2 -15
  113. package/dist/components/selected-outline-uv.js +3 -106
  114. package/dist/esm/{chunk-w4244j4n.js → chunk-7prjt5n5.js} +32831 -26820
  115. package/dist/esm/internals.mjs +32831 -26820
  116. package/dist/esm/previewEntry.mjs +17304 -11293
  117. package/dist/esm/renderEntry.mjs +1 -1
  118. package/dist/helpers/calculate-timeline.d.ts +1 -7
  119. package/dist/helpers/calculate-timeline.js +2 -146
  120. package/dist/helpers/create-folder-tree.js +16 -1
  121. package/dist/helpers/editor-ruler.js +6 -5
  122. package/dist/helpers/format-file-location.d.ts +8 -0
  123. package/dist/helpers/format-file-location.js +14 -3
  124. package/dist/helpers/get-asset-metadata.d.ts +19 -0
  125. package/dist/helpers/get-asset-metadata.js +51 -6
  126. package/dist/helpers/get-connected-compositions.d.ts +1 -6
  127. package/dist/helpers/get-connected-compositions.js +2 -8
  128. package/dist/helpers/get-sequence-visible-range.d.ts +1 -5
  129. package/dist/helpers/get-sequence-visible-range.js +6 -51
  130. package/dist/helpers/get-timeline-max-zoom.d.ts +8 -0
  131. package/dist/helpers/get-timeline-max-zoom.js +17 -6
  132. package/dist/helpers/get-timeline-nestedness.d.ts +1 -2
  133. package/dist/helpers/get-timeline-nestedness.js +2 -12
  134. package/dist/helpers/get-timeline-sequence-sort-key.d.ts +2 -22
  135. package/dist/helpers/get-timeline-sequence-sort-key.js +2 -16
  136. package/dist/helpers/hoverable.d.ts +1 -0
  137. package/dist/helpers/hoverable.js +4 -1
  138. package/dist/helpers/is-current-selected-still.js +4 -2
  139. package/dist/helpers/sort-by-nonce-history.d.ts +1 -5
  140. package/dist/helpers/sort-by-nonce-history.js +3 -148
  141. package/dist/helpers/timeline-node-path-key.d.ts +1 -2
  142. package/dist/helpers/timeline-node-path-key.js +2 -2
  143. package/dist/helpers/use-menu-structure.js +20 -0
  144. package/dist/icons/enter.d.ts +4 -0
  145. package/dist/icons/enter.js +10 -0
  146. package/dist/state/editor-pixel-grid.d.ts +8 -0
  147. package/dist/state/editor-pixel-grid.js +18 -0
  148. package/dist/state/modals.d.ts +4 -0
  149. package/dist/state/playbackrate.d.ts +1 -0
  150. package/dist/state/playbackrate.js +4 -1
  151. package/package.json +14 -12
  152. package/dist/components/selected-outline-order.d.ts +0 -12
  153. package/dist/components/selected-outline-order.js +0 -251
  154. package/dist/helpers/get-box-quads-polyfill-internals.d.ts +0 -82
  155. package/dist/helpers/get-box-quads-polyfill-internals.js +0 -2403
  156. package/dist/helpers/get-box-quads-ponyfill.d.ts +0 -10
  157. package/dist/helpers/get-box-quads-ponyfill.js +0 -23
@@ -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
- selectedItems: [],
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
- const getTimelineSelectionKey = (item) => {
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
- const getTimelineSequenceSelectionKey = (nodePathInfo) => (0, timeline_node_path_key_1.timelineNodePathInfoToKey)({ ...nodePathInfo, auxiliaryKeys: [] });
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 [selectedItems, setSelectedItems] = (0, react_1.useState)([]);
651
- const selectionAnchor = (0, react_1.useRef)(null);
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
- setSelectedItems([]);
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 getCurrentAvailableSelectionState = (0, react_1.useCallback)((currentSelectedItems) => {
669
- if (selectionScope.current !== timelineSelectionScope) {
670
- return exports.EMPTY_TIMELINE_SELECTION_STATE;
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
- setSelectedItems((currentSelectedItems) => {
704
- const nextState = selectionScope.current === timelineSelectionScope
705
- ? {
706
- selectedItems: currentSelectedItems,
707
- anchor: selectionAnchor.current,
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
- setSelectedItems((currentSelectedItems) => {
736
- const currentSelectionState = getCurrentAvailableSelectionState(currentSelectedItems);
737
- const nextState = (0, exports.getTimelineSelectionAfterInteraction)({
738
- currentState: {
739
- selectedItems: currentSelectionState.selectedItems,
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
- selectionAnchor.current = null;
823
- setSelectedItems([]);
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
- const SEQUENCE_REORDER_MIME_TYPE = 'application/remotion-sequence-reorder';
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.jsx(TimelineSequenceExpandArrow, { disabled: !previewInteractive, isExpanded: isExpanded, nodePathInfo: nodePathInfo, sequence: sequence })) : null, numberOfHiddenDuplicates > 0 ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
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 TimelineSelection[];
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 TimelineSelection[];
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 TimelineSelection[];
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 TimelineSelection[];
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 TimelineSelection[];
12
+ }) => readonly import("@remotion/canvas").CanvasSelectionItem[];
14
13
  export declare const deleteSelectedTimelineItems: ({ selections, sequences, overrideIdsToNodePaths, setPropStatuses, clientId, confirm, propStatuses, timelinePosition, }: {
15
- selections: readonly TimelineSelection[];
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: TimelineSelection) => selection is {
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: TimelineSelection) => selection is {
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 TimelineSelection[];
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("../../helpers/get-timeline-sequence-sort-key").TimelineTrackData | undefined;
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 TimelineSelection[];
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 TimelineSelection[];
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 TimelineSelection[];
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 TimelineSelection[];
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: TimelineSelection;
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 TimelineSelection[];
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: TimelineSelection;
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 TimelineSelection[];
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 TimelineSelection[]) => ReadonlySet<string>;
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 is in an edge zone
21
- * and repeatedly invokes `onTick` while it stays there. The consumer performs
22
- * the actual scrolling (and any dependent updates) inside `onTick`, so it can
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 is in an edge zone
80
- * and repeatedly invokes `onTick` while it stays there. The consumer performs
81
- * the actual scrolling (and any dependent updates) inside `onTick`, so it can
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) {