@remotion/studio 4.0.526 → 4.0.528

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 (309) hide show
  1. package/dist/components/AgentPrompt.js +1 -2
  2. package/dist/components/AudioWaveform.d.ts +1 -0
  3. package/dist/components/AudioWaveform.js +10 -14
  4. package/dist/components/Canvas.js +88 -26
  5. package/dist/components/CanvasCaptureDropHandler.js +63 -0
  6. package/dist/components/CanvasOrLoading.js +10 -2
  7. package/dist/components/CodeFrame.js +1 -1
  8. package/dist/components/ColorPicker/checker.d.ts +1 -1
  9. package/dist/components/CompositionSelectorItem.js +1 -0
  10. package/dist/components/CurrentAsset.js +4 -2
  11. package/dist/components/EditorRuler/Ruler.js +6 -3
  12. package/dist/components/EffectPickerModal.js +69 -43
  13. package/dist/components/ElementInstallConfirmation.js +3 -3
  14. package/dist/components/ElementLibrariesSettings.d.ts +2 -0
  15. package/dist/components/ElementLibrariesSettings.js +200 -0
  16. package/dist/components/InitialCompositionLoader.js +4 -2
  17. package/dist/components/InlineDropdown.js +26 -2
  18. package/dist/components/InlineEditableTitle.js +1 -0
  19. package/dist/components/InspectorOpenInEditor.js +13 -0
  20. package/dist/components/InspectorPanel/AlignmentControls.js +28 -9
  21. package/dist/components/InspectorPanel/CollapsibleInspectorSectionHeader.js +2 -1
  22. package/dist/components/InspectorPanel/CompositionInspector.js +3 -3
  23. package/dist/components/InspectorPanel/CompositionMetadata.js +4 -0
  24. package/dist/components/InspectorPanel/EasingInspector.js +6 -2
  25. package/dist/components/InspectorPanel/ElementLibraryButton.js +2 -1
  26. package/dist/components/InspectorPanel/KeyframeEasingNavigator.js +1 -1
  27. package/dist/components/InspectorPanel/KeyframeInspector.js +28 -24
  28. package/dist/components/InspectorPanel/MultiSequenceInspector.js +32 -1
  29. package/dist/components/InspectorPanel/MultiSequenceNumberField.js +1 -1
  30. package/dist/components/InspectorPanel/SequenceInspectorHeader.d.ts +3 -1
  31. package/dist/components/InspectorPanel/SequenceSelectionInspector.js +70 -2
  32. package/dist/components/InspectorPanel/SequenceWrapAction.d.ts +8 -0
  33. package/dist/components/InspectorPanel/SequenceWrapAction.js +151 -0
  34. package/dist/components/InspectorPanel/common.js +1 -0
  35. package/dist/components/InspectorPanel/easing-inspector-selection.d.ts +2 -1
  36. package/dist/components/InspectorPanel/easing-inspector-selection.js +4 -3
  37. package/dist/components/InspectorPanel/keyframe-inspector-frame.d.ts +2 -1
  38. package/dist/components/InspectorPanel/keyframe-inspector-frame.js +2 -2
  39. package/dist/components/InspectorPanel/styles.js +2 -0
  40. package/dist/components/InspectorPanel/use-composition-actions.js +1 -0
  41. package/dist/components/InspectorSequenceSection.d.ts +1 -0
  42. package/dist/components/InspectorSequenceSection.js +7 -5
  43. package/dist/components/InspectorSourceLocation.js +3 -0
  44. package/dist/components/KeyboardShortcutsSettings.js +1 -1
  45. package/dist/components/Menu/styles.d.ts +2 -2
  46. package/dist/components/MenuBuildIndicator.js +1 -0
  47. package/dist/components/Modals.js +7 -6
  48. package/dist/components/ModelManager.js +10 -9
  49. package/dist/components/NewComposition/CancelButton.js +11 -5
  50. package/dist/components/NewComposition/InputDragger.d.ts +3 -1
  51. package/dist/components/NewComposition/InputDragger.js +28 -9
  52. package/dist/components/NewComposition/NewComposition.js +7 -6
  53. package/dist/components/NewComposition/RemInput.d.ts +1 -1
  54. package/dist/components/NewComposition/menu-typeahead.js +1 -1
  55. package/dist/components/Preview.js +4 -0
  56. package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +1 -0
  57. package/dist/components/QuickSwitcher/QuickSwitcherContent.js +1 -0
  58. package/dist/components/RadioButton.js +1 -0
  59. package/dist/components/RenderModal/DataEditor.js +4 -1
  60. package/dist/components/RenderModal/SchemaEditor/create-zod-values.js +1 -2
  61. package/dist/components/RenderModal/WebRenderModalPicture.js +1 -2
  62. package/dist/components/RenderQueue/CaptionQueueItem.js +19 -7
  63. package/dist/components/RenderQueue/CaptionQueueProcessor.js +65 -15
  64. package/dist/components/RenderQueue/QueueJobError.d.ts +8 -0
  65. package/dist/components/RenderQueue/QueueJobError.js +24 -0
  66. package/dist/components/RenderQueue/QueueJobErrorModal.d.ts +8 -0
  67. package/dist/components/RenderQueue/QueueJobErrorModal.js +63 -0
  68. package/dist/components/RenderQueue/RenderQueueItemCancelButton.d.ts +3 -1
  69. package/dist/components/RenderQueue/RenderQueueItemCancelButton.js +11 -4
  70. package/dist/components/RenderQueue/RenderQueueRepeat.d.ts +3 -1
  71. package/dist/components/RenderQueue/RenderQueueRepeat.js +20 -3
  72. package/dist/components/RenderQueue/VideoMattingQueueItem.js +25 -27
  73. package/dist/components/RenderQueue/VideoMattingQueueProcessor.js +68 -28
  74. package/dist/components/RenderQueue/caption-job-types.d.ts +9 -1
  75. package/dist/components/RenderQueue/context.d.ts +4 -0
  76. package/dist/components/RenderQueue/context.js +58 -8
  77. package/dist/components/RenderQueue/index.js +3 -3
  78. package/dist/components/RenderQueue/load-model-for-job.d.ts +2 -1
  79. package/dist/components/RenderQueue/load-model-for-job.js +5 -1
  80. package/dist/components/RenderQueue/video-matting-job-types.d.ts +13 -6
  81. package/dist/components/RendersTab.js +2 -0
  82. package/dist/components/SelectedOutlineCropControls.js +2 -1
  83. package/dist/components/SelectedOutlineEditingHandles.js +9 -2
  84. package/dist/components/SelectedOutlineElement.js +9 -3
  85. package/dist/components/SelectedOutlineKeyboardControls.d.ts +2 -4
  86. package/dist/components/SelectedOutlineKeyboardControls.js +4 -22
  87. package/dist/components/SelectedOutlineOverlay.js +152 -106
  88. package/dist/components/SelectedOutlinePathPoints.d.ts +8 -0
  89. package/dist/components/SelectedOutlinePathPoints.js +433 -0
  90. package/dist/components/SelectedOutlinePolygon.js +21 -46
  91. package/dist/components/SelectedOutlineRenderer.d.ts +3 -5
  92. package/dist/components/SelectedOutlineRenderer.js +32 -136
  93. package/dist/components/SelectedOutlineSnapIndicators.d.ts +6 -0
  94. package/dist/components/SelectedOutlineSnapIndicators.js +16 -12
  95. package/dist/components/SelectedOutlineTransformOriginHandle.js +3 -2
  96. package/dist/components/SelectedOutlineUvControls.js +12 -7
  97. package/dist/components/SequencePropsSubscriptionProvider.d.ts +3 -0
  98. package/dist/components/SequencePropsSubscriptionProvider.js +8 -6
  99. package/dist/components/SettingsModal.js +30 -3
  100. package/dist/components/SettingsModalFooter.d.ts +1 -0
  101. package/dist/components/SettingsModalFooter.js +7 -3
  102. package/dist/components/ShowOutlinesProvider.js +1 -1
  103. package/dist/components/SkillsSettings.d.ts +0 -1
  104. package/dist/components/SkillsSettings.js +13 -14
  105. package/dist/components/Splitter/SplitterElement.js +1 -2
  106. package/dist/components/TimeValue.js +1 -1
  107. package/dist/components/Timeline/LoopedTimelineIndicators.d.ts +1 -0
  108. package/dist/components/Timeline/LoopedTimelineIndicators.js +7 -6
  109. package/dist/components/Timeline/TimelineArrayField.js +1 -1
  110. package/dist/components/Timeline/TimelineClipboardKeybindings.js +0 -1
  111. package/dist/components/Timeline/TimelineColorField.js +1 -1
  112. package/dist/components/Timeline/TimelineDeleteKeybindings.js +6 -9
  113. package/dist/components/Timeline/TimelineDragHandler.js +1 -1
  114. package/dist/components/Timeline/TimelineEffectItem.js +1 -0
  115. package/dist/components/Timeline/TimelineEffectPropItem.d.ts +1 -0
  116. package/dist/components/Timeline/TimelineEffectPropItem.js +12 -5
  117. package/dist/components/Timeline/TimelineExpandArrowButton.js +1 -0
  118. package/dist/components/Timeline/TimelineExpandedRow.d.ts +1 -0
  119. package/dist/components/Timeline/TimelineExpandedRow.js +6 -4
  120. package/dist/components/Timeline/TimelineExpandedSection.d.ts +1 -0
  121. package/dist/components/Timeline/TimelineExpandedSection.js +2 -2
  122. package/dist/components/Timeline/TimelineExpandedTrackKeyframes.d.ts +1 -0
  123. package/dist/components/Timeline/TimelineExpandedTrackKeyframes.js +3 -1
  124. package/dist/components/Timeline/TimelineFieldLabel.js +1 -0
  125. package/dist/components/Timeline/TimelineFontFamilyField.js +12 -12
  126. package/dist/components/Timeline/TimelineKeyframeControls.d.ts +1 -0
  127. package/dist/components/Timeline/TimelineKeyframeControls.js +40 -28
  128. package/dist/components/Timeline/TimelineLayerChildren.js +1 -1
  129. package/dist/components/Timeline/TimelineList.js +1 -1
  130. package/dist/components/Timeline/TimelineNumberField.js +2 -4
  131. package/dist/components/Timeline/TimelinePrimitiveFieldValue.js +1 -1
  132. package/dist/components/Timeline/TimelineSelection.d.ts +9 -9
  133. package/dist/components/Timeline/TimelineSelection.js +16 -9
  134. package/dist/components/Timeline/TimelineSequence.d.ts +3 -1
  135. package/dist/components/Timeline/TimelineSequence.js +65 -21
  136. package/dist/components/Timeline/TimelineSequenceFrame.js +1 -0
  137. package/dist/components/Timeline/TimelineSequenceItem.d.ts +1 -0
  138. package/dist/components/Timeline/TimelineSequenceItem.js +46 -8
  139. package/dist/components/Timeline/TimelineSequencePropItem.d.ts +3 -0
  140. package/dist/components/Timeline/TimelineSequencePropItem.js +262 -25
  141. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +11 -13
  142. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +98 -77
  143. package/dist/components/Timeline/TimelineTextContentField.js +27 -4
  144. package/dist/components/Timeline/TimelineTimeIndicators.js +10 -5
  145. package/dist/components/Timeline/TimelineTrack.js +1 -1
  146. package/dist/components/Timeline/TimelineTrimTooltip.d.ts +11 -0
  147. package/dist/components/Timeline/TimelineTrimTooltip.js +41 -0
  148. package/dist/components/Timeline/TimelineVideoInfo.d.ts +1 -0
  149. package/dist/components/Timeline/TimelineVideoInfo.js +13 -10
  150. package/dist/components/Timeline/TimelineViewport.d.ts +1 -0
  151. package/dist/components/Timeline/TimelineViewport.js +10 -1
  152. package/dist/components/Timeline/delete-selected-keyframe.js +22 -8
  153. package/dist/components/Timeline/delete-selected-timeline-item.d.ts +1 -5
  154. package/dist/components/Timeline/delete-selected-timeline-item.js +9 -95
  155. package/dist/components/Timeline/get-animation-item-selection-for-frame.d.ts +2 -1
  156. package/dist/components/Timeline/get-animation-item-selection-for-frame.js +7 -5
  157. package/dist/components/Timeline/get-keyframed-sequence-drag-targets.d.ts +23 -0
  158. package/dist/components/Timeline/get-keyframed-sequence-drag-targets.js +57 -0
  159. package/dist/components/Timeline/get-node-keyframes.d.ts +2 -1
  160. package/dist/components/Timeline/get-node-keyframes.js +6 -4
  161. package/dist/components/Timeline/get-playback-rate-keyframe-changes.d.ts +21 -0
  162. package/dist/components/Timeline/get-playback-rate-keyframe-changes.js +142 -0
  163. package/dist/components/Timeline/get-sequence-context-menu-items.d.ts +3 -1
  164. package/dist/components/Timeline/get-sequence-context-menu-items.js +13 -1
  165. package/dist/components/Timeline/get-timeline-keyframes.d.ts +15 -2
  166. package/dist/components/Timeline/get-timeline-keyframes.js +44 -6
  167. package/dist/components/Timeline/keyframe-clipboard.js +17 -3
  168. package/dist/components/Timeline/split-selected-timeline-item.d.ts +13 -10
  169. package/dist/components/Timeline/split-selected-timeline-item.js +61 -35
  170. package/dist/components/Timeline/timeline-field-display-utils.js +1 -0
  171. package/dist/components/Timeline/timeline-field-row-layout.js +1 -0
  172. package/dist/components/Timeline/use-delete-timeline-items.js +17 -11
  173. package/dist/components/Timeline/use-expanded-track-keyframe-rows.d.ts +2 -1
  174. package/dist/components/Timeline/use-expanded-track-keyframe-rows.js +3 -1
  175. package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.js +7 -3
  176. package/dist/components/Timeline/use-timeline-keyframe-drag.js +28 -19
  177. package/dist/components/TimelineCombobox.js +1 -0
  178. package/dist/components/Transcription/Models.js +1 -1
  179. package/dist/components/Transcription/TranscriptionModal.js +18 -11
  180. package/dist/components/Transcription/TranscriptionModalWithOptionalWhisper.js +1 -1
  181. package/dist/components/Transcription/resample-media-to-16-khz.d.ts +2 -1
  182. package/dist/components/Transcription/resample-media-to-16-khz.js +20 -2
  183. package/dist/components/UpdatesSettings.js +2 -0
  184. package/dist/components/VideoMatting/Models.js +1 -1
  185. package/dist/components/VideoMatting/VideoMattingModal.js +30 -47
  186. package/dist/components/VideoMatting/VideoMattingModalWithOptionalPackage.js +1 -1
  187. package/dist/components/WebMcp.js +23 -40
  188. package/dist/components/composition-drop-preview.d.ts +9 -2
  189. package/dist/components/composition-drop-preview.js +8 -4
  190. package/dist/components/composition-menu-items.js +4 -4
  191. package/dist/components/delete-jsx-nodes-api.d.ts +2 -0
  192. package/dist/components/{delete-jsx-node-api.js → delete-jsx-nodes-api.js} +5 -5
  193. package/dist/components/effect-drag-and-drop.d.ts +13 -5
  194. package/dist/components/effect-drag-and-drop.js +19 -4
  195. package/dist/components/get-open-in-menu-items.d.ts +2 -1
  196. package/dist/components/get-open-in-menu-items.js +24 -8
  197. package/dist/components/keyboard-shortcuts.d.ts +4 -4
  198. package/dist/components/keyboard-shortcuts.js +3 -1
  199. package/dist/components/public-output-name.d.ts +1 -0
  200. package/dist/components/public-output-name.js +7 -3
  201. package/dist/components/selected-outline-drag.d.ts +1 -6
  202. package/dist/components/selected-outline-drag.js +22 -6
  203. package/dist/components/selected-outline-geometry.d.ts +2 -18
  204. package/dist/components/selected-outline-measurement.d.ts +23 -41
  205. package/dist/components/selected-outline-measurement.js +14 -252
  206. package/dist/components/selected-outline-order.d.ts +4 -11
  207. package/dist/components/selected-outline-order.js +2 -254
  208. package/dist/components/selected-outline-snap.d.ts +1 -1
  209. package/dist/components/selected-outline-snap.js +2 -1
  210. package/dist/components/selected-outline-types.d.ts +18 -28
  211. package/dist/components/selected-outline-uv.d.ts +4 -4
  212. package/dist/components/selected-outline-uv.js +6 -111
  213. package/dist/components/sequence-props-api.js +0 -10
  214. package/dist/components/use-selected-outline-control-target.js +12 -21
  215. package/dist/components/wrap-jsx-node-api.d.ts +2 -0
  216. package/dist/components/wrap-jsx-node-api.js +13 -0
  217. package/dist/error-overlay/remotion-overlay/OpenInEditor.js +45 -2
  218. package/dist/error-overlay/remotion-overlay/StackFrame.js +32 -3
  219. package/dist/esm/{CaptionQueueProcessor-k0yrm3dj.mjs → CaptionQueueProcessor-nr7hjcga.mjs} +96 -19
  220. package/dist/esm/LazyModels-ajkn7fs3.mjs +12 -0
  221. package/dist/esm/LazyModels-g1g7cf4e.mjs +12 -0
  222. package/dist/esm/{TranscriptionModal-ymnx1c7m.mjs → TranscriptionModal-e18bzbkb.mjs} +30 -22
  223. package/dist/esm/{VideoMattingModal-05vpczks.mjs → VideoMattingModal-5bz2s4rs.mjs} +47 -62
  224. package/dist/esm/{VideoMattingQueueProcessor-t1hgm2rm.mjs → VideoMattingQueueProcessor-4tkj0f4k.mjs} +69 -26
  225. package/dist/esm/{index-v4tr1bft.mjs → index-09txs1bj.mjs} +5 -0
  226. package/dist/esm/{index-4dsz9035.mjs → index-5ycb9e9q.mjs} +2 -4
  227. package/dist/esm/index-890dd9b3.mjs +768 -0
  228. package/dist/esm/{index-5bfxbpca.mjs → index-8nt6a0mw.mjs} +3 -3
  229. package/dist/esm/{index-5gd8k9yv.mjs → index-9q9w8v9p.mjs} +3 -3
  230. package/dist/esm/{index-x40wwfmt.mjs → index-c2wabcdt.mjs} +8 -6
  231. package/dist/esm/index-dfy1t576.mjs +129 -0
  232. package/dist/esm/index-dh3zk2hv.mjs +220 -0
  233. package/dist/esm/{index-0gewwxse.mjs → index-dpyss74p.mjs} +6179 -5011
  234. package/dist/esm/{index-9x6e1dq0.mjs → index-hqxc6tzp.mjs} +40 -6
  235. package/dist/esm/{index-cdy8v54v.mjs → index-qve7mdfp.mjs} +36 -539
  236. package/dist/esm/{index-eb5txqp6.mjs → index-s6qya2gg.mjs} +8 -88
  237. package/dist/esm/index-t7tbt980.mjs +103 -0
  238. package/dist/esm/{index-g7k2dvar.mjs → index-t7xnxdf8.mjs} +44 -26
  239. package/dist/esm/index-wqc43mw0.mjs +158 -0
  240. package/dist/esm/{index-bs39wngg.mjs → index-x6r9bn12.mjs} +5623 -6218
  241. package/dist/esm/{index-f97r9e2g.mjs → index-xac20sv4.mjs} +46 -57
  242. package/dist/esm/index.mjs +4 -4
  243. package/dist/esm/internals.mjs +13 -10
  244. package/dist/esm/previewEntry.mjs +18 -12
  245. package/dist/esm/renderEntry.mjs +5 -1
  246. package/dist/esm/{resolve-composition-component-location-bt2d6qxq.mjs → resolve-composition-component-location-2hgf6g0a.mjs} +1 -1
  247. package/dist/helpers/calculate-timeline.d.ts +5 -1
  248. package/dist/helpers/calculate-timeline.js +1 -1
  249. package/dist/helpers/checkerboard-background.d.ts +2 -2
  250. package/dist/helpers/colors.d.ts +132 -112
  251. package/dist/helpers/colors.js +117 -95
  252. package/dist/helpers/copy-text.js +1 -16
  253. package/dist/helpers/create-folder-tree.js +2 -1
  254. package/dist/helpers/editor-guide-selection.d.ts +1 -1
  255. package/dist/helpers/editor-ruler.js +23 -12
  256. package/dist/helpers/get-connected-compositions.d.ts +6 -1
  257. package/dist/helpers/get-connected-compositions.js +1 -1
  258. package/dist/helpers/get-sequence-double-click-action.js +1 -1
  259. package/dist/helpers/get-sequence-visible-range.d.ts +1 -1
  260. package/dist/helpers/get-sequence-visible-range.js +2 -5
  261. package/dist/helpers/get-timeline-nestedness.d.ts +1 -1
  262. package/dist/helpers/get-timeline-nestedness.js +1 -1
  263. package/dist/helpers/get-timeline-sequence-sort-key.d.ts +1 -1
  264. package/dist/helpers/get-timeline-sequence-sort-key.js +1 -1
  265. package/dist/helpers/hoverable.js +6 -5
  266. package/dist/helpers/inject-css.js +5 -7
  267. package/dist/helpers/open-in-editor.js +1 -1
  268. package/dist/helpers/prism-vsc-dark-plus.d.ts +1 -1
  269. package/dist/helpers/prism-vsc-dark-plus.js +52 -51
  270. package/dist/helpers/resolve-studio-color.d.ts +1 -0
  271. package/dist/helpers/resolve-studio-color.js +11 -0
  272. package/dist/helpers/studio-css-variables.d.ts +1 -0
  273. package/dist/helpers/studio-css-variables.js +105 -0
  274. package/dist/helpers/studio-pixel-ratio.d.ts +1 -0
  275. package/dist/helpers/studio-pixel-ratio.js +7 -0
  276. package/dist/helpers/studio-runtime-config.d.ts +1 -1
  277. package/dist/helpers/timeline-node-path-key.d.ts +1 -1
  278. package/dist/helpers/timeline-node-path-key.js +2 -2
  279. package/dist/helpers/use-keybinding.d.ts +1 -1
  280. package/dist/helpers/use-keyboard-shortcut-label.d.ts +2 -2
  281. package/dist/helpers/use-menu-structure.js +15 -9
  282. package/dist/helpers/use-runtime-values.js +2 -28
  283. package/dist/hot-middleware-client/client.js +5 -3
  284. package/dist/icons/align-center-horizontal.js +2 -1
  285. package/dist/icons/align-left.js +2 -1
  286. package/dist/icons/align-right.js +2 -1
  287. package/dist/icons/{separation.d.ts → background-removal.d.ts} +1 -1
  288. package/dist/icons/background-removal.js +9 -0
  289. package/dist/icons/wrap.d.ts +4 -0
  290. package/dist/icons/wrap.js +10 -0
  291. package/dist/previewEntry.js +2 -0
  292. package/dist/renderEntry.js +2 -0
  293. package/dist/state/modals.d.ts +20 -1
  294. package/dist/state/timeline-sequence-hover.d.ts +6 -16
  295. package/dist/state/timeline-sequence-hover.js +6 -67
  296. package/dist/state/timeline-zoom.js +4 -0
  297. package/package.json +20 -19
  298. package/dist/components/Timeline/get-easing-selection-after-keyframe-delete.d.ts +0 -15
  299. package/dist/components/Timeline/get-easing-selection-after-keyframe-delete.js +0 -31
  300. package/dist/components/delete-jsx-node-api.d.ts +0 -2
  301. package/dist/esm/LazyModels-mtggyjye.mjs +0 -11
  302. package/dist/esm/LazyModels-nk7py0zt.mjs +0 -11
  303. package/dist/esm/index-cw0pnpg5.mjs +0 -50
  304. package/dist/esm/index-k426ye99.mjs +0 -139
  305. package/dist/helpers/get-box-quads-polyfill-internals.d.ts +0 -82
  306. package/dist/helpers/get-box-quads-polyfill-internals.js +0 -2403
  307. package/dist/helpers/get-box-quads-ponyfill.d.ts +0 -10
  308. package/dist/helpers/get-box-quads-ponyfill.js +0 -23
  309. package/dist/icons/separation.js +0 -7
@@ -3,16 +3,15 @@ import {
3
3
  } from "./index-7tt71e8n.mjs";
4
4
  import {
5
5
  RenderModalOutputName
6
- } from "./index-x40wwfmt.mjs";
6
+ } from "./index-c2wabcdt.mjs";
7
7
  import {
8
8
  Button,
9
9
  Checkmark,
10
10
  Combobox,
11
11
  DismissableModal,
12
+ GearIcon,
12
13
  ModalHeader,
13
- ModelsIcon,
14
14
  RenderModalHr,
15
- SeparationIcon,
16
15
  SetSelectedModalContext,
17
16
  SidebarContext,
18
17
  VerticalTab,
@@ -25,17 +24,20 @@ import {
25
24
  rightRow,
26
25
  useStaticFiles,
27
26
  validatePublicOutputName
28
- } from "./index-bs39wngg.mjs";
27
+ } from "./index-x6r9bn12.mjs";
28
+ import"./index-dh3zk2hv.mjs";
29
29
  import {
30
30
  RenderQueueContext
31
- } from "./index-9x6e1dq0.mjs";
32
- import"./index-eb5txqp6.mjs";
33
- import"./index-cw0pnpg5.mjs";
31
+ } from "./index-hqxc6tzp.mjs";
32
+ import"./index-s6qya2gg.mjs";
33
+ import"./index-dfy1t576.mjs";
34
+ import"./index-t7tbt980.mjs";
34
35
  import {
35
36
  Models
36
- } from "./index-5bfxbpca.mjs";
37
- import"./index-g7k2dvar.mjs";
37
+ } from "./index-8nt6a0mw.mjs";
38
+ import"./index-t7xnxdf8.mjs";
38
39
  import {
40
+ ModelsIcon,
39
41
  VERTICAL_SCROLLBAR_CLASSNAME,
40
42
  ValidationMessage,
41
43
  buttonStyle,
@@ -48,11 +50,12 @@ import {
48
50
  leftSidebar,
49
51
  optionsPanel,
50
52
  outerModalStyle
51
- } from "./index-cdy8v54v.mjs";
53
+ } from "./index-890dd9b3.mjs";
54
+ import"./index-qve7mdfp.mjs";
52
55
  import"./index-5zrb1ft4.mjs";
53
56
  import {
54
57
  BLUE_DISABLED
55
- } from "./index-k426ye99.mjs";
58
+ } from "./index-wqc43mw0.mjs";
56
59
  import"./index-rcv7qkt5.mjs";
57
60
 
58
61
  // src/components/VideoMatting/VideoMattingModal.tsx
@@ -108,9 +111,10 @@ var makeOptions = ({
108
111
  }));
109
112
  var VideoMattingModal = ({
110
113
  displayName,
111
- src
114
+ src,
115
+ target
112
116
  }) => {
113
- const [tab, setTab] = useState("separate");
117
+ const [tab, setTab] = useState("remove");
114
118
  const isModelCached = useCallback((selectedModel) => isVideoMattingModelCached({ model: selectedModel }), []);
115
119
  const cachedModels = useModelCacheStatus({
116
120
  isModelCached,
@@ -118,10 +122,9 @@ var VideoMattingModal = ({
118
122
  refreshKey: tab
119
123
  });
120
124
  const baseName = useMemo(() => getDefaultOutputBaseName(src, displayName, "video"), [displayName, src]);
121
- const [baseOutName, setBaseOutName] = useState(`${baseName}-base.webm`);
122
- const [foregroundOutName, setForegroundOutName] = useState(`${baseName}-foreground.webm`);
123
- const [model, setModel] = useState("ben2-base");
124
- const [audio, setAudio] = useState("base");
125
+ const [outName, setOutName] = useState(`${baseName}-no-background.webm`);
126
+ const [model, setModel] = useState("modnet");
127
+ const [audio, setAudio] = useState("keep");
125
128
  const [videoBitrate, setVideoBitrate] = useState("very-high");
126
129
  const [support, setSupport] = useState({ type: "checking" });
127
130
  const staticFiles = useStaticFiles();
@@ -140,18 +143,11 @@ var VideoMattingModal = ({
140
143
  cancelled = true;
141
144
  };
142
145
  }, [model]);
143
- const normalizedBase = baseOutName.normalize("NFC").toLowerCase();
144
- const normalizedForeground = foregroundOutName.normalize("NFC").toLowerCase();
145
- const duplicateOutput = normalizedBase === normalizedForeground;
146
- const queuedOutputs = new Set(videoMattingJobs.filter((job) => job.status === "idle" || job.status === "running").flatMap((job) => [job.baseOutName, job.foregroundOutName]).map((name) => name.normalize("NFC").toLowerCase()));
147
- const baseError = validatePublicOutputName({ extension: ".webm", outName: baseOutName }) ?? (duplicateOutput ? "Base and foreground outputs must be different" : queuedOutputs.has(normalizedBase) ? "Another video matting job is using this output file" : null);
148
- const foregroundError = validatePublicOutputName({
149
- extension: ".webm",
150
- outName: foregroundOutName
151
- }) ?? (duplicateOutput ? "Base and foreground outputs must be different" : queuedOutputs.has(normalizedForeground) ? "Another video matting job is using this output file" : null);
152
- const baseExists = staticFiles.some((file) => file.name.normalize("NFC").toLowerCase() === normalizedBase);
153
- const foregroundExists = staticFiles.some((file) => file.name.normalize("NFC").toLowerCase() === normalizedForeground);
154
- const canSubmit = support.type === "supported" && baseError === null && foregroundError === null;
146
+ const normalizedOutput = outName.normalize("NFC").toLowerCase();
147
+ const queuedOutputs = new Set(videoMattingJobs.filter((job) => job.status === "idle" || job.status === "running" || job.status === "saving").map((job) => job.outName).map((name) => name.normalize("NFC").toLowerCase()));
148
+ const outputError = validatePublicOutputName({ extension: ".webm", outName }) ?? (queuedOutputs.has(normalizedOutput) ? "Another background removal job is using this output file" : null);
149
+ const outputExists = staticFiles.some((file) => file.name.normalize("NFC").toLowerCase() === normalizedOutput);
150
+ const canSubmit = support.type === "supported" && outputError === null;
155
151
  const modelOptions = useMemo(() => makeOptions({
156
152
  items: MODELS.map((item) => ({
157
153
  id: item.name,
@@ -162,9 +158,7 @@ var VideoMattingModal = ({
162
158
  }), [cachedModels, model]);
163
159
  const audioOptions = useMemo(() => makeOptions({
164
160
  items: [
165
- { id: "base", label: "Background layer" },
166
- { id: "foreground", label: "Foreground layer" },
167
- { id: "both", label: "Both layers" },
161
+ { id: "keep", label: "Keep original audio" },
168
162
  { id: "none", label: "No audio" }
169
163
  ],
170
164
  selected: audio,
@@ -184,11 +178,11 @@ var VideoMattingModal = ({
184
178
  addVideoMattingJob({
185
179
  src,
186
180
  displayName,
187
- baseOutName,
188
- foregroundOutName,
181
+ outName,
189
182
  model,
190
183
  audio,
191
- videoBitrate
184
+ videoBitrate,
185
+ target
192
186
  });
193
187
  setSidebarCollapsedState({ left: null, right: "expanded" });
194
188
  persistSelectedOptionsSidebarPanel("renders");
@@ -197,23 +191,24 @@ var VideoMattingModal = ({
197
191
  }, [
198
192
  addVideoMattingJob,
199
193
  audio,
200
- baseOutName,
201
194
  canSubmit,
202
195
  displayName,
203
- foregroundOutName,
196
+ outName,
204
197
  model,
205
198
  setSelectedModal,
206
199
  setSidebarCollapsedState,
207
200
  src,
201
+ target,
208
202
  videoBitrate
209
203
  ]);
204
+ const title = `Remove background from ${displayName}`;
210
205
  return /* @__PURE__ */ jsx(DismissableModal, {
211
- ariaLabel: `Track matting ${displayName}`,
206
+ ariaLabel: title,
212
207
  children: /* @__PURE__ */ jsxs("div", {
213
208
  style: modalStyle,
214
209
  children: [
215
210
  /* @__PURE__ */ jsx(ModalHeader, {
216
- title: `Track matting ${displayName}`
211
+ title
217
212
  }),
218
213
  /* @__PURE__ */ jsxs("div", {
219
214
  style: container,
@@ -229,7 +224,7 @@ var VideoMattingModal = ({
229
224
  ...buttonStyle,
230
225
  backgroundColor: canSubmit ? buttonStyle.backgroundColor : BLUE_DISABLED
231
226
  },
232
- children: "Separate"
227
+ children: "Remove background"
233
228
  })
234
229
  ]
235
230
  }),
@@ -241,17 +236,17 @@ var VideoMattingModal = ({
241
236
  children: [
242
237
  /* @__PURE__ */ jsx(VerticalTab, {
243
238
  autoFocus: true,
244
- onClick: () => setTab("separate"),
239
+ onClick: () => setTab("remove"),
245
240
  renderIcon: (color) => /* @__PURE__ */ jsx("div", {
246
241
  style: iconContainer,
247
- children: /* @__PURE__ */ jsx(SeparationIcon, {
242
+ children: /* @__PURE__ */ jsx(GearIcon, {
248
243
  color,
249
244
  style: icon
250
245
  })
251
246
  }),
252
- selected: tab === "separate",
247
+ selected: tab === "remove",
253
248
  style: horizontalTab,
254
- children: "Separate"
249
+ children: "General"
255
250
  }),
256
251
  /* @__PURE__ */ jsx(VerticalTab, {
257
252
  onClick: () => setTab("models"),
@@ -269,28 +264,18 @@ var VideoMattingModal = ({
269
264
  ]
270
265
  }),
271
266
  /* @__PURE__ */ jsxs("div", {
272
- style: tab === "separate" ? panelStyle : hiddenPanel,
267
+ style: tab === "remove" ? panelStyle : hiddenPanel,
273
268
  className: VERTICAL_SCROLLBAR_CLASSNAME,
274
269
  children: [
275
270
  /* @__PURE__ */ jsx(RenderModalOutputName, {
276
- ariaLabel: "Base video output file",
277
- existingOutputPath: window.remotion_publicFolderExists ? `${window.remotion_publicFolderExists}/${baseOutName}` : null,
278
- existence: baseExists,
279
- inputStyle: input,
280
- label: "Base output in public/",
281
- onValueChange: (event) => setBaseOutName(event.target.value),
282
- outName: baseOutName,
283
- validationMessage: baseError
284
- }),
285
- /* @__PURE__ */ jsx(RenderModalOutputName, {
286
- ariaLabel: "Foreground video output file",
287
- existingOutputPath: window.remotion_publicFolderExists ? `${window.remotion_publicFolderExists}/${foregroundOutName}` : null,
288
- existence: foregroundExists,
271
+ ariaLabel: "Video output file",
272
+ existingOutputPath: window.remotion_publicFolderExists ? `${window.remotion_publicFolderExists}/${outName}` : null,
273
+ existence: outputExists,
289
274
  inputStyle: input,
290
- label: "Foreground output in public/",
291
- onValueChange: (event) => setForegroundOutName(event.target.value),
292
- outName: foregroundOutName,
293
- validationMessage: foregroundError
275
+ label: "Output in public/",
276
+ onValueChange: (event) => setOutName(event.target.value),
277
+ outName,
278
+ validationMessage: outputError
294
279
  }),
295
280
  /* @__PURE__ */ jsx(RenderModalHr, {}),
296
281
  /* @__PURE__ */ jsxs("div", {
@@ -1,99 +1,142 @@
1
1
  import {
2
2
  loadModelForJob
3
- } from "./index-v4tr1bft.mjs";
3
+ } from "./index-09txs1bj.mjs";
4
4
  import {
5
5
  RenderQueueContext
6
- } from "./index-9x6e1dq0.mjs";
6
+ } from "./index-hqxc6tzp.mjs";
7
7
  import {
8
+ callApi,
9
+ getBrowserStudioOperations,
8
10
  writeStaticFile
9
- } from "./index-cw0pnpg5.mjs";
11
+ } from "./index-dfy1t576.mjs";
10
12
  import"./index-rcv7qkt5.mjs";
11
13
 
12
14
  // src/components/RenderQueue/VideoMattingQueueProcessor.tsx
13
15
  import {
14
16
  canUseVideoMatting,
15
17
  disposeVideoMattingModel,
18
+ downloadVideoMattingModel,
16
19
  isVideoMattingModelCached,
17
20
  loadVideoMattingModel,
18
- separateVideoLayers
21
+ VideoMattingInternals
19
22
  } from "@remotion/video-matting";
20
23
  import { useCallback, useContext, useEffect } from "react";
21
24
  var VideoMattingQueueProcessor = () => {
22
25
  const {
23
26
  markVideoMattingJobDone,
24
27
  markVideoMattingJobFailed,
28
+ markVideoMattingJobCancelled,
29
+ markVideoMattingJobSaving,
30
+ getAbortController,
25
31
  setProcessVideoMattingJobCallback,
26
32
  updateVideoMattingJobProgress
27
33
  } = useContext(RenderQueueContext);
28
34
  const processJob = useCallback(async (job) => {
29
- let outputs = null;
35
+ const { signal } = getAbortController(job.id);
36
+ let output = null;
30
37
  let processingError = null;
31
38
  try {
39
+ signal.throwIfAborted();
32
40
  updateVideoMattingJobProgress(job.id, {
33
41
  detail: null,
34
42
  message: "Checking WebGPU support...",
35
43
  value: 0
36
44
  });
37
45
  const support = await canUseVideoMatting({ model: job.model });
46
+ signal.throwIfAborted();
38
47
  if (!support.supported) {
39
48
  throw new Error(support.detailedReason);
40
49
  }
41
50
  await loadModelForJob({
51
+ signal,
42
52
  model: job.model,
43
53
  progressStart: 0,
44
54
  progressSpan: 0.2,
45
55
  isModelCached: (model) => isVideoMattingModelCached({ model }),
46
- loadModel: (model, onProgress) => loadVideoMattingModel({
47
- model,
48
- onProgress: (progress) => onProgress(progress.progress)
49
- }),
56
+ loadModel: async (model, onProgress) => {
57
+ await downloadVideoMattingModel({
58
+ signal,
59
+ model,
60
+ onProgress: (progress) => onProgress(progress.progress)
61
+ });
62
+ await loadVideoMattingModel({ model, signal });
63
+ },
50
64
  updateProgress: (progress) => updateVideoMattingJobProgress(job.id, {
51
65
  ...progress,
52
66
  detail: null
53
67
  })
54
68
  });
55
- outputs = await separateVideoLayers({
69
+ const mattingOptions = {
70
+ signal,
56
71
  src: job.src,
57
72
  model: job.model,
58
- audio: job.audio,
59
73
  videoBitrate: job.videoBitrate,
60
74
  onProgress: (progress) => {
61
75
  updateVideoMattingJobProgress(job.id, {
62
76
  detail: progress.stage === "finalizing" ? `Processed ${progress.processedFrames} ${progress.processedFrames === 1 ? "frame" : "frames"}` : `Processed ${progress.processedFrames} ${progress.processedFrames === 1 ? "frame" : "frames"} · ${Math.round(progress.progress * 100)}%`,
63
- message: progress.stage === "finalizing" ? "Finalizing video layers..." : "Separating foreground...",
77
+ message: progress.stage === "finalizing" ? "Finalizing video..." : "Removing background...",
64
78
  value: 0.2 + (progress.progress ?? 1) * 0.65
65
79
  });
66
80
  }
81
+ };
82
+ output = await VideoMattingInternals.removeVideoBackground({
83
+ ...mattingOptions,
84
+ audio: job.audio
67
85
  });
86
+ if (output === null) {
87
+ throw new Error("Video matting produced no output.");
88
+ }
89
+ signal.throwIfAborted();
68
90
  updateVideoMattingJobProgress(job.id, {
69
91
  detail: null,
70
- message: "Saving video layers...",
92
+ message: "Saving video...",
71
93
  value: 0.88
72
94
  });
73
- const [base, foreground] = await Promise.all([
74
- outputs.base.getBlob(),
75
- outputs.foreground.getBlob()
76
- ]);
77
- await Promise.all([
78
- base.arrayBuffer().then((contents) => writeStaticFile({ contents, filePath: job.baseOutName })),
79
- foreground.arrayBuffer().then((contents) => writeStaticFile({ contents, filePath: job.foregroundOutName }))
80
- ]);
95
+ const video = await output.video.getBlob();
96
+ signal.throwIfAborted();
97
+ markVideoMattingJobSaving(job.id);
98
+ await video.arrayBuffer().then((contents) => writeStaticFile({ contents, filePath: job.outName }));
99
+ if (job.target !== null) {
100
+ updateVideoMattingJobProgress(job.id, {
101
+ detail: null,
102
+ message: "Replacing video source...",
103
+ value: 0.97
104
+ });
105
+ const browserStudioOperations = getBrowserStudioOperations();
106
+ const request = {
107
+ fileName: job.target.fileName,
108
+ nodePath: job.target.nodePath.nodePath,
109
+ src: job.outName
110
+ };
111
+ const replaceSource = browserStudioOperations?.replaceVideoSource;
112
+ if (browserStudioOperations && !replaceSource) {
113
+ throw new Error("Browser Studio cannot replace the video source.");
114
+ }
115
+ const response = replaceSource ? await replaceSource(request) : await callApi("/api/replace-video-source", request);
116
+ if (!response.success) {
117
+ throw new Error(response.reason);
118
+ }
119
+ }
81
120
  } catch (error) {
82
121
  processingError = error instanceof Error ? error : new Error(String(error));
83
122
  }
123
+ if (output) {
124
+ await Promise.allSettled([output.video.dispose()]);
125
+ }
84
126
  try {
85
- await Promise.all([
86
- outputs?.base.dispose(),
87
- outputs?.foreground.dispose()
88
- ]);
89
127
  await disposeVideoMattingModel({ model: job.model });
90
128
  } catch {}
91
- if (processingError) {
129
+ if (signal.aborted) {
130
+ markVideoMattingJobCancelled(job.id);
131
+ } else if (processingError) {
92
132
  markVideoMattingJobFailed(job.id, processingError);
93
133
  } else {
94
134
  markVideoMattingJobDone(job.id);
95
135
  }
96
136
  }, [
137
+ getAbortController,
138
+ markVideoMattingJobCancelled,
139
+ markVideoMattingJobSaving,
97
140
  markVideoMattingJobDone,
98
141
  markVideoMattingJobFailed,
99
142
  updateVideoMattingJobProgress
@@ -3,18 +3,23 @@ var loadModelForJob = async ({
3
3
  isModelCached,
4
4
  loadModel,
5
5
  model,
6
+ signal,
6
7
  progressSpan,
7
8
  progressStart,
8
9
  updateProgress
9
10
  }) => {
11
+ signal.throwIfAborted();
10
12
  const cached = await isModelCached(model);
13
+ signal.throwIfAborted();
11
14
  await loadModel(model, (progress) => {
15
+ signal.throwIfAborted();
12
16
  const percentage = progress === null ? "" : ` ${Math.round(progress * 100)}%`;
13
17
  updateProgress({
14
18
  message: `${cached ? "Loading" : "Downloading"} ${model}${percentage}`,
15
19
  value: progressStart + (progress ?? 0) * progressSpan
16
20
  });
17
21
  });
22
+ signal.throwIfAborted();
18
23
  };
19
24
 
20
25
  export { loadModelForJob };
@@ -1,9 +1,7 @@
1
1
  import {
2
- callApi
3
- } from "./index-eb5txqp6.mjs";
4
- import {
2
+ callApi,
5
3
  getBrowserStudioOperations
6
- } from "./index-cw0pnpg5.mjs";
4
+ } from "./index-dfy1t576.mjs";
7
5
 
8
6
  // src/api/pause.ts
9
7
  import { Internals } from "remotion";