@remotion/studio 4.0.518 → 4.0.520

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 (196) hide show
  1. package/dist/api/visual-control.js +2 -2
  2. package/dist/components/AppLaunchButton.d.ts +16 -0
  3. package/dist/components/AppLaunchButton.js +90 -0
  4. package/dist/components/AssetSelector.js +7 -6
  5. package/dist/components/AssetSelectorItem.d.ts +12 -0
  6. package/dist/components/AssetSelectorItem.js +180 -62
  7. package/dist/components/AudioWaveform.js +6 -1
  8. package/dist/components/Button.js +20 -7
  9. package/dist/components/Canvas.js +117 -92
  10. package/dist/components/CanvasOrLoading.js +7 -7
  11. package/dist/components/CodingAgentButton.d.ts +7 -0
  12. package/dist/components/CodingAgentButton.js +59 -0
  13. package/dist/components/CompositionContextButton.d.ts +1 -0
  14. package/dist/components/CompositionContextButton.js +6 -3
  15. package/dist/components/CompositionSelector.js +21 -20
  16. package/dist/components/CompositionSelectorItem.js +23 -35
  17. package/dist/components/ConfigureLicenseModal.js +4 -48
  18. package/dist/components/CurrentAsset.js +1 -1
  19. package/dist/components/CurrentCompositionSideEffects.js +5 -0
  20. package/dist/components/ElementInstallConfirmation.d.ts +2 -10
  21. package/dist/components/ElementInstallConfirmation.js +339 -32
  22. package/dist/components/FixComputedValueModal.js +5 -131
  23. package/dist/components/FpsCounter.js +1 -1
  24. package/dist/components/FramePersistor.js +1 -1
  25. package/dist/components/InitialCompositionLoader.js +3 -2
  26. package/dist/components/InspectorOpenInEditor.js +48 -33
  27. package/dist/components/InspectorPanel/CompositionInspector.js +35 -3
  28. package/dist/components/InspectorPanel/CompositionInspectorHeader.js +22 -14
  29. package/dist/components/InspectorPanel/ConnectedCompositionsSection.js +3 -1
  30. package/dist/components/InspectorPanel/SequenceInspectorHeader.d.ts +1 -1
  31. package/dist/components/InspectorPanel/SequenceInspectorHeader.js +10 -5
  32. package/dist/components/InspectorPanel/SequenceSelectionInspector.js +5 -4
  33. package/dist/components/InspectorPanel/common.js +1 -0
  34. package/dist/components/InspectorPanel/styles.js +1 -0
  35. package/dist/components/InspectorPanel/use-composition-actions.js +5 -8
  36. package/dist/components/InspectorSequenceSection.js +8 -3
  37. package/dist/components/InspectorSourceLocation.js +5 -1
  38. package/dist/components/KnownBugs.d.ts +1 -1
  39. package/dist/components/KnownBugs.js +1 -1
  40. package/dist/components/LicenseExplanation.d.ts +2 -0
  41. package/dist/components/LicenseExplanation.js +63 -0
  42. package/dist/components/MenuToolbar.js +7 -1
  43. package/dist/components/Modals.js +1 -2
  44. package/dist/components/NewComposition/InputDragger.js +29 -2
  45. package/dist/components/NewComposition/NewCompDuration.js +1 -1
  46. package/dist/components/NewComposition/NewComposition.d.ts +23 -0
  47. package/dist/components/NewComposition/NewComposition.js +217 -80
  48. package/dist/components/{UpdateModal/OpenIssueButton.js → OpenIssueButton.js} +1 -1
  49. package/dist/components/PlayPause.js +2 -13
  50. package/dist/components/PreviewToolbar.js +1 -1
  51. package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +2 -1
  52. package/dist/components/QuickSwitcher/QuickSwitcherContent.js +50 -28
  53. package/dist/components/QuickSwitcher/QuickSwitcherResult.d.ts +14 -1
  54. package/dist/components/QuickSwitcher/QuickSwitcherResult.js +64 -9
  55. package/dist/components/QuickSwitcher/composition-search.d.ts +16 -0
  56. package/dist/components/QuickSwitcher/composition-search.js +136 -0
  57. package/dist/components/RenderQueue/actions.d.ts +1 -0
  58. package/dist/components/RenderQueue/actions.js +5 -1
  59. package/dist/components/ResetZoomButton.js +17 -2
  60. package/dist/components/SelectedOutlineCanvasRotation.js +27 -1
  61. package/dist/components/SelectedOutlineElement.js +12 -31
  62. package/dist/components/SelectedOutlineKeyboardControls.d.ts +2 -2
  63. package/dist/components/SelectedOutlineOverlay.d.ts +3 -1
  64. package/dist/components/SelectedOutlineOverlay.js +21 -26
  65. package/dist/components/SelectedOutlinePolygon.d.ts +1 -0
  66. package/dist/components/SelectedOutlinePolygon.js +12 -4
  67. package/dist/components/SelectedOutlineRenderer.js +88 -21
  68. package/dist/components/SettingsContext.js +2 -1
  69. package/dist/components/SettingsModal.d.ts +1 -1
  70. package/dist/components/SettingsModal.js +19 -3
  71. package/dist/components/SidebarRenderButton.d.ts +1 -0
  72. package/dist/components/SidebarRenderButton.js +14 -5
  73. package/dist/components/Timeline/SequencePropsObserver.js +29 -14
  74. package/dist/components/Timeline/Timeline.js +2 -1
  75. package/dist/components/Timeline/TimelineAssetField.js +1 -0
  76. package/dist/components/Timeline/TimelineDeleteKeybindings.js +5 -90
  77. package/dist/components/Timeline/TimelineDragHandler.js +18 -8
  78. package/dist/components/Timeline/TimelineInOutDragHandler.js +2 -3
  79. package/dist/components/Timeline/TimelineKeyframeControls.js +3 -1
  80. package/dist/components/Timeline/TimelinePinchZoom.js +14 -4
  81. package/dist/components/Timeline/TimelinePlayCursorSyncer.js +8 -4
  82. package/dist/components/Timeline/TimelineRowChrome.js +4 -2
  83. package/dist/components/Timeline/TimelineSequence.js +52 -45
  84. package/dist/components/Timeline/TimelineSequenceItem.js +44 -32
  85. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +3 -3
  86. package/dist/components/Timeline/TimelineSlider.js +2 -2
  87. package/dist/components/Timeline/TimelineStack/get-stack.d.ts +1 -0
  88. package/dist/components/Timeline/TimelineStack/get-stack.js +35 -3
  89. package/dist/components/Timeline/TimelineWidthProvider.js +15 -8
  90. package/dist/components/Timeline/TimelineZoomControls.js +25 -8
  91. package/dist/components/Timeline/delete-selected-timeline-item.js +2 -2
  92. package/dist/components/Timeline/duplicate-selected-timeline-item.js +23 -25
  93. package/dist/components/Timeline/get-sequence-context-menu-items.d.ts +6 -0
  94. package/dist/components/Timeline/get-sequence-context-menu-items.js +34 -1
  95. package/dist/components/Timeline/sequence-props-subscription-store.d.ts +2 -0
  96. package/dist/components/Timeline/sequence-props-subscription-store.js +22 -1
  97. package/dist/components/Timeline/timeline-scroll-logic.d.ts +1 -0
  98. package/dist/components/Timeline/timeline-scroll-logic.js +21 -17
  99. package/dist/components/Timeline/use-delete-timeline-items.d.ts +1 -0
  100. package/dist/components/Timeline/use-delete-timeline-items.js +118 -0
  101. package/dist/components/Timeline/use-sequence-props-subscription.js +7 -0
  102. package/dist/components/Timeline/use-timeline-asset-drop.js +8 -14
  103. package/dist/components/TimelineCombobox.js +1 -0
  104. package/dist/components/UpdateCheck.d.ts +0 -8
  105. package/dist/components/UpdateCheck.js +7 -54
  106. package/dist/components/UpdateStatusContext.d.ts +18 -0
  107. package/dist/components/UpdateStatusContext.js +74 -0
  108. package/dist/components/UpdatesSettings.d.ts +2 -0
  109. package/dist/components/UpdatesSettings.js +251 -0
  110. package/dist/components/WebMcp.js +64 -11
  111. package/dist/components/ZoomPersistor.js +2 -2
  112. package/dist/components/composition-drag-data.d.ts +36 -0
  113. package/dist/components/composition-drag-data.js +232 -0
  114. package/dist/components/drop-handler-data.d.ts +2 -1
  115. package/dist/components/drop-handler-data.js +6 -4
  116. package/dist/components/effect-drag-and-drop.d.ts +2 -5
  117. package/dist/components/get-open-in-menu-items.d.ts +4 -0
  118. package/dist/components/get-open-in-menu-items.js +28 -24
  119. package/dist/components/handle-drop.js +6 -2
  120. package/dist/components/import-assets.d.ts +5 -13
  121. package/dist/components/root-composition-menu-items.d.ts +4 -1
  122. package/dist/components/root-composition-menu-items.js +38 -1
  123. package/dist/components/selected-outline-geometry.d.ts +21 -2
  124. package/dist/components/selected-outline-geometry.js +16 -5
  125. package/dist/components/selected-outline-measurement.d.ts +40 -1
  126. package/dist/components/selected-outline-measurement.js +239 -1
  127. package/dist/components/selected-outline-order.d.ts +12 -0
  128. package/dist/components/selected-outline-order.js +251 -0
  129. package/dist/components/selected-outline-types.d.ts +15 -2
  130. package/dist/components/selected-outline-uv.js +106 -3
  131. package/dist/components/use-configure-default-apps.d.ts +1 -0
  132. package/dist/components/use-configure-default-apps.js +24 -0
  133. package/dist/error-overlay/current-error.d.ts +13 -0
  134. package/dist/error-overlay/current-error.js +21 -0
  135. package/dist/error-overlay/remotion-overlay/CodeFrame.js +5 -6
  136. package/dist/error-overlay/remotion-overlay/CopyStackTrace.js +1 -1
  137. package/dist/error-overlay/remotion-overlay/ErrorDisplay.js +47 -18
  138. package/dist/error-overlay/remotion-overlay/ErrorLoader.js +6 -2
  139. package/dist/error-overlay/remotion-overlay/ErrorTitle.js +5 -4
  140. package/dist/error-overlay/remotion-overlay/OpenInEditor.js +48 -76
  141. package/dist/error-overlay/remotion-overlay/SearchGitHubIssues.js +1 -1
  142. package/dist/error-overlay/remotion-overlay/ShortcutHint.js +2 -2
  143. package/dist/error-overlay/remotion-overlay/StackFrame.js +13 -8
  144. package/dist/error-overlay/remotion-overlay/Symbolicating.js +1 -1
  145. package/dist/esm/chunk-6jf1natv.js +25 -0
  146. package/dist/esm/{chunk-4bxz1d3g.js → chunk-je0h1bgt.js} +1 -28
  147. package/dist/esm/chunk-m0jqdbkr.js +14571 -0
  148. package/dist/esm/{chunk-7prjt5n5.js → chunk-np6q13k5.js} +18637 -12189
  149. package/dist/esm/index.mjs +4 -3
  150. package/dist/esm/internals.mjs +35826 -14822
  151. package/dist/esm/previewEntry.mjs +40028 -18935
  152. package/dist/esm/renderEntry.mjs +6 -3
  153. package/dist/helpers/can-show-updates.d.ts +5 -0
  154. package/dist/helpers/can-show-updates.js +7 -0
  155. package/dist/helpers/colors.d.ts +0 -3
  156. package/dist/helpers/colors.js +2 -5
  157. package/dist/helpers/create-folder-tree.d.ts +5 -0
  158. package/dist/helpers/create-folder-tree.js +26 -6
  159. package/dist/helpers/document-title.d.ts +2 -0
  160. package/dist/helpers/document-title.js +14 -3
  161. package/dist/helpers/get-asset-metadata.js +1 -1
  162. package/dist/helpers/get-box-quads-polyfill-internals.d.ts +82 -0
  163. package/dist/helpers/get-box-quads-polyfill-internals.js +2403 -0
  164. package/dist/helpers/get-box-quads-ponyfill.d.ts +10 -0
  165. package/dist/helpers/get-box-quads-ponyfill.js +23 -0
  166. package/dist/helpers/get-git-menu-item.d.ts +5 -0
  167. package/dist/helpers/get-git-menu-item.js +15 -1
  168. package/dist/helpers/get-timeline-max-zoom.d.ts +34 -28
  169. package/dist/helpers/get-timeline-max-zoom.js +46 -29
  170. package/dist/helpers/hoverable.js +10 -5
  171. package/dist/helpers/install-fiber-sequence-order-observer.d.ts +37 -0
  172. package/dist/helpers/install-fiber-sequence-order-observer.js +109 -0
  173. package/dist/helpers/open-in-editor.js +53 -2
  174. package/dist/helpers/preview-server-events.js +3 -0
  175. package/dist/helpers/timeline-layout.d.ts +0 -1
  176. package/dist/helpers/timeline-layout.js +1 -5
  177. package/dist/helpers/url-state.d.ts +1 -0
  178. package/dist/helpers/url-state.js +12 -5
  179. package/dist/helpers/use-runtime-values.d.ts +1 -1
  180. package/dist/helpers/use-runtime-values.js +5 -4
  181. package/dist/helpers/use-sync-external-store.d.ts +3 -0
  182. package/dist/helpers/use-sync-external-store.js +5 -0
  183. package/dist/previewEntry.js +2 -0
  184. package/dist/renderEntry.js +2 -0
  185. package/dist/state/folders.d.ts +3 -0
  186. package/dist/state/folders.js +40 -1
  187. package/dist/state/modals.d.ts +19 -8
  188. package/dist/state/timeline-sequence-hover.js +3 -2
  189. package/dist/state/timeline-zoom.d.ts +0 -1
  190. package/dist/state/timeline-zoom.js +13 -6
  191. package/package.json +18 -15
  192. package/dist/components/UpdateModal/UpdateModal.d.ts +0 -6
  193. package/dist/components/UpdateModal/UpdateModal.js +0 -104
  194. package/dist/helpers/sort-by-nonce-history.d.ts +0 -1
  195. package/dist/helpers/sort-by-nonce-history.js +0 -6
  196. /package/dist/components/{UpdateModal/OpenIssueButton.d.ts → OpenIssueButton.d.ts} +0 -0
@@ -50,9 +50,7 @@ const modals_1 = require("../../state/modals");
50
50
  const AudioWaveform_1 = require("../AudioWaveform");
51
51
  const ConfirmationDialog_1 = require("../ConfirmationDialog");
52
52
  const ContextMenu_1 = require("../ContextMenu");
53
- const delete_jsx_node_api_1 = require("../delete-jsx-node-api");
54
53
  const InitialCompositionLoader_1 = require("../InitialCompositionLoader");
55
- const NotificationCenter_1 = require("../Notifications/NotificationCenter");
56
54
  const use_select_asset_1 = require("../use-select-asset");
57
55
  const disable_sequence_interactivity_1 = require("./disable-sequence-interactivity");
58
56
  const duplicate_selected_timeline_item_1 = require("./duplicate-selected-timeline-item");
@@ -68,6 +66,7 @@ const TimelineSequenceRightEdgeDragHandle_1 = require("./TimelineSequenceRightEd
68
66
  const TimelineVideoInfo_1 = require("./TimelineVideoInfo");
69
67
  const TimelineViewport_1 = require("./TimelineViewport");
70
68
  const TimelineWidthProvider_1 = require("./TimelineWidthProvider");
69
+ const use_delete_timeline_items_1 = require("./use-delete-timeline-items");
71
70
  const use_open_sequence_in_apps_1 = require("./use-open-sequence-in-apps");
72
71
  const use_sequence_freeze_frame_menu_item_1 = require("./use-sequence-freeze-frame-menu-item");
73
72
  const TimelineSequenceFn = ({ s, connectedCompositions, nodePathInfo, sequenceFrameOffset, cascadedStart, localStart, }) => {
@@ -117,11 +116,9 @@ const TimelineSequenceNegativeStartInner = ({ left, width, leftEdgeVisible, clip
117
116
  };
118
117
  const TimelineSequenceNegativeStart = react_1.default.memo(TimelineSequenceNegativeStartInner);
119
118
  const TimelineSequenceCurrentFrame = ({ s, displayDurationInFrames, premount, postmount, negativeStart, leftEdgeVisible, negativeStartClipped, style, children, nodePathInfo, sequenceFrameOffset, fromCanUpdate, frozenFrame, onMoveDragPointerDown, onPointerDownCapture, onDoubleClick, }) => {
120
- var _a, _b, _c, _d;
119
+ var _a, _b, _c;
121
120
  const ref = (0, react_1.useRef)(null);
122
121
  const { onSelect, selectable, selected, selectionItem } = (0, TimelineSelection_1.useTimelineRowSelection)(nodePathInfo);
123
- const containsSelection = (0, TimelineSelection_1.useTimelineRowContainsSelection)(nodePathInfo);
124
- const { selectedItems } = (0, TimelineSelection_1.useTimelineSelection)();
125
122
  (0, TimelineSelection_1.useTimelineMarqueeSelectableItem)(selectionItem, ref);
126
123
  const onPointerDown = (0, react_1.useCallback)((e) => {
127
124
  if (e.button === 0) {
@@ -159,14 +156,13 @@ const TimelineSequenceCurrentFrame = ({ s, displayDurationInFrames, premount, po
159
156
  ? negativeStart.left + negativeStart.width
160
157
  : 0;
161
158
  const actualStyle = (0, react_1.useMemo)(() => {
162
- const hasSelectedTrack = selectedItems.some((item) => item.type !== 'guide');
163
159
  return {
164
160
  ...style,
165
161
  background: negativeStart ? colors_1.TRANSPARENT : style.background,
166
162
  border: negativeStart ? 'none' : style.border,
167
- opacity: hasSelectedTrack && !selected && !containsSelection ? 0.75 : 1,
163
+ opacity: selected ? 1 : 0.75,
168
164
  };
169
- }, [containsSelection, negativeStart, selected, selectedItems, style]);
165
+ }, [negativeStart, selected, style]);
170
166
  const content = (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [premount ? (jsx_runtime_1.jsx("div", { style: {
171
167
  left: premount.left,
172
168
  width: premount.width,
@@ -195,8 +191,8 @@ const TimelineSequenceCurrentFrame = ({ s, displayDurationInFrames, premount, po
195
191
  s.type !== 'video' &&
196
192
  s.type !== 'image' &&
197
193
  s.loopDisplay === undefined &&
198
- (isInRange || isPremounting || isPostmounting) ? (jsx_runtime_1.jsx("div", { style: {
199
- paddingLeft: 5 + ((_c = negativeStart === null || negativeStart === void 0 ? void 0 : negativeStart.width) !== null && _c !== void 0 ? _c : 0) + ((_d = premount === null || premount === void 0 ? void 0 : premount.width) !== null && _d !== void 0 ? _d : 0),
194
+ (frozenFrame !== null || isInRange || isPremounting || isPostmounting) ? (jsx_runtime_1.jsx("div", { style: {
195
+ paddingLeft: 5 + negativeStartEnd + ((_c = premount === null || premount === void 0 ? void 0 : premount.width) !== null && _c !== void 0 ? _c : 0),
200
196
  height: '100%',
201
197
  display: 'flex',
202
198
  alignItems: 'center',
@@ -279,7 +275,17 @@ const TimelineSequenceInner = ({ s, connectedCompositions, windowWidth, nodePath
279
275
  const selectAsset = (0, use_select_asset_1.useSelectAsset)();
280
276
  const selectComposition = (0, InitialCompositionLoader_1.useSelectComposition)();
281
277
  const confirm = (0, ConfirmationDialog_1.useConfirmationDialog)();
282
- const { onSelect, selectable } = (0, TimelineSelection_1.useTimelineRowSelection)(nodePathInfo);
278
+ const deleteTimelineItems = (0, use_delete_timeline_items_1.useDeleteTimelineItems)();
279
+ const { onSelect, selectable, selected } = (0, TimelineSelection_1.useTimelineRowSelection)(nodePathInfo);
280
+ const { selectedItems } = (0, TimelineSelection_1.useTimelineSelection)();
281
+ const selectedSequenceNodePathInfos = (0, react_1.useMemo)(() => {
282
+ if (!selected ||
283
+ selectedItems.length < 2 ||
284
+ selectedItems.some((item) => item.type !== 'sequence')) {
285
+ return null;
286
+ }
287
+ return selectedItems.flatMap((item) => item.type === 'sequence' ? [item.nodePathInfo] : []);
288
+ }, [selected, selectedItems]);
283
289
  const onSequenceDoubleClick = (0, react_1.useCallback)((e) => {
284
290
  if ((0, TimelineSelection_1.isTimelineSelectionModifierEvent)(e)) {
285
291
  e.stopPropagation();
@@ -332,45 +338,36 @@ const TimelineSequenceInner = ({ s, connectedCompositions, windowWidth, nodePath
332
338
  }
333
339
  (0, duplicate_selected_timeline_item_1.duplicateSequencesFromSource)([nodePathInfo], confirm).catch(() => undefined);
334
340
  }, [confirm, duplicateDisabled, nodePathInfo, validatedLocation === null || validatedLocation === void 0 ? void 0 : validatedLocation.source]);
335
- const onDeleteSequenceFromSource = (0, react_1.useCallback)(async () => {
336
- if (!(validatedLocation === null || validatedLocation === void 0 ? void 0 : validatedLocation.source) || !nodePath || deleteDisabled) {
341
+ const onDuplicateSelectedSequences = (0, react_1.useCallback)(() => {
342
+ if (!previewInteractive || selectedSequenceNodePathInfos === null) {
337
343
  return;
338
344
  }
339
- if (nodePathInfo && nodePathInfo.numberOfSequencesWithThisNodePath > 1) {
340
- const shouldDelete = await confirm({
341
- title: 'Delete sequence?',
342
- message: 'This sequence is programmatically duplicated ' +
343
- nodePathInfo.numberOfSequencesWithThisNodePath +
344
- ' times in the code. Deleting removes all instances. Continue?',
345
- confirmLabel: 'Delete',
346
- });
347
- if (!shouldDelete) {
348
- return;
349
- }
350
- }
351
- try {
352
- const result = await (0, delete_jsx_node_api_1.deleteJsxNode)({
353
- nodes: [
354
- {
355
- fileName: validatedLocation.source,
356
- nodePath: nodePath.nodePath,
357
- },
358
- ],
359
- });
360
- if (!result.success) {
361
- (0, NotificationCenter_1.showNotification)(result.reason, 4000);
362
- }
363
- }
364
- catch (err) {
365
- (0, NotificationCenter_1.showNotification)(err.message, 4000);
345
+ (0, duplicate_selected_timeline_item_1.duplicateSequencesFromSource)(selectedSequenceNodePathInfos, confirm).catch(() => undefined);
346
+ }, [confirm, previewInteractive, selectedSequenceNodePathInfos]);
347
+ const onDeleteSequenceFromSource = (0, react_1.useCallback)(() => {
348
+ if (!(validatedLocation === null || validatedLocation === void 0 ? void 0 : validatedLocation.source) ||
349
+ !nodePath ||
350
+ !nodePathInfo ||
351
+ deleteDisabled) {
352
+ return;
366
353
  }
354
+ deleteTimelineItems([{ type: 'sequence', nodePathInfo }]);
367
355
  }, [
368
- confirm,
369
356
  deleteDisabled,
357
+ deleteTimelineItems,
370
358
  nodePath,
371
359
  nodePathInfo,
372
360
  validatedLocation === null || validatedLocation === void 0 ? void 0 : validatedLocation.source,
373
361
  ]);
362
+ const onDeleteSelectedSequences = (0, react_1.useCallback)(() => {
363
+ if (!previewInteractive || selectedSequenceNodePathInfos === null) {
364
+ return;
365
+ }
366
+ deleteTimelineItems(selectedSequenceNodePathInfos.map((selectedNodePathInfo) => ({
367
+ type: 'sequence',
368
+ nodePathInfo: selectedNodePathInfo,
369
+ })));
370
+ }, [deleteTimelineItems, previewInteractive, selectedSequenceNodePathInfos]);
374
371
  const onDisableSequenceInteractivity = (0, react_1.useCallback)(() => {
375
372
  if (disableInteractivityDisabled ||
376
373
  !nodePath ||
@@ -393,9 +390,17 @@ const TimelineSequenceInner = ({ s, connectedCompositions, windowWidth, nodePath
393
390
  ]);
394
391
  const getContextMenuItems = (0, react_1.useCallback)(() => {
395
392
  var _a;
396
- if (selectable) {
393
+ if (selectable && !selected) {
397
394
  onSelect({ shiftKey: false, toggleKey: false });
398
395
  }
396
+ if (selectedSequenceNodePathInfos !== null) {
397
+ return (0, get_sequence_context_menu_items_1.getMultiSequenceContextMenuItems)({
398
+ deleteDisabled: !previewInteractive,
399
+ duplicateDisabled: !previewInteractive,
400
+ onDeleteSelectedSequences,
401
+ onDuplicateSelectedSequences,
402
+ });
403
+ }
399
404
  const freezeFrameMenuItem = (0, use_sequence_freeze_frame_menu_item_1.getSequenceFreezeFrameMenuItem)({
400
405
  clientId: previewInteractive && previewServerState.type === 'connected'
401
406
  ? previewServerState.clientId
@@ -454,8 +459,10 @@ const TimelineSequenceInner = ({ s, connectedCompositions, windowWidth, nodePath
454
459
  nodePath,
455
460
  onSelect,
456
461
  onDeleteSequenceFromSource,
462
+ onDeleteSelectedSequences,
457
463
  onDisableSequenceInteractivity,
458
464
  onDuplicateSequenceFromSource,
465
+ onDuplicateSelectedSequences,
459
466
  openInCodingAgent,
460
467
  openInEditor,
461
468
  originalLocation,
@@ -465,6 +472,8 @@ const TimelineSequenceInner = ({ s, connectedCompositions, windowWidth, nodePath
465
472
  s,
466
473
  selectAsset,
467
474
  selectable,
475
+ selected,
476
+ selectedSequenceNodePathInfos,
468
477
  sequenceFrameOffset,
469
478
  setPropStatuses,
470
479
  setSelectedModal,
@@ -543,9 +552,7 @@ const TimelineSequenceInner = ({ s, connectedCompositions, windowWidth, nodePath
543
552
  ? colors_1.TIMELINE_AUDIO_GRADIENT
544
553
  : s.type === 'video'
545
554
  ? colors_1.TIMELINE_VIDEO_GRADIENT
546
- : s.type === 'image'
547
- ? colors_1.TIMELINE_IMAGE_GRADIENT
548
- : colors_1.BLUE,
555
+ : colors_1.BLUE,
549
556
  border: `${get_timeline_sequence_layout_1.SEQUENCE_BORDER_WIDTH}px solid ${colors_1.WHITE_ALPHA_20}`,
550
557
  borderLeftColor: (visibleLayout === null || visibleLayout === void 0 ? void 0 : visibleLayout.leftEdgeVisible) && !negativeStartClipped
551
558
  ? colors_1.WHITE_ALPHA_20
@@ -53,7 +53,6 @@ const transform_3d_mode_1 = require("../../state/transform-3d-mode");
53
53
  const CompositionOrStillIcon_1 = require("../CompositionOrStillIcon");
54
54
  const ConfirmationDialog_1 = require("../ConfirmationDialog");
55
55
  const ContextMenu_1 = require("../ContextMenu");
56
- const delete_jsx_node_api_1 = require("../delete-jsx-node-api");
57
56
  const effect_drag_and_drop_1 = require("../effect-drag-and-drop");
58
57
  const ExpandedTracksProvider_1 = require("../ExpandedTracksProvider");
59
58
  const InitialCompositionLoader_1 = require("../InitialCompositionLoader");
@@ -76,6 +75,7 @@ const TimelineMediaInfo_1 = require("./TimelineMediaInfo");
76
75
  const TimelineRowChrome_1 = require("./TimelineRowChrome");
77
76
  const TimelineSelection_1 = require("./TimelineSelection");
78
77
  const TimelineSequenceName_1 = require("./TimelineSequenceName");
78
+ const use_delete_timeline_items_1 = require("./use-delete-timeline-items");
79
79
  const use_open_sequence_in_apps_1 = require("./use-open-sequence-in-apps");
80
80
  const use_rename_sequence_1 = require("./use-rename-sequence");
81
81
  const use_sequence_freeze_frame_menu_item_1 = require("./use-sequence-freeze-frame-menu-item");
@@ -193,8 +193,17 @@ const TimelineSequenceItemInner = ({ afterDropLineOffset, connectedCompositions,
193
193
  const { isHighestContext } = (0, use_keybinding_1.useKeybinding)();
194
194
  const selectAsset = (0, use_select_asset_1.useSelectAsset)();
195
195
  const selectComposition = (0, InitialCompositionLoader_1.useSelectComposition)();
196
+ const deleteTimelineItems = (0, use_delete_timeline_items_1.useDeleteTimelineItems)();
196
197
  const { onSelect, selectable, selected } = (0, TimelineSelection_1.useTimelineRowSelection)(nodePathInfo);
197
198
  const { selectItem, selectedItems } = (0, TimelineSelection_1.useTimelineSelection)();
199
+ const selectedSequenceNodePathInfos = (0, react_1.useMemo)(() => {
200
+ if (!selected ||
201
+ selectedItems.length < 2 ||
202
+ selectedItems.some((item) => item.type !== 'sequence')) {
203
+ return null;
204
+ }
205
+ return selectedItems.flatMap((item) => item.type === 'sequence' ? [item.nodePathInfo] : []);
206
+ }, [selected, selectedItems]);
198
207
  const containsSelection = (0, TimelineSelection_1.useTimelineRowContainsSelection)(nodePathInfo);
199
208
  const [effectDropHovered, setEffectDropHovered] = (0, react_1.useState)(false);
200
209
  const [isRenaming, setIsRenaming] = (0, react_1.useState)(false);
@@ -246,45 +255,36 @@ const TimelineSequenceItemInner = ({ afterDropLineOffset, connectedCompositions,
246
255
  }
247
256
  (0, duplicate_selected_timeline_item_1.duplicateSequencesFromSource)([nodePathInfo], confirm).catch(() => undefined);
248
257
  }, [confirm, duplicateDisabled, nodePathInfo, validatedLocation === null || validatedLocation === void 0 ? void 0 : validatedLocation.source]);
249
- const onDeleteSequenceFromSource = (0, react_1.useCallback)(async () => {
250
- if (deleteDisabled || !(validatedLocation === null || validatedLocation === void 0 ? void 0 : validatedLocation.source) || !nodePath) {
258
+ const onDuplicateSelectedSequences = (0, react_1.useCallback)(() => {
259
+ if (!previewInteractive || selectedSequenceNodePathInfos === null) {
251
260
  return;
252
261
  }
253
- if (nodePathInfo && nodePathInfo.numberOfSequencesWithThisNodePath > 1) {
254
- const shouldDelete = await confirm({
255
- title: 'Delete sequence?',
256
- message: 'This sequence is programmatically duplicated ' +
257
- nodePathInfo.numberOfSequencesWithThisNodePath +
258
- ' times in the code. Deleting removes all instances. Continue?',
259
- confirmLabel: 'Delete',
260
- });
261
- if (!shouldDelete) {
262
- return;
263
- }
264
- }
265
- try {
266
- const result = await (0, delete_jsx_node_api_1.deleteJsxNode)({
267
- nodes: [
268
- {
269
- fileName: validatedLocation.source,
270
- nodePath: nodePath.nodePath,
271
- },
272
- ],
273
- });
274
- if (!result.success) {
275
- (0, NotificationCenter_1.showNotification)(result.reason, 4000);
276
- }
277
- }
278
- catch (err) {
279
- (0, NotificationCenter_1.showNotification)(err.message, 4000);
262
+ (0, duplicate_selected_timeline_item_1.duplicateSequencesFromSource)(selectedSequenceNodePathInfos, confirm).catch(() => undefined);
263
+ }, [confirm, previewInteractive, selectedSequenceNodePathInfos]);
264
+ const onDeleteSequenceFromSource = (0, react_1.useCallback)(() => {
265
+ if (deleteDisabled ||
266
+ !(validatedLocation === null || validatedLocation === void 0 ? void 0 : validatedLocation.source) ||
267
+ !nodePath ||
268
+ !nodePathInfo) {
269
+ return;
280
270
  }
271
+ deleteTimelineItems([{ type: 'sequence', nodePathInfo }]);
281
272
  }, [
282
- confirm,
283
273
  deleteDisabled,
274
+ deleteTimelineItems,
284
275
  nodePath,
285
276
  validatedLocation === null || validatedLocation === void 0 ? void 0 : validatedLocation.source,
286
277
  nodePathInfo,
287
278
  ]);
279
+ const onDeleteSelectedSequences = (0, react_1.useCallback)(() => {
280
+ if (!previewInteractive || selectedSequenceNodePathInfos === null) {
281
+ return;
282
+ }
283
+ deleteTimelineItems(selectedSequenceNodePathInfos.map((selectedNodePathInfo) => ({
284
+ type: 'sequence',
285
+ nodePathInfo: selectedNodePathInfo,
286
+ })));
287
+ }, [deleteTimelineItems, previewInteractive, selectedSequenceNodePathInfos]);
288
288
  const onDisableSequenceInteractivity = (0, react_1.useCallback)(() => {
289
289
  if (disableInteractivityDisabled ||
290
290
  !nodePath ||
@@ -693,9 +693,17 @@ const TimelineSequenceItemInner = ({ afterDropLineOffset, connectedCompositions,
693
693
  }, [canRotate, nodePathInfo, selectItem, setManuallyEnabled]);
694
694
  const getContextMenuItems = (0, react_1.useCallback)(() => {
695
695
  var _a;
696
- if (selectable) {
696
+ if (selectable && !selected) {
697
697
  onSelect({ shiftKey: false, toggleKey: false });
698
698
  }
699
+ if (selectedSequenceNodePathInfos !== null) {
700
+ return (0, get_sequence_context_menu_items_1.getMultiSequenceContextMenuItems)({
701
+ deleteDisabled: !previewInteractive,
702
+ duplicateDisabled: !previewInteractive,
703
+ onDeleteSelectedSequences,
704
+ onDuplicateSelectedSequences,
705
+ });
706
+ }
699
707
  const freezeFrameMenuItem = (0, use_sequence_freeze_frame_menu_item_1.getSequenceFreezeFrameMenuItem)({
700
708
  clientId: previewInteractive && previewServerState.type === 'connected'
701
709
  ? previewServerState.clientId
@@ -835,8 +843,10 @@ const TimelineSequenceItemInner = ({ afterDropLineOffset, connectedCompositions,
835
843
  onCrop,
836
844
  onRotate,
837
845
  onDeleteSequenceFromSource,
846
+ onDeleteSelectedSequences,
838
847
  onDisableSequenceInteractivity,
839
848
  onDuplicateSequenceFromSource,
849
+ onDuplicateSelectedSequences,
840
850
  onRenameSequence,
841
851
  onSelect,
842
852
  openInCodingAgent,
@@ -847,6 +857,8 @@ const TimelineSequenceItemInner = ({ afterDropLineOffset, connectedCompositions,
847
857
  propStatusesForOverride,
848
858
  selectAsset,
849
859
  selectable,
860
+ selected,
861
+ selectedSequenceNodePathInfos,
850
862
  sequence,
851
863
  sequenceFrameOffset,
852
864
  setSelectedModal,
@@ -35,6 +35,7 @@ var __importStar = (this && this.__importStar) || (function () {
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.TimelineSequenceRightEdgeDragHandle = exports.useTimelineSequenceFromDrag = exports.TimelineSequenceLeftEdgeDragHandle = exports.getTimelineSequenceFromDragTargets = exports.getTimelineSequenceLeftEdgeDragTargets = exports.getTimelineSequenceDurationDragTargets = exports.getTimelineSequenceFromDragKeyframeMoves = exports.getTimelineSequenceFromDragChanges = exports.getTimelineSequenceFromDragDelta = exports.getTimelineSequenceFromDragValue = exports.getTimelineSequenceDurationDragChanges = exports.getTimelineSequenceLeftEdgeDragChanges = exports.getTimelineSequenceLeftEdgeDragValues = exports.getTimelineSequenceLeftEdgeDragDelta = exports.getTimelineSequenceDurationDragValue = exports.isTimelineSequenceLeftEdgeDraggable = exports.canResizeTimelineSequenceDuration = exports.isTimelineSequenceDurationDraggable = exports.isCascadingSequence = exports.isTransitionSeriesSequence = exports.timelineSequenceFromDragSnapThresholdPx = void 0;
37
37
  const jsx_runtime_1 = require("react/jsx-runtime");
38
+ const canvas_1 = require("@remotion/canvas");
38
39
  const studio_shared_1 = require("@remotion/studio-shared");
39
40
  const react_1 = __importStar(require("react"));
40
41
  const remotion_1 = require("remotion");
@@ -43,7 +44,6 @@ const calculate_timeline_1 = require("../../helpers/calculate-timeline");
43
44
  const client_id_1 = require("../../helpers/client-id");
44
45
  const colors_1 = require("../../helpers/colors");
45
46
  const pointer_session_1 = require("../../helpers/pointer-session");
46
- const sort_by_nonce_history_1 = require("../../helpers/sort-by-nonce-history");
47
47
  const timeline_layout_1 = require("../../helpers/timeline-layout");
48
48
  const editor_snapping_1 = require("../../state/editor-snapping");
49
49
  const ForceSpecificCursor_1 = require("../ForceSpecificCursor");
@@ -168,9 +168,9 @@ const getMinimumSequenceDuration = ({ sequence, sequences, }) => {
168
168
  if (!(0, exports.isTransitionSeriesSequence)(sequence)) {
169
169
  return 1;
170
170
  }
171
- const siblings = (0, sort_by_nonce_history_1.sortItemsByNonceHistory)(sequences.filter((candidate) => candidate.parent === sequence.parent &&
171
+ const siblings = (0, canvas_1.sortItemsByCommitOrder)(sequences.filter((candidate) => candidate.parent === sequence.parent &&
172
172
  ((0, exports.isTransitionSeriesSequence)(candidate) ||
173
- isTransitionSeriesTransition(candidate))));
173
+ isTransitionSeriesTransition(candidate))), (candidate) => candidate.timelineOrder);
174
174
  const sequenceIndex = siblings.findIndex((candidate) => candidate.id === sequence.id);
175
175
  if (sequenceIndex === -1) {
176
176
  return 1;
@@ -60,8 +60,8 @@ const TimelineSliderInner = () => {
60
60
  throw new Error('Unexpectedly did not have timeline width');
61
61
  }
62
62
  const zoomLevel = (canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) === 'composition'
63
- ? ((_a = zoomMap[canvasContent.compositionId]) !== null && _a !== void 0 ? _a : timeline_zoom_1.TIMELINE_MIN_ZOOM)
64
- : timeline_zoom_1.TIMELINE_MIN_ZOOM;
63
+ ? ((_a = zoomMap[canvasContent.compositionId]) !== null && _a !== void 0 ? _a : null)
64
+ : null;
65
65
  (0, react_1.useLayoutEffect)(() => {
66
66
  var _a;
67
67
  const el = ref.current;
@@ -1 +1,2 @@
1
+ export declare const getSourceMapFilesForSource: (source: string) => Record<string, string> | null;
1
2
  export declare const getOriginalLocationFromStack: (stack: string, type: "sequence" | "visual-control") => Promise<import("../../../error-overlay/react-overlay/utils/get-source-map").OriginalPosition | null>;
@@ -1,16 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getOriginalLocationFromStack = void 0;
3
+ exports.getOriginalLocationFromStack = exports.getSourceMapFilesForSource = void 0;
4
4
  const trace_mapping_1 = require("@jridgewell/trace-mapping");
5
5
  const get_source_map_1 = require("../../../error-overlay/react-overlay/utils/get-source-map");
6
6
  const get_location_of_sequence_1 = require("../../../helpers/get-location-of-sequence");
7
7
  const traceMapCache = {};
8
8
  const traceMapPromises = {};
9
+ const traceMapsByOriginalSource = new Map();
10
+ const sourceMapFilesCache = new WeakMap();
9
11
  const browserStudioOriginalSourcePrefix = 'browser-studio-original://';
10
12
  const studioOriginalSourcePrefix = 'studio-original://';
11
- const getSourceMapCache = async (fileName) => {
13
+ const getSourceMapCache = (fileName) => {
12
14
  if (traceMapCache[fileName]) {
13
- return traceMapCache[fileName];
15
+ return Promise.resolve(traceMapCache[fileName]);
14
16
  }
15
17
  if (traceMapPromises[fileName]) {
16
18
  return traceMapPromises[fileName];
@@ -18,8 +20,16 @@ const getSourceMapCache = async (fileName) => {
18
20
  traceMapPromises[fileName] = fetch(`${fileName}.map`)
19
21
  .then((res) => res.json())
20
22
  .then((json) => {
23
+ var _a;
21
24
  const map = new trace_mapping_1.TraceMap(json);
22
25
  traceMapCache[fileName] = map;
26
+ for (let index = 0; index < map.sources.length; index++) {
27
+ const source = map.sources[index];
28
+ const content = (_a = map.sourcesContent) === null || _a === void 0 ? void 0 : _a[index];
29
+ if (source !== null && typeof content === 'string') {
30
+ traceMapsByOriginalSource.set(source, map);
31
+ }
32
+ }
23
33
  return map;
24
34
  })
25
35
  .finally(() => {
@@ -27,6 +37,28 @@ const getSourceMapCache = async (fileName) => {
27
37
  });
28
38
  return traceMapPromises[fileName];
29
39
  };
40
+ const getSourceMapFilesForSource = (source) => {
41
+ var _a;
42
+ const map = traceMapsByOriginalSource.get(source);
43
+ if (!map) {
44
+ return null;
45
+ }
46
+ const cached = sourceMapFilesCache.get(map);
47
+ if (cached) {
48
+ return cached;
49
+ }
50
+ const files = {};
51
+ for (let index = 0; index < map.sources.length; index++) {
52
+ const fileName = map.sources[index];
53
+ const content = (_a = map.sourcesContent) === null || _a === void 0 ? void 0 : _a[index];
54
+ if (fileName !== null && typeof content === 'string') {
55
+ files[fileName] = content;
56
+ }
57
+ }
58
+ sourceMapFilesCache.set(map, files);
59
+ return files;
60
+ };
61
+ exports.getSourceMapFilesForSource = getSourceMapFilesForSource;
30
62
  const getOriginalLocationFromStack = async (stack, type) => {
31
63
  const location = type === 'sequence'
32
64
  ? (0, get_location_of_sequence_1.getLocationOfSequence)(stack)
@@ -5,6 +5,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const player_1 = require("@remotion/player");
6
6
  const react_1 = require("react");
7
7
  const remotion_1 = require("remotion");
8
+ const get_timeline_max_zoom_1 = require("../../helpers/get-timeline-max-zoom");
8
9
  const timeline_zoom_1 = require("../../state/timeline-zoom");
9
10
  const timeline_refs_1 = require("./timeline-refs");
10
11
  exports.TimelineWidthContext = (0, react_1.createContext)(null);
@@ -15,18 +16,24 @@ const TimelineWidthProvider = ({ children }) => {
15
16
  });
16
17
  const { zoom: zoomMap } = (0, react_1.useContext)(timeline_zoom_1.TimelineZoomCtx);
17
18
  const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
19
+ const videoConfig = remotion_1.Internals.useUnsafeVideoConfig();
18
20
  const width = (0, react_1.useMemo)(() => {
19
21
  var _a, _b;
20
- var _c, _d, _e;
21
- const zoom = (canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) === 'composition'
22
- ? ((_c = zoomMap[canvasContent.compositionId]) !== null && _c !== void 0 ? _c : timeline_zoom_1.TIMELINE_MIN_ZOOM)
23
- : timeline_zoom_1.TIMELINE_MIN_ZOOM;
24
- const scrollableWidth = (_d = size === null || size === void 0 ? void 0 : size.width) !== null && _d !== void 0 ? _d : (_a = timeline_refs_1.scrollableRef.current) === null || _a === void 0 ? void 0 : _a.clientWidth;
22
+ var _c, _d, _e, _f;
23
+ const scrollableWidth = (_c = size === null || size === void 0 ? void 0 : size.width) !== null && _c !== void 0 ? _c : (_a = timeline_refs_1.scrollableRef.current) === null || _a === void 0 ? void 0 : _a.clientWidth;
25
24
  if (scrollableWidth === undefined) {
26
- return (_e = (_b = timeline_refs_1.sliderAreaRef.current) === null || _b === void 0 ? void 0 : _b.clientWidth) !== null && _e !== void 0 ? _e : null;
25
+ return (_d = (_b = timeline_refs_1.sliderAreaRef.current) === null || _b === void 0 ? void 0 : _b.clientWidth) !== null && _d !== void 0 ? _d : null;
27
26
  }
28
- return scrollableWidth * zoom;
29
- }, [canvasContent, size === null || size === void 0 ? void 0 : size.width, zoomMap]);
27
+ const durationInFrames = (_e = videoConfig === null || videoConfig === void 0 ? void 0 : videoConfig.durationInFrames) !== null && _e !== void 0 ? _e : 1;
28
+ const zoom = (0, get_timeline_max_zoom_1.getTimelineZoom)({
29
+ durationInFrames,
30
+ timelineViewportWidth: scrollableWidth,
31
+ zoom: (canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) === 'composition'
32
+ ? ((_f = zoomMap[canvasContent.compositionId]) !== null && _f !== void 0 ? _f : null)
33
+ : null,
34
+ });
35
+ return (0, get_timeline_max_zoom_1.getTimelineWidth)({ durationInFrames, zoom });
36
+ }, [canvasContent, size === null || size === void 0 ? void 0 : size.width, videoConfig === null || videoConfig === void 0 ? void 0 : videoConfig.durationInFrames, zoomMap]);
30
37
  return (jsx_runtime_1.jsx(exports.TimelineWidthContext.Provider, { value: width, children: children }));
31
38
  };
32
39
  exports.TimelineWidthProvider = TimelineWidthProvider;
@@ -35,6 +35,7 @@ var __importStar = (this && this.__importStar) || (function () {
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.TimelineZoomControls = void 0;
37
37
  const jsx_runtime_1 = require("react/jsx-runtime");
38
+ const player_1 = require("@remotion/player");
38
39
  const react_1 = __importStar(require("react"));
39
40
  const remotion_1 = require("remotion");
40
41
  const colors_1 = require("../../helpers/colors");
@@ -45,6 +46,7 @@ const timeline_zoom_1 = require("../../state/timeline-zoom");
45
46
  const z_index_1 = require("../../state/z-index");
46
47
  const ControlButton_1 = require("../ControlButton");
47
48
  const layout_1 = require("../layout");
49
+ const timeline_refs_1 = require("./timeline-refs");
48
50
  const TIMELINE_ZOOM_BUTTON_FACTOR = 1.2;
49
51
  const container = {
50
52
  color: colors_1.BLACK,
@@ -55,10 +57,11 @@ const container = {
55
57
  const buttonStyle = {
56
58
  fontSize: 24,
57
59
  };
58
- const TimelineZoomSlider = ({ maxWidth, maxZoom }) => {
59
- var _a;
60
+ const TimelineZoomSlider = ({ maxWidth, minZoom, timelineViewportWidth }) => {
61
+ var _a, _b;
60
62
  const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
61
63
  const { setZoom, zoom: zoomMap } = (0, react_1.useContext)(timeline_zoom_1.TimelineZoomCtx);
64
+ const videoConfig = remotion_1.Internals.useUnsafeVideoConfig();
62
65
  const { tabIndex } = (0, z_index_1.useZIndex)();
63
66
  const isStill = (0, is_current_selected_still_1.useIsStill)();
64
67
  const onChange = (0, react_1.useCallback)((e) => {
@@ -67,26 +70,40 @@ const TimelineZoomSlider = ({ maxWidth, maxZoom }) => {
67
70
  }
68
71
  setZoom(canvasContent.compositionId, () => (0, get_timeline_max_zoom_1.sliderValueToTimelineZoom)({
69
72
  sliderValue: Number(e.target.value),
70
- maxZoom,
73
+ minZoom,
71
74
  }), {
72
75
  anchorFrame: null,
73
76
  anchorContentX: null,
74
77
  });
75
- }, [canvasContent, maxZoom, setZoom]);
78
+ }, [canvasContent, minZoom, setZoom]);
76
79
  if (isStill ||
77
80
  canvasContent === null ||
78
81
  canvasContent.type !== 'composition') {
79
82
  return null;
80
83
  }
81
- const zoom = (_a = zoomMap[canvasContent.compositionId]) !== null && _a !== void 0 ? _a : get_timeline_max_zoom_1.TIMELINE_MIN_ZOOM;
82
- return (jsx_runtime_1.jsx("input", { style: maxWidth === undefined ? undefined : { maxWidth }, title: `Timeline zoom (${zoom}x)`, alt: `Timeline zoom (${zoom}x)`, type: "range", min: get_timeline_max_zoom_1.TIMELINE_ZOOM_SLIDER_PROPS.min, max: get_timeline_max_zoom_1.TIMELINE_ZOOM_SLIDER_PROPS.max, step: get_timeline_max_zoom_1.TIMELINE_ZOOM_SLIDER_PROPS.step, value: (0, get_timeline_max_zoom_1.timelineZoomToSliderValue)({ zoom, maxZoom }), onChange: onChange, className: "__remotion-timeline-slider", tabIndex: tabIndex }));
84
+ const zoom = (0, get_timeline_max_zoom_1.getTimelineZoom)({
85
+ durationInFrames: (_a = videoConfig === null || videoConfig === void 0 ? void 0 : videoConfig.durationInFrames) !== null && _a !== void 0 ? _a : 1,
86
+ timelineViewportWidth,
87
+ zoom: (_b = zoomMap[canvasContent.compositionId]) !== null && _b !== void 0 ? _b : null,
88
+ });
89
+ const roundedZoom = Math.round(zoom * 100) / 100;
90
+ return (jsx_runtime_1.jsx("input", { style: maxWidth === undefined ? undefined : { maxWidth }, title: `Timeline zoom (${roundedZoom}px/frame)`, alt: `Timeline zoom (${roundedZoom}px/frame)`, type: "range", min: get_timeline_max_zoom_1.TIMELINE_ZOOM_SLIDER_PROPS.min, max: get_timeline_max_zoom_1.TIMELINE_ZOOM_SLIDER_PROPS.max, step: get_timeline_max_zoom_1.TIMELINE_ZOOM_SLIDER_PROPS.step, value: (0, get_timeline_max_zoom_1.timelineZoomToSliderValue)({ zoom, minZoom }), onChange: onChange, className: "__remotion-timeline-slider", tabIndex: tabIndex }));
83
91
  };
84
92
  const TimelineZoomControlsInner = ({ sliderMaxWidth }) => {
85
93
  var _a;
94
+ var _b, _c, _d;
86
95
  const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
87
96
  const { setZoom } = (0, react_1.useContext)(timeline_zoom_1.TimelineZoomCtx);
88
97
  const videoConfig = remotion_1.Internals.useUnsafeVideoConfig();
89
- const maxZoom = (0, get_timeline_max_zoom_1.getTimelineMaxZoom)((_a = videoConfig === null || videoConfig === void 0 ? void 0 : videoConfig.durationInFrames) !== null && _a !== void 0 ? _a : 1);
98
+ const timelineSize = player_1.PlayerInternals.useElementSize(timeline_refs_1.scrollableRef, {
99
+ triggerOnWindowResize: true,
100
+ shouldApplyCssTransforms: true,
101
+ });
102
+ const timelineViewportWidth = (_c = (_b = timelineSize === null || timelineSize === void 0 ? void 0 : timelineSize.width) !== null && _b !== void 0 ? _b : (_a = timeline_refs_1.scrollableRef.current) === null || _a === void 0 ? void 0 : _a.clientWidth) !== null && _c !== void 0 ? _c : 0;
103
+ const minZoom = (0, get_timeline_max_zoom_1.getTimelineMinZoom)({
104
+ durationInFrames: (_d = videoConfig === null || videoConfig === void 0 ? void 0 : videoConfig.durationInFrames) !== null && _d !== void 0 ? _d : 1,
105
+ timelineViewportWidth,
106
+ });
90
107
  const onMinusClicked = (0, react_1.useCallback)(() => {
91
108
  if (canvasContent === null || canvasContent.type !== 'composition') {
92
109
  return;
@@ -106,7 +123,7 @@ const TimelineZoomControlsInner = ({ sliderMaxWidth }) => {
106
123
  return null;
107
124
  }
108
125
  return (jsx_runtime_1.jsxs("div", { style: container, children: [
109
- jsx_runtime_1.jsx(ControlButton_1.ControlButton, { onClick: onMinusClicked, style: buttonStyle, title: "Zoom out timeline", role: 'ControlButton', type: "button", children: (color) => jsx_runtime_1.jsx(canvas_zoom_1.CanvasZoomOutIcon, { color: color }) }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }), jsx_runtime_1.jsx(TimelineZoomSlider, { maxWidth: sliderMaxWidth, maxZoom: maxZoom }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }), jsx_runtime_1.jsx(ControlButton_1.ControlButton, { onClick: onPlusClicked, style: buttonStyle, title: "Zoom in timeline", role: 'button', type: "button", children: (color) => jsx_runtime_1.jsx(canvas_zoom_1.CanvasZoomIcon, { color: color }) })
126
+ jsx_runtime_1.jsx(ControlButton_1.ControlButton, { onClick: onMinusClicked, style: buttonStyle, title: "Zoom out timeline", role: 'ControlButton', type: "button", children: (color) => jsx_runtime_1.jsx(canvas_zoom_1.CanvasZoomOutIcon, { color: color }) }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }), jsx_runtime_1.jsx(TimelineZoomSlider, { maxWidth: sliderMaxWidth, minZoom: minZoom, timelineViewportWidth: timelineViewportWidth }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }), jsx_runtime_1.jsx(ControlButton_1.ControlButton, { onClick: onPlusClicked, style: buttonStyle, title: "Zoom in timeline", role: 'button', type: "button", children: (color) => jsx_runtime_1.jsx(canvas_zoom_1.CanvasZoomIcon, { color: color }) })
110
127
  ] }));
111
128
  };
112
129
  exports.TimelineZoomControls = react_1.default.memo(TimelineZoomControlsInner);
@@ -52,11 +52,11 @@ const deleteSequencesFromSource = async (nodePathInfos, confirm) => {
52
52
  if (!result.success) {
53
53
  (0, NotificationCenter_1.showNotification)(result.reason, 4000);
54
54
  }
55
- return true;
55
+ return result.success;
56
56
  })
57
57
  .catch((err) => {
58
58
  (0, NotificationCenter_1.showNotification)(err.message, 4000);
59
- return true;
59
+ return false;
60
60
  });
61
61
  };
62
62
  exports.deleteSequencesFromSource = deleteSequencesFromSource;