@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.
Files changed (309) hide show
  1. package/dist/components/AgentPrompt.js +1 -2
  2. package/dist/components/AudioWaveform.d.ts +1 -0
  3. package/dist/components/AudioWaveform.js +10 -14
  4. package/dist/components/Canvas.js +88 -26
  5. package/dist/components/CanvasCaptureDropHandler.js +63 -0
  6. package/dist/components/CanvasOrLoading.js +10 -2
  7. package/dist/components/CodeFrame.js +1 -1
  8. package/dist/components/ColorPicker/checker.d.ts +1 -1
  9. package/dist/components/CompositionSelectorItem.js +1 -0
  10. package/dist/components/CurrentAsset.js +4 -2
  11. package/dist/components/EditorRuler/Ruler.js +6 -3
  12. package/dist/components/EffectPickerModal.js +69 -43
  13. package/dist/components/ElementInstallConfirmation.js +3 -3
  14. package/dist/components/ElementLibrariesSettings.d.ts +2 -0
  15. package/dist/components/ElementLibrariesSettings.js +200 -0
  16. package/dist/components/InitialCompositionLoader.js +4 -2
  17. package/dist/components/InlineDropdown.js +26 -2
  18. package/dist/components/InlineEditableTitle.js +1 -0
  19. package/dist/components/InspectorOpenInEditor.js +13 -0
  20. package/dist/components/InspectorPanel/AlignmentControls.js +28 -9
  21. package/dist/components/InspectorPanel/CollapsibleInspectorSectionHeader.js +2 -1
  22. package/dist/components/InspectorPanel/CompositionInspector.js +3 -3
  23. package/dist/components/InspectorPanel/CompositionMetadata.js +4 -0
  24. package/dist/components/InspectorPanel/EasingInspector.js +6 -2
  25. package/dist/components/InspectorPanel/ElementLibraryButton.js +2 -1
  26. package/dist/components/InspectorPanel/KeyframeEasingNavigator.js +1 -1
  27. package/dist/components/InspectorPanel/KeyframeInspector.js +28 -24
  28. package/dist/components/InspectorPanel/MultiSequenceInspector.js +32 -1
  29. package/dist/components/InspectorPanel/MultiSequenceNumberField.js +1 -1
  30. package/dist/components/InspectorPanel/SequenceInspectorHeader.d.ts +3 -1
  31. package/dist/components/InspectorPanel/SequenceSelectionInspector.js +70 -2
  32. package/dist/components/InspectorPanel/SequenceWrapAction.d.ts +8 -0
  33. package/dist/components/InspectorPanel/SequenceWrapAction.js +151 -0
  34. package/dist/components/InspectorPanel/common.js +1 -0
  35. package/dist/components/InspectorPanel/easing-inspector-selection.d.ts +2 -1
  36. package/dist/components/InspectorPanel/easing-inspector-selection.js +4 -3
  37. package/dist/components/InspectorPanel/keyframe-inspector-frame.d.ts +2 -1
  38. package/dist/components/InspectorPanel/keyframe-inspector-frame.js +2 -2
  39. package/dist/components/InspectorPanel/styles.js +2 -0
  40. package/dist/components/InspectorPanel/use-composition-actions.js +1 -0
  41. package/dist/components/InspectorSequenceSection.d.ts +1 -0
  42. package/dist/components/InspectorSequenceSection.js +7 -5
  43. package/dist/components/InspectorSourceLocation.js +3 -0
  44. package/dist/components/KeyboardShortcutsSettings.js +1 -1
  45. package/dist/components/Menu/styles.d.ts +2 -2
  46. package/dist/components/MenuBuildIndicator.js +1 -0
  47. package/dist/components/Modals.js +7 -6
  48. package/dist/components/ModelManager.js +10 -9
  49. package/dist/components/NewComposition/CancelButton.js +11 -5
  50. package/dist/components/NewComposition/InputDragger.d.ts +3 -1
  51. package/dist/components/NewComposition/InputDragger.js +28 -9
  52. package/dist/components/NewComposition/NewComposition.js +7 -6
  53. package/dist/components/NewComposition/RemInput.d.ts +1 -1
  54. package/dist/components/NewComposition/menu-typeahead.js +1 -1
  55. package/dist/components/Preview.js +4 -0
  56. package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +1 -0
  57. package/dist/components/QuickSwitcher/QuickSwitcherContent.js +1 -0
  58. package/dist/components/RadioButton.js +1 -0
  59. package/dist/components/RenderModal/DataEditor.js +4 -1
  60. package/dist/components/RenderModal/SchemaEditor/create-zod-values.js +1 -2
  61. package/dist/components/RenderModal/WebRenderModalPicture.js +1 -2
  62. package/dist/components/RenderQueue/CaptionQueueItem.js +19 -7
  63. package/dist/components/RenderQueue/CaptionQueueProcessor.js +65 -15
  64. package/dist/components/RenderQueue/QueueJobError.d.ts +8 -0
  65. package/dist/components/RenderQueue/QueueJobError.js +24 -0
  66. package/dist/components/RenderQueue/QueueJobErrorModal.d.ts +8 -0
  67. package/dist/components/RenderQueue/QueueJobErrorModal.js +63 -0
  68. package/dist/components/RenderQueue/RenderQueueItemCancelButton.d.ts +3 -1
  69. package/dist/components/RenderQueue/RenderQueueItemCancelButton.js +11 -4
  70. package/dist/components/RenderQueue/RenderQueueRepeat.d.ts +3 -1
  71. package/dist/components/RenderQueue/RenderQueueRepeat.js +20 -3
  72. package/dist/components/RenderQueue/VideoMattingQueueItem.js +25 -27
  73. package/dist/components/RenderQueue/VideoMattingQueueProcessor.js +68 -28
  74. package/dist/components/RenderQueue/caption-job-types.d.ts +9 -1
  75. package/dist/components/RenderQueue/context.d.ts +4 -0
  76. package/dist/components/RenderQueue/context.js +58 -8
  77. package/dist/components/RenderQueue/index.js +3 -3
  78. package/dist/components/RenderQueue/load-model-for-job.d.ts +2 -1
  79. package/dist/components/RenderQueue/load-model-for-job.js +5 -1
  80. package/dist/components/RenderQueue/video-matting-job-types.d.ts +13 -6
  81. package/dist/components/RendersTab.js +2 -0
  82. package/dist/components/SelectedOutlineCropControls.js +2 -1
  83. package/dist/components/SelectedOutlineEditingHandles.js +9 -2
  84. package/dist/components/SelectedOutlineElement.js +9 -3
  85. package/dist/components/SelectedOutlineKeyboardControls.d.ts +2 -4
  86. package/dist/components/SelectedOutlineKeyboardControls.js +4 -22
  87. package/dist/components/SelectedOutlineOverlay.js +152 -106
  88. package/dist/components/SelectedOutlinePathPoints.d.ts +8 -0
  89. package/dist/components/SelectedOutlinePathPoints.js +433 -0
  90. package/dist/components/SelectedOutlinePolygon.js +21 -46
  91. package/dist/components/SelectedOutlineRenderer.d.ts +3 -5
  92. package/dist/components/SelectedOutlineRenderer.js +32 -136
  93. package/dist/components/SelectedOutlineSnapIndicators.d.ts +6 -0
  94. package/dist/components/SelectedOutlineSnapIndicators.js +16 -12
  95. package/dist/components/SelectedOutlineTransformOriginHandle.js +3 -2
  96. package/dist/components/SelectedOutlineUvControls.js +12 -7
  97. package/dist/components/SequencePropsSubscriptionProvider.d.ts +3 -0
  98. package/dist/components/SequencePropsSubscriptionProvider.js +8 -6
  99. package/dist/components/SettingsModal.js +30 -3
  100. package/dist/components/SettingsModalFooter.d.ts +1 -0
  101. package/dist/components/SettingsModalFooter.js +7 -3
  102. package/dist/components/ShowOutlinesProvider.js +1 -1
  103. package/dist/components/SkillsSettings.d.ts +0 -1
  104. package/dist/components/SkillsSettings.js +13 -14
  105. package/dist/components/Splitter/SplitterElement.js +1 -2
  106. package/dist/components/TimeValue.js +1 -1
  107. package/dist/components/Timeline/LoopedTimelineIndicators.d.ts +1 -0
  108. package/dist/components/Timeline/LoopedTimelineIndicators.js +7 -6
  109. package/dist/components/Timeline/TimelineArrayField.js +1 -1
  110. package/dist/components/Timeline/TimelineClipboardKeybindings.js +0 -1
  111. package/dist/components/Timeline/TimelineColorField.js +1 -1
  112. package/dist/components/Timeline/TimelineDeleteKeybindings.js +6 -9
  113. package/dist/components/Timeline/TimelineDragHandler.js +1 -1
  114. package/dist/components/Timeline/TimelineEffectItem.js +1 -0
  115. package/dist/components/Timeline/TimelineEffectPropItem.d.ts +1 -0
  116. package/dist/components/Timeline/TimelineEffectPropItem.js +12 -5
  117. package/dist/components/Timeline/TimelineExpandArrowButton.js +1 -0
  118. package/dist/components/Timeline/TimelineExpandedRow.d.ts +1 -0
  119. package/dist/components/Timeline/TimelineExpandedRow.js +6 -4
  120. package/dist/components/Timeline/TimelineExpandedSection.d.ts +1 -0
  121. package/dist/components/Timeline/TimelineExpandedSection.js +2 -2
  122. package/dist/components/Timeline/TimelineExpandedTrackKeyframes.d.ts +1 -0
  123. package/dist/components/Timeline/TimelineExpandedTrackKeyframes.js +3 -1
  124. package/dist/components/Timeline/TimelineFieldLabel.js +1 -0
  125. package/dist/components/Timeline/TimelineFontFamilyField.js +12 -12
  126. package/dist/components/Timeline/TimelineKeyframeControls.d.ts +1 -0
  127. package/dist/components/Timeline/TimelineKeyframeControls.js +40 -28
  128. package/dist/components/Timeline/TimelineLayerChildren.js +1 -1
  129. package/dist/components/Timeline/TimelineList.js +1 -1
  130. package/dist/components/Timeline/TimelineNumberField.js +2 -4
  131. package/dist/components/Timeline/TimelinePrimitiveFieldValue.js +1 -1
  132. package/dist/components/Timeline/TimelineSelection.d.ts +9 -9
  133. package/dist/components/Timeline/TimelineSelection.js +16 -9
  134. package/dist/components/Timeline/TimelineSequence.d.ts +3 -1
  135. package/dist/components/Timeline/TimelineSequence.js +65 -21
  136. package/dist/components/Timeline/TimelineSequenceFrame.js +1 -0
  137. package/dist/components/Timeline/TimelineSequenceItem.d.ts +1 -0
  138. package/dist/components/Timeline/TimelineSequenceItem.js +46 -8
  139. package/dist/components/Timeline/TimelineSequencePropItem.d.ts +3 -0
  140. package/dist/components/Timeline/TimelineSequencePropItem.js +262 -25
  141. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +11 -13
  142. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +98 -77
  143. package/dist/components/Timeline/TimelineTextContentField.js +27 -4
  144. package/dist/components/Timeline/TimelineTimeIndicators.js +10 -5
  145. package/dist/components/Timeline/TimelineTrack.js +1 -1
  146. package/dist/components/Timeline/TimelineTrimTooltip.d.ts +11 -0
  147. package/dist/components/Timeline/TimelineTrimTooltip.js +41 -0
  148. package/dist/components/Timeline/TimelineVideoInfo.d.ts +1 -0
  149. package/dist/components/Timeline/TimelineVideoInfo.js +13 -10
  150. package/dist/components/Timeline/TimelineViewport.d.ts +1 -0
  151. package/dist/components/Timeline/TimelineViewport.js +10 -1
  152. package/dist/components/Timeline/delete-selected-keyframe.js +22 -8
  153. package/dist/components/Timeline/delete-selected-timeline-item.d.ts +1 -5
  154. package/dist/components/Timeline/delete-selected-timeline-item.js +9 -95
  155. package/dist/components/Timeline/get-animation-item-selection-for-frame.d.ts +2 -1
  156. package/dist/components/Timeline/get-animation-item-selection-for-frame.js +7 -5
  157. package/dist/components/Timeline/get-keyframed-sequence-drag-targets.d.ts +23 -0
  158. package/dist/components/Timeline/get-keyframed-sequence-drag-targets.js +57 -0
  159. package/dist/components/Timeline/get-node-keyframes.d.ts +2 -1
  160. package/dist/components/Timeline/get-node-keyframes.js +6 -4
  161. package/dist/components/Timeline/get-playback-rate-keyframe-changes.d.ts +21 -0
  162. package/dist/components/Timeline/get-playback-rate-keyframe-changes.js +142 -0
  163. package/dist/components/Timeline/get-sequence-context-menu-items.d.ts +3 -1
  164. package/dist/components/Timeline/get-sequence-context-menu-items.js +13 -1
  165. package/dist/components/Timeline/get-timeline-keyframes.d.ts +15 -2
  166. package/dist/components/Timeline/get-timeline-keyframes.js +44 -6
  167. package/dist/components/Timeline/keyframe-clipboard.js +17 -3
  168. package/dist/components/Timeline/split-selected-timeline-item.d.ts +13 -10
  169. package/dist/components/Timeline/split-selected-timeline-item.js +61 -35
  170. package/dist/components/Timeline/timeline-field-display-utils.js +1 -0
  171. package/dist/components/Timeline/timeline-field-row-layout.js +1 -0
  172. package/dist/components/Timeline/use-delete-timeline-items.js +17 -11
  173. package/dist/components/Timeline/use-expanded-track-keyframe-rows.d.ts +2 -1
  174. package/dist/components/Timeline/use-expanded-track-keyframe-rows.js +3 -1
  175. package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.js +7 -3
  176. package/dist/components/Timeline/use-timeline-keyframe-drag.js +28 -19
  177. package/dist/components/TimelineCombobox.js +1 -0
  178. package/dist/components/Transcription/Models.js +1 -1
  179. package/dist/components/Transcription/TranscriptionModal.js +18 -11
  180. package/dist/components/Transcription/TranscriptionModalWithOptionalWhisper.js +1 -1
  181. package/dist/components/Transcription/resample-media-to-16-khz.d.ts +2 -1
  182. package/dist/components/Transcription/resample-media-to-16-khz.js +20 -2
  183. package/dist/components/UpdatesSettings.js +2 -0
  184. package/dist/components/VideoMatting/Models.js +1 -1
  185. package/dist/components/VideoMatting/VideoMattingModal.js +30 -47
  186. package/dist/components/VideoMatting/VideoMattingModalWithOptionalPackage.js +1 -1
  187. package/dist/components/WebMcp.js +23 -40
  188. package/dist/components/composition-drop-preview.d.ts +9 -2
  189. package/dist/components/composition-drop-preview.js +8 -4
  190. package/dist/components/composition-menu-items.js +4 -4
  191. package/dist/components/delete-jsx-nodes-api.d.ts +2 -0
  192. package/dist/components/{delete-jsx-node-api.js → delete-jsx-nodes-api.js} +5 -5
  193. package/dist/components/effect-drag-and-drop.d.ts +13 -5
  194. package/dist/components/effect-drag-and-drop.js +19 -4
  195. package/dist/components/get-open-in-menu-items.d.ts +2 -1
  196. package/dist/components/get-open-in-menu-items.js +24 -8
  197. package/dist/components/keyboard-shortcuts.d.ts +4 -4
  198. package/dist/components/keyboard-shortcuts.js +3 -1
  199. package/dist/components/public-output-name.d.ts +1 -0
  200. package/dist/components/public-output-name.js +7 -3
  201. package/dist/components/selected-outline-drag.d.ts +1 -6
  202. package/dist/components/selected-outline-drag.js +22 -6
  203. package/dist/components/selected-outline-geometry.d.ts +2 -18
  204. package/dist/components/selected-outline-measurement.d.ts +23 -41
  205. package/dist/components/selected-outline-measurement.js +14 -252
  206. package/dist/components/selected-outline-order.d.ts +4 -11
  207. package/dist/components/selected-outline-order.js +2 -254
  208. package/dist/components/selected-outline-snap.d.ts +1 -1
  209. package/dist/components/selected-outline-snap.js +2 -1
  210. package/dist/components/selected-outline-types.d.ts +18 -28
  211. package/dist/components/selected-outline-uv.d.ts +4 -4
  212. package/dist/components/selected-outline-uv.js +6 -111
  213. package/dist/components/sequence-props-api.js +0 -10
  214. package/dist/components/use-selected-outline-control-target.js +12 -21
  215. package/dist/components/wrap-jsx-node-api.d.ts +2 -0
  216. package/dist/components/wrap-jsx-node-api.js +13 -0
  217. package/dist/error-overlay/remotion-overlay/OpenInEditor.js +45 -2
  218. package/dist/error-overlay/remotion-overlay/StackFrame.js +32 -3
  219. package/dist/esm/{CaptionQueueProcessor-k0yrm3dj.mjs → CaptionQueueProcessor-nr7hjcga.mjs} +96 -19
  220. package/dist/esm/LazyModels-ajkn7fs3.mjs +12 -0
  221. package/dist/esm/LazyModels-g1g7cf4e.mjs +12 -0
  222. package/dist/esm/{TranscriptionModal-ymnx1c7m.mjs → TranscriptionModal-e18bzbkb.mjs} +30 -22
  223. package/dist/esm/{VideoMattingModal-05vpczks.mjs → VideoMattingModal-5bz2s4rs.mjs} +47 -62
  224. package/dist/esm/{VideoMattingQueueProcessor-t1hgm2rm.mjs → VideoMattingQueueProcessor-4tkj0f4k.mjs} +69 -26
  225. package/dist/esm/{index-v4tr1bft.mjs → index-09txs1bj.mjs} +5 -0
  226. package/dist/esm/{index-4dsz9035.mjs → index-5ycb9e9q.mjs} +2 -4
  227. package/dist/esm/index-890dd9b3.mjs +768 -0
  228. package/dist/esm/{index-5bfxbpca.mjs → index-8nt6a0mw.mjs} +3 -3
  229. package/dist/esm/{index-5gd8k9yv.mjs → index-9q9w8v9p.mjs} +3 -3
  230. package/dist/esm/{index-x40wwfmt.mjs → index-c2wabcdt.mjs} +8 -6
  231. package/dist/esm/index-dfy1t576.mjs +129 -0
  232. package/dist/esm/index-dh3zk2hv.mjs +220 -0
  233. package/dist/esm/{index-0gewwxse.mjs → index-dpyss74p.mjs} +6179 -5011
  234. package/dist/esm/{index-9x6e1dq0.mjs → index-hqxc6tzp.mjs} +40 -6
  235. package/dist/esm/{index-cdy8v54v.mjs → index-qve7mdfp.mjs} +36 -539
  236. package/dist/esm/{index-eb5txqp6.mjs → index-s6qya2gg.mjs} +8 -88
  237. package/dist/esm/index-t7tbt980.mjs +103 -0
  238. package/dist/esm/{index-g7k2dvar.mjs → index-t7xnxdf8.mjs} +44 -26
  239. package/dist/esm/index-wqc43mw0.mjs +158 -0
  240. package/dist/esm/{index-bs39wngg.mjs → index-x6r9bn12.mjs} +5623 -6218
  241. package/dist/esm/{index-f97r9e2g.mjs → index-xac20sv4.mjs} +46 -57
  242. package/dist/esm/index.mjs +4 -4
  243. package/dist/esm/internals.mjs +13 -10
  244. package/dist/esm/previewEntry.mjs +18 -12
  245. package/dist/esm/renderEntry.mjs +5 -1
  246. package/dist/esm/{resolve-composition-component-location-bt2d6qxq.mjs → resolve-composition-component-location-2hgf6g0a.mjs} +1 -1
  247. package/dist/helpers/calculate-timeline.d.ts +5 -1
  248. package/dist/helpers/calculate-timeline.js +1 -1
  249. package/dist/helpers/checkerboard-background.d.ts +2 -2
  250. package/dist/helpers/colors.d.ts +132 -112
  251. package/dist/helpers/colors.js +117 -95
  252. package/dist/helpers/copy-text.js +1 -16
  253. package/dist/helpers/create-folder-tree.js +2 -1
  254. package/dist/helpers/editor-guide-selection.d.ts +1 -1
  255. package/dist/helpers/editor-ruler.js +23 -12
  256. package/dist/helpers/get-connected-compositions.d.ts +6 -1
  257. package/dist/helpers/get-connected-compositions.js +1 -1
  258. package/dist/helpers/get-sequence-double-click-action.js +1 -1
  259. package/dist/helpers/get-sequence-visible-range.d.ts +1 -1
  260. package/dist/helpers/get-sequence-visible-range.js +2 -5
  261. package/dist/helpers/get-timeline-nestedness.d.ts +1 -1
  262. package/dist/helpers/get-timeline-nestedness.js +1 -1
  263. package/dist/helpers/get-timeline-sequence-sort-key.d.ts +1 -1
  264. package/dist/helpers/get-timeline-sequence-sort-key.js +1 -1
  265. package/dist/helpers/hoverable.js +6 -5
  266. package/dist/helpers/inject-css.js +5 -7
  267. package/dist/helpers/open-in-editor.js +1 -1
  268. package/dist/helpers/prism-vsc-dark-plus.d.ts +1 -1
  269. package/dist/helpers/prism-vsc-dark-plus.js +52 -51
  270. package/dist/helpers/resolve-studio-color.d.ts +1 -0
  271. package/dist/helpers/resolve-studio-color.js +11 -0
  272. package/dist/helpers/studio-css-variables.d.ts +1 -0
  273. package/dist/helpers/studio-css-variables.js +105 -0
  274. package/dist/helpers/studio-pixel-ratio.d.ts +1 -0
  275. package/dist/helpers/studio-pixel-ratio.js +7 -0
  276. package/dist/helpers/studio-runtime-config.d.ts +1 -1
  277. package/dist/helpers/timeline-node-path-key.d.ts +1 -1
  278. package/dist/helpers/timeline-node-path-key.js +2 -2
  279. package/dist/helpers/use-keybinding.d.ts +1 -1
  280. package/dist/helpers/use-keyboard-shortcut-label.d.ts +2 -2
  281. package/dist/helpers/use-menu-structure.js +15 -9
  282. package/dist/helpers/use-runtime-values.js +2 -28
  283. package/dist/hot-middleware-client/client.js +5 -3
  284. package/dist/icons/align-center-horizontal.js +2 -1
  285. package/dist/icons/align-left.js +2 -1
  286. package/dist/icons/align-right.js +2 -1
  287. package/dist/icons/{separation.d.ts → background-removal.d.ts} +1 -1
  288. package/dist/icons/background-removal.js +9 -0
  289. package/dist/icons/wrap.d.ts +4 -0
  290. package/dist/icons/wrap.js +10 -0
  291. package/dist/previewEntry.js +2 -0
  292. package/dist/renderEntry.js +2 -0
  293. package/dist/state/modals.d.ts +20 -1
  294. package/dist/state/timeline-sequence-hover.d.ts +6 -16
  295. package/dist/state/timeline-sequence-hover.js +6 -67
  296. package/dist/state/timeline-zoom.js +4 -0
  297. package/package.json +20 -19
  298. package/dist/components/Timeline/get-easing-selection-after-keyframe-delete.d.ts +0 -15
  299. package/dist/components/Timeline/get-easing-selection-after-keyframe-delete.js +0 -31
  300. package/dist/components/delete-jsx-node-api.d.ts +0 -2
  301. package/dist/esm/LazyModels-mtggyjye.mjs +0 -11
  302. package/dist/esm/LazyModels-nk7py0zt.mjs +0 -11
  303. package/dist/esm/index-cw0pnpg5.mjs +0 -50
  304. package/dist/esm/index-k426ye99.mjs +0 -139
  305. package/dist/helpers/get-box-quads-polyfill-internals.d.ts +0 -82
  306. package/dist/helpers/get-box-quads-polyfill-internals.js +0 -2403
  307. package/dist/helpers/get-box-quads-ponyfill.d.ts +0 -10
  308. package/dist/helpers/get-box-quads-ponyfill.js +0 -23
  309. package/dist/icons/separation.js +0 -7
@@ -7,15 +7,12 @@ const remotion_1 = require("remotion");
7
7
  const use_keybinding_1 = require("../helpers/use-keybinding");
8
8
  const NotificationCenter_1 = require("./Notifications/NotificationCenter");
9
9
  const selected_outline_drag_1 = require("./selected-outline-drag");
10
- const selected_outline_measurement_1 = require("./selected-outline-measurement");
11
10
  const selected_outline_types_1 = require("./selected-outline-types");
12
11
  const call_add_keyframe_1 = require("./Timeline/call-add-keyframe");
13
12
  const imperative_state_1 = require("./Timeline/imperative-state");
14
13
  const save_sequence_prop_1 = require("./Timeline/save-sequence-prop");
15
14
  const timeline_scroll_logic_1 = require("./Timeline/timeline-scroll-logic");
16
- const TimelineSelection_1 = require("./Timeline/TimelineSelection");
17
- const SelectedOutlineKeyboardControls = ({ getLatestOutlineTargetByKey, getSelectableOutlines }) => {
18
- const currentSelection = (0, TimelineSelection_1.useCurrentTimelineSelectionStateAsRef)();
15
+ const SelectedOutlineKeyboardControls = ({ getAllDragTargets }) => {
19
16
  const { getDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeDragOverridesContext);
20
17
  const { setPropStatuses, setDragOverrides, clearDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
21
18
  const { frameBack, frameForward, getCurrentFrame, seek } = player_1.PlayerInternals.usePlayerMethods();
@@ -143,21 +140,8 @@ const SelectedOutlineKeyboardControls = ({ getLatestOutlineTargetByKey, getSelec
143
140
  if (direction === null) {
144
141
  return;
145
142
  }
146
- const { selectedItems } = currentSelection.current;
147
- const selectedSequenceKeys = (0, selected_outline_measurement_1.getSelectedSequenceKeys)(selectedItems);
148
- const sequenceKeysContainingSelection = (0, selected_outline_measurement_1.getSequenceKeysContainingSelection)(selectedItems);
149
- const selectableOutlines = getSelectableOutlines();
150
- const allDragTargets = selectableOutlines.flatMap(({ key }) => {
151
- var _a;
152
- var _b;
153
- if (!selectedSequenceKeys.has(key) &&
154
- !sequenceKeysContainingSelection.has(key)) {
155
- return [];
156
- }
157
- const drag = (_b = (_a = getLatestOutlineTargetByKey(key)) === null || _a === void 0 ? void 0 : _a.drag) !== null && _b !== void 0 ? _b : null;
158
- return drag === null ? [] : [drag];
159
- });
160
- if (selectedItems.length === 0 || allDragTargets.length === 0) {
143
+ const allDragTargets = getAllDragTargets();
144
+ if (allDragTargets.length === 0) {
161
145
  seekWithArrowKey(event, direction);
162
146
  return;
163
147
  }
@@ -215,11 +199,9 @@ const SelectedOutlineKeyboardControls = ({ getLatestOutlineTargetByKey, getSelec
215
199
  }
216
200
  }
217
201
  }, [
218
- currentSelection,
202
+ getAllDragTargets,
219
203
  getCurrentFrame,
220
204
  getDragOverrides,
221
- getLatestOutlineTargetByKey,
222
- getSelectableOutlines,
223
205
  seekWithArrowKey,
224
206
  setDragOverrides,
225
207
  ]);
@@ -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
- const firstNodePathInfoBySourceNode = new Map();
154
- const selectedSourceNodeKeys = new Set();
155
- for (const { key, nodePathInfo } of selectableOutlines) {
156
- const sourceNodeKey = (0, timeline_node_path_key_1.timelineSequenceNodePathToKey)(nodePathInfo.sequenceSubscriptionKey);
157
- if (selectedSequenceKeys.has(key)) {
158
- selectedSourceNodeKeys.add(sourceNodeKey);
159
- }
160
- const currentFirst = firstNodePathInfoBySourceNode.get(sourceNodeKey);
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
- key,
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
- : selectedTransformOriginInfo.displayFrame -
326
- (0, get_timeline_keyframes_1.getKeyframeDisplayOffset)({
327
- propStatus: transformOriginPropStatus,
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 = (selectedCropInfo === null || selectedCropInfo === void 0 ? void 0 : selectedCropInfo.displayFrame) === null ||
344
- (selectedCropInfo === null || selectedCropInfo === void 0 ? void 0 : selectedCropInfo.displayFrame) === undefined
345
- ? sourceFrame
346
- : selectedCropInfo.displayFrame - nodeKeyframeDisplayOffset;
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((_d = remotion_1.Internals.getEffectiveVisualModeValue({
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 && _d !== void 0 ? _d : transformOriginFieldSchema.default),
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
- ? ((_e = remotion_1.Internals.getEffectiveVisualModeValue({
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 && _e !== void 0 ? _e : '0deg')
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((_f = remotion_1.Internals.getEffectiveVisualModeValue({
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 && _f !== void 0 ? _f : 1)
472
+ })) !== null && _g !== void 0 ? _g : 1)
470
473
  : '1',
471
474
  schema: controls.schema,
472
- sourceFrame: transformOriginSourceFrame,
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((_g = remotion_1.Internals.getEffectiveVisualModeValue({
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 && _g !== void 0 ? _g : fieldSchema.default),
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
- if (measureAllOutlines) {
496
- return selectableOutlines;
497
- }
498
- // A timeline item can represent multiple connected canvas instances.
499
- // Keep every instance of an active source node without calculating targets
500
- // for unrelated timeline items while the canvas itself is inactive.
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.useCallback)((timelinePosition) => {
579
- if (isFullscreen ||
580
- !(0, interactivity_enabled_1.isStudioSelectionEnabled)() ||
581
- !previewSelectionAvailable ||
582
- !editorShowOutlines) {
583
- return [];
584
- }
585
- return (0, selected_outline_measurement_1.getSequencesWithSelectableOutlines)({
586
- sequences,
587
- overrideIdsToNodePaths: overrideIdToNodePathMappings,
588
- compositions,
589
- timelinePosition,
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 getCurrentSelectableOutlines = (0, react_1.useCallback)(() => getSelectableOutlinesAtFrame(getCurrentFrame()), [getCurrentFrame, getSelectableOutlinesAtFrame]);
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 = canvasHovered ||
680
- draggingOutline ||
681
- canvasContextMenuOpen ||
682
- sequenceKeysContainingSelection.size > 0 ||
683
- (hoveredSequence === null || hoveredSequence === void 0 ? void 0 : hoveredSequence.source) === 'timeline';
684
- const measureAllOutlines = canvasHovered || draggingOutline || canvasContextMenuOpen;
685
- const hoveredTimelineNodePathKey = (hoveredSequence === null || hoveredSequence === void 0 ? void 0 : hoveredSequence.source) === 'timeline' ? hoveredSequence.nodePathKey : null;
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, { getLatestOutlineTargetByKey: getLatestOutlineTargetByKey, getSelectableOutlines: getCurrentSelectableOutlines }), measurementActive ? (jsx_runtime_1.jsx(ActiveSelectedOutlineOverlay, { calculateOutlineTargetsForCurrentState: calculateOutlineTargetsForCurrentState, compositionHeight: compositionHeight, compositionWidth: compositionWidth, draggingOutline: draggingOutline, 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] }));
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
+ }>;