@remotion/studio 4.0.478 → 4.0.481

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 (201) hide show
  1. package/dist/components/AssetSelector.js +8 -14
  2. package/dist/components/AudioWaveform.js +19 -11
  3. package/dist/components/Button.d.ts +2 -0
  4. package/dist/components/Button.js +9 -6
  5. package/dist/components/CompactExplanation.d.ts +12 -0
  6. package/dist/components/CompactExplanation.js +52 -0
  7. package/dist/components/CompositionSelector.js +2 -4
  8. package/dist/components/CurrentAsset.d.ts +3 -1
  9. package/dist/components/CurrentAsset.js +42 -34
  10. package/dist/components/CurrentComposition.d.ts +1 -1
  11. package/dist/components/CurrentComposition.js +38 -31
  12. package/dist/components/CurrentCompositionSideEffects.d.ts +0 -3
  13. package/dist/components/CurrentCompositionSideEffects.js +1 -37
  14. package/dist/components/DefaultPropsEditor.d.ts +12 -2
  15. package/dist/components/DefaultPropsEditor.js +2 -2
  16. package/dist/components/Editor.js +2 -5
  17. package/dist/components/EditorContent.js +2 -1
  18. package/dist/components/EffectPickerModal.d.ts +5 -0
  19. package/dist/components/EffectPickerModal.js +179 -0
  20. package/dist/components/ExpandedTracksProvider.d.ts +1 -0
  21. package/dist/components/ExpandedTracksProvider.js +81 -7
  22. package/dist/components/GlobalKeybindings.d.ts +3 -1
  23. package/dist/components/GlobalKeybindings.js +104 -10
  24. package/dist/components/InspectorInfoHeader.d.ts +11 -0
  25. package/dist/components/InspectorInfoHeader.js +55 -0
  26. package/dist/components/InspectorPanel/DefaultInspector.d.ts +8 -0
  27. package/dist/components/InspectorPanel/DefaultInspector.js +93 -0
  28. package/dist/components/InspectorPanel/EasingInspector.d.ts +5 -0
  29. package/dist/components/InspectorPanel/EasingInspector.js +41 -0
  30. package/dist/components/InspectorPanel/GuideInspector.d.ts +7 -0
  31. package/dist/components/InspectorPanel/GuideInspector.js +55 -0
  32. package/dist/components/InspectorPanel/KeyframeInspector.d.ts +7 -0
  33. package/dist/components/InspectorPanel/KeyframeInspector.js +109 -0
  34. package/dist/components/InspectorPanel/SelectedInspector.d.ts +5 -0
  35. package/dist/components/InspectorPanel/SelectedInspector.js +26 -0
  36. package/dist/components/InspectorPanel/SequenceSelectionInspector.d.ts +5 -0
  37. package/dist/components/InspectorPanel/SequenceSelectionInspector.js +117 -0
  38. package/dist/components/InspectorPanel/common.d.ts +15 -0
  39. package/dist/components/InspectorPanel/common.js +18 -0
  40. package/dist/components/InspectorPanel/inspector-selection.d.ts +10 -0
  41. package/dist/components/InspectorPanel/inspector-selection.js +35 -0
  42. package/dist/components/InspectorPanel/styles.d.ts +28 -0
  43. package/dist/components/InspectorPanel/styles.js +196 -0
  44. package/dist/components/InspectorPanel/use-track-for-selection.d.ts +2 -0
  45. package/dist/components/InspectorPanel/use-track-for-selection.js +22 -0
  46. package/dist/components/InspectorPanel.d.ts +8 -0
  47. package/dist/components/InspectorPanel.js +26 -0
  48. package/dist/components/InspectorPanelLayout.d.ts +1 -0
  49. package/dist/components/InspectorPanelLayout.js +4 -0
  50. package/dist/components/InspectorSequenceSection.d.ts +19 -0
  51. package/dist/components/InspectorSequenceSection.js +157 -0
  52. package/dist/components/InspectorSourceLocation.d.ts +7 -0
  53. package/dist/components/InspectorSourceLocation.js +71 -0
  54. package/dist/components/KeyboardShortcutsExplainer.js +10 -2
  55. package/dist/components/Modals.js +3 -3
  56. package/dist/components/NewComposition/InputDragger.js +1 -1
  57. package/dist/components/NewComposition/RemInput.d.ts +1 -0
  58. package/dist/components/NewComposition/RemInput.js +8 -2
  59. package/dist/components/NewComposition/RemTextarea.d.ts +1 -0
  60. package/dist/components/NewComposition/RemTextarea.js +8 -2
  61. package/dist/components/NewComposition/ValidationMessage.d.ts +3 -0
  62. package/dist/components/NewComposition/ValidationMessage.js +16 -5
  63. package/dist/components/OptionsPanel.d.ts +1 -1
  64. package/dist/components/OptionsPanel.js +8 -17
  65. package/dist/components/QuickSwitcher/QuickSwitcherContent.js +2 -7
  66. package/dist/components/QuickSwitcher/QuickSwitcherResult.js +3 -10
  67. package/dist/components/QuickSwitcher/shared.d.ts +4 -0
  68. package/dist/components/QuickSwitcher/shared.js +24 -0
  69. package/dist/components/RenderModal/DataEditor.d.ts +29 -2
  70. package/dist/components/RenderModal/DataEditor.js +107 -56
  71. package/dist/components/RenderModal/RenderModalJSONPropsEditor.d.ts +1 -0
  72. package/dist/components/RenderModal/RenderModalJSONPropsEditor.js +25 -7
  73. package/dist/components/RenderModal/SchemaEditor/Fieldset.d.ts +2 -1
  74. package/dist/components/RenderModal/SchemaEditor/Fieldset.js +10 -5
  75. package/dist/components/RenderModal/SchemaEditor/SchemaEditor.d.ts +4 -0
  76. package/dist/components/RenderModal/SchemaEditor/SchemaEditor.js +27 -4
  77. package/dist/components/RenderModal/SchemaEditor/SchemaErrorMessages.d.ts +12 -4
  78. package/dist/components/RenderModal/SchemaEditor/SchemaErrorMessages.js +23 -9
  79. package/dist/components/RenderModal/SchemaEditor/SchemaLabel.js +3 -3
  80. package/dist/components/RenderModal/SchemaEditor/SchemaSeparationLine.js +8 -1
  81. package/dist/components/RenderModal/SchemaEditor/ZodColorEditor.js +1 -1
  82. package/dist/components/RenderModal/SchemaEditor/ZodDateEditor.js +1 -1
  83. package/dist/components/RenderModal/SchemaEditor/ZodDiscriminatedUnionEditor.js +1 -1
  84. package/dist/components/RenderModal/SchemaEditor/ZodEnumEditor.js +1 -1
  85. package/dist/components/RenderModal/SchemaEditor/ZodErrorMessages.d.ts +1 -0
  86. package/dist/components/RenderModal/SchemaEditor/ZodErrorMessages.js +23 -6
  87. package/dist/components/RenderModal/SchemaEditor/ZodFieldValidation.js +2 -2
  88. package/dist/components/RenderModal/SchemaEditor/ZodNonEditableValue.js +2 -1
  89. package/dist/components/RenderModal/SchemaEditor/ZodNumberEditor.js +1 -1
  90. package/dist/components/RenderModal/SchemaEditor/ZodObjectEditor.js +9 -11
  91. package/dist/components/RenderModal/SchemaEditor/ZodOrNullishEditor.js +1 -1
  92. package/dist/components/RenderModal/SchemaEditor/ZodStaticFileEditor.js +1 -1
  93. package/dist/components/RenderModal/SchemaEditor/ZodStringEditor.js +1 -1
  94. package/dist/components/RenderModal/SchemaEditor/ZodTextareaEditor.js +1 -1
  95. package/dist/components/RenderModal/WarningIndicatorButton.d.ts +1 -0
  96. package/dist/components/RenderModal/WarningIndicatorButton.js +17 -4
  97. package/dist/components/RenderModal/get-render-modal-warnings.d.ts +2 -1
  98. package/dist/components/RenderModal/get-render-modal-warnings.js +6 -3
  99. package/dist/components/RendersTab.js +1 -1
  100. package/dist/components/ResetZoomButton.d.ts +2 -1
  101. package/dist/components/ResetZoomButton.js +5 -1
  102. package/dist/components/SegmentedControl.d.ts +3 -0
  103. package/dist/components/SegmentedControl.js +11 -5
  104. package/dist/components/SelectedOutlineElement.js +96 -24
  105. package/dist/components/SelectedOutlineOverlay.d.ts +1 -1
  106. package/dist/components/SelectedOutlineOverlay.js +44 -30
  107. package/dist/components/SelectedOutlineUvControls.d.ts +9 -0
  108. package/dist/components/SelectedOutlineUvControls.js +64 -10
  109. package/dist/components/Tabs/index.js +4 -4
  110. package/dist/components/Timeline/EasingEditorModal.d.ts +5 -4
  111. package/dist/components/Timeline/EasingEditorModal.js +597 -124
  112. package/dist/components/Timeline/KeyframeSettingsModal.d.ts +2 -2
  113. package/dist/components/Timeline/SubscribeToNodePaths.d.ts +2 -2
  114. package/dist/components/Timeline/Timeline.js +9 -9
  115. package/dist/components/Timeline/TimelineClipboardKeybindings.d.ts +15 -3
  116. package/dist/components/Timeline/TimelineClipboardKeybindings.js +85 -1
  117. package/dist/components/Timeline/TimelineDeleteKeybindings.js +10 -3
  118. package/dist/components/Timeline/TimelineEffectItem.d.ts +2 -2
  119. package/dist/components/Timeline/TimelineEffectItem.js +1 -1
  120. package/dist/components/Timeline/TimelineEffectPropItem.d.ts +8 -0
  121. package/dist/components/Timeline/TimelineEffectPropItem.js +25 -21
  122. package/dist/components/Timeline/TimelineExpandArrowButton.js +42 -2
  123. package/dist/components/Timeline/TimelineExpandedRow.d.ts +5 -2
  124. package/dist/components/Timeline/TimelineExpandedRow.js +6 -6
  125. package/dist/components/Timeline/TimelineExpandedSection.d.ts +1 -1
  126. package/dist/components/Timeline/TimelineExpandedSection.js +10 -25
  127. package/dist/components/Timeline/TimelineKeyframeControls.d.ts +8 -2
  128. package/dist/components/Timeline/TimelineKeyframeControls.js +24 -3
  129. package/dist/components/Timeline/TimelineKeyframeEasingLine.js +2 -47
  130. package/dist/components/Timeline/TimelineKeyframedValue.d.ts +1 -1
  131. package/dist/components/Timeline/TimelineKeyframedValue.js +8 -10
  132. package/dist/components/Timeline/TimelineNumberField.js +5 -11
  133. package/dist/components/Timeline/TimelineRotationField.js +5 -6
  134. package/dist/components/Timeline/TimelineRowChrome.d.ts +2 -0
  135. package/dist/components/Timeline/TimelineRowChrome.js +5 -3
  136. package/dist/components/Timeline/TimelineScaleField.js +4 -8
  137. package/dist/components/Timeline/TimelineSelection.d.ts +28 -2
  138. package/dist/components/Timeline/TimelineSelection.js +342 -61
  139. package/dist/components/Timeline/TimelineSequence.js +19 -3
  140. package/dist/components/Timeline/TimelineSequenceItem.js +68 -64
  141. package/dist/components/Timeline/TimelineSequencePropItem.d.ts +12 -2
  142. package/dist/components/Timeline/TimelineSequencePropItem.js +57 -53
  143. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +6 -4
  144. package/dist/components/Timeline/TimelineTransformOriginField.js +4 -5
  145. package/dist/components/Timeline/TimelineTranslateField.js +4 -5
  146. package/dist/components/Timeline/TimelineUvCoordinateField.js +4 -4
  147. package/dist/components/Timeline/call-add-keyframe.d.ts +4 -4
  148. package/dist/components/Timeline/call-delete-keyframe.d.ts +4 -4
  149. package/dist/components/Timeline/call-move-keyframe.d.ts +2 -2
  150. package/dist/components/Timeline/call-update-keyframe-settings.d.ts +3 -3
  151. package/dist/components/Timeline/delete-selected-timeline-item.d.ts +2 -1
  152. package/dist/components/Timeline/delete-selected-timeline-item.js +27 -1
  153. package/dist/components/Timeline/find-track-for-node-path-info.js +2 -2
  154. package/dist/components/Timeline/get-node-keyframes.d.ts +7 -0
  155. package/dist/components/Timeline/get-node-keyframes.js +26 -1
  156. package/dist/components/Timeline/parse-keyframe-field-from-node-path.js +2 -2
  157. package/dist/components/Timeline/reset-selected-timeline-props.d.ts +3 -3
  158. package/dist/components/Timeline/reset-selected-timeline-props.js +34 -7
  159. package/dist/components/Timeline/save-effect-prop.d.ts +2 -2
  160. package/dist/components/Timeline/save-sequence-prop.d.ts +2 -2
  161. package/dist/components/Timeline/sequence-props-subscription-store.d.ts +3 -3
  162. package/dist/components/Timeline/timeline-expanded-filter.d.ts +12 -0
  163. package/dist/components/Timeline/timeline-expanded-filter.js +38 -0
  164. package/dist/components/Timeline/timeline-field-display-utils.d.ts +5 -0
  165. package/dist/components/Timeline/timeline-field-display-utils.js +244 -0
  166. package/dist/components/Timeline/update-selected-easing.d.ts +47 -4
  167. package/dist/components/Timeline/update-selected-easing.js +40 -9
  168. package/dist/components/Timeline/use-expanded-track-keyframe-rows.js +50 -18
  169. package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.d.ts +13 -0
  170. package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.js +73 -0
  171. package/dist/components/Timeline/use-sequence-props-subscription.d.ts +3 -3
  172. package/dist/components/Timeline/use-timeline-expanded-tree.d.ts +12 -0
  173. package/dist/components/Timeline/use-timeline-expanded-tree.js +60 -0
  174. package/dist/components/Timeline/use-timeline-height.js +51 -7
  175. package/dist/components/Timeline/use-timeline-keyframe-drag.js +12 -6
  176. package/dist/components/TopPanel.js +1 -1
  177. package/dist/components/VisualControls/VisualControlsContent.d.ts +1 -1
  178. package/dist/components/VisualControls/VisualControlsContent.js +4 -5
  179. package/dist/components/effect-drag-and-drop.d.ts +10 -0
  180. package/dist/components/effect-drag-and-drop.js +17 -8
  181. package/dist/components/effect-picker-search.d.ts +5 -0
  182. package/dist/components/effect-picker-search.js +77 -0
  183. package/dist/components/selected-outline-drag.d.ts +21 -2
  184. package/dist/components/selected-outline-drag.js +31 -6
  185. package/dist/components/selected-outline-measurement.js +48 -14
  186. package/dist/components/selected-outline-types.d.ts +7 -7
  187. package/dist/components/selected-outline-uv.d.ts +4 -3
  188. package/dist/components/selected-outline-uv.js +6 -2
  189. package/dist/error-overlay/remotion-overlay/ErrorLoader.js +8 -1
  190. package/dist/esm/{chunk-hrw9799x.js → chunk-4rq5gt8c.js} +30557 -26640
  191. package/dist/esm/internals.mjs +30557 -26640
  192. package/dist/esm/previewEntry.mjs +18584 -14665
  193. package/dist/esm/renderEntry.mjs +1 -1
  194. package/dist/helpers/migrate-expanded-tracks-for-subscription-key.js +3 -3
  195. package/dist/helpers/render-codec-label.d.ts +2 -0
  196. package/dist/helpers/render-codec-label.js +49 -0
  197. package/dist/helpers/timeline-layout.d.ts +4 -4
  198. package/dist/helpers/use-media-metadata.d.ts +8 -2
  199. package/dist/helpers/use-media-metadata.js +17 -4
  200. package/dist/state/modals.d.ts +9 -4
  201. package/package.json +12 -12
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useTimelineExpandedTree = void 0;
4
+ const react_1 = require("react");
5
+ const remotion_1 = require("remotion");
6
+ const timeline_layout_1 = require("../../helpers/timeline-layout");
7
+ const ExpandedTracksProvider_1 = require("../ExpandedTracksProvider");
8
+ const get_node_keyframes_1 = require("./get-node-keyframes");
9
+ const timeline_expanded_filter_1 = require("./timeline-expanded-filter");
10
+ const TimelineSelection_1 = require("./TimelineSelection");
11
+ const useTimelineExpandedTree = ({ sequence, nodePathInfo, }) => {
12
+ const { getIsExpanded } = (0, react_1.useContext)(ExpandedTracksProvider_1.ExpandedTracksGetterContext);
13
+ const { toggleTrack } = (0, react_1.useContext)(ExpandedTracksProvider_1.ExpandedTracksSetterContext);
14
+ const { propStatuses: visualModePropStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesContext);
15
+ const { getDragOverrides, getEffectDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeDragOverridesContext);
16
+ const { selectedItems } = (0, TimelineSelection_1.useTimelineSelection)();
17
+ const tree = (0, react_1.useMemo)(() => (0, timeline_layout_1.buildTimelineTree)({
18
+ sequence,
19
+ nodePathInfo,
20
+ getDragOverrides,
21
+ getEffectDragOverrides,
22
+ propStatuses: visualModePropStatuses,
23
+ }), [
24
+ sequence,
25
+ nodePathInfo,
26
+ getDragOverrides,
27
+ getEffectDragOverrides,
28
+ visualModePropStatuses,
29
+ ]);
30
+ const selectedRowKeys = (0, react_1.useMemo)(() => (0, timeline_expanded_filter_1.getSelectedTimelineExpandedRowKeys)(selectedItems), [selectedItems]);
31
+ const filteredTree = (0, react_1.useMemo)(() => (0, timeline_expanded_filter_1.filterTimelineExpandedTree)({
32
+ nodes: tree,
33
+ shouldShowNode: (node) => (0, timeline_expanded_filter_1.isTimelineExpandedNodeSelected)({
34
+ nodePathInfo: node.nodePathInfo,
35
+ selectedRowKeys,
36
+ }) ||
37
+ (0, get_node_keyframes_1.getNodeHasKeyframes)({
38
+ node,
39
+ nodePath: nodePathInfo.sequenceSubscriptionKey,
40
+ propStatuses: visualModePropStatuses,
41
+ getDragOverrides,
42
+ getEffectDragOverrides,
43
+ }),
44
+ }), [
45
+ getDragOverrides,
46
+ getEffectDragOverrides,
47
+ nodePathInfo.sequenceSubscriptionKey,
48
+ selectedRowKeys,
49
+ tree,
50
+ visualModePropStatuses,
51
+ ]);
52
+ return {
53
+ filteredTree,
54
+ getIsExpanded,
55
+ propStatuses: visualModePropStatuses,
56
+ toggleTrack,
57
+ tree,
58
+ };
59
+ };
60
+ exports.useTimelineExpandedTree = useTimelineExpandedTree;
@@ -6,13 +6,19 @@ const remotion_1 = require("remotion");
6
6
  const client_id_1 = require("../../helpers/client-id");
7
7
  const timeline_layout_1 = require("../../helpers/timeline-layout");
8
8
  const ExpandedTracksProvider_1 = require("../ExpandedTracksProvider");
9
+ const get_node_keyframes_1 = require("./get-node-keyframes");
9
10
  const MaxTimelineTracks_1 = require("./MaxTimelineTracks");
11
+ const timeline_expanded_filter_1 = require("./timeline-expanded-filter");
12
+ const TimelineSelection_1 = require("./TimelineSelection");
10
13
  const TimelineTimeIndicators_1 = require("./TimelineTimeIndicators");
11
14
  const useTimelineHeight = ({ shown, hasBeenCut, }) => {
12
15
  const { getIsExpanded } = (0, react_1.useContext)(ExpandedTracksProvider_1.ExpandedTracksGetterContext);
13
16
  const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
14
17
  const { propStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesContext);
18
+ const { getDragOverrides, getEffectDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeDragOverridesContext);
19
+ const { selectedItems } = (0, TimelineSelection_1.useTimelineSelection)();
15
20
  const previewServerConnected = previewServerState.type === 'connected';
21
+ const selectedRowKeys = (0, react_1.useMemo)(() => (0, timeline_expanded_filter_1.getSelectedTimelineExpandedRowKeys)(selectedItems), [selectedItems]);
16
22
  return (0, react_1.useMemo)(() => {
17
23
  const tracksHeight = shown.reduce((acc, track) => {
18
24
  const isExpanded = previewServerConnected &&
@@ -20,20 +26,58 @@ const useTimelineHeight = ({ shown, hasBeenCut, }) => {
20
26
  getIsExpanded(track.nodePathInfo);
21
27
  const layerHeight = (0, timeline_layout_1.getTimelineLayerHeight)(track.sequence.type) +
22
28
  timeline_layout_1.TIMELINE_ITEM_BORDER_BOTTOM;
23
- const expandedHeight = isExpanded && track.nodePathInfo
24
- ? (0, timeline_layout_1.getExpandedTrackHeight)({
29
+ const expandedHeight = (() => {
30
+ if (!isExpanded || track.nodePathInfo === null) {
31
+ return 0;
32
+ }
33
+ const { nodePathInfo } = track;
34
+ const tree = (0, timeline_layout_1.buildTimelineTree)({
25
35
  sequence: track.sequence,
26
- nodePathInfo: track.nodePathInfo,
27
- getIsExpanded,
36
+ nodePathInfo,
37
+ getDragOverrides,
38
+ getEffectDragOverrides,
28
39
  propStatuses,
29
- }) + timeline_layout_1.TIMELINE_ITEM_BORDER_BOTTOM
30
- : 0;
40
+ });
41
+ const filteredTree = (0, timeline_expanded_filter_1.filterTimelineExpandedTree)({
42
+ nodes: tree,
43
+ shouldShowNode: (node) => (0, timeline_expanded_filter_1.isTimelineExpandedNodeSelected)({
44
+ nodePathInfo: node.nodePathInfo,
45
+ selectedRowKeys,
46
+ }) ||
47
+ (0, get_node_keyframes_1.getNodeHasKeyframes)({
48
+ node,
49
+ nodePath: nodePathInfo.sequenceSubscriptionKey,
50
+ propStatuses,
51
+ getDragOverrides,
52
+ getEffectDragOverrides,
53
+ }),
54
+ });
55
+ const flat = (0, timeline_layout_1.flattenVisibleTreeNodes)({
56
+ nodes: filteredTree,
57
+ getIsExpanded,
58
+ });
59
+ if (flat.length === 0) {
60
+ return 0;
61
+ }
62
+ const totalRowsHeight = flat.reduce((sum, { node }) => sum + (0, timeline_layout_1.getTreeRowHeight)(node), 0);
63
+ const separators = Math.max(0, flat.length - 1);
64
+ return totalRowsHeight + separators + timeline_layout_1.TIMELINE_ITEM_BORDER_BOTTOM;
65
+ })();
31
66
  return acc + layerHeight + expandedHeight;
32
67
  }, 0);
33
68
  return (tracksHeight +
34
69
  timeline_layout_1.TIMELINE_ITEM_BORDER_BOTTOM +
35
70
  (hasBeenCut ? MaxTimelineTracks_1.MAX_TIMELINE_TRACKS_NOTICE_HEIGHT : 0) +
36
71
  TimelineTimeIndicators_1.TIMELINE_TIME_INDICATOR_HEIGHT);
37
- }, [shown, hasBeenCut, previewServerConnected, getIsExpanded, propStatuses]);
72
+ }, [
73
+ shown,
74
+ hasBeenCut,
75
+ previewServerConnected,
76
+ getIsExpanded,
77
+ propStatuses,
78
+ getDragOverrides,
79
+ getEffectDragOverrides,
80
+ selectedRowKeys,
81
+ ]);
38
82
  };
39
83
  exports.useTimelineHeight = useTimelineHeight;
@@ -285,7 +285,8 @@ const useTimelineKeyframeDrag = ({ frame, nodePathInfo, onSelect, selectable, se
285
285
  toggleKey: e.metaKey || e.ctrlKey,
286
286
  };
287
287
  const shouldDragExistingSelection = selected && !interaction.shiftKey && !interaction.toggleKey;
288
- if (!shouldDragExistingSelection) {
288
+ const shouldSelectOnPointerUp = !selected && !interaction.shiftKey && !interaction.toggleKey;
289
+ if (!shouldDragExistingSelection && !shouldSelectOnPointerUp) {
289
290
  onSelect(interaction);
290
291
  }
291
292
  const clickedSelection = {
@@ -380,6 +381,9 @@ const useTimelineKeyframeDrag = ({ frame, nodePathInfo, onSelect, selectable, se
380
381
  cleanup();
381
382
  const targets = dragTargets;
382
383
  if (!hasDragged || lastDelta === 0 || targets === null) {
384
+ if (shouldSelectOnPointerUp) {
385
+ onSelect(interaction);
386
+ }
383
387
  clearActiveOverrides();
384
388
  clearDraggedKeyframes();
385
389
  return;
@@ -392,11 +396,13 @@ const useTimelineKeyframeDrag = ({ frame, nodePathInfo, onSelect, selectable, se
392
396
  clearDraggedKeyframes();
393
397
  return;
394
398
  }
395
- currentSelection.current.selectItems(targets.map((target) => ({
396
- type: 'keyframe',
397
- nodePathInfo: target.nodePathInfo,
398
- frame: target.displayFrame + lastDelta,
399
- })));
399
+ if (shouldDragExistingSelection) {
400
+ currentSelection.current.selectItems(targets.map((target) => ({
401
+ type: 'keyframe',
402
+ nodePathInfo: target.nodePathInfo,
403
+ frame: target.displayFrame + lastDelta,
404
+ })));
405
+ }
400
406
  clearActiveOverrides();
401
407
  clearDraggedKeyframes();
402
408
  (0, call_move_keyframe_1.callMoveKeyframes)({
@@ -115,7 +115,7 @@ const TopPanelInner = ({ readOnlyStudio, onMounted, drawRef, bufferStateDelayInM
115
115
  : null, readOnlyStudio: readOnlyStudio, children: jsx_runtime_1.jsxs("div", { style: container, children: [
116
116
  jsx_runtime_1.jsx("div", { style: row, children: jsx_runtime_1.jsxs(SplitterContainer_1.SplitterContainer, { minFlex: 0.15, maxFlex: 0.4, defaultFlex: 0.2, id: "sidebar-to-preview", orientation: "vertical", children: [actualStateLeft === 'expanded' ? (isMobileLayout ? (jsx_runtime_1.jsx(MobilePanel_1.default, { onClose: onCollapseLeft, children: jsx_runtime_1.jsx(ExplorerPanel_1.ExplorerPanel, { readOnlyStudio: readOnlyStudio }) })) : (jsx_runtime_1.jsx(SplitterElement_1.SplitterElement, { sticky: null, type: "flexer", children: jsx_runtime_1.jsx(ExplorerPanel_1.ExplorerPanel, { readOnlyStudio: readOnlyStudio }) }))) : null, actualStateLeft === 'expanded' ? (jsx_runtime_1.jsx(SplitterHandle_1.SplitterHandle, { allowToCollapse: "left", onCollapse: onCollapseLeft })) : null, jsx_runtime_1.jsx(SplitterElement_1.SplitterElement, { sticky: null, type: "anti-flexer", children: jsx_runtime_1.jsxs(SplitterContainer_1.SplitterContainer, { minFlex: 0.5, maxFlex: 0.8, defaultFlex: 0.7, id: "canvas-to-right-sidebar", orientation: "vertical", children: [
117
117
  jsx_runtime_1.jsx(SplitterElement_1.SplitterElement, { sticky: null, type: "flexer", children: jsx_runtime_1.jsx("div", { ref: drawRef, style: canvasContainerStyle, children: jsx_runtime_1.jsx(CanvasIfSizeIsAvailable_1.CanvasIfSizeIsAvailable, {}) }) }), actualStateRight === 'expanded' ? (jsx_runtime_1.jsx(SplitterHandle_1.SplitterHandle, { allowToCollapse: "right", onCollapse: onCollapseRight })) : null, actualStateRight === 'expanded' ? (isMobileLayout ? (jsx_runtime_1.jsx(MobilePanel_1.default, { onClose: onCollapseRight, children: jsx_runtime_1.jsx(OptionsPanel_1.OptionsPanel, { readOnlyStudio: readOnlyStudio }) })) : (jsx_runtime_1.jsx(SplitterElement_1.SplitterElement, { sticky: null, type: "anti-flexer", children: jsx_runtime_1.jsx(OptionsPanel_1.OptionsPanel, { readOnlyStudio: readOnlyStudio }) }))) : null] }) })
118
- ] }) }), jsx_runtime_1.jsx(PreviewToolbar_1.PreviewToolbar, { bufferStateDelayInMilliseconds: bufferStateDelayInMilliseconds, readOnlyStudio: readOnlyStudio }), jsx_runtime_1.jsx(CurrentCompositionSideEffects_1.CurrentCompositionKeybindings, { readOnlyStudio: readOnlyStudio }), jsx_runtime_1.jsx(CurrentCompositionSideEffects_1.TitleUpdater, {})
118
+ ] }) }), jsx_runtime_1.jsx(PreviewToolbar_1.PreviewToolbar, { bufferStateDelayInMilliseconds: bufferStateDelayInMilliseconds, readOnlyStudio: readOnlyStudio }), jsx_runtime_1.jsx(CurrentCompositionSideEffects_1.TitleUpdater, {})
119
119
  ] }) }));
120
120
  };
121
121
  exports.TopPanel = react_1.default.memo(TopPanelInner);
@@ -1 +1 @@
1
- export declare const VisualControlsContent: () => import("react/jsx-runtime").JSX.Element;
1
+ export declare const VisualControlsContent: () => import("react/jsx-runtime").JSX.Element | null;
@@ -37,16 +37,15 @@ exports.VisualControlsContent = void 0;
37
37
  const jsx_runtime_1 = require("react/jsx-runtime");
38
38
  const react_1 = __importStar(require("react"));
39
39
  const VisualControls_1 = require("../../visual-controls/VisualControls");
40
- const is_menu_item_1 = require("../Menu/is-menu-item");
41
40
  const SchemaSeparationLine_1 = require("../RenderModal/SchemaEditor/SchemaSeparationLine");
42
41
  const VisualControlHandle_1 = require("./VisualControlHandle");
43
- const container = {
44
- overflowY: 'auto',
45
- };
46
42
  const VisualControlsContent = () => {
47
43
  const { handles } = (0, react_1.useContext)(VisualControls_1.VisualControlsContext);
48
44
  const entries = Object.entries(handles);
49
- return (jsx_runtime_1.jsx("div", { style: container, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: entries.map(([key, value], i) => {
45
+ if (entries.length === 0) {
46
+ return null;
47
+ }
48
+ return (jsx_runtime_1.jsx("div", { children: entries.map(([key, value], i) => {
50
49
  return (jsx_runtime_1.jsxs(react_1.default.Fragment, { children: [
51
50
  jsx_runtime_1.jsx(VisualControlHandle_1.VisualControlHandle, { keyName: key, value: value }), i === entries.length - 1 ? null : jsx_runtime_1.jsx(SchemaSeparationLine_1.SchemaSeparationLine, {})] }, key));
52
51
  }) }));
@@ -9,3 +9,13 @@ export declare const addEffectFromDragData: ({ clientId, dragData, fileName, nod
9
9
  readonly fileName: string;
10
10
  readonly nodePath: SequencePropsSubscriptionKey;
11
11
  }) => Promise<void>;
12
+ export declare const addEffectToSequence: ({ clientId, effect, fileName, nodePath, }: {
13
+ readonly clientId: string;
14
+ readonly effect: {
15
+ name: string;
16
+ importPath: string;
17
+ config: Record<string, unknown>;
18
+ };
19
+ readonly fileName: string;
20
+ readonly nodePath: SequencePropsSubscriptionKey;
21
+ }) => Promise<void>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.addEffectFromDragData = exports.getEffectDragData = exports.hasExplicitEffectDragType = exports.hasEffectDragType = void 0;
3
+ exports.addEffectToSequence = exports.addEffectFromDragData = exports.getEffectDragData = exports.hasExplicitEffectDragType = exports.hasEffectDragType = void 0;
4
4
  const studio_shared_1 = require("@remotion/studio-shared");
5
5
  const install_required_package_1 = require("../helpers/install-required-package");
6
6
  const call_api_1 = require("./call-api");
@@ -47,20 +47,29 @@ const getEffectDragData = (dataTransfer) => {
47
47
  return null;
48
48
  };
49
49
  exports.getEffectDragData = getEffectDragData;
50
- const addEffectFromDragData = async ({ clientId, dragData, fileName, nodePath, }) => {
50
+ const addEffectFromDragData = ({ clientId, dragData, fileName, nodePath, }) => {
51
+ return (0, exports.addEffectToSequence)({
52
+ clientId,
53
+ effect: dragData.effect,
54
+ fileName,
55
+ nodePath,
56
+ });
57
+ };
58
+ exports.addEffectFromDragData = addEffectFromDragData;
59
+ const addEffectToSequence = async ({ clientId, effect, fileName, nodePath, }) => {
51
60
  try {
52
- const requiredPackage = (0, studio_shared_1.getRequiredPackageForEffectImportPath)(dragData.effect.importPath);
61
+ const requiredPackage = (0, studio_shared_1.getRequiredPackageForEffectImportPath)(effect.importPath);
53
62
  await (0, install_required_package_1.installRequiredPackages)(requiredPackage ? [requiredPackage] : []);
54
63
  const result = await (0, call_api_1.callApi)('/api/add-effect', {
55
64
  fileName,
56
65
  sequenceNodePath: nodePath,
57
- effectName: dragData.effect.name,
58
- effectImportPath: dragData.effect.importPath,
59
- effectConfig: dragData.effect.config,
66
+ effectName: effect.name,
67
+ effectImportPath: effect.importPath,
68
+ effectConfig: effect.config,
60
69
  clientId,
61
70
  });
62
71
  if (result.success) {
63
- (0, NotificationCenter_1.showNotification)(`Added ${dragData.effect.name}()`, 2000);
72
+ (0, NotificationCenter_1.showNotification)(`Added ${effect.name}()`, 2000);
64
73
  }
65
74
  else {
66
75
  (0, NotificationCenter_1.showNotification)(result.reason, 4000);
@@ -70,4 +79,4 @@ const addEffectFromDragData = async ({ clientId, dragData, fileName, nodePath, }
70
79
  (0, NotificationCenter_1.showNotification)(err.message, 4000);
71
80
  }
72
81
  };
73
- exports.addEffectFromDragData = addEffectFromDragData;
82
+ exports.addEffectToSequence = addEffectToSequence;
@@ -0,0 +1,5 @@
1
+ import type { EffectCatalogItem } from '@remotion/studio-shared';
2
+ export declare const filterEffectCatalog: ({ items, query, }: {
3
+ readonly items: readonly EffectCatalogItem[];
4
+ readonly query: string;
5
+ }) => EffectCatalogItem[];
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.filterEffectCatalog = void 0;
4
+ const normalize = (value) => value.trim().toLowerCase();
5
+ const compact = (value) => normalize(value).replace(/[^a-z0-9]/g, '');
6
+ const fuzzyMatches = (query, value) => {
7
+ let index = -1;
8
+ for (const character of query) {
9
+ index = value.indexOf(character, index + 1);
10
+ if (index === -1) {
11
+ return false;
12
+ }
13
+ }
14
+ return true;
15
+ };
16
+ const getMatchScore = (item, query) => {
17
+ const normalizedQuery = normalize(query);
18
+ const compactQuery = compact(query);
19
+ if (normalizedQuery.length === 0) {
20
+ return 0;
21
+ }
22
+ const label = normalize(item.label);
23
+ const name = normalize(item.effect.name);
24
+ const primary = [label, name];
25
+ const compactPrimary = primary.map(compact);
26
+ if (primary.some((field) => field === normalizedQuery)) {
27
+ return 0;
28
+ }
29
+ if (compactQuery.length > 0) {
30
+ if (compactPrimary.some((field) => field === compactQuery)) {
31
+ return 1;
32
+ }
33
+ if (compactPrimary.some((field) => field.startsWith(compactQuery))) {
34
+ return 2;
35
+ }
36
+ }
37
+ if (primary.some((field) => field.startsWith(normalizedQuery))) {
38
+ return 2;
39
+ }
40
+ if (compactQuery.length > 0) {
41
+ if (compactPrimary.some((field) => field.includes(compactQuery))) {
42
+ return 3;
43
+ }
44
+ }
45
+ if (primary.some((field) => field.includes(normalizedQuery))) {
46
+ return 3;
47
+ }
48
+ const importPath = normalize(item.effect.importPath);
49
+ if (importPath.includes(normalizedQuery) ||
50
+ (compactQuery.length > 0 && compact(importPath).includes(compactQuery))) {
51
+ return 4;
52
+ }
53
+ const secondary = [normalize(item.category), normalize(item.description)];
54
+ const compactSecondary = secondary.map(compact);
55
+ if (secondary.some((field) => field.includes(normalizedQuery)) ||
56
+ (compactQuery.length > 0 &&
57
+ compactSecondary.some((field) => field.includes(compactQuery)))) {
58
+ return 5;
59
+ }
60
+ if (compactQuery.length > 0 &&
61
+ compactPrimary.some((field) => fuzzyMatches(compactQuery, field))) {
62
+ return 6;
63
+ }
64
+ return null;
65
+ };
66
+ const filterEffectCatalog = ({ items, query, }) => {
67
+ return items
68
+ .map((item, index) => ({
69
+ item,
70
+ index,
71
+ score: getMatchScore(item, query),
72
+ }))
73
+ .filter((candidate) => candidate.score !== null)
74
+ .sort((a, b) => a.score - b.score || a.index - b.index)
75
+ .map(({ item }) => item);
76
+ };
77
+ exports.filterEffectCatalog = filterEffectCatalog;
@@ -1,8 +1,15 @@
1
- import type { GetDragOverrides, SequencePropsSubscriptionKey, SequenceSchema } from 'remotion';
1
+ import type { CanUpdateSequencePropStatus, DragOverrideValue, GetDragOverrides, SequencePropsSubscriptionKey, InteractivitySchema } from 'remotion';
2
2
  import { type OutlinePoint } from './selected-outline-geometry';
3
3
  import type { SelectedOutlineDragState, SelectedOutlineRotationDragState, SelectedOutlineRotationDragTarget, SelectedOutlineScaleDragState, SelectedOutlineScaleDragTarget, SelectedOutlineDragTarget } from './selected-outline-types';
4
4
  import { type UvCoordinate } from './selected-outline-uv';
5
5
  import type { SaveSequencePropChange } from './Timeline/save-sequence-prop';
6
+ export declare const getSelectedOutlineActiveSchema: ({ schema, currentRuntimeValueDotNotation, dragOverrides, propStatus, frame, }: {
7
+ readonly schema: InteractivitySchema;
8
+ readonly currentRuntimeValueDotNotation: Record<string, unknown>;
9
+ readonly dragOverrides: Record<string, DragOverrideValue>;
10
+ readonly propStatus: Record<string, CanUpdateSequencePropStatus> | undefined;
11
+ readonly frame: number | null;
12
+ }) => InteractivitySchema;
6
13
  export declare const getSelectedOutlineDragStates: ({ dragTargets, getDragOverrides, timelinePosition, }: {
7
14
  readonly dragTargets: readonly SelectedOutlineDragTarget[];
8
15
  readonly getDragOverrides: GetDragOverrides;
@@ -35,7 +42,7 @@ export type SelectedOutlineKeyframedDragChange = {
35
42
  readonly fieldKey: string;
36
43
  readonly sourceFrame: number;
37
44
  readonly value: unknown;
38
- readonly schema: SequenceSchema;
45
+ readonly schema: InteractivitySchema;
39
46
  readonly clientId: string;
40
47
  };
41
48
  export type SelectedOutlineDragChange = SelectedOutlineStaticDragChange | SelectedOutlineKeyframedDragChange;
@@ -90,6 +97,11 @@ export declare const getSelectedOutlineRotationDragValues: ({ dragStates, rotati
90
97
  readonly dragStates: readonly SelectedOutlineRotationDragState[];
91
98
  readonly rotationDeltaDegrees: number;
92
99
  }) => Map<string, string>;
100
+ export declare const selectedOutlineRotationSnapStepDegrees = 15;
101
+ export declare const snapSelectedOutlineRotationDeltaDegrees: ({ dragStates, rotationDeltaDegrees, }: {
102
+ readonly dragStates: readonly SelectedOutlineRotationDragState[];
103
+ readonly rotationDeltaDegrees: number;
104
+ }) => number;
93
105
  export declare const getSelectedOutlineRotationDragChanges: ({ dragStates, lastValues, }: {
94
106
  readonly dragStates: readonly SelectedOutlineRotationDragState[];
95
107
  readonly lastValues: ReadonlyMap<string, string>;
@@ -130,6 +142,13 @@ export declare const applySelectedOutlineTransformOriginAxisLock: ({ lockedAxis,
130
142
  readonly startUv: UvCoordinate;
131
143
  readonly uv: UvCoordinate;
132
144
  }) => UvCoordinate;
145
+ export declare const selectedOutlineUvSnapThresholdPx = 10;
146
+ export declare const snapSelectedOutlineUv: ({ point, points, thresholdPx, uv, }: {
147
+ readonly point: OutlinePoint;
148
+ readonly points: readonly [OutlinePoint, OutlinePoint, OutlinePoint, OutlinePoint];
149
+ readonly thresholdPx?: number | undefined;
150
+ readonly uv: UvCoordinate;
151
+ }) => UvCoordinate;
133
152
  export declare const selectedOutlineTransformOriginSnapThresholdPx = 10;
134
153
  export declare const snapSelectedOutlineTransformOriginUv: ({ point, points, thresholdPx, uv, }: {
135
154
  readonly point: OutlinePoint;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.snapSelectedOutlineTransformOriginUv = exports.selectedOutlineTransformOriginSnapThresholdPx = exports.applySelectedOutlineTransformOriginAxisLock = exports.getSelectedOutlineTransformOriginLockedAxis = exports.uvsEqual = exports.compensateTranslateForTransformOrigin = exports.parseCssRotationToRadians = exports.clearSelectedOutlineRotationDragOverrides = exports.clearSelectedOutlineScaleDragOverrides = exports.getSelectedOutlineKeyboardNudgeDirection = exports.clearSelectedOutlineDragOverrides = exports.getSelectedOutlineRotationDragChanges = exports.getSelectedOutlineRotationDragValues = exports.getSelectedOutlineRotationDragStates = exports.getSelectedOutlineScaleDragChanges = exports.getSelectedOutlineScaleDragValues = exports.getSelectedOutlineScaleDragStates = exports.getSelectedOutlineScaleEdgeInfo = exports.getSelectedOutlineKeyboardNudgeDeltas = exports.getSelectedOutlineKeyboardNudgeDelta = exports.getSelectedOutlineDragChanges = exports.isSelectedOutlineDragPastThreshold = exports.applySelectedOutlineDragAxisLock = exports.getSelectedOutlineDragValues = exports.getSelectedOutlineDragStates = void 0;
3
+ exports.snapSelectedOutlineTransformOriginUv = exports.selectedOutlineTransformOriginSnapThresholdPx = exports.snapSelectedOutlineUv = exports.selectedOutlineUvSnapThresholdPx = exports.applySelectedOutlineTransformOriginAxisLock = exports.getSelectedOutlineTransformOriginLockedAxis = exports.uvsEqual = exports.compensateTranslateForTransformOrigin = exports.parseCssRotationToRadians = exports.clearSelectedOutlineRotationDragOverrides = exports.clearSelectedOutlineScaleDragOverrides = exports.getSelectedOutlineKeyboardNudgeDirection = exports.clearSelectedOutlineDragOverrides = exports.getSelectedOutlineRotationDragChanges = exports.snapSelectedOutlineRotationDeltaDegrees = exports.selectedOutlineRotationSnapStepDegrees = exports.getSelectedOutlineRotationDragValues = exports.getSelectedOutlineRotationDragStates = exports.getSelectedOutlineScaleDragChanges = exports.getSelectedOutlineScaleDragValues = exports.getSelectedOutlineScaleDragStates = exports.getSelectedOutlineScaleEdgeInfo = exports.getSelectedOutlineKeyboardNudgeDeltas = exports.getSelectedOutlineKeyboardNudgeDelta = exports.getSelectedOutlineDragChanges = exports.isSelectedOutlineDragPastThreshold = exports.applySelectedOutlineDragAxisLock = exports.getSelectedOutlineDragValues = exports.getSelectedOutlineDragStates = exports.getSelectedOutlineActiveSchema = void 0;
4
4
  const remotion_1 = require("remotion");
5
5
  const no_react_1 = require("remotion/no-react");
6
6
  const selected_outline_geometry_1 = require("./selected-outline-geometry");
@@ -11,6 +11,17 @@ const timeline_field_utils_1 = require("./Timeline/timeline-field-utils");
11
11
  const timeline_rotation_utils_1 = require("./Timeline/timeline-rotation-utils");
12
12
  const timeline_translate_utils_1 = require("./Timeline/timeline-translate-utils");
13
13
  const TimelineScaleField_1 = require("./Timeline/TimelineScaleField");
14
+ const getSelectedOutlineActiveSchema = ({ schema, currentRuntimeValueDotNotation, dragOverrides, propStatus, frame, }) => {
15
+ const { merged: valuesDotNotation } = remotion_1.Internals.computeEffectiveSchemaValuesDotNotation({
16
+ schema,
17
+ currentValue: currentRuntimeValueDotNotation,
18
+ overrideValues: dragOverrides,
19
+ propStatus,
20
+ frame,
21
+ });
22
+ return remotion_1.Internals.flattenActiveSchema(schema, (key) => valuesDotNotation[key]);
23
+ };
24
+ exports.getSelectedOutlineActiveSchema = getSelectedOutlineActiveSchema;
14
25
  const getSelectedOutlineDragStates = ({ dragTargets, getDragOverrides, timelinePosition, }) => {
15
26
  return dragTargets.map((target) => {
16
27
  var _a;
@@ -304,6 +315,18 @@ const getSelectedOutlineRotationDragValues = ({ dragStates, rotationDeltaDegrees
304
315
  }));
305
316
  };
306
317
  exports.getSelectedOutlineRotationDragValues = getSelectedOutlineRotationDragValues;
318
+ exports.selectedOutlineRotationSnapStepDegrees = 15;
319
+ const snapSelectedOutlineRotationDeltaDegrees = ({ dragStates, rotationDeltaDegrees, }) => {
320
+ const anchor = dragStates[0];
321
+ if (anchor === undefined) {
322
+ return rotationDeltaDegrees;
323
+ }
324
+ return (Math.round((anchor.startDegrees + rotationDeltaDegrees) /
325
+ exports.selectedOutlineRotationSnapStepDegrees) *
326
+ exports.selectedOutlineRotationSnapStepDegrees -
327
+ anchor.startDegrees);
328
+ };
329
+ exports.snapSelectedOutlineRotationDeltaDegrees = snapSelectedOutlineRotationDeltaDegrees;
307
330
  const getSelectedOutlineRotationDragChanges = ({ dragStates, lastValues, }) => {
308
331
  const changes = [];
309
332
  for (const dragState of dragStates) {
@@ -445,7 +468,7 @@ const applySelectedOutlineTransformOriginAxisLock = ({ lockedAxis, startUv, uv,
445
468
  return uv;
446
469
  };
447
470
  exports.applySelectedOutlineTransformOriginAxisLock = applySelectedOutlineTransformOriginAxisLock;
448
- const transformOriginSnapTargets = [
471
+ const selectedOutlineUvSnapTargets = [
449
472
  [0, 0],
450
473
  [0.5, 0],
451
474
  [1, 0],
@@ -456,11 +479,11 @@ const transformOriginSnapTargets = [
456
479
  [0, 0.5],
457
480
  [0.5, 0.5],
458
481
  ];
459
- exports.selectedOutlineTransformOriginSnapThresholdPx = 10;
460
- const snapSelectedOutlineTransformOriginUv = ({ point, points, thresholdPx = exports.selectedOutlineTransformOriginSnapThresholdPx, uv, }) => {
482
+ exports.selectedOutlineUvSnapThresholdPx = 10;
483
+ const snapSelectedOutlineUv = ({ point, points, thresholdPx = exports.selectedOutlineUvSnapThresholdPx, uv, }) => {
461
484
  var _a;
462
485
  let best = null;
463
- for (const snapUv of transformOriginSnapTargets) {
486
+ for (const snapUv of selectedOutlineUvSnapTargets) {
464
487
  const snapPoint = (0, selected_outline_uv_1.getUvHandlePosition)(points, snapUv);
465
488
  const distance = Math.hypot(point.x - snapPoint.x, point.y - snapPoint.y);
466
489
  if (distance > thresholdPx) {
@@ -472,4 +495,6 @@ const snapSelectedOutlineTransformOriginUv = ({ point, points, thresholdPx = exp
472
495
  }
473
496
  return (_a = best === null || best === void 0 ? void 0 : best.uv) !== null && _a !== void 0 ? _a : uv;
474
497
  };
475
- exports.snapSelectedOutlineTransformOriginUv = snapSelectedOutlineTransformOriginUv;
498
+ exports.snapSelectedOutlineUv = snapSelectedOutlineUv;
499
+ exports.selectedOutlineTransformOriginSnapThresholdPx = exports.selectedOutlineUvSnapThresholdPx;
500
+ exports.snapSelectedOutlineTransformOriginUv = exports.snapSelectedOutlineUv;
@@ -219,28 +219,60 @@ const getOutlineSelectionInteraction = ({ shiftKey, metaKey, ctrlKey, }) => ({
219
219
  toggleKey: metaKey || ctrlKey,
220
220
  });
221
221
  exports.getOutlineSelectionInteraction = getOutlineSelectionInteraction;
222
+ const getKeyframeOrEasingField = (item) => {
223
+ if (item.type !== 'keyframe' && item.type !== 'easing') {
224
+ return null;
225
+ }
226
+ return (0, parse_keyframe_field_from_node_path_1.parseKeyframeFieldFromNodePath)(item.nodePathInfo.auxiliaryKeys);
227
+ };
222
228
  const getSelectedEffectFieldsBySequenceKey = (selectedItems) => {
223
- var _a, _b;
229
+ var _a;
224
230
  const selectedEffects = new Map();
225
231
  for (const item of selectedItems) {
226
- if (item.type !== 'sequence-effect' &&
227
- item.type !== 'sequence-effect-prop') {
232
+ if (item.type === 'guide') {
228
233
  continue;
229
234
  }
230
235
  const sequenceKey = (0, TimelineSelection_1.getTimelineSequenceSelectionKey)(item.nodePathInfo);
231
236
  const effectsForSequence = (_a = selectedEffects.get(sequenceKey)) !== null && _a !== void 0 ? _a : new Map();
232
- const selectedFields = (_b = effectsForSequence.get(item.i)) !== null && _b !== void 0 ? _b : {
233
- allFields: false,
234
- fieldKeys: new Set(),
237
+ const addSelectedFields = ({ effectIndex, fieldKey, allFields, }) => {
238
+ var _a;
239
+ const selectedFields = (_a = effectsForSequence.get(effectIndex)) !== null && _a !== void 0 ? _a : {
240
+ allFields: false,
241
+ fieldKeys: new Set(),
242
+ };
243
+ if (allFields) {
244
+ selectedFields.allFields = true;
245
+ }
246
+ else if (fieldKey !== null) {
247
+ selectedFields.fieldKeys.add(fieldKey);
248
+ }
249
+ effectsForSequence.set(effectIndex, selectedFields);
250
+ selectedEffects.set(sequenceKey, effectsForSequence);
235
251
  };
236
252
  if (item.type === 'sequence-effect') {
237
- selectedFields.allFields = true;
253
+ addSelectedFields({
254
+ effectIndex: item.i,
255
+ fieldKey: null,
256
+ allFields: true,
257
+ });
258
+ continue;
259
+ }
260
+ if (item.type === 'sequence-effect-prop') {
261
+ addSelectedFields({
262
+ effectIndex: item.i,
263
+ fieldKey: item.key,
264
+ allFields: false,
265
+ });
266
+ continue;
238
267
  }
239
- else {
240
- selectedFields.fieldKeys.add(item.key);
268
+ const keyframedField = getKeyframeOrEasingField(item);
269
+ if ((keyframedField === null || keyframedField === void 0 ? void 0 : keyframedField.type) === 'effect') {
270
+ addSelectedFields({
271
+ effectIndex: keyframedField.effectIndex,
272
+ fieldKey: keyframedField.fieldKey,
273
+ allFields: false,
274
+ });
241
275
  }
242
- effectsForSequence.set(item.i, selectedFields);
243
- selectedEffects.set(sequenceKey, effectsForSequence);
244
276
  }
245
277
  return selectedEffects;
246
278
  };
@@ -257,17 +289,19 @@ const getSelectedTransformOriginInfo = (selectedItems) => {
257
289
  displayFrame: null,
258
290
  };
259
291
  }
260
- if (selectedItem.type !== 'keyframe') {
292
+ if (selectedItem.type !== 'keyframe' && selectedItem.type !== 'easing') {
261
293
  return null;
262
294
  }
263
- const field = (0, parse_keyframe_field_from_node_path_1.parseKeyframeFieldFromNodePath)(selectedItem.nodePathInfo.auxiliaryKeys);
295
+ const field = getKeyframeOrEasingField(selectedItem);
264
296
  if ((field === null || field === void 0 ? void 0 : field.type) !== 'sequence' ||
265
297
  field.fieldKey !== selected_outline_types_1.transformOriginFieldKey) {
266
298
  return null;
267
299
  }
268
300
  return {
269
301
  sequenceKey: (0, TimelineSelection_1.getTimelineSequenceSelectionKey)(selectedItem.nodePathInfo),
270
- displayFrame: selectedItem.frame,
302
+ displayFrame: selectedItem.type === 'keyframe'
303
+ ? selectedItem.frame
304
+ : selectedItem.fromFrame,
271
305
  };
272
306
  };
273
307
  exports.getSelectedTransformOriginInfo = getSelectedTransformOriginInfo;
@@ -1,4 +1,4 @@
1
- import type { CanUpdateSequencePropStatusKeyframed, CanUpdateSequencePropStatusStatic, SequenceFieldSchema, SequencePropsSubscriptionKey, SequenceSchema, TSequence } from 'remotion';
1
+ import type { CanUpdateSequencePropStatusKeyframed, CanUpdateSequencePropStatusStatic, InteractivitySchemaField, SequencePropsSubscriptionKey, InteractivitySchema, TSequence } from 'remotion';
2
2
  import type { SequenceNodePathInfo } from '../helpers/get-timeline-sequence-sort-key';
3
3
  import type { ComboboxValue } from './NewComposition/ComboBox';
4
4
  import type { SelectedOutlineUvHandle } from './selected-outline-uv';
@@ -31,7 +31,7 @@ export type SelectedOutlineDragTarget = {
31
31
  readonly fieldDefault: string | undefined;
32
32
  readonly keyframeDisplayOffset: number;
33
33
  readonly nodePath: SequencePropsSubscriptionKey;
34
- readonly schema: SequenceSchema;
34
+ readonly schema: InteractivitySchema;
35
35
  };
36
36
  export type SelectedOutlineTransformOriginDragTarget = {
37
37
  readonly clientId: string;
@@ -42,16 +42,16 @@ export type SelectedOutlineTransformOriginDragTarget = {
42
42
  readonly originValue: string;
43
43
  readonly rotateValue: string;
44
44
  readonly scaleValue: number | string;
45
- readonly schema: SequenceSchema;
45
+ readonly schema: InteractivitySchema;
46
46
  readonly sourceFrame: number;
47
47
  readonly translateDefault: string | undefined;
48
48
  readonly translatePropStatus: CanUpdateSequencePropStatusStatic | CanUpdateSequencePropStatusKeyframed;
49
49
  readonly translateValue: string;
50
50
  };
51
- export type ScaleFieldSchema = Extract<SequenceFieldSchema, {
51
+ export type ScaleFieldSchema = Extract<InteractivitySchemaField, {
52
52
  type: 'scale';
53
53
  }>;
54
- export type RotationFieldSchema = Extract<SequenceFieldSchema, {
54
+ export type RotationFieldSchema = Extract<InteractivitySchemaField, {
55
55
  type: 'rotation-css';
56
56
  }>;
57
57
  export type SelectedOutlineScaleDragTarget = {
@@ -62,7 +62,7 @@ export type SelectedOutlineScaleDragTarget = {
62
62
  readonly keyframeDisplayOffset: number;
63
63
  readonly linked: boolean;
64
64
  readonly nodePath: SequencePropsSubscriptionKey;
65
- readonly schema: SequenceSchema;
65
+ readonly schema: InteractivitySchema;
66
66
  };
67
67
  export type SelectedOutlineRotationDragTarget = {
68
68
  readonly propStatus: CanUpdateSequencePropStatusStatic | CanUpdateSequencePropStatusKeyframed;
@@ -71,7 +71,7 @@ export type SelectedOutlineRotationDragTarget = {
71
71
  readonly fieldSchema: RotationFieldSchema;
72
72
  readonly keyframeDisplayOffset: number;
73
73
  readonly nodePath: SequencePropsSubscriptionKey;
74
- readonly schema: SequenceSchema;
74
+ readonly schema: InteractivitySchema;
75
75
  readonly transformOriginValue: string;
76
76
  };
77
77
  export type SelectedOutlineDragState = {