@remotion/studio 4.0.479 → 4.0.482

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 (75) hide show
  1. package/dist/components/AudioWaveform.js +19 -11
  2. package/dist/components/Button.d.ts +1 -0
  3. package/dist/components/Button.js +2 -2
  4. package/dist/components/CurrentCompositionSideEffects.d.ts +0 -3
  5. package/dist/components/CurrentCompositionSideEffects.js +1 -37
  6. package/dist/components/Editor.js +2 -5
  7. package/dist/components/EditorContent.js +2 -1
  8. package/dist/components/ExpandedTracksProvider.d.ts +1 -0
  9. package/dist/components/ExpandedTracksProvider.js +81 -7
  10. package/dist/components/GlobalKeybindings.d.ts +3 -1
  11. package/dist/components/GlobalKeybindings.js +104 -10
  12. package/dist/components/InspectorPanel/SequenceSelectionInspector.js +7 -5
  13. package/dist/components/InspectorPanel/inspector-selection.d.ts +3 -3
  14. package/dist/components/InspectorPanel/inspector-selection.js +7 -6
  15. package/dist/components/InspectorPanel/styles.d.ts +1 -0
  16. package/dist/components/InspectorPanel/styles.js +19 -1
  17. package/dist/components/InspectorPanel.js +3 -3
  18. package/dist/components/InspectorSequenceSection.d.ts +3 -0
  19. package/dist/components/InspectorSequenceSection.js +12 -2
  20. package/dist/components/KeyboardShortcutsExplainer.js +10 -2
  21. package/dist/components/MediaVolumeProvider.js +4 -4
  22. package/dist/components/Modals.js +2 -1
  23. package/dist/components/NewComposition/CodemodFooter.d.ts +1 -0
  24. package/dist/components/NewComposition/CodemodFooter.js +25 -3
  25. package/dist/components/NewComposition/InputDragger.d.ts +4 -0
  26. package/dist/components/NewComposition/InputDragger.js +18 -2
  27. package/dist/components/NewComposition/NewComposition.d.ts +2 -0
  28. package/dist/components/NewComposition/NewComposition.js +178 -0
  29. package/dist/components/PreviewToolbar.js +3 -3
  30. package/dist/components/ResetZoomButton.d.ts +2 -1
  31. package/dist/components/ResetZoomButton.js +5 -1
  32. package/dist/components/SelectedOutlineElement.js +39 -0
  33. package/dist/components/SelectedOutlineOverlay.d.ts +6 -0
  34. package/dist/components/SelectedOutlineOverlay.js +21 -3
  35. package/dist/components/Timeline/Timeline.js +9 -9
  36. package/dist/components/Timeline/TimelineEffectItem.js +1 -1
  37. package/dist/components/Timeline/TimelineEffectPropItem.js +1 -1
  38. package/dist/components/Timeline/TimelineExpandArrowButton.js +42 -2
  39. package/dist/components/Timeline/TimelineExpandedRow.js +2 -2
  40. package/dist/components/Timeline/TimelineExpandedSection.js +8 -9
  41. package/dist/components/Timeline/TimelineRowChrome.d.ts +2 -0
  42. package/dist/components/Timeline/TimelineRowChrome.js +5 -3
  43. package/dist/components/Timeline/TimelineSelection.d.ts +26 -3
  44. package/dist/components/Timeline/TimelineSelection.js +322 -91
  45. package/dist/components/Timeline/TimelineSequenceItem.js +62 -5
  46. package/dist/components/Timeline/TimelineSequencePropItem.js +1 -1
  47. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +6 -4
  48. package/dist/components/Timeline/find-track-for-node-path-info.js +2 -2
  49. package/dist/components/Timeline/get-node-keyframes.d.ts +7 -0
  50. package/dist/components/Timeline/get-node-keyframes.js +26 -1
  51. package/dist/components/Timeline/reset-selected-timeline-props.js +15 -2
  52. package/dist/components/Timeline/timeline-expanded-filter.d.ts +12 -0
  53. package/dist/components/Timeline/timeline-expanded-filter.js +38 -0
  54. package/dist/components/Timeline/timeline-field-display-utils.js +3 -0
  55. package/dist/components/Timeline/use-expanded-track-keyframe-rows.js +50 -18
  56. package/dist/components/Timeline/use-timeline-expanded-tree.d.ts +1 -0
  57. package/dist/components/Timeline/use-timeline-expanded-tree.js +27 -0
  58. package/dist/components/Timeline/use-timeline-height.js +51 -7
  59. package/dist/components/Timeline/use-timeline-keyframe-drag.js +12 -6
  60. package/dist/components/TopPanel.js +1 -1
  61. package/dist/components/composition-menu-items.js +17 -0
  62. package/dist/components/selected-outline-measurement.js +48 -14
  63. package/dist/error-overlay/remotion-overlay/ErrorLoader.js +8 -1
  64. package/dist/esm/{chunk-fge2mq5p.js → chunk-nkqfa5bw.js} +17611 -16502
  65. package/dist/esm/internals.mjs +17611 -16502
  66. package/dist/esm/previewEntry.mjs +5179 -4068
  67. package/dist/esm/renderEntry.mjs +1 -1
  68. package/dist/helpers/calculate-timeline.js +6 -2
  69. package/dist/helpers/get-sequence-visible-range.d.ts +1 -0
  70. package/dist/helpers/get-sequence-visible-range.js +15 -1
  71. package/dist/helpers/migrate-expanded-tracks-for-subscription-key.js +3 -3
  72. package/dist/state/modals.d.ts +2 -0
  73. package/package.json +11 -11
  74. package/dist/components/Timeline/TimelineItemStack.d.ts +0 -5
  75. package/dist/components/Timeline/TimelineItemStack.js +0 -29
@@ -1,8 +1,14 @@
1
1
  import React from 'react';
2
+ import { type SelectedOutline } from './selected-outline-geometry';
3
+ import { type SelectedOutlineTarget } from './selected-outline-types';
2
4
  export { applySelectedOutlineDragAxisLock, applySelectedOutlineTransformOriginAxisLock, compensateTranslateForTransformOrigin, getSelectedOutlineActiveSchema, getSelectedOutlineDragChanges, getSelectedOutlineDragValues, getSelectedOutlineKeyboardNudgeDelta, getSelectedOutlineKeyboardNudgeDeltas, getSelectedOutlineRotationDragChanges, getSelectedOutlineRotationDragStates, getSelectedOutlineRotationDragValues, getSelectedOutlineScaleDragChanges, getSelectedOutlineScaleDragStates, getSelectedOutlineScaleDragValues, getSelectedOutlineScaleEdgeInfo, getSelectedOutlineTransformOriginLockedAxis, isSelectedOutlineDragPastThreshold, selectedOutlineUvSnapThresholdPx, selectedOutlineTransformOriginSnapThresholdPx, snapSelectedOutlineRotationDeltaDegrees, snapSelectedOutlineUv, snapSelectedOutlineTransformOriginUv, } from './selected-outline-drag';
3
5
  export { getOutlineSelectionInteraction, getSelectedEffectFieldsBySequenceKey, getSelectedOutlineRotationCornerInfo, getSelectedOutlineRotationDeltaDegrees, getSelectedOutlineRotationPivot, getSelectedSequenceKeys, getSequencesWithSelectableOutlines, getTransformedSvgViewportPoints, } from './selected-outline-measurement';
4
6
  export { selectedOutlineDragThresholdPx } from './selected-outline-types';
5
7
  export type { SelectedOutlineDragState, SelectedOutlineRotationDragState, SelectedOutlineScaleDragState, } from './selected-outline-types';
8
+ export declare const orderOutlinesForRendering: ({ outlines, targetsByKey, }: {
9
+ readonly outlines: readonly SelectedOutline[];
10
+ readonly targetsByKey: ReadonlyMap<string, SelectedOutlineTarget>;
11
+ }) => readonly SelectedOutline[];
6
12
  export declare const SelectedOutlineOverlay: React.FC<{
7
13
  readonly scale: number;
8
14
  }>;
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.SelectedOutlineOverlay = exports.selectedOutlineDragThresholdPx = exports.getTransformedSvgViewportPoints = exports.getSequencesWithSelectableOutlines = exports.getSelectedSequenceKeys = exports.getSelectedOutlineRotationPivot = exports.getSelectedOutlineRotationDeltaDegrees = exports.getSelectedOutlineRotationCornerInfo = exports.getSelectedEffectFieldsBySequenceKey = exports.getOutlineSelectionInteraction = exports.snapSelectedOutlineTransformOriginUv = exports.snapSelectedOutlineUv = exports.snapSelectedOutlineRotationDeltaDegrees = exports.selectedOutlineTransformOriginSnapThresholdPx = exports.selectedOutlineUvSnapThresholdPx = exports.isSelectedOutlineDragPastThreshold = exports.getSelectedOutlineTransformOriginLockedAxis = exports.getSelectedOutlineScaleEdgeInfo = exports.getSelectedOutlineScaleDragValues = exports.getSelectedOutlineScaleDragStates = exports.getSelectedOutlineScaleDragChanges = exports.getSelectedOutlineRotationDragValues = exports.getSelectedOutlineRotationDragStates = exports.getSelectedOutlineRotationDragChanges = exports.getSelectedOutlineKeyboardNudgeDeltas = exports.getSelectedOutlineKeyboardNudgeDelta = exports.getSelectedOutlineDragValues = exports.getSelectedOutlineDragChanges = exports.getSelectedOutlineActiveSchema = exports.compensateTranslateForTransformOrigin = exports.applySelectedOutlineTransformOriginAxisLock = exports.applySelectedOutlineDragAxisLock = void 0;
36
+ exports.SelectedOutlineOverlay = exports.orderOutlinesForRendering = exports.selectedOutlineDragThresholdPx = exports.getTransformedSvgViewportPoints = exports.getSequencesWithSelectableOutlines = exports.getSelectedSequenceKeys = exports.getSelectedOutlineRotationPivot = exports.getSelectedOutlineRotationDeltaDegrees = exports.getSelectedOutlineRotationCornerInfo = exports.getSelectedEffectFieldsBySequenceKey = exports.getOutlineSelectionInteraction = exports.snapSelectedOutlineTransformOriginUv = exports.snapSelectedOutlineUv = exports.snapSelectedOutlineRotationDeltaDegrees = exports.selectedOutlineTransformOriginSnapThresholdPx = exports.selectedOutlineUvSnapThresholdPx = exports.isSelectedOutlineDragPastThreshold = exports.getSelectedOutlineTransformOriginLockedAxis = exports.getSelectedOutlineScaleEdgeInfo = exports.getSelectedOutlineScaleDragValues = exports.getSelectedOutlineScaleDragStates = exports.getSelectedOutlineScaleDragChanges = exports.getSelectedOutlineRotationDragValues = exports.getSelectedOutlineRotationDragStates = exports.getSelectedOutlineRotationDragChanges = exports.getSelectedOutlineKeyboardNudgeDeltas = exports.getSelectedOutlineKeyboardNudgeDelta = exports.getSelectedOutlineDragValues = exports.getSelectedOutlineDragChanges = exports.getSelectedOutlineActiveSchema = exports.compensateTranslateForTransformOrigin = exports.applySelectedOutlineTransformOriginAxisLock = exports.applySelectedOutlineDragAxisLock = void 0;
37
37
  const jsx_runtime_1 = require("react/jsx-runtime");
38
38
  const player_1 = require("@remotion/player");
39
39
  const react_1 = __importStar(require("react"));
@@ -95,6 +95,16 @@ const outlineContainer = {
95
95
  pointerEvents: 'none',
96
96
  overflow: 'visible',
97
97
  };
98
+ const orderOutlinesForRendering = ({ outlines, targetsByKey, }) => {
99
+ return [...outlines].sort((a, b) => {
100
+ var _a, _b;
101
+ var _c, _d;
102
+ const aSelected = (_c = (_a = targetsByKey.get(a.key)) === null || _a === void 0 ? void 0 : _a.selected) !== null && _c !== void 0 ? _c : false;
103
+ const bSelected = (_d = (_b = targetsByKey.get(b.key)) === null || _b === void 0 ? void 0 : _b.selected) !== null && _d !== void 0 ? _d : false;
104
+ return Number(aSelected) - Number(bSelected);
105
+ });
106
+ };
107
+ exports.orderOutlinesForRendering = orderOutlinesForRendering;
98
108
  const SelectedOutlineOverlay = ({ scale }) => {
99
109
  const { selectedItems, selectItem } = (0, TimelineSelection_1.useTimelineSelection)();
100
110
  const { sequences } = (0, react_1.useContext)(remotion_1.Internals.SequenceManager);
@@ -120,6 +130,9 @@ const SelectedOutlineOverlay = ({ scale }) => {
120
130
  setHoveredOutlineKey(null);
121
131
  }
122
132
  }, []);
133
+ const selectOutlineItem = (0, react_1.useCallback)((item, interaction) => {
134
+ selectItem(item, interaction, undefined, { reveal: true });
135
+ }, [selectItem]);
123
136
  const outlineTargets = (0, react_1.useMemo)(() => {
124
137
  if (!editorShowOutlines) {
125
138
  return [];
@@ -363,8 +376,13 @@ const SelectedOutlineOverlay = ({ scale }) => {
363
376
  const targetsByKey = (0, react_1.useMemo)(() => {
364
377
  return new Map(outlineTargets.map((target) => [target.key, target]));
365
378
  }, [outlineTargets]);
379
+ const outlinesForRendering = (0, react_1.useMemo)(() => {
380
+ return (0, exports.orderOutlinesForRendering)({ outlines, targetsByKey });
381
+ }, [outlines, targetsByKey]);
366
382
  const allDragTargets = (0, react_1.useMemo)(() => {
367
- return outlineTargets.flatMap((target) => target.selected && target.drag !== null ? [target.drag] : []);
383
+ return outlineTargets.flatMap((target) => (target.selected || target.containsSelection) && target.drag !== null
384
+ ? [target.drag]
385
+ : []);
368
386
  }, [outlineTargets]);
369
387
  const allScaleDragTargets = (0, react_1.useMemo)(() => {
370
388
  return outlineTargets.flatMap((target) => target.selected && target.scaleDrag !== null ? [target.scaleDrag] : []);
@@ -620,6 +638,6 @@ const SelectedOutlineOverlay = ({ scale }) => {
620
638
  if (outlineTargets.length === 0) {
621
639
  return null;
622
640
  }
623
- return (jsx_runtime_1.jsxs("svg", { ref: overlayRef, style: outlineContainer, width: "100%", height: "100%", "aria-hidden": "true", children: [outlines.map((outline) => (jsx_runtime_1.jsx(SelectedOutlineElement_1.SelectedOutlineElement, { allDragTargets: allDragTargets, allRotationDragTargets: allRotationDragTargets, allScaleDragTargets: allScaleDragTargets, dragging: draggingOutline, hovered: hoveredOutlineKey === outline.key, outline: outline, onDraggingChange: onDraggingChange, onHoverChange: setHoveredOutlineKey, onSelect: selectItem, scale: scale, target: targetsByKey.get(outline.key) }, outline.key))), outlines.map((outline) => (jsx_runtime_1.jsx(SelectedOutlineUvControls_1.SelectedOutlineUvHandleConnectionLayer, { outline: outline, target: targetsByKey.get(outline.key) }, `${outline.key}-uv-connection-lines`))), outlines.map((outline) => (jsx_runtime_1.jsx(SelectedOutlineUvControls_1.SelectedOutlineUvHandleCircleLayer, { onDraggingChange: onDraggingChange, onSelect: selectItem, outline: outline, target: targetsByKey.get(outline.key) }, `${outline.key}-uv-handles`)))] }));
641
+ return (jsx_runtime_1.jsxs("svg", { ref: overlayRef, style: outlineContainer, width: "100%", height: "100%", "aria-hidden": "true", children: [outlinesForRendering.map((outline) => (jsx_runtime_1.jsx(SelectedOutlineElement_1.SelectedOutlineElement, { allDragTargets: allDragTargets, allRotationDragTargets: allRotationDragTargets, allScaleDragTargets: allScaleDragTargets, dragging: draggingOutline, hovered: hoveredOutlineKey === outline.key, outline: outline, onDraggingChange: onDraggingChange, onHoverChange: setHoveredOutlineKey, onSelect: selectOutlineItem, scale: scale, target: targetsByKey.get(outline.key) }, outline.key))), outlinesForRendering.map((outline) => (jsx_runtime_1.jsx(SelectedOutlineUvControls_1.SelectedOutlineUvHandleConnectionLayer, { outline: outline, target: targetsByKey.get(outline.key) }, `${outline.key}-uv-connection-lines`))), outlinesForRendering.map((outline) => (jsx_runtime_1.jsx(SelectedOutlineUvControls_1.SelectedOutlineUvHandleCircleLayer, { onDraggingChange: onDraggingChange, onSelect: selectOutlineItem, outline: outline, target: targetsByKey.get(outline.key) }, `${outline.key}-uv-handles`)))] }));
624
642
  };
625
643
  exports.SelectedOutlineOverlay = SelectedOutlineOverlay;
@@ -231,15 +231,15 @@ const TimelineInner = () => {
231
231
  return null;
232
232
  }
233
233
  return (jsx_runtime_1.jsx(SubscribeToNodePaths_1.SubscribeToNodePaths, { overrideId: sequence.controls.overrideId, componentIdentity: sequence.controls.componentIdentity, schema: sequence.controls.schema, getStack: sequence.getStack, effects: sequence.effects }, sequence.id));
234
- }), jsx_runtime_1.jsx(SequencePropsObserver_1.SequencePropsObserver, {}), jsx_runtime_1.jsxs(TimelineKeyframeTracksContext_1.TimelineKeyframeTracksProvider, { tracks: filtered, children: [
235
- jsx_runtime_1.jsx(TimelineSelection_1.TimelineSelectAllKeybindings, { timeline: shown }), jsx_runtime_1.jsx(TimelineHeightContainer_1.TimelineHeightContainer, { shown: shown, hasBeenCut: hasBeenCut, children: isStill ? (jsx_runtime_1.jsx(TimelineList_1.TimelineList, { timeline: shown })) : (jsx_runtime_1.jsxs(TimelineWidthProvider_1.TimelineWidthProvider, { children: [
236
- jsx_runtime_1.jsx(TimelinePinchZoom_1.TimelinePinchZoom, {}), jsx_runtime_1.jsxs(SplitterContainer_1.SplitterContainer, { orientation: "vertical", defaultFlex: 0.2, id: "names-to-timeline", maxFlex: 0.5, minFlex: 0.15, children: [
237
- jsx_runtime_1.jsx(SplitterElement_1.SplitterElement, { type: "flexer", sticky: jsx_runtime_1.jsx(TimelineTimeIndicators_1.TimelineTimePlaceholders, {}), children: jsx_runtime_1.jsx(TimelineList_1.TimelineList, { timeline: shown }) }), jsx_runtime_1.jsx(SplitterHandle_1.SplitterHandle, { onCollapse: noop, allowToCollapse: "none" }), jsx_runtime_1.jsx(SplitterElement_1.SplitterElement, { type: "anti-flexer", sticky: null, children: jsx_runtime_1.jsxs(TimelineScrollable_1.TimelineScrollable, { children: [
238
- jsx_runtime_1.jsx(TimelineTracks_1.TimelineTracks, { timeline: shown, hasBeenCut: hasBeenCut }), jsx_runtime_1.jsx(TimelinePlayCursorSyncer_1.TimelinePlayCursorSyncer, {}), jsx_runtime_1.jsx(TimelineInOutPointer_1.TimelineInOutPointer, {}), jsx_runtime_1.jsx(TimelineTimeIndicators_1.TimelineTimeIndicators, {}), jsx_runtime_1.jsx(TimelineDragHandler_1.TimelineDragHandler, {}), jsx_runtime_1.jsx(TimelineInOutDragHandler_1.TimelineInOutDragHandler, {}), jsx_runtime_1.jsx(TimelineSlider_1.TimelineSlider, {})
239
- ] }) })
240
- ] })
241
- ] })) })
242
- ] })
234
+ }), jsx_runtime_1.jsx(SequencePropsObserver_1.SequencePropsObserver, {}), jsx_runtime_1.jsx(TimelineKeyframeTracksContext_1.TimelineKeyframeTracksProvider, { tracks: filtered, children: jsx_runtime_1.jsxs(TimelineSelection_1.TimelineSelectableItemsProvider, { timeline: shown, children: [
235
+ jsx_runtime_1.jsx(TimelineSelection_1.TimelineSelectAllKeybindings, { timeline: shown }), jsx_runtime_1.jsx(TimelineHeightContainer_1.TimelineHeightContainer, { shown: shown, hasBeenCut: hasBeenCut, children: isStill ? (jsx_runtime_1.jsx(TimelineList_1.TimelineList, { timeline: shown })) : (jsx_runtime_1.jsxs(TimelineWidthProvider_1.TimelineWidthProvider, { children: [
236
+ jsx_runtime_1.jsx(TimelinePinchZoom_1.TimelinePinchZoom, {}), jsx_runtime_1.jsxs(SplitterContainer_1.SplitterContainer, { orientation: "vertical", defaultFlex: 0.2, id: "names-to-timeline", maxFlex: 0.5, minFlex: 0.15, children: [
237
+ jsx_runtime_1.jsx(SplitterElement_1.SplitterElement, { type: "flexer", sticky: jsx_runtime_1.jsx(TimelineTimeIndicators_1.TimelineTimePlaceholders, {}), children: jsx_runtime_1.jsx(TimelineList_1.TimelineList, { timeline: shown }) }), jsx_runtime_1.jsx(SplitterHandle_1.SplitterHandle, { onCollapse: noop, allowToCollapse: "none" }), jsx_runtime_1.jsx(SplitterElement_1.SplitterElement, { type: "anti-flexer", sticky: null, children: jsx_runtime_1.jsxs(TimelineScrollable_1.TimelineScrollable, { children: [
238
+ jsx_runtime_1.jsx(TimelineTracks_1.TimelineTracks, { timeline: shown, hasBeenCut: hasBeenCut }), jsx_runtime_1.jsx(TimelinePlayCursorSyncer_1.TimelinePlayCursorSyncer, {}), jsx_runtime_1.jsx(TimelineInOutPointer_1.TimelineInOutPointer, {}), jsx_runtime_1.jsx(TimelineTimeIndicators_1.TimelineTimeIndicators, {}), jsx_runtime_1.jsx(TimelineDragHandler_1.TimelineDragHandler, {}), jsx_runtime_1.jsx(TimelineInOutDragHandler_1.TimelineInOutDragHandler, {}), jsx_runtime_1.jsx(TimelineSlider_1.TimelineSlider, {})
239
+ ] }) })
240
+ ] })
241
+ ] })) })
242
+ ] }) })
243
243
  ] }));
244
244
  };
245
245
  exports.Timeline = react_1.default.memo(TimelineInner);
@@ -316,7 +316,7 @@ const TimelineEffectItem = ({ label, nodePathInfo, effectIndex, effectSchema, do
316
316
  ...(dropIndicator === 'before' ? { top: -1 } : { bottom: -1 }),
317
317
  };
318
318
  }, [dropIndicator]);
319
- const row = (jsx_runtime_1.jsx(TimelineRowChrome_1.TimelineRowChrome, { depth: rowDepth, eye: canToggle ? (jsx_runtime_1.jsx(TimelineLayerEye_1.TimelineLayerEye, { type: "effect", hidden: isDisabled, onInvoked: onToggle })) : (jsx_runtime_1.jsx(TimelineLayerEye_1.TimelineLayerEyeSpacer, {})), arrow: jsx_runtime_1.jsx(TimelineExpandArrowButton_1.TimelineExpandArrowButton, { isExpanded: isExpanded, onClick: () => toggleTrack(nodePathInfo), label: `${label} section`, disabled: false }), style: rowStyle, selected: selection.selected, selectable: selection.selectable, onSelect: selection.onSelect, showSelectedBackground: true, containsSelection: false, outerHeight: null, children: jsx_runtime_1.jsx("span", { title: label, style: labelStyle, children: label }) }));
319
+ const row = (jsx_runtime_1.jsx(TimelineRowChrome_1.TimelineRowChrome, { depth: rowDepth, eye: canToggle ? (jsx_runtime_1.jsx(TimelineLayerEye_1.TimelineLayerEye, { type: "effect", hidden: isDisabled, onInvoked: onToggle })) : (jsx_runtime_1.jsx(TimelineLayerEye_1.TimelineLayerEyeSpacer, {})), arrow: jsx_runtime_1.jsx(TimelineExpandArrowButton_1.TimelineExpandArrowButton, { isExpanded: isExpanded, onClick: () => toggleTrack(nodePathInfo), label: `${label} section`, disabled: false }), style: rowStyle, selected: selection.selected, selectable: selection.selectable, selectionItem: selection.selectionItem, onSelect: selection.onSelect, showSelectedBackground: true, containsSelection: false, outerHeight: null, children: jsx_runtime_1.jsx("span", { title: label, style: labelStyle, children: label }) }));
320
320
  const draggableRow = canReorder ? (jsx_runtime_1.jsxs("div", { draggable: true, onDragStart: onDragStart, onDragEnd: onDragEnd, onDragOver: onDragOver, onDragLeave: onDragLeave, onDrop: onDrop, style: reorderWrapper, children: [reorderLineStyle ? jsx_runtime_1.jsx("div", { style: reorderLineStyle }) : null, row] })) : (row);
321
321
  return previewConnected ? (jsx_runtime_1.jsx(ContextMenu_1.ContextMenu, { values: contextMenuValues, onOpen: selection.selectable ? selection.onSelect : null, children: draggableRow })) : (draggableRow);
322
322
  };
@@ -359,7 +359,7 @@ const TimelineEffectPropItem = ({ field, validatedLocation, rowDepth, nodePath,
359
359
  previewServerState,
360
360
  propStatus,
361
361
  ]);
362
- const row = (jsx_runtime_1.jsxs(TimelineRowChrome_1.TimelineRowChrome, { depth: rowDepth, eye: jsx_runtime_1.jsx(TimelineLayerEye_1.TimelineLayerEyeSpacer, {}), keyframeControls: keyframeControls, arrow: jsx_runtime_1.jsx(TimelineExpandArrowButton_1.TimelineExpandArrowSpacer, {}), style: style, selected: selection.selected, selectable: selection.selectable, onSelect: selection.onSelect, showSelectedBackground: true, containsSelection: false, outerHeight: null, children: [
362
+ const row = (jsx_runtime_1.jsxs(TimelineRowChrome_1.TimelineRowChrome, { depth: rowDepth, eye: jsx_runtime_1.jsx(TimelineLayerEye_1.TimelineLayerEyeSpacer, {}), keyframeControls: keyframeControls, arrow: jsx_runtime_1.jsx(TimelineExpandArrowButton_1.TimelineExpandArrowSpacer, {}), style: style, selected: selection.selected, selectable: selection.selectable, selectionItem: selection.selectionItem, onSelect: selection.onSelect, showSelectedBackground: true, containsSelection: false, outerHeight: null, children: [
363
363
  jsx_runtime_1.jsx(TimelineFieldLabel_1.TimelineFieldLabel, { rowDepth: rowDepth, selected: selection.selected, label: (_c = field.description) !== null && _c !== void 0 ? _c : field.key }), jsx_runtime_1.jsx("div", { style: timeline_field_row_layout_1.timelineFieldValueColumnStyle, children: jsx_runtime_1.jsx(exports.TimelineEffectPropValue, { field: field, nodePath: nodePath, validatedLocation: validatedLocation, sourceFrame: sourceFrame }) })
364
364
  ] }));
365
365
  return (jsx_runtime_1.jsx(ContextMenu_1.ContextMenu, { values: contextMenuValues, onOpen: selection.selectable ? selection.onSelect : null, children: row }));
@@ -1,8 +1,41 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
2
35
  Object.defineProperty(exports, "__esModule", { value: true });
3
36
  exports.TimelineExpandArrowSpacer = exports.TimelineExpandArrowButton = void 0;
4
37
  const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_1 = require("react");
38
+ const react_1 = __importStar(require("react"));
6
39
  const arrowButton = {
7
40
  background: 'none',
8
41
  border: 'none',
@@ -27,6 +60,13 @@ const arrowSpacer = {
27
60
  };
28
61
  const svgStyle = { display: 'block' };
29
62
  const TimelineExpandArrowButton = ({ isExpanded, onClick, label, disabled = false }) => {
63
+ const handleClick = react_1.default.useCallback((e) => {
64
+ e.stopPropagation();
65
+ onClick();
66
+ }, [onClick]);
67
+ const stopPropagation = react_1.default.useCallback((e) => {
68
+ e.stopPropagation();
69
+ }, []);
30
70
  const style = (0, react_1.useMemo)(() => {
31
71
  return {
32
72
  ...arrowButton,
@@ -35,7 +75,7 @@ const TimelineExpandArrowButton = ({ isExpanded, onClick, label, disabled = fals
35
75
  opacity: disabled ? 0.5 : 1,
36
76
  };
37
77
  }, [isExpanded, disabled]);
38
- return (jsx_runtime_1.jsx("button", { type: "button", style: style, onClick: onClick, disabled: disabled, "aria-expanded": isExpanded, "aria-label": `${isExpanded ? 'Collapse' : 'Expand'} ${label}`, children: jsx_runtime_1.jsx("svg", { width: "12", height: "12", viewBox: "0 0 8 8", style: svgStyle, children: jsx_runtime_1.jsx("path", { d: "M2 1L6 4L2 7Z", fill: "#ccc" }) }) }));
78
+ return (jsx_runtime_1.jsx("button", { type: "button", style: style, onClick: handleClick, onDoubleClick: stopPropagation, onPointerDown: stopPropagation, disabled: disabled, "aria-expanded": isExpanded, "aria-label": `${isExpanded ? 'Collapse' : 'Expand'} ${label}`, children: jsx_runtime_1.jsx("svg", { width: "12", height: "12", viewBox: "0 0 8 8", style: svgStyle, children: jsx_runtime_1.jsx("path", { d: "M2 1L6 4L2 7Z", fill: "#ccc" }) }) }));
39
79
  };
40
80
  exports.TimelineExpandArrowButton = TimelineExpandArrowButton;
41
81
  const TimelineExpandArrowSpacer = () => {
@@ -44,7 +44,7 @@ const TimelineExpandedRow = ({ node, depth, nestedDepth, rowDepthBase, getIsExpa
44
44
  const isExpanded = getIsExpanded(node.nodePathInfo);
45
45
  return (jsx_runtime_1.jsx(TimelineRowChrome_1.TimelineRowChrome, { depth: rowDepth, eye: jsx_runtime_1.jsx(TimelineLayerEye_1.TimelineLayerEyeSpacer, {}), arrow: jsx_runtime_1.jsx(TimelineExpandArrowButton_1.TimelineExpandArrowButton, { isExpanded: isExpanded, onClick: () => toggleTrack(node.nodePathInfo), label: `${node.label} section`, disabled: false }), style: {
46
46
  height: timeline_layout_1.TREE_GROUP_ROW_HEIGHT,
47
- }, selected: selection.selected, selectable: selection.selectable, onSelect: selection.onSelect, showSelectedBackground: true, containsSelection: false, outerHeight: null, children: jsx_runtime_1.jsx("span", { style: labelStyle, children: node.label }) }));
47
+ }, selected: selection.selected, selectable: selection.selectable, selectionItem: selection.selectionItem, onSelect: selection.onSelect, showSelectedBackground: true, containsSelection: false, outerHeight: null, children: jsx_runtime_1.jsx("span", { style: labelStyle, children: node.label }) }));
48
48
  }
49
49
  if (node.field) {
50
50
  if (node.field.kind === 'effect-field') {
@@ -57,6 +57,6 @@ const TimelineExpandedRow = ({ node, depth, nestedDepth, rowDepthBase, getIsExpa
57
57
  }
58
58
  return (jsx_runtime_1.jsx(TimelineRowChrome_1.TimelineRowChrome, { depth: rowDepth, eye: jsx_runtime_1.jsx(TimelineLayerEye_1.TimelineLayerEyeSpacer, {}), arrow: jsx_runtime_1.jsx(TimelineExpandArrowButton_1.TimelineExpandArrowSpacer, {}), style: {
59
59
  height: (0, timeline_layout_1.getTreeRowHeight)(node),
60
- }, selected: selection.selected, selectable: selection.selectable, onSelect: selection.onSelect, showSelectedBackground: true, containsSelection: false, outerHeight: null, children: jsx_runtime_1.jsx("span", { style: labelStyle, children: node.label }) }));
60
+ }, selected: selection.selected, selectable: selection.selectable, selectionItem: selection.selectionItem, onSelect: selection.onSelect, showSelectedBackground: true, containsSelection: false, outerHeight: null, children: jsx_runtime_1.jsx("span", { style: labelStyle, children: node.label }) }));
61
61
  };
62
62
  exports.TimelineExpandedRow = TimelineExpandedRow;
@@ -53,17 +53,16 @@ const separator = {
53
53
  borderBottom: `1px solid ${colors_1.TIMELINE_TRACK_SEPARATOR}`,
54
54
  };
55
55
  const TimelineExpandedSection = ({ sequence, validatedLocation, nodePathInfo, nestedDepth, keyframeDisplayOffset, }) => {
56
- const { getIsExpanded, propStatuses, toggleTrack, tree } = (0, use_timeline_expanded_tree_1.useTimelineExpandedTree)({
56
+ const { filteredTree, getIsExpanded, toggleTrack } = (0, use_timeline_expanded_tree_1.useTimelineExpandedTree)({
57
57
  sequence,
58
58
  nodePathInfo,
59
59
  });
60
- const flat = (0, react_1.useMemo)(() => (0, timeline_layout_1.flattenVisibleTreeNodes)({ nodes: tree, getIsExpanded }), [tree, getIsExpanded]);
61
- const expandedHeight = (0, react_1.useMemo)(() => (0, timeline_layout_1.getExpandedTrackHeight)({
62
- sequence,
63
- nodePathInfo,
64
- getIsExpanded,
65
- propStatuses,
66
- }), [sequence, nodePathInfo, getIsExpanded, propStatuses]);
60
+ const flat = (0, react_1.useMemo)(() => (0, timeline_layout_1.flattenVisibleTreeNodes)({ nodes: filteredTree, getIsExpanded }), [filteredTree, getIsExpanded]);
61
+ const expandedHeight = (0, react_1.useMemo)(() => {
62
+ const totalRowsHeight = flat.reduce((sum, { node }) => sum + (0, timeline_layout_1.getTreeRowHeight)(node), 0);
63
+ const separators = Math.max(0, flat.length - 1);
64
+ return totalRowsHeight + separators;
65
+ }, [flat]);
67
66
  const style = (0, react_1.useMemo)(() => {
68
67
  return {
69
68
  ...expandedSectionBase,
@@ -72,7 +71,7 @@ const TimelineExpandedSection = ({ sequence, validatedLocation, nodePathInfo, ne
72
71
  }, [expandedHeight]);
73
72
  const { schema } = sequence.controls;
74
73
  if (flat.length === 0) {
75
- return jsx_runtime_1.jsx("div", { style: style, children: "No schema" });
74
+ return null;
76
75
  }
77
76
  return (jsx_runtime_1.jsx("div", { style: style, children: flat.map(({ node, depth }, i) => {
78
77
  return (jsx_runtime_1.jsxs(react_1.default.Fragment, { children: [i > 0 ? jsx_runtime_1.jsx("div", { style: separator }) : null, jsx_runtime_1.jsx(TimelineExpandedRow_1.TimelineExpandedRow, { node: node, depth: depth, nestedDepth: nestedDepth, getIsExpanded: getIsExpanded, toggleTrack: toggleTrack, validatedLocation: validatedLocation, nodePath: nodePathInfo.sequenceSubscriptionKey, schema: schema, keyframeDisplayOffset: keyframeDisplayOffset })
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import type { TimelineSelectionInteraction } from './TimelineSelection';
3
+ import { type TimelineSelection } from './TimelineSelection';
3
4
  export declare const TimelineRowChrome: React.FC<{
4
5
  readonly depth: number;
5
6
  readonly eye: React.ReactNode;
@@ -9,6 +10,7 @@ export declare const TimelineRowChrome: React.FC<{
9
10
  readonly style: React.CSSProperties;
10
11
  readonly selected: boolean;
11
12
  readonly selectable: boolean;
13
+ readonly selectionItem: TimelineSelection | null;
12
14
  readonly onSelect: (interaction?: TimelineSelectionInteraction) => void;
13
15
  readonly showSelectedBackground: boolean;
14
16
  readonly containsSelection: boolean;
@@ -23,8 +23,10 @@ const keyframeControlsColumnBaseStyle = {
23
23
  flexShrink: 0,
24
24
  justifyContent: 'flex-start',
25
25
  };
26
- const TimelineRowChrome = ({ depth, eye, keyframeControls, arrow, children, style, selected, selectable, onSelect, showSelectedBackground, containsSelection, outerHeight, onDragLeave, onDragOver, onDrop, onDoubleClick, }) => {
26
+ const TimelineRowChrome = ({ depth, eye, keyframeControls, arrow, children, style, selected, selectable, selectionItem, onSelect, showSelectedBackground, containsSelection, outerHeight, onDragLeave, onDragOver, onDrop, onDoubleClick, }) => {
27
+ const ref = (0, react_1.useRef)(null);
27
28
  const indentWidth = (0, timeline_row_layout_1.getTimelineRowIndentWidth)(depth);
29
+ (0, TimelineSelection_1.useTimelineFocusableItem)(selectionItem, ref);
28
30
  const keyframeControlsColumnStyle = (0, react_1.useMemo)(() => ({
29
31
  ...keyframeControlsColumnBaseStyle,
30
32
  width: (0, timeline_row_layout_1.getTimelineRowLeftChromeWidth)(depth),
@@ -73,8 +75,8 @@ const TimelineRowChrome = ({ depth, eye, keyframeControls, arrow, children, styl
73
75
  const chrome = (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
74
76
  jsx_runtime_1.jsx("div", { style: leftChromeStyle, children: keyframeControls ? (jsx_runtime_1.jsx("div", { style: keyframeControlsColumnStyle, children: keyframeControls })) : (jsx_runtime_1.jsxs("div", { style: chromeColumnStyle, children: [eye, indentWidth > 0 ? jsx_runtime_1.jsx(Padder_1.Padder, { depth: depth }) : null, arrow] })) }), children] }));
75
77
  if (outerStyle) {
76
- return (jsx_runtime_1.jsx("div", { style: outerStyle, onDragLeave: onDragLeave, onDragOver: onDragOver, onDrop: onDrop, onPointerDown: selectable ? onPointerDown : undefined, onContextMenu: selectable ? onContextMenu : undefined, onDoubleClick: onDoubleClick, children: jsx_runtime_1.jsx("div", { style: innerRowStyle, children: chrome }) }));
78
+ return (jsx_runtime_1.jsx("div", { ref: ref, style: outerStyle, onDragLeave: onDragLeave, onDragOver: onDragOver, onDrop: onDrop, onPointerDown: selectable ? onPointerDown : undefined, onContextMenu: selectable ? onContextMenu : undefined, onDoubleClick: onDoubleClick, children: jsx_runtime_1.jsx("div", { style: innerRowStyle, children: chrome }) }));
77
79
  }
78
- return (jsx_runtime_1.jsx("div", { onDragLeave: onDragLeave, onDragOver: onDragOver, onDrop: onDrop, onPointerDown: selectable ? onPointerDown : undefined, onContextMenu: selectable ? onContextMenu : undefined, onDoubleClick: onDoubleClick, style: innerRowStyle, children: chrome }));
80
+ return (jsx_runtime_1.jsx("div", { ref: ref, onDragLeave: onDragLeave, onDragOver: onDragOver, onDrop: onDrop, onPointerDown: selectable ? onPointerDown : undefined, onContextMenu: selectable ? onContextMenu : undefined, onDoubleClick: onDoubleClick, style: innerRowStyle, children: chrome }));
79
81
  };
80
82
  exports.TimelineRowChrome = TimelineRowChrome;
@@ -1,5 +1,7 @@
1
1
  import React, { type CSSProperties } from 'react';
2
+ import { type GetDragOverrides, type GetEffectDragOverrides, type PropStatuses } from 'remotion';
2
3
  import type { SequenceNodePathInfo, TrackWithHash } from '../../helpers/get-timeline-sequence-sort-key';
4
+ import { type GetIsExpanded } from '../ExpandedTracksProvider';
3
5
  export declare const TIMELINE_SELECTED_BACKGROUND = "#3B3F42";
4
6
  export declare const TIMELINE_SELECTED_LABEL_BACKGROUND = "#B0B0B0";
5
7
  export declare const TIMELINE_SELECTED_LABEL_TEXT = "black";
@@ -114,10 +116,10 @@ type TimelineSelectionContextValue = {
114
116
  readonly canSelect: boolean;
115
117
  readonly selectedItems: readonly TimelineSelection[];
116
118
  readonly isSelected: (item: TimelineSelection) => boolean;
117
- readonly selectItem: (item: TimelineSelection, interaction?: TimelineSelectionInteraction) => void;
118
- readonly selectItems: (items: readonly TimelineSelection[]) => void;
119
- readonly registerSelectableItem: (item: TimelineSelection) => () => void;
119
+ readonly selectItem: (item: TimelineSelection, interaction?: TimelineSelectionInteraction, allSelectableItems?: readonly TimelineSelection[], options?: TimelineSelectionOptions) => void;
120
+ readonly selectItems: (items: readonly TimelineSelection[], options?: TimelineSelectionOptions) => void;
120
121
  readonly registerMarqueeSelectableItem: (item: TimelineSelection, getRect: () => DOMRect | null) => () => void;
122
+ readonly registerFocusableItem: (item: TimelineSelection, getElement: () => Element | null) => () => void;
121
123
  readonly getMarqueeSelection: (marqueeRect: TimelineMarqueeRect, lockedSelectionKind: TimelineMarqueeSelectionKind | null) => {
122
124
  readonly lockedSelectionKind: TimelineMarqueeSelectionKind | null;
123
125
  readonly selectedItems: readonly TimelineSelection[];
@@ -125,13 +127,33 @@ type TimelineSelectionContextValue = {
125
127
  readonly containsSelection: (nodePathInfo: SequenceNodePathInfo) => boolean;
126
128
  readonly clearSelection: () => void;
127
129
  };
130
+ export declare const TimelineSelectionOrderProvider: React.FC<{
131
+ readonly children: React.ReactNode;
132
+ readonly items: readonly TimelineSelection[];
133
+ }>;
134
+ type TimelineSelectionOptions = {
135
+ readonly reveal?: boolean;
136
+ };
128
137
  export declare const getTimelineSelectionFromNodePathInfo: (nodePathInfo: SequenceNodePathInfo | null) => TimelineSelection | null;
129
138
  export declare const getTimelineSelectionKey: (item: TimelineSelection) => string;
130
139
  export declare const getSelectableTimelineSequenceSelections: (tracks: readonly Pick<TrackWithHash, "nodePathInfo">[]) => TimelineSelection[];
140
+ export declare const getSelectableTimelineItems: ({ getDragOverrides, getEffectDragOverrides, getIsExpanded, propStatuses, selectedItems, timeline, timelinePosition, }: {
141
+ readonly getDragOverrides: GetDragOverrides;
142
+ readonly getEffectDragOverrides: GetEffectDragOverrides;
143
+ readonly getIsExpanded: GetIsExpanded;
144
+ readonly propStatuses: PropStatuses;
145
+ readonly selectedItems: readonly TimelineSelection[];
146
+ readonly timeline: readonly TrackWithHash[];
147
+ readonly timelinePosition: number;
148
+ }) => TimelineSelection[];
131
149
  export declare const getTimelineSequenceSelectionKey: (nodePathInfo: SequenceNodePathInfo) => string;
132
150
  export declare const TimelineSelectAllKeybindings: React.FC<{
133
151
  readonly timeline: readonly TrackWithHash[];
134
152
  }>;
153
+ export declare const TimelineSelectableItemsProvider: React.FC<{
154
+ readonly children: React.ReactNode;
155
+ readonly timeline: readonly TrackWithHash[];
156
+ }>;
135
157
  export declare const TimelineSelectionProvider: React.FC<{
136
158
  readonly children: React.ReactNode;
137
159
  }>;
@@ -144,6 +166,7 @@ export declare const useTimelineMarqueeSelection: () => {
144
166
  onPointerDownCapture: (event: React.PointerEvent<HTMLDivElement>) => void;
145
167
  };
146
168
  export declare const useTimelineMarqueeSelectableItem: (item: TimelineSelection | null, ref: React.RefObject<Element | null>) => void;
169
+ export declare const useTimelineFocusableItem: (item: TimelineSelection | null, ref: React.RefObject<Element | null>) => void;
147
170
  export declare const useTimelineRowSelection: (nodePathInfo: SequenceNodePathInfo | null) => {
148
171
  onSelect: (interaction?: TimelineSelectionInteraction | undefined) => void;
149
172
  selectable: boolean;