@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
@@ -274,6 +274,9 @@ const DataEditor = ({ unresolvedComposition, defaultProps, setDefaultProps, prop
274
274
  if (!unresolvedComposition.defaultProps) {
275
275
  return jsx_runtime_1.jsx(SchemaErrorMessages_1.NoDefaultProps, { mode: schemaErrorMode });
276
276
  }
277
+ // <Composition> normalizes omitted defaultProps to an empty object.
278
+ // Avoid rendering field editors with undefined values in that case.
279
+ const emptyDefaultPropsAreInvalid = Object.keys(defaultProps).length === 0 && !zodValidationResult.success;
277
280
  const shouldRenderControlRow = !hideModeControls || (!hideWarningButton && warnings.length > 0);
278
281
  const shouldRenderWarningMessages = showWarning && warnings.length > 0;
279
282
  const compactLayout = layout === 'inspector';
@@ -284,6 +287,6 @@ const DataEditor = ({ unresolvedComposition, defaultProps, setDefaultProps, prop
284
287
  jsx_runtime_1.jsx(layout_1.Spacing, { y: 1 }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { message: warning.message, align: "flex-start", type: "warning", size: compactLayout ? 'compact' : 'default', action: warning.resolveLink ? (jsx_runtime_1.jsx("a", { href: warning.resolveLink, target: "_blank", rel: "noopener noreferrer", style: compactLayout
285
288
  ? compactResolveLinkStyle
286
289
  : resolveLinkStyle, children: "Resolve" })) : null })] }, warning.id)))
287
- : null] })) : null, mode === 'schema' ? (jsx_runtime_1.jsx(SchemaEditor_1.SchemaEditor, { value: defaultProps, setValue: setDefaultProps, schema: schema, scrollableContainer: !compactLayout, contentInset: compactLayout ? InspectorPanelLayout_1.INSPECTOR_PANEL_HORIZONTAL_PADDING : undefined, errorMode: schemaErrorMode })) : (jsx_runtime_1.jsx(RenderModalJSONPropsEditor_1.RenderModalJSONPropsEditor, { value: defaultProps !== null && defaultProps !== void 0 ? defaultProps : {}, setValue: jsonEditorSetValue, onSave: onSave, serializedJSON: serializedJSON, defaultProps: unresolvedComposition.defaultProps, schema: schema, compositionId: unresolvedComposition.id, layout: layout }))] }));
290
+ : null] })) : null, mode === 'schema' ? (emptyDefaultPropsAreInvalid ? (jsx_runtime_1.jsx(SchemaErrorMessages_1.InvalidDefaultProps, { zodValidationResult: zodValidationResult })) : (jsx_runtime_1.jsx(SchemaEditor_1.SchemaEditor, { value: defaultProps, setValue: setDefaultProps, schema: schema, scrollableContainer: !compactLayout, contentInset: compactLayout ? InspectorPanelLayout_1.INSPECTOR_PANEL_HORIZONTAL_PADDING : undefined, errorMode: schemaErrorMode }))) : (jsx_runtime_1.jsx(RenderModalJSONPropsEditor_1.RenderModalJSONPropsEditor, { value: defaultProps !== null && defaultProps !== void 0 ? defaultProps : {}, setValue: jsonEditorSetValue, onSave: onSave, serializedJSON: serializedJSON, defaultProps: unresolvedComposition.defaultProps, schema: schema, compositionId: unresolvedComposition.id, layout: layout }))] }));
288
291
  };
289
292
  exports.DataEditor = DataEditor;
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createZodValues = void 0;
4
- const colors_1 = require("../../../helpers/colors");
5
4
  const zod_schema_type_1 = require("./zod-schema-type");
6
5
  const createZodValues = (schema, zodRuntime, zodTypes) => {
7
6
  var _a;
@@ -14,7 +13,7 @@ const createZodValues = (schema, zodRuntime, zodTypes) => {
14
13
  const description = (0, zod_schema_type_1.getZodSchemaDescription)(schema);
15
14
  if (zodTypes) {
16
15
  if (description === zodTypes.ZodZypesInternals.REMOTION_COLOR_BRAND) {
17
- return colors_1.WHITE_FULL_HEX;
16
+ return '#ffffff';
18
17
  }
19
18
  if (description === zodTypes.ZodZypesInternals.REMOTION_TEXTAREA_BRAND) {
20
19
  return '';
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.WebRenderModalPicture = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
- const colors_1 = require("../../helpers/colors");
7
6
  const Checkbox_1 = require("../Checkbox");
8
7
  const ComboBox_1 = require("../NewComposition/ComboBox");
9
8
  const layout_1 = require("./layout");
@@ -23,7 +22,7 @@ const WebRenderModalPicture = ({ renderMode, videoBitrate, setVideoBitrate, keyf
23
22
  jsx_runtime_1.jsxs("div", { style: layout_1.optionRow, children: [
24
23
  jsx_runtime_1.jsx("div", { style: layout_1.label, children: "Quality" }), jsx_runtime_1.jsx("div", { style: layout_1.rightRow, children: jsx_runtime_1.jsx(ComboBox_1.Combobox, { values: qualityOptions, selectedId: videoBitrate, title: "Quality" }) })
25
24
  ] }), jsx_runtime_1.jsx(NumberSetting_1.NumberSetting, { name: "Keyframe Interval", formatter: (v) => `${v}s`, min: 1, max: 300, step: 1, value: keyframeIntervalInSeconds, onValueChanged: setKeyframeIntervalInSeconds }), jsx_runtime_1.jsxs("div", { style: layout_1.optionRow, children: [
26
- jsx_runtime_1.jsx("div", { style: layout_1.label, children: "Transparent" }), jsx_runtime_1.jsx("div", { style: layout_1.rightRow, children: jsx_runtime_1.jsx(Checkbox_1.Checkbox, { checked: transparent, onChange: onTransparentChanged, name: colors_1.TRANSPARENT }) })
25
+ jsx_runtime_1.jsx("div", { style: layout_1.label, children: "Transparent" }), jsx_runtime_1.jsx("div", { style: layout_1.rightRow, children: jsx_runtime_1.jsx(Checkbox_1.Checkbox, { checked: transparent, onChange: onTransparentChanged, name: "transparent" }) })
27
26
  ] })
28
27
  ] }))] }));
29
28
  };
@@ -12,6 +12,10 @@ const use_select_asset_1 = require("../use-select-asset");
12
12
  const CircularProgress_1 = require("./CircularProgress");
13
13
  const context_1 = require("./context");
14
14
  const item_style_1 = require("./item-style");
15
+ const QueueJobError_1 = require("./QueueJobError");
16
+ const RenderQueueCancelledMessage_1 = require("./RenderQueueCancelledMessage");
17
+ const RenderQueueItemCancelButton_1 = require("./RenderQueueItemCancelButton");
18
+ const RenderQueueRepeat_1 = require("./RenderQueueRepeat");
15
19
  const SuccessIcon_1 = require("./SuccessIcon");
16
20
  const container = {
17
21
  padding: 12,
@@ -53,13 +57,13 @@ const removeIcon = {
53
57
  color: colors_1.CURRENT_COLOR,
54
58
  };
55
59
  const CaptionJobStatus = ({ job }) => {
56
- if (job.status === 'running') {
60
+ if (job.status === 'running' || job.status === 'saving') {
57
61
  return (jsx_runtime_1.jsx("div", { style: statusIcon, role: "progressbar", "aria-label": "Caption job progress", "aria-valuetext": job.progress.message, "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": Math.round(job.progress.value * 100), children: jsx_runtime_1.jsx(CircularProgress_1.CircularProgress, { progress: Math.max(0.07, job.progress.value) }) }));
58
62
  }
59
63
  if (job.status === 'done') {
60
64
  return jsx_runtime_1.jsx(SuccessIcon_1.SuccessIcon, {});
61
65
  }
62
- if (job.status === 'failed') {
66
+ if (job.status === 'failed' || job.status === 'cancelled') {
63
67
  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 32l-17 17-47 47 47 47 17 17L320 353.9l-17-17-47-47-47 47-17 17L158.1 320l17-17 47-47-47-47-17-17L192 158.1l17 17 47 47 47-47 17-17L353.9 192z" }) }));
64
68
  }
65
69
  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 0S512 114.6 512 256s-114.6 256-256 256zM232 120V256c0 8 4 15.5 10.7 20l96 64c11 7.4 25.9 4.4 33.3-6.7s4.4-25.9-6.7-33.3L280 243.2V120c0-13.3-10.7-24-24-24s-24 10.7-24 24z" }) }));
@@ -68,7 +72,7 @@ const CaptionQueueItem = ({ job, selected }) => {
68
72
  const [hovered, setHovered] = (0, react_1.useState)(false);
69
73
  const { removeCaptionJob } = (0, react_1.useContext)(context_1.RenderQueueContext);
70
74
  const selectAsset = (0, use_select_asset_1.useSelectAsset)();
71
- const isHoverable = job.status === 'done';
75
+ const isHoverable = job.status === 'done' && job.target === null;
72
76
  const containerStyle = (0, react_1.useMemo)(() => {
73
77
  return {
74
78
  ...container,
@@ -95,6 +99,9 @@ const CaptionQueueItem = ({ job, selected }) => {
95
99
  if (job.status !== 'done') {
96
100
  return;
97
101
  }
102
+ if (job.target !== null) {
103
+ return;
104
+ }
98
105
  selectAsset(job.outName);
99
106
  (0, url_state_1.pushUrl)(`/assets/${job.outName}`);
100
107
  }, [job, selectAsset]);
@@ -114,17 +121,22 @@ const CaptionQueueItem = ({ job, selected }) => {
114
121
  if (job.status === 'idle') {
115
122
  return 'Queued for transcription';
116
123
  }
117
- if (job.status === 'running') {
124
+ if (job.status === 'running' || job.status === 'saving') {
118
125
  return job.progress.message;
119
126
  }
127
+ if (job.status === 'cancelled') {
128
+ return 'Cancelled';
129
+ }
120
130
  if (job.status === 'failed') {
121
131
  return job.error.message;
122
132
  }
123
- return job.outName;
133
+ return job.target === null ? job.outName : 'Captions added to composition';
124
134
  }, [job]);
125
135
  return (jsx_runtime_1.jsxs(layout_1.Row, { "data-render-queue-item": job.id, style: containerStyle, align: "center", onClick: onClick, onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, className: selected ? item_style_1.RENDER_QUEUE_ITEM_SELECTED_CLASSNAME : undefined, children: [
126
136
  jsx_runtime_1.jsx(CaptionJobStatus, { job: job }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), jsx_runtime_1.jsxs("div", { style: right, children: [
127
- jsx_runtime_1.jsx("div", { style: title, children: job.displayName }), jsx_runtime_1.jsx("div", { style: subtitleContainer, children: jsx_runtime_1.jsx("span", { style: subtitle, title: message, children: message }) })
128
- ] }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), 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: renderRemoveAction, onClick: onRemove, "aria-label": "Clear", variant: null }) }))] }));
137
+ jsx_runtime_1.jsx("div", { style: title, children: job.displayName }), jsx_runtime_1.jsx("div", { style: subtitleContainer, 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: "Transcription failed" })) : (jsx_runtime_1.jsx("span", { style: subtitle, title: message, children: message })) })
138
+ ] }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), job.status === 'done' ||
139
+ job.status === 'failed' ||
140
+ 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: renderRemoveAction, onClick: onRemove, "aria-label": "Clear", variant: null }) }))] }));
129
141
  };
130
142
  exports.CaptionQueueItem = CaptionQueueItem;
@@ -4,20 +4,26 @@ exports.CaptionQueueProcessor = void 0;
4
4
  const whisper_webgpu_1 = require("@remotion/whisper-webgpu");
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 install_required_package_1 = require("../../helpers/install-required-package");
9
+ const call_api_1 = require("../call-api");
7
10
  const resample_media_to_16_khz_1 = require("../Transcription/resample-media-to-16-khz");
8
11
  const context_1 = require("./context");
9
12
  const load_model_for_job_1 = require("./load-model-for-job");
10
13
  const CaptionQueueProcessor = () => {
11
- const { updateCaptionJobProgress, markCaptionJobDone, markCaptionJobFailed, setProcessCaptionJobCallback, } = (0, react_1.useContext)(context_1.RenderQueueContext);
14
+ const { updateCaptionJobProgress, markCaptionJobDone, markCaptionJobFailed, markCaptionJobCancelled, markCaptionJobSaving, getAbortController, setProcessCaptionJobCallback, } = (0, react_1.useContext)(context_1.RenderQueueContext);
12
15
  const processJob = (0, react_1.useCallback)(async (job) => {
16
+ const { signal } = getAbortController(job.id);
13
17
  let captionCount = null;
14
18
  let processingError = null;
15
19
  try {
20
+ signal.throwIfAborted();
16
21
  updateCaptionJobProgress(job.id, {
17
22
  message: 'Checking WebGPU support...',
18
23
  value: 0,
19
24
  });
20
25
  const support = await (0, whisper_webgpu_1.canUseWhisperWebGpu)();
26
+ signal.throwIfAborted();
21
27
  if (!support.supported) {
22
28
  throw new Error(support.detailedReason);
23
29
  }
@@ -26,15 +32,21 @@ const CaptionQueueProcessor = () => {
26
32
  value: 0.02,
27
33
  });
28
34
  await (0, whisper_webgpu_1.clearStaleModels)();
35
+ signal.throwIfAborted();
29
36
  await (0, load_model_for_job_1.loadModelForJob)({
37
+ signal,
30
38
  model: job.model,
31
39
  progressStart: 0.03,
32
40
  progressSpan: 0.27,
33
41
  isModelCached: (model) => (0, whisper_webgpu_1.isWhisperModelCached)({ model }),
34
- loadModel: (model, onProgress) => (0, whisper_webgpu_1.loadWhisperModel)({
35
- model,
36
- onProgress: (progress) => onProgress(progress.progress),
37
- }),
42
+ loadModel: async (model, onProgress) => {
43
+ await (0, whisper_webgpu_1.downloadWhisperModel)({
44
+ signal,
45
+ model,
46
+ onProgress: (progress) => onProgress(progress.progress),
47
+ });
48
+ await (0, whisper_webgpu_1.loadWhisperModel)({ model, signal });
49
+ },
38
50
  updateProgress: (progress) => updateCaptionJobProgress(job.id, progress),
39
51
  });
40
52
  updateCaptionJobProgress(job.id, {
@@ -42,6 +54,7 @@ const CaptionQueueProcessor = () => {
42
54
  value: 0.3,
43
55
  });
44
56
  const channelWaveform = await (0, resample_media_to_16_khz_1.resampleMediaTo16Khz)({
57
+ signal,
45
58
  src: job.src,
46
59
  audioStreamIndex: job.audioStreamIndex,
47
60
  requestInit: job.requestInit,
@@ -57,6 +70,7 @@ const CaptionQueueProcessor = () => {
57
70
  value: 0.5,
58
71
  });
59
72
  const transcription = await (0, whisper_webgpu_1.transcribe)({
73
+ signal,
60
74
  channelWaveform,
61
75
  model: job.model,
62
76
  task: job.task,
@@ -73,14 +87,40 @@ const CaptionQueueProcessor = () => {
73
87
  const { captions } = (0, whisper_webgpu_1.toCaptions)({
74
88
  whisperWebGpuOutput: transcription,
75
89
  });
76
- updateCaptionJobProgress(job.id, {
77
- message: `Saving ${job.outName}...`,
78
- value: 0.95,
79
- });
80
- await (0, write_static_file_1.writeStaticFile)({
81
- contents: JSON.stringify(captions, null, 2),
82
- filePath: job.outName,
83
- });
90
+ signal.throwIfAborted();
91
+ markCaptionJobSaving(job.id);
92
+ if (job.target === null) {
93
+ updateCaptionJobProgress(job.id, {
94
+ message: `Saving ${job.outName}...`,
95
+ value: 0.95,
96
+ });
97
+ await (0, write_static_file_1.writeStaticFile)({
98
+ contents: JSON.stringify(captions, null, 2),
99
+ filePath: job.outName,
100
+ });
101
+ }
102
+ else {
103
+ updateCaptionJobProgress(job.id, {
104
+ message: 'Adding Basic captions...',
105
+ value: 0.95,
106
+ });
107
+ await (0, install_required_package_1.installRequiredPackages)([
108
+ { name: '@remotion/captions', version: null },
109
+ ]);
110
+ const request = {
111
+ fileName: job.target.fileName,
112
+ nodePath: job.target.nodePath.nodePath,
113
+ durationInFrames: job.target.durationInFrames,
114
+ captions,
115
+ };
116
+ const browserStudioOperations = (0, browser_studio_operations_1.getBrowserStudioOperations)();
117
+ const response = browserStudioOperations
118
+ ? await browserStudioOperations.insertBasicCaptions(request)
119
+ : await (0, call_api_1.callApi)('/api/insert-basic-captions', request);
120
+ if (!response.success) {
121
+ throw new Error(response.reason);
122
+ }
123
+ }
84
124
  captionCount = captions.length;
85
125
  }
86
126
  catch (error) {
@@ -94,13 +134,23 @@ const CaptionQueueProcessor = () => {
94
134
  // The pipeline is removed from the in-memory registry before disposal.
95
135
  // A cleanup failure should not hide a successfully written caption file.
96
136
  }
97
- if (processingError) {
137
+ if (signal.aborted) {
138
+ markCaptionJobCancelled(job.id);
139
+ }
140
+ else if (processingError) {
98
141
  markCaptionJobFailed(job.id, processingError);
99
142
  }
100
143
  else {
101
144
  markCaptionJobDone(job.id, captionCount !== null && captionCount !== void 0 ? captionCount : 0);
102
145
  }
103
- }, [markCaptionJobDone, markCaptionJobFailed, updateCaptionJobProgress]);
146
+ }, [
147
+ getAbortController,
148
+ markCaptionJobCancelled,
149
+ markCaptionJobDone,
150
+ markCaptionJobFailed,
151
+ markCaptionJobSaving,
152
+ updateCaptionJobProgress,
153
+ ]);
104
154
  (0, react_1.useEffect)(() => {
105
155
  setProcessCaptionJobCallback(processJob);
106
156
  return () => setProcessCaptionJobCallback(null);
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ export declare const QueueJobError: React.FC<{
3
+ readonly error: {
4
+ message: string;
5
+ stack: string | undefined;
6
+ };
7
+ readonly modalTitle: string;
8
+ }>;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.QueueJobError = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const modals_1 = require("../../state/modals");
7
+ const item_style_1 = require("./item-style");
8
+ const errorStyle = {
9
+ ...item_style_1.renderQueueItemSubtitleStyle,
10
+ };
11
+ const QueueJobError = ({ error, modalTitle }) => {
12
+ const { setSelectedModal } = (0, react_1.useContext)(modals_1.SetSelectedModalContext);
13
+ const onClick = (0, react_1.useCallback)((event) => {
14
+ var _a;
15
+ event.stopPropagation();
16
+ setSelectedModal({
17
+ type: 'queue-job-error',
18
+ title: modalTitle,
19
+ error: { message: error.message, stack: (_a = error.stack) !== null && _a !== void 0 ? _a : null },
20
+ });
21
+ }, [error, modalTitle, setSelectedModal]);
22
+ return (jsx_runtime_1.jsx("button", { onClick: onClick, type: "button", style: errorStyle, title: error.message, children: error.message }));
23
+ };
24
+ exports.QueueJobError = QueueJobError;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ export declare const QueueJobErrorModal: React.FC<{
3
+ readonly title: string;
4
+ readonly error: {
5
+ message: string;
6
+ stack: string | null;
7
+ };
8
+ }>;
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.QueueJobErrorModal = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const CopyStackTrace_1 = require("../../error-overlay/remotion-overlay/CopyStackTrace");
7
+ const colors_1 = require("../../helpers/colors");
8
+ const modals_1 = require("../../state/modals");
9
+ const Button_1 = require("../Button");
10
+ const layout_1 = require("../layout");
11
+ const is_menu_item_1 = require("../Menu/is-menu-item");
12
+ const ModalContainer_1 = require("../ModalContainer");
13
+ const ModalHeader_1 = require("../ModalHeader");
14
+ const container = {
15
+ padding: 20,
16
+ maxWidth: 900,
17
+ paddingTop: 0,
18
+ };
19
+ const codeBlock = {
20
+ backgroundColor: colors_1.RENDER_STATUS_BACKGROUND,
21
+ whiteSpace: 'pre',
22
+ padding: 12,
23
+ borderRadius: 4,
24
+ fontFamily: 'monospace',
25
+ overflow: 'auto',
26
+ maxHeight: 300,
27
+ };
28
+ const description = {
29
+ color: colors_1.LIGHT_TEXT,
30
+ fontFamily: 'sans-serif',
31
+ fontSize: 14,
32
+ lineHeight: 1.5,
33
+ margin: 0,
34
+ marginBottom: 12,
35
+ marginTop: 16,
36
+ };
37
+ const spacer = {
38
+ height: layout_1.SPACING_UNIT,
39
+ width: layout_1.SPACING_UNIT,
40
+ };
41
+ const buttonRow = {
42
+ display: 'flex',
43
+ flexDirection: 'row',
44
+ justifyContent: 'flex-end',
45
+ };
46
+ const QueueJobErrorModal = ({ title, error }) => {
47
+ var _a;
48
+ const { setSelectedModal } = (0, react_1.useContext)(modals_1.SetSelectedModalContext);
49
+ const onClose = (0, react_1.useCallback)(() => {
50
+ setSelectedModal(null);
51
+ }, [setSelectedModal]);
52
+ const errorDetails = ((_a = error.stack) === null || _a === void 0 ? void 0 : _a.split('\n')[0].includes(error.message))
53
+ ? error.stack
54
+ : [error.message, error.stack].filter(Boolean).join('\n');
55
+ return (jsx_runtime_1.jsxs(ModalContainer_1.ModalContainer, { ariaLabel: title, onOutsideClick: onClose, onEscape: onClose, children: [
56
+ jsx_runtime_1.jsx(ModalHeader_1.ModalHeader, { title: title }), jsx_runtime_1.jsxs("div", { style: container, children: [
57
+ jsx_runtime_1.jsx("p", { style: description, children: "The job failed because of the following error:" }), jsx_runtime_1.jsx("div", { className: is_menu_item_1.HORIZONTAL_SCROLLBAR_CLASSNAME, style: codeBlock, children: errorDetails }), jsx_runtime_1.jsx("div", { style: spacer }), jsx_runtime_1.jsxs("div", { style: buttonRow, children: [
58
+ jsx_runtime_1.jsx(CopyStackTrace_1.CopyStackTrace, { errorText: errorDetails }), jsx_runtime_1.jsx(layout_1.Flex, {}), jsx_runtime_1.jsx(Button_1.Button, { onClick: onClose, children: "Close" })
59
+ ] })
60
+ ] })
61
+ ] }));
62
+ };
63
+ exports.QueueJobErrorModal = QueueJobErrorModal;
@@ -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;
@@ -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
  };
@@ -71,52 +75,44 @@ const VideoMattingQueueItem = ({ job, selected }) => {
71
75
  selected,
72
76
  }),
73
77
  userSelect: 'none',
78
+ WebkitUserSelect: 'none',
74
79
  }), [done, hovered, selected]);
75
80
  const messages = job.status === 'idle'
76
- ? ['Queued for video matting']
77
- : job.status === 'running'
81
+ ? ['Queued for background removal']
82
+ : job.status === 'running' || job.status === 'saving'
78
83
  ? [job.progress.message, job.progress.detail].filter((message) => message !== null)
79
84
  : job.status === 'failed'
80
85
  ? [job.error.message]
81
- : [job.baseOutName, job.foregroundOutName];
86
+ : job.status === 'cancelled'
87
+ ? ['Cancelled']
88
+ : [job.outName];
82
89
  const tooltip = messages.join('\n');
83
90
  const revealAsset = (0, react_1.useCallback)((assetName) => {
84
91
  selectAsset(assetName);
85
92
  (0, url_state_1.pushUrl)(`/assets/${assetName}`);
86
93
  }, [selectAsset]);
94
+ const outputName = job.outName;
87
95
  const onClick = (0, react_1.useCallback)(() => {
88
96
  if (!done)
89
97
  return;
90
- revealAsset(job.foregroundOutName);
91
- }, [done, job.foregroundOutName, revealAsset]);
98
+ revealAsset(outputName);
99
+ }, [done, outputName, revealAsset]);
92
100
  const revealItems = (0, react_1.useMemo)(() => {
93
101
  return [
94
102
  {
95
103
  disabled: false,
96
- id: 'reveal-foreground',
104
+ id: 'reveal-output',
97
105
  keyHint: null,
98
- label: 'Reveal foreground',
106
+ label: 'Reveal output',
99
107
  leftItem: null,
100
- onClick: () => revealAsset(job.foregroundOutName),
108
+ onClick: () => revealAsset(outputName),
101
109
  quickSwitcherLabel: null,
102
110
  subMenu: null,
103
111
  type: 'item',
104
- value: 'reveal-foreground',
105
- },
106
- {
107
- disabled: false,
108
- id: 'reveal-background',
109
- keyHint: null,
110
- label: 'Reveal background',
111
- leftItem: null,
112
- onClick: () => revealAsset(job.baseOutName),
113
- quickSwitcherLabel: null,
114
- subMenu: null,
115
- type: 'item',
116
- value: 'reveal-background',
112
+ value: 'reveal-output',
117
113
  },
118
114
  ];
119
- }, [job.baseOutName, job.foregroundOutName, revealAsset]);
115
+ }, [outputName, revealAsset]);
120
116
  const onRemove = (0, react_1.useCallback)((event) => {
121
117
  event.stopPropagation();
122
118
  removeVideoMattingJob(job.id);
@@ -124,7 +120,9 @@ const VideoMattingQueueItem = ({ job, selected }) => {
124
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" }) })), []);
125
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: [
126
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: [
127
- 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))) })
128
- ] }), 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", { style: subtitles, title: 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 }) }))] }));
129
127
  };
130
128
  exports.VideoMattingQueueItem = VideoMattingQueueItem;