@remotion/studio 4.0.526 → 4.0.528
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/AgentPrompt.js +1 -2
- package/dist/components/AudioWaveform.d.ts +1 -0
- package/dist/components/AudioWaveform.js +10 -14
- package/dist/components/Canvas.js +88 -26
- package/dist/components/CanvasCaptureDropHandler.js +63 -0
- package/dist/components/CanvasOrLoading.js +10 -2
- package/dist/components/CodeFrame.js +1 -1
- package/dist/components/ColorPicker/checker.d.ts +1 -1
- package/dist/components/CompositionSelectorItem.js +1 -0
- package/dist/components/CurrentAsset.js +4 -2
- package/dist/components/EditorRuler/Ruler.js +6 -3
- package/dist/components/EffectPickerModal.js +69 -43
- package/dist/components/ElementInstallConfirmation.js +3 -3
- package/dist/components/ElementLibrariesSettings.d.ts +2 -0
- package/dist/components/ElementLibrariesSettings.js +200 -0
- package/dist/components/InitialCompositionLoader.js +4 -2
- package/dist/components/InlineDropdown.js +26 -2
- package/dist/components/InlineEditableTitle.js +1 -0
- package/dist/components/InspectorOpenInEditor.js +13 -0
- package/dist/components/InspectorPanel/AlignmentControls.js +28 -9
- package/dist/components/InspectorPanel/CollapsibleInspectorSectionHeader.js +2 -1
- package/dist/components/InspectorPanel/CompositionInspector.js +3 -3
- package/dist/components/InspectorPanel/CompositionMetadata.js +4 -0
- package/dist/components/InspectorPanel/EasingInspector.js +6 -2
- package/dist/components/InspectorPanel/ElementLibraryButton.js +2 -1
- package/dist/components/InspectorPanel/KeyframeEasingNavigator.js +1 -1
- package/dist/components/InspectorPanel/KeyframeInspector.js +28 -24
- package/dist/components/InspectorPanel/MultiSequenceInspector.js +32 -1
- package/dist/components/InspectorPanel/MultiSequenceNumberField.js +1 -1
- package/dist/components/InspectorPanel/SequenceInspectorHeader.d.ts +3 -1
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +70 -2
- package/dist/components/InspectorPanel/SequenceWrapAction.d.ts +8 -0
- package/dist/components/InspectorPanel/SequenceWrapAction.js +151 -0
- package/dist/components/InspectorPanel/common.js +1 -0
- package/dist/components/InspectorPanel/easing-inspector-selection.d.ts +2 -1
- package/dist/components/InspectorPanel/easing-inspector-selection.js +4 -3
- package/dist/components/InspectorPanel/keyframe-inspector-frame.d.ts +2 -1
- package/dist/components/InspectorPanel/keyframe-inspector-frame.js +2 -2
- package/dist/components/InspectorPanel/styles.js +2 -0
- package/dist/components/InspectorPanel/use-composition-actions.js +1 -0
- package/dist/components/InspectorSequenceSection.d.ts +1 -0
- package/dist/components/InspectorSequenceSection.js +7 -5
- package/dist/components/InspectorSourceLocation.js +3 -0
- package/dist/components/KeyboardShortcutsSettings.js +1 -1
- package/dist/components/Menu/styles.d.ts +2 -2
- package/dist/components/MenuBuildIndicator.js +1 -0
- package/dist/components/Modals.js +7 -6
- package/dist/components/ModelManager.js +10 -9
- package/dist/components/NewComposition/CancelButton.js +11 -5
- package/dist/components/NewComposition/InputDragger.d.ts +3 -1
- package/dist/components/NewComposition/InputDragger.js +28 -9
- package/dist/components/NewComposition/NewComposition.js +7 -6
- package/dist/components/NewComposition/RemInput.d.ts +1 -1
- package/dist/components/NewComposition/menu-typeahead.js +1 -1
- package/dist/components/Preview.js +4 -0
- package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +1 -0
- package/dist/components/QuickSwitcher/QuickSwitcherContent.js +1 -0
- package/dist/components/RadioButton.js +1 -0
- package/dist/components/RenderModal/DataEditor.js +4 -1
- package/dist/components/RenderModal/SchemaEditor/create-zod-values.js +1 -2
- package/dist/components/RenderModal/WebRenderModalPicture.js +1 -2
- package/dist/components/RenderQueue/CaptionQueueItem.js +19 -7
- package/dist/components/RenderQueue/CaptionQueueProcessor.js +65 -15
- package/dist/components/RenderQueue/QueueJobError.d.ts +8 -0
- package/dist/components/RenderQueue/QueueJobError.js +24 -0
- package/dist/components/RenderQueue/QueueJobErrorModal.d.ts +8 -0
- package/dist/components/RenderQueue/QueueJobErrorModal.js +63 -0
- package/dist/components/RenderQueue/RenderQueueItemCancelButton.d.ts +3 -1
- package/dist/components/RenderQueue/RenderQueueItemCancelButton.js +11 -4
- package/dist/components/RenderQueue/RenderQueueRepeat.d.ts +3 -1
- package/dist/components/RenderQueue/RenderQueueRepeat.js +20 -3
- package/dist/components/RenderQueue/VideoMattingQueueItem.js +25 -27
- package/dist/components/RenderQueue/VideoMattingQueueProcessor.js +68 -28
- package/dist/components/RenderQueue/caption-job-types.d.ts +9 -1
- package/dist/components/RenderQueue/context.d.ts +4 -0
- package/dist/components/RenderQueue/context.js +58 -8
- package/dist/components/RenderQueue/index.js +3 -3
- package/dist/components/RenderQueue/load-model-for-job.d.ts +2 -1
- package/dist/components/RenderQueue/load-model-for-job.js +5 -1
- package/dist/components/RenderQueue/video-matting-job-types.d.ts +13 -6
- package/dist/components/RendersTab.js +2 -0
- package/dist/components/SelectedOutlineCropControls.js +2 -1
- package/dist/components/SelectedOutlineEditingHandles.js +9 -2
- package/dist/components/SelectedOutlineElement.js +9 -3
- package/dist/components/SelectedOutlineKeyboardControls.d.ts +2 -4
- package/dist/components/SelectedOutlineKeyboardControls.js +4 -22
- package/dist/components/SelectedOutlineOverlay.js +152 -106
- package/dist/components/SelectedOutlinePathPoints.d.ts +8 -0
- package/dist/components/SelectedOutlinePathPoints.js +433 -0
- package/dist/components/SelectedOutlinePolygon.js +21 -46
- package/dist/components/SelectedOutlineRenderer.d.ts +3 -5
- package/dist/components/SelectedOutlineRenderer.js +32 -136
- package/dist/components/SelectedOutlineSnapIndicators.d.ts +6 -0
- package/dist/components/SelectedOutlineSnapIndicators.js +16 -12
- package/dist/components/SelectedOutlineTransformOriginHandle.js +3 -2
- package/dist/components/SelectedOutlineUvControls.js +12 -7
- package/dist/components/SequencePropsSubscriptionProvider.d.ts +3 -0
- package/dist/components/SequencePropsSubscriptionProvider.js +8 -6
- package/dist/components/SettingsModal.js +30 -3
- package/dist/components/SettingsModalFooter.d.ts +1 -0
- package/dist/components/SettingsModalFooter.js +7 -3
- package/dist/components/ShowOutlinesProvider.js +1 -1
- package/dist/components/SkillsSettings.d.ts +0 -1
- package/dist/components/SkillsSettings.js +13 -14
- package/dist/components/Splitter/SplitterElement.js +1 -2
- package/dist/components/TimeValue.js +1 -1
- package/dist/components/Timeline/LoopedTimelineIndicators.d.ts +1 -0
- package/dist/components/Timeline/LoopedTimelineIndicators.js +7 -6
- package/dist/components/Timeline/TimelineArrayField.js +1 -1
- package/dist/components/Timeline/TimelineClipboardKeybindings.js +0 -1
- package/dist/components/Timeline/TimelineColorField.js +1 -1
- package/dist/components/Timeline/TimelineDeleteKeybindings.js +6 -9
- package/dist/components/Timeline/TimelineDragHandler.js +1 -1
- package/dist/components/Timeline/TimelineEffectItem.js +1 -0
- package/dist/components/Timeline/TimelineEffectPropItem.d.ts +1 -0
- package/dist/components/Timeline/TimelineEffectPropItem.js +12 -5
- package/dist/components/Timeline/TimelineExpandArrowButton.js +1 -0
- package/dist/components/Timeline/TimelineExpandedRow.d.ts +1 -0
- package/dist/components/Timeline/TimelineExpandedRow.js +6 -4
- package/dist/components/Timeline/TimelineExpandedSection.d.ts +1 -0
- package/dist/components/Timeline/TimelineExpandedSection.js +2 -2
- package/dist/components/Timeline/TimelineExpandedTrackKeyframes.d.ts +1 -0
- package/dist/components/Timeline/TimelineExpandedTrackKeyframes.js +3 -1
- package/dist/components/Timeline/TimelineFieldLabel.js +1 -0
- package/dist/components/Timeline/TimelineFontFamilyField.js +12 -12
- package/dist/components/Timeline/TimelineKeyframeControls.d.ts +1 -0
- package/dist/components/Timeline/TimelineKeyframeControls.js +40 -28
- package/dist/components/Timeline/TimelineLayerChildren.js +1 -1
- package/dist/components/Timeline/TimelineList.js +1 -1
- package/dist/components/Timeline/TimelineNumberField.js +2 -4
- package/dist/components/Timeline/TimelinePrimitiveFieldValue.js +1 -1
- package/dist/components/Timeline/TimelineSelection.d.ts +9 -9
- package/dist/components/Timeline/TimelineSelection.js +16 -9
- package/dist/components/Timeline/TimelineSequence.d.ts +3 -1
- package/dist/components/Timeline/TimelineSequence.js +65 -21
- package/dist/components/Timeline/TimelineSequenceFrame.js +1 -0
- package/dist/components/Timeline/TimelineSequenceItem.d.ts +1 -0
- package/dist/components/Timeline/TimelineSequenceItem.js +46 -8
- package/dist/components/Timeline/TimelineSequencePropItem.d.ts +3 -0
- package/dist/components/Timeline/TimelineSequencePropItem.js +262 -25
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +11 -13
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +98 -77
- package/dist/components/Timeline/TimelineTextContentField.js +27 -4
- package/dist/components/Timeline/TimelineTimeIndicators.js +10 -5
- package/dist/components/Timeline/TimelineTrack.js +1 -1
- package/dist/components/Timeline/TimelineTrimTooltip.d.ts +11 -0
- package/dist/components/Timeline/TimelineTrimTooltip.js +41 -0
- package/dist/components/Timeline/TimelineVideoInfo.d.ts +1 -0
- package/dist/components/Timeline/TimelineVideoInfo.js +13 -10
- package/dist/components/Timeline/TimelineViewport.d.ts +1 -0
- package/dist/components/Timeline/TimelineViewport.js +10 -1
- package/dist/components/Timeline/delete-selected-keyframe.js +22 -8
- package/dist/components/Timeline/delete-selected-timeline-item.d.ts +1 -5
- package/dist/components/Timeline/delete-selected-timeline-item.js +9 -95
- package/dist/components/Timeline/get-animation-item-selection-for-frame.d.ts +2 -1
- package/dist/components/Timeline/get-animation-item-selection-for-frame.js +7 -5
- package/dist/components/Timeline/get-keyframed-sequence-drag-targets.d.ts +23 -0
- package/dist/components/Timeline/get-keyframed-sequence-drag-targets.js +57 -0
- package/dist/components/Timeline/get-node-keyframes.d.ts +2 -1
- package/dist/components/Timeline/get-node-keyframes.js +6 -4
- package/dist/components/Timeline/get-playback-rate-keyframe-changes.d.ts +21 -0
- package/dist/components/Timeline/get-playback-rate-keyframe-changes.js +142 -0
- package/dist/components/Timeline/get-sequence-context-menu-items.d.ts +3 -1
- package/dist/components/Timeline/get-sequence-context-menu-items.js +13 -1
- package/dist/components/Timeline/get-timeline-keyframes.d.ts +15 -2
- package/dist/components/Timeline/get-timeline-keyframes.js +44 -6
- package/dist/components/Timeline/keyframe-clipboard.js +17 -3
- package/dist/components/Timeline/split-selected-timeline-item.d.ts +13 -10
- package/dist/components/Timeline/split-selected-timeline-item.js +61 -35
- package/dist/components/Timeline/timeline-field-display-utils.js +1 -0
- package/dist/components/Timeline/timeline-field-row-layout.js +1 -0
- package/dist/components/Timeline/use-delete-timeline-items.js +17 -11
- package/dist/components/Timeline/use-expanded-track-keyframe-rows.d.ts +2 -1
- package/dist/components/Timeline/use-expanded-track-keyframe-rows.js +3 -1
- package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.js +7 -3
- package/dist/components/Timeline/use-timeline-keyframe-drag.js +28 -19
- package/dist/components/TimelineCombobox.js +1 -0
- package/dist/components/Transcription/Models.js +1 -1
- package/dist/components/Transcription/TranscriptionModal.js +18 -11
- package/dist/components/Transcription/TranscriptionModalWithOptionalWhisper.js +1 -1
- package/dist/components/Transcription/resample-media-to-16-khz.d.ts +2 -1
- package/dist/components/Transcription/resample-media-to-16-khz.js +20 -2
- package/dist/components/UpdatesSettings.js +2 -0
- package/dist/components/VideoMatting/Models.js +1 -1
- package/dist/components/VideoMatting/VideoMattingModal.js +30 -47
- package/dist/components/VideoMatting/VideoMattingModalWithOptionalPackage.js +1 -1
- package/dist/components/WebMcp.js +23 -40
- package/dist/components/composition-drop-preview.d.ts +9 -2
- package/dist/components/composition-drop-preview.js +8 -4
- package/dist/components/composition-menu-items.js +4 -4
- package/dist/components/delete-jsx-nodes-api.d.ts +2 -0
- package/dist/components/{delete-jsx-node-api.js → delete-jsx-nodes-api.js} +5 -5
- package/dist/components/effect-drag-and-drop.d.ts +13 -5
- package/dist/components/effect-drag-and-drop.js +19 -4
- package/dist/components/get-open-in-menu-items.d.ts +2 -1
- package/dist/components/get-open-in-menu-items.js +24 -8
- package/dist/components/keyboard-shortcuts.d.ts +4 -4
- package/dist/components/keyboard-shortcuts.js +3 -1
- package/dist/components/public-output-name.d.ts +1 -0
- package/dist/components/public-output-name.js +7 -3
- package/dist/components/selected-outline-drag.d.ts +1 -6
- package/dist/components/selected-outline-drag.js +22 -6
- package/dist/components/selected-outline-geometry.d.ts +2 -18
- package/dist/components/selected-outline-measurement.d.ts +23 -41
- package/dist/components/selected-outline-measurement.js +14 -252
- package/dist/components/selected-outline-order.d.ts +4 -11
- package/dist/components/selected-outline-order.js +2 -254
- package/dist/components/selected-outline-snap.d.ts +1 -1
- package/dist/components/selected-outline-snap.js +2 -1
- package/dist/components/selected-outline-types.d.ts +18 -28
- package/dist/components/selected-outline-uv.d.ts +4 -4
- package/dist/components/selected-outline-uv.js +6 -111
- package/dist/components/sequence-props-api.js +0 -10
- package/dist/components/use-selected-outline-control-target.js +12 -21
- package/dist/components/wrap-jsx-node-api.d.ts +2 -0
- package/dist/components/wrap-jsx-node-api.js +13 -0
- package/dist/error-overlay/remotion-overlay/OpenInEditor.js +45 -2
- package/dist/error-overlay/remotion-overlay/StackFrame.js +32 -3
- package/dist/esm/{CaptionQueueProcessor-k0yrm3dj.mjs → CaptionQueueProcessor-nr7hjcga.mjs} +96 -19
- package/dist/esm/LazyModels-ajkn7fs3.mjs +12 -0
- package/dist/esm/LazyModels-g1g7cf4e.mjs +12 -0
- package/dist/esm/{TranscriptionModal-ymnx1c7m.mjs → TranscriptionModal-e18bzbkb.mjs} +30 -22
- package/dist/esm/{VideoMattingModal-05vpczks.mjs → VideoMattingModal-5bz2s4rs.mjs} +47 -62
- package/dist/esm/{VideoMattingQueueProcessor-t1hgm2rm.mjs → VideoMattingQueueProcessor-4tkj0f4k.mjs} +69 -26
- package/dist/esm/{index-v4tr1bft.mjs → index-09txs1bj.mjs} +5 -0
- package/dist/esm/{index-4dsz9035.mjs → index-5ycb9e9q.mjs} +2 -4
- package/dist/esm/index-890dd9b3.mjs +768 -0
- package/dist/esm/{index-5bfxbpca.mjs → index-8nt6a0mw.mjs} +3 -3
- package/dist/esm/{index-5gd8k9yv.mjs → index-9q9w8v9p.mjs} +3 -3
- package/dist/esm/{index-x40wwfmt.mjs → index-c2wabcdt.mjs} +8 -6
- package/dist/esm/index-dfy1t576.mjs +129 -0
- package/dist/esm/index-dh3zk2hv.mjs +220 -0
- package/dist/esm/{index-0gewwxse.mjs → index-dpyss74p.mjs} +6179 -5011
- package/dist/esm/{index-9x6e1dq0.mjs → index-hqxc6tzp.mjs} +40 -6
- package/dist/esm/{index-cdy8v54v.mjs → index-qve7mdfp.mjs} +36 -539
- package/dist/esm/{index-eb5txqp6.mjs → index-s6qya2gg.mjs} +8 -88
- package/dist/esm/index-t7tbt980.mjs +103 -0
- package/dist/esm/{index-g7k2dvar.mjs → index-t7xnxdf8.mjs} +44 -26
- package/dist/esm/index-wqc43mw0.mjs +158 -0
- package/dist/esm/{index-bs39wngg.mjs → index-x6r9bn12.mjs} +5623 -6218
- package/dist/esm/{index-f97r9e2g.mjs → index-xac20sv4.mjs} +46 -57
- package/dist/esm/index.mjs +4 -4
- package/dist/esm/internals.mjs +13 -10
- package/dist/esm/previewEntry.mjs +18 -12
- package/dist/esm/renderEntry.mjs +5 -1
- package/dist/esm/{resolve-composition-component-location-bt2d6qxq.mjs → resolve-composition-component-location-2hgf6g0a.mjs} +1 -1
- package/dist/helpers/calculate-timeline.d.ts +5 -1
- package/dist/helpers/calculate-timeline.js +1 -1
- package/dist/helpers/checkerboard-background.d.ts +2 -2
- package/dist/helpers/colors.d.ts +132 -112
- package/dist/helpers/colors.js +117 -95
- package/dist/helpers/copy-text.js +1 -16
- package/dist/helpers/create-folder-tree.js +2 -1
- package/dist/helpers/editor-guide-selection.d.ts +1 -1
- package/dist/helpers/editor-ruler.js +23 -12
- package/dist/helpers/get-connected-compositions.d.ts +6 -1
- package/dist/helpers/get-connected-compositions.js +1 -1
- package/dist/helpers/get-sequence-double-click-action.js +1 -1
- package/dist/helpers/get-sequence-visible-range.d.ts +1 -1
- package/dist/helpers/get-sequence-visible-range.js +2 -5
- package/dist/helpers/get-timeline-nestedness.d.ts +1 -1
- package/dist/helpers/get-timeline-nestedness.js +1 -1
- package/dist/helpers/get-timeline-sequence-sort-key.d.ts +1 -1
- package/dist/helpers/get-timeline-sequence-sort-key.js +1 -1
- package/dist/helpers/hoverable.js +6 -5
- package/dist/helpers/inject-css.js +5 -7
- package/dist/helpers/open-in-editor.js +1 -1
- package/dist/helpers/prism-vsc-dark-plus.d.ts +1 -1
- package/dist/helpers/prism-vsc-dark-plus.js +52 -51
- package/dist/helpers/resolve-studio-color.d.ts +1 -0
- package/dist/helpers/resolve-studio-color.js +11 -0
- package/dist/helpers/studio-css-variables.d.ts +1 -0
- package/dist/helpers/studio-css-variables.js +105 -0
- package/dist/helpers/studio-pixel-ratio.d.ts +1 -0
- package/dist/helpers/studio-pixel-ratio.js +7 -0
- package/dist/helpers/studio-runtime-config.d.ts +1 -1
- package/dist/helpers/timeline-node-path-key.d.ts +1 -1
- package/dist/helpers/timeline-node-path-key.js +2 -2
- package/dist/helpers/use-keybinding.d.ts +1 -1
- package/dist/helpers/use-keyboard-shortcut-label.d.ts +2 -2
- package/dist/helpers/use-menu-structure.js +15 -9
- package/dist/helpers/use-runtime-values.js +2 -28
- package/dist/hot-middleware-client/client.js +5 -3
- package/dist/icons/align-center-horizontal.js +2 -1
- package/dist/icons/align-left.js +2 -1
- package/dist/icons/align-right.js +2 -1
- package/dist/icons/{separation.d.ts → background-removal.d.ts} +1 -1
- package/dist/icons/background-removal.js +9 -0
- package/dist/icons/wrap.d.ts +4 -0
- package/dist/icons/wrap.js +10 -0
- package/dist/previewEntry.js +2 -0
- package/dist/renderEntry.js +2 -0
- package/dist/state/modals.d.ts +20 -1
- package/dist/state/timeline-sequence-hover.d.ts +6 -16
- package/dist/state/timeline-sequence-hover.js +6 -67
- package/dist/state/timeline-zoom.js +4 -0
- package/package.json +20 -19
- package/dist/components/Timeline/get-easing-selection-after-keyframe-delete.d.ts +0 -15
- package/dist/components/Timeline/get-easing-selection-after-keyframe-delete.js +0 -31
- package/dist/components/delete-jsx-node-api.d.ts +0 -2
- package/dist/esm/LazyModels-mtggyjye.mjs +0 -11
- package/dist/esm/LazyModels-nk7py0zt.mjs +0 -11
- package/dist/esm/index-cw0pnpg5.mjs +0 -50
- package/dist/esm/index-k426ye99.mjs +0 -139
- package/dist/helpers/get-box-quads-polyfill-internals.d.ts +0 -82
- package/dist/helpers/get-box-quads-polyfill-internals.js +0 -2403
- package/dist/helpers/get-box-quads-ponyfill.d.ts +0 -10
- package/dist/helpers/get-box-quads-ponyfill.js +0 -23
- package/dist/icons/separation.js +0 -7
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { CanUpdateSequencePropStatus,
|
|
2
|
+
import type { CanUpdateSequencePropStatus, InteractivitySchema, OverrideIdToNodePaths, PropStatuses, SequencePropsSubscriptionKey, TSequence } from 'remotion';
|
|
3
3
|
import type { SequenceNodePathInfo } from '../../helpers/get-timeline-sequence-sort-key';
|
|
4
4
|
import type { MoveEffectKeyframeChange, MoveSequenceKeyframeChange } from './call-move-keyframe';
|
|
5
|
+
import { type TimelineSequenceEffectKeyframeDragTarget, type TimelineSequenceKeyframeDragTarget } from './get-keyframed-sequence-drag-targets';
|
|
5
6
|
import { type SaveSequencePropChange } from './save-sequence-prop';
|
|
6
7
|
export declare const timelineSequenceFromDragSnapThresholdPx = 10;
|
|
7
8
|
export type TimelineSequenceMediaDurationDragLimits = {
|
|
@@ -23,6 +24,7 @@ export declare const getTimelineSequenceMediaDurationDragLimits: ({ cascadedStar
|
|
|
23
24
|
readonly timelineDurationInFrames: number;
|
|
24
25
|
}) => TimelineSequenceMediaDurationDragLimits | null;
|
|
25
26
|
export type TimelineSequenceDurationDragTarget = {
|
|
27
|
+
readonly parentPlaybackRate: number;
|
|
26
28
|
readonly fileName: string;
|
|
27
29
|
readonly initialDuration: number;
|
|
28
30
|
readonly maximumDuration: number;
|
|
@@ -31,6 +33,7 @@ export type TimelineSequenceDurationDragTarget = {
|
|
|
31
33
|
readonly schema: InteractivitySchema;
|
|
32
34
|
};
|
|
33
35
|
export type TimelineSequenceLeftEdgeDragTarget = {
|
|
36
|
+
readonly parentPlaybackRate: number;
|
|
34
37
|
readonly fileName: string;
|
|
35
38
|
readonly initialDuration: number;
|
|
36
39
|
readonly initialFrom: number;
|
|
@@ -42,6 +45,7 @@ export type TimelineSequenceLeftEdgeDragTarget = {
|
|
|
42
45
|
readonly schema: InteractivitySchema;
|
|
43
46
|
};
|
|
44
47
|
export type TimelineSequenceFromDragTarget = {
|
|
48
|
+
readonly parentPlaybackRate: number;
|
|
45
49
|
readonly canSnapToTimelineStart: boolean;
|
|
46
50
|
readonly minimumDeltaFrames: number;
|
|
47
51
|
readonly initialTimelineStart: number;
|
|
@@ -51,17 +55,6 @@ export type TimelineSequenceFromDragTarget = {
|
|
|
51
55
|
readonly nodePath: SequencePropsSubscriptionKey;
|
|
52
56
|
readonly sequenceKeyframes: TimelineSequenceKeyframeDragTarget[];
|
|
53
57
|
};
|
|
54
|
-
type TimelineSequenceKeyframeDragTarget = {
|
|
55
|
-
readonly fileName: string;
|
|
56
|
-
readonly fieldKey: string;
|
|
57
|
-
readonly isDescendant: boolean;
|
|
58
|
-
readonly nodePath: SequencePropsSubscriptionKey;
|
|
59
|
-
readonly schema: InteractivitySchema;
|
|
60
|
-
readonly status: CanUpdateSequencePropStatusKeyframed;
|
|
61
|
-
};
|
|
62
|
-
type TimelineSequenceEffectKeyframeDragTarget = TimelineSequenceKeyframeDragTarget & {
|
|
63
|
-
readonly effectIndex: number;
|
|
64
|
-
};
|
|
65
58
|
export declare const isTransitionSeriesSequence: (sequence: TSequence) => boolean;
|
|
66
59
|
export declare const isCascadingSequence: (sequence: TSequence) => boolean;
|
|
67
60
|
export declare const isTimelineSequenceDurationDraggable: (sequence: TSequence) => boolean;
|
|
@@ -149,9 +142,12 @@ export declare const getTimelineSequenceFromDragTargets: ({ draggedNodePathInfo,
|
|
|
149
142
|
readonly propStatuses: PropStatuses;
|
|
150
143
|
}) => TimelineSequenceFromDragTarget[] | null;
|
|
151
144
|
export declare const TimelineSequenceLeftEdgeDragHandle: React.NamedExoticComponent<{
|
|
145
|
+
readonly cursor: "e-resize" | "ew-resize";
|
|
152
146
|
readonly nodePathInfo: SequenceNodePathInfo;
|
|
153
147
|
readonly windowWidth: number;
|
|
154
148
|
readonly timelineDurationInFrames: number;
|
|
149
|
+
readonly initialEdgeFrame: number;
|
|
150
|
+
readonly fps: number;
|
|
155
151
|
readonly onDragEnd: (wasDragged: boolean) => void;
|
|
156
152
|
readonly onSelect: (interaction?: import("@remotion/canvas").CanvasSelectionInteraction | undefined) => void;
|
|
157
153
|
readonly selected: boolean;
|
|
@@ -165,12 +161,14 @@ export declare const useTimelineSequenceFromDrag: ({ nodePathInfo, windowWidth,
|
|
|
165
161
|
onPointerDown: (e: React.PointerEvent<HTMLDivElement>) => void;
|
|
166
162
|
};
|
|
167
163
|
export declare const TimelineSequenceRightEdgeDragHandle: React.NamedExoticComponent<{
|
|
164
|
+
readonly cursor: "ew-resize" | "w-resize";
|
|
168
165
|
readonly nodePathInfo: SequenceNodePathInfo;
|
|
169
166
|
readonly mediaDurationDragLimits: TimelineSequenceMediaDurationDragLimits | null;
|
|
170
167
|
readonly windowWidth: number;
|
|
171
168
|
readonly timelineDurationInFrames: number;
|
|
169
|
+
readonly initialEdgeFrame: number;
|
|
170
|
+
readonly fps: number;
|
|
172
171
|
readonly onDragEnd: (wasDragged: boolean) => void;
|
|
173
172
|
readonly onSelect: (interaction?: import("@remotion/canvas").CanvasSelectionInteraction | undefined) => void;
|
|
174
173
|
readonly selected: boolean;
|
|
175
174
|
}>;
|
|
176
|
-
export {};
|
|
@@ -47,8 +47,11 @@ const pointer_session_1 = require("../../helpers/pointer-session");
|
|
|
47
47
|
const timeline_layout_1 = require("../../helpers/timeline-layout");
|
|
48
48
|
const editor_snapping_1 = require("../../state/editor-snapping");
|
|
49
49
|
const ForceSpecificCursor_1 = require("../ForceSpecificCursor");
|
|
50
|
+
const get_keyframed_sequence_drag_targets_1 = require("./get-keyframed-sequence-drag-targets");
|
|
50
51
|
const save_sequence_prop_1 = require("./save-sequence-prop");
|
|
51
52
|
const TimelineSelection_1 = require("./TimelineSelection");
|
|
53
|
+
const TimelineTrimTooltip_1 = require("./TimelineTrimTooltip");
|
|
54
|
+
const { getParentSequencePlaybackRate, sortItemsByCommitOrder } = canvas_1.CanvasInternals;
|
|
52
55
|
const HANDLE_INSET = 6;
|
|
53
56
|
const HANDLE_OUTSET = 8;
|
|
54
57
|
const timelineSequenceEdgeDragThresholdPx = 4;
|
|
@@ -97,58 +100,9 @@ const baseStyle = {
|
|
|
97
100
|
bottom: 0,
|
|
98
101
|
// Keep the middle half of narrow layers available for moving.
|
|
99
102
|
width: `calc(${HANDLE_OUTSET}px + min(${HANDLE_INSET}px, 25%))`,
|
|
100
|
-
cursor: 'ew-resize',
|
|
101
103
|
zIndex: 1,
|
|
102
104
|
touchAction: 'none',
|
|
103
105
|
};
|
|
104
|
-
const getKeyframedSequenceDragTargets = ({ nodePath, sequence, propStatuses, isDescendant, }) => {
|
|
105
|
-
var _a;
|
|
106
|
-
const status = propStatuses[remotion_1.Internals.makeSequencePropsSubscriptionKey(nodePath)];
|
|
107
|
-
if (status === null || status === undefined || !status.canUpdate) {
|
|
108
|
-
return { effectKeyframes: [], sequenceKeyframes: [] };
|
|
109
|
-
}
|
|
110
|
-
const sequenceSchema = (_a = sequence.controls) === null || _a === void 0 ? void 0 : _a.schema;
|
|
111
|
-
const sequenceKeyframes = sequenceSchema === undefined
|
|
112
|
-
? []
|
|
113
|
-
: Object.entries(status.props).flatMap(([fieldKey, propStatus]) => propStatus.status === 'keyframed' &&
|
|
114
|
-
(!isDescendant || propStatus.keyframeDisplayOffsetAdjustment !== null)
|
|
115
|
-
? [
|
|
116
|
-
{
|
|
117
|
-
fileName: nodePath.absolutePath,
|
|
118
|
-
fieldKey,
|
|
119
|
-
isDescendant,
|
|
120
|
-
nodePath,
|
|
121
|
-
schema: sequenceSchema,
|
|
122
|
-
status: propStatus,
|
|
123
|
-
},
|
|
124
|
-
]
|
|
125
|
-
: []);
|
|
126
|
-
const effectKeyframes = status.effects.flatMap((effectStatus) => {
|
|
127
|
-
var _a;
|
|
128
|
-
if (!effectStatus.canUpdate) {
|
|
129
|
-
return [];
|
|
130
|
-
}
|
|
131
|
-
const effectSchema = (_a = sequence.effects[effectStatus.effectIndex]) === null || _a === void 0 ? void 0 : _a.schema;
|
|
132
|
-
if (effectSchema === undefined) {
|
|
133
|
-
return [];
|
|
134
|
-
}
|
|
135
|
-
return Object.entries(effectStatus.props).flatMap(([fieldKey, propStatus]) => propStatus.status === 'keyframed' &&
|
|
136
|
-
(!isDescendant || propStatus.keyframeDisplayOffsetAdjustment !== null)
|
|
137
|
-
? [
|
|
138
|
-
{
|
|
139
|
-
effectIndex: effectStatus.effectIndex,
|
|
140
|
-
fileName: nodePath.absolutePath,
|
|
141
|
-
fieldKey,
|
|
142
|
-
isDescendant,
|
|
143
|
-
nodePath,
|
|
144
|
-
schema: effectSchema,
|
|
145
|
-
status: propStatus,
|
|
146
|
-
},
|
|
147
|
-
]
|
|
148
|
-
: []);
|
|
149
|
-
});
|
|
150
|
-
return { effectKeyframes, sequenceKeyframes };
|
|
151
|
-
};
|
|
152
106
|
const shiftKeyframedStatus = ({ status, deltaFrames, isDescendant, }) => {
|
|
153
107
|
if (isDescendant) {
|
|
154
108
|
const adjustment = status.keyframeDisplayOffsetAdjustment;
|
|
@@ -209,7 +163,7 @@ const getMinimumSequenceDuration = ({ sequence, sequences, }) => {
|
|
|
209
163
|
if (!(0, exports.isTransitionSeriesSequence)(sequence)) {
|
|
210
164
|
return 1;
|
|
211
165
|
}
|
|
212
|
-
const siblings =
|
|
166
|
+
const siblings = sortItemsByCommitOrder(sequences.filter((candidate) => candidate.parent === sequence.parent &&
|
|
213
167
|
((0, exports.isTransitionSeriesSequence)(candidate) ||
|
|
214
168
|
isTransitionSeriesTransition(candidate))), (candidate) => candidate.timelineOrder);
|
|
215
169
|
const sequenceIndex = siblings.findIndex((candidate) => candidate.id === sequence.id);
|
|
@@ -256,7 +210,7 @@ const getTrimBeforePlaybackRate = (sequence) => {
|
|
|
256
210
|
if (componentIdentity === null ||
|
|
257
211
|
componentIdentity === undefined ||
|
|
258
212
|
!playbackRateComponentIdentities.has(componentIdentity)) {
|
|
259
|
-
return
|
|
213
|
+
return sequence.sequencePlaybackRate;
|
|
260
214
|
}
|
|
261
215
|
const runtimePlaybackRate = (_b = sequence.controls) === null || _b === void 0 ? void 0 : _b.runtimeValues.getSnapshot().playbackRate;
|
|
262
216
|
return typeof runtimePlaybackRate === 'number' ? runtimePlaybackRate : 1;
|
|
@@ -298,7 +252,7 @@ const getTimelineSequenceLeftEdgeDragChanges = ({ targets, deltaFrames, }) => {
|
|
|
298
252
|
initialDuration: target.initialDuration,
|
|
299
253
|
initialFrom: target.initialFrom,
|
|
300
254
|
initialTrimBefore: target.initialTrimBefore,
|
|
301
|
-
deltaFrames,
|
|
255
|
+
deltaFrames: deltaFrames * target.parentPlaybackRate,
|
|
302
256
|
playbackRate: target.playbackRate,
|
|
303
257
|
minimumDuration: target.minimumDuration,
|
|
304
258
|
});
|
|
@@ -342,7 +296,7 @@ const getTimelineSequenceDurationDragChanges = ({ targets, deltaFrames, }) => {
|
|
|
342
296
|
return targets.flatMap((target) => {
|
|
343
297
|
const nextValue = (0, exports.getTimelineSequenceDurationDragValue)({
|
|
344
298
|
initialDuration: target.initialDuration,
|
|
345
|
-
deltaFrames,
|
|
299
|
+
deltaFrames: deltaFrames * target.parentPlaybackRate,
|
|
346
300
|
maximumDuration: target.maximumDuration,
|
|
347
301
|
minimumDuration: target.minimumDuration,
|
|
348
302
|
});
|
|
@@ -373,15 +327,15 @@ const getTimelineSequenceFromDragDelta = ({ deltaFrames, timelineDurationInFrame
|
|
|
373
327
|
}
|
|
374
328
|
const nextFrom = (0, exports.getTimelineSequenceFromDragValue)({
|
|
375
329
|
initialFrom: target.initialFrom,
|
|
376
|
-
deltaFrames,
|
|
330
|
+
deltaFrames: deltaFrames * target.parentPlaybackRate,
|
|
377
331
|
});
|
|
378
|
-
const distancePx = Math.abs(nextFrom * pxPerFrame);
|
|
332
|
+
const distancePx = Math.abs((nextFrom / target.parentPlaybackRate) * pxPerFrame);
|
|
379
333
|
if (distancePx > exports.timelineSequenceFromDragSnapThresholdPx ||
|
|
380
334
|
(closestSnap && closestSnap.distancePx <= distancePx)) {
|
|
381
335
|
continue;
|
|
382
336
|
}
|
|
383
337
|
closestSnap = {
|
|
384
|
-
deltaFrames: -target.initialFrom,
|
|
338
|
+
deltaFrames: -target.initialFrom / target.parentPlaybackRate,
|
|
385
339
|
distancePx,
|
|
386
340
|
};
|
|
387
341
|
}
|
|
@@ -395,7 +349,7 @@ const getTimelineSequenceFromDragChanges = ({ targets, deltaFrames, }) => {
|
|
|
395
349
|
return targets.flatMap((target) => {
|
|
396
350
|
const nextValue = (0, exports.getTimelineSequenceFromDragValue)({
|
|
397
351
|
initialFrom: target.initialFrom,
|
|
398
|
-
deltaFrames,
|
|
352
|
+
deltaFrames: deltaFrames * target.parentPlaybackRate,
|
|
399
353
|
});
|
|
400
354
|
if (nextValue === target.initialFrom) {
|
|
401
355
|
return [];
|
|
@@ -423,10 +377,10 @@ const getTimelineSequenceFromDragKeyframeMoves = ({ targets, deltaFrames, }) =>
|
|
|
423
377
|
nodePath: keyframeTarget.nodePath,
|
|
424
378
|
fieldKey: keyframeTarget.fieldKey,
|
|
425
379
|
fromFrame: keyframe.frame,
|
|
426
|
-
toFrame: keyframe.frame + deltaFrames,
|
|
380
|
+
toFrame: keyframe.frame + deltaFrames * keyframeTarget.parentPlaybackRate,
|
|
427
381
|
schema: keyframeTarget.schema,
|
|
428
382
|
keyframeDisplayOffsetAdjustmentDelta: keyframeTarget.isDescendant
|
|
429
|
-
? -deltaFrames
|
|
383
|
+
? -deltaFrames * keyframeTarget.parentPlaybackRate
|
|
430
384
|
: undefined,
|
|
431
385
|
})))),
|
|
432
386
|
effectKeyframes: targets.flatMap((target) => target.effectKeyframes.flatMap((keyframeTarget) => keyframeTarget.status.keyframes.map((keyframe) => ({
|
|
@@ -435,10 +389,10 @@ const getTimelineSequenceFromDragKeyframeMoves = ({ targets, deltaFrames, }) =>
|
|
|
435
389
|
effectIndex: keyframeTarget.effectIndex,
|
|
436
390
|
fieldKey: keyframeTarget.fieldKey,
|
|
437
391
|
fromFrame: keyframe.frame,
|
|
438
|
-
toFrame: keyframe.frame + deltaFrames,
|
|
392
|
+
toFrame: keyframe.frame + deltaFrames * keyframeTarget.parentPlaybackRate,
|
|
439
393
|
schema: keyframeTarget.schema,
|
|
440
394
|
keyframeDisplayOffsetAdjustmentDelta: keyframeTarget.isDescendant
|
|
441
|
-
? -deltaFrames
|
|
395
|
+
? -deltaFrames * keyframeTarget.parentPlaybackRate
|
|
442
396
|
: undefined,
|
|
443
397
|
})))),
|
|
444
398
|
};
|
|
@@ -455,7 +409,7 @@ const findSequenceTrack = ({ tracks, nodePathInfo, }) => {
|
|
|
455
409
|
};
|
|
456
410
|
const getTimelineSequenceDurationDragTargets = ({ draggedNodePathInfo, draggedSequenceMediaDurationDragLimits, selectedSequenceMediaDurationDragLimits, selectedItems, sequences, overrideIdsToNodePaths, propStatuses, timelineDurationInFrames, }) => {
|
|
457
411
|
var _a;
|
|
458
|
-
var _b
|
|
412
|
+
var _b;
|
|
459
413
|
const draggedSelectionKey = (0, TimelineSelection_1.getTimelineSequenceSelectionKey)(draggedNodePathInfo);
|
|
460
414
|
const selectedSequenceItems = selectedItems.filter((item) => item.type === 'sequence');
|
|
461
415
|
const draggedItemIsSelected = selectedSequenceItems.some((item) => (0, TimelineSelection_1.getTimelineSequenceSelectionKey)(item.nodePathInfo) ===
|
|
@@ -505,12 +459,18 @@ const getTimelineSequenceDurationDragTargets = ({ draggedNodePathInfo, draggedSe
|
|
|
505
459
|
return null;
|
|
506
460
|
}
|
|
507
461
|
const minimumDuration = Math.max(1 - originalSequence.from, getMinimumSequenceDuration({ sequence: originalSequence, sequences }));
|
|
508
|
-
const initialDuration =
|
|
509
|
-
|
|
462
|
+
const initialDuration = mediaDurationDragLimits
|
|
463
|
+
? mediaDurationDragLimits.initialDuration * track.keyframePlaybackRate
|
|
464
|
+
: originalSequence.duration;
|
|
465
|
+
const constrainedMaximumDuration = Math.min(mediaDurationDragLimits
|
|
466
|
+
? mediaDurationDragLimits.maximumDuration * track.keyframePlaybackRate
|
|
467
|
+
: Infinity, (timelineDurationInFrames - track.cascadedStart) *
|
|
468
|
+
track.keyframePlaybackRate);
|
|
510
469
|
const maximumDuration = isMedia
|
|
511
470
|
? Math.max(minimumDuration, initialDuration, constrainedMaximumDuration)
|
|
512
471
|
: Math.max(minimumDuration, constrainedMaximumDuration);
|
|
513
472
|
targets.set(key, {
|
|
473
|
+
parentPlaybackRate: getParentSequencePlaybackRate(originalSequence, sequences),
|
|
514
474
|
fileName: nodePath.absolutePath,
|
|
515
475
|
initialDuration,
|
|
516
476
|
maximumDuration,
|
|
@@ -565,6 +525,7 @@ const getTimelineSequenceLeftEdgeDragTargets = ({ draggedNodePathInfo, selectedI
|
|
|
565
525
|
const key = (0, studio_shared_1.stringifySequenceSubscriptionKey)(nodePath);
|
|
566
526
|
if (!targets.has(key)) {
|
|
567
527
|
targets.set(key, {
|
|
528
|
+
parentPlaybackRate: getParentSequencePlaybackRate(originalSequence, sequences),
|
|
568
529
|
fileName: nodePath.absolutePath,
|
|
569
530
|
initialDuration: originalSequence.duration,
|
|
570
531
|
initialFrom: positionField === 'from' ? originalSequence.from : 0,
|
|
@@ -669,9 +630,10 @@ const getTimelineSequenceFromDragTargets = ({ draggedNodePathInfo, selectedItems
|
|
|
669
630
|
}
|
|
670
631
|
includedKeyframeNodePaths.add(descendantNodePathKey);
|
|
671
632
|
return [
|
|
672
|
-
getKeyframedSequenceDragTargets({
|
|
633
|
+
(0, get_keyframed_sequence_drag_targets_1.getKeyframedSequenceDragTargets)({
|
|
673
634
|
nodePath: descendantNodePath,
|
|
674
635
|
sequence,
|
|
636
|
+
sequences,
|
|
675
637
|
propStatuses,
|
|
676
638
|
isDescendant: sequence.id !== originalSequence.id,
|
|
677
639
|
}),
|
|
@@ -680,8 +642,10 @@ const getTimelineSequenceFromDragTargets = ({ draggedNodePathInfo, selectedItems
|
|
|
680
642
|
const effectKeyframes = descendantKeyframes.flatMap((descendant) => descendant.effectKeyframes);
|
|
681
643
|
const sequenceKeyframes = descendantKeyframes.flatMap((descendant) => descendant.sequenceKeyframes);
|
|
682
644
|
targets.set(key, {
|
|
645
|
+
parentPlaybackRate: getParentSequencePlaybackRate(originalSequence, sequences),
|
|
683
646
|
canSnapToTimelineStart: originalSequence.parent === null,
|
|
684
|
-
minimumDeltaFrames: 1 - originalSequence.duration - originalSequence.from
|
|
647
|
+
minimumDeltaFrames: (1 - originalSequence.duration - originalSequence.from) /
|
|
648
|
+
getParentSequencePlaybackRate(originalSequence, sequences),
|
|
685
649
|
initialTimelineStart,
|
|
686
650
|
effectKeyframes,
|
|
687
651
|
fileName: nodePath.absolutePath,
|
|
@@ -721,17 +685,19 @@ const clearFromDragOverrides = ({ clearDragOverrides, clearEffectDragOverrides,
|
|
|
721
685
|
}
|
|
722
686
|
}
|
|
723
687
|
};
|
|
724
|
-
const TimelineSequenceLeftEdgeDragHandleInner = ({ nodePathInfo, windowWidth, timelineDurationInFrames, onDragEnd, onSelect, selected, }) => {
|
|
688
|
+
const TimelineSequenceLeftEdgeDragHandleInner = ({ cursor, nodePathInfo, windowWidth, timelineDurationInFrames, initialEdgeFrame, fps, onDragEnd, onSelect, selected, }) => {
|
|
725
689
|
const { setPropStatuses, setDragOverrides, clearDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
|
|
726
690
|
const propStatusesRef = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesRefContext);
|
|
727
691
|
const sequencesRef = (0, react_1.useContext)(remotion_1.Internals.SequenceManagerRefContext);
|
|
728
692
|
const { overrideIdToNodePathMappings } = (0, react_1.useContext)(remotion_1.Internals.OverrideIdsToNodePathsGettersContext);
|
|
729
693
|
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
730
694
|
const currentSelection = (0, TimelineSelection_1.useCurrentTimelineSelectionStateAsRef)();
|
|
695
|
+
const [trimTooltip, setTrimTooltip] = (0, react_1.useState)(null);
|
|
731
696
|
const stopPointerSessionRef = (0, react_1.useRef)(null);
|
|
732
697
|
const dragStateRef = (0, react_1.useRef)(null);
|
|
733
698
|
const latestRef = (0, react_1.useRef)({
|
|
734
699
|
nodePathInfo,
|
|
700
|
+
initialEdgeFrame,
|
|
735
701
|
setPropStatuses,
|
|
736
702
|
setDragOverrides,
|
|
737
703
|
clearDragOverrides,
|
|
@@ -742,6 +708,7 @@ const TimelineSequenceLeftEdgeDragHandleInner = ({ nodePathInfo, windowWidth, ti
|
|
|
742
708
|
});
|
|
743
709
|
latestRef.current = {
|
|
744
710
|
nodePathInfo,
|
|
711
|
+
initialEdgeFrame,
|
|
745
712
|
setPropStatuses,
|
|
746
713
|
setDragOverrides,
|
|
747
714
|
clearDragOverrides,
|
|
@@ -756,6 +723,7 @@ const TimelineSequenceLeftEdgeDragHandleInner = ({ nodePathInfo, windowWidth, ti
|
|
|
756
723
|
return;
|
|
757
724
|
}
|
|
758
725
|
dragStateRef.current = null;
|
|
726
|
+
setTrimTooltip(null);
|
|
759
727
|
latestRef.current.onDragEnd(dragState.didMove);
|
|
760
728
|
document.body.style.userSelect = '';
|
|
761
729
|
document.body.style.webkitUserSelect = '';
|
|
@@ -833,6 +801,11 @@ const TimelineSequenceLeftEdgeDragHandleInner = ({ nodePathInfo, windowWidth, ti
|
|
|
833
801
|
propStatuses: propStatusesRef.current,
|
|
834
802
|
})) !== null && _b !== void 0 ? _b : [])
|
|
835
803
|
: [];
|
|
804
|
+
const draggedKey = (0, studio_shared_1.stringifySequenceSubscriptionKey)(latestNodePathInfo.sequenceSubscriptionKey);
|
|
805
|
+
const draggedTarget = targets.find((target) => (0, studio_shared_1.stringifySequenceSubscriptionKey)(target.nodePath) === draggedKey);
|
|
806
|
+
const handleRect = e.currentTarget.getBoundingClientRect();
|
|
807
|
+
const initialEdgeClientY = handleRect.top;
|
|
808
|
+
const initialTimelineEdge = latestRef.current.initialEdgeFrame;
|
|
836
809
|
(_a = stopPointerSessionRef.current) === null || _a === void 0 ? void 0 : _a.call(stopPointerSessionRef);
|
|
837
810
|
dragStateRef.current = {
|
|
838
811
|
initialClientX: e.clientX,
|
|
@@ -845,7 +818,7 @@ const TimelineSequenceLeftEdgeDragHandleInner = ({ nodePathInfo, windowWidth, ti
|
|
|
845
818
|
};
|
|
846
819
|
document.body.style.userSelect = 'none';
|
|
847
820
|
document.body.style.webkitUserSelect = 'none';
|
|
848
|
-
(0, ForceSpecificCursor_1.forceSpecificCursor)(
|
|
821
|
+
(0, ForceSpecificCursor_1.forceSpecificCursor)(cursor);
|
|
849
822
|
const onMove = (pointerEvent) => {
|
|
850
823
|
const dragState = dragStateRef.current;
|
|
851
824
|
if (!dragState || pointerEvent.pointerId !== dragState.pointerId) {
|
|
@@ -866,7 +839,7 @@ const TimelineSequenceLeftEdgeDragHandleInner = ({ nodePathInfo, windowWidth, ti
|
|
|
866
839
|
initialDuration: target.initialDuration,
|
|
867
840
|
initialFrom: target.initialFrom,
|
|
868
841
|
initialTrimBefore: target.initialTrimBefore,
|
|
869
|
-
deltaFrames,
|
|
842
|
+
deltaFrames: deltaFrames * target.parentPlaybackRate,
|
|
870
843
|
playbackRate: target.playbackRate,
|
|
871
844
|
minimumDuration: target.minimumDuration,
|
|
872
845
|
});
|
|
@@ -876,6 +849,24 @@ const TimelineSequenceLeftEdgeDragHandleInner = ({ nodePathInfo, windowWidth, ti
|
|
|
876
849
|
latestRef.current.setDragOverrides(target.nodePath, 'durationInFrames', remotion_1.Internals.makeStaticDragOverride(nextValues.durationInFrames));
|
|
877
850
|
latestRef.current.setDragOverrides(target.nodePath, 'trimBefore', remotion_1.Internals.makeStaticDragOverride(nextValues.trimBefore));
|
|
878
851
|
}
|
|
852
|
+
if (dragState.didMove && draggedTarget) {
|
|
853
|
+
const values = (0, exports.getTimelineSequenceLeftEdgeDragValues)({
|
|
854
|
+
initialDuration: draggedTarget.initialDuration,
|
|
855
|
+
initialFrom: draggedTarget.initialFrom,
|
|
856
|
+
initialTrimBefore: draggedTarget.initialTrimBefore,
|
|
857
|
+
deltaFrames,
|
|
858
|
+
playbackRate: draggedTarget.playbackRate,
|
|
859
|
+
minimumDuration: draggedTarget.minimumDuration,
|
|
860
|
+
});
|
|
861
|
+
const appliedDelta = values.from - draggedTarget.initialFrom;
|
|
862
|
+
const edgeDelta = draggedTarget.positionField === null ? 0 : appliedDelta;
|
|
863
|
+
setTrimTooltip({
|
|
864
|
+
deltaFrames: appliedDelta,
|
|
865
|
+
edgeFrame: initialTimelineEdge + edgeDelta,
|
|
866
|
+
x: pointerEvent.clientX,
|
|
867
|
+
y: initialEdgeClientY,
|
|
868
|
+
});
|
|
869
|
+
}
|
|
879
870
|
};
|
|
880
871
|
const onUp = (pointerEvent) => {
|
|
881
872
|
const dragState = dragStateRef.current;
|
|
@@ -912,6 +903,7 @@ const TimelineSequenceLeftEdgeDragHandleInner = ({ nodePathInfo, windowWidth, ti
|
|
|
912
903
|
});
|
|
913
904
|
}, [
|
|
914
905
|
currentSelection,
|
|
906
|
+
cursor,
|
|
915
907
|
finishDrag,
|
|
916
908
|
propStatusesRef,
|
|
917
909
|
selected,
|
|
@@ -929,9 +921,11 @@ const TimelineSequenceLeftEdgeDragHandleInner = ({ nodePathInfo, windowWidth, ti
|
|
|
929
921
|
const style = {
|
|
930
922
|
...baseStyle,
|
|
931
923
|
left: -HANDLE_OUTSET,
|
|
924
|
+
cursor,
|
|
932
925
|
background: colors_1.TRANSPARENT,
|
|
933
926
|
};
|
|
934
|
-
return (jsx_runtime_1.
|
|
927
|
+
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
928
|
+
jsx_runtime_1.jsx("div", { role: "separator", "aria-orientation": "vertical", title: "Drag to trim start", style: style, onPointerDown: onPointerDown }), trimTooltip === null ? null : (jsx_runtime_1.jsx(TimelineTrimTooltip_1.TimelineTrimTooltip, { state: trimTooltip, fps: fps }))] }));
|
|
935
929
|
};
|
|
936
930
|
exports.TimelineSequenceLeftEdgeDragHandle = react_1.default.memo(TimelineSequenceLeftEdgeDragHandleInner);
|
|
937
931
|
const useTimelineSequenceFromDrag = ({ nodePathInfo, windowWidth, timelineDurationInFrames, onDragEnd, }) => {
|
|
@@ -1092,7 +1086,7 @@ const useTimelineSequenceFromDrag = ({ nodePathInfo, windowWidth, timelineDurati
|
|
|
1092
1086
|
for (const target of dragState.targets) {
|
|
1093
1087
|
const nextFrom = (0, exports.getTimelineSequenceFromDragValue)({
|
|
1094
1088
|
initialFrom: target.initialFrom,
|
|
1095
|
-
deltaFrames,
|
|
1089
|
+
deltaFrames: deltaFrames * target.parentPlaybackRate,
|
|
1096
1090
|
});
|
|
1097
1091
|
latestRef.current.setDragOverrides(target.nodePath, 'from', remotion_1.Internals.makeStaticDragOverride(nextFrom));
|
|
1098
1092
|
for (const keyframeTarget of target.sequenceKeyframes) {
|
|
@@ -1100,7 +1094,7 @@ const useTimelineSequenceFromDrag = ({ nodePathInfo, windowWidth, timelineDurati
|
|
|
1100
1094
|
type: 'keyframed',
|
|
1101
1095
|
status: shiftKeyframedStatus({
|
|
1102
1096
|
status: keyframeTarget.status,
|
|
1103
|
-
deltaFrames,
|
|
1097
|
+
deltaFrames: deltaFrames * keyframeTarget.parentPlaybackRate,
|
|
1104
1098
|
isDescendant: keyframeTarget.isDescendant,
|
|
1105
1099
|
}),
|
|
1106
1100
|
});
|
|
@@ -1110,7 +1104,7 @@ const useTimelineSequenceFromDrag = ({ nodePathInfo, windowWidth, timelineDurati
|
|
|
1110
1104
|
type: 'keyframed',
|
|
1111
1105
|
status: shiftKeyframedStatus({
|
|
1112
1106
|
status: keyframeTarget.status,
|
|
1113
|
-
deltaFrames,
|
|
1107
|
+
deltaFrames: deltaFrames * keyframeTarget.parentPlaybackRate,
|
|
1114
1108
|
isDescendant: keyframeTarget.isDescendant,
|
|
1115
1109
|
}),
|
|
1116
1110
|
});
|
|
@@ -1142,7 +1136,7 @@ const useTimelineSequenceFromDrag = ({ nodePathInfo, windowWidth, timelineDurati
|
|
|
1142
1136
|
};
|
|
1143
1137
|
};
|
|
1144
1138
|
exports.useTimelineSequenceFromDrag = useTimelineSequenceFromDrag;
|
|
1145
|
-
const TimelineSequenceRightEdgeDragHandleInner = ({ nodePathInfo, mediaDurationDragLimits, windowWidth, timelineDurationInFrames, onDragEnd, onSelect, selected, }) => {
|
|
1139
|
+
const TimelineSequenceRightEdgeDragHandleInner = ({ cursor, nodePathInfo, mediaDurationDragLimits, windowWidth, timelineDurationInFrames, initialEdgeFrame, fps, onDragEnd, onSelect, selected, }) => {
|
|
1146
1140
|
const { setPropStatuses, setDragOverrides, clearDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
|
|
1147
1141
|
const propStatusesRef = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesRefContext);
|
|
1148
1142
|
const sequencesRef = (0, react_1.useContext)(remotion_1.Internals.SequenceManagerRefContext);
|
|
@@ -1150,12 +1144,14 @@ const TimelineSequenceRightEdgeDragHandleInner = ({ nodePathInfo, mediaDurationD
|
|
|
1150
1144
|
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
1151
1145
|
const currentSelection = (0, TimelineSelection_1.useCurrentTimelineSelectionStateAsRef)();
|
|
1152
1146
|
const mediaDurationDragLimitsRegistry = (0, react_1.useContext)(exports.TimelineSequenceMediaDurationDragLimitsContext);
|
|
1147
|
+
const [trimTooltip, setTrimTooltip] = (0, react_1.useState)(null);
|
|
1153
1148
|
const stopPointerSessionRef = (0, react_1.useRef)(null);
|
|
1154
1149
|
const dragStateRef = (0, react_1.useRef)(null);
|
|
1155
1150
|
// Keep latest props/setters available to window listeners installed once at pointerdown.
|
|
1156
1151
|
const latestRef = (0, react_1.useRef)({
|
|
1157
1152
|
nodePathInfo,
|
|
1158
1153
|
mediaDurationDragLimits,
|
|
1154
|
+
initialEdgeFrame,
|
|
1159
1155
|
setPropStatuses,
|
|
1160
1156
|
setDragOverrides,
|
|
1161
1157
|
clearDragOverrides,
|
|
@@ -1167,6 +1163,7 @@ const TimelineSequenceRightEdgeDragHandleInner = ({ nodePathInfo, mediaDurationD
|
|
|
1167
1163
|
latestRef.current = {
|
|
1168
1164
|
nodePathInfo,
|
|
1169
1165
|
mediaDurationDragLimits,
|
|
1166
|
+
initialEdgeFrame,
|
|
1170
1167
|
setPropStatuses,
|
|
1171
1168
|
setDragOverrides,
|
|
1172
1169
|
clearDragOverrides,
|
|
@@ -1181,6 +1178,7 @@ const TimelineSequenceRightEdgeDragHandleInner = ({ nodePathInfo, mediaDurationD
|
|
|
1181
1178
|
return;
|
|
1182
1179
|
}
|
|
1183
1180
|
dragStateRef.current = null;
|
|
1181
|
+
setTrimTooltip(null);
|
|
1184
1182
|
latestRef.current.onDragEnd(dragState.didMove);
|
|
1185
1183
|
document.body.style.userSelect = '';
|
|
1186
1184
|
document.body.style.webkitUserSelect = '';
|
|
@@ -1259,6 +1257,11 @@ const TimelineSequenceRightEdgeDragHandleInner = ({ nodePathInfo, mediaDurationD
|
|
|
1259
1257
|
timelineDurationInFrames,
|
|
1260
1258
|
})) !== null && _c !== void 0 ? _c : [])
|
|
1261
1259
|
: [];
|
|
1260
|
+
const draggedKey = (0, studio_shared_1.stringifySequenceSubscriptionKey)(latestNodePathInfo.sequenceSubscriptionKey);
|
|
1261
|
+
const draggedTarget = targets.find((target) => (0, studio_shared_1.stringifySequenceSubscriptionKey)(target.nodePath) === draggedKey);
|
|
1262
|
+
const handleRect = e.currentTarget.getBoundingClientRect();
|
|
1263
|
+
const initialEdgeClientY = handleRect.top;
|
|
1264
|
+
const initialTimelineEdge = latestRef.current.initialEdgeFrame;
|
|
1262
1265
|
(_a = stopPointerSessionRef.current) === null || _a === void 0 ? void 0 : _a.call(stopPointerSessionRef);
|
|
1263
1266
|
dragStateRef.current = {
|
|
1264
1267
|
initialClientX: e.clientX,
|
|
@@ -1271,7 +1274,7 @@ const TimelineSequenceRightEdgeDragHandleInner = ({ nodePathInfo, mediaDurationD
|
|
|
1271
1274
|
};
|
|
1272
1275
|
document.body.style.userSelect = 'none';
|
|
1273
1276
|
document.body.style.webkitUserSelect = 'none';
|
|
1274
|
-
(0, ForceSpecificCursor_1.forceSpecificCursor)(
|
|
1277
|
+
(0, ForceSpecificCursor_1.forceSpecificCursor)(cursor);
|
|
1275
1278
|
const onMove = (pointerEvent) => {
|
|
1276
1279
|
const dragState = dragStateRef.current;
|
|
1277
1280
|
if (!dragState || pointerEvent.pointerId !== dragState.pointerId) {
|
|
@@ -1290,12 +1293,27 @@ const TimelineSequenceRightEdgeDragHandleInner = ({ nodePathInfo, mediaDurationD
|
|
|
1290
1293
|
for (const target of dragState.targets) {
|
|
1291
1294
|
const previewValue = (0, exports.getTimelineSequenceDurationDragValue)({
|
|
1292
1295
|
initialDuration: target.initialDuration,
|
|
1293
|
-
deltaFrames,
|
|
1296
|
+
deltaFrames: deltaFrames * target.parentPlaybackRate,
|
|
1294
1297
|
maximumDuration: target.maximumDuration,
|
|
1295
1298
|
minimumDuration: target.minimumDuration,
|
|
1296
1299
|
});
|
|
1297
1300
|
latestRef.current.setDragOverrides(target.nodePath, 'durationInFrames', remotion_1.Internals.makeStaticDragOverride(previewValue));
|
|
1298
1301
|
}
|
|
1302
|
+
if (dragState.didMove && draggedTarget) {
|
|
1303
|
+
const previewValue = (0, exports.getTimelineSequenceDurationDragValue)({
|
|
1304
|
+
initialDuration: draggedTarget.initialDuration,
|
|
1305
|
+
deltaFrames,
|
|
1306
|
+
maximumDuration: draggedTarget.maximumDuration,
|
|
1307
|
+
minimumDuration: draggedTarget.minimumDuration,
|
|
1308
|
+
});
|
|
1309
|
+
const appliedDelta = previewValue - draggedTarget.initialDuration;
|
|
1310
|
+
setTrimTooltip({
|
|
1311
|
+
deltaFrames: appliedDelta,
|
|
1312
|
+
edgeFrame: initialTimelineEdge + appliedDelta,
|
|
1313
|
+
x: pointerEvent.clientX,
|
|
1314
|
+
y: initialEdgeClientY,
|
|
1315
|
+
});
|
|
1316
|
+
}
|
|
1299
1317
|
};
|
|
1300
1318
|
const onUp = (pointerEvent) => {
|
|
1301
1319
|
const dragState = dragStateRef.current;
|
|
@@ -1332,6 +1350,7 @@ const TimelineSequenceRightEdgeDragHandleInner = ({ nodePathInfo, mediaDurationD
|
|
|
1332
1350
|
});
|
|
1333
1351
|
}, [
|
|
1334
1352
|
currentSelection,
|
|
1353
|
+
cursor,
|
|
1335
1354
|
finishDrag,
|
|
1336
1355
|
mediaDurationDragLimitsRegistry,
|
|
1337
1356
|
propStatusesRef,
|
|
@@ -1350,8 +1369,10 @@ const TimelineSequenceRightEdgeDragHandleInner = ({ nodePathInfo, mediaDurationD
|
|
|
1350
1369
|
const style = {
|
|
1351
1370
|
...baseStyle,
|
|
1352
1371
|
right: -HANDLE_OUTSET,
|
|
1372
|
+
cursor,
|
|
1353
1373
|
background: colors_1.TRANSPARENT,
|
|
1354
1374
|
};
|
|
1355
|
-
return (jsx_runtime_1.
|
|
1375
|
+
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
1376
|
+
jsx_runtime_1.jsx("div", { role: "separator", "aria-orientation": "vertical", title: "Drag to change duration", style: style, onPointerDown: onPointerDown }), trimTooltip === null ? null : (jsx_runtime_1.jsx(TimelineTrimTooltip_1.TimelineTrimTooltip, { state: trimTooltip, fps: fps }))] }));
|
|
1356
1377
|
};
|
|
1357
1378
|
exports.TimelineSequenceRightEdgeDragHandle = react_1.default.memo(TimelineSequenceRightEdgeDragHandleInner);
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TimelineTextContentField = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const paths_1 = require("@remotion/paths");
|
|
5
6
|
const react_1 = require("react");
|
|
6
7
|
const RemTextarea_1 = require("../NewComposition/RemTextarea");
|
|
7
8
|
const focus_inspector_field_1 = require("./focus-inspector-field");
|
|
@@ -16,9 +17,22 @@ const textAreaStyle = {
|
|
|
16
17
|
fieldSizing: 'content',
|
|
17
18
|
},
|
|
18
19
|
};
|
|
20
|
+
const isValidPathData = (value) => {
|
|
21
|
+
if (value.trim() === '') {
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
try {
|
|
25
|
+
(0, paths_1.parsePath)(value);
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
catch (_a) {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
19
32
|
const TimelineTextContentField = ({ effectiveValue, field, nodePath, onDragEnd, onDragValueChange, onSave, propStatus, }) => {
|
|
20
33
|
var _a;
|
|
21
34
|
const inputRef = (0, react_1.useRef)(null);
|
|
35
|
+
const [valid, setValid] = (0, react_1.useState)(true);
|
|
22
36
|
const currentValue = String(effectiveValue !== null && effectiveValue !== void 0 ? effectiveValue : '');
|
|
23
37
|
const draftRef = (0, react_1.useRef)({
|
|
24
38
|
dirty: false,
|
|
@@ -46,6 +60,10 @@ const TimelineTextContentField = ({ effectiveValue, field, nodePath, onDragEnd,
|
|
|
46
60
|
return false;
|
|
47
61
|
}
|
|
48
62
|
const value = (_b = (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : draftRef.current.value;
|
|
63
|
+
if (field.typeName === 'svg-path' && !isValidPathData(value)) {
|
|
64
|
+
latestRef.current.onDragEnd();
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
49
67
|
const savedValue = String((_c = latestRef.current.codeValue) !== null && _c !== void 0 ? _c : '');
|
|
50
68
|
draftRef.current = {
|
|
51
69
|
dirty: false,
|
|
@@ -64,7 +82,7 @@ const TimelineTextContentField = ({ effectiveValue, field, nodePath, onDragEnd,
|
|
|
64
82
|
})
|
|
65
83
|
.catch(() => undefined);
|
|
66
84
|
return true;
|
|
67
|
-
}, []);
|
|
85
|
+
}, [field.typeName]);
|
|
68
86
|
const setInputRef = (0, react_1.useCallback)((element) => {
|
|
69
87
|
if (element === null && inputRef.current !== null) {
|
|
70
88
|
commitPending();
|
|
@@ -87,8 +105,12 @@ const TimelineTextContentField = ({ effectiveValue, field, nodePath, onDragEnd,
|
|
|
87
105
|
dirty: true,
|
|
88
106
|
value,
|
|
89
107
|
};
|
|
90
|
-
|
|
91
|
-
|
|
108
|
+
const nextValid = field.typeName !== 'svg-path' || isValidPathData(value);
|
|
109
|
+
setValid(nextValid);
|
|
110
|
+
if (nextValid) {
|
|
111
|
+
latestRef.current.onDragValueChange(value);
|
|
112
|
+
}
|
|
113
|
+
}, [field.typeName]);
|
|
92
114
|
const onKeyDownCapture = (0, react_1.useCallback)((event) => {
|
|
93
115
|
var _a;
|
|
94
116
|
if (event.key === 'Escape') {
|
|
@@ -98,10 +120,11 @@ const TimelineTextContentField = ({ effectiveValue, field, nodePath, onDragEnd,
|
|
|
98
120
|
value: savedValue,
|
|
99
121
|
};
|
|
100
122
|
event.currentTarget.value = savedValue;
|
|
123
|
+
setValid(true);
|
|
101
124
|
latestRef.current.onDragEnd();
|
|
102
125
|
event.currentTarget.blur();
|
|
103
126
|
}
|
|
104
127
|
}, []);
|
|
105
|
-
return (jsx_runtime_1.jsx(RemTextarea_1.RemTextarea, { ref: setInputRef, status:
|
|
128
|
+
return (jsx_runtime_1.jsx(RemTextarea_1.RemTextarea, { ref: setInputRef, status: valid ? 'ok' : 'error', "aria-invalid": !valid, small: true, defaultValue: currentValue, onBlur: commitPending, onChange: onChange, onDoubleClick: (event) => event.stopPropagation(), onKeyDownCapture: onKeyDownCapture, style: textAreaStyle }, String((_a = propStatus.codeValue) !== null && _a !== void 0 ? _a : '')));
|
|
106
129
|
};
|
|
107
130
|
exports.TimelineTextContentField = TimelineTextContentField;
|