@remotion/studio 4.0.516 → 4.0.517

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 (117) hide show
  1. package/dist/components/AssetSelector.js +1 -1
  2. package/dist/components/Canvas.js +15 -12
  3. package/dist/components/CanvasCaptureDropHandler.d.ts +4 -0
  4. package/dist/components/CanvasCaptureDropHandler.js +42 -0
  5. package/dist/components/CanvasOrLoading.js +4 -3
  6. package/dist/components/CaptionInspector.js +1 -1
  7. package/dist/components/CheckboardToggle.js +1 -1
  8. package/dist/components/Checkbox.d.ts +0 -1
  9. package/dist/components/Checkbox.js +2 -19
  10. package/dist/components/ConfigureLicenseModal.js +79 -46
  11. package/dist/components/CurrentAsset.d.ts +1 -1
  12. package/dist/components/CurrentAsset.js +9 -4
  13. package/dist/components/Editor.js +2 -1
  14. package/dist/components/EditorContent.js +5 -2
  15. package/dist/components/EditorContexts.js +2 -1
  16. package/dist/components/EditorRuler/Ruler.d.ts +1 -0
  17. package/dist/components/EditorRuler/Ruler.js +9 -8
  18. package/dist/components/EditorRuler/index.d.ts +1 -0
  19. package/dist/components/EditorRuler/index.js +3 -4
  20. package/dist/components/EditorRuler/use-is-ruler-visible.d.ts +1 -1
  21. package/dist/components/EditorRuler/use-is-ruler-visible.js +8 -2
  22. package/dist/components/ElementLibraryModal.d.ts +5 -0
  23. package/dist/components/ElementLibraryModal.js +38 -0
  24. package/dist/components/FilePreview.js +71 -0
  25. package/dist/components/InlineEditableTitle.js +2 -2
  26. package/dist/components/InspectorPanel/CompositionInspector.js +11 -38
  27. package/dist/components/InspectorPanel/CompositionInspectorHeader.js +2 -2
  28. package/dist/components/InspectorPanel/CompositionMetadata.js +11 -4
  29. package/dist/components/InspectorPanel/EasingInspector.js +2 -2
  30. package/dist/components/InspectorPanel/ElementLibraryButton.d.ts +2 -0
  31. package/dist/components/InspectorPanel/ElementLibraryButton.js +139 -0
  32. package/dist/components/InspectorPanel/KeyframeInspector.js +1 -1
  33. package/dist/components/InspectorPanel/SequenceInspectorHeader.js +12 -5
  34. package/dist/components/InspectorPanel/SequenceSelectionInspector.js +1 -3
  35. package/dist/components/InspectorPanel/common.d.ts +0 -1
  36. package/dist/components/InspectorPanel/common.js +3 -7
  37. package/dist/components/InspectorPanel/inspector-selection.d.ts +2 -2
  38. package/dist/components/InspectorPanel/styles.d.ts +0 -1
  39. package/dist/components/InspectorPanel/styles.js +3 -4
  40. package/dist/components/InspectorPanel/use-track-for-selection.d.ts +1 -2
  41. package/dist/components/InspectorSequenceSection.d.ts +1 -2
  42. package/dist/components/InspectorSourceLocation.js +1 -1
  43. package/dist/components/Menu/MenuItem.js +15 -6
  44. package/dist/components/MenuToolbar.js +7 -3
  45. package/dist/components/Modals.js +2 -1
  46. package/dist/components/PlaybackRateSelector.js +1 -1
  47. package/dist/components/Preview.js +83 -5
  48. package/dist/components/PreviewToolbar.js +10 -4
  49. package/dist/components/PreviewToolbarOverflowButton.d.ts +1 -0
  50. package/dist/components/PreviewToolbarOverflowButton.js +9 -2
  51. package/dist/components/RadioButton.d.ts +6 -0
  52. package/dist/components/RadioButton.js +62 -0
  53. package/dist/components/RenderButton.js +2 -1
  54. package/dist/components/RulersAndGuidesToggle.d.ts +3 -1
  55. package/dist/components/RulersAndGuidesToggle.js +18 -7
  56. package/dist/components/SelectedOutlinePolygon.d.ts +1 -2
  57. package/dist/components/SelectedOutlineRenderer.d.ts +1 -2
  58. package/dist/components/SelectedOutlineUvControls.d.ts +1 -1
  59. package/dist/components/SettingsModal.js +1 -1
  60. package/dist/components/SettingsModalFooter.d.ts +3 -1
  61. package/dist/components/SettingsModalFooter.js +19 -4
  62. package/dist/components/ShowPixelGridProvider.d.ts +4 -0
  63. package/dist/components/ShowPixelGridProvider.js +24 -0
  64. package/dist/components/SidebarCollapserControls.js +2 -2
  65. package/dist/components/Timeline/Timeline.js +41 -0
  66. package/dist/components/Timeline/TimelineClipboardKeybindings.d.ts +6 -7
  67. package/dist/components/Timeline/TimelineDragHandler.js +11 -4
  68. package/dist/components/Timeline/TimelineKeyframeControls.d.ts +1 -2
  69. package/dist/components/Timeline/TimelinePlayCursorSyncer.js +4 -2
  70. package/dist/components/Timeline/TimelineSelection.d.ts +29 -66
  71. package/dist/components/Timeline/TimelineSelection.js +30 -170
  72. package/dist/components/Timeline/TimelineSequenceItem.d.ts +1 -0
  73. package/dist/components/Timeline/TimelineSequenceItem.js +8 -6
  74. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +3 -4
  75. package/dist/components/Timeline/delete-selected-timeline-item.d.ts +3 -4
  76. package/dist/components/Timeline/duplicate-selected-timeline-item.d.ts +3 -4
  77. package/dist/components/Timeline/find-track-for-node-path-info.d.ts +1 -1
  78. package/dist/components/Timeline/keyframe-clipboard.d.ts +2 -3
  79. package/dist/components/Timeline/reset-selected-timeline-props.d.ts +2 -3
  80. package/dist/components/Timeline/sequence-prop-clipboard.d.ts +2 -3
  81. package/dist/components/Timeline/split-selected-timeline-item.d.ts +2 -3
  82. package/dist/components/Timeline/timeline-expanded-filter.d.ts +1 -2
  83. package/dist/components/Timeline/timeline-scroll-logic.d.ts +7 -5
  84. package/dist/components/Timeline/timeline-scroll-logic.js +12 -7
  85. package/dist/components/Timeline/update-selected-easing.d.ts +7 -7
  86. package/dist/components/Timeline/use-timeline-asset-drop.js +24 -1
  87. package/dist/components/Timeline/use-timeline-keyframe-drag.d.ts +6 -7
  88. package/dist/components/canvas-capture-drop.d.ts +4 -0
  89. package/dist/components/canvas-capture-drop.js +22 -0
  90. package/dist/components/selected-outline-measurement.d.ts +7 -8
  91. package/dist/esm/{chunk-w4244j4n.js → chunk-gzqm3g2m.js} +15184 -8344
  92. package/dist/esm/internals.mjs +15184 -8344
  93. package/dist/esm/previewEntry.mjs +15096 -8256
  94. package/dist/esm/renderEntry.mjs +1 -1
  95. package/dist/helpers/calculate-timeline.d.ts +1 -7
  96. package/dist/helpers/calculate-timeline.js +2 -146
  97. package/dist/helpers/editor-ruler.js +6 -5
  98. package/dist/helpers/get-asset-metadata.d.ts +19 -0
  99. package/dist/helpers/get-asset-metadata.js +51 -6
  100. package/dist/helpers/get-connected-compositions.d.ts +1 -6
  101. package/dist/helpers/get-connected-compositions.js +2 -8
  102. package/dist/helpers/get-sequence-visible-range.d.ts +1 -5
  103. package/dist/helpers/get-sequence-visible-range.js +6 -51
  104. package/dist/helpers/get-timeline-nestedness.d.ts +1 -2
  105. package/dist/helpers/get-timeline-nestedness.js +2 -12
  106. package/dist/helpers/get-timeline-sequence-sort-key.d.ts +2 -22
  107. package/dist/helpers/get-timeline-sequence-sort-key.js +2 -16
  108. package/dist/helpers/is-current-selected-still.js +4 -2
  109. package/dist/helpers/sort-by-nonce-history.d.ts +1 -5
  110. package/dist/helpers/sort-by-nonce-history.js +3 -148
  111. package/dist/helpers/timeline-node-path-key.d.ts +1 -2
  112. package/dist/helpers/timeline-node-path-key.js +2 -2
  113. package/dist/helpers/use-menu-structure.js +20 -0
  114. package/dist/state/editor-pixel-grid.d.ts +8 -0
  115. package/dist/state/editor-pixel-grid.js +18 -0
  116. package/dist/state/modals.d.ts +4 -0
  117. package/package.json +14 -12
@@ -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,4 @@
1
+ export declare const handleCanvasCaptureDrop: ({ files, setSelectedModal, }: {
2
+ readonly files: readonly File[];
3
+ readonly setSelectedModal: import("react").Dispatch<import("react").SetStateAction<import("../state/modals").ModalState | null>>;
4
+ }) => Promise<boolean>;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.handleCanvasCaptureDrop = void 0;
4
+ const get_canvas_capture_import_1 = require("../helpers/get-canvas-capture-import");
5
+ const handleCanvasCaptureDrop = async ({ files, setSelectedModal, }) => {
6
+ if (files.length !== 1) {
7
+ return false;
8
+ }
9
+ const canvasCapture = await (0, get_canvas_capture_import_1.getCanvasCaptureImport)(files[0]);
10
+ if (canvasCapture === null) {
11
+ return false;
12
+ }
13
+ setSelectedModal({
14
+ type: 'new-comp',
15
+ canvasCapture,
16
+ folderName: null,
17
+ parentName: null,
18
+ stack: null,
19
+ });
20
+ return true;
21
+ };
22
+ exports.handleCanvasCaptureDrop = handleCanvasCaptureDrop;
@@ -1,7 +1,6 @@
1
1
  import type { OverrideIdToNodePaths, TSequence } from 'remotion';
2
2
  import type { OutlinePoint, SelectedOutline } from './selected-outline-geometry';
3
3
  import type { SelectedOutlineLayoutTarget, SequenceWithSelectedOutline } from './selected-outline-types';
4
- import { type TimelineSelection, type TimelineSelectionInteraction } from './Timeline/TimelineSelection';
5
4
  export declare const pointToString: (point: OutlinePoint) => string;
6
5
  export declare const midpoint: (from: OutlinePoint, to: OutlinePoint) => OutlinePoint;
7
6
  export declare const getOutlineCenter: (points: readonly [OutlinePoint, OutlinePoint, OutlinePoint, OutlinePoint]) => OutlinePoint;
@@ -47,18 +46,18 @@ export declare const cropOutlinePoints: (points: readonly [OutlinePoint, Outline
47
46
  readonly top: number;
48
47
  readonly bottom: number;
49
48
  }) => readonly [OutlinePoint, OutlinePoint, OutlinePoint, OutlinePoint];
50
- export declare const getSelectedSequenceKeys: (selectedItems: readonly TimelineSelection[]) => Set<string>;
51
- export declare const getSequenceKeysContainingSelection: (selectedItems: readonly TimelineSelection[]) => Set<string>;
49
+ export declare const getSelectedSequenceKeys: (selectedItems: readonly import("@remotion/canvas").CanvasSelectionItem[]) => Set<string>;
50
+ export declare const getSequenceKeysContainingSelection: (selectedItems: readonly import("@remotion/canvas").CanvasSelectionItem[]) => Set<string>;
52
51
  export declare const getOutlineSelectionInteraction: ({ shiftKey, metaKey, ctrlKey, }: {
53
52
  readonly shiftKey: boolean;
54
53
  readonly metaKey: boolean;
55
54
  readonly ctrlKey: boolean;
56
- }) => TimelineSelectionInteraction;
55
+ }) => import("@remotion/canvas").CanvasSelectionInteraction;
57
56
  type SelectedEffectFields = {
58
57
  allFields: boolean;
59
58
  fieldKeys: Set<string>;
60
59
  };
61
- export declare const getSelectedEffectFieldsBySequenceKey: (selectedItems: readonly TimelineSelection[]) => Map<string, Map<number, SelectedEffectFields>>;
60
+ export declare const getSelectedEffectFieldsBySequenceKey: (selectedItems: readonly import("@remotion/canvas").CanvasSelectionItem[]) => Map<string, Map<number, SelectedEffectFields>>;
62
61
  type SelectedTransformOriginInfo = {
63
62
  readonly sequenceKey: string;
64
63
  readonly displayFrame: number | null;
@@ -71,9 +70,9 @@ export type SelectedCropInfo = {
71
70
  readonly sequenceKey: string;
72
71
  readonly displayFrame: number | null;
73
72
  };
74
- export declare const getSelectedCropInfo: (selectedItems: readonly TimelineSelection[]) => SelectedCropInfo | null;
75
- export declare const getSelectedTransformOriginInfo: (selectedItems: readonly TimelineSelection[]) => SelectedTransformOriginInfo | null;
76
- export declare const getSelectedRotationInfo: (selectedItems: readonly TimelineSelection[]) => SelectedRotationInfo | null;
73
+ export declare const getSelectedCropInfo: (selectedItems: readonly import("@remotion/canvas").CanvasSelectionItem[]) => SelectedCropInfo | null;
74
+ export declare const getSelectedTransformOriginInfo: (selectedItems: readonly import("@remotion/canvas").CanvasSelectionItem[]) => SelectedTransformOriginInfo | null;
75
+ export declare const getSelectedRotationInfo: (selectedItems: readonly import("@remotion/canvas").CanvasSelectionItem[]) => SelectedRotationInfo | null;
77
76
  export declare const getSequencesWithSelectableOutlines: ({ sequences, overrideIdsToNodePaths, compositions, timelinePosition, }: {
78
77
  readonly sequences: readonly TSequence[];
79
78
  readonly overrideIdsToNodePaths: OverrideIdToNodePaths;