@remotion/studio 4.0.489 → 4.0.491
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 +20 -2
- package/dist/components/CurrentComposition.js +4 -1
- package/dist/components/EditorContent.js +1 -1
- package/dist/components/GlobalKeybindings.d.ts +1 -3
- package/dist/components/GlobalKeybindings.js +2 -9
- package/dist/components/InspectorLocationCopy.d.ts +7 -0
- package/dist/components/InspectorLocationCopy.js +65 -0
- 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/SequenceInspectorHeader.js +4 -3
- 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 +4 -0
- package/dist/components/MobilePanel.js +9 -3
- package/dist/components/Modals.js +1 -2
- package/dist/components/NewComposition/CancelButton.d.ts +1 -0
- package/dist/components/NewComposition/CancelButton.js +6 -2
- package/dist/components/OptionsPanel.js +4 -8
- package/dist/components/OutlineToggle.d.ts +3 -1
- package/dist/components/OutlineToggle.js +2 -2
- package/dist/components/Preview.js +1 -1
- package/dist/components/PreviewToolbar.js +1 -1
- package/dist/components/RenderButton.js +9 -33
- package/dist/components/RenderModal/WebRenderModal.js +3 -8
- package/dist/components/RenderModal/WebRenderModalAdvanced.d.ts +0 -2
- package/dist/components/RenderModal/WebRenderModalAdvanced.js +2 -9
- package/dist/components/RenderQueue/ClientRenderQueueProcessor.js +0 -2
- package/dist/components/RenderQueue/client-side-render-types.d.ts +0 -1
- package/dist/components/RenderQueue/index.js +0 -9
- package/dist/components/SelectedOutlineElement.js +40 -38
- package/dist/components/SelectedOutlineOverlay.d.ts +7 -2
- package/dist/components/SelectedOutlineOverlay.js +249 -22
- package/dist/components/SnappingToggle.d.ts +3 -1
- package/dist/components/SnappingToggle.js +2 -2
- package/dist/components/Timeline/TimelineClipboardKeybindings.d.ts +20 -1
- package/dist/components/Timeline/TimelineClipboardKeybindings.js +304 -155
- package/dist/components/Timeline/TimelineEffectPropItem.js +9 -61
- package/dist/components/Timeline/TimelineFieldLabel.d.ts +1 -0
- package/dist/components/Timeline/TimelineFieldLabel.js +4 -2
- package/dist/components/Timeline/TimelineFieldRowContent.d.ts +8 -0
- package/dist/components/Timeline/TimelineFieldRowContent.js +16 -0
- package/dist/components/Timeline/TimelinePrimitiveFieldValue.js +1 -1
- package/dist/components/Timeline/TimelineRowChrome.js +2 -0
- package/dist/components/Timeline/TimelineSequence.js +2 -4
- package/dist/components/Timeline/TimelineSequenceItem.js +6 -9
- package/dist/components/Timeline/TimelineSequenceName.js +1 -3
- package/dist/components/Timeline/TimelineSequencePropItem.js +10 -59
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +2 -0
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +18 -6
- package/dist/components/Timeline/TimelineTextContentField.js +12 -5
- package/dist/components/Timeline/TimelineVideoInfo.d.ts +3 -1
- package/dist/components/Timeline/TimelineVideoInfo.js +11 -4
- package/dist/components/Timeline/delete-selected-timeline-item.js +4 -5
- package/dist/components/Timeline/effects-clipboard.d.ts +14 -0
- package/dist/components/Timeline/effects-clipboard.js +68 -0
- package/dist/components/Timeline/get-sequence-context-menu-items.js +37 -0
- package/dist/components/Timeline/get-timeline-media-start-frame.d.ts +6 -0
- package/dist/components/Timeline/get-timeline-media-start-frame.js +15 -0
- package/dist/components/Timeline/sequence-props-subscription-store.d.ts +3 -2
- package/dist/components/Timeline/sequence-props-subscription-store.js +4 -2
- package/dist/components/Timeline/timeline-field-row-layout.d.ts +1 -0
- package/dist/components/Timeline/timeline-field-row-layout.js +8 -1
- package/dist/components/Timeline/timeline-row-layout.d.ts +1 -1
- package/dist/components/Timeline/timeline-row-layout.js +1 -1
- package/dist/components/Timeline/use-sequence-props-subscription.js +10 -1
- package/dist/components/import-assets.d.ts +5 -0
- package/dist/components/import-assets.js +10 -2
- package/dist/components/selected-outline-measurement.d.ts +4 -0
- package/dist/components/selected-outline-measurement.js +3 -1
- package/dist/components/selected-outline-types.d.ts +1 -6
- package/dist/esm/{chunk-jrta3xaf.js → chunk-9wh9k3jj.js} +10393 -9551
- package/dist/esm/index.mjs +0 -1
- package/dist/esm/internals.mjs +10393 -9551
- package/dist/esm/previewEntry.mjs +7603 -6761
- package/dist/esm/renderEntry.mjs +1 -1
- package/dist/helpers/format-file-location.d.ts +5 -0
- package/dist/helpers/format-file-location.js +9 -1
- package/dist/helpers/install-required-package.d.ts +1 -0
- package/dist/helpers/install-required-package.js +3 -2
- package/dist/helpers/retry-payload.js +0 -1
- package/dist/helpers/studio-runtime-config.d.ts +0 -1
- package/dist/helpers/studio-runtime-config.js +1 -6
- package/dist/helpers/use-menu-structure.js +15 -18
- 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 -3
- package/package.json +11 -11
- package/dist/components/RenderModal/WebRendererExperimentalBadge.d.ts +0 -1
- package/dist/components/RenderModal/WebRendererExperimentalBadge.js +0 -35
- package/dist/components/Timeline/KeyframeSettingsModal.d.ts +0 -15
- package/dist/components/Timeline/KeyframeSettingsModal.js +0 -151
- package/dist/helpers/show-browser-rendering.d.ts +0 -1
- package/dist/helpers/show-browser-rendering.js +0 -5
|
@@ -12,6 +12,7 @@ const client_id_1 = require("../helpers/client-id");
|
|
|
12
12
|
const colors_1 = require("../helpers/colors");
|
|
13
13
|
const get_asset_metadata_1 = require("../helpers/get-asset-metadata");
|
|
14
14
|
const get_effective_translation_1 = require("../helpers/get-effective-translation");
|
|
15
|
+
const install_required_package_1 = require("../helpers/install-required-package");
|
|
15
16
|
const open_in_editor_1 = require("../helpers/open-in-editor");
|
|
16
17
|
const remote_asset_drag_1 = require("../helpers/remote-asset-drag");
|
|
17
18
|
const smooth_zoom_1 = require("../helpers/smooth-zoom");
|
|
@@ -35,6 +36,18 @@ const elementInstallCompositionIdStyle = {
|
|
|
35
36
|
fontFamily: 'monospace',
|
|
36
37
|
fontSize: 13,
|
|
37
38
|
};
|
|
39
|
+
const elementInstallDependencyListStyle = {
|
|
40
|
+
marginTop: 8,
|
|
41
|
+
marginBottom: 0,
|
|
42
|
+
paddingLeft: 24,
|
|
43
|
+
listStyleType: 'disc',
|
|
44
|
+
};
|
|
45
|
+
const elementInstallDependencyStyle = {
|
|
46
|
+
color: 'inherit',
|
|
47
|
+
fontFamily: 'monospace',
|
|
48
|
+
fontSize: 13,
|
|
49
|
+
lineHeight: 1.5,
|
|
50
|
+
};
|
|
38
51
|
const elementInstallCodeDetailsStyle = {
|
|
39
52
|
marginTop: 12,
|
|
40
53
|
fontSize: 13,
|
|
@@ -623,6 +636,7 @@ const Canvas = ({ canvasContent, size }) => {
|
|
|
623
636
|
canInstall: canInstallElements,
|
|
624
637
|
lastFocusedAt: lastFocusedAtRef.current,
|
|
625
638
|
readOnly: window.remotion_isReadOnlyStudio,
|
|
639
|
+
studioUrl: window.location.href,
|
|
626
640
|
}).catch(() => undefined);
|
|
627
641
|
}, [
|
|
628
642
|
canInstallElements,
|
|
@@ -693,10 +707,14 @@ const Canvas = ({ canvasContent, size }) => {
|
|
|
693
707
|
let canceled = false;
|
|
694
708
|
const handleInstallRequest = async () => {
|
|
695
709
|
setInstallingElementName(activeElementInstallRequest.element.displayName);
|
|
710
|
+
const missingPackages = (0, install_required_package_1.getMissingPackages)(activeElementInstallRequest.element.dependencies);
|
|
696
711
|
const accepted = await confirm({
|
|
697
712
|
title: 'Install Element',
|
|
698
|
-
message: (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: ["Install \u201C", activeElementInstallRequest.element.displayName, "\u201D into", ' ', jsx_runtime_1.jsx("code", { style: elementInstallCompositionIdStyle, children: activeElementInstallRequest.compositionId }), ' ', "composition? This will create an Element source file and update the composition source.",
|
|
699
|
-
|
|
713
|
+
message: (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: ["Install \u201C", activeElementInstallRequest.element.displayName, "\u201D into", ' ', jsx_runtime_1.jsx("code", { style: elementInstallCompositionIdStyle, children: activeElementInstallRequest.compositionId }), ' ', "composition? This will create an Element source file and update the composition source.", missingPackages.length > 0 ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
714
|
+
jsx_runtime_1.jsx("br", {}), jsx_runtime_1.jsx("br", {}),
|
|
715
|
+
"The following dependencies will also be installed:",
|
|
716
|
+
jsx_runtime_1.jsx("ul", { style: elementInstallDependencyListStyle, children: missingPackages.map((packageName) => (jsx_runtime_1.jsx("li", { style: elementInstallDependencyStyle, children: packageName }, packageName))) })
|
|
717
|
+
] })) : null, jsx_runtime_1.jsxs("details", { style: elementInstallCodeDetailsStyle, children: [
|
|
700
718
|
jsx_runtime_1.jsx("summary", { style: elementInstallCodeSummaryStyle, children: "Preview Element source" }), jsx_runtime_1.jsx("pre", { style: elementInstallCodeBlockStyle, children: jsx_runtime_1.jsx("code", { children: activeElementInstallRequest.element.sourceCode }) })
|
|
701
719
|
] })
|
|
702
720
|
] })),
|
|
@@ -12,6 +12,7 @@ const video_1 = require("../icons/video");
|
|
|
12
12
|
const render_frame_1 = require("../state/render-frame");
|
|
13
13
|
const InlineCompositionName_1 = require("./InlineCompositionName");
|
|
14
14
|
const InspectorInfoHeader_1 = require("./InspectorInfoHeader");
|
|
15
|
+
const InspectorLocationCopy_1 = require("./InspectorLocationCopy");
|
|
15
16
|
const InspectorSourceLocation_1 = require("./InspectorSourceLocation");
|
|
16
17
|
const NotificationCenter_1 = require("./Notifications/NotificationCenter");
|
|
17
18
|
const use_resolved_stack_1 = require("./Timeline/use-resolved-stack");
|
|
@@ -86,6 +87,8 @@ const CurrentComposition = () => {
|
|
|
86
87
|
return (0, is_composition_still_1.isCompositionStill)(video) ? (jsx_runtime_1.jsx(still_1.StillIcon, { color: color, style: sourceLocationIconStyle })) : (jsx_runtime_1.jsx(video_1.FilmIcon, { color: color, style: sourceLocationIconStyle }));
|
|
87
88
|
}, [video]);
|
|
88
89
|
return (jsx_runtime_1.jsx(InspectorInfoHeader_1.InspectorInfoHeader, { children: video ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
89
|
-
jsx_runtime_1.
|
|
90
|
+
jsx_runtime_1.jsxs(InspectorLocationCopy_1.InspectorLocationCopy, { location: validatedLocation, name: video.id, children: [
|
|
91
|
+
jsx_runtime_1.jsx(InlineCompositionName_1.InlineCompositionName, { compositionId: video.id, stack: (_e = currentComposition === null || currentComposition === void 0 ? void 0 : currentComposition.stack) !== null && _e !== void 0 ? _e : null, compositions: compositions }, video.id), jsx_runtime_1.jsx(InspectorSourceLocation_1.InspectorSourceLocation, { location: validatedLocation, canOpen: validatedLocation !== null, onOpen: openFileLocation, renderIcon: renderCompositionIcon }), jsx_runtime_1.jsx(InspectorSourceLocation_1.InspectorSourceLocation, { location: componentLocation, canOpen: componentLocation !== null, onOpen: openComponentLocation, renderIcon: renderReactIcon })
|
|
92
|
+
] }), jsx_runtime_1.jsxs(InspectorInfoHeader_1.InspectorInfoSubtitle, { children: [video.width, "x", video.height, (0, is_composition_still_1.isCompositionStill)(video) ? null : `, ${video.fps} FPS`] }), (0, is_composition_still_1.isCompositionStill)(video) ? (jsx_runtime_1.jsx(InspectorInfoHeader_1.InspectorInfoSubtitle, { children: "Still" })) : (jsx_runtime_1.jsxs(InspectorInfoHeader_1.InspectorInfoSubtitle, { children: ["Duration ", (0, render_frame_1.renderFrame)(video.durationInFrames, video.fps)] }))] })) : null }));
|
|
90
93
|
};
|
|
91
94
|
exports.CurrentComposition = CurrentComposition;
|
|
@@ -39,7 +39,7 @@ const EditorContent = ({ readOnlyStudio, 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: [
|
|
42
|
-
jsx_runtime_1.jsx(InitialCompositionLoader_1.InitialCompositionLoader, {}), jsx_runtime_1.jsx(MenuToolbar_1.MenuToolbar, { readOnlyStudio: readOnlyStudio }), jsx_runtime_1.jsx(GlobalKeybindings_1.GlobalKeybindings, {
|
|
42
|
+
jsx_runtime_1.jsx(InitialCompositionLoader_1.InitialCompositionLoader, {}), jsx_runtime_1.jsx(MenuToolbar_1.MenuToolbar, { readOnlyStudio: readOnlyStudio }), jsx_runtime_1.jsx(GlobalKeybindings_1.GlobalKeybindings, {}), jsx_runtime_1.jsx(TimelineKeyframeDragState_1.TimelineKeyframeDragStateProvider, { children: content })
|
|
43
43
|
] }) }));
|
|
44
44
|
};
|
|
45
45
|
exports.EditorContent = EditorContent;
|
|
@@ -4,8 +4,6 @@ exports.GlobalKeybindings = void 0;
|
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const remotion_1 = require("remotion");
|
|
6
6
|
const calculate_timeline_1 = require("../helpers/calculate-timeline");
|
|
7
|
-
const client_id_1 = require("../helpers/client-id");
|
|
8
|
-
const show_browser_rendering_1 = require("../helpers/show-browser-rendering");
|
|
9
7
|
const studio_runtime_config_1 = require("../helpers/studio-runtime-config");
|
|
10
8
|
const timeline_node_path_key_1 = require("../helpers/timeline-node-path-key");
|
|
11
9
|
const use_keybinding_1 = require("../helpers/use-keybinding");
|
|
@@ -23,7 +21,7 @@ const sequencePropShortcuts = {
|
|
|
23
21
|
t: 'style.opacity',
|
|
24
22
|
};
|
|
25
23
|
const hasOwnProperty = (obj, key) => Object.prototype.hasOwnProperty.call(obj, key);
|
|
26
|
-
const GlobalKeybindings = (
|
|
24
|
+
const GlobalKeybindings = () => {
|
|
27
25
|
const keybindings = (0, use_keybinding_1.useKeybinding)();
|
|
28
26
|
const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
29
27
|
const { setCheckerboard } = (0, react_1.useContext)(checkerboard_1.CheckerboardContext);
|
|
@@ -32,7 +30,6 @@ const GlobalKeybindings = ({ readOnlyStudio }) => {
|
|
|
32
30
|
const { sequences } = (0, react_1.useContext)(remotion_1.Internals.SequenceManager);
|
|
33
31
|
const videoConfig = remotion_1.Internals.useUnsafeVideoConfig();
|
|
34
32
|
const { overrideIdToNodePathMappings } = (0, react_1.useContext)(remotion_1.Internals.OverrideIdsToNodePathsGettersContext);
|
|
35
|
-
const { type } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx).previewServerState;
|
|
36
33
|
const { navigateToNextComposition, navigateToPreviousComposition } = (0, CompositionSelector_1.useCompositionNavigation)();
|
|
37
34
|
const video = remotion_1.Internals.useVideo();
|
|
38
35
|
const timeline = (0, react_1.useMemo)(() => {
|
|
@@ -81,13 +78,9 @@ const GlobalKeybindings = ({ readOnlyStudio }) => {
|
|
|
81
78
|
if (!video) {
|
|
82
79
|
return;
|
|
83
80
|
}
|
|
84
|
-
if (type !== 'connected' && !show_browser_rendering_1.SHOW_BROWSER_RENDERING && !readOnlyStudio) {
|
|
85
|
-
(0, NotificationCenter_1.showNotification)('Studio server is offline', 2000);
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
81
|
const renderButton = document.getElementById('render-modal-button');
|
|
89
82
|
renderButton.click();
|
|
90
|
-
}, [
|
|
83
|
+
}, [video]);
|
|
91
84
|
(0, react_1.useEffect)(() => {
|
|
92
85
|
const onSequencePropKey = (event) => {
|
|
93
86
|
const key = event.key.toLowerCase();
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { OriginalPosition } from '../error-overlay/react-overlay/utils/get-source-map';
|
|
3
|
+
export declare const InspectorLocationCopy: React.FC<{
|
|
4
|
+
readonly children: React.ReactNode;
|
|
5
|
+
readonly location: OriginalPosition | null;
|
|
6
|
+
readonly name: string | null;
|
|
7
|
+
}>;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InspectorLocationCopy = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const format_file_location_1 = require("../helpers/format-file-location");
|
|
7
|
+
const clipboard_1 = require("../icons/clipboard");
|
|
8
|
+
const InlineAction_1 = require("./InlineAction");
|
|
9
|
+
const NotificationCenter_1 = require("./Notifications/NotificationCenter");
|
|
10
|
+
const row = {
|
|
11
|
+
alignItems: 'center',
|
|
12
|
+
display: 'flex',
|
|
13
|
+
flexDirection: 'row',
|
|
14
|
+
minWidth: 0,
|
|
15
|
+
width: '100%',
|
|
16
|
+
};
|
|
17
|
+
const content = {
|
|
18
|
+
display: 'flex',
|
|
19
|
+
flex: 1,
|
|
20
|
+
flexDirection: 'column',
|
|
21
|
+
minWidth: 0,
|
|
22
|
+
overflow: 'hidden',
|
|
23
|
+
};
|
|
24
|
+
const action = {
|
|
25
|
+
flexShrink: 0,
|
|
26
|
+
height: 24,
|
|
27
|
+
marginLeft: 4,
|
|
28
|
+
marginRight: -4,
|
|
29
|
+
};
|
|
30
|
+
const icon = {
|
|
31
|
+
flexShrink: 0,
|
|
32
|
+
height: 12,
|
|
33
|
+
width: 12,
|
|
34
|
+
};
|
|
35
|
+
const InspectorLocationCopy = ({ children, location, name }) => {
|
|
36
|
+
const [hovered, setHovered] = (0, react_1.useState)(false);
|
|
37
|
+
const [focusedWithin, setFocusedWithin] = (0, react_1.useState)(false);
|
|
38
|
+
const textToCopy = (0, react_1.useMemo)(() => {
|
|
39
|
+
return (0, format_file_location_1.formatLocationForAgents)({
|
|
40
|
+
location,
|
|
41
|
+
name,
|
|
42
|
+
root: window.remotion_cwd,
|
|
43
|
+
});
|
|
44
|
+
}, [location, name]);
|
|
45
|
+
const renderCopyAction = (0, react_1.useCallback)((color) => {
|
|
46
|
+
return jsx_runtime_1.jsx(clipboard_1.ClipboardIcon, { style: icon, color: color });
|
|
47
|
+
}, []);
|
|
48
|
+
const onCopy = (0, react_1.useCallback)((event) => {
|
|
49
|
+
event.stopPropagation();
|
|
50
|
+
if (!textToCopy) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
navigator.clipboard.writeText(textToCopy).catch((err) => {
|
|
54
|
+
(0, NotificationCenter_1.showNotification)(`Could not copy to clipboard: ${err.message}`, 2000);
|
|
55
|
+
});
|
|
56
|
+
}, [textToCopy]);
|
|
57
|
+
const showAction = hovered || focusedWithin;
|
|
58
|
+
return (jsx_runtime_1.jsxs("div", { style: row, onPointerEnter: () => setHovered(true), onPointerLeave: () => setHovered(false), onFocus: () => setFocusedWithin(true), onBlur: () => setFocusedWithin(false), children: [
|
|
59
|
+
jsx_runtime_1.jsx("div", { style: content, children: children }), textToCopy ? (jsx_runtime_1.jsx("div", { style: {
|
|
60
|
+
...action,
|
|
61
|
+
opacity: showAction ? 1 : 0,
|
|
62
|
+
pointerEvents: showAction ? 'auto' : 'none',
|
|
63
|
+
}, children: jsx_runtime_1.jsx(InlineAction_1.InlineAction, { onClick: onCopy, renderAction: renderCopyAction, title: "Copy location for agents" }) })) : null] }));
|
|
64
|
+
};
|
|
65
|
+
exports.InspectorLocationCopy = InspectorLocationCopy;
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AlignmentControls = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const remotion_1 = require("remotion");
|
|
7
|
+
const client_id_1 = require("../../helpers/client-id");
|
|
8
|
+
const align_bottom_1 = require("../../icons/align-bottom");
|
|
9
|
+
const align_center_horizontal_1 = require("../../icons/align-center-horizontal");
|
|
10
|
+
const align_center_vertical_1 = require("../../icons/align-center-vertical");
|
|
11
|
+
const align_left_1 = require("../../icons/align-left");
|
|
12
|
+
const align_right_1 = require("../../icons/align-right");
|
|
13
|
+
const align_top_1 = require("../../icons/align-top");
|
|
14
|
+
const InlineAction_1 = require("../InlineAction");
|
|
15
|
+
const InspectorPanelLayout_1 = require("../InspectorPanelLayout");
|
|
16
|
+
const selected_outline_drag_1 = require("../selected-outline-drag");
|
|
17
|
+
const selected_outline_types_1 = require("../selected-outline-types");
|
|
18
|
+
const call_add_keyframe_1 = require("../Timeline/call-add-keyframe");
|
|
19
|
+
const save_sequence_prop_1 = require("../Timeline/save-sequence-prop");
|
|
20
|
+
const timeline_translate_utils_1 = require("../Timeline/timeline-translate-utils");
|
|
21
|
+
const alignment_controls_1 = require("./alignment-controls");
|
|
22
|
+
const isPropStatusDraggable = (propStatus) => {
|
|
23
|
+
return (!propStatus ||
|
|
24
|
+
propStatus.status === 'static' ||
|
|
25
|
+
(propStatus.status === 'keyframed' &&
|
|
26
|
+
propStatus.interpolationFunction === 'interpolate'));
|
|
27
|
+
};
|
|
28
|
+
const container = {
|
|
29
|
+
display: 'flex',
|
|
30
|
+
flexDirection: 'row',
|
|
31
|
+
gap: 4,
|
|
32
|
+
padding: `0 ${InspectorPanelLayout_1.INSPECTOR_PANEL_HORIZONTAL_PADDING}px 12px`,
|
|
33
|
+
alignItems: 'center',
|
|
34
|
+
};
|
|
35
|
+
const iconStyle = {
|
|
36
|
+
width: 16,
|
|
37
|
+
height: 16,
|
|
38
|
+
};
|
|
39
|
+
const verticalDivider = {
|
|
40
|
+
width: 1,
|
|
41
|
+
height: 16,
|
|
42
|
+
backgroundColor: 'rgba(255, 255, 255, 0.1)',
|
|
43
|
+
margin: '0 8px',
|
|
44
|
+
};
|
|
45
|
+
const AlignmentButton = ({ onClick, title, Icon, disabled }) => {
|
|
46
|
+
return (jsx_runtime_1.jsx(InlineAction_1.InlineAction, { title: title, onClick: onClick, renderAction: (color) => jsx_runtime_1.jsx(Icon, { style: iconStyle, color: color }), disabled: disabled }));
|
|
47
|
+
};
|
|
48
|
+
const AlignmentControls = ({ track }) => {
|
|
49
|
+
var _a;
|
|
50
|
+
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
51
|
+
const { propStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesContext);
|
|
52
|
+
const { getDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeDragOverridesContext);
|
|
53
|
+
const { setPropStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
|
|
54
|
+
const { canvasContent, compositions } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
55
|
+
const currentCompositionMetadata = (0, react_1.useMemo)(() => {
|
|
56
|
+
var _a;
|
|
57
|
+
if ((canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) !== 'composition')
|
|
58
|
+
return null;
|
|
59
|
+
return ((_a = compositions.find((c) => c.id === canvasContent.compositionId)) !== null && _a !== void 0 ? _a : null);
|
|
60
|
+
}, [canvasContent, compositions]);
|
|
61
|
+
const timelinePosition = remotion_1.Internals.Timeline.useTimelinePosition();
|
|
62
|
+
const handleAlign = (0, react_1.useCallback)((direction) => {
|
|
63
|
+
var _a;
|
|
64
|
+
var _b, _c, _d, _e;
|
|
65
|
+
if (previewServerState.type !== 'connected' ||
|
|
66
|
+
!track.nodePathInfo ||
|
|
67
|
+
!track.sequence.controls) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
const ref = (_a = track.sequence.refForOutline) === null || _a === void 0 ? void 0 : _a.current;
|
|
71
|
+
if (!ref) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
const nodePath = track.nodePathInfo.sequenceSubscriptionKey;
|
|
75
|
+
const nodePropStatuses = remotion_1.Internals.getPropStatusesCtx(propStatuses, nodePath);
|
|
76
|
+
const sourceFrame = timelinePosition - track.keyframeDisplayOffset;
|
|
77
|
+
const dragOverrides = (_b = getDragOverrides(nodePath)) !== null && _b !== void 0 ? _b : {};
|
|
78
|
+
const activeSchema = (0, selected_outline_drag_1.getSelectedOutlineActiveSchema)({
|
|
79
|
+
schema: track.sequence.controls.schema,
|
|
80
|
+
currentRuntimeValueDotNotation: track.sequence.controls.currentRuntimeValueDotNotation,
|
|
81
|
+
dragOverrides,
|
|
82
|
+
propStatus: nodePropStatuses,
|
|
83
|
+
frame: sourceFrame,
|
|
84
|
+
});
|
|
85
|
+
const fieldSchema = activeSchema === null || activeSchema === void 0 ? void 0 : activeSchema[selected_outline_types_1.translateFieldKey];
|
|
86
|
+
const propStatus = nodePropStatuses === null || nodePropStatuses === void 0 ? void 0 : nodePropStatuses[selected_outline_types_1.translateFieldKey];
|
|
87
|
+
if ((fieldSchema === null || fieldSchema === void 0 ? void 0 : fieldSchema.type) !== 'translate') {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
if (!isPropStatusDraggable(propStatus)) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
let elementRect;
|
|
94
|
+
try {
|
|
95
|
+
elementRect = ref.getBoundingClientRect();
|
|
96
|
+
}
|
|
97
|
+
catch (_f) {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
if (!(currentCompositionMetadata === null || currentCompositionMetadata === void 0 ? void 0 : currentCompositionMetadata.width)) {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
const compositionRect = remotion_1.Internals.portalNode().getBoundingClientRect();
|
|
104
|
+
if (compositionRect.width === 0 || compositionRect.height === 0) {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
const scale = compositionRect.width / currentCompositionMetadata.width;
|
|
108
|
+
const currentTranslate = propStatus
|
|
109
|
+
? String((_d = (_c = remotion_1.Internals.getEffectiveVisualModeValue({
|
|
110
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
111
|
+
propStatus: propStatus,
|
|
112
|
+
dragOverrideValue: dragOverrides[selected_outline_types_1.translateFieldKey],
|
|
113
|
+
defaultValue: fieldSchema.default,
|
|
114
|
+
frame: sourceFrame,
|
|
115
|
+
shouldResortToDefaultValueIfUndefined: true,
|
|
116
|
+
})) !== null && _c !== void 0 ? _c : fieldSchema.default) !== null && _d !== void 0 ? _d : '0px 0px')
|
|
117
|
+
: String((_e = fieldSchema.default) !== null && _e !== void 0 ? _e : '0px 0px');
|
|
118
|
+
const [currentX, currentY] = (0, timeline_translate_utils_1.parseTranslate)(currentTranslate);
|
|
119
|
+
const { x: newX, y: newY } = (0, alignment_controls_1.computeAlignedTranslate)({
|
|
120
|
+
direction,
|
|
121
|
+
elementRect,
|
|
122
|
+
compositionRect,
|
|
123
|
+
currentTranslateX: currentX,
|
|
124
|
+
currentTranslateY: currentY,
|
|
125
|
+
scale,
|
|
126
|
+
});
|
|
127
|
+
const newValue = (0, timeline_translate_utils_1.serializeTranslate)(newX, newY);
|
|
128
|
+
const undoLabels = {
|
|
129
|
+
left: 'Align left',
|
|
130
|
+
'center-h': 'Align center horizontally',
|
|
131
|
+
right: 'Align right',
|
|
132
|
+
top: 'Align top',
|
|
133
|
+
'center-v': 'Align center vertically',
|
|
134
|
+
bottom: 'Align bottom',
|
|
135
|
+
};
|
|
136
|
+
const label = undoLabels[direction];
|
|
137
|
+
if (!propStatus || propStatus.status === 'static') {
|
|
138
|
+
(0, save_sequence_prop_1.saveSequenceProps)({
|
|
139
|
+
changes: [
|
|
140
|
+
{
|
|
141
|
+
fileName: nodePath.absolutePath,
|
|
142
|
+
nodePath,
|
|
143
|
+
fieldKey: selected_outline_types_1.translateFieldKey,
|
|
144
|
+
value: newValue,
|
|
145
|
+
defaultValue: fieldSchema.default !== undefined
|
|
146
|
+
? JSON.stringify(fieldSchema.default)
|
|
147
|
+
: null,
|
|
148
|
+
schema: track.sequence.controls.schema,
|
|
149
|
+
},
|
|
150
|
+
],
|
|
151
|
+
setPropStatuses,
|
|
152
|
+
clientId: previewServerState.clientId,
|
|
153
|
+
undoLabel: label,
|
|
154
|
+
redoLabel: label,
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
(0, call_add_keyframe_1.callAddSequenceKeyframe)({
|
|
159
|
+
fileName: nodePath.absolutePath,
|
|
160
|
+
nodePath,
|
|
161
|
+
fieldKey: selected_outline_types_1.translateFieldKey,
|
|
162
|
+
sourceFrame,
|
|
163
|
+
value: newValue,
|
|
164
|
+
schema: track.sequence.controls.schema,
|
|
165
|
+
setPropStatuses,
|
|
166
|
+
clientId: previewServerState.clientId,
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
}, [
|
|
170
|
+
previewServerState,
|
|
171
|
+
track,
|
|
172
|
+
currentCompositionMetadata,
|
|
173
|
+
timelinePosition,
|
|
174
|
+
propStatuses,
|
|
175
|
+
getDragOverrides,
|
|
176
|
+
setPropStatuses,
|
|
177
|
+
]);
|
|
178
|
+
if (previewServerState.type !== 'connected' ||
|
|
179
|
+
!track.nodePathInfo ||
|
|
180
|
+
!track.sequence.controls ||
|
|
181
|
+
!currentCompositionMetadata) {
|
|
182
|
+
return null;
|
|
183
|
+
}
|
|
184
|
+
const renderNodePath = track.nodePathInfo.sequenceSubscriptionKey;
|
|
185
|
+
const renderNodePropStatuses = remotion_1.Internals.getPropStatusesCtx(propStatuses, renderNodePath);
|
|
186
|
+
const renderSourceFrame = timelinePosition - track.keyframeDisplayOffset;
|
|
187
|
+
const renderDragOverrides = (_a = getDragOverrides(renderNodePath)) !== null && _a !== void 0 ? _a : {};
|
|
188
|
+
const renderActiveSchema = (0, selected_outline_drag_1.getSelectedOutlineActiveSchema)({
|
|
189
|
+
schema: track.sequence.controls.schema,
|
|
190
|
+
currentRuntimeValueDotNotation: track.sequence.controls.currentRuntimeValueDotNotation,
|
|
191
|
+
dragOverrides: renderDragOverrides,
|
|
192
|
+
propStatus: renderNodePropStatuses,
|
|
193
|
+
frame: renderSourceFrame,
|
|
194
|
+
});
|
|
195
|
+
const renderFieldSchema = renderActiveSchema === null || renderActiveSchema === void 0 ? void 0 : renderActiveSchema[selected_outline_types_1.translateFieldKey];
|
|
196
|
+
const renderPropStatus = renderNodePropStatuses === null || renderNodePropStatuses === void 0 ? void 0 : renderNodePropStatuses[selected_outline_types_1.translateFieldKey];
|
|
197
|
+
if ((renderFieldSchema === null || renderFieldSchema === void 0 ? void 0 : renderFieldSchema.type) !== 'translate') {
|
|
198
|
+
return null;
|
|
199
|
+
}
|
|
200
|
+
const alignmentDisabled = !isPropStatusDraggable(renderPropStatus);
|
|
201
|
+
return (jsx_runtime_1.jsxs("div", { style: container, children: [
|
|
202
|
+
jsx_runtime_1.jsx(AlignmentButton, { title: "Align left", onClick: () => handleAlign('left'), Icon: align_left_1.AlignLeftIcon, disabled: alignmentDisabled }), jsx_runtime_1.jsx(AlignmentButton, { title: "Align center horizontally", onClick: () => handleAlign('center-h'), Icon: align_center_horizontal_1.AlignCenterHorizontalIcon, disabled: alignmentDisabled }), jsx_runtime_1.jsx(AlignmentButton, { title: "Align right", onClick: () => handleAlign('right'), Icon: align_right_1.AlignRightIcon, disabled: alignmentDisabled }), jsx_runtime_1.jsx("div", { style: verticalDivider }), jsx_runtime_1.jsx(AlignmentButton, { title: "Align top", onClick: () => handleAlign('top'), Icon: align_top_1.AlignTopIcon, disabled: alignmentDisabled }), jsx_runtime_1.jsx(AlignmentButton, { title: "Align center vertically", onClick: () => handleAlign('center-v'), Icon: align_center_vertical_1.AlignCenterVerticalIcon, disabled: alignmentDisabled }), jsx_runtime_1.jsx(AlignmentButton, { title: "Align bottom", onClick: () => handleAlign('bottom'), Icon: align_bottom_1.AlignBottomIcon, disabled: alignmentDisabled })
|
|
203
|
+
] }));
|
|
204
|
+
};
|
|
205
|
+
exports.AlignmentControls = AlignmentControls;
|
|
@@ -16,6 +16,7 @@ const update_selected_easing_1 = require("../Timeline/update-selected-easing");
|
|
|
16
16
|
const common_1 = require("./common");
|
|
17
17
|
const easing_inspector_selection_1 = require("./easing-inspector-selection");
|
|
18
18
|
const KeyframeEasingNavigator_1 = require("./KeyframeEasingNavigator");
|
|
19
|
+
const KeyframeSettings_1 = require("./KeyframeSettings");
|
|
19
20
|
const SequenceInspectorHeader_1 = require("./SequenceInspectorHeader");
|
|
20
21
|
const styles_1 = require("./styles");
|
|
21
22
|
const use_track_for_selection_1 = require("./use-track-for-selection");
|
|
@@ -206,10 +207,15 @@ const EasingInspector = ({ selection }) => {
|
|
|
206
207
|
selection,
|
|
207
208
|
track,
|
|
208
209
|
]);
|
|
209
|
-
if (state === null ||
|
|
210
|
+
if (state === null ||
|
|
211
|
+
track === null ||
|
|
212
|
+
currentEasingSelection === null ||
|
|
213
|
+
easingUpdate === null) {
|
|
210
214
|
return jsx_runtime_1.jsx(common_1.InspectorMessage, { children: "Easing unavailable" });
|
|
211
215
|
}
|
|
212
216
|
return (jsx_runtime_1.jsxs("div", { style: styles_1.selectedContainer, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: [
|
|
213
|
-
jsx_runtime_1.jsx(SequenceInspectorHeader_1.SequenceInspectorHeaderWithDivider, { track: track }), jsx_runtime_1.jsx(EasingEditorModal_1.EasingEditor, { state: state, renderHeader: renderHeader }, (0, TimelineSelection_1.getTimelineSelectionKey)(currentEasingSelection)),
|
|
217
|
+
jsx_runtime_1.jsx(SequenceInspectorHeader_1.SequenceInspectorHeaderWithDivider, { track: track }), jsx_runtime_1.jsx(EasingEditorModal_1.EasingEditor, { state: state, renderHeader: renderHeader }, (0, TimelineSelection_1.getTimelineSelectionKey)(currentEasingSelection)), jsx_runtime_1.jsx(KeyframeSettings_1.KeyframeSettings, { update: easingUpdate }), canAddKeyframeAtPlayhead ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
218
|
+
jsx_runtime_1.jsx("div", { style: styles_1.inspectorSectionDivider }), jsx_runtime_1.jsx("div", { style: styles_1.detailsContainer, children: jsx_runtime_1.jsx(common_1.InspectorInlineAction, { disabled: addKeyframeDisabled, onClick: onAddKeyframeAtPlayhead, renderIcon: (color) => (jsx_runtime_1.jsx(plus_1.Plus, { color: color, style: addKeyframeIcon })), children: `Add keyframe at ${addKeyframeTime}` }) })
|
|
219
|
+
] })) : null] }));
|
|
214
220
|
};
|
|
215
221
|
exports.EasingInspector = EasingInspector;
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.KeyframeSettings = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const remotion_1 = require("remotion");
|
|
7
|
+
const client_id_1 = require("../../helpers/client-id");
|
|
8
|
+
const ComboBox_1 = require("../NewComposition/ComboBox");
|
|
9
|
+
const InputDragger_1 = require("../NewComposition/InputDragger");
|
|
10
|
+
const call_update_keyframe_settings_1 = require("../Timeline/call-update-keyframe-settings");
|
|
11
|
+
const common_1 = require("./common");
|
|
12
|
+
const styles_1 = require("./styles");
|
|
13
|
+
const comboStyle = {
|
|
14
|
+
minWidth: 120,
|
|
15
|
+
};
|
|
16
|
+
const keyframeSettingsContainer = {
|
|
17
|
+
...styles_1.detailsContainer,
|
|
18
|
+
paddingBottom: 0,
|
|
19
|
+
};
|
|
20
|
+
const extrapolateOptions = [
|
|
21
|
+
'extend',
|
|
22
|
+
'clamp',
|
|
23
|
+
'identity',
|
|
24
|
+
'wrap',
|
|
25
|
+
];
|
|
26
|
+
const labelForExtrapolate = (value) => value[0].toUpperCase() + value.slice(1);
|
|
27
|
+
const getExtrapolateValues = (onSelect, disabled) => {
|
|
28
|
+
return extrapolateOptions.map((value) => ({
|
|
29
|
+
type: 'item',
|
|
30
|
+
id: value,
|
|
31
|
+
keyHint: null,
|
|
32
|
+
label: labelForExtrapolate(value),
|
|
33
|
+
leftItem: null,
|
|
34
|
+
disabled,
|
|
35
|
+
onClick: () => onSelect(value),
|
|
36
|
+
quickSwitcherLabel: null,
|
|
37
|
+
subMenu: null,
|
|
38
|
+
value,
|
|
39
|
+
}));
|
|
40
|
+
};
|
|
41
|
+
const outputOptions = [
|
|
42
|
+
'linear',
|
|
43
|
+
'perceptual-scale',
|
|
44
|
+
];
|
|
45
|
+
const labelForOutput = (value) => {
|
|
46
|
+
return value === 'perceptual-scale' ? 'Perceptual scale' : 'Linear';
|
|
47
|
+
};
|
|
48
|
+
const getOutputValues = (onSelect, disabled) => {
|
|
49
|
+
return outputOptions.map((value) => ({
|
|
50
|
+
type: 'item',
|
|
51
|
+
id: value,
|
|
52
|
+
keyHint: null,
|
|
53
|
+
label: labelForOutput(value),
|
|
54
|
+
leftItem: null,
|
|
55
|
+
disabled,
|
|
56
|
+
onClick: () => onSelect(value),
|
|
57
|
+
quickSwitcherLabel: null,
|
|
58
|
+
subMenu: null,
|
|
59
|
+
value,
|
|
60
|
+
}));
|
|
61
|
+
};
|
|
62
|
+
const KeyframeSettings = ({ update }) => {
|
|
63
|
+
var _a, _b;
|
|
64
|
+
const { setPropStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
|
|
65
|
+
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
66
|
+
const { propStatus } = update;
|
|
67
|
+
const [posterize, setPosterize] = (0, react_1.useState)((_a = propStatus.posterize) !== null && _a !== void 0 ? _a : 0);
|
|
68
|
+
const canEditInterpolationSettings = propStatus.interpolationFunction === 'interpolate';
|
|
69
|
+
const disabled = previewServerState.type !== 'connected';
|
|
70
|
+
(0, react_1.useEffect)(() => {
|
|
71
|
+
var _a;
|
|
72
|
+
setPosterize((_a = propStatus.posterize) !== null && _a !== void 0 ? _a : 0);
|
|
73
|
+
}, [propStatus.posterize]);
|
|
74
|
+
const save = (0, react_1.useCallback)((settings) => {
|
|
75
|
+
if (previewServerState.type !== 'connected') {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
if (update.type === 'sequence') {
|
|
79
|
+
(0, call_update_keyframe_settings_1.callUpdateSequenceKeyframeSettings)({
|
|
80
|
+
fileName: update.fileName,
|
|
81
|
+
nodePath: update.nodePath,
|
|
82
|
+
fieldKey: update.fieldKey,
|
|
83
|
+
settings,
|
|
84
|
+
schema: update.schema,
|
|
85
|
+
setPropStatuses,
|
|
86
|
+
clientId: previewServerState.clientId,
|
|
87
|
+
}).catch(() => undefined);
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
(0, call_update_keyframe_settings_1.callUpdateEffectKeyframeSettings)({
|
|
91
|
+
fileName: update.fileName,
|
|
92
|
+
nodePath: update.nodePath,
|
|
93
|
+
effectIndex: update.effectIndex,
|
|
94
|
+
fieldKey: update.fieldKey,
|
|
95
|
+
settings,
|
|
96
|
+
schema: update.schema,
|
|
97
|
+
setPropStatuses,
|
|
98
|
+
clientId: previewServerState.clientId,
|
|
99
|
+
}).catch(() => undefined);
|
|
100
|
+
}, [previewServerState, setPropStatuses, update]);
|
|
101
|
+
const saveSettings = (0, react_1.useCallback)((_a) => {
|
|
102
|
+
var _b, _c;
|
|
103
|
+
var { left = propStatus.clamping.left, output = (_b = propStatus.output) !== null && _b !== void 0 ? _b : 'linear', posterize: nextPosterize = (_c = propStatus.posterize) !== null && _c !== void 0 ? _c : 0, right = propStatus.clamping.right, } = _a;
|
|
104
|
+
save({
|
|
105
|
+
type: 'settings',
|
|
106
|
+
clamping: canEditInterpolationSettings ? { left, right } : undefined,
|
|
107
|
+
output: canEditInterpolationSettings ? output : undefined,
|
|
108
|
+
posterize: nextPosterize <= 0 ? undefined : nextPosterize,
|
|
109
|
+
});
|
|
110
|
+
}, [
|
|
111
|
+
canEditInterpolationSettings,
|
|
112
|
+
propStatus.clamping.left,
|
|
113
|
+
propStatus.clamping.right,
|
|
114
|
+
propStatus.output,
|
|
115
|
+
propStatus.posterize,
|
|
116
|
+
save,
|
|
117
|
+
]);
|
|
118
|
+
const onSelectLeft = (0, react_1.useCallback)((left) => saveSettings({ left }), [saveSettings]);
|
|
119
|
+
const onSelectRight = (0, react_1.useCallback)((right) => saveSettings({ right }), [saveSettings]);
|
|
120
|
+
const onSelectOutput = (0, react_1.useCallback)((output) => saveSettings({ output }), [saveSettings]);
|
|
121
|
+
const leftValues = (0, react_1.useMemo)(() => getExtrapolateValues(onSelectLeft, disabled), [disabled, onSelectLeft]);
|
|
122
|
+
const rightValues = (0, react_1.useMemo)(() => getExtrapolateValues(onSelectRight, disabled), [disabled, onSelectRight]);
|
|
123
|
+
const outputValues = (0, react_1.useMemo)(() => getOutputValues(onSelectOutput, disabled), [disabled, onSelectOutput]);
|
|
124
|
+
const onPosterizeChange = (0, react_1.useCallback)((value) => {
|
|
125
|
+
setPosterize(Math.max(0, Math.round(value)));
|
|
126
|
+
}, []);
|
|
127
|
+
const onPosterizeChangeEnd = (0, react_1.useCallback)((value) => {
|
|
128
|
+
const nextPosterize = Math.max(0, Math.round(value));
|
|
129
|
+
setPosterize(nextPosterize);
|
|
130
|
+
saveSettings({ posterize: nextPosterize });
|
|
131
|
+
}, [saveSettings]);
|
|
132
|
+
const posterizeFormatter = (0, react_1.useCallback)((value) => {
|
|
133
|
+
return String(Math.round(Number(value)));
|
|
134
|
+
}, []);
|
|
135
|
+
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
136
|
+
jsx_runtime_1.jsx("div", { style: styles_1.inspectorSectionDivider }), jsx_runtime_1.jsx(common_1.InspectorSectionHeader, { children: "Keyframe settings" }), jsx_runtime_1.jsxs("div", { style: keyframeSettingsContainer, children: [canEditInterpolationSettings ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
137
|
+
jsx_runtime_1.jsx(common_1.InspectorDetailRow, { label: "Extrapolate left", children: jsx_runtime_1.jsx(ComboBox_1.Combobox, { values: leftValues, selectedId: propStatus.clamping.left, title: "Extrapolate left", style: comboStyle, small: true }) }), jsx_runtime_1.jsx(common_1.InspectorDetailRow, { label: "Extrapolate right", children: jsx_runtime_1.jsx(ComboBox_1.Combobox, { values: rightValues, selectedId: propStatus.clamping.right, title: "Extrapolate right", style: comboStyle, small: true }) }), jsx_runtime_1.jsx(common_1.InspectorDetailRow, { label: "Output", children: jsx_runtime_1.jsx(ComboBox_1.Combobox, { values: outputValues, selectedId: (_b = propStatus.output) !== null && _b !== void 0 ? _b : 'linear', title: "Output", style: comboStyle, small: true }) })
|
|
138
|
+
] })) : null, jsx_runtime_1.jsx(common_1.InspectorDetailRow, { label: "Posterize", children: jsx_runtime_1.jsx(InputDragger_1.InputDragger, { type: "number", value: posterize, status: "ok", onValueChange: onPosterizeChange, onValueChangeEnd: onPosterizeChangeEnd, onTextChange: () => undefined, min: 0, step: 1, formatter: posterizeFormatter, rightAlign: true, small: true, disabled: disabled }) })
|
|
139
|
+
] })
|
|
140
|
+
] }));
|
|
141
|
+
};
|
|
142
|
+
exports.KeyframeSettings = KeyframeSettings;
|
|
@@ -5,6 +5,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const client_id_1 = require("../../helpers/client-id");
|
|
7
7
|
const InlineEditableTitle_1 = require("../InlineEditableTitle");
|
|
8
|
+
const InspectorLocationCopy_1 = require("../InspectorLocationCopy");
|
|
8
9
|
const InspectorSourceLocation_1 = require("../InspectorSourceLocation");
|
|
9
10
|
const use_open_sequence_in_editor_1 = require("../Timeline/use-open-sequence-in-editor");
|
|
10
11
|
const use_rename_sequence_1 = require("../Timeline/use-rename-sequence");
|
|
@@ -66,9 +67,9 @@ const SequenceInspectorHeader = ({ sourceLocation, track }) => {
|
|
|
66
67
|
const onRename = (0, react_1.useCallback)((newName) => {
|
|
67
68
|
saveName(newName).catch(() => undefined);
|
|
68
69
|
}, [saveName]);
|
|
69
|
-
return (jsx_runtime_1.
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
return (jsx_runtime_1.jsx("div", { style: styles_1.sequenceHeader, children: jsx_runtime_1.jsxs(InspectorLocationCopy_1.InspectorLocationCopy, { location: sourceLocation.validatedLocation, name: componentName !== null && componentName !== void 0 ? componentName : null, children: [
|
|
71
|
+
jsx_runtime_1.jsx("div", { style: styles_1.sequenceHeaderTitle, children: jsx_runtime_1.jsx(InlineEditableTitle_1.InlineEditableTitle, { value: sequenceDisplayName, canRename: canRename, onCommit: onRename }) }), documentationLink ? (jsx_runtime_1.jsx("button", { type: "button", style: subtitleStyle, title: "Open component docs", onClick: openDocumentationLink, children: componentName })) : (jsx_runtime_1.jsx("div", { style: subtitleStyle, children: componentName })), jsx_runtime_1.jsx(InspectorSourceLocation_1.InspectorSourceLocation, { location: sourceLocation.validatedLocation, canOpen: sourceLocation.canOpenInEditor, onOpen: sourceLocation.openFileLocation })
|
|
72
|
+
] }) }));
|
|
72
73
|
};
|
|
73
74
|
exports.SequenceInspectorHeader = SequenceInspectorHeader;
|
|
74
75
|
const SequenceInspectorHeaderWithDivider = ({ track }) => {
|
|
@@ -7,6 +7,7 @@ const client_id_1 = require("../../helpers/client-id");
|
|
|
7
7
|
const InspectorSequenceSection_1 = require("../InspectorSequenceSection");
|
|
8
8
|
const is_menu_item_1 = require("../Menu/is-menu-item");
|
|
9
9
|
const TimelineSelection_1 = require("../Timeline/TimelineSelection");
|
|
10
|
+
const AlignmentControls_1 = require("./AlignmentControls");
|
|
10
11
|
const common_1 = require("./common");
|
|
11
12
|
const SequenceInspectorHeader_1 = require("./SequenceInspectorHeader");
|
|
12
13
|
const styles_1 = require("./styles");
|
|
@@ -51,7 +52,7 @@ const SequenceExpandedInspector = ({ track }) => {
|
|
|
51
52
|
return jsx_runtime_1.jsx(common_1.InspectorMessage, { children: "Sequence inspector unavailable" });
|
|
52
53
|
}
|
|
53
54
|
return (jsx_runtime_1.jsxs("div", { style: styles_1.selectedContainer, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, onPointerDown: selectSequenceOnInspectorPointerDown, children: [
|
|
54
|
-
jsx_runtime_1.jsx(SequenceInspectorHeader_1.SequenceInspectorHeader, { sourceLocation: sourceLocation, track: track }), jsx_runtime_1.jsx(InspectorSequenceSection_1.InspectorSequenceSection, { sequence: track.sequence, validatedLocation: validatedLocation, nodePathInfo: track.nodePathInfo, keyframeDisplayOffset: track.keyframeDisplayOffset, renderSectionHeader: (children) => (jsx_runtime_1.jsx(common_1.InspectorSectionHeader, { children: children })) })] }));
|
|
55
|
+
jsx_runtime_1.jsx(SequenceInspectorHeader_1.SequenceInspectorHeader, { sourceLocation: sourceLocation, track: track }), jsx_runtime_1.jsx(InspectorSequenceSection_1.InspectorSequenceSection, { sequence: track.sequence, validatedLocation: validatedLocation, nodePathInfo: track.nodePathInfo, keyframeDisplayOffset: track.keyframeDisplayOffset, renderSectionHeader: (children) => (jsx_runtime_1.jsx(common_1.InspectorSectionHeader, { children: children })), renderTransformControls: () => jsx_runtime_1.jsx(AlignmentControls_1.AlignmentControls, { track: track }) })] }));
|
|
55
56
|
};
|
|
56
57
|
const SequenceSelectionInspector = ({ selection }) => {
|
|
57
58
|
const track = (0, use_track_for_selection_1.useTrackForSelection)(selection);
|