@remotion/studio 4.0.500 → 4.0.502
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/Studio.js +1 -1
- package/dist/api/delete-static-file.js +8 -3
- package/dist/api/rename-static-file.js +8 -0
- package/dist/api/watch-public-folder.js +2 -1
- package/dist/api/watch-static-file.js +2 -1
- package/dist/api/write-static-file.js +8 -3
- package/dist/components/AssetSelector.js +3 -1
- package/dist/components/AssetSelectorItem.d.ts +2 -1
- package/dist/components/AssetSelectorItem.js +7 -4
- package/dist/components/Canvas.js +9 -4
- package/dist/components/CaptionInspector.d.ts +10 -0
- package/dist/components/CaptionInspector.js +24 -0
- package/dist/components/CaptionTextEditor.d.ts +9 -0
- package/dist/components/CaptionTextEditor.js +132 -0
- package/dist/components/CompositionSelector.js +4 -4
- package/dist/components/CompositionSelectorItem.js +5 -5
- package/dist/components/CurrentAsset.js +3 -2
- package/dist/components/EditorContent.js +1 -1
- package/dist/components/EditorContexts.d.ts +0 -1
- package/dist/components/EditorContexts.js +2 -2
- package/dist/components/FpsCounter.js +3 -3
- package/dist/components/FullscreenToggle.d.ts +3 -1
- package/dist/components/FullscreenToggle.js +3 -2
- package/dist/components/GlobalKeybindings.js +2 -0
- package/dist/components/InitialCompositionLoader.d.ts +1 -1
- package/dist/components/InlineAction.js +2 -1
- package/dist/components/InlineCaptionInspector.d.ts +11 -0
- package/dist/components/InlineCaptionInspector.js +108 -0
- package/dist/components/InspectorPanel/CompositionInspector.js +5 -3
- package/dist/components/InspectorPanel/SelectedInspector.d.ts +1 -0
- package/dist/components/InspectorPanel/SelectedInspector.js +2 -2
- package/dist/components/InspectorPanel/SequenceSelectionInspector.d.ts +1 -0
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +4 -4
- package/dist/components/InspectorPanel/inspector-section-collapse.d.ts +22 -0
- package/dist/components/InspectorPanel/inspector-section-collapse.js +165 -0
- package/dist/components/InspectorPanel/styles.js +7 -1
- package/dist/components/InspectorPanel/use-composition-actions.d.ts +4 -1
- package/dist/components/InspectorPanel/use-composition-actions.js +135 -7
- package/dist/components/InspectorPanel.js +2 -2
- package/dist/components/InspectorSequenceSection.d.ts +2 -1
- package/dist/components/InspectorSequenceSection.js +238 -8
- package/dist/components/LoopToggle.d.ts +1 -0
- package/dist/components/LoopToggle.js +9 -5
- package/dist/components/Menu/MenuSubItem.js +9 -1
- package/dist/components/MenuToolbar.js +8 -1
- package/dist/components/Modals.js +1 -1
- package/dist/components/ObserveDefaultPropsContext.js +7 -4
- package/dist/components/PlayPause.d.ts +1 -0
- package/dist/components/PlayPause.js +2 -4
- package/dist/components/PlaybackRateSelector.d.ts +9 -2
- package/dist/components/PlaybackRateSelector.js +21 -10
- package/dist/components/PreviewToolbar.js +19 -109
- package/dist/components/PreviewToolbarOverflowButton.d.ts +12 -0
- package/dist/components/PreviewToolbarOverflowButton.js +217 -0
- package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +1 -0
- package/dist/components/QuickSwitcher/QuickSwitcher.d.ts +6 -0
- package/dist/components/QuickSwitcher/QuickSwitcher.js +2 -2
- package/dist/components/QuickSwitcher/QuickSwitcherContent.d.ts +6 -0
- package/dist/components/QuickSwitcher/QuickSwitcherContent.js +42 -9
- package/dist/components/QuickSwitcher/QuickSwitcherResult.d.ts +2 -0
- package/dist/components/QuickSwitcher/QuickSwitcherResult.js +7 -1
- package/dist/components/RenderButton.d.ts +1 -0
- package/dist/components/RenderButton.js +6 -4
- package/dist/components/RenderQueue/ClientRenderQueueProcessor.d.ts +0 -1
- package/dist/components/RenderQueue/ClientRenderQueueProcessor.js +3 -14
- package/dist/components/RenderQueue/RenderQueueDownloadItem.js +2 -2
- package/dist/components/SelectedOutlineElement.js +1 -4
- package/dist/components/SelectedOutlineOverlay.js +17 -8
- package/dist/components/ShowOutlinesProvider.js +4 -1
- package/dist/components/SizeSelector.d.ts +6 -0
- package/dist/components/SizeSelector.js +17 -8
- package/dist/components/Splitter/SplitterContainer.d.ts +1 -0
- package/dist/components/Splitter/SplitterContainer.js +23 -3
- package/dist/components/Splitter/SplitterContext.d.ts +14 -0
- package/dist/components/Splitter/SplitterContext.js +16 -1
- package/dist/components/Splitter/SplitterHandle.js +8 -6
- package/dist/components/Timeline/Timeline.js +21 -6
- package/dist/components/Timeline/TimelineAssetField.d.ts +1 -1
- package/dist/components/Timeline/TimelineAssetField.js +37 -1
- package/dist/components/Timeline/TimelineDragHandler.js +1 -1
- package/dist/components/Timeline/TimelineExpandedKeyframeRow.js +8 -2
- package/dist/components/Timeline/TimelinePrimitiveFieldValue.d.ts +7 -2
- package/dist/components/Timeline/TimelinePrimitiveFieldValue.js +3 -1
- package/dist/components/Timeline/TimelineRowChrome.d.ts +3 -0
- package/dist/components/Timeline/TimelineRowChrome.js +4 -3
- package/dist/components/Timeline/TimelineSelection.d.ts +4 -2
- package/dist/components/Timeline/TimelineSelection.js +9 -6
- package/dist/components/Timeline/TimelineSequence.js +1 -4
- package/dist/components/Timeline/TimelineSequenceItem.js +4 -5
- package/dist/components/Timeline/TimelineSequencePropItem.js +9 -10
- package/dist/components/Timeline/TimelineStack/get-stack.js +8 -0
- package/dist/components/Timeline/TimelineTrack.js +4 -2
- package/dist/components/Timeline/border-radius-representation.d.ts +16 -0
- package/dist/components/Timeline/border-radius-representation.js +60 -0
- package/dist/components/Timeline/delete-selected-timeline-item.js +1 -6
- package/dist/components/Timeline/get-sequence-prop-reset-changes.d.ts +10 -0
- package/dist/components/Timeline/get-sequence-prop-reset-changes.js +33 -0
- package/dist/components/Timeline/reset-selected-timeline-props.js +2 -8
- package/dist/components/Timeline/save-sequence-prop.d.ts +12 -1
- package/dist/components/Timeline/save-sequence-prop.js +28 -4
- package/dist/components/Timeline/sequence-props-subscription-store.d.ts +2 -2
- package/dist/components/Timeline/sequence-props-subscription-store.js +3 -3
- package/dist/components/Timeline/timeline-field-display-utils.js +1 -0
- package/dist/components/Timeline/use-timeline-asset-drop.js +4 -0
- package/dist/components/TopPanel.js +1 -1
- package/dist/components/UndoRedoButtons.js +15 -6
- package/dist/components/UpdateCheck.js +11 -4
- package/dist/components/default-props-api.d.ts +3 -0
- package/dist/components/default-props-api.js +19 -0
- package/dist/components/drop-handler-data.d.ts +1 -1
- package/dist/components/drop-handler-data.js +6 -6
- package/dist/components/effect-drag-and-drop.d.ts +1 -1
- package/dist/components/effect-drag-and-drop.js +3 -3
- package/dist/components/element-drag-and-drop.d.ts +1 -1
- package/dist/components/element-drag-and-drop.js +3 -3
- package/dist/components/handle-drop.d.ts +3 -2
- package/dist/components/handle-drop.js +2 -1
- package/dist/components/import-assets.d.ts +8 -6
- package/dist/components/import-assets.js +20 -7
- package/dist/components/sequence-props-api.d.ts +4 -0
- package/dist/components/sequence-props-api.js +26 -0
- package/dist/components/use-element-overwrite-confirmation.d.ts +2 -0
- package/dist/components/use-element-overwrite-confirmation.js +73 -0
- package/dist/components/use-static-files.js +7 -2
- package/dist/error-overlay/react-overlay/effects/resolve-file-source.js +13 -2
- package/dist/error-overlay/remotion-overlay/ErrorDisplay.d.ts +1 -0
- package/dist/error-overlay/remotion-overlay/ErrorDisplay.js +29 -5
- package/dist/error-overlay/remotion-overlay/ErrorLoader.js +4 -20
- package/dist/esm/{chunk-dr1y1vm3.js → chunk-fjv75ty4.js} +8478 -6609
- package/dist/esm/index.mjs +24 -8
- package/dist/esm/internals.mjs +8478 -6609
- package/dist/esm/previewEntry.mjs +8535 -6666
- package/dist/esm/renderEntry.mjs +1 -1
- package/dist/helpers/browser-studio-operations.d.ts +3 -0
- package/dist/helpers/browser-studio-operations.js +14 -0
- package/dist/helpers/client-id.d.ts +0 -1
- package/dist/helpers/client-id.js +15 -10
- package/dist/helpers/download-blob.d.ts +1 -0
- package/dist/helpers/download-blob.js +15 -0
- package/dist/helpers/inject-css.js +5 -3
- package/dist/helpers/open-in-editor.js +26 -5
- package/dist/helpers/preview-server-events.js +46 -9
- package/dist/helpers/use-create-composition.js +8 -6
- package/dist/helpers/use-menu-structure.js +29 -0
- package/dist/hot-middleware-client/client.js +3 -3
- package/dist/icons/border-radius.d.ts +4 -0
- package/dist/icons/border-radius.js +8 -0
- package/dist/icons/fullscreen.d.ts +4 -0
- package/dist/icons/fullscreen.js +6 -0
- package/dist/icons/upload.d.ts +4 -0
- package/dist/icons/upload.js +8 -0
- package/dist/previewEntry.js +1 -1
- package/dist/state/modals.d.ts +5 -0
- package/dist/state/timeline-sequence-hover.d.ts +17 -0
- package/dist/state/timeline-sequence-hover.js +33 -0
- package/package.json +13 -12
package/dist/Studio.js
CHANGED
|
@@ -17,7 +17,7 @@ const getServerDisconnectedDomElement = () => {
|
|
|
17
17
|
};
|
|
18
18
|
const StudioInner = ({ rootComponent, readOnly }) => {
|
|
19
19
|
var _a, _b;
|
|
20
|
-
return (jsx_runtime_1.jsx(remotion_1.Internals.CompositionManagerProvider, { onlyRenderComposition: null, currentCompositionMetadata: null, initialCompositions: [], initialCanvasContent: null, children: jsx_runtime_1.jsx(remotion_1.Internals.RemotionRootContexts, { frameState: null, audioEnabled: window.remotion_audioEnabled, videoEnabled: window.remotion_videoEnabled, logLevel: (_a = window.remotion_logLevel) !== null && _a !== void 0 ? _a : 'info', numberOfAudioTags: window.remotion_numberOfAudioTags, audioLatencyHint: (_b = window.remotion_audioLatencyHint) !== null && _b !== void 0 ? _b : 'playback', previewSampleRate: window.remotion_previewSampleRate, children: jsx_runtime_1.jsx(use_static_files_1.StaticFilesProvider, { children: jsx_runtime_1.jsx(ResolveCompositionConfigInStudio_1.ResolveCompositionConfigInStudio, { children: jsx_runtime_1.jsxs(EditorContexts_1.EditorContexts, {
|
|
20
|
+
return (jsx_runtime_1.jsx(remotion_1.Internals.CompositionManagerProvider, { onlyRenderComposition: null, currentCompositionMetadata: null, initialCompositions: [], initialCanvasContent: null, children: jsx_runtime_1.jsx(remotion_1.Internals.RemotionRootContexts, { frameState: null, audioEnabled: window.remotion_audioEnabled, videoEnabled: window.remotion_videoEnabled, logLevel: (_a = window.remotion_logLevel) !== null && _a !== void 0 ? _a : 'info', numberOfAudioTags: window.remotion_numberOfAudioTags, audioLatencyHint: (_b = window.remotion_audioLatencyHint) !== null && _b !== void 0 ? _b : 'playback', previewSampleRate: window.remotion_previewSampleRate, children: jsx_runtime_1.jsx(use_static_files_1.StaticFilesProvider, { children: jsx_runtime_1.jsx(ResolveCompositionConfigInStudio_1.ResolveCompositionConfigInStudio, { children: jsx_runtime_1.jsxs(EditorContexts_1.EditorContexts, { children: [
|
|
21
21
|
jsx_runtime_1.jsx(Editor_1.Editor, { readOnlyStudio: readOnly, Root: rootComponent }), readOnly
|
|
22
22
|
? null
|
|
23
23
|
: (0, react_dom_1.createPortal)(jsx_runtime_1.jsx(ServerDisconnected_1.ServerDisconnected, {}), getServerDisconnectedDomElement())] }) }) }) }) }));
|
|
@@ -3,16 +3,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.deleteStaticFile = void 0;
|
|
4
4
|
const remotion_1 = require("remotion");
|
|
5
5
|
const call_api_1 = require("../components/call-api");
|
|
6
|
+
const browser_studio_operations_1 = require("../helpers/browser-studio-operations");
|
|
6
7
|
const deleteStaticFile = async (relativePath) => {
|
|
7
8
|
if (!(0, remotion_1.getRemotionEnvironment)().isStudio) {
|
|
8
9
|
throw new Error('deleteStaticFile() is only available in the Studio');
|
|
9
10
|
}
|
|
10
|
-
if (window.remotion_isReadOnlyStudio) {
|
|
11
|
-
throw new Error('deleteStaticFile() is not available in Read-Only Studio');
|
|
12
|
-
}
|
|
13
11
|
if (relativePath.startsWith(window.remotion_staticBase)) {
|
|
14
12
|
relativePath = relativePath.substring(window.remotion_staticBase.length + 1);
|
|
15
13
|
}
|
|
14
|
+
const browserStudioOperations = (0, browser_studio_operations_1.getBrowserStudioOperations)();
|
|
15
|
+
if (browserStudioOperations) {
|
|
16
|
+
return browserStudioOperations.deleteStaticFile({ relativePath });
|
|
17
|
+
}
|
|
18
|
+
if (window.remotion_isReadOnlyStudio) {
|
|
19
|
+
throw new Error('deleteStaticFile() is not available in Read-Only Studio');
|
|
20
|
+
}
|
|
16
21
|
const res = await (0, call_api_1.callApi)('/api/delete-static-file', { relativePath });
|
|
17
22
|
return res;
|
|
18
23
|
};
|
|
@@ -3,10 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.renameStaticFile = void 0;
|
|
4
4
|
const remotion_1 = require("remotion");
|
|
5
5
|
const call_api_1 = require("../components/call-api");
|
|
6
|
+
const browser_studio_operations_1 = require("../helpers/browser-studio-operations");
|
|
6
7
|
const renameStaticFile = ({ oldRelativePath, newRelativePath, }) => {
|
|
7
8
|
if (!(0, remotion_1.getRemotionEnvironment)().isStudio) {
|
|
8
9
|
throw new Error('renameStaticFile() is only available in the Studio');
|
|
9
10
|
}
|
|
11
|
+
const browserStudioOperations = (0, browser_studio_operations_1.getBrowserStudioOperations)();
|
|
12
|
+
if (browserStudioOperations) {
|
|
13
|
+
return browserStudioOperations.renameStaticFile({
|
|
14
|
+
oldRelativePath,
|
|
15
|
+
newRelativePath,
|
|
16
|
+
});
|
|
17
|
+
}
|
|
10
18
|
if (window.remotion_isReadOnlyStudio) {
|
|
11
19
|
throw new Error('renameStaticFile() is not available in Read-Only Studio');
|
|
12
20
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.watchPublicFolder = exports.WATCH_REMOTION_STATIC_FILES = void 0;
|
|
4
4
|
const remotion_1 = require("remotion");
|
|
5
|
+
const browser_studio_operations_1 = require("../helpers/browser-studio-operations");
|
|
5
6
|
const get_static_files_1 = require("./get-static-files");
|
|
6
7
|
exports.WATCH_REMOTION_STATIC_FILES = 'remotion_staticFilesChanged';
|
|
7
8
|
/*
|
|
@@ -14,7 +15,7 @@ const watchPublicFolder = (callback) => {
|
|
|
14
15
|
console.warn('The watchPublicFolder() API is only available while using the Remotion Studio.');
|
|
15
16
|
return { cancel: () => undefined };
|
|
16
17
|
}
|
|
17
|
-
if (window.remotion_isReadOnlyStudio) {
|
|
18
|
+
if (window.remotion_isReadOnlyStudio && !(0, browser_studio_operations_1.getBrowserStudioOperations)()) {
|
|
18
19
|
throw new Error('watchPublicFolder() is not available in read-only Studio');
|
|
19
20
|
}
|
|
20
21
|
const emitUpdate = () => {
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.watchStaticFile = void 0;
|
|
4
4
|
const remotion_1 = require("remotion");
|
|
5
|
+
const browser_studio_operations_1 = require("../helpers/browser-studio-operations");
|
|
5
6
|
const watch_public_folder_1 = require("./watch-public-folder");
|
|
6
7
|
/*
|
|
7
8
|
* @description Watches for changes in a specific static file and invokes a callback function when the file changes, enabling dynamic updates in your Remotion projects.
|
|
@@ -13,7 +14,7 @@ const watchStaticFile = (fileName, callback) => {
|
|
|
13
14
|
console.warn('watchStaticFile() is only available while using the Remotion Studio.');
|
|
14
15
|
return { cancel: () => undefined };
|
|
15
16
|
}
|
|
16
|
-
if (window.remotion_isReadOnlyStudio) {
|
|
17
|
+
if (window.remotion_isReadOnlyStudio && !(0, browser_studio_operations_1.getBrowserStudioOperations)()) {
|
|
17
18
|
// eslint-disable-next-line no-console
|
|
18
19
|
console.warn('watchStaticFile() is only available in an interactive Studio.');
|
|
19
20
|
return { cancel: () => undefined };
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.writeStaticFile = void 0;
|
|
4
|
+
const browser_studio_operations_1 = require("../helpers/browser-studio-operations");
|
|
4
5
|
const writeStaticFile = async ({ contents, filePath, }) => {
|
|
6
|
+
if (filePath.includes('\\')) {
|
|
7
|
+
return Promise.reject(new Error('File path cannot contain backslashes'));
|
|
8
|
+
}
|
|
9
|
+
const browserStudioOperations = (0, browser_studio_operations_1.getBrowserStudioOperations)();
|
|
10
|
+
if (browserStudioOperations) {
|
|
11
|
+
return browserStudioOperations.writeStaticFile({ contents, filePath });
|
|
12
|
+
}
|
|
5
13
|
if (window.remotion_isReadOnlyStudio) {
|
|
6
14
|
throw new Error('writeStaticFile() is not available in read-only Studio');
|
|
7
15
|
}
|
|
8
16
|
const url = new URL(`${window.remotion_staticBase}/api/add-asset`, window.location.origin);
|
|
9
|
-
if (filePath.includes('\\')) {
|
|
10
|
-
return Promise.reject(new Error('File path cannot contain backslashes'));
|
|
11
|
-
}
|
|
12
17
|
url.search = new URLSearchParams({
|
|
13
18
|
filePath,
|
|
14
19
|
}).toString();
|
|
@@ -37,6 +37,7 @@ exports.AssetSelector = void 0;
|
|
|
37
37
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
38
|
const react_1 = require("react");
|
|
39
39
|
const write_static_file_1 = require("../api/write-static-file");
|
|
40
|
+
const browser_studio_operations_1 = require("../helpers/browser-studio-operations");
|
|
40
41
|
const client_id_1 = require("../helpers/client-id");
|
|
41
42
|
const colors_1 = require("../helpers/colors");
|
|
42
43
|
const create_folder_tree_1 = require("../helpers/create-folder-tree");
|
|
@@ -80,7 +81,8 @@ const AssetSelector = ({ readOnlyStudio }) => {
|
|
|
80
81
|
const [dropLocation, setDropLocation] = (0, react_1.useState)(null);
|
|
81
82
|
const connectionStatus = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx)
|
|
82
83
|
.previewServerState.type;
|
|
83
|
-
const shouldAllowUpload =
|
|
84
|
+
const shouldAllowUpload = (0, browser_studio_operations_1.getBrowserStudioOperations)() !== null ||
|
|
85
|
+
(connectionStatus === 'connected' && !readOnlyStudio);
|
|
84
86
|
const list = (0, react_1.useMemo)(() => {
|
|
85
87
|
return {
|
|
86
88
|
...baseList,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { AssetStructure } from '../helpers/create-folder-tree';
|
|
3
3
|
import type { ComboboxValue } from './NewComposition/ComboBox';
|
|
4
|
-
export declare const getAssetActionAvailability: ({ readOnlyStudio, connectionStatus, publicFolderExists, }: {
|
|
4
|
+
export declare const getAssetActionAvailability: ({ browserStudioCanMutateAssets, readOnlyStudio, connectionStatus, publicFolderExists, }: {
|
|
5
|
+
browserStudioCanMutateAssets: boolean | null;
|
|
5
6
|
readOnlyStudio: boolean;
|
|
6
7
|
connectionStatus: "connected" | "disconnected" | "init";
|
|
7
8
|
publicFolderExists: string | null;
|
|
@@ -35,11 +35,12 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.AssetFolderTree = exports.getAssetContextMenuItems = exports.getCanDragAsset = exports.getAssetActionAvailability = void 0;
|
|
37
37
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
-
const
|
|
38
|
+
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
42
|
const delete_static_file_1 = require("../api/delete-static-file");
|
|
43
|
+
const browser_studio_operations_1 = require("../helpers/browser-studio-operations");
|
|
43
44
|
const client_id_1 = require("../helpers/client-id");
|
|
44
45
|
const colors_1 = require("../helpers/colors");
|
|
45
46
|
const copy_text_1 = require("../helpers/copy-text");
|
|
@@ -105,9 +106,10 @@ const revealIconStyle = {
|
|
|
105
106
|
height: 12,
|
|
106
107
|
color: colors_1.CURRENT_COLOR,
|
|
107
108
|
};
|
|
108
|
-
const getAssetActionAvailability = ({ readOnlyStudio, connectionStatus, publicFolderExists, }) => {
|
|
109
|
+
const getAssetActionAvailability = ({ browserStudioCanMutateAssets, readOnlyStudio, connectionStatus, publicFolderExists, }) => {
|
|
109
110
|
return {
|
|
110
|
-
mutationsDisabled:
|
|
111
|
+
mutationsDisabled: browserStudioCanMutateAssets !== true &&
|
|
112
|
+
(readOnlyStudio || connectionStatus !== 'connected'),
|
|
111
113
|
fileExplorerDisabled: publicFolderExists === null ||
|
|
112
114
|
readOnlyStudio ||
|
|
113
115
|
connectionStatus !== 'connected',
|
|
@@ -336,7 +338,7 @@ const AssetSelectorItem = ({ item, tabIndex, level, parentFolder, readOnlyStudio
|
|
|
336
338
|
mediaMetadata.duration > 0
|
|
337
339
|
? mediaMetadata.duration
|
|
338
340
|
: null;
|
|
339
|
-
const dragData =
|
|
341
|
+
const dragData = studio_protocol_1.StudioProtocolInternals.makeDragData({
|
|
340
342
|
type: 'asset',
|
|
341
343
|
assetPath: relativePath,
|
|
342
344
|
width: hasDimensions ? width : null,
|
|
@@ -399,6 +401,7 @@ const AssetSelectorItem = ({ item, tabIndex, level, parentFolder, readOnlyStudio
|
|
|
399
401
|
});
|
|
400
402
|
}, [relativePath]);
|
|
401
403
|
const { mutationsDisabled, fileExplorerDisabled } = (0, exports.getAssetActionAvailability)({
|
|
404
|
+
browserStudioCanMutateAssets: (0, browser_studio_operations_1.getBrowserStudioOperations)() === null ? null : true,
|
|
402
405
|
readOnlyStudio,
|
|
403
406
|
connectionStatus,
|
|
404
407
|
publicFolderExists: window.remotion_publicFolderExists,
|
|
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.Canvas = void 0;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const
|
|
8
|
+
const studio_protocol_1 = require("@remotion/studio-protocol");
|
|
9
9
|
const react_1 = require("react");
|
|
10
10
|
const remotion_1 = require("remotion");
|
|
11
11
|
const get_static_files_1 = require("../api/get-static-files");
|
|
@@ -42,6 +42,7 @@ const ResetZoomButton_1 = require("./ResetZoomButton");
|
|
|
42
42
|
const SvgImportDialog_1 = require("./SvgImportDialog");
|
|
43
43
|
const imperative_state_1 = require("./Timeline/imperative-state");
|
|
44
44
|
const use_resolved_stack_1 = require("./Timeline/use-resolved-stack");
|
|
45
|
+
const use_element_overwrite_confirmation_1 = require("./use-element-overwrite-confirmation");
|
|
45
46
|
const elementInstallCompositionIdStyle = {
|
|
46
47
|
fontFamily: 'monospace',
|
|
47
48
|
fontSize: 13,
|
|
@@ -158,6 +159,7 @@ const Canvas = ({ canvasContent, size }) => {
|
|
|
158
159
|
const touchPinchRef = (0, react_1.useRef)(null);
|
|
159
160
|
const keybindings = (0, use_keybinding_1.useKeybinding)();
|
|
160
161
|
const confirm = (0, ConfirmationDialog_1.useConfirmationDialog)();
|
|
162
|
+
const confirmElementOverwrite = (0, use_element_overwrite_confirmation_1.useElementOverwriteConfirmation)();
|
|
161
163
|
const chooseSvgImportMode = (0, SvgImportDialog_1.useSvgImportDialog)();
|
|
162
164
|
const config = remotion_1.Internals.useUnsafeVideoConfig();
|
|
163
165
|
const areRulersVisible = (0, use_is_ruler_visible_1.useIsRulerVisible)();
|
|
@@ -682,6 +684,7 @@ const Canvas = ({ canvasContent, size }) => {
|
|
|
682
684
|
element: activeElementInstallRequest.element,
|
|
683
685
|
compositionFile: activeElementInstallRequest.compositionFile,
|
|
684
686
|
compositionId: activeElementInstallRequest.compositionId,
|
|
687
|
+
confirmOverwrite: confirmElementOverwrite,
|
|
685
688
|
dropPosition: null,
|
|
686
689
|
from: null,
|
|
687
690
|
});
|
|
@@ -703,7 +706,7 @@ const Canvas = ({ canvasContent, size }) => {
|
|
|
703
706
|
return () => {
|
|
704
707
|
canceled = true;
|
|
705
708
|
};
|
|
706
|
-
}, [activeElementInstallRequest, confirm]);
|
|
709
|
+
}, [activeElementInstallRequest, confirm, confirmElementOverwrite]);
|
|
707
710
|
const onDragOver = (0, react_1.useCallback)((event) => {
|
|
708
711
|
var _a;
|
|
709
712
|
var _b;
|
|
@@ -725,7 +728,7 @@ const Canvas = ({ canvasContent, size }) => {
|
|
|
725
728
|
setCompositionDropPreview(null);
|
|
726
729
|
return;
|
|
727
730
|
}
|
|
728
|
-
const metadata =
|
|
731
|
+
const metadata = studio_protocol_1.StudioProtocolInternals.getDragPreviewMetadata((_b = (_a = event.dataTransfer) === null || _a === void 0 ? void 0 : _a.types) !== null && _b !== void 0 ? _b : []);
|
|
729
732
|
if ((metadata === null || metadata === void 0 ? void 0 : metadata.type) !== 'composition' ||
|
|
730
733
|
metadata.width === undefined ||
|
|
731
734
|
metadata.height === undefined) {
|
|
@@ -832,7 +835,7 @@ const Canvas = ({ canvasContent, size }) => {
|
|
|
832
835
|
event.stopPropagation();
|
|
833
836
|
setIsAddingAsset(true);
|
|
834
837
|
try {
|
|
835
|
-
const metadata =
|
|
838
|
+
const metadata = studio_protocol_1.StudioProtocolInternals.getDragPreviewMetadata((_b = (_a = event.dataTransfer) === null || _a === void 0 ? void 0 : _a.types) !== null && _b !== void 0 ? _b : []);
|
|
836
839
|
const isComposition = (metadata === null || metadata === void 0 ? void 0 : metadata.type) === 'composition';
|
|
837
840
|
let dropPosition = getDropPosition({
|
|
838
841
|
addFitPadding,
|
|
@@ -871,6 +874,7 @@ const Canvas = ({ canvasContent, size }) => {
|
|
|
871
874
|
await (0, handle_drop_1.handleDrop)({
|
|
872
875
|
chooseSvgImportMode,
|
|
873
876
|
compositionFile,
|
|
877
|
+
confirmElementOverwrite,
|
|
874
878
|
compositionId: currentCompositionId,
|
|
875
879
|
destinationDimensions: contentDimensions === 'none' ? null : contentDimensions,
|
|
876
880
|
dropPosition,
|
|
@@ -888,6 +892,7 @@ const Canvas = ({ canvasContent, size }) => {
|
|
|
888
892
|
cannotAddSequence,
|
|
889
893
|
chooseSvgImportMode,
|
|
890
894
|
compositionFile,
|
|
895
|
+
confirmElementOverwrite,
|
|
891
896
|
config,
|
|
892
897
|
contentDimensions,
|
|
893
898
|
currentCompositionId,
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Caption } from '@remotion/captions';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export declare const CaptionInspector: React.FC<{
|
|
4
|
+
readonly captions: Caption[];
|
|
5
|
+
readonly onTextChange: (captions: Caption[]) => void;
|
|
6
|
+
readonly onTextSave: ((captions: Caption[]) => void) | null;
|
|
7
|
+
readonly onTextCancel: (() => void) | null;
|
|
8
|
+
readonly readOnly: boolean;
|
|
9
|
+
readonly readOnlyTitle: string | null;
|
|
10
|
+
}>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CaptionInspector = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const colors_1 = require("../helpers/colors");
|
|
6
|
+
const CaptionTextEditor_1 = require("./CaptionTextEditor");
|
|
7
|
+
const common_1 = require("./InspectorPanel/common");
|
|
8
|
+
const styles_1 = require("./InspectorPanel/styles");
|
|
9
|
+
const readOnlyStatus = {
|
|
10
|
+
color: colors_1.LIGHT_TEXT,
|
|
11
|
+
fontFamily: 'sans-serif',
|
|
12
|
+
fontSize: 12,
|
|
13
|
+
fontWeight: 'normal',
|
|
14
|
+
lineHeight: '16px',
|
|
15
|
+
marginLeft: 12,
|
|
16
|
+
};
|
|
17
|
+
const CaptionInspector = ({ captions, onTextChange, onTextSave, onTextCancel, readOnly, readOnlyTitle, }) => {
|
|
18
|
+
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.jsxs("div", { style: styles_1.sectionHeaderRow, children: [
|
|
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
|
+
] }));
|
|
23
|
+
};
|
|
24
|
+
exports.CaptionInspector = CaptionInspector;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Caption } from '@remotion/captions';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export declare const CaptionTextEditor: React.FC<{
|
|
4
|
+
readonly captions: Caption[];
|
|
5
|
+
readonly onChange: (captions: Caption[]) => void;
|
|
6
|
+
readonly onSave: ((captions: Caption[]) => void) | null;
|
|
7
|
+
readonly onCancel: (() => void) | null;
|
|
8
|
+
readonly readOnly: boolean;
|
|
9
|
+
}>;
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CaptionTextEditor = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const colors_1 = require("../helpers/colors");
|
|
7
|
+
const RemInput_1 = require("./NewComposition/RemInput");
|
|
8
|
+
const container = {
|
|
9
|
+
alignSelf: 'stretch',
|
|
10
|
+
backgroundColor: colors_1.BACKGROUND,
|
|
11
|
+
display: 'flex',
|
|
12
|
+
flexDirection: 'column',
|
|
13
|
+
fontFamily: 'sans-serif',
|
|
14
|
+
width: '100%',
|
|
15
|
+
};
|
|
16
|
+
const list = {
|
|
17
|
+
display: 'flex',
|
|
18
|
+
flexDirection: 'column',
|
|
19
|
+
};
|
|
20
|
+
const row = {
|
|
21
|
+
alignItems: 'center',
|
|
22
|
+
borderBottom: `1px solid ${colors_1.LINE_COLOR}`,
|
|
23
|
+
display: 'grid',
|
|
24
|
+
gap: 12,
|
|
25
|
+
gridTemplateColumns: '100px minmax(0, 1fr)',
|
|
26
|
+
padding: '5px 12px',
|
|
27
|
+
};
|
|
28
|
+
const timing = {
|
|
29
|
+
color: colors_1.LIGHT_TEXT,
|
|
30
|
+
fontFamily: 'monospace',
|
|
31
|
+
fontSize: 11,
|
|
32
|
+
fontVariantNumeric: 'tabular-nums',
|
|
33
|
+
lineHeight: '16px',
|
|
34
|
+
textAlign: 'right',
|
|
35
|
+
whiteSpace: 'nowrap',
|
|
36
|
+
};
|
|
37
|
+
const empty = {
|
|
38
|
+
color: colors_1.LIGHT_TEXT,
|
|
39
|
+
fontFamily: 'sans-serif',
|
|
40
|
+
fontSize: 13,
|
|
41
|
+
lineHeight: '18px',
|
|
42
|
+
padding: 12,
|
|
43
|
+
textAlign: 'center',
|
|
44
|
+
};
|
|
45
|
+
const formatMilliseconds = (milliseconds) => {
|
|
46
|
+
return Math.round(milliseconds);
|
|
47
|
+
};
|
|
48
|
+
const CaptionTextEditor = ({ captions, onChange, onSave, onCancel, readOnly }) => {
|
|
49
|
+
const listRef = (0, react_1.useRef)(null);
|
|
50
|
+
const cancelledBlurIndexes = (0, react_1.useRef)(new Set());
|
|
51
|
+
const dirtyRef = (0, react_1.useRef)(false);
|
|
52
|
+
const latestRef = (0, react_1.useRef)({ captions, onSave });
|
|
53
|
+
latestRef.current = { captions, onSave };
|
|
54
|
+
const captionRows = (0, react_1.useMemo)(() => {
|
|
55
|
+
const occurrences = new Map();
|
|
56
|
+
return captions.map((caption) => {
|
|
57
|
+
var _a;
|
|
58
|
+
const signature = [
|
|
59
|
+
caption.startMs,
|
|
60
|
+
caption.endMs,
|
|
61
|
+
caption.timestampMs,
|
|
62
|
+
caption.confidence,
|
|
63
|
+
].join('-');
|
|
64
|
+
const occurrence = (_a = occurrences.get(signature)) !== null && _a !== void 0 ? _a : 0;
|
|
65
|
+
occurrences.set(signature, occurrence + 1);
|
|
66
|
+
return { caption, key: `${signature}-${occurrence}` };
|
|
67
|
+
});
|
|
68
|
+
}, [captions]);
|
|
69
|
+
const commitPending = (0, react_1.useCallback)(() => {
|
|
70
|
+
var _a, _b;
|
|
71
|
+
if (!dirtyRef.current) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
dirtyRef.current = false;
|
|
75
|
+
(_b = (_a = latestRef.current).onSave) === null || _b === void 0 ? void 0 : _b.call(_a, latestRef.current.captions);
|
|
76
|
+
}, []);
|
|
77
|
+
(0, react_1.useEffect)(() => {
|
|
78
|
+
return commitPending;
|
|
79
|
+
}, [commitPending]);
|
|
80
|
+
const updateText = (0, react_1.useCallback)((index, text) => {
|
|
81
|
+
var _a;
|
|
82
|
+
if (((_a = latestRef.current.captions[index]) === null || _a === void 0 ? void 0 : _a.text) === text) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
const nextCaptions = latestRef.current.captions.map((caption, captionIndex) => {
|
|
86
|
+
return captionIndex === index ? { ...caption, text } : caption;
|
|
87
|
+
});
|
|
88
|
+
latestRef.current.captions = nextCaptions;
|
|
89
|
+
dirtyRef.current = true;
|
|
90
|
+
onChange(nextCaptions);
|
|
91
|
+
}, [onChange]);
|
|
92
|
+
const focusSibling = (0, react_1.useCallback)((index) => {
|
|
93
|
+
var _a;
|
|
94
|
+
const input = (_a = listRef.current) === null || _a === void 0 ? void 0 : _a.querySelector(`[data-caption-index="${index}"]`);
|
|
95
|
+
input === null || input === void 0 ? void 0 : input.focus();
|
|
96
|
+
input === null || input === void 0 ? void 0 : input.scrollIntoView({ block: 'nearest' });
|
|
97
|
+
}, []);
|
|
98
|
+
return (jsx_runtime_1.jsx("div", { style: container, children: jsx_runtime_1.jsxs("div", { ref: listRef, style: list, children: [captions.length === 0 ? jsx_runtime_1.jsx("div", { style: empty, children: "No captions" }) : null, captionRows.map(({ caption, key }, index) => {
|
|
99
|
+
return (jsx_runtime_1.jsxs("div", { style: row, children: [
|
|
100
|
+
jsx_runtime_1.jsxs("div", { style: timing, children: [formatMilliseconds(caption.startMs), " \u2192", ' ', formatMilliseconds(caption.endMs), " ms"] }), jsx_runtime_1.jsx(RemInput_1.RemotionInput, { "data-caption-index": index, disabled: readOnly, onBlur: (event) => {
|
|
101
|
+
if (cancelledBlurIndexes.current.delete(index)) {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
updateText(index, event.currentTarget.value);
|
|
105
|
+
commitPending();
|
|
106
|
+
}, onChange: (event) => updateText(index, event.target.value), onKeyDown: (event) => {
|
|
107
|
+
if (event.key === 'ArrowDown' &&
|
|
108
|
+
index < captions.length - 1) {
|
|
109
|
+
event.preventDefault();
|
|
110
|
+
focusSibling(index + 1);
|
|
111
|
+
}
|
|
112
|
+
if (event.key === 'ArrowUp' && index > 0) {
|
|
113
|
+
event.preventDefault();
|
|
114
|
+
focusSibling(index - 1);
|
|
115
|
+
}
|
|
116
|
+
if (event.key === 'Escape') {
|
|
117
|
+
event.preventDefault();
|
|
118
|
+
cancelledBlurIndexes.current.add(index);
|
|
119
|
+
dirtyRef.current = false;
|
|
120
|
+
onCancel === null || onCancel === void 0 ? void 0 : onCancel();
|
|
121
|
+
event.currentTarget.blur();
|
|
122
|
+
}
|
|
123
|
+
}, rightAlign: false, small: true, status: "ok", style: {
|
|
124
|
+
color: colors_1.WHITE,
|
|
125
|
+
fontFamily: 'sans-serif',
|
|
126
|
+
fontSize: 12,
|
|
127
|
+
lineHeight: '16px',
|
|
128
|
+
}, value: caption.text })
|
|
129
|
+
] }, key));
|
|
130
|
+
})] }) }));
|
|
131
|
+
};
|
|
132
|
+
exports.CaptionTextEditor = CaptionTextEditor;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CompositionSelector = exports.useCompositionNavigation = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const
|
|
5
|
+
const studio_protocol_1 = require("@remotion/studio-protocol");
|
|
6
6
|
const studio_shared_1 = require("@remotion/studio-shared");
|
|
7
7
|
const react_1 = require("react");
|
|
8
8
|
const remotion_1 = require("remotion");
|
|
@@ -161,7 +161,7 @@ const CompositionSelector = () => {
|
|
|
161
161
|
const onCompositionListDragOverCapture = (0, react_1.useCallback)((event) => {
|
|
162
162
|
var _a;
|
|
163
163
|
if (window.remotion_isReadOnlyStudio ||
|
|
164
|
-
((_a =
|
|
164
|
+
((_a = studio_protocol_1.StudioProtocolInternals.getDragPreviewMetadata(event.dataTransfer.types)) === null || _a === void 0 ? void 0 : _a.type) !== 'composition') {
|
|
165
165
|
stopCompositionListAutoScroll();
|
|
166
166
|
return;
|
|
167
167
|
}
|
|
@@ -178,7 +178,7 @@ const CompositionSelector = () => {
|
|
|
178
178
|
const onRootDragOver = (0, react_1.useCallback)((event) => {
|
|
179
179
|
var _a;
|
|
180
180
|
if (window.remotion_isReadOnlyStudio ||
|
|
181
|
-
((_a =
|
|
181
|
+
((_a = studio_protocol_1.StudioProtocolInternals.getDragPreviewMetadata(event.dataTransfer.types)) === null || _a === void 0 ? void 0 : _a.type) !== 'composition') {
|
|
182
182
|
return;
|
|
183
183
|
}
|
|
184
184
|
event.preventDefault();
|
|
@@ -198,7 +198,7 @@ const CompositionSelector = () => {
|
|
|
198
198
|
if (window.remotion_isReadOnlyStudio) {
|
|
199
199
|
return;
|
|
200
200
|
}
|
|
201
|
-
const parsed =
|
|
201
|
+
const parsed = studio_protocol_1.StudioProtocolInternals.parseDragData(event.dataTransfer);
|
|
202
202
|
if ((parsed === null || parsed === void 0 ? void 0 : parsed.type) !== 'composition') {
|
|
203
203
|
return;
|
|
204
204
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CompositionSelectorItem = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const
|
|
5
|
+
const studio_protocol_1 = require("@remotion/studio-protocol");
|
|
6
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");
|
|
@@ -150,7 +150,7 @@ const CompositionSelectorItem = ({ item, level, currentComposition, tabIndex, se
|
|
|
150
150
|
}
|
|
151
151
|
setIsDragging(true);
|
|
152
152
|
event.dataTransfer.effectAllowed = 'copyMove';
|
|
153
|
-
const dragData =
|
|
153
|
+
const dragData = studio_protocol_1.StudioProtocolInternals.makeDragData({
|
|
154
154
|
type: 'composition',
|
|
155
155
|
compositionFile: (_a = resolvedLocation === null || resolvedLocation === void 0 ? void 0 : resolvedLocation.source) !== null && _a !== void 0 ? _a : null,
|
|
156
156
|
compositionId: item.composition.id,
|
|
@@ -167,7 +167,7 @@ const CompositionSelectorItem = ({ item, level, currentComposition, tabIndex, se
|
|
|
167
167
|
var _a;
|
|
168
168
|
if (item.type !== 'folder' ||
|
|
169
169
|
window.remotion_isReadOnlyStudio ||
|
|
170
|
-
((_a =
|
|
170
|
+
((_a = studio_protocol_1.StudioProtocolInternals.getDragPreviewMetadata(event.dataTransfer.types)) === null || _a === void 0 ? void 0 : _a.type) !== 'composition') {
|
|
171
171
|
return;
|
|
172
172
|
}
|
|
173
173
|
event.preventDefault();
|
|
@@ -183,7 +183,7 @@ const CompositionSelectorItem = ({ item, level, currentComposition, tabIndex, se
|
|
|
183
183
|
var _a;
|
|
184
184
|
if (item.type !== 'folder' ||
|
|
185
185
|
window.remotion_isReadOnlyStudio ||
|
|
186
|
-
((_a =
|
|
186
|
+
((_a = studio_protocol_1.StudioProtocolInternals.getDragPreviewMetadata(event.dataTransfer.types)) === null || _a === void 0 ? void 0 : _a.type) !== 'composition') {
|
|
187
187
|
return;
|
|
188
188
|
}
|
|
189
189
|
event.preventDefault();
|
|
@@ -195,7 +195,7 @@ const CompositionSelectorItem = ({ item, level, currentComposition, tabIndex, se
|
|
|
195
195
|
if (item.type !== 'folder' || window.remotion_isReadOnlyStudio) {
|
|
196
196
|
return;
|
|
197
197
|
}
|
|
198
|
-
const parsed =
|
|
198
|
+
const parsed = studio_protocol_1.StudioProtocolInternals.parseDragData(event.dataTransfer);
|
|
199
199
|
if ((parsed === null || parsed === void 0 ? void 0 : parsed.type) !== 'composition') {
|
|
200
200
|
return;
|
|
201
201
|
}
|
|
@@ -5,6 +5,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const studio_shared_1 = require("@remotion/studio-shared");
|
|
6
6
|
const react_1 = require("react");
|
|
7
7
|
const remotion_1 = require("remotion");
|
|
8
|
+
const browser_studio_operations_1 = require("../helpers/browser-studio-operations");
|
|
8
9
|
const client_id_1 = require("../helpers/client-id");
|
|
9
10
|
const format_media_duration_1 = require("../helpers/format-media-duration");
|
|
10
11
|
const get_preview_file_type_1 = require("../helpers/get-preview-file-type");
|
|
@@ -88,8 +89,8 @@ const AssetInfo = ({ assetName, contentSized = false, onAssetClick, readOnlyStud
|
|
|
88
89
|
const imageSrc = (0, exports.getCurrentAssetImageMetadataSource)(assetName);
|
|
89
90
|
const imageMetadata = (0, use_image_metadata_1.useImageMetadata)(imageSrc);
|
|
90
91
|
const canRename = onAssetClick === undefined &&
|
|
91
|
-
|
|
92
|
-
|
|
92
|
+
((0, browser_studio_operations_1.getBrowserStudioOperations)() !== null ||
|
|
93
|
+
(connectionStatus === 'connected' && !readOnlyStudio));
|
|
93
94
|
const onRename = (0, react_1.useCallback)((newName) => {
|
|
94
95
|
renameFile(newName).catch(() => undefined);
|
|
95
96
|
}, [renameFile]);
|
|
@@ -35,7 +35,7 @@ const StudioClearSelectionArea = ({ children }) => {
|
|
|
35
35
|
const EditorContent = ({ readOnlyStudio, children }) => {
|
|
36
36
|
const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
37
37
|
const showTimeline = canvasContent !== null && canvasContent.type === 'composition';
|
|
38
|
-
const content = (jsx_runtime_1.jsxs(SplitterContainer_1.SplitterContainer, { orientation: "horizontal", id: "top-to-bottom", maxFlex: 0.9, minFlex: 0.2, defaultFlex: 0.75, maxFlexerSize: null, maxAntiFlexerSize: null, children: [
|
|
38
|
+
const content = (jsx_runtime_1.jsxs(SplitterContainer_1.SplitterContainer, { orientation: "horizontal", id: "top-to-bottom", maxFlex: 0.9, minFlex: 0.2, defaultFlex: 0.75, maxFlexerSize: null, minFlexerSize: null, maxAntiFlexerSize: null, children: [
|
|
39
39
|
jsx_runtime_1.jsx(SplitterElement_1.SplitterElement, { sticky: null, type: "flexer", children: children }), jsx_runtime_1.jsx(SplitterHandle_1.SplitterHandle, { allowToCollapse: "none", onCollapse: noop }), jsx_runtime_1.jsx(SplitterElement_1.SplitterElement, { sticky: null, type: "anti-flexer", children: showTimeline ? jsx_runtime_1.jsx(Timeline_1.Timeline, {}) : jsx_runtime_1.jsx(TimelineEmptyState_1.TimelineEmptyState, {}) })
|
|
40
40
|
] }));
|
|
41
41
|
return (jsx_runtime_1.jsx(TimelineSelection_1.TimelineSelectionProvider, { children: jsx_runtime_1.jsxs(StudioClearSelectionArea, { children: [
|
|
@@ -24,8 +24,8 @@ const ShowRulersProvider_1 = require("./ShowRulersProvider");
|
|
|
24
24
|
const SnappingProvider_1 = require("./SnappingProvider");
|
|
25
25
|
const VisualControlsUndoSync_1 = require("./VisualControls/VisualControlsUndoSync");
|
|
26
26
|
const ZoomGesturesProvider_1 = require("./ZoomGesturesProvider");
|
|
27
|
-
const EditorContexts = ({ children
|
|
28
|
-
return (jsx_runtime_1.jsx(get_zod_if_possible_1.ZodProvider, { children: jsx_runtime_1.jsx(VisualControls_1.VisualControlsProvider, { children: jsx_runtime_1.jsxs(client_id_1.PreviewServerConnection, {
|
|
27
|
+
const EditorContexts = ({ children }) => {
|
|
28
|
+
return (jsx_runtime_1.jsx(get_zod_if_possible_1.ZodProvider, { children: jsx_runtime_1.jsx(VisualControls_1.VisualControlsProvider, { children: jsx_runtime_1.jsxs(client_id_1.PreviewServerConnection, { children: [
|
|
29
29
|
jsx_runtime_1.jsx(VisualControlsUndoSync_1.VisualControlsUndoSync, {}), jsx_runtime_1.jsxs(context_1.RenderQueueContextProvider, { children: [
|
|
30
30
|
jsx_runtime_1.jsx(ClientRenderQueueProcessor_1.ClientRenderQueueProcessor, {}), jsx_runtime_1.jsx(keybindings_1.KeybindingContextProvider, { children: jsx_runtime_1.jsx(CheckerboardProvider_1.CheckerboardProvider, { children: jsx_runtime_1.jsx(ZoomGesturesProvider_1.ZoomGesturesProvider, { children: jsx_runtime_1.jsx(ShowRulersProvider_1.ShowRulersProvider, { children: jsx_runtime_1.jsx(ShowGuidesProvider_1.ShowGuidesProvider, { children: jsx_runtime_1.jsx(ShowOutlinesProvider_1.ShowOutlinesProvider, { children: jsx_runtime_1.jsx(SnappingProvider_1.SnappingProvider, { children: jsx_runtime_1.jsx(preview_size_1.PreviewSizeProvider, { children: jsx_runtime_1.jsx(ModalsProvider_1.ModalsProvider, { children: jsx_runtime_1.jsx(MediaVolumeProvider_1.MediaVolumeProvider, { children: jsx_runtime_1.jsx(player_1.PlayerInternals.PlayerEmitterProvider, { currentPlaybackRate: null, children: jsx_runtime_1.jsx(sidebar_1.SidebarContextProvider, { children: jsx_runtime_1.jsx(folders_1.FolderContextProvider, { children: jsx_runtime_1.jsx(highest_z_index_1.HighestZIndexProvider, { children: jsx_runtime_1.jsx(SetTimelineInOutProvider_1.SetTimelineInOutProvider, { children: jsx_runtime_1.jsx(ExpandedTracksProvider_1.ExpandedTracksProvider, { children: children }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) })
|
|
31
31
|
] })
|
|
@@ -6,8 +6,8 @@ const react_1 = require("react");
|
|
|
6
6
|
const remotion_1 = require("remotion");
|
|
7
7
|
const colors_1 = require("../helpers/colors");
|
|
8
8
|
const label = {
|
|
9
|
-
color: colors_1.
|
|
10
|
-
fontSize:
|
|
9
|
+
color: colors_1.LIGHT_TEXT,
|
|
10
|
+
fontSize: 13,
|
|
11
11
|
fontFamily: 'Arial, Helvetica, sans-serif',
|
|
12
12
|
whiteSpace: 'nowrap',
|
|
13
13
|
};
|
|
@@ -59,7 +59,7 @@ const FpsCounter = ({ playbackSpeed }) => {
|
|
|
59
59
|
const expectedFps = Math.abs(playbackSpeed) * videoConfig.fps;
|
|
60
60
|
return {
|
|
61
61
|
...label,
|
|
62
|
-
color: fps < expectedFps * 0.9 ? colors_1.RED : colors_1.
|
|
62
|
+
color: fps < expectedFps * 0.9 ? colors_1.RED : colors_1.LIGHT_TEXT,
|
|
63
63
|
};
|
|
64
64
|
}, [fps, playbackSpeed, videoConfig]);
|
|
65
65
|
if (fps === 0) {
|
|
@@ -7,6 +7,7 @@ const remotion_1 = require("remotion");
|
|
|
7
7
|
const no_react_1 = require("remotion/no-react");
|
|
8
8
|
const colors_1 = require("../helpers/colors");
|
|
9
9
|
const use_keybinding_1 = require("../helpers/use-keybinding");
|
|
10
|
+
const fullscreen_1 = require("../icons/fullscreen");
|
|
10
11
|
const canvas_ref_1 = require("../state/canvas-ref");
|
|
11
12
|
const ControlButton_1 = require("./ControlButton");
|
|
12
13
|
const accessibilityLabel = [
|
|
@@ -15,7 +16,7 @@ const accessibilityLabel = [
|
|
|
15
16
|
]
|
|
16
17
|
.filter(no_react_1.NoReactInternals.truthy)
|
|
17
18
|
.join(' ');
|
|
18
|
-
const FullScreenToggle = () => {
|
|
19
|
+
const FullScreenToggle = ({ hidden }) => {
|
|
19
20
|
const keybindings = (0, use_keybinding_1.useKeybinding)();
|
|
20
21
|
const { setSize } = (0, react_1.useContext)(remotion_1.Internals.PreviewSizeContext);
|
|
21
22
|
const onClick = (0, react_1.useCallback)(() => {
|
|
@@ -44,6 +45,6 @@ const FullScreenToggle = () => {
|
|
|
44
45
|
f.unregister();
|
|
45
46
|
};
|
|
46
47
|
}, [keybindings, onClick]);
|
|
47
|
-
return (jsx_runtime_1.jsx(
|
|
48
|
+
return hidden ? (jsx_runtime_1.jsx("button", { id: "fullscreen-toggle", type: "button", style: { display: 'none' }, onClick: onClick })) : (jsx_runtime_1.jsx(ControlButton_1.ControlButton, { id: "fullscreen-toggle", title: accessibilityLabel, "aria-label": accessibilityLabel, onClick: onClick, children: jsx_runtime_1.jsx(fullscreen_1.FullscreenIcon, { color: colors_1.WHITE_HEX, style: { width: 18, height: 18 } }) }));
|
|
48
49
|
};
|
|
49
50
|
exports.FullScreenToggle = FullScreenToggle;
|