@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.
- package/dist/components/AgentPrompt.js +1 -2
- package/dist/components/AudioWaveform.d.ts +1 -0
- package/dist/components/AudioWaveform.js +10 -14
- package/dist/components/Canvas.js +88 -26
- package/dist/components/CanvasCaptureDropHandler.js +63 -0
- package/dist/components/CanvasOrLoading.js +10 -2
- package/dist/components/CodeFrame.js +1 -1
- package/dist/components/ColorPicker/checker.d.ts +1 -1
- package/dist/components/CompositionSelectorItem.js +1 -0
- package/dist/components/CurrentAsset.js +4 -2
- package/dist/components/EditorRuler/Ruler.js +6 -3
- package/dist/components/EffectPickerModal.js +69 -43
- package/dist/components/ElementInstallConfirmation.js +3 -3
- package/dist/components/ElementLibrariesSettings.d.ts +2 -0
- package/dist/components/ElementLibrariesSettings.js +200 -0
- package/dist/components/InitialCompositionLoader.js +4 -2
- package/dist/components/InlineDropdown.js +26 -2
- package/dist/components/InlineEditableTitle.js +1 -0
- package/dist/components/InspectorOpenInEditor.js +13 -0
- package/dist/components/InspectorPanel/AlignmentControls.js +28 -9
- package/dist/components/InspectorPanel/CollapsibleInspectorSectionHeader.js +2 -1
- package/dist/components/InspectorPanel/CompositionInspector.js +3 -3
- package/dist/components/InspectorPanel/CompositionMetadata.js +4 -0
- package/dist/components/InspectorPanel/EasingInspector.js +6 -2
- package/dist/components/InspectorPanel/ElementLibraryButton.js +2 -1
- package/dist/components/InspectorPanel/KeyframeEasingNavigator.js +1 -1
- package/dist/components/InspectorPanel/KeyframeInspector.js +28 -24
- package/dist/components/InspectorPanel/MultiSequenceInspector.js +32 -1
- package/dist/components/InspectorPanel/MultiSequenceNumberField.js +1 -1
- package/dist/components/InspectorPanel/SequenceInspectorHeader.d.ts +3 -1
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +70 -2
- package/dist/components/InspectorPanel/SequenceWrapAction.d.ts +8 -0
- package/dist/components/InspectorPanel/SequenceWrapAction.js +151 -0
- package/dist/components/InspectorPanel/common.js +1 -0
- package/dist/components/InspectorPanel/easing-inspector-selection.d.ts +2 -1
- package/dist/components/InspectorPanel/easing-inspector-selection.js +4 -3
- package/dist/components/InspectorPanel/keyframe-inspector-frame.d.ts +2 -1
- package/dist/components/InspectorPanel/keyframe-inspector-frame.js +2 -2
- package/dist/components/InspectorPanel/styles.js +2 -0
- package/dist/components/InspectorPanel/use-composition-actions.js +1 -0
- package/dist/components/InspectorSequenceSection.d.ts +1 -0
- package/dist/components/InspectorSequenceSection.js +7 -5
- package/dist/components/InspectorSourceLocation.js +3 -0
- package/dist/components/KeyboardShortcutsSettings.js +1 -1
- package/dist/components/Menu/styles.d.ts +2 -2
- package/dist/components/MenuBuildIndicator.js +1 -0
- package/dist/components/Modals.js +7 -6
- package/dist/components/ModelManager.js +10 -9
- package/dist/components/NewComposition/CancelButton.js +11 -5
- package/dist/components/NewComposition/InputDragger.d.ts +3 -1
- package/dist/components/NewComposition/InputDragger.js +28 -9
- package/dist/components/NewComposition/NewComposition.js +7 -6
- package/dist/components/NewComposition/RemInput.d.ts +1 -1
- package/dist/components/NewComposition/menu-typeahead.js +1 -1
- package/dist/components/Preview.js +4 -0
- package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +1 -0
- package/dist/components/QuickSwitcher/QuickSwitcherContent.js +1 -0
- package/dist/components/RadioButton.js +1 -0
- package/dist/components/RenderModal/DataEditor.js +4 -1
- package/dist/components/RenderModal/SchemaEditor/create-zod-values.js +1 -2
- package/dist/components/RenderModal/WebRenderModalPicture.js +1 -2
- package/dist/components/RenderQueue/CaptionQueueItem.js +19 -7
- package/dist/components/RenderQueue/CaptionQueueProcessor.js +65 -15
- package/dist/components/RenderQueue/QueueJobError.d.ts +8 -0
- package/dist/components/RenderQueue/QueueJobError.js +24 -0
- package/dist/components/RenderQueue/QueueJobErrorModal.d.ts +8 -0
- package/dist/components/RenderQueue/QueueJobErrorModal.js +63 -0
- package/dist/components/RenderQueue/RenderQueueItemCancelButton.d.ts +3 -1
- package/dist/components/RenderQueue/RenderQueueItemCancelButton.js +11 -4
- package/dist/components/RenderQueue/RenderQueueRepeat.d.ts +3 -1
- package/dist/components/RenderQueue/RenderQueueRepeat.js +20 -3
- package/dist/components/RenderQueue/VideoMattingQueueItem.js +25 -27
- package/dist/components/RenderQueue/VideoMattingQueueProcessor.js +68 -28
- package/dist/components/RenderQueue/caption-job-types.d.ts +9 -1
- package/dist/components/RenderQueue/context.d.ts +4 -0
- package/dist/components/RenderQueue/context.js +58 -8
- package/dist/components/RenderQueue/index.js +3 -3
- package/dist/components/RenderQueue/load-model-for-job.d.ts +2 -1
- package/dist/components/RenderQueue/load-model-for-job.js +5 -1
- package/dist/components/RenderQueue/video-matting-job-types.d.ts +13 -6
- package/dist/components/RendersTab.js +2 -0
- package/dist/components/SelectedOutlineCropControls.js +2 -1
- package/dist/components/SelectedOutlineEditingHandles.js +9 -2
- package/dist/components/SelectedOutlineElement.js +9 -3
- package/dist/components/SelectedOutlineKeyboardControls.d.ts +2 -4
- package/dist/components/SelectedOutlineKeyboardControls.js +4 -22
- package/dist/components/SelectedOutlineOverlay.js +152 -106
- package/dist/components/SelectedOutlinePathPoints.d.ts +8 -0
- package/dist/components/SelectedOutlinePathPoints.js +433 -0
- package/dist/components/SelectedOutlinePolygon.js +21 -46
- package/dist/components/SelectedOutlineRenderer.d.ts +3 -5
- package/dist/components/SelectedOutlineRenderer.js +32 -136
- package/dist/components/SelectedOutlineSnapIndicators.d.ts +6 -0
- package/dist/components/SelectedOutlineSnapIndicators.js +16 -12
- package/dist/components/SelectedOutlineTransformOriginHandle.js +3 -2
- package/dist/components/SelectedOutlineUvControls.js +12 -7
- package/dist/components/SequencePropsSubscriptionProvider.d.ts +3 -0
- package/dist/components/SequencePropsSubscriptionProvider.js +8 -6
- package/dist/components/SettingsModal.js +30 -3
- package/dist/components/SettingsModalFooter.d.ts +1 -0
- package/dist/components/SettingsModalFooter.js +7 -3
- package/dist/components/ShowOutlinesProvider.js +1 -1
- package/dist/components/SkillsSettings.d.ts +0 -1
- package/dist/components/SkillsSettings.js +13 -14
- package/dist/components/Splitter/SplitterElement.js +1 -2
- package/dist/components/TimeValue.js +1 -1
- package/dist/components/Timeline/LoopedTimelineIndicators.d.ts +1 -0
- package/dist/components/Timeline/LoopedTimelineIndicators.js +7 -6
- package/dist/components/Timeline/TimelineArrayField.js +1 -1
- package/dist/components/Timeline/TimelineClipboardKeybindings.js +0 -1
- package/dist/components/Timeline/TimelineColorField.js +1 -1
- package/dist/components/Timeline/TimelineDeleteKeybindings.js +6 -9
- package/dist/components/Timeline/TimelineDragHandler.js +1 -1
- package/dist/components/Timeline/TimelineEffectItem.js +1 -0
- package/dist/components/Timeline/TimelineEffectPropItem.d.ts +1 -0
- package/dist/components/Timeline/TimelineEffectPropItem.js +12 -5
- package/dist/components/Timeline/TimelineExpandArrowButton.js +1 -0
- package/dist/components/Timeline/TimelineExpandedRow.d.ts +1 -0
- package/dist/components/Timeline/TimelineExpandedRow.js +6 -4
- package/dist/components/Timeline/TimelineExpandedSection.d.ts +1 -0
- package/dist/components/Timeline/TimelineExpandedSection.js +2 -2
- package/dist/components/Timeline/TimelineExpandedTrackKeyframes.d.ts +1 -0
- package/dist/components/Timeline/TimelineExpandedTrackKeyframes.js +3 -1
- package/dist/components/Timeline/TimelineFieldLabel.js +1 -0
- package/dist/components/Timeline/TimelineFontFamilyField.js +12 -12
- package/dist/components/Timeline/TimelineKeyframeControls.d.ts +1 -0
- package/dist/components/Timeline/TimelineKeyframeControls.js +40 -28
- package/dist/components/Timeline/TimelineLayerChildren.js +1 -1
- package/dist/components/Timeline/TimelineList.js +1 -1
- package/dist/components/Timeline/TimelineNumberField.js +2 -4
- package/dist/components/Timeline/TimelinePrimitiveFieldValue.js +1 -1
- package/dist/components/Timeline/TimelineSelection.d.ts +9 -9
- package/dist/components/Timeline/TimelineSelection.js +16 -9
- package/dist/components/Timeline/TimelineSequence.d.ts +3 -1
- package/dist/components/Timeline/TimelineSequence.js +65 -21
- package/dist/components/Timeline/TimelineSequenceFrame.js +1 -0
- package/dist/components/Timeline/TimelineSequenceItem.d.ts +1 -0
- package/dist/components/Timeline/TimelineSequenceItem.js +46 -8
- package/dist/components/Timeline/TimelineSequencePropItem.d.ts +3 -0
- package/dist/components/Timeline/TimelineSequencePropItem.js +262 -25
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +11 -13
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +98 -77
- package/dist/components/Timeline/TimelineTextContentField.js +27 -4
- package/dist/components/Timeline/TimelineTimeIndicators.js +10 -5
- package/dist/components/Timeline/TimelineTrack.js +1 -1
- package/dist/components/Timeline/TimelineTrimTooltip.d.ts +11 -0
- package/dist/components/Timeline/TimelineTrimTooltip.js +41 -0
- package/dist/components/Timeline/TimelineVideoInfo.d.ts +1 -0
- package/dist/components/Timeline/TimelineVideoInfo.js +13 -10
- package/dist/components/Timeline/TimelineViewport.d.ts +1 -0
- package/dist/components/Timeline/TimelineViewport.js +10 -1
- package/dist/components/Timeline/delete-selected-keyframe.js +22 -8
- package/dist/components/Timeline/delete-selected-timeline-item.d.ts +1 -5
- package/dist/components/Timeline/delete-selected-timeline-item.js +9 -95
- package/dist/components/Timeline/get-animation-item-selection-for-frame.d.ts +2 -1
- package/dist/components/Timeline/get-animation-item-selection-for-frame.js +7 -5
- package/dist/components/Timeline/get-keyframed-sequence-drag-targets.d.ts +23 -0
- package/dist/components/Timeline/get-keyframed-sequence-drag-targets.js +57 -0
- package/dist/components/Timeline/get-node-keyframes.d.ts +2 -1
- package/dist/components/Timeline/get-node-keyframes.js +6 -4
- package/dist/components/Timeline/get-playback-rate-keyframe-changes.d.ts +21 -0
- package/dist/components/Timeline/get-playback-rate-keyframe-changes.js +142 -0
- package/dist/components/Timeline/get-sequence-context-menu-items.d.ts +3 -1
- package/dist/components/Timeline/get-sequence-context-menu-items.js +13 -1
- package/dist/components/Timeline/get-timeline-keyframes.d.ts +15 -2
- package/dist/components/Timeline/get-timeline-keyframes.js +44 -6
- package/dist/components/Timeline/keyframe-clipboard.js +17 -3
- package/dist/components/Timeline/split-selected-timeline-item.d.ts +13 -10
- package/dist/components/Timeline/split-selected-timeline-item.js +61 -35
- package/dist/components/Timeline/timeline-field-display-utils.js +1 -0
- package/dist/components/Timeline/timeline-field-row-layout.js +1 -0
- package/dist/components/Timeline/use-delete-timeline-items.js +17 -11
- package/dist/components/Timeline/use-expanded-track-keyframe-rows.d.ts +2 -1
- package/dist/components/Timeline/use-expanded-track-keyframe-rows.js +3 -1
- package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.js +7 -3
- package/dist/components/Timeline/use-timeline-keyframe-drag.js +28 -19
- package/dist/components/TimelineCombobox.js +1 -0
- package/dist/components/Transcription/Models.js +1 -1
- package/dist/components/Transcription/TranscriptionModal.js +18 -11
- package/dist/components/Transcription/TranscriptionModalWithOptionalWhisper.js +1 -1
- package/dist/components/Transcription/resample-media-to-16-khz.d.ts +2 -1
- package/dist/components/Transcription/resample-media-to-16-khz.js +20 -2
- package/dist/components/UpdatesSettings.js +2 -0
- package/dist/components/VideoMatting/Models.js +1 -1
- package/dist/components/VideoMatting/VideoMattingModal.js +30 -47
- package/dist/components/VideoMatting/VideoMattingModalWithOptionalPackage.js +1 -1
- package/dist/components/WebMcp.js +23 -40
- package/dist/components/composition-drop-preview.d.ts +9 -2
- package/dist/components/composition-drop-preview.js +8 -4
- package/dist/components/composition-menu-items.js +4 -4
- package/dist/components/delete-jsx-nodes-api.d.ts +2 -0
- package/dist/components/{delete-jsx-node-api.js → delete-jsx-nodes-api.js} +5 -5
- package/dist/components/effect-drag-and-drop.d.ts +13 -5
- package/dist/components/effect-drag-and-drop.js +19 -4
- package/dist/components/get-open-in-menu-items.d.ts +2 -1
- package/dist/components/get-open-in-menu-items.js +24 -8
- package/dist/components/keyboard-shortcuts.d.ts +4 -4
- package/dist/components/keyboard-shortcuts.js +3 -1
- package/dist/components/public-output-name.d.ts +1 -0
- package/dist/components/public-output-name.js +7 -3
- package/dist/components/selected-outline-drag.d.ts +1 -6
- package/dist/components/selected-outline-drag.js +22 -6
- package/dist/components/selected-outline-geometry.d.ts +2 -18
- package/dist/components/selected-outline-measurement.d.ts +23 -41
- package/dist/components/selected-outline-measurement.js +14 -252
- package/dist/components/selected-outline-order.d.ts +4 -11
- package/dist/components/selected-outline-order.js +2 -254
- package/dist/components/selected-outline-snap.d.ts +1 -1
- package/dist/components/selected-outline-snap.js +2 -1
- package/dist/components/selected-outline-types.d.ts +18 -28
- package/dist/components/selected-outline-uv.d.ts +4 -4
- package/dist/components/selected-outline-uv.js +6 -111
- package/dist/components/sequence-props-api.js +0 -10
- package/dist/components/use-selected-outline-control-target.js +12 -21
- package/dist/components/wrap-jsx-node-api.d.ts +2 -0
- package/dist/components/wrap-jsx-node-api.js +13 -0
- package/dist/error-overlay/remotion-overlay/OpenInEditor.js +45 -2
- package/dist/error-overlay/remotion-overlay/StackFrame.js +32 -3
- package/dist/esm/{CaptionQueueProcessor-k0yrm3dj.mjs → CaptionQueueProcessor-nr7hjcga.mjs} +96 -19
- package/dist/esm/LazyModels-ajkn7fs3.mjs +12 -0
- package/dist/esm/LazyModels-g1g7cf4e.mjs +12 -0
- package/dist/esm/{TranscriptionModal-ymnx1c7m.mjs → TranscriptionModal-e18bzbkb.mjs} +30 -22
- package/dist/esm/{VideoMattingModal-05vpczks.mjs → VideoMattingModal-5bz2s4rs.mjs} +47 -62
- package/dist/esm/{VideoMattingQueueProcessor-t1hgm2rm.mjs → VideoMattingQueueProcessor-4tkj0f4k.mjs} +69 -26
- package/dist/esm/{index-v4tr1bft.mjs → index-09txs1bj.mjs} +5 -0
- package/dist/esm/{index-4dsz9035.mjs → index-5ycb9e9q.mjs} +2 -4
- package/dist/esm/index-890dd9b3.mjs +768 -0
- package/dist/esm/{index-5bfxbpca.mjs → index-8nt6a0mw.mjs} +3 -3
- package/dist/esm/{index-5gd8k9yv.mjs → index-9q9w8v9p.mjs} +3 -3
- package/dist/esm/{index-x40wwfmt.mjs → index-c2wabcdt.mjs} +8 -6
- package/dist/esm/index-dfy1t576.mjs +129 -0
- package/dist/esm/index-dh3zk2hv.mjs +220 -0
- package/dist/esm/{index-0gewwxse.mjs → index-dpyss74p.mjs} +6179 -5011
- package/dist/esm/{index-9x6e1dq0.mjs → index-hqxc6tzp.mjs} +40 -6
- package/dist/esm/{index-cdy8v54v.mjs → index-qve7mdfp.mjs} +36 -539
- package/dist/esm/{index-eb5txqp6.mjs → index-s6qya2gg.mjs} +8 -88
- package/dist/esm/index-t7tbt980.mjs +103 -0
- package/dist/esm/{index-g7k2dvar.mjs → index-t7xnxdf8.mjs} +44 -26
- package/dist/esm/index-wqc43mw0.mjs +158 -0
- package/dist/esm/{index-bs39wngg.mjs → index-x6r9bn12.mjs} +5623 -6218
- package/dist/esm/{index-f97r9e2g.mjs → index-xac20sv4.mjs} +46 -57
- package/dist/esm/index.mjs +4 -4
- package/dist/esm/internals.mjs +13 -10
- package/dist/esm/previewEntry.mjs +18 -12
- package/dist/esm/renderEntry.mjs +5 -1
- package/dist/esm/{resolve-composition-component-location-bt2d6qxq.mjs → resolve-composition-component-location-2hgf6g0a.mjs} +1 -1
- package/dist/helpers/calculate-timeline.d.ts +5 -1
- package/dist/helpers/calculate-timeline.js +1 -1
- package/dist/helpers/checkerboard-background.d.ts +2 -2
- package/dist/helpers/colors.d.ts +132 -112
- package/dist/helpers/colors.js +117 -95
- package/dist/helpers/copy-text.js +1 -16
- package/dist/helpers/create-folder-tree.js +2 -1
- package/dist/helpers/editor-guide-selection.d.ts +1 -1
- package/dist/helpers/editor-ruler.js +23 -12
- package/dist/helpers/get-connected-compositions.d.ts +6 -1
- package/dist/helpers/get-connected-compositions.js +1 -1
- package/dist/helpers/get-sequence-double-click-action.js +1 -1
- package/dist/helpers/get-sequence-visible-range.d.ts +1 -1
- package/dist/helpers/get-sequence-visible-range.js +2 -5
- package/dist/helpers/get-timeline-nestedness.d.ts +1 -1
- package/dist/helpers/get-timeline-nestedness.js +1 -1
- package/dist/helpers/get-timeline-sequence-sort-key.d.ts +1 -1
- package/dist/helpers/get-timeline-sequence-sort-key.js +1 -1
- package/dist/helpers/hoverable.js +6 -5
- package/dist/helpers/inject-css.js +5 -7
- package/dist/helpers/open-in-editor.js +1 -1
- package/dist/helpers/prism-vsc-dark-plus.d.ts +1 -1
- package/dist/helpers/prism-vsc-dark-plus.js +52 -51
- package/dist/helpers/resolve-studio-color.d.ts +1 -0
- package/dist/helpers/resolve-studio-color.js +11 -0
- package/dist/helpers/studio-css-variables.d.ts +1 -0
- package/dist/helpers/studio-css-variables.js +105 -0
- package/dist/helpers/studio-pixel-ratio.d.ts +1 -0
- package/dist/helpers/studio-pixel-ratio.js +7 -0
- package/dist/helpers/studio-runtime-config.d.ts +1 -1
- package/dist/helpers/timeline-node-path-key.d.ts +1 -1
- package/dist/helpers/timeline-node-path-key.js +2 -2
- package/dist/helpers/use-keybinding.d.ts +1 -1
- package/dist/helpers/use-keyboard-shortcut-label.d.ts +2 -2
- package/dist/helpers/use-menu-structure.js +15 -9
- package/dist/helpers/use-runtime-values.js +2 -28
- package/dist/hot-middleware-client/client.js +5 -3
- package/dist/icons/align-center-horizontal.js +2 -1
- package/dist/icons/align-left.js +2 -1
- package/dist/icons/align-right.js +2 -1
- package/dist/icons/{separation.d.ts → background-removal.d.ts} +1 -1
- package/dist/icons/background-removal.js +9 -0
- package/dist/icons/wrap.d.ts +4 -0
- package/dist/icons/wrap.js +10 -0
- package/dist/previewEntry.js +2 -0
- package/dist/renderEntry.js +2 -0
- package/dist/state/modals.d.ts +20 -1
- package/dist/state/timeline-sequence-hover.d.ts +6 -16
- package/dist/state/timeline-sequence-hover.js +6 -67
- package/dist/state/timeline-zoom.js +4 -0
- package/package.json +20 -19
- package/dist/components/Timeline/get-easing-selection-after-keyframe-delete.d.ts +0 -15
- package/dist/components/Timeline/get-easing-selection-after-keyframe-delete.js +0 -31
- package/dist/components/delete-jsx-node-api.d.ts +0 -2
- package/dist/esm/LazyModels-mtggyjye.mjs +0 -11
- package/dist/esm/LazyModels-nk7py0zt.mjs +0 -11
- package/dist/esm/index-cw0pnpg5.mjs +0 -50
- package/dist/esm/index-k426ye99.mjs +0 -139
- package/dist/helpers/get-box-quads-polyfill-internals.d.ts +0 -82
- package/dist/helpers/get-box-quads-polyfill-internals.js +0 -2403
- package/dist/helpers/get-box-quads-ponyfill.d.ts +0 -10
- package/dist/helpers/get-box-quads-ponyfill.js +0 -23
- 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
|
|
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:
|
|
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 === '
|
|
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) =>
|
|
35
|
-
|
|
36
|
-
|
|
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
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
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 (
|
|
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
|
-
}, [
|
|
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,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,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 (
|
|
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,
|
|
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":
|
|
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 (
|
|
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,
|
|
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": "
|
|
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
|
|
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
|
-
:
|
|
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(
|
|
91
|
-
}, [done,
|
|
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-
|
|
104
|
+
id: 'reveal-output',
|
|
97
105
|
keyHint: null,
|
|
98
|
-
label: 'Reveal
|
|
106
|
+
label: 'Reveal output',
|
|
99
107
|
leftItem: null,
|
|
100
|
-
onClick: () => revealAsset(
|
|
108
|
+
onClick: () => revealAsset(outputName),
|
|
101
109
|
quickSwitcherLabel: null,
|
|
102
110
|
subMenu: null,
|
|
103
111
|
type: 'item',
|
|
104
|
-
value: 'reveal-
|
|
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
|
-
}, [
|
|
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
|
|
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;
|