@remotion/studio 4.0.527 → 4.0.529

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 (367) hide show
  1. package/dist/Studio.js +2 -0
  2. package/dist/components/AgentPrompt.js +3 -4
  3. package/dist/components/AppLaunchButton.d.ts +0 -1
  4. package/dist/components/AppLaunchButton.js +2 -5
  5. package/dist/components/AssetAudioVolume.js +2 -2
  6. package/dist/components/AssetSelectorItem.js +5 -5
  7. package/dist/components/AudioWaveform.d.ts +1 -0
  8. package/dist/components/AudioWaveform.js +10 -14
  9. package/dist/components/Button.d.ts +1 -1
  10. package/dist/components/Button.js +2 -2
  11. package/dist/components/CaptionInspector.js +1 -1
  12. package/dist/components/CaptionTextEditor.js +1 -1
  13. package/dist/components/CheckboardToggle.js +1 -1
  14. package/dist/components/CodeFrame.js +1 -1
  15. package/dist/components/CodingAgentButton.js +1 -1
  16. package/dist/components/ColorPicker/ColorPicker.d.ts +1 -1
  17. package/dist/components/ColorPicker/ColorPicker.js +2 -2
  18. package/dist/components/ColorPicker/ColorPickerPopup.js +1 -1
  19. package/dist/components/ColorPicker/checker.d.ts +1 -1
  20. package/dist/components/CompactExplanation.js +3 -3
  21. package/dist/components/CompositionSelectorItem.js +2 -2
  22. package/dist/components/ConfigSelect.js +1 -1
  23. package/dist/components/ConfigureDefaultEditorModal.js +2 -2
  24. package/dist/components/ControlButton.d.ts +0 -1
  25. package/dist/components/ControlButton.js +2 -2
  26. package/dist/components/CurrentAsset.js +4 -3
  27. package/dist/components/EditorRuler/Ruler.js +6 -3
  28. package/dist/components/EffectPickerModal.js +69 -43
  29. package/dist/components/ElementInstallConfirmation.js +3 -3
  30. package/dist/components/ElementLibrariesSettings.d.ts +2 -0
  31. package/dist/components/ElementLibrariesSettings.js +200 -0
  32. package/dist/components/ElementLibraryModal.js +1 -1
  33. package/dist/components/FramePersistor.js +3 -3
  34. package/dist/components/FullscreenToggle.js +1 -1
  35. package/dist/components/InitialCompositionLoader.js +5 -3
  36. package/dist/components/InlineAction.d.ts +2 -2
  37. package/dist/components/InlineAction.js +2 -3
  38. package/dist/components/InlineEditableTitle.d.ts +1 -1
  39. package/dist/components/InlineEditableTitle.js +3 -3
  40. package/dist/components/InspectorLocationCopy.js +1 -1
  41. package/dist/components/InspectorOpenInEditor.js +14 -3
  42. package/dist/components/InspectorPanel/AlignmentControls.js +31 -12
  43. package/dist/components/InspectorPanel/CollapsibleInspectorSectionHeader.js +1 -1
  44. package/dist/components/InspectorPanel/CompositionInspector.js +1 -5
  45. package/dist/components/InspectorPanel/CompositionMetadata.js +4 -4
  46. package/dist/components/InspectorPanel/EasingInspector.js +7 -3
  47. package/dist/components/InspectorPanel/ElementLibraryButton.js +3 -14
  48. package/dist/components/InspectorPanel/KeyframeEasingNavigator.js +6 -8
  49. package/dist/components/InspectorPanel/KeyframeInspector.js +29 -25
  50. package/dist/components/InspectorPanel/KeyframeSettings.js +16 -11
  51. package/dist/components/InspectorPanel/MultiSequenceField.js +1 -1
  52. package/dist/components/InspectorPanel/MultiSequenceInspector.js +2 -7
  53. package/dist/components/InspectorPanel/MultiSequenceNumberField.js +2 -2
  54. package/dist/components/InspectorPanel/SequenceInspectorHeader.d.ts +3 -1
  55. package/dist/components/InspectorPanel/SequenceInspectorHeader.js +1 -1
  56. package/dist/components/InspectorPanel/SequenceSelectionInspector.js +33 -14
  57. package/dist/components/InspectorPanel/SequenceWrapAction.d.ts +8 -0
  58. package/dist/components/InspectorPanel/SequenceWrapAction.js +143 -0
  59. package/dist/components/InspectorPanel/common.d.ts +6 -2
  60. package/dist/components/InspectorPanel/common.js +25 -9
  61. package/dist/components/InspectorPanel/easing-inspector-selection.d.ts +2 -1
  62. package/dist/components/InspectorPanel/easing-inspector-selection.js +4 -3
  63. package/dist/components/InspectorPanel/keyframe-inspector-frame.d.ts +2 -1
  64. package/dist/components/InspectorPanel/keyframe-inspector-frame.js +2 -2
  65. package/dist/components/InspectorSequenceSection.d.ts +1 -0
  66. package/dist/components/InspectorSequenceSection.js +12 -10
  67. package/dist/components/InspectorSourceLocation.js +2 -2
  68. package/dist/components/KeyboardShortcutsSettings.js +2 -2
  69. package/dist/components/LicenseKeyValidation.js +2 -2
  70. package/dist/components/LoopToggle.js +1 -1
  71. package/dist/components/Menu/MenuSubItem.js +4 -2
  72. package/dist/components/Menu/styles.d.ts +2 -2
  73. package/dist/components/MenuBuildIndicator.js +1 -1
  74. package/dist/components/MenuCompositionName.js +1 -1
  75. package/dist/components/Modals.js +7 -6
  76. package/dist/components/ModelManager.js +10 -9
  77. package/dist/components/MuteToggle.js +1 -1
  78. package/dist/components/NewComposition/CancelButton.js +10 -4
  79. package/dist/components/NewComposition/ComboBox.d.ts +1 -1
  80. package/dist/components/NewComposition/ComboBox.js +2 -2
  81. package/dist/components/NewComposition/DuplicateComposition.js +1 -1
  82. package/dist/components/NewComposition/InputDragger.d.ts +4 -2
  83. package/dist/components/NewComposition/InputDragger.js +29 -10
  84. package/dist/components/NewComposition/NewComposition.js +8 -7
  85. package/dist/components/NewComposition/RemInput.d.ts +1 -1
  86. package/dist/components/NewComposition/menu-typeahead.js +1 -1
  87. package/dist/components/OpenIssueButton.js +1 -1
  88. package/dist/components/OutlineToggle.js +1 -1
  89. package/dist/components/PlayPause.js +1 -1
  90. package/dist/components/PlaybackRateSelector.js +1 -1
  91. package/dist/components/PreviewToolbarOverflowButton.js +1 -1
  92. package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +1 -1
  93. package/dist/components/RenderButton.js +2 -4
  94. package/dist/components/RenderModal/InfoBubble.d.ts +1 -1
  95. package/dist/components/RenderModal/InfoBubble.js +2 -2
  96. package/dist/components/RenderModal/NumberSetting.js +1 -1
  97. package/dist/components/RenderModal/OptionExplainerBubble.js +2 -2
  98. package/dist/components/RenderModal/RenderModalAdvanced.js +2 -2
  99. package/dist/components/RenderModal/RenderModalAudio.js +2 -2
  100. package/dist/components/RenderModal/RenderModalBasic.js +3 -3
  101. package/dist/components/RenderModal/RenderModalEncoding.js +4 -4
  102. package/dist/components/RenderModal/RenderModalOutputName.js +1 -1
  103. package/dist/components/RenderModal/SchemaEditor/SchemaLabel.js +1 -1
  104. package/dist/components/RenderModal/SchemaEditor/ZodDiscriminatedUnionEditor.js +1 -1
  105. package/dist/components/RenderModal/SchemaEditor/ZodEnumEditor.js +1 -1
  106. package/dist/components/RenderModal/SchemaEditor/ZodFieldValidation.js +1 -1
  107. package/dist/components/RenderModal/SchemaEditor/ZodStaticFileEditor.js +1 -1
  108. package/dist/components/RenderModal/SchemaEditor/create-zod-values.js +1 -2
  109. package/dist/components/RenderModal/WebRenderModalAdvanced.js +2 -2
  110. package/dist/components/RenderModal/WebRenderModalAudio.js +2 -2
  111. package/dist/components/RenderModal/WebRenderModalBasic.js +3 -3
  112. package/dist/components/RenderModal/WebRenderModalPicture.js +2 -3
  113. package/dist/components/RenderQueue/CaptionQueueItem.js +14 -5
  114. package/dist/components/RenderQueue/CaptionQueueProcessor.js +30 -7
  115. package/dist/components/RenderQueue/QueueJobError.d.ts +8 -0
  116. package/dist/components/RenderQueue/QueueJobError.js +24 -0
  117. package/dist/components/RenderQueue/QueueJobErrorModal.d.ts +8 -0
  118. package/dist/components/RenderQueue/QueueJobErrorModal.js +63 -0
  119. package/dist/components/RenderQueue/RenderQueueError.js +1 -1
  120. package/dist/components/RenderQueue/RenderQueueItemCancelButton.d.ts +3 -1
  121. package/dist/components/RenderQueue/RenderQueueItemCancelButton.js +11 -4
  122. package/dist/components/RenderQueue/RenderQueueOutputName.js +1 -1
  123. package/dist/components/RenderQueue/RenderQueueProgressMessage.js +1 -1
  124. package/dist/components/RenderQueue/RenderQueueRepeat.d.ts +3 -1
  125. package/dist/components/RenderQueue/RenderQueueRepeat.js +20 -3
  126. package/dist/components/RenderQueue/VideoMattingQueueItem.js +24 -27
  127. package/dist/components/RenderQueue/VideoMattingQueueProcessor.js +68 -28
  128. package/dist/components/RenderQueue/caption-job-types.d.ts +3 -1
  129. package/dist/components/RenderQueue/context.d.ts +4 -0
  130. package/dist/components/RenderQueue/context.js +58 -8
  131. package/dist/components/RenderQueue/index.js +2 -3
  132. package/dist/components/RenderQueue/load-model-for-job.d.ts +2 -1
  133. package/dist/components/RenderQueue/load-model-for-job.js +5 -1
  134. package/dist/components/RenderQueue/video-matting-job-types.d.ts +13 -6
  135. package/dist/components/RenderingSettings.js +6 -6
  136. package/dist/components/RulersAndGuidesToggle.js +1 -1
  137. package/dist/components/SegmentedButton.d.ts +0 -2
  138. package/dist/components/SegmentedButton.js +6 -6
  139. package/dist/components/SelectedOutlineCropControls.js +2 -1
  140. package/dist/components/SelectedOutlineEditingHandles.js +9 -2
  141. package/dist/components/SelectedOutlineElement.js +9 -3
  142. package/dist/components/SelectedOutlineKeyboardControls.d.ts +2 -4
  143. package/dist/components/SelectedOutlineKeyboardControls.js +4 -22
  144. package/dist/components/SelectedOutlineOverlay.js +165 -106
  145. package/dist/components/SelectedOutlinePathPoints.d.ts +8 -0
  146. package/dist/components/SelectedOutlinePathPoints.js +457 -0
  147. package/dist/components/SelectedOutlinePolygon.js +21 -46
  148. package/dist/components/SelectedOutlineRenderer.d.ts +3 -5
  149. package/dist/components/SelectedOutlineRenderer.js +32 -136
  150. package/dist/components/SelectedOutlineTransformOriginHandle.js +3 -2
  151. package/dist/components/SelectedOutlineUvControls.js +12 -7
  152. package/dist/components/SettingsButton.js +1 -1
  153. package/dist/components/SettingsModal.js +30 -3
  154. package/dist/components/SettingsModalFooter.d.ts +1 -0
  155. package/dist/components/SettingsModalFooter.js +7 -3
  156. package/dist/components/ShowOutlinesProvider.js +1 -1
  157. package/dist/components/SizeSelector.js +1 -1
  158. package/dist/components/SkillsSettings.d.ts +0 -1
  159. package/dist/components/SkillsSettings.js +14 -15
  160. package/dist/components/SnappingToggle.js +1 -1
  161. package/dist/components/Splitter/SplitterElement.js +1 -2
  162. package/dist/components/StudioSettings.js +2 -2
  163. package/dist/components/TimeValue.js +2 -4
  164. package/dist/components/Timeline/EasingEditorModal.js +3 -3
  165. package/dist/components/Timeline/LoopedTimelineIndicators.d.ts +1 -0
  166. package/dist/components/Timeline/LoopedTimelineIndicators.js +7 -6
  167. package/dist/components/Timeline/TimelineArrayField.js +3 -3
  168. package/dist/components/Timeline/TimelineAssetField.js +3 -3
  169. package/dist/components/Timeline/TimelineClipboardKeybindings.js +0 -1
  170. package/dist/components/Timeline/TimelineColorField.js +3 -3
  171. package/dist/components/Timeline/TimelineDragHandler.js +3 -3
  172. package/dist/components/Timeline/TimelineDuplicateCount.js +1 -1
  173. package/dist/components/Timeline/TimelineEffectItem.js +1 -1
  174. package/dist/components/Timeline/TimelineEffectPropItem.d.ts +1 -0
  175. package/dist/components/Timeline/TimelineEffectPropItem.js +12 -5
  176. package/dist/components/Timeline/TimelineEnumField.js +1 -1
  177. package/dist/components/Timeline/TimelineExpandedRow.d.ts +1 -0
  178. package/dist/components/Timeline/TimelineExpandedRow.js +5 -4
  179. package/dist/components/Timeline/TimelineExpandedSection.d.ts +1 -0
  180. package/dist/components/Timeline/TimelineExpandedSection.js +2 -2
  181. package/dist/components/Timeline/TimelineExpandedTrackKeyframes.d.ts +1 -0
  182. package/dist/components/Timeline/TimelineExpandedTrackKeyframes.js +3 -1
  183. package/dist/components/Timeline/TimelineFieldLabel.js +1 -1
  184. package/dist/components/Timeline/TimelineFontFamilyField.js +14 -14
  185. package/dist/components/Timeline/TimelineFontWeightField.js +1 -1
  186. package/dist/components/Timeline/TimelineKeyframeControls.d.ts +1 -0
  187. package/dist/components/Timeline/TimelineKeyframeControls.js +42 -31
  188. package/dist/components/Timeline/TimelineKeyframeDiamond.js +1 -1
  189. package/dist/components/Timeline/TimelineKeyframeEasingLine.js +1 -1
  190. package/dist/components/Timeline/TimelineLayerChildren.js +2 -2
  191. package/dist/components/Timeline/TimelineList.js +16 -8
  192. package/dist/components/Timeline/TimelineMediaInfo.js +1 -1
  193. package/dist/components/Timeline/TimelineNumberField.js +2 -4
  194. package/dist/components/Timeline/TimelinePrimitiveFieldValue.js +1 -1
  195. package/dist/components/Timeline/TimelineScaleField.js +1 -1
  196. package/dist/components/Timeline/TimelineSchemaField.js +2 -2
  197. package/dist/components/Timeline/TimelineSelection.d.ts +9 -9
  198. package/dist/components/Timeline/TimelineSelection.js +16 -9
  199. package/dist/components/Timeline/TimelineSequence.d.ts +3 -1
  200. package/dist/components/Timeline/TimelineSequence.js +40 -22
  201. package/dist/components/Timeline/TimelineSequenceItem.d.ts +1 -0
  202. package/dist/components/Timeline/TimelineSequenceItem.js +52 -24
  203. package/dist/components/Timeline/TimelineSequenceName.d.ts +1 -0
  204. package/dist/components/Timeline/TimelineSequenceName.js +38 -6
  205. package/dist/components/Timeline/TimelineSequencePropItem.d.ts +3 -0
  206. package/dist/components/Timeline/TimelineSequencePropItem.js +266 -27
  207. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +11 -13
  208. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +98 -77
  209. package/dist/components/Timeline/TimelineTextContentField.js +27 -4
  210. package/dist/components/Timeline/TimelineTimeIndicators.js +10 -5
  211. package/dist/components/Timeline/TimelineTrack.js +1 -1
  212. package/dist/components/Timeline/TimelineTrimTooltip.d.ts +11 -0
  213. package/dist/components/Timeline/TimelineTrimTooltip.js +41 -0
  214. package/dist/components/Timeline/TimelineVideoInfo.d.ts +1 -0
  215. package/dist/components/Timeline/TimelineVideoInfo.js +13 -10
  216. package/dist/components/Timeline/TimelineZoomControls.js +2 -2
  217. package/dist/components/Timeline/delete-selected-keyframe.js +22 -8
  218. package/dist/components/Timeline/delete-selected-timeline-item.d.ts +1 -5
  219. package/dist/components/Timeline/delete-selected-timeline-item.js +7 -93
  220. package/dist/components/Timeline/get-animation-item-selection-for-frame.d.ts +2 -1
  221. package/dist/components/Timeline/get-animation-item-selection-for-frame.js +7 -5
  222. package/dist/components/Timeline/get-keyframed-sequence-drag-targets.d.ts +23 -0
  223. package/dist/components/Timeline/get-keyframed-sequence-drag-targets.js +57 -0
  224. package/dist/components/Timeline/get-node-keyframes.d.ts +2 -1
  225. package/dist/components/Timeline/get-node-keyframes.js +6 -4
  226. package/dist/components/Timeline/get-playback-rate-keyframe-changes.d.ts +21 -0
  227. package/dist/components/Timeline/get-playback-rate-keyframe-changes.js +142 -0
  228. package/dist/components/Timeline/get-sequence-split-menu-item.js +2 -2
  229. package/dist/components/Timeline/get-timeline-keyframes.d.ts +15 -2
  230. package/dist/components/Timeline/get-timeline-keyframes.js +44 -6
  231. package/dist/components/Timeline/keyframe-clipboard.js +17 -3
  232. package/dist/components/Timeline/split-selected-timeline-item.js +4 -1
  233. package/dist/components/Timeline/timeline-field-display-utils.js +1 -0
  234. package/dist/components/Timeline/timeline-field-row-layout.js +1 -0
  235. package/dist/components/Timeline/use-delete-timeline-items.js +17 -11
  236. package/dist/components/Timeline/use-expanded-track-keyframe-rows.d.ts +2 -1
  237. package/dist/components/Timeline/use-expanded-track-keyframe-rows.js +3 -1
  238. package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.js +7 -3
  239. package/dist/components/Timeline/use-timeline-expanded-tree.d.ts +1 -1
  240. package/dist/components/Timeline/use-timeline-expanded-tree.js +3 -0
  241. package/dist/components/Timeline/use-timeline-keyframe-drag.js +28 -19
  242. package/dist/components/TimelineCombobox.d.ts +1 -1
  243. package/dist/components/TimelineCombobox.js +5 -6
  244. package/dist/components/TimelineInOutToggle.js +1 -1
  245. package/dist/components/Transcription/Models.js +1 -1
  246. package/dist/components/Transcription/TranscriptionModal.js +9 -7
  247. package/dist/components/Transcription/resample-media-to-16-khz.d.ts +2 -1
  248. package/dist/components/Transcription/resample-media-to-16-khz.js +20 -2
  249. package/dist/components/UndoRedoButtons.js +1 -1
  250. package/dist/components/UpdatesSettings.js +4 -2
  251. package/dist/components/VideoMatting/Models.js +1 -1
  252. package/dist/components/VideoMatting/VideoMattingModal.js +34 -51
  253. package/dist/components/VideoMatting/VideoMattingModalWithOptionalPackage.js +1 -1
  254. package/dist/components/WebMcp.js +22 -40
  255. package/dist/components/composition-drop-preview.js +1 -0
  256. package/dist/components/effect-drag-and-drop.d.ts +13 -5
  257. package/dist/components/effect-drag-and-drop.js +19 -4
  258. package/dist/components/get-open-in-menu-items.d.ts +2 -1
  259. package/dist/components/get-open-in-menu-items.js +17 -1
  260. package/dist/components/selected-outline-drag.d.ts +1 -6
  261. package/dist/components/selected-outline-drag.js +22 -6
  262. package/dist/components/selected-outline-geometry.d.ts +2 -18
  263. package/dist/components/selected-outline-measurement.d.ts +23 -41
  264. package/dist/components/selected-outline-measurement.js +14 -252
  265. package/dist/components/selected-outline-order.d.ts +4 -11
  266. package/dist/components/selected-outline-order.js +2 -254
  267. package/dist/components/selected-outline-snap.d.ts +1 -1
  268. package/dist/components/selected-outline-snap.js +2 -1
  269. package/dist/components/selected-outline-types.d.ts +20 -28
  270. package/dist/components/selected-outline-uv.d.ts +4 -4
  271. package/dist/components/selected-outline-uv.js +6 -111
  272. package/dist/components/sequence-props-api.js +0 -10
  273. package/dist/components/use-selected-outline-control-target.js +12 -21
  274. package/dist/components/wrap-jsx-node-api.d.ts +2 -0
  275. package/dist/components/wrap-jsx-node-api.js +13 -0
  276. package/dist/error-overlay/remotion-overlay/CompositionIdListItem.js +1 -1
  277. package/dist/error-overlay/remotion-overlay/OpenInEditor.js +46 -3
  278. package/dist/error-overlay/remotion-overlay/StackFrame.js +32 -3
  279. package/dist/esm/{CaptionQueueProcessor-npa6szn1.mjs → CaptionQueueProcessor-qj37c6r2.mjs} +63 -17
  280. package/dist/esm/LazyModels-rjsrgap5.mjs +12 -0
  281. package/dist/esm/LazyModels-rnbjx98t.mjs +12 -0
  282. package/dist/esm/{TranscriptionModal-79m5wgcj.mjs → TranscriptionModal-y7zeqj2d.mjs} +21 -21
  283. package/dist/esm/{VideoMattingModal-31pew0xj.mjs → VideoMattingModal-jzrkhah1.mjs} +51 -69
  284. package/dist/esm/{VideoMattingQueueProcessor-t1hgm2rm.mjs → VideoMattingQueueProcessor-4tkj0f4k.mjs} +69 -26
  285. package/dist/esm/{index-v4tr1bft.mjs → index-09txs1bj.mjs} +5 -0
  286. package/dist/esm/{index-e855w59j.mjs → index-19d05w9e.mjs} +3 -5
  287. package/dist/esm/index-24wge6y5.mjs +102 -0
  288. package/dist/esm/index-3qb54r5j.mjs +157 -0
  289. package/dist/esm/{index-n5gmcvhz.mjs → index-5ycb9e9q.mjs} +2 -4
  290. package/dist/esm/{index-s7qa3xbw.mjs → index-cakcjjy2.mjs} +7 -7
  291. package/dist/esm/{index-r1gr3j3a.mjs → index-dfy1t576.mjs} +50 -1
  292. package/dist/esm/{index-614tdz2q.mjs → index-f9hxt5yh.mjs} +3 -3
  293. package/dist/esm/{index-9x6e1dq0.mjs → index-hqxc6tzp.mjs} +40 -6
  294. package/dist/esm/{index-ac5550e7.mjs → index-jc22b2wb.mjs} +3 -3
  295. package/dist/esm/{index-5t2dwxsk.mjs → index-m01zjph7.mjs} +261 -25
  296. package/dist/esm/{index-ppspzgn9.mjs → index-m2a95v3p.mjs} +4904 -4951
  297. package/dist/esm/{index-9xxg6218.mjs → index-qve7mdfp.mjs} +19 -1
  298. package/dist/esm/{index-vxwg66ar.mjs → index-r9bj4tta.mjs} +47 -60
  299. package/dist/esm/{index-r0ejh5sy.mjs → index-vnc2wdfd.mjs} +44 -27
  300. package/dist/esm/{index-21hxsfaa.mjs → index-vtr5qzam.mjs} +6 -25
  301. package/dist/esm/{index-4zen9prq.mjs → index-x7kg7jqv.mjs} +6809 -5640
  302. package/dist/esm/index.mjs +4 -5
  303. package/dist/esm/internals.mjs +13 -13
  304. package/dist/esm/previewEntry.mjs +18 -15
  305. package/dist/esm/renderEntry.mjs +5 -1
  306. package/dist/helpers/calculate-timeline.d.ts +5 -1
  307. package/dist/helpers/calculate-timeline.js +1 -1
  308. package/dist/helpers/checkerboard-background.d.ts +2 -2
  309. package/dist/helpers/checkerboard-background.js +1 -1
  310. package/dist/helpers/colors.d.ts +131 -112
  311. package/dist/helpers/colors.js +121 -100
  312. package/dist/helpers/create-folder-tree.js +2 -1
  313. package/dist/helpers/editor-guide-selection.d.ts +1 -1
  314. package/dist/helpers/editor-ruler.js +23 -12
  315. package/dist/helpers/get-connected-compositions.d.ts +6 -1
  316. package/dist/helpers/get-connected-compositions.js +1 -1
  317. package/dist/helpers/get-sequence-double-click-action.js +1 -1
  318. package/dist/helpers/get-sequence-visible-range.d.ts +1 -1
  319. package/dist/helpers/get-sequence-visible-range.js +2 -5
  320. package/dist/helpers/get-timeline-nestedness.d.ts +1 -1
  321. package/dist/helpers/get-timeline-nestedness.js +1 -1
  322. package/dist/helpers/get-timeline-sequence-sort-key.d.ts +1 -1
  323. package/dist/helpers/get-timeline-sequence-sort-key.js +1 -1
  324. package/dist/helpers/hoverable.js +4 -4
  325. package/dist/helpers/inject-css.js +5 -7
  326. package/dist/helpers/prism-vsc-dark-plus.d.ts +1 -1
  327. package/dist/helpers/prism-vsc-dark-plus.js +52 -51
  328. package/dist/helpers/resolve-studio-color.d.ts +1 -0
  329. package/dist/helpers/resolve-studio-color.js +11 -0
  330. package/dist/helpers/studio-css-variables.d.ts +1 -0
  331. package/dist/helpers/studio-css-variables.js +104 -0
  332. package/dist/helpers/studio-pixel-ratio.d.ts +1 -0
  333. package/dist/helpers/studio-pixel-ratio.js +7 -0
  334. package/dist/helpers/timeline-node-path-key.d.ts +1 -1
  335. package/dist/helpers/timeline-node-path-key.js +2 -2
  336. package/dist/helpers/use-runtime-values.js +2 -28
  337. package/dist/hot-middleware-client/client.js +5 -3
  338. package/dist/icons/align-center-horizontal.js +2 -1
  339. package/dist/icons/align-left.js +2 -1
  340. package/dist/icons/align-right.js +2 -1
  341. package/dist/icons/{separation.d.ts → background-removal.d.ts} +1 -1
  342. package/dist/icons/background-removal.js +9 -0
  343. package/dist/icons/snowflake.js +1 -3
  344. package/dist/icons/{scissors.d.ts → split.d.ts} +1 -1
  345. package/dist/icons/split.js +8 -0
  346. package/dist/icons/trash.js +2 -2
  347. package/dist/icons/wrap.d.ts +4 -0
  348. package/dist/icons/wrap.js +10 -0
  349. package/dist/previewEntry.js +2 -0
  350. package/dist/renderEntry.js +2 -0
  351. package/dist/state/modals.d.ts +15 -1
  352. package/dist/state/timeline-sequence-hover.d.ts +6 -16
  353. package/dist/state/timeline-sequence-hover.js +6 -67
  354. package/package.json +20 -19
  355. package/dist/components/Timeline/get-easing-selection-after-keyframe-delete.d.ts +0 -15
  356. package/dist/components/Timeline/get-easing-selection-after-keyframe-delete.js +0 -31
  357. package/dist/esm/LazyModels-nh3c8h9p.mjs +0 -12
  358. package/dist/esm/LazyModels-rr5v8h5y.mjs +0 -12
  359. package/dist/esm/index-cw0pnpg5.mjs +0 -50
  360. package/dist/esm/index-k426ye99.mjs +0 -139
  361. package/dist/helpers/get-box-quads-polyfill-internals.d.ts +0 -82
  362. package/dist/helpers/get-box-quads-polyfill-internals.js +0 -2403
  363. package/dist/helpers/get-box-quads-ponyfill.d.ts +0 -10
  364. package/dist/helpers/get-box-quads-ponyfill.js +0 -23
  365. package/dist/icons/scissors.js +0 -8
  366. package/dist/icons/separation.js +0 -7
  367. /package/dist/esm/{resolve-composition-component-location-qrp05g62.mjs → resolve-composition-component-location-2hgf6g0a.mjs} +0 -0
@@ -1,5 +1,7 @@
1
1
  import React from 'react';
2
+ import type { CaptionJob } from './caption-job-types';
2
3
  import type { AnyRenderJob } from './context';
4
+ import type { VideoMattingJob } from './video-matting-job-types';
3
5
  export declare const RenderQueueCancelButton: React.FC<{
4
- readonly job: AnyRenderJob;
6
+ readonly job: AnyRenderJob | CaptionJob | VideoMattingJob;
5
7
  }>;
@@ -10,18 +10,19 @@ const NotificationCenter_1 = require("../Notifications/NotificationCenter");
10
10
  const actions_1 = require("./actions");
11
11
  const context_1 = require("./context");
12
12
  const RenderQueueCancelButton = ({ job }) => {
13
- const isClientJob = (0, context_1.isClientRenderJob)(job);
14
13
  const { cancelClientJob } = (0, react_1.useContext)(context_1.RenderQueueContext);
15
14
  const onClick = (0, react_1.useCallback)((e) => {
16
15
  e.stopPropagation();
17
- if (isClientJob) {
16
+ if (job.type === 'caption' ||
17
+ job.type === 'video-matting' ||
18
+ (0, context_1.isClientRenderJob)(job)) {
18
19
  cancelClientJob(job.id);
19
20
  return;
20
21
  }
21
22
  (0, actions_1.cancelRenderJob)(job).catch((err) => {
22
23
  (0, NotificationCenter_1.showNotification)(`Could not cancel job: ${err.message}`, 2000);
23
24
  });
24
- }, [job, isClientJob, cancelClientJob]);
25
+ }, [job, cancelClientJob]);
25
26
  const icon = (0, react_1.useMemo)(() => {
26
27
  return {
27
28
  height: 14,
@@ -31,6 +32,12 @@ const RenderQueueCancelButton = ({ job }) => {
31
32
  const renderAction = (0, react_1.useCallback)((color) => {
32
33
  return (jsx_runtime_1.jsx("svg", { style: icon, xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512", children: jsx_runtime_1.jsx("path", { fill: color, d: "M367.2 412.5L99.5 144.8C77.1 176.1 64 214.5 64 256c0 106 86 192 192 192c41.5 0 79.9-13.1 111.2-35.5zm45.3-45.3C434.9 335.9 448 297.5 448 256c0-106-86-192-192-192c-41.5 0-79.9 13.1-111.2 35.5L412.5 367.2zM512 256c0 141.4-114.6 256-256 256S0 397.4 0 256S114.6 0 256 0S512 114.6 512 256z" }) }));
33
34
  }, [icon]);
34
- return (jsx_runtime_1.jsx(ActionTooltip_1.ActionTooltip, { label: "Cancel", shortcut: null, delay: 800, dismissOnClick: true, children: jsx_runtime_1.jsx(InlineAction_1.InlineAction, { "aria-label": "Cancel render", renderAction: renderAction, onClick: onClick, variant: null }) }));
35
+ return (jsx_runtime_1.jsx(ActionTooltip_1.ActionTooltip, { label: "Cancel", shortcut: null, delay: 800, dismissOnClick: true, children: jsx_runtime_1.jsx(InlineAction_1.InlineAction, { "aria-label": job.type === 'caption'
36
+ ? 'Cancel transcription'
37
+ : job.type === 'video-matting'
38
+ ? 'outName' in job
39
+ ? 'Cancel background removal'
40
+ : 'Cancel video matting'
41
+ : 'Cancel render', renderAction: renderAction, onClick: onClick, variant: null }) }));
35
42
  };
36
43
  exports.RenderQueueCancelButton = RenderQueueCancelButton;
@@ -20,6 +20,6 @@ const RenderQueueOutputName = ({ job }) => {
20
20
  }
21
21
  return job.outName;
22
22
  };
23
- return (jsx_runtime_1.jsx("span", { style: style, title: getTitle(), children: job.outName }));
23
+ return (jsx_runtime_1.jsx("span", { role: "group", style: style, "aria-label": getTitle(), children: job.outName }));
24
24
  };
25
25
  exports.RenderQueueOutputName = RenderQueueOutputName;
@@ -27,6 +27,6 @@ const RenderQueueProgressMessage = ({ job }) => {
27
27
  const message = isClientJob
28
28
  ? (0, client_render_progress_1.getClientRenderProgressMessage)(job.progress)
29
29
  : job.progress.message;
30
- return (jsx_runtime_1.jsx("button", { onClick: onClick, type: "button", style: outputLocation, tabIndex: tabIndex, title: message, children: message }));
30
+ return (jsx_runtime_1.jsx("button", { onClick: onClick, type: "button", style: outputLocation, tabIndex: tabIndex, "aria-label": message, children: message }));
31
31
  };
32
32
  exports.RenderQueueProgressMessage = RenderQueueProgressMessage;
@@ -1,5 +1,7 @@
1
1
  import React from 'react';
2
+ import type { CaptionJob } from './caption-job-types';
2
3
  import type { AnyRenderJob } from './context';
4
+ import type { VideoMattingJob } from './video-matting-job-types';
3
5
  export declare const RenderQueueRepeatItem: React.FC<{
4
- readonly job: AnyRenderJob;
6
+ readonly job: AnyRenderJob | CaptionJob | VideoMattingJob;
5
7
  }>;
@@ -11,10 +11,27 @@ const InlineAction_1 = require("../InlineAction");
11
11
  const context_1 = require("./context");
12
12
  const RenderQueueRepeatItem = ({ job }) => {
13
13
  const { setSelectedModal } = (0, react_1.useContext)(modals_1.SetSelectedModalContext);
14
- const isClientJob = (0, context_1.isClientRenderJob)(job);
15
14
  const onClick = (0, react_1.useCallback)((e) => {
16
15
  e.stopPropagation();
17
- if (isClientJob) {
16
+ if (job.type === 'caption') {
17
+ setSelectedModal({
18
+ type: 'transcribe',
19
+ src: job.src,
20
+ displayName: job.displayName,
21
+ audioStreamIndex: job.audioStreamIndex,
22
+ requestInit: job.requestInit,
23
+ target: job.target,
24
+ });
25
+ }
26
+ else if (job.type === 'video-matting') {
27
+ setSelectedModal({
28
+ type: 'video-matting',
29
+ src: job.src,
30
+ displayName: job.displayName,
31
+ target: job.target,
32
+ });
33
+ }
34
+ else if ((0, context_1.isClientRenderJob)(job)) {
18
35
  const retryPayload = (0, retry_payload_1.makeClientRetryPayload)(job);
19
36
  setSelectedModal(retryPayload);
20
37
  }
@@ -22,7 +39,7 @@ const RenderQueueRepeatItem = ({ job }) => {
22
39
  const retryPayload = (0, retry_payload_1.makeRetryPayload)(job);
23
40
  setSelectedModal(retryPayload);
24
41
  }
25
- }, [job, isClientJob, setSelectedModal]);
42
+ }, [job, setSelectedModal]);
26
43
  const icon = (0, react_1.useMemo)(() => {
27
44
  return {
28
45
  height: 12,
@@ -14,6 +14,10 @@ const use_select_asset_1 = require("../use-select-asset");
14
14
  const CircularProgress_1 = require("./CircularProgress");
15
15
  const context_1 = require("./context");
16
16
  const item_style_1 = require("./item-style");
17
+ const QueueJobError_1 = require("./QueueJobError");
18
+ const RenderQueueCancelledMessage_1 = require("./RenderQueueCancelledMessage");
19
+ const RenderQueueItemCancelButton_1 = require("./RenderQueueItemCancelButton");
20
+ const RenderQueueRepeat_1 = require("./RenderQueueRepeat");
17
21
  const SuccessIcon_1 = require("./SuccessIcon");
18
22
  const container = {
19
23
  borderRadius: 4,
@@ -50,12 +54,12 @@ const ellipsisIconStyle = {
50
54
  style: { height: 12 },
51
55
  };
52
56
  const Status = ({ job }) => {
53
- if (job.status === 'running') {
54
- return (jsx_runtime_1.jsx("div", { style: statusIcon, role: "progressbar", "aria-label": "Video matting progress", "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": Math.round(job.progress.value * 100), "aria-valuetext": job.progress.message, children: jsx_runtime_1.jsx(CircularProgress_1.CircularProgress, { progress: Math.max(0.07, job.progress.value) }) }));
57
+ if (job.status === 'running' || job.status === 'saving') {
58
+ return (jsx_runtime_1.jsx("div", { style: statusIcon, role: "progressbar", "aria-label": "Background removal progress", "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": Math.round(job.progress.value * 100), "aria-valuetext": job.progress.message, children: jsx_runtime_1.jsx(CircularProgress_1.CircularProgress, { progress: Math.max(0.07, job.progress.value) }) }));
55
59
  }
56
60
  if (job.status === 'done')
57
61
  return jsx_runtime_1.jsx(SuccessIcon_1.SuccessIcon, {});
58
- if (job.status === 'failed')
62
+ if (job.status === 'failed' || job.status === 'cancelled')
59
63
  return (jsx_runtime_1.jsx("svg", { style: statusIcon, viewBox: "0 0 512 512", children: jsx_runtime_1.jsx("path", { fill: colors_1.FAIL_COLOR, d: "M0 160V352L160 512H352L512 352V160L352 0H160L0 160zm353.9 32-64 64 64 64L320 353.9l-64-64-64 64L158.1 320l64-64-64-64L192 158.1l64 64 64-64z" }) }));
60
64
  return (jsx_runtime_1.jsx("svg", { style: statusIcon, viewBox: "0 0 512 512", children: jsx_runtime_1.jsx("path", { fill: colors_1.LIGHT_TEXT, d: "M256 512C114.6 512 0 397.4 0 256S114.6 0 256 0s256 114.6 256 256-114.6 256-256 256zM232 120v136c0 8 4 15.5 10.7 20l96 64 26.6-39.9-85.3-56.9V120z" }) }));
61
65
  };
@@ -74,50 +78,41 @@ const VideoMattingQueueItem = ({ job, selected }) => {
74
78
  WebkitUserSelect: 'none',
75
79
  }), [done, hovered, selected]);
76
80
  const messages = job.status === 'idle'
77
- ? ['Queued for video matting']
78
- : job.status === 'running'
81
+ ? ['Queued for background removal']
82
+ : job.status === 'running' || job.status === 'saving'
79
83
  ? [job.progress.message, job.progress.detail].filter((message) => message !== null)
80
84
  : job.status === 'failed'
81
85
  ? [job.error.message]
82
- : [job.baseOutName, job.foregroundOutName];
86
+ : job.status === 'cancelled'
87
+ ? ['Cancelled']
88
+ : [job.outName];
83
89
  const tooltip = messages.join('\n');
84
90
  const revealAsset = (0, react_1.useCallback)((assetName) => {
85
91
  selectAsset(assetName);
86
92
  (0, url_state_1.pushUrl)(`/assets/${assetName}`);
87
93
  }, [selectAsset]);
94
+ const outputName = job.outName;
88
95
  const onClick = (0, react_1.useCallback)(() => {
89
96
  if (!done)
90
97
  return;
91
- revealAsset(job.foregroundOutName);
92
- }, [done, job.foregroundOutName, revealAsset]);
98
+ revealAsset(outputName);
99
+ }, [done, outputName, revealAsset]);
93
100
  const revealItems = (0, react_1.useMemo)(() => {
94
101
  return [
95
102
  {
96
103
  disabled: false,
97
- id: 'reveal-foreground',
104
+ id: 'reveal-output',
98
105
  keyHint: null,
99
- label: 'Reveal foreground',
106
+ label: 'Reveal output',
100
107
  leftItem: null,
101
- onClick: () => revealAsset(job.foregroundOutName),
108
+ onClick: () => revealAsset(outputName),
102
109
  quickSwitcherLabel: null,
103
110
  subMenu: null,
104
111
  type: 'item',
105
- value: 'reveal-foreground',
106
- },
107
- {
108
- disabled: false,
109
- id: 'reveal-background',
110
- keyHint: null,
111
- label: 'Reveal background',
112
- leftItem: null,
113
- onClick: () => revealAsset(job.baseOutName),
114
- quickSwitcherLabel: null,
115
- subMenu: null,
116
- type: 'item',
117
- value: 'reveal-background',
112
+ value: 'reveal-output',
118
113
  },
119
114
  ];
120
- }, [job.baseOutName, job.foregroundOutName, revealAsset]);
115
+ }, [outputName, revealAsset]);
121
116
  const onRemove = (0, react_1.useCallback)((event) => {
122
117
  event.stopPropagation();
123
118
  removeVideoMattingJob(job.id);
@@ -125,7 +120,9 @@ const VideoMattingQueueItem = ({ job, selected }) => {
125
120
  const renderRemove = (0, react_1.useCallback)((color) => (jsx_runtime_1.jsx("svg", { style: removeIcon, viewBox: "0 0 320 512", children: jsx_runtime_1.jsx("path", { fill: color, d: "M310.6 150.6 205.3 256l105.3 105.4-45.3 45.3L160 301.3 54.6 406.6 9.4 361.4 114.7 256 9.4 150.6l45.2-45.2L160 210.7l105.3-105.3z" }) })), []);
126
121
  return (jsx_runtime_1.jsxs(layout_1.Row, { "data-render-queue-item": job.id, style: style, align: "center", onClick: onClick, onPointerEnter: () => setHovered(true), onPointerLeave: () => setHovered(false), children: [
127
122
  jsx_runtime_1.jsx(Status, { job: job }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), jsx_runtime_1.jsxs("div", { style: right, children: [
128
- jsx_runtime_1.jsx("div", { style: title, children: job.displayName }), jsx_runtime_1.jsx("div", { style: subtitles, title: tooltip, children: messages.map((message) => (jsx_runtime_1.jsx("span", { style: subtitle, children: message }, message))) })
129
- ] }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), done ? (jsx_runtime_1.jsx(ActionTooltip_1.ActionTooltip, { label: "Reveal video layer", shortcut: null, delay: 800, dismissOnClick: true, children: jsx_runtime_1.jsx(InlineDropdown_1.InlineDropdown, { renderAction: (color) => (jsx_runtime_1.jsx(ellipsis_1.EllipsisIcon, { fill: color, svgProps: ellipsisIconStyle })), "aria-label": "Reveal video layer", values: revealItems, variant: null }) })) : null, job.status === 'running' ? null : (jsx_runtime_1.jsx(ActionTooltip_1.ActionTooltip, { label: "Clear", shortcut: null, delay: 800, dismissOnClick: true, children: jsx_runtime_1.jsx(InlineAction_1.InlineAction, { renderAction: renderRemove, onClick: onRemove, "aria-label": "Clear", variant: null }) }))] }));
123
+ jsx_runtime_1.jsx("div", { style: title, children: job.displayName }), jsx_runtime_1.jsx("div", { role: "group", style: subtitles, "aria-label": tooltip, children: job.status === 'cancelled' ? (jsx_runtime_1.jsx(RenderQueueCancelledMessage_1.RenderQueueCancelledMessage, {})) : job.status === 'failed' ? (jsx_runtime_1.jsx(QueueJobError_1.QueueJobError, { error: job.error, modalTitle: "Background removal failed" })) : (messages.map((message) => (jsx_runtime_1.jsx("span", { style: subtitle, children: message }, message)))) })
124
+ ] }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), done ? (jsx_runtime_1.jsx(ActionTooltip_1.ActionTooltip, { label: "Reveal output", shortcut: null, delay: 800, dismissOnClick: true, children: jsx_runtime_1.jsx(InlineDropdown_1.InlineDropdown, { renderAction: (color) => (jsx_runtime_1.jsx(ellipsis_1.EllipsisIcon, { fill: color, svgProps: ellipsisIconStyle })), "aria-label": "Reveal output", values: revealItems, variant: null }) })) : null, job.status === 'done' ||
125
+ job.status === 'failed' ||
126
+ job.status === 'cancelled' ? (jsx_runtime_1.jsx(RenderQueueRepeat_1.RenderQueueRepeatItem, { job: job })) : null, job.status === 'running' ? (jsx_runtime_1.jsx(RenderQueueItemCancelButton_1.RenderQueueCancelButton, { job: job })) : job.status === 'saving' ? null : (jsx_runtime_1.jsx(ActionTooltip_1.ActionTooltip, { label: "Clear", shortcut: null, delay: 800, dismissOnClick: true, children: jsx_runtime_1.jsx(InlineAction_1.InlineAction, { renderAction: renderRemove, onClick: onRemove, "aria-label": "Clear", variant: null }) }))] }));
130
127
  };
131
128
  exports.VideoMattingQueueItem = VideoMattingQueueItem;
@@ -4,41 +4,51 @@ exports.VideoMattingQueueProcessor = void 0;
4
4
  const video_matting_1 = require("@remotion/video-matting");
5
5
  const react_1 = require("react");
6
6
  const write_static_file_1 = require("../../api/write-static-file");
7
+ const browser_studio_operations_1 = require("../../helpers/browser-studio-operations");
8
+ const call_api_1 = require("../call-api");
7
9
  const context_1 = require("./context");
8
10
  const load_model_for_job_1 = require("./load-model-for-job");
9
11
  const VideoMattingQueueProcessor = () => {
10
- const { markVideoMattingJobDone, markVideoMattingJobFailed, setProcessVideoMattingJobCallback, updateVideoMattingJobProgress, } = (0, react_1.useContext)(context_1.RenderQueueContext);
12
+ const { markVideoMattingJobDone, markVideoMattingJobFailed, markVideoMattingJobCancelled, markVideoMattingJobSaving, getAbortController, setProcessVideoMattingJobCallback, updateVideoMattingJobProgress, } = (0, react_1.useContext)(context_1.RenderQueueContext);
11
13
  const processJob = (0, react_1.useCallback)(async (job) => {
12
- let outputs = null;
14
+ const { signal } = getAbortController(job.id);
15
+ let output = null;
13
16
  let processingError = null;
14
17
  try {
18
+ signal.throwIfAborted();
15
19
  updateVideoMattingJobProgress(job.id, {
16
20
  detail: null,
17
21
  message: 'Checking WebGPU support...',
18
22
  value: 0,
19
23
  });
20
24
  const support = await (0, video_matting_1.canUseVideoMatting)({ model: job.model });
25
+ signal.throwIfAborted();
21
26
  if (!support.supported) {
22
27
  throw new Error(support.detailedReason);
23
28
  }
24
29
  await (0, load_model_for_job_1.loadModelForJob)({
30
+ signal,
25
31
  model: job.model,
26
32
  progressStart: 0,
27
33
  progressSpan: 0.2,
28
34
  isModelCached: (model) => (0, video_matting_1.isVideoMattingModelCached)({ model }),
29
- loadModel: (model, onProgress) => (0, video_matting_1.loadVideoMattingModel)({
30
- model,
31
- onProgress: (progress) => onProgress(progress.progress),
32
- }),
35
+ loadModel: async (model, onProgress) => {
36
+ await (0, video_matting_1.downloadVideoMattingModel)({
37
+ signal,
38
+ model,
39
+ onProgress: (progress) => onProgress(progress.progress),
40
+ });
41
+ await (0, video_matting_1.loadVideoMattingModel)({ model, signal });
42
+ },
33
43
  updateProgress: (progress) => updateVideoMattingJobProgress(job.id, {
34
44
  ...progress,
35
45
  detail: null,
36
46
  }),
37
47
  });
38
- outputs = await (0, video_matting_1.separateVideoLayers)({
48
+ const mattingOptions = {
49
+ signal,
39
50
  src: job.src,
40
51
  model: job.model,
41
- audio: job.audio,
42
52
  videoBitrate: job.videoBitrate,
43
53
  onProgress: (progress) => {
44
54
  var _a;
@@ -47,51 +57,81 @@ const VideoMattingQueueProcessor = () => {
47
57
  ? `Processed ${progress.processedFrames} ${progress.processedFrames === 1 ? 'frame' : 'frames'}`
48
58
  : `Processed ${progress.processedFrames} ${progress.processedFrames === 1 ? 'frame' : 'frames'} · ${Math.round(progress.progress * 100)}%`,
49
59
  message: progress.stage === 'finalizing'
50
- ? 'Finalizing video layers...'
51
- : 'Separating foreground...',
60
+ ? 'Finalizing video...'
61
+ : 'Removing background...',
52
62
  value: 0.2 + ((_a = progress.progress) !== null && _a !== void 0 ? _a : 1) * 0.65,
53
63
  });
54
64
  },
65
+ };
66
+ output = await video_matting_1.VideoMattingInternals.removeVideoBackground({
67
+ ...mattingOptions,
68
+ audio: job.audio,
55
69
  });
70
+ if (output === null) {
71
+ throw new Error('Video matting produced no output.');
72
+ }
73
+ signal.throwIfAborted();
56
74
  updateVideoMattingJobProgress(job.id, {
57
75
  detail: null,
58
- message: 'Saving video layers...',
76
+ message: 'Saving video...',
59
77
  value: 0.88,
60
78
  });
61
- const [base, foreground] = await Promise.all([
62
- outputs.base.getBlob(),
63
- outputs.foreground.getBlob(),
64
- ]);
65
- await Promise.all([
66
- base
67
- .arrayBuffer()
68
- .then((contents) => (0, write_static_file_1.writeStaticFile)({ contents, filePath: job.baseOutName })),
69
- foreground
70
- .arrayBuffer()
71
- .then((contents) => (0, write_static_file_1.writeStaticFile)({ contents, filePath: job.foregroundOutName })),
72
- ]);
79
+ const video = await output.video.getBlob();
80
+ signal.throwIfAborted();
81
+ markVideoMattingJobSaving(job.id);
82
+ await video
83
+ .arrayBuffer()
84
+ .then((contents) => (0, write_static_file_1.writeStaticFile)({ contents, filePath: job.outName }));
85
+ if (job.target !== null) {
86
+ updateVideoMattingJobProgress(job.id, {
87
+ detail: null,
88
+ message: 'Replacing video source...',
89
+ value: 0.97,
90
+ });
91
+ const browserStudioOperations = (0, browser_studio_operations_1.getBrowserStudioOperations)();
92
+ const request = {
93
+ fileName: job.target.fileName,
94
+ nodePath: job.target.nodePath.nodePath,
95
+ src: job.outName,
96
+ };
97
+ const replaceSource = browserStudioOperations === null || browserStudioOperations === void 0 ? void 0 : browserStudioOperations.replaceVideoSource;
98
+ if (browserStudioOperations && !replaceSource) {
99
+ throw new Error('Browser Studio cannot replace the video source.');
100
+ }
101
+ const response = replaceSource
102
+ ? await replaceSource(request)
103
+ : await (0, call_api_1.callApi)('/api/replace-video-source', request);
104
+ if (!response.success) {
105
+ throw new Error(response.reason);
106
+ }
107
+ }
73
108
  }
74
109
  catch (error) {
75
110
  processingError =
76
111
  error instanceof Error ? error : new Error(String(error));
77
112
  }
113
+ if (output) {
114
+ await Promise.allSettled([output.video.dispose()]);
115
+ }
78
116
  try {
79
- await Promise.all([
80
- outputs === null || outputs === void 0 ? void 0 : outputs.base.dispose(),
81
- outputs === null || outputs === void 0 ? void 0 : outputs.foreground.dispose(),
82
- ]);
83
117
  await (0, video_matting_1.disposeVideoMattingModel)({ model: job.model });
84
118
  }
85
119
  catch (_a) {
86
120
  // Cleanup errors must not hide successfully written outputs.
87
121
  }
88
- if (processingError) {
122
+ if (signal.aborted) {
123
+ markVideoMattingJobCancelled(job.id);
124
+ }
125
+ else if (processingError) {
89
126
  markVideoMattingJobFailed(job.id, processingError);
90
127
  }
91
128
  else {
92
129
  markVideoMattingJobDone(job.id);
93
130
  }
94
131
  }, [
132
+ getAbortController,
133
+ markVideoMattingJobCancelled,
134
+ markVideoMattingJobSaving,
95
135
  markVideoMattingJobDone,
96
136
  markVideoMattingJobFailed,
97
137
  updateVideoMattingJobProgress,
@@ -7,7 +7,9 @@ export type CaptionJobProgress = {
7
7
  type CaptionJobStatus = {
8
8
  status: 'idle';
9
9
  } | {
10
- status: 'running';
10
+ status: 'cancelled';
11
+ } | {
12
+ status: 'running' | 'saving';
11
13
  progress: CaptionJobProgress;
12
14
  } | {
13
15
  status: 'done';
@@ -32,12 +32,16 @@ type RenderQueueContextType = {
32
32
  updateCaptionJobProgress: (jobId: string, progress: CaptionJobProgress) => void;
33
33
  markCaptionJobDone: (jobId: string, captionCount: number) => void;
34
34
  markCaptionJobFailed: (jobId: string, error: Error) => void;
35
+ markCaptionJobCancelled: (jobId: string) => void;
36
+ markCaptionJobSaving: (jobId: string) => void;
35
37
  removeCaptionJob: (jobId: string) => void;
36
38
  setProcessCaptionJobCallback: (callback: ((job: CaptionJob) => Promise<void>) | null) => void;
37
39
  addVideoMattingJob: (params: AddVideoMattingJobParams) => string;
38
40
  updateVideoMattingJobProgress: (jobId: string, progress: VideoMattingJobProgress) => void;
39
41
  markVideoMattingJobDone: (jobId: string) => void;
40
42
  markVideoMattingJobFailed: (jobId: string, error: Error) => void;
43
+ markVideoMattingJobCancelled: (jobId: string) => void;
44
+ markVideoMattingJobSaving: (jobId: string) => void;
41
45
  removeVideoMattingJob: (jobId: string) => void;
42
46
  setProcessVideoMattingJobCallback: (callback: ((job: VideoMattingJob) => Promise<void>) | null) => void;
43
47
  getAbortController: (jobId: string) => AbortController;
@@ -68,12 +68,16 @@ exports.RenderQueueContext = react_1.default.createContext({
68
68
  updateCaptionJobProgress: noop,
69
69
  markCaptionJobDone: noop,
70
70
  markCaptionJobFailed: noop,
71
+ markCaptionJobCancelled: noop,
72
+ markCaptionJobSaving: noop,
71
73
  removeCaptionJob: noop,
72
74
  setProcessCaptionJobCallback: noop,
73
75
  addVideoMattingJob: noopString,
74
76
  updateVideoMattingJobProgress: noop,
75
77
  markVideoMattingJobDone: noop,
76
78
  markVideoMattingJobFailed: noop,
79
+ markVideoMattingJobCancelled: noop,
80
+ markVideoMattingJobSaving: noop,
77
81
  removeVideoMattingJob: noop,
78
82
  setProcessVideoMattingJobCallback: noop,
79
83
  getAbortController: () => new AbortController(),
@@ -89,8 +93,12 @@ const RenderQueueContextProvider = ({ children }) => {
89
93
  const hasActiveLocalJob = clientJobs.some((job) => job.status === 'idle' ||
90
94
  job.status === 'running' ||
91
95
  job.status === 'saving') ||
92
- captionJobs.some((job) => job.status === 'idle' || job.status === 'running') ||
93
- videoMattingJobs.some((job) => job.status === 'idle' || job.status === 'running');
96
+ captionJobs.some((job) => job.status === 'idle' ||
97
+ job.status === 'running' ||
98
+ job.status === 'saving') ||
99
+ videoMattingJobs.some((job) => job.status === 'idle' ||
100
+ job.status === 'running' ||
101
+ job.status === 'saving');
94
102
  const [currentlyProcessing, setCurrentlyProcessing] = (0, react_1.useState)(null);
95
103
  const lastLocalJobStartedAt = (0, react_1.useRef)(clientJobs.reduce((latest, job) => Math.max(latest, job.startedAt), 0));
96
104
  const processJobCallbackRef = (0, react_1.useRef)(null);
@@ -154,7 +162,9 @@ const RenderQueueContextProvider = ({ children }) => {
154
162
  status: 'running',
155
163
  progress: {
156
164
  detail: null,
157
- message: 'Starting video matting...',
165
+ message: 'outName' in job
166
+ ? 'Starting background removal...'
167
+ : 'Starting video matting...',
158
168
  value: 0,
159
169
  },
160
170
  }
@@ -283,17 +293,20 @@ const RenderQueueContextProvider = ({ children }) => {
283
293
  return id;
284
294
  }, [getLocalJobStartedAt]);
285
295
  const updateCaptionJobProgress = (0, react_1.useCallback)((jobId, progress) => {
286
- setCaptionJobs((prev) => prev.map((job) => job.id === jobId
287
- ? { ...job, status: 'running', progress }
296
+ setCaptionJobs((prev) => prev.map((job) => job.id === jobId &&
297
+ (job.status === 'running' || job.status === 'saving')
298
+ ? { ...job, progress }
288
299
  : job));
289
300
  }, []);
290
301
  const markCaptionJobDone = (0, react_1.useCallback)((jobId, captionCount) => {
302
+ (0, client_render_queue_1.deleteAbortController)(jobId);
291
303
  setCaptionJobs((prev) => prev.map((job) => job.id === jobId
292
304
  ? { ...job, status: 'done', captionCount }
293
305
  : job));
294
306
  setCurrentlyProcessing((current) => (current === jobId ? null : current));
295
307
  }, []);
296
308
  const markCaptionJobFailed = (0, react_1.useCallback)((jobId, error) => {
309
+ (0, client_render_queue_1.deleteAbortController)(jobId);
297
310
  setCaptionJobs((prev) => prev.map((job) => job.id === jobId
298
311
  ? {
299
312
  ...job,
@@ -303,12 +316,24 @@ const RenderQueueContextProvider = ({ children }) => {
303
316
  : job));
304
317
  setCurrentlyProcessing((current) => (current === jobId ? null : current));
305
318
  }, []);
319
+ const markCaptionJobCancelled = (0, react_1.useCallback)((jobId) => {
320
+ (0, client_render_queue_1.deleteAbortController)(jobId);
321
+ setCaptionJobs((prev) => prev.map((job) => job.id === jobId ? { ...job, status: 'cancelled' } : job));
322
+ setCurrentlyProcessing((current) => (current === jobId ? null : current));
323
+ }, []);
324
+ const markCaptionJobSaving = (0, react_1.useCallback)((jobId) => {
325
+ setCaptionJobs((prev) => prev.map((job) => job.id === jobId && job.status === 'running'
326
+ ? { ...job, status: 'saving' }
327
+ : job));
328
+ }, []);
306
329
  const removeCaptionJob = (0, react_1.useCallback)((jobId) => {
307
330
  setCaptionJobs((prev) => {
308
331
  const jobToRemove = prev.find((job) => job.id === jobId);
309
- if ((jobToRemove === null || jobToRemove === void 0 ? void 0 : jobToRemove.status) === 'running') {
332
+ if ((jobToRemove === null || jobToRemove === void 0 ? void 0 : jobToRemove.status) === 'running' ||
333
+ (jobToRemove === null || jobToRemove === void 0 ? void 0 : jobToRemove.status) === 'saving') {
310
334
  return prev;
311
335
  }
336
+ (0, client_render_queue_1.deleteAbortController)(jobId);
312
337
  return prev.filter((job) => job.id !== jobId);
313
338
  });
314
339
  }, []);
@@ -333,13 +358,18 @@ const RenderQueueContextProvider = ({ children }) => {
333
358
  return id;
334
359
  }, [getLocalJobStartedAt]);
335
360
  const updateVideoMattingJobProgress = (0, react_1.useCallback)((jobId, progress) => {
336
- setVideoMattingJobs((prev) => prev.map((job) => job.id === jobId ? { ...job, status: 'running', progress } : job));
361
+ setVideoMattingJobs((prev) => prev.map((job) => job.id === jobId &&
362
+ (job.status === 'running' || job.status === 'saving')
363
+ ? { ...job, progress }
364
+ : job));
337
365
  }, []);
338
366
  const markVideoMattingJobDone = (0, react_1.useCallback)((jobId) => {
367
+ (0, client_render_queue_1.deleteAbortController)(jobId);
339
368
  setVideoMattingJobs((prev) => prev.map((job) => (job.id === jobId ? { ...job, status: 'done' } : job)));
340
369
  setCurrentlyProcessing((current) => (current === jobId ? null : current));
341
370
  }, []);
342
371
  const markVideoMattingJobFailed = (0, react_1.useCallback)((jobId, error) => {
372
+ (0, client_render_queue_1.deleteAbortController)(jobId);
343
373
  setVideoMattingJobs((prev) => prev.map((job) => job.id === jobId
344
374
  ? {
345
375
  ...job,
@@ -349,12 +379,24 @@ const RenderQueueContextProvider = ({ children }) => {
349
379
  : job));
350
380
  setCurrentlyProcessing((current) => (current === jobId ? null : current));
351
381
  }, []);
382
+ const markVideoMattingJobCancelled = (0, react_1.useCallback)((jobId) => {
383
+ (0, client_render_queue_1.deleteAbortController)(jobId);
384
+ setVideoMattingJobs((prev) => prev.map((job) => job.id === jobId ? { ...job, status: 'cancelled' } : job));
385
+ setCurrentlyProcessing((current) => (current === jobId ? null : current));
386
+ }, []);
387
+ const markVideoMattingJobSaving = (0, react_1.useCallback)((jobId) => {
388
+ setVideoMattingJobs((prev) => prev.map((job) => job.id === jobId && job.status === 'running'
389
+ ? { ...job, status: 'saving' }
390
+ : job));
391
+ }, []);
352
392
  const removeVideoMattingJob = (0, react_1.useCallback)((jobId) => {
353
393
  setVideoMattingJobs((prev) => {
354
394
  const jobToRemove = prev.find((job) => job.id === jobId);
355
- if ((jobToRemove === null || jobToRemove === void 0 ? void 0 : jobToRemove.status) === 'running') {
395
+ if ((jobToRemove === null || jobToRemove === void 0 ? void 0 : jobToRemove.status) === 'running' ||
396
+ (jobToRemove === null || jobToRemove === void 0 ? void 0 : jobToRemove.status) === 'saving') {
356
397
  return prev;
357
398
  }
399
+ (0, client_render_queue_1.deleteAbortController)(jobId);
358
400
  return prev.filter((job) => job.id !== jobId);
359
401
  });
360
402
  }, []);
@@ -408,12 +450,16 @@ const RenderQueueContextProvider = ({ children }) => {
408
450
  updateCaptionJobProgress,
409
451
  markCaptionJobDone,
410
452
  markCaptionJobFailed,
453
+ markCaptionJobCancelled,
454
+ markCaptionJobSaving,
411
455
  removeCaptionJob,
412
456
  setProcessCaptionJobCallback,
413
457
  addVideoMattingJob,
414
458
  updateVideoMattingJobProgress,
415
459
  markVideoMattingJobDone,
416
460
  markVideoMattingJobFailed,
461
+ markVideoMattingJobCancelled,
462
+ markVideoMattingJobSaving,
417
463
  removeVideoMattingJob,
418
464
  setProcessVideoMattingJobCallback,
419
465
  getAbortController: client_render_queue_1.getAbortController,
@@ -438,12 +484,16 @@ const RenderQueueContextProvider = ({ children }) => {
438
484
  updateCaptionJobProgress,
439
485
  markCaptionJobDone,
440
486
  markCaptionJobFailed,
487
+ markCaptionJobCancelled,
488
+ markCaptionJobSaving,
441
489
  removeCaptionJob,
442
490
  setProcessCaptionJobCallback,
443
491
  addVideoMattingJob,
444
492
  updateVideoMattingJobProgress,
445
493
  markVideoMattingJobDone,
446
494
  markVideoMattingJobFailed,
495
+ markVideoMattingJobCancelled,
496
+ markVideoMattingJobSaving,
447
497
  removeVideoMattingJob,
448
498
  setProcessVideoMattingJobCallback,
449
499
  ]);
@@ -115,8 +115,7 @@ const RenderQueue = () => {
115
115
  }
116
116
  if ((0, video_matting_job_types_1.isVideoMattingJob)(job) &&
117
117
  job.status === 'done' &&
118
- (canvasContent.asset === job.baseOutName ||
119
- canvasContent.asset === job.foregroundOutName)) {
118
+ canvasContent.asset === job.outName) {
120
119
  return i;
121
120
  }
122
121
  }
@@ -125,7 +124,7 @@ const RenderQueue = () => {
125
124
  }, [allJobs, canvasContent]);
126
125
  if (jobCount === 0) {
127
126
  return (jsx_runtime_1.jsxs("div", { style: explainer, children: [
128
- jsx_runtime_1.jsx(layout_1.Spacing, { y: 5 }), jsx_runtime_1.jsx("div", { style: errorExplanation, children: "Renders, transcriptions and video matting jobs will show up here." }), jsx_runtime_1.jsx(layout_1.Spacing, { y: 2, block: true })
127
+ jsx_runtime_1.jsx(layout_1.Spacing, { y: 5 }), jsx_runtime_1.jsx("div", { style: errorExplanation, children: "Renders, transcriptions and background removal jobs will show up here." }), jsx_runtime_1.jsx(layout_1.Spacing, { y: 2, block: true })
129
128
  ] }));
130
129
  }
131
130
  return (jsx_runtime_1.jsx("div", { ref: divRef, style: renderQueue, className: ['css-reset', is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME].join(' '), children: allJobs.map((job, index) => {
@@ -1,7 +1,8 @@
1
- export declare const loadModelForJob: <Model extends string>({ isModelCached, loadModel, model, progressSpan, progressStart, updateProgress, }: {
1
+ export declare const loadModelForJob: <Model extends string>({ isModelCached, loadModel, model, signal, progressSpan, progressStart, updateProgress, }: {
2
2
  isModelCached: (model: Model) => Promise<boolean>;
3
3
  loadModel: (model: Model, onProgress: (progress: number | null) => void) => Promise<unknown>;
4
4
  model: Model;
5
+ signal: AbortSignal;
5
6
  progressSpan: number;
6
7
  progressStart: number;
7
8
  updateProgress: (progress: {
@@ -1,14 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.loadModelForJob = void 0;
4
- const loadModelForJob = async ({ isModelCached, loadModel, model, progressSpan, progressStart, updateProgress, }) => {
4
+ const loadModelForJob = async ({ isModelCached, loadModel, model, signal, progressSpan, progressStart, updateProgress, }) => {
5
+ signal.throwIfAborted();
5
6
  const cached = await isModelCached(model);
7
+ signal.throwIfAborted();
6
8
  await loadModel(model, (progress) => {
9
+ signal.throwIfAborted();
7
10
  const percentage = progress === null ? '' : ` ${Math.round(progress * 100)}%`;
8
11
  updateProgress({
9
12
  message: `${cached ? 'Loading' : 'Downloading'} ${model}${percentage}`,
10
13
  value: progressStart + (progress !== null && progress !== void 0 ? progress : 0) * progressSpan,
11
14
  });
12
15
  });
16
+ signal.throwIfAborted();
13
17
  };
14
18
  exports.loadModelForJob = loadModelForJob;