@remotion/studio 4.0.472 → 4.0.474

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 (165) hide show
  1. package/dist/api/rename-static-file.d.ts +6 -0
  2. package/dist/api/rename-static-file.js +18 -0
  3. package/dist/components/AssetSelector.js +45 -4
  4. package/dist/components/AssetSelectorItem.js +177 -27
  5. package/dist/components/Canvas.js +131 -11
  6. package/dist/components/ConfirmationDialog-types.d.ts +8 -0
  7. package/dist/components/ConfirmationDialog-types.js +2 -0
  8. package/dist/components/ConfirmationDialog.d.ts +7 -0
  9. package/dist/components/ConfirmationDialog.js +103 -0
  10. package/dist/components/ContextMenu.d.ts +9 -1
  11. package/dist/components/ContextMenu.js +49 -5
  12. package/dist/components/CurrentAsset.d.ts +1 -0
  13. package/dist/components/CurrentAsset.js +13 -2
  14. package/dist/components/EditorContent.js +15 -2
  15. package/dist/components/EditorContexts.js +2 -1
  16. package/dist/components/EditorRuler/Ruler.js +2 -0
  17. package/dist/components/ExplorerPanel.d.ts +0 -4
  18. package/dist/components/ExplorerPanel.js +8 -4
  19. package/dist/components/ExplorerPanelRef.d.ts +4 -0
  20. package/dist/components/ExplorerPanelRef.js +5 -0
  21. package/dist/components/FilePreview.d.ts +1 -1
  22. package/dist/components/InitialCompositionLoader.d.ts +0 -1
  23. package/dist/components/InitialCompositionLoader.js +5 -27
  24. package/dist/components/Menu/MenuItem.js +7 -1
  25. package/dist/components/Menu/SubMenu.js +5 -1
  26. package/dist/components/Menu/portals.js +17 -8
  27. package/dist/components/MenuToolbar.js +5 -1
  28. package/dist/components/ModalContainer.js +6 -1
  29. package/dist/components/Modals.js +5 -2
  30. package/dist/components/NewComposition/ComboBox.js +8 -2
  31. package/dist/components/NewComposition/InputDragger.d.ts +1 -0
  32. package/dist/components/NewComposition/InputDragger.js +9 -6
  33. package/dist/components/NewComposition/RenameStaticFile.d.ts +4 -0
  34. package/dist/components/NewComposition/RenameStaticFile.js +118 -0
  35. package/dist/components/OptionsPanel.js +5 -1
  36. package/dist/components/OutlineToggle.d.ts +2 -0
  37. package/dist/components/OutlineToggle.js +20 -0
  38. package/dist/components/Preview.d.ts +0 -2
  39. package/dist/components/Preview.js +23 -33
  40. package/dist/components/PreviewToolbar.js +19 -6
  41. package/dist/components/RenderButton.js +8 -2
  42. package/dist/components/RenderPreview.js +2 -2
  43. package/dist/components/SelectedOutlineOverlay.d.ts +29 -3
  44. package/dist/components/SelectedOutlineOverlay.js +259 -80
  45. package/dist/components/ShowOutlinesProvider.d.ts +4 -0
  46. package/dist/components/ShowOutlinesProvider.js +24 -0
  47. package/dist/components/SizeSelector.js +3 -3
  48. package/dist/components/Splitter/SplitterHandle.js +2 -0
  49. package/dist/components/StaticFilePreview.js +2 -2
  50. package/dist/components/Timeline/KeyframeSettingsModal.d.ts +15 -0
  51. package/dist/components/Timeline/KeyframeSettingsModal.js +150 -0
  52. package/dist/components/Timeline/SequencePropsObserver.js +3 -3
  53. package/dist/components/Timeline/Timeline.js +3 -13
  54. package/dist/components/Timeline/TimelineClipboardKeybindings.d.ts +26 -3
  55. package/dist/components/Timeline/TimelineClipboardKeybindings.js +242 -25
  56. package/dist/components/Timeline/TimelineDeleteKeybindings.js +23 -11
  57. package/dist/components/Timeline/TimelineEffectItem.js +8 -7
  58. package/dist/components/Timeline/TimelineEffectPropItem.js +69 -19
  59. package/dist/components/Timeline/TimelineExpandedKeyframeRow.js +6 -1
  60. package/dist/components/Timeline/TimelineExpandedSection.js +5 -5
  61. package/dist/components/Timeline/TimelineKeyframeControls.js +13 -23
  62. package/dist/components/Timeline/TimelineKeyframeDiamond.js +24 -22
  63. package/dist/components/Timeline/TimelineKeyframeDiamondIcon.d.ts +6 -0
  64. package/dist/components/Timeline/TimelineKeyframeDiamondIcon.js +14 -0
  65. package/dist/components/Timeline/TimelineKeyframeDragState.d.ts +17 -0
  66. package/dist/components/Timeline/TimelineKeyframeDragState.js +39 -0
  67. package/dist/components/Timeline/TimelineKeyframeEasingLine.d.ts +9 -0
  68. package/dist/components/Timeline/TimelineKeyframeEasingLine.js +120 -0
  69. package/dist/components/Timeline/TimelineKeyframedValue.js +1 -1
  70. package/dist/components/Timeline/TimelineList.js +2 -2
  71. package/dist/components/Timeline/TimelineMediaInfo.d.ts +0 -13
  72. package/dist/components/Timeline/TimelineMediaInfo.js +8 -73
  73. package/dist/components/Timeline/TimelineNumberField.js +15 -7
  74. package/dist/components/Timeline/TimelineRotationField.js +17 -11
  75. package/dist/components/Timeline/TimelineScaleField.js +17 -13
  76. package/dist/components/Timeline/TimelineSelection.d.ts +15 -0
  77. package/dist/components/Timeline/TimelineSelection.js +26 -1
  78. package/dist/components/Timeline/TimelineSequence.js +6 -6
  79. package/dist/components/Timeline/TimelineSequenceItem.d.ts +1 -0
  80. package/dist/components/Timeline/TimelineSequenceItem.js +297 -36
  81. package/dist/components/Timeline/TimelineSequencePropItem.js +113 -48
  82. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +5 -5
  83. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +69 -70
  84. package/dist/components/Timeline/TimelineTranslateField.js +24 -19
  85. package/dist/components/Timeline/TimelineUvCoordinateField.js +18 -12
  86. package/dist/components/Timeline/apply-effect-response-to-prop-statuses.d.ts +5 -0
  87. package/dist/components/Timeline/apply-effect-response-to-prop-statuses.js +19 -0
  88. package/dist/components/Timeline/call-add-keyframe.d.ts +5 -5
  89. package/dist/components/Timeline/call-add-keyframe.js +6 -4
  90. package/dist/components/Timeline/call-delete-keyframe.d.ts +7 -7
  91. package/dist/components/Timeline/call-delete-keyframe.js +7 -7
  92. package/dist/components/Timeline/call-move-keyframe.d.ts +19 -0
  93. package/dist/components/Timeline/call-move-keyframe.js +71 -0
  94. package/dist/components/Timeline/call-update-keyframe-settings.d.ts +22 -0
  95. package/dist/components/Timeline/call-update-keyframe-settings.js +52 -0
  96. package/dist/components/Timeline/delete-selected-keyframe.d.ts +5 -5
  97. package/dist/components/Timeline/delete-selected-keyframe.js +5 -5
  98. package/dist/components/Timeline/delete-selected-timeline-item.d.ts +10 -7
  99. package/dist/components/Timeline/delete-selected-timeline-item.js +37 -23
  100. package/dist/components/Timeline/duplicate-selected-timeline-item.d.ts +4 -2
  101. package/dist/components/Timeline/duplicate-selected-timeline-item.js +39 -34
  102. package/dist/components/Timeline/get-bounded-keyframe-drag-delta.d.ts +8 -0
  103. package/dist/components/Timeline/get-bounded-keyframe-drag-delta.js +12 -0
  104. package/dist/components/Timeline/get-keyframe-navigation.d.ts +2 -2
  105. package/dist/components/Timeline/get-keyframe-navigation.js +14 -6
  106. package/dist/components/Timeline/get-node-keyframes.d.ts +3 -3
  107. package/dist/components/Timeline/get-node-keyframes.js +4 -4
  108. package/dist/components/Timeline/get-timeline-easing-segments.d.ts +9 -0
  109. package/dist/components/Timeline/get-timeline-easing-segments.js +19 -0
  110. package/dist/components/Timeline/reset-selected-timeline-props.d.ts +7 -7
  111. package/dist/components/Timeline/reset-selected-timeline-props.js +13 -12
  112. package/dist/components/Timeline/save-effect-prop.d.ts +16 -5
  113. package/dist/components/Timeline/save-effect-prop.js +37 -19
  114. package/dist/components/Timeline/save-prop-queue.d.ts +4 -3
  115. package/dist/components/Timeline/save-prop-queue.js +6 -3
  116. package/dist/components/Timeline/save-sequence-prop.d.ts +5 -10
  117. package/dist/components/Timeline/save-sequence-prop.js +35 -32
  118. package/dist/components/Timeline/should-clear-selection-on-pointer-down.d.ts +3 -0
  119. package/dist/components/Timeline/should-clear-selection-on-pointer-down.js +7 -0
  120. package/dist/components/Timeline/timeline-asset-link.d.ts +13 -0
  121. package/dist/components/Timeline/timeline-asset-link.js +37 -0
  122. package/dist/components/Timeline/timeline-field-utils.d.ts +10 -0
  123. package/dist/components/Timeline/timeline-field-utils.js +26 -5
  124. package/dist/components/Timeline/timeline-translate-utils.d.ts +1 -1
  125. package/dist/components/Timeline/timeline-translate-utils.js +6 -4
  126. package/dist/components/Timeline/use-expanded-track-keyframe-rows.js +7 -7
  127. package/dist/components/Timeline/use-sequence-props-subscription.js +3 -3
  128. package/dist/components/Timeline/use-timeline-height.js +3 -3
  129. package/dist/components/Timeline/use-timeline-keyframe-drag.d.ts +10 -0
  130. package/dist/components/Timeline/use-timeline-keyframe-drag.js +380 -0
  131. package/dist/components/import-assets.d.ts +31 -0
  132. package/dist/components/import-assets.js +216 -17
  133. package/dist/components/load-canvas-content-from-url.d.ts +1 -0
  134. package/dist/components/load-canvas-content-from-url.js +9 -3
  135. package/dist/components/use-select-asset.d.ts +1 -0
  136. package/dist/components/use-select-asset.js +30 -0
  137. package/dist/error-overlay/error-origin.d.ts +3 -0
  138. package/dist/error-overlay/error-origin.js +42 -0
  139. package/dist/error-overlay/react-overlay/listen-to-runtime-errors.js +6 -2
  140. package/dist/error-overlay/remotion-overlay/ErrorLoader.js +38 -0
  141. package/dist/error-overlay/remotion-overlay/ShortcutHint.js +1 -1
  142. package/dist/error-overlay/remotion-overlay/log-studio-error.d.ts +3 -0
  143. package/dist/error-overlay/remotion-overlay/log-studio-error.js +27 -0
  144. package/dist/esm/{chunk-48grt472.js → chunk-xjvc8qen.js} +21838 -18862
  145. package/dist/esm/internals.mjs +21838 -18862
  146. package/dist/esm/previewEntry.mjs +21127 -18127
  147. package/dist/esm/renderEntry.mjs +1 -1
  148. package/dist/helpers/get-asset-metadata.js +2 -2
  149. package/dist/helpers/get-preview-file-type.d.ts +2 -0
  150. package/dist/helpers/get-preview-file-type.js +33 -0
  151. package/dist/helpers/install-required-package.d.ts +1 -0
  152. package/dist/helpers/install-required-package.js +39 -0
  153. package/dist/helpers/remote-asset-drag.d.ts +4 -0
  154. package/dist/helpers/remote-asset-drag.js +73 -0
  155. package/dist/helpers/timeline-layout.d.ts +6 -6
  156. package/dist/helpers/timeline-layout.js +5 -5
  157. package/dist/helpers/use-asset-drag-events.d.ts +5 -2
  158. package/dist/helpers/use-asset-drag-events.js +13 -2
  159. package/dist/hot-middleware-client/client.js +6 -0
  160. package/dist/state/editor-outlines.d.ts +8 -0
  161. package/dist/state/editor-outlines.js +18 -0
  162. package/dist/state/modals.d.ts +16 -2
  163. package/package.json +10 -10
  164. package/dist/helpers/detect-file-type.d.ts +0 -69
  165. package/dist/helpers/detect-file-type.js +0 -278
@@ -33,7 +33,8 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.SelectedOutlineOverlay = exports.getSelectedOutlineScaleDragChanges = exports.getSelectedOutlineScaleDragValues = exports.getSelectedOutlineScaleDragStates = exports.getSelectedOutlineScaleEdgeInfo = exports.getSelectedOutlineDragChanges = exports.getSelectedOutlineDragValues = exports.getSequencesWithSelectableOutlines = exports.getSelectedEffectFieldsBySequenceKey = exports.getOutlineSelectionInteraction = exports.getUvCoordinateForPoint = exports.getUvHandlePosition = void 0;
36
+ exports.SelectedOutlineOverlay = exports.getSelectedOutlineScaleDragChanges = exports.getSelectedOutlineScaleDragValues = exports.getSelectedOutlineScaleDragStates = exports.getSelectedOutlineScaleEdgeInfo = exports.getSelectedOutlineDragChanges = exports.getSelectedOutlineDragValues = exports.getSequencesWithSelectableOutlines = exports.getSelectedEffectFieldsBySequenceKey = exports.getOutlineSelectionInteraction = exports.getSelectedSequenceKeys = exports.getUvCoordinateForPoint = exports.getUvHandleConnectionLines = exports.getUvHandlePosition = void 0;
37
+ exports.constrainUv = constrainUv;
37
38
  const jsx_runtime_1 = require("react/jsx-runtime");
38
39
  const react_1 = __importStar(require("react"));
39
40
  const remotion_1 = require("remotion");
@@ -41,16 +42,20 @@ const no_react_1 = require("remotion/no-react");
41
42
  const calculate_timeline_1 = require("../helpers/calculate-timeline");
42
43
  const client_id_1 = require("../helpers/client-id");
43
44
  const colors_1 = require("../helpers/colors");
45
+ const format_file_location_1 = require("../helpers/format-file-location");
44
46
  const get_box_quads_ponyfill_1 = require("../helpers/get-box-quads-ponyfill");
47
+ const open_in_editor_1 = require("../helpers/open-in-editor");
48
+ const editor_outlines_1 = require("../state/editor-outlines");
45
49
  const scale_lock_1 = require("../state/scale-lock");
50
+ const ContextMenu_1 = require("./ContextMenu");
46
51
  const NotificationCenter_1 = require("./Notifications/NotificationCenter");
47
52
  const call_add_keyframe_1 = require("./Timeline/call-add-keyframe");
48
53
  const save_effect_prop_1 = require("./Timeline/save-effect-prop");
49
54
  const save_sequence_prop_1 = require("./Timeline/save-sequence-prop");
50
- const timeline_field_utils_1 = require("./Timeline/timeline-field-utils");
51
55
  const timeline_translate_utils_1 = require("./Timeline/timeline-translate-utils");
52
56
  const TimelineScaleField_1 = require("./Timeline/TimelineScaleField");
53
57
  const TimelineSelection_1 = require("./Timeline/TimelineSelection");
58
+ const get_stack_1 = require("./Timeline/TimelineStack/get-stack");
54
59
  const translateFieldKey = 'style.translate';
55
60
  const scaleFieldKey = 'style.scale';
56
61
  const outlineContainer = {
@@ -59,6 +64,7 @@ const outlineContainer = {
59
64
  pointerEvents: 'none',
60
65
  overflow: 'visible',
61
66
  };
67
+ const emptyContextMenuValues = [];
62
68
  const pointToString = (point) => `${point.x},${point.y}`;
63
69
  const parseUvCoordinate = (value) => {
64
70
  if (Array.isArray(value) &&
@@ -142,6 +148,39 @@ const getUvHandlePosition = (points, uv) => {
142
148
  : applyProjectiveTransform(transform, uv);
143
149
  };
144
150
  exports.getUvHandlePosition = getUvHandlePosition;
151
+ const getUvHandleConnectionLines = ({ handles, points, }) => {
152
+ const handlesByField = new Map(handles.map((handle) => [
153
+ `${handle.effectIndex}\u0000${handle.fieldKey}`,
154
+ handle,
155
+ ]));
156
+ const seenPairs = new Set();
157
+ const lines = [];
158
+ for (const handle of handles) {
159
+ const targetFieldKey = handle.fieldSchema.lineTo;
160
+ if (targetFieldKey === undefined || targetFieldKey === handle.fieldKey) {
161
+ continue;
162
+ }
163
+ const target = handlesByField.get(`${handle.effectIndex}\u0000${targetFieldKey}`);
164
+ if (target === undefined) {
165
+ continue;
166
+ }
167
+ const pairKey = [
168
+ handle.effectIndex,
169
+ ...[handle.fieldKey, targetFieldKey].sort(),
170
+ ].join('\u0000');
171
+ if (seenPairs.has(pairKey)) {
172
+ continue;
173
+ }
174
+ seenPairs.add(pairKey);
175
+ lines.push({
176
+ key: `${handle.effectIndex}-${handle.fieldKey}-${targetFieldKey}`,
177
+ from: (0, exports.getUvHandlePosition)(points, handle.value),
178
+ to: (0, exports.getUvHandlePosition)(points, target.value),
179
+ });
180
+ }
181
+ return lines;
182
+ };
183
+ exports.getUvHandleConnectionLines = getUvHandleConnectionLines;
145
184
  const vectorBetween = (from, to) => {
146
185
  return { x: to.x - from.x, y: to.y - from.y };
147
186
  };
@@ -203,22 +242,12 @@ exports.getUvCoordinateForPoint = getUvCoordinateForPoint;
203
242
  const clamp = (value, min, max) => {
204
243
  return Math.min(max, Math.max(min, value));
205
244
  };
206
- const roundToStep = (value, step) => {
207
- if (step === undefined || !Number.isFinite(step) || step <= 0) {
208
- return value;
209
- }
210
- const decimals = (0, timeline_field_utils_1.getDecimalPlaces)(step);
211
- return Number((Math.round(value / step) * step).toFixed(decimals));
212
- };
213
- const constrainUv = (value, schema) => {
245
+ function constrainUv(value, schema) {
214
246
  var _a, _b;
215
247
  const min = (_a = schema.min) !== null && _a !== void 0 ? _a : -Infinity;
216
248
  const max = (_b = schema.max) !== null && _b !== void 0 ? _b : Infinity;
217
- return [
218
- clamp(roundToStep(value[0], schema.step), min, max),
219
- clamp(roundToStep(value[1], schema.step), min, max),
220
- ];
221
- };
249
+ return [clamp(value[0], min, max), clamp(value[1], min, max)];
250
+ }
222
251
  const rectToPoints = (elementRect, containerRect) => {
223
252
  const left = elementRect.left - containerRect.left;
224
253
  const top = elementRect.top - containerRect.top;
@@ -261,6 +290,12 @@ const getElementOutlinePoints = (element, containerRect) => {
261
290
  return quadToPoints(quad, containerRect);
262
291
  };
263
292
  const getSelectedSequenceKeys = (selectedItems) => {
293
+ return new Set(selectedItems
294
+ .filter((item) => item.type === 'sequence')
295
+ .map((item) => (0, TimelineSelection_1.getTimelineSequenceSelectionKey)(item.nodePathInfo)));
296
+ };
297
+ exports.getSelectedSequenceKeys = getSelectedSequenceKeys;
298
+ const getSequenceKeysContainingSelection = (selectedItems) => {
264
299
  return new Set(selectedItems.map((item) => (0, TimelineSelection_1.getTimelineSequenceSelectionKey)(item.nodePathInfo)));
265
300
  };
266
301
  const getOutlineSelectionInteraction = ({ shiftKey, metaKey, ctrlKey, }) => ({
@@ -282,7 +317,12 @@ const getSelectedEffectFieldsBySequenceKey = (selectedItems) => {
282
317
  allFields: false,
283
318
  fieldKeys: new Set(),
284
319
  };
285
- selectedFields.allFields = true;
320
+ if (item.type === 'sequence-effect') {
321
+ selectedFields.allFields = true;
322
+ }
323
+ else {
324
+ selectedFields.fieldKeys.add(item.key);
325
+ }
286
326
  effectsForSequence.set(item.i, selectedFields);
287
327
  selectedEffects.set(sequenceKey, effectsForSequence);
288
328
  }
@@ -316,7 +356,7 @@ const getSequencesWithSelectableOutlines = ({ sequences, overrideIdsToNodePaths,
316
356
  });
317
357
  };
318
358
  exports.getSequencesWithSelectableOutlines = getSequencesWithSelectableOutlines;
319
- const getSelectedUvHandles = ({ codeValues, clientId, getEffectDragOverrides, nodePath, selectedEffects, sequence, }) => {
359
+ const getSelectedUvHandles = ({ propStatuses, clientId, getEffectDragOverrides, nodePath, selectedEffects, sequence, }) => {
320
360
  if (clientId === null || selectedEffects === undefined) {
321
361
  return [];
322
362
  }
@@ -326,8 +366,8 @@ const getSelectedUvHandles = ({ codeValues, clientId, getEffectDragOverrides, no
326
366
  if (!effect) {
327
367
  continue;
328
368
  }
329
- const effectStatus = remotion_1.Internals.getEffectCodeValuesCtx({
330
- codeValues,
369
+ const effectStatus = remotion_1.Internals.getEffectPropStatusesCtx({
370
+ propStatuses,
331
371
  nodePath,
332
372
  effectIndex,
333
373
  });
@@ -357,7 +397,7 @@ const getSelectedUvHandles = ({ codeValues, clientId, getEffectDragOverrides, no
357
397
  }
358
398
  const dragOverrideValue = dragOverrides[fieldKey];
359
399
  const effectiveValue = remotion_1.Internals.getEffectiveVisualModeValue({
360
- codeValue: propStatus,
400
+ propStatus,
361
401
  dragOverrideValue,
362
402
  defaultValue: fieldSchema.default,
363
403
  shouldResortToDefaultValueIfUndefined: true,
@@ -368,7 +408,7 @@ const getSelectedUvHandles = ({ codeValues, clientId, getEffectDragOverrides, no
368
408
  }
369
409
  handles.push({
370
410
  clientId,
371
- codeValue: propStatus,
411
+ propStatus,
372
412
  effectIndex,
373
413
  fieldDefault: fieldSchema.default,
374
414
  fieldKey,
@@ -420,7 +460,7 @@ const getSelectedOutlineDragStates = ({ dragTargets, getDragOverrides, timelineP
420
460
  const dragOverrideValue = ((_a = getDragOverrides(target.nodePath)) !== null && _a !== void 0 ? _a : {})[translateFieldKey];
421
461
  const sourceFrame = timelinePosition - target.keyframeDisplayOffset;
422
462
  const effectiveValue = remotion_1.Internals.getEffectiveVisualModeValue({
423
- codeValue: target.codeValue,
463
+ propStatus: target.propStatus,
424
464
  dragOverrideValue,
425
465
  defaultValue: target.fieldDefault,
426
466
  frame: sourceFrame,
@@ -453,7 +493,7 @@ const getSelectedOutlineDragChanges = ({ dragStates, lastValues, }) => {
453
493
  if (value === undefined) {
454
494
  continue;
455
495
  }
456
- if (dragState.target.codeValue.status === 'keyframed') {
496
+ if (dragState.target.propStatus.status === 'keyframed') {
457
497
  const startValue = (0, timeline_translate_utils_1.serializeTranslate)(dragState.startX, dragState.startY);
458
498
  if (value === startValue) {
459
499
  continue;
@@ -471,9 +511,9 @@ const getSelectedOutlineDragChanges = ({ dragStates, lastValues, }) => {
471
511
  continue;
472
512
  }
473
513
  const stringifiedValue = JSON.stringify(value);
474
- const shouldSave = value !== dragState.target.codeValue.codeValue &&
514
+ const shouldSave = value !== dragState.target.propStatus.codeValue &&
475
515
  !(dragState.defaultValue === stringifiedValue &&
476
- dragState.target.codeValue.codeValue === undefined);
516
+ dragState.target.propStatus.codeValue === undefined);
477
517
  if (!shouldSave) {
478
518
  continue;
479
519
  }
@@ -520,7 +560,7 @@ const getSelectedOutlineScaleDragStates = ({ dragTargets, getDragOverrides, }) =
520
560
  var _a;
521
561
  const dragOverrideValue = ((_a = getDragOverrides(target.nodePath)) !== null && _a !== void 0 ? _a : {})[scaleFieldKey];
522
562
  const effectiveValue = remotion_1.Internals.getEffectiveVisualModeValue({
523
- codeValue: target.codeValue,
563
+ propStatus: target.propStatus,
524
564
  dragOverrideValue,
525
565
  defaultValue: target.fieldDefault,
526
566
  shouldResortToDefaultValueIfUndefined: true,
@@ -574,9 +614,9 @@ const getSelectedOutlineScaleDragChanges = ({ dragStates, lastValues, }) => {
574
614
  }
575
615
  const stringifiedValue = JSON.stringify(value);
576
616
  const shouldSave = stringifiedValue !==
577
- JSON.stringify(dragState.target.codeValue.codeValue) &&
617
+ JSON.stringify(dragState.target.propStatus.codeValue) &&
578
618
  !(dragState.defaultValue === stringifiedValue &&
579
- dragState.target.codeValue.codeValue === undefined);
619
+ dragState.target.propStatus.codeValue === undefined);
580
620
  if (!shouldSave) {
581
621
  return [];
582
622
  }
@@ -603,17 +643,19 @@ const clearSelectedOutlineScaleDragOverrides = ({ clearDragOverrides, dragStates
603
643
  clearDragOverrides(dragState.target.nodePath);
604
644
  }
605
645
  };
606
- const SelectedOutlinePolygon = ({ allDragTargets, hovered, outline, onHoverChange, onSelect, scale, target, }) => {
607
- var _a, _b;
646
+ const SelectedOutlinePolygon = ({ allDragTargets, contextMenuValues, dragging, hovered, onContextMenuOpen, outline, onDraggingChange, onHoverChange, onSelect, scale, target, }) => {
647
+ var _a, _b, _c;
608
648
  const { getDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeDragOverridesContext);
609
- const { setCodeValues, setDragOverrides, clearDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
649
+ const { setPropStatuses, setDragOverrides, clearDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
610
650
  const timelinePosition = remotion_1.Internals.Timeline.useTimelinePosition();
611
651
  const timelinePositionRef = (0, react_1.useRef)(timelinePosition);
612
652
  timelinePositionRef.current = timelinePosition;
653
+ const polygonRef = (0, react_1.useRef)(null);
613
654
  const points = (0, react_1.useMemo)(() => outline.points.map(pointToString).join(' '), [outline.points]);
614
655
  const drag = (_a = target === null || target === void 0 ? void 0 : target.drag) !== null && _a !== void 0 ? _a : null;
615
656
  const selected = (_b = target === null || target === void 0 ? void 0 : target.selected) !== null && _b !== void 0 ? _b : false;
616
- const visible = selected || hovered;
657
+ const containsSelection = (_c = target === null || target === void 0 ? void 0 : target.containsSelection) !== null && _c !== void 0 ? _c : false;
658
+ const visible = containsSelection || hovered;
617
659
  const onPointerDown = react_1.default.useCallback((event) => {
618
660
  if (event.button !== 0 || target === undefined) {
619
661
  return;
@@ -628,6 +670,7 @@ const SelectedOutlinePolygon = ({ allDragTargets, hovered, outline, onHoverChang
628
670
  if (drag === null || interaction.shiftKey || interaction.toggleKey) {
629
671
  return;
630
672
  }
673
+ onDraggingChange(true);
631
674
  const startPointerX = event.clientX;
632
675
  const startPointerY = event.clientY;
633
676
  const dragStates = getSelectedOutlineDragStates({
@@ -648,9 +691,9 @@ const SelectedOutlinePolygon = ({ allDragTargets, hovered, outline, onHoverChang
648
691
  if (value === undefined) {
649
692
  throw new Error('Expected drag value to be available');
650
693
  }
651
- if (dragState.target.codeValue.status === 'keyframed') {
694
+ if (dragState.target.propStatus.status === 'keyframed') {
652
695
  setDragOverrides(dragState.target.nodePath, translateFieldKey, remotion_1.Internals.makeKeyframedDragOverride({
653
- status: dragState.target.codeValue,
696
+ status: dragState.target.propStatus,
654
697
  frame: dragState.sourceFrame,
655
698
  value,
656
699
  }));
@@ -664,6 +707,7 @@ const SelectedOutlinePolygon = ({ allDragTargets, hovered, outline, onHoverChang
664
707
  window.removeEventListener('pointermove', onPointerMove);
665
708
  window.removeEventListener('pointerup', onPointerUp);
666
709
  window.removeEventListener('pointercancel', onPointerUp);
710
+ onDraggingChange(false);
667
711
  const changes = (0, exports.getSelectedOutlineDragChanges)({
668
712
  dragStates,
669
713
  lastValues,
@@ -678,10 +722,14 @@ const SelectedOutlinePolygon = ({ allDragTargets, hovered, outline, onHoverChang
678
722
  staticChanges.length > 0
679
723
  ? (0, save_sequence_prop_1.saveSequenceProps)({
680
724
  changes: staticChanges,
681
- setCodeValues,
725
+ setPropStatuses,
682
726
  clientId: drag.clientId,
683
- undoLabel: changes.length > 1 ? 'Move selected sequences' : null,
684
- redoLabel: changes.length > 1 ? 'Move selected sequences back' : null,
727
+ undoLabel: changes.length > 1
728
+ ? 'Move selected sequences'
729
+ : 'Move sequence',
730
+ redoLabel: changes.length > 1
731
+ ? 'Move selected sequences back'
732
+ : 'Move sequence back',
685
733
  })
686
734
  : Promise.resolve(),
687
735
  ...keyframedChanges.map((change) => (0, call_add_keyframe_1.callAddSequenceKeyframe)({
@@ -691,7 +739,7 @@ const SelectedOutlinePolygon = ({ allDragTargets, hovered, outline, onHoverChang
691
739
  sourceFrame: change.sourceFrame,
692
740
  value: change.value,
693
741
  schema: change.schema,
694
- setCodeValues,
742
+ setPropStatuses,
695
743
  clientId: change.clientId,
696
744
  })),
697
745
  ])
@@ -710,21 +758,33 @@ const SelectedOutlinePolygon = ({ allDragTargets, hovered, outline, onHoverChang
710
758
  clearDragOverrides,
711
759
  drag,
712
760
  getDragOverrides,
761
+ onDraggingChange,
713
762
  onSelect,
714
763
  scale,
715
764
  selected,
716
- setCodeValues,
765
+ setPropStatuses,
717
766
  setDragOverrides,
718
767
  target,
719
768
  ]);
720
- return (jsx_runtime_1.jsx("polygon", { points: points, fill: "transparent", stroke: colors_1.BLUE, strokeOpacity: visible ? 1 : 0, strokeWidth: 2, vectorEffect: "non-scaling-stroke", pointerEvents: target === undefined ? undefined : 'all', onPointerEnter: () => onHoverChange(outline.key), onPointerLeave: () => onHoverChange(null), onPointerDown: onPointerDown }));
769
+ return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
770
+ jsx_runtime_1.jsx("polygon", { ref: polygonRef, points: points, fill: "transparent", stroke: colors_1.BLUE, strokeOpacity: visible ? 1 : 0, strokeWidth: 2, vectorEffect: "non-scaling-stroke", pointerEvents: target === undefined ? undefined : 'all', onPointerEnter: () => {
771
+ if (!dragging) {
772
+ onHoverChange(outline.key);
773
+ }
774
+ }, onPointerLeave: () => {
775
+ if (!dragging) {
776
+ onHoverChange(null);
777
+ }
778
+ }, onPointerDown: onPointerDown }), jsx_runtime_1.jsx(ContextMenu_1.ContextMenuForTarget, { triggerRef: polygonRef, values: [...contextMenuValues], onOpen: onContextMenuOpen })
779
+ ] }));
721
780
  };
722
- const SelectedOutlineScaleEdgeLine = ({ allScaleDragTargets, edge, outline, onHoverChange, onSelect, target, }) => {
781
+ const SelectedOutlineScaleEdgeLine = ({ allScaleDragTargets, contextMenuValues, dragging, edge, outline, onDraggingChange, onContextMenuOpen, onHoverChange, onSelect, target, }) => {
723
782
  var _a, _b;
724
783
  const { getDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeDragOverridesContext);
725
- const { setCodeValues, setDragOverrides, clearDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
784
+ const { setPropStatuses, setDragOverrides, clearDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
726
785
  const scaleDrag = (_a = target === null || target === void 0 ? void 0 : target.scaleDrag) !== null && _a !== void 0 ? _a : null;
727
786
  const selected = (_b = target === null || target === void 0 ? void 0 : target.selected) !== null && _b !== void 0 ? _b : false;
787
+ const lineRef = (0, react_1.useRef)(null);
728
788
  const edgeInfo = (0, react_1.useMemo)(() => (0, exports.getSelectedOutlineScaleEdgeInfo)(outline.points, edge), [edge, outline.points]);
729
789
  const onPointerDown = react_1.default.useCallback((event) => {
730
790
  if (event.button !== 0 || scaleDrag === null || edgeInfo === null) {
@@ -740,6 +800,7 @@ const SelectedOutlineScaleEdgeLine = ({ allScaleDragTargets, edge, outline, onHo
740
800
  if (interaction.shiftKey || interaction.toggleKey) {
741
801
  return;
742
802
  }
803
+ onDraggingChange(true);
743
804
  const startPointer = { x: event.clientX, y: event.clientY };
744
805
  const dragStates = (0, exports.getSelectedOutlineScaleDragStates)({
745
806
  dragTargets: selected ? allScaleDragTargets : [scaleDrag],
@@ -771,6 +832,7 @@ const SelectedOutlineScaleEdgeLine = ({ allScaleDragTargets, edge, outline, onHo
771
832
  window.removeEventListener('pointermove', onPointerMove);
772
833
  window.removeEventListener('pointerup', onPointerUp);
773
834
  window.removeEventListener('pointercancel', onPointerUp);
835
+ onDraggingChange(false);
774
836
  const changes = (0, exports.getSelectedOutlineScaleDragChanges)({
775
837
  dragStates,
776
838
  lastValues,
@@ -784,10 +846,12 @@ const SelectedOutlineScaleEdgeLine = ({ allScaleDragTargets, edge, outline, onHo
784
846
  }
785
847
  (0, save_sequence_prop_1.saveSequenceProps)({
786
848
  changes,
787
- setCodeValues,
849
+ setPropStatuses,
788
850
  clientId: scaleDrag.clientId,
789
- undoLabel: changes.length > 1 ? 'Scale selected sequences' : null,
790
- redoLabel: changes.length > 1 ? 'Scale selected sequences back' : null,
851
+ undoLabel: changes.length > 1 ? 'Scale selected sequences' : 'Scale sequence',
852
+ redoLabel: changes.length > 1
853
+ ? 'Scale selected sequences back'
854
+ : 'Scale sequence back',
791
855
  })
792
856
  .catch((err) => {
793
857
  (0, NotificationCenter_1.showNotification)(`Could not save sequence props: ${err instanceof Error ? err.message : String(err)}`, 4000);
@@ -807,17 +871,28 @@ const SelectedOutlineScaleEdgeLine = ({ allScaleDragTargets, edge, outline, onHo
807
871
  clearDragOverrides,
808
872
  edgeInfo,
809
873
  getDragOverrides,
874
+ onDraggingChange,
810
875
  onSelect,
811
876
  scaleDrag,
812
877
  selected,
813
- setCodeValues,
878
+ setPropStatuses,
814
879
  setDragOverrides,
815
880
  target,
816
881
  ]);
817
882
  if (scaleDrag === null || edgeInfo === null) {
818
883
  return null;
819
884
  }
820
- return (jsx_runtime_1.jsx("line", { x1: edgeInfo.start.x, y1: edgeInfo.start.y, x2: edgeInfo.end.x, y2: edgeInfo.end.y, stroke: "transparent", strokeWidth: 12, vectorEffect: "non-scaling-stroke", pointerEvents: "stroke", cursor: edgeInfo.cursor, onPointerEnter: () => onHoverChange(outline.key), onPointerLeave: () => onHoverChange(null), onPointerDown: onPointerDown }));
885
+ return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
886
+ jsx_runtime_1.jsx("line", { ref: lineRef, x1: edgeInfo.start.x, y1: edgeInfo.start.y, x2: edgeInfo.end.x, y2: edgeInfo.end.y, stroke: "transparent", strokeWidth: 12, vectorEffect: "non-scaling-stroke", pointerEvents: "stroke", cursor: edgeInfo.cursor, onPointerEnter: () => {
887
+ if (!dragging) {
888
+ onHoverChange(outline.key);
889
+ }
890
+ }, onPointerLeave: () => {
891
+ if (!dragging) {
892
+ onHoverChange(null);
893
+ }
894
+ }, onPointerDown: onPointerDown }), jsx_runtime_1.jsx(ContextMenu_1.ContextMenuForTarget, { triggerRef: lineRef, values: [...contextMenuValues], onOpen: onContextMenuOpen })
895
+ ] }));
821
896
  };
822
897
  const getSvgPointFromPointerEvent = ({ event, rect, }) => {
823
898
  return {
@@ -825,8 +900,12 @@ const getSvgPointFromPointerEvent = ({ event, rect, }) => {
825
900
  y: event.clientY - rect.top,
826
901
  };
827
902
  };
828
- const SelectedUvHandleCircle = ({ handle, outline }) => {
829
- const { setEffectDragOverrides, clearEffectDragOverrides, setCodeValues } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
903
+ const SelectedUvHandleConnectionLines = ({ handles, outline }) => {
904
+ const lines = (0, react_1.useMemo)(() => (0, exports.getUvHandleConnectionLines)({ handles, points: outline.points }), [handles, outline.points]);
905
+ return (jsx_runtime_1.jsx(jsx_runtime_1.Fragment, { children: lines.map((line) => (jsx_runtime_1.jsx("line", { x1: line.from.x, y1: line.from.y, x2: line.to.x, y2: line.to.y, stroke: colors_1.BLUE, strokeWidth: 2, vectorEffect: "non-scaling-stroke", pointerEvents: "none" }, line.key))) }));
906
+ };
907
+ const SelectedUvHandleCircle = ({ handle, onDraggingChange, outline }) => {
908
+ const { setEffectDragOverrides, clearEffectDragOverrides, setPropStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
830
909
  const position = (0, react_1.useMemo)(() => (0, exports.getUvHandlePosition)(outline.points, handle.value), [handle.value, outline.points]);
831
910
  const onPointerDown = react_1.default.useCallback((event) => {
832
911
  if (event.button !== 0) {
@@ -840,6 +919,7 @@ const SelectedUvHandleCircle = ({ handle, outline }) => {
840
919
  }
841
920
  const svgRect = svg.getBoundingClientRect();
842
921
  let lastValue = null;
922
+ onDraggingChange(true);
843
923
  const defaultValue = handle.fieldDefault !== undefined
844
924
  ? JSON.stringify(handle.fieldDefault)
845
925
  : null;
@@ -861,16 +941,18 @@ const SelectedUvHandleCircle = ({ handle, outline }) => {
861
941
  window.removeEventListener('pointermove', onPointerMove);
862
942
  window.removeEventListener('pointerup', onPointerUp);
863
943
  window.removeEventListener('pointercancel', onPointerUp);
944
+ onDraggingChange(false);
864
945
  const stringifiedValue = lastValue === null ? null : JSON.stringify(lastValue);
865
946
  const shouldSave = lastValue !== null &&
866
- !tuplesEqual(handle.codeValue.codeValue, lastValue) &&
947
+ !tuplesEqual(handle.propStatus.codeValue, lastValue) &&
867
948
  !(defaultValue === stringifiedValue &&
868
- handle.codeValue.codeValue === undefined);
949
+ handle.propStatus.codeValue === undefined);
869
950
  if (!shouldSave) {
870
951
  clearEffectDragOverrides(handle.nodePath, handle.effectIndex);
871
952
  return;
872
953
  }
873
954
  (0, save_effect_prop_1.saveEffectProp)({
955
+ type: 'value',
874
956
  fileName: handle.nodePath.absolutePath,
875
957
  nodePath: handle.nodePath,
876
958
  effectIndex: handle.effectIndex,
@@ -878,7 +960,7 @@ const SelectedUvHandleCircle = ({ handle, outline }) => {
878
960
  value: lastValue,
879
961
  defaultValue,
880
962
  schema: handle.schema,
881
- setCodeValues,
963
+ setPropStatuses,
882
964
  clientId: handle.clientId,
883
965
  }).finally(() => {
884
966
  clearEffectDragOverrides(handle.nodePath, handle.effectIndex);
@@ -890,28 +972,131 @@ const SelectedUvHandleCircle = ({ handle, outline }) => {
890
972
  }, [
891
973
  clearEffectDragOverrides,
892
974
  handle,
975
+ onDraggingChange,
893
976
  outline.points,
894
- setCodeValues,
977
+ setPropStatuses,
895
978
  setEffectDragOverrides,
896
979
  ]);
897
- return (jsx_runtime_1.jsx("circle", { cx: position.x, cy: position.y, r: 6, fill: "white", stroke: colors_1.BLUE, strokeWidth: 2, vectorEffect: "non-scaling-stroke", pointerEvents: "all", cursor: "move", onPointerDown: onPointerDown }));
980
+ return (jsx_runtime_1.jsx("circle", { cx: position.x, cy: position.y, r: 6, fill: "white", stroke: colors_1.BLUE, strokeWidth: 2, vectorEffect: "non-scaling-stroke", pointerEvents: "all", cursor: "default", onPointerDown: onPointerDown }));
981
+ };
982
+ const SelectedOutlineElement = ({ allDragTargets, allScaleDragTargets, dragging, hovered, outline, onDraggingChange, onHoverChange, onSelect, scale, target, }) => {
983
+ const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
984
+ const updateResolvedStackTrace = (0, react_1.useContext)(remotion_1.Internals.SequenceStackTracesUpdateContext);
985
+ const onContextMenuOpen = react_1.default.useCallback(async () => {
986
+ if (target === undefined || previewServerState.type !== 'connected') {
987
+ return false;
988
+ }
989
+ if (!target.selected) {
990
+ onSelect(target.selection, { shiftKey: false, toggleKey: false });
991
+ }
992
+ const stack = target.sequence.getStack();
993
+ let originalLocation = null;
994
+ if (stack) {
995
+ try {
996
+ originalLocation = await (0, get_stack_1.getOriginalLocationFromStack)(stack, 'sequence');
997
+ }
998
+ catch (err) {
999
+ (0, NotificationCenter_1.showNotification)(err.message, 2000);
1000
+ }
1001
+ }
1002
+ if (stack) {
1003
+ updateResolvedStackTrace(stack, originalLocation);
1004
+ }
1005
+ const fileLocation = (0, format_file_location_1.formatFileLocation)({
1006
+ location: originalLocation,
1007
+ root: window.remotion_cwd,
1008
+ });
1009
+ const editorName = window.remotion_editorName;
1010
+ return [
1011
+ editorName
1012
+ ? {
1013
+ type: 'item',
1014
+ id: 'show-outline-in-editor',
1015
+ keyHint: null,
1016
+ label: `Show in ${editorName}`,
1017
+ leftItem: null,
1018
+ disabled: !originalLocation,
1019
+ onClick: () => {
1020
+ if (!originalLocation) {
1021
+ return;
1022
+ }
1023
+ (0, open_in_editor_1.openOriginalPositionInEditor)(originalLocation).catch((err) => {
1024
+ (0, NotificationCenter_1.showNotification)(err.message, 2000);
1025
+ });
1026
+ },
1027
+ quickSwitcherLabel: null,
1028
+ subMenu: null,
1029
+ value: 'show-outline-in-editor',
1030
+ }
1031
+ : null,
1032
+ {
1033
+ type: 'item',
1034
+ id: 'copy-outline-file-location',
1035
+ keyHint: null,
1036
+ label: 'Copy file location',
1037
+ leftItem: null,
1038
+ disabled: !fileLocation,
1039
+ onClick: () => {
1040
+ if (!fileLocation) {
1041
+ return;
1042
+ }
1043
+ navigator.clipboard
1044
+ .writeText(fileLocation)
1045
+ .then(() => {
1046
+ (0, NotificationCenter_1.showNotification)('Copied file location to clipboard', 1000);
1047
+ })
1048
+ .catch((err) => {
1049
+ (0, NotificationCenter_1.showNotification)(`Could not copy to clipboard: ${err.message}`, 1000);
1050
+ });
1051
+ },
1052
+ quickSwitcherLabel: null,
1053
+ subMenu: null,
1054
+ value: 'copy-outline-file-location',
1055
+ },
1056
+ ].filter(no_react_1.NoReactInternals.truthy);
1057
+ }, [onSelect, previewServerState.type, target, updateResolvedStackTrace]);
1058
+ return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
1059
+ jsx_runtime_1.jsx(SelectedOutlinePolygon, { allDragTargets: allDragTargets, contextMenuValues: emptyContextMenuValues, dragging: dragging, hovered: hovered, outline: outline, onContextMenuOpen: onContextMenuOpen, onDraggingChange: onDraggingChange, onHoverChange: onHoverChange, onSelect: onSelect, scale: scale, target: target }), (target === null || target === void 0 ? void 0 : target.containsSelection) || hovered
1060
+ ? ['top', 'right', 'bottom', 'left'].map((edge) => (jsx_runtime_1.jsx(SelectedOutlineScaleEdgeLine, { allScaleDragTargets: allScaleDragTargets, contextMenuValues: emptyContextMenuValues, dragging: dragging, edge: edge, outline: outline, onContextMenuOpen: onContextMenuOpen, onDraggingChange: onDraggingChange, onHoverChange: onHoverChange, onSelect: onSelect, target: target }, edge)))
1061
+ : null] }));
1062
+ };
1063
+ const SelectedOutlineUvHandleConnectionLayer = ({ outline, target }) => {
1064
+ if (!(target === null || target === void 0 ? void 0 : target.containsSelection) || target.uvHandles.length === 0) {
1065
+ return null;
1066
+ }
1067
+ return (jsx_runtime_1.jsx(SelectedUvHandleConnectionLines, { handles: target.uvHandles, outline: outline }));
1068
+ };
1069
+ const SelectedOutlineUvHandleCircleLayer = ({ onDraggingChange, outline, target }) => {
1070
+ if (!(target === null || target === void 0 ? void 0 : target.containsSelection) || target.uvHandles.length === 0) {
1071
+ return null;
1072
+ }
1073
+ return (jsx_runtime_1.jsx(jsx_runtime_1.Fragment, { children: target.uvHandles.map((handle) => (jsx_runtime_1.jsx(SelectedUvHandleCircle, { handle: handle, onDraggingChange: onDraggingChange, outline: outline }, `${handle.effectIndex}-${handle.fieldKey}`))) }));
898
1074
  };
899
1075
  const SelectedOutlineOverlay = ({ scale }) => {
900
1076
  const { selectedItems, selectItem } = (0, TimelineSelection_1.useTimelineSelection)();
901
1077
  const { sequences } = (0, react_1.useContext)(remotion_1.Internals.SequenceManager);
902
- const { codeValues } = (0, react_1.useContext)(remotion_1.Internals.VisualModeCodeValuesContext);
1078
+ const { propStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesContext);
903
1079
  const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
904
1080
  const { overrideIdToNodePathMappings } = (0, react_1.useContext)(remotion_1.Internals.OverrideIdsToNodePathsGettersContext);
905
1081
  const { getDragOverrides, getEffectDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeDragOverridesContext);
906
1082
  const { getScaleLockState } = (0, react_1.useContext)(scale_lock_1.ScaleLockContext);
1083
+ const { editorShowOutlines } = (0, react_1.useContext)(editor_outlines_1.EditorShowOutlinesContext);
907
1084
  const [outlines, setOutlines] = (0, react_1.useState)([]);
908
1085
  const [hoveredOutlineKey, setHoveredOutlineKey] = (0, react_1.useState)(null);
1086
+ const [draggingOutline, setDraggingOutline] = (0, react_1.useState)(false);
909
1087
  const overlayRef = (0, react_1.useRef)(null);
1088
+ const onDraggingChange = react_1.default.useCallback((dragging) => {
1089
+ setDraggingOutline(dragging);
1090
+ if (dragging) {
1091
+ setHoveredOutlineKey(null);
1092
+ }
1093
+ }, []);
910
1094
  const outlineTargets = (0, react_1.useMemo)(() => {
911
- if (!TimelineSelection_1.ENABLE_OUTLINES) {
1095
+ if (!TimelineSelection_1.ENABLE_OUTLINES || !editorShowOutlines) {
912
1096
  return [];
913
1097
  }
914
- const selectedSequenceKeys = getSelectedSequenceKeys(selectedItems);
1098
+ const selectedSequenceKeys = (0, exports.getSelectedSequenceKeys)(selectedItems);
1099
+ const sequenceKeysContainingSelection = getSequenceKeysContainingSelection(selectedItems);
915
1100
  const selectedEffectsBySequenceKey = (0, exports.getSelectedEffectFieldsBySequenceKey)(selectedItems);
916
1101
  const clientId = previewServerState.type === 'connected'
917
1102
  ? previewServerState.clientId
@@ -925,15 +1110,16 @@ const SelectedOutlineOverlay = ({ scale }) => {
925
1110
  throw new Error('Expected sequence to have a ref for outline');
926
1111
  }
927
1112
  const selected = selectedSequenceKeys.has(key);
1113
+ const containsSelection = sequenceKeysContainingSelection.has(key);
928
1114
  const nodePath = nodePathInfo.sequenceSubscriptionKey;
929
1115
  const { controls } = sequence;
930
1116
  const fieldSchema = controls === null || controls === void 0 ? void 0 : controls.schema[translateFieldKey];
931
- const codeValue = (_a = remotion_1.Internals.getCodeValuesCtx(codeValues, nodePath)) === null || _a === void 0 ? void 0 : _a[translateFieldKey];
1117
+ const propStatus = (_a = remotion_1.Internals.getPropStatusesCtx(propStatuses, nodePath)) === null || _a === void 0 ? void 0 : _a[translateFieldKey];
932
1118
  const scaleFieldSchema = controls === null || controls === void 0 ? void 0 : controls.schema[scaleFieldKey];
933
- const scaleCodeValue = (_b = remotion_1.Internals.getCodeValuesCtx(codeValues, nodePath)) === null || _b === void 0 ? void 0 : _b[scaleFieldKey];
934
- const canDragStatus = (codeValue === null || codeValue === void 0 ? void 0 : codeValue.status) === 'static' ||
935
- ((codeValue === null || codeValue === void 0 ? void 0 : codeValue.status) === 'keyframed' &&
936
- codeValue.interpolationFunction === 'interpolate');
1119
+ const scalePropStatus = (_b = remotion_1.Internals.getPropStatusesCtx(propStatuses, nodePath)) === null || _b === void 0 ? void 0 : _b[scaleFieldKey];
1120
+ const canDragStatus = (propStatus === null || propStatus === void 0 ? void 0 : propStatus.status) === 'static' ||
1121
+ ((propStatus === null || propStatus === void 0 ? void 0 : propStatus.status) === 'keyframed' &&
1122
+ propStatus.interpolationFunction === 'interpolate');
937
1123
  const canDrag = previewServerState.type === 'connected' &&
938
1124
  controls !== null &&
939
1125
  (fieldSchema === null || fieldSchema === void 0 ? void 0 : fieldSchema.type) === 'translate' &&
@@ -941,16 +1127,18 @@ const SelectedOutlineOverlay = ({ scale }) => {
941
1127
  const canScaleDrag = previewServerState.type === 'connected' &&
942
1128
  controls !== null &&
943
1129
  (scaleFieldSchema === null || scaleFieldSchema === void 0 ? void 0 : scaleFieldSchema.type) === 'scale' &&
944
- (scaleCodeValue === null || scaleCodeValue === void 0 ? void 0 : scaleCodeValue.status) === 'static';
1130
+ (scalePropStatus === null || scalePropStatus === void 0 ? void 0 : scalePropStatus.status) === 'static';
945
1131
  return {
946
1132
  key,
1133
+ containsSelection,
947
1134
  nodePathInfo,
948
1135
  ref: sequence.refForOutline,
949
1136
  selected,
950
1137
  selection: { type: 'sequence', nodePathInfo },
1138
+ sequence,
951
1139
  drag: canDrag
952
1140
  ? {
953
- codeValue,
1141
+ propStatus,
954
1142
  clientId: previewServerState.clientId,
955
1143
  fieldDefault: fieldSchema.default,
956
1144
  keyframeDisplayOffset,
@@ -960,7 +1148,7 @@ const SelectedOutlineOverlay = ({ scale }) => {
960
1148
  : null,
961
1149
  scaleDrag: canScaleDrag
962
1150
  ? {
963
- codeValue: scaleCodeValue,
1151
+ propStatus: scalePropStatus,
964
1152
  clientId: previewServerState.clientId,
965
1153
  fieldDefault: scaleFieldSchema.default,
966
1154
  fieldSchema: scaleFieldSchema,
@@ -971,7 +1159,7 @@ const SelectedOutlineOverlay = ({ scale }) => {
971
1159
  var _a;
972
1160
  const dragOverrideValue = ((_a = getDragOverrides(nodePath)) !== null && _a !== void 0 ? _a : {})[scaleFieldKey];
973
1161
  const effectiveValue = remotion_1.Internals.getEffectiveVisualModeValue({
974
- codeValue: scaleCodeValue,
1162
+ propStatus: scalePropStatus,
975
1163
  dragOverrideValue,
976
1164
  defaultValue: scaleFieldSchema.default,
977
1165
  shouldResortToDefaultValueIfUndefined: true,
@@ -984,9 +1172,9 @@ const SelectedOutlineOverlay = ({ scale }) => {
984
1172
  schema: controls.schema,
985
1173
  }
986
1174
  : null,
987
- uvHandles: selected
1175
+ uvHandles: containsSelection
988
1176
  ? getSelectedUvHandles({
989
- codeValues,
1177
+ propStatuses,
990
1178
  clientId,
991
1179
  getEffectDragOverrides,
992
1180
  nodePath,
@@ -997,10 +1185,11 @@ const SelectedOutlineOverlay = ({ scale }) => {
997
1185
  };
998
1186
  });
999
1187
  }, [
1000
- codeValues,
1188
+ propStatuses,
1001
1189
  getDragOverrides,
1002
1190
  getEffectDragOverrides,
1003
1191
  getScaleLockState,
1192
+ editorShowOutlines,
1004
1193
  overrideIdToNodePathMappings,
1005
1194
  previewServerState,
1006
1195
  selectedItems,
@@ -1046,16 +1235,6 @@ const SelectedOutlineOverlay = ({ scale }) => {
1046
1235
  if (outlineTargets.length === 0) {
1047
1236
  return null;
1048
1237
  }
1049
- return (jsx_runtime_1.jsx("svg", { ref: overlayRef, style: outlineContainer, width: "100%", height: "100%", "aria-hidden": "true", children: outlines.map((outline) => {
1050
- var _a, _b, _c;
1051
- return (jsx_runtime_1.jsxs(react_1.default.Fragment, { children: [
1052
- jsx_runtime_1.jsx(SelectedOutlinePolygon, { allDragTargets: allDragTargets, hovered: hoveredOutlineKey === outline.key, outline: outline, onHoverChange: setHoveredOutlineKey, onSelect: selectItem, scale: scale, target: targetsByKey.get(outline.key) }), ((_a = targetsByKey.get(outline.key)) === null || _a === void 0 ? void 0 : _a.selected) ||
1053
- hoveredOutlineKey === outline.key
1054
- ? ['top', 'right', 'bottom', 'left'].map((edge) => (jsx_runtime_1.jsx(SelectedOutlineScaleEdgeLine, { allScaleDragTargets: allScaleDragTargets, edge: edge, outline: outline, onHoverChange: setHoveredOutlineKey, onSelect: selectItem, target: targetsByKey.get(outline.key) }, edge)))
1055
- : null, ((_b = targetsByKey.get(outline.key)) === null || _b === void 0 ? void 0 : _b.selected)
1056
- ? (_c = targetsByKey
1057
- .get(outline.key)) === null || _c === void 0 ? void 0 : _c.uvHandles.map((handle) => (jsx_runtime_1.jsx(SelectedUvHandleCircle, { handle: handle, outline: outline }, `${handle.effectIndex}-${handle.fieldKey}`)))
1058
- : null] }, outline.key));
1059
- }) }));
1238
+ return (jsx_runtime_1.jsxs("svg", { ref: overlayRef, style: outlineContainer, width: "100%", height: "100%", "aria-hidden": "true", children: [outlines.map((outline) => (jsx_runtime_1.jsx(SelectedOutlineElement, { allDragTargets: allDragTargets, allScaleDragTargets: allScaleDragTargets, dragging: draggingOutline, hovered: hoveredOutlineKey === outline.key, outline: outline, onDraggingChange: onDraggingChange, onHoverChange: setHoveredOutlineKey, onSelect: selectItem, scale: scale, target: targetsByKey.get(outline.key) }, outline.key))), outlines.map((outline) => (jsx_runtime_1.jsx(SelectedOutlineUvHandleConnectionLayer, { outline: outline, target: targetsByKey.get(outline.key) }, `${outline.key}-uv-connection-lines`))), outlines.map((outline) => (jsx_runtime_1.jsx(SelectedOutlineUvHandleCircleLayer, { onDraggingChange: onDraggingChange, outline: outline, target: targetsByKey.get(outline.key) }, `${outline.key}-uv-handles`)))] }));
1060
1239
  };
1061
1240
  exports.SelectedOutlineOverlay = SelectedOutlineOverlay;