@remotion/studio 4.0.493 → 4.0.495

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 (111) hide show
  1. package/dist/api/get-static-files.d.ts +1 -1
  2. package/dist/components/AssetFileIcon.d.ts +7 -0
  3. package/dist/components/AssetFileIcon.js +24 -0
  4. package/dist/components/AssetSelectorItem.js +13 -7
  5. package/dist/components/Canvas.js +194 -36
  6. package/dist/components/CompositionSelectorItem.js +15 -8
  7. package/dist/components/CurrentAsset.d.ts +1 -0
  8. package/dist/components/CurrentAsset.js +17 -1
  9. package/dist/components/Editor.js +2 -4
  10. package/dist/components/InitialCompositionLoader.d.ts +1 -1
  11. package/dist/components/InitialCompositionLoader.js +6 -1
  12. package/dist/components/InspectorPanel/AssetInspector.d.ts +4 -0
  13. package/dist/components/InspectorPanel/AssetInspector.js +11 -0
  14. package/dist/components/InspectorPanel/{DefaultInspector.d.ts → CompositionInspector.d.ts} +2 -2
  15. package/dist/components/InspectorPanel/CompositionInspector.js +114 -0
  16. package/dist/components/InspectorPanel/CompositionInspectorHeader.d.ts +1 -0
  17. package/dist/components/{CurrentComposition.js → InspectorPanel/CompositionInspectorHeader.js} +16 -16
  18. package/dist/components/InspectorPanel/{CompositionDimensions.d.ts → CompositionMetadata.d.ts} +1 -1
  19. package/dist/components/InspectorPanel/{CompositionDimensions.js → CompositionMetadata.js} +17 -8
  20. package/dist/components/InspectorPanel/ConnectedCompositionsSection.js +2 -2
  21. package/dist/components/InspectorPanel/EasingInspector.js +3 -5
  22. package/dist/components/InspectorPanel/KeyframeInspector.js +2 -2
  23. package/dist/components/InspectorPanel/SequenceSelectionInspector.js +34 -1
  24. package/dist/components/InspectorPanel/common.d.ts +8 -0
  25. package/dist/components/InspectorPanel/common.js +31 -8
  26. package/dist/components/InspectorPanel/styles.d.ts +5 -3
  27. package/dist/components/InspectorPanel/styles.js +13 -4
  28. package/dist/components/InspectorPanel/use-composition-actions.d.ts +8 -0
  29. package/dist/components/InspectorPanel/use-composition-actions.js +114 -0
  30. package/dist/components/InspectorPanel.js +11 -2
  31. package/dist/components/InspectorSequenceSection.d.ts +0 -1
  32. package/dist/components/InspectorSequenceSection.js +9 -48
  33. package/dist/components/Modals.js +2 -1
  34. package/dist/components/NewComposition/InputDragger.d.ts +6 -0
  35. package/dist/components/NewComposition/InputDragger.js +26 -13
  36. package/dist/components/NewComposition/NewComposition.js +8 -1
  37. package/dist/components/NewComposition/ValidationMessage.d.ts +1 -1
  38. package/dist/components/Preview.js +15 -7
  39. package/dist/components/RenderModal/RenderModalOutputName.js +34 -1
  40. package/dist/components/SelectedOutlineOverlay.js +1 -0
  41. package/dist/components/SvgImportDialog.d.ts +7 -0
  42. package/dist/components/SvgImportDialog.js +103 -0
  43. package/dist/components/Timeline/Timeline.js +2 -0
  44. package/dist/components/Timeline/TimelineClipboardKeybindings.js +11 -1
  45. package/dist/components/Timeline/TimelineDeleteKeybindings.js +2 -0
  46. package/dist/components/Timeline/TimelineKeyframeControls.js +1 -0
  47. package/dist/components/Timeline/TimelineList.js +9 -4
  48. package/dist/components/Timeline/TimelineSequence.d.ts +1 -0
  49. package/dist/components/Timeline/TimelineSequence.js +42 -6
  50. package/dist/components/Timeline/TimelineSequenceItem.d.ts +2 -1
  51. package/dist/components/Timeline/TimelineSequenceItem.js +33 -13
  52. package/dist/components/Timeline/TimelineTrack.js +2 -1
  53. package/dist/components/Timeline/call-delete-keyframe.d.ts +1 -0
  54. package/dist/components/Timeline/call-delete-keyframe.js +4 -0
  55. package/dist/components/Timeline/delete-selected-keyframe.d.ts +4 -2
  56. package/dist/components/Timeline/delete-selected-keyframe.js +48 -5
  57. package/dist/components/Timeline/delete-selected-timeline-item.d.ts +3 -1
  58. package/dist/components/Timeline/delete-selected-timeline-item.js +3 -1
  59. package/dist/components/Timeline/nest-timeline-tracks.d.ts +8 -0
  60. package/dist/components/Timeline/nest-timeline-tracks.js +25 -0
  61. package/dist/components/Timeline/timeline-scroll-logic.d.ts +8 -4
  62. package/dist/components/Timeline/timeline-scroll-logic.js +29 -15
  63. package/dist/components/import-assets.d.ts +41 -3
  64. package/dist/components/import-assets.js +148 -24
  65. package/dist/components/layout.d.ts +1 -0
  66. package/dist/components/layout.js +2 -1
  67. package/dist/components/selected-outline-measurement.d.ts +2 -1
  68. package/dist/components/selected-outline-measurement.js +3 -1
  69. package/dist/esm/{chunk-mndqr3zx.js → chunk-784jbkzs.js} +8604 -7249
  70. package/dist/esm/internals.mjs +8604 -7249
  71. package/dist/esm/previewEntry.mjs +8704 -7349
  72. package/dist/esm/renderEntry.mjs +1 -1
  73. package/dist/helpers/client-id.js +2 -1
  74. package/dist/helpers/clipboard-figma.d.ts +4 -0
  75. package/dist/helpers/clipboard-figma.js +41 -0
  76. package/dist/helpers/clipboard-images.d.ts +10 -0
  77. package/dist/helpers/clipboard-images.js +77 -0
  78. package/dist/helpers/clipboard-svg.d.ts +3 -0
  79. package/dist/helpers/clipboard-svg.js +47 -0
  80. package/dist/helpers/get-effective-translation.d.ts +2 -1
  81. package/dist/helpers/get-effective-translation.js +15 -7
  82. package/dist/helpers/get-preview-file-type.d.ts +1 -1
  83. package/dist/helpers/get-preview-file-type.js +5 -1
  84. package/dist/helpers/get-sequence-double-click-action.d.ts +6 -0
  85. package/dist/helpers/get-sequence-double-click-action.js +10 -1
  86. package/dist/helpers/inject-css.js +9 -2
  87. package/dist/helpers/studio-fit-padding.d.ts +41 -0
  88. package/dist/helpers/studio-fit-padding.js +64 -0
  89. package/dist/helpers/use-image-metadata.d.ts +8 -0
  90. package/dist/helpers/use-image-metadata.js +82 -0
  91. package/dist/helpers/use-studio-canvas-dimensions.js +2 -2
  92. package/dist/icons/audio.d.ts +3 -0
  93. package/dist/icons/audio.js +3 -1
  94. package/dist/icons/font.d.ts +4 -0
  95. package/dist/icons/font.js +8 -0
  96. package/dist/icons/frame.d.ts +3 -1
  97. package/dist/icons/frame.js +1 -1
  98. package/dist/icons/json.d.ts +4 -0
  99. package/dist/icons/json.js +8 -0
  100. package/dist/icons/magnet.js +1 -1
  101. package/dist/icons/scissors.d.ts +5 -0
  102. package/dist/icons/scissors.js +8 -0
  103. package/dist/icons/solid.d.ts +5 -0
  104. package/dist/icons/solid.js +8 -0
  105. package/dist/icons/video.d.ts +3 -0
  106. package/dist/icons/video.js +5 -1
  107. package/dist/state/modals.d.ts +8 -1
  108. package/dist/state/timeline-zoom.js +12 -11
  109. package/package.json +11 -11
  110. package/dist/components/CurrentComposition.d.ts +0 -2
  111. package/dist/components/InspectorPanel/DefaultInspector.js +0 -97
@@ -1,11 +1,24 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.deleteSelectedKeyframes = exports.deleteSelectedKeyframe = void 0;
4
+ const remotion_1 = require("remotion");
4
5
  const call_delete_keyframe_1 = require("./call-delete-keyframe");
5
6
  const find_track_for_node_path_info_1 = require("./find-track-for-node-path-info");
6
7
  const parse_keyframe_field_from_node_path_1 = require("./parse-keyframe-field-from-node-path");
7
- const getSelectedKeyframeDeletion = ({ nodePathInfo, frame, sequences, overrideIdsToNodePaths, }) => {
8
- var _a, _b;
8
+ const getValueWhenLastKeyframeDeleted = ({ propStatus, playheadSourceFrame, }) => {
9
+ var _a;
10
+ if ((propStatus === null || propStatus === void 0 ? void 0 : propStatus.status) !== 'keyframed' || playheadSourceFrame === null) {
11
+ return null;
12
+ }
13
+ return ((_a = remotion_1.Internals.interpolateKeyframedStatus({
14
+ forceSpringAllowTail: null,
15
+ frame: playheadSourceFrame,
16
+ status: propStatus,
17
+ })) !== null && _a !== void 0 ? _a : null);
18
+ };
19
+ const getSelectedKeyframeDeletion = ({ nodePathInfo, frame, sequences, overrideIdsToNodePaths, propStatuses, timelinePosition, }) => {
20
+ var _a;
21
+ var _b, _c, _d;
9
22
  const field = (0, parse_keyframe_field_from_node_path_1.parseKeyframeFieldFromNodePath)(nodePathInfo.auxiliaryKeys);
10
23
  if (field === null) {
11
24
  return null;
@@ -15,11 +28,14 @@ const getSelectedKeyframeDeletion = ({ nodePathInfo, frame, sequences, overrideI
15
28
  overrideIdsToNodePaths,
16
29
  nodePathInfo,
17
30
  });
18
- const sequence = (_a = track === null || track === void 0 ? void 0 : track.sequence) !== null && _a !== void 0 ? _a : null;
31
+ const sequence = (_b = track === null || track === void 0 ? void 0 : track.sequence) !== null && _b !== void 0 ? _b : null;
19
32
  if (!(sequence === null || sequence === void 0 ? void 0 : sequence.controls)) {
20
33
  return null;
21
34
  }
22
- const sourceFrame = frame - ((_b = track === null || track === void 0 ? void 0 : track.keyframeDisplayOffset) !== null && _b !== void 0 ? _b : 0);
35
+ const sourceFrame = frame - ((_c = track === null || track === void 0 ? void 0 : track.keyframeDisplayOffset) !== null && _c !== void 0 ? _c : 0);
36
+ const playheadSourceFrame = timelinePosition === null
37
+ ? null
38
+ : timelinePosition - ((_d = track === null || track === void 0 ? void 0 : track.keyframeDisplayOffset) !== null && _d !== void 0 ? _d : 0);
23
39
  const nodePath = nodePathInfo.sequenceSubscriptionKey;
24
40
  const fileName = nodePath.absolutePath;
25
41
  if (field.type === 'effect') {
@@ -27,6 +43,20 @@ const getSelectedKeyframeDeletion = ({ nodePathInfo, frame, sequences, overrideI
27
43
  if (!effect) {
28
44
  return null;
29
45
  }
46
+ const effectStatus = propStatuses !== null
47
+ ? remotion_1.Internals.getEffectPropStatusesCtx({
48
+ propStatuses,
49
+ nodePath,
50
+ effectIndex: field.effectIndex,
51
+ })
52
+ : null;
53
+ const effectPropStatus = (effectStatus === null || effectStatus === void 0 ? void 0 : effectStatus.type) === 'can-update-effect'
54
+ ? effectStatus.props[field.fieldKey]
55
+ : null;
56
+ const effectValueWhenLastKeyframeDeleted = getValueWhenLastKeyframeDeleted({
57
+ propStatus: effectPropStatus,
58
+ playheadSourceFrame,
59
+ });
30
60
  return {
31
61
  type: 'effect',
32
62
  fileName,
@@ -35,8 +65,16 @@ const getSelectedKeyframeDeletion = ({ nodePathInfo, frame, sequences, overrideI
35
65
  fieldKey: field.fieldKey,
36
66
  sourceFrame,
37
67
  schema: effect.schema,
68
+ valueWhenLastKeyframeDeleted: effectValueWhenLastKeyframeDeleted,
38
69
  };
39
70
  }
71
+ const sequencePropStatus = propStatuses !== null
72
+ ? (_a = remotion_1.Internals.getPropStatusesCtx(propStatuses, nodePath)) === null || _a === void 0 ? void 0 : _a[field.fieldKey]
73
+ : null;
74
+ const sequenceValueWhenLastKeyframeDeleted = getValueWhenLastKeyframeDeleted({
75
+ propStatus: sequencePropStatus,
76
+ playheadSourceFrame,
77
+ });
40
78
  return {
41
79
  type: 'sequence',
42
80
  fileName,
@@ -44,6 +82,7 @@ const getSelectedKeyframeDeletion = ({ nodePathInfo, frame, sequences, overrideI
44
82
  fieldKey: field.fieldKey,
45
83
  sourceFrame,
46
84
  schema: sequence.controls.schema,
85
+ valueWhenLastKeyframeDeleted: sequenceValueWhenLastKeyframeDeleted,
47
86
  };
48
87
  };
49
88
  const deleteSelectedKeyframe = ({ nodePathInfo, frame, sequences, overrideIdsToNodePaths, setPropStatuses, clientId, }) => {
@@ -52,6 +91,8 @@ const deleteSelectedKeyframe = ({ nodePathInfo, frame, sequences, overrideIdsToN
52
91
  frame,
53
92
  sequences,
54
93
  overrideIdsToNodePaths,
94
+ propStatuses: null,
95
+ timelinePosition: null,
55
96
  });
56
97
  if (deletion === null) {
57
98
  return null;
@@ -70,13 +111,15 @@ const deleteSelectedKeyframe = ({ nodePathInfo, frame, sequences, overrideIdsToN
70
111
  });
71
112
  };
72
113
  exports.deleteSelectedKeyframe = deleteSelectedKeyframe;
73
- const deleteSelectedKeyframes = ({ keyframes, sequences, overrideIdsToNodePaths, setPropStatuses, clientId, }) => {
114
+ const deleteSelectedKeyframes = ({ keyframes, sequences, overrideIdsToNodePaths, setPropStatuses, clientId, propStatuses, timelinePosition, }) => {
74
115
  const deletions = keyframes
75
116
  .map((keyframe) => getSelectedKeyframeDeletion({
76
117
  nodePathInfo: keyframe.nodePathInfo,
77
118
  frame: keyframe.frame,
78
119
  sequences,
79
120
  overrideIdsToNodePaths,
121
+ propStatuses,
122
+ timelinePosition,
80
123
  }))
81
124
  .filter((deletion) => deletion !== null);
82
125
  if (deletions.length === 0) {
@@ -17,11 +17,13 @@ export declare const getTimelineSelectionAfterDeletingItems: ({ selections, sequ
17
17
  readonly propStatuses?: PropStatuses | undefined;
18
18
  readonly timelinePosition?: number | undefined;
19
19
  }) => readonly TimelineSelection[];
20
- export declare const deleteSelectedTimelineItems: ({ selections, sequences, overrideIdsToNodePaths, setPropStatuses, clientId, confirm, }: {
20
+ export declare const deleteSelectedTimelineItems: ({ selections, sequences, overrideIdsToNodePaths, setPropStatuses, clientId, confirm, propStatuses, timelinePosition, }: {
21
21
  selections: readonly TimelineSelection[];
22
22
  sequences: TSequence[];
23
23
  overrideIdsToNodePaths: OverrideIdToNodePaths;
24
24
  setPropStatuses: SetPropStatuses;
25
25
  clientId: string;
26
26
  confirm: ConfirmationDialogFunction;
27
+ propStatuses: PropStatuses;
28
+ timelinePosition: number;
27
29
  }) => Promise<boolean> | null;
@@ -253,7 +253,7 @@ const assertTimelineSelectionsHaveSameType = (selections) => {
253
253
  }
254
254
  };
255
255
  const containsOnlyKeyframesAndEasings = (selections) => selections.every((selection) => selection.type === 'keyframe' || selection.type === 'easing');
256
- const deleteSelectedTimelineItems = ({ selections, sequences, overrideIdsToNodePaths, setPropStatuses, clientId, confirm, }) => {
256
+ const deleteSelectedTimelineItems = ({ selections, sequences, overrideIdsToNodePaths, setPropStatuses, clientId, confirm, propStatuses, timelinePosition, }) => {
257
257
  var _a;
258
258
  const firstSelection = selections[0];
259
259
  if (!firstSelection) {
@@ -273,6 +273,8 @@ const deleteSelectedTimelineItems = ({ selections, sequences, overrideIdsToNodeP
273
273
  overrideIdsToNodePaths,
274
274
  setPropStatuses,
275
275
  clientId,
276
+ propStatuses,
277
+ timelinePosition,
276
278
  });
277
279
  return (_a = promise === null || promise === void 0 ? void 0 : promise.then(() => true)) !== null && _a !== void 0 ? _a : null;
278
280
  }
@@ -0,0 +1,8 @@
1
+ export type NestedTimelineTrack<T> = {
2
+ readonly track: T;
3
+ readonly siblingIndex: number;
4
+ readonly children: NestedTimelineTrack<T>[];
5
+ };
6
+ export declare const nestTimelineTracks: <T extends {
7
+ readonly depth: number;
8
+ }>(timeline: readonly T[]) => NestedTimelineTrack<T>[];
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.nestTimelineTracks = void 0;
4
+ const nestTimelineTracks = (timeline) => {
5
+ const roots = [];
6
+ const stack = [];
7
+ for (let trackIndex = 0; trackIndex < timeline.length; trackIndex++) {
8
+ const track = timeline[trackIndex];
9
+ while (stack.length > 0 &&
10
+ stack[stack.length - 1].track.depth >= track.depth) {
11
+ stack.pop();
12
+ }
13
+ const parent = stack[stack.length - 1];
14
+ const siblings = parent ? parent.children : roots;
15
+ const nestedTrack = {
16
+ track,
17
+ siblingIndex: siblings.length,
18
+ children: [],
19
+ };
20
+ siblings.push(nestedTrack);
21
+ stack.push(nestedTrack);
22
+ }
23
+ return roots;
24
+ };
25
+ exports.nestTimelineTracks = nestTimelineTracks;
@@ -44,12 +44,16 @@ export declare const viewportClientXToScrollContentX: ({ clientX, scrollEl, }: {
44
44
  clientX: number;
45
45
  scrollEl: HTMLDivElement;
46
46
  }) => number;
47
- export declare const zoomAndPreserveCursor: ({ oldZoom, newZoom, currentFrame, currentDurationInFrames, anchorFrame, anchorContentX, }: {
48
- oldZoom: number;
49
- newZoom: number;
47
+ export declare const getScrollLeftToKeepCursorInPlace: ({ anchorContentX, oldScrollLeft, oldTimelineWidth, newTimelineWidth, }: {
48
+ anchorContentX: number;
49
+ oldScrollLeft: number;
50
+ oldTimelineWidth: number;
51
+ newTimelineWidth: number;
52
+ }) => number;
53
+ export declare const prepareToPreserveTimelineCursor: ({ currentFrame, currentDurationInFrames, anchorFrame, anchorContentX, }: {
50
54
  currentFrame: number;
51
55
  currentDurationInFrames: number;
52
56
  anchorFrame: number | null;
53
57
  /** Prefer this over `anchorFrame` when not null (subpixel-accurate anchor). */
54
58
  anchorContentX: number | null;
55
- }) => void;
59
+ }) => () => void;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.zoomAndPreserveCursor = exports.viewportClientXToScrollContentX = exports.getFrameFromX = exports.getFrameWhileScrollingRight = exports.getFrameIncrementFromWidth = exports.getScrollPositionForCursorOnRightEdge = exports.getScrollPositionForCursorOnLeftEdge = exports.scrollToTimelineXOffset = exports.ensureFrameIsInViewport = exports.isCursorInViewport = exports.getFrameWhileScrollingLeft = exports.canScrollTimelineIntoDirection = void 0;
3
+ exports.prepareToPreserveTimelineCursor = exports.getScrollLeftToKeepCursorInPlace = exports.viewportClientXToScrollContentX = exports.getFrameFromX = exports.getFrameWhileScrollingRight = exports.getFrameIncrementFromWidth = exports.getScrollPositionForCursorOnRightEdge = exports.getScrollPositionForCursorOnLeftEdge = exports.scrollToTimelineXOffset = exports.ensureFrameIsInViewport = exports.isCursorInViewport = exports.getFrameWhileScrollingLeft = exports.canScrollTimelineIntoDirection = void 0;
4
4
  const remotion_1 = require("remotion");
5
5
  const timeline_layout_1 = require("../../helpers/timeline-layout");
6
6
  const timeline_refs_1 = require("./timeline-refs");
@@ -214,24 +214,38 @@ const viewportClientXToScrollContentX = ({ clientX, scrollEl, }) => {
214
214
  return clampedClientX + scrollEl.scrollLeft - rect.left;
215
215
  };
216
216
  exports.viewportClientXToScrollContentX = viewportClientXToScrollContentX;
217
- const zoomAndPreserveCursor = ({ oldZoom, newZoom, currentFrame, currentDurationInFrames, anchorFrame, anchorContentX, }) => {
218
- const ratio = newZoom / oldZoom;
219
- if (ratio === 1) {
220
- return;
221
- }
217
+ const getScrollLeftToKeepCursorInPlace = ({ anchorContentX, oldScrollLeft, oldTimelineWidth, newTimelineWidth, }) => {
218
+ const oldUsableWidth = getUsableTimelineWidth(oldTimelineWidth);
219
+ const newUsableWidth = getUsableTimelineWidth(newTimelineWidth);
220
+ const clampedAnchorContentX = Math.min(Math.max(anchorContentX, timeline_layout_1.TIMELINE_PADDING), timeline_layout_1.TIMELINE_PADDING + oldUsableWidth);
221
+ const cursorX = clampedAnchorContentX - oldScrollLeft;
222
+ const anchorInUsableWidth = clampedAnchorContentX - timeline_layout_1.TIMELINE_PADDING;
223
+ const newAnchorContentX = timeline_layout_1.TIMELINE_PADDING + (anchorInUsableWidth / oldUsableWidth) * newUsableWidth;
224
+ return newAnchorContentX - cursorX;
225
+ };
226
+ exports.getScrollLeftToKeepCursorInPlace = getScrollLeftToKeepCursorInPlace;
227
+ const prepareToPreserveTimelineCursor = ({ currentFrame, currentDurationInFrames, anchorFrame, anchorContentX, }) => {
222
228
  const { current } = timeline_refs_1.scrollableRef;
223
229
  if (!current) {
224
- return;
230
+ return () => undefined;
225
231
  }
226
- const frameIncrement = getFrameIncrement(currentDurationInFrames);
232
+ const oldTimelineWidth = current.scrollWidth;
233
+ const oldScrollLeft = current.scrollLeft;
234
+ const frameIncrement = (0, exports.getFrameIncrementFromWidth)(currentDurationInFrames, oldTimelineWidth);
227
235
  const frameForScroll = anchorFrame !== null && anchorFrame !== void 0 ? anchorFrame : currentFrame;
228
236
  const prevCursorPosition = anchorContentX !== null
229
- ? Math.min(Math.max(anchorContentX, 0), current.scrollWidth)
237
+ ? anchorContentX
230
238
  : frameIncrement * frameForScroll + timeline_layout_1.TIMELINE_PADDING;
231
- const newCursorPosition = ratio * (prevCursorPosition - timeline_layout_1.TIMELINE_PADDING) + timeline_layout_1.TIMELINE_PADDING;
232
- current.scrollLeft += newCursorPosition - prevCursorPosition;
233
- // Playhead position is synced in `TimelineSlider` `useLayoutEffect` using
234
- // measured `sliderAreaRef.clientWidth` so it matches layout after zoom
235
- // (avoids fighting React `style` with stale `timelineWidth` during pinch).
239
+ return () => {
240
+ if (timeline_refs_1.scrollableRef.current !== current) {
241
+ return;
242
+ }
243
+ current.scrollLeft = (0, exports.getScrollLeftToKeepCursorInPlace)({
244
+ anchorContentX: prevCursorPosition,
245
+ oldScrollLeft,
246
+ oldTimelineWidth,
247
+ newTimelineWidth: current.scrollWidth,
248
+ });
249
+ };
236
250
  };
237
- exports.zoomAndPreserveCursor = zoomAndPreserveCursor;
251
+ exports.prepareToPreserveTimelineCursor = prepareToPreserveTimelineCursor;
@@ -29,6 +29,21 @@ export declare const getAssetElementFromPath: (assetPath: string) => {
29
29
  } | null;
30
30
  position: InsertableCompositionElementPosition | null;
31
31
  } | null;
32
+ export declare const getAssetElementForDroppedFile: ({ fileType, src, }: {
33
+ fileType: FileType;
34
+ src: string;
35
+ }) => {
36
+ type: "asset";
37
+ assetType: "animated-image" | "audio" | "gif" | "image" | "video";
38
+ src: string;
39
+ srcType: "remote" | "static";
40
+ dimensions: {
41
+ width: number;
42
+ height: number;
43
+ } | null;
44
+ position: InsertableCompositionElementPosition | null;
45
+ } | null;
46
+ export declare const hasSvgFile: (files: File[]) => boolean;
32
47
  export declare const getElementPositionForDrop: ({ dimensions, dropPosition, }: {
33
48
  dimensions: Dimensions | null;
34
49
  dropPosition: InsertElementDropPosition | null;
@@ -38,6 +53,11 @@ export declare const getCompositionPositionForDrop: ({ compositionDimensions, de
38
53
  destinationDimensions: Dimensions | null;
39
54
  dropPosition: InsertElementDropPosition | null;
40
55
  }) => InsertableCompositionElementPosition | null;
56
+ export declare const getAssetPositionForDrop: ({ assetDimensions, destinationDimensions, dropPosition, }: {
57
+ assetDimensions: Dimensions | null;
58
+ destinationDimensions: Dimensions | null;
59
+ dropPosition: InsertElementDropPosition | null;
60
+ }) => InsertableCompositionElementPosition | null;
41
61
  export declare const getComponentDimensions: (component: {
42
62
  componentName: string;
43
63
  dimensions?: import("@remotion/studio-shared").ComponentDimensions | undefined;
@@ -48,15 +68,32 @@ export declare const getComponentDimensions: (component: {
48
68
  export declare const pickFilesToImport: ({ multiple, }?: {
49
69
  readonly multiple?: boolean | undefined;
50
70
  }) => Promise<File[]>;
51
- export declare const importAssets: ({ compositionFile, compositionId, dropPosition, files, }: {
71
+ export declare const importAssets: ({ compositionFile, compositionId, destinationDimensions, dropPosition, files, svgImportMode, }: {
52
72
  compositionFile: string;
53
73
  compositionId: string;
74
+ destinationDimensions: Dimensions | null;
54
75
  dropPosition: InsertElementDropPosition | null;
55
76
  files: File[];
77
+ svgImportMode: "image" | "inline";
78
+ }) => Promise<void>;
79
+ export declare const importFigmaClipboard: ({ compositionFile, compositionId, destinationDimensions, dropPosition, html, }: {
80
+ compositionFile: string;
81
+ compositionId: string;
82
+ destinationDimensions: Dimensions | null;
83
+ dropPosition: InsertElementDropPosition | null;
84
+ html: string;
56
85
  }) => Promise<void>;
57
- export declare const importRemoteAsset: ({ compositionFile, compositionId, dropPosition, url, }: {
86
+ export declare const insertSvgMarkup: ({ compositionFile, compositionId, destinationDimensions, dropPosition, markup, }: {
58
87
  compositionFile: string;
59
88
  compositionId: string;
89
+ destinationDimensions: Dimensions | null;
90
+ dropPosition: InsertElementDropPosition | null;
91
+ markup: string;
92
+ }) => Promise<void>;
93
+ export declare const importRemoteAsset: ({ compositionFile, compositionId, destinationDimensions, dropPosition, url, }: {
94
+ compositionFile: string;
95
+ compositionId: string;
96
+ destinationDimensions: Dimensions | null;
60
97
  dropPosition: InsertElementDropPosition | null;
61
98
  url: string;
62
99
  }) => Promise<void>;
@@ -65,10 +102,11 @@ export declare const insertRemoteAudio: ({ compositionFile, compositionId, url,
65
102
  compositionId: string;
66
103
  url: string;
67
104
  }) => Promise<void>;
68
- export declare const insertExistingAssets: ({ assetPaths, compositionFile, compositionId, dropPosition, }: {
105
+ export declare const insertExistingAssets: ({ assetPaths, compositionFile, compositionId, destinationDimensions, dropPosition, }: {
69
106
  assetPaths: string[];
70
107
  compositionFile: string;
71
108
  compositionId: string;
109
+ destinationDimensions: Dimensions | null;
72
110
  dropPosition: InsertElementDropPosition | null;
73
111
  }) => Promise<void>;
74
112
  export declare const insertComponent: ({ component, compositionFile, compositionId, dropPosition, }: {