@remotion/studio 4.0.522 → 4.0.524
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/ActionTooltip.d.ts +9 -0
- package/dist/components/ActionTooltip.js +143 -0
- package/dist/components/AssetAudioVolume.d.ts +5 -0
- package/dist/components/AssetAudioVolume.js +33 -0
- package/dist/components/Canvas.js +8 -8
- package/dist/components/CaptionInspector.js +74 -20
- package/dist/components/CheckboardToggle.js +9 -10
- 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 +254 -137
- package/dist/components/FixComputedValueModal.js +38 -8
- package/dist/components/FullscreenToggle.js +8 -10
- package/dist/components/GlobalKeybindings.js +107 -49
- 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 +69 -6
- package/dist/components/InstallPackage.js +4 -5
- package/dist/components/KeyboardShortcutsSettings.js +212 -33
- package/dist/components/LazySyntaxHighlightedSource.d.ts +4 -0
- package/dist/components/LazySyntaxHighlightedSource.js +43 -0
- package/dist/components/LoopToggle.js +8 -2
- package/dist/components/MenuToolbar.js +11 -7
- 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/MuteToggle.d.ts +1 -0
- package/dist/components/MuteToggle.js +16 -6
- 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/NewComposition.d.ts +1 -0
- package/dist/components/NewComposition/NewComposition.js +5 -4
- package/dist/components/NewComposition/NewFolder.js +9 -8
- package/dist/components/NewComposition/RenameComposition.js +3 -2
- package/dist/components/NewComposition/RenameFolder.js +15 -10
- package/dist/components/NewComposition/SlugPreview.d.ts +7 -0
- package/dist/components/NewComposition/SlugPreview.js +18 -0
- package/dist/components/OptionalPackageModal.d.ts +11 -0
- package/dist/components/OptionalPackageModal.js +155 -0
- package/dist/components/OutlineToggle.js +16 -10
- package/dist/components/PlayPause.js +11 -9
- package/dist/components/PlaybackKeyboardShortcutsManager.d.ts +2 -0
- package/dist/components/PlaybackKeyboardShortcutsManager.js +39 -7
- package/dist/components/PlaybackRateSelector.js +2 -2
- package/dist/components/PreviewToolbar.js +1 -1
- package/dist/components/PreviewToolbarOverflowButton.js +19 -4
- 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 +130 -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 +2 -1
- package/dist/components/RenderQueue/RenderQueueDownloadItem.js +2 -1
- package/dist/components/RenderQueue/RenderQueueItem.js +3 -3
- package/dist/components/RenderQueue/RenderQueueItemCancelButton.js +2 -1
- package/dist/components/RenderQueue/RenderQueueOpenInFolder.js +2 -1
- package/dist/components/RenderQueue/RenderQueueRemoveItem.js +2 -1
- package/dist/components/RenderQueue/RenderQueueRepeat.js +2 -1
- package/dist/components/RenderQueue/VideoMattingQueueItem.d.ts +6 -0
- package/dist/components/RenderQueue/VideoMattingQueueItem.js +130 -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/RulersAndGuidesToggle.js +7 -1
- 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 +51 -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 +17 -21
- package/dist/components/SizeSelector.js +12 -4
- package/dist/components/SkillsSettings.js +2 -3
- package/dist/components/SnappingToggle.js +9 -8
- package/dist/components/StudioSettings.js +32 -18
- package/dist/components/SyntaxHighlightedSource.d.ts +5 -0
- package/dist/components/SyntaxHighlightedSource.js +78 -0
- 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 +49 -81
- 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/TimelineLayerChildren.js +12 -9
- 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/TimelineZoomControls.js +2 -1
- package/dist/components/Timeline/timeline-field-display-utils.js +8 -5
- 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/TimelineCombobox.d.ts +1 -0
- package/dist/components/TimelineCombobox.js +8 -4
- package/dist/components/TimelineInOutToggle.js +14 -18
- 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/handle-drop.js +3 -2
- 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 +191 -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/error-overlay/remotion-overlay/CodeFrame.js +29 -18
- package/dist/esm/CaptionQueueProcessor-k0yrm3dj.mjs +211 -0
- package/dist/esm/LazyModels-hc33szyn.mjs +11 -0
- package/dist/esm/LazyModels-sg40rjw6.mjs +11 -0
- package/dist/esm/SyntaxHighlightedSource-3xks91rz.mjs +1236 -0
- package/dist/esm/TranscriptionModal-3ctnxpt6.mjs +1011 -0
- package/dist/esm/VideoMattingModal-b0r7e60n.mjs +374 -0
- package/dist/esm/VideoMattingQueueProcessor-t1hgm2rm.mjs +109 -0
- package/dist/esm/index-1b9skrrd.mjs +142 -0
- package/dist/esm/index-2j3d1g81.mjs +261 -0
- package/dist/esm/index-5zrb1ft4.mjs +39 -0
- package/dist/esm/index-7tt71e8n.mjs +36 -0
- package/dist/esm/index-9qtvmwtx.mjs +1366 -0
- package/dist/esm/index-9x6e1dq0.mjs +428 -0
- package/dist/esm/index-c37kme2v.mjs +46209 -0
- package/dist/esm/index-cw0pnpg5.mjs +50 -0
- package/dist/esm/index-e3zwf3e7.mjs +36 -0
- package/dist/esm/index-er3mh6em.mjs +54688 -0
- package/dist/esm/{chunk-je0h1bgt.js → index-k426ye99.mjs} +4 -1
- package/dist/esm/index-q2epbw93.mjs +423 -0
- package/dist/esm/index-q5xv20xx.mjs +41 -0
- package/dist/esm/{chunk-6jf1natv.js → index-rcv7qkt5.mjs} +18 -1
- package/dist/esm/index-v4tr1bft.mjs +20 -0
- package/dist/esm/index-wbmp5srk.mjs +35 -0
- package/dist/esm/index-yfrysr5f.mjs +1154 -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 +5 -5
- package/dist/esm/{chunk-m0jqdbkr.js → resolve-composition-component-location-bt2d6qxq.mjs} +1 -1
- package/dist/helpers/colors.d.ts +1 -0
- package/dist/helpers/colors.js +4 -3
- 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-vsc-dark-plus.d.ts +1 -0
- package/dist/helpers/prism-vsc-dark-plus.js +305 -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-create-composition.d.ts +1 -0
- package/dist/helpers/use-create-composition.js +12 -7
- 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 +59 -14
- package/dist/helpers/use-rename-composition.d.ts +1 -0
- package/dist/helpers/use-rename-composition.js +11 -5
- 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/skills.js +1 -1
- package/dist/icons/transcription.d.ts +4 -0
- package/dist/icons/transcription.js +7 -0
- package/dist/icons/upload.js +1 -1
- package/dist/renderEntry.js +2 -2
- package/dist/state/modals.d.ts +14 -2
- package/package.json +35 -21
- package/dist/components/UpdateCheck.d.ts +0 -1
- package/dist/components/UpdateCheck.js +0 -79
- package/dist/esm/chunk-3netyjd9.js +0 -99793
|
@@ -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-yfrysr5f.mjs";
|
|
11
|
+
import {
|
|
12
|
+
BLUE,
|
|
13
|
+
BORDER_WHITE_ALPHA_12,
|
|
14
|
+
LIGHT_TEXT,
|
|
15
|
+
WHITE
|
|
16
|
+
} from "./index-k426ye99.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,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 };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// src/components/use-model-cache-status.ts
|
|
2
|
+
import { useEffect, useState } from "react";
|
|
3
|
+
var useModelCacheStatus = ({
|
|
4
|
+
isModelCached,
|
|
5
|
+
models,
|
|
6
|
+
refreshKey
|
|
7
|
+
}) => {
|
|
8
|
+
const [cachedModels, setCachedModels] = useState(new Set);
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
let cancelled = false;
|
|
11
|
+
Promise.all(models.map(async ({ name }) => ({
|
|
12
|
+
cached: await isModelCached(name),
|
|
13
|
+
name
|
|
14
|
+
}))).then((results) => {
|
|
15
|
+
if (!cancelled) {
|
|
16
|
+
const nextCachedModels = new Set;
|
|
17
|
+
for (const result of results) {
|
|
18
|
+
if (result.cached) {
|
|
19
|
+
nextCachedModels.add(result.name);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
setCachedModels(nextCachedModels);
|
|
23
|
+
}
|
|
24
|
+
}).catch(() => {
|
|
25
|
+
if (!cancelled) {
|
|
26
|
+
setCachedModels(new Set);
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
return () => {
|
|
30
|
+
cancelled = true;
|
|
31
|
+
};
|
|
32
|
+
}, [isModelCached, models, refreshKey]);
|
|
33
|
+
return cachedModels;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export { useModelCacheStatus };
|