@remotion/studio 4.0.521 → 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/CanvasIfSizeIsAvailable.js +7 -0
- 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/CopyButton.js +7 -14
- package/dist/components/CurrentAsset.js +40 -6
- package/dist/components/Editor.js +6 -5
- package/dist/components/EditorContent.js +1 -1
- package/dist/components/EditorContexts.js +3 -1
- package/dist/components/ElementInstallConfirmation.js +290 -136
- package/dist/components/FixComputedValueModal.js +56 -16
- 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/InspectorLocationCopy.js +10 -5
- 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/MenuBuildIndicator.js +7 -2
- package/dist/components/MenuCompositionName.js +62 -6
- 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/CliCopyButton.js +13 -27
- 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/RenderQueueCopyToClipboard.js +7 -4
- 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 +21 -16
- package/dist/components/SizeSelector.js +10 -2
- package/dist/components/SkillsSettings.js +11 -8
- package/dist/components/SnappingToggle.js +5 -2
- package/dist/components/Splitter/SplitterContainer.js +63 -10
- package/dist/components/Splitter/SplitterContext.d.ts +3 -0
- package/dist/components/Splitter/SplitterContext.js +5 -1
- package/dist/components/Splitter/SplitterElement.js +11 -2
- package/dist/components/Splitter/SplitterHandle.d.ts +1 -0
- package/dist/components/Splitter/SplitterHandle.js +55 -25
- 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/SubscribeToNodePaths.d.ts +2 -1
- package/dist/components/Timeline/SubscribeToNodePaths.js +2 -1
- package/dist/components/Timeline/Timeline.js +17 -46
- package/dist/components/Timeline/TimelineClipboardKeybindings.js +2 -4
- package/dist/components/Timeline/TimelineDeleteKeybindings.js +3 -18
- package/dist/components/Timeline/TimelineDragHandler.js +11 -6
- package/dist/components/Timeline/TimelineExpandedKeyframeRow.js +1 -0
- package/dist/components/Timeline/TimelinePinchZoom.js +6 -30
- package/dist/components/Timeline/TimelinePlayCursorSyncer.js +1 -7
- 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 +148 -25
- package/dist/components/Timeline/TimelineSequenceItem.d.ts +0 -1
- package/dist/components/Timeline/TimelineSequenceItem.js +220 -112
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +35 -5
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +233 -138
- package/dist/components/Timeline/TimelineSlider.js +1 -4
- package/dist/components/Timeline/TimelineTimeIndicators.js +1 -0
- package/dist/components/Timeline/TimelineWidthProvider.js +2 -5
- package/dist/components/Timeline/TimelineZoomControls.js +20 -20
- package/dist/components/Timeline/get-sequence-split-menu-item.d.ts +11 -0
- package/dist/components/Timeline/get-sequence-split-menu-item.js +55 -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/Timeline/use-sequence-props-subscription.d.ts +3 -2
- package/dist/components/Timeline/use-sequence-props-subscription.js +4 -10
- package/dist/components/TimelineInOutToggle.js +20 -17
- package/dist/components/TopPanel.js +3 -19
- 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 +17 -17
- 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/ZoomPersistor.js +6 -3
- package/dist/components/composition-menu-items.js +1 -1
- 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 -114127
- package/dist/esm/previewEntry.mjs +387 -114784
- package/dist/esm/renderEntry.mjs +3 -3
- package/dist/esm/{chunk-m0jqdbkr.js → resolve-composition-component-location-14148845.mjs} +1 -1
- package/dist/helpers/copy-text.js +1 -2
- 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-copy-feedback.d.ts +4 -0
- package/dist/helpers/use-copy-feedback.js +19 -0
- 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/copy.d.ts +5 -0
- package/dist/icons/copy.js +12 -0
- 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/canvas-ref.d.ts +1 -0
- package/dist/state/canvas-ref.js +2 -1
- package/dist/state/modals.d.ts +14 -2
- package/dist/state/sidebar.d.ts +3 -0
- package/dist/state/sidebar.js +6 -1
- package/dist/state/timeline-zoom.d.ts +1 -1
- package/dist/state/timeline-zoom.js +3 -3
- package/dist/visual-controls/VisualControls.js +4 -0
- package/package.json +34 -20
- package/dist/components/UpdateCheck.d.ts +0 -1
- package/dist/components/UpdateCheck.js +0 -79
- package/dist/esm/chunk-emw4k5b0.js +0 -99527
- package/dist/esm/chunk-vkrvnx2h.js +0 -99378
- package/dist/helpers/use-max-media-duration.d.ts +0 -2
- package/dist/helpers/use-max-media-duration.js +0 -61
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CheckCircleFilled,
|
|
3
|
+
CloudDownloadIcon,
|
|
4
|
+
InlineAction,
|
|
5
|
+
Spinner,
|
|
6
|
+
TrashIcon,
|
|
7
|
+
VERTICAL_SCROLLBAR_CLASSNAME,
|
|
8
|
+
ValidationMessage,
|
|
9
|
+
optionsPanel
|
|
10
|
+
} from "./index-xhe2m2qr.mjs";
|
|
11
|
+
import {
|
|
12
|
+
BLUE,
|
|
13
|
+
BORDER_WHITE_ALPHA_12,
|
|
14
|
+
LIGHT_TEXT,
|
|
15
|
+
WHITE
|
|
16
|
+
} from "./index-jg13hf2g.mjs";
|
|
17
|
+
|
|
18
|
+
// src/components/ModelManager.tsx
|
|
19
|
+
import { formatBytes } from "@remotion/studio-shared";
|
|
20
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
21
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
22
|
+
var modelPanel = {
|
|
23
|
+
...optionsPanel,
|
|
24
|
+
flexDirection: "column"
|
|
25
|
+
};
|
|
26
|
+
var hiddenPanel = { display: "none" };
|
|
27
|
+
var container = {
|
|
28
|
+
boxSizing: "border-box",
|
|
29
|
+
flex: 1,
|
|
30
|
+
fontFamily: "sans-serif",
|
|
31
|
+
minWidth: 0,
|
|
32
|
+
padding: "16px 16px 0",
|
|
33
|
+
width: "100%"
|
|
34
|
+
};
|
|
35
|
+
var flushContainer = {
|
|
36
|
+
...container,
|
|
37
|
+
padding: "16px 0 0"
|
|
38
|
+
};
|
|
39
|
+
var descriptionStyle = {
|
|
40
|
+
color: LIGHT_TEXT,
|
|
41
|
+
fontSize: 13,
|
|
42
|
+
lineHeight: 1.5,
|
|
43
|
+
margin: 0,
|
|
44
|
+
whiteSpace: "pre-line"
|
|
45
|
+
};
|
|
46
|
+
var list = { marginTop: 14 };
|
|
47
|
+
var modelRow = {
|
|
48
|
+
alignItems: "center",
|
|
49
|
+
borderBottom: BORDER_WHITE_ALPHA_12,
|
|
50
|
+
display: "flex",
|
|
51
|
+
gap: 10,
|
|
52
|
+
minHeight: 38,
|
|
53
|
+
padding: "0 10px"
|
|
54
|
+
};
|
|
55
|
+
var lastModelRow = {
|
|
56
|
+
...modelRow,
|
|
57
|
+
borderBottom: "none"
|
|
58
|
+
};
|
|
59
|
+
var statusIcon = {
|
|
60
|
+
flexShrink: 0,
|
|
61
|
+
height: 14,
|
|
62
|
+
width: 14
|
|
63
|
+
};
|
|
64
|
+
var modelName = {
|
|
65
|
+
color: WHITE,
|
|
66
|
+
flex: 1,
|
|
67
|
+
fontFamily: "monospace",
|
|
68
|
+
fontSize: 13,
|
|
69
|
+
lineHeight: 1.4,
|
|
70
|
+
minWidth: 0,
|
|
71
|
+
overflow: "hidden",
|
|
72
|
+
textOverflow: "ellipsis",
|
|
73
|
+
whiteSpace: "nowrap"
|
|
74
|
+
};
|
|
75
|
+
var status = {
|
|
76
|
+
color: LIGHT_TEXT,
|
|
77
|
+
fontSize: 12,
|
|
78
|
+
fontVariantNumeric: "tabular-nums",
|
|
79
|
+
lineHeight: 1.4,
|
|
80
|
+
whiteSpace: "nowrap"
|
|
81
|
+
};
|
|
82
|
+
var actionIcon = { height: 14, width: 14 };
|
|
83
|
+
var actionSlot = {
|
|
84
|
+
alignItems: "center",
|
|
85
|
+
display: "inline-flex",
|
|
86
|
+
flexShrink: 0,
|
|
87
|
+
height: 24,
|
|
88
|
+
justifyContent: "center",
|
|
89
|
+
width: 24
|
|
90
|
+
};
|
|
91
|
+
var ModelManager = ({
|
|
92
|
+
ariaLabel,
|
|
93
|
+
availableModels,
|
|
94
|
+
description,
|
|
95
|
+
indent,
|
|
96
|
+
isModelCached,
|
|
97
|
+
loadModel,
|
|
98
|
+
prepare,
|
|
99
|
+
removeModel,
|
|
100
|
+
visible
|
|
101
|
+
}) => {
|
|
102
|
+
const mounted = useRef(true);
|
|
103
|
+
const initialized = useRef(false);
|
|
104
|
+
const [cachedModels, setCachedModels] = useState(null);
|
|
105
|
+
const [actionState, setActionState] = useState({
|
|
106
|
+
type: "idle"
|
|
107
|
+
});
|
|
108
|
+
const [cacheCheckError, setCacheCheckError] = useState(null);
|
|
109
|
+
useEffect(() => {
|
|
110
|
+
mounted.current = true;
|
|
111
|
+
return () => {
|
|
112
|
+
mounted.current = false;
|
|
113
|
+
};
|
|
114
|
+
}, []);
|
|
115
|
+
useEffect(() => {
|
|
116
|
+
if (!visible || initialized.current) {
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
initialized.current = true;
|
|
120
|
+
Promise.resolve().then(() => prepare?.()).then(() => Promise.all(availableModels.map(async ({ name }) => await isModelCached(name) ? name : null))).then((models) => {
|
|
121
|
+
if (mounted.current) {
|
|
122
|
+
const cached = new Set;
|
|
123
|
+
for (const model of models) {
|
|
124
|
+
if (model !== null) {
|
|
125
|
+
cached.add(model);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
setCachedModels(cached);
|
|
129
|
+
}
|
|
130
|
+
}).catch((error) => {
|
|
131
|
+
if (mounted.current) {
|
|
132
|
+
setCachedModels(new Set);
|
|
133
|
+
setCacheCheckError(error instanceof Error ? error.message : String(error));
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
}, [availableModels, isModelCached, prepare, visible]);
|
|
137
|
+
const downloadModel = useCallback((model) => {
|
|
138
|
+
setActionState({ type: "downloading", model, progress: 0 });
|
|
139
|
+
loadModel(model, (progress) => {
|
|
140
|
+
if (mounted.current) {
|
|
141
|
+
setActionState({ type: "downloading", model, progress });
|
|
142
|
+
}
|
|
143
|
+
}).then(() => {
|
|
144
|
+
if (mounted.current) {
|
|
145
|
+
setCachedModels((current) => new Set([...current ?? [], model]));
|
|
146
|
+
setActionState({ type: "idle" });
|
|
147
|
+
}
|
|
148
|
+
}).catch((error) => {
|
|
149
|
+
if (mounted.current) {
|
|
150
|
+
setActionState({
|
|
151
|
+
type: "error",
|
|
152
|
+
model,
|
|
153
|
+
message: error instanceof Error ? error.message : String(error)
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
}, [loadModel]);
|
|
158
|
+
const remove = useCallback((model) => {
|
|
159
|
+
setActionState({ type: "removing", model });
|
|
160
|
+
removeModel(model).then(() => {
|
|
161
|
+
if (mounted.current) {
|
|
162
|
+
setCachedModels((current) => {
|
|
163
|
+
const next = new Set(current ?? []);
|
|
164
|
+
next.delete(model);
|
|
165
|
+
return next;
|
|
166
|
+
});
|
|
167
|
+
setActionState({ type: "idle" });
|
|
168
|
+
}
|
|
169
|
+
}).catch((error) => {
|
|
170
|
+
if (mounted.current) {
|
|
171
|
+
setActionState({
|
|
172
|
+
type: "error",
|
|
173
|
+
model,
|
|
174
|
+
message: error instanceof Error ? error.message : String(error)
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
}, [removeModel]);
|
|
179
|
+
const renderDownloadIcon = useCallback((color) => {
|
|
180
|
+
return /* @__PURE__ */ jsx(CloudDownloadIcon, {
|
|
181
|
+
color,
|
|
182
|
+
style: actionIcon
|
|
183
|
+
});
|
|
184
|
+
}, []);
|
|
185
|
+
const renderRemoveIcon = useCallback((color) => {
|
|
186
|
+
return /* @__PURE__ */ jsx(TrashIcon, {
|
|
187
|
+
color,
|
|
188
|
+
style: actionIcon
|
|
189
|
+
});
|
|
190
|
+
}, []);
|
|
191
|
+
const actionInProgress = actionState.type === "downloading" || actionState.type === "removing";
|
|
192
|
+
return /* @__PURE__ */ jsx("div", {
|
|
193
|
+
style: visible ? modelPanel : hiddenPanel,
|
|
194
|
+
className: VERTICAL_SCROLLBAR_CLASSNAME,
|
|
195
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
196
|
+
style: indent ? container : flushContainer,
|
|
197
|
+
children: [
|
|
198
|
+
description === null ? null : /* @__PURE__ */ jsx("p", {
|
|
199
|
+
style: descriptionStyle,
|
|
200
|
+
children: description
|
|
201
|
+
}),
|
|
202
|
+
cacheCheckError ? /* @__PURE__ */ jsx(ValidationMessage, {
|
|
203
|
+
align: "flex-start",
|
|
204
|
+
message: cacheCheckError,
|
|
205
|
+
type: "error"
|
|
206
|
+
}) : null,
|
|
207
|
+
/* @__PURE__ */ jsx("div", {
|
|
208
|
+
style: description === null ? undefined : list,
|
|
209
|
+
role: "list",
|
|
210
|
+
"aria-label": ariaLabel,
|
|
211
|
+
children: availableModels.map((model, index) => {
|
|
212
|
+
const cached = cachedModels?.has(model.name) ?? false;
|
|
213
|
+
const processingThisModel = actionState.type !== "idle" && actionState.type !== "error" && actionState.model === model.name;
|
|
214
|
+
const progress = actionState.type === "downloading" && actionState.model === model.name ? actionState.progress : null;
|
|
215
|
+
const modelStatus = processingThisModel ? actionState.type === "removing" ? "Removing…" : `Downloading${progress === null ? "…" : ` ${Math.round(progress * 100)}%`}` : actionState.type === "error" && actionState.model === model.name ? actionState.message : formatBytes(model.webGpuDownloadSize);
|
|
216
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
217
|
+
role: "listitem",
|
|
218
|
+
style: index === availableModels.length - 1 ? lastModelRow : modelRow,
|
|
219
|
+
children: [
|
|
220
|
+
/* @__PURE__ */ jsx("span", {
|
|
221
|
+
style: modelName,
|
|
222
|
+
children: model.name
|
|
223
|
+
}),
|
|
224
|
+
/* @__PURE__ */ jsx("span", {
|
|
225
|
+
style: status,
|
|
226
|
+
title: modelStatus,
|
|
227
|
+
children: modelStatus
|
|
228
|
+
}),
|
|
229
|
+
cached ? /* @__PURE__ */ jsx(CheckCircleFilled, {
|
|
230
|
+
"aria-hidden": true,
|
|
231
|
+
style: { ...statusIcon, fill: BLUE }
|
|
232
|
+
}) : null,
|
|
233
|
+
processingThisModel ? /* @__PURE__ */ jsx("span", {
|
|
234
|
+
style: actionSlot,
|
|
235
|
+
children: /* @__PURE__ */ jsx(Spinner, {
|
|
236
|
+
duration: 0.5,
|
|
237
|
+
size: 14
|
|
238
|
+
})
|
|
239
|
+
}) : cached ? /* @__PURE__ */ jsx(InlineAction, {
|
|
240
|
+
disabled: actionInProgress,
|
|
241
|
+
onClick: () => remove(model.name),
|
|
242
|
+
renderAction: renderRemoveIcon,
|
|
243
|
+
title: `Remove ${model.name}`,
|
|
244
|
+
variant: null
|
|
245
|
+
}) : /* @__PURE__ */ jsx(InlineAction, {
|
|
246
|
+
disabled: cachedModels === null || actionInProgress,
|
|
247
|
+
onClick: () => downloadModel(model.name),
|
|
248
|
+
renderAction: renderDownloadIcon,
|
|
249
|
+
title: `Download ${model.name}`,
|
|
250
|
+
variant: null
|
|
251
|
+
})
|
|
252
|
+
]
|
|
253
|
+
}, model.name);
|
|
254
|
+
})
|
|
255
|
+
})
|
|
256
|
+
]
|
|
257
|
+
})
|
|
258
|
+
});
|
|
259
|
+
};
|
|
260
|
+
|
|
261
|
+
export { ModelManager };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import {
|
|
2
|
+
callApi
|
|
3
|
+
} from "./index-hy4xcgty.mjs";
|
|
4
|
+
import {
|
|
5
|
+
getBrowserStudioOperations
|
|
6
|
+
} from "./index-cw0pnpg5.mjs";
|
|
7
|
+
|
|
8
|
+
// src/api/pause.ts
|
|
9
|
+
import { Internals } from "remotion";
|
|
10
|
+
var pause = () => {
|
|
11
|
+
Internals.timeValueRef.current?.pause();
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
// src/api/play.ts
|
|
15
|
+
import { Internals as Internals2 } from "remotion";
|
|
16
|
+
var play = (e) => {
|
|
17
|
+
Internals2.timeValueRef.current?.play(e);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
// src/api/restart-studio.ts
|
|
21
|
+
import { getRemotionEnvironment } from "remotion";
|
|
22
|
+
var restartStudio = () => {
|
|
23
|
+
if (!getRemotionEnvironment().isStudio) {
|
|
24
|
+
throw new Error("restartStudio() is only available in the Studio");
|
|
25
|
+
}
|
|
26
|
+
if (getBrowserStudioOperations() !== null) {
|
|
27
|
+
throw new Error("restartStudio() is not supported in Browser Studio");
|
|
28
|
+
}
|
|
29
|
+
if (window.remotion_isReadOnlyStudio) {
|
|
30
|
+
throw new Error("restartStudio() is not available in read-only Studio");
|
|
31
|
+
}
|
|
32
|
+
return callApi("/api/restart-studio", {});
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
// src/api/seek.ts
|
|
36
|
+
import { Internals as Internals3 } from "remotion";
|
|
37
|
+
var seek = (frame) => {
|
|
38
|
+
Internals3.timeValueRef.current?.seek(Math.max(0, frame));
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export { pause, play, restartStudio, seek };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ModelManager
|
|
3
|
+
} from "./index-1x7bsdh6.mjs";
|
|
4
|
+
|
|
5
|
+
// src/components/Transcription/Models.tsx
|
|
6
|
+
import {
|
|
7
|
+
clearStaleModels,
|
|
8
|
+
getAvailableModels,
|
|
9
|
+
isWhisperModelCached,
|
|
10
|
+
loadWhisperModel,
|
|
11
|
+
removeWhisperModel
|
|
12
|
+
} from "@remotion/whisper-webgpu";
|
|
13
|
+
import { useCallback } from "react";
|
|
14
|
+
import { jsx } from "react/jsx-runtime";
|
|
15
|
+
var AVAILABLE_MODELS = getAvailableModels();
|
|
16
|
+
var Models = ({ description, indent, visible }) => {
|
|
17
|
+
const isModelCached = useCallback((model) => isWhisperModelCached({ model }), []);
|
|
18
|
+
const loadModel = useCallback((model, onProgress) => loadWhisperModel({
|
|
19
|
+
model,
|
|
20
|
+
onProgress: (progress) => onProgress(progress.progress)
|
|
21
|
+
}), []);
|
|
22
|
+
const removeModel = useCallback((model) => removeWhisperModel({ model }), []);
|
|
23
|
+
return /* @__PURE__ */ jsx(ModelManager, {
|
|
24
|
+
ariaLabel: "Whisper models",
|
|
25
|
+
availableModels: AVAILABLE_MODELS,
|
|
26
|
+
description,
|
|
27
|
+
indent,
|
|
28
|
+
isModelCached,
|
|
29
|
+
loadModel,
|
|
30
|
+
prepare: clearStaleModels,
|
|
31
|
+
removeModel,
|
|
32
|
+
visible
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export { Models };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// src/helpers/studio-runtime-config.ts
|
|
2
|
+
var DEFAULT_BUFFER_STATE_DELAY_IN_MILLISECONDS = 300;
|
|
3
|
+
var defaultStudioRuntimeConfig = {
|
|
4
|
+
askAIEnabled: false,
|
|
5
|
+
bufferStateDelayInMilliseconds: null,
|
|
6
|
+
defaultCodingAgent: null,
|
|
7
|
+
defaultEditor: null,
|
|
8
|
+
interactivityEnabled: true,
|
|
9
|
+
keyboardShortcutsEnabled: true,
|
|
10
|
+
maxTimelineTracks: null,
|
|
11
|
+
publicLicenseKey: null,
|
|
12
|
+
configFileStudioSettings: null
|
|
13
|
+
};
|
|
14
|
+
var getStudioRuntimeConfig = () => {
|
|
15
|
+
if (typeof window === "undefined") {
|
|
16
|
+
return defaultStudioRuntimeConfig;
|
|
17
|
+
}
|
|
18
|
+
return window.remotion_studioConfig ?? defaultStudioRuntimeConfig;
|
|
19
|
+
};
|
|
20
|
+
var getStudioAskAIEnabled = () => {
|
|
21
|
+
return getStudioRuntimeConfig().askAIEnabled;
|
|
22
|
+
};
|
|
23
|
+
var getStudioInteractivityEnabled = () => {
|
|
24
|
+
return getStudioRuntimeConfig().interactivityEnabled;
|
|
25
|
+
};
|
|
26
|
+
var getStudioKeyboardShortcutsEnabled = () => {
|
|
27
|
+
return getStudioRuntimeConfig().keyboardShortcutsEnabled;
|
|
28
|
+
};
|
|
29
|
+
var getStudioKeyboardShortcuts = () => {
|
|
30
|
+
return getStudioRuntimeConfig().keyboardShortcuts ?? null;
|
|
31
|
+
};
|
|
32
|
+
var getStudioMaxTimelineTracks = () => {
|
|
33
|
+
return getStudioRuntimeConfig().maxTimelineTracks;
|
|
34
|
+
};
|
|
35
|
+
var getStudioBufferStateDelayInMilliseconds = () => {
|
|
36
|
+
return getStudioRuntimeConfig().bufferStateDelayInMilliseconds ?? DEFAULT_BUFFER_STATE_DELAY_IN_MILLISECONDS;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export { getStudioAskAIEnabled, getStudioInteractivityEnabled, getStudioKeyboardShortcutsEnabled, getStudioKeyboardShortcuts, getStudioMaxTimelineTracks, getStudioBufferStateDelayInMilliseconds };
|