@remotion/studio 4.0.522 → 4.0.524

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 (259) hide show
  1. package/dist/api/install-package.js +4 -2
  2. package/dist/components/ActionTooltip.d.ts +9 -0
  3. package/dist/components/ActionTooltip.js +143 -0
  4. package/dist/components/AssetAudioVolume.d.ts +5 -0
  5. package/dist/components/AssetAudioVolume.js +33 -0
  6. package/dist/components/Canvas.js +8 -8
  7. package/dist/components/CaptionInspector.js +74 -20
  8. package/dist/components/CheckboardToggle.js +9 -10
  9. package/dist/components/Checkbox.d.ts +1 -0
  10. package/dist/components/Checkbox.js +2 -2
  11. package/dist/components/CompositionContextButton.js +4 -1
  12. package/dist/components/CompositionSelectorItem.js +2 -2
  13. package/dist/components/ConfigureLicenseModal.js +1 -1
  14. package/dist/components/CurrentAsset.js +40 -6
  15. package/dist/components/EditorContexts.js +3 -1
  16. package/dist/components/ElementInstallConfirmation.js +254 -137
  17. package/dist/components/FixComputedValueModal.js +38 -8
  18. package/dist/components/FullscreenToggle.js +8 -10
  19. package/dist/components/GlobalKeybindings.js +107 -49
  20. package/dist/components/InspectorPanel/MultiSequenceField.d.ts +12 -0
  21. package/dist/components/InspectorPanel/MultiSequenceField.js +131 -0
  22. package/dist/components/InspectorPanel/MultiSequenceInspector.d.ts +8 -0
  23. package/dist/components/InspectorPanel/MultiSequenceInspector.js +102 -0
  24. package/dist/components/InspectorPanel/MultiSequenceNumberField.d.ts +9 -0
  25. package/dist/components/InspectorPanel/MultiSequenceNumberField.js +88 -0
  26. package/dist/components/InspectorPanel.js +4 -0
  27. package/dist/components/InspectorSequenceSection.js +69 -6
  28. package/dist/components/InstallPackage.js +4 -5
  29. package/dist/components/KeyboardShortcutsSettings.js +212 -33
  30. package/dist/components/LazySyntaxHighlightedSource.d.ts +4 -0
  31. package/dist/components/LazySyntaxHighlightedSource.js +43 -0
  32. package/dist/components/LoopToggle.js +8 -2
  33. package/dist/components/MenuToolbar.js +11 -7
  34. package/dist/components/ModalContainer.d.ts +1 -0
  35. package/dist/components/ModalContainer.js +2 -2
  36. package/dist/components/Modals.js +3 -1
  37. package/dist/components/ModelManager.d.ts +16 -0
  38. package/dist/components/ModelManager.js +200 -0
  39. package/dist/components/ModelsSettings.d.ts +2 -0
  40. package/dist/components/ModelsSettings.js +133 -0
  41. package/dist/components/MuteToggle.d.ts +1 -0
  42. package/dist/components/MuteToggle.js +16 -6
  43. package/dist/components/NewComposition/DismissableModal.d.ts +1 -0
  44. package/dist/components/NewComposition/DismissableModal.js +2 -2
  45. package/dist/components/NewComposition/InputDragger.d.ts +2 -2
  46. package/dist/components/NewComposition/InputDragger.js +6 -6
  47. package/dist/components/NewComposition/NewComposition.d.ts +1 -0
  48. package/dist/components/NewComposition/NewComposition.js +5 -4
  49. package/dist/components/NewComposition/NewFolder.js +9 -8
  50. package/dist/components/NewComposition/RenameComposition.js +3 -2
  51. package/dist/components/NewComposition/RenameFolder.js +15 -10
  52. package/dist/components/NewComposition/SlugPreview.d.ts +7 -0
  53. package/dist/components/NewComposition/SlugPreview.js +18 -0
  54. package/dist/components/OptionalPackageModal.d.ts +11 -0
  55. package/dist/components/OptionalPackageModal.js +155 -0
  56. package/dist/components/OutlineToggle.js +16 -10
  57. package/dist/components/PlayPause.js +11 -9
  58. package/dist/components/PlaybackKeyboardShortcutsManager.d.ts +2 -0
  59. package/dist/components/PlaybackKeyboardShortcutsManager.js +39 -7
  60. package/dist/components/PlaybackRateSelector.js +2 -2
  61. package/dist/components/PreviewToolbar.js +1 -1
  62. package/dist/components/PreviewToolbarOverflowButton.js +19 -4
  63. package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +5 -2
  64. package/dist/components/RadioButton.d.ts +1 -0
  65. package/dist/components/RadioButton.js +2 -2
  66. package/dist/components/RenderButton.js +5 -1
  67. package/dist/components/RenderModal/NumberSetting.d.ts +6 -1
  68. package/dist/components/RenderModal/NumberSetting.js +2 -2
  69. package/dist/components/RenderModal/RenderModalBasic.js +1 -1
  70. package/dist/components/RenderModal/RenderModalOutputName.d.ts +3 -1
  71. package/dist/components/RenderModal/RenderModalOutputName.js +4 -4
  72. package/dist/components/RenderModal/SeparateAudioOption.js +1 -1
  73. package/dist/components/RenderModal/WebRenderModalBasic.js +1 -1
  74. package/dist/components/RenderQueue/CaptionQueueItem.d.ts +6 -0
  75. package/dist/components/RenderQueue/CaptionQueueItem.js +130 -0
  76. package/dist/components/RenderQueue/CaptionQueueProcessor.d.ts +1 -0
  77. package/dist/components/RenderQueue/CaptionQueueProcessor.js +110 -0
  78. package/dist/components/RenderQueue/CaptionQueueProcessorLoader.d.ts +2 -0
  79. package/dist/components/RenderQueue/CaptionQueueProcessorLoader.js +54 -0
  80. package/dist/components/RenderQueue/RenderQueueCopyToClipboard.js +2 -1
  81. package/dist/components/RenderQueue/RenderQueueDownloadItem.js +2 -1
  82. package/dist/components/RenderQueue/RenderQueueItem.js +3 -3
  83. package/dist/components/RenderQueue/RenderQueueItemCancelButton.js +2 -1
  84. package/dist/components/RenderQueue/RenderQueueOpenInFolder.js +2 -1
  85. package/dist/components/RenderQueue/RenderQueueRemoveItem.js +2 -1
  86. package/dist/components/RenderQueue/RenderQueueRepeat.js +2 -1
  87. package/dist/components/RenderQueue/VideoMattingQueueItem.d.ts +6 -0
  88. package/dist/components/RenderQueue/VideoMattingQueueItem.js +130 -0
  89. package/dist/components/RenderQueue/VideoMattingQueueProcessor.d.ts +1 -0
  90. package/dist/components/RenderQueue/VideoMattingQueueProcessor.js +105 -0
  91. package/dist/components/RenderQueue/VideoMattingQueueProcessorLoader.d.ts +2 -0
  92. package/dist/components/RenderQueue/VideoMattingQueueProcessorLoader.js +54 -0
  93. package/dist/components/RenderQueue/caption-job-types.d.ts +47 -0
  94. package/dist/components/RenderQueue/caption-job-types.js +7 -0
  95. package/dist/components/RenderQueue/context.d.ts +16 -0
  96. package/dist/components/RenderQueue/context.js +224 -11
  97. package/dist/components/RenderQueue/index.js +34 -10
  98. package/dist/components/RenderQueue/item-style.d.ts +1 -0
  99. package/dist/components/RenderQueue/item-style.js +2 -1
  100. package/dist/components/RenderQueue/load-model-for-job.d.ts +11 -0
  101. package/dist/components/RenderQueue/load-model-for-job.js +14 -0
  102. package/dist/components/RenderQueue/video-matting-job-types.d.ts +38 -0
  103. package/dist/components/RenderQueue/video-matting-job-types.js +5 -0
  104. package/dist/components/RendersTab.js +4 -4
  105. package/dist/components/RulersAndGuidesToggle.js +7 -1
  106. package/dist/components/SegmentedControl.d.ts +2 -2
  107. package/dist/components/SegmentedControl.js +38 -13
  108. package/dist/components/SelectedOutlinePolygon.js +8 -2
  109. package/dist/components/SettingsButton.d.ts +4 -0
  110. package/dist/components/SettingsButton.js +51 -0
  111. package/dist/components/SettingsModal.d.ts +1 -1
  112. package/dist/components/SettingsModal.js +3 -1
  113. package/dist/components/ShowOutlinesProvider.js +12 -0
  114. package/dist/components/SidebarCollapserControls.js +17 -21
  115. package/dist/components/SizeSelector.js +12 -4
  116. package/dist/components/SkillsSettings.js +2 -3
  117. package/dist/components/SnappingToggle.js +9 -8
  118. package/dist/components/StudioSettings.js +32 -18
  119. package/dist/components/SyntaxHighlightedSource.d.ts +5 -0
  120. package/dist/components/SyntaxHighlightedSource.js +78 -0
  121. package/dist/components/Tabs/vertical.d.ts +1 -0
  122. package/dist/components/Tabs/vertical.js +2 -2
  123. package/dist/components/TimeValue.js +2 -3
  124. package/dist/components/Timeline/SequencePropsObserver.js +4 -0
  125. package/dist/components/Timeline/Timeline.js +49 -81
  126. package/dist/components/Timeline/TimelineClipboardKeybindings.js +2 -4
  127. package/dist/components/Timeline/TimelineDeleteKeybindings.js +3 -18
  128. package/dist/components/Timeline/TimelineDragHandler.js +2 -2
  129. package/dist/components/Timeline/TimelineExpandedKeyframeRow.js +1 -0
  130. package/dist/components/Timeline/TimelineLayerChildren.js +12 -9
  131. package/dist/components/Timeline/TimelineRowChrome.js +11 -3
  132. package/dist/components/Timeline/TimelineSchemaField.js +8 -4
  133. package/dist/components/Timeline/TimelineSelection.d.ts +2 -0
  134. package/dist/components/Timeline/TimelineSelection.js +55 -2
  135. package/dist/components/Timeline/TimelineSequence.js +75 -17
  136. package/dist/components/Timeline/TimelineSequenceItem.d.ts +0 -1
  137. package/dist/components/Timeline/TimelineSequenceItem.js +208 -111
  138. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +23 -3
  139. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +73 -25
  140. package/dist/components/Timeline/TimelineTimeIndicators.js +1 -0
  141. package/dist/components/Timeline/TimelineZoomControls.js +2 -1
  142. package/dist/components/Timeline/timeline-field-display-utils.js +8 -5
  143. package/dist/components/Timeline/use-asset-timeline-context-menu.d.ts +2 -0
  144. package/dist/components/Timeline/use-asset-timeline-context-menu.js +52 -0
  145. package/dist/components/TimelineCombobox.d.ts +1 -0
  146. package/dist/components/TimelineCombobox.js +8 -4
  147. package/dist/components/TimelineInOutToggle.js +14 -18
  148. package/dist/components/Transcription/LazyModels.d.ts +1 -0
  149. package/dist/components/Transcription/LazyModels.js +5 -0
  150. package/dist/components/Transcription/Models.d.ts +6 -0
  151. package/dist/components/Transcription/Models.js +18 -0
  152. package/dist/components/Transcription/TranscriptionModal.d.ts +3 -0
  153. package/dist/components/Transcription/TranscriptionModal.js +428 -0
  154. package/dist/components/Transcription/TranscriptionModalWithOptionalWhisper.d.ts +5 -0
  155. package/dist/components/Transcription/TranscriptionModalWithOptionalWhisper.js +48 -0
  156. package/dist/components/Transcription/caption-output-name.d.ts +2 -0
  157. package/dist/components/Transcription/caption-output-name.js +10 -0
  158. package/dist/components/Transcription/resample-media-to-16-khz.d.ts +6 -0
  159. package/dist/components/Transcription/resample-media-to-16-khz.js +82 -0
  160. package/dist/components/Transcription/whisper-languages.d.ts +2 -0
  161. package/dist/components/Transcription/whisper-languages.js +104 -0
  162. package/dist/components/Transcription/whisper-webgpu-capability.d.ts +2 -0
  163. package/dist/components/Transcription/whisper-webgpu-capability.js +7 -0
  164. package/dist/components/UndoRedoButtons.js +13 -38
  165. package/dist/components/UpdatesSettings.js +8 -12
  166. package/dist/components/VideoMatting/LazyModels.d.ts +1 -0
  167. package/dist/components/VideoMatting/LazyModels.js +5 -0
  168. package/dist/components/VideoMatting/Models.d.ts +6 -0
  169. package/dist/components/VideoMatting/Models.js +18 -0
  170. package/dist/components/VideoMatting/VideoMattingModal.d.ts +3 -0
  171. package/dist/components/VideoMatting/VideoMattingModal.js +207 -0
  172. package/dist/components/VideoMatting/VideoMattingModalWithOptionalPackage.d.ts +5 -0
  173. package/dist/components/VideoMatting/VideoMattingModalWithOptionalPackage.js +46 -0
  174. package/dist/components/VideoMatting/video-matting-capability.d.ts +2 -0
  175. package/dist/components/VideoMatting/video-matting-capability.js +7 -0
  176. package/dist/components/WebMcp.js +439 -22
  177. package/dist/components/handle-drop.js +3 -2
  178. package/dist/components/import-assets.d.ts +3 -2
  179. package/dist/components/import-assets.js +5 -9
  180. package/dist/components/keyboard-shortcuts.d.ts +17 -1
  181. package/dist/components/keyboard-shortcuts.js +191 -89
  182. package/dist/components/public-output-name.d.ts +5 -0
  183. package/dist/components/public-output-name.js +60 -0
  184. package/dist/components/use-model-cache-status.d.ts +7 -0
  185. package/dist/components/use-model-cache-status.js +35 -0
  186. package/dist/error-overlay/remotion-overlay/CodeFrame.js +29 -18
  187. package/dist/esm/CaptionQueueProcessor-k0yrm3dj.mjs +211 -0
  188. package/dist/esm/LazyModels-hc33szyn.mjs +11 -0
  189. package/dist/esm/LazyModels-sg40rjw6.mjs +11 -0
  190. package/dist/esm/SyntaxHighlightedSource-3xks91rz.mjs +1236 -0
  191. package/dist/esm/TranscriptionModal-3ctnxpt6.mjs +1011 -0
  192. package/dist/esm/VideoMattingModal-b0r7e60n.mjs +374 -0
  193. package/dist/esm/VideoMattingQueueProcessor-t1hgm2rm.mjs +109 -0
  194. package/dist/esm/index-1b9skrrd.mjs +142 -0
  195. package/dist/esm/index-2j3d1g81.mjs +261 -0
  196. package/dist/esm/index-5zrb1ft4.mjs +39 -0
  197. package/dist/esm/index-7tt71e8n.mjs +36 -0
  198. package/dist/esm/index-9qtvmwtx.mjs +1366 -0
  199. package/dist/esm/index-9x6e1dq0.mjs +428 -0
  200. package/dist/esm/index-c37kme2v.mjs +46209 -0
  201. package/dist/esm/index-cw0pnpg5.mjs +50 -0
  202. package/dist/esm/index-e3zwf3e7.mjs +36 -0
  203. package/dist/esm/index-er3mh6em.mjs +54688 -0
  204. package/dist/esm/{chunk-je0h1bgt.js → index-k426ye99.mjs} +4 -1
  205. package/dist/esm/index-q2epbw93.mjs +423 -0
  206. package/dist/esm/index-q5xv20xx.mjs +41 -0
  207. package/dist/esm/{chunk-6jf1natv.js → index-rcv7qkt5.mjs} +18 -1
  208. package/dist/esm/index-v4tr1bft.mjs +20 -0
  209. package/dist/esm/index-wbmp5srk.mjs +35 -0
  210. package/dist/esm/index-yfrysr5f.mjs +1154 -0
  211. package/dist/esm/index.mjs +45 -933
  212. package/dist/esm/internals.mjs +13 -114393
  213. package/dist/esm/previewEntry.mjs +387 -115050
  214. package/dist/esm/renderEntry.mjs +5 -5
  215. package/dist/esm/{chunk-m0jqdbkr.js → resolve-composition-component-location-bt2d6qxq.mjs} +1 -1
  216. package/dist/helpers/colors.d.ts +1 -0
  217. package/dist/helpers/colors.js +4 -3
  218. package/dist/helpers/drag-aware-double-click.d.ts +2 -1
  219. package/dist/helpers/drag-aware-double-click.js +12 -1
  220. package/dist/helpers/get-asset-metadata.d.ts +1 -0
  221. package/dist/helpers/get-asset-metadata.js +4 -0
  222. package/dist/helpers/hoverable.js +8 -0
  223. package/dist/helpers/inject-css.js +2 -0
  224. package/dist/helpers/optional-package-dependencies.d.ts +3 -0
  225. package/dist/helpers/optional-package-dependencies.js +24 -0
  226. package/dist/helpers/pointer-session.d.ts +6 -0
  227. package/dist/helpers/pointer-session.js +36 -14
  228. package/dist/helpers/prism-vsc-dark-plus.d.ts +1 -0
  229. package/dist/helpers/prism-vsc-dark-plus.js +305 -0
  230. package/dist/helpers/sequence-node-path-mutations.js +11 -0
  231. package/dist/helpers/slugify-name.d.ts +1 -0
  232. package/dist/helpers/slugify-name.js +14 -0
  233. package/dist/helpers/studio-runtime-config.d.ts +1 -0
  234. package/dist/helpers/studio-runtime-config.js +6 -1
  235. package/dist/helpers/use-create-composition.d.ts +1 -0
  236. package/dist/helpers/use-create-composition.js +12 -7
  237. package/dist/helpers/use-keybinding.d.ts +9 -3
  238. package/dist/helpers/use-keybinding.js +8 -9
  239. package/dist/helpers/use-keyboard-shortcut-label.d.ts +2 -0
  240. package/dist/helpers/use-keyboard-shortcut-label.js +15 -0
  241. package/dist/helpers/use-menu-structure.js +59 -14
  242. package/dist/helpers/use-rename-composition.d.ts +1 -0
  243. package/dist/helpers/use-rename-composition.js +11 -5
  244. package/dist/icons/input-props.d.ts +1 -1
  245. package/dist/icons/input-props.js +2 -2
  246. package/dist/icons/models.d.ts +4 -0
  247. package/dist/icons/models.js +7 -0
  248. package/dist/icons/separation.d.ts +4 -0
  249. package/dist/icons/separation.js +7 -0
  250. package/dist/icons/skills.js +1 -1
  251. package/dist/icons/transcription.d.ts +4 -0
  252. package/dist/icons/transcription.js +7 -0
  253. package/dist/icons/upload.js +1 -1
  254. package/dist/renderEntry.js +2 -2
  255. package/dist/state/modals.d.ts +14 -2
  256. package/package.json +35 -21
  257. package/dist/components/UpdateCheck.d.ts +0 -1
  258. package/dist/components/UpdateCheck.js +0 -79
  259. package/dist/esm/chunk-3netyjd9.js +0 -99793
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
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;
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.getTimelineSequenceMediaDurationDragLimits = exports.TimelineSequenceMediaDurationDragLimitsProvider = exports.TimelineSequenceMediaDurationDragLimitsContext = exports.timelineSequenceFromDragSnapThresholdPx = void 0;
37
37
  const jsx_runtime_1 = require("react/jsx-runtime");
38
38
  const canvas_1 = require("@remotion/canvas");
39
39
  const studio_shared_1 = require("@remotion/studio-shared");
@@ -53,6 +53,32 @@ const HANDLE_INSET = 6;
53
53
  const HANDLE_OUTSET = 8;
54
54
  const timelineSequenceEdgeDragThresholdPx = 4;
55
55
  exports.timelineSequenceFromDragSnapThresholdPx = 10;
56
+ exports.TimelineSequenceMediaDurationDragLimitsContext = react_1.default.createContext(null);
57
+ const TimelineSequenceMediaDurationDragLimitsProvider = ({ children }) => {
58
+ const limits = (0, react_1.useRef)(new Map());
59
+ return (jsx_runtime_1.jsx(exports.TimelineSequenceMediaDurationDragLimitsContext.Provider, { value: limits, children: children }));
60
+ };
61
+ exports.TimelineSequenceMediaDurationDragLimitsProvider = TimelineSequenceMediaDurationDragLimitsProvider;
62
+ const getTimelineSequenceMediaDurationDragLimits = ({ cascadedStart, displayDurationInFrames, displayStart, effectiveMaxMediaDuration, explicitDurationInFrames, hasImplicitDuration, naturalMediaDuration, timelineDurationInFrames, }) => {
63
+ if (naturalMediaDuration === null ||
64
+ !Number.isFinite(naturalMediaDuration) ||
65
+ naturalMediaDuration <= 0) {
66
+ return null;
67
+ }
68
+ const initialDuration = explicitDurationInFrames !== null && explicitDurationInFrames !== void 0 ? explicitDurationInFrames : Math.ceil(displayStart +
69
+ Math.max(0, Math.min(displayDurationInFrames, timelineDurationInFrames - displayStart, effectiveMaxMediaDuration !== null && effectiveMaxMediaDuration !== void 0 ? effectiveMaxMediaDuration : Infinity)) -
70
+ cascadedStart);
71
+ const maximumDuration =
72
+ // Keeping duration omitted represents the media's natural end. An
73
+ // explicit duration is only useful once its edge is before that end.
74
+ Math.ceil(displayStart + naturalMediaDuration - cascadedStart) -
75
+ (hasImplicitDuration ? 1 : 0);
76
+ if (hasImplicitDuration && initialDuration > maximumDuration) {
77
+ return null;
78
+ }
79
+ return { initialDuration, maximumDuration };
80
+ };
81
+ exports.getTimelineSequenceMediaDurationDragLimits = getTimelineSequenceMediaDurationDragLimits;
56
82
  const getTimelineSequenceEdgeSelectionInteraction = ({ button, selected, shiftKey, metaKey, ctrlKey, }) => {
57
83
  if (button !== 0 ||
58
84
  !(0, TimelineSelection_1.shouldSelectTimelineRowOnPointerDown)({
@@ -205,14 +231,8 @@ const isTimelineSequenceDurationDraggable = (sequence) => {
205
231
  Boolean(sequence.controls));
206
232
  };
207
233
  exports.isTimelineSequenceDurationDraggable = isTimelineSequenceDurationDraggable;
208
- const canResizeTimelineSequenceDuration = ({ sequence, status, }) => {
209
- if ((status === null || status === void 0 ? void 0 : status.status) !== 'static') {
210
- return false;
211
- }
212
- if (sequence.type === 'audio' || sequence.type === 'video') {
213
- return status.codeValue !== undefined;
214
- }
215
- return true;
234
+ const canResizeTimelineSequenceDuration = ({ status, }) => {
235
+ return (status === null || status === void 0 ? void 0 : status.status) === 'static';
216
236
  };
217
237
  exports.canResizeTimelineSequenceDuration = canResizeTimelineSequenceDuration;
218
238
  const isTimelineSequenceLeftEdgeDraggable = (sequence) => {
@@ -265,7 +285,10 @@ const getTimelineSequenceLeftEdgeDragValues = ({ initialDuration, initialFrom, i
265
285
  return {
266
286
  durationInFrames: initialDuration - clampedDeltaFrames,
267
287
  from: initialFrom + clampedDeltaFrames,
268
- trimBefore: initialTrimBefore + clampedDeltaFrames * playbackRate,
288
+ // Division and multiplication by playbackRate may not cancel exactly.
289
+ trimBefore: clampedDeltaFrames === -initialTrimBefore / playbackRate
290
+ ? 0
291
+ : initialTrimBefore + clampedDeltaFrames * playbackRate,
269
292
  };
270
293
  };
271
294
  exports.getTimelineSequenceLeftEdgeDragValues = getTimelineSequenceLeftEdgeDragValues;
@@ -430,8 +453,9 @@ const findSequenceTrack = ({ tracks, nodePathInfo, }) => {
430
453
  return ((0, studio_shared_1.stringifySequenceExpandedRowKey)(candidate.nodePathInfo.sequenceSubscriptionKey) === key && candidate.nodePathInfo.index === nodePathInfo.index);
431
454
  });
432
455
  };
433
- const getTimelineSequenceDurationDragTargets = ({ draggedNodePathInfo, selectedItems, sequences, overrideIdsToNodePaths, propStatuses, timelineDurationInFrames, }) => {
456
+ const getTimelineSequenceDurationDragTargets = ({ draggedNodePathInfo, draggedSequenceMediaDurationDragLimits, selectedSequenceMediaDurationDragLimits, selectedItems, sequences, overrideIdsToNodePaths, propStatuses, timelineDurationInFrames, }) => {
434
457
  var _a;
458
+ var _b, _c, _d;
435
459
  const draggedSelectionKey = (0, TimelineSelection_1.getTimelineSequenceSelectionKey)(draggedNodePathInfo);
436
460
  const selectedSequenceItems = selectedItems.filter((item) => item.type === 'sequence');
437
461
  const draggedItemIsSelected = selectedSequenceItems.some((item) => (0, TimelineSelection_1.getTimelineSequenceSelectionKey)(item.nodePathInfo) ===
@@ -459,7 +483,6 @@ const getTimelineSequenceDurationDragTargets = ({ draggedNodePathInfo, selectedI
459
483
  const nodePath = track.nodePathInfo.sequenceSubscriptionKey;
460
484
  const durationStatus = (_a = remotion_1.Internals.getPropStatusesCtx(propStatuses, nodePath)) === null || _a === void 0 ? void 0 : _a.durationInFrames;
461
485
  if (!(0, exports.canResizeTimelineSequenceDuration)({
462
- sequence: originalSequence,
463
486
  status: durationStatus,
464
487
  })) {
465
488
  return null;
@@ -470,11 +493,27 @@ const getTimelineSequenceDurationDragTargets = ({ draggedNodePathInfo, selectedI
470
493
  }
471
494
  const key = (0, studio_shared_1.stringifySequenceSubscriptionKey)(nodePath);
472
495
  if (!targets.has(key)) {
496
+ const selectionKey = (0, TimelineSelection_1.getTimelineSequenceSelectionKey)(nodePathInfo);
497
+ const isMedia = originalSequence.type === 'audio' || originalSequence.type === 'video';
498
+ const isDraggedSequence = selectionKey === draggedSelectionKey;
499
+ const mediaDurationDragLimits = isMedia
500
+ ? isDraggedSequence
501
+ ? draggedSequenceMediaDurationDragLimits
502
+ : ((_b = selectedSequenceMediaDurationDragLimits === null || selectedSequenceMediaDurationDragLimits === void 0 ? void 0 : selectedSequenceMediaDurationDragLimits.get(selectionKey)) !== null && _b !== void 0 ? _b : null)
503
+ : null;
504
+ if (isMedia && mediaDurationDragLimits === null) {
505
+ return null;
506
+ }
473
507
  const minimumDuration = Math.max(1 - originalSequence.from, getMinimumSequenceDuration({ sequence: originalSequence, sequences }));
508
+ const initialDuration = (_c = mediaDurationDragLimits === null || mediaDurationDragLimits === void 0 ? void 0 : mediaDurationDragLimits.initialDuration) !== null && _c !== void 0 ? _c : originalSequence.duration;
509
+ const constrainedMaximumDuration = Math.min((_d = mediaDurationDragLimits === null || mediaDurationDragLimits === void 0 ? void 0 : mediaDurationDragLimits.maximumDuration) !== null && _d !== void 0 ? _d : Infinity, timelineDurationInFrames - track.cascadedStart);
510
+ const maximumDuration = isMedia
511
+ ? Math.max(minimumDuration, initialDuration, constrainedMaximumDuration)
512
+ : Math.max(minimumDuration, constrainedMaximumDuration);
474
513
  targets.set(key, {
475
514
  fileName: nodePath.absolutePath,
476
- initialDuration: originalSequence.duration,
477
- maximumDuration: Math.max(minimumDuration, timelineDurationInFrames - track.cascadedStart),
515
+ initialDuration,
516
+ maximumDuration,
478
517
  // A negative start needs enough duration to retain one visible frame.
479
518
  minimumDuration,
480
519
  nodePath,
@@ -1029,12 +1068,10 @@ const useTimelineSequenceFromDrag = ({ nodePathInfo, windowWidth, timelineDurati
1029
1068
  document.body.style.webkitUserSelect = 'none';
1030
1069
  // Register before React commits so no pointer move can arrive before
1031
1070
  // the global session listeners exist.
1032
- stopPointerSessionRef.current = (0, pointer_session_1.startCapturedPointerSession)({
1071
+ stopPointerSessionRef.current = (0, pointer_session_1.startDeferredCapturedPointerSession)({
1033
1072
  event: e.nativeEvent,
1034
- // The bar is removed when it leaves the visible timeline. Capture on
1035
- // a stable element so the move continues until the pointer is released.
1036
1073
  captureTarget: e.currentTarget.ownerDocument.body,
1037
- onMove: (moveEvent) => {
1074
+ onMove: (moveEvent, capturePointer) => {
1038
1075
  const dragState = dragStateRef.current;
1039
1076
  if (!dragState) {
1040
1077
  return;
@@ -1049,6 +1086,10 @@ const useTimelineSequenceFromDrag = ({ nodePathInfo, windowWidth, timelineDurati
1049
1086
  });
1050
1087
  dragState.latestDeltaFrames = deltaFrames;
1051
1088
  if (deltaFrames !== 0) {
1089
+ // The bar can be removed when it leaves the visible timeline.
1090
+ // Capture only after a real drag starts so clicks and double-clicks
1091
+ // remain targeted at the bar.
1092
+ capturePointer();
1052
1093
  dragState.didMove = true;
1053
1094
  }
1054
1095
  for (const target of dragState.targets) {
@@ -1107,18 +1148,20 @@ const useTimelineSequenceFromDrag = ({ nodePathInfo, windowWidth, timelineDurati
1107
1148
  };
1108
1149
  };
1109
1150
  exports.useTimelineSequenceFromDrag = useTimelineSequenceFromDrag;
1110
- const TimelineSequenceRightEdgeDragHandleInner = ({ nodePathInfo, windowWidth, timelineDurationInFrames, onDragEnd, onSelect, selected, }) => {
1151
+ const TimelineSequenceRightEdgeDragHandleInner = ({ nodePathInfo, mediaDurationDragLimits, windowWidth, timelineDurationInFrames, onDragEnd, onSelect, selected, }) => {
1111
1152
  const { setPropStatuses, setDragOverrides, clearDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
1112
1153
  const propStatusesRef = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesRefContext);
1113
1154
  const sequencesRef = (0, react_1.useContext)(remotion_1.Internals.SequenceManagerRefContext);
1114
1155
  const { overrideIdToNodePathMappings } = (0, react_1.useContext)(remotion_1.Internals.OverrideIdsToNodePathsGettersContext);
1115
1156
  const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
1116
1157
  const currentSelection = (0, TimelineSelection_1.useCurrentTimelineSelectionStateAsRef)();
1158
+ const mediaDurationDragLimitsRegistry = (0, react_1.useContext)(exports.TimelineSequenceMediaDurationDragLimitsContext);
1117
1159
  const stopPointerSessionRef = (0, react_1.useRef)(null);
1118
1160
  const dragStateRef = (0, react_1.useRef)(null);
1119
1161
  // Keep latest props/setters available to window listeners installed once at pointerdown.
1120
1162
  const latestRef = (0, react_1.useRef)({
1121
1163
  nodePathInfo,
1164
+ mediaDurationDragLimits,
1122
1165
  setPropStatuses,
1123
1166
  setDragOverrides,
1124
1167
  clearDragOverrides,
@@ -1129,6 +1172,7 @@ const TimelineSequenceRightEdgeDragHandleInner = ({ nodePathInfo, windowWidth, t
1129
1172
  });
1130
1173
  latestRef.current = {
1131
1174
  nodePathInfo,
1175
+ mediaDurationDragLimits,
1132
1176
  setPropStatuses,
1133
1177
  setDragOverrides,
1134
1178
  clearDragOverrides,
@@ -1190,7 +1234,7 @@ const TimelineSequenceRightEdgeDragHandleInner = ({ nodePathInfo, windowWidth, t
1190
1234
  }, []);
1191
1235
  const onPointerDown = (0, react_1.useCallback)((e) => {
1192
1236
  var _a;
1193
- var _b;
1237
+ var _b, _c;
1194
1238
  if (e.button !== 0) {
1195
1239
  return;
1196
1240
  }
@@ -1207,17 +1251,19 @@ const TimelineSequenceRightEdgeDragHandleInner = ({ nodePathInfo, windowWidth, t
1207
1251
  ? (windowWidth - timeline_layout_1.TIMELINE_PADDING * 2) / timelineDurationInFrames
1208
1252
  : 0;
1209
1253
  const canCalculateDelta = Number.isFinite(pxPerFrame) && pxPerFrame > 0;
1210
- const { nodePathInfo: latestNodePathInfo, overrideIdToNodePathMappings: latestOverrideIdsToNodePaths, } = latestRef.current;
1254
+ const { nodePathInfo: latestNodePathInfo, mediaDurationDragLimits: latestMediaDurationDragLimits, overrideIdToNodePathMappings: latestOverrideIdsToNodePaths, } = latestRef.current;
1211
1255
  const { selectedItems: latestSelectedItems } = currentSelection.current;
1212
1256
  const targets = canCalculateDelta
1213
- ? ((_b = (0, exports.getTimelineSequenceDurationDragTargets)({
1257
+ ? ((_c = (0, exports.getTimelineSequenceDurationDragTargets)({
1214
1258
  draggedNodePathInfo: latestNodePathInfo,
1259
+ draggedSequenceMediaDurationDragLimits: latestMediaDurationDragLimits,
1260
+ selectedSequenceMediaDurationDragLimits: (_b = mediaDurationDragLimitsRegistry === null || mediaDurationDragLimitsRegistry === void 0 ? void 0 : mediaDurationDragLimitsRegistry.current) !== null && _b !== void 0 ? _b : null,
1215
1261
  selectedItems: latestSelectedItems,
1216
1262
  sequences: sequencesRef.current,
1217
1263
  overrideIdsToNodePaths: latestOverrideIdsToNodePaths,
1218
1264
  propStatuses: propStatusesRef.current,
1219
1265
  timelineDurationInFrames,
1220
- })) !== null && _b !== void 0 ? _b : [])
1266
+ })) !== null && _c !== void 0 ? _c : [])
1221
1267
  : [];
1222
1268
  (_a = stopPointerSessionRef.current) === null || _a === void 0 ? void 0 : _a.call(stopPointerSessionRef);
1223
1269
  dragStateRef.current = {
@@ -1248,12 +1294,13 @@ const TimelineSequenceRightEdgeDragHandleInner = ({ nodePathInfo, windowWidth, t
1248
1294
  dragState.didMove = true;
1249
1295
  }
1250
1296
  for (const target of dragState.targets) {
1251
- latestRef.current.setDragOverrides(target.nodePath, 'durationInFrames', remotion_1.Internals.makeStaticDragOverride((0, exports.getTimelineSequenceDurationDragValue)({
1297
+ const previewValue = (0, exports.getTimelineSequenceDurationDragValue)({
1252
1298
  initialDuration: target.initialDuration,
1253
1299
  deltaFrames,
1254
1300
  maximumDuration: target.maximumDuration,
1255
1301
  minimumDuration: target.minimumDuration,
1256
- })));
1302
+ });
1303
+ latestRef.current.setDragOverrides(target.nodePath, 'durationInFrames', remotion_1.Internals.makeStaticDragOverride(previewValue));
1257
1304
  }
1258
1305
  };
1259
1306
  const onUp = (pointerEvent) => {
@@ -1295,6 +1342,7 @@ const TimelineSequenceRightEdgeDragHandleInner = ({ nodePathInfo, windowWidth, t
1295
1342
  }, [
1296
1343
  currentSelection,
1297
1344
  finishDrag,
1345
+ mediaDurationDragLimitsRegistry,
1298
1346
  propStatusesRef,
1299
1347
  selected,
1300
1348
  sequencesRef,
@@ -295,6 +295,7 @@ const TimelineTimeIndicatorsInner = react_1.default.memo(({ windowWidth, duratio
295
295
  return {
296
296
  ...container,
297
297
  width: windowWidth,
298
+ minWidth: '100%',
298
299
  overflow: 'hidden',
299
300
  pointerEvents: 'none',
300
301
  };
@@ -44,6 +44,7 @@ const is_current_selected_still_1 = require("../../helpers/is-current-selected-s
44
44
  const canvas_zoom_1 = require("../../icons/canvas-zoom");
45
45
  const timeline_zoom_1 = require("../../state/timeline-zoom");
46
46
  const z_index_1 = require("../../state/z-index");
47
+ const ActionTooltip_1 = require("../ActionTooltip");
47
48
  const ControlButton_1 = require("../ControlButton");
48
49
  const layout_1 = require("../layout");
49
50
  const timeline_refs_1 = require("./timeline-refs");
@@ -123,7 +124,7 @@ const TimelineZoomControlsInner = ({ sliderMaxWidth }) => {
123
124
  return null;
124
125
  }
125
126
  return (jsx_runtime_1.jsxs("div", { style: container, children: [
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 }) })
127
+ jsx_runtime_1.jsx(ActionTooltip_1.ActionTooltip, { label: "Zoom out timeline", shortcut: null, delay: 800, dismissOnClick: true, children: jsx_runtime_1.jsx(ControlButton_1.ControlButton, { onClick: onMinusClicked, style: buttonStyle, title: "", "aria-label": "Zoom out timeline", 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(ActionTooltip_1.ActionTooltip, { label: "Zoom in timeline", shortcut: null, delay: 800, dismissOnClick: true, children: jsx_runtime_1.jsx(ControlButton_1.ControlButton, { onClick: onPlusClicked, style: buttonStyle, title: "", "aria-label": "Zoom in timeline", type: "button", children: (color) => jsx_runtime_1.jsx(canvas_zoom_1.CanvasZoomIcon, { color: color }) }) })
127
128
  ] }));
128
129
  };
129
130
  exports.TimelineZoomControls = react_1.default.memo(TimelineZoomControlsInner);
@@ -95,11 +95,14 @@ const formatNumberTimelineFieldValueForDisplay = ({ fieldSchema, value, }) => {
95
95
  const digits = (0, timeline_field_utils_1.getDecimalPlaces)(numericValue);
96
96
  return digits === 0 ? String(numericValue) : numericValue.toFixed(digits);
97
97
  }
98
- return (0, timeline_field_utils_1.formatTimelineNumber)({
99
- decimalPlaces: stepDecimals,
100
- fixed: true,
101
- value: numericValue,
102
- });
98
+ // The step controls increments, not the precision of source or typed values.
99
+ // Keep finer values while trimming floating point noise.
100
+ const normalizedValue = (0, timeline_field_utils_1.getDecimalPlaces)(numericValue) > stepDecimals
101
+ ? Number(numericValue.toPrecision(15))
102
+ : numericValue;
103
+ return (0, timeline_field_utils_1.getDecimalPlaces)(normalizedValue) > stepDecimals
104
+ ? String(normalizedValue)
105
+ : normalizedValue.toFixed(stepDecimals);
103
106
  };
104
107
  const formatRotationTimelineFieldValueForDisplay = ({ fieldSchema, value, }) => {
105
108
  const configuredStep = fieldSchema.type === 'rotation-css' ||
@@ -0,0 +1,2 @@
1
+ import type { ComboboxValue } from '../NewComposition/ComboBox';
2
+ export declare const useAssetTimelineContextMenu: () => ComboboxValue[] | null;
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useAssetTimelineContextMenu = void 0;
4
+ const react_1 = require("react");
5
+ const remotion_1 = require("remotion");
6
+ const browser_studio_operations_1 = require("../../helpers/browser-studio-operations");
7
+ const client_id_1 = require("../../helpers/client-id");
8
+ const get_file_manager_name_1 = require("../../helpers/get-file-manager-name");
9
+ const NotificationCenter_1 = require("../Notifications/NotificationCenter");
10
+ const actions_1 = require("../RenderQueue/actions");
11
+ const get_copy_context_for_agents_menu_item_1 = require("./get-copy-context-for-agents-menu-item");
12
+ const useAssetTimelineContextMenu = () => {
13
+ const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
14
+ const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
15
+ return (0, react_1.useMemo)(() => {
16
+ if ((canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) !== 'asset') {
17
+ return null;
18
+ }
19
+ const copyContextItem = (0, get_copy_context_for_agents_menu_item_1.getCopyContextForAgentsMenuItem)({
20
+ contextForAgents: window.remotion_publicFolderExists
21
+ ? `Asset: ${window.remotion_publicFolderExists}/${canvasContent.asset}`
22
+ : `Asset: staticFile(${JSON.stringify(canvasContent.asset)})`,
23
+ });
24
+ if ((0, browser_studio_operations_1.getBrowserStudioOperations)() !== null) {
25
+ return [copyContextItem];
26
+ }
27
+ return [
28
+ {
29
+ type: 'item',
30
+ id: 'open-asset-in-explorer',
31
+ label: `Show in ${(0, get_file_manager_name_1.getFileManagerName)(window.remotion_fileSystemPlatform)}`,
32
+ keyHint: null,
33
+ leftItem: null,
34
+ quickSwitcherLabel: null,
35
+ subMenu: null,
36
+ value: 'open-asset-in-explorer',
37
+ disabled: Boolean(window.remotion_isReadOnlyStudio) ||
38
+ !window.remotion_publicFolderExists ||
39
+ previewServerState.type !== 'connected',
40
+ onClick: () => {
41
+ (0, actions_1.openInFileExplorer)({
42
+ directory: window.remotion_publicFolderExists + '/' + canvasContent.asset,
43
+ }).catch((err) => {
44
+ (0, NotificationCenter_1.showNotification)(`Could not open file: ${err.message}`, 2000);
45
+ });
46
+ },
47
+ },
48
+ copyContextItem,
49
+ ];
50
+ }, [canvasContent, previewServerState.type]);
51
+ };
52
+ exports.useAssetTimelineContextMenu = useAssetTimelineContextMenu;
@@ -5,6 +5,7 @@ export declare const TimelineCombobox: React.FC<{
5
5
  readonly values: ComboboxValue[];
6
6
  readonly selectedId: string | number;
7
7
  readonly title: string;
8
+ readonly tooltipDelay: number | null;
8
9
  readonly labelWidth?: number;
9
10
  readonly renderLeftItem?: RenderInlineAction;
10
11
  readonly unhoveredIconColor?: string;
@@ -4,6 +4,7 @@ exports.TimelineCombobox = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const colors_1 = require("../helpers/colors");
6
6
  const caret_1 = require("../icons/caret");
7
+ const ActionTooltip_1 = require("./ActionTooltip");
7
8
  const layout_1 = require("./layout");
8
9
  const SegmentedButton_1 = require("./SegmentedButton");
9
10
  const segmentedButtonStyle = {
@@ -21,7 +22,7 @@ const label = {
21
22
  userSelect: 'none',
22
23
  whiteSpace: 'nowrap',
23
24
  };
24
- const TimelineCombobox = ({ values, selectedId, title, labelWidth = 32, renderLeftItem, unhoveredIconColor = colors_1.LIGHT_TEXT, }) => {
25
+ const TimelineCombobox = ({ values, selectedId, title, tooltipDelay, labelWidth = 32, renderLeftItem, unhoveredIconColor = colors_1.LIGHT_TEXT, }) => {
25
26
  const selected = values.find((value) => value.id === selectedId);
26
27
  const segments = [
27
28
  {
@@ -32,16 +33,19 @@ const TimelineCombobox = ({ values, selectedId, title, labelWidth = 32, renderLe
32
33
  leaveLeftSpace: true,
33
34
  onOpenChange: null,
34
35
  renderContent: (color) => (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [renderLeftItem ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [renderLeftItem(color), jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 })
35
- ] })) : null, selected ? (jsx_runtime_1.jsx("div", { title: typeof selected.label === 'string' ? selected.label : undefined, style: { ...label, width: labelWidth }, children: selected.label })) : null, jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }), jsx_runtime_1.jsx(caret_1.CaretDown, { color: color })
36
+ ] })) : null, selected ? (jsx_runtime_1.jsx("div", { title: tooltipDelay === null && typeof selected.label === 'string'
37
+ ? selected.label
38
+ : undefined, style: { ...label, width: labelWidth }, children: selected.label })) : null, jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }), jsx_runtime_1.jsx(caret_1.CaretDown, { color: color })
36
39
  ] })),
37
40
  segmentId: 'selector',
38
41
  selectedId,
39
42
  style: { fontFamily: 'inherit', padding: '0 4px' },
40
- title,
43
+ title: tooltipDelay === null ? title : null,
41
44
  type: 'menu',
42
45
  values,
43
46
  },
44
47
  ];
45
- return (jsx_runtime_1.jsx(SegmentedButton_1.SegmentedButton, { segments: segments, style: segmentedButtonStyle, title: null }));
48
+ const button = (jsx_runtime_1.jsx(SegmentedButton_1.SegmentedButton, { segments: segments, style: segmentedButtonStyle, title: null }));
49
+ return tooltipDelay === null ? (button) : (jsx_runtime_1.jsx(ActionTooltip_1.ActionTooltip, { label: title, shortcut: null, delay: tooltipDelay, dismissOnClick: true, children: button }));
46
50
  };
47
51
  exports.TimelineCombobox = TimelineCombobox;
@@ -5,19 +5,13 @@ 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 no_react_1 = require("remotion/no-react");
9
8
  const colors_1 = require("../helpers/colors");
10
9
  const use_keybinding_1 = require("../helpers/use-keybinding");
10
+ const use_keyboard_shortcut_label_1 = require("../helpers/use-keyboard-shortcut-label");
11
11
  const timelineInOutPointer_1 = require("../icons/timelineInOutPointer");
12
12
  const in_out_1 = require("../state/in-out");
13
+ const ActionTooltip_1 = require("./ActionTooltip");
13
14
  const ControlButton_1 = require("./ControlButton");
14
- const getTooltipText = (pointType, key) => [
15
- `Mark ${pointType}`,
16
- (0, use_keybinding_1.areKeyboardShortcutsDisabled)() ? null : `(${key})`,
17
- '- right click to clear',
18
- ]
19
- .filter(no_react_1.NoReactInternals.truthy)
20
- .join(' ');
21
15
  const style = {
22
16
  width: 17,
23
17
  height: 17,
@@ -29,6 +23,11 @@ exports.inOutHandles = (0, react_1.createRef)();
29
23
  exports.defaultInOutValue = { inFrame: null, outFrame: null };
30
24
  const TimelineInOutPointToggle = () => {
31
25
  var _a;
26
+ const inShortcut = (0, use_keyboard_shortcut_label_1.useKeyboardShortcutLabel)('setInPoint');
27
+ const outShortcut = (0, use_keyboard_shortcut_label_1.useKeyboardShortcutLabel)('setOutPoint');
28
+ const inAriaShortcut = (0, use_keyboard_shortcut_label_1.useKeyboardShortcutAriaKeyShortcuts)('setInPoint');
29
+ const outAriaShortcut = (0, use_keyboard_shortcut_label_1.useKeyboardShortcutAriaKeyShortcuts)('setOutPoint');
30
+ const shortcutsDisabled = (0, use_keybinding_1.areKeyboardShortcutsDisabled)();
32
31
  const { inFrame, outFrame } = (0, in_out_1.useTimelineInOutFramePosition)();
33
32
  const { setInAndOutFrames } = (0, in_out_1.useTimelineSetInOutFramePosition)();
34
33
  const videoConfig = remotion_1.Internals.useUnsafeVideoConfig();
@@ -195,34 +194,31 @@ const TimelineInOutPointToggle = () => {
195
194
  return;
196
195
  }
197
196
  const iKey = keybindings.registerKeybinding({
198
- event: 'keypress',
199
- key: 'i',
197
+ event: 'keydown',
198
+ action: 'setInPoint',
200
199
  callback: (e) => {
201
200
  onInMark(e);
202
201
  },
203
- commandCtrlKey: false,
204
202
  preventDefault: true,
205
203
  triggerIfInputFieldFocused: false,
206
204
  keepRegisteredWhenNotHighestContext: false,
207
205
  });
208
206
  const oKey = keybindings.registerKeybinding({
209
- event: 'keypress',
210
- key: 'o',
207
+ event: 'keydown',
208
+ action: 'setOutPoint',
211
209
  callback: (e) => {
212
210
  onOutMark(e);
213
211
  },
214
- commandCtrlKey: false,
215
212
  preventDefault: true,
216
213
  triggerIfInputFieldFocused: false,
217
214
  keepRegisteredWhenNotHighestContext: false,
218
215
  });
219
216
  const xKey = keybindings.registerKeybinding({
220
- event: 'keypress',
221
- key: 'x',
217
+ event: 'keydown',
218
+ action: 'clearInOutPoints',
222
219
  callback: () => {
223
220
  onInOutClear(confId);
224
221
  },
225
- commandCtrlKey: false,
226
222
  preventDefault: true,
227
223
  triggerIfInputFieldFocused: false,
228
224
  keepRegisteredWhenNotHighestContext: false,
@@ -246,7 +242,7 @@ const TimelineInOutPointToggle = () => {
246
242
  };
247
243
  }, [confId, onInMark, onInOutClear, onOutMark]);
248
244
  return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
249
- jsx_runtime_1.jsx(ControlButton_1.ControlButton, { title: getTooltipText('In', 'I'), "aria-label": getTooltipText('In', 'I'), style: buttonStyle, onClick: onInMark, onContextMenu: clearInMark, disabled: !videoConfig || isFirstFrame, children: (color) => (jsx_runtime_1.jsx(timelineInOutPointer_1.TimelineInPointer, { color: inFrame === null ? color : colors_1.BLUE, style: style })) }), jsx_runtime_1.jsx(ControlButton_1.ControlButton, { title: getTooltipText('Out', 'O'), "aria-label": getTooltipText('Out', 'O'), style: buttonStyle, onClick: onOutMark, onContextMenu: clearOutMark, disabled: !videoConfig || isLastFrame, children: (color) => (jsx_runtime_1.jsx(timelineInOutPointer_1.TimelineOutPointer, { color: outFrame === null ? color : colors_1.BLUE, style: style })) })
245
+ jsx_runtime_1.jsx(ActionTooltip_1.ActionTooltip, { label: "In point", shortcut: shortcutsDisabled ? null : inShortcut, delay: 800, dismissOnClick: true, children: jsx_runtime_1.jsx(ControlButton_1.ControlButton, { title: "", "aria-label": "In point", "aria-description": "Right click to clear", "aria-keyshortcuts": shortcutsDisabled ? undefined : inAriaShortcut || undefined, style: buttonStyle, onClick: onInMark, onContextMenu: clearInMark, disabled: !videoConfig || isFirstFrame, children: (color) => (jsx_runtime_1.jsx(timelineInOutPointer_1.TimelineInPointer, { color: inFrame === null ? color : colors_1.BLUE, style: style })) }) }), jsx_runtime_1.jsx(ActionTooltip_1.ActionTooltip, { label: "Out point", shortcut: shortcutsDisabled ? null : outShortcut, delay: 800, dismissOnClick: true, children: jsx_runtime_1.jsx(ControlButton_1.ControlButton, { title: "", "aria-label": "Out point", "aria-description": "Right click to clear", "aria-keyshortcuts": shortcutsDisabled ? undefined : outAriaShortcut || undefined, style: buttonStyle, onClick: onOutMark, onContextMenu: clearOutMark, disabled: !videoConfig || isLastFrame, children: (color) => (jsx_runtime_1.jsx(timelineInOutPointer_1.TimelineOutPointer, { color: outFrame === null ? color : colors_1.BLUE, style: style })) }) })
250
246
  ] }));
251
247
  };
252
248
  exports.TimelineInOutPointToggle = TimelineInOutPointToggle;
@@ -0,0 +1 @@
1
+ export { Models as default } from './Models';
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = void 0;
4
+ const Models_1 = require("./Models");
5
+ Object.defineProperty(exports, "default", { enumerable: true, get: function () { return Models_1.Models; } });
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ export declare const Models: React.FC<{
3
+ readonly description: string | null;
4
+ readonly indent: boolean;
5
+ readonly visible: boolean;
6
+ }>;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Models = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const whisper_webgpu_1 = require("@remotion/whisper-webgpu");
6
+ const react_1 = require("react");
7
+ const ModelManager_1 = require("../ModelManager");
8
+ const AVAILABLE_MODELS = (0, whisper_webgpu_1.getAvailableModels)();
9
+ const Models = ({ description, indent, visible }) => {
10
+ const isModelCached = (0, react_1.useCallback)((model) => (0, whisper_webgpu_1.isWhisperModelCached)({ model }), []);
11
+ const loadModel = (0, react_1.useCallback)((model, onProgress) => (0, whisper_webgpu_1.loadWhisperModel)({
12
+ model,
13
+ onProgress: (progress) => onProgress(progress.progress),
14
+ }), []);
15
+ const removeModel = (0, react_1.useCallback)((model) => (0, whisper_webgpu_1.removeWhisperModel)({ model }), []);
16
+ return (jsx_runtime_1.jsx(ModelManager_1.ModelManager, { ariaLabel: "Whisper models", availableModels: AVAILABLE_MODELS, description: description, indent: indent, isModelCached: isModelCached, loadModel: loadModel, prepare: whisper_webgpu_1.clearStaleModels, removeModel: removeModel, visible: visible }));
17
+ };
18
+ exports.Models = Models;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import type { TranscriptionModalState } from '../../state/modals';
3
+ export declare const TranscriptionModal: React.FC<TranscriptionModalState>;