@remotion/studio 4.0.516 → 4.0.518

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 (157) hide show
  1. package/dist/components/AssetSelector.js +63 -22
  2. package/dist/components/AssetSelectorItem.d.ts +2 -1
  3. package/dist/components/AssetSelectorItem.js +41 -10
  4. package/dist/components/Canvas.js +15 -12
  5. package/dist/components/CanvasCaptureDropHandler.d.ts +4 -0
  6. package/dist/components/CanvasCaptureDropHandler.js +42 -0
  7. package/dist/components/CanvasOrLoading.js +4 -3
  8. package/dist/components/CaptionInspector.js +1 -1
  9. package/dist/components/CaptionTextEditor.js +32 -8
  10. package/dist/components/CheckboardToggle.js +1 -1
  11. package/dist/components/Checkbox.d.ts +0 -1
  12. package/dist/components/Checkbox.js +2 -19
  13. package/dist/components/CompositionContextButton.js +2 -1
  14. package/dist/components/CompositionSelector.js +1 -1
  15. package/dist/components/ConfigureLicenseModal.js +79 -46
  16. package/dist/components/CurrentAsset.d.ts +1 -1
  17. package/dist/components/CurrentAsset.js +9 -4
  18. package/dist/components/Editor.js +2 -1
  19. package/dist/components/EditorContent.js +11 -5
  20. package/dist/components/EditorContexts.js +2 -1
  21. package/dist/components/EditorRuler/Ruler.d.ts +1 -0
  22. package/dist/components/EditorRuler/Ruler.js +9 -8
  23. package/dist/components/EditorRuler/index.d.ts +1 -0
  24. package/dist/components/EditorRuler/index.js +3 -4
  25. package/dist/components/EditorRuler/use-is-ruler-visible.d.ts +1 -1
  26. package/dist/components/EditorRuler/use-is-ruler-visible.js +8 -2
  27. package/dist/components/ElementInstallConfirmation.d.ts +5 -0
  28. package/dist/components/ElementInstallConfirmation.js +25 -1
  29. package/dist/components/ElementLibraryModal.d.ts +5 -0
  30. package/dist/components/ElementLibraryModal.js +40 -0
  31. package/dist/components/FilePreview.js +71 -0
  32. package/dist/components/InlineCaptionInspector.js +13 -2
  33. package/dist/components/InlineEditableTitle.js +2 -2
  34. package/dist/components/InspectorPanel/CompositionInspector.js +11 -38
  35. package/dist/components/InspectorPanel/CompositionInspectorHeader.js +2 -2
  36. package/dist/components/InspectorPanel/CompositionMetadata.js +11 -4
  37. package/dist/components/InspectorPanel/EasingInspector.js +2 -2
  38. package/dist/components/InspectorPanel/ElementLibraryButton.d.ts +2 -0
  39. package/dist/components/InspectorPanel/ElementLibraryButton.js +139 -0
  40. package/dist/components/InspectorPanel/KeyframeInspector.js +1 -1
  41. package/dist/components/InspectorPanel/SequenceInspectorHeader.js +12 -5
  42. package/dist/components/InspectorPanel/SequenceSelectionInspector.js +1 -3
  43. package/dist/components/InspectorPanel/common.d.ts +0 -1
  44. package/dist/components/InspectorPanel/common.js +3 -7
  45. package/dist/components/InspectorPanel/inspector-selection.d.ts +2 -2
  46. package/dist/components/InspectorPanel/styles.d.ts +0 -1
  47. package/dist/components/InspectorPanel/styles.js +3 -4
  48. package/dist/components/InspectorPanel/use-track-for-selection.d.ts +1 -2
  49. package/dist/components/InspectorSequenceSection.d.ts +1 -2
  50. package/dist/components/InspectorSourceLocation.js +1 -1
  51. package/dist/components/Menu/MenuItem.js +15 -6
  52. package/dist/components/MenuToolbar.js +7 -3
  53. package/dist/components/Modals.js +51 -1
  54. package/dist/components/PlaybackRateSelector.js +3 -6
  55. package/dist/components/Preview.js +83 -5
  56. package/dist/components/PreviewToolbar.js +10 -4
  57. package/dist/components/PreviewToolbarOverflowButton.d.ts +1 -0
  58. package/dist/components/PreviewToolbarOverflowButton.js +9 -2
  59. package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.d.ts +2 -0
  60. package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +28 -8
  61. package/dist/components/RadioButton.d.ts +6 -0
  62. package/dist/components/RadioButton.js +62 -0
  63. package/dist/components/RenderButton.js +2 -1
  64. package/dist/components/RulersAndGuidesToggle.d.ts +3 -1
  65. package/dist/components/RulersAndGuidesToggle.js +18 -7
  66. package/dist/components/SelectedOutlineKeyboardControls.d.ts +2 -2
  67. package/dist/components/SelectedOutlineOverlay.d.ts +1 -3
  68. package/dist/components/SelectedOutlineOverlay.js +21 -17
  69. package/dist/components/SelectedOutlinePolygon.d.ts +1 -2
  70. package/dist/components/SelectedOutlineRenderer.d.ts +2 -3
  71. package/dist/components/SelectedOutlineRenderer.js +9 -78
  72. package/dist/components/SelectedOutlineUvControls.d.ts +1 -1
  73. package/dist/components/SettingsModal.js +1 -1
  74. package/dist/components/SettingsModalFooter.d.ts +3 -1
  75. package/dist/components/SettingsModalFooter.js +19 -4
  76. package/dist/components/ShowPixelGridProvider.d.ts +4 -0
  77. package/dist/components/ShowPixelGridProvider.js +24 -0
  78. package/dist/components/SidebarCollapserControls.js +2 -2
  79. package/dist/components/SidebarRenderButton.js +2 -1
  80. package/dist/components/Timeline/Timeline.js +41 -0
  81. package/dist/components/Timeline/TimelineClipboardKeybindings.d.ts +6 -7
  82. package/dist/components/Timeline/TimelineDragHandler.js +11 -4
  83. package/dist/components/Timeline/TimelineKeyframeControls.d.ts +1 -2
  84. package/dist/components/Timeline/TimelinePlayCursorSyncer.js +4 -2
  85. package/dist/components/Timeline/TimelineSelection.d.ts +29 -66
  86. package/dist/components/Timeline/TimelineSelection.js +30 -170
  87. package/dist/components/Timeline/TimelineSequenceItem.d.ts +1 -0
  88. package/dist/components/Timeline/TimelineSequenceItem.js +8 -6
  89. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +3 -4
  90. package/dist/components/Timeline/delete-selected-timeline-item.d.ts +3 -4
  91. package/dist/components/Timeline/duplicate-selected-timeline-item.d.ts +3 -4
  92. package/dist/components/Timeline/find-track-for-node-path-info.d.ts +1 -1
  93. package/dist/components/Timeline/keyframe-clipboard.d.ts +2 -3
  94. package/dist/components/Timeline/reset-selected-timeline-props.d.ts +2 -3
  95. package/dist/components/Timeline/sequence-prop-clipboard.d.ts +2 -3
  96. package/dist/components/Timeline/split-selected-timeline-item.d.ts +2 -3
  97. package/dist/components/Timeline/timeline-expanded-filter.d.ts +1 -2
  98. package/dist/components/Timeline/timeline-scroll-logic.d.ts +7 -5
  99. package/dist/components/Timeline/timeline-scroll-logic.js +12 -7
  100. package/dist/components/Timeline/update-selected-easing.d.ts +7 -7
  101. package/dist/components/Timeline/use-timeline-asset-drop.js +24 -1
  102. package/dist/components/Timeline/use-timeline-keyframe-drag.d.ts +6 -7
  103. package/dist/components/WebMcp.d.ts +2 -0
  104. package/dist/components/WebMcp.js +945 -0
  105. package/dist/components/canvas-capture-drop.d.ts +4 -0
  106. package/dist/components/canvas-capture-drop.js +22 -0
  107. package/dist/components/composition-menu-items.js +26 -0
  108. package/dist/components/selected-outline-geometry.d.ts +2 -21
  109. package/dist/components/selected-outline-geometry.js +5 -16
  110. package/dist/components/selected-outline-measurement.d.ts +8 -37
  111. package/dist/components/selected-outline-measurement.js +1 -231
  112. package/dist/components/selected-outline-types.d.ts +2 -15
  113. package/dist/components/selected-outline-uv.js +3 -106
  114. package/dist/esm/{chunk-w4244j4n.js → chunk-7prjt5n5.js} +32831 -26820
  115. package/dist/esm/internals.mjs +32831 -26820
  116. package/dist/esm/previewEntry.mjs +17304 -11293
  117. package/dist/esm/renderEntry.mjs +1 -1
  118. package/dist/helpers/calculate-timeline.d.ts +1 -7
  119. package/dist/helpers/calculate-timeline.js +2 -146
  120. package/dist/helpers/create-folder-tree.js +16 -1
  121. package/dist/helpers/editor-ruler.js +6 -5
  122. package/dist/helpers/format-file-location.d.ts +8 -0
  123. package/dist/helpers/format-file-location.js +14 -3
  124. package/dist/helpers/get-asset-metadata.d.ts +19 -0
  125. package/dist/helpers/get-asset-metadata.js +51 -6
  126. package/dist/helpers/get-connected-compositions.d.ts +1 -6
  127. package/dist/helpers/get-connected-compositions.js +2 -8
  128. package/dist/helpers/get-sequence-visible-range.d.ts +1 -5
  129. package/dist/helpers/get-sequence-visible-range.js +6 -51
  130. package/dist/helpers/get-timeline-max-zoom.d.ts +8 -0
  131. package/dist/helpers/get-timeline-max-zoom.js +17 -6
  132. package/dist/helpers/get-timeline-nestedness.d.ts +1 -2
  133. package/dist/helpers/get-timeline-nestedness.js +2 -12
  134. package/dist/helpers/get-timeline-sequence-sort-key.d.ts +2 -22
  135. package/dist/helpers/get-timeline-sequence-sort-key.js +2 -16
  136. package/dist/helpers/hoverable.d.ts +1 -0
  137. package/dist/helpers/hoverable.js +4 -1
  138. package/dist/helpers/is-current-selected-still.js +4 -2
  139. package/dist/helpers/sort-by-nonce-history.d.ts +1 -5
  140. package/dist/helpers/sort-by-nonce-history.js +3 -148
  141. package/dist/helpers/timeline-node-path-key.d.ts +1 -2
  142. package/dist/helpers/timeline-node-path-key.js +2 -2
  143. package/dist/helpers/use-menu-structure.js +20 -0
  144. package/dist/icons/enter.d.ts +4 -0
  145. package/dist/icons/enter.js +10 -0
  146. package/dist/state/editor-pixel-grid.d.ts +8 -0
  147. package/dist/state/editor-pixel-grid.js +18 -0
  148. package/dist/state/modals.d.ts +4 -0
  149. package/dist/state/playbackrate.d.ts +1 -0
  150. package/dist/state/playbackrate.js +4 -1
  151. package/package.json +14 -12
  152. package/dist/components/selected-outline-order.d.ts +0 -12
  153. package/dist/components/selected-outline-order.js +0 -251
  154. package/dist/helpers/get-box-quads-polyfill-internals.d.ts +0 -82
  155. package/dist/helpers/get-box-quads-polyfill-internals.js +0 -2403
  156. package/dist/helpers/get-box-quads-ponyfill.d.ts +0 -10
  157. package/dist/helpers/get-box-quads-ponyfill.js +0 -23
@@ -1,7 +1,7 @@
1
1
  export { canEditEasingForInterpolationFunction } from '@remotion/studio-shared';
2
2
  import type { CanUpdateSequencePropStatusKeyframed, CanUpdateSequencePropStatusEasing, DragOverrideValue, OverrideIdToNodePaths, PropStatuses, SequencePropsSubscriptionKey, InteractivitySchema, TSequence } from 'remotion';
3
3
  import type { SetPropStatuses } from './save-sequence-prop';
4
- import type { TimelineEasingSelection, TimelineSelection } from './TimelineSelection';
4
+ import type { TimelineEasingSelection } from './TimelineSelection';
5
5
  export type EasingSelection = TimelineEasingSelection;
6
6
  export type TimelineEasingValue = CanUpdateSequencePropStatusEasing;
7
7
  export type SelectedEasingUpdate = {
@@ -27,7 +27,7 @@ export type SelectedEasingUpdate = {
27
27
  export declare const getSelectedEasingUpdate: ({ selection, sequences, overrideIdsToNodePaths, propStatuses, }: {
28
28
  selection: {
29
29
  readonly type: "easing";
30
- readonly nodePathInfo: import("../../helpers/get-timeline-sequence-sort-key").SequenceNodePathInfo;
30
+ readonly nodePathInfo: import("@remotion/canvas").SequenceNodePathInfo;
31
31
  readonly fromFrame: number;
32
32
  readonly toFrame: number;
33
33
  readonly segmentIndex: number;
@@ -37,7 +37,7 @@ export declare const getSelectedEasingUpdate: ({ selection, sequences, overrideI
37
37
  propStatuses: PropStatuses;
38
38
  }) => SelectedEasingUpdate | null;
39
39
  export declare const getSelectedEasingUpdates: ({ selections, sequences, overrideIdsToNodePaths, propStatuses, }: {
40
- readonly selections: readonly TimelineSelection[];
40
+ readonly selections: readonly import("@remotion/canvas").CanvasSelectionItem[];
41
41
  readonly sequences: TSequence[];
42
42
  readonly overrideIdsToNodePaths: OverrideIdToNodePaths;
43
43
  readonly propStatuses: PropStatuses;
@@ -47,9 +47,9 @@ export declare const makeEasingDragOverride: ({ status, segmentIndex, easing, }:
47
47
  readonly segmentIndex: number;
48
48
  readonly easing: CanUpdateSequencePropStatusEasing;
49
49
  }) => DragOverrideValue;
50
- export declare const getEasingSelections: (selections: readonly TimelineSelection[]) => {
50
+ export declare const getEasingSelections: (selections: readonly import("@remotion/canvas").CanvasSelectionItem[]) => {
51
51
  readonly type: "easing";
52
- readonly nodePathInfo: import("../../helpers/get-timeline-sequence-sort-key").SequenceNodePathInfo;
52
+ readonly nodePathInfo: import("@remotion/canvas").SequenceNodePathInfo;
53
53
  readonly fromFrame: number;
54
54
  readonly toFrame: number;
55
55
  readonly segmentIndex: number;
@@ -57,7 +57,7 @@ export declare const getEasingSelections: (selections: readonly TimelineSelectio
57
57
  export declare const getTimelineEasingValueForSelection: ({ selection, sequences, overrideIdsToNodePaths, propStatuses, }: {
58
58
  selection: {
59
59
  readonly type: "easing";
60
- readonly nodePathInfo: import("../../helpers/get-timeline-sequence-sort-key").SequenceNodePathInfo;
60
+ readonly nodePathInfo: import("@remotion/canvas").SequenceNodePathInfo;
61
61
  readonly fromFrame: number;
62
62
  readonly toFrame: number;
63
63
  readonly segmentIndex: number;
@@ -67,7 +67,7 @@ export declare const getTimelineEasingValueForSelection: ({ selection, sequences
67
67
  propStatuses: PropStatuses;
68
68
  }) => CanUpdateSequencePropStatusEasing | null;
69
69
  export declare const updateSelectedTimelineEasings: ({ selections, sequences, overrideIdsToNodePaths, propStatuses, setPropStatuses, clientId, easing, }: {
70
- selections: readonly TimelineSelection[];
70
+ selections: readonly import("@remotion/canvas").CanvasSelectionItem[];
71
71
  sequences: TSequence[];
72
72
  overrideIdsToNodePaths: OverrideIdToNodePaths;
73
73
  propStatuses: PropStatuses;
@@ -6,6 +6,8 @@ const remotion_1 = require("remotion");
6
6
  const client_id_1 = require("../../helpers/client-id");
7
7
  const interactivity_enabled_1 = require("../../helpers/interactivity-enabled");
8
8
  const open_in_editor_1 = require("../../helpers/open-in-editor");
9
+ const modals_1 = require("../../state/modals");
10
+ const canvas_capture_drop_1 = require("../canvas-capture-drop");
9
11
  const drop_handler_data_1 = require("../drop-handler-data");
10
12
  const effect_drag_and_drop_1 = require("../effect-drag-and-drop");
11
13
  const handle_drop_1 = require("../handle-drop");
@@ -30,6 +32,7 @@ const useTimelineAssetDrop = () => {
30
32
  const { canvasContent, compositions } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
31
33
  const videoConfig = remotion_1.Internals.useUnsafeVideoConfig();
32
34
  const chooseSvgImportMode = (0, SvgImportDialog_1.useSvgImportDialog)();
35
+ const { setSelectedModal } = (0, react_1.useContext)(modals_1.SetSelectedModalContext);
33
36
  const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
34
37
  const [isAddingAsset, setIsAddingAsset] = (0, react_1.useState)(false);
35
38
  const [assetDropFrame, setAssetDropFrame] = (0, react_1.useState)(null);
@@ -96,6 +99,25 @@ const useTimelineAssetDrop = () => {
96
99
  !isEventInsideElement(event, timeline)) {
97
100
  return;
98
101
  }
102
+ const localFiles = (0, drop_handler_data_1.isFileDragEvent)(event)
103
+ ? Array.from(dataTransfer.files)
104
+ : null;
105
+ if (localFiles !== null && !window.remotion_isReadOnlyStudio) {
106
+ event.preventDefault();
107
+ event.stopPropagation();
108
+ setIsAddingAsset(true);
109
+ try {
110
+ if (await (0, canvas_capture_drop_1.handleCanvasCaptureDrop)({
111
+ files: localFiles,
112
+ setSelectedModal,
113
+ })) {
114
+ return;
115
+ }
116
+ }
117
+ finally {
118
+ setIsAddingAsset(false);
119
+ }
120
+ }
99
121
  if ((0, effect_drag_and_drop_1.getEffectDragData)(dataTransfer) !== null) {
100
122
  event.preventDefault();
101
123
  return;
@@ -132,7 +154,7 @@ const useTimelineAssetDrop = () => {
132
154
  event,
133
155
  fps: videoConfig.fps,
134
156
  from: frame,
135
- localFiles: null,
157
+ localFiles,
136
158
  preferCompositionStart: false,
137
159
  });
138
160
  }
@@ -146,6 +168,7 @@ const useTimelineAssetDrop = () => {
146
168
  compositionFile,
147
169
  currentCompositionId,
148
170
  getDropFrame,
171
+ setSelectedModal,
149
172
  videoConfig,
150
173
  ]);
151
174
  const clearAssetDropFrame = (0, react_1.useCallback)(() => {
@@ -1,10 +1,9 @@
1
1
  import type React from 'react';
2
2
  import type { SequenceNodePathInfo } from '../../helpers/get-timeline-sequence-sort-key';
3
3
  import { type TimelineDraggedKeyframe } from './TimelineKeyframeDragState';
4
- import { type TimelineSelection, type TimelineSelectionInteraction } from './TimelineSelection';
5
4
  export declare const getKeyframesForTimelineEasingDrag: ({ currentSelections, interaction, selectionItem, selected, }: {
6
- readonly currentSelections: readonly TimelineSelection[];
7
- readonly interaction: TimelineSelectionInteraction;
5
+ readonly currentSelections: readonly import("@remotion/canvas").CanvasSelectionItem[];
6
+ readonly interaction: import("@remotion/canvas").CanvasSelectionInteraction;
8
7
  readonly selectionItem: {
9
8
  readonly type: "easing";
10
9
  readonly nodePathInfo: SequenceNodePathInfo;
@@ -22,18 +21,18 @@ export declare const getKeyframesForTimelineEasingDrag: ({ currentSelections, in
22
21
  })[];
23
22
  export declare const getTimelineSelectionsAfterEasingKeyframeDrag: ({ delta, selections, targets, }: {
24
23
  readonly delta: number;
25
- readonly selections: readonly TimelineSelection[];
24
+ readonly selections: readonly import("@remotion/canvas").CanvasSelectionItem[];
26
25
  readonly targets: readonly TimelineDraggedKeyframe[];
27
- }) => TimelineSelection[];
26
+ }) => import("@remotion/canvas").CanvasSelectionItem[];
28
27
  export declare const useTimelineKeyframeDrag: ({ frame, nodePathInfo, onSelect, selectable, selected, }: {
29
28
  readonly frame: number;
30
29
  readonly nodePathInfo: SequenceNodePathInfo;
31
- readonly onSelect: (interaction?: TimelineSelectionInteraction | undefined) => void;
30
+ readonly onSelect: (interaction?: import("@remotion/canvas").CanvasSelectionInteraction | undefined) => void;
32
31
  readonly selectable: boolean;
33
32
  readonly selected: boolean;
34
33
  }) => (e: React.PointerEvent<HTMLButtonElement>) => void;
35
34
  export declare const useTimelineEasingKeyframeDrag: ({ onSelect, selectable, selected, selectionItem, }: {
36
- readonly onSelect: (interaction?: TimelineSelectionInteraction | undefined) => void;
35
+ readonly onSelect: (interaction?: import("@remotion/canvas").CanvasSelectionInteraction | undefined) => void;
37
36
  readonly selectable: boolean;
38
37
  readonly selected: boolean;
39
38
  readonly selectionItem: {
@@ -0,0 +1,2 @@
1
+ import { type FC } from 'react';
2
+ export declare const WebMcp: FC;