@remotion/studio 4.0.522 → 4.0.523
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/api/install-package.js +4 -2
- package/dist/components/AssetAudioVolume.d.ts +5 -0
- package/dist/components/AssetAudioVolume.js +33 -0
- package/dist/components/Canvas.js +5 -6
- package/dist/components/CaptionInspector.js +74 -20
- package/dist/components/CheckboardToggle.js +8 -6
- package/dist/components/Checkbox.d.ts +1 -0
- package/dist/components/Checkbox.js +2 -2
- package/dist/components/CompositionContextButton.js +4 -1
- package/dist/components/CompositionSelectorItem.js +2 -2
- package/dist/components/ConfigureLicenseModal.js +1 -1
- package/dist/components/CurrentAsset.js +40 -6
- package/dist/components/EditorContexts.js +3 -1
- package/dist/components/ElementInstallConfirmation.js +287 -135
- package/dist/components/FixComputedValueModal.js +38 -8
- package/dist/components/FullscreenToggle.js +9 -8
- package/dist/components/GlobalKeybindings.js +50 -49
- package/dist/components/HighlightedElementSource.d.ts +5 -0
- package/dist/components/HighlightedElementSource.js +78 -0
- package/dist/components/InspectorPanel/MultiSequenceField.d.ts +12 -0
- package/dist/components/InspectorPanel/MultiSequenceField.js +131 -0
- package/dist/components/InspectorPanel/MultiSequenceInspector.d.ts +8 -0
- package/dist/components/InspectorPanel/MultiSequenceInspector.js +102 -0
- package/dist/components/InspectorPanel/MultiSequenceNumberField.d.ts +9 -0
- package/dist/components/InspectorPanel/MultiSequenceNumberField.js +88 -0
- package/dist/components/InspectorPanel.js +4 -0
- package/dist/components/InspectorSequenceSection.js +64 -1
- package/dist/components/InstallPackage.js +4 -5
- package/dist/components/KeyboardShortcutsSettings.js +212 -33
- package/dist/components/MenuToolbar.js +7 -5
- package/dist/components/ModalContainer.d.ts +1 -0
- package/dist/components/ModalContainer.js +2 -2
- package/dist/components/Modals.js +3 -1
- package/dist/components/ModelManager.d.ts +16 -0
- package/dist/components/ModelManager.js +200 -0
- package/dist/components/ModelsSettings.d.ts +2 -0
- package/dist/components/ModelsSettings.js +133 -0
- package/dist/components/NewComposition/DismissableModal.d.ts +1 -0
- package/dist/components/NewComposition/DismissableModal.js +2 -2
- package/dist/components/NewComposition/InputDragger.d.ts +2 -2
- package/dist/components/NewComposition/InputDragger.js +6 -6
- package/dist/components/NewComposition/NewFolder.js +11 -8
- package/dist/components/NewComposition/RenameFolder.js +17 -10
- package/dist/components/OptionalPackageModal.d.ts +11 -0
- package/dist/components/OptionalPackageModal.js +155 -0
- package/dist/components/PlayPause.js +4 -8
- package/dist/components/PlaybackKeyboardShortcutsManager.js +3 -6
- package/dist/components/PreviewToolbarOverflowButton.js +11 -2
- package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +5 -2
- package/dist/components/RadioButton.d.ts +1 -0
- package/dist/components/RadioButton.js +2 -2
- package/dist/components/RenderButton.js +5 -1
- package/dist/components/RenderModal/NumberSetting.d.ts +6 -1
- package/dist/components/RenderModal/NumberSetting.js +2 -2
- package/dist/components/RenderModal/RenderModalBasic.js +1 -1
- package/dist/components/RenderModal/RenderModalOutputName.d.ts +3 -1
- package/dist/components/RenderModal/RenderModalOutputName.js +4 -4
- package/dist/components/RenderModal/SeparateAudioOption.js +1 -1
- package/dist/components/RenderModal/WebRenderModalBasic.js +1 -1
- package/dist/components/RenderQueue/CaptionQueueItem.d.ts +6 -0
- package/dist/components/RenderQueue/CaptionQueueItem.js +129 -0
- package/dist/components/RenderQueue/CaptionQueueProcessor.d.ts +1 -0
- package/dist/components/RenderQueue/CaptionQueueProcessor.js +110 -0
- package/dist/components/RenderQueue/CaptionQueueProcessorLoader.d.ts +2 -0
- package/dist/components/RenderQueue/CaptionQueueProcessorLoader.js +54 -0
- package/dist/components/RenderQueue/RenderQueueItem.js +3 -3
- package/dist/components/RenderQueue/VideoMattingQueueItem.d.ts +6 -0
- package/dist/components/RenderQueue/VideoMattingQueueItem.js +129 -0
- package/dist/components/RenderQueue/VideoMattingQueueProcessor.d.ts +1 -0
- package/dist/components/RenderQueue/VideoMattingQueueProcessor.js +105 -0
- package/dist/components/RenderQueue/VideoMattingQueueProcessorLoader.d.ts +2 -0
- package/dist/components/RenderQueue/VideoMattingQueueProcessorLoader.js +54 -0
- package/dist/components/RenderQueue/caption-job-types.d.ts +47 -0
- package/dist/components/RenderQueue/caption-job-types.js +7 -0
- package/dist/components/RenderQueue/context.d.ts +16 -0
- package/dist/components/RenderQueue/context.js +224 -11
- package/dist/components/RenderQueue/index.js +34 -10
- package/dist/components/RenderQueue/item-style.d.ts +1 -0
- package/dist/components/RenderQueue/item-style.js +2 -1
- package/dist/components/RenderQueue/load-model-for-job.d.ts +11 -0
- package/dist/components/RenderQueue/load-model-for-job.js +14 -0
- package/dist/components/RenderQueue/video-matting-job-types.d.ts +38 -0
- package/dist/components/RenderQueue/video-matting-job-types.js +5 -0
- package/dist/components/RendersTab.js +4 -4
- package/dist/components/SegmentedControl.d.ts +2 -2
- package/dist/components/SegmentedControl.js +38 -13
- package/dist/components/SelectedOutlinePolygon.js +8 -2
- package/dist/components/SettingsButton.d.ts +4 -0
- package/dist/components/SettingsButton.js +49 -0
- package/dist/components/SettingsModal.d.ts +1 -1
- package/dist/components/SettingsModal.js +3 -1
- package/dist/components/ShowOutlinesProvider.js +12 -0
- package/dist/components/SidebarCollapserControls.js +10 -11
- package/dist/components/SizeSelector.js +10 -2
- package/dist/components/SkillsSettings.js +2 -3
- package/dist/components/SnappingToggle.js +5 -2
- package/dist/components/Tabs/vertical.d.ts +1 -0
- package/dist/components/Tabs/vertical.js +2 -2
- package/dist/components/TimeValue.js +2 -3
- package/dist/components/Timeline/SequencePropsObserver.js +4 -0
- package/dist/components/Timeline/Timeline.js +2 -42
- package/dist/components/Timeline/TimelineClipboardKeybindings.js +2 -4
- package/dist/components/Timeline/TimelineDeleteKeybindings.js +3 -18
- package/dist/components/Timeline/TimelineDragHandler.js +2 -2
- package/dist/components/Timeline/TimelineExpandedKeyframeRow.js +1 -0
- package/dist/components/Timeline/TimelineRowChrome.js +11 -3
- package/dist/components/Timeline/TimelineSchemaField.js +8 -4
- package/dist/components/Timeline/TimelineSelection.d.ts +2 -0
- package/dist/components/Timeline/TimelineSelection.js +55 -2
- package/dist/components/Timeline/TimelineSequence.js +75 -17
- package/dist/components/Timeline/TimelineSequenceItem.d.ts +0 -1
- package/dist/components/Timeline/TimelineSequenceItem.js +208 -111
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +23 -3
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +73 -25
- package/dist/components/Timeline/TimelineTimeIndicators.js +1 -0
- package/dist/components/Timeline/use-asset-timeline-context-menu.d.ts +2 -0
- package/dist/components/Timeline/use-asset-timeline-context-menu.js +52 -0
- package/dist/components/TimelineInOutToggle.js +20 -17
- package/dist/components/Transcription/LazyModels.d.ts +1 -0
- package/dist/components/Transcription/LazyModels.js +5 -0
- package/dist/components/Transcription/Models.d.ts +6 -0
- package/dist/components/Transcription/Models.js +18 -0
- package/dist/components/Transcription/TranscriptionModal.d.ts +3 -0
- package/dist/components/Transcription/TranscriptionModal.js +428 -0
- package/dist/components/Transcription/TranscriptionModalWithOptionalWhisper.d.ts +5 -0
- package/dist/components/Transcription/TranscriptionModalWithOptionalWhisper.js +48 -0
- package/dist/components/Transcription/caption-output-name.d.ts +2 -0
- package/dist/components/Transcription/caption-output-name.js +10 -0
- package/dist/components/Transcription/resample-media-to-16-khz.d.ts +6 -0
- package/dist/components/Transcription/resample-media-to-16-khz.js +82 -0
- package/dist/components/Transcription/whisper-languages.d.ts +2 -0
- package/dist/components/Transcription/whisper-languages.js +104 -0
- package/dist/components/Transcription/whisper-webgpu-capability.d.ts +2 -0
- package/dist/components/Transcription/whisper-webgpu-capability.js +7 -0
- package/dist/components/UndoRedoButtons.js +13 -38
- package/dist/components/UpdatesSettings.js +8 -12
- package/dist/components/VideoMatting/LazyModels.d.ts +1 -0
- package/dist/components/VideoMatting/LazyModels.js +5 -0
- package/dist/components/VideoMatting/Models.d.ts +6 -0
- package/dist/components/VideoMatting/Models.js +18 -0
- package/dist/components/VideoMatting/VideoMattingModal.d.ts +3 -0
- package/dist/components/VideoMatting/VideoMattingModal.js +207 -0
- package/dist/components/VideoMatting/VideoMattingModalWithOptionalPackage.d.ts +5 -0
- package/dist/components/VideoMatting/VideoMattingModalWithOptionalPackage.js +46 -0
- package/dist/components/VideoMatting/video-matting-capability.d.ts +2 -0
- package/dist/components/VideoMatting/video-matting-capability.js +7 -0
- package/dist/components/WebMcp.js +439 -22
- package/dist/components/import-assets.d.ts +3 -2
- package/dist/components/import-assets.js +5 -9
- package/dist/components/keyboard-shortcuts.d.ts +17 -1
- package/dist/components/keyboard-shortcuts.js +177 -89
- package/dist/components/public-output-name.d.ts +5 -0
- package/dist/components/public-output-name.js +60 -0
- package/dist/components/use-model-cache-status.d.ts +7 -0
- package/dist/components/use-model-cache-status.js +35 -0
- package/dist/esm/CaptionQueueProcessor-k0yrm3dj.mjs +211 -0
- package/dist/esm/HighlightedElementSource-jfc66k4p.mjs +1236 -0
- package/dist/esm/LazyModels-2trdm224.mjs +11 -0
- package/dist/esm/LazyModels-fjb5ckaq.mjs +11 -0
- package/dist/esm/TranscriptionModal-916jqhry.mjs +1011 -0
- package/dist/esm/VideoMattingModal-2tm79s9b.mjs +374 -0
- package/dist/esm/VideoMattingQueueProcessor-t1hgm2rm.mjs +109 -0
- package/dist/esm/index-1x7bsdh6.mjs +261 -0
- package/dist/esm/index-3hgr6gjx.mjs +41 -0
- package/dist/esm/index-5qddp5h7.mjs +36 -0
- package/dist/esm/index-5zrb1ft4.mjs +39 -0
- package/dist/esm/index-6cvm9a65.mjs +45923 -0
- package/dist/esm/index-7tt71e8n.mjs +36 -0
- package/dist/esm/index-9x6e1dq0.mjs +428 -0
- package/dist/esm/index-cw0pnpg5.mjs +50 -0
- package/dist/esm/index-czwvnn9g.mjs +35 -0
- package/dist/esm/index-hy4xcgty.mjs +1366 -0
- package/dist/esm/{chunk-je0h1bgt.js → index-jg13hf2g.mjs} +3 -1
- package/dist/esm/{chunk-6jf1natv.js → index-rcv7qkt5.mjs} +18 -1
- package/dist/esm/index-sgtmgc4h.mjs +423 -0
- package/dist/esm/index-te66vvrp.mjs +142 -0
- package/dist/esm/index-v4tr1bft.mjs +20 -0
- package/dist/esm/index-x7t2y7ws.mjs +54194 -0
- package/dist/esm/index-xhe2m2qr.mjs +1146 -0
- package/dist/esm/index.mjs +45 -933
- package/dist/esm/internals.mjs +13 -114393
- package/dist/esm/previewEntry.mjs +387 -115050
- package/dist/esm/renderEntry.mjs +3 -3
- package/dist/esm/{chunk-m0jqdbkr.js → resolve-composition-component-location-14148845.mjs} +1 -1
- package/dist/helpers/drag-aware-double-click.d.ts +2 -1
- package/dist/helpers/drag-aware-double-click.js +12 -1
- package/dist/helpers/get-asset-metadata.d.ts +1 -0
- package/dist/helpers/get-asset-metadata.js +4 -0
- package/dist/helpers/hoverable.js +8 -0
- package/dist/helpers/inject-css.js +2 -0
- package/dist/helpers/optional-package-dependencies.d.ts +3 -0
- package/dist/helpers/optional-package-dependencies.js +24 -0
- package/dist/helpers/pointer-session.d.ts +6 -0
- package/dist/helpers/pointer-session.js +36 -14
- package/dist/helpers/prism-tomorrow.d.ts +1 -0
- package/dist/helpers/prism-tomorrow.js +151 -0
- package/dist/helpers/sequence-node-path-mutations.js +11 -0
- package/dist/helpers/slugify-name.d.ts +1 -0
- package/dist/helpers/slugify-name.js +14 -0
- package/dist/helpers/studio-runtime-config.d.ts +1 -0
- package/dist/helpers/studio-runtime-config.js +6 -1
- package/dist/helpers/use-keybinding.d.ts +9 -3
- package/dist/helpers/use-keybinding.js +8 -9
- package/dist/helpers/use-keyboard-shortcut-label.d.ts +2 -0
- package/dist/helpers/use-keyboard-shortcut-label.js +15 -0
- package/dist/helpers/use-menu-structure.js +58 -13
- package/dist/icons/input-props.d.ts +1 -1
- package/dist/icons/input-props.js +2 -2
- package/dist/icons/models.d.ts +4 -0
- package/dist/icons/models.js +7 -0
- package/dist/icons/separation.d.ts +4 -0
- package/dist/icons/separation.js +7 -0
- package/dist/icons/transcription.d.ts +4 -0
- package/dist/icons/transcription.js +7 -0
- package/dist/icons/upload.js +1 -1
- package/dist/state/modals.d.ts +14 -2
- package/package.json +34 -20
- package/dist/components/UpdateCheck.d.ts +0 -1
- package/dist/components/UpdateCheck.js +0 -79
- package/dist/esm/chunk-3netyjd9.js +0 -99793
|
@@ -54,8 +54,8 @@ const label = {
|
|
|
54
54
|
fontSize: 14,
|
|
55
55
|
lineHeight: '20px',
|
|
56
56
|
};
|
|
57
|
-
const RadioButton = ({ checked, children, onClick }) => {
|
|
58
|
-
return (jsx_runtime_1.jsxs("button", { "aria-checked": checked, className: `${hoverable_1.HOVERABLE_CLASS_NAME} ${hoverable_1.FOCUS_VISIBLE_ONLY_CLASS_NAME}`, onClick: onClick, role: "radio", style: row, type: "button", children: [
|
|
57
|
+
const RadioButton = ({ checked, disabled, children, onClick }) => {
|
|
58
|
+
return (jsx_runtime_1.jsxs("button", { "aria-checked": checked, disabled: disabled, className: `${hoverable_1.HOVERABLE_CLASS_NAME} ${hoverable_1.FOCUS_VISIBLE_ONLY_CLASS_NAME}`, onClick: onClick, role: "radio", style: row, type: "button", children: [
|
|
59
59
|
jsx_runtime_1.jsx("span", { style: circle, children: checked ? jsx_runtime_1.jsx("span", { style: bullet }) : null }), jsx_runtime_1.jsx("span", { style: label, children: children })
|
|
60
60
|
] }));
|
|
61
61
|
};
|
|
@@ -42,6 +42,7 @@ const browser_studio_operations_1 = require("../helpers/browser-studio-operation
|
|
|
42
42
|
const client_id_1 = require("../helpers/client-id");
|
|
43
43
|
const colors_1 = require("../helpers/colors");
|
|
44
44
|
const use_keybinding_1 = require("../helpers/use-keybinding");
|
|
45
|
+
const use_keyboard_shortcut_label_1 = require("../helpers/use-keyboard-shortcut-label");
|
|
45
46
|
const caret_1 = require("../icons/caret");
|
|
46
47
|
const render_1 = require("../icons/render");
|
|
47
48
|
const in_out_1 = require("../state/in-out");
|
|
@@ -128,7 +129,10 @@ const RenderButtonInner = ({ readOnlyStudio, size: controlSize = 'default', narr
|
|
|
128
129
|
}
|
|
129
130
|
return preferredRenderType;
|
|
130
131
|
}, [connectionStatus, isBrowserStudio, preferredRenderType, readOnlyStudio]);
|
|
131
|
-
const
|
|
132
|
+
const renderShortcut = (0, use_keyboard_shortcut_label_1.useKeyboardShortcutLabel)('render');
|
|
133
|
+
const shortcut = (0, use_keybinding_1.areKeyboardShortcutsDisabled)() || renderShortcut === ''
|
|
134
|
+
? ''
|
|
135
|
+
: `(${renderShortcut})`;
|
|
132
136
|
const tooltip = renderType === 'render-command'
|
|
133
137
|
? 'Copy a CLI command to render this composition ' + shortcut
|
|
134
138
|
: 'Export the current composition ' + shortcut;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type { AvailableOptions } from '@remotion/renderer/client';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
type NumberSettingHint = AvailableOptions | {
|
|
4
|
+
readonly content: React.ReactNode;
|
|
5
|
+
readonly title: string;
|
|
6
|
+
};
|
|
3
7
|
export declare const NumberSetting: React.FC<{
|
|
4
8
|
readonly name: string;
|
|
5
9
|
readonly value: number;
|
|
@@ -8,5 +12,6 @@ export declare const NumberSetting: React.FC<{
|
|
|
8
12
|
readonly min: number;
|
|
9
13
|
readonly step: number;
|
|
10
14
|
readonly formatter?: (value: string | number) => string;
|
|
11
|
-
readonly hint?:
|
|
15
|
+
readonly hint?: NumberSettingHint;
|
|
12
16
|
}>;
|
|
17
|
+
export {};
|
|
@@ -6,6 +6,7 @@ const react_1 = require("react");
|
|
|
6
6
|
const layout_1 = require("../layout");
|
|
7
7
|
const InputDragger_1 = require("../NewComposition/InputDragger");
|
|
8
8
|
const RemInput_1 = require("../NewComposition/RemInput");
|
|
9
|
+
const InfoBubble_1 = require("./InfoBubble");
|
|
9
10
|
const layout_2 = require("./layout");
|
|
10
11
|
const OptionExplainerBubble_1 = require("./OptionExplainerBubble");
|
|
11
12
|
const NumberSetting = ({ name, value, step, hint, onValueChanged, max, min, formatter }) => {
|
|
@@ -23,8 +24,7 @@ const NumberSetting = ({ name, value, step, hint, onValueChanged, max, min, form
|
|
|
23
24
|
}, [onValueChanged]);
|
|
24
25
|
return (jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
25
26
|
jsx_runtime_1.jsxs("div", { style: layout_2.label, children: [name, hint ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
26
|
-
jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }), jsx_runtime_1.jsx(OptionExplainerBubble_1.OptionExplainerBubble, { id: hint })
|
|
27
|
-
] })) : null] }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsx(RemInput_1.RightAlignInput, { children: jsx_runtime_1.jsx(InputDragger_1.InputDragger, { value: value, name: name.toLowerCase(), onTextChange: onTextChanged, onValueChange: onValueChange, step: step, placeholder: [min, max]
|
|
27
|
+
jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }), typeof hint === 'string' ? (jsx_runtime_1.jsx(OptionExplainerBubble_1.OptionExplainerBubble, { id: hint })) : (jsx_runtime_1.jsx(InfoBubble_1.InfoBubble, { title: hint.title, children: hint.content }))] })) : null] }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsx(RemInput_1.RightAlignInput, { children: jsx_runtime_1.jsx(InputDragger_1.InputDragger, { value: value, name: name.toLowerCase(), "aria-label": `${name}: ${formatter ? formatter(value) : value}`, onTextChange: onTextChanged, onValueChange: onValueChange, step: step, placeholder: [min, max]
|
|
28
28
|
.map((f) => (f !== null && f !== undefined ? f : ''))
|
|
29
29
|
.join('-'), min: min, max: max, formatter: formatter, status: "ok", rightAlign: true }) }) })
|
|
30
30
|
] }));
|
|
@@ -101,7 +101,7 @@ const RenderModalBasic = ({ renderMode, imageFormatOptions, outName, codec, setV
|
|
|
101
101
|
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Frame" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsx(RemInput_1.RightAlignInput, { children: jsx_runtime_1.jsx(InputDragger_1.InputDragger, { value: frame, onTextChange: onFrameChanged, placeholder: `0-${resolvedComposition.durationInFrames - 1}`, onValueChange: onFrameSetDirectly, name: "frame", step: 1, min: 0, status: "ok", max: resolvedComposition.durationInFrames - 1, rightAlign: true }) }) })
|
|
102
102
|
] })) : null, renderMode === 'video' && codec === 'prores' ? (jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
103
103
|
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "ProRes profile" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsx(ComboBox_1.Combobox, { title: 'proResProfile', selectedId: proResProfile, values: proResProfileOptions }) })
|
|
104
|
-
] })) : null, renderMode === 'still' ? null : (jsx_runtime_1.jsx(FrameRangeSetting_1.FrameRangeSetting, { durationInFrames: resolvedComposition.durationInFrames, endFrame: endFrame, setEndFrame: setEndFrame, setStartFrame: setStartFrame, startFrame: startFrame })), showOutputName ? (jsx_runtime_1.jsx(RenderModalOutputName_1.RenderModalOutputName, { existence: existence, inputStyle: layout_2.input, outName: outName, onValueChange: onValueChange, validationMessage: validationMessage, label: renderMode === 'sequence' ? 'Folder name' : 'Output name' })) : null, jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
104
|
+
] })) : null, renderMode === 'still' ? null : (jsx_runtime_1.jsx(FrameRangeSetting_1.FrameRangeSetting, { durationInFrames: resolvedComposition.durationInFrames, endFrame: endFrame, setEndFrame: setEndFrame, setStartFrame: setStartFrame, startFrame: startFrame })), showOutputName ? (jsx_runtime_1.jsx(RenderModalOutputName_1.RenderModalOutputName, { ariaLabel: null, existingOutputPath: null, existence: existence, inputStyle: layout_2.input, outName: outName, onValueChange: onValueChange, validationMessage: validationMessage, label: renderMode === 'sequence' ? 'Folder name' : 'Output name' })) : null, jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
105
105
|
jsx_runtime_1.jsxs("div", { style: layout_2.label, children: ["Log Level ",
|
|
106
106
|
jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }), jsx_runtime_1.jsx(OptionExplainerBubble_1.OptionExplainerBubble, { id: "logLevelOption" })
|
|
107
107
|
] }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsx(ComboBox_1.Combobox, { values: logLevelOptions, selectedId: logLevel, title: "Log Level" }) })
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
type Props = {
|
|
3
|
+
readonly ariaLabel: string | null;
|
|
4
|
+
readonly existingOutputPath: string | null;
|
|
3
5
|
readonly existence: boolean;
|
|
4
6
|
readonly inputStyle: React.CSSProperties;
|
|
5
7
|
readonly outName: string;
|
|
@@ -7,5 +9,5 @@ type Props = {
|
|
|
7
9
|
readonly validationMessage: string | null;
|
|
8
10
|
readonly label: string;
|
|
9
11
|
};
|
|
10
|
-
export declare const RenderModalOutputName: ({ existence, inputStyle, outName, onValueChange, validationMessage, label: labelText, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare const RenderModalOutputName: ({ ariaLabel, existingOutputPath, existence, inputStyle, outName, onValueChange, validationMessage, label: labelText, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
11
13
|
export {};
|
|
@@ -38,12 +38,12 @@ const outputNameInputContainer = {
|
|
|
38
38
|
minWidth: 0,
|
|
39
39
|
maxWidth: 280,
|
|
40
40
|
};
|
|
41
|
-
const RenderModalOutputName = ({ existence, inputStyle, outName, onValueChange, validationMessage, label: labelText, }) => {
|
|
41
|
+
const RenderModalOutputName = ({ ariaLabel, existingOutputPath, existence, inputStyle, outName, onValueChange, validationMessage, label: labelText, }) => {
|
|
42
42
|
const openExistingOutput = (0, react_1.useCallback)(() => {
|
|
43
|
-
(0, actions_1.openInFileExplorer)({ directory: outName }).catch((err) => {
|
|
43
|
+
(0, actions_1.openInFileExplorer)({ directory: existingOutputPath !== null && existingOutputPath !== void 0 ? existingOutputPath : outName }).catch((err) => {
|
|
44
44
|
(0, NotificationCenter_1.showNotification)(`Could not open file: ${err.message}`, 2000);
|
|
45
45
|
});
|
|
46
|
-
}, [outName]);
|
|
46
|
+
}, [existingOutputPath, outName]);
|
|
47
47
|
const renderOpenIcon = (0, react_1.useCallback)((color) => {
|
|
48
48
|
return jsx_runtime_1.jsx(folder_1.ExpandedFolderIconSolid, { style: openIconStyle, color: color });
|
|
49
49
|
}, []);
|
|
@@ -51,7 +51,7 @@ const RenderModalOutputName = ({ existence, inputStyle, outName, onValueChange,
|
|
|
51
51
|
const isBrowserStudio = (0, browser_studio_operations_1.getBrowserStudioOperations)() !== null;
|
|
52
52
|
return (jsx_runtime_1.jsxs("div", { style: outputNameRow, children: [
|
|
53
53
|
jsx_runtime_1.jsx(layout_1.Column, { children: jsx_runtime_1.jsx("div", { style: layout_2.label, children: labelText }) }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsxs("div", { style: outputNameInputContainer, children: [
|
|
54
|
-
jsx_runtime_1.jsx(RemInput_1.RemotionInput, { status: validationMessage ? 'error' : existence ? 'warning' : 'ok', style: inputStyle, type: "text", value: outName, onChange: onValueChange, rightAlign: true }), validationMessage ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
54
|
+
jsx_runtime_1.jsx(RemInput_1.RemotionInput, { "aria-label": ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : undefined, status: validationMessage ? 'error' : existence ? 'warning' : 'ok', style: inputStyle, type: "text", value: outName, onChange: onValueChange, rightAlign: true }), validationMessage ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
55
55
|
jsx_runtime_1.jsx(layout_1.Spacing, { y: 1, block: true }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { align: "flex-end", message: validationMessage, type: 'error' })
|
|
56
56
|
] })) : existence ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
57
57
|
jsx_runtime_1.jsx(layout_1.Spacing, { y: 1, block: true }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { align: "flex-end", message: jsx_runtime_1.jsxs("span", { style: existsMessageStyle, children: [isBrowserStudio ? null : (jsx_runtime_1.jsx(InlineAction_1.InlineAction, { variant: null, onClick: openExistingOutput, renderAction: renderOpenIcon, title: `Open in ${fileManagerName}` })), "Exists, will be overwritten"] }), type: 'warning' })
|
|
@@ -24,7 +24,7 @@ const SeparateAudioOptionInput = ({ separateAudioTo, setSeparateAudioTo, audioCo
|
|
|
24
24
|
}
|
|
25
25
|
return null;
|
|
26
26
|
}, [audioCodec, separateAudioTo]);
|
|
27
|
-
return (jsx_runtime_1.jsx(RenderModalOutputName_1.RenderModalOutputName, { existence: existence, inputStyle: layout_2.input, onValueChange: onValueChange, outName: separateAudioTo, label: 'Separate audio to', validationMessage: validationMessage }));
|
|
27
|
+
return (jsx_runtime_1.jsx(RenderModalOutputName_1.RenderModalOutputName, { ariaLabel: null, existingOutputPath: null, existence: existence, inputStyle: layout_2.input, onValueChange: onValueChange, outName: separateAudioTo, label: 'Separate audio to', validationMessage: validationMessage }));
|
|
28
28
|
};
|
|
29
29
|
exports.SeparateAudioOptionInput = SeparateAudioOptionInput;
|
|
30
30
|
const SeparateAudioOption = ({ separateAudioTo, setSeparateAudioTo, audioCodec, outName }) => {
|
|
@@ -121,7 +121,7 @@ const WebRenderModalBasic = ({ renderMode, resolvedComposition, imageFormat, set
|
|
|
121
121
|
jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }), jsx_runtime_1.jsx(OptionExplainerBubble_1.WebRendererOptionExplainerBubble, { apiName: "codec", id: "videoCodecOption" })
|
|
122
122
|
] }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsx(ComboBox_1.Combobox, { values: codecOptions, selectedId: effectiveVideoCodec, title: "Codec" }) })
|
|
123
123
|
] })) : null, jsx_runtime_1.jsx(FrameRangeSetting_1.FrameRangeSetting, { durationInFrames: resolvedComposition.durationInFrames, startFrame: startFrame !== null && startFrame !== void 0 ? startFrame : 0, endFrame: endFrame !== null && endFrame !== void 0 ? endFrame : resolvedComposition.durationInFrames - 1, setStartFrame: setStartFrame, setEndFrame: setEndFrame })
|
|
124
|
-
] })), jsx_runtime_1.jsx(RenderModalOutputName_1.RenderModalOutputName, { existence: false, inputStyle: layout_2.input, outName: outName, onValueChange: onOutNameChange, validationMessage: validationMessage, label: window.remotion_isReadOnlyStudio ? 'Download name' : 'Output name' }), jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
124
|
+
] })), jsx_runtime_1.jsx(RenderModalOutputName_1.RenderModalOutputName, { ariaLabel: null, existingOutputPath: null, existence: false, inputStyle: layout_2.input, outName: outName, onValueChange: onOutNameChange, validationMessage: validationMessage, label: window.remotion_isReadOnlyStudio ? 'Download name' : 'Output name' }), jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
125
125
|
jsx_runtime_1.jsxs("div", { style: layout_2.label, children: ["Log Level ",
|
|
126
126
|
jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }), jsx_runtime_1.jsx(OptionExplainerBubble_1.WebRendererOptionExplainerBubble, { apiName: "logLevel", id: "logLevelOption" })
|
|
127
127
|
] }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsx(ComboBox_1.Combobox, { values: logLevelOptions, selectedId: logLevel, title: "Log Level" }) })
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CaptionQueueItem = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const colors_1 = require("../../helpers/colors");
|
|
7
|
+
const url_state_1 = require("../../helpers/url-state");
|
|
8
|
+
const InlineAction_1 = require("../InlineAction");
|
|
9
|
+
const layout_1 = require("../layout");
|
|
10
|
+
const use_select_asset_1 = require("../use-select-asset");
|
|
11
|
+
const CircularProgress_1 = require("./CircularProgress");
|
|
12
|
+
const context_1 = require("./context");
|
|
13
|
+
const item_style_1 = require("./item-style");
|
|
14
|
+
const SuccessIcon_1 = require("./SuccessIcon");
|
|
15
|
+
const container = {
|
|
16
|
+
padding: 12,
|
|
17
|
+
display: 'flex',
|
|
18
|
+
flexDirection: 'row',
|
|
19
|
+
paddingBottom: 10,
|
|
20
|
+
paddingRight: 4,
|
|
21
|
+
marginBottom: 1,
|
|
22
|
+
marginLeft: 4,
|
|
23
|
+
borderRadius: 4,
|
|
24
|
+
width: 'calc(100% - 4px)',
|
|
25
|
+
};
|
|
26
|
+
const title = {
|
|
27
|
+
fontSize: 13,
|
|
28
|
+
lineHeight: 1,
|
|
29
|
+
};
|
|
30
|
+
const right = {
|
|
31
|
+
flex: 1,
|
|
32
|
+
display: 'flex',
|
|
33
|
+
flexDirection: 'column',
|
|
34
|
+
overflow: 'hidden',
|
|
35
|
+
};
|
|
36
|
+
const subtitleContainer = {
|
|
37
|
+
maxWidth: '100%',
|
|
38
|
+
flex: 1,
|
|
39
|
+
display: 'flex',
|
|
40
|
+
overflow: 'hidden',
|
|
41
|
+
};
|
|
42
|
+
const subtitle = {
|
|
43
|
+
...item_style_1.renderQueueItemSubtitleStyle,
|
|
44
|
+
cursor: 'default',
|
|
45
|
+
};
|
|
46
|
+
const statusIcon = {
|
|
47
|
+
height: CircularProgress_1.RENDER_STATUS_INDICATOR_SIZE,
|
|
48
|
+
width: CircularProgress_1.RENDER_STATUS_INDICATOR_SIZE,
|
|
49
|
+
};
|
|
50
|
+
const removeIcon = {
|
|
51
|
+
height: 16,
|
|
52
|
+
color: colors_1.CURRENT_COLOR,
|
|
53
|
+
};
|
|
54
|
+
const CaptionJobStatus = ({ job }) => {
|
|
55
|
+
if (job.status === 'running') {
|
|
56
|
+
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) }) }));
|
|
57
|
+
}
|
|
58
|
+
if (job.status === 'done') {
|
|
59
|
+
return jsx_runtime_1.jsx(SuccessIcon_1.SuccessIcon, {});
|
|
60
|
+
}
|
|
61
|
+
if (job.status === 'failed') {
|
|
62
|
+
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" }) }));
|
|
63
|
+
}
|
|
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 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" }) }));
|
|
65
|
+
};
|
|
66
|
+
const CaptionQueueItem = ({ job, selected }) => {
|
|
67
|
+
const [hovered, setHovered] = (0, react_1.useState)(false);
|
|
68
|
+
const { removeCaptionJob } = (0, react_1.useContext)(context_1.RenderQueueContext);
|
|
69
|
+
const selectAsset = (0, use_select_asset_1.useSelectAsset)();
|
|
70
|
+
const isHoverable = job.status === 'done';
|
|
71
|
+
const containerStyle = (0, react_1.useMemo)(() => {
|
|
72
|
+
return {
|
|
73
|
+
...container,
|
|
74
|
+
backgroundColor: (0, colors_1.getBackgroundFromHoverState)({
|
|
75
|
+
hovered: isHoverable && hovered,
|
|
76
|
+
selected,
|
|
77
|
+
}),
|
|
78
|
+
userSelect: 'none',
|
|
79
|
+
WebkitUserSelect: 'none',
|
|
80
|
+
};
|
|
81
|
+
}, [hovered, isHoverable, selected]);
|
|
82
|
+
const onPointerEnter = (0, react_1.useCallback)(() => {
|
|
83
|
+
setHovered(true);
|
|
84
|
+
}, []);
|
|
85
|
+
const onPointerLeave = (0, react_1.useCallback)(() => {
|
|
86
|
+
setHovered(false);
|
|
87
|
+
}, []);
|
|
88
|
+
const scrollCurrentIntoView = (0, react_1.useCallback)(() => {
|
|
89
|
+
var _a;
|
|
90
|
+
(_a = document
|
|
91
|
+
.querySelector(`.${item_style_1.RENDER_QUEUE_ITEM_SELECTED_CLASSNAME}`)) === null || _a === void 0 ? void 0 : _a.scrollIntoView({ behavior: 'smooth' });
|
|
92
|
+
}, []);
|
|
93
|
+
const onClick = (0, react_1.useCallback)(() => {
|
|
94
|
+
if (job.status !== 'done') {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
selectAsset(job.outName);
|
|
98
|
+
(0, url_state_1.pushUrl)(`/assets/${job.outName}`);
|
|
99
|
+
}, [job, selectAsset]);
|
|
100
|
+
(0, react_1.useEffect)(() => {
|
|
101
|
+
if (selected) {
|
|
102
|
+
scrollCurrentIntoView();
|
|
103
|
+
}
|
|
104
|
+
}, [scrollCurrentIntoView, selected]);
|
|
105
|
+
const onRemove = (0, react_1.useCallback)((event) => {
|
|
106
|
+
event.stopPropagation();
|
|
107
|
+
removeCaptionJob(job.id);
|
|
108
|
+
}, [job.id, removeCaptionJob]);
|
|
109
|
+
const renderRemoveAction = (0, react_1.useCallback)((color) => {
|
|
110
|
+
return (jsx_runtime_1.jsx("svg", { style: removeIcon, viewBox: "0 0 320 512", children: jsx_runtime_1.jsx("path", { fill: color, d: "M310.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L160 210.7 54.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L114.7 256 9.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 301.3 265.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L205.3 256 310.6 150.6z" }) }));
|
|
111
|
+
}, []);
|
|
112
|
+
const message = (0, react_1.useMemo)(() => {
|
|
113
|
+
if (job.status === 'idle') {
|
|
114
|
+
return 'Queued for transcription';
|
|
115
|
+
}
|
|
116
|
+
if (job.status === 'running') {
|
|
117
|
+
return job.progress.message;
|
|
118
|
+
}
|
|
119
|
+
if (job.status === 'failed') {
|
|
120
|
+
return job.error.message;
|
|
121
|
+
}
|
|
122
|
+
return job.outName;
|
|
123
|
+
}, [job]);
|
|
124
|
+
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: [
|
|
125
|
+
jsx_runtime_1.jsx(CaptionJobStatus, { job: job }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), jsx_runtime_1.jsxs("div", { style: right, children: [
|
|
126
|
+
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 }) })
|
|
127
|
+
] }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), job.status === 'running' ? null : (jsx_runtime_1.jsx(InlineAction_1.InlineAction, { renderAction: renderRemoveAction, onClick: onRemove, title: "Remove", variant: null }))] }));
|
|
128
|
+
};
|
|
129
|
+
exports.CaptionQueueItem = CaptionQueueItem;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const CaptionQueueProcessor: React.FC;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CaptionQueueProcessor = void 0;
|
|
4
|
+
const whisper_webgpu_1 = require("@remotion/whisper-webgpu");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const write_static_file_1 = require("../../api/write-static-file");
|
|
7
|
+
const resample_media_to_16_khz_1 = require("../Transcription/resample-media-to-16-khz");
|
|
8
|
+
const context_1 = require("./context");
|
|
9
|
+
const load_model_for_job_1 = require("./load-model-for-job");
|
|
10
|
+
const CaptionQueueProcessor = () => {
|
|
11
|
+
const { updateCaptionJobProgress, markCaptionJobDone, markCaptionJobFailed, setProcessCaptionJobCallback, } = (0, react_1.useContext)(context_1.RenderQueueContext);
|
|
12
|
+
const processJob = (0, react_1.useCallback)(async (job) => {
|
|
13
|
+
let captionCount = null;
|
|
14
|
+
let processingError = null;
|
|
15
|
+
try {
|
|
16
|
+
updateCaptionJobProgress(job.id, {
|
|
17
|
+
message: 'Checking WebGPU support...',
|
|
18
|
+
value: 0,
|
|
19
|
+
});
|
|
20
|
+
const support = await (0, whisper_webgpu_1.canUseWhisperWebGpu)();
|
|
21
|
+
if (!support.supported) {
|
|
22
|
+
throw new Error(support.detailedReason);
|
|
23
|
+
}
|
|
24
|
+
updateCaptionJobProgress(job.id, {
|
|
25
|
+
message: `Checking ${job.model}...`,
|
|
26
|
+
value: 0.02,
|
|
27
|
+
});
|
|
28
|
+
await (0, whisper_webgpu_1.clearStaleModels)();
|
|
29
|
+
await (0, load_model_for_job_1.loadModelForJob)({
|
|
30
|
+
model: job.model,
|
|
31
|
+
progressStart: 0.03,
|
|
32
|
+
progressSpan: 0.27,
|
|
33
|
+
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
|
+
}),
|
|
38
|
+
updateProgress: (progress) => updateCaptionJobProgress(job.id, progress),
|
|
39
|
+
});
|
|
40
|
+
updateCaptionJobProgress(job.id, {
|
|
41
|
+
message: `Preparing ${job.displayName}...`,
|
|
42
|
+
value: 0.3,
|
|
43
|
+
});
|
|
44
|
+
const channelWaveform = await (0, resample_media_to_16_khz_1.resampleMediaTo16Khz)({
|
|
45
|
+
src: job.src,
|
|
46
|
+
audioStreamIndex: job.audioStreamIndex,
|
|
47
|
+
requestInit: job.requestInit,
|
|
48
|
+
onProgress: (progress) => {
|
|
49
|
+
updateCaptionJobProgress(job.id, {
|
|
50
|
+
message: `Preparing ${job.displayName}...`,
|
|
51
|
+
value: 0.3 + progress * 0.2,
|
|
52
|
+
});
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
updateCaptionJobProgress(job.id, {
|
|
56
|
+
message: `Transcribing ${job.displayName}...`,
|
|
57
|
+
value: 0.5,
|
|
58
|
+
});
|
|
59
|
+
const transcription = await (0, whisper_webgpu_1.transcribe)({
|
|
60
|
+
channelWaveform,
|
|
61
|
+
model: job.model,
|
|
62
|
+
task: job.task,
|
|
63
|
+
chunkLengthInSeconds: job.chunkLengthInSeconds,
|
|
64
|
+
strideLengthInSeconds: job.strideLengthInSeconds,
|
|
65
|
+
forceFullSequences: job.forceFullSequences,
|
|
66
|
+
doSample: job.doSample,
|
|
67
|
+
temperature: job.temperature,
|
|
68
|
+
topK: job.topK,
|
|
69
|
+
repetitionPenalty: job.repetitionPenalty,
|
|
70
|
+
noRepeatNgramSize: job.noRepeatNgramSize,
|
|
71
|
+
...(job.language === null ? {} : { language: job.language }),
|
|
72
|
+
});
|
|
73
|
+
const { captions } = (0, whisper_webgpu_1.toCaptions)({
|
|
74
|
+
whisperWebGpuOutput: transcription,
|
|
75
|
+
});
|
|
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
|
+
});
|
|
84
|
+
captionCount = captions.length;
|
|
85
|
+
}
|
|
86
|
+
catch (error) {
|
|
87
|
+
processingError =
|
|
88
|
+
error instanceof Error ? error : new Error(String(error));
|
|
89
|
+
}
|
|
90
|
+
try {
|
|
91
|
+
await (0, whisper_webgpu_1.disposeWhisperModel)({ model: job.model });
|
|
92
|
+
}
|
|
93
|
+
catch (_a) {
|
|
94
|
+
// The pipeline is removed from the in-memory registry before disposal.
|
|
95
|
+
// A cleanup failure should not hide a successfully written caption file.
|
|
96
|
+
}
|
|
97
|
+
if (processingError) {
|
|
98
|
+
markCaptionJobFailed(job.id, processingError);
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
markCaptionJobDone(job.id, captionCount !== null && captionCount !== void 0 ? captionCount : 0);
|
|
102
|
+
}
|
|
103
|
+
}, [markCaptionJobDone, markCaptionJobFailed, updateCaptionJobProgress]);
|
|
104
|
+
(0, react_1.useEffect)(() => {
|
|
105
|
+
setProcessCaptionJobCallback(processJob);
|
|
106
|
+
return () => setProcessCaptionJobCallback(null);
|
|
107
|
+
}, [processJob, setProcessCaptionJobCallback]);
|
|
108
|
+
return null;
|
|
109
|
+
};
|
|
110
|
+
exports.CaptionQueueProcessor = CaptionQueueProcessor;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.CaptionQueueProcessorLoader = void 0;
|
|
37
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
+
const react_1 = __importStar(require("react"));
|
|
39
|
+
const OptionalPackageModal_1 = require("../OptionalPackageModal");
|
|
40
|
+
const whisper_webgpu_capability_1 = require("../Transcription/whisper-webgpu-capability");
|
|
41
|
+
const context_1 = require("./context");
|
|
42
|
+
const LazyCaptionQueueProcessor = react_1.default.lazy(async () => {
|
|
43
|
+
const { CaptionQueueProcessor } = await Promise.resolve().then(() => __importStar(require('./CaptionQueueProcessor')));
|
|
44
|
+
return { default: CaptionQueueProcessor };
|
|
45
|
+
});
|
|
46
|
+
const CaptionQueueProcessorLoader = () => {
|
|
47
|
+
const { captionJobs } = (0, react_1.useContext)(context_1.RenderQueueContext);
|
|
48
|
+
const installed = (0, OptionalPackageModal_1.useOptionalPackageInstalled)(whisper_webgpu_capability_1.WHISPER_WEBGPU_PACKAGE);
|
|
49
|
+
if (!installed || captionJobs.length === 0) {
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
return (jsx_runtime_1.jsx(react_1.Suspense, { fallback: null, children: jsx_runtime_1.jsx(LazyCaptionQueueProcessor, {}) }));
|
|
53
|
+
};
|
|
54
|
+
exports.CaptionQueueProcessorLoader = CaptionQueueProcessorLoader;
|
|
@@ -10,6 +10,7 @@ const url_state_1 = require("../../helpers/url-state");
|
|
|
10
10
|
const layout_1 = require("../layout");
|
|
11
11
|
const client_side_render_types_1 = require("./client-side-render-types");
|
|
12
12
|
const context_1 = require("./context");
|
|
13
|
+
const item_style_1 = require("./item-style");
|
|
13
14
|
const RenderQueueCancelledMessage_1 = require("./RenderQueueCancelledMessage");
|
|
14
15
|
const RenderQueueCopyToClipboard_1 = require("./RenderQueueCopyToClipboard");
|
|
15
16
|
const RenderQueueDownloadItem_1 = require("./RenderQueueDownloadItem");
|
|
@@ -50,7 +51,6 @@ const subtitle = {
|
|
|
50
51
|
display: 'flex',
|
|
51
52
|
overflow: 'hidden',
|
|
52
53
|
};
|
|
53
|
-
const SELECTED_CLASSNAME = '__remotion_selected_classname';
|
|
54
54
|
const RenderQueueItem = ({ job, selected }) => {
|
|
55
55
|
const [hovered, setHovered] = (0, react_1.useState)(false);
|
|
56
56
|
const { setCanvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionSetters);
|
|
@@ -78,7 +78,7 @@ const RenderQueueItem = ({ job, selected }) => {
|
|
|
78
78
|
const scrollCurrentIntoView = (0, react_1.useCallback)(() => {
|
|
79
79
|
var _a;
|
|
80
80
|
(_a = document
|
|
81
|
-
.querySelector(`.${
|
|
81
|
+
.querySelector(`.${item_style_1.RENDER_QUEUE_ITEM_SELECTED_CLASSNAME}`)) === null || _a === void 0 ? void 0 : _a.scrollIntoView({ behavior: 'smooth' });
|
|
82
82
|
}, []);
|
|
83
83
|
const clientBlobInfo = (0, react_1.useMemo)(() => {
|
|
84
84
|
if (!isClientJob || job.status !== 'done' || !job.getBlob) {
|
|
@@ -146,7 +146,7 @@ const RenderQueueItem = ({ job, selected }) => {
|
|
|
146
146
|
job.status === 'failed' ||
|
|
147
147
|
job.status === 'cancelled') &&
|
|
148
148
|
!((0, context_1.isClientRenderJob)(job) && (0, client_side_render_types_1.isRestoredClientJob)(job));
|
|
149
|
-
return (jsx_runtime_1.jsxs(layout_1.Row, { "data-render-queue-item": job.id, onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, style: containerStyle, align: "center", onClick: onClick, draggable: canDrag, onDragStart: onDragStart, onDragEnd: onDragEnd, className: selected ?
|
|
149
|
+
return (jsx_runtime_1.jsxs(layout_1.Row, { "data-render-queue-item": job.id, onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, style: containerStyle, align: "center", onClick: onClick, draggable: canDrag, onDragStart: onDragStart, onDragEnd: onDragEnd, className: selected ? item_style_1.RENDER_QUEUE_ITEM_SELECTED_CLASSNAME : undefined, children: [
|
|
150
150
|
jsx_runtime_1.jsx(RenderQueueItemStatus_1.RenderQueueItemStatus, { job: job }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), jsx_runtime_1.jsxs("div", { style: right, children: [
|
|
151
151
|
jsx_runtime_1.jsx("div", { style: title, children: job.compositionId }), jsx_runtime_1.jsx("div", { style: subtitle, children: job.status === 'done' ? (jsx_runtime_1.jsx(RenderQueueOutputName_1.RenderQueueOutputName, { job: job })) : job.status === 'failed' ? (jsx_runtime_1.jsx(RenderQueueError_1.RenderQueueError, { job: job })) : job.status === 'running' ? (jsx_runtime_1.jsx(RenderQueueProgressMessage_1.RenderQueueProgressMessage, { job: job })) : job.status === 'saving' ? (jsx_runtime_1.jsx(RenderQueueSavingMessage_1.RenderQueueSavingMessage, {})) : job.status === 'cancelled' ? (jsx_runtime_1.jsx(RenderQueueCancelledMessage_1.RenderQueueCancelledMessage, {})) : null })
|
|
152
152
|
] }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), !isDragging ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [canCopyToClipboard ? (jsx_runtime_1.jsx(RenderQueueCopyToClipboard_1.RenderQueueCopyToClipboard, { job: job })) : null, canRepeat ? jsx_runtime_1.jsx(RenderQueueRepeat_1.RenderQueueRepeatItem, { job: job }) : null, job.status === 'running' ? (jsx_runtime_1.jsx(RenderQueueItemCancelButton_1.RenderQueueCancelButton, { job: job })) : isBrowserStudio ? null : (jsx_runtime_1.jsx(RenderQueueRemoveItem_1.RenderQueueRemoveItem, { job: job })), job.status === 'done' ? (clientBlobInfo ? (jsx_runtime_1.jsx(RenderQueueDownloadItem_1.RenderQueueDownloadItem, { job: job })) : isBrowserStudio ? null : (jsx_runtime_1.jsx(RenderQueueOpenInFolder_1.RenderQueueOpenInFinderItem, { job: job }))) : null] })) : null] }));
|