@remotion/studio 4.0.505 → 4.0.507

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 (208) hide show
  1. package/dist/api/copy-render-output-to-asset.d.ts +4 -0
  2. package/dist/api/copy-render-output-to-asset.js +11 -0
  3. package/dist/api/install-package.d.ts +2 -3
  4. package/dist/api/install-package.js +1 -3
  5. package/dist/api/visual-control.d.ts +3 -0
  6. package/dist/api/visual-control.js +3 -0
  7. package/dist/components/AssetSelector.js +19 -4
  8. package/dist/components/AssetSelectorItem.js +3 -3
  9. package/dist/components/Canvas.js +2 -0
  10. package/dist/components/CodingAgentIcon.d.ts +4 -0
  11. package/dist/components/CodingAgentIcon.js +17 -0
  12. package/dist/components/CompositionSelector.js +1 -1
  13. package/dist/components/CompositionSelectorItem.js +1 -1
  14. package/dist/components/ConfigureDefaultEditorModal.d.ts +1 -1
  15. package/dist/components/ConfigureDefaultEditorModal.js +117 -69
  16. package/dist/components/ConfigureLicenseModal.d.ts +1 -3
  17. package/dist/components/ConfigureLicenseModal.js +105 -89
  18. package/dist/components/ConfirmationDialog.js +2 -2
  19. package/dist/components/ContextMenu.js +10 -8
  20. package/dist/components/Editor.js +2 -0
  21. package/dist/components/EditorContexts.js +6 -5
  22. package/dist/components/EffectPickerModal.js +1 -1
  23. package/dist/components/ExpandedTracksProvider.js +10 -53
  24. package/dist/components/GlobalKeybindings.js +3 -2
  25. package/dist/components/InlineCaptionInspector.d.ts +2 -2
  26. package/dist/components/InlineDropdown.d.ts +2 -1
  27. package/dist/components/InlineDropdown.js +10 -4
  28. package/dist/components/InspectorLocationCopy.js +8 -8
  29. package/dist/components/InspectorOpenInEditor.d.ts +2 -0
  30. package/dist/components/InspectorOpenInEditor.js +63 -49
  31. package/dist/components/InspectorPanel/AlignmentControls.js +5 -2
  32. package/dist/components/InspectorPanel/CompositionInspector.js +15 -1
  33. package/dist/components/InspectorPanel/ConnectedCompositionsSection.js +1 -1
  34. package/dist/components/InspectorPanel/EasingInspector.js +7 -4
  35. package/dist/components/InspectorPanel/KeyframeInspector.js +5 -1
  36. package/dist/components/InspectorPanel/SequenceInspectorHeader.d.ts +3 -0
  37. package/dist/components/InspectorPanel/SequenceInspectorHeader.js +22 -4
  38. package/dist/components/InspectorPanel/SequenceSelectionInspector.js +1 -1
  39. package/dist/components/InspectorPanel/common.d.ts +1 -0
  40. package/dist/components/InspectorPanel/common.js +2 -2
  41. package/dist/components/InspectorPanel/use-composition-actions.js +4 -1
  42. package/dist/components/InspectorSequenceSection.js +4 -4
  43. package/dist/components/InstallPackage.js +1 -1
  44. package/dist/components/Menu/MenuSectionHeader.d.ts +4 -0
  45. package/dist/components/Menu/MenuSectionHeader.js +20 -0
  46. package/dist/components/Menu/SubMenu.js +13 -2
  47. package/dist/components/Menu/menu-tree-context.d.ts +3 -0
  48. package/dist/components/Menu/menu-tree-context.js +13 -0
  49. package/dist/components/MenuBuildIndicator.js +1 -0
  50. package/dist/components/MenuToolbar.js +1 -1
  51. package/dist/components/ModalFooter.d.ts +1 -0
  52. package/dist/components/ModalFooter.js +6 -2
  53. package/dist/components/ModalHeader.js +1 -1
  54. package/dist/components/Modals.js +18 -7
  55. package/dist/components/ModalsProvider.js +5 -6
  56. package/dist/components/NewComposition/CodemodFooter.js +1 -1
  57. package/dist/components/NewComposition/ComboBox.d.ts +6 -1
  58. package/dist/components/NewComposition/DismissableModal.js +1 -1
  59. package/dist/components/NewComposition/MenuContent.js +27 -19
  60. package/dist/components/NewComposition/RenameStaticFile.js +1 -1
  61. package/dist/components/NewComposition/menu-typeahead.js +2 -2
  62. package/dist/components/OverrideInputProps.js +1 -1
  63. package/dist/components/PlayPause.js +2 -1
  64. package/dist/components/PlaybackKeyboardShortcutsManager.js +7 -5
  65. package/dist/components/Preview.js +29 -4
  66. package/dist/components/PreviewToolbarOverflowButton.js +4 -2
  67. package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +1 -1
  68. package/dist/components/QuickSwitcher/QuickSwitcherContent.js +1 -1
  69. package/dist/components/RenderButton.d.ts +3 -3
  70. package/dist/components/RenderButton.js +42 -7
  71. package/dist/components/RenderModal/RenderStatusModal.js +1 -1
  72. package/dist/components/RenderModal/SchemaEditor/ZodEnumEditor.d.ts +1 -0
  73. package/dist/components/RenderModal/SchemaEditor/ZodEnumEditor.js +2 -2
  74. package/dist/components/RenderModal/SchemaEditor/ZodOrNullishEditor.js +3 -3
  75. package/dist/components/RenderModal/SchemaEditor/ZodSwitch.js +1 -1
  76. package/dist/components/RenderModal/ServerRenderModal.js +5 -1
  77. package/dist/components/RenderModal/WebRenderModal.js +3 -2
  78. package/dist/components/RenderQueue/RenderQueueError.js +1 -1
  79. package/dist/components/RenderQueue/RenderQueueItem.js +8 -2
  80. package/dist/components/RenderQueue/RenderQueueItemStatus.js +1 -1
  81. package/dist/components/RenderQueue/RenderQueueProgressMessage.js +1 -1
  82. package/dist/components/RenderQueue/RenderQueueRepeat.js +1 -1
  83. package/dist/components/RenderQueue/actions.d.ts +4 -2
  84. package/dist/components/RenderQueue/actions.js +4 -2
  85. package/dist/components/RenderQueue/index.js +3 -4
  86. package/dist/components/RenderQueue/use-render-output-file-drag.d.ts +8 -0
  87. package/dist/components/RenderQueue/use-render-output-file-drag.js +121 -0
  88. package/dist/components/SegmentedControl.js +0 -1
  89. package/dist/components/SelectedOutlineElement.d.ts +14 -17
  90. package/dist/components/SelectedOutlineElement.js +113 -931
  91. package/dist/components/SelectedOutlineKeyboardControls.d.ts +7 -0
  92. package/dist/components/SelectedOutlineKeyboardControls.js +261 -0
  93. package/dist/components/SelectedOutlineOverlay.d.ts +6 -13
  94. package/dist/components/SelectedOutlineOverlay.js +360 -832
  95. package/dist/components/SelectedOutlinePolygon.d.ts +25 -0
  96. package/dist/components/SelectedOutlinePolygon.js +359 -0
  97. package/dist/components/SelectedOutlineRenderer.d.ts +18 -0
  98. package/dist/components/SelectedOutlineRenderer.js +208 -0
  99. package/dist/components/SelectedOutlineRotationCornerHandle.d.ts +16 -0
  100. package/dist/components/SelectedOutlineRotationCornerHandle.js +269 -0
  101. package/dist/components/SelectedOutlineScaleEdgeLine.d.ts +16 -0
  102. package/dist/components/SelectedOutlineScaleEdgeLine.js +211 -0
  103. package/dist/components/SelectedOutlineSnapIndicators.d.ts +9 -0
  104. package/dist/components/SelectedOutlineSnapIndicators.js +29 -0
  105. package/dist/components/SelectedOutlineTransformOriginHandle.d.ts +9 -0
  106. package/dist/components/SelectedOutlineTransformOriginHandle.js +286 -0
  107. package/dist/components/SelectedOutlineUvControls.d.ts +3 -9
  108. package/dist/components/SelectedOutlineUvControls.js +57 -12
  109. package/dist/components/SettingsContext.d.ts +15 -0
  110. package/dist/components/SettingsContext.js +116 -0
  111. package/dist/components/SettingsModal.d.ts +7 -0
  112. package/dist/components/SettingsModal.js +56 -0
  113. package/dist/components/SettingsModalFooter.d.ts +2 -0
  114. package/dist/components/SettingsModalFooter.js +44 -0
  115. package/dist/components/ShowOutlinesProvider.js +2 -3
  116. package/dist/components/SidebarRenderButton.js +1 -1
  117. package/dist/components/SvgImportDialog.js +2 -2
  118. package/dist/components/TimeValue.js +1 -1
  119. package/dist/components/Timeline/EasingEditorModal.js +66 -22
  120. package/dist/components/Timeline/Timeline.js +23 -5
  121. package/dist/components/Timeline/TimelineAssetField.js +1 -1
  122. package/dist/components/Timeline/TimelineDragHandler.js +3 -3
  123. package/dist/components/Timeline/TimelineDuplicateCount.d.ts +4 -0
  124. package/dist/components/Timeline/TimelineDuplicateCount.js +28 -0
  125. package/dist/components/Timeline/TimelineEffectPropItem.js +5 -3
  126. package/dist/components/Timeline/TimelineExpandedKeyframeRow.js +3 -23
  127. package/dist/components/Timeline/TimelineExpandedRow.d.ts +4 -2
  128. package/dist/components/Timeline/TimelineExpandedRow.js +2 -2
  129. package/dist/components/Timeline/TimelineExpandedTrackKeyframes.d.ts +4 -2
  130. package/dist/components/Timeline/TimelineExpandedTrackKeyframes.js +11 -1
  131. package/dist/components/Timeline/TimelineFontFamilyField.js +3 -1
  132. package/dist/components/Timeline/TimelineKeyframeControls.js +1 -0
  133. package/dist/components/Timeline/TimelineSelection.js +1 -0
  134. package/dist/components/Timeline/TimelineSequence.js +28 -25
  135. package/dist/components/Timeline/TimelineSequenceItem.js +74 -58
  136. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +1 -1
  137. package/dist/components/Timeline/TimelineTrack.js +2 -1
  138. package/dist/components/Timeline/get-sequence-context-menu-items.d.ts +6 -3
  139. package/dist/components/Timeline/get-sequence-context-menu-items.js +58 -53
  140. package/dist/components/Timeline/reset-selected-timeline-props.js +1 -1
  141. package/dist/components/Timeline/should-subscribe-to-sequence-props.d.ts +1 -1
  142. package/dist/components/Timeline/timeline-asset-link.d.ts +2 -2
  143. package/dist/components/Timeline/timeline-asset-link.js +2 -2
  144. package/dist/components/Timeline/use-expanded-track-keyframe-rows.js +38 -2
  145. package/dist/components/Timeline/{use-open-sequence-in-editor.d.ts → use-open-sequence-in-apps.d.ts} +4 -1
  146. package/dist/components/Timeline/{use-open-sequence-in-editor.js → use-open-sequence-in-apps.js} +20 -4
  147. package/dist/components/Timeline/use-timeline-asset-drop.js +1 -0
  148. package/dist/components/Timeline/use-timeline-expanded-tree.d.ts +5 -0
  149. package/dist/components/Timeline/use-timeline-expanded-tree.js +50 -1
  150. package/dist/components/Timeline/use-timeline-height.js +20 -0
  151. package/dist/components/TimelineInOutToggle.js +5 -1
  152. package/dist/components/TopPanel.js +16 -0
  153. package/dist/components/UpdateCheck.js +1 -1
  154. package/dist/components/effect-drag-and-drop.js +1 -1
  155. package/dist/components/get-open-in-menu-items.d.ts +12 -0
  156. package/dist/components/get-open-in-menu-items.js +83 -0
  157. package/dist/components/handle-drop.d.ts +2 -1
  158. package/dist/components/handle-drop.js +12 -2
  159. package/dist/components/import-assets.d.ts +18 -6
  160. package/dist/components/import-assets.js +76 -32
  161. package/dist/components/selected-outline-measurement.d.ts +2 -2
  162. package/dist/components/selected-outline-order.d.ts +12 -0
  163. package/dist/components/selected-outline-order.js +251 -0
  164. package/dist/components/selected-outline-types.d.ts +9 -10
  165. package/dist/components/svg-point-to-client-point.d.ts +2 -0
  166. package/dist/components/svg-point-to-client-point.js +10 -0
  167. package/dist/components/use-auto-save-config.d.ts +8 -0
  168. package/dist/components/use-auto-save-config.js +74 -0
  169. package/dist/components/use-default-editor-info.d.ts +1 -0
  170. package/dist/components/use-default-editor-info.js +10 -30
  171. package/dist/esm/{chunk-jefhcs5z.js → chunk-fgedsvhb.js} +1 -2
  172. package/dist/esm/{chunk-7pgk8h5m.js → chunk-ptnd65a9.js} +14596 -12725
  173. package/dist/esm/internals.mjs +14595 -12724
  174. package/dist/esm/previewEntry.mjs +12726 -10855
  175. package/dist/esm/renderEntry.mjs +2 -2
  176. package/dist/helpers/are-sequence-node-path-infos-equal.d.ts +2 -0
  177. package/dist/helpers/are-sequence-node-path-infos-equal.js +27 -0
  178. package/dist/helpers/calculate-timeline.js +3 -3
  179. package/dist/helpers/client-id.d.ts +3 -1
  180. package/dist/helpers/client-id.js +28 -4
  181. package/dist/helpers/format-file-location.d.ts +1 -1
  182. package/dist/helpers/format-file-location.js +3 -3
  183. package/dist/helpers/install-required-package.d.ts +3 -3
  184. package/dist/helpers/install-required-package.js +1 -6
  185. package/dist/helpers/migrate-expanded-tracks-for-subscription-key.js +3 -3
  186. package/dist/helpers/open-in-editor.d.ts +1 -0
  187. package/dist/helpers/open-in-editor.js +5 -1
  188. package/dist/helpers/studio-fit-padding.d.ts +1 -1
  189. package/dist/helpers/studio-fit-padding.js +1 -1
  190. package/dist/helpers/studio-runtime-config.js +3 -0
  191. package/dist/helpers/timeline-layout.d.ts +2 -1
  192. package/dist/helpers/timeline-layout.js +5 -2
  193. package/dist/helpers/timeline-node-path-key.d.ts +2 -0
  194. package/dist/helpers/timeline-node-path-key.js +3 -1
  195. package/dist/helpers/use-asset-drag-events.d.ts +2 -1
  196. package/dist/helpers/use-asset-drag-events.js +14 -6
  197. package/dist/helpers/use-menu-structure.js +25 -35
  198. package/dist/helpers/use-runtime-values.d.ts +9 -0
  199. package/dist/helpers/use-runtime-values.js +76 -0
  200. package/dist/icons/apps.d.ts +2 -0
  201. package/dist/icons/apps.js +7 -0
  202. package/dist/icons/browse-elements.d.ts +4 -0
  203. package/dist/icons/browse-elements.js +10 -0
  204. package/dist/state/modals.d.ts +5 -6
  205. package/dist/state/modals.js +5 -3
  206. package/dist/state/timeline-sequence-hover.d.ts +9 -3
  207. package/dist/state/timeline-sequence-hover.js +63 -12
  208. package/package.json +12 -12
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.SelectedOutlineOverlay = exports.orderOutlinesForRendering = 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.compensateTranslateForTransformOrigin = exports.applySelectedOutlineTransformOriginAxisLock = exports.applySelectedOutlineDragAxisLock = void 0;
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.compensateTranslateForTransformOrigin = exports.applySelectedOutlineTransformOriginAxisLock = exports.applySelectedOutlineDragAxisLock = exports.orderOutlinesForRendering = void 0;
37
37
  const jsx_runtime_1 = require("react/jsx-runtime");
38
38
  const player_1 = require("@remotion/player");
39
39
  const react_1 = __importStar(require("react"));
@@ -41,24 +41,19 @@ const remotion_1 = require("remotion");
41
41
  const no_react_1 = require("remotion/no-react");
42
42
  const client_id_1 = require("../helpers/client-id");
43
43
  const interactivity_enabled_1 = require("../helpers/interactivity-enabled");
44
+ const timeline_node_path_key_1 = require("../helpers/timeline-node-path-key");
44
45
  const use_is_fullscreen_1 = require("../helpers/use-is-fullscreen");
45
- const use_keybinding_1 = require("../helpers/use-keybinding");
46
- const editor_guides_1 = require("../state/editor-guides");
46
+ const use_runtime_values_1 = require("../helpers/use-runtime-values");
47
47
  const editor_outlines_1 = require("../state/editor-outlines");
48
48
  const scale_lock_1 = require("../state/scale-lock");
49
49
  const timeline_sequence_hover_1 = require("../state/timeline-sequence-hover");
50
- const NotificationCenter_1 = require("./Notifications/NotificationCenter");
51
50
  const selected_outline_drag_1 = require("./selected-outline-drag");
52
51
  const selected_outline_measurement_1 = require("./selected-outline-measurement");
53
- const selected_outline_snap_1 = require("./selected-outline-snap");
52
+ const selected_outline_order_1 = require("./selected-outline-order");
53
+ Object.defineProperty(exports, "orderOutlinesForRendering", { enumerable: true, get: function () { return selected_outline_order_1.orderOutlinesForRendering; } });
54
54
  const selected_outline_types_1 = require("./selected-outline-types");
55
- const selected_outline_uv_1 = require("./selected-outline-uv");
56
- const SelectedOutlineElement_1 = require("./SelectedOutlineElement");
57
- const SelectedOutlineUvControls_1 = require("./SelectedOutlineUvControls");
58
- const call_add_keyframe_1 = require("./Timeline/call-add-keyframe");
59
- const imperative_state_1 = require("./Timeline/imperative-state");
60
- const save_sequence_prop_1 = require("./Timeline/save-sequence-prop");
61
- const timeline_scroll_logic_1 = require("./Timeline/timeline-scroll-logic");
55
+ const SelectedOutlineKeyboardControls_1 = require("./SelectedOutlineKeyboardControls");
56
+ const SelectedOutlineRenderer_1 = require("./SelectedOutlineRenderer");
62
57
  const TimelineSelection_1 = require("./Timeline/TimelineSelection");
63
58
  const selected_outline_drag_2 = require("./selected-outline-drag");
64
59
  Object.defineProperty(exports, "applySelectedOutlineDragAxisLock", { enumerable: true, get: function () { return selected_outline_drag_2.applySelectedOutlineDragAxisLock; } });
@@ -99,7 +94,7 @@ Object.defineProperty(exports, "getSequencesWithSelectableOutlines", { enumerabl
99
94
  Object.defineProperty(exports, "getTransformedSvgViewportPoints", { enumerable: true, get: function () { return selected_outline_measurement_2.getTransformedSvgViewportPoints; } });
100
95
  const selected_outline_types_2 = require("./selected-outline-types");
101
96
  Object.defineProperty(exports, "selectedOutlineDragThresholdPx", { enumerable: true, get: function () { return selected_outline_types_2.selectedOutlineDragThresholdPx; } });
102
- const getEffectiveCropValue = ({ activeSchema, controls, dragOverrides, fieldKey, frame, propStatuses, }) => {
97
+ const getEffectiveCropValue = ({ activeSchema, dragOverrides, fieldKey, frame, propStatuses, runtimeValues, }) => {
103
98
  var _a;
104
99
  const fieldSchema = activeSchema === null || activeSchema === void 0 ? void 0 : activeSchema[fieldKey];
105
100
  if ((fieldSchema === null || fieldSchema === void 0 ? void 0 : fieldSchema.type) !== 'number') {
@@ -114,7 +109,7 @@ const getEffectiveCropValue = ({ activeSchema, controls, dragOverrides, fieldKey
114
109
  frame,
115
110
  shouldResortToDefaultValueIfUndefined: true,
116
111
  })
117
- : ((_a = controls === null || controls === void 0 ? void 0 : controls.currentRuntimeValueDotNotation[fieldKey]) !== null && _a !== void 0 ? _a : fieldSchema.default);
112
+ : ((_a = runtimeValues[fieldKey]) !== null && _a !== void 0 ? _a : fieldSchema.default);
118
113
  return typeof value === 'number' && Number.isFinite(value) ? value : 0;
119
114
  };
120
115
  const getCropDragFields = ({ activeSchema, cropValues, propStatuses, }) => {
@@ -143,477 +138,196 @@ const getCropDragFields = ({ activeSchema, cropValues, propStatuses, }) => {
143
138
  }
144
139
  return fields;
145
140
  };
146
- const outlineContainer = {
147
- position: 'absolute',
148
- inset: 0,
149
- pointerEvents: 'none',
150
- overflow: 'visible',
151
- };
152
- const SelectedOutlineSnapIndicators = ({ activeSnapPoints, compositionHeight, compositionWidth, scale }) => {
153
- if (activeSnapPoints.length === 0) {
154
- return null;
155
- }
156
- return (jsx_runtime_1.jsx("g", { pointerEvents: "none", children: activeSnapPoints.map((snapPoint) => {
157
- if (snapPoint.target.axis === 'x') {
158
- const x = snapPoint.target.position * scale;
159
- return (jsx_runtime_1.jsx("line", { x1: x, x2: x, y1: 0, y2: compositionHeight * scale, stroke: selected_outline_snap_1.selectedOutlineSnapIndicatorColor, strokeWidth: 1, vectorEffect: "non-scaling-stroke" }, `${snapPoint.target.axis}-${snapPoint.target.type}-${snapPoint.target.position}-${snapPoint.edge}`));
160
- }
161
- const y = snapPoint.target.position * scale;
162
- return (jsx_runtime_1.jsx("line", { x1: 0, x2: compositionWidth * scale, y1: y, y2: y, stroke: selected_outline_snap_1.selectedOutlineSnapIndicatorColor, strokeWidth: 1, vectorEffect: "non-scaling-stroke" }, `${snapPoint.target.axis}-${snapPoint.target.type}-${snapPoint.target.position}-${snapPoint.edge}`));
163
- }) }));
164
- };
165
- const outlinePointEqualityTolerance = 0.5;
166
- const outlineAreaEqualityTolerance = 0.5;
167
- const outlineBoundsOverlapTolerance = 0.5;
168
- const outlinePointsAreEquivalent = (a, b) => {
169
- return (Math.abs(a.x - b.x) <= outlinePointEqualityTolerance &&
170
- Math.abs(a.y - b.y) <= outlinePointEqualityTolerance);
171
- };
172
- const outlinesHaveEquivalentHitArea = (a, b) => {
173
- if (a.points.length !== b.points.length) {
174
- return false;
175
- }
176
- for (let startIndex = 0; startIndex < b.points.length; startIndex++) {
177
- for (const direction of [1, -1]) {
178
- const pointsMatch = a.points.every((point, index) => {
179
- const bIndex = (startIndex + direction * index + b.points.length) % b.points.length;
180
- return outlinePointsAreEquivalent(point, b.points[bIndex]);
181
- });
182
- if (pointsMatch) {
183
- return true;
184
- }
185
- }
186
- }
187
- return false;
188
- };
189
- const getOutlineHitArea = (outline) => {
190
- let area = 0;
191
- for (let i = 0; i < outline.points.length; i++) {
192
- const current = outline.points[i];
193
- const next = outline.points[(i + 1) % outline.points.length];
194
- area += current.x * next.y - next.x * current.y;
195
- }
196
- return Math.abs(area) / 2;
197
- };
198
- const getOutlineBounds = (outline) => {
199
- const xs = outline.points.map((point) => point.x);
200
- const ys = outline.points.map((point) => point.y);
201
- return {
202
- maxX: Math.max(...xs),
203
- maxY: Math.max(...ys),
204
- minX: Math.min(...xs),
205
- minY: Math.min(...ys),
206
- };
207
- };
208
- const outlineBoundsOverlap = (a, b) => {
209
- const aBounds = getOutlineBounds(a);
210
- const bBounds = getOutlineBounds(b);
211
- return (aBounds.minX <= bBounds.maxX + outlineBoundsOverlapTolerance &&
212
- aBounds.maxX + outlineBoundsOverlapTolerance >= bBounds.minX &&
213
- aBounds.minY <= bBounds.maxY + outlineBoundsOverlapTolerance &&
214
- aBounds.maxY + outlineBoundsOverlapTolerance >= bBounds.minY);
215
- };
216
- const getSequenceId = (target) => {
217
- var _a;
218
- var _b;
219
- return (_b = (_a = target === null || target === void 0 ? void 0 : target.sequence) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : null;
220
- };
221
- const getParentBySequenceId = ({ sequences, targetsByKey, }) => {
222
- const parentBySequenceId = new Map();
223
- for (const sequence of sequences) {
224
- parentBySequenceId.set(sequence.id, sequence.parent);
225
- }
226
- for (const target of targetsByKey.values()) {
227
- const sequenceId = getSequenceId(target);
228
- if (sequenceId !== null && !parentBySequenceId.has(sequenceId)) {
229
- parentBySequenceId.set(sequenceId, target.sequence.parent);
230
- }
231
- }
232
- return parentBySequenceId;
233
- };
234
- const isAncestorTarget = ({ ancestor, descendant, parentBySequenceId, }) => {
235
- var _a;
236
- var _b, _c;
237
- const ancestorId = getSequenceId(ancestor);
238
- if (ancestorId === null) {
239
- return false;
240
- }
241
- let parentId = (_b = (_a = descendant.sequence) === null || _a === void 0 ? void 0 : _a.parent) !== null && _b !== void 0 ? _b : null;
242
- while (parentId !== null) {
243
- if (parentId === ancestorId) {
244
- return true;
245
- }
246
- parentId = (_c = parentBySequenceId.get(parentId)) !== null && _c !== void 0 ? _c : null;
247
- }
248
- return false;
249
- };
250
- const orderOutlineGroup = ({ outlines, parentBySequenceId, targetsByKey, }) => {
251
- var _a;
252
- var _b, _c, _d, _e;
253
- const incomingEdges = new Map();
254
- const outgoingEdges = new Map();
255
- const outlinesByKey = new Map(outlines.map((outline) => [outline.key, outline]));
256
- for (const outline of outlines) {
257
- incomingEdges.set(outline.key, new Set());
258
- outgoingEdges.set(outline.key, new Set());
259
- }
260
- const hasPath = ({ fromKey, seen, toKey, }) => {
261
- var _a;
262
- if (fromKey === toKey) {
263
- return true;
264
- }
265
- if (seen.has(fromKey)) {
266
- return false;
267
- }
268
- seen.add(fromKey);
269
- for (const nextKey of (_a = outgoingEdges.get(fromKey)) !== null && _a !== void 0 ? _a : []) {
270
- if (hasPath({ fromKey: nextKey, seen, toKey })) {
271
- return true;
272
- }
273
- }
274
- return false;
275
- };
276
- const addEdge = (before, after, options) => {
277
- if (before.key === after.key) {
278
- return;
279
- }
280
- const incoming = incomingEdges.get(after.key);
281
- const outgoing = outgoingEdges.get(before.key);
282
- if (incoming === undefined || outgoing === undefined) {
283
- throw new Error('Expected outline to be registered before adding edge');
284
- }
285
- if (outgoing.has(after.key)) {
286
- return;
287
- }
288
- if (hasPath({ fromKey: after.key, seen: new Set(), toKey: before.key })) {
289
- if (options === null || options === void 0 ? void 0 : options.skipIfCycle) {
290
- return;
291
- }
292
- throw new Error('Could not determine a stable outline rendering order');
293
- }
294
- incoming.add(before.key);
295
- outgoing.add(after.key);
296
- };
297
- const addAncestorConstraint = ({ ancestor, descendant, descendantContainsSelection, equivalentHitArea, }) => {
298
- // Usually, children should be above parents so nested elements are directly
299
- // selectable. If an unselected child has the same hit area as its parent, put
300
- // it below the parent so the wrapper can be selected. Once the child or
301
- // one of its properties is selected, keep it above the parent so it remains
302
- // directly draggable.
303
- if (equivalentHitArea && !descendantContainsSelection) {
304
- addEdge(descendant, ancestor);
305
- }
306
- else {
307
- addEdge(ancestor, descendant);
308
- }
309
- };
310
- const outlineBySequenceId = new Map();
311
- for (const outline of outlines) {
312
- const sequenceId = getSequenceId(targetsByKey.get(outline.key));
313
- if (sequenceId !== null) {
314
- outlineBySequenceId.set(sequenceId, outline);
315
- }
141
+ const calculateOutlineTargets = ({ connectedClientId, editorShowOutlines, getDragOverrides, getScaleLockState, isFullscreen, mode, previewSelectionAvailable, propStatuses, runtimeValuesByStore, selectableOutlines, selectedCropInfo, selectedEffectsBySequenceKey, selectedSequenceKeys, selectedTransformOriginInfo, sequenceKeysContainingSelection, studioInteractivityEnabled, targetKey, targetTimelinePosition, }) => {
142
+ if (isFullscreen ||
143
+ !(0, interactivity_enabled_1.isStudioSelectionEnabled)() ||
144
+ !previewSelectionAvailable ||
145
+ !editorShowOutlines) {
146
+ return [];
316
147
  }
317
- // Only constrain each outline against its nearest rendered ancestor. The
318
- // resulting graph follows the sequence tree, so pairwise subpixel equivalence
319
- // cannot introduce contradictory edges across three nested outlines.
320
- for (const descendant of outlines) {
321
- const descendantTarget = targetsByKey.get(descendant.key);
322
- let parentId = (_b = (_a = descendantTarget === null || descendantTarget === void 0 ? void 0 : descendantTarget.sequence) === null || _a === void 0 ? void 0 : _a.parent) !== null && _b !== void 0 ? _b : null;
323
- while (parentId !== null) {
324
- const ancestor = outlineBySequenceId.get(parentId);
325
- if (ancestor !== undefined) {
326
- addAncestorConstraint({
327
- ancestor,
328
- descendant,
329
- descendantContainsSelection: ((_c = descendantTarget === null || descendantTarget === void 0 ? void 0 : descendantTarget.selected) !== null && _c !== void 0 ? _c : false) ||
330
- ((_d = descendantTarget === null || descendantTarget === void 0 ? void 0 : descendantTarget.containsSelection) !== null && _d !== void 0 ? _d : false),
331
- equivalentHitArea: outlinesHaveEquivalentHitArea(ancestor, descendant),
332
- });
333
- break;
334
- }
335
- parentId = (_e = parentBySequenceId.get(parentId)) !== null && _e !== void 0 ? _e : null;
148
+ const previewInteractive = connectedClientId !== null && studioInteractivityEnabled;
149
+ const firstNodePathInfoBySourceNode = new Map();
150
+ const selectedSourceNodeKeys = new Set();
151
+ for (const { key, nodePathInfo } of selectableOutlines) {
152
+ const sourceNodeKey = (0, timeline_node_path_key_1.timelineSequenceNodePathToKey)(nodePathInfo.sequenceSubscriptionKey);
153
+ if (selectedSequenceKeys.has(key)) {
154
+ selectedSourceNodeKeys.add(sourceNodeKey);
155
+ }
156
+ const currentFirst = firstNodePathInfoBySourceNode.get(sourceNodeKey);
157
+ if (currentFirst === undefined || nodePathInfo.index < currentFirst.index) {
158
+ firstNodePathInfoBySourceNode.set(sourceNodeKey, nodePathInfo);
336
159
  }
337
160
  }
338
- // For unrelated overlapping outlines, put broader hit targets below
339
- // smaller ones so a large selected sequence cannot swallow clicks on
340
- // a more specific element in the same canvas area.
341
- for (let i = 0; i < outlines.length; i++) {
342
- for (let j = i + 1; j < outlines.length; j++) {
343
- const a = outlines[i];
344
- const b = outlines[j];
345
- const aTarget = targetsByKey.get(a.key);
346
- const bTarget = targetsByKey.get(b.key);
347
- if (aTarget === undefined || bTarget === undefined) {
348
- continue;
349
- }
350
- const aAncestorOfB = isAncestorTarget({
351
- ancestor: aTarget,
352
- descendant: bTarget,
353
- parentBySequenceId,
354
- });
355
- const bAncestorOfA = isAncestorTarget({
356
- ancestor: bTarget,
357
- descendant: aTarget,
358
- parentBySequenceId,
359
- });
360
- if (aAncestorOfB || bAncestorOfA || !outlineBoundsOverlap(a, b)) {
361
- continue;
362
- }
363
- const aArea = getOutlineHitArea(a);
364
- const bArea = getOutlineHitArea(b);
365
- if (Math.abs(aArea - bArea) <= outlineAreaEqualityTolerance) {
366
- continue;
367
- }
368
- if (aArea > bArea) {
369
- addEdge(a, b, { skipIfCycle: true });
370
- }
371
- else {
372
- addEdge(b, a, { skipIfCycle: true });
373
- }
374
- }
375
- }
376
- const emitted = new Set();
377
- const visiting = new Set();
378
- const ordered = [];
379
- const visit = (outline) => {
380
- var _a;
381
- if (emitted.has(outline.key)) {
382
- return;
383
- }
384
- if (visiting.has(outline.key)) {
385
- throw new Error('Could not determine a stable outline rendering order');
386
- }
387
- visiting.add(outline.key);
388
- for (const dependencyKey of (_a = incomingEdges.get(outline.key)) !== null && _a !== void 0 ? _a : []) {
389
- const dependency = outlinesByKey.get(dependencyKey);
390
- if (dependency === undefined) {
391
- throw new Error('Expected outline dependency to exist');
392
- }
393
- visit(dependency);
394
- }
395
- visiting.delete(outline.key);
396
- emitted.add(outline.key);
397
- ordered.push(outline);
398
- };
399
- for (const outline of outlines) {
400
- visit(outline);
401
- }
402
- return ordered;
403
- };
404
- const orderOutlinesForRendering = ({ outlines, sequences, targetsByKey, }) => {
405
- const parentBySequenceId = getParentBySequenceId({ sequences, targetsByKey });
406
- return orderOutlineGroup({
407
- outlines,
408
- parentBySequenceId,
409
- targetsByKey,
410
- });
411
- };
412
- exports.orderOutlinesForRendering = orderOutlinesForRendering;
413
- const SelectedOutlineOverlay = ({ compositionHeight, compositionWidth, scale, translationX, translationY, }) => {
414
- const { selectedItems, selectItem } = (0, TimelineSelection_1.useTimelineSelection)();
415
- const { sequences } = (0, react_1.useContext)(remotion_1.Internals.SequenceManager);
416
- const { canvasContent, compositions } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
417
- const { propStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesContext);
418
- const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
419
- const { overrideIdToNodePathMappings } = (0, react_1.useContext)(remotion_1.Internals.OverrideIdsToNodePathsGettersContext);
420
- const { getDragOverrides, getEffectDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeDragOverridesContext);
421
- const { setPropStatuses, setDragOverrides, clearDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
422
- const { getScaleLockState } = (0, react_1.useContext)(scale_lock_1.ScaleLockContext);
423
- const { editorShowOutlines } = (0, react_1.useContext)(editor_outlines_1.EditorShowOutlinesContext);
424
- const { hoveredSequence, setHoveredSequence } = (0, react_1.useContext)(timeline_sequence_hover_1.TimelineSequenceHoverContext);
425
- const { editorShowGuides, guidesList } = (0, react_1.useContext)(editor_guides_1.EditorShowGuidesContext);
426
- const isFullscreen = (0, use_is_fullscreen_1.useIsFullscreen)();
427
- const { frameBack, frameForward, getCurrentFrame, seek } = player_1.PlayerInternals.usePlayer();
428
- const keybindings = (0, use_keybinding_1.useKeybinding)();
429
- const timelinePosition = remotion_1.Internals.Timeline.useTimelinePosition();
430
- const [outlines, setOutlines] = (0, react_1.useState)([]);
431
- const [draggingOutline, setDraggingOutline] = (0, react_1.useState)(false);
432
- const [activeSnapPoints, setActiveSnapPoints] = (0, react_1.useState)([]);
433
- const overlayRef = (0, react_1.useRef)(null);
434
- const keyboardNudgeSessionRef = (0, react_1.useRef)(null);
435
- const saveKeyboardNudgeSessionRef = (0, react_1.useRef)(() => undefined);
436
- const previewInteractive = previewServerState.type === 'connected' && (0, interactivity_enabled_1.isStudioInteractivityEnabled)();
437
- const previewSelectionAvailable = previewServerState.type === 'connected' || window.remotion_isReadOnlyStudio;
438
- const onDraggingChange = react_1.default.useCallback((dragging) => {
439
- setDraggingOutline(dragging);
440
- if (dragging) {
441
- setHoveredSequence((currentHover) => (currentHover === null || currentHover === void 0 ? void 0 : currentHover.source) === 'canvas' ? null : currentHover);
442
- }
443
- else {
444
- setActiveSnapPoints([]);
445
- }
446
- }, [setHoveredSequence]);
447
- const onHoverChange = (0, react_1.useCallback)((key) => {
448
- setHoveredSequence((currentHover) => {
449
- if (key !== null) {
450
- return { key, source: 'canvas' };
451
- }
452
- return (currentHover === null || currentHover === void 0 ? void 0 : currentHover.source) === 'canvas' ? null : currentHover;
453
- });
454
- }, [setHoveredSequence]);
455
- const onSnapPointsChange = (0, react_1.useCallback)((snapPoints) => {
456
- setActiveSnapPoints(snapPoints);
457
- }, []);
458
- const selectOutlineItem = (0, react_1.useCallback)((item, interaction) => {
459
- selectItem(item, interaction, undefined, { reveal: true });
460
- }, [selectItem]);
461
- const outlineTargets = (0, react_1.useMemo)(() => {
462
- if (isFullscreen ||
463
- !(0, interactivity_enabled_1.isStudioSelectionEnabled)() ||
464
- !previewSelectionAvailable ||
465
- !editorShowOutlines) {
161
+ return selectableOutlines.flatMap((selectableOutline) => {
162
+ var _a, _b, _c, _d, _e, _f, _g;
163
+ const { key, keyframeDisplayOffset, nodePathInfo, sequence } = selectableOutline;
164
+ if (targetKey !== null && targetKey !== key) {
466
165
  return [];
467
166
  }
468
- const selectedSequenceKeys = (0, selected_outline_measurement_1.getSelectedSequenceKeys)(selectedItems);
469
- const sequenceKeysContainingSelection = (0, selected_outline_measurement_1.getSequenceKeysContainingSelection)(selectedItems);
470
- const selectedEffectsBySequenceKey = (0, selected_outline_measurement_1.getSelectedEffectFieldsBySequenceKey)(selectedItems);
471
- const selectedTransformOriginInfo = (0, selected_outline_measurement_1.getSelectedTransformOriginInfo)(selectedItems);
472
- const selectedCropInfo = (0, selected_outline_measurement_1.getSelectedCropInfo)(selectedItems);
473
- const clientId = previewServerState.type === 'connected'
474
- ? previewServerState.clientId
167
+ if (sequence.refForOutline === null) {
168
+ throw new Error('Expected sequence to have a ref for outline');
169
+ }
170
+ const selected = selectedSequenceKeys.has(key);
171
+ const containsSelection = sequenceKeysContainingSelection.has(key);
172
+ const nodePath = nodePathInfo.sequenceSubscriptionKey;
173
+ const sourceNodeKey = (0, timeline_node_path_key_1.timelineSequenceNodePathToKey)(nodePath);
174
+ const showSelectedOutline = containsSelection || selectedSourceNodeKeys.has(sourceNodeKey);
175
+ const selectionNodePathInfo = firstNodePathInfoBySourceNode.get(sourceNodeKey);
176
+ if (selectionNodePathInfo === undefined) {
177
+ throw new Error('Expected a first sequence for the source node');
178
+ }
179
+ const { controls } = sequence;
180
+ const nodePropStatuses = remotion_1.Internals.getPropStatusesCtx(propStatuses, nodePath);
181
+ const sourceFrame = targetTimelinePosition - keyframeDisplayOffset;
182
+ const dragOverrides = (_a = getDragOverrides(nodePath)) !== null && _a !== void 0 ? _a : {};
183
+ const runtimeValues = controls
184
+ ? ((_b = runtimeValuesByStore.get(controls.runtimeValues)) !== null && _b !== void 0 ? _b : controls.runtimeValues.getSnapshot())
185
+ : {};
186
+ const activeSchema = controls
187
+ ? (0, selected_outline_drag_1.getSelectedOutlineActiveSchema)({
188
+ schema: controls.schema,
189
+ currentRuntimeValueDotNotation: runtimeValues,
190
+ dragOverrides,
191
+ propStatus: nodePropStatuses,
192
+ frame: sourceFrame,
193
+ })
475
194
  : null;
476
- return (0, selected_outline_measurement_1.getSequencesWithSelectableOutlines)({
477
- sequences,
478
- overrideIdsToNodePaths: overrideIdToNodePathMappings,
479
- compositions,
480
- timelinePosition,
481
- }).map(({ key, keyframeDisplayOffset, nodePathInfo, sequence }) => {
482
- var _a, _b, _c, _d, _e, _f;
483
- if (sequence.refForOutline === null) {
484
- throw new Error('Expected sequence to have a ref for outline');
485
- }
486
- const selected = selectedSequenceKeys.has(key);
487
- const containsSelection = sequenceKeysContainingSelection.has(key);
488
- const nodePath = nodePathInfo.sequenceSubscriptionKey;
489
- const { controls } = sequence;
490
- const nodePropStatuses = remotion_1.Internals.getPropStatusesCtx(propStatuses, nodePath);
491
- const sourceFrame = timelinePosition - keyframeDisplayOffset;
492
- const dragOverrides = (_a = getDragOverrides(nodePath)) !== null && _a !== void 0 ? _a : {};
493
- const activeSchema = controls
494
- ? (0, selected_outline_drag_1.getSelectedOutlineActiveSchema)({
495
- schema: controls.schema,
496
- currentRuntimeValueDotNotation: controls.currentRuntimeValueDotNotation,
497
- dragOverrides,
498
- propStatus: nodePropStatuses,
499
- frame: sourceFrame,
500
- })
501
- : null;
502
- const cropValues = {
503
- cropLeft: getEffectiveCropValue({
504
- activeSchema,
505
- controls,
506
- dragOverrides,
507
- fieldKey: selected_outline_types_1.cropFieldKeys.left,
508
- frame: sourceFrame,
509
- propStatuses: nodePropStatuses,
510
- }),
511
- cropRight: getEffectiveCropValue({
512
- activeSchema,
513
- controls,
514
- dragOverrides,
515
- fieldKey: selected_outline_types_1.cropFieldKeys.right,
516
- frame: sourceFrame,
517
- propStatuses: nodePropStatuses,
518
- }),
519
- cropTop: getEffectiveCropValue({
520
- activeSchema,
521
- controls,
522
- dragOverrides,
523
- fieldKey: selected_outline_types_1.cropFieldKeys.top,
524
- frame: sourceFrame,
525
- propStatuses: nodePropStatuses,
526
- }),
527
- cropBottom: getEffectiveCropValue({
528
- activeSchema,
529
- controls,
530
- dragOverrides,
531
- fieldKey: selected_outline_types_1.cropFieldKeys.bottom,
532
- frame: sourceFrame,
533
- propStatuses: nodePropStatuses,
534
- }),
535
- };
536
- const crop = remotion_1.Internals.resolveSequenceCrop(cropValues);
537
- const cropFields = getCropDragFields({
195
+ const cropValues = {
196
+ cropLeft: getEffectiveCropValue({
197
+ activeSchema,
198
+ dragOverrides,
199
+ fieldKey: selected_outline_types_1.cropFieldKeys.left,
200
+ frame: sourceFrame,
201
+ propStatuses: nodePropStatuses,
202
+ runtimeValues,
203
+ }),
204
+ cropRight: getEffectiveCropValue({
205
+ activeSchema,
206
+ dragOverrides,
207
+ fieldKey: selected_outline_types_1.cropFieldKeys.right,
208
+ frame: sourceFrame,
209
+ propStatuses: nodePropStatuses,
210
+ runtimeValues,
211
+ }),
212
+ cropTop: getEffectiveCropValue({
213
+ activeSchema,
214
+ dragOverrides,
215
+ fieldKey: selected_outline_types_1.cropFieldKeys.top,
216
+ frame: sourceFrame,
217
+ propStatuses: nodePropStatuses,
218
+ runtimeValues,
219
+ }),
220
+ cropBottom: getEffectiveCropValue({
538
221
  activeSchema,
539
- cropValues,
222
+ dragOverrides,
223
+ fieldKey: selected_outline_types_1.cropFieldKeys.bottom,
224
+ frame: sourceFrame,
540
225
  propStatuses: nodePropStatuses,
541
- });
542
- const fieldSchema = activeSchema === null || activeSchema === void 0 ? void 0 : activeSchema[selected_outline_types_1.translateFieldKey];
543
- const propStatus = nodePropStatuses === null || nodePropStatuses === void 0 ? void 0 : nodePropStatuses[selected_outline_types_1.translateFieldKey];
544
- const scaleFieldSchema = activeSchema === null || activeSchema === void 0 ? void 0 : activeSchema[selected_outline_types_1.scaleFieldKey];
545
- const scalePropStatus = nodePropStatuses === null || nodePropStatuses === void 0 ? void 0 : nodePropStatuses[selected_outline_types_1.scaleFieldKey];
546
- const rotationFieldSchema = activeSchema === null || activeSchema === void 0 ? void 0 : activeSchema[selected_outline_types_1.rotateFieldKey];
547
- const rotationPropStatus = nodePropStatuses === null || nodePropStatuses === void 0 ? void 0 : nodePropStatuses[selected_outline_types_1.rotateFieldKey];
548
- const transformOriginFieldSchema = activeSchema === null || activeSchema === void 0 ? void 0 : activeSchema[selected_outline_types_1.transformOriginFieldKey];
549
- const transformOriginPropStatus = nodePropStatuses === null || nodePropStatuses === void 0 ? void 0 : nodePropStatuses[selected_outline_types_1.transformOriginFieldKey];
550
- const transformOriginValueForRotation = (transformOriginFieldSchema === null || transformOriginFieldSchema === void 0 ? void 0 : transformOriginFieldSchema.type) === 'transform-origin' &&
551
- ((transformOriginPropStatus === null || transformOriginPropStatus === void 0 ? void 0 : transformOriginPropStatus.status) === 'static' ||
552
- (transformOriginPropStatus === null || transformOriginPropStatus === void 0 ? void 0 : transformOriginPropStatus.status) === 'keyframed')
553
- ? String((_b = remotion_1.Internals.getEffectiveVisualModeValue({
554
- propStatus: transformOriginPropStatus,
555
- dragOverrideValue: dragOverrides[selected_outline_types_1.transformOriginFieldKey],
556
- defaultValue: transformOriginFieldSchema.default,
557
- frame: sourceFrame,
558
- shouldResortToDefaultValueIfUndefined: true,
559
- })) !== null && _b !== void 0 ? _b : transformOriginFieldSchema.default)
560
- : '50% 50%';
561
- const canDragStatus = (propStatus === null || propStatus === void 0 ? void 0 : propStatus.status) === 'static' ||
562
- ((propStatus === null || propStatus === void 0 ? void 0 : propStatus.status) === 'keyframed' &&
563
- propStatus.interpolationFunction === 'interpolate');
564
- const canRotationDragStatus = (rotationPropStatus === null || rotationPropStatus === void 0 ? void 0 : rotationPropStatus.status) === 'static' ||
565
- ((rotationPropStatus === null || rotationPropStatus === void 0 ? void 0 : rotationPropStatus.status) === 'keyframed' &&
566
- rotationPropStatus.interpolationFunction === 'interpolate');
567
- const canDrag = previewInteractive &&
568
- controls !== null &&
569
- (fieldSchema === null || fieldSchema === void 0 ? void 0 : fieldSchema.type) === 'translate' &&
570
- canDragStatus;
571
- const canScaleDragStatus = (scalePropStatus === null || scalePropStatus === void 0 ? void 0 : scalePropStatus.status) === 'static' ||
572
- ((scalePropStatus === null || scalePropStatus === void 0 ? void 0 : scalePropStatus.status) === 'keyframed' &&
573
- scalePropStatus.interpolationFunction === 'interpolate');
574
- const canScaleDrag = previewInteractive &&
575
- controls !== null &&
576
- (scaleFieldSchema === null || scaleFieldSchema === void 0 ? void 0 : scaleFieldSchema.type) === 'scale' &&
577
- canScaleDragStatus;
578
- const canRotationDrag = previewInteractive &&
579
- controls !== null &&
580
- (rotationFieldSchema === null || rotationFieldSchema === void 0 ? void 0 : rotationFieldSchema.type) === 'rotation-css' &&
581
- canRotationDragStatus;
582
- const selectedForTransformOrigin = (selectedTransformOriginInfo === null || selectedTransformOriginInfo === void 0 ? void 0 : selectedTransformOriginInfo.sequenceKey) === key;
583
- const transformOriginSourceFrame = (selectedTransformOriginInfo === null || selectedTransformOriginInfo === void 0 ? void 0 : selectedTransformOriginInfo.displayFrame) === null ||
584
- (selectedTransformOriginInfo === null || selectedTransformOriginInfo === void 0 ? void 0 : selectedTransformOriginInfo.displayFrame) === undefined
585
- ? sourceFrame
586
- : selectedTransformOriginInfo.displayFrame - keyframeDisplayOffset;
587
- const canTransformOriginStatus = (transformOriginPropStatus === null || transformOriginPropStatus === void 0 ? void 0 : transformOriginPropStatus.status) === 'static' ||
588
- ((transformOriginPropStatus === null || transformOriginPropStatus === void 0 ? void 0 : transformOriginPropStatus.status) === 'keyframed' &&
589
- transformOriginPropStatus.interpolationFunction === 'interpolate');
590
- const canTransformOriginTranslateStatus = (propStatus === null || propStatus === void 0 ? void 0 : propStatus.status) === 'static' ||
591
- ((propStatus === null || propStatus === void 0 ? void 0 : propStatus.status) === 'keyframed' &&
592
- propStatus.interpolationFunction === 'interpolate');
593
- const canTransformOriginDrag = previewInteractive &&
594
- selectedForTransformOrigin &&
595
- controls !== null &&
596
- (transformOriginFieldSchema === null || transformOriginFieldSchema === void 0 ? void 0 : transformOriginFieldSchema.type) === 'transform-origin' &&
597
- (fieldSchema === null || fieldSchema === void 0 ? void 0 : fieldSchema.type) === 'translate' &&
598
- canTransformOriginStatus &&
599
- canTransformOriginTranslateStatus;
600
- const selectedForCrop = (selectedCropInfo === null || selectedCropInfo === void 0 ? void 0 : selectedCropInfo.sequenceKey) === key;
601
- const cropSourceFrame = (selectedCropInfo === null || selectedCropInfo === void 0 ? void 0 : selectedCropInfo.displayFrame) === null ||
602
- (selectedCropInfo === null || selectedCropInfo === void 0 ? void 0 : selectedCropInfo.displayFrame) === undefined
603
- ? sourceFrame
604
- : selectedCropInfo.displayFrame - keyframeDisplayOffset;
605
- const canCropDrag = previewInteractive &&
606
- selectedForCrop &&
607
- controls !== null &&
608
- cropFields !== null;
609
- const canDropEffect = previewInteractive && (controls === null || controls === void 0 ? void 0 : controls.supportsEffects) === true;
610
- return {
611
- key,
226
+ runtimeValues,
227
+ }),
228
+ };
229
+ const crop = remotion_1.Internals.resolveSequenceCrop(cropValues);
230
+ const selectedForTransformOrigin = (selectedTransformOriginInfo === null || selectedTransformOriginInfo === void 0 ? void 0 : selectedTransformOriginInfo.sequenceKey) === key;
231
+ const selectedForCrop = (selectedCropInfo === null || selectedCropInfo === void 0 ? void 0 : selectedCropInfo.sequenceKey) === key;
232
+ const selectedForUvHandles = selectedEffectsBySequenceKey.has(key);
233
+ const layoutTarget = {
234
+ key,
235
+ containsSelection,
236
+ crop,
237
+ keyframeDisplayOffset,
238
+ nodePathInfo,
239
+ ref: sequence.refForOutline,
240
+ selected,
241
+ selectedForCrop,
242
+ selectedForTransformOrigin,
243
+ selectedForUvHandles,
244
+ showSelectedOutline,
245
+ selection: {
246
+ type: 'sequence',
247
+ nodePathInfo: selectionNodePathInfo,
248
+ },
249
+ sequence,
250
+ };
251
+ if (mode === 'layout') {
252
+ return [layoutTarget];
253
+ }
254
+ const cropFields = getCropDragFields({
255
+ activeSchema,
256
+ cropValues,
257
+ propStatuses: nodePropStatuses,
258
+ });
259
+ const fieldSchema = activeSchema === null || activeSchema === void 0 ? void 0 : activeSchema[selected_outline_types_1.translateFieldKey];
260
+ const propStatus = nodePropStatuses === null || nodePropStatuses === void 0 ? void 0 : nodePropStatuses[selected_outline_types_1.translateFieldKey];
261
+ const scaleFieldSchema = activeSchema === null || activeSchema === void 0 ? void 0 : activeSchema[selected_outline_types_1.scaleFieldKey];
262
+ const scalePropStatus = nodePropStatuses === null || nodePropStatuses === void 0 ? void 0 : nodePropStatuses[selected_outline_types_1.scaleFieldKey];
263
+ const rotationFieldSchema = activeSchema === null || activeSchema === void 0 ? void 0 : activeSchema[selected_outline_types_1.rotateFieldKey];
264
+ const rotationPropStatus = nodePropStatuses === null || nodePropStatuses === void 0 ? void 0 : nodePropStatuses[selected_outline_types_1.rotateFieldKey];
265
+ const transformOriginFieldSchema = activeSchema === null || activeSchema === void 0 ? void 0 : activeSchema[selected_outline_types_1.transformOriginFieldKey];
266
+ const transformOriginPropStatus = nodePropStatuses === null || nodePropStatuses === void 0 ? void 0 : nodePropStatuses[selected_outline_types_1.transformOriginFieldKey];
267
+ const transformOriginValueForRotation = (transformOriginFieldSchema === null || transformOriginFieldSchema === void 0 ? void 0 : transformOriginFieldSchema.type) === 'transform-origin' &&
268
+ ((transformOriginPropStatus === null || transformOriginPropStatus === void 0 ? void 0 : transformOriginPropStatus.status) === 'static' ||
269
+ (transformOriginPropStatus === null || transformOriginPropStatus === void 0 ? void 0 : transformOriginPropStatus.status) === 'keyframed')
270
+ ? String((_c = remotion_1.Internals.getEffectiveVisualModeValue({
271
+ propStatus: transformOriginPropStatus,
272
+ dragOverrideValue: dragOverrides[selected_outline_types_1.transformOriginFieldKey],
273
+ defaultValue: transformOriginFieldSchema.default,
274
+ frame: sourceFrame,
275
+ shouldResortToDefaultValueIfUndefined: true,
276
+ })) !== null && _c !== void 0 ? _c : transformOriginFieldSchema.default)
277
+ : '50% 50%';
278
+ const canDragStatus = (propStatus === null || propStatus === void 0 ? void 0 : propStatus.status) === 'static' ||
279
+ ((propStatus === null || propStatus === void 0 ? void 0 : propStatus.status) === 'keyframed' &&
280
+ propStatus.interpolationFunction === 'interpolate');
281
+ const canRotationDragStatus = (rotationPropStatus === null || rotationPropStatus === void 0 ? void 0 : rotationPropStatus.status) === 'static' ||
282
+ ((rotationPropStatus === null || rotationPropStatus === void 0 ? void 0 : rotationPropStatus.status) === 'keyframed' &&
283
+ rotationPropStatus.interpolationFunction === 'interpolate');
284
+ const canDrag = previewInteractive &&
285
+ controls !== null &&
286
+ (fieldSchema === null || fieldSchema === void 0 ? void 0 : fieldSchema.type) === 'translate' &&
287
+ canDragStatus;
288
+ const canScaleDragStatus = (scalePropStatus === null || scalePropStatus === void 0 ? void 0 : scalePropStatus.status) === 'static' ||
289
+ ((scalePropStatus === null || scalePropStatus === void 0 ? void 0 : scalePropStatus.status) === 'keyframed' &&
290
+ scalePropStatus.interpolationFunction === 'interpolate');
291
+ const canScaleDrag = previewInteractive &&
292
+ controls !== null &&
293
+ (scaleFieldSchema === null || scaleFieldSchema === void 0 ? void 0 : scaleFieldSchema.type) === 'scale' &&
294
+ canScaleDragStatus;
295
+ const canRotationDrag = previewInteractive &&
296
+ controls !== null &&
297
+ (rotationFieldSchema === null || rotationFieldSchema === void 0 ? void 0 : rotationFieldSchema.type) === 'rotation-css' &&
298
+ canRotationDragStatus;
299
+ const transformOriginSourceFrame = (selectedTransformOriginInfo === null || selectedTransformOriginInfo === void 0 ? void 0 : selectedTransformOriginInfo.displayFrame) === null ||
300
+ (selectedTransformOriginInfo === null || selectedTransformOriginInfo === void 0 ? void 0 : selectedTransformOriginInfo.displayFrame) === undefined
301
+ ? sourceFrame
302
+ : selectedTransformOriginInfo.displayFrame - keyframeDisplayOffset;
303
+ const canTransformOriginStatus = (transformOriginPropStatus === null || transformOriginPropStatus === void 0 ? void 0 : transformOriginPropStatus.status) === 'static' ||
304
+ ((transformOriginPropStatus === null || transformOriginPropStatus === void 0 ? void 0 : transformOriginPropStatus.status) === 'keyframed' &&
305
+ transformOriginPropStatus.interpolationFunction === 'interpolate');
306
+ const canTransformOriginTranslateStatus = (propStatus === null || propStatus === void 0 ? void 0 : propStatus.status) === 'static' ||
307
+ ((propStatus === null || propStatus === void 0 ? void 0 : propStatus.status) === 'keyframed' &&
308
+ propStatus.interpolationFunction === 'interpolate');
309
+ const canTransformOriginDrag = previewInteractive &&
310
+ selectedForTransformOrigin &&
311
+ controls !== null &&
312
+ (transformOriginFieldSchema === null || transformOriginFieldSchema === void 0 ? void 0 : transformOriginFieldSchema.type) === 'transform-origin' &&
313
+ (fieldSchema === null || fieldSchema === void 0 ? void 0 : fieldSchema.type) === 'translate' &&
314
+ canTransformOriginStatus &&
315
+ canTransformOriginTranslateStatus;
316
+ const cropSourceFrame = (selectedCropInfo === null || selectedCropInfo === void 0 ? void 0 : selectedCropInfo.displayFrame) === null ||
317
+ (selectedCropInfo === null || selectedCropInfo === void 0 ? void 0 : selectedCropInfo.displayFrame) === undefined
318
+ ? sourceFrame
319
+ : selectedCropInfo.displayFrame - keyframeDisplayOffset;
320
+ const canCropDrag = previewInteractive &&
321
+ selectedForCrop &&
322
+ controls !== null &&
323
+ cropFields !== null;
324
+ return [
325
+ {
326
+ ...layoutTarget,
612
327
  canCrop: previewInteractive && controls !== null && cropFields !== null,
613
- crop,
614
328
  cropDrag: canCropDrag
615
329
  ? {
616
- clientId: previewServerState.clientId,
330
+ clientId: connectedClientId,
617
331
  fields: cropFields,
618
332
  nodePath,
619
333
  schema: controls.schema,
@@ -628,23 +342,10 @@ const SelectedOutlineOverlay = ({ compositionHeight, compositionWidth, scale, tr
628
342
  : null,
629
343
  }
630
344
  : null,
631
- containsSelection,
632
- effectDrop: canDropEffect
633
- ? {
634
- clientId: previewServerState.clientId,
635
- fileName: nodePath.absolutePath,
636
- nodePath,
637
- }
638
- : null,
639
- nodePathInfo,
640
- ref: sequence.refForOutline,
641
- selected,
642
- selection: { type: 'sequence', nodePathInfo },
643
- sequence,
644
345
  drag: canDrag
645
346
  ? {
646
347
  propStatus,
647
- clientId: previewServerState.clientId,
348
+ clientId: connectedClientId,
648
349
  fieldDefault: fieldSchema.default,
649
350
  keyframeDisplayOffset,
650
351
  nodePath,
@@ -654,7 +355,7 @@ const SelectedOutlineOverlay = ({ compositionHeight, compositionWidth, scale, tr
654
355
  scaleDrag: canScaleDrag
655
356
  ? {
656
357
  propStatus: scalePropStatus,
657
- clientId: previewServerState.clientId,
358
+ clientId: connectedClientId,
658
359
  fieldDefault: scaleFieldSchema.default,
659
360
  fieldSchema: scaleFieldSchema,
660
361
  keyframeDisplayOffset,
@@ -680,7 +381,7 @@ const SelectedOutlineOverlay = ({ compositionHeight, compositionWidth, scale, tr
680
381
  rotationDrag: canRotationDrag
681
382
  ? {
682
383
  propStatus: rotationPropStatus,
683
- clientId: previewServerState.clientId,
384
+ clientId: connectedClientId,
684
385
  fieldDefault: rotationFieldSchema.default,
685
386
  fieldSchema: rotationFieldSchema,
686
387
  keyframeDisplayOffset,
@@ -691,21 +392,21 @@ const SelectedOutlineOverlay = ({ compositionHeight, compositionWidth, scale, tr
691
392
  : null,
692
393
  transformOriginDrag: canTransformOriginDrag
693
394
  ? {
694
- clientId: previewServerState.clientId,
395
+ clientId: connectedClientId,
695
396
  keyframeDisplayOffset,
696
397
  nodePath,
697
398
  originDefault: transformOriginFieldSchema.default,
698
399
  originPropStatus: transformOriginPropStatus,
699
- originValue: String((_c = remotion_1.Internals.getEffectiveVisualModeValue({
400
+ originValue: String((_d = remotion_1.Internals.getEffectiveVisualModeValue({
700
401
  propStatus: transformOriginPropStatus,
701
402
  dragOverrideValue: dragOverrides[selected_outline_types_1.transformOriginFieldKey],
702
403
  defaultValue: transformOriginFieldSchema.default,
703
404
  frame: transformOriginSourceFrame,
704
405
  shouldResortToDefaultValueIfUndefined: true,
705
- })) !== null && _c !== void 0 ? _c : transformOriginFieldSchema.default),
406
+ })) !== null && _d !== void 0 ? _d : transformOriginFieldSchema.default),
706
407
  rotateValue: String((rotationPropStatus === null || rotationPropStatus === void 0 ? void 0 : rotationPropStatus.status) === 'static' ||
707
408
  (rotationPropStatus === null || rotationPropStatus === void 0 ? void 0 : rotationPropStatus.status) === 'keyframed'
708
- ? ((_d = remotion_1.Internals.getEffectiveVisualModeValue({
409
+ ? ((_e = remotion_1.Internals.getEffectiveVisualModeValue({
709
410
  propStatus: rotationPropStatus,
710
411
  dragOverrideValue: dragOverrides[selected_outline_types_1.rotateFieldKey],
711
412
  defaultValue: (rotationFieldSchema === null || rotationFieldSchema === void 0 ? void 0 : rotationFieldSchema.type) === 'rotation-css'
@@ -713,11 +414,11 @@ const SelectedOutlineOverlay = ({ compositionHeight, compositionWidth, scale, tr
713
414
  : '0deg',
714
415
  frame: transformOriginSourceFrame,
715
416
  shouldResortToDefaultValueIfUndefined: true,
716
- })) !== null && _d !== void 0 ? _d : '0deg')
417
+ })) !== null && _e !== void 0 ? _e : '0deg')
717
418
  : '0deg'),
718
419
  scaleValue: (scalePropStatus === null || scalePropStatus === void 0 ? void 0 : scalePropStatus.status) === 'static' ||
719
420
  (scalePropStatus === null || scalePropStatus === void 0 ? void 0 : scalePropStatus.status) === 'keyframed'
720
- ? String((_e = remotion_1.Internals.getEffectiveVisualModeValue({
421
+ ? String((_f = remotion_1.Internals.getEffectiveVisualModeValue({
721
422
  propStatus: scalePropStatus,
722
423
  dragOverrideValue: dragOverrides[selected_outline_types_1.scaleFieldKey],
723
424
  defaultValue: (scaleFieldSchema === null || scaleFieldSchema === void 0 ? void 0 : scaleFieldSchema.type) === 'scale'
@@ -725,367 +426,194 @@ const SelectedOutlineOverlay = ({ compositionHeight, compositionWidth, scale, tr
725
426
  : 1,
726
427
  frame: transformOriginSourceFrame,
727
428
  shouldResortToDefaultValueIfUndefined: true,
728
- })) !== null && _e !== void 0 ? _e : 1)
429
+ })) !== null && _f !== void 0 ? _f : 1)
729
430
  : '1',
730
431
  schema: controls.schema,
731
432
  sourceFrame: transformOriginSourceFrame,
732
433
  translateDefault: fieldSchema.default,
733
434
  translatePropStatus: propStatus,
734
- translateValue: String((_f = remotion_1.Internals.getEffectiveVisualModeValue({
435
+ translateValue: String((_g = remotion_1.Internals.getEffectiveVisualModeValue({
735
436
  propStatus,
736
437
  dragOverrideValue: dragOverrides[selected_outline_types_1.translateFieldKey],
737
438
  defaultValue: fieldSchema.default,
738
439
  frame: transformOriginSourceFrame,
739
440
  shouldResortToDefaultValueIfUndefined: true,
740
- })) !== null && _f !== void 0 ? _f : fieldSchema.default),
441
+ })) !== null && _g !== void 0 ? _g : fieldSchema.default),
741
442
  }
742
443
  : null,
743
- uvHandles: containsSelection
744
- ? (0, selected_outline_uv_1.getSelectedUvHandles)({
745
- propStatuses,
746
- clientId,
747
- getEffectDragOverrides,
748
- nodePath,
749
- selectedEffects: selectedEffectsBySequenceKey.get(key),
750
- sequence,
751
- sourceFrame: timelinePosition - keyframeDisplayOffset,
752
- })
753
- : [],
754
- };
444
+ },
445
+ ];
446
+ });
447
+ };
448
+ const ActiveSelectedOutlineOverlayUnmemoized = ({ calculateOutlineTargetsForCurrentState, compositionHeight, compositionWidth, draggingOutline, getLatestOutlineTargetByKey, getSelectableOutlines, onDraggingChange, onSelect, scale, selectedSequenceKeys, sequenceKeysContainingSelection, sequences, translationX, translationY, }) => {
449
+ const timelinePosition = remotion_1.Internals.Timeline.useTimelinePosition();
450
+ const updateOutlinesRef = (0, react_1.useRef)(() => undefined);
451
+ const selectableOutlines = (0, react_1.useMemo)(() => {
452
+ return getSelectableOutlines(timelinePosition);
453
+ }, [getSelectableOutlines, timelinePosition]);
454
+ const outlineRuntimeControls = (0, react_1.useMemo)(() => {
455
+ return selectableOutlines.flatMap(({ key, sequence }) => {
456
+ if (!selectedSequenceKeys.has(key) &&
457
+ !sequenceKeysContainingSelection.has(key)) {
458
+ return [];
459
+ }
460
+ return sequence.controls ? [sequence.controls] : [];
755
461
  });
756
462
  }, [
757
- propStatuses,
758
- getDragOverrides,
759
- getEffectDragOverrides,
760
- getScaleLockState,
761
- editorShowOutlines,
762
- isFullscreen,
763
- overrideIdToNodePathMappings,
764
- previewInteractive,
765
- previewSelectionAvailable,
766
- previewServerState,
767
- selectedItems,
768
- sequences,
769
- compositions,
463
+ selectableOutlines,
464
+ selectedSequenceKeys,
465
+ sequenceKeysContainingSelection,
466
+ ]);
467
+ const outlineRuntimeSnapshots = (0, use_runtime_values_1.useRuntimeValueSnapshots)(outlineRuntimeControls);
468
+ const outlineRuntimeValuesByStore = (0, react_1.useMemo)(() => new Map(outlineRuntimeControls.map((controls, index) => [
469
+ controls.runtimeValues,
470
+ outlineRuntimeSnapshots[index],
471
+ ])), [outlineRuntimeControls, outlineRuntimeSnapshots]);
472
+ const outlineTargets = (0, react_1.useMemo)(() => calculateOutlineTargetsForCurrentState({
473
+ mode: 'layout',
474
+ runtimeValuesByStore: outlineRuntimeValuesByStore,
475
+ selectableOutlines,
476
+ targetKey: null,
477
+ targetTimelinePosition: timelinePosition,
478
+ }), [
479
+ calculateOutlineTargetsForCurrentState,
480
+ outlineRuntimeValuesByStore,
481
+ selectableOutlines,
770
482
  timelinePosition,
771
483
  ]);
772
- (0, react_1.useEffect)(() => {
773
- if ((hoveredSequence === null || hoveredSequence === void 0 ? void 0 : hoveredSequence.source) === 'canvas' &&
774
- !outlineTargets.some((target) => target.key === hoveredSequence.key)) {
775
- setHoveredSequence((currentHover) => (currentHover === null || currentHover === void 0 ? void 0 : currentHover.source) === 'canvas' ? null : currentHover);
776
- }
777
- }, [hoveredSequence, outlineTargets, setHoveredSequence]);
778
- const targetsByKey = (0, react_1.useMemo)(() => {
779
- return new Map(outlineTargets.map((target) => [target.key, target]));
780
- }, [outlineTargets]);
781
- const outlinesForRendering = (0, react_1.useMemo)(() => {
782
- return (0, exports.orderOutlinesForRendering)({ outlines, sequences, targetsByKey });
783
- }, [outlines, sequences, targetsByKey]);
784
- const outlinesByKey = (0, react_1.useMemo)(() => {
785
- return new Map(outlines.map((outline) => [outline.key, outline]));
786
- }, [outlines]);
787
- const allDragTargets = (0, react_1.useMemo)(() => {
788
- return outlineTargets.flatMap((target) => (target.selected || target.containsSelection) && target.drag !== null
789
- ? [target.drag]
790
- : []);
791
- }, [outlineTargets]);
792
- const allDragOutlines = (0, react_1.useMemo)(() => {
793
- return outlineTargets.flatMap((target) => {
794
- if ((!target.selected && !target.containsSelection) ||
795
- target.drag === null) {
796
- return [];
797
- }
798
- const outline = outlinesByKey.get(target.key);
799
- return outline === undefined ? [] : [outline];
800
- });
801
- }, [outlineTargets, outlinesByKey]);
802
- const allScaleDragTargets = (0, react_1.useMemo)(() => {
803
- return outlineTargets.flatMap((target) => target.selected && target.scaleDrag !== null ? [target.scaleDrag] : []);
804
- }, [outlineTargets]);
805
- const allRotationDragTargets = (0, react_1.useMemo)(() => {
806
- return outlineTargets.flatMap((target) => target.selected && target.rotationDrag !== null
807
- ? [target.rotationDrag]
808
- : []);
809
- }, [outlineTargets]);
810
- const guidesForSnap = (0, react_1.useMemo)(() => {
811
- if (!editorShowGuides || (canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) !== 'composition') {
484
+ const outlineTargetsRef = (0, react_1.useRef)(outlineTargets);
485
+ const getOutlineTargets = (0, react_1.useCallback)(() => outlineTargetsRef.current, []);
486
+ (0, react_1.useLayoutEffect)(() => {
487
+ outlineTargetsRef.current = outlineTargets;
488
+ updateOutlinesRef.current();
489
+ }, [outlineTargets, scale, translationX, translationY]);
490
+ return (jsx_runtime_1.jsx(SelectedOutlineRenderer_1.SelectedOutlineRenderer, { compositionHeight: compositionHeight, compositionWidth: compositionWidth, dragging: draggingOutline, getLatestOutlineTargetByKey: getLatestOutlineTargetByKey, getOutlineTargets: getOutlineTargets, onDraggingChange: onDraggingChange, onSelect: onSelect, scale: scale, sequences: sequences, updateOutlinesRef: updateOutlinesRef }));
491
+ };
492
+ const ActiveSelectedOutlineOverlay = react_1.default.memo(ActiveSelectedOutlineOverlayUnmemoized);
493
+ const SelectedOutlineOverlayUnmemoized = ({ canvasHovered, compositionHeight, compositionWidth, scale, translationX, translationY, }) => {
494
+ const { selectedItems, selectItem } = (0, TimelineSelection_1.useTimelineSelection)();
495
+ const { sequences } = (0, react_1.useContext)(remotion_1.Internals.SequenceManager);
496
+ const { compositions } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
497
+ const { propStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesContext);
498
+ const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
499
+ const { overrideIdToNodePathMappings } = (0, react_1.useContext)(remotion_1.Internals.OverrideIdsToNodePathsGettersContext);
500
+ const { getDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeDragOverridesContext);
501
+ const { getScaleLockState } = (0, react_1.useContext)(scale_lock_1.ScaleLockContext);
502
+ const { editorShowOutlines } = (0, react_1.useContext)(editor_outlines_1.EditorShowOutlinesContext);
503
+ const setHoveredSequence = (0, timeline_sequence_hover_1.useSetTimelineSequenceHover)();
504
+ const hoveredSequence = (0, timeline_sequence_hover_1.useTimelineSequenceHoverState)();
505
+ const isFullscreen = (0, use_is_fullscreen_1.useIsFullscreen)();
506
+ const { getCurrentFrame } = player_1.PlayerInternals.usePlayerMethods();
507
+ const [draggingOutline, setDraggingOutline] = (0, react_1.useState)(false);
508
+ const previewSelectionAvailable = previewServerState.type === 'connected' || window.remotion_isReadOnlyStudio;
509
+ const selectedSequenceKeys = (0, react_1.useMemo)(() => (0, selected_outline_measurement_1.getSelectedSequenceKeys)(selectedItems), [selectedItems]);
510
+ const sequenceKeysContainingSelection = (0, react_1.useMemo)(() => (0, selected_outline_measurement_1.getSequenceKeysContainingSelection)(selectedItems), [selectedItems]);
511
+ const selectedEffectsBySequenceKey = (0, react_1.useMemo)(() => (0, selected_outline_measurement_1.getSelectedEffectFieldsBySequenceKey)(selectedItems), [selectedItems]);
512
+ const selectedTransformOriginInfo = (0, react_1.useMemo)(() => (0, selected_outline_measurement_1.getSelectedTransformOriginInfo)(selectedItems), [selectedItems]);
513
+ const selectedCropInfo = (0, react_1.useMemo)(() => (0, selected_outline_measurement_1.getSelectedCropInfo)(selectedItems), [selectedItems]);
514
+ const getSelectableOutlines = (0, react_1.useCallback)((timelinePosition) => {
515
+ if (isFullscreen ||
516
+ !(0, interactivity_enabled_1.isStudioSelectionEnabled)() ||
517
+ !previewSelectionAvailable ||
518
+ !editorShowOutlines) {
812
519
  return [];
813
520
  }
814
- return guidesList.filter((guide) => guide.compositionId === canvasContent.compositionId);
815
- }, [canvasContent, editorShowGuides, guidesList]);
816
- const snapTargets = (0, react_1.useMemo)(() => {
817
- return (0, selected_outline_snap_1.getSelectedOutlineSnapTargets)({
818
- compositionHeight,
819
- compositionWidth,
820
- guides: guidesForSnap,
821
- });
822
- }, [compositionHeight, compositionWidth, guidesForSnap]);
823
- const saveKeyboardNudgeSession = (0, react_1.useCallback)(() => {
824
- const session = keyboardNudgeSessionRef.current;
825
- if (session === null) {
826
- return;
827
- }
828
- keyboardNudgeSessionRef.current = null;
829
- const changes = (0, selected_outline_drag_1.getSelectedOutlineDragChanges)({
830
- dragStates: session.dragStates,
831
- lastValues: session.lastValues,
832
- });
833
- if (changes.length === 0) {
834
- (0, selected_outline_drag_1.clearSelectedOutlineDragOverrides)({
835
- clearDragOverrides,
836
- dragStates: session.dragStates,
837
- });
838
- return;
839
- }
840
- const staticChanges = changes.filter((change) => change.type === 'static');
841
- const keyframedChanges = changes.filter((change) => change.type === 'keyframed');
842
- Promise.all([
843
- staticChanges.length > 0
844
- ? (0, save_sequence_prop_1.saveSequenceProps)({
845
- changes: staticChanges,
846
- addedKeyframes: null,
847
- movedKeyframes: null,
848
- setPropStatuses,
849
- clientId: session.clientId,
850
- undoLabel: changes.length > 1 ? 'Move selected sequences' : 'Move sequence',
851
- redoLabel: changes.length > 1
852
- ? 'Move selected sequences back'
853
- : 'Move sequence back',
854
- })
855
- : Promise.resolve(),
856
- (0, call_add_keyframe_1.callAddKeyframes)({
857
- sequenceKeyframes: keyframedChanges,
858
- effectKeyframes: [],
859
- setPropStatuses,
860
- clientId: session.clientId,
861
- }),
862
- ])
863
- .catch((err) => {
864
- (0, NotificationCenter_1.showNotification)(`Could not save sequence props: ${err instanceof Error ? err.message : String(err)}`, 4000);
865
- })
866
- .finally(() => {
867
- (0, selected_outline_drag_1.clearSelectedOutlineDragOverrides)({
868
- clearDragOverrides,
869
- dragStates: session.dragStates,
870
- });
871
- });
872
- }, [clearDragOverrides, setPropStatuses]);
873
- (0, react_1.useEffect)(() => {
874
- saveKeyboardNudgeSessionRef.current = saveKeyboardNudgeSession;
875
- }, [saveKeyboardNudgeSession]);
876
- (0, react_1.useEffect)(() => {
877
- return () => {
878
- saveKeyboardNudgeSessionRef.current();
879
- };
880
- }, []);
881
- const seekWithArrowKey = (0, react_1.useCallback)((event, direction) => {
882
- if (direction === 'up' || direction === 'down') {
883
- return;
884
- }
885
- event.preventDefault();
886
- if (direction === 'left') {
887
- if (event.altKey) {
888
- seek(0);
889
- (0, timeline_scroll_logic_1.ensureFrameIsInViewport)({
890
- direction: 'fit-left',
891
- durationInFrames: (0, imperative_state_1.getCurrentDuration)(),
892
- frame: 0,
893
- });
894
- }
895
- else if (event.shiftKey) {
896
- frameBack((0, imperative_state_1.getCurrentFps)());
897
- (0, timeline_scroll_logic_1.ensureFrameIsInViewport)({
898
- direction: 'fit-left',
899
- durationInFrames: (0, imperative_state_1.getCurrentDuration)(),
900
- frame: Math.max(0, getCurrentFrame() - (0, imperative_state_1.getCurrentFps)()),
901
- });
902
- }
903
- else {
904
- frameBack(1);
905
- (0, timeline_scroll_logic_1.ensureFrameIsInViewport)({
906
- direction: 'fit-left',
907
- durationInFrames: (0, imperative_state_1.getCurrentDuration)(),
908
- frame: Math.max(0, getCurrentFrame() - 1),
909
- });
910
- }
911
- return;
912
- }
913
- if (event.altKey) {
914
- seek((0, imperative_state_1.getCurrentDuration)() - 1);
915
- (0, timeline_scroll_logic_1.ensureFrameIsInViewport)({
916
- direction: 'fit-right',
917
- durationInFrames: (0, imperative_state_1.getCurrentDuration)() - 1,
918
- frame: (0, imperative_state_1.getCurrentDuration)() - 1,
919
- });
920
- }
921
- else if (event.shiftKey) {
922
- frameForward((0, imperative_state_1.getCurrentFps)());
923
- (0, timeline_scroll_logic_1.ensureFrameIsInViewport)({
924
- direction: 'fit-right',
925
- durationInFrames: (0, imperative_state_1.getCurrentDuration)(),
926
- frame: Math.min((0, imperative_state_1.getCurrentDuration)() - 1, getCurrentFrame() + (0, imperative_state_1.getCurrentFps)()),
927
- });
928
- }
929
- else {
930
- frameForward(1);
931
- (0, timeline_scroll_logic_1.ensureFrameIsInViewport)({
932
- direction: 'fit-right',
933
- durationInFrames: (0, imperative_state_1.getCurrentDuration)(),
934
- frame: Math.min((0, imperative_state_1.getCurrentDuration)() - 1, getCurrentFrame() + 1),
935
- });
936
- }
937
- }, [frameBack, frameForward, getCurrentFrame, seek]);
938
- const onArrowKeyDown = (0, react_1.useCallback)((event) => {
939
- var _a;
940
- const direction = (0, selected_outline_drag_1.getSelectedOutlineKeyboardNudgeDirection)(event.key);
941
- if (direction === null) {
942
- return;
943
- }
944
- if (selectedItems.length === 0 || allDragTargets.length === 0) {
945
- seekWithArrowKey(event, direction);
946
- return;
947
- }
948
- if (event.altKey) {
949
- seekWithArrowKey(event, direction);
950
- return;
951
- }
952
- event.preventDefault();
953
- const activeSession = (_a = keyboardNudgeSessionRef.current) !== null && _a !== void 0 ? _a : (() => {
954
- const [firstDragTarget] = allDragTargets;
955
- if (firstDragTarget === undefined) {
956
- throw new Error('Expected a drag target');
957
- }
958
- return {
959
- clientId: firstDragTarget.clientId,
960
- deltaX: 0,
961
- deltaY: 0,
962
- dragStates: (0, selected_outline_drag_1.getSelectedOutlineDragStates)({
963
- dragTargets: allDragTargets,
964
- getDragOverrides,
965
- timelinePosition,
966
- }),
967
- lastValues: new Map(),
968
- };
969
- })();
970
- keyboardNudgeSessionRef.current = activeSession;
971
- const nextDeltas = (0, selected_outline_drag_1.getSelectedOutlineKeyboardNudgeDeltas)({
972
- deltaX: activeSession.deltaX,
973
- deltaY: activeSession.deltaY,
974
- direction,
975
- shiftKey: event.shiftKey,
976
- });
977
- activeSession.deltaX = nextDeltas.deltaX;
978
- activeSession.deltaY = nextDeltas.deltaY;
979
- const lastValues = (0, selected_outline_drag_1.getSelectedOutlineDragValues)({
980
- dragStates: activeSession.dragStates,
981
- deltaX: activeSession.deltaX,
982
- deltaY: activeSession.deltaY,
521
+ return (0, selected_outline_measurement_1.getSequencesWithSelectableOutlines)({
522
+ sequences,
523
+ overrideIdsToNodePaths: overrideIdToNodePathMappings,
524
+ compositions,
525
+ timelinePosition,
983
526
  });
984
- activeSession.lastValues = lastValues;
985
- for (const dragState of activeSession.dragStates) {
986
- const value = lastValues.get(dragState.key);
987
- if (value === undefined) {
988
- throw new Error('Expected drag value to be available');
989
- }
990
- if (dragState.target.propStatus.status === 'keyframed') {
991
- setDragOverrides(dragState.target.nodePath, selected_outline_types_1.translateFieldKey, remotion_1.Internals.makeKeyframedDragOverride({
992
- status: dragState.target.propStatus,
993
- frame: dragState.sourceFrame,
994
- value,
995
- }));
996
- }
997
- else {
998
- setDragOverrides(dragState.target.nodePath, selected_outline_types_1.translateFieldKey, remotion_1.Internals.makeStaticDragOverride(value));
999
- }
1000
- }
1001
527
  }, [
1002
- allDragTargets,
528
+ compositions,
529
+ editorShowOutlines,
530
+ isFullscreen,
531
+ overrideIdToNodePathMappings,
532
+ previewSelectionAvailable,
533
+ sequences,
534
+ ]);
535
+ const calculateOutlineTargetsForCurrentState = (0, react_1.useCallback)((options) => calculateOutlineTargets({
536
+ ...options,
537
+ connectedClientId: previewServerState.type === 'connected'
538
+ ? previewServerState.clientId
539
+ : null,
540
+ editorShowOutlines,
1003
541
  getDragOverrides,
1004
- seekWithArrowKey,
1005
- selectedItems.length,
1006
- setDragOverrides,
1007
- timelinePosition,
542
+ getScaleLockState,
543
+ isFullscreen,
544
+ previewSelectionAvailable,
545
+ propStatuses,
546
+ selectedCropInfo,
547
+ selectedEffectsBySequenceKey,
548
+ selectedSequenceKeys,
549
+ selectedTransformOriginInfo,
550
+ sequenceKeysContainingSelection,
551
+ studioInteractivityEnabled: (0, interactivity_enabled_1.isStudioInteractivityEnabled)(),
552
+ }), [
553
+ editorShowOutlines,
554
+ getDragOverrides,
555
+ getScaleLockState,
556
+ isFullscreen,
557
+ previewSelectionAvailable,
558
+ previewServerState,
559
+ propStatuses,
560
+ selectedCropInfo,
561
+ selectedEffectsBySequenceKey,
562
+ selectedSequenceKeys,
563
+ selectedTransformOriginInfo,
564
+ sequenceKeysContainingSelection,
1008
565
  ]);
1009
- const onArrowKeyUp = (0, react_1.useCallback)((event) => {
1010
- const direction = (0, selected_outline_drag_1.getSelectedOutlineKeyboardNudgeDirection)(event.key);
1011
- if (direction === null || keyboardNudgeSessionRef.current === null) {
1012
- return;
1013
- }
1014
- event.preventDefault();
1015
- saveKeyboardNudgeSession();
1016
- }, [saveKeyboardNudgeSession]);
1017
- (0, react_1.useEffect)(() => {
1018
- const keyDownBindings = ['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown'].map((key) => keybindings.registerKeybinding({
1019
- event: 'keydown',
1020
- key,
1021
- callback: onArrowKeyDown,
1022
- commandCtrlKey: false,
1023
- preventDefault: false,
1024
- triggerIfInputFieldFocused: false,
1025
- keepRegisteredWhenNotHighestContext: false,
1026
- }));
1027
- const keyUpBindings = ['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown'].map((key) => keybindings.registerKeybinding({
1028
- event: 'keyup',
1029
- key,
1030
- callback: onArrowKeyUp,
1031
- commandCtrlKey: false,
1032
- preventDefault: false,
1033
- triggerIfInputFieldFocused: false,
1034
- keepRegisteredWhenNotHighestContext: false,
1035
- }));
1036
- return () => {
1037
- for (const binding of [...keyDownBindings, ...keyUpBindings]) {
1038
- binding.unregister();
1039
- }
566
+ const calculateOutlineTargetsRef = (0, react_1.useRef)(calculateOutlineTargetsForCurrentState);
567
+ const getSelectableOutlinesRef = (0, react_1.useRef)(getSelectableOutlines);
568
+ const selectableOutlinesCacheRef = (0, react_1.useRef)(null);
569
+ (0, react_1.useLayoutEffect)(() => {
570
+ calculateOutlineTargetsRef.current = calculateOutlineTargetsForCurrentState;
571
+ getSelectableOutlinesRef.current = getSelectableOutlines;
572
+ }, [calculateOutlineTargetsForCurrentState, getSelectableOutlines]);
573
+ const getSelectableOutlinesAtFrame = (0, react_1.useCallback)((timelinePosition) => {
574
+ const currentGetSelectableOutlines = getSelectableOutlinesRef.current;
575
+ const cached = selectableOutlinesCacheRef.current;
576
+ if ((cached === null || cached === void 0 ? void 0 : cached.timelinePosition) === timelinePosition &&
577
+ cached.getSelectableOutlines === currentGetSelectableOutlines) {
578
+ return cached.selectableOutlines;
579
+ }
580
+ const selectableOutlines = currentGetSelectableOutlines(timelinePosition);
581
+ selectableOutlinesCacheRef.current = {
582
+ getSelectableOutlines: currentGetSelectableOutlines,
583
+ selectableOutlines,
584
+ timelinePosition,
1040
585
  };
1041
- }, [keybindings, onArrowKeyDown, onArrowKeyUp, saveKeyboardNudgeSession]);
1042
- const updateOutlines = (0, react_1.useCallback)(() => {
1043
- if (overlayRef.current === null || outlineTargets.length === 0) {
1044
- setOutlines((prevOutlines) => prevOutlines.length === 0 ? prevOutlines : []);
1045
- return;
586
+ return selectableOutlines;
587
+ }, []);
588
+ const getLatestOutlineTargetByKey = (0, react_1.useCallback)((key) => {
589
+ const timelinePosition = getCurrentFrame();
590
+ const target = calculateOutlineTargetsRef.current({
591
+ mode: 'controls',
592
+ runtimeValuesByStore: new Map(),
593
+ selectableOutlines: getSelectableOutlinesAtFrame(timelinePosition),
594
+ targetKey: key,
595
+ targetTimelinePosition: timelinePosition,
596
+ })[0];
597
+ return target;
598
+ }, [getCurrentFrame, getSelectableOutlinesAtFrame]);
599
+ const getCurrentSelectableOutlines = (0, react_1.useCallback)(() => getSelectableOutlinesAtFrame(getCurrentFrame()), [getCurrentFrame, getSelectableOutlinesAtFrame]);
600
+ const onDraggingChange = (0, react_1.useCallback)((dragging) => {
601
+ setDraggingOutline(dragging);
602
+ if (dragging) {
603
+ setHoveredSequence((currentHover) => (currentHover === null || currentHover === void 0 ? void 0 : currentHover.source) === 'canvas' ? null : currentHover);
1046
604
  }
1047
- const nextOutlines = (0, selected_outline_measurement_1.measureOutlines)(overlayRef.current, outlineTargets);
1048
- setOutlines((prevOutlines) => (0, selected_outline_measurement_1.outlinesAreEqual)(prevOutlines, nextOutlines)
1049
- ? prevOutlines
1050
- : nextOutlines);
1051
- }, [outlineTargets]);
1052
- (0, react_1.useLayoutEffect)(() => {
1053
- updateOutlines();
1054
- }, [outlineTargets, scale, translationX, translationY, updateOutlines]);
605
+ }, [setHoveredSequence]);
606
+ const selectOutlineItem = (0, react_1.useCallback)((item, interaction) => {
607
+ selectItem(item, interaction, undefined, { reveal: true });
608
+ }, [selectItem]);
609
+ const measurementActive = canvasHovered || draggingOutline || (hoveredSequence === null || hoveredSequence === void 0 ? void 0 : hoveredSequence.source) === 'timeline';
1055
610
  (0, react_1.useLayoutEffect)(() => {
1056
- if (outlineTargets.length === 0 || typeof ResizeObserver === 'undefined') {
611
+ if (measurementActive) {
1057
612
  return;
1058
613
  }
1059
- let animationFrame = null;
1060
- const scheduleUpdate = () => {
1061
- if (animationFrame !== null) {
1062
- return;
1063
- }
1064
- animationFrame = requestAnimationFrame(() => {
1065
- animationFrame = null;
1066
- updateOutlines();
1067
- });
1068
- };
1069
- const resizeObserver = new ResizeObserver(scheduleUpdate);
1070
- if (overlayRef.current !== null) {
1071
- resizeObserver.observe(overlayRef.current);
1072
- }
1073
- for (const target of outlineTargets) {
1074
- if (target.ref.current !== null) {
1075
- resizeObserver.observe(target.ref.current);
1076
- }
1077
- }
1078
- return () => {
1079
- if (animationFrame !== null) {
1080
- cancelAnimationFrame(animationFrame);
1081
- }
1082
- resizeObserver.disconnect();
1083
- };
1084
- }, [outlineTargets, updateOutlines]);
1085
- if (outlineTargets.length === 0) {
1086
- return null;
1087
- }
1088
- return (jsx_runtime_1.jsxs("svg", { ref: overlayRef, style: outlineContainer, width: "100%", height: "100%", "aria-hidden": "true", children: [
1089
- jsx_runtime_1.jsx(SelectedOutlineSnapIndicators, { activeSnapPoints: activeSnapPoints, compositionHeight: compositionHeight, compositionWidth: compositionWidth, scale: scale }), outlinesForRendering.map((outline) => (jsx_runtime_1.jsx(SelectedOutlineElement_1.SelectedOutlineElement, { allDragTargets: allDragTargets, allDragOutlines: allDragOutlines, allRotationDragTargets: allRotationDragTargets, allScaleDragTargets: allScaleDragTargets, dragging: draggingOutline, hovered: (hoveredSequence === null || hoveredSequence === void 0 ? void 0 : hoveredSequence.key) === outline.key, outline: outline, onDraggingChange: onDraggingChange, onHoverChange: onHoverChange, onSnapPointsChange: onSnapPointsChange, onSelect: selectOutlineItem, scale: scale, snapTargets: snapTargets, target: targetsByKey.get(outline.key) }, outline.key))), outlinesForRendering.map((outline) => (jsx_runtime_1.jsx(SelectedOutlineElement_1.SelectedOutlineTransformOriginHandle, { outline: outline, onDraggingChange: onDraggingChange, target: targetsByKey.get(outline.key) }, `${outline.key}-transform-origin`))), outlinesForRendering.map((outline) => (jsx_runtime_1.jsx(SelectedOutlineUvControls_1.SelectedOutlineUvHandleConnectionLayer, { outline: outline, target: targetsByKey.get(outline.key) }, `${outline.key}-uv-connection-lines`))), outlinesForRendering.map((outline) => (jsx_runtime_1.jsx(SelectedOutlineUvControls_1.SelectedOutlineUvHandleCircleLayer, { onDraggingChange: onDraggingChange, onSelect: selectOutlineItem, outline: outline, target: targetsByKey.get(outline.key) }, `${outline.key}-uv-handles`)))] }));
614
+ setHoveredSequence((currentHover) => (currentHover === null || currentHover === void 0 ? void 0 : currentHover.source) === 'canvas' ? null : currentHover);
615
+ }, [measurementActive, setHoveredSequence]);
616
+ return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
617
+ 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, onDraggingChange: onDraggingChange, onSelect: selectOutlineItem, scale: scale, selectedSequenceKeys: selectedSequenceKeys, sequenceKeysContainingSelection: sequenceKeysContainingSelection, sequences: sequences, translationX: translationX, translationY: translationY })) : null] }));
1090
618
  };
1091
- exports.SelectedOutlineOverlay = SelectedOutlineOverlay;
619
+ exports.SelectedOutlineOverlay = react_1.default.memo(SelectedOutlineOverlayUnmemoized);