@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.
- package/dist/api/restart-studio.js +4 -0
- package/dist/components/AssetSelector.js +4 -10
- package/dist/components/AssetSelectorItem.d.ts +2 -1
- package/dist/components/AssetSelectorItem.js +24 -29
- package/dist/components/Canvas.js +21 -15
- package/dist/components/CanvasCaptureDropHandler.d.ts +4 -0
- package/dist/components/CanvasCaptureDropHandler.js +42 -0
- package/dist/components/CanvasOrLoading.js +4 -3
- package/dist/components/CaptionInspector.d.ts +2 -0
- package/dist/components/CaptionInspector.js +3 -5
- package/dist/components/CheckboardToggle.js +1 -1
- package/dist/components/Checkbox.d.ts +0 -1
- package/dist/components/Checkbox.js +2 -19
- package/dist/components/CompositionSelector.js +6 -3
- package/dist/components/CompositionSelectorItem.js +9 -10
- package/dist/components/ConfigSelect.d.ts +17 -0
- package/dist/components/ConfigSelect.js +50 -0
- package/dist/components/ConfigureLicenseModal.js +79 -46
- package/dist/components/CurrentAsset.d.ts +10 -2
- package/dist/components/CurrentAsset.js +143 -45
- package/dist/components/Editor.js +2 -1
- package/dist/components/EditorContent.js +5 -2
- package/dist/components/EditorContexts.js +2 -1
- package/dist/components/EditorRuler/Ruler.d.ts +1 -0
- package/dist/components/EditorRuler/Ruler.js +9 -8
- package/dist/components/EditorRuler/index.d.ts +1 -0
- package/dist/components/EditorRuler/index.js +3 -4
- package/dist/components/EditorRuler/use-is-ruler-visible.d.ts +1 -1
- package/dist/components/EditorRuler/use-is-ruler-visible.js +8 -2
- package/dist/components/ElementLibraryModal.d.ts +5 -0
- package/dist/components/ElementLibraryModal.js +38 -0
- package/dist/components/FilePreview.js +71 -0
- package/dist/components/FixComputedValueModal.js +54 -51
- package/dist/components/GlobalKeybindings.js +5 -5
- package/dist/components/InlineAction.d.ts +1 -1
- package/dist/components/InlineAction.js +12 -2
- package/dist/components/InlineCaptionInspector.d.ts +2 -0
- package/dist/components/InlineCaptionInspector.js +2 -2
- package/dist/components/InlineCompositionName.js +1 -1
- package/dist/components/InlineEditableTitle.js +5 -4
- package/dist/components/InspectorInfoHeader.js +1 -1
- package/dist/components/InspectorOpenInEditor.js +48 -72
- package/dist/components/InspectorPanel/AlignmentControls.js +2 -3
- package/dist/components/InspectorPanel/CollapsibleInspectorSectionHeader.d.ts +7 -0
- package/dist/components/InspectorPanel/CollapsibleInspectorSectionHeader.js +39 -0
- package/dist/components/InspectorPanel/CompositionInspector.js +25 -45
- package/dist/components/InspectorPanel/CompositionInspectorHeader.js +2 -2
- package/dist/components/InspectorPanel/CompositionMetadata.js +11 -4
- package/dist/components/InspectorPanel/EasingInspector.js +2 -2
- package/dist/components/InspectorPanel/ElementLibraryButton.d.ts +2 -0
- package/dist/components/InspectorPanel/ElementLibraryButton.js +139 -0
- package/dist/components/InspectorPanel/KeyframeEasingNavigator.js +10 -4
- package/dist/components/InspectorPanel/KeyframeInspector.js +1 -1
- package/dist/components/InspectorPanel/SequenceInspectorHeader.js +14 -6
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +2 -7
- package/dist/components/InspectorPanel/common.d.ts +0 -13
- package/dist/components/InspectorPanel/common.js +6 -59
- package/dist/components/InspectorPanel/inspector-selection.d.ts +2 -2
- package/dist/components/InspectorPanel/styles.d.ts +0 -1
- package/dist/components/InspectorPanel/styles.js +3 -4
- package/dist/components/InspectorPanel/use-composition-actions.js +0 -1
- package/dist/components/InspectorPanel/use-track-for-selection.d.ts +1 -2
- package/dist/components/InspectorPanelLayout.d.ts +1 -1
- package/dist/components/InspectorPanelLayout.js +1 -1
- package/dist/components/InspectorSequenceSection.d.ts +1 -2
- package/dist/components/InspectorSequenceSection.js +40 -54
- package/dist/components/InspectorSourceLocation.js +1 -1
- package/dist/components/InstallPackage.d.ts +2 -1
- package/dist/components/InstallPackage.js +60 -30
- package/dist/components/InstallablePackage.js +37 -11
- package/dist/components/KeyboardShortcutsSettings.d.ts +2 -0
- package/dist/components/KeyboardShortcutsSettings.js +177 -0
- package/dist/components/Menu/MenuItem.js +15 -6
- package/dist/components/MenuBuildIndicator.js +1 -1
- package/dist/components/MenuToolbar.js +7 -3
- package/dist/components/Modals.js +7 -5
- package/dist/components/NewComposition/CodemodFooter.d.ts +0 -1
- package/dist/components/NewComposition/CodemodFooter.js +2 -8
- package/dist/components/NewComposition/DeleteComposition.js +1 -1
- package/dist/components/NewComposition/DeleteFolder.js +1 -1
- package/dist/components/NewComposition/DuplicateComposition.js +1 -1
- package/dist/components/NewComposition/InputDragger.js +27 -4
- package/dist/components/NewComposition/NewComposition.js +1 -1
- package/dist/components/NewComposition/NewFolder.js +1 -3
- package/dist/components/NewComposition/RenameComposition.js +1 -1
- package/dist/components/NewComposition/RenameFolder.js +1 -1
- package/dist/components/NewComposition/use-rename-static-file.js +1 -1
- package/dist/components/Notifications/NotificationCenter.d.ts +1 -0
- package/dist/components/Notifications/NotificationCenter.js +5 -0
- package/dist/components/OptionsPanel.js +9 -12
- package/dist/components/PlaybackRateSelector.js +1 -1
- package/dist/components/Preview.js +83 -5
- package/dist/components/PreviewToolbar.js +12 -3
- package/dist/components/PreviewToolbarOverflowButton.d.ts +1 -0
- package/dist/components/PreviewToolbarOverflowButton.js +39 -2
- package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +2 -2
- package/dist/components/QuickSwitcher/QuickSwitcherContent.js +14 -30
- package/dist/components/RadioButton.d.ts +6 -0
- package/dist/components/RadioButton.js +62 -0
- package/dist/components/RenderButton.js +68 -184
- package/dist/components/RenderModal/DataEditor.js +15 -12
- package/dist/components/RenderModal/RenderStatusModal.js +0 -1
- package/dist/components/RenderModal/SchemaEditor/ZodSwitch.js +3 -1
- package/dist/components/RenderModal/SchemaEditor/infer-zod-schema-from-value.d.ts +15 -0
- package/dist/components/RenderModal/SchemaEditor/infer-zod-schema-from-value.js +95 -0
- package/dist/components/RenderQueue/RenderQueueRemoveItem.js +1 -6
- package/dist/components/RenderingSettings.js +7 -4
- package/dist/components/RulersAndGuidesToggle.d.ts +4 -0
- package/dist/components/RulersAndGuidesToggle.js +34 -0
- package/dist/components/SegmentedButton.d.ts +29 -0
- package/dist/components/SegmentedButton.js +226 -0
- package/dist/components/SelectedOutlineEditingHandles.d.ts +16 -0
- package/dist/components/SelectedOutlineEditingHandles.js +66 -0
- package/dist/components/SelectedOutlineElement.d.ts +2 -4
- package/dist/components/SelectedOutlineElement.js +15 -54
- package/dist/components/SelectedOutlineOverlay.js +32 -6
- package/dist/components/SelectedOutlinePolygon.d.ts +4 -6
- package/dist/components/SelectedOutlinePolygon.js +18 -16
- package/dist/components/SelectedOutlineRenderer.d.ts +1 -2
- package/dist/components/SelectedOutlineRenderer.js +66 -14
- package/dist/components/SelectedOutlineUvControls.d.ts +1 -1
- package/dist/components/SettingsModal.d.ts +1 -1
- package/dist/components/SettingsModal.js +30 -7
- package/dist/components/SettingsModalFooter.d.ts +3 -1
- package/dist/components/SettingsModalFooter.js +20 -4
- package/dist/components/ShowPixelGridProvider.d.ts +4 -0
- package/dist/components/ShowPixelGridProvider.js +24 -0
- package/dist/components/SidebarCollapserControls.js +2 -2
- package/dist/components/SkillsSettings.d.ts +2 -0
- package/dist/components/SkillsSettings.js +129 -0
- package/dist/components/StaticFilePreview.js +7 -1
- package/dist/components/StudioSettings.js +7 -48
- package/dist/components/Tabs/index.js +1 -1
- package/dist/components/Timeline/Timeline.js +41 -1
- package/dist/components/Timeline/TimelineAssetField.d.ts +1 -1
- package/dist/components/Timeline/TimelineAssetField.js +15 -9
- package/dist/components/Timeline/TimelineBooleanField.js +1 -4
- package/dist/components/Timeline/TimelineClipboardKeybindings.d.ts +6 -7
- package/dist/components/Timeline/TimelineClipboardKeybindings.js +7 -10
- package/dist/components/Timeline/TimelineDragHandler.js +11 -4
- package/dist/components/Timeline/TimelineEffectItem.d.ts +1 -0
- package/dist/components/Timeline/TimelineEffectItem.js +23 -10
- package/dist/components/Timeline/TimelineEffectPropItem.js +15 -2
- package/dist/components/Timeline/TimelineExpandedRow.js +5 -4
- package/dist/components/Timeline/TimelineFieldLabel.js +4 -2
- package/dist/components/Timeline/TimelineFieldRowContent.d.ts +1 -2
- package/dist/components/Timeline/TimelineFieldRowContent.js +8 -21
- package/dist/components/Timeline/TimelineImageInfo.d.ts +0 -1
- package/dist/components/Timeline/TimelineImageInfo.js +13 -32
- package/dist/components/Timeline/TimelineKeyframeControls.d.ts +1 -2
- package/dist/components/Timeline/TimelineKeyframeControls.js +10 -4
- package/dist/components/Timeline/TimelinePlayCursorSyncer.js +4 -2
- package/dist/components/Timeline/TimelinePrimitiveFieldValue.js +1 -1
- package/dist/components/Timeline/TimelineRotationField.js +0 -2
- package/dist/components/Timeline/TimelineRowChrome.d.ts +0 -1
- package/dist/components/Timeline/TimelineRowChrome.js +3 -4
- package/dist/components/Timeline/TimelineRowLayoutContext.d.ts +0 -1
- package/dist/components/Timeline/TimelineRowLayoutContext.js +1 -4
- package/dist/components/Timeline/TimelineScaleField.js +2 -6
- package/dist/components/Timeline/TimelineSchemaField.js +9 -3
- package/dist/components/Timeline/TimelineSelection.d.ts +29 -66
- package/dist/components/Timeline/TimelineSelection.js +31 -171
- package/dist/components/Timeline/TimelineSequence.d.ts +2 -0
- package/dist/components/Timeline/TimelineSequence.js +110 -19
- package/dist/components/Timeline/TimelineSequenceItem.d.ts +1 -0
- package/dist/components/Timeline/TimelineSequenceItem.js +13 -11
- package/dist/components/Timeline/TimelineSequencePropItem.js +15 -2
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +7 -6
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +85 -91
- package/dist/components/Timeline/TimelineTrack.js +1 -1
- package/dist/components/Timeline/TimelineTransformOriginField.js +0 -4
- package/dist/components/Timeline/TimelineTranslateField.js +0 -4
- package/dist/components/Timeline/TimelineVirtualization.js +3 -1
- package/dist/components/Timeline/delete-selected-timeline-item.d.ts +3 -4
- package/dist/components/Timeline/duplicate-selected-timeline-item.d.ts +3 -4
- package/dist/components/Timeline/duplicate-selected-timeline-item.js +3 -12
- package/dist/components/Timeline/find-track-for-node-path-info.d.ts +1 -1
- package/dist/components/Timeline/get-copy-context-for-agents-menu-item.d.ts +4 -0
- package/dist/components/Timeline/get-copy-context-for-agents-menu-item.js +26 -0
- package/dist/components/Timeline/get-sequence-context-menu-items.js +2 -19
- package/dist/components/Timeline/get-timeline-sequence-visible-layout.d.ts +6 -1
- package/dist/components/Timeline/get-timeline-sequence-visible-layout.js +11 -4
- package/dist/components/Timeline/keyframe-clipboard.d.ts +2 -3
- package/dist/components/Timeline/reset-selected-timeline-props.d.ts +2 -3
- package/dist/components/Timeline/sequence-prop-clipboard.d.ts +2 -3
- package/dist/components/Timeline/split-selected-timeline-item.d.ts +2 -3
- package/dist/components/Timeline/split-selected-timeline-item.js +0 -1
- package/dist/components/Timeline/timeline-expanded-filter.d.ts +1 -2
- package/dist/components/Timeline/timeline-field-row-layout.d.ts +1 -1
- package/dist/components/Timeline/timeline-field-row-layout.js +4 -7
- package/dist/components/Timeline/timeline-field-utils.js +0 -2
- package/dist/components/Timeline/timeline-scroll-logic.d.ts +7 -5
- package/dist/components/Timeline/timeline-scroll-logic.js +12 -7
- package/dist/components/Timeline/update-selected-easing.d.ts +7 -7
- package/dist/components/Timeline/use-timeline-asset-drop.js +24 -0
- package/dist/components/Timeline/use-timeline-keyframe-drag.d.ts +6 -7
- package/dist/components/TimelineCombobox.js +25 -160
- package/dist/components/TimelineInOutToggle.js +4 -1
- package/dist/components/canvas-capture-drop.d.ts +4 -0
- package/dist/components/canvas-capture-drop.js +22 -0
- package/dist/components/duplicate-jsx-node-api.d.ts +2 -0
- package/dist/components/duplicate-jsx-node-api.js +12 -0
- package/dist/components/effect-drag-and-drop.js +1 -4
- package/dist/components/handle-drop.d.ts +2 -1
- package/dist/components/handle-drop.js +3 -3
- package/dist/components/import-assets.js +9 -65
- package/dist/components/keyboard-shortcuts.d.ts +10 -0
- package/dist/components/keyboard-shortcuts.js +135 -0
- package/dist/components/selected-outline-control-layout.js +2 -6
- package/dist/components/selected-outline-measurement.d.ts +8 -9
- package/dist/components/selected-outline-measurement.js +16 -3
- package/dist/components/use-delete-asset.d.ts +1 -0
- package/dist/components/use-delete-asset.js +40 -0
- package/dist/components/use-selected-outline-control-target.d.ts +11 -0
- package/dist/components/use-selected-outline-control-target.js +79 -0
- package/dist/esm/{chunk-s6k99gh2.js → chunk-4bxz1d3g.js} +3 -2
- package/dist/esm/{chunk-v5a8vpv4.js → chunk-gzqm3g2m.js} +47432 -40444
- package/dist/esm/index.mjs +3 -0
- package/dist/esm/internals.mjs +47431 -40443
- package/dist/esm/previewEntry.mjs +47169 -40181
- package/dist/esm/renderEntry.mjs +2 -2
- package/dist/helpers/add-asset-cache-bust.d.ts +4 -0
- package/dist/helpers/add-asset-cache-bust.js +10 -0
- package/dist/helpers/calculate-timeline.d.ts +1 -7
- package/dist/helpers/calculate-timeline.js +2 -145
- package/dist/helpers/colors.d.ts +2 -0
- package/dist/helpers/colors.js +6 -2
- package/dist/helpers/drag-aware-double-click.d.ts +6 -0
- package/dist/helpers/drag-aware-double-click.js +20 -0
- package/dist/helpers/editor-ruler.js +6 -5
- package/dist/helpers/get-asset-metadata.d.ts +19 -0
- package/dist/helpers/get-asset-metadata.js +75 -21
- package/dist/helpers/get-connected-compositions.d.ts +1 -6
- package/dist/helpers/get-connected-compositions.js +2 -8
- package/dist/helpers/get-sequence-double-click-action.d.ts +2 -1
- package/dist/helpers/get-sequence-double-click-action.js +7 -1
- package/dist/helpers/get-sequence-visible-range.d.ts +1 -5
- package/dist/helpers/get-sequence-visible-range.js +6 -51
- package/dist/helpers/get-timeline-nestedness.d.ts +1 -2
- package/dist/helpers/get-timeline-nestedness.js +2 -12
- package/dist/helpers/get-timeline-sequence-layout.d.ts +4 -1
- package/dist/helpers/get-timeline-sequence-layout.js +15 -6
- package/dist/helpers/get-timeline-sequence-sort-key.d.ts +2 -21
- package/dist/helpers/get-timeline-sequence-sort-key.js +2 -16
- package/dist/helpers/hoverable.d.ts +1 -0
- package/dist/helpers/hoverable.js +2 -1
- package/dist/helpers/inject-css.js +3 -1
- package/dist/helpers/is-current-selected-still.js +4 -2
- package/dist/helpers/open-in-remotion-convert.d.ts +7 -0
- package/dist/helpers/open-in-remotion-convert.js +18 -0
- package/dist/helpers/sort-by-nonce-history.d.ts +1 -5
- package/dist/helpers/sort-by-nonce-history.js +3 -148
- package/dist/helpers/timeline-node-path-key.d.ts +1 -2
- package/dist/helpers/timeline-node-path-key.js +2 -2
- package/dist/helpers/use-media-metadata.d.ts +2 -1
- package/dist/helpers/use-media-metadata.js +12 -5
- package/dist/helpers/use-menu-structure.js +52 -32
- package/dist/icons/align-center-horizontal.js +1 -1
- package/dist/icons/align-left.js +1 -1
- package/dist/icons/align-right.js +1 -1
- package/dist/icons/keyboard.d.ts +4 -0
- package/dist/icons/keyboard.js +10 -0
- package/dist/icons/license.d.ts +4 -0
- package/dist/icons/license.js +8 -0
- package/dist/icons/package.d.ts +4 -0
- package/dist/icons/package.js +8 -0
- package/dist/icons/react.js +1 -1
- package/dist/icons/remotion-convert.d.ts +4 -0
- package/dist/icons/remotion-convert.js +10 -0
- package/dist/icons/skills.d.ts +4 -0
- package/dist/icons/skills.js +10 -0
- package/dist/state/editor-pixel-grid.d.ts +8 -0
- package/dist/state/editor-pixel-grid.js +18 -0
- package/dist/state/modals.d.ts +6 -5
- package/package.json +14 -12
- package/dist/components/KeyboardShortcutsExplainer.d.ts +0 -2
- package/dist/components/KeyboardShortcutsExplainer.js +0 -194
|
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.TimelineSequenceItem = void 0;
|
|
36
|
+
exports.TimelineSequenceItem = exports.SEQUENCE_REORDER_MIME_TYPE = void 0;
|
|
37
37
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
38
|
const react_1 = __importStar(require("react"));
|
|
39
39
|
const remotion_1 = require("remotion");
|
|
@@ -98,7 +98,7 @@ const effectDropHighlight = {
|
|
|
98
98
|
outline: colors_1.BORDER_TIMELINE_DROP_BLUE,
|
|
99
99
|
outlineOffset: -1,
|
|
100
100
|
};
|
|
101
|
-
|
|
101
|
+
exports.SEQUENCE_REORDER_MIME_TYPE = 'application/remotion-sequence-reorder';
|
|
102
102
|
let currentSequenceDrag = null;
|
|
103
103
|
const TimelineSequenceExpandArrowInner = ({ disabled, isExpanded, nodePathInfo, sequence }) => {
|
|
104
104
|
const { toggleTrack } = (0, react_1.useContext)(ExpandedTracksProvider_1.ExpandedTracksSetterContext);
|
|
@@ -146,7 +146,7 @@ const sequenceReorderAfterLine = {
|
|
|
146
146
|
top: -1,
|
|
147
147
|
};
|
|
148
148
|
const hasSequenceReorderDragType = (dataTransfer) => {
|
|
149
|
-
return Array.from(dataTransfer.types).includes(SEQUENCE_REORDER_MIME_TYPE);
|
|
149
|
+
return Array.from(dataTransfer.types).includes(exports.SEQUENCE_REORDER_MIME_TYPE);
|
|
150
150
|
};
|
|
151
151
|
const isSequenceReorderDrag = (dataTransfer) => {
|
|
152
152
|
return (currentSequenceDrag !== null || hasSequenceReorderDragType(dataTransfer));
|
|
@@ -155,7 +155,7 @@ const getSequenceReorderDragData = (dataTransfer) => {
|
|
|
155
155
|
if (currentSequenceDrag) {
|
|
156
156
|
return currentSequenceDrag;
|
|
157
157
|
}
|
|
158
|
-
const value = dataTransfer.getData(SEQUENCE_REORDER_MIME_TYPE);
|
|
158
|
+
const value = dataTransfer.getData(exports.SEQUENCE_REORDER_MIME_TYPE);
|
|
159
159
|
if (!value) {
|
|
160
160
|
return null;
|
|
161
161
|
}
|
|
@@ -378,7 +378,7 @@ const TimelineSequenceItemInner = ({ afterDropLineOffset, connectedCompositions,
|
|
|
378
378
|
};
|
|
379
379
|
currentSequenceDrag = dragData;
|
|
380
380
|
e.dataTransfer.effectAllowed = 'move';
|
|
381
|
-
e.dataTransfer.setData(SEQUENCE_REORDER_MIME_TYPE, JSON.stringify(dragData));
|
|
381
|
+
e.dataTransfer.setData(exports.SEQUENCE_REORDER_MIME_TYPE, JSON.stringify(dragData));
|
|
382
382
|
e.stopPropagation();
|
|
383
383
|
}, [
|
|
384
384
|
canReorderSequence,
|
|
@@ -441,10 +441,7 @@ const TimelineSequenceItemInner = ({ afterDropLineOffset, connectedCompositions,
|
|
|
441
441
|
position: dropTarget.position,
|
|
442
442
|
clientId: previewServerState.clientId,
|
|
443
443
|
});
|
|
444
|
-
if (result.success) {
|
|
445
|
-
(0, NotificationCenter_1.showNotification)('Reordered sequence', 2000);
|
|
446
|
-
}
|
|
447
|
-
else {
|
|
444
|
+
if (!result.success) {
|
|
448
445
|
(0, NotificationCenter_1.showNotification)(result.reason, 4000);
|
|
449
446
|
}
|
|
450
447
|
}
|
|
@@ -553,6 +550,9 @@ const TimelineSequenceItemInner = ({ afterDropLineOffset, connectedCompositions,
|
|
|
553
550
|
button: e.button,
|
|
554
551
|
canOpenInEditor,
|
|
555
552
|
numberOfConnectedCompositions: connectedCompositions.length,
|
|
553
|
+
// The track list row reorders via native drag-and-drop, which
|
|
554
|
+
// already suppresses `dblclick` after a drag.
|
|
555
|
+
sequenceWasDragged: false,
|
|
556
556
|
});
|
|
557
557
|
if (action === null) {
|
|
558
558
|
return;
|
|
@@ -911,9 +911,11 @@ const TimelineSequenceItemInner = ({ afterDropLineOffset, connectedCompositions,
|
|
|
911
911
|
clientId: previewServerState.clientId,
|
|
912
912
|
});
|
|
913
913
|
}, [canDropEffect, nodePath, previewServerState, validatedLocation]);
|
|
914
|
-
const trackRow = (jsx_runtime_1.jsx(TimelineRowChrome_1.TimelineRowChrome, { depth: nestedDepth, eye: canToggleVisibility ? (jsx_runtime_1.jsx(TimelineLayerEye_1.TimelineLayerEye, { type: sequence.type === 'audio' ? 'speaker' : 'eye', hidden: isItemHidden, onInvoked: onToggleVisibility })) : (jsx_runtime_1.jsx(TimelineLayerEye_1.TimelineLayerEyeSpacer, {})), arrow: jsx_runtime_1.jsx(TimelineExpandArrowButton_1.TimelineExpandArrowSpacer, {}), style: rowStyle, selected: selected, selectable: selectable, onSelect: onSelect, showSelectedBackground: true, containsSelection: containsSelection, hovered: hovered,
|
|
914
|
+
const trackRow = (jsx_runtime_1.jsx(TimelineRowChrome_1.TimelineRowChrome, { depth: nestedDepth, eye: canToggleVisibility ? (jsx_runtime_1.jsx(TimelineLayerEye_1.TimelineLayerEye, { type: sequence.type === 'audio' ? 'speaker' : 'eye', hidden: isItemHidden, onInvoked: onToggleVisibility })) : (jsx_runtime_1.jsx(TimelineLayerEye_1.TimelineLayerEyeSpacer, {})), arrow: jsx_runtime_1.jsx(TimelineExpandArrowButton_1.TimelineExpandArrowSpacer, {}), style: rowStyle, selected: selected, selectable: selectable, onSelect: onSelect, showSelectedBackground: true, containsSelection: containsSelection, hovered: hovered, outerHeight: outerHeight, onDragLeave: canDropEffect ? onEffectDragLeave : undefined, onDragOver: canDropEffect ? onEffectDragOver : undefined, onDrop: canDropEffect ? onEffectDrop : undefined, onDoubleClick: canHandleSequenceDoubleClick ? onSequenceDoubleClick : undefined, onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, children: jsx_runtime_1.jsxs("div", { style: labelContainerStyle, children: [connectedCompositions.length > 0 ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
915
915
|
jsx_runtime_1.jsx(CompositionOrStillIcon_1.CompositionOrStillIcon, { color: (0, TimelineSelection_1.getTimelineColor)(false, false), composition: connectedCompositions[0], style: connectedCompositionIconStyle }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 })
|
|
916
|
-
] })) : null, jsx_runtime_1.jsx(TimelineSequenceName_1.TimelineSequenceName, { displayName: timelineDisplayName, fallbackDisplayName: fallbackDisplayName, selected: selected, containsSelection: containsSelection, editing: isRenaming, onCancelEditing: onCancelRenaming, onSaveName: onSaveName }), hasExpandableContent && nodePathInfo !== null ? (jsx_runtime_1.
|
|
916
|
+
] })) : null, jsx_runtime_1.jsx(TimelineSequenceName_1.TimelineSequenceName, { displayName: timelineDisplayName, fallbackDisplayName: fallbackDisplayName, selected: selected, containsSelection: containsSelection, editing: isRenaming, onCancelEditing: onCancelRenaming, onSaveName: onSaveName }), hasExpandableContent && nodePathInfo !== null ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
917
|
+
jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }), jsx_runtime_1.jsx(TimelineSequenceExpandArrow, { disabled: !previewInteractive, isExpanded: isExpanded, nodePathInfo: nodePathInfo, sequence: sequence })
|
|
918
|
+
] })) : null, numberOfHiddenDuplicates > 0 ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
917
919
|
jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }), jsx_runtime_1.jsx(TimelineDuplicateCount_1.TimelineDuplicateCount, { count: numberOfHiddenDuplicates })
|
|
918
920
|
] })) : null, mediaSrc ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
919
921
|
jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }),
|
|
@@ -39,11 +39,13 @@ const studio_shared_1 = require("@remotion/studio-shared");
|
|
|
39
39
|
const react_1 = __importStar(require("react"));
|
|
40
40
|
const remotion_1 = require("remotion");
|
|
41
41
|
const client_id_1 = require("../../helpers/client-id");
|
|
42
|
+
const format_file_location_1 = require("../../helpers/format-file-location");
|
|
42
43
|
const open_in_editor_1 = require("../../helpers/open-in-editor");
|
|
43
44
|
const ContextMenu_1 = require("../ContextMenu");
|
|
44
45
|
const InspectorPanelLayout_1 = require("../InspectorPanelLayout");
|
|
45
46
|
const use_default_editor_info_1 = require("../use-default-editor-info");
|
|
46
47
|
const call_add_keyframe_1 = require("./call-add-keyframe");
|
|
48
|
+
const get_copy_context_for_agents_menu_item_1 = require("./get-copy-context-for-agents-menu-item");
|
|
47
49
|
const get_sequence_prop_reset_changes_1 = require("./get-sequence-prop-reset-changes");
|
|
48
50
|
const get_timeline_keyframes_1 = require("./get-timeline-keyframes");
|
|
49
51
|
const save_sequence_prop_1 = require("./save-sequence-prop");
|
|
@@ -327,6 +329,17 @@ const TimelineSequencePropItem = ({ field, validatedLocation, rowDepth, nodePath
|
|
|
327
329
|
selection.onSelect({ shiftKey: false, toggleKey: false });
|
|
328
330
|
}
|
|
329
331
|
return [
|
|
332
|
+
(0, get_copy_context_for_agents_menu_item_1.getCopyContextForAgentsMenuItem)({
|
|
333
|
+
contextForAgents: (0, format_file_location_1.formatContextForAgents)({
|
|
334
|
+
location: validatedLocation,
|
|
335
|
+
name: `Property "${field.key}"`,
|
|
336
|
+
root: window.remotion_cwd,
|
|
337
|
+
}),
|
|
338
|
+
}),
|
|
339
|
+
{
|
|
340
|
+
type: 'divider',
|
|
341
|
+
id: 'copy-context-for-agents-divider',
|
|
342
|
+
},
|
|
330
343
|
{
|
|
331
344
|
type: 'item',
|
|
332
345
|
id: 'reset-sequence-field',
|
|
@@ -340,7 +353,7 @@ const TimelineSequencePropItem = ({ field, validatedLocation, rowDepth, nodePath
|
|
|
340
353
|
value: 'reset-sequence-field',
|
|
341
354
|
},
|
|
342
355
|
];
|
|
343
|
-
}, [canShowReset, onReset, selection]);
|
|
356
|
+
}, [canShowReset, field.key, onReset, selection, validatedLocation]);
|
|
344
357
|
const onPropertyDoubleClick = (0, react_1.useCallback)((event) => {
|
|
345
358
|
var _a;
|
|
346
359
|
if (!canOpenInEditor || !defaultEditorId) {
|
|
@@ -364,7 +377,7 @@ const TimelineSequencePropItem = ({ field, validatedLocation, rowDepth, nodePath
|
|
|
364
377
|
...style,
|
|
365
378
|
}, children: fieldValue }));
|
|
366
379
|
}
|
|
367
|
-
const row = (jsx_runtime_1.jsx(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, onDoubleClick: onPropertyDoubleClick, showSelectedBackground: true, containsSelection: false,
|
|
380
|
+
const row = (jsx_runtime_1.jsx(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, onDoubleClick: onPropertyDoubleClick, showSelectedBackground: true, containsSelection: false, outerHeight: null, children: jsx_runtime_1.jsx(TimelineFieldRowContent_1.TimelineFieldRowContent, { field: field, rowDepth: rowDepth, selected: selection.selected, children: fieldValue }) }));
|
|
368
381
|
return jsx_runtime_1.jsx(ContextMenu_1.ContextMenu, { getItems: getContextMenuItems, children: row });
|
|
369
382
|
};
|
|
370
383
|
exports.TimelineSequencePropItem = TimelineSequencePropItem;
|
|
@@ -3,7 +3,6 @@ import type { CanUpdateSequencePropStatus, CanUpdateSequencePropStatusKeyframed,
|
|
|
3
3
|
import type { SequenceNodePathInfo } from '../../helpers/get-timeline-sequence-sort-key';
|
|
4
4
|
import type { MoveEffectKeyframeChange, MoveSequenceKeyframeChange } from './call-move-keyframe';
|
|
5
5
|
import { type SaveSequencePropChange } from './save-sequence-prop';
|
|
6
|
-
import { type TimelineSelection } from './TimelineSelection';
|
|
7
6
|
export declare const timelineSequenceFromDragSnapThresholdPx = 10;
|
|
8
7
|
export type TimelineSequenceDurationDragTarget = {
|
|
9
8
|
readonly fileName: string;
|
|
@@ -105,21 +104,21 @@ export declare const getTimelineSequenceFromDragKeyframeMoves: ({ targets, delta
|
|
|
105
104
|
};
|
|
106
105
|
export declare const getTimelineSequenceDurationDragTargets: ({ draggedNodePathInfo, selectedItems, sequences, overrideIdsToNodePaths, propStatuses, }: {
|
|
107
106
|
readonly draggedNodePathInfo: SequenceNodePathInfo;
|
|
108
|
-
readonly selectedItems: readonly
|
|
107
|
+
readonly selectedItems: readonly import("@remotion/canvas").CanvasSelectionItem[];
|
|
109
108
|
readonly sequences: TSequence[];
|
|
110
109
|
readonly overrideIdsToNodePaths: OverrideIdToNodePaths;
|
|
111
110
|
readonly propStatuses: PropStatuses;
|
|
112
111
|
}) => TimelineSequenceDurationDragTarget[] | null;
|
|
113
112
|
export declare const getTimelineSequenceLeftEdgeDragTargets: ({ draggedNodePathInfo, selectedItems, sequences, overrideIdsToNodePaths, propStatuses, }: {
|
|
114
113
|
readonly draggedNodePathInfo: SequenceNodePathInfo;
|
|
115
|
-
readonly selectedItems: readonly
|
|
114
|
+
readonly selectedItems: readonly import("@remotion/canvas").CanvasSelectionItem[];
|
|
116
115
|
readonly sequences: TSequence[];
|
|
117
116
|
readonly overrideIdsToNodePaths: OverrideIdToNodePaths;
|
|
118
117
|
readonly propStatuses: PropStatuses;
|
|
119
118
|
}) => TimelineSequenceLeftEdgeDragTarget[] | null;
|
|
120
119
|
export declare const getTimelineSequenceFromDragTargets: ({ draggedNodePathInfo, selectedItems, sequences, overrideIdsToNodePaths, propStatuses, }: {
|
|
121
120
|
readonly draggedNodePathInfo: SequenceNodePathInfo;
|
|
122
|
-
readonly selectedItems: readonly
|
|
121
|
+
readonly selectedItems: readonly import("@remotion/canvas").CanvasSelectionItem[];
|
|
123
122
|
readonly sequences: TSequence[];
|
|
124
123
|
readonly overrideIdsToNodePaths: OverrideIdToNodePaths;
|
|
125
124
|
readonly propStatuses: PropStatuses;
|
|
@@ -128,18 +127,20 @@ export declare const TimelineSequenceLeftEdgeDragHandle: React.NamedExoticCompon
|
|
|
128
127
|
readonly nodePathInfo: SequenceNodePathInfo;
|
|
129
128
|
readonly windowWidth: number;
|
|
130
129
|
readonly timelineDurationInFrames: number;
|
|
130
|
+
readonly onDragEnd: (wasDragged: boolean) => void;
|
|
131
131
|
}>;
|
|
132
|
-
export declare const useTimelineSequenceFromDrag: ({ nodePathInfo, windowWidth, timelineDurationInFrames, }: {
|
|
132
|
+
export declare const useTimelineSequenceFromDrag: ({ nodePathInfo, windowWidth, timelineDurationInFrames, onDragEnd, }: {
|
|
133
133
|
readonly nodePathInfo: SequenceNodePathInfo | null;
|
|
134
134
|
readonly windowWidth: number;
|
|
135
135
|
readonly timelineDurationInFrames: number;
|
|
136
|
+
readonly onDragEnd: (wasDragged: boolean) => void;
|
|
136
137
|
}) => {
|
|
137
|
-
dragging: boolean;
|
|
138
138
|
onPointerDown: (e: React.PointerEvent<HTMLDivElement>) => void;
|
|
139
139
|
};
|
|
140
140
|
export declare const TimelineSequenceRightEdgeDragHandle: React.NamedExoticComponent<{
|
|
141
141
|
readonly nodePathInfo: SequenceNodePathInfo;
|
|
142
142
|
readonly windowWidth: number;
|
|
143
143
|
readonly timelineDurationInFrames: number;
|
|
144
|
+
readonly onDragEnd: (wasDragged: boolean) => void;
|
|
144
145
|
}>;
|
|
145
146
|
export {};
|
|
@@ -663,7 +663,7 @@ const clearFromDragOverrides = ({ clearDragOverrides, clearEffectDragOverrides,
|
|
|
663
663
|
}
|
|
664
664
|
}
|
|
665
665
|
};
|
|
666
|
-
const TimelineSequenceLeftEdgeDragHandleInner = ({ nodePathInfo, windowWidth, timelineDurationInFrames }) => {
|
|
666
|
+
const TimelineSequenceLeftEdgeDragHandleInner = ({ nodePathInfo, windowWidth, timelineDurationInFrames, onDragEnd }) => {
|
|
667
667
|
const { setPropStatuses, setDragOverrides, clearDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
|
|
668
668
|
const propStatusesRef = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesRefContext);
|
|
669
669
|
const sequencesRef = (0, react_1.useContext)(remotion_1.Internals.SequenceManagerRefContext);
|
|
@@ -679,6 +679,7 @@ const TimelineSequenceLeftEdgeDragHandleInner = ({ nodePathInfo, windowWidth, ti
|
|
|
679
679
|
clearDragOverrides,
|
|
680
680
|
previewServerState,
|
|
681
681
|
overrideIdToNodePathMappings,
|
|
682
|
+
onDragEnd,
|
|
682
683
|
});
|
|
683
684
|
latestRef.current = {
|
|
684
685
|
nodePathInfo,
|
|
@@ -687,6 +688,7 @@ const TimelineSequenceLeftEdgeDragHandleInner = ({ nodePathInfo, windowWidth, ti
|
|
|
687
688
|
clearDragOverrides,
|
|
688
689
|
previewServerState,
|
|
689
690
|
overrideIdToNodePathMappings,
|
|
691
|
+
onDragEnd,
|
|
690
692
|
};
|
|
691
693
|
const finishDrag = (0, react_1.useCallback)((commit) => {
|
|
692
694
|
const dragState = dragStateRef.current;
|
|
@@ -694,6 +696,7 @@ const TimelineSequenceLeftEdgeDragHandleInner = ({ nodePathInfo, windowWidth, ti
|
|
|
694
696
|
return;
|
|
695
697
|
}
|
|
696
698
|
dragStateRef.current = null;
|
|
699
|
+
latestRef.current.onDragEnd(dragState.didMove);
|
|
697
700
|
document.body.style.userSelect = '';
|
|
698
701
|
document.body.style.webkitUserSelect = '';
|
|
699
702
|
(0, ForceSpecificCursor_1.stopForcingSpecificCursor)();
|
|
@@ -764,6 +767,7 @@ const TimelineSequenceLeftEdgeDragHandleInner = ({ nodePathInfo, windowWidth, ti
|
|
|
764
767
|
dragStateRef.current = {
|
|
765
768
|
initialClientX: e.clientX,
|
|
766
769
|
latestDeltaFrames: 0,
|
|
770
|
+
didMove: false,
|
|
767
771
|
pxPerFrame,
|
|
768
772
|
pointerId: e.pointerId,
|
|
769
773
|
button: e.button,
|
|
@@ -794,6 +798,9 @@ const TimelineSequenceLeftEdgeDragHandleInner = ({ nodePathInfo, windowWidth, ti
|
|
|
794
798
|
const dx = e.clientX - dragState.initialClientX;
|
|
795
799
|
const deltaFrames = Math.round(dx / dragState.pxPerFrame);
|
|
796
800
|
dragState.latestDeltaFrames = deltaFrames;
|
|
801
|
+
if (deltaFrames !== 0) {
|
|
802
|
+
dragState.didMove = true;
|
|
803
|
+
}
|
|
797
804
|
for (const target of dragState.targets) {
|
|
798
805
|
const nextValues = (0, exports.getTimelineSequenceLeftEdgeDragValues)({
|
|
799
806
|
initialDuration: target.initialDuration,
|
|
@@ -854,7 +861,7 @@ const TimelineSequenceLeftEdgeDragHandleInner = ({ nodePathInfo, windowWidth, ti
|
|
|
854
861
|
return (jsx_runtime_1.jsx("div", { role: "separator", "aria-orientation": "vertical", title: "Drag to trim start", style: style, onPointerDown: onPointerDown }));
|
|
855
862
|
};
|
|
856
863
|
exports.TimelineSequenceLeftEdgeDragHandle = react_1.default.memo(TimelineSequenceLeftEdgeDragHandleInner);
|
|
857
|
-
const useTimelineSequenceFromDrag = ({ nodePathInfo, windowWidth, timelineDurationInFrames, }) => {
|
|
864
|
+
const useTimelineSequenceFromDrag = ({ nodePathInfo, windowWidth, timelineDurationInFrames, onDragEnd, }) => {
|
|
858
865
|
const { setPropStatuses, setDragOverrides, clearDragOverrides, setEffectDragOverrides, clearEffectDragOverrides, } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
|
|
859
866
|
const propStatusesRef = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesRefContext);
|
|
860
867
|
const sequencesRef = (0, react_1.useContext)(remotion_1.Internals.SequenceManagerRefContext);
|
|
@@ -862,7 +869,7 @@ const useTimelineSequenceFromDrag = ({ nodePathInfo, windowWidth, timelineDurati
|
|
|
862
869
|
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
863
870
|
const currentSelection = (0, TimelineSelection_1.useCurrentTimelineSelectionStateAsRef)();
|
|
864
871
|
const { editorSnapping } = (0, react_1.useContext)(editor_snapping_1.EditorSnappingContext);
|
|
865
|
-
const
|
|
872
|
+
const stopPointerSessionRef = (0, react_1.useRef)(null);
|
|
866
873
|
const dragStateRef = (0, react_1.useRef)(null);
|
|
867
874
|
const latestRef = (0, react_1.useRef)({
|
|
868
875
|
nodePathInfo,
|
|
@@ -874,6 +881,7 @@ const useTimelineSequenceFromDrag = ({ nodePathInfo, windowWidth, timelineDurati
|
|
|
874
881
|
previewServerState,
|
|
875
882
|
overrideIdToNodePathMappings,
|
|
876
883
|
editorSnapping,
|
|
884
|
+
onDragEnd,
|
|
877
885
|
});
|
|
878
886
|
latestRef.current = {
|
|
879
887
|
nodePathInfo,
|
|
@@ -885,6 +893,7 @@ const useTimelineSequenceFromDrag = ({ nodePathInfo, windowWidth, timelineDurati
|
|
|
885
893
|
previewServerState,
|
|
886
894
|
overrideIdToNodePathMappings,
|
|
887
895
|
editorSnapping,
|
|
896
|
+
onDragEnd,
|
|
888
897
|
};
|
|
889
898
|
const finishDrag = (0, react_1.useCallback)((commit) => {
|
|
890
899
|
const dragState = dragStateRef.current;
|
|
@@ -892,9 +901,9 @@ const useTimelineSequenceFromDrag = ({ nodePathInfo, windowWidth, timelineDurati
|
|
|
892
901
|
return;
|
|
893
902
|
}
|
|
894
903
|
dragStateRef.current = null;
|
|
904
|
+
latestRef.current.onDragEnd(dragState.didMove);
|
|
895
905
|
document.body.style.userSelect = '';
|
|
896
906
|
document.body.style.webkitUserSelect = '';
|
|
897
|
-
setDragging(false);
|
|
898
907
|
const { setPropStatuses: latestSetPropStatuses, clearDragOverrides: latestClear, clearEffectDragOverrides: latestClearEffect, previewServerState: latestServerState, } = latestRef.current;
|
|
899
908
|
const changes = (0, exports.getTimelineSequenceFromDragChanges)({
|
|
900
909
|
targets: dragState.targets,
|
|
@@ -945,7 +954,7 @@ const useTimelineSequenceFromDrag = ({ nodePathInfo, windowWidth, timelineDurati
|
|
|
945
954
|
});
|
|
946
955
|
}, []);
|
|
947
956
|
const onPointerDown = (0, react_1.useCallback)((e) => {
|
|
948
|
-
var _a
|
|
957
|
+
var _a;
|
|
949
958
|
if (e.button !== 0) {
|
|
950
959
|
return;
|
|
951
960
|
}
|
|
@@ -970,115 +979,93 @@ const useTimelineSequenceFromDrag = ({ nodePathInfo, windowWidth, timelineDurati
|
|
|
970
979
|
if (targets === null || targets.length === 0) {
|
|
971
980
|
return;
|
|
972
981
|
}
|
|
982
|
+
(_a = stopPointerSessionRef.current) === null || _a === void 0 ? void 0 : _a.call(stopPointerSessionRef);
|
|
973
983
|
e.preventDefault();
|
|
974
984
|
dragStateRef.current = {
|
|
975
985
|
initialClientX: e.clientX,
|
|
976
986
|
latestDeltaFrames: 0,
|
|
987
|
+
didMove: false,
|
|
977
988
|
pxPerFrame,
|
|
978
|
-
pointerId: e.pointerId,
|
|
979
|
-
button: e.button,
|
|
980
|
-
target: e.currentTarget,
|
|
981
989
|
targets,
|
|
982
990
|
};
|
|
983
|
-
(_b = (_a = e.currentTarget).setPointerCapture) === null || _b === void 0 ? void 0 : _b.call(_a, e.pointerId);
|
|
984
991
|
document.body.style.userSelect = 'none';
|
|
985
992
|
document.body.style.webkitUserSelect = 'none';
|
|
986
|
-
|
|
993
|
+
// Register before React commits so no pointer move can arrive before
|
|
994
|
+
// the global session listeners exist.
|
|
995
|
+
stopPointerSessionRef.current = (0, pointer_session_1.startCapturedPointerSession)({
|
|
996
|
+
event: e.nativeEvent,
|
|
997
|
+
captureTarget: e.currentTarget,
|
|
998
|
+
onMove: (moveEvent) => {
|
|
999
|
+
const dragState = dragStateRef.current;
|
|
1000
|
+
if (!dragState) {
|
|
1001
|
+
return;
|
|
1002
|
+
}
|
|
1003
|
+
const dx = moveEvent.clientX - dragState.initialClientX;
|
|
1004
|
+
const deltaFrames = (0, exports.getTimelineSequenceFromDragDelta)({
|
|
1005
|
+
deltaFrames: Math.round(dx / dragState.pxPerFrame),
|
|
1006
|
+
pxPerFrame: dragState.pxPerFrame,
|
|
1007
|
+
snappingEnabled: latestRef.current.editorSnapping,
|
|
1008
|
+
targets: dragState.targets,
|
|
1009
|
+
});
|
|
1010
|
+
dragState.latestDeltaFrames = deltaFrames;
|
|
1011
|
+
if (deltaFrames !== 0) {
|
|
1012
|
+
dragState.didMove = true;
|
|
1013
|
+
}
|
|
1014
|
+
for (const target of dragState.targets) {
|
|
1015
|
+
const nextFrom = (0, exports.getTimelineSequenceFromDragValue)({
|
|
1016
|
+
initialFrom: target.initialFrom,
|
|
1017
|
+
deltaFrames,
|
|
1018
|
+
});
|
|
1019
|
+
latestRef.current.setDragOverrides(target.nodePath, 'from', remotion_1.Internals.makeStaticDragOverride(nextFrom));
|
|
1020
|
+
for (const keyframeTarget of target.sequenceKeyframes) {
|
|
1021
|
+
latestRef.current.setDragOverrides(keyframeTarget.nodePath, keyframeTarget.fieldKey, {
|
|
1022
|
+
type: 'keyframed',
|
|
1023
|
+
status: shiftKeyframedStatus({
|
|
1024
|
+
status: keyframeTarget.status,
|
|
1025
|
+
deltaFrames,
|
|
1026
|
+
isDescendant: keyframeTarget.isDescendant,
|
|
1027
|
+
}),
|
|
1028
|
+
});
|
|
1029
|
+
}
|
|
1030
|
+
for (const keyframeTarget of target.effectKeyframes) {
|
|
1031
|
+
latestRef.current.setEffectDragOverrides(keyframeTarget.nodePath, keyframeTarget.effectIndex, keyframeTarget.fieldKey, {
|
|
1032
|
+
type: 'keyframed',
|
|
1033
|
+
status: shiftKeyframedStatus({
|
|
1034
|
+
status: keyframeTarget.status,
|
|
1035
|
+
deltaFrames,
|
|
1036
|
+
isDescendant: keyframeTarget.isDescendant,
|
|
1037
|
+
}),
|
|
1038
|
+
});
|
|
1039
|
+
}
|
|
1040
|
+
}
|
|
1041
|
+
},
|
|
1042
|
+
onEnd: (reason, endEvent) => {
|
|
1043
|
+
stopPointerSessionRef.current = null;
|
|
1044
|
+
finishDrag((reason === 'pointerup' || reason === 'buttons-released') &&
|
|
1045
|
+
endEvent !== null);
|
|
1046
|
+
},
|
|
1047
|
+
});
|
|
987
1048
|
}, [
|
|
988
1049
|
currentSelection,
|
|
1050
|
+
finishDrag,
|
|
989
1051
|
propStatusesRef,
|
|
990
1052
|
sequencesRef,
|
|
991
1053
|
timelineDurationInFrames,
|
|
992
1054
|
windowWidth,
|
|
993
1055
|
]);
|
|
994
1056
|
(0, react_1.useEffect)(() => {
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
const dragState = dragStateRef.current;
|
|
1000
|
-
if (!dragState || e.pointerId !== dragState.pointerId) {
|
|
1001
|
-
return;
|
|
1002
|
-
}
|
|
1003
|
-
const dx = e.clientX - dragState.initialClientX;
|
|
1004
|
-
const deltaFrames = (0, exports.getTimelineSequenceFromDragDelta)({
|
|
1005
|
-
deltaFrames: Math.round(dx / dragState.pxPerFrame),
|
|
1006
|
-
pxPerFrame: dragState.pxPerFrame,
|
|
1007
|
-
snappingEnabled: latestRef.current.editorSnapping,
|
|
1008
|
-
targets: dragState.targets,
|
|
1009
|
-
});
|
|
1010
|
-
dragState.latestDeltaFrames = deltaFrames;
|
|
1011
|
-
for (const target of dragState.targets) {
|
|
1012
|
-
const nextFrom = (0, exports.getTimelineSequenceFromDragValue)({
|
|
1013
|
-
initialFrom: target.initialFrom,
|
|
1014
|
-
deltaFrames,
|
|
1015
|
-
});
|
|
1016
|
-
latestRef.current.setDragOverrides(target.nodePath, 'from', remotion_1.Internals.makeStaticDragOverride(nextFrom));
|
|
1017
|
-
for (const keyframeTarget of target.sequenceKeyframes) {
|
|
1018
|
-
latestRef.current.setDragOverrides(keyframeTarget.nodePath, keyframeTarget.fieldKey, {
|
|
1019
|
-
type: 'keyframed',
|
|
1020
|
-
status: shiftKeyframedStatus({
|
|
1021
|
-
status: keyframeTarget.status,
|
|
1022
|
-
deltaFrames,
|
|
1023
|
-
isDescendant: keyframeTarget.isDescendant,
|
|
1024
|
-
}),
|
|
1025
|
-
});
|
|
1026
|
-
}
|
|
1027
|
-
for (const keyframeTarget of target.effectKeyframes) {
|
|
1028
|
-
latestRef.current.setEffectDragOverrides(keyframeTarget.nodePath, keyframeTarget.effectIndex, keyframeTarget.fieldKey, {
|
|
1029
|
-
type: 'keyframed',
|
|
1030
|
-
status: shiftKeyframedStatus({
|
|
1031
|
-
status: keyframeTarget.status,
|
|
1032
|
-
deltaFrames,
|
|
1033
|
-
isDescendant: keyframeTarget.isDescendant,
|
|
1034
|
-
}),
|
|
1035
|
-
});
|
|
1036
|
-
}
|
|
1037
|
-
}
|
|
1038
|
-
};
|
|
1039
|
-
const onUp = (e) => {
|
|
1040
|
-
const dragState = dragStateRef.current;
|
|
1041
|
-
if (!dragState || e.pointerId !== dragState.pointerId) {
|
|
1042
|
-
return;
|
|
1043
|
-
}
|
|
1044
|
-
finishDrag(true);
|
|
1045
|
-
};
|
|
1046
|
-
const onCancel = (e) => {
|
|
1047
|
-
const dragState = dragStateRef.current;
|
|
1048
|
-
if (!dragState || e.pointerId !== dragState.pointerId) {
|
|
1049
|
-
return;
|
|
1050
|
-
}
|
|
1051
|
-
finishDrag(false);
|
|
1057
|
+
return () => {
|
|
1058
|
+
var _a;
|
|
1059
|
+
(_a = stopPointerSessionRef.current) === null || _a === void 0 ? void 0 : _a.call(stopPointerSessionRef);
|
|
1060
|
+
stopPointerSessionRef.current = null;
|
|
1052
1061
|
};
|
|
1053
|
-
|
|
1054
|
-
if (!activeDragState) {
|
|
1055
|
-
return;
|
|
1056
|
-
}
|
|
1057
|
-
return (0, pointer_session_1.startCapturedPointerSession)({
|
|
1058
|
-
event: activeDragState,
|
|
1059
|
-
captureTarget: activeDragState.target,
|
|
1060
|
-
onMove,
|
|
1061
|
-
onEnd: (reason, endEvent) => {
|
|
1062
|
-
if ((reason === 'pointerup' || reason === 'buttons-released') &&
|
|
1063
|
-
endEvent) {
|
|
1064
|
-
onUp(endEvent);
|
|
1065
|
-
}
|
|
1066
|
-
else if (endEvent) {
|
|
1067
|
-
onCancel(endEvent);
|
|
1068
|
-
}
|
|
1069
|
-
else {
|
|
1070
|
-
finishDrag(false);
|
|
1071
|
-
}
|
|
1072
|
-
},
|
|
1073
|
-
});
|
|
1074
|
-
}, [dragging, finishDrag]);
|
|
1062
|
+
}, []);
|
|
1075
1063
|
return {
|
|
1076
|
-
dragging,
|
|
1077
1064
|
onPointerDown,
|
|
1078
1065
|
};
|
|
1079
1066
|
};
|
|
1080
1067
|
exports.useTimelineSequenceFromDrag = useTimelineSequenceFromDrag;
|
|
1081
|
-
const TimelineSequenceRightEdgeDragHandleInner = ({ nodePathInfo, windowWidth, timelineDurationInFrames }) => {
|
|
1068
|
+
const TimelineSequenceRightEdgeDragHandleInner = ({ nodePathInfo, windowWidth, timelineDurationInFrames, onDragEnd }) => {
|
|
1082
1069
|
const { setPropStatuses, setDragOverrides, clearDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
|
|
1083
1070
|
const propStatusesRef = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesRefContext);
|
|
1084
1071
|
const sequencesRef = (0, react_1.useContext)(remotion_1.Internals.SequenceManagerRefContext);
|
|
@@ -1095,6 +1082,7 @@ const TimelineSequenceRightEdgeDragHandleInner = ({ nodePathInfo, windowWidth, t
|
|
|
1095
1082
|
clearDragOverrides,
|
|
1096
1083
|
previewServerState,
|
|
1097
1084
|
overrideIdToNodePathMappings,
|
|
1085
|
+
onDragEnd,
|
|
1098
1086
|
});
|
|
1099
1087
|
latestRef.current = {
|
|
1100
1088
|
nodePathInfo,
|
|
@@ -1103,6 +1091,7 @@ const TimelineSequenceRightEdgeDragHandleInner = ({ nodePathInfo, windowWidth, t
|
|
|
1103
1091
|
clearDragOverrides,
|
|
1104
1092
|
previewServerState,
|
|
1105
1093
|
overrideIdToNodePathMappings,
|
|
1094
|
+
onDragEnd,
|
|
1106
1095
|
};
|
|
1107
1096
|
const finishDrag = (0, react_1.useCallback)((commit) => {
|
|
1108
1097
|
const dragState = dragStateRef.current;
|
|
@@ -1110,6 +1099,7 @@ const TimelineSequenceRightEdgeDragHandleInner = ({ nodePathInfo, windowWidth, t
|
|
|
1110
1099
|
return;
|
|
1111
1100
|
}
|
|
1112
1101
|
dragStateRef.current = null;
|
|
1102
|
+
latestRef.current.onDragEnd(dragState.didMove);
|
|
1113
1103
|
document.body.style.userSelect = '';
|
|
1114
1104
|
document.body.style.webkitUserSelect = '';
|
|
1115
1105
|
(0, ForceSpecificCursor_1.stopForcingSpecificCursor)();
|
|
@@ -1178,6 +1168,7 @@ const TimelineSequenceRightEdgeDragHandleInner = ({ nodePathInfo, windowWidth, t
|
|
|
1178
1168
|
dragStateRef.current = {
|
|
1179
1169
|
initialClientX: e.clientX,
|
|
1180
1170
|
latestDeltaFrames: 0,
|
|
1171
|
+
didMove: false,
|
|
1181
1172
|
pxPerFrame,
|
|
1182
1173
|
pointerId: e.pointerId,
|
|
1183
1174
|
button: e.button,
|
|
@@ -1211,6 +1202,9 @@ const TimelineSequenceRightEdgeDragHandleInner = ({ nodePathInfo, windowWidth, t
|
|
|
1211
1202
|
const dx = e.clientX - dragState.initialClientX;
|
|
1212
1203
|
const deltaFrames = Math.round(dx / dragState.pxPerFrame);
|
|
1213
1204
|
dragState.latestDeltaFrames = deltaFrames;
|
|
1205
|
+
if (deltaFrames !== 0) {
|
|
1206
|
+
dragState.didMove = true;
|
|
1207
|
+
}
|
|
1214
1208
|
for (const target of dragState.targets) {
|
|
1215
1209
|
latestRef.current.setDragOverrides(target.nodePath, 'durationInFrames', remotion_1.Internals.makeStaticDragOverride((0, exports.getTimelineSequenceDurationDragValue)({
|
|
1216
1210
|
initialDuration: target.initialDuration,
|
|
@@ -65,7 +65,7 @@ const TimelineTrackUnmemoized = ({ track }) => {
|
|
|
65
65
|
previewServerConnected &&
|
|
66
66
|
getIsExpanded(track.nodePathInfo);
|
|
67
67
|
return (jsx_runtime_1.jsxs("div", { onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, children: [
|
|
68
|
-
jsx_runtime_1.jsxs("div", { style: layerStyle, children: [rowHighlightBackground && timelineWidth !== null ? (jsx_runtime_1.jsx("div", { style: (0, TimelineSelection_1.getTimelineSelectedTrackHighlightStyle)(timelineWidth, rowHighlightBackground) })) : null, jsx_runtime_1.jsx(TimelineSequence_1.TimelineSequence, { s: track.sequence, connectedCompositions: (_a = track.connectedCompositions) !== null && _a !== void 0 ? _a : emptyConnectedCompositions, nodePathInfo: track.nodePathInfo, sequenceFrameOffset: track.sequenceFrameOffset })
|
|
68
|
+
jsx_runtime_1.jsxs("div", { style: layerStyle, children: [rowHighlightBackground && timelineWidth !== null ? (jsx_runtime_1.jsx("div", { style: (0, TimelineSelection_1.getTimelineSelectedTrackHighlightStyle)(timelineWidth, rowHighlightBackground) })) : null, jsx_runtime_1.jsx(TimelineSequence_1.TimelineSequence, { s: track.sequence, cascadedStart: track.cascadedStart, localStart: track.localStart, connectedCompositions: (_a = track.connectedCompositions) !== null && _a !== void 0 ? _a : emptyConnectedCompositions, nodePathInfo: track.nodePathInfo, sequenceFrameOffset: track.sequenceFrameOffset })
|
|
69
69
|
] }), showExpandedKeyframes && track.nodePathInfo ? (jsx_runtime_1.jsx(TimelineExpandedTrackKeyframes_1.TimelineExpandedTrackKeyframes, { sequence: track.sequence, nodePathInfo: track.nodePathInfo, keyframeDisplayOffset: track.keyframeDisplayOffset })) : null] }));
|
|
70
70
|
};
|
|
71
71
|
exports.TimelineTrack = react_1.default.memo(TimelineTrackUnmemoized);
|
|
@@ -10,14 +10,10 @@ const TimelineSchemaField_1 = require("./TimelineSchemaField");
|
|
|
10
10
|
const transform_origin_utils_1 = require("./transform-origin-utils");
|
|
11
11
|
const Transform3DModeContext_1 = require("./Transform3DModeContext");
|
|
12
12
|
const leftDraggerStyle = {
|
|
13
|
-
paddingBottom: 2,
|
|
14
13
|
paddingLeft: 0,
|
|
15
|
-
paddingTop: 2,
|
|
16
14
|
};
|
|
17
15
|
const rightDraggerStyle = {
|
|
18
|
-
paddingBottom: 2,
|
|
19
16
|
paddingRight: 0,
|
|
20
|
-
paddingTop: 2,
|
|
21
17
|
};
|
|
22
18
|
const containerStyle = {
|
|
23
19
|
display: 'flex',
|
|
@@ -9,14 +9,10 @@ const timeline_field_utils_1 = require("./timeline-field-utils");
|
|
|
9
9
|
const timeline_translate_utils_1 = require("./timeline-translate-utils");
|
|
10
10
|
const Transform3DModeContext_1 = require("./Transform3DModeContext");
|
|
11
11
|
const leftDraggerStyle = {
|
|
12
|
-
paddingBottom: 2,
|
|
13
12
|
paddingLeft: 0,
|
|
14
|
-
paddingTop: 2,
|
|
15
13
|
};
|
|
16
14
|
const rightDraggerStyle = {
|
|
17
|
-
paddingBottom: 2,
|
|
18
15
|
paddingRight: 0,
|
|
19
|
-
paddingTop: 2,
|
|
20
16
|
};
|
|
21
17
|
const containerStyle = {
|
|
22
18
|
display: 'flex',
|
|
@@ -115,12 +115,14 @@ const TimelineVirtualizationProvider = ({ children, hasBeenCut, isStill, timelin
|
|
|
115
115
|
virtualizer.measure();
|
|
116
116
|
}, [trackHeights, virtualizer]);
|
|
117
117
|
(0, react_1.useEffect)(() => {
|
|
118
|
+
var _a;
|
|
118
119
|
if (revealRequest === null) {
|
|
119
120
|
return;
|
|
120
121
|
}
|
|
121
122
|
const key = getSelectionTrackKey(revealRequest.item);
|
|
122
123
|
const index = key === null ? undefined : layout.rootTrackIndexes.get(key);
|
|
123
|
-
if (index !== undefined
|
|
124
|
+
if (index !== undefined &&
|
|
125
|
+
((_a = virtualizer.getOffsetForIndex(index, 'auto')) === null || _a === void 0 ? void 0 : _a[1]) !== 'auto') {
|
|
124
126
|
virtualizer.scrollToIndex(index, { align: 'center' });
|
|
125
127
|
}
|
|
126
128
|
}, [layout.rootTrackIndexes, revealRequest, virtualizer]);
|
|
@@ -2,17 +2,16 @@ import type { OverrideIdToNodePaths, PropStatuses, TSequence } from 'remotion';
|
|
|
2
2
|
import type { SequenceNodePathInfo } from '../../helpers/get-timeline-sequence-sort-key';
|
|
3
3
|
import type { ConfirmationDialogFunction } from '../ConfirmationDialog-types';
|
|
4
4
|
import type { SetPropStatuses } from './save-sequence-prop';
|
|
5
|
-
import { type TimelineSelection } from './TimelineSelection';
|
|
6
5
|
export declare const deleteSequencesFromSource: (nodePathInfos: SequenceNodePathInfo[], confirm: ConfirmationDialogFunction) => Promise<boolean>;
|
|
7
6
|
export declare const getTimelineSelectionAfterDeletingItems: ({ selections, sequences, overrideIdsToNodePaths, propStatuses, timelinePosition, }: {
|
|
8
|
-
readonly selections: readonly
|
|
7
|
+
readonly selections: readonly import("@remotion/canvas").CanvasSelectionItem[];
|
|
9
8
|
readonly sequences?: TSequence[] | undefined;
|
|
10
9
|
readonly overrideIdsToNodePaths?: OverrideIdToNodePaths | undefined;
|
|
11
10
|
readonly propStatuses?: PropStatuses | undefined;
|
|
12
11
|
readonly timelinePosition?: number | undefined;
|
|
13
|
-
}) => readonly
|
|
12
|
+
}) => readonly import("@remotion/canvas").CanvasSelectionItem[];
|
|
14
13
|
export declare const deleteSelectedTimelineItems: ({ selections, sequences, overrideIdsToNodePaths, setPropStatuses, clientId, confirm, propStatuses, timelinePosition, }: {
|
|
15
|
-
selections: readonly
|
|
14
|
+
selections: readonly import("@remotion/canvas").CanvasSelectionItem[];
|
|
16
15
|
sequences: TSequence[];
|
|
17
16
|
overrideIdsToNodePaths: OverrideIdToNodePaths;
|
|
18
17
|
setPropStatuses: SetPropStatuses;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import type { SequenceNodePathInfo } from '../../helpers/get-timeline-sequence-sort-key';
|
|
2
2
|
import type { ConfirmationDialogFunction } from '../ConfirmationDialog-types';
|
|
3
|
-
import type { TimelineSelection } from './TimelineSelection';
|
|
4
3
|
export declare const duplicateSequencesFromSource: (nodePathInfos: readonly SequenceNodePathInfo[], confirm: ConfirmationDialogFunction) => Promise<void>;
|
|
5
|
-
export declare const isDuplicatableSequenceRowSelection: (selection:
|
|
4
|
+
export declare const isDuplicatableSequenceRowSelection: (selection: import("@remotion/canvas").CanvasSelectionItem) => selection is {
|
|
6
5
|
readonly type: "sequence";
|
|
7
6
|
readonly nodePathInfo: SequenceNodePathInfo;
|
|
8
7
|
} & {
|
|
9
8
|
type: "sequence";
|
|
10
9
|
};
|
|
11
|
-
export declare const isDuplicatableEffectSelection: (selection:
|
|
10
|
+
export declare const isDuplicatableEffectSelection: (selection: import("@remotion/canvas").CanvasSelectionItem) => selection is {
|
|
12
11
|
readonly type: "sequence-effect";
|
|
13
12
|
readonly nodePathInfo: SequenceNodePathInfo;
|
|
14
13
|
readonly i: number;
|
|
@@ -16,6 +15,6 @@ export declare const isDuplicatableEffectSelection: (selection: TimelineSelectio
|
|
|
16
15
|
type: "sequence-effect";
|
|
17
16
|
};
|
|
18
17
|
export declare const duplicateSelectedTimelineItems: ({ selections, confirm, }: {
|
|
19
|
-
selections: readonly
|
|
18
|
+
selections: readonly import("@remotion/canvas").CanvasSelectionItem[];
|
|
20
19
|
confirm: ConfirmationDialogFunction;
|
|
21
20
|
}) => Promise<void> | null;
|