@remotion/studio 4.0.515 → 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.
Files changed (277) hide show
  1. package/dist/api/restart-studio.js +4 -0
  2. package/dist/components/AssetSelector.js +4 -10
  3. package/dist/components/AssetSelectorItem.d.ts +2 -1
  4. package/dist/components/AssetSelectorItem.js +24 -29
  5. package/dist/components/Canvas.js +21 -15
  6. package/dist/components/CanvasCaptureDropHandler.d.ts +4 -0
  7. package/dist/components/CanvasCaptureDropHandler.js +42 -0
  8. package/dist/components/CanvasOrLoading.js +4 -3
  9. package/dist/components/CaptionInspector.d.ts +2 -0
  10. package/dist/components/CaptionInspector.js +3 -5
  11. package/dist/components/CheckboardToggle.js +1 -1
  12. package/dist/components/Checkbox.d.ts +0 -1
  13. package/dist/components/Checkbox.js +2 -19
  14. package/dist/components/CompositionSelector.js +6 -3
  15. package/dist/components/CompositionSelectorItem.js +9 -10
  16. package/dist/components/ConfigSelect.d.ts +17 -0
  17. package/dist/components/ConfigSelect.js +50 -0
  18. package/dist/components/ConfigureLicenseModal.js +79 -46
  19. package/dist/components/CurrentAsset.d.ts +10 -2
  20. package/dist/components/CurrentAsset.js +143 -45
  21. package/dist/components/Editor.js +2 -1
  22. package/dist/components/EditorContent.js +5 -2
  23. package/dist/components/EditorContexts.js +2 -1
  24. package/dist/components/EditorRuler/Ruler.d.ts +1 -0
  25. package/dist/components/EditorRuler/Ruler.js +9 -8
  26. package/dist/components/EditorRuler/index.d.ts +1 -0
  27. package/dist/components/EditorRuler/index.js +3 -4
  28. package/dist/components/EditorRuler/use-is-ruler-visible.d.ts +1 -1
  29. package/dist/components/EditorRuler/use-is-ruler-visible.js +8 -2
  30. package/dist/components/ElementLibraryModal.d.ts +5 -0
  31. package/dist/components/ElementLibraryModal.js +38 -0
  32. package/dist/components/FilePreview.js +71 -0
  33. package/dist/components/FixComputedValueModal.js +54 -51
  34. package/dist/components/GlobalKeybindings.js +5 -5
  35. package/dist/components/InlineAction.d.ts +1 -1
  36. package/dist/components/InlineAction.js +12 -2
  37. package/dist/components/InlineCaptionInspector.d.ts +2 -0
  38. package/dist/components/InlineCaptionInspector.js +2 -2
  39. package/dist/components/InlineCompositionName.js +1 -1
  40. package/dist/components/InlineEditableTitle.js +5 -4
  41. package/dist/components/InspectorInfoHeader.js +1 -1
  42. package/dist/components/InspectorOpenInEditor.js +48 -72
  43. package/dist/components/InspectorPanel/AlignmentControls.js +2 -3
  44. package/dist/components/InspectorPanel/CollapsibleInspectorSectionHeader.d.ts +7 -0
  45. package/dist/components/InspectorPanel/CollapsibleInspectorSectionHeader.js +39 -0
  46. package/dist/components/InspectorPanel/CompositionInspector.js +25 -45
  47. package/dist/components/InspectorPanel/CompositionInspectorHeader.js +2 -2
  48. package/dist/components/InspectorPanel/CompositionMetadata.js +11 -4
  49. package/dist/components/InspectorPanel/EasingInspector.js +2 -2
  50. package/dist/components/InspectorPanel/ElementLibraryButton.d.ts +2 -0
  51. package/dist/components/InspectorPanel/ElementLibraryButton.js +139 -0
  52. package/dist/components/InspectorPanel/KeyframeEasingNavigator.js +10 -4
  53. package/dist/components/InspectorPanel/KeyframeInspector.js +1 -1
  54. package/dist/components/InspectorPanel/SequenceInspectorHeader.js +14 -6
  55. package/dist/components/InspectorPanel/SequenceSelectionInspector.js +2 -7
  56. package/dist/components/InspectorPanel/common.d.ts +0 -13
  57. package/dist/components/InspectorPanel/common.js +6 -59
  58. package/dist/components/InspectorPanel/inspector-selection.d.ts +2 -2
  59. package/dist/components/InspectorPanel/styles.d.ts +0 -1
  60. package/dist/components/InspectorPanel/styles.js +3 -4
  61. package/dist/components/InspectorPanel/use-composition-actions.js +0 -1
  62. package/dist/components/InspectorPanel/use-track-for-selection.d.ts +1 -2
  63. package/dist/components/InspectorPanelLayout.d.ts +1 -1
  64. package/dist/components/InspectorPanelLayout.js +1 -1
  65. package/dist/components/InspectorSequenceSection.d.ts +1 -2
  66. package/dist/components/InspectorSequenceSection.js +40 -54
  67. package/dist/components/InspectorSourceLocation.js +1 -1
  68. package/dist/components/InstallPackage.d.ts +2 -1
  69. package/dist/components/InstallPackage.js +60 -30
  70. package/dist/components/InstallablePackage.js +37 -11
  71. package/dist/components/KeyboardShortcutsSettings.d.ts +2 -0
  72. package/dist/components/KeyboardShortcutsSettings.js +177 -0
  73. package/dist/components/Menu/MenuItem.js +15 -6
  74. package/dist/components/MenuBuildIndicator.js +1 -1
  75. package/dist/components/MenuToolbar.js +7 -3
  76. package/dist/components/Modals.js +7 -5
  77. package/dist/components/NewComposition/CodemodFooter.d.ts +0 -1
  78. package/dist/components/NewComposition/CodemodFooter.js +2 -8
  79. package/dist/components/NewComposition/DeleteComposition.js +1 -1
  80. package/dist/components/NewComposition/DeleteFolder.js +1 -1
  81. package/dist/components/NewComposition/DuplicateComposition.js +1 -1
  82. package/dist/components/NewComposition/InputDragger.js +27 -4
  83. package/dist/components/NewComposition/NewComposition.js +1 -1
  84. package/dist/components/NewComposition/NewFolder.js +1 -3
  85. package/dist/components/NewComposition/RenameComposition.js +1 -1
  86. package/dist/components/NewComposition/RenameFolder.js +1 -1
  87. package/dist/components/NewComposition/use-rename-static-file.js +1 -1
  88. package/dist/components/Notifications/NotificationCenter.d.ts +1 -0
  89. package/dist/components/Notifications/NotificationCenter.js +5 -0
  90. package/dist/components/OptionsPanel.js +9 -12
  91. package/dist/components/PlaybackRateSelector.js +1 -1
  92. package/dist/components/Preview.js +83 -5
  93. package/dist/components/PreviewToolbar.js +12 -3
  94. package/dist/components/PreviewToolbarOverflowButton.d.ts +1 -0
  95. package/dist/components/PreviewToolbarOverflowButton.js +39 -2
  96. package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +2 -2
  97. package/dist/components/QuickSwitcher/QuickSwitcherContent.js +14 -30
  98. package/dist/components/RadioButton.d.ts +6 -0
  99. package/dist/components/RadioButton.js +62 -0
  100. package/dist/components/RenderButton.js +68 -184
  101. package/dist/components/RenderModal/DataEditor.js +15 -12
  102. package/dist/components/RenderModal/RenderStatusModal.js +0 -1
  103. package/dist/components/RenderModal/SchemaEditor/ZodSwitch.js +3 -1
  104. package/dist/components/RenderModal/SchemaEditor/infer-zod-schema-from-value.d.ts +15 -0
  105. package/dist/components/RenderModal/SchemaEditor/infer-zod-schema-from-value.js +95 -0
  106. package/dist/components/RenderQueue/RenderQueueRemoveItem.js +1 -6
  107. package/dist/components/RenderingSettings.js +7 -4
  108. package/dist/components/RulersAndGuidesToggle.d.ts +4 -0
  109. package/dist/components/RulersAndGuidesToggle.js +34 -0
  110. package/dist/components/SegmentedButton.d.ts +29 -0
  111. package/dist/components/SegmentedButton.js +226 -0
  112. package/dist/components/SelectedOutlineEditingHandles.d.ts +16 -0
  113. package/dist/components/SelectedOutlineEditingHandles.js +66 -0
  114. package/dist/components/SelectedOutlineElement.d.ts +2 -4
  115. package/dist/components/SelectedOutlineElement.js +15 -54
  116. package/dist/components/SelectedOutlineOverlay.js +32 -6
  117. package/dist/components/SelectedOutlinePolygon.d.ts +4 -6
  118. package/dist/components/SelectedOutlinePolygon.js +18 -16
  119. package/dist/components/SelectedOutlineRenderer.d.ts +1 -2
  120. package/dist/components/SelectedOutlineRenderer.js +66 -14
  121. package/dist/components/SelectedOutlineUvControls.d.ts +1 -1
  122. package/dist/components/SettingsModal.d.ts +1 -1
  123. package/dist/components/SettingsModal.js +30 -7
  124. package/dist/components/SettingsModalFooter.d.ts +3 -1
  125. package/dist/components/SettingsModalFooter.js +20 -4
  126. package/dist/components/ShowPixelGridProvider.d.ts +4 -0
  127. package/dist/components/ShowPixelGridProvider.js +24 -0
  128. package/dist/components/SidebarCollapserControls.js +2 -2
  129. package/dist/components/SkillsSettings.d.ts +2 -0
  130. package/dist/components/SkillsSettings.js +129 -0
  131. package/dist/components/StaticFilePreview.js +7 -1
  132. package/dist/components/StudioSettings.js +7 -48
  133. package/dist/components/Tabs/index.js +1 -1
  134. package/dist/components/Timeline/Timeline.js +41 -1
  135. package/dist/components/Timeline/TimelineAssetField.d.ts +1 -1
  136. package/dist/components/Timeline/TimelineAssetField.js +15 -9
  137. package/dist/components/Timeline/TimelineBooleanField.js +1 -4
  138. package/dist/components/Timeline/TimelineClipboardKeybindings.d.ts +6 -7
  139. package/dist/components/Timeline/TimelineClipboardKeybindings.js +7 -10
  140. package/dist/components/Timeline/TimelineDragHandler.js +11 -4
  141. package/dist/components/Timeline/TimelineEffectItem.d.ts +1 -0
  142. package/dist/components/Timeline/TimelineEffectItem.js +23 -10
  143. package/dist/components/Timeline/TimelineEffectPropItem.js +15 -2
  144. package/dist/components/Timeline/TimelineExpandedRow.js +5 -4
  145. package/dist/components/Timeline/TimelineFieldLabel.js +4 -2
  146. package/dist/components/Timeline/TimelineFieldRowContent.d.ts +1 -2
  147. package/dist/components/Timeline/TimelineFieldRowContent.js +8 -21
  148. package/dist/components/Timeline/TimelineImageInfo.d.ts +0 -1
  149. package/dist/components/Timeline/TimelineImageInfo.js +13 -32
  150. package/dist/components/Timeline/TimelineKeyframeControls.d.ts +1 -2
  151. package/dist/components/Timeline/TimelineKeyframeControls.js +10 -4
  152. package/dist/components/Timeline/TimelinePlayCursorSyncer.js +4 -2
  153. package/dist/components/Timeline/TimelinePrimitiveFieldValue.js +1 -1
  154. package/dist/components/Timeline/TimelineRotationField.js +0 -2
  155. package/dist/components/Timeline/TimelineRowChrome.d.ts +0 -1
  156. package/dist/components/Timeline/TimelineRowChrome.js +3 -4
  157. package/dist/components/Timeline/TimelineRowLayoutContext.d.ts +0 -1
  158. package/dist/components/Timeline/TimelineRowLayoutContext.js +1 -4
  159. package/dist/components/Timeline/TimelineScaleField.js +2 -6
  160. package/dist/components/Timeline/TimelineSchemaField.js +9 -3
  161. package/dist/components/Timeline/TimelineSelection.d.ts +29 -66
  162. package/dist/components/Timeline/TimelineSelection.js +31 -171
  163. package/dist/components/Timeline/TimelineSequence.d.ts +2 -0
  164. package/dist/components/Timeline/TimelineSequence.js +110 -19
  165. package/dist/components/Timeline/TimelineSequenceItem.d.ts +1 -0
  166. package/dist/components/Timeline/TimelineSequenceItem.js +13 -11
  167. package/dist/components/Timeline/TimelineSequencePropItem.js +15 -2
  168. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +7 -6
  169. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +85 -91
  170. package/dist/components/Timeline/TimelineTrack.js +1 -1
  171. package/dist/components/Timeline/TimelineTransformOriginField.js +0 -4
  172. package/dist/components/Timeline/TimelineTranslateField.js +0 -4
  173. package/dist/components/Timeline/TimelineVirtualization.js +3 -1
  174. package/dist/components/Timeline/delete-selected-timeline-item.d.ts +3 -4
  175. package/dist/components/Timeline/duplicate-selected-timeline-item.d.ts +3 -4
  176. package/dist/components/Timeline/duplicate-selected-timeline-item.js +3 -12
  177. package/dist/components/Timeline/find-track-for-node-path-info.d.ts +1 -1
  178. package/dist/components/Timeline/get-copy-context-for-agents-menu-item.d.ts +4 -0
  179. package/dist/components/Timeline/get-copy-context-for-agents-menu-item.js +26 -0
  180. package/dist/components/Timeline/get-sequence-context-menu-items.js +2 -19
  181. package/dist/components/Timeline/get-timeline-sequence-visible-layout.d.ts +6 -1
  182. package/dist/components/Timeline/get-timeline-sequence-visible-layout.js +11 -4
  183. package/dist/components/Timeline/keyframe-clipboard.d.ts +2 -3
  184. package/dist/components/Timeline/reset-selected-timeline-props.d.ts +2 -3
  185. package/dist/components/Timeline/sequence-prop-clipboard.d.ts +2 -3
  186. package/dist/components/Timeline/split-selected-timeline-item.d.ts +2 -3
  187. package/dist/components/Timeline/split-selected-timeline-item.js +0 -1
  188. package/dist/components/Timeline/timeline-expanded-filter.d.ts +1 -2
  189. package/dist/components/Timeline/timeline-field-row-layout.d.ts +1 -1
  190. package/dist/components/Timeline/timeline-field-row-layout.js +4 -7
  191. package/dist/components/Timeline/timeline-field-utils.js +0 -2
  192. package/dist/components/Timeline/timeline-scroll-logic.d.ts +7 -5
  193. package/dist/components/Timeline/timeline-scroll-logic.js +12 -7
  194. package/dist/components/Timeline/update-selected-easing.d.ts +7 -7
  195. package/dist/components/Timeline/use-timeline-asset-drop.js +24 -0
  196. package/dist/components/Timeline/use-timeline-keyframe-drag.d.ts +6 -7
  197. package/dist/components/TimelineCombobox.js +25 -160
  198. package/dist/components/TimelineInOutToggle.js +4 -1
  199. package/dist/components/canvas-capture-drop.d.ts +4 -0
  200. package/dist/components/canvas-capture-drop.js +22 -0
  201. package/dist/components/duplicate-jsx-node-api.d.ts +2 -0
  202. package/dist/components/duplicate-jsx-node-api.js +12 -0
  203. package/dist/components/effect-drag-and-drop.js +1 -4
  204. package/dist/components/handle-drop.d.ts +2 -1
  205. package/dist/components/handle-drop.js +3 -3
  206. package/dist/components/import-assets.js +9 -65
  207. package/dist/components/keyboard-shortcuts.d.ts +10 -0
  208. package/dist/components/keyboard-shortcuts.js +135 -0
  209. package/dist/components/selected-outline-control-layout.js +2 -6
  210. package/dist/components/selected-outline-measurement.d.ts +8 -9
  211. package/dist/components/selected-outline-measurement.js +16 -3
  212. package/dist/components/use-delete-asset.d.ts +1 -0
  213. package/dist/components/use-delete-asset.js +40 -0
  214. package/dist/components/use-selected-outline-control-target.d.ts +11 -0
  215. package/dist/components/use-selected-outline-control-target.js +79 -0
  216. package/dist/esm/{chunk-s6k99gh2.js → chunk-4bxz1d3g.js} +3 -2
  217. package/dist/esm/{chunk-v5a8vpv4.js → chunk-gzqm3g2m.js} +47432 -40444
  218. package/dist/esm/index.mjs +3 -0
  219. package/dist/esm/internals.mjs +47431 -40443
  220. package/dist/esm/previewEntry.mjs +47169 -40181
  221. package/dist/esm/renderEntry.mjs +2 -2
  222. package/dist/helpers/add-asset-cache-bust.d.ts +4 -0
  223. package/dist/helpers/add-asset-cache-bust.js +10 -0
  224. package/dist/helpers/calculate-timeline.d.ts +1 -7
  225. package/dist/helpers/calculate-timeline.js +2 -145
  226. package/dist/helpers/colors.d.ts +2 -0
  227. package/dist/helpers/colors.js +6 -2
  228. package/dist/helpers/drag-aware-double-click.d.ts +6 -0
  229. package/dist/helpers/drag-aware-double-click.js +20 -0
  230. package/dist/helpers/editor-ruler.js +6 -5
  231. package/dist/helpers/get-asset-metadata.d.ts +19 -0
  232. package/dist/helpers/get-asset-metadata.js +75 -21
  233. package/dist/helpers/get-connected-compositions.d.ts +1 -6
  234. package/dist/helpers/get-connected-compositions.js +2 -8
  235. package/dist/helpers/get-sequence-double-click-action.d.ts +2 -1
  236. package/dist/helpers/get-sequence-double-click-action.js +7 -1
  237. package/dist/helpers/get-sequence-visible-range.d.ts +1 -5
  238. package/dist/helpers/get-sequence-visible-range.js +6 -51
  239. package/dist/helpers/get-timeline-nestedness.d.ts +1 -2
  240. package/dist/helpers/get-timeline-nestedness.js +2 -12
  241. package/dist/helpers/get-timeline-sequence-layout.d.ts +4 -1
  242. package/dist/helpers/get-timeline-sequence-layout.js +15 -6
  243. package/dist/helpers/get-timeline-sequence-sort-key.d.ts +2 -21
  244. package/dist/helpers/get-timeline-sequence-sort-key.js +2 -16
  245. package/dist/helpers/hoverable.d.ts +1 -0
  246. package/dist/helpers/hoverable.js +2 -1
  247. package/dist/helpers/inject-css.js +3 -1
  248. package/dist/helpers/is-current-selected-still.js +4 -2
  249. package/dist/helpers/open-in-remotion-convert.d.ts +7 -0
  250. package/dist/helpers/open-in-remotion-convert.js +18 -0
  251. package/dist/helpers/sort-by-nonce-history.d.ts +1 -5
  252. package/dist/helpers/sort-by-nonce-history.js +3 -148
  253. package/dist/helpers/timeline-node-path-key.d.ts +1 -2
  254. package/dist/helpers/timeline-node-path-key.js +2 -2
  255. package/dist/helpers/use-media-metadata.d.ts +2 -1
  256. package/dist/helpers/use-media-metadata.js +12 -5
  257. package/dist/helpers/use-menu-structure.js +52 -32
  258. package/dist/icons/align-center-horizontal.js +1 -1
  259. package/dist/icons/align-left.js +1 -1
  260. package/dist/icons/align-right.js +1 -1
  261. package/dist/icons/keyboard.d.ts +4 -0
  262. package/dist/icons/keyboard.js +10 -0
  263. package/dist/icons/license.d.ts +4 -0
  264. package/dist/icons/license.js +8 -0
  265. package/dist/icons/package.d.ts +4 -0
  266. package/dist/icons/package.js +8 -0
  267. package/dist/icons/react.js +1 -1
  268. package/dist/icons/remotion-convert.d.ts +4 -0
  269. package/dist/icons/remotion-convert.js +10 -0
  270. package/dist/icons/skills.d.ts +4 -0
  271. package/dist/icons/skills.js +10 -0
  272. package/dist/state/editor-pixel-grid.d.ts +8 -0
  273. package/dist/state/editor-pixel-grid.js +18 -0
  274. package/dist/state/modals.d.ts +6 -5
  275. package/package.json +14 -12
  276. package/dist/components/KeyboardShortcutsExplainer.d.ts +0 -2
  277. package/dist/components/KeyboardShortcutsExplainer.js +0 -194
@@ -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 +=
@@ -1056,7 +916,7 @@ const useTimelineRowSelection = (nodePathInfo) => {
1056
916
  if (selectionItem === null) {
1057
917
  return;
1058
918
  }
1059
- selectItem(selectionItem, interaction, selectableTimelineItemsRef.current, { reveal: true });
919
+ selectItem(selectionItem, interaction, selectableTimelineItemsRef.current);
1060
920
  }, [selectItem, selectableTimelineItemsRef, selectionItem]);
1061
921
  return {
1062
922
  onSelect,
@@ -6,4 +6,6 @@ export declare const TimelineSequence: React.NamedExoticComponent<{
6
6
  readonly connectedCompositions: readonly import("remotion").AnyComposition[];
7
7
  readonly nodePathInfo: SequenceNodePathInfo | null;
8
8
  readonly sequenceFrameOffset: number;
9
+ readonly cascadedStart: number;
10
+ readonly localStart: number;
9
11
  }>;
@@ -39,6 +39,7 @@ const react_1 = __importStar(require("react"));
39
39
  const remotion_1 = require("remotion");
40
40
  const client_id_1 = require("../../helpers/client-id");
41
41
  const colors_1 = require("../../helpers/colors");
42
+ const drag_aware_double_click_1 = require("../../helpers/drag-aware-double-click");
42
43
  const get_sequence_double_click_action_1 = require("../../helpers/get-sequence-double-click-action");
43
44
  const get_timeline_sequence_layout_1 = require("../../helpers/get-timeline-sequence-layout");
44
45
  const interactivity_enabled_1 = require("../../helpers/interactivity-enabled");
@@ -69,17 +70,58 @@ const TimelineViewport_1 = require("./TimelineViewport");
69
70
  const TimelineWidthProvider_1 = require("./TimelineWidthProvider");
70
71
  const use_open_sequence_in_apps_1 = require("./use-open-sequence-in-apps");
71
72
  const use_sequence_freeze_frame_menu_item_1 = require("./use-sequence-freeze-frame-menu-item");
72
- const TimelineSequenceFn = ({ s, connectedCompositions, nodePathInfo, sequenceFrameOffset }) => {
73
+ const TimelineSequenceFn = ({ s, connectedCompositions, nodePathInfo, sequenceFrameOffset, cascadedStart, localStart, }) => {
73
74
  const windowWidth = (0, react_1.useContext)(TimelineWidthProvider_1.TimelineWidthContext);
74
75
  if (windowWidth === null) {
75
76
  return null;
76
77
  }
77
- return (jsx_runtime_1.jsx(TimelineSequenceInner, { windowWidth: windowWidth, s: s, connectedCompositions: connectedCompositions, nodePathInfo: nodePathInfo, sequenceFrameOffset: sequenceFrameOffset }));
78
+ return (jsx_runtime_1.jsx(TimelineSequenceInner, { windowWidth: windowWidth, s: s, connectedCompositions: connectedCompositions, nodePathInfo: nodePathInfo, sequenceFrameOffset: sequenceFrameOffset, cascadedStart: cascadedStart, localStart: localStart }));
78
79
  };
79
- const TimelineSequenceCurrentFrame = ({ s, displayDurationInFrames, premount, postmount, style, children, nodePathInfo, sequenceFrameOffset, fromCanUpdate, frozenFrame, onMoveDragPointerDown, onDoubleClick, }) => {
80
- var _a, _b, _c;
80
+ const TimelineSequenceNegativeStartInner = ({ left, width, leftEdgeVisible, clipped }) => {
81
+ const outerStyle = (0, react_1.useMemo)(() => {
82
+ return {
83
+ backgroundColor: clipped ? colors_1.TIMELINE_BACKGROUND_COLOR : undefined,
84
+ height: '100%',
85
+ left,
86
+ minWidth: 2,
87
+ pointerEvents: 'none',
88
+ position: 'absolute',
89
+ top: 0,
90
+ width,
91
+ };
92
+ }, [clipped, left, width]);
93
+ const innerStyle = (0, react_1.useMemo)(() => {
94
+ const showLeftEdge = leftEdgeVisible && !clipped;
95
+ const maskImage = clipped
96
+ ? 'linear-gradient(to right, transparent, black 20%)'
97
+ : undefined;
98
+ return {
99
+ backgroundColor: colors_1.TIMELINE_NEGATIVE_START_BACKGROUND_COLOR,
100
+ border: `${get_timeline_sequence_layout_1.SEQUENCE_BORDER_WIDTH}px solid ${colors_1.TIMELINE_NEGATIVE_START_BORDER_COLOR}`,
101
+ borderBottomLeftRadius: showLeftEdge ? 2 : 0,
102
+ borderLeft: showLeftEdge
103
+ ? `${get_timeline_sequence_layout_1.SEQUENCE_BORDER_WIDTH}px solid ${colors_1.TIMELINE_NEGATIVE_START_BORDER_COLOR}`
104
+ : 'none',
105
+ borderRight: 'none',
106
+ borderTopLeftRadius: showLeftEdge ? 2 : 0,
107
+ boxSizing: 'border-box',
108
+ height: '100%',
109
+ maskImage,
110
+ position: 'absolute',
111
+ top: 0,
112
+ WebkitMaskImage: maskImage,
113
+ width: '100%',
114
+ };
115
+ }, [clipped, leftEdgeVisible]);
116
+ return (jsx_runtime_1.jsx("div", { style: outerStyle, children: jsx_runtime_1.jsx("div", { style: innerStyle }) }));
117
+ };
118
+ const TimelineSequenceNegativeStart = react_1.default.memo(TimelineSequenceNegativeStartInner);
119
+ const TimelineSequenceCurrentFrame = ({ s, displayDurationInFrames, premount, postmount, negativeStart, leftEdgeVisible, negativeStartClipped, style, children, nodePathInfo, sequenceFrameOffset, fromCanUpdate, frozenFrame, onMoveDragPointerDown, onPointerDownCapture, onDoubleClick, }) => {
120
+ var _a, _b, _c, _d;
81
121
  const ref = (0, react_1.useRef)(null);
82
122
  const { onSelect, selectable, selected, selectionItem } = (0, TimelineSelection_1.useTimelineRowSelection)(nodePathInfo);
123
+ const containsSelection = (0, TimelineSelection_1.useTimelineRowContainsSelection)(nodePathInfo);
124
+ const { selectedItems } = (0, TimelineSelection_1.useTimelineSelection)();
83
125
  (0, TimelineSelection_1.useTimelineMarqueeSelectableItem)(selectionItem, ref);
84
126
  const onPointerDown = (0, react_1.useCallback)((e) => {
85
127
  if (e.button === 0) {
@@ -113,13 +155,19 @@ const TimelineSequenceCurrentFrame = ({ s, displayDurationInFrames, premount, po
113
155
  const isPostmounting = relativeFrameWithPostmount >= 0 &&
114
156
  relativeFrameWithPostmount < ((_b = s.postmountDisplay) !== null && _b !== void 0 ? _b : 0) &&
115
157
  !isInRange;
158
+ const negativeStartEnd = negativeStart
159
+ ? negativeStart.left + negativeStart.width
160
+ : 0;
116
161
  const actualStyle = (0, react_1.useMemo)(() => {
162
+ const hasSelectedTrack = selectedItems.some((item) => item.type !== 'guide');
117
163
  return {
118
164
  ...style,
119
- opacity: isInRange ? 1 : 0.5,
165
+ background: negativeStart ? colors_1.TRANSPARENT : style.background,
166
+ border: negativeStart ? 'none' : style.border,
167
+ opacity: hasSelectedTrack && !selected && !containsSelection ? 0.75 : 1,
120
168
  };
121
- }, [isInRange, style]);
122
- return (jsx_runtime_1.jsxs("div", { ref: ref, [TimelineSelection_1.TIMELINE_MARQUEE_ITEM_ATTR]: true, style: actualStyle, title: s.displayName, onPointerDown: selectable ? onPointerDown : undefined, onDoubleClick: onDoubleClick, children: [premount ? (jsx_runtime_1.jsx("div", { style: {
169
+ }, [containsSelection, negativeStart, selected, selectedItems, style]);
170
+ const content = (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [premount ? (jsx_runtime_1.jsx("div", { style: {
123
171
  left: premount.left,
124
172
  width: premount.width,
125
173
  height: '100%',
@@ -148,20 +196,46 @@ const TimelineSequenceCurrentFrame = ({ s, displayDurationInFrames, premount, po
148
196
  s.type !== 'image' &&
149
197
  s.loopDisplay === undefined &&
150
198
  (isInRange || isPremounting || isPostmounting) ? (jsx_runtime_1.jsx("div", { style: {
151
- paddingLeft: 5 + ((_c = premount === null || premount === void 0 ? void 0 : premount.width) !== null && _c !== void 0 ? _c : 0),
199
+ paddingLeft: 5 + ((_c = negativeStart === null || negativeStart === void 0 ? void 0 : negativeStart.width) !== null && _c !== void 0 ? _c : 0) + ((_d = premount === null || premount === void 0 ? void 0 : premount.width) !== null && _d !== void 0 ? _d : 0),
152
200
  height: '100%',
153
201
  display: 'flex',
154
202
  alignItems: 'center',
155
203
  }, children: jsx_runtime_1.jsx(TimelineSequenceFrame_1.TimelineSequenceFrame, { premounted: isPremounting, postmounted: isPostmounting ? s.duration - 1 : null, roundedFrame: roundedFrame, frozenFrame: frozenFrame }) })) : null] }));
204
+ return (jsx_runtime_1.jsx("div", { ref: ref, [TimelineSelection_1.TIMELINE_MARQUEE_ITEM_ATTR]: true, style: actualStyle, title: s.displayName, onPointerDownCapture: onPointerDownCapture, onPointerDown: selectable ? onPointerDown : undefined, onDoubleClick: onDoubleClick, children: negativeStart ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
205
+ jsx_runtime_1.jsx(TimelineSequenceNegativeStart, { left: negativeStart.left, width: negativeStart.width, leftEdgeVisible: leftEdgeVisible, clipped: negativeStartClipped }), jsx_runtime_1.jsx("div", { style: {
206
+ background: style.background,
207
+ border: style.border,
208
+ borderBottomLeftRadius: 0,
209
+ borderBottomRightRadius: style.borderBottomRightRadius,
210
+ borderLeft: 'none',
211
+ borderRightColor: style.borderRightColor,
212
+ borderTopLeftRadius: 0,
213
+ borderTopRightRadius: style.borderTopRightRadius,
214
+ boxSizing: 'border-box',
215
+ height: '100%',
216
+ left: negativeStartEnd,
217
+ overflow: 'hidden',
218
+ position: 'absolute',
219
+ top: 0,
220
+ width: `calc(100% - ${negativeStartEnd}px)`,
221
+ }, children: jsx_runtime_1.jsx("div", { style: {
222
+ height: '100%',
223
+ left: -negativeStartEnd,
224
+ position: 'absolute',
225
+ top: 0,
226
+ width: style.width,
227
+ }, children: content }) })
228
+ ] })) : (content) }));
156
229
  };
157
- const TimelineSequenceInner = ({ s, connectedCompositions, windowWidth, nodePathInfo, sequenceFrameOffset, }) => {
230
+ const TimelineSequenceInner = ({ s, connectedCompositions, windowWidth, nodePathInfo, sequenceFrameOffset, cascadedStart, localStart, }) => {
158
231
  // If a duration is 1, it is essentially a still and it should have width 0
159
232
  // Some compositions may not be longer than their media duration,
160
233
  // if that is the case, it needs to be asynchronously determined
161
234
  var _a, _b, _c;
162
- var _d, _e, _f, _g, _h, _j;
235
+ var _d, _e, _f, _g, _h, _j, _k;
163
236
  const video = remotion_1.Internals.useVideo();
164
237
  const renderWindow = (0, react_1.useContext)(TimelineViewport_1.TimelineViewportContext);
238
+ const dragAwareDoubleClick = (0, react_1.useMemo)(() => (0, drag_aware_double_click_1.createDragAwareDoubleClickTracker)(), []);
165
239
  const maxMediaDuration = (0, use_max_media_duration_1.useMaxMediaDuration)(s, (_d = video === null || video === void 0 ? void 0 : video.fps) !== null && _d !== void 0 ? _d : 30);
166
240
  const effectiveMaxMediaDuration = s.loopDisplay ? null : maxMediaDuration;
167
241
  const extendVideoLastFrame = (0, is_video_with_last_frame_hold_1.isVideoWithLastFrameHold)(s);
@@ -215,6 +289,7 @@ const TimelineSequenceInner = ({ s, connectedCompositions, windowWidth, nodePath
215
289
  button: e.button,
216
290
  canOpenInEditor,
217
291
  numberOfConnectedCompositions: connectedCompositions.length,
292
+ sequenceWasDragged: dragAwareDoubleClick.consumePointerGestureWasDragged(),
218
293
  });
219
294
  if (action === null) {
220
295
  return;
@@ -233,6 +308,7 @@ const TimelineSequenceInner = ({ s, connectedCompositions, windowWidth, nodePath
233
308
  }, [
234
309
  canOpenInEditor,
235
310
  connectedCompositions,
311
+ dragAwareDoubleClick,
236
312
  openInEditor,
237
313
  s,
238
314
  selectComposition,
@@ -399,6 +475,7 @@ const TimelineSequenceInner = ({ s, connectedCompositions, windowWidth, nodePath
399
475
  nodePathInfo,
400
476
  windowWidth,
401
477
  timelineDurationInFrames: (_g = video === null || video === void 0 ? void 0 : video.durationInFrames) !== null && _g !== void 0 ? _g : 1,
478
+ onDragEnd: dragAwareDoubleClick.endPointerGesture,
402
479
  });
403
480
  if (!video) {
404
481
  throw new TypeError('Expected video config');
@@ -406,10 +483,11 @@ const TimelineSequenceInner = ({ s, connectedCompositions, windowWidth, nodePath
406
483
  const displayDurationInFrames = s.loopDisplay
407
484
  ? s.loopDisplay.durationInFrames * s.loopDisplay.numberOfTimes
408
485
  : s.duration;
409
- const { marginLeft, width, premountWidth, postmountWidth } = (0, react_1.useMemo)(() => {
486
+ const { marginLeft, width, negativeStartWidth, negativeStartClipped, premountWidth, postmountWidth, } = (0, react_1.useMemo)(() => {
410
487
  return (0, get_timeline_sequence_layout_1.getTimelineSequenceLayout)({
411
488
  durationInFrames: displayDurationInFrames,
412
489
  startFrom: s.loopDisplay ? s.from + s.loopDisplay.startOffset : s.from,
490
+ cascadedStart,
413
491
  startFromMedia: s.type === 'sequence' || s.type === 'image' ? 0 : s.startMediaFrom,
414
492
  maxMediaDuration: effectiveMaxMediaDuration,
415
493
  video,
@@ -418,6 +496,7 @@ const TimelineSequenceInner = ({ s, connectedCompositions, windowWidth, nodePath
418
496
  postmountDisplay: s.postmountDisplay,
419
497
  });
420
498
  }, [
499
+ cascadedStart,
421
500
  displayDurationInFrames,
422
501
  effectiveMaxMediaDuration,
423
502
  s,
@@ -431,12 +510,20 @@ const TimelineSequenceInner = ({ s, connectedCompositions, windowWidth, nodePath
431
510
  return (0, get_timeline_sequence_visible_layout_1.getTimelineSequenceVisibleLayout)({
432
511
  marginLeft,
433
512
  width,
513
+ negativeStartWidth,
434
514
  premountWidth: premountWidth !== null && premountWidth !== void 0 ? premountWidth : 0,
435
515
  postmountWidth: postmountWidth !== null && postmountWidth !== void 0 ? postmountWidth : 0,
436
516
  renderWindowLeft: renderWindow.left - timeline_layout_1.TIMELINE_PADDING,
437
517
  renderWindowWidth: renderWindow.width,
438
518
  });
439
- }, [marginLeft, postmountWidth, premountWidth, renderWindow, width]);
519
+ }, [
520
+ marginLeft,
521
+ negativeStartWidth,
522
+ postmountWidth,
523
+ premountWidth,
524
+ renderWindow,
525
+ width,
526
+ ]);
440
527
  const mediaVisualizationStyle = (0, react_1.useMemo)(() => {
441
528
  var _a, _b;
442
529
  var _c, _d;
@@ -446,6 +533,9 @@ const TimelineSequenceInner = ({ s, connectedCompositions, windowWidth, nodePath
446
533
  height: '100%',
447
534
  };
448
535
  }, [visibleLayout]);
536
+ const showLeftBorderRadius = (visibleLayout === null || visibleLayout === void 0 ? void 0 : visibleLayout.leftEdgeVisible) === true &&
537
+ localStart >= 0 &&
538
+ ((_h = s.trimBefore) !== null && _h !== void 0 ? _h : 0) === 0;
449
539
  const style = (0, react_1.useMemo)(() => {
450
540
  var _a, _b;
451
541
  return {
@@ -457,14 +547,14 @@ const TimelineSequenceInner = ({ s, connectedCompositions, windowWidth, nodePath
457
547
  ? colors_1.TIMELINE_IMAGE_GRADIENT
458
548
  : colors_1.BLUE,
459
549
  border: `${get_timeline_sequence_layout_1.SEQUENCE_BORDER_WIDTH}px solid ${colors_1.WHITE_ALPHA_20}`,
460
- borderLeftColor: (visibleLayout === null || visibleLayout === void 0 ? void 0 : visibleLayout.leftEdgeVisible)
550
+ borderLeftColor: (visibleLayout === null || visibleLayout === void 0 ? void 0 : visibleLayout.leftEdgeVisible) && !negativeStartClipped
461
551
  ? colors_1.WHITE_ALPHA_20
462
552
  : colors_1.TRANSPARENT,
463
553
  borderRightColor: (visibleLayout === null || visibleLayout === void 0 ? void 0 : visibleLayout.rightEdgeVisible)
464
554
  ? colors_1.WHITE_ALPHA_20
465
555
  : colors_1.TRANSPARENT,
466
- borderTopLeftRadius: (visibleLayout === null || visibleLayout === void 0 ? void 0 : visibleLayout.leftEdgeVisible) ? 2 : 0,
467
- borderBottomLeftRadius: (visibleLayout === null || visibleLayout === void 0 ? void 0 : visibleLayout.leftEdgeVisible) ? 2 : 0,
556
+ borderTopLeftRadius: showLeftBorderRadius ? 2 : 0,
557
+ borderBottomLeftRadius: showLeftBorderRadius ? 2 : 0,
468
558
  borderTopRightRadius: (visibleLayout === null || visibleLayout === void 0 ? void 0 : visibleLayout.rightEdgeVisible) ? 2 : 0,
469
559
  borderBottomRightRadius: (visibleLayout === null || visibleLayout === void 0 ? void 0 : visibleLayout.rightEdgeVisible) ? 2 : 0,
470
560
  position: 'absolute',
@@ -474,7 +564,7 @@ const TimelineSequenceInner = ({ s, connectedCompositions, windowWidth, nodePath
474
564
  color: colors_1.WHITE,
475
565
  overflow: 'hidden',
476
566
  };
477
- }, [s.type, visibleLayout]);
567
+ }, [negativeStartClipped, s.type, showLeftBorderRadius, visibleLayout]);
478
568
  const showRightEdgeDragHandle = (0, TimelineSequenceRightEdgeDragHandle_1.isTimelineSequenceDurationDraggable)(s) &&
479
569
  nodePath !== null &&
480
570
  validatedLocation !== null &&
@@ -495,13 +585,14 @@ const TimelineSequenceInner = ({ s, connectedCompositions, windowWidth, nodePath
495
585
  const mediaDisplayDurationInFrames = visibleLayout.media
496
586
  ? visibleLayout.media.width / frameIncrement
497
587
  : 0;
498
- const sequence = (jsx_runtime_1.jsxs(TimelineSequenceCurrentFrame, { s: s, displayDurationInFrames: displayDurationInFrames, premount: visibleLayout.premount, postmount: visibleLayout.postmount, style: style, nodePathInfo: nodePathInfo, sequenceFrameOffset: sequenceFrameOffset, fromCanUpdate: fromCanUpdate, frozenFrame: frozenFrame, onMoveDragPointerDown: onMoveDragPointerDown, onDoubleClick: canHandleSequenceDoubleClick ? onSequenceDoubleClick : undefined, children: [s.type === 'audio' && visibleLayout.media ? (jsx_runtime_1.jsx("div", { style: mediaVisualizationStyle, children: jsx_runtime_1.jsx(AudioWaveform_1.AudioWaveform, { src: s.src, height: timeline_layout_1.TIMELINE_LAYER_HEIGHT_AUDIO, doesVolumeChange: s.doesVolumeChange, muted: s.muted, visualizationWidth: visibleLayout.media.width, startFrom: s.startMediaFrom, durationInFrames: s.duration, displayOffsetInFrames: mediaDisplayOffsetInFrames, displayDurationInFrames: mediaDisplayDurationInFrames, volume: s.volume, playbackRate: s.playbackRate, loopDisplay: s.loopDisplay }) })) : null, s.type === 'video' && visibleLayout.media ? (jsx_runtime_1.jsx(TimelineVideoInfo_1.TimelineVideoInfo, { src: s.src, visualizationWidth: visibleLayout.media.width, displayOffsetInFrames: mediaDisplayOffsetInFrames, displayDurationInFrames: mediaDisplayDurationInFrames, startMediaFrom: s.startMediaFrom, mediaFrameAtSequenceZero: s.mediaFrameAtSequenceZero, sequenceFrameOffset: sequenceFrameOffset, playbackRate: s.playbackRate, volume: s.volume, muted: s.muted, doesVolumeChange: s.doesVolumeChange, marginLeft: visibleLayout.media.left, loopDisplay: s.loopDisplay, frozenMediaFrame: s.frozenMediaFrame, extendLastFrame: extendVideoLastFrame })) : null, s.type === 'image' && visibleLayout.media ? (jsx_runtime_1.jsx("div", { style: mediaVisualizationStyle, children: jsx_runtime_1.jsx(TimelineImageInfo_1.TimelineImageInfo, { src: s.src, visualizationWidth: visibleLayout.media.width, offsetInPixels: visibleLayout.media.offset }) })) : null, s.loopDisplay === undefined ? null : (jsx_runtime_1.jsx(LoopedTimelineIndicators_1.LoopedTimelineIndicator, { loops: s.loopDisplay.numberOfTimes, fullWidth: width, visibleOffset: visibleLayout.cropLeft, visibleWidth: visibleLayout.width })), showLeftEdgeDragHandle &&
588
+ const sequence = (jsx_runtime_1.jsxs(TimelineSequenceCurrentFrame, { s: s, displayDurationInFrames: displayDurationInFrames, premount: visibleLayout.premount, postmount: visibleLayout.postmount, negativeStart: visibleLayout.negativeStart, leftEdgeVisible: visibleLayout.leftEdgeVisible, negativeStartClipped: negativeStartClipped, style: style, nodePathInfo: nodePathInfo, sequenceFrameOffset: sequenceFrameOffset, fromCanUpdate: fromCanUpdate, frozenFrame: frozenFrame, onMoveDragPointerDown: onMoveDragPointerDown, onPointerDownCapture: dragAwareDoubleClick.beginPointerGesture, onDoubleClick: canHandleSequenceDoubleClick ? onSequenceDoubleClick : undefined, children: [s.type === 'audio' && visibleLayout.media ? (jsx_runtime_1.jsx("div", { style: mediaVisualizationStyle, children: jsx_runtime_1.jsx(AudioWaveform_1.AudioWaveform, { src: s.src, height: timeline_layout_1.TIMELINE_LAYER_HEIGHT_AUDIO, doesVolumeChange: s.doesVolumeChange, muted: s.muted, visualizationWidth: visibleLayout.media.width, startFrom: s.startMediaFrom, durationInFrames: s.duration, displayOffsetInFrames: mediaDisplayOffsetInFrames, displayDurationInFrames: mediaDisplayDurationInFrames, volume: s.volume, playbackRate: s.playbackRate, loopDisplay: s.loopDisplay }) })) : null, s.type === 'video' && visibleLayout.media ? (jsx_runtime_1.jsx(TimelineVideoInfo_1.TimelineVideoInfo, { src: s.src, visualizationWidth: visibleLayout.media.width, displayOffsetInFrames: mediaDisplayOffsetInFrames, displayDurationInFrames: mediaDisplayDurationInFrames, startMediaFrom: s.startMediaFrom, mediaFrameAtSequenceZero: s.mediaFrameAtSequenceZero, sequenceFrameOffset: sequenceFrameOffset, playbackRate: s.playbackRate, volume: s.volume, muted: s.muted, doesVolumeChange: s.doesVolumeChange, marginLeft: visibleLayout.media.left, loopDisplay: s.loopDisplay, frozenMediaFrame: s.frozenMediaFrame, extendLastFrame: extendVideoLastFrame })) : null, s.type === 'image' && visibleLayout.media ? (jsx_runtime_1.jsx("div", { style: mediaVisualizationStyle, children: jsx_runtime_1.jsx(TimelineImageInfo_1.TimelineImageInfo, { src: s.src, offsetInPixels: visibleLayout.media.offset }) })) : null, s.loopDisplay === undefined ? null : (jsx_runtime_1.jsx(LoopedTimelineIndicators_1.LoopedTimelineIndicator, { loops: s.loopDisplay.numberOfTimes, fullWidth: width, visibleOffset: visibleLayout.cropLeft, visibleWidth: visibleLayout.width })), showLeftEdgeDragHandle &&
499
589
  visibleLayout.leftEdgeVisible &&
590
+ negativeStartWidth === 0 &&
500
591
  nodePathInfo &&
501
- validatedLocation ? (jsx_runtime_1.jsx(TimelineSequenceRightEdgeDragHandle_1.TimelineSequenceLeftEdgeDragHandle, { nodePathInfo: nodePathInfo, windowWidth: windowWidth, timelineDurationInFrames: (_h = video.durationInFrames) !== null && _h !== void 0 ? _h : 1 })) : null, showRightEdgeDragHandle &&
592
+ validatedLocation ? (jsx_runtime_1.jsx(TimelineSequenceRightEdgeDragHandle_1.TimelineSequenceLeftEdgeDragHandle, { nodePathInfo: nodePathInfo, windowWidth: windowWidth, timelineDurationInFrames: (_j = video.durationInFrames) !== null && _j !== void 0 ? _j : 1, onDragEnd: dragAwareDoubleClick.endPointerGesture })) : null, showRightEdgeDragHandle &&
502
593
  visibleLayout.rightEdgeVisible &&
503
594
  nodePathInfo &&
504
- validatedLocation ? (jsx_runtime_1.jsx(TimelineSequenceRightEdgeDragHandle_1.TimelineSequenceRightEdgeDragHandle, { nodePathInfo: nodePathInfo, windowWidth: windowWidth, timelineDurationInFrames: (_j = video.durationInFrames) !== null && _j !== void 0 ? _j : 1 })) : null] }));
595
+ validatedLocation ? (jsx_runtime_1.jsx(TimelineSequenceRightEdgeDragHandle_1.TimelineSequenceRightEdgeDragHandle, { nodePathInfo: nodePathInfo, windowWidth: windowWidth, timelineDurationInFrames: (_k = video.durationInFrames) !== null && _k !== void 0 ? _k : 1, onDragEnd: dragAwareDoubleClick.endPointerGesture })) : null] }));
505
596
  return previewConnected || window.remotion_isReadOnlyStudio ? (jsx_runtime_1.jsx(ContextMenu_1.ContextMenu, { getItems: getContextMenuItems, children: sequence })) : (sequence);
506
597
  };
507
598
  exports.TimelineSequence = react_1.default.memo(TimelineSequenceFn);
@@ -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;