@remotion/studio 4.0.514 → 4.0.516
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 +14 -1
- package/dist/api/restart-studio.js +4 -0
- package/dist/components/AssetSelector.js +3 -9
- package/dist/components/AssetSelectorItem.d.ts +3 -1
- package/dist/components/AssetSelectorItem.js +41 -42
- package/dist/components/AudioWaveform.js +17 -139
- package/dist/components/Canvas.js +7 -4
- package/dist/components/CaptionInspector.d.ts +2 -0
- package/dist/components/CaptionInspector.js +3 -5
- package/dist/components/CompositionSelector.js +6 -3
- package/dist/components/CompositionSelectorItem.js +9 -10
- package/dist/components/ConfigSelect.d.ts +17 -0
- package/dist/components/ConfigSelect.js +50 -0
- package/dist/components/CurrentAsset.d.ts +10 -2
- package/dist/components/CurrentAsset.js +139 -46
- package/dist/components/FixComputedValueModal.js +54 -51
- package/dist/components/GlobalKeybindings.js +5 -5
- package/dist/components/InlineAction.d.ts +1 -1
- package/dist/components/InlineAction.js +12 -2
- package/dist/components/InlineCaptionInspector.d.ts +2 -0
- package/dist/components/InlineCaptionInspector.js +2 -2
- package/dist/components/InlineCompositionName.js +1 -1
- package/dist/components/InlineEditableTitle.js +3 -2
- package/dist/components/InspectorInfoHeader.js +1 -1
- package/dist/components/InspectorOpenInEditor.js +48 -72
- package/dist/components/InspectorPanel/AlignmentControls.js +2 -3
- package/dist/components/InspectorPanel/CollapsibleInspectorSectionHeader.d.ts +7 -0
- package/dist/components/InspectorPanel/CollapsibleInspectorSectionHeader.js +39 -0
- package/dist/components/InspectorPanel/CompositionInspector.js +41 -12
- package/dist/components/InspectorPanel/KeyframeEasingNavigator.js +10 -4
- package/dist/components/InspectorPanel/SequenceInspectorHeader.js +2 -1
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +1 -4
- package/dist/components/InspectorPanel/common.d.ts +0 -12
- package/dist/components/InspectorPanel/common.js +3 -52
- package/dist/components/InspectorPanel/use-composition-actions.js +0 -1
- package/dist/components/InspectorPanelLayout.d.ts +1 -1
- package/dist/components/InspectorPanelLayout.js +1 -1
- package/dist/components/InspectorSequenceSection.js +40 -54
- package/dist/components/InstallPackage.d.ts +3 -2
- package/dist/components/InstallPackage.js +90 -28
- package/dist/components/InstallablePackage.js +37 -11
- package/dist/components/KeyboardShortcutsSettings.d.ts +2 -0
- package/dist/components/KeyboardShortcutsSettings.js +177 -0
- package/dist/components/Menu/MenuDivider.js +1 -1
- package/dist/components/MenuBuildIndicator.js +1 -1
- package/dist/components/Modals.js +12 -4
- package/dist/components/NewComposition/CodemodFooter.d.ts +0 -1
- package/dist/components/NewComposition/CodemodFooter.js +2 -8
- package/dist/components/NewComposition/DeleteComposition.js +1 -1
- package/dist/components/NewComposition/DeleteFolder.js +1 -1
- package/dist/components/NewComposition/DuplicateComposition.js +1 -1
- package/dist/components/NewComposition/InputDragger.js +27 -4
- package/dist/components/NewComposition/NewComposition.js +1 -1
- package/dist/components/NewComposition/NewFolder.js +1 -3
- package/dist/components/NewComposition/RenameComposition.js +1 -1
- package/dist/components/NewComposition/RenameFolder.js +1 -1
- package/dist/components/NewComposition/use-rename-static-file.js +1 -1
- package/dist/components/Notifications/NotificationCenter.d.ts +1 -0
- package/dist/components/Notifications/NotificationCenter.js +5 -0
- package/dist/components/OptionsPanel.js +9 -12
- package/dist/components/PreviewToolbar.js +5 -2
- package/dist/components/PreviewToolbarOverflowButton.js +30 -0
- package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +2 -2
- package/dist/components/QuickSwitcher/QuickSwitcherContent.js +14 -30
- package/dist/components/RenderButton.js +66 -183
- package/dist/components/RenderModal/DataEditor.js +15 -12
- package/dist/components/RenderModal/GuiRenderStatus.js +3 -1
- package/dist/components/RenderModal/RenderModalOutputName.js +3 -3
- package/dist/components/RenderModal/RenderStatusModal.js +0 -1
- package/dist/components/RenderModal/SchemaEditor/ZodSwitch.js +3 -1
- package/dist/components/RenderModal/SchemaEditor/infer-zod-schema-from-value.d.ts +15 -0
- package/dist/components/RenderModal/SchemaEditor/infer-zod-schema-from-value.js +95 -0
- package/dist/components/RenderModal/WebRenderModal.js +4 -2
- package/dist/components/RenderQueue/RenderQueueItem.js +3 -1
- package/dist/components/RenderQueue/RenderQueueOpenInFolder.js +3 -1
- package/dist/components/RenderQueue/RenderQueueRemoveItem.js +2 -7
- package/dist/components/RenderingSettings.js +7 -4
- package/dist/components/RulersAndGuidesToggle.d.ts +2 -0
- package/dist/components/RulersAndGuidesToggle.js +23 -0
- package/dist/components/SegmentedButton.d.ts +29 -0
- package/dist/components/SegmentedButton.js +226 -0
- package/dist/components/SelectedOutlineCanvasRotation.d.ts +1 -0
- package/dist/components/SelectedOutlineCanvasRotation.js +11 -4
- package/dist/components/SelectedOutlineEditingHandles.d.ts +16 -0
- package/dist/components/SelectedOutlineEditingHandles.js +66 -0
- package/dist/components/SelectedOutlineElement.d.ts +2 -4
- package/dist/components/SelectedOutlineElement.js +15 -54
- package/dist/components/SelectedOutlineOverlay.js +32 -6
- package/dist/components/SelectedOutlinePolygon.d.ts +4 -4
- package/dist/components/SelectedOutlinePolygon.js +20 -17
- package/dist/components/SelectedOutlineRenderer.js +66 -14
- package/dist/components/SettingsModal.d.ts +1 -1
- package/dist/components/SettingsModal.js +30 -7
- package/dist/components/SettingsModalFooter.js +2 -1
- package/dist/components/SkillsSettings.d.ts +2 -0
- package/dist/components/SkillsSettings.js +129 -0
- package/dist/components/StaticFilePreview.js +7 -1
- package/dist/components/StudioSettings.js +7 -48
- package/dist/components/Tabs/index.js +1 -1
- package/dist/components/Timeline/Timeline.js +0 -1
- package/dist/components/Timeline/TimelineAssetField.d.ts +1 -1
- package/dist/components/Timeline/TimelineAssetField.js +15 -9
- package/dist/components/Timeline/TimelineBooleanField.js +1 -4
- package/dist/components/Timeline/TimelineClipboardKeybindings.js +13 -12
- package/dist/components/Timeline/TimelineEffectItem.d.ts +1 -0
- package/dist/components/Timeline/TimelineEffectItem.js +45 -15
- package/dist/components/Timeline/TimelineEffectPropItem.js +21 -4
- package/dist/components/Timeline/TimelineExpandArrowButton.js +10 -7
- package/dist/components/Timeline/TimelineExpandedKeyframeRow.js +4 -1
- package/dist/components/Timeline/TimelineExpandedRow.js +5 -4
- package/dist/components/Timeline/TimelineExpandedSection.js +8 -5
- package/dist/components/Timeline/TimelineFieldLabel.js +4 -2
- package/dist/components/Timeline/TimelineFieldRowContent.d.ts +1 -2
- package/dist/components/Timeline/TimelineFieldRowContent.js +8 -21
- package/dist/components/Timeline/TimelineImageInfo.d.ts +0 -1
- package/dist/components/Timeline/TimelineImageInfo.js +13 -32
- package/dist/components/Timeline/TimelineKeyframeControls.js +10 -4
- package/dist/components/Timeline/TimelinePrimitiveFieldValue.js +1 -1
- package/dist/components/Timeline/TimelineRotationField.js +0 -2
- package/dist/components/Timeline/TimelineRowChrome.d.ts +1 -1
- package/dist/components/Timeline/TimelineRowChrome.js +41 -6
- package/dist/components/Timeline/TimelineRowLayoutContext.d.ts +0 -1
- package/dist/components/Timeline/TimelineRowLayoutContext.js +1 -4
- package/dist/components/Timeline/TimelineScaleField.js +2 -6
- package/dist/components/Timeline/TimelineSchemaField.js +9 -3
- package/dist/components/Timeline/TimelineSelection.d.ts +8 -3
- package/dist/components/Timeline/TimelineSelection.js +7 -5
- package/dist/components/Timeline/TimelineSequence.d.ts +2 -0
- package/dist/components/Timeline/TimelineSequence.js +110 -19
- package/dist/components/Timeline/TimelineSequenceItem.js +11 -8
- package/dist/components/Timeline/TimelineSequenceName.js +1 -1
- package/dist/components/Timeline/TimelineSequencePropItem.js +15 -2
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +4 -2
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +85 -91
- package/dist/components/Timeline/TimelineTrack.js +5 -2
- package/dist/components/Timeline/TimelineTransformOriginField.js +0 -4
- package/dist/components/Timeline/TimelineTranslateField.js +0 -4
- package/dist/components/Timeline/TimelineVideoInfo.js +4 -2
- package/dist/components/Timeline/TimelineVirtualization.js +3 -1
- package/dist/components/Timeline/delete-selected-timeline-item.js +6 -2
- package/dist/components/Timeline/duplicate-selected-timeline-item.js +7 -14
- package/dist/components/Timeline/get-copy-context-for-agents-menu-item.d.ts +4 -0
- package/dist/components/Timeline/get-copy-context-for-agents-menu-item.js +26 -0
- package/dist/components/Timeline/get-sequence-context-menu-items.js +2 -19
- package/dist/components/Timeline/get-timeline-sequence-visible-layout.d.ts +6 -1
- package/dist/components/Timeline/get-timeline-sequence-visible-layout.js +11 -4
- package/dist/components/Timeline/save-effect-prop.js +3 -3
- package/dist/components/Timeline/split-selected-timeline-item.js +0 -1
- package/dist/components/Timeline/timeline-field-row-layout.d.ts +1 -1
- package/dist/components/Timeline/timeline-field-row-layout.js +4 -7
- package/dist/components/Timeline/timeline-field-utils.js +0 -2
- package/dist/components/Timeline/use-timeline-asset-drop.js +1 -0
- package/dist/components/TimelineCombobox.js +25 -160
- package/dist/components/TimelineInOutToggle.js +4 -1
- package/dist/components/duplicate-jsx-node-api.d.ts +2 -0
- package/dist/components/duplicate-jsx-node-api.js +12 -0
- package/dist/components/effect-drag-and-drop.js +7 -7
- package/dist/components/effect-operations-api.d.ts +8 -0
- package/dist/components/effect-operations-api.js +52 -0
- package/dist/components/handle-drop.d.ts +2 -1
- package/dist/components/handle-drop.js +3 -3
- package/dist/components/import-assets.js +9 -65
- package/dist/components/keyboard-shortcuts.d.ts +10 -0
- package/dist/components/keyboard-shortcuts.js +135 -0
- package/dist/components/selected-outline-control-layout.js +2 -6
- package/dist/components/selected-outline-measurement.d.ts +1 -1
- package/dist/components/selected-outline-measurement.js +16 -3
- package/dist/components/use-delete-asset.d.ts +1 -0
- package/dist/components/use-delete-asset.js +40 -0
- package/dist/components/use-selected-outline-control-target.d.ts +11 -0
- package/dist/components/use-selected-outline-control-target.js +79 -0
- package/dist/error-overlay/remotion-overlay/log-studio-error.js +4 -0
- package/dist/esm/{chunk-r46yxrjr.js → chunk-4bxz1d3g.js} +4 -3
- package/dist/esm/{chunk-xn2q7eem.js → chunk-w4244j4n.js} +14747 -14549
- package/dist/esm/index.mjs +3 -0
- package/dist/esm/internals.mjs +14747 -14549
- package/dist/esm/previewEntry.mjs +14557 -14359
- package/dist/esm/renderEntry.mjs +2 -2
- package/dist/helpers/add-asset-cache-bust.d.ts +4 -0
- package/dist/helpers/add-asset-cache-bust.js +10 -0
- package/dist/helpers/browser-studio-operations.d.ts +3 -0
- package/dist/helpers/browser-studio-operations.js +18 -1
- package/dist/helpers/calculate-timeline.js +2 -1
- package/dist/helpers/colors.d.ts +3 -1
- package/dist/helpers/colors.js +7 -3
- package/dist/helpers/drag-aware-double-click.d.ts +6 -0
- package/dist/helpers/drag-aware-double-click.js +20 -0
- package/dist/helpers/get-asset-metadata.js +25 -16
- package/dist/helpers/get-sequence-double-click-action.d.ts +2 -1
- package/dist/helpers/get-sequence-double-click-action.js +7 -1
- package/dist/helpers/get-timeline-sequence-layout.d.ts +4 -1
- package/dist/helpers/get-timeline-sequence-layout.js +15 -6
- package/dist/helpers/get-timeline-sequence-sort-key.d.ts +2 -1
- package/dist/helpers/hoverable.d.ts +1 -0
- package/dist/helpers/hoverable.js +2 -1
- package/dist/helpers/inject-css.js +7 -3
- package/dist/helpers/open-in-remotion-convert.d.ts +7 -0
- package/dist/helpers/open-in-remotion-convert.js +18 -0
- package/dist/helpers/use-max-media-duration.js +5 -3
- package/dist/helpers/use-media-metadata.d.ts +2 -1
- package/dist/helpers/use-media-metadata.js +49 -25
- package/dist/helpers/use-menu-structure.js +54 -67
- package/dist/icons/align-center-horizontal.js +1 -1
- package/dist/icons/align-left.js +1 -1
- package/dist/icons/align-right.js +1 -1
- package/dist/icons/cloud-download.d.ts +4 -0
- package/dist/icons/cloud-download.js +8 -0
- package/dist/icons/keyboard.d.ts +4 -0
- package/dist/icons/keyboard.js +10 -0
- package/dist/icons/license.d.ts +4 -0
- package/dist/icons/license.js +8 -0
- package/dist/icons/package.d.ts +4 -0
- package/dist/icons/package.js +8 -0
- package/dist/icons/react.js +1 -1
- package/dist/icons/remotion-convert.d.ts +4 -0
- package/dist/icons/remotion-convert.js +10 -0
- package/dist/icons/skills.d.ts +4 -0
- package/dist/icons/skills.js +10 -0
- package/dist/state/modals.d.ts +2 -5
- package/package.json +12 -12
- package/dist/components/KeyboardShortcutsExplainer.d.ts +0 -2
- package/dist/components/KeyboardShortcutsExplainer.js +0 -194
|
@@ -3,10 +3,23 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.installPackages = void 0;
|
|
4
4
|
const remotion_1 = require("remotion");
|
|
5
5
|
const call_api_1 = require("../components/call-api");
|
|
6
|
-
const
|
|
6
|
+
const browser_studio_operations_1 = require("../helpers/browser-studio-operations");
|
|
7
|
+
const installPackages = async (dependencies) => {
|
|
7
8
|
if (!(0, remotion_1.getRemotionEnvironment)().isStudio) {
|
|
8
9
|
throw new Error('installPackages() is only available in the Studio');
|
|
9
10
|
}
|
|
11
|
+
const browserStudioOperations = (0, browser_studio_operations_1.getBrowserStudioOperations)();
|
|
12
|
+
if (browserStudioOperations !== null) {
|
|
13
|
+
const response = await browserStudioOperations.packageInstallation.installPackages({
|
|
14
|
+
dependencies: [...dependencies],
|
|
15
|
+
});
|
|
16
|
+
if (!response.success) {
|
|
17
|
+
const error = new Error(response.reason);
|
|
18
|
+
error.stack = response.stack;
|
|
19
|
+
throw error;
|
|
20
|
+
}
|
|
21
|
+
return {};
|
|
22
|
+
}
|
|
10
23
|
if (window.remotion_isReadOnlyStudio) {
|
|
11
24
|
throw new Error('installPackages() is not available in Read-Only Studio');
|
|
12
25
|
}
|
|
@@ -7,10 +7,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
7
|
exports.restartStudio = void 0;
|
|
8
8
|
const remotion_1 = require("remotion");
|
|
9
9
|
const call_api_1 = require("../components/call-api");
|
|
10
|
+
const browser_studio_operations_1 = require("../helpers/browser-studio-operations");
|
|
10
11
|
const restartStudio = () => {
|
|
11
12
|
if (!(0, remotion_1.getRemotionEnvironment)().isStudio) {
|
|
12
13
|
throw new Error('restartStudio() is only available in the Studio');
|
|
13
14
|
}
|
|
15
|
+
if ((0, browser_studio_operations_1.getBrowserStudioOperations)() !== null) {
|
|
16
|
+
throw new Error('restartStudio() is not supported in Browser Studio');
|
|
17
|
+
}
|
|
14
18
|
if (window.remotion_isReadOnlyStudio) {
|
|
15
19
|
throw new Error('restartStudio() is not available in read-only Studio');
|
|
16
20
|
}
|
|
@@ -135,9 +135,9 @@ const AssetSelector = ({ readOnlyStudio }) => {
|
|
|
135
135
|
outputPath: renderOutput.outputPath,
|
|
136
136
|
assetPath: destination,
|
|
137
137
|
});
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
138
|
+
if (!result.created) {
|
|
139
|
+
(0, NotificationCenter_1.showNotification)(`${destination} already exists`, 3000);
|
|
140
|
+
}
|
|
141
141
|
return;
|
|
142
142
|
}
|
|
143
143
|
const { files } = e.dataTransfer;
|
|
@@ -164,12 +164,6 @@ const AssetSelector = ({ readOnlyStudio }) => {
|
|
|
164
164
|
filePath: makePath(file),
|
|
165
165
|
});
|
|
166
166
|
}
|
|
167
|
-
if (files.length === 1) {
|
|
168
|
-
(0, NotificationCenter_1.showNotification)(`Created ${makePath(files[0])}`, 3000);
|
|
169
|
-
}
|
|
170
|
-
else {
|
|
171
|
-
(0, NotificationCenter_1.showNotification)(`Added ${files.length} files to ${assetPath}`, 3000);
|
|
172
|
-
}
|
|
173
167
|
}
|
|
174
168
|
catch (error) {
|
|
175
169
|
(0, NotificationCenter_1.showNotification)(`Error during upload: ${error}`, 3000);
|
|
@@ -14,14 +14,16 @@ export declare const getCanDragAsset: ({ readOnlyStudio, relativePath, }: {
|
|
|
14
14
|
readOnlyStudio: boolean;
|
|
15
15
|
relativePath: string;
|
|
16
16
|
}) => boolean;
|
|
17
|
-
export declare const getAssetContextMenuItems: ({ relativePath, fileManagerName, copyFileName, copyStaticFilePath, openAssetInExplorer, renameAsset, deleteAsset, fileExplorerDisabled, mutationsDisabled, }: {
|
|
17
|
+
export declare const getAssetContextMenuItems: ({ relativePath, fileManagerName, copyFileName, copyStaticFilePath, openAssetInConvert, openAssetInExplorer, renameAsset, deleteAsset, fileExplorerAvailable, fileExplorerDisabled, mutationsDisabled, }: {
|
|
18
18
|
relativePath: string;
|
|
19
19
|
fileManagerName: string;
|
|
20
20
|
copyFileName: () => void;
|
|
21
21
|
copyStaticFilePath: () => void;
|
|
22
|
+
openAssetInConvert: () => void;
|
|
22
23
|
openAssetInExplorer: () => void;
|
|
23
24
|
renameAsset: () => void;
|
|
24
25
|
deleteAsset: () => void;
|
|
26
|
+
fileExplorerAvailable: boolean;
|
|
25
27
|
fileExplorerDisabled: boolean;
|
|
26
28
|
mutationsDisabled: boolean;
|
|
27
29
|
}) => ComboboxValue[];
|
|
@@ -39,13 +39,13 @@ const studio_protocol_1 = require("@remotion/studio-protocol");
|
|
|
39
39
|
const react_1 = require("react");
|
|
40
40
|
const remotion_1 = require("remotion");
|
|
41
41
|
const no_react_1 = require("remotion/no-react");
|
|
42
|
-
const delete_static_file_1 = require("../api/delete-static-file");
|
|
43
42
|
const browser_studio_operations_1 = require("../helpers/browser-studio-operations");
|
|
44
43
|
const client_id_1 = require("../helpers/client-id");
|
|
45
44
|
const colors_1 = require("../helpers/colors");
|
|
46
45
|
const copy_text_1 = require("../helpers/copy-text");
|
|
47
46
|
const get_file_manager_name_1 = require("../helpers/get-file-manager-name");
|
|
48
47
|
const get_preview_file_type_1 = require("../helpers/get-preview-file-type");
|
|
48
|
+
const open_in_remotion_convert_1 = require("../helpers/open-in-remotion-convert");
|
|
49
49
|
const sidebar_scroll_into_view_1 = require("../helpers/sidebar-scroll-into-view");
|
|
50
50
|
const url_state_1 = require("../helpers/url-state");
|
|
51
51
|
const use_asset_drag_events_1 = __importStar(require("../helpers/use-asset-drag-events"));
|
|
@@ -55,15 +55,14 @@ const clipboard_1 = require("../icons/clipboard");
|
|
|
55
55
|
const folder_1 = require("../icons/folder");
|
|
56
56
|
const modals_1 = require("../state/modals");
|
|
57
57
|
const AssetFileIcon_1 = require("./AssetFileIcon");
|
|
58
|
-
const ConfirmationDialog_1 = require("./ConfirmationDialog");
|
|
59
58
|
const ContextMenu_1 = require("./ContextMenu");
|
|
60
59
|
const import_assets_1 = require("./import-assets");
|
|
61
60
|
const InlineAction_1 = require("./InlineAction");
|
|
62
61
|
const layout_1 = require("./layout");
|
|
63
|
-
const styles_1 = require("./Menu/styles");
|
|
64
62
|
const NotificationCenter_1 = require("./Notifications/NotificationCenter");
|
|
65
63
|
const open_in_new_window_1 = require("./open-in-new-window");
|
|
66
64
|
const actions_1 = require("./RenderQueue/actions");
|
|
65
|
+
const use_delete_asset_1 = require("./use-delete-asset");
|
|
67
66
|
const iconStyle = {
|
|
68
67
|
width: 18,
|
|
69
68
|
height: 18,
|
|
@@ -117,9 +116,24 @@ const getCanDragAsset = ({ readOnlyStudio, relativePath, }) => {
|
|
|
117
116
|
return !readOnlyStudio && (0, import_assets_1.getAssetElementFromPath)(relativePath) !== null;
|
|
118
117
|
};
|
|
119
118
|
exports.getCanDragAsset = getCanDragAsset;
|
|
120
|
-
const getAssetContextMenuItems = ({ relativePath, fileManagerName, copyFileName, copyStaticFilePath, openAssetInExplorer, renameAsset, deleteAsset, fileExplorerDisabled, mutationsDisabled, }) => {
|
|
121
|
-
|
|
119
|
+
const getAssetContextMenuItems = ({ relativePath, fileManagerName, copyFileName, copyStaticFilePath, openAssetInConvert, openAssetInExplorer, renameAsset, deleteAsset, fileExplorerAvailable, fileExplorerDisabled, mutationsDisabled, }) => {
|
|
120
|
+
const previewFileType = (0, get_preview_file_type_1.getPreviewFileType)(relativePath);
|
|
121
|
+
const canOpenInConvert = previewFileType === 'audio' || previewFileType === 'video';
|
|
122
|
+
const items = [
|
|
122
123
|
(0, open_in_new_window_1.getOpenInNewWindowMenuItem)(`/assets/${relativePath}`),
|
|
124
|
+
canOpenInConvert
|
|
125
|
+
? {
|
|
126
|
+
id: 'open-asset-in-convert',
|
|
127
|
+
keyHint: null,
|
|
128
|
+
label: 'Open in Remotion Convert',
|
|
129
|
+
leftItem: null,
|
|
130
|
+
onClick: openAssetInConvert,
|
|
131
|
+
quickSwitcherLabel: 'Open asset in Remotion Convert',
|
|
132
|
+
subMenu: null,
|
|
133
|
+
type: 'item',
|
|
134
|
+
value: 'open-asset-in-convert',
|
|
135
|
+
}
|
|
136
|
+
: null,
|
|
123
137
|
{
|
|
124
138
|
type: 'divider',
|
|
125
139
|
id: 'open-in-new-window-divider',
|
|
@@ -150,18 +164,20 @@ const getAssetContextMenuItems = ({ relativePath, fileManagerName, copyFileName,
|
|
|
150
164
|
type: 'divider',
|
|
151
165
|
id: 'asset-file-actions-divider',
|
|
152
166
|
},
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
167
|
+
fileExplorerAvailable
|
|
168
|
+
? {
|
|
169
|
+
id: 'open-asset-in-explorer',
|
|
170
|
+
keyHint: null,
|
|
171
|
+
label: `Show in ${fileManagerName}`,
|
|
172
|
+
leftItem: null,
|
|
173
|
+
onClick: openAssetInExplorer,
|
|
174
|
+
quickSwitcherLabel: `Show asset in ${fileManagerName}`,
|
|
175
|
+
subMenu: null,
|
|
176
|
+
type: 'item',
|
|
177
|
+
value: 'open-asset-in-explorer',
|
|
178
|
+
disabled: fileExplorerDisabled,
|
|
179
|
+
}
|
|
180
|
+
: null,
|
|
165
181
|
{
|
|
166
182
|
id: 'rename-asset',
|
|
167
183
|
keyHint: null,
|
|
@@ -187,6 +203,7 @@ const getAssetContextMenuItems = ({ relativePath, fileManagerName, copyFileName,
|
|
|
187
203
|
disabled: mutationsDisabled,
|
|
188
204
|
},
|
|
189
205
|
];
|
|
206
|
+
return items.filter(no_react_1.NoReactInternals.truthy);
|
|
190
207
|
};
|
|
191
208
|
exports.getAssetContextMenuItems = getAssetContextMenuItems;
|
|
192
209
|
const AssetFolderItem = ({ tabIndex, item, level, parentFolder, toggleFolder, dropLocation, setDropLocation, readOnlyStudio, }) => {
|
|
@@ -260,7 +277,6 @@ const AssetSelectorItem = ({ item, tabIndex, level, parentFolder, readOnlyStudio
|
|
|
260
277
|
const [hovered, setHovered] = (0, react_1.useState)(false);
|
|
261
278
|
const [isDragging, setIsDragging] = (0, react_1.useState)(false);
|
|
262
279
|
const { setSelectedModal } = (0, react_1.useContext)(modals_1.SetSelectedModalContext);
|
|
263
|
-
const confirm = (0, ConfirmationDialog_1.useConfirmationDialog)();
|
|
264
280
|
const connectionStatus = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx)
|
|
265
281
|
.previewServerState.type;
|
|
266
282
|
const onPointerEnter = (0, react_1.useCallback)(() => {
|
|
@@ -376,6 +392,9 @@ const AssetSelectorItem = ({ item, tabIndex, level, parentFolder, readOnlyStudio
|
|
|
376
392
|
(0, NotificationCenter_1.showNotification)(`Could not copy: ${err.message}`, 2000);
|
|
377
393
|
});
|
|
378
394
|
}, [relativePath]);
|
|
395
|
+
const openAssetInConvert = (0, react_1.useCallback)(() => {
|
|
396
|
+
(0, open_in_remotion_convert_1.openInRemotionConvert)({ relativePath });
|
|
397
|
+
}, [relativePath]);
|
|
379
398
|
const openAssetInExplorer = (0, react_1.useCallback)(() => {
|
|
380
399
|
if (!window.remotion_publicFolderExists) {
|
|
381
400
|
(0, NotificationCenter_1.showNotification)('Could not find the public folder', 2000);
|
|
@@ -393,30 +412,7 @@ const AssetSelectorItem = ({ item, tabIndex, level, parentFolder, readOnlyStudio
|
|
|
393
412
|
connectionStatus,
|
|
394
413
|
publicFolderExists: window.remotion_publicFolderExists,
|
|
395
414
|
});
|
|
396
|
-
const deleteAsset = (0,
|
|
397
|
-
confirm({
|
|
398
|
-
title: 'Delete asset',
|
|
399
|
-
message: (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: ["Do you want to delete the asset", ' ', jsx_runtime_1.jsx("code", { style: styles_1.inlineCodeSnippet, children: relativePath }),
|
|
400
|
-
" from your public folder?"] })),
|
|
401
|
-
confirmLabel: 'Delete',
|
|
402
|
-
})
|
|
403
|
-
.then((confirmed) => {
|
|
404
|
-
if (!confirmed) {
|
|
405
|
-
return;
|
|
406
|
-
}
|
|
407
|
-
const notification = (0, NotificationCenter_1.showNotification)(`Deleting ${relativePath}...`, null);
|
|
408
|
-
(0, delete_static_file_1.deleteStaticFile)(relativePath)
|
|
409
|
-
.then(() => {
|
|
410
|
-
notification.replaceContent(`Deleted ${relativePath}`, 2000);
|
|
411
|
-
})
|
|
412
|
-
.catch((err) => {
|
|
413
|
-
notification.replaceContent(`Could not delete ${relativePath}: ${err.message}`, 3000);
|
|
414
|
-
});
|
|
415
|
-
})
|
|
416
|
-
.catch((err) => {
|
|
417
|
-
(0, NotificationCenter_1.showNotification)(`Could not delete ${relativePath}: ${err.message}`, 3000);
|
|
418
|
-
});
|
|
419
|
-
}, [confirm, relativePath]);
|
|
415
|
+
const deleteAsset = (0, use_delete_asset_1.useDeleteAsset)(relativePath);
|
|
420
416
|
const renameAsset = (0, react_1.useCallback)(() => {
|
|
421
417
|
setSelectedModal({
|
|
422
418
|
type: 'rename-static-file',
|
|
@@ -429,9 +425,11 @@ const AssetSelectorItem = ({ item, tabIndex, level, parentFolder, readOnlyStudio
|
|
|
429
425
|
fileManagerName,
|
|
430
426
|
copyFileName,
|
|
431
427
|
copyStaticFilePath,
|
|
428
|
+
openAssetInConvert,
|
|
432
429
|
openAssetInExplorer,
|
|
433
430
|
renameAsset,
|
|
434
431
|
deleteAsset,
|
|
432
|
+
fileExplorerAvailable: (0, browser_studio_operations_1.getBrowserStudioOperations)() === null,
|
|
435
433
|
fileExplorerDisabled,
|
|
436
434
|
mutationsDisabled,
|
|
437
435
|
});
|
|
@@ -442,6 +440,7 @@ const AssetSelectorItem = ({ item, tabIndex, level, parentFolder, readOnlyStudio
|
|
|
442
440
|
fileExplorerDisabled,
|
|
443
441
|
fileManagerName,
|
|
444
442
|
mutationsDisabled,
|
|
443
|
+
openAssetInConvert,
|
|
445
444
|
openAssetInExplorer,
|
|
446
445
|
renameAsset,
|
|
447
446
|
relativePath,
|
|
@@ -41,19 +41,6 @@ const remotion_1 = require("remotion");
|
|
|
41
41
|
const colors_1 = require("../helpers/colors");
|
|
42
42
|
const timeline_layout_1 = require("../helpers/timeline-layout");
|
|
43
43
|
const EMPTY_PEAKS = new Float32Array(0);
|
|
44
|
-
// Recreate the canvas after Fast Refresh because an already transferred canvas
|
|
45
|
-
// cannot be handed to OffscreenCanvas again.
|
|
46
|
-
const canRetryCanvasTransfer = (err) => {
|
|
47
|
-
return err instanceof DOMException && err.name === 'InvalidStateError';
|
|
48
|
-
};
|
|
49
|
-
const canUseAudioWaveformWorker = () => {
|
|
50
|
-
if (typeof Worker === 'undefined' ||
|
|
51
|
-
typeof OffscreenCanvas === 'undefined' ||
|
|
52
|
-
typeof HTMLCanvasElement === 'undefined') {
|
|
53
|
-
return false;
|
|
54
|
-
}
|
|
55
|
-
return 'transferControlToOffscreen' in HTMLCanvasElement.prototype;
|
|
56
|
-
};
|
|
57
44
|
const getContainerStyle = (height) => {
|
|
58
45
|
return {
|
|
59
46
|
display: 'flex',
|
|
@@ -64,9 +51,6 @@ const getContainerStyle = (height) => {
|
|
|
64
51
|
height,
|
|
65
52
|
};
|
|
66
53
|
};
|
|
67
|
-
const getWaveformErrorMessage = () => {
|
|
68
|
-
return new Error('No waveform available. The audio could not be decoded or may not support CORS.');
|
|
69
|
-
};
|
|
70
54
|
const waveformCanvasStyle = {
|
|
71
55
|
pointerEvents: 'none',
|
|
72
56
|
width: '100%',
|
|
@@ -86,17 +70,12 @@ const parseVolume = (volume) => {
|
|
|
86
70
|
const AudioWaveformInner = ({ src, height, startFrom, durationInFrames, displayOffsetInFrames, displayDurationInFrames, visualizationWidth, volume, doesVolumeChange, muted, playbackRate, loopDisplay, }) => {
|
|
87
71
|
const [peaks, setPeaks] = (0, react_1.useState)(null);
|
|
88
72
|
const [error, setError] = (0, react_1.useState)(null);
|
|
89
|
-
const [waveformCanvasKey, setWaveformCanvasKey] = (0, react_1.useState)(0);
|
|
90
|
-
const canUseWorkerPath = (0, react_1.useMemo)(() => canUseAudioWaveformWorker(), []);
|
|
91
73
|
const vidConf = remotion_1.Internals.useUnsafeVideoConfig();
|
|
92
74
|
if (vidConf === null) {
|
|
93
75
|
throw new Error('Expected video config');
|
|
94
76
|
}
|
|
95
77
|
const waveformCanvas = (0, react_1.useRef)(null);
|
|
96
78
|
const volumeCanvas = (0, react_1.useRef)(null);
|
|
97
|
-
const waveformWorker = (0, react_1.useRef)(null);
|
|
98
|
-
const hasTransferredCanvas = (0, react_1.useRef)(false);
|
|
99
|
-
const latestRequestId = (0, react_1.useRef)(0);
|
|
100
79
|
const shouldRenderVolumeOverlay = doesVolumeChange && typeof volume === 'string';
|
|
101
80
|
const parsedVolume = (0, react_1.useMemo)(() => parseVolume(volume), [volume]);
|
|
102
81
|
const visibleVolume = (0, react_1.useMemo)(() => {
|
|
@@ -116,82 +95,19 @@ const AudioWaveformInner = ({ src, height, startFrom, durationInFrames, displayO
|
|
|
116
95
|
muted,
|
|
117
96
|
parsedVolume,
|
|
118
97
|
]);
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
}
|
|
123
|
-
const controller = new AbortController();
|
|
98
|
+
// Layout effect so that a cache hit sets the peaks synchronously and the
|
|
99
|
+
// waveform is painted on the very first frame after mounting.
|
|
100
|
+
(0, react_1.useLayoutEffect)(() => {
|
|
124
101
|
setPeaks(null);
|
|
125
102
|
setError(null);
|
|
126
|
-
(0, timeline_utils_1.
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
}
|
|
131
|
-
})
|
|
132
|
-
.catch((err) => {
|
|
133
|
-
if (!controller.signal.aborted) {
|
|
134
|
-
setError(err);
|
|
135
|
-
}
|
|
103
|
+
return (0, timeline_utils_1.subscribeToWaveformPeaks)({
|
|
104
|
+
src,
|
|
105
|
+
onPeaks: (p) => setPeaks(p),
|
|
106
|
+
onError: (err) => setError(err),
|
|
136
107
|
});
|
|
137
|
-
|
|
138
|
-
}, [canUseWorkerPath, src]);
|
|
139
|
-
(0, react_1.useEffect)(() => {
|
|
140
|
-
if (!canUseWorkerPath) {
|
|
141
|
-
return;
|
|
142
|
-
}
|
|
143
|
-
const canvasElement = waveformCanvas.current;
|
|
144
|
-
if (!canvasElement || hasTransferredCanvas.current) {
|
|
145
|
-
return;
|
|
146
|
-
}
|
|
147
|
-
const worker = (0, timeline_utils_1.makeAudioWaveformWorker)();
|
|
148
|
-
let workerFailed = false;
|
|
149
|
-
waveformWorker.current = worker;
|
|
150
|
-
worker.addEventListener('message', (event) => {
|
|
151
|
-
if (event.data.type === 'error') {
|
|
152
|
-
if (event.data.requestId !== latestRequestId.current) {
|
|
153
|
-
return;
|
|
154
|
-
}
|
|
155
|
-
setError(new Error(event.data.message));
|
|
156
|
-
}
|
|
157
|
-
});
|
|
158
|
-
worker.addEventListener('error', (event) => {
|
|
159
|
-
event.preventDefault();
|
|
160
|
-
workerFailed = true;
|
|
161
|
-
if (worker !== waveformWorker.current) {
|
|
162
|
-
return;
|
|
163
|
-
}
|
|
164
|
-
worker.terminate();
|
|
165
|
-
waveformWorker.current = null;
|
|
166
|
-
hasTransferredCanvas.current = false;
|
|
167
|
-
setError(getWaveformErrorMessage());
|
|
168
|
-
});
|
|
169
|
-
let offscreen;
|
|
170
|
-
try {
|
|
171
|
-
offscreen = canvasElement.transferControlToOffscreen();
|
|
172
|
-
}
|
|
173
|
-
catch (err) {
|
|
174
|
-
worker.terminate();
|
|
175
|
-
waveformWorker.current = null;
|
|
176
|
-
if (canRetryCanvasTransfer(err)) {
|
|
177
|
-
setWaveformCanvasKey((key) => key + 1);
|
|
178
|
-
return;
|
|
179
|
-
}
|
|
180
|
-
throw err;
|
|
181
|
-
}
|
|
182
|
-
hasTransferredCanvas.current = true;
|
|
183
|
-
worker.postMessage({ type: 'init', canvas: offscreen }, [offscreen]);
|
|
184
|
-
return () => {
|
|
185
|
-
if (!workerFailed) {
|
|
186
|
-
worker.postMessage({ type: 'dispose' });
|
|
187
|
-
}
|
|
188
|
-
worker.terminate();
|
|
189
|
-
waveformWorker.current = null;
|
|
190
|
-
hasTransferredCanvas.current = false;
|
|
191
|
-
};
|
|
192
|
-
}, [canUseWorkerPath, waveformCanvasKey]);
|
|
108
|
+
}, [src]);
|
|
193
109
|
const portionPeaks = (0, react_1.useMemo)(() => {
|
|
194
|
-
if (
|
|
110
|
+
if (!peaks) {
|
|
195
111
|
return null;
|
|
196
112
|
}
|
|
197
113
|
return (0, timeline_utils_1.sliceVisibleWaveformPeaks)({
|
|
@@ -205,7 +121,6 @@ const AudioWaveformInner = ({ src, height, startFrom, durationInFrames, displayO
|
|
|
205
121
|
startFrom,
|
|
206
122
|
});
|
|
207
123
|
}, [
|
|
208
|
-
canUseWorkerPath,
|
|
209
124
|
displayDurationInFrames,
|
|
210
125
|
displayOffsetInFrames,
|
|
211
126
|
durationInFrames,
|
|
@@ -215,7 +130,10 @@ const AudioWaveformInner = ({ src, height, startFrom, durationInFrames, displayO
|
|
|
215
130
|
startFrom,
|
|
216
131
|
vidConf.fps,
|
|
217
132
|
]);
|
|
218
|
-
|
|
133
|
+
// Drawing must happen in a layout effect: when the timeline zooms, the
|
|
134
|
+
// canvas CSS box resizes in the same commit, and painting the bitmap
|
|
135
|
+
// before the browser paints avoids showing a stretched stale waveform.
|
|
136
|
+
(0, react_1.useLayoutEffect)(() => {
|
|
219
137
|
const { current: canvasElement } = waveformCanvas;
|
|
220
138
|
if (!canvasElement) {
|
|
221
139
|
return;
|
|
@@ -223,31 +141,6 @@ const AudioWaveformInner = ({ src, height, startFrom, durationInFrames, displayO
|
|
|
223
141
|
const pixelRatio = window.devicePixelRatio;
|
|
224
142
|
const h = Math.ceil(height * pixelRatio);
|
|
225
143
|
const w = Math.ceil(visualizationWidth * pixelRatio);
|
|
226
|
-
if (canUseWorkerPath) {
|
|
227
|
-
const worker = waveformWorker.current;
|
|
228
|
-
if (!worker || !hasTransferredCanvas.current) {
|
|
229
|
-
return;
|
|
230
|
-
}
|
|
231
|
-
latestRequestId.current += 1;
|
|
232
|
-
setError(null);
|
|
233
|
-
const message = {
|
|
234
|
-
type: 'render',
|
|
235
|
-
requestId: latestRequestId.current,
|
|
236
|
-
src,
|
|
237
|
-
width: w,
|
|
238
|
-
height: h,
|
|
239
|
-
volume: visibleVolume,
|
|
240
|
-
startFrom,
|
|
241
|
-
durationInFrames,
|
|
242
|
-
displayOffsetInFrames,
|
|
243
|
-
displayDurationInFrames,
|
|
244
|
-
fps: vidConf.fps,
|
|
245
|
-
playbackRate,
|
|
246
|
-
loopDisplay,
|
|
247
|
-
};
|
|
248
|
-
worker.postMessage(message);
|
|
249
|
-
return;
|
|
250
|
-
}
|
|
251
144
|
canvasElement.width = w;
|
|
252
145
|
canvasElement.height = h;
|
|
253
146
|
(0, timeline_utils_1.drawBars)({
|
|
@@ -257,23 +150,8 @@ const AudioWaveformInner = ({ src, height, startFrom, durationInFrames, displayO
|
|
|
257
150
|
volume: visibleVolume,
|
|
258
151
|
width: w,
|
|
259
152
|
});
|
|
260
|
-
}, [
|
|
261
|
-
|
|
262
|
-
displayDurationInFrames,
|
|
263
|
-
displayOffsetInFrames,
|
|
264
|
-
durationInFrames,
|
|
265
|
-
height,
|
|
266
|
-
loopDisplay,
|
|
267
|
-
playbackRate,
|
|
268
|
-
portionPeaks,
|
|
269
|
-
src,
|
|
270
|
-
startFrom,
|
|
271
|
-
vidConf.fps,
|
|
272
|
-
visualizationWidth,
|
|
273
|
-
visibleVolume,
|
|
274
|
-
waveformCanvasKey,
|
|
275
|
-
]);
|
|
276
|
-
(0, react_1.useEffect)(() => {
|
|
153
|
+
}, [height, portionPeaks, visibleVolume, visualizationWidth]);
|
|
154
|
+
(0, react_1.useLayoutEffect)(() => {
|
|
277
155
|
if (!shouldRenderVolumeOverlay) {
|
|
278
156
|
return;
|
|
279
157
|
}
|
|
@@ -315,10 +193,10 @@ const AudioWaveformInner = ({ src, height, startFrom, durationInFrames, displayO
|
|
|
315
193
|
if (error) {
|
|
316
194
|
return null;
|
|
317
195
|
}
|
|
318
|
-
if (!
|
|
196
|
+
if (!peaks) {
|
|
319
197
|
return null;
|
|
320
198
|
}
|
|
321
199
|
return (jsx_runtime_1.jsxs("div", { style: getContainerStyle(height), children: [
|
|
322
|
-
jsx_runtime_1.jsx("canvas", { ref: waveformCanvas, style: waveformCanvasStyle }
|
|
200
|
+
jsx_runtime_1.jsx("canvas", { ref: waveformCanvas, style: waveformCanvasStyle }), shouldRenderVolumeOverlay ? (jsx_runtime_1.jsx("canvas", { ref: volumeCanvas, style: volumeCanvasStyle })) : null] }));
|
|
323
201
|
};
|
|
324
202
|
exports.AudioWaveform = react_1.default.memo(AudioWaveformInner);
|
|
@@ -846,14 +846,16 @@ const Canvas = ({ canvasContent, size }) => {
|
|
|
846
846
|
if (!(0, drop_handler_data_1.isSupportedDropEvent)(event) || !isDragEventInsideCanvas(event)) {
|
|
847
847
|
return;
|
|
848
848
|
}
|
|
849
|
-
|
|
849
|
+
const localFiles = (0, drop_handler_data_1.isFileDragEvent)(event)
|
|
850
|
+
? Array.from((_c = (_a = event.dataTransfer) === null || _a === void 0 ? void 0 : _a.files) !== null && _c !== void 0 ? _c : [])
|
|
851
|
+
: null;
|
|
852
|
+
if (localFiles !== null && !window.remotion_isReadOnlyStudio) {
|
|
850
853
|
event.preventDefault();
|
|
851
854
|
event.stopPropagation();
|
|
852
|
-
|
|
853
|
-
if (files.length === 1) {
|
|
855
|
+
if (localFiles.length === 1) {
|
|
854
856
|
setIsAddingAsset(true);
|
|
855
857
|
try {
|
|
856
|
-
const canvasCapture = await (0, get_canvas_capture_import_1.getCanvasCaptureImport)(
|
|
858
|
+
const canvasCapture = await (0, get_canvas_capture_import_1.getCanvasCaptureImport)(localFiles[0]);
|
|
857
859
|
if (canvasCapture !== null) {
|
|
858
860
|
setSelectedModal({
|
|
859
861
|
type: 'new-comp',
|
|
@@ -936,6 +938,7 @@ const Canvas = ({ canvasContent, size }) => {
|
|
|
936
938
|
event,
|
|
937
939
|
fps: config.fps,
|
|
938
940
|
from: (0, imperative_state_1.getCurrentFrame)(),
|
|
941
|
+
localFiles,
|
|
939
942
|
preferCompositionStart: true,
|
|
940
943
|
});
|
|
941
944
|
}
|
|
@@ -2,9 +2,11 @@ import type { Caption } from '@remotion/captions';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
export declare const CaptionInspector: React.FC<{
|
|
4
4
|
readonly captions: Caption[];
|
|
5
|
+
readonly expanded: boolean;
|
|
5
6
|
readonly onTextChange: (captions: Caption[]) => void;
|
|
6
7
|
readonly onTextSave: ((captions: Caption[]) => void) | null;
|
|
7
8
|
readonly onTextCancel: (() => void) | null;
|
|
9
|
+
readonly onToggle: () => void;
|
|
8
10
|
readonly readOnly: boolean;
|
|
9
11
|
readonly readOnlyTitle: string | null;
|
|
10
12
|
}>;
|
|
@@ -4,6 +4,7 @@ exports.CaptionInspector = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const colors_1 = require("../helpers/colors");
|
|
6
6
|
const CaptionTextEditor_1 = require("./CaptionTextEditor");
|
|
7
|
+
const CollapsibleInspectorSectionHeader_1 = require("./InspectorPanel/CollapsibleInspectorSectionHeader");
|
|
7
8
|
const common_1 = require("./InspectorPanel/common");
|
|
8
9
|
const styles_1 = require("./InspectorPanel/styles");
|
|
9
10
|
const readOnlyStatus = {
|
|
@@ -14,11 +15,8 @@ const readOnlyStatus = {
|
|
|
14
15
|
lineHeight: '16px',
|
|
15
16
|
marginLeft: 12,
|
|
16
17
|
};
|
|
17
|
-
const CaptionInspector = ({ captions, onTextChange, onTextSave, onTextCancel, readOnly, readOnlyTitle, }) => {
|
|
18
|
+
const CaptionInspector = ({ captions, expanded, onTextChange, onTextSave, onTextCancel, onToggle, readOnly, readOnlyTitle, }) => {
|
|
18
19
|
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
19
|
-
jsx_runtime_1.jsx(common_1.InspectorSectionDivider, {}), jsx_runtime_1.jsx(common_1.InspectorSectionHeader, { children: jsx_runtime_1.
|
|
20
|
-
jsx_runtime_1.jsx("div", { style: styles_1.sectionHeaderTitle, children: "Captions" }), jsx_runtime_1.jsx("div", { style: styles_1.sectionHeaderEnd, children: readOnly ? (jsx_runtime_1.jsx("div", { style: readOnlyStatus, title: readOnlyTitle !== null && readOnlyTitle !== void 0 ? readOnlyTitle : undefined, children: "Read only" })) : null })
|
|
21
|
-
] }) }), jsx_runtime_1.jsx(CaptionTextEditor_1.CaptionTextEditor, { captions: captions, onChange: onTextChange, onSave: onTextSave, onCancel: onTextCancel, readOnly: readOnly })
|
|
22
|
-
] }));
|
|
20
|
+
jsx_runtime_1.jsx(common_1.InspectorSectionDivider, {}), jsx_runtime_1.jsx(common_1.InspectorSectionHeader, { children: jsx_runtime_1.jsx(CollapsibleInspectorSectionHeader_1.CollapsibleInspectorSectionHeader, { action: jsx_runtime_1.jsx("div", { style: styles_1.sectionHeaderEnd, children: readOnly ? (jsx_runtime_1.jsx("div", { style: readOnlyStatus, title: readOnlyTitle !== null && readOnlyTitle !== void 0 ? readOnlyTitle : undefined, children: "Read only" })) : null }), expanded: expanded, label: "Captions", onToggle: onToggle }) }), expanded ? (jsx_runtime_1.jsx(CaptionTextEditor_1.CaptionTextEditor, { captions: captions, onChange: onTextChange, onSave: onTextSave, onCancel: onTextCancel, readOnly: readOnly })) : null] }));
|
|
23
21
|
};
|
|
24
22
|
exports.CaptionInspector = CaptionInspector;
|
|
@@ -227,9 +227,12 @@ const CompositionSelector = () => {
|
|
|
227
227
|
signal: controller.signal,
|
|
228
228
|
symbolicatedStack: (0, studio_shared_1.compositionDragDataToSymbolicatedStack)(compositionDragData),
|
|
229
229
|
});
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
230
|
+
if (result.success) {
|
|
231
|
+
notification.dismiss();
|
|
232
|
+
}
|
|
233
|
+
else {
|
|
234
|
+
notification.replaceContent(result.reason, 4000);
|
|
235
|
+
}
|
|
233
236
|
}
|
|
234
237
|
catch (err) {
|
|
235
238
|
notification.replaceContent(err instanceof Error ? err.message : String(err), 4000);
|
|
@@ -7,7 +7,6 @@ const studio_shared_1 = require("@remotion/studio-shared");
|
|
|
7
7
|
const react_1 = require("react");
|
|
8
8
|
const client_id_1 = require("../helpers/client-id");
|
|
9
9
|
const colors_1 = require("../helpers/colors");
|
|
10
|
-
const get_folder_id_1 = require("../helpers/get-folder-id");
|
|
11
10
|
const noop_1 = require("../helpers/noop");
|
|
12
11
|
const sidebar_scroll_into_view_1 = require("../helpers/sidebar-scroll-into-view");
|
|
13
12
|
const folder_1 = require("../icons/folder");
|
|
@@ -33,11 +32,12 @@ const itemStyle = {
|
|
|
33
32
|
cursor: 'default',
|
|
34
33
|
alignItems: 'center',
|
|
35
34
|
marginBottom: 1,
|
|
36
|
-
marginLeft:
|
|
35
|
+
marginLeft: 8,
|
|
36
|
+
marginRight: 4,
|
|
37
37
|
appearance: 'none',
|
|
38
38
|
border: 'none',
|
|
39
39
|
borderRadius: 4,
|
|
40
|
-
width: 'calc(100% -
|
|
40
|
+
width: 'calc(100% - 12px)',
|
|
41
41
|
textAlign: 'left',
|
|
42
42
|
backgroundColor: colors_1.BACKGROUND,
|
|
43
43
|
height: layout_1.COMPACT_CONTROL_ROW_HEIGHT,
|
|
@@ -223,10 +223,6 @@ const CompositionSelectorItem = ({ item, level, currentComposition, tabIndex, se
|
|
|
223
223
|
if (isAlreadyDirectChild) {
|
|
224
224
|
return;
|
|
225
225
|
}
|
|
226
|
-
const folderId = (0, get_folder_id_1.getFolderId)({
|
|
227
|
-
folderName: item.folderName,
|
|
228
|
-
parentName: item.parentName,
|
|
229
|
-
});
|
|
230
226
|
const notification = (0, NotificationCenter_1.showNotification)(`Moving ${compositionDragData.compositionId}...`, null);
|
|
231
227
|
const controller = new AbortController();
|
|
232
228
|
try {
|
|
@@ -241,9 +237,12 @@ const CompositionSelectorItem = ({ item, level, currentComposition, tabIndex, se
|
|
|
241
237
|
signal: controller.signal,
|
|
242
238
|
symbolicatedStack: (0, studio_shared_1.compositionDragDataToSymbolicatedStack)(compositionDragData),
|
|
243
239
|
});
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
240
|
+
if (result.success) {
|
|
241
|
+
notification.dismiss();
|
|
242
|
+
}
|
|
243
|
+
else {
|
|
244
|
+
notification.replaceContent(result.reason, 4000);
|
|
245
|
+
}
|
|
247
246
|
if (result.success && !item.expanded) {
|
|
248
247
|
toggleFolder(item.folderName, item.parentName);
|
|
249
248
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const booleanOptions: readonly [{
|
|
2
|
+
readonly label: "Enabled";
|
|
3
|
+
readonly value: true;
|
|
4
|
+
}, {
|
|
5
|
+
readonly label: "Disabled";
|
|
6
|
+
readonly value: false;
|
|
7
|
+
}];
|
|
8
|
+
export declare const ConfigSelect: <T extends string | boolean>({ defaultLabel, name, onChange, options, value, }: {
|
|
9
|
+
readonly defaultLabel: string;
|
|
10
|
+
readonly name: string;
|
|
11
|
+
readonly onChange: (value: T | null) => void;
|
|
12
|
+
readonly options: readonly {
|
|
13
|
+
label: string;
|
|
14
|
+
value: T;
|
|
15
|
+
}[];
|
|
16
|
+
readonly value: T | null;
|
|
17
|
+
}) => import("react/jsx-runtime").JSX.Element;
|