@remotion/studio 4.0.501 → 4.0.503
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/AssetSelectorItem.js +4 -4
- package/dist/components/Canvas.js +37 -57
- package/dist/components/ColorPicker/AlphaSlider.js +14 -10
- package/dist/components/ColorPicker/HueSlider.js +14 -10
- package/dist/components/ColorPicker/SaturationValueArea.js +14 -12
- package/dist/components/CompositionContextButton.js +1 -1
- package/dist/components/CompositionSelector.js +4 -4
- package/dist/components/CompositionSelectorItem.js +5 -5
- package/dist/components/ConfigureDefaultEditorModal.d.ts +2 -0
- package/dist/components/ConfigureDefaultEditorModal.js +151 -0
- package/dist/components/ConfirmationDialog.js +6 -3
- package/dist/components/ContextMenu.js +0 -2
- package/dist/components/Editor.js +1 -4
- package/dist/components/EditorContent.js +1 -1
- package/dist/components/EditorGuides/Guide.js +48 -74
- package/dist/components/EditorRuler/Ruler.d.ts +1 -0
- package/dist/components/EditorRuler/Ruler.js +3 -1
- package/dist/components/EditorRuler/index.js +26 -23
- package/dist/components/ElementInstallConfirmation.d.ts +12 -0
- package/dist/components/ElementInstallConfirmation.js +205 -0
- package/dist/components/ForceSpecificCursor.js +14 -0
- package/dist/components/FullscreenToggle.d.ts +3 -1
- package/dist/components/FullscreenToggle.js +2 -2
- package/dist/components/InlineAction.d.ts +2 -1
- package/dist/components/InlineAction.js +4 -4
- package/dist/components/InspectorLocationCopy.d.ts +1 -0
- package/dist/components/InspectorLocationCopy.js +7 -3
- package/dist/components/InspectorOpenInEditor.d.ts +5 -0
- package/dist/components/InspectorOpenInEditor.js +135 -0
- package/dist/components/InspectorPanel/AlignmentControls.js +1 -1
- package/dist/components/InspectorPanel/CompositionInspectorHeader.js +3 -3
- package/dist/components/InspectorPanel/CompositionMetadata.js +1 -1
- package/dist/components/InspectorPanel/KeyframeEasingNavigator.js +2 -2
- package/dist/components/InspectorPanel/SequenceInspectorHeader.js +2 -2
- package/dist/components/InspectorPanel/use-composition-actions.d.ts +1 -1
- package/dist/components/InspectorPanel/use-composition-actions.js +46 -3
- package/dist/components/InspectorSequenceSection.js +2 -2
- package/dist/components/LoopToggle.d.ts +1 -0
- package/dist/components/LoopToggle.js +9 -5
- package/dist/components/Menu/MenuItem.js +13 -6
- package/dist/components/Menu/MenuSubItem.js +11 -1
- package/dist/components/MenuBuildIndicator.js +1 -1
- package/dist/components/MenuCompositionName.js +1 -1
- package/dist/components/MobilePanel.js +5 -1
- package/dist/components/ModalContainer.js +1 -1
- package/dist/components/ModalFooter.d.ts +1 -0
- package/dist/components/ModalFooter.js +2 -2
- package/dist/components/Modals.js +11 -2
- package/dist/components/NewComposition/InputDragger.js +19 -29
- package/dist/components/ObserveDefaultPropsContext.js +7 -4
- package/dist/components/PlayPause.d.ts +1 -0
- package/dist/components/PlayPause.js +2 -4
- package/dist/components/PlaybackRateSelector.d.ts +9 -2
- package/dist/components/PlaybackRateSelector.js +21 -10
- package/dist/components/PreviewToolbar.js +19 -109
- package/dist/components/PreviewToolbarOverflowButton.d.ts +12 -0
- package/dist/components/PreviewToolbarOverflowButton.js +217 -0
- package/dist/components/QuickSwitcher/QuickSwitcher.d.ts +1 -0
- package/dist/components/QuickSwitcher/QuickSwitcherContent.d.ts +1 -0
- package/dist/components/QuickSwitcher/QuickSwitcherContent.js +16 -1
- package/dist/components/QuickSwitcher/QuickSwitcherResult.d.ts +2 -0
- package/dist/components/QuickSwitcher/QuickSwitcherResult.js +7 -1
- package/dist/components/RenderButton.d.ts +1 -0
- package/dist/components/RenderButton.js +6 -4
- package/dist/components/RenderModal/InlineEyeIcon.js +1 -1
- package/dist/components/RenderModal/InlineRemoveButton.js +1 -1
- package/dist/components/RenderModal/RenderModalOutputName.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/SchemaResetButton.js +1 -1
- package/dist/components/RenderQueue/RenderQueueCopyToClipboard.js +1 -1
- package/dist/components/RenderQueue/RenderQueueDownloadItem.js +1 -1
- package/dist/components/RenderQueue/RenderQueueItemCancelButton.js +1 -1
- package/dist/components/RenderQueue/RenderQueueOpenInFolder.js +1 -1
- package/dist/components/RenderQueue/RenderQueueRemoveItem.js +1 -1
- package/dist/components/RenderQueue/RenderQueueRepeat.js +1 -1
- package/dist/components/SelectedOutlineCropControls.js +7 -6
- package/dist/components/SelectedOutlineElement.js +28 -26
- package/dist/components/SelectedOutlineUvControls.js +25 -24
- package/dist/components/ShowGuidesProvider.js +2 -0
- package/dist/components/SidebarCollapserControls.js +2 -2
- package/dist/components/SidebarRenderButton.js +1 -1
- package/dist/components/SizeSelector.d.ts +6 -0
- package/dist/components/SizeSelector.js +17 -8
- package/dist/components/Splitter/SplitterContainer.d.ts +1 -0
- package/dist/components/Splitter/SplitterContainer.js +23 -3
- package/dist/components/Splitter/SplitterContext.d.ts +14 -0
- package/dist/components/Splitter/SplitterContext.js +16 -1
- package/dist/components/Splitter/SplitterHandle.js +25 -74
- package/dist/components/Timeline/EasingEditorModal.js +27 -19
- package/dist/components/Timeline/Timeline.js +2 -1
- package/dist/components/Timeline/TimelineAssetField.d.ts +1 -1
- package/dist/components/Timeline/TimelineAssetField.js +37 -2
- package/dist/components/Timeline/TimelineDragHandler.js +39 -8
- package/dist/components/Timeline/TimelineInOutDragHandler.js +26 -11
- package/dist/components/Timeline/TimelineLayerEye.js +36 -4
- package/dist/components/Timeline/TimelineSelection.js +14 -21
- package/dist/components/Timeline/TimelineSequence.js +7 -3
- package/dist/components/Timeline/TimelineSequenceItem.js +24 -18
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +1 -1
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +76 -43
- package/dist/components/Timeline/TimelineStack/get-stack.js +13 -0
- package/dist/components/Timeline/get-sequence-context-menu-items.d.ts +4 -2
- package/dist/components/Timeline/get-sequence-context-menu-items.js +38 -2
- package/dist/components/Timeline/save-sequence-prop.js +4 -4
- package/dist/components/Timeline/sequence-props-subscription-store.d.ts +2 -2
- package/dist/components/Timeline/sequence-props-subscription-store.js +3 -3
- package/dist/components/Timeline/should-subscribe-to-source-file.d.ts +1 -0
- package/dist/components/Timeline/should-subscribe-to-source-file.js +11 -0
- package/dist/components/Timeline/use-open-sequence-in-editor.d.ts +3 -1
- package/dist/components/Timeline/use-open-sequence-in-editor.js +5 -2
- package/dist/components/Timeline/use-sequence-props-subscription.js +2 -0
- package/dist/components/Timeline/use-timeline-asset-drop.js +0 -4
- package/dist/components/Timeline/use-timeline-keyframe-drag.js +31 -16
- package/dist/components/TopPanel.js +1 -1
- package/dist/components/UndoRedoButtons.js +1 -1
- package/dist/components/UpdateCheck.d.ts +2 -0
- package/dist/components/UpdateCheck.js +20 -8
- package/dist/components/UpdateModal/UpdateModal.js +26 -10
- package/dist/components/VisualControls/ClickableFileName.js +5 -2
- package/dist/components/composition-menu-items.js +1 -1
- package/dist/components/default-props-api.d.ts +3 -0
- package/dist/components/default-props-api.js +19 -0
- package/dist/components/drop-handler-data.d.ts +1 -1
- package/dist/components/drop-handler-data.js +6 -6
- package/dist/components/effect-drag-and-drop.d.ts +1 -1
- package/dist/components/effect-drag-and-drop.js +3 -3
- package/dist/components/element-drag-and-drop.d.ts +1 -1
- package/dist/components/element-drag-and-drop.js +3 -3
- package/dist/components/element-install-request.d.ts +3 -0
- package/dist/components/element-install-request.js +17 -0
- package/dist/components/folder-menu-items.js +1 -1
- package/dist/components/handle-drop.d.ts +2 -3
- package/dist/components/handle-drop.js +11 -4
- package/dist/components/import-assets.d.ts +9 -9
- package/dist/components/import-assets.js +4 -15
- package/dist/components/sequence-props-api.d.ts +4 -0
- package/dist/components/sequence-props-api.js +26 -0
- package/dist/components/use-default-editor-info.d.ts +4 -0
- package/dist/components/use-default-editor-info.js +47 -0
- package/dist/error-overlay/remotion-overlay/ErrorDisplay.d.ts +1 -0
- package/dist/error-overlay/remotion-overlay/ErrorDisplay.js +29 -5
- package/dist/error-overlay/remotion-overlay/ErrorLoader.js +4 -20
- package/dist/error-overlay/remotion-overlay/OpenInEditor.js +1 -1
- package/dist/error-overlay/remotion-overlay/StackFrame.js +1 -1
- package/dist/esm/{chunk-n1kj09yv.js → chunk-bj1r1hh5.js} +8153 -6662
- package/dist/esm/internals.mjs +8153 -6662
- package/dist/esm/previewEntry.mjs +8210 -6719
- package/dist/esm/renderEntry.mjs +1 -1
- package/dist/helpers/inject-css.js +18 -44
- package/dist/helpers/open-in-editor.d.ts +3 -3
- package/dist/helpers/open-in-editor.js +10 -6
- package/dist/helpers/pointer-session.d.ts +9 -0
- package/dist/helpers/pointer-session.js +94 -0
- package/dist/helpers/use-menu-structure.js +24 -2
- package/dist/icons/custom-editor.d.ts +4 -0
- package/dist/icons/custom-editor.js +11 -0
- package/dist/icons/editor.d.ts +6 -0
- package/dist/icons/editor.js +52 -0
- package/dist/icons/upload.d.ts +4 -0
- package/dist/icons/upload.js +8 -0
- package/dist/state/editor-guides.d.ts +1 -0
- package/dist/state/editor-guides.js +1 -0
- package/dist/state/modals.d.ts +3 -0
- package/dist/state/z-index.d.ts +1 -0
- package/dist/state/z-index.js +34 -18
- package/package.json +12 -13
- package/dist/components/StudioCanvasCapture.d.ts +0 -5
- package/dist/components/StudioCanvasCapture.js +0 -40
- package/dist/components/canvas-capture-enabled.d.ts +0 -1
- package/dist/components/canvas-capture-enabled.js +0 -4
- package/dist/components/use-element-overwrite-confirmation.d.ts +0 -2
- package/dist/components/use-element-overwrite-confirmation.js +0 -73
|
@@ -38,6 +38,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
38
38
|
const react_1 = __importStar(require("react"));
|
|
39
39
|
const remotion_1 = require("remotion");
|
|
40
40
|
const colors_1 = require("../helpers/colors");
|
|
41
|
+
const pointer_session_1 = require("../helpers/pointer-session");
|
|
41
42
|
const editor_snapping_1 = require("../state/editor-snapping");
|
|
42
43
|
const ForceSpecificCursor_1 = require("./ForceSpecificCursor");
|
|
43
44
|
const selected_outline_drag_1 = require("./selected-outline-drag");
|
|
@@ -217,9 +218,6 @@ const SelectedUvEllipseStartHandle = ({ control, onDraggingChange, outline }) =>
|
|
|
217
218
|
updateFromPointerEvent(moveEvent);
|
|
218
219
|
};
|
|
219
220
|
const onPointerUp = () => {
|
|
220
|
-
window.removeEventListener('pointermove', onPointerMove);
|
|
221
|
-
window.removeEventListener('pointerup', onPointerUp);
|
|
222
|
-
window.removeEventListener('pointercancel', onPointerUp);
|
|
223
221
|
if (dragging) {
|
|
224
222
|
(0, ForceSpecificCursor_1.stopForcingSpecificCursor)();
|
|
225
223
|
onDraggingChange(false);
|
|
@@ -236,9 +234,12 @@ const SelectedUvEllipseStartHandle = ({ control, onDraggingChange, outline }) =>
|
|
|
236
234
|
sourceFrame: control.handle.sourceFrame,
|
|
237
235
|
});
|
|
238
236
|
};
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
237
|
+
(0, pointer_session_1.startPointerSession)({
|
|
238
|
+
event,
|
|
239
|
+
target: event.currentTarget,
|
|
240
|
+
onMove: onPointerMove,
|
|
241
|
+
onEnd: onPointerUp,
|
|
242
|
+
});
|
|
242
243
|
}, [
|
|
243
244
|
clearEffectDragOverrides,
|
|
244
245
|
control.handle,
|
|
@@ -317,9 +318,6 @@ const SelectedUvEllipseResizeHandle = ({ axis, control, onDraggingChange, outlin
|
|
|
317
318
|
updateFromPointerEvent(moveEvent);
|
|
318
319
|
};
|
|
319
320
|
const onPointerUp = () => {
|
|
320
|
-
window.removeEventListener('pointermove', onPointerMove);
|
|
321
|
-
window.removeEventListener('pointerup', onPointerUp);
|
|
322
|
-
window.removeEventListener('pointercancel', onPointerUp);
|
|
323
321
|
if (dragging) {
|
|
324
322
|
(0, ForceSpecificCursor_1.stopForcingSpecificCursor)();
|
|
325
323
|
onDraggingChange(false);
|
|
@@ -336,9 +334,12 @@ const SelectedUvEllipseResizeHandle = ({ axis, control, onDraggingChange, outlin
|
|
|
336
334
|
sourceFrame: control.handle.sourceFrame,
|
|
337
335
|
});
|
|
338
336
|
};
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
337
|
+
(0, pointer_session_1.startPointerSession)({
|
|
338
|
+
event,
|
|
339
|
+
target: event.currentTarget,
|
|
340
|
+
onMove: onPointerMove,
|
|
341
|
+
onEnd: onPointerUp,
|
|
342
|
+
});
|
|
342
343
|
}, [
|
|
343
344
|
axis,
|
|
344
345
|
clearEffectDragOverrides,
|
|
@@ -470,9 +471,6 @@ const SelectedUvEllipseRotationHandle = ({ control, onDraggingChange }) => {
|
|
|
470
471
|
}
|
|
471
472
|
};
|
|
472
473
|
const onPointerUp = () => {
|
|
473
|
-
window.removeEventListener('pointermove', onPointerMove);
|
|
474
|
-
window.removeEventListener('pointerup', onPointerUp);
|
|
475
|
-
window.removeEventListener('pointercancel', onPointerUp);
|
|
476
474
|
window.removeEventListener('keydown', onKeyChange);
|
|
477
475
|
window.removeEventListener('keyup', onKeyChange);
|
|
478
476
|
if (dragging) {
|
|
@@ -491,9 +489,12 @@ const SelectedUvEllipseRotationHandle = ({ control, onDraggingChange }) => {
|
|
|
491
489
|
sourceFrame: control.handle.sourceFrame,
|
|
492
490
|
});
|
|
493
491
|
};
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
492
|
+
(0, pointer_session_1.startPointerSession)({
|
|
493
|
+
event,
|
|
494
|
+
target: event.currentTarget,
|
|
495
|
+
onMove: onPointerMove,
|
|
496
|
+
onEnd: onPointerUp,
|
|
497
|
+
});
|
|
497
498
|
window.addEventListener('keydown', onKeyChange);
|
|
498
499
|
window.addEventListener('keyup', onKeyChange);
|
|
499
500
|
}, [
|
|
@@ -595,9 +596,6 @@ const SelectedUvHandleCircle = ({ handle, nodePathInfo, onDraggingChange, onSele
|
|
|
595
596
|
updateDragFromPointerEvent(moveEvent);
|
|
596
597
|
};
|
|
597
598
|
const onPointerUp = () => {
|
|
598
|
-
window.removeEventListener('pointermove', onPointerMove);
|
|
599
|
-
window.removeEventListener('pointerup', onPointerUp);
|
|
600
|
-
window.removeEventListener('pointercancel', onPointerUp);
|
|
601
599
|
if (dragging) {
|
|
602
600
|
(0, ForceSpecificCursor_1.stopForcingSpecificCursor)();
|
|
603
601
|
onDraggingChange(false);
|
|
@@ -645,9 +643,12 @@ const SelectedUvHandleCircle = ({ handle, nodePathInfo, onDraggingChange, onSele
|
|
|
645
643
|
clearEffectDragOverrides(handle.nodePath, handle.effectIndex);
|
|
646
644
|
});
|
|
647
645
|
};
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
646
|
+
(0, pointer_session_1.startPointerSession)({
|
|
647
|
+
event,
|
|
648
|
+
target: event.currentTarget,
|
|
649
|
+
onMove: onPointerMove,
|
|
650
|
+
onEnd: onPointerUp,
|
|
651
|
+
});
|
|
651
652
|
}, [
|
|
652
653
|
clearEffectDragOverrides,
|
|
653
654
|
editorSnapping,
|
|
@@ -7,6 +7,7 @@ const editor_guides_1 = require("../state/editor-guides");
|
|
|
7
7
|
const ShowGuidesProvider = ({ children }) => {
|
|
8
8
|
const [guidesList, setGuidesList] = (0, react_1.useState)(() => (0, editor_guides_1.loadGuidesList)());
|
|
9
9
|
const [draggingGuideId, setDraggingGuideId] = (0, react_1.useState)(null);
|
|
10
|
+
const moveGuidePointerRef = (0, react_1.useRef)(null);
|
|
10
11
|
const [hoveredGuideId, setHoveredGuideId] = (0, react_1.useState)(null);
|
|
11
12
|
const [editorShowGuides, setEditorShowGuidesState] = (0, react_1.useState)(() => (0, editor_guides_1.loadEditorShowGuidesOption)());
|
|
12
13
|
const shouldCreateGuideRef = (0, react_1.useRef)(false);
|
|
@@ -25,6 +26,7 @@ const ShowGuidesProvider = ({ children }) => {
|
|
|
25
26
|
guidesList,
|
|
26
27
|
setGuidesList,
|
|
27
28
|
draggingGuideId,
|
|
29
|
+
moveGuidePointerRef,
|
|
28
30
|
setDraggingGuideId,
|
|
29
31
|
shouldCreateGuideRef,
|
|
30
32
|
shouldDeleteGuideRef,
|
|
@@ -139,8 +139,8 @@ const SidebarCollapserControl = ({ side }) => {
|
|
|
139
139
|
return (jsx_runtime_1.jsx("div", { "data-sidebar-toggle": "right", style: colorStyle(color), title: toggleRightTooltip, children: jsx_runtime_1.jsx("div", { style: rightIcon(color) }) }));
|
|
140
140
|
}, [colorStyle, rightIcon, toggleRightTooltip]);
|
|
141
141
|
if (side === 'left') {
|
|
142
|
-
return (jsx_runtime_1.jsx(InlineAction_1.InlineAction, { onClick: toggleLeft, renderAction: toggleLeftAction, unhoveredColor: colors_1.WHITE_ALPHA_80 }));
|
|
142
|
+
return (jsx_runtime_1.jsx(InlineAction_1.InlineAction, { variant: null, onClick: toggleLeft, renderAction: toggleLeftAction, unhoveredColor: colors_1.WHITE_ALPHA_80 }));
|
|
143
143
|
}
|
|
144
|
-
return (jsx_runtime_1.jsx(InlineAction_1.InlineAction, { onClick: toggleRight, renderAction: toggleRightAction, unhoveredColor: colors_1.WHITE_ALPHA_80 }));
|
|
144
|
+
return (jsx_runtime_1.jsx(InlineAction_1.InlineAction, { variant: null, onClick: toggleRight, renderAction: toggleRightAction, unhoveredColor: colors_1.WHITE_ALPHA_80 }));
|
|
145
145
|
};
|
|
146
146
|
exports.SidebarCollapserControl = SidebarCollapserControl;
|
|
@@ -101,6 +101,6 @@ const SidebarRenderButton = ({ composition, visible }) => {
|
|
|
101
101
|
if (!visible || connectionStatus !== 'connected') {
|
|
102
102
|
return null;
|
|
103
103
|
}
|
|
104
|
-
return jsx_runtime_1.jsx(InlineAction_1.InlineAction, { renderAction: renderAction, onClick: onClick });
|
|
104
|
+
return (jsx_runtime_1.jsx(InlineAction_1.InlineAction, { renderAction: renderAction, onClick: onClick, variant: null }));
|
|
105
105
|
};
|
|
106
106
|
exports.SidebarRenderButton = SidebarRenderButton;
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { PreviewSize } from 'remotion';
|
|
3
|
+
import type { ComboboxValue } from './NewComposition/ComboBox';
|
|
3
4
|
export declare const getPreviewSizeLabel: (previewSize: PreviewSize) => string;
|
|
4
5
|
export declare const getUniqueSizes: (size: PreviewSize) => PreviewSize[];
|
|
6
|
+
export declare const usePreviewSizeMenuItems: () => {
|
|
7
|
+
items: ComboboxValue[];
|
|
8
|
+
selectedId: string;
|
|
9
|
+
zoomable: boolean | null;
|
|
10
|
+
};
|
|
5
11
|
export declare const SizeSelector: React.FC;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SizeSelector = exports.getUniqueSizes = exports.getPreviewSizeLabel = void 0;
|
|
3
|
+
exports.SizeSelector = exports.usePreviewSizeMenuItems = exports.getUniqueSizes = exports.getPreviewSizeLabel = 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");
|
|
@@ -67,14 +67,9 @@ const getUniqueSizes = (size) => {
|
|
|
67
67
|
};
|
|
68
68
|
exports.getUniqueSizes = getUniqueSizes;
|
|
69
69
|
const zoomableFileTypes = ['video', 'image'];
|
|
70
|
-
const
|
|
70
|
+
const usePreviewSizeMenuItems = () => {
|
|
71
71
|
const { size, setSize } = (0, react_1.useContext)(remotion_1.Internals.PreviewSizeContext);
|
|
72
72
|
const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
73
|
-
const style = (0, react_1.useMemo)(() => {
|
|
74
|
-
return {
|
|
75
|
-
padding: ControlButton_1.CONTROL_BUTTON_PADDING - 2,
|
|
76
|
-
};
|
|
77
|
-
}, []);
|
|
78
73
|
const zoomable = (0, react_1.useMemo)(() => {
|
|
79
74
|
if (!canvasContent) {
|
|
80
75
|
return null;
|
|
@@ -111,9 +106,23 @@ const SizeSelector = () => {
|
|
|
111
106
|
};
|
|
112
107
|
});
|
|
113
108
|
}, [setSize, size]);
|
|
109
|
+
return {
|
|
110
|
+
items,
|
|
111
|
+
selectedId: String(size.size),
|
|
112
|
+
zoomable,
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
exports.usePreviewSizeMenuItems = usePreviewSizeMenuItems;
|
|
116
|
+
const SizeSelector = () => {
|
|
117
|
+
const { items, selectedId, zoomable } = (0, exports.usePreviewSizeMenuItems)();
|
|
118
|
+
const style = (0, react_1.useMemo)(() => {
|
|
119
|
+
return {
|
|
120
|
+
padding: ControlButton_1.CONTROL_BUTTON_PADDING - 2,
|
|
121
|
+
};
|
|
122
|
+
}, []);
|
|
114
123
|
if (!zoomable) {
|
|
115
124
|
return null;
|
|
116
125
|
}
|
|
117
|
-
return (jsx_runtime_1.jsx("div", { style: style, "aria-label": accessibilityLabel, children: jsx_runtime_1.jsx(ComboBox_1.Combobox, { size: "compact", title: accessibilityLabel, style: comboStyle, selectedId:
|
|
126
|
+
return (jsx_runtime_1.jsx("div", { style: style, "aria-label": accessibilityLabel, children: jsx_runtime_1.jsx(ComboBox_1.Combobox, { size: "compact", title: accessibilityLabel, style: comboStyle, selectedId: selectedId, values: items }) }));
|
|
118
127
|
};
|
|
119
128
|
exports.SizeSelector = SizeSelector;
|
|
@@ -6,6 +6,7 @@ export declare const SplitterContainer: React.FC<{
|
|
|
6
6
|
readonly maxFlex: number;
|
|
7
7
|
readonly minFlex: number;
|
|
8
8
|
readonly maxFlexerSize: number | null;
|
|
9
|
+
readonly minFlexerSize: number | null;
|
|
9
10
|
readonly maxAntiFlexerSize: number | null;
|
|
10
11
|
readonly id: string;
|
|
11
12
|
readonly defaultFlex: number;
|
|
@@ -6,6 +6,7 @@ const player_1 = require("@remotion/player");
|
|
|
6
6
|
const react_1 = require("react");
|
|
7
7
|
const timeline_1 = require("../../state/timeline");
|
|
8
8
|
const SplitterContext_1 = require("./SplitterContext");
|
|
9
|
+
const SplitterHandle_1 = require("./SplitterHandle");
|
|
9
10
|
const containerRow = {
|
|
10
11
|
display: 'flex',
|
|
11
12
|
flexDirection: 'row',
|
|
@@ -19,14 +20,31 @@ exports.containerColumn = {
|
|
|
19
20
|
flex: 1,
|
|
20
21
|
height: 0,
|
|
21
22
|
};
|
|
22
|
-
const SplitterContainer = ({ orientation, children, defaultFlex, maxFlex, minFlex, maxFlexerSize, maxAntiFlexerSize, id, }) => {
|
|
23
|
+
const SplitterContainer = ({ orientation, children, defaultFlex, maxFlex, minFlex, maxFlexerSize, minFlexerSize, maxAntiFlexerSize, id, }) => {
|
|
23
24
|
const [initialTimelineFlex, persistFlex] = (0, timeline_1.useTimelineFlex)(id);
|
|
24
25
|
const [flexValue, setFlexValue] = (0, react_1.useState)(initialTimelineFlex !== null && initialTimelineFlex !== void 0 ? initialTimelineFlex : defaultFlex);
|
|
25
26
|
const ref = (0, react_1.useRef)(null);
|
|
26
27
|
const isDragging = (0, react_1.useRef)(false);
|
|
28
|
+
const size = player_1.PlayerInternals.useElementSize(ref, {
|
|
29
|
+
triggerOnWindowResize: true,
|
|
30
|
+
shouldApplyCssTransforms: true,
|
|
31
|
+
});
|
|
32
|
+
const availableSize = size
|
|
33
|
+
? (orientation === 'vertical' ? size.width : size.height) -
|
|
34
|
+
SplitterHandle_1.SPLITTER_HANDLE_SIZE
|
|
35
|
+
: null;
|
|
36
|
+
const effectiveFlexValue = (0, SplitterContext_1.getClampedSplitterFlex)({
|
|
37
|
+
availableSize,
|
|
38
|
+
flexValue,
|
|
39
|
+
maxAntiFlexerSize,
|
|
40
|
+
maxFlex,
|
|
41
|
+
maxFlexerSize,
|
|
42
|
+
minFlex,
|
|
43
|
+
minFlexerSize,
|
|
44
|
+
});
|
|
27
45
|
const value = (0, react_1.useMemo)(() => {
|
|
28
46
|
return {
|
|
29
|
-
flexValue,
|
|
47
|
+
flexValue: effectiveFlexValue,
|
|
30
48
|
ref,
|
|
31
49
|
setFlexValue,
|
|
32
50
|
isDragging,
|
|
@@ -35,16 +53,18 @@ const SplitterContainer = ({ orientation, children, defaultFlex, maxFlex, minFle
|
|
|
35
53
|
maxFlex,
|
|
36
54
|
minFlex,
|
|
37
55
|
maxFlexerSize,
|
|
56
|
+
minFlexerSize,
|
|
38
57
|
maxAntiFlexerSize,
|
|
39
58
|
defaultFlex,
|
|
40
59
|
persistFlex,
|
|
41
60
|
};
|
|
42
61
|
}, [
|
|
43
62
|
defaultFlex,
|
|
44
|
-
|
|
63
|
+
effectiveFlexValue,
|
|
45
64
|
id,
|
|
46
65
|
maxFlex,
|
|
47
66
|
maxFlexerSize,
|
|
67
|
+
minFlexerSize,
|
|
48
68
|
maxAntiFlexerSize,
|
|
49
69
|
minFlex,
|
|
50
70
|
orientation,
|
|
@@ -12,6 +12,7 @@ export type TSplitterContext = {
|
|
|
12
12
|
maxFlex: number;
|
|
13
13
|
minFlex: number;
|
|
14
14
|
maxFlexerSize: number | null;
|
|
15
|
+
minFlexerSize: number | null;
|
|
15
16
|
maxAntiFlexerSize: number | null;
|
|
16
17
|
defaultFlex: number;
|
|
17
18
|
id: string;
|
|
@@ -21,4 +22,17 @@ export type TSplitterContext = {
|
|
|
21
22
|
y: number;
|
|
22
23
|
}>;
|
|
23
24
|
};
|
|
25
|
+
type SplitterFlexBounds = Pick<TSplitterContext, 'maxAntiFlexerSize' | 'maxFlex' | 'maxFlexerSize' | 'minFlex' | 'minFlexerSize'> & {
|
|
26
|
+
readonly availableSize: number | null;
|
|
27
|
+
};
|
|
28
|
+
export declare const getSplitterFlexBounds: ({ availableSize, maxAntiFlexerSize, maxFlex, maxFlexerSize, minFlex, minFlexerSize, }: SplitterFlexBounds) => {
|
|
29
|
+
minFlex: number;
|
|
30
|
+
maxFlex: number;
|
|
31
|
+
};
|
|
32
|
+
export declare const getClampedSplitterFlex: ({ flexValue, ...bounds }: Pick<TSplitterContext, "maxAntiFlexerSize" | "maxFlex" | "maxFlexerSize" | "minFlex" | "minFlexerSize"> & {
|
|
33
|
+
readonly availableSize: number | null;
|
|
34
|
+
} & {
|
|
35
|
+
readonly flexValue: number;
|
|
36
|
+
}) => number;
|
|
24
37
|
export declare const SplitterContext: React.Context<TSplitterContext>;
|
|
38
|
+
export {};
|
|
@@ -3,8 +3,22 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.SplitterContext = void 0;
|
|
6
|
+
exports.SplitterContext = exports.getClampedSplitterFlex = exports.getSplitterFlexBounds = void 0;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const getSplitterFlexBounds = ({ availableSize, maxAntiFlexerSize, maxFlex, maxFlexerSize, minFlex, minFlexerSize, }) => {
|
|
9
|
+
if (availableSize === null || availableSize <= 0) {
|
|
10
|
+
return { minFlex, maxFlex };
|
|
11
|
+
}
|
|
12
|
+
const minimum = Math.min(1, Math.max(minFlex, minFlexerSize === null ? 0 : minFlexerSize / availableSize, maxAntiFlexerSize === null ? 0 : 1 - maxAntiFlexerSize / availableSize));
|
|
13
|
+
const maximum = Math.max(minimum, Math.min(maxFlex, maxFlexerSize === null ? 1 : maxFlexerSize / availableSize));
|
|
14
|
+
return { minFlex: minimum, maxFlex: maximum };
|
|
15
|
+
};
|
|
16
|
+
exports.getSplitterFlexBounds = getSplitterFlexBounds;
|
|
17
|
+
const getClampedSplitterFlex = ({ flexValue, ...bounds }) => {
|
|
18
|
+
const { minFlex, maxFlex } = (0, exports.getSplitterFlexBounds)(bounds);
|
|
19
|
+
return Math.min(maxFlex, Math.max(minFlex, flexValue));
|
|
20
|
+
};
|
|
21
|
+
exports.getClampedSplitterFlex = getClampedSplitterFlex;
|
|
8
22
|
exports.SplitterContext = react_1.default.createContext({
|
|
9
23
|
flexValue: 1,
|
|
10
24
|
ref: { current: null },
|
|
@@ -14,6 +28,7 @@ exports.SplitterContext = react_1.default.createContext({
|
|
|
14
28
|
maxFlex: 1,
|
|
15
29
|
minFlex: 1,
|
|
16
30
|
maxFlexerSize: null,
|
|
31
|
+
minFlexerSize: null,
|
|
17
32
|
maxAntiFlexerSize: null,
|
|
18
33
|
defaultFlex: 1,
|
|
19
34
|
id: '--',
|
|
@@ -4,6 +4,7 @@ exports.SplitterHandle = exports.SPLITTER_HANDLE_SIZE = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const player_1 = require("@remotion/player");
|
|
6
6
|
const react_1 = require("react");
|
|
7
|
+
const pointer_session_1 = require("../../helpers/pointer-session");
|
|
7
8
|
const ForceSpecificCursor_1 = require("../ForceSpecificCursor");
|
|
8
9
|
const SplitterContext_1 = require("./SplitterContext");
|
|
9
10
|
exports.SPLITTER_HANDLE_SIZE = 3;
|
|
@@ -28,7 +29,6 @@ const SplitterHandle = ({ allowToCollapse, onCollapse }) => {
|
|
|
28
29
|
if (!current) {
|
|
29
30
|
return;
|
|
30
31
|
}
|
|
31
|
-
// Cleanup for the listeners that only exist for the duration of a drag.
|
|
32
32
|
let endDrag = null;
|
|
33
33
|
const onPointerDown = (e) => {
|
|
34
34
|
var _a;
|
|
@@ -49,16 +49,17 @@ const SplitterHandle = ({ allowToCollapse, onCollapse }) => {
|
|
|
49
49
|
const availableSize = (dragContext.orientation === 'vertical'
|
|
50
50
|
? containerWidth
|
|
51
51
|
: containerHeight) - exports.SPLITTER_HANDLE_SIZE;
|
|
52
|
-
const minFlex
|
|
53
|
-
|
|
54
|
-
:
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
:
|
|
52
|
+
const { minFlex, maxFlex } = (0, SplitterContext_1.getSplitterFlexBounds)({
|
|
53
|
+
availableSize,
|
|
54
|
+
maxAntiFlexerSize: dragContext.maxAntiFlexerSize,
|
|
55
|
+
maxFlex: dragContext.maxFlex,
|
|
56
|
+
maxFlexerSize: dragContext.maxFlexerSize,
|
|
57
|
+
minFlex: dragContext.minFlex,
|
|
58
|
+
minFlexerSize: dragContext.minFlexerSize,
|
|
59
|
+
});
|
|
58
60
|
const startFlex = Math.min(maxFlex, Math.max(minFlex, dragContext.flexValue));
|
|
59
61
|
dragContext.isDragging.current = start;
|
|
60
62
|
(0, ForceSpecificCursor_1.forceSpecificCursor)(dragContext.orientation === 'horizontal' ? 'row-resize' : 'col-resize');
|
|
61
|
-
current.classList.add('remotion-splitter-active');
|
|
62
63
|
const getNewValue = (ev, clamp) => {
|
|
63
64
|
if (!dragContext.ref.current) {
|
|
64
65
|
throw new Error('domRect is not mounted');
|
|
@@ -73,17 +74,6 @@ const SplitterHandle = ({ allowToCollapse, onCollapse }) => {
|
|
|
73
74
|
}
|
|
74
75
|
return newFlex;
|
|
75
76
|
};
|
|
76
|
-
endDrag = () => {
|
|
77
|
-
dragContext.isDragging.current = false;
|
|
78
|
-
(0, ForceSpecificCursor_1.stopForcingSpecificCursor)();
|
|
79
|
-
current.classList.remove('remotion-splitter-active');
|
|
80
|
-
window.removeEventListener('pointermove', onPointerMove);
|
|
81
|
-
window.removeEventListener('pointerup', onPointerUp);
|
|
82
|
-
window.removeEventListener('pointercancel', onPointerCancel);
|
|
83
|
-
window.removeEventListener('blur', onWindowBlur);
|
|
84
|
-
endDrag = null;
|
|
85
|
-
player_1.PlayerInternals.updateAllElementsSizes();
|
|
86
|
-
};
|
|
87
77
|
const onPointerMove = (ev) => {
|
|
88
78
|
if (!dragContext.isDragging.current) {
|
|
89
79
|
return;
|
|
@@ -105,23 +95,22 @@ const SplitterHandle = ({ allowToCollapse, onCollapse }) => {
|
|
|
105
95
|
}
|
|
106
96
|
}
|
|
107
97
|
};
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
window.addEventListener('blur', onWindowBlur);
|
|
98
|
+
endDrag = (0, pointer_session_1.startPointerSession)({
|
|
99
|
+
event: e,
|
|
100
|
+
target: current,
|
|
101
|
+
onMove: onPointerMove,
|
|
102
|
+
onEnd: (reason, endEvent) => {
|
|
103
|
+
if ((reason === 'pointerup' || reason === 'buttons-released') &&
|
|
104
|
+
endEvent &&
|
|
105
|
+
dragContext.isDragging.current) {
|
|
106
|
+
dragContext.persistFlex(getNewValue(endEvent, true));
|
|
107
|
+
}
|
|
108
|
+
dragContext.isDragging.current = false;
|
|
109
|
+
(0, ForceSpecificCursor_1.stopForcingSpecificCursor)();
|
|
110
|
+
endDrag = null;
|
|
111
|
+
player_1.PlayerInternals.updateAllElementsSizes();
|
|
112
|
+
},
|
|
113
|
+
});
|
|
125
114
|
};
|
|
126
115
|
current.addEventListener('pointerdown', onPointerDown);
|
|
127
116
|
return () => {
|
|
@@ -129,44 +118,6 @@ const SplitterHandle = ({ allowToCollapse, onCollapse }) => {
|
|
|
129
118
|
endDrag === null || endDrag === void 0 ? void 0 : endDrag();
|
|
130
119
|
};
|
|
131
120
|
}, []);
|
|
132
|
-
(0, react_1.useEffect)(() => {
|
|
133
|
-
const { current } = ref;
|
|
134
|
-
if (!current) {
|
|
135
|
-
return;
|
|
136
|
-
}
|
|
137
|
-
let isMouseDown = false;
|
|
138
|
-
const onMouseDown = () => {
|
|
139
|
-
isMouseDown = true;
|
|
140
|
-
};
|
|
141
|
-
const onMouseUp = () => {
|
|
142
|
-
isMouseDown = false;
|
|
143
|
-
};
|
|
144
|
-
const onMouseEnter = (e) => {
|
|
145
|
-
if (e.button !== 0) {
|
|
146
|
-
return;
|
|
147
|
-
}
|
|
148
|
-
if (isMouseDown) {
|
|
149
|
-
return;
|
|
150
|
-
}
|
|
151
|
-
current.classList.add('remotion-splitter-hover');
|
|
152
|
-
};
|
|
153
|
-
const onMouseLeave = (e) => {
|
|
154
|
-
if (e.button !== 0) {
|
|
155
|
-
return;
|
|
156
|
-
}
|
|
157
|
-
current.classList.remove('remotion-splitter-hover');
|
|
158
|
-
};
|
|
159
|
-
current.addEventListener('mouseenter', onMouseEnter);
|
|
160
|
-
current.addEventListener('mouseleave', onMouseLeave);
|
|
161
|
-
window.addEventListener('mousedown', onMouseDown);
|
|
162
|
-
window.addEventListener('mouseup', onMouseUp);
|
|
163
|
-
return () => {
|
|
164
|
-
current.removeEventListener('mouseenter', onMouseEnter);
|
|
165
|
-
current.removeEventListener('mouseleave', onMouseLeave);
|
|
166
|
-
window.removeEventListener('mousedown', onMouseDown);
|
|
167
|
-
window.removeEventListener('mouseup', onMouseUp);
|
|
168
|
-
};
|
|
169
|
-
}, []);
|
|
170
121
|
return (jsx_runtime_1.jsx("div", { ref: ref, className: [
|
|
171
122
|
'remotion-splitter',
|
|
172
123
|
context.orientation === 'horizontal'
|
|
@@ -7,6 +7,7 @@ const react_1 = require("react");
|
|
|
7
7
|
const remotion_1 = require("remotion");
|
|
8
8
|
const client_id_1 = require("../../helpers/client-id");
|
|
9
9
|
const colors_1 = require("../../helpers/colors");
|
|
10
|
+
const pointer_session_1 = require("../../helpers/pointer-session");
|
|
10
11
|
const Checkbox_1 = require("../Checkbox");
|
|
11
12
|
const InspectorPanelLayout_1 = require("../InspectorPanelLayout");
|
|
12
13
|
const InputDragger_1 = require("../NewComposition/InputDragger");
|
|
@@ -642,33 +643,40 @@ const EasingEditor = ({ state, renderHeader }) => {
|
|
|
642
643
|
}
|
|
643
644
|
setBezierAndPreview(next);
|
|
644
645
|
}, [getValueFromPointer, setBezierAndPreview]);
|
|
645
|
-
(0, react_1.useEffect)(() => {
|
|
646
|
-
if (activeHandle === null) {
|
|
647
|
-
return;
|
|
648
|
-
}
|
|
649
|
-
const onPointerMove = (event) => {
|
|
650
|
-
updateHandleFromPointer(activeHandle, event);
|
|
651
|
-
};
|
|
652
|
-
const onPointerUp = () => {
|
|
653
|
-
commitEasing(serializeBezier(bezierRef.current), liveOverrideVersionRef.current);
|
|
654
|
-
setActiveHandle(null);
|
|
655
|
-
};
|
|
656
|
-
window.addEventListener('pointermove', onPointerMove);
|
|
657
|
-
window.addEventListener('pointerup', onPointerUp, { once: true });
|
|
658
|
-
return () => {
|
|
659
|
-
window.removeEventListener('pointermove', onPointerMove);
|
|
660
|
-
window.removeEventListener('pointerup', onPointerUp);
|
|
661
|
-
};
|
|
662
|
-
}, [activeHandle, commitEasing, updateHandleFromPointer]);
|
|
663
646
|
const onHandlePointerDown = (0, react_1.useCallback)((handle, event) => {
|
|
664
647
|
if (previewServerState.type !== 'connected') {
|
|
665
648
|
return;
|
|
666
649
|
}
|
|
667
650
|
event.preventDefault();
|
|
668
651
|
event.stopPropagation();
|
|
652
|
+
const bezierBeforeDrag = [...bezierRef.current];
|
|
669
653
|
setActiveHandle(handle);
|
|
670
654
|
updateHandleFromPointer(handle, event);
|
|
671
|
-
|
|
655
|
+
(0, pointer_session_1.startPointerSession)({
|
|
656
|
+
event,
|
|
657
|
+
target: event.currentTarget,
|
|
658
|
+
onMove: (moveEvent) => {
|
|
659
|
+
updateHandleFromPointer(handle, moveEvent);
|
|
660
|
+
},
|
|
661
|
+
onEnd: (reason) => {
|
|
662
|
+
if (reason === 'pointerup' || reason === 'buttons-released') {
|
|
663
|
+
commitEasing(serializeBezier(bezierRef.current), liveOverrideVersionRef.current);
|
|
664
|
+
}
|
|
665
|
+
else {
|
|
666
|
+
clearEasingDragOverrides(pendingOverrideTargetsRef.current);
|
|
667
|
+
pendingOverrideTargetsRef.current = [];
|
|
668
|
+
bezierRef.current = bezierBeforeDrag;
|
|
669
|
+
setBezier(bezierBeforeDrag);
|
|
670
|
+
}
|
|
671
|
+
setActiveHandle(null);
|
|
672
|
+
},
|
|
673
|
+
});
|
|
674
|
+
}, [
|
|
675
|
+
clearEasingDragOverrides,
|
|
676
|
+
commitEasing,
|
|
677
|
+
previewServerState.type,
|
|
678
|
+
updateHandleFromPointer,
|
|
679
|
+
]);
|
|
672
680
|
(0, react_1.useEffect)(() => {
|
|
673
681
|
return () => {
|
|
674
682
|
clearEasingDragOverrides(pendingOverrideTargetsRef.current);
|
|
@@ -75,6 +75,7 @@ const TimelineTracks_1 = require("./TimelineTracks");
|
|
|
75
75
|
const TimelineWidthProvider_1 = require("./TimelineWidthProvider");
|
|
76
76
|
const use_resolved_stack_1 = require("./use-resolved-stack");
|
|
77
77
|
const use_timeline_asset_drop_1 = require("./use-timeline-asset-drop");
|
|
78
|
+
const MIN_TIMELINE_LABELS_WIDTH = 240;
|
|
78
79
|
const container = {
|
|
79
80
|
minHeight: '100%',
|
|
80
81
|
flex: 1,
|
|
@@ -267,7 +268,7 @@ const TimelineInner = () => {
|
|
|
267
268
|
}
|
|
268
269
|
return (jsx_runtime_1.jsx(SubscribeToNodePaths_1.SubscribeToNodePaths, { overrideId: sequence.controls.overrideId, componentIdentity: sequence.controls.componentIdentity, schema: sequence.controls.schema, getStack: sequence.getStack, effects: sequence.effects }, sequence.id));
|
|
269
270
|
}), (0, interactivity_enabled_1.isStudioInteractivityEnabled)() ? jsx_runtime_1.jsx(SequencePropsObserver_1.SequencePropsObserver, {}) : null, jsx_runtime_1.jsx(TimelineKeyframeTracksContext_1.TimelineKeyframeTracksProvider, { tracks: filtered, children: jsx_runtime_1.jsxs(TimelineSelection_1.TimelineSelectableItemsProvider, { timeline: shown, children: [(0, interactivity_enabled_1.isStudioInteractivityEnabled)() ? (jsx_runtime_1.jsx(TimelineSelection_1.TimelineSelectAllKeybindings, { timeline: shown })) : null, jsx_runtime_1.jsx(TimelineHeightContainer_1.TimelineHeightContainer, { shown: shown, hasBeenCut: hasBeenCut, children: isStill ? (jsx_runtime_1.jsx(TimelineList_1.TimelineList, { timeline: shown })) : (jsx_runtime_1.jsxs(TimelineWidthProvider_1.TimelineWidthProvider, { children: [
|
|
270
|
-
jsx_runtime_1.jsx(TimelinePinchZoom_1.TimelinePinchZoom, {}), jsx_runtime_1.jsxs(SplitterContainer_1.SplitterContainer, { orientation: "vertical", defaultFlex: 0.2, id: "names-to-timeline", maxFlex: 0.5, minFlex: 0.15, maxFlexerSize: null, maxAntiFlexerSize: null, children: [
|
|
271
|
+
jsx_runtime_1.jsx(TimelinePinchZoom_1.TimelinePinchZoom, {}), jsx_runtime_1.jsxs(SplitterContainer_1.SplitterContainer, { orientation: "vertical", defaultFlex: 0.2, id: "names-to-timeline", maxFlex: 0.5, minFlex: 0.15, maxFlexerSize: null, minFlexerSize: MIN_TIMELINE_LABELS_WIDTH, maxAntiFlexerSize: null, children: [
|
|
271
272
|
jsx_runtime_1.jsx(SplitterElement_1.SplitterElement, { type: "flexer", sticky: jsx_runtime_1.jsx(TimelineTimeIndicators_1.TimelineTimePlaceholders, {}), children: jsx_runtime_1.jsx(TimelineList_1.TimelineList, { timeline: shown }) }), jsx_runtime_1.jsx(SplitterHandle_1.SplitterHandle, { onCollapse: noop, allowToCollapse: "none" }), jsx_runtime_1.jsx(SplitterElement_1.SplitterElement, { type: "anti-flexer", sticky: null, children: jsx_runtime_1.jsxs(TimelineScrollable_1.TimelineScrollable, { children: [
|
|
272
273
|
jsx_runtime_1.jsx(TimelineTracks_1.TimelineTracks, { timeline: shown, hasBeenCut: hasBeenCut }), jsx_runtime_1.jsx(TimelinePlayCursorSyncer_1.TimelinePlayCursorSyncer, {}), jsx_runtime_1.jsx(TimelineInOutPointer_1.TimelineInOutPointer, {}), jsx_runtime_1.jsx(TimelineTimeIndicators_1.TimelineTimeIndicators, {}), jsx_runtime_1.jsx(TimelineDragHandler_1.TimelineDragHandler, {}), (0, interactivity_enabled_1.isStudioInteractivityEnabled)() ? (jsx_runtime_1.jsx(TimelineInOutDragHandler_1.TimelineInOutDragHandler, {})) : null, jsx_runtime_1.jsx(TimelineSlider_1.TimelineSlider, {})
|
|
273
274
|
] }) })
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type
|
|
2
|
+
import { type CanUpdateSequencePropStatusStatic } from 'remotion';
|
|
3
3
|
import type { SchemaFieldInfo, TimelineFieldOnDragValueChange, TimelineFieldOnSave } from '../../helpers/timeline-layout';
|
|
4
4
|
import { type InspectorInlineActionProps } from '../InspectorPanel/common';
|
|
5
5
|
export type InspectorSourceAction = Omit<InspectorInlineActionProps, 'variant'>;
|
|
@@ -3,11 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.TimelineAssetField = exports.toFileToken = exports.AssetSelectionContext = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
+
const remotion_1 = require("remotion");
|
|
6
7
|
const no_react_1 = require("remotion/no-react");
|
|
8
|
+
const write_static_file_1 = require("../../api/write-static-file");
|
|
7
9
|
const pen_1 = require("../../icons/pen");
|
|
8
10
|
const modals_1 = require("../../state/modals");
|
|
11
|
+
const import_assets_1 = require("../import-assets");
|
|
9
12
|
const InlineAction_1 = require("../InlineAction");
|
|
10
13
|
const common_1 = require("../InspectorPanel/common");
|
|
14
|
+
const NotificationCenter_1 = require("../Notifications/NotificationCenter");
|
|
15
|
+
const use_static_files_1 = require("../use-static-files");
|
|
11
16
|
const penIcon = {
|
|
12
17
|
display: 'block',
|
|
13
18
|
height: 14,
|
|
@@ -30,6 +35,7 @@ const TimelineAssetField = ({ field, effectiveValue, propStatus, onSave, onDragV
|
|
|
30
35
|
throw new Error('TimelineAssetField rendered for non-asset field');
|
|
31
36
|
}
|
|
32
37
|
const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
38
|
+
const staticFiles = (0, use_static_files_1.useStaticFiles)();
|
|
33
39
|
const { getSourceAction, initialQuery, sourceAction } = (0, react_1.useContext)(exports.AssetSelectionContext);
|
|
34
40
|
const inlineSourceAction = (0, react_1.useMemo)(() => {
|
|
35
41
|
if (field.key !== 'src') {
|
|
@@ -49,6 +55,32 @@ const TimelineAssetField = ({ field, effectiveValue, propStatus, onSave, onDragV
|
|
|
49
55
|
onDragEnd();
|
|
50
56
|
});
|
|
51
57
|
}, [propStatus.codeValue, onDragValueChange, onSave, onDragEnd]);
|
|
58
|
+
const selectFile = (0, react_1.useCallback)(async () => {
|
|
59
|
+
const [file] = await (0, import_assets_1.pickFilesToImport)({ multiple: false });
|
|
60
|
+
if (!file) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
const existing = staticFiles.find((candidate) => candidate.name === file.name);
|
|
64
|
+
if (existing && existing.sizeInBytes !== file.size) {
|
|
65
|
+
(0, NotificationCenter_1.showNotification)(`File with name ${file.name} already exists and is different`, 4000);
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
try {
|
|
69
|
+
if (!existing) {
|
|
70
|
+
await (0, write_static_file_1.writeStaticFile)({
|
|
71
|
+
contents: await file.arrayBuffer(),
|
|
72
|
+
filePath: file.name,
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
onSelect(file.name, (0, remotion_1.staticFile)(file.name));
|
|
76
|
+
if (!existing) {
|
|
77
|
+
(0, NotificationCenter_1.showNotification)(`Created ${file.name} in public folder`, 3000);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
catch (error) {
|
|
81
|
+
(0, NotificationCenter_1.showNotification)(`Could not upload asset: ${error instanceof Error ? error.message : String(error)}`, 4000);
|
|
82
|
+
}
|
|
83
|
+
}, [onSelect, staticFiles]);
|
|
52
84
|
const openAssetSelection = (0, react_1.useCallback)(() => {
|
|
53
85
|
setSelectedModal({
|
|
54
86
|
type: 'quick-switcher',
|
|
@@ -56,12 +88,15 @@ const TimelineAssetField = ({ field, effectiveValue, propStatus, onSave, onDragV
|
|
|
56
88
|
invocationTimestamp: Date.now(),
|
|
57
89
|
assetSelection: {
|
|
58
90
|
initialQuery,
|
|
91
|
+
onSelectFile: () => {
|
|
92
|
+
selectFile().catch(() => undefined);
|
|
93
|
+
},
|
|
59
94
|
onSelected: (asset) => onSelect(asset.name, asset.src),
|
|
60
95
|
},
|
|
61
96
|
compositionSelection: null,
|
|
62
97
|
});
|
|
63
|
-
}, [initialQuery, onSelect, setSelectedModal]);
|
|
64
|
-
const action = (jsx_runtime_1.jsx(InlineAction_1.InlineAction, { onClick: openAssetSelection, disabled: window.remotion_isReadOnlyStudio, title: "Change source", renderAction: (color) => jsx_runtime_1.jsx(pen_1.PenIcon, { color: color, style: penIcon }) }));
|
|
98
|
+
}, [initialQuery, onSelect, selectFile, setSelectedModal]);
|
|
99
|
+
const action = (jsx_runtime_1.jsx(InlineAction_1.InlineAction, { variant: null, onClick: openAssetSelection, disabled: window.remotion_isReadOnlyStudio, title: "Change source", renderAction: (color) => jsx_runtime_1.jsx(pen_1.PenIcon, { color: color, style: penIcon }) }));
|
|
65
100
|
if (inlineSourceAction === null) {
|
|
66
101
|
return action;
|
|
67
102
|
}
|