@remotion/studio 4.0.488 → 4.0.490
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/components/Canvas.js +30 -12
- package/dist/components/Editor.js +2 -5
- package/dist/components/GlobalKeybindings.js +2 -1
- package/dist/components/InspectorPanel/AlignmentControls.d.ts +5 -0
- package/dist/components/InspectorPanel/AlignmentControls.js +205 -0
- package/dist/components/InspectorPanel/EasingInspector.js +8 -2
- package/dist/components/InspectorPanel/KeyframeSettings.d.ts +5 -0
- package/dist/components/InspectorPanel/KeyframeSettings.js +142 -0
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +2 -1
- package/dist/components/InspectorPanel/alignment-controls.d.ts +12 -0
- package/dist/components/InspectorPanel/alignment-controls.js +42 -0
- package/dist/components/InspectorSequenceSection.d.ts +1 -0
- package/dist/components/InspectorSequenceSection.js +2 -2
- package/dist/components/KeyboardShortcutsExplainer.js +2 -1
- package/dist/components/MobilePanel.js +9 -3
- package/dist/components/Modals.js +3 -3
- package/dist/components/NewComposition/CancelButton.d.ts +1 -0
- package/dist/components/NewComposition/CancelButton.js +6 -2
- package/dist/components/NewComposition/MenuContent.js +2 -2
- package/dist/components/Preview.js +1 -1
- package/dist/components/SelectedOutlineOverlay.d.ts +6 -1
- package/dist/components/SelectedOutlineOverlay.js +247 -9
- package/dist/components/Timeline/MaxTimelineTracks.js +2 -5
- package/dist/components/Timeline/TimelineClipboardKeybindings.js +3 -0
- package/dist/components/Timeline/TimelineEffectPropItem.js +2 -50
- package/dist/components/Timeline/TimelineSequenceItem.js +8 -10
- package/dist/components/Timeline/TimelineSequenceName.js +1 -3
- package/dist/components/Timeline/TimelineSequencePropItem.js +2 -49
- package/dist/components/import-assets.d.ts +1 -0
- package/dist/components/import-assets.js +1 -0
- package/dist/esm/{chunk-nn36hyt1.js → chunk-16nwrbrm.js} +4972 -4346
- package/dist/esm/index.mjs +21 -1
- package/dist/esm/internals.mjs +4972 -4346
- package/dist/esm/previewEntry.mjs +5010 -4384
- package/dist/esm/renderEntry.mjs +1 -1
- package/dist/helpers/install-required-package.d.ts +1 -0
- package/dist/helpers/install-required-package.js +3 -2
- package/dist/helpers/interactivity-enabled.js +2 -4
- package/dist/helpers/show-browser-rendering.js +2 -1
- package/dist/helpers/studio-runtime-config.d.ts +7 -0
- package/dist/helpers/studio-runtime-config.js +46 -0
- package/dist/helpers/use-keybinding.js +4 -3
- package/dist/helpers/use-menu-structure.js +2 -1
- package/dist/icons/align-bottom.d.ts +3 -0
- package/dist/icons/align-bottom.js +12 -0
- package/dist/icons/align-center-horizontal.d.ts +3 -0
- package/dist/icons/align-center-horizontal.js +12 -0
- package/dist/icons/align-center-vertical.d.ts +3 -0
- package/dist/icons/align-center-vertical.js +12 -0
- package/dist/icons/align-left.d.ts +3 -0
- package/dist/icons/align-left.js +12 -0
- package/dist/icons/align-right.d.ts +3 -0
- package/dist/icons/align-right.js +12 -0
- package/dist/icons/align-top.d.ts +3 -0
- package/dist/icons/align-top.js +12 -0
- package/dist/state/modals.d.ts +1 -2
- package/package.json +11 -11
- package/dist/components/Timeline/KeyframeSettingsModal.d.ts +0 -15
- package/dist/components/Timeline/KeyframeSettingsModal.js +0 -151
|
@@ -8,6 +8,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
8
8
|
const react_dom_1 = __importDefault(require("react-dom"));
|
|
9
9
|
const colors_1 = require("../helpers/colors");
|
|
10
10
|
const z_index_1 = require("../state/z-index");
|
|
11
|
+
const InlineAction_1 = require("./InlineAction");
|
|
11
12
|
const portals_1 = require("./Menu/portals");
|
|
12
13
|
const CancelButton_1 = require("./NewComposition/CancelButton");
|
|
13
14
|
const container = {
|
|
@@ -25,13 +26,18 @@ const buttonContainer = {
|
|
|
25
26
|
alignItems: 'center',
|
|
26
27
|
display: 'flex',
|
|
27
28
|
justifyContent: 'flex-end',
|
|
29
|
+
paddingRight: 8,
|
|
28
30
|
};
|
|
29
31
|
const button = {
|
|
30
|
-
height:
|
|
31
|
-
width:
|
|
32
|
+
height: 16,
|
|
33
|
+
width: 16,
|
|
34
|
+
flexShrink: 0,
|
|
35
|
+
};
|
|
36
|
+
const renderCloseIcon = (color) => {
|
|
37
|
+
return jsx_runtime_1.jsx(CancelButton_1.CancelIcon, { style: { ...button, color } });
|
|
32
38
|
};
|
|
33
39
|
function MobilePanel({ children, onClose, }) {
|
|
34
40
|
const { currentZIndex } = (0, z_index_1.useZIndex)();
|
|
35
41
|
return react_dom_1.default.createPortal(jsx_runtime_1.jsxs("div", { style: container, children: [
|
|
36
|
-
jsx_runtime_1.jsx("div", { style: buttonContainer, children: jsx_runtime_1.jsx(
|
|
42
|
+
jsx_runtime_1.jsx("div", { style: buttonContainer, children: jsx_runtime_1.jsx(InlineAction_1.InlineAction, { onClick: onClose, renderAction: renderCloseIcon, title: "Close sidebar" }) }), children] }), (0, portals_1.getPortal)(currentZIndex));
|
|
37
43
|
}
|
|
@@ -7,6 +7,7 @@ exports.Modals = void 0;
|
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const react_1 = require("react");
|
|
9
9
|
const client_id_1 = require("../helpers/client-id");
|
|
10
|
+
const studio_runtime_config_1 = require("../helpers/studio-runtime-config");
|
|
10
11
|
const modals_1 = require("../state/modals");
|
|
11
12
|
const AskAiModal_1 = require("./AskAiModal");
|
|
12
13
|
const ConfirmationDialog_1 = require("./ConfirmationDialog");
|
|
@@ -25,15 +26,14 @@ const QuickSwitcher_1 = __importDefault(require("./QuickSwitcher/QuickSwitcher")
|
|
|
25
26
|
const RenderStatusModal_1 = require("./RenderModal/RenderStatusModal");
|
|
26
27
|
const ServerRenderModal_1 = require("./RenderModal/ServerRenderModal");
|
|
27
28
|
const WebRenderModal_1 = require("./RenderModal/WebRenderModal");
|
|
28
|
-
const KeyframeSettingsModal_1 = require("./Timeline/KeyframeSettingsModal");
|
|
29
29
|
const UpdateModal_1 = require("./UpdateModal/UpdateModal");
|
|
30
30
|
const Modals = ({ readOnlyStudio }) => {
|
|
31
31
|
var _a;
|
|
32
32
|
const { selectedModal: modalContextType } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
33
33
|
const canRender = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx).previewServerState.type ===
|
|
34
34
|
'connected';
|
|
35
|
-
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [modalContextType && modalContextType.type === 'new-comp' && (jsx_runtime_1.jsx(NewComposition_1.NewComposition, { folderName: modalContextType.folderName, parentName: modalContextType.parentName, stack: modalContextType.stack })), modalContextType && modalContextType.type === 'new-folder' && (jsx_runtime_1.jsx(NewFolder_1.NewFolder, { parentName: modalContextType.parentName, stack: modalContextType.stack })), modalContextType && modalContextType.type === 'duplicate-comp' && (jsx_runtime_1.jsx(DuplicateComposition_1.DuplicateComposition, { compositionType: modalContextType.compositionType, compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'delete-comp' && (jsx_runtime_1.jsx(DeleteComposition_1.DeleteComposition, { compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'rename-comp' && (jsx_runtime_1.jsx(RenameComposition_1.RenameComposition, { compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'delete-folder' && (jsx_runtime_1.jsx(DeleteFolder_1.DeleteFolder, { folderName: modalContextType.folderName, parentName: modalContextType.parentName, stack: modalContextType.stack })), modalContextType && modalContextType.type === 'rename-folder' && (jsx_runtime_1.jsx(RenameFolder_1.RenameFolder, { folderName: modalContextType.folderName, parentName: modalContextType.parentName, stack: modalContextType.stack })), modalContextType && modalContextType.type === 'rename-static-file' && (jsx_runtime_1.jsx(RenameStaticFile_1.RenameStaticFileModal, { relativePath: modalContextType.relativePath })), modalContextType && modalContextType.type === 'input-props-override' && (jsx_runtime_1.jsx(OverrideInputProps_1.OverrideInputPropsModal, {})), modalContextType && modalContextType.type === '
|
|
35
|
+
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [modalContextType && modalContextType.type === 'new-comp' && (jsx_runtime_1.jsx(NewComposition_1.NewComposition, { folderName: modalContextType.folderName, parentName: modalContextType.parentName, stack: modalContextType.stack })), modalContextType && modalContextType.type === 'new-folder' && (jsx_runtime_1.jsx(NewFolder_1.NewFolder, { parentName: modalContextType.parentName, stack: modalContextType.stack })), modalContextType && modalContextType.type === 'duplicate-comp' && (jsx_runtime_1.jsx(DuplicateComposition_1.DuplicateComposition, { compositionType: modalContextType.compositionType, compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'delete-comp' && (jsx_runtime_1.jsx(DeleteComposition_1.DeleteComposition, { compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'rename-comp' && (jsx_runtime_1.jsx(RenameComposition_1.RenameComposition, { compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'delete-folder' && (jsx_runtime_1.jsx(DeleteFolder_1.DeleteFolder, { folderName: modalContextType.folderName, parentName: modalContextType.parentName, stack: modalContextType.stack })), modalContextType && modalContextType.type === 'rename-folder' && (jsx_runtime_1.jsx(RenameFolder_1.RenameFolder, { folderName: modalContextType.folderName, parentName: modalContextType.parentName, stack: modalContextType.stack })), modalContextType && modalContextType.type === 'rename-static-file' && (jsx_runtime_1.jsx(RenameStaticFile_1.RenameStaticFileModal, { relativePath: modalContextType.relativePath })), modalContextType && modalContextType.type === 'input-props-override' && (jsx_runtime_1.jsx(OverrideInputProps_1.OverrideInputPropsModal, {})), modalContextType && modalContextType.type === 'web-render' && (jsx_runtime_1.jsx(WebRenderModal_1.WebRenderModalWithLoader, { ...modalContextType })), modalContextType &&
|
|
36
36
|
modalContextType.type === 'server-render' &&
|
|
37
|
-
(canRender || modalContextType.readOnlyStudio) ? (jsx_runtime_1.jsx(ServerRenderModal_1.RenderModalWithLoader, { readOnlyStudio: (_a = modalContextType.readOnlyStudio) !== null && _a !== void 0 ? _a : false, initialFrame: modalContextType.initialFrame, initialDarkMode: modalContextType.initialDarkMode, compositionId: modalContextType.compositionId, initialVideoImageFormat: modalContextType.initialVideoImageFormat, initialJpegQuality: modalContextType.initialJpegQuality, initialScale: modalContextType.initialScale, initialLogLevel: modalContextType.initialLogLevel, initialOffthreadVideoCacheSizeInBytes: modalContextType.initialOffthreadVideoCacheSizeInBytes, initialOffthreadVideoThreads: modalContextType.initialOffthreadVideoThreads, initialMediaCacheSizeInBytes: modalContextType.initialMediaCacheSizeInBytes, initialConcurrency: modalContextType.initialConcurrency, maxConcurrency: modalContextType.maxConcurrency, minConcurrency: modalContextType.minConcurrency, initialStillImageFormat: modalContextType.initialStillImageFormat, initialMuted: modalContextType.initialMuted, initialEnforceAudioTrack: modalContextType.initialEnforceAudioTrack, initialProResProfile: modalContextType.initialProResProfile, initialx264Preset: modalContextType.initialx264Preset, initialGopSize: modalContextType.initialGopSize, initialPixelFormat: modalContextType.initialPixelFormat, initialAudioBitrate: modalContextType.initialAudioBitrate, initialVideoBitrate: modalContextType.initialVideoBitrate, initialEveryNthFrame: modalContextType.initialEveryNthFrame, initialNumberOfGifLoops: modalContextType.initialNumberOfGifLoops, initialDelayRenderTimeout: modalContextType.initialDelayRenderTimeout, initialEnvVariables: modalContextType.initialEnvVariables, initialDisableWebSecurity: modalContextType.initialDisableWebSecurity, initialGl: modalContextType.initialOpenGlRenderer, initialHeadless: modalContextType.initialHeadless, initialIgnoreCertificateErrors: modalContextType.initialIgnoreCertificateErrors, initialEncodingBufferSize: modalContextType.initialEncodingBufferSize, initialEncodingMaxRate: modalContextType.initialEncodingMaxRate, initialUserAgent: modalContextType.initialUserAgent, initialColorSpace: modalContextType.initialColorSpace, initialMultiProcessOnLinux: modalContextType.initialMultiProcessOnLinux, initialRepro: modalContextType.initialRepro, initialBeep: modalContextType.initialBeep, initialForSeamlessAacConcatenation: modalContextType.initialForSeamlessAacConcatenation, defaultProps: modalContextType.defaultProps, inFrameMark: modalContextType.inFrameMark, outFrameMark: modalContextType.outFrameMark, defaultConfigurationAudioCodec: modalContextType.defaultConfigurationAudioCodec, defaultConfigurationVideoCodec: modalContextType.defaultConfigurationVideoCodec, renderTypeOfLastRender: modalContextType.renderTypeOfLastRender, defaultMetadata: modalContextType.defaulMetadata, initialHardwareAcceleration: modalContextType.initialHardwareAcceleration, initialSampleRate: modalContextType.initialSampleRate, initialChromeMode: modalContextType.initialChromeMode, renderDefaults: modalContextType.renderDefaults })) : null, modalContextType && modalContextType.type === 'render-progress' && (jsx_runtime_1.jsx(RenderStatusModal_1.RenderStatusModal, { jobId: modalContextType.jobId })), modalContextType && modalContextType.type === 'update' && (jsx_runtime_1.jsx(UpdateModal_1.UpdateModal, { info: modalContextType.info, knownBugs: modalContextType.knownBugs })), modalContextType && modalContextType.type === 'install-packages' && (jsx_runtime_1.jsx(InstallPackage_1.InstallPackageModal, { packageManager: modalContextType.packageManager })), modalContextType && modalContextType.type === 'quick-switcher' && (jsx_runtime_1.jsx(QuickSwitcher_1.default, { readOnlyStudio: readOnlyStudio, invocationTimestamp: modalContextType.invocationTimestamp, initialMode: modalContextType.mode })), modalContextType && modalContextType.type === 'add-effect' && (jsx_runtime_1.jsx(EffectPickerModal_1.EffectPickerModal, { state: modalContextType })), modalContextType && modalContextType.type === 'confirmation-dialog' && (jsx_runtime_1.jsx(ConfirmationDialog_1.ConfirmationDialog, { state: modalContextType })),
|
|
37
|
+
(canRender || modalContextType.readOnlyStudio) ? (jsx_runtime_1.jsx(ServerRenderModal_1.RenderModalWithLoader, { readOnlyStudio: (_a = modalContextType.readOnlyStudio) !== null && _a !== void 0 ? _a : false, initialFrame: modalContextType.initialFrame, initialDarkMode: modalContextType.initialDarkMode, compositionId: modalContextType.compositionId, initialVideoImageFormat: modalContextType.initialVideoImageFormat, initialJpegQuality: modalContextType.initialJpegQuality, initialScale: modalContextType.initialScale, initialLogLevel: modalContextType.initialLogLevel, initialOffthreadVideoCacheSizeInBytes: modalContextType.initialOffthreadVideoCacheSizeInBytes, initialOffthreadVideoThreads: modalContextType.initialOffthreadVideoThreads, initialMediaCacheSizeInBytes: modalContextType.initialMediaCacheSizeInBytes, initialConcurrency: modalContextType.initialConcurrency, maxConcurrency: modalContextType.maxConcurrency, minConcurrency: modalContextType.minConcurrency, initialStillImageFormat: modalContextType.initialStillImageFormat, initialMuted: modalContextType.initialMuted, initialEnforceAudioTrack: modalContextType.initialEnforceAudioTrack, initialProResProfile: modalContextType.initialProResProfile, initialx264Preset: modalContextType.initialx264Preset, initialGopSize: modalContextType.initialGopSize, initialPixelFormat: modalContextType.initialPixelFormat, initialAudioBitrate: modalContextType.initialAudioBitrate, initialVideoBitrate: modalContextType.initialVideoBitrate, initialEveryNthFrame: modalContextType.initialEveryNthFrame, initialNumberOfGifLoops: modalContextType.initialNumberOfGifLoops, initialDelayRenderTimeout: modalContextType.initialDelayRenderTimeout, initialEnvVariables: modalContextType.initialEnvVariables, initialDisableWebSecurity: modalContextType.initialDisableWebSecurity, initialGl: modalContextType.initialOpenGlRenderer, initialHeadless: modalContextType.initialHeadless, initialIgnoreCertificateErrors: modalContextType.initialIgnoreCertificateErrors, initialEncodingBufferSize: modalContextType.initialEncodingBufferSize, initialEncodingMaxRate: modalContextType.initialEncodingMaxRate, initialUserAgent: modalContextType.initialUserAgent, initialColorSpace: modalContextType.initialColorSpace, initialMultiProcessOnLinux: modalContextType.initialMultiProcessOnLinux, initialRepro: modalContextType.initialRepro, initialBeep: modalContextType.initialBeep, initialForSeamlessAacConcatenation: modalContextType.initialForSeamlessAacConcatenation, defaultProps: modalContextType.defaultProps, inFrameMark: modalContextType.inFrameMark, outFrameMark: modalContextType.outFrameMark, defaultConfigurationAudioCodec: modalContextType.defaultConfigurationAudioCodec, defaultConfigurationVideoCodec: modalContextType.defaultConfigurationVideoCodec, renderTypeOfLastRender: modalContextType.renderTypeOfLastRender, defaultMetadata: modalContextType.defaulMetadata, initialHardwareAcceleration: modalContextType.initialHardwareAcceleration, initialSampleRate: modalContextType.initialSampleRate, initialChromeMode: modalContextType.initialChromeMode, renderDefaults: modalContextType.renderDefaults })) : null, modalContextType && modalContextType.type === 'render-progress' && (jsx_runtime_1.jsx(RenderStatusModal_1.RenderStatusModal, { jobId: modalContextType.jobId })), modalContextType && modalContextType.type === 'update' && (jsx_runtime_1.jsx(UpdateModal_1.UpdateModal, { info: modalContextType.info, knownBugs: modalContextType.knownBugs })), modalContextType && modalContextType.type === 'install-packages' && (jsx_runtime_1.jsx(InstallPackage_1.InstallPackageModal, { packageManager: modalContextType.packageManager })), modalContextType && modalContextType.type === 'quick-switcher' && (jsx_runtime_1.jsx(QuickSwitcher_1.default, { readOnlyStudio: readOnlyStudio, invocationTimestamp: modalContextType.invocationTimestamp, initialMode: modalContextType.mode })), modalContextType && modalContextType.type === 'add-effect' && (jsx_runtime_1.jsx(EffectPickerModal_1.EffectPickerModal, { state: modalContextType })), modalContextType && modalContextType.type === 'confirmation-dialog' && (jsx_runtime_1.jsx(ConfirmationDialog_1.ConfirmationDialog, { state: modalContextType })), (0, studio_runtime_config_1.getStudioAskAIEnabled)() && jsx_runtime_1.jsx(AskAiModal_1.AskAiModal, {})] }));
|
|
38
38
|
};
|
|
39
39
|
exports.Modals = Modals;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CancelButton = void 0;
|
|
3
|
+
exports.CancelButton = exports.CancelIcon = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const colors_1 = require("../../helpers/colors");
|
|
6
6
|
const z_index_1 = require("../../state/z-index");
|
|
@@ -14,8 +14,12 @@ const style = {
|
|
|
14
14
|
justifyContent: 'center',
|
|
15
15
|
alignItems: 'center',
|
|
16
16
|
};
|
|
17
|
+
const CancelIcon = (props) => {
|
|
18
|
+
return (jsx_runtime_1.jsx("svg", { viewBox: "0 0 320 512", ...props, children: jsx_runtime_1.jsx("path", { fill: colors_1.CURRENT_COLOR, d: "M207.6 256l107.72-107.72c6.23-6.23 6.23-16.34 0-22.58l-25.03-25.03c-6.23-6.23-16.34-6.23-22.58 0L160 208.4 52.28 100.68c-6.23-6.23-16.34-6.23-22.58 0L4.68 125.7c-6.23 6.23-6.23 16.34 0 22.58L112.4 256 4.68 363.72c-6.23 6.23-6.23 16.34 0 22.58l25.03 25.03c6.23 6.23 16.34 6.23 22.58 0L160 303.6l107.72 107.72c6.23 6.23 16.34 6.23 22.58 0l25.03-25.03c6.23-6.23 6.23-16.34 0-22.58L207.6 256z" }) }));
|
|
19
|
+
};
|
|
20
|
+
exports.CancelIcon = CancelIcon;
|
|
17
21
|
const CancelButton = ({ onPress, ...props }) => {
|
|
18
22
|
const { tabIndex } = (0, z_index_1.useZIndex)();
|
|
19
|
-
return (jsx_runtime_1.jsx("button", { tabIndex: tabIndex, style: style, type: "button", onClick: onPress, children: jsx_runtime_1.jsx(
|
|
23
|
+
return (jsx_runtime_1.jsx("button", { tabIndex: tabIndex, style: style, type: "button", onClick: onPress, children: jsx_runtime_1.jsx(exports.CancelIcon, { ...props }) }));
|
|
20
24
|
};
|
|
21
25
|
exports.CancelButton = CancelButton;
|
|
@@ -5,6 +5,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const colors_1 = require("../../helpers/colors");
|
|
7
7
|
const mobile_layout_1 = require("../../helpers/mobile-layout");
|
|
8
|
+
const studio_runtime_config_1 = require("../../helpers/studio-runtime-config");
|
|
8
9
|
const use_keybinding_1 = require("../../helpers/use-keybinding");
|
|
9
10
|
const is_menu_item_1 = require("../Menu/is-menu-item");
|
|
10
11
|
const MenuDivider_1 = require("../Menu/MenuDivider");
|
|
@@ -168,8 +169,7 @@ const MenuContent = ({ onHide, values, preselectIndex, onNextMenu, onPreviousMen
|
|
|
168
169
|
return containerStyles;
|
|
169
170
|
}, [fixedHeight, isMobileLayout]);
|
|
170
171
|
(0, react_1.useEffect)(() => {
|
|
171
|
-
if (!keybindings.isHighestContext ||
|
|
172
|
-
!process.env.KEYBOARD_SHORTCUTS_ENABLED) {
|
|
172
|
+
if (!keybindings.isHighestContext || !(0, studio_runtime_config_1.getStudioKeyboardShortcutsEnabled)()) {
|
|
173
173
|
return;
|
|
174
174
|
}
|
|
175
175
|
const onKeyDown = (event) => {
|
|
@@ -121,7 +121,7 @@ const CompWhenItHasDimensions = ({ contentDimensions, canvasSize, canvasContent,
|
|
|
121
121
|
if (canvasContent.type === 'output-blob') {
|
|
122
122
|
return (jsx_runtime_1.jsx("div", { style: outer, children: jsx_runtime_1.jsx(RenderPreview_1.RenderPreview, { path: canvasContent.displayName, assetMetadata: assetMetadata, getBlob: canvasContent.getBlob }) }));
|
|
123
123
|
}
|
|
124
|
-
return (jsx_runtime_1.jsxs("div", { style: outer, children: [
|
|
124
|
+
return (jsx_runtime_1.jsxs("div", { className: "remotion-studio-composition-container", style: outer, children: [
|
|
125
125
|
jsx_runtime_1.jsx(PortalContainer, { contentDimensions: contentDimensions, scale: scale, xCorrection: xCorrection, yCorrection: yCorrection }), jsx_runtime_1.jsx(SelectedOutlineOverlay_1.SelectedOutlineOverlay, { compositionHeight: contentDimensions.height, compositionWidth: contentDimensions.width, scale: scale, translationX: previewSize.translation.x, translationY: previewSize.translation.y })
|
|
126
126
|
] }));
|
|
127
127
|
};
|
|
@@ -5,8 +5,13 @@ export { applySelectedOutlineDragAxisLock, applySelectedOutlineTransformOriginAx
|
|
|
5
5
|
export { getOutlineSelectionInteraction, getSelectedEffectFieldsBySequenceKey, getSelectedOutlineRotationCornerInfo, getSelectedOutlineRotationDeltaDegrees, getSelectedOutlineRotationPivot, getSelectedSequenceKeys, getSequencesWithSelectableOutlines, getTransformedSvgViewportPoints, } from './selected-outline-measurement';
|
|
6
6
|
export { selectedOutlineDragThresholdPx } from './selected-outline-types';
|
|
7
7
|
export type { SelectedOutlineDragState, SelectedOutlineRotationDragState, SelectedOutlineScaleDragState, } from './selected-outline-types';
|
|
8
|
-
|
|
8
|
+
type OutlineSequenceParent = {
|
|
9
|
+
readonly id: string;
|
|
10
|
+
readonly parent: string | null;
|
|
11
|
+
};
|
|
12
|
+
export declare const orderOutlinesForRendering: ({ outlines, sequences, targetsByKey, }: {
|
|
9
13
|
readonly outlines: readonly SelectedOutline[];
|
|
14
|
+
readonly sequences: readonly OutlineSequenceParent[];
|
|
10
15
|
readonly targetsByKey: ReadonlyMap<string, SelectedOutlineTarget>;
|
|
11
16
|
}) => readonly SelectedOutline[];
|
|
12
17
|
export declare const SelectedOutlineOverlay: React.FC<{
|
|
@@ -111,13 +111,251 @@ const SelectedOutlineSnapIndicators = ({ activeSnapPoints, compositionHeight, co
|
|
|
111
111
|
return (jsx_runtime_1.jsx("line", { x1: 0, x2: compositionWidth * scale, y1: y, y2: y, stroke: selected_outline_snap_1.selectedOutlineSnapIndicatorColor, strokeWidth: 1, vectorEffect: "non-scaling-stroke" }, `${snapPoint.target.axis}-${snapPoint.target.type}-${snapPoint.target.position}-${snapPoint.edge}`));
|
|
112
112
|
}) }));
|
|
113
113
|
};
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
114
|
+
const outlinePointEqualityTolerance = 0.5;
|
|
115
|
+
const outlineAreaEqualityTolerance = 0.5;
|
|
116
|
+
const outlineBoundsOverlapTolerance = 0.5;
|
|
117
|
+
const outlinePointsAreEquivalent = (a, b) => {
|
|
118
|
+
return (Math.abs(a.x - b.x) <= outlinePointEqualityTolerance &&
|
|
119
|
+
Math.abs(a.y - b.y) <= outlinePointEqualityTolerance);
|
|
120
|
+
};
|
|
121
|
+
const outlinesHaveEquivalentHitArea = (a, b) => {
|
|
122
|
+
if (a.points.length !== b.points.length) {
|
|
123
|
+
return false;
|
|
124
|
+
}
|
|
125
|
+
for (let startIndex = 0; startIndex < b.points.length; startIndex++) {
|
|
126
|
+
for (const direction of [1, -1]) {
|
|
127
|
+
const pointsMatch = a.points.every((point, index) => {
|
|
128
|
+
const bIndex = (startIndex + direction * index + b.points.length) % b.points.length;
|
|
129
|
+
return outlinePointsAreEquivalent(point, b.points[bIndex]);
|
|
130
|
+
});
|
|
131
|
+
if (pointsMatch) {
|
|
132
|
+
return true;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
return false;
|
|
137
|
+
};
|
|
138
|
+
const getOutlineHitArea = (outline) => {
|
|
139
|
+
let area = 0;
|
|
140
|
+
for (let i = 0; i < outline.points.length; i++) {
|
|
141
|
+
const current = outline.points[i];
|
|
142
|
+
const next = outline.points[(i + 1) % outline.points.length];
|
|
143
|
+
area += current.x * next.y - next.x * current.y;
|
|
144
|
+
}
|
|
145
|
+
return Math.abs(area) / 2;
|
|
146
|
+
};
|
|
147
|
+
const getOutlineBounds = (outline) => {
|
|
148
|
+
const xs = outline.points.map((point) => point.x);
|
|
149
|
+
const ys = outline.points.map((point) => point.y);
|
|
150
|
+
return {
|
|
151
|
+
maxX: Math.max(...xs),
|
|
152
|
+
maxY: Math.max(...ys),
|
|
153
|
+
minX: Math.min(...xs),
|
|
154
|
+
minY: Math.min(...ys),
|
|
155
|
+
};
|
|
156
|
+
};
|
|
157
|
+
const outlineBoundsOverlap = (a, b) => {
|
|
158
|
+
const aBounds = getOutlineBounds(a);
|
|
159
|
+
const bBounds = getOutlineBounds(b);
|
|
160
|
+
return (aBounds.minX <= bBounds.maxX + outlineBoundsOverlapTolerance &&
|
|
161
|
+
aBounds.maxX + outlineBoundsOverlapTolerance >= bBounds.minX &&
|
|
162
|
+
aBounds.minY <= bBounds.maxY + outlineBoundsOverlapTolerance &&
|
|
163
|
+
aBounds.maxY + outlineBoundsOverlapTolerance >= bBounds.minY);
|
|
164
|
+
};
|
|
165
|
+
const getSequenceId = (target) => {
|
|
166
|
+
var _a;
|
|
167
|
+
var _b;
|
|
168
|
+
return (_b = (_a = target === null || target === void 0 ? void 0 : target.sequence) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : null;
|
|
169
|
+
};
|
|
170
|
+
const getParentBySequenceId = ({ sequences, targetsByKey, }) => {
|
|
171
|
+
const parentBySequenceId = new Map();
|
|
172
|
+
for (const sequence of sequences) {
|
|
173
|
+
parentBySequenceId.set(sequence.id, sequence.parent);
|
|
174
|
+
}
|
|
175
|
+
for (const target of targetsByKey.values()) {
|
|
176
|
+
const sequenceId = getSequenceId(target);
|
|
177
|
+
if (sequenceId !== null && !parentBySequenceId.has(sequenceId)) {
|
|
178
|
+
parentBySequenceId.set(sequenceId, target.sequence.parent);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
return parentBySequenceId;
|
|
182
|
+
};
|
|
183
|
+
const isAncestorTarget = ({ ancestor, descendant, parentBySequenceId, }) => {
|
|
184
|
+
var _a;
|
|
185
|
+
var _b, _c;
|
|
186
|
+
const ancestorId = getSequenceId(ancestor);
|
|
187
|
+
if (ancestorId === null) {
|
|
188
|
+
return false;
|
|
189
|
+
}
|
|
190
|
+
let parentId = (_b = (_a = descendant.sequence) === null || _a === void 0 ? void 0 : _a.parent) !== null && _b !== void 0 ? _b : null;
|
|
191
|
+
while (parentId !== null) {
|
|
192
|
+
if (parentId === ancestorId) {
|
|
193
|
+
return true;
|
|
194
|
+
}
|
|
195
|
+
parentId = (_c = parentBySequenceId.get(parentId)) !== null && _c !== void 0 ? _c : null;
|
|
196
|
+
}
|
|
197
|
+
return false;
|
|
198
|
+
};
|
|
199
|
+
const orderOutlineGroup = ({ outlines, parentBySequenceId, targetsByKey, }) => {
|
|
200
|
+
var _a;
|
|
201
|
+
var _b, _c, _d, _e;
|
|
202
|
+
const incomingEdges = new Map();
|
|
203
|
+
const outgoingEdges = new Map();
|
|
204
|
+
const outlinesByKey = new Map(outlines.map((outline) => [outline.key, outline]));
|
|
205
|
+
for (const outline of outlines) {
|
|
206
|
+
incomingEdges.set(outline.key, new Set());
|
|
207
|
+
outgoingEdges.set(outline.key, new Set());
|
|
208
|
+
}
|
|
209
|
+
const hasPath = ({ fromKey, seen, toKey, }) => {
|
|
210
|
+
var _a;
|
|
211
|
+
if (fromKey === toKey) {
|
|
212
|
+
return true;
|
|
213
|
+
}
|
|
214
|
+
if (seen.has(fromKey)) {
|
|
215
|
+
return false;
|
|
216
|
+
}
|
|
217
|
+
seen.add(fromKey);
|
|
218
|
+
for (const nextKey of (_a = outgoingEdges.get(fromKey)) !== null && _a !== void 0 ? _a : []) {
|
|
219
|
+
if (hasPath({ fromKey: nextKey, seen, toKey })) {
|
|
220
|
+
return true;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
return false;
|
|
224
|
+
};
|
|
225
|
+
const addEdge = (before, after, options) => {
|
|
226
|
+
if (before.key === after.key) {
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
const incoming = incomingEdges.get(after.key);
|
|
230
|
+
const outgoing = outgoingEdges.get(before.key);
|
|
231
|
+
if (incoming === undefined || outgoing === undefined) {
|
|
232
|
+
throw new Error('Expected outline to be registered before adding edge');
|
|
233
|
+
}
|
|
234
|
+
if (outgoing.has(after.key)) {
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
237
|
+
if (hasPath({ fromKey: after.key, seen: new Set(), toKey: before.key })) {
|
|
238
|
+
if (options === null || options === void 0 ? void 0 : options.skipIfCycle) {
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
241
|
+
throw new Error('Could not determine a stable outline rendering order');
|
|
242
|
+
}
|
|
243
|
+
incoming.add(before.key);
|
|
244
|
+
outgoing.add(after.key);
|
|
245
|
+
};
|
|
246
|
+
const addAncestorConstraint = ({ ancestor, descendant, descendantContainsSelection, equivalentHitArea, }) => {
|
|
247
|
+
// Usually, children should be above parents so nested elements are directly
|
|
248
|
+
// selectable. If an unselected child has the same hit area as its parent, put
|
|
249
|
+
// it below the parent so the wrapper can be selected. Once the child or
|
|
250
|
+
// one of its properties is selected, keep it above the parent so it remains
|
|
251
|
+
// directly draggable.
|
|
252
|
+
if (equivalentHitArea && !descendantContainsSelection) {
|
|
253
|
+
addEdge(descendant, ancestor);
|
|
254
|
+
}
|
|
255
|
+
else {
|
|
256
|
+
addEdge(ancestor, descendant);
|
|
257
|
+
}
|
|
258
|
+
};
|
|
259
|
+
const outlineBySequenceId = new Map();
|
|
260
|
+
for (const outline of outlines) {
|
|
261
|
+
const sequenceId = getSequenceId(targetsByKey.get(outline.key));
|
|
262
|
+
if (sequenceId !== null) {
|
|
263
|
+
outlineBySequenceId.set(sequenceId, outline);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
// Only constrain each outline against its nearest rendered ancestor. The
|
|
267
|
+
// resulting graph follows the sequence tree, so pairwise subpixel equivalence
|
|
268
|
+
// cannot introduce contradictory edges across three nested outlines.
|
|
269
|
+
for (const descendant of outlines) {
|
|
270
|
+
const descendantTarget = targetsByKey.get(descendant.key);
|
|
271
|
+
let parentId = (_b = (_a = descendantTarget === null || descendantTarget === void 0 ? void 0 : descendantTarget.sequence) === null || _a === void 0 ? void 0 : _a.parent) !== null && _b !== void 0 ? _b : null;
|
|
272
|
+
while (parentId !== null) {
|
|
273
|
+
const ancestor = outlineBySequenceId.get(parentId);
|
|
274
|
+
if (ancestor !== undefined) {
|
|
275
|
+
addAncestorConstraint({
|
|
276
|
+
ancestor,
|
|
277
|
+
descendant,
|
|
278
|
+
descendantContainsSelection: ((_c = descendantTarget === null || descendantTarget === void 0 ? void 0 : descendantTarget.selected) !== null && _c !== void 0 ? _c : false) ||
|
|
279
|
+
((_d = descendantTarget === null || descendantTarget === void 0 ? void 0 : descendantTarget.containsSelection) !== null && _d !== void 0 ? _d : false),
|
|
280
|
+
equivalentHitArea: outlinesHaveEquivalentHitArea(ancestor, descendant),
|
|
281
|
+
});
|
|
282
|
+
break;
|
|
283
|
+
}
|
|
284
|
+
parentId = (_e = parentBySequenceId.get(parentId)) !== null && _e !== void 0 ? _e : null;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
// For unrelated overlapping outlines, put broader hit targets below
|
|
288
|
+
// smaller ones so a large selected sequence cannot swallow clicks on
|
|
289
|
+
// a more specific element in the same canvas area.
|
|
290
|
+
for (let i = 0; i < outlines.length; i++) {
|
|
291
|
+
for (let j = i + 1; j < outlines.length; j++) {
|
|
292
|
+
const a = outlines[i];
|
|
293
|
+
const b = outlines[j];
|
|
294
|
+
const aTarget = targetsByKey.get(a.key);
|
|
295
|
+
const bTarget = targetsByKey.get(b.key);
|
|
296
|
+
if (aTarget === undefined || bTarget === undefined) {
|
|
297
|
+
continue;
|
|
298
|
+
}
|
|
299
|
+
const aAncestorOfB = isAncestorTarget({
|
|
300
|
+
ancestor: aTarget,
|
|
301
|
+
descendant: bTarget,
|
|
302
|
+
parentBySequenceId,
|
|
303
|
+
});
|
|
304
|
+
const bAncestorOfA = isAncestorTarget({
|
|
305
|
+
ancestor: bTarget,
|
|
306
|
+
descendant: aTarget,
|
|
307
|
+
parentBySequenceId,
|
|
308
|
+
});
|
|
309
|
+
if (aAncestorOfB || bAncestorOfA || !outlineBoundsOverlap(a, b)) {
|
|
310
|
+
continue;
|
|
311
|
+
}
|
|
312
|
+
const aArea = getOutlineHitArea(a);
|
|
313
|
+
const bArea = getOutlineHitArea(b);
|
|
314
|
+
if (Math.abs(aArea - bArea) <= outlineAreaEqualityTolerance) {
|
|
315
|
+
continue;
|
|
316
|
+
}
|
|
317
|
+
if (aArea > bArea) {
|
|
318
|
+
addEdge(a, b, { skipIfCycle: true });
|
|
319
|
+
}
|
|
320
|
+
else {
|
|
321
|
+
addEdge(b, a, { skipIfCycle: true });
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
const emitted = new Set();
|
|
326
|
+
const visiting = new Set();
|
|
327
|
+
const ordered = [];
|
|
328
|
+
const visit = (outline) => {
|
|
329
|
+
var _a;
|
|
330
|
+
if (emitted.has(outline.key)) {
|
|
331
|
+
return;
|
|
332
|
+
}
|
|
333
|
+
if (visiting.has(outline.key)) {
|
|
334
|
+
throw new Error('Could not determine a stable outline rendering order');
|
|
335
|
+
}
|
|
336
|
+
visiting.add(outline.key);
|
|
337
|
+
for (const dependencyKey of (_a = incomingEdges.get(outline.key)) !== null && _a !== void 0 ? _a : []) {
|
|
338
|
+
const dependency = outlinesByKey.get(dependencyKey);
|
|
339
|
+
if (dependency === undefined) {
|
|
340
|
+
throw new Error('Expected outline dependency to exist');
|
|
341
|
+
}
|
|
342
|
+
visit(dependency);
|
|
343
|
+
}
|
|
344
|
+
visiting.delete(outline.key);
|
|
345
|
+
emitted.add(outline.key);
|
|
346
|
+
ordered.push(outline);
|
|
347
|
+
};
|
|
348
|
+
for (const outline of outlines) {
|
|
349
|
+
visit(outline);
|
|
350
|
+
}
|
|
351
|
+
return ordered;
|
|
352
|
+
};
|
|
353
|
+
const orderOutlinesForRendering = ({ outlines, sequences, targetsByKey, }) => {
|
|
354
|
+
const parentBySequenceId = getParentBySequenceId({ sequences, targetsByKey });
|
|
355
|
+
return orderOutlineGroup({
|
|
356
|
+
outlines,
|
|
357
|
+
parentBySequenceId,
|
|
358
|
+
targetsByKey,
|
|
121
359
|
});
|
|
122
360
|
};
|
|
123
361
|
exports.orderOutlinesForRendering = orderOutlinesForRendering;
|
|
@@ -414,8 +652,8 @@ const SelectedOutlineOverlay = ({ compositionHeight, compositionWidth, scale, tr
|
|
|
414
652
|
return new Map(outlineTargets.map((target) => [target.key, target]));
|
|
415
653
|
}, [outlineTargets]);
|
|
416
654
|
const outlinesForRendering = (0, react_1.useMemo)(() => {
|
|
417
|
-
return (0, exports.orderOutlinesForRendering)({ outlines, targetsByKey });
|
|
418
|
-
}, [outlines, targetsByKey]);
|
|
655
|
+
return (0, exports.orderOutlinesForRendering)({ outlines, sequences, targetsByKey });
|
|
656
|
+
}, [outlines, sequences, targetsByKey]);
|
|
419
657
|
const outlinesByKey = (0, react_1.useMemo)(() => {
|
|
420
658
|
return new Map(outlines.map((outline) => [outline.key, outline]));
|
|
421
659
|
}, [outlines]);
|
|
@@ -2,13 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MaxTimelineTracksReached = exports.MAX_TIMELINE_TRACKS_NOTICE_HEIGHT = exports.MAX_TIMELINE_TRACKS = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const studio_shared_1 = require("@remotion/studio-shared");
|
|
6
5
|
const colors_1 = require("../../helpers/colors");
|
|
6
|
+
const studio_runtime_config_1 = require("../../helpers/studio-runtime-config");
|
|
7
7
|
const timeline_layout_1 = require("../../helpers/timeline-layout");
|
|
8
|
-
exports.MAX_TIMELINE_TRACKS =
|
|
9
|
-
process.env.MAX_TIMELINE_TRACKS === null
|
|
10
|
-
? studio_shared_1.DEFAULT_TIMELINE_TRACKS
|
|
11
|
-
: Number(process.env.MAX_TIMELINE_TRACKS);
|
|
8
|
+
exports.MAX_TIMELINE_TRACKS = (0, studio_runtime_config_1.getStudioMaxTimelineTracks)();
|
|
12
9
|
exports.MAX_TIMELINE_TRACKS_NOTICE_HEIGHT = 24;
|
|
13
10
|
const container = {
|
|
14
11
|
height: exports.MAX_TIMELINE_TRACKS_NOTICE_HEIGHT,
|
|
@@ -90,6 +90,9 @@ const effectPropStatusToClipboardParam = (prop) => {
|
|
|
90
90
|
keyframes: prop.keyframes,
|
|
91
91
|
easing: prop.easing,
|
|
92
92
|
clamping: prop.clamping,
|
|
93
|
+
...(prop.output === undefined || prop.output === 'linear'
|
|
94
|
+
? {}
|
|
95
|
+
: { output: prop.output }),
|
|
93
96
|
...(prop.posterize === undefined ? {} : { posterize: prop.posterize }),
|
|
94
97
|
};
|
|
95
98
|
};
|
|
@@ -6,7 +6,6 @@ const studio_shared_1 = require("@remotion/studio-shared");
|
|
|
6
6
|
const react_1 = require("react");
|
|
7
7
|
const remotion_1 = require("remotion");
|
|
8
8
|
const client_id_1 = require("../../helpers/client-id");
|
|
9
|
-
const modals_1 = require("../../state/modals");
|
|
10
9
|
const call_api_1 = require("../call-api");
|
|
11
10
|
const ContextMenu_1 = require("../ContextMenu");
|
|
12
11
|
const call_add_keyframe_1 = require("./call-add-keyframe");
|
|
@@ -216,7 +215,6 @@ const TimelineEffectPropItem = ({ field, validatedLocation, rowDepth, nodePath,
|
|
|
216
215
|
var _a;
|
|
217
216
|
var _b, _c;
|
|
218
217
|
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
219
|
-
const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
220
218
|
const { setPropStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
|
|
221
219
|
const { propStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesContext);
|
|
222
220
|
const { getEffectDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeDragOverridesContext);
|
|
@@ -302,33 +300,8 @@ const TimelineEffectPropItem = ({ field, validatedLocation, rowDepth, nodePath,
|
|
|
302
300
|
setPropStatuses,
|
|
303
301
|
validatedLocation.source,
|
|
304
302
|
]);
|
|
305
|
-
const onOpenKeyframeSettings = (0, react_1.useCallback)(() => {
|
|
306
|
-
var _a;
|
|
307
|
-
if (propStatus === null || !isKeyframedStatus(propStatus)) {
|
|
308
|
-
return;
|
|
309
|
-
}
|
|
310
|
-
setSelectedModal({
|
|
311
|
-
type: 'keyframe-settings',
|
|
312
|
-
fileName: validatedLocation.source,
|
|
313
|
-
nodePath,
|
|
314
|
-
fieldKey: field.key,
|
|
315
|
-
fieldLabel: (_a = field.description) !== null && _a !== void 0 ? _a : field.key,
|
|
316
|
-
status: propStatus,
|
|
317
|
-
schema: field.effectSchema,
|
|
318
|
-
effectIndex: field.effectIndex,
|
|
319
|
-
});
|
|
320
|
-
}, [
|
|
321
|
-
field.description,
|
|
322
|
-
field.effectIndex,
|
|
323
|
-
field.effectSchema,
|
|
324
|
-
field.key,
|
|
325
|
-
nodePath,
|
|
326
|
-
propStatus,
|
|
327
|
-
setSelectedModal,
|
|
328
|
-
validatedLocation.source,
|
|
329
|
-
]);
|
|
330
303
|
const contextMenuValues = (0, react_1.useMemo)(() => {
|
|
331
|
-
|
|
304
|
+
return [
|
|
332
305
|
{
|
|
333
306
|
type: 'item',
|
|
334
307
|
id: 'reset-effect-field',
|
|
@@ -342,28 +315,7 @@ const TimelineEffectPropItem = ({ field, validatedLocation, rowDepth, nodePath,
|
|
|
342
315
|
value: 'reset-effect-field',
|
|
343
316
|
},
|
|
344
317
|
];
|
|
345
|
-
|
|
346
|
-
values.push({
|
|
347
|
-
type: 'item',
|
|
348
|
-
id: 'keyframe-settings-effect-field',
|
|
349
|
-
keyHint: null,
|
|
350
|
-
label: 'Keyframe settings...',
|
|
351
|
-
leftItem: null,
|
|
352
|
-
disabled: previewServerState.type !== 'connected',
|
|
353
|
-
onClick: onOpenKeyframeSettings,
|
|
354
|
-
quickSwitcherLabel: null,
|
|
355
|
-
subMenu: null,
|
|
356
|
-
value: 'keyframe-settings-effect-field',
|
|
357
|
-
});
|
|
358
|
-
}
|
|
359
|
-
return values;
|
|
360
|
-
}, [
|
|
361
|
-
canShowReset,
|
|
362
|
-
onOpenKeyframeSettings,
|
|
363
|
-
onReset,
|
|
364
|
-
previewServerState,
|
|
365
|
-
propStatus,
|
|
366
|
-
]);
|
|
318
|
+
}, [canShowReset, onReset]);
|
|
367
319
|
const seekToDisplayFrame = (0, react_1.useCallback)((frame) => {
|
|
368
320
|
setFrame((current) => {
|
|
369
321
|
const next = { ...current, [videoConfig.id]: frame };
|
|
@@ -41,6 +41,7 @@ const client_id_1 = require("../../helpers/client-id");
|
|
|
41
41
|
const colors_1 = require("../../helpers/colors");
|
|
42
42
|
const format_file_location_1 = require("../../helpers/format-file-location");
|
|
43
43
|
const interactivity_enabled_1 = require("../../helpers/interactivity-enabled");
|
|
44
|
+
const studio_runtime_config_1 = require("../../helpers/studio-runtime-config");
|
|
44
45
|
const timeline_layout_1 = require("../../helpers/timeline-layout");
|
|
45
46
|
const use_keybinding_1 = require("../../helpers/use-keybinding");
|
|
46
47
|
const modals_1 = require("../../state/modals");
|
|
@@ -534,18 +535,17 @@ const TimelineSequenceItem = ({ nestedDepth, sequence, nodePathInfo, keyframeDis
|
|
|
534
535
|
codeHiddenStatus !== undefined &&
|
|
535
536
|
codeHiddenStatus !== null &&
|
|
536
537
|
codeHiddenStatus.status === 'static';
|
|
537
|
-
const
|
|
538
|
+
const onShowInEditorDoubleClick = (0, react_1.useCallback)((e) => {
|
|
539
|
+
if (!canOpenInEditor) {
|
|
540
|
+
return;
|
|
541
|
+
}
|
|
538
542
|
if ((0, TimelineSelection_1.isTimelineSelectionModifierEvent)(e)) {
|
|
539
543
|
e.stopPropagation();
|
|
540
544
|
return;
|
|
541
545
|
}
|
|
542
546
|
e.stopPropagation();
|
|
543
|
-
if (canRenameThisSequence) {
|
|
544
|
-
setIsRenaming(true);
|
|
545
|
-
return;
|
|
546
|
-
}
|
|
547
547
|
openInEditor();
|
|
548
|
-
}, [
|
|
548
|
+
}, [canOpenInEditor, openInEditor]);
|
|
549
549
|
const canRenameSelectedSequence = canRenameThisSequence &&
|
|
550
550
|
selected &&
|
|
551
551
|
selectedItems.length === 1 &&
|
|
@@ -558,7 +558,7 @@ const TimelineSequenceItem = ({ nestedDepth, sequence, nodePathInfo, keyframeDis
|
|
|
558
558
|
await saveName(name);
|
|
559
559
|
}, [saveName]);
|
|
560
560
|
react_1.default.useEffect(() => {
|
|
561
|
-
if (!canRenameSelectedSequence || !
|
|
561
|
+
if (!canRenameSelectedSequence || !(0, studio_runtime_config_1.getStudioKeyboardShortcutsEnabled)()) {
|
|
562
562
|
setIsRenaming(false);
|
|
563
563
|
return;
|
|
564
564
|
}
|
|
@@ -765,9 +765,7 @@ const TimelineSequenceItem = ({ nestedDepth, sequence, nodePathInfo, keyframeDis
|
|
|
765
765
|
clientId: previewServerState.clientId,
|
|
766
766
|
});
|
|
767
767
|
}, [canDropEffect, nodePath, previewServerState, validatedLocation]);
|
|
768
|
-
const trackRow = (jsx_runtime_1.jsx(TimelineRowChrome_1.TimelineRowChrome, { depth: nestedDepth, eye: canToggleVisibility ? (jsx_runtime_1.jsx(TimelineLayerEye_1.TimelineLayerEye, { type: sequence.type === 'audio' ? 'speaker' : 'eye', hidden: isItemHidden, onInvoked: onToggleVisibility })) : (jsx_runtime_1.jsx(TimelineLayerEye_1.TimelineLayerEyeSpacer, {})), arrow: hasExpandableContent && nodePathInfo !== null ? (jsx_runtime_1.jsx(TimelineSequenceExpandArrow, { disabled: !previewInteractive, isExpanded: isExpanded, nodePathInfo: nodePathInfo, onToggleExpand: onToggleExpand, sequence: sequence })) : (jsx_runtime_1.jsx(TimelineExpandArrowButton_1.TimelineExpandArrowSpacer, {})), style: rowStyle, selected: selected, selectable: selectable, selectionItem: selectionItem, onSelect: onSelect, showSelectedBackground: true, containsSelection: containsSelection, outerHeight: outerHeight, onDragLeave: canDropEffect ? onEffectDragLeave : undefined, onDragOver: canDropEffect ? onEffectDragOver : undefined, onDrop: canDropEffect ? onEffectDrop : undefined, onDoubleClick:
|
|
769
|
-
? onSequenceDoubleClick
|
|
770
|
-
: undefined, children: jsx_runtime_1.jsxs("div", { style: labelContainerStyle, children: [
|
|
768
|
+
const trackRow = (jsx_runtime_1.jsx(TimelineRowChrome_1.TimelineRowChrome, { depth: nestedDepth, eye: canToggleVisibility ? (jsx_runtime_1.jsx(TimelineLayerEye_1.TimelineLayerEye, { type: sequence.type === 'audio' ? 'speaker' : 'eye', hidden: isItemHidden, onInvoked: onToggleVisibility })) : (jsx_runtime_1.jsx(TimelineLayerEye_1.TimelineLayerEyeSpacer, {})), arrow: hasExpandableContent && nodePathInfo !== null ? (jsx_runtime_1.jsx(TimelineSequenceExpandArrow, { disabled: !previewInteractive, isExpanded: isExpanded, nodePathInfo: nodePathInfo, onToggleExpand: onToggleExpand, sequence: sequence })) : (jsx_runtime_1.jsx(TimelineExpandArrowButton_1.TimelineExpandArrowSpacer, {})), style: rowStyle, selected: selected, selectable: selectable, selectionItem: selectionItem, onSelect: onSelect, showSelectedBackground: true, containsSelection: containsSelection, outerHeight: outerHeight, onDragLeave: canDropEffect ? onEffectDragLeave : undefined, onDragOver: canDropEffect ? onEffectDragOver : undefined, onDrop: canDropEffect ? onEffectDrop : undefined, onDoubleClick: canOpenInEditor ? onShowInEditorDoubleClick : undefined, children: jsx_runtime_1.jsxs("div", { style: labelContainerStyle, children: [
|
|
771
769
|
jsx_runtime_1.jsx(TimelineSequenceName_1.TimelineSequenceName, { displayName: displayName, fallbackDisplayName: fallbackDisplayName, selected: selected, containsSelection: containsSelection, editing: isRenaming, onCancelEditing: onCancelRenaming, onSaveName: onSaveName }), mediaSrc ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
772
770
|
jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }),
|
|
773
771
|
" ",
|
|
@@ -66,9 +66,7 @@ const TimelineSequenceName = ({ displayName, fallbackDisplayName, selected, cont
|
|
|
66
66
|
return;
|
|
67
67
|
}
|
|
68
68
|
input.focus();
|
|
69
|
-
|
|
70
|
-
const selectionEnd = basenameIndex > 0 ? basenameIndex : editableDisplayName.length;
|
|
71
|
-
input.setSelectionRange(0, selectionEnd);
|
|
69
|
+
input.select();
|
|
72
70
|
}, [editableDisplayName, editing]);
|
|
73
71
|
const save = (0, react_1.useCallback)(() => {
|
|
74
72
|
onSaveName(draftName).catch(() => undefined);
|