@remotion/studio 4.0.527 → 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/CodeFrame.js +1 -1
- package/dist/components/ColorPicker/checker.d.ts +1 -1
- package/dist/components/CurrentAsset.js +3 -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 +3 -1
- package/dist/components/InspectorOpenInEditor.js +13 -0
- package/dist/components/InspectorPanel/AlignmentControls.js +28 -9
- package/dist/components/InspectorPanel/CollapsibleInspectorSectionHeader.js +1 -1
- package/dist/components/InspectorPanel/EasingInspector.js +6 -2
- package/dist/components/InspectorPanel/ElementLibraryButton.js +1 -1
- package/dist/components/InspectorPanel/KeyframeEasingNavigator.js +1 -1
- package/dist/components/InspectorPanel/KeyframeInspector.js +28 -24
- package/dist/components/InspectorPanel/MultiSequenceNumberField.js +1 -1
- package/dist/components/InspectorPanel/SequenceInspectorHeader.d.ts +3 -1
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +30 -2
- package/dist/components/InspectorPanel/SequenceWrapAction.d.ts +8 -0
- package/dist/components/InspectorPanel/SequenceWrapAction.js +151 -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/InspectorSequenceSection.d.ts +1 -0
- package/dist/components/InspectorSequenceSection.js +7 -5
- package/dist/components/KeyboardShortcutsSettings.js +1 -1
- package/dist/components/Menu/styles.d.ts +2 -2
- package/dist/components/Modals.js +7 -6
- package/dist/components/ModelManager.js +10 -9
- package/dist/components/NewComposition/CancelButton.js +10 -4
- 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 +3 -2
- 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 +14 -5
- package/dist/components/RenderQueue/CaptionQueueProcessor.js +30 -7
- 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 +24 -27
- package/dist/components/RenderQueue/VideoMattingQueueProcessor.js +68 -28
- package/dist/components/RenderQueue/caption-job-types.d.ts +3 -1
- package/dist/components/RenderQueue/context.d.ts +4 -0
- package/dist/components/RenderQueue/context.js +58 -8
- package/dist/components/RenderQueue/index.js +2 -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/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/SelectedOutlineTransformOriginHandle.js +3 -2
- package/dist/components/SelectedOutlineUvControls.js +12 -7
- 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/TimelineDragHandler.js +1 -1
- package/dist/components/Timeline/TimelineEffectPropItem.d.ts +1 -0
- package/dist/components/Timeline/TimelineEffectPropItem.js +12 -5
- package/dist/components/Timeline/TimelineExpandedRow.d.ts +1 -0
- package/dist/components/Timeline/TimelineExpandedRow.js +5 -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/TimelineFontFamilyField.js +12 -12
- package/dist/components/Timeline/TimelineKeyframeControls.d.ts +1 -0
- package/dist/components/Timeline/TimelineKeyframeControls.js +39 -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 +39 -21
- package/dist/components/Timeline/TimelineSequenceItem.d.ts +1 -0
- package/dist/components/Timeline/TimelineSequenceItem.js +18 -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/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 +7 -93
- 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-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.js +4 -1
- 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/Transcription/Models.js +1 -1
- package/dist/components/Transcription/TranscriptionModal.js +3 -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 +22 -40
- package/dist/components/composition-drop-preview.js +1 -0
- 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 +17 -1
- 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-npa6szn1.mjs → CaptionQueueProcessor-nr7hjcga.mjs} +63 -17
- package/dist/esm/LazyModels-ajkn7fs3.mjs +12 -0
- package/dist/esm/LazyModels-g1g7cf4e.mjs +12 -0
- package/dist/esm/{TranscriptionModal-79m5wgcj.mjs → TranscriptionModal-e18bzbkb.mjs} +15 -15
- package/dist/esm/{VideoMattingModal-31pew0xj.mjs → VideoMattingModal-5bz2s4rs.mjs} +47 -65
- 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-n5gmcvhz.mjs → index-5ycb9e9q.mjs} +2 -4
- package/dist/esm/{index-5t2dwxsk.mjs → index-890dd9b3.mjs} +259 -21
- package/dist/esm/{index-ac5550e7.mjs → index-8nt6a0mw.mjs} +3 -3
- package/dist/esm/{index-614tdz2q.mjs → index-9q9w8v9p.mjs} +3 -3
- package/dist/esm/{index-s7qa3xbw.mjs → index-c2wabcdt.mjs} +6 -6
- package/dist/esm/{index-r1gr3j3a.mjs → index-dfy1t576.mjs} +50 -1
- package/dist/esm/{index-21hxsfaa.mjs → index-dh3zk2hv.mjs} +6 -25
- package/dist/esm/{index-4zen9prq.mjs → index-dpyss74p.mjs} +6563 -5485
- package/dist/esm/{index-9x6e1dq0.mjs → index-hqxc6tzp.mjs} +40 -6
- package/dist/esm/{index-9xxg6218.mjs → index-qve7mdfp.mjs} +19 -1
- package/dist/esm/{index-e855w59j.mjs → index-s6qya2gg.mjs} +3 -5
- package/dist/esm/index-t7tbt980.mjs +103 -0
- package/dist/esm/{index-r0ejh5sy.mjs → index-t7xnxdf8.mjs} +44 -26
- package/dist/esm/index-wqc43mw0.mjs +158 -0
- package/dist/esm/{index-ppspzgn9.mjs → index-x6r9bn12.mjs} +4026 -4761
- package/dist/esm/{index-vxwg66ar.mjs → index-xac20sv4.mjs} +44 -57
- package/dist/esm/index.mjs +4 -5
- package/dist/esm/internals.mjs +13 -13
- package/dist/esm/previewEntry.mjs +18 -15
- package/dist/esm/renderEntry.mjs +5 -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/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 +4 -4
- package/dist/helpers/inject-css.js +5 -7
- 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/timeline-node-path-key.d.ts +1 -1
- package/dist/helpers/timeline-node-path-key.js +2 -2
- 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 +15 -1
- package/dist/state/timeline-sequence-hover.d.ts +6 -16
- package/dist/state/timeline-sequence-hover.js +6 -67
- 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/esm/LazyModels-nh3c8h9p.mjs +0 -12
- package/dist/esm/LazyModels-rr5v8h5y.mjs +0 -12
- 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
- /package/dist/esm/{resolve-composition-component-location-qrp05g62.mjs → resolve-composition-component-location-2hgf6g0a.mjs} +0 -0
|
@@ -35,13 +35,13 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.SelectedOutlineOverlay = exports.selectedOutlineDragThresholdPx = exports.getTransformedSvgViewportPoints = exports.getSequencesWithSelectableOutlines = exports.getSelectedSequenceKeys = exports.getSelectedOutlineRotationPivot = exports.getSelectedOutlineRotationDeltaDegrees = exports.getSelectedOutlineRotationCornerInfo = exports.getSelectedEffectFieldsBySequenceKey = exports.getSelectedCropInfo = exports.getOutlineSelectionInteraction = exports.snapSelectedOutlineUv = exports.snapSelectedOutlineTransformOriginUv = exports.snapSelectedOutlineRotationDeltaDegrees = exports.selectedOutlineUvSnapThresholdPx = exports.selectedOutlineTransformOriginSnapThresholdPx = exports.isSelectedOutlineDragPastThreshold = exports.getSelectedOutlineTransformOriginLockedAxis = exports.getSelectedOutlineTransformOriginDragChanges = exports.getSelectedOutlineScaleEdgeInfo = exports.getSelectedOutlineScaleDragValues = exports.getSelectedOutlineScaleDragStates = exports.getSelectedOutlineScaleDragChanges = exports.getSelectedOutlineRotationDragValues = exports.getSelectedOutlineRotationDragStates = exports.getSelectedOutlineRotationDragChanges = exports.getSelectedOutlineKeyboardNudgeDeltas = exports.getSelectedOutlineKeyboardNudgeDelta = exports.getSelectedOutlineDragValues = exports.getSelectedOutlineDragChanges = exports.getSelectedOutlineCropFollowingTransformOrigin = exports.getSelectedOutlineCropDragValues = exports.getSelectedOutlineCropDragChanges = exports.getSelectedOutlineActiveSchema = exports.getSelectedOutline3DRotationDragValues = exports.compensateTranslateForTransformOrigin = exports.applySelectedOutlineTransformOriginAxisLock = exports.applySelectedOutlineDragAxisLock = exports.orderOutlinesForRendering = void 0;
|
|
37
37
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
+
const canvas_1 = require("@remotion/canvas");
|
|
38
39
|
const player_1 = require("@remotion/player");
|
|
39
40
|
const react_1 = __importStar(require("react"));
|
|
40
41
|
const remotion_1 = require("remotion");
|
|
41
42
|
const no_react_1 = require("remotion/no-react");
|
|
42
43
|
const client_id_1 = require("../helpers/client-id");
|
|
43
44
|
const interactivity_enabled_1 = require("../helpers/interactivity-enabled");
|
|
44
|
-
const timeline_node_path_key_1 = require("../helpers/timeline-node-path-key");
|
|
45
45
|
const use_is_fullscreen_1 = require("../helpers/use-is-fullscreen");
|
|
46
46
|
const use_runtime_values_1 = require("../helpers/use-runtime-values");
|
|
47
47
|
const editor_outlines_1 = require("../state/editor-outlines");
|
|
@@ -58,6 +58,7 @@ const SelectedOutlineRenderer_1 = require("./SelectedOutlineRenderer");
|
|
|
58
58
|
const get_timeline_keyframes_1 = require("./Timeline/get-timeline-keyframes");
|
|
59
59
|
const TimelineSelection_1 = require("./Timeline/TimelineSelection");
|
|
60
60
|
const transform_3d_mode_2 = require("./Timeline/transform-3d-mode");
|
|
61
|
+
const { calculateTimeline, getCanvasSelectableOutlines, getCanvasVisibleOutlineTargets, getCanvasActiveOutlineTargets, getCanvasOutlineActivity, getCanvasOutlineLayoutTargets, } = canvas_1.CanvasInternals;
|
|
61
62
|
const selected_outline_drag_2 = require("./selected-outline-drag");
|
|
62
63
|
Object.defineProperty(exports, "applySelectedOutlineDragAxisLock", { enumerable: true, get: function () { return selected_outline_drag_2.applySelectedOutlineDragAxisLock; } });
|
|
63
64
|
Object.defineProperty(exports, "applySelectedOutlineTransformOriginAxisLock", { enumerable: true, get: function () { return selected_outline_drag_2.applySelectedOutlineTransformOriginAxisLock; } });
|
|
@@ -150,44 +151,29 @@ const calculateOutlineTargets = ({ connectedClientId, editorShowOutlines, getDra
|
|
|
150
151
|
return [];
|
|
151
152
|
}
|
|
152
153
|
const previewInteractive = connectedClientId !== null && studioInteractivityEnabled;
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
const
|
|
161
|
-
if (currentFirst === undefined || nodePathInfo.index < currentFirst.index) {
|
|
162
|
-
firstNodePathInfoBySourceNode.set(sourceNodeKey, nodePathInfo);
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
return selectableOutlines.flatMap((selectableOutline) => {
|
|
166
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
167
|
-
const { key, keyframeDisplayOffset, nodePathInfo, sequence } = selectableOutline;
|
|
168
|
-
if (targetKey !== null && targetKey !== key) {
|
|
169
|
-
return [];
|
|
170
|
-
}
|
|
171
|
-
if (sequence.refForOutline === null) {
|
|
172
|
-
throw new Error('Expected sequence to have a ref for outline');
|
|
173
|
-
}
|
|
174
|
-
const selected = selectedSequenceKeys.has(key);
|
|
175
|
-
const containsSelection = sequenceKeysContainingSelection.has(key);
|
|
154
|
+
return getCanvasOutlineLayoutTargets({
|
|
155
|
+
selectableOutlines,
|
|
156
|
+
selectedSequenceKeys,
|
|
157
|
+
sequenceKeysContainingSelection,
|
|
158
|
+
targetKey,
|
|
159
|
+
}).flatMap((canvasLayoutTarget) => {
|
|
160
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
161
|
+
const { key, keyframeDisplayOffset, keyframePlaybackRate, nodePathInfo, sequence, } = canvasLayoutTarget;
|
|
176
162
|
const nodePath = nodePathInfo.sequenceSubscriptionKey;
|
|
177
|
-
const sourceNodeKey = (0, timeline_node_path_key_1.timelineSequenceNodePathToKey)(nodePath);
|
|
178
|
-
const showSelectedOutline = containsSelection || selectedSourceNodeKeys.has(sourceNodeKey);
|
|
179
|
-
const selectionNodePathInfo = firstNodePathInfoBySourceNode.get(sourceNodeKey);
|
|
180
|
-
if (selectionNodePathInfo === undefined) {
|
|
181
|
-
throw new Error('Expected a first sequence for the source node');
|
|
182
|
-
}
|
|
183
163
|
const { controls } = sequence;
|
|
184
164
|
const nodePropStatuses = remotion_1.Internals.getPropStatusesCtx(propStatuses, nodePath);
|
|
185
165
|
const firstKeyframedStatus = Object.values(nodePropStatuses !== null && nodePropStatuses !== void 0 ? nodePropStatuses : {}).find((status) => status.status === 'keyframed');
|
|
186
166
|
const nodeKeyframeDisplayOffset = (0, get_timeline_keyframes_1.getKeyframeDisplayOffset)({
|
|
187
|
-
propStatus: firstKeyframedStatus,
|
|
167
|
+
propStatus: firstKeyframedStatus !== null && firstKeyframedStatus !== void 0 ? firstKeyframedStatus : null,
|
|
188
168
|
keyframeDisplayOffset,
|
|
169
|
+
keyframePlaybackRate,
|
|
170
|
+
});
|
|
171
|
+
const sourceFrame = (0, get_timeline_keyframes_1.getKeyframeSourceFrame)({
|
|
172
|
+
displayFrame: targetTimelinePosition,
|
|
173
|
+
keyframeDisplayOffset: nodeKeyframeDisplayOffset,
|
|
174
|
+
keyframePlaybackRate,
|
|
175
|
+
propStatus: firstKeyframedStatus !== null && firstKeyframedStatus !== void 0 ? firstKeyframedStatus : null,
|
|
189
176
|
});
|
|
190
|
-
const sourceFrame = targetTimelinePosition - nodeKeyframeDisplayOffset;
|
|
191
177
|
const dragOverrides = (_a = getDragOverrides(nodePath)) !== null && _a !== void 0 ? _a : {};
|
|
192
178
|
const runtimeValues = controls
|
|
193
179
|
? ((_b = runtimeValuesByStore.get(controls.runtimeValues)) !== null && _b !== void 0 ? _b : controls.runtimeValues.getSnapshot())
|
|
@@ -241,6 +227,8 @@ const calculateOutlineTargets = ({ connectedClientId, editorShowOutlines, getDra
|
|
|
241
227
|
const selectedForRotation = (selectedRotationInfo === null || selectedRotationInfo === void 0 ? void 0 : selectedRotationInfo.sequenceKey) === key;
|
|
242
228
|
const selectedForUvHandles = selectedEffectsBySequenceKey.has(key);
|
|
243
229
|
const fieldSchema = activeSchema === null || activeSchema === void 0 ? void 0 : activeSchema[selected_outline_types_1.translateFieldKey];
|
|
230
|
+
const pathFieldSchema = activeSchema === null || activeSchema === void 0 ? void 0 : activeSchema.d;
|
|
231
|
+
const pathPropStatus = nodePropStatuses === null || nodePropStatuses === void 0 ? void 0 : nodePropStatuses.d;
|
|
244
232
|
const propStatus = nodePropStatuses === null || nodePropStatuses === void 0 ? void 0 : nodePropStatuses[selected_outline_types_1.translateFieldKey];
|
|
245
233
|
const scaleFieldSchema = activeSchema === null || activeSchema === void 0 ? void 0 : activeSchema[selected_outline_types_1.scaleFieldKey];
|
|
246
234
|
const scalePropStatus = nodePropStatuses === null || nodePropStatuses === void 0 ? void 0 : nodePropStatuses[selected_outline_types_1.scaleFieldKey];
|
|
@@ -252,7 +240,7 @@ const calculateOutlineTargets = ({ connectedClientId, editorShowOutlines, getDra
|
|
|
252
240
|
((transformOriginPropStatus === null || transformOriginPropStatus === void 0 ? void 0 : transformOriginPropStatus.status) === 'static' ||
|
|
253
241
|
(transformOriginPropStatus === null || transformOriginPropStatus === void 0 ? void 0 : transformOriginPropStatus.status) === 'keyframed')
|
|
254
242
|
? String((_c = remotion_1.Internals.getEffectiveVisualModeValue({
|
|
255
|
-
propStatus: transformOriginPropStatus,
|
|
243
|
+
propStatus: transformOriginPropStatus !== null && transformOriginPropStatus !== void 0 ? transformOriginPropStatus : null,
|
|
256
244
|
dragOverrideValue: dragOverrides[selected_outline_types_1.transformOriginFieldKey],
|
|
257
245
|
defaultValue: transformOriginFieldSchema.default,
|
|
258
246
|
frame: sourceFrame,
|
|
@@ -260,24 +248,14 @@ const calculateOutlineTargets = ({ connectedClientId, editorShowOutlines, getDra
|
|
|
260
248
|
})) !== null && _c !== void 0 ? _c : transformOriginFieldSchema.default)
|
|
261
249
|
: '50% 50%';
|
|
262
250
|
const layoutTarget = {
|
|
263
|
-
|
|
264
|
-
containsSelection,
|
|
251
|
+
...canvasLayoutTarget,
|
|
265
252
|
crop,
|
|
266
253
|
keyframeDisplayOffset: nodeKeyframeDisplayOffset,
|
|
267
|
-
nodePathInfo,
|
|
268
|
-
ref: sequence.refForOutline,
|
|
269
|
-
selected,
|
|
270
254
|
selectedForCrop,
|
|
271
255
|
selectedForRotation,
|
|
272
256
|
selectedForTransformOrigin,
|
|
273
257
|
selectedForUvHandles,
|
|
274
|
-
showSelectedOutline,
|
|
275
258
|
transformOriginValue: transformOriginValueForRotation,
|
|
276
|
-
selection: {
|
|
277
|
-
type: 'sequence',
|
|
278
|
-
nodePathInfo: selectionNodePathInfo,
|
|
279
|
-
},
|
|
280
|
-
sequence,
|
|
281
259
|
};
|
|
282
260
|
if (mode === 'layout') {
|
|
283
261
|
return [layoutTarget];
|
|
@@ -322,11 +300,16 @@ const calculateOutlineTargets = ({ connectedClientId, editorShowOutlines, getDra
|
|
|
322
300
|
const transformOriginSourceFrame = (selectedTransformOriginInfo === null || selectedTransformOriginInfo === void 0 ? void 0 : selectedTransformOriginInfo.displayFrame) === null ||
|
|
323
301
|
(selectedTransformOriginInfo === null || selectedTransformOriginInfo === void 0 ? void 0 : selectedTransformOriginInfo.displayFrame) === undefined
|
|
324
302
|
? sourceFrame
|
|
325
|
-
:
|
|
326
|
-
|
|
327
|
-
|
|
303
|
+
: (0, get_timeline_keyframes_1.getKeyframeSourceFrame)({
|
|
304
|
+
displayFrame: selectedTransformOriginInfo.displayFrame,
|
|
305
|
+
propStatus: transformOriginPropStatus !== null && transformOriginPropStatus !== void 0 ? transformOriginPropStatus : null,
|
|
306
|
+
keyframeDisplayOffset: (0, get_timeline_keyframes_1.getKeyframeDisplayOffset)({
|
|
307
|
+
propStatus: transformOriginPropStatus !== null && transformOriginPropStatus !== void 0 ? transformOriginPropStatus : null,
|
|
328
308
|
keyframeDisplayOffset,
|
|
329
|
-
|
|
309
|
+
keyframePlaybackRate,
|
|
310
|
+
}),
|
|
311
|
+
keyframePlaybackRate,
|
|
312
|
+
});
|
|
330
313
|
const canTransformOriginStatus = (transformOriginPropStatus === null || transformOriginPropStatus === void 0 ? void 0 : transformOriginPropStatus.status) === 'static' ||
|
|
331
314
|
((transformOriginPropStatus === null || transformOriginPropStatus === void 0 ? void 0 : transformOriginPropStatus.status) === 'keyframed' &&
|
|
332
315
|
transformOriginPropStatus.interpolationFunction === 'interpolate');
|
|
@@ -340,10 +323,11 @@ const calculateOutlineTargets = ({ connectedClientId, editorShowOutlines, getDra
|
|
|
340
323
|
(fieldSchema === null || fieldSchema === void 0 ? void 0 : fieldSchema.type) === 'translate' &&
|
|
341
324
|
canTransformOriginStatus &&
|
|
342
325
|
canTransformOriginTranslateStatus;
|
|
343
|
-
const cropSourceFrame =
|
|
344
|
-
(selectedCropInfo === null || selectedCropInfo === void 0 ? void 0 : selectedCropInfo.displayFrame)
|
|
345
|
-
|
|
346
|
-
|
|
326
|
+
const cropSourceFrame = {
|
|
327
|
+
displayFrame: (_d = selectedCropInfo === null || selectedCropInfo === void 0 ? void 0 : selectedCropInfo.displayFrame) !== null && _d !== void 0 ? _d : targetTimelinePosition,
|
|
328
|
+
keyframeDisplayOffset: nodeKeyframeDisplayOffset,
|
|
329
|
+
keyframePlaybackRate,
|
|
330
|
+
};
|
|
347
331
|
const canCropDrag = previewInteractive &&
|
|
348
332
|
selectedForCrop &&
|
|
349
333
|
controls !== null &&
|
|
@@ -351,6 +335,17 @@ const calculateOutlineTargets = ({ connectedClientId, editorShowOutlines, getDra
|
|
|
351
335
|
return [
|
|
352
336
|
{
|
|
353
337
|
...layoutTarget,
|
|
338
|
+
pathDrag: previewInteractive &&
|
|
339
|
+
controls !== null &&
|
|
340
|
+
(pathFieldSchema === null || pathFieldSchema === void 0 ? void 0 : pathFieldSchema.type) === 'svg-path' &&
|
|
341
|
+
(pathPropStatus === null || pathPropStatus === void 0 ? void 0 : pathPropStatus.status) === 'static' &&
|
|
342
|
+
typeof pathPropStatus.codeValue === 'string'
|
|
343
|
+
? {
|
|
344
|
+
clientId: connectedClientId,
|
|
345
|
+
nodePath,
|
|
346
|
+
schema: controls.schema,
|
|
347
|
+
}
|
|
348
|
+
: null,
|
|
354
349
|
canCrop: previewInteractive && controls !== null && cropFields !== null,
|
|
355
350
|
cropDrag: canCropDrag
|
|
356
351
|
? {
|
|
@@ -363,7 +358,7 @@ const calculateOutlineTargets = ({ connectedClientId, editorShowOutlines, getDra
|
|
|
363
358
|
transformOriginPropStatus !== undefined
|
|
364
359
|
? {
|
|
365
360
|
defaultValue: transformOriginFieldSchema.default,
|
|
366
|
-
propStatus: transformOriginPropStatus,
|
|
361
|
+
propStatus: transformOriginPropStatus !== null && transformOriginPropStatus !== void 0 ? transformOriginPropStatus : null,
|
|
367
362
|
value: transformOriginValueForRotation,
|
|
368
363
|
}
|
|
369
364
|
: null,
|
|
@@ -374,9 +369,11 @@ const calculateOutlineTargets = ({ connectedClientId, editorShowOutlines, getDra
|
|
|
374
369
|
propStatus,
|
|
375
370
|
clientId: connectedClientId,
|
|
376
371
|
fieldDefault: fieldSchema.default,
|
|
372
|
+
keyframePlaybackRate,
|
|
377
373
|
keyframeDisplayOffset: (0, get_timeline_keyframes_1.getKeyframeDisplayOffset)({
|
|
378
374
|
propStatus,
|
|
379
375
|
keyframeDisplayOffset,
|
|
376
|
+
keyframePlaybackRate,
|
|
380
377
|
}),
|
|
381
378
|
nodePath,
|
|
382
379
|
schema: controls.schema,
|
|
@@ -388,9 +385,11 @@ const calculateOutlineTargets = ({ connectedClientId, editorShowOutlines, getDra
|
|
|
388
385
|
clientId: connectedClientId,
|
|
389
386
|
fieldDefault: scaleFieldSchema.default,
|
|
390
387
|
fieldSchema: scaleFieldSchema,
|
|
388
|
+
keyframePlaybackRate,
|
|
391
389
|
keyframeDisplayOffset: (0, get_timeline_keyframes_1.getKeyframeDisplayOffset)({
|
|
392
390
|
propStatus: scalePropStatus,
|
|
393
391
|
keyframeDisplayOffset,
|
|
392
|
+
keyframePlaybackRate,
|
|
394
393
|
}),
|
|
395
394
|
linked: getScaleLockState({
|
|
396
395
|
nodePath,
|
|
@@ -417,9 +416,11 @@ const calculateOutlineTargets = ({ connectedClientId, editorShowOutlines, getDra
|
|
|
417
416
|
clientId: connectedClientId,
|
|
418
417
|
fieldDefault: rotationFieldSchema.default,
|
|
419
418
|
fieldSchema: rotationFieldSchema,
|
|
419
|
+
keyframePlaybackRate,
|
|
420
420
|
keyframeDisplayOffset: (0, get_timeline_keyframes_1.getKeyframeDisplayOffset)({
|
|
421
421
|
propStatus: rotationPropStatus,
|
|
422
422
|
keyframeDisplayOffset,
|
|
423
|
+
keyframePlaybackRate,
|
|
423
424
|
}),
|
|
424
425
|
nodePath,
|
|
425
426
|
schema: controls.schema,
|
|
@@ -430,23 +431,25 @@ const calculateOutlineTargets = ({ connectedClientId, editorShowOutlines, getDra
|
|
|
430
431
|
transformOriginDrag: canTransformOriginDrag
|
|
431
432
|
? {
|
|
432
433
|
clientId: connectedClientId,
|
|
434
|
+
keyframePlaybackRate,
|
|
433
435
|
keyframeDisplayOffset: (0, get_timeline_keyframes_1.getKeyframeDisplayOffset)({
|
|
434
|
-
propStatus: transformOriginPropStatus,
|
|
436
|
+
propStatus: transformOriginPropStatus !== null && transformOriginPropStatus !== void 0 ? transformOriginPropStatus : null,
|
|
435
437
|
keyframeDisplayOffset,
|
|
438
|
+
keyframePlaybackRate,
|
|
436
439
|
}),
|
|
437
440
|
nodePath,
|
|
438
441
|
originDefault: transformOriginFieldSchema.default,
|
|
439
442
|
originPropStatus: transformOriginPropStatus,
|
|
440
|
-
originValue: String((
|
|
441
|
-
propStatus: transformOriginPropStatus,
|
|
443
|
+
originValue: String((_e = remotion_1.Internals.getEffectiveVisualModeValue({
|
|
444
|
+
propStatus: transformOriginPropStatus !== null && transformOriginPropStatus !== void 0 ? transformOriginPropStatus : null,
|
|
442
445
|
dragOverrideValue: dragOverrides[selected_outline_types_1.transformOriginFieldKey],
|
|
443
446
|
defaultValue: transformOriginFieldSchema.default,
|
|
444
447
|
frame: transformOriginSourceFrame,
|
|
445
448
|
shouldResortToDefaultValueIfUndefined: true,
|
|
446
|
-
})) !== null &&
|
|
449
|
+
})) !== null && _e !== void 0 ? _e : transformOriginFieldSchema.default),
|
|
447
450
|
rotateValue: String((rotationPropStatus === null || rotationPropStatus === void 0 ? void 0 : rotationPropStatus.status) === 'static' ||
|
|
448
451
|
(rotationPropStatus === null || rotationPropStatus === void 0 ? void 0 : rotationPropStatus.status) === 'keyframed'
|
|
449
|
-
? ((
|
|
452
|
+
? ((_f = remotion_1.Internals.getEffectiveVisualModeValue({
|
|
450
453
|
propStatus: rotationPropStatus,
|
|
451
454
|
dragOverrideValue: dragOverrides[selected_outline_types_1.rotateFieldKey],
|
|
452
455
|
defaultValue: (rotationFieldSchema === null || rotationFieldSchema === void 0 ? void 0 : rotationFieldSchema.type) === 'rotation-css'
|
|
@@ -454,11 +457,11 @@ const calculateOutlineTargets = ({ connectedClientId, editorShowOutlines, getDra
|
|
|
454
457
|
: '0deg',
|
|
455
458
|
frame: transformOriginSourceFrame,
|
|
456
459
|
shouldResortToDefaultValueIfUndefined: true,
|
|
457
|
-
})) !== null &&
|
|
460
|
+
})) !== null && _f !== void 0 ? _f : '0deg')
|
|
458
461
|
: '0deg'),
|
|
459
462
|
scaleValue: (scalePropStatus === null || scalePropStatus === void 0 ? void 0 : scalePropStatus.status) === 'static' ||
|
|
460
463
|
(scalePropStatus === null || scalePropStatus === void 0 ? void 0 : scalePropStatus.status) === 'keyframed'
|
|
461
|
-
? String((
|
|
464
|
+
? String((_g = remotion_1.Internals.getEffectiveVisualModeValue({
|
|
462
465
|
propStatus: scalePropStatus,
|
|
463
466
|
dragOverrideValue: dragOverrides[selected_outline_types_1.scaleFieldKey],
|
|
464
467
|
defaultValue: (scaleFieldSchema === null || scaleFieldSchema === void 0 ? void 0 : scaleFieldSchema.type) === 'scale'
|
|
@@ -466,49 +469,46 @@ const calculateOutlineTargets = ({ connectedClientId, editorShowOutlines, getDra
|
|
|
466
469
|
: 1,
|
|
467
470
|
frame: transformOriginSourceFrame,
|
|
468
471
|
shouldResortToDefaultValueIfUndefined: true,
|
|
469
|
-
})) !== null &&
|
|
472
|
+
})) !== null && _g !== void 0 ? _g : 1)
|
|
470
473
|
: '1',
|
|
471
474
|
schema: controls.schema,
|
|
472
|
-
sourceFrame:
|
|
475
|
+
sourceFrame: {
|
|
476
|
+
displayFrame: (_h = selectedTransformOriginInfo === null || selectedTransformOriginInfo === void 0 ? void 0 : selectedTransformOriginInfo.displayFrame) !== null && _h !== void 0 ? _h : targetTimelinePosition,
|
|
477
|
+
keyframeDisplayOffset: (0, get_timeline_keyframes_1.getKeyframeDisplayOffset)({
|
|
478
|
+
propStatus: transformOriginPropStatus,
|
|
479
|
+
keyframeDisplayOffset,
|
|
480
|
+
keyframePlaybackRate,
|
|
481
|
+
}),
|
|
482
|
+
keyframePlaybackRate,
|
|
483
|
+
},
|
|
473
484
|
translateDefault: fieldSchema.default,
|
|
474
485
|
translatePropStatus: propStatus,
|
|
475
|
-
translateValue: String((
|
|
486
|
+
translateValue: String((_j = remotion_1.Internals.getEffectiveVisualModeValue({
|
|
476
487
|
propStatus,
|
|
477
488
|
dragOverrideValue: dragOverrides[selected_outline_types_1.translateFieldKey],
|
|
478
489
|
defaultValue: fieldSchema.default,
|
|
479
490
|
frame: transformOriginSourceFrame,
|
|
480
491
|
shouldResortToDefaultValueIfUndefined: true,
|
|
481
|
-
})) !== null &&
|
|
492
|
+
})) !== null && _j !== void 0 ? _j : fieldSchema.default),
|
|
482
493
|
}
|
|
483
494
|
: null,
|
|
484
495
|
},
|
|
485
496
|
];
|
|
486
497
|
});
|
|
487
498
|
};
|
|
488
|
-
const ActiveSelectedOutlineOverlayUnmemoized = ({ calculateOutlineTargetsForCurrentState, compositionHeight, compositionWidth, draggingOutline, getLatestOutlineTargetByKey, getSelectableOutlines, hoveredTimelineNodePathKey, measureAllOutlines, onDraggingChange, onContextMenuOpenChange, onSelect, scale, selectedSequenceKeys, sequenceKeysContainingSelection, sequences, translationX, translationY, }) => {
|
|
499
|
+
const ActiveSelectedOutlineOverlayUnmemoized = ({ calculateOutlineTargetsForCurrentState, compositionHeight, compositionWidth, draggingOutline, getAllDragTargets, getLatestOutlineTargetByKey, getSelectableOutlines, hoveredTimelineNodePathKey, measureAllOutlines, onDraggingChange, onContextMenuOpenChange, onSelect, scale, selectedSequenceKeys, sequenceKeysContainingSelection, sequences, translationX, translationY, }) => {
|
|
489
500
|
const timelinePosition = remotion_1.Internals.Timeline.useTimelinePosition();
|
|
490
501
|
const updateOutlinesRef = (0, react_1.useRef)(() => undefined);
|
|
491
502
|
const selectableOutlines = (0, react_1.useMemo)(() => {
|
|
492
503
|
return getSelectableOutlines(timelinePosition);
|
|
493
504
|
}, [getSelectableOutlines, timelinePosition]);
|
|
494
|
-
const selectableOutlinesForLayout = (0, react_1.useMemo)(() => {
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
const activeNodePathKeys = new Set();
|
|
502
|
-
for (const { key, nodePathInfo } of selectableOutlines) {
|
|
503
|
-
const nodePathKey = (0, timeline_node_path_key_1.timelineSequenceNodePathToKey)(nodePathInfo.sequenceSubscriptionKey);
|
|
504
|
-
if (selectedSequenceKeys.has(key) ||
|
|
505
|
-
sequenceKeysContainingSelection.has(key) ||
|
|
506
|
-
nodePathKey === hoveredTimelineNodePathKey) {
|
|
507
|
-
activeNodePathKeys.add(nodePathKey);
|
|
508
|
-
}
|
|
509
|
-
}
|
|
510
|
-
return selectableOutlines.filter(({ nodePathInfo }) => activeNodePathKeys.has((0, timeline_node_path_key_1.timelineSequenceNodePathToKey)(nodePathInfo.sequenceSubscriptionKey)));
|
|
511
|
-
}, [
|
|
505
|
+
const selectableOutlinesForLayout = (0, react_1.useMemo)(() => getCanvasActiveOutlineTargets({
|
|
506
|
+
targets: selectableOutlines,
|
|
507
|
+
selectedSequenceKeys,
|
|
508
|
+
sequenceKeysContainingSelection,
|
|
509
|
+
hoveredNodePathKey: hoveredTimelineNodePathKey,
|
|
510
|
+
measureAll: measureAllOutlines,
|
|
511
|
+
}), [
|
|
512
512
|
hoveredTimelineNodePathKey,
|
|
513
513
|
measureAllOutlines,
|
|
514
514
|
selectableOutlines,
|
|
@@ -548,11 +548,12 @@ const ActiveSelectedOutlineOverlayUnmemoized = ({ calculateOutlineTargetsForCurr
|
|
|
548
548
|
(0, react_1.useLayoutEffect)(() => {
|
|
549
549
|
updateOutlinesRef.current();
|
|
550
550
|
}, [scale, translationX, translationY]);
|
|
551
|
-
return (jsx_runtime_1.jsx(SelectedOutlineRenderer_1.SelectedOutlineRenderer, { compositionHeight: compositionHeight, compositionWidth: compositionWidth, dragging: draggingOutline, getLatestOutlineTargetByKey: getLatestOutlineTargetByKey, outlineTargets: outlineTargets, onDraggingChange: onDraggingChange, onContextMenuOpenChange: onContextMenuOpenChange, onSelect: onSelect, scale: scale, sequences: sequences, updateOutlinesRef: updateOutlinesRef }));
|
|
551
|
+
return (jsx_runtime_1.jsx(SelectedOutlineRenderer_1.SelectedOutlineRenderer, { compositionHeight: compositionHeight, compositionWidth: compositionWidth, dragging: draggingOutline, getAllDragTargets: getAllDragTargets, getLatestOutlineTargetByKey: getLatestOutlineTargetByKey, outlineTargets: outlineTargets, onDraggingChange: onDraggingChange, onContextMenuOpenChange: onContextMenuOpenChange, onSelect: onSelect, scale: scale, sequences: sequences, updateOutlinesRef: updateOutlinesRef }));
|
|
552
552
|
};
|
|
553
553
|
const ActiveSelectedOutlineOverlay = react_1.default.memo(ActiveSelectedOutlineOverlayUnmemoized);
|
|
554
554
|
const SelectedOutlineOverlayUnmemoized = ({ canvasHovered, compositionHeight, compositionWidth, scale, translationX, translationY, }) => {
|
|
555
555
|
const { selectedItems, selectItem } = (0, TimelineSelection_1.useTimelineSelection)();
|
|
556
|
+
const currentSelection = (0, TimelineSelection_1.useCurrentTimelineSelectionStateAsRef)();
|
|
556
557
|
const { sequences } = (0, react_1.useContext)(remotion_1.Internals.SequenceManager);
|
|
557
558
|
const { compositions } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
558
559
|
const { propStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesContext);
|
|
@@ -575,19 +576,33 @@ const SelectedOutlineOverlayUnmemoized = ({ canvasHovered, compositionHeight, co
|
|
|
575
576
|
const selectedTransformOriginInfo = (0, react_1.useMemo)(() => (0, selected_outline_measurement_1.getSelectedTransformOriginInfo)(selectedItems), [selectedItems]);
|
|
576
577
|
const selectedRotationInfo = (0, react_1.useMemo)(() => (0, selected_outline_measurement_1.getSelectedRotationInfo)(selectedItems), [selectedItems]);
|
|
577
578
|
const selectedCropInfo = (0, react_1.useMemo)(() => (0, selected_outline_measurement_1.getSelectedCropInfo)(selectedItems), [selectedItems]);
|
|
578
|
-
const getSelectableOutlines = (0, react_1.
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
579
|
+
const getSelectableOutlines = (0, react_1.useMemo)(() => {
|
|
580
|
+
// Resolve source identities once per sequence snapshot, on first demand.
|
|
581
|
+
// Playback only filters the cached candidates by their visible range.
|
|
582
|
+
let selectableOutlines = null;
|
|
583
|
+
return (timelinePosition) => {
|
|
584
|
+
if (isFullscreen ||
|
|
585
|
+
!(0, interactivity_enabled_1.isStudioSelectionEnabled)() ||
|
|
586
|
+
!previewSelectionAvailable ||
|
|
587
|
+
!editorShowOutlines) {
|
|
588
|
+
return [];
|
|
589
|
+
}
|
|
590
|
+
selectableOutlines !== null && selectableOutlines !== void 0 ? selectableOutlines : (selectableOutlines = getCanvasSelectableOutlines({
|
|
591
|
+
tracks: calculateTimeline({
|
|
592
|
+
sequences: [...sequences],
|
|
593
|
+
overrideIdsToNodePaths: overrideIdToNodePathMappings,
|
|
594
|
+
compositions,
|
|
595
|
+
}),
|
|
596
|
+
timelinePosition: null,
|
|
597
|
+
resolveSequenceNodePathInfo: null,
|
|
598
|
+
}));
|
|
599
|
+
return timelinePosition === null
|
|
600
|
+
? selectableOutlines
|
|
601
|
+
: getCanvasVisibleOutlineTargets({
|
|
602
|
+
targets: selectableOutlines,
|
|
603
|
+
timelinePosition,
|
|
604
|
+
});
|
|
605
|
+
};
|
|
591
606
|
}, [
|
|
592
607
|
compositions,
|
|
593
608
|
editorShowOutlines,
|
|
@@ -666,7 +681,38 @@ const SelectedOutlineOverlayUnmemoized = ({ canvasHovered, compositionHeight, co
|
|
|
666
681
|
getCurrentFrame,
|
|
667
682
|
getSelectableOutlinesAtFrame,
|
|
668
683
|
]);
|
|
669
|
-
const
|
|
684
|
+
const getAllDragTargets = (0, react_1.useCallback)(() => {
|
|
685
|
+
// Selected layers can be outside the current frame and have no mounted DOM.
|
|
686
|
+
// Only outline measurement and snapping need to be restricted to visible layers.
|
|
687
|
+
const selectedKeys = (0, selected_outline_measurement_1.getSequenceKeysContainingSelection)(currentSelection.current.selectedItems);
|
|
688
|
+
if (selectedKeys.size === 0) {
|
|
689
|
+
return [];
|
|
690
|
+
}
|
|
691
|
+
const selectableOutlines = getSelectableOutlines(null).filter(({ key }) => selectedKeys.has(key));
|
|
692
|
+
const targets = calculateOutlineTargetsForCurrentState({
|
|
693
|
+
mode: 'controls',
|
|
694
|
+
runtimeValuesByStore: new Map(),
|
|
695
|
+
selectableOutlines,
|
|
696
|
+
targetKey: null,
|
|
697
|
+
targetTimelinePosition: getCurrentFrame(),
|
|
698
|
+
});
|
|
699
|
+
const dragTargets = new Map();
|
|
700
|
+
for (const { drag } of targets) {
|
|
701
|
+
if (drag === null) {
|
|
702
|
+
continue;
|
|
703
|
+
}
|
|
704
|
+
const sourceNodeKey = remotion_1.Internals.makeSequencePropsSubscriptionKey(drag.nodePath);
|
|
705
|
+
if (!dragTargets.has(sourceNodeKey)) {
|
|
706
|
+
dragTargets.set(sourceNodeKey, drag);
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
return [...dragTargets.values()];
|
|
710
|
+
}, [
|
|
711
|
+
calculateOutlineTargetsForCurrentState,
|
|
712
|
+
currentSelection,
|
|
713
|
+
getCurrentFrame,
|
|
714
|
+
getSelectableOutlines,
|
|
715
|
+
]);
|
|
670
716
|
const onDraggingChange = (0, react_1.useCallback)((dragging) => {
|
|
671
717
|
setDraggingOutline(dragging);
|
|
672
718
|
if (dragging) {
|
|
@@ -676,13 +722,13 @@ const SelectedOutlineOverlayUnmemoized = ({ canvasHovered, compositionHeight, co
|
|
|
676
722
|
const selectOutlineItem = (0, react_1.useCallback)((item, interaction) => {
|
|
677
723
|
selectItem(item, interaction, undefined, { reveal: true });
|
|
678
724
|
}, [selectItem]);
|
|
679
|
-
const measurementActive =
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
725
|
+
const { measurementActive, measureAllOutlines, hoveredTimelineNodePathKey } = getCanvasOutlineActivity({
|
|
726
|
+
canvasHovered,
|
|
727
|
+
dragging: draggingOutline,
|
|
728
|
+
contextMenuOpen: canvasContextMenuOpen,
|
|
729
|
+
hasSelection: sequenceKeysContainingSelection.size > 0,
|
|
730
|
+
hoveredSequence,
|
|
731
|
+
});
|
|
686
732
|
(0, react_1.useLayoutEffect)(() => {
|
|
687
733
|
if (measurementActive) {
|
|
688
734
|
return;
|
|
@@ -690,6 +736,6 @@ const SelectedOutlineOverlayUnmemoized = ({ canvasHovered, compositionHeight, co
|
|
|
690
736
|
setHoveredSequence((currentHover) => (currentHover === null || currentHover === void 0 ? void 0 : currentHover.source) === 'canvas' ? null : currentHover);
|
|
691
737
|
}, [measurementActive, setHoveredSequence]);
|
|
692
738
|
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
693
|
-
jsx_runtime_1.jsx(SelectedOutlineKeyboardControls_1.SelectedOutlineKeyboardControls, {
|
|
739
|
+
jsx_runtime_1.jsx(SelectedOutlineKeyboardControls_1.SelectedOutlineKeyboardControls, { getAllDragTargets: getAllDragTargets }), measurementActive ? (jsx_runtime_1.jsx(ActiveSelectedOutlineOverlay, { calculateOutlineTargetsForCurrentState: calculateOutlineTargetsForCurrentState, compositionHeight: compositionHeight, compositionWidth: compositionWidth, draggingOutline: draggingOutline, getAllDragTargets: getAllDragTargets, getLatestOutlineTargetByKey: getLatestOutlineTargetByKey, getSelectableOutlines: getSelectableOutlines, hoveredTimelineNodePathKey: hoveredTimelineNodePathKey, measureAllOutlines: measureAllOutlines, onDraggingChange: onDraggingChange, onContextMenuOpenChange: setCanvasContextMenuOpen, onSelect: selectOutlineItem, scale: scale, selectedSequenceKeys: selectedSequenceKeys, sequenceKeysContainingSelection: sequenceKeysContainingSelection, sequences: sequences, translationX: translationX, translationY: translationY })) : null] }));
|
|
694
740
|
};
|
|
695
741
|
exports.SelectedOutlineOverlay = react_1.default.memo(SelectedOutlineOverlayUnmemoized);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { SelectedOutline } from './selected-outline-geometry';
|
|
3
|
+
import type { SelectedOutlinePathDragTarget } from './selected-outline-types';
|
|
4
|
+
export declare const SelectedOutlinePathPoints: React.FC<{
|
|
5
|
+
readonly outline: SelectedOutline;
|
|
6
|
+
readonly pathDrag: SelectedOutlinePathDragTarget;
|
|
7
|
+
readonly onDraggingChange: (dragging: boolean) => void;
|
|
8
|
+
}>;
|