@remotion/studio 4.0.514 → 4.0.515
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/install-package.js +14 -1
- package/dist/components/AssetSelectorItem.d.ts +2 -1
- package/dist/components/AssetSelectorItem.js +18 -14
- package/dist/components/AudioWaveform.js +17 -139
- package/dist/components/InspectorPanel/CompositionInspector.js +27 -5
- package/dist/components/InstallPackage.d.ts +1 -1
- package/dist/components/InstallPackage.js +38 -6
- package/dist/components/Menu/MenuDivider.js +1 -1
- package/dist/components/Modals.js +9 -2
- package/dist/components/RenderModal/GuiRenderStatus.js +3 -1
- package/dist/components/RenderModal/RenderModalOutputName.js +3 -3
- package/dist/components/RenderModal/WebRenderModal.js +4 -2
- package/dist/components/RenderQueue/RenderQueueItem.js +3 -1
- package/dist/components/RenderQueue/RenderQueueOpenInFolder.js +3 -1
- package/dist/components/RenderQueue/RenderQueueRemoveItem.js +1 -1
- package/dist/components/SelectedOutlineCanvasRotation.d.ts +1 -0
- package/dist/components/SelectedOutlineCanvasRotation.js +11 -4
- package/dist/components/SelectedOutlineElement.js +1 -1
- package/dist/components/SelectedOutlinePolygon.d.ts +1 -0
- package/dist/components/SelectedOutlinePolygon.js +3 -2
- package/dist/components/Timeline/TimelineClipboardKeybindings.js +6 -2
- package/dist/components/Timeline/TimelineEffectItem.js +23 -6
- package/dist/components/Timeline/TimelineEffectPropItem.js +6 -2
- package/dist/components/Timeline/TimelineExpandArrowButton.js +10 -7
- package/dist/components/Timeline/TimelineExpandedKeyframeRow.js +4 -1
- package/dist/components/Timeline/TimelineExpandedSection.js +8 -5
- package/dist/components/Timeline/TimelineRowChrome.d.ts +1 -0
- package/dist/components/Timeline/TimelineRowChrome.js +38 -2
- package/dist/components/Timeline/TimelineSelection.d.ts +8 -3
- package/dist/components/Timeline/TimelineSelection.js +6 -4
- package/dist/components/Timeline/TimelineSequenceItem.js +7 -4
- package/dist/components/Timeline/TimelineSequenceName.js +1 -1
- package/dist/components/Timeline/TimelineTrack.js +4 -1
- package/dist/components/Timeline/TimelineVideoInfo.js +4 -2
- package/dist/components/Timeline/delete-selected-timeline-item.js +6 -2
- package/dist/components/Timeline/duplicate-selected-timeline-item.js +4 -2
- package/dist/components/Timeline/save-effect-prop.js +3 -3
- package/dist/components/effect-drag-and-drop.js +6 -3
- package/dist/components/effect-operations-api.d.ts +8 -0
- package/dist/components/effect-operations-api.js +52 -0
- package/dist/error-overlay/remotion-overlay/log-studio-error.js +4 -0
- package/dist/esm/{chunk-r46yxrjr.js → chunk-s6k99gh2.js} +1 -1
- package/dist/esm/{chunk-xn2q7eem.js → chunk-v5a8vpv4.js} +3525 -3475
- package/dist/esm/internals.mjs +3525 -3475
- package/dist/esm/previewEntry.mjs +3533 -3483
- package/dist/esm/renderEntry.mjs +2 -2
- package/dist/helpers/browser-studio-operations.d.ts +3 -0
- package/dist/helpers/browser-studio-operations.js +18 -1
- package/dist/helpers/colors.d.ts +1 -1
- package/dist/helpers/colors.js +1 -1
- package/dist/helpers/inject-css.js +5 -3
- package/dist/helpers/use-max-media-duration.js +5 -3
- package/dist/helpers/use-media-metadata.js +37 -20
- package/dist/helpers/use-menu-structure.js +67 -80
- package/dist/icons/cloud-download.d.ts +4 -0
- package/dist/icons/cloud-download.js +8 -0
- package/dist/state/modals.d.ts +1 -1
- package/package.json +12 -12
|
@@ -6,6 +6,7 @@ const studio_shared_1 = require("@remotion/studio-shared");
|
|
|
6
6
|
const web_renderer_1 = require("@remotion/web-renderer");
|
|
7
7
|
const react_1 = require("react");
|
|
8
8
|
const ShortcutHint_1 = require("../../error-overlay/remotion-overlay/ShortcutHint");
|
|
9
|
+
const browser_studio_operations_1 = require("../../helpers/browser-studio-operations");
|
|
9
10
|
const audio_1 = require("../../icons/audio");
|
|
10
11
|
const certificate_1 = require("../../icons/certificate");
|
|
11
12
|
const file_1 = require("../../icons/file");
|
|
@@ -105,6 +106,7 @@ const WebRenderModal = ({ initialFrame, defaultProps, inFrameMark, outFrameMark,
|
|
|
105
106
|
? 'video'
|
|
106
107
|
: 'still');
|
|
107
108
|
const [tab, setTab] = (0, react_1.useState)('general');
|
|
109
|
+
const isBrowserStudio = (0, browser_studio_operations_1.getBrowserStudioOperations)() !== null;
|
|
108
110
|
const [imageFormat, setImageFormat] = (0, react_1.useState)(() => initialStillImageFormat !== null && initialStillImageFormat !== void 0 ? initialStillImageFormat : 'png');
|
|
109
111
|
const [frame, setFrame] = (0, react_1.useState)(() => initialFrame);
|
|
110
112
|
const [logLevel, setLogLevel] = (0, react_1.useState)(() => initialLogLevel);
|
|
@@ -418,11 +420,11 @@ const WebRenderModal = ({ initialFrame, defaultProps, inFrameMark, outFrameMark,
|
|
|
418
420
|
jsx_runtime_1.jsx(SegmentedControl_1.SegmentedControl, { items: renderTabOptions, needsWrapping: false }), jsx_runtime_1.jsx("div", { style: render_modals_1.flexer }), jsx_runtime_1.jsxs(Button_1.Button, { autoFocus: true, onClick: onAddToQueue, style: render_modals_1.buttonStyle, disabled: !outnameValidation.valid, children: ["Render ", renderMode, jsx_runtime_1.jsx(ShortcutHint_1.ShortcutHint, { keyToPress: "\u21B5", cmdOrCtrl: true })
|
|
419
421
|
] })
|
|
420
422
|
] }), jsx_runtime_1.jsxs("div", { style: render_modals_1.horizontalLayout, children: [
|
|
421
|
-
jsx_runtime_1.jsxs("div", { style: render_modals_1.leftSidebar, children: [jsx_runtime_1.jsx(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'general', onClick: () => setTab('general'), renderIcon: (color) => (jsx_runtime_1.jsx("div", { style: render_modals_1.iconContainer, children: jsx_runtime_1.jsx(file_1.FileIcon, { color: color, style: render_modals_1.icon }) })), children: "General" }), jsx_runtime_1.jsx(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'data', onClick: () => setTab('data'), renderIcon: (color) => (jsx_runtime_1.jsx("div", { style: render_modals_1.iconContainer, children: jsx_runtime_1.jsx(input_props_1.InputPropsIcon, { color: color, style: render_modals_1.icon }) })), children: "Input Props" }), renderMode !== 'audio' ? (jsx_runtime_1.jsx(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'picture', onClick: () => setTab('picture'), renderIcon: (color) => (jsx_runtime_1.jsx("div", { style: render_modals_1.iconContainer, children: jsx_runtime_1.jsx(frame_1.PicIcon, { color: color, style: render_modals_1.icon }) })), children: "Picture" })) : null, renderMode === 'video' || renderMode === 'audio' ? (jsx_runtime_1.jsx(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'audio', onClick: () => setTab('audio'), renderIcon: (color) => (jsx_runtime_1.jsx("div", { style: render_modals_1.iconContainer, children: jsx_runtime_1.jsx(audio_1.AudioIcon, { color: color, style: render_modals_1.icon }) })), children: "Audio" })) : null, jsx_runtime_1.jsx(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'advanced', onClick: () => setTab('advanced'), renderIcon: (color) => (jsx_runtime_1.jsx("div", { style: render_modals_1.iconContainer, children: jsx_runtime_1.jsx(gear_1.GearIcon, { color: color, style: render_modals_1.icon }) })), children: "Other" }), jsx_runtime_1.jsx(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: false, onClick: () => setSelectedModal({
|
|
423
|
+
jsx_runtime_1.jsxs("div", { style: render_modals_1.leftSidebar, children: [jsx_runtime_1.jsx(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'general', onClick: () => setTab('general'), renderIcon: (color) => (jsx_runtime_1.jsx("div", { style: render_modals_1.iconContainer, children: jsx_runtime_1.jsx(file_1.FileIcon, { color: color, style: render_modals_1.icon }) })), children: "General" }), jsx_runtime_1.jsx(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'data', onClick: () => setTab('data'), renderIcon: (color) => (jsx_runtime_1.jsx("div", { style: render_modals_1.iconContainer, children: jsx_runtime_1.jsx(input_props_1.InputPropsIcon, { color: color, style: render_modals_1.icon }) })), children: "Input Props" }), renderMode !== 'audio' ? (jsx_runtime_1.jsx(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'picture', onClick: () => setTab('picture'), renderIcon: (color) => (jsx_runtime_1.jsx("div", { style: render_modals_1.iconContainer, children: jsx_runtime_1.jsx(frame_1.PicIcon, { color: color, style: render_modals_1.icon }) })), children: "Picture" })) : null, renderMode === 'video' || renderMode === 'audio' ? (jsx_runtime_1.jsx(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'audio', onClick: () => setTab('audio'), renderIcon: (color) => (jsx_runtime_1.jsx("div", { style: render_modals_1.iconContainer, children: jsx_runtime_1.jsx(audio_1.AudioIcon, { color: color, style: render_modals_1.icon }) })), children: "Audio" })) : null, jsx_runtime_1.jsx(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'advanced', onClick: () => setTab('advanced'), renderIcon: (color) => (jsx_runtime_1.jsx("div", { style: render_modals_1.iconContainer, children: jsx_runtime_1.jsx(gear_1.GearIcon, { color: color, style: render_modals_1.icon }) })), children: "Other" }), isBrowserStudio ? null : (jsx_runtime_1.jsx(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: false, onClick: () => setSelectedModal({
|
|
422
424
|
type: 'settings',
|
|
423
425
|
initialTab: 'license',
|
|
424
426
|
initialPublicLicenseKey: publicLicenseKey,
|
|
425
|
-
}), renderIcon: (color) => (jsx_runtime_1.jsx("div", { style: render_modals_1.iconContainer, children: jsx_runtime_1.jsx(certificate_1.CertificateIcon, { color: color, style: render_modals_1.icon }) })), children: "License" })] }), jsx_runtime_1.jsx("div", { style: render_modals_1.optionsPanel, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: tab === 'general' ? (jsx_runtime_1.jsx(WebRenderModalBasic_1.WebRenderModalBasic, { renderMode: renderMode, resolvedComposition: resolvedComposition, imageFormat: imageFormat, setStillFormat: setStillFormat, frame: frame, onFrameChanged: onFrameChanged, onFrameSetDirectly: onFrameSetDirectly, container: container, setContainerFormat: setContainerFormat, setCodec: setCodecWithContainer, encodableVideoCodecs: encodableVideoCodecs, effectiveVideoCodec: effectiveVideoCodec, startFrame: finalStartFrame, setStartFrame: setStartFrame, endFrame: finalEndFrame, setEndFrame: setEndFrame, outName: outName, onOutNameChange: onOutNameChange, validationMessage: outnameValidation.valid ? null : outnameValidation.error.message, logLevel: logLevel, setLogLevel: setLogLevel })) : tab === 'data' ? (jsx_runtime_1.jsx(DataEditor_1.DataEditor, { defaultProps: inputProps, setDefaultProps: setInputProps, unresolvedComposition: unresolvedComposition, propsEditType: "input-props", canSaveDefaultProps: {
|
|
427
|
+
}), renderIcon: (color) => (jsx_runtime_1.jsx("div", { style: render_modals_1.iconContainer, children: jsx_runtime_1.jsx(certificate_1.CertificateIcon, { color: color, style: render_modals_1.icon }) })), children: "License" }))] }), jsx_runtime_1.jsx("div", { style: render_modals_1.optionsPanel, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: tab === 'general' ? (jsx_runtime_1.jsx(WebRenderModalBasic_1.WebRenderModalBasic, { renderMode: renderMode, resolvedComposition: resolvedComposition, imageFormat: imageFormat, setStillFormat: setStillFormat, frame: frame, onFrameChanged: onFrameChanged, onFrameSetDirectly: onFrameSetDirectly, container: container, setContainerFormat: setContainerFormat, setCodec: setCodecWithContainer, encodableVideoCodecs: encodableVideoCodecs, effectiveVideoCodec: effectiveVideoCodec, startFrame: finalStartFrame, setStartFrame: setStartFrame, endFrame: finalEndFrame, setEndFrame: setEndFrame, outName: outName, onOutNameChange: onOutNameChange, validationMessage: outnameValidation.valid ? null : outnameValidation.error.message, logLevel: logLevel, setLogLevel: setLogLevel })) : tab === 'data' ? (jsx_runtime_1.jsx(DataEditor_1.DataEditor, { defaultProps: inputProps, setDefaultProps: setInputProps, unresolvedComposition: unresolvedComposition, propsEditType: "input-props", canSaveDefaultProps: {
|
|
426
428
|
canUpdate: false,
|
|
427
429
|
reason: 'render dialogue',
|
|
428
430
|
determined: false,
|
|
@@ -4,6 +4,7 @@ exports.RenderQueueItem = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const remotion_1 = require("remotion");
|
|
7
|
+
const browser_studio_operations_1 = require("../../helpers/browser-studio-operations");
|
|
7
8
|
const colors_1 = require("../../helpers/colors");
|
|
8
9
|
const url_state_1 = require("../../helpers/url-state");
|
|
9
10
|
const layout_1 = require("../layout");
|
|
@@ -54,6 +55,7 @@ const RenderQueueItem = ({ job, selected }) => {
|
|
|
54
55
|
const [hovered, setHovered] = (0, react_1.useState)(false);
|
|
55
56
|
const { setCanvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionSetters);
|
|
56
57
|
const isClientJob = (0, context_1.isClientRenderJob)(job);
|
|
58
|
+
const isBrowserStudio = (0, browser_studio_operations_1.getBrowserStudioOperations)() !== null;
|
|
57
59
|
const { canDrag, isDragging, onDragEnd, onDragStart } = (0, use_render_output_file_drag_1.useRenderOutputFileDrag)(job);
|
|
58
60
|
const onPointerEnter = (0, react_1.useCallback)(() => {
|
|
59
61
|
setHovered(true);
|
|
@@ -147,6 +149,6 @@ const RenderQueueItem = ({ job, selected }) => {
|
|
|
147
149
|
return (jsx_runtime_1.jsxs(layout_1.Row, { "data-render-queue-item": job.id, onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, style: containerStyle, align: "center", onClick: onClick, draggable: canDrag, onDragStart: onDragStart, onDragEnd: onDragEnd, className: selected ? SELECTED_CLASSNAME : undefined, children: [
|
|
148
150
|
jsx_runtime_1.jsx(RenderQueueItemStatus_1.RenderQueueItemStatus, { job: job }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), jsx_runtime_1.jsxs("div", { style: right, children: [
|
|
149
151
|
jsx_runtime_1.jsx("div", { style: title, children: job.compositionId }), jsx_runtime_1.jsx("div", { style: subtitle, children: job.status === 'done' ? (jsx_runtime_1.jsx(RenderQueueOutputName_1.RenderQueueOutputName, { job: job })) : job.status === 'failed' ? (jsx_runtime_1.jsx(RenderQueueError_1.RenderQueueError, { job: job })) : job.status === 'running' ? (jsx_runtime_1.jsx(RenderQueueProgressMessage_1.RenderQueueProgressMessage, { job: job })) : job.status === 'saving' ? (jsx_runtime_1.jsx(RenderQueueSavingMessage_1.RenderQueueSavingMessage, {})) : job.status === 'cancelled' ? (jsx_runtime_1.jsx(RenderQueueCancelledMessage_1.RenderQueueCancelledMessage, {})) : null })
|
|
150
|
-
] }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), !isDragging ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [canCopyToClipboard ? (jsx_runtime_1.jsx(RenderQueueCopyToClipboard_1.RenderQueueCopyToClipboard, { job: job })) : null, canRepeat ? jsx_runtime_1.jsx(RenderQueueRepeat_1.RenderQueueRepeatItem, { job: job }) : null, job.status === 'running' ? (jsx_runtime_1.jsx(RenderQueueItemCancelButton_1.RenderQueueCancelButton, { job: job })) : (jsx_runtime_1.jsx(RenderQueueRemoveItem_1.RenderQueueRemoveItem, { job: job })), job.status === 'done' ? (clientBlobInfo ? (jsx_runtime_1.jsx(RenderQueueDownloadItem_1.RenderQueueDownloadItem, { job: job })) : (jsx_runtime_1.jsx(RenderQueueOpenInFolder_1.RenderQueueOpenInFinderItem, { job: job }))) : null] })) : null] }));
|
|
152
|
+
] }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), !isDragging ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [canCopyToClipboard ? (jsx_runtime_1.jsx(RenderQueueCopyToClipboard_1.RenderQueueCopyToClipboard, { job: job })) : null, canRepeat ? jsx_runtime_1.jsx(RenderQueueRepeat_1.RenderQueueRepeatItem, { job: job }) : null, job.status === 'running' ? (jsx_runtime_1.jsx(RenderQueueItemCancelButton_1.RenderQueueCancelButton, { job: job })) : isBrowserStudio ? null : (jsx_runtime_1.jsx(RenderQueueRemoveItem_1.RenderQueueRemoveItem, { job: job })), job.status === 'done' ? (clientBlobInfo ? (jsx_runtime_1.jsx(RenderQueueDownloadItem_1.RenderQueueDownloadItem, { job: job })) : isBrowserStudio ? null : (jsx_runtime_1.jsx(RenderQueueOpenInFolder_1.RenderQueueOpenInFinderItem, { job: job }))) : null] })) : null] }));
|
|
151
153
|
};
|
|
152
154
|
exports.RenderQueueItem = RenderQueueItem;
|
|
@@ -3,12 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.RenderQueueOpenInFinderItem = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
+
const browser_studio_operations_1 = require("../../helpers/browser-studio-operations");
|
|
6
7
|
const colors_1 = require("../../helpers/colors");
|
|
7
8
|
const folder_1 = require("../../icons/folder");
|
|
8
9
|
const InlineAction_1 = require("../InlineAction");
|
|
9
10
|
const NotificationCenter_1 = require("../Notifications/NotificationCenter");
|
|
10
11
|
const actions_1 = require("./actions");
|
|
11
12
|
const RenderQueueOpenInFinderItem = ({ job }) => {
|
|
13
|
+
const isBrowserStudio = (0, browser_studio_operations_1.getBrowserStudioOperations)() !== null;
|
|
12
14
|
const onClick = (0, react_1.useCallback)((e) => {
|
|
13
15
|
e.stopPropagation();
|
|
14
16
|
(0, actions_1.openInFileExplorer)({ directory: job.outName }).catch((err) => {
|
|
@@ -24,6 +26,6 @@ const RenderQueueOpenInFinderItem = ({ job }) => {
|
|
|
24
26
|
const renderAction = (0, react_1.useCallback)((color) => {
|
|
25
27
|
return jsx_runtime_1.jsx(folder_1.ExpandedFolderIconSolid, { style: icon, color: color });
|
|
26
28
|
}, [icon]);
|
|
27
|
-
return (jsx_runtime_1.jsx(InlineAction_1.InlineAction, { renderAction: renderAction, onClick: onClick, variant: null }));
|
|
29
|
+
return isBrowserStudio ? null : (jsx_runtime_1.jsx(InlineAction_1.InlineAction, { renderAction: renderAction, onClick: onClick, variant: null }));
|
|
28
30
|
};
|
|
29
31
|
exports.RenderQueueOpenInFinderItem = RenderQueueOpenInFinderItem;
|
|
@@ -46,6 +46,6 @@ const RenderQueueRemoveItem = ({ job }) => {
|
|
|
46
46
|
const renderAction = (0, react_1.useCallback)((color) => {
|
|
47
47
|
return (jsx_runtime_1.jsx("svg", { style: icon, xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 320 512", children: jsx_runtime_1.jsx("path", { fill: color, d: "M310.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L160 210.7 54.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L114.7 256 9.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 301.3 265.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L205.3 256 310.6 150.6z" }) }));
|
|
48
48
|
}, [icon]);
|
|
49
|
-
return (jsx_runtime_1.jsx(InlineAction_1.InlineAction, { renderAction: renderAction, onClick: onClick, variant: null }));
|
|
49
|
+
return (jsx_runtime_1.jsx(InlineAction_1.InlineAction, { renderAction: renderAction, onClick: onClick, title: "Remove", variant: null }));
|
|
50
50
|
};
|
|
51
51
|
exports.RenderQueueRemoveItem = RenderQueueRemoveItem;
|
|
@@ -52,10 +52,14 @@ const focus_inspector_field_1 = require("./Timeline/focus-inspector-field");
|
|
|
52
52
|
const imperative_state_1 = require("./Timeline/imperative-state");
|
|
53
53
|
const save_sequence_prop_1 = require("./Timeline/save-sequence-prop");
|
|
54
54
|
const rotationDegreesPerPixel = 0.5;
|
|
55
|
-
const
|
|
55
|
+
const canvas2DRotationCursor = (0, selected_outline_measurement_1.getRotationCursor)(0);
|
|
56
|
+
const SelectedOutlineCanvasRotation = ({ getLatestTargetByKey, layoutTarget, onDraggingChange, outline, transform3DMode, }) => {
|
|
56
57
|
const { getDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeDragOverridesContext);
|
|
57
58
|
const { setPropStatuses, setDragOverrides, clearDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
|
|
58
59
|
const { editorSnapping } = (0, react_1.useContext)(editor_snapping_1.EditorSnappingContext);
|
|
60
|
+
const cursor = transform3DMode
|
|
61
|
+
? canvas_rotation_cursor_1.canvasRotationCursor
|
|
62
|
+
: canvas2DRotationCursor;
|
|
59
63
|
const onPointerDown = react_1.default.useCallback((event) => {
|
|
60
64
|
var _a, _b;
|
|
61
65
|
if (event.button !== 0) {
|
|
@@ -76,7 +80,10 @@ const SelectedOutlineCanvasRotation = ({ getLatestTargetByKey, layoutTarget, onD
|
|
|
76
80
|
return;
|
|
77
81
|
}
|
|
78
82
|
const previousSvgCursor = svg.style.cursor;
|
|
79
|
-
|
|
83
|
+
const dragCursor = rotationDrag.transform3DMode
|
|
84
|
+
? canvas_rotation_cursor_1.canvasRotationCursor
|
|
85
|
+
: canvas2DRotationCursor;
|
|
86
|
+
svg.style.cursor = dragCursor;
|
|
80
87
|
const startPointer = { x: event.clientX, y: event.clientY };
|
|
81
88
|
const center = (0, svg_point_to_client_point_1.svgPointToClientPoint)((0, selected_outline_measurement_1.getSelectedOutlineRotationPivot)({
|
|
82
89
|
dimensions: outline.dimensions,
|
|
@@ -106,7 +113,7 @@ const SelectedOutlineCanvasRotation = ({ getLatestTargetByKey, layoutTarget, onD
|
|
|
106
113
|
return;
|
|
107
114
|
}
|
|
108
115
|
dragStarted = true;
|
|
109
|
-
(0, ForceSpecificCursor_1.forceSpecificCursor)(
|
|
116
|
+
(0, ForceSpecificCursor_1.forceSpecificCursor)(dragCursor);
|
|
110
117
|
onDraggingChange(true);
|
|
111
118
|
}
|
|
112
119
|
if (rotationDrag.transform3DMode) {
|
|
@@ -234,6 +241,6 @@ const SelectedOutlineCanvasRotation = ({ getLatestTargetByKey, layoutTarget, onD
|
|
|
234
241
|
setDragOverrides,
|
|
235
242
|
setPropStatuses,
|
|
236
243
|
]);
|
|
237
|
-
return (jsx_runtime_1.jsx("polygon", { points: outline.points.map((point) => `${point.x},${point.y}`).join(' '), fill: colors_1.TRANSPARENT, pointerEvents: "all", cursor:
|
|
244
|
+
return (jsx_runtime_1.jsx("polygon", { points: outline.points.map((point) => `${point.x},${point.y}`).join(' '), fill: colors_1.TRANSPARENT, pointerEvents: "all", cursor: cursor, onPointerDown: onPointerDown, "data-remotion-studio-canvas-rotation": true }));
|
|
238
245
|
};
|
|
239
246
|
exports.SelectedOutlineCanvasRotation = SelectedOutlineCanvasRotation;
|
|
@@ -393,7 +393,7 @@ const SelectedOutlineElementUnmemoized = ({ compositionHeight, compositionWidth,
|
|
|
393
393
|
setPropStatuses,
|
|
394
394
|
]);
|
|
395
395
|
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
396
|
-
jsx_runtime_1.jsx(SelectedOutlinePolygon_1.SelectedOutlinePolygon, { compositionHeight: compositionHeight, compositionWidth: compositionWidth, directlySelected: (layoutTarget === null || layoutTarget === void 0 ? void 0 : layoutTarget.selected) === true, dragging: dragging, getAllDragOutlines: getAllDragOutlines, getAllDragTargets: getAllDragTargets, getLayoutTarget: getLayoutTarget, getTarget: getTarget, hasTarget: layoutTarget !== undefined, hovered: hovered, outline: outline, onContextMenuOpen: onContextMenuOpen, onContextMenuOpenChange: onContextMenuOpenChange, onDraggingChange: onDraggingChange, onHoverChange: onHoverChange, onSnapPointsChange: onSnapPointsChange, onSelect: onSelect, onDoubleClickTarget: onDoubleClickTarget, scale: scale, showSelectedOutline: (_a = layoutTarget === null || layoutTarget === void 0 ? void 0 : layoutTarget.showSelectedOutline) !== null && _a !== void 0 ? _a : false }), (layoutTarget === null || layoutTarget === void 0 ? void 0 : layoutTarget.selectedForRotation) && (controlTarget === null || controlTarget === void 0 ? void 0 : controlTarget.rotationDrag) ? (jsx_runtime_1.jsx(SelectedOutlineCanvasRotation_1.SelectedOutlineCanvasRotation, { getLatestTargetByKey: getLatestTargetByKey, layoutTarget: layoutTarget, onDraggingChange: onDraggingChange, outline: outline })) : null, jsx_runtime_1.jsx(SelectedOutlineCropControls_1.SelectedOutlineCropControls, { outline: outline, onDraggingChange: onDraggingChange, target: controlTarget }), (controlTarget === null || controlTarget === void 0 ? void 0 : controlTarget.cropDrag) === null &&
|
|
396
|
+
jsx_runtime_1.jsx(SelectedOutlinePolygon_1.SelectedOutlinePolygon, { compositionHeight: compositionHeight, compositionWidth: compositionWidth, containsSelection: (layoutTarget === null || layoutTarget === void 0 ? void 0 : layoutTarget.containsSelection) === true, directlySelected: (layoutTarget === null || layoutTarget === void 0 ? void 0 : layoutTarget.selected) === true, dragging: dragging, getAllDragOutlines: getAllDragOutlines, getAllDragTargets: getAllDragTargets, getLayoutTarget: getLayoutTarget, getTarget: getTarget, hasTarget: layoutTarget !== undefined, hovered: hovered, outline: outline, onContextMenuOpen: onContextMenuOpen, onContextMenuOpenChange: onContextMenuOpenChange, onDraggingChange: onDraggingChange, onHoverChange: onHoverChange, onSnapPointsChange: onSnapPointsChange, onSelect: onSelect, onDoubleClickTarget: onDoubleClickTarget, scale: scale, showSelectedOutline: (_a = layoutTarget === null || layoutTarget === void 0 ? void 0 : layoutTarget.showSelectedOutline) !== null && _a !== void 0 ? _a : false }), (layoutTarget === null || layoutTarget === void 0 ? void 0 : layoutTarget.selectedForRotation) && (controlTarget === null || controlTarget === void 0 ? void 0 : controlTarget.rotationDrag) ? (jsx_runtime_1.jsx(SelectedOutlineCanvasRotation_1.SelectedOutlineCanvasRotation, { getLatestTargetByKey: getLatestTargetByKey, layoutTarget: layoutTarget, onDraggingChange: onDraggingChange, outline: outline, transform3DMode: controlTarget.rotationDrag.transform3DMode })) : null, jsx_runtime_1.jsx(SelectedOutlineCropControls_1.SelectedOutlineCropControls, { outline: outline, onDraggingChange: onDraggingChange, target: controlTarget }), (controlTarget === null || controlTarget === void 0 ? void 0 : controlTarget.cropDrag) === null &&
|
|
397
397
|
((layoutTarget === null || layoutTarget === void 0 ? void 0 : layoutTarget.containsSelection) || hovered)
|
|
398
398
|
? controlLayout.scaleEdges.map((edge) => (jsx_runtime_1.jsx(SelectedOutlineScaleEdgeLine_1.SelectedOutlineScaleEdgeLine, { getAllScaleDragTargets: getAllScaleDragTargets, dragging: dragging, edge: edge, hitWidth: edge === 'top' || edge === 'bottom'
|
|
399
399
|
? controlLayout.scaleHitWidth.horizontal
|
|
@@ -6,6 +6,7 @@ import type { TimelineSelection, TimelineSelectionInteraction } from './Timeline
|
|
|
6
6
|
export declare const SelectedOutlinePolygon: React.NamedExoticComponent<{
|
|
7
7
|
readonly compositionHeight: number;
|
|
8
8
|
readonly compositionWidth: number;
|
|
9
|
+
readonly containsSelection: boolean;
|
|
9
10
|
readonly directlySelected: boolean;
|
|
10
11
|
readonly dragging: boolean;
|
|
11
12
|
readonly getAllDragOutlines: () => readonly SelectedOutline[];
|
|
@@ -56,7 +56,7 @@ const focus_inspector_field_1 = require("./Timeline/focus-inspector-field");
|
|
|
56
56
|
const imperative_state_1 = require("./Timeline/imperative-state");
|
|
57
57
|
const save_sequence_prop_1 = require("./Timeline/save-sequence-prop");
|
|
58
58
|
const should_clear_selection_on_pointer_down_1 = require("./Timeline/should-clear-selection-on-pointer-down");
|
|
59
|
-
const SelectedOutlinePolygonUnmemoized = ({ compositionHeight, compositionWidth, directlySelected, dragging, getAllDragOutlines, getAllDragTargets, getLayoutTarget, getTarget, hasTarget, hovered, onContextMenuOpen, onContextMenuOpenChange, outline, onDraggingChange, onHoverChange, onSnapPointsChange, onSelect, onDoubleClickTarget, scale, showSelectedOutline, }) => {
|
|
59
|
+
const SelectedOutlinePolygonUnmemoized = ({ compositionHeight, compositionWidth, containsSelection, directlySelected, dragging, getAllDragOutlines, getAllDragTargets, getLayoutTarget, getTarget, hasTarget, hovered, onContextMenuOpen, onContextMenuOpenChange, outline, onDraggingChange, onHoverChange, onSnapPointsChange, onSelect, onDoubleClickTarget, scale, showSelectedOutline, }) => {
|
|
60
60
|
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
61
61
|
const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
62
62
|
const { getDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeDragOverridesContext);
|
|
@@ -114,7 +114,7 @@ const SelectedOutlinePolygonUnmemoized = ({ compositionHeight, compositionWidth,
|
|
|
114
114
|
const deferSelection = !selected &&
|
|
115
115
|
!interaction.shiftKey &&
|
|
116
116
|
!interaction.toggleKey &&
|
|
117
|
-
pointerInsideSelectedOutline;
|
|
117
|
+
(containsSelection || pointerInsideSelectedOutline);
|
|
118
118
|
if (!deferSelection && shouldUpdateSelection) {
|
|
119
119
|
onSelect(target.selection, interaction);
|
|
120
120
|
}
|
|
@@ -317,6 +317,7 @@ const SelectedOutlinePolygonUnmemoized = ({ compositionHeight, compositionWidth,
|
|
|
317
317
|
clearDragOverrides,
|
|
318
318
|
compositionHeight,
|
|
319
319
|
compositionWidth,
|
|
320
|
+
containsSelection,
|
|
320
321
|
editorShowGuides,
|
|
321
322
|
editorSnapping,
|
|
322
323
|
getAllDragOutlines,
|
|
@@ -4,13 +4,14 @@ exports.TimelineClipboardKeybindings = exports.getPasteEffectPropTarget = export
|
|
|
4
4
|
const studio_shared_1 = require("@remotion/studio-shared");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const remotion_1 = require("remotion");
|
|
7
|
+
const browser_studio_operations_1 = require("../../helpers/browser-studio-operations");
|
|
7
8
|
const client_id_1 = require("../../helpers/client-id");
|
|
8
9
|
const clipboard_figma_1 = require("../../helpers/clipboard-figma");
|
|
9
10
|
const clipboard_images_1 = require("../../helpers/clipboard-images");
|
|
10
11
|
const clipboard_svg_1 = require("../../helpers/clipboard-svg");
|
|
11
12
|
const use_keybinding_1 = require("../../helpers/use-keybinding");
|
|
12
|
-
const call_api_1 = require("../call-api");
|
|
13
13
|
const ConfirmationDialog_1 = require("../ConfirmationDialog");
|
|
14
|
+
const effect_operations_api_1 = require("../effect-operations-api");
|
|
14
15
|
const NotificationCenter_1 = require("../Notifications/NotificationCenter");
|
|
15
16
|
const call_add_keyframe_1 = require("./call-add-keyframe");
|
|
16
17
|
const call_delete_keyframe_1 = require("./call-delete-keyframe");
|
|
@@ -869,6 +870,9 @@ const TimelineClipboardKeybindings = () => {
|
|
|
869
870
|
if (result.status === 'invalid') {
|
|
870
871
|
return;
|
|
871
872
|
}
|
|
873
|
+
if (!(0, browser_studio_operations_1.canUseEffectOperations)()) {
|
|
874
|
+
return;
|
|
875
|
+
}
|
|
872
876
|
e.preventDefault();
|
|
873
877
|
if (result.status === 'unsupported-version') {
|
|
874
878
|
(0, NotificationCenter_1.showNotification)('Cannot paste effects copied from a different Remotion Studio version', 4000);
|
|
@@ -892,7 +896,7 @@ const TimelineClipboardKeybindings = () => {
|
|
|
892
896
|
const insertAtIndices = (envelope === null || envelope === void 0 ? void 0 : envelope.sourceIdentity) === makeTargetKey(targetSequenceNodePath)
|
|
893
897
|
? envelope.originalEffectIndices
|
|
894
898
|
: null;
|
|
895
|
-
return (0,
|
|
899
|
+
return (0, effect_operations_api_1.pasteEffects)({
|
|
896
900
|
targetFileName: targetSequenceNodePath.absolutePath,
|
|
897
901
|
targetSequenceNodePath,
|
|
898
902
|
type: payload.type,
|
|
@@ -4,11 +4,12 @@ exports.TimelineEffectItem = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const remotion_1 = require("remotion");
|
|
7
|
+
const browser_studio_operations_1 = require("../../helpers/browser-studio-operations");
|
|
7
8
|
const client_id_1 = require("../../helpers/client-id");
|
|
8
9
|
const colors_1 = require("../../helpers/colors");
|
|
9
10
|
const timeline_layout_1 = require("../../helpers/timeline-layout");
|
|
10
|
-
const call_api_1 = require("../call-api");
|
|
11
11
|
const ContextMenu_1 = require("../ContextMenu");
|
|
12
|
+
const effect_operations_api_1 = require("../effect-operations-api");
|
|
12
13
|
const NotificationCenter_1 = require("../Notifications/NotificationCenter");
|
|
13
14
|
const save_effect_prop_1 = require("./save-effect-prop");
|
|
14
15
|
const TimelineExpandArrowButton_1 = require("./TimelineExpandArrowButton");
|
|
@@ -26,6 +27,14 @@ const rowStyle = {
|
|
|
26
27
|
height: timeline_layout_1.TREE_GROUP_ROW_HEIGHT,
|
|
27
28
|
cursor: 'default',
|
|
28
29
|
};
|
|
30
|
+
const labelContainerStyle = {
|
|
31
|
+
alignItems: 'center',
|
|
32
|
+
alignSelf: 'stretch',
|
|
33
|
+
display: 'flex',
|
|
34
|
+
flex: 1,
|
|
35
|
+
minWidth: 0,
|
|
36
|
+
paddingRight: timeline_layout_1.EXPANDED_SECTION_PADDING_RIGHT,
|
|
37
|
+
};
|
|
29
38
|
const reorderWrapper = {
|
|
30
39
|
position: 'relative',
|
|
31
40
|
};
|
|
@@ -69,6 +78,7 @@ const TimelineEffectItem = ({ label, nodePathInfo, effectIndex, effectSchema, do
|
|
|
69
78
|
var _b;
|
|
70
79
|
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
71
80
|
const previewConnected = previewServerState.type === 'connected';
|
|
81
|
+
const canMutateEffects = (0, browser_studio_operations_1.canUseEffectOperations)();
|
|
72
82
|
const { propStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesContext);
|
|
73
83
|
const { setPropStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
|
|
74
84
|
const selection = (0, TimelineSelection_1.useTimelineRowSelection)(nodePathInfo);
|
|
@@ -88,11 +98,13 @@ const TimelineEffectItem = ({ label, nodePathInfo, effectIndex, effectSchema, do
|
|
|
88
98
|
}
|
|
89
99
|
return false;
|
|
90
100
|
}, [disabledStatus]);
|
|
91
|
-
const canToggle = previewConnected && (disabledStatus === null || disabledStatus === void 0 ? void 0 : disabledStatus.status) === 'static';
|
|
101
|
+
const canToggle = previewConnected && canMutateEffects && (disabledStatus === null || disabledStatus === void 0 ? void 0 : disabledStatus.status) === 'static';
|
|
92
102
|
const deleteDisabled = !previewConnected ||
|
|
103
|
+
!canMutateEffects ||
|
|
93
104
|
effectStatus.type !== 'can-update-effect' ||
|
|
94
105
|
!validatedLocation.source;
|
|
95
106
|
const canReorder = previewConnected &&
|
|
107
|
+
canMutateEffects &&
|
|
96
108
|
effectStatus.type === 'can-update-effect' &&
|
|
97
109
|
Boolean(validatedLocation.source);
|
|
98
110
|
const nodePathKey = (0, react_1.useMemo)(() => remotion_1.Internals.makeSequencePropsSubscriptionKey(nodePath), [nodePath]);
|
|
@@ -101,7 +113,7 @@ const TimelineEffectItem = ({ label, nodePathInfo, effectIndex, effectSchema, do
|
|
|
101
113
|
return;
|
|
102
114
|
}
|
|
103
115
|
try {
|
|
104
|
-
const result = await (0,
|
|
116
|
+
const result = await (0, effect_operations_api_1.deleteEffects)([
|
|
105
117
|
{
|
|
106
118
|
type: 'single-effect',
|
|
107
119
|
fileName: validatedLocation.source,
|
|
@@ -209,8 +221,11 @@ const TimelineEffectItem = ({ label, nodePathInfo, effectIndex, effectSchema, do
|
|
|
209
221
|
alignItems: 'center',
|
|
210
222
|
color: (0, TimelineSelection_1.getTimelineColor)(selection.selected, true),
|
|
211
223
|
display: 'inline-flex',
|
|
212
|
-
|
|
224
|
+
flexShrink: 1,
|
|
213
225
|
minWidth: 0,
|
|
226
|
+
overflow: 'hidden',
|
|
227
|
+
textOverflow: 'ellipsis',
|
|
228
|
+
whiteSpace: 'nowrap',
|
|
214
229
|
boxShadow: containsSelection && !selection.selected
|
|
215
230
|
? `inset 0 0 0 2px ${TimelineSelection_1.TIMELINE_SELECTED_LABEL_BACKGROUND}`
|
|
216
231
|
: undefined,
|
|
@@ -288,7 +303,7 @@ const TimelineEffectItem = ({ label, nodePathInfo, effectIndex, effectSchema, do
|
|
|
288
303
|
setDropIndicator(null);
|
|
289
304
|
currentEffectDrag = null;
|
|
290
305
|
try {
|
|
291
|
-
const result = await (0,
|
|
306
|
+
const result = await (0, effect_operations_api_1.reorderEffect)({
|
|
292
307
|
fileName: validatedLocation.source,
|
|
293
308
|
sequenceNodePath: nodePath,
|
|
294
309
|
fromIndex: dropTarget.dragData.effectIndex,
|
|
@@ -321,7 +336,9 @@ const TimelineEffectItem = ({ label, nodePathInfo, effectIndex, effectSchema, do
|
|
|
321
336
|
...(dropIndicator === 'before' ? { top: -1 } : { bottom: -1 }),
|
|
322
337
|
};
|
|
323
338
|
}, [dropIndicator]);
|
|
324
|
-
const row = (jsx_runtime_1.jsx(TimelineRowChrome_1.TimelineRowChrome, { depth: rowDepth, eye: canToggle ? (jsx_runtime_1.jsx(TimelineLayerEye_1.TimelineLayerEye, { type: "effect", hidden: isDisabled, onInvoked: onToggle })) : (jsx_runtime_1.jsx(TimelineLayerEye_1.TimelineLayerEyeSpacer, {})), arrow: jsx_runtime_1.jsx(TimelineExpandArrowButton_1.
|
|
339
|
+
const row = (jsx_runtime_1.jsx(TimelineRowChrome_1.TimelineRowChrome, { depth: rowDepth, eye: canToggle ? (jsx_runtime_1.jsx(TimelineLayerEye_1.TimelineLayerEye, { type: "effect", hidden: isDisabled, onInvoked: onToggle })) : (jsx_runtime_1.jsx(TimelineLayerEye_1.TimelineLayerEyeSpacer, {})), arrow: jsx_runtime_1.jsx(TimelineExpandArrowButton_1.TimelineExpandArrowSpacer, {}), style: rowStyle, selected: selection.selected, selectable: selection.selectable, onSelect: selection.onSelect, showSelectedBackground: true, containsSelection: containsSelection, isFieldRow: false, outerHeight: null, children: jsx_runtime_1.jsxs("div", { style: labelContainerStyle, children: [
|
|
340
|
+
jsx_runtime_1.jsx("span", { title: label, style: labelStyle, children: label }), jsx_runtime_1.jsx(TimelineExpandArrowButton_1.TimelineExpandArrowButton, { isExpanded: isExpanded, onClick: () => toggleTrack(nodePathInfo), label: `${label} section`, disabled: false })
|
|
341
|
+
] }) }));
|
|
325
342
|
const draggableRow = canReorder ? (jsx_runtime_1.jsxs("div", { draggable: true, onDragStart: onDragStart, onDragEnd: onDragEnd, onDragOver: onDragOver, onDragLeave: onDragLeave, onDrop: onDrop, style: reorderWrapper, children: [reorderLineStyle ? jsx_runtime_1.jsx("div", { style: reorderLineStyle }) : null, row] })) : (row);
|
|
326
343
|
return previewConnected ? (jsx_runtime_1.jsx(ContextMenu_1.ContextMenu, { getItems: getContextMenuItems, children: draggableRow })) : (draggableRow);
|
|
327
344
|
};
|
|
@@ -5,11 +5,12 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const studio_shared_1 = require("@remotion/studio-shared");
|
|
6
6
|
const react_1 = require("react");
|
|
7
7
|
const remotion_1 = require("remotion");
|
|
8
|
+
const browser_studio_operations_1 = require("../../helpers/browser-studio-operations");
|
|
8
9
|
const client_id_1 = require("../../helpers/client-id");
|
|
9
10
|
const open_in_editor_1 = require("../../helpers/open-in-editor");
|
|
10
11
|
const use_runtime_values_1 = require("../../helpers/use-runtime-values");
|
|
11
|
-
const call_api_1 = require("../call-api");
|
|
12
12
|
const ContextMenu_1 = require("../ContextMenu");
|
|
13
|
+
const effect_operations_api_1 = require("../effect-operations-api");
|
|
13
14
|
const use_default_editor_info_1 = require("../use-default-editor-info");
|
|
14
15
|
const call_add_keyframe_1 = require("./call-add-keyframe");
|
|
15
16
|
const get_timeline_keyframes_1 = require("./get-timeline-keyframes");
|
|
@@ -128,7 +129,7 @@ const TimelineEffectPropValue = ({ field, nodePath, validatedLocation, sourceFra
|
|
|
128
129
|
value,
|
|
129
130
|
schema: field.effectSchema,
|
|
130
131
|
}),
|
|
131
|
-
apiCall: () => (0,
|
|
132
|
+
apiCall: () => (0, effect_operations_api_1.saveEffectProps)({
|
|
132
133
|
type: 'value',
|
|
133
134
|
fileName: validatedLocation.source,
|
|
134
135
|
sequenceNodePath: nodePath,
|
|
@@ -182,6 +183,9 @@ const TimelineEffectPropValue = ({ field, nodePath, validatedLocation, sourceFra
|
|
|
182
183
|
if (field.fieldSchema.type === 'scale') {
|
|
183
184
|
throw new Error(`Effects do not support scale fields: ${field.key}`);
|
|
184
185
|
}
|
|
186
|
+
if (!(0, browser_studio_operations_1.canUseEffectOperations)()) {
|
|
187
|
+
return jsx_runtime_1.jsx(TimelineSchemaField_1.UnsupportedStatus, { label: "read only", formattedValue: false });
|
|
188
|
+
}
|
|
185
189
|
if (effectStatus.type === 'cannot-update-effect') {
|
|
186
190
|
if (effectStatus.reason === 'computed') {
|
|
187
191
|
return (jsx_runtime_1.jsx(TimelineComputedEffectPropValue, { propStatus: { status: 'computed' }, field: field, runtimeValueStore: runtimeValueStore, validatedLocation: validatedLocation }));
|
|
@@ -37,11 +37,11 @@ exports.TimelineExpandArrowSpacer = exports.TimelineExpandArrowButton = void 0;
|
|
|
37
37
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
38
|
const react_1 = __importStar(require("react"));
|
|
39
39
|
const colors_1 = require("../../helpers/colors");
|
|
40
|
+
const hoverable_1 = require("../../helpers/hoverable");
|
|
41
|
+
const caret_1 = require("../../icons/caret");
|
|
40
42
|
const arrowButton = {
|
|
41
43
|
background: 'none',
|
|
42
44
|
border: 'none',
|
|
43
|
-
color: colors_1.WHITE,
|
|
44
|
-
cursor: 'pointer',
|
|
45
45
|
padding: 0,
|
|
46
46
|
display: 'flex',
|
|
47
47
|
alignItems: 'center',
|
|
@@ -57,9 +57,7 @@ const arrowButton = {
|
|
|
57
57
|
};
|
|
58
58
|
const arrowSpacer = {
|
|
59
59
|
...arrowButton,
|
|
60
|
-
cursor: 'default',
|
|
61
60
|
};
|
|
62
|
-
const svgStyle = { display: 'block' };
|
|
63
61
|
const TimelineExpandArrowButton = ({ isExpanded, onClick, label, disabled = false }) => {
|
|
64
62
|
const handleClick = react_1.default.useCallback((e) => {
|
|
65
63
|
e.stopPropagation();
|
|
@@ -71,12 +69,17 @@ const TimelineExpandArrowButton = ({ isExpanded, onClick, label, disabled = fals
|
|
|
71
69
|
const style = (0, react_1.useMemo)(() => {
|
|
72
70
|
return {
|
|
73
71
|
...arrowButton,
|
|
74
|
-
|
|
75
|
-
|
|
72
|
+
...(0, hoverable_1.hoverableStyle)({
|
|
73
|
+
idleBackground: colors_1.TRANSPARENT,
|
|
74
|
+
hoverBackground: colors_1.TRANSPARENT,
|
|
75
|
+
idleColor: colors_1.LIGHT_GRAY,
|
|
76
|
+
hoverColor: disabled ? colors_1.LIGHT_GRAY : colors_1.WHITE,
|
|
77
|
+
}),
|
|
78
|
+
transform: isExpanded ? 'rotate(0deg)' : 'rotate(-90deg)',
|
|
76
79
|
opacity: disabled ? 0.5 : 1,
|
|
77
80
|
};
|
|
78
81
|
}, [isExpanded, disabled]);
|
|
79
|
-
return (jsx_runtime_1.jsx("button", { type: "button", style: style, onClick: handleClick, onDoubleClick: stopPropagation, onPointerDown: stopPropagation, disabled: disabled, "aria-expanded": isExpanded, "aria-label": `${isExpanded ? 'Collapse' : 'Expand'} ${label}`, children: jsx_runtime_1.jsx(
|
|
82
|
+
return (jsx_runtime_1.jsx("button", { type: "button", className: `${hoverable_1.HOVERABLE_CLASS_NAME} __remotion-timeline-expand-arrow-button`, style: style, onClick: handleClick, onDoubleClick: stopPropagation, onPointerDown: stopPropagation, disabled: disabled, "aria-expanded": isExpanded, "aria-label": `${isExpanded ? 'Collapse' : 'Expand'} ${label}`, children: jsx_runtime_1.jsx(caret_1.CaretDown, {}) }));
|
|
80
83
|
};
|
|
81
84
|
exports.TimelineExpandArrowButton = TimelineExpandArrowButton;
|
|
82
85
|
const TimelineExpandArrowSpacer = () => {
|
|
@@ -59,7 +59,10 @@ const rowSeparator = {
|
|
|
59
59
|
};
|
|
60
60
|
const TimelineExpandedKeyframeRowUnmemoized = ({ height, keyframes, canEditEasing, nodePathInfo, showSeparator }) => {
|
|
61
61
|
const timelineWidth = (0, react_1.useContext)(TimelineWidthProvider_1.TimelineWidthContext);
|
|
62
|
-
const rowHighlightBackground = (0, TimelineSelection_1.useTimelineRowHighlightBackground)(nodePathInfo
|
|
62
|
+
const rowHighlightBackground = (0, TimelineSelection_1.useTimelineRowHighlightBackground)(nodePathInfo, {
|
|
63
|
+
hovered: false,
|
|
64
|
+
selectedBackground: TimelineSelection_1.TIMELINE_EXPANDED_SELECTED_BACKGROUND,
|
|
65
|
+
});
|
|
63
66
|
const easingSegments = canEditEasing
|
|
64
67
|
? (0, get_timeline_easing_segments_1.getTimelineEasingSegments)(keyframes)
|
|
65
68
|
: [];
|
|
@@ -39,8 +39,11 @@ const react_1 = __importStar(require("react"));
|
|
|
39
39
|
const colors_1 = require("../../helpers/colors");
|
|
40
40
|
const timeline_layout_1 = require("../../helpers/timeline-layout");
|
|
41
41
|
const TimelineExpandedRow_1 = require("./TimelineExpandedRow");
|
|
42
|
+
const TimelineRowChrome_1 = require("./TimelineRowChrome");
|
|
43
|
+
const TimelineSelection_1 = require("./TimelineSelection");
|
|
42
44
|
const use_timeline_expanded_tree_1 = require("./use-timeline-expanded-tree");
|
|
43
45
|
const expandedSectionBase = {
|
|
46
|
+
backgroundColor: TimelineSelection_1.TIMELINE_BACKGROUND,
|
|
44
47
|
color: colors_1.WHITE,
|
|
45
48
|
fontFamily: 'Arial, Helvetica, sans-serif',
|
|
46
49
|
fontSize: 12,
|
|
@@ -68,16 +71,16 @@ const TimelineExpandedSection = ({ sequence, validatedLocation, nodePathInfo, ne
|
|
|
68
71
|
const style = (0, react_1.useMemo)(() => {
|
|
69
72
|
return {
|
|
70
73
|
...expandedSectionBase,
|
|
71
|
-
height: expandedHeight,
|
|
74
|
+
height: expandedHeight + timeline_layout_1.TIMELINE_ITEM_BORDER_BOTTOM,
|
|
72
75
|
};
|
|
73
76
|
}, [expandedHeight]);
|
|
74
77
|
const { schema } = sequence.controls;
|
|
75
78
|
if (flat.length === 0) {
|
|
76
79
|
return null;
|
|
77
80
|
}
|
|
78
|
-
return (jsx_runtime_1.jsx("div", { style: style, children: flat.map(({ node, depth }, i) => {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
81
|
+
return (jsx_runtime_1.jsx(TimelineRowChrome_1.TimelineRowSelectedBackgroundContext.Provider, { value: TimelineSelection_1.TIMELINE_EXPANDED_SELECTED_BACKGROUND, children: jsx_runtime_1.jsx("div", { style: style, children: flat.map(({ node, depth }, i) => {
|
|
82
|
+
return (jsx_runtime_1.jsxs(react_1.default.Fragment, { children: [i > 0 ? jsx_runtime_1.jsx("div", { style: separator }) : null, jsx_runtime_1.jsx(TimelineExpandedRow_1.TimelineExpandedRow, { node: node, depth: depth, nestedDepth: nestedDepth, getIsExpanded: getIsExpanded, toggleTrack: toggleTrack, validatedLocation: validatedLocation, nodePath: nodePathInfo.sequenceSubscriptionKey, schema: schema, keyframeDisplayOffset: keyframeDisplayOffset, keyframeControlsMode: "timeline" })
|
|
83
|
+
] }, JSON.stringify(node.nodePathInfo)));
|
|
84
|
+
}) }) }));
|
|
82
85
|
};
|
|
83
86
|
exports.TimelineExpandedSection = TimelineExpandedSection;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { TimelineSelectionInteraction } from './TimelineSelection';
|
|
3
|
+
export declare const TimelineRowSelectedBackgroundContext: React.Context<string>;
|
|
3
4
|
export declare const TimelineRowKeyframeControlsColumn: React.FC<{
|
|
4
5
|
readonly children: React.ReactNode;
|
|
5
6
|
readonly depth: number;
|
|
@@ -1,13 +1,47 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TimelineRowChrome = exports.TimelineRowKeyframeControlsColumn = void 0;
|
|
36
|
+
exports.TimelineRowChrome = exports.TimelineRowKeyframeControlsColumn = exports.TimelineRowSelectedBackgroundContext = void 0;
|
|
4
37
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 = require("react");
|
|
38
|
+
const react_1 = __importStar(require("react"));
|
|
6
39
|
const colors_1 = require("../../helpers/colors");
|
|
7
40
|
const Padder_1 = require("./Padder");
|
|
8
41
|
const timeline_row_layout_1 = require("./timeline-row-layout");
|
|
9
42
|
const TimelineRowLayoutContext_1 = require("./TimelineRowLayoutContext");
|
|
10
43
|
const TimelineSelection_1 = require("./TimelineSelection");
|
|
44
|
+
exports.TimelineRowSelectedBackgroundContext = react_1.default.createContext(TimelineSelection_1.TIMELINE_SELECTED_BACKGROUND);
|
|
11
45
|
const rowBase = {
|
|
12
46
|
alignItems: 'stretch',
|
|
13
47
|
display: 'flex',
|
|
@@ -37,6 +71,7 @@ const TimelineRowKeyframeControlsColumn = ({ children, depth }) => {
|
|
|
37
71
|
exports.TimelineRowKeyframeControlsColumn = TimelineRowKeyframeControlsColumn;
|
|
38
72
|
const TimelineRowChrome = ({ depth, eye, keyframeControls, arrow, children, style, selected, selectable, onSelect, showSelectedBackground, containsSelection, hovered = false, isFieldRow, outerHeight, onDragLeave, onDragOver, onDrop, onDoubleClick, onPointerEnter, onPointerLeave, }) => {
|
|
39
73
|
const { basePadding, keyframeControlsPlacement, rowBorderRadius, rowHorizontalMargin, } = (0, react_1.useContext)(TimelineRowLayoutContext_1.TimelineRowLayoutContext);
|
|
74
|
+
const selectedBackground = (0, react_1.useContext)(exports.TimelineRowSelectedBackgroundContext);
|
|
40
75
|
const indentWidth = (0, timeline_row_layout_1.getTimelineRowIndentWidth)(depth);
|
|
41
76
|
const chromeColumnStyle = (0, react_1.useMemo)(() => ({
|
|
42
77
|
alignItems: 'center',
|
|
@@ -72,6 +107,7 @@ const TimelineRowChrome = ({ depth, eye, keyframeControls, arrow, children, styl
|
|
|
72
107
|
selected,
|
|
73
108
|
containsSelection,
|
|
74
109
|
hovered,
|
|
110
|
+
selectedBackground,
|
|
75
111
|
});
|
|
76
112
|
const innerRowStyle = (0, react_1.useMemo)(() => ({
|
|
77
113
|
...rowBase,
|
|
@@ -3,6 +3,7 @@ import { type GetDragOverrides, type GetEffectDragOverrides, type PropStatuses }
|
|
|
3
3
|
import type { SequenceNodePathInfo, TimelineTrackData } from '../../helpers/get-timeline-sequence-sort-key';
|
|
4
4
|
import { type GetIsExpanded } from '../ExpandedTracksProvider';
|
|
5
5
|
export declare const TIMELINE_SELECTED_BACKGROUND = "#3B3F42";
|
|
6
|
+
export declare const TIMELINE_EXPANDED_SELECTED_BACKGROUND = "rgb(31,36,40)";
|
|
6
7
|
export declare const TIMELINE_HOVER_BACKGROUND = "rgba(255, 255, 255, 0.05)";
|
|
7
8
|
export declare const TIMELINE_SELECTED_LABEL_BACKGROUND = "#B0B0B0";
|
|
8
9
|
export declare const TIMELINE_SELECTED_LABEL_TEXT = "black";
|
|
@@ -10,13 +11,14 @@ export declare const TIMELINE_SELECTED_LABEL_HORIZONTAL_PADDING = 2;
|
|
|
10
11
|
export declare const getTimelineSelectedLabelStyle: (selected: boolean, subcategory: boolean) => CSSProperties;
|
|
11
12
|
export declare const getTimelineColor: (selected: boolean, subcategory: boolean) => "black" | "rgba(255, 255, 255, 0.8)";
|
|
12
13
|
export declare const getTimelineSelectedTrackHighlightStyle: (timelineWidth: number, backgroundColor?: string) => CSSProperties;
|
|
13
|
-
export declare const getTimelineRowHighlightBackground: ({ showSelectedBackground, selected, containsSelection, hovered, }: {
|
|
14
|
+
export declare const getTimelineRowHighlightBackground: ({ showSelectedBackground, selected, containsSelection, hovered, selectedBackground, }: {
|
|
14
15
|
readonly showSelectedBackground: boolean;
|
|
15
16
|
readonly selected: boolean;
|
|
16
17
|
readonly containsSelection: boolean;
|
|
17
18
|
readonly hovered: boolean;
|
|
19
|
+
readonly selectedBackground: string;
|
|
18
20
|
}) => string | undefined;
|
|
19
|
-
export declare const TIMELINE_BACKGROUND = "#
|
|
21
|
+
export declare const TIMELINE_BACKGROUND = "#15181B";
|
|
20
22
|
export declare const TIMELINE_TICKS_BACKGROUND = "rgb(31,36,40)";
|
|
21
23
|
export type TimelineSelection = {
|
|
22
24
|
readonly type: 'guide';
|
|
@@ -222,5 +224,8 @@ export declare const useTimelineGuideSelection: (guideId: string) => {
|
|
|
222
224
|
selectionItem: TimelineSelection;
|
|
223
225
|
};
|
|
224
226
|
export declare const useTimelineRowContainsSelection: (nodePathInfo: SequenceNodePathInfo | null) => boolean;
|
|
225
|
-
export declare const useTimelineRowHighlightBackground: (nodePathInfo: SequenceNodePathInfo | null, hovered
|
|
227
|
+
export declare const useTimelineRowHighlightBackground: (nodePathInfo: SequenceNodePathInfo | null, { hovered, selectedBackground, }: {
|
|
228
|
+
readonly hovered: boolean;
|
|
229
|
+
readonly selectedBackground: string;
|
|
230
|
+
}) => string | undefined;
|
|
226
231
|
export {};
|