@remotion/studio 4.0.498 → 4.0.500
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/AssetSelector.js +8 -6
- package/dist/components/AssetSelectorItem.d.ts +24 -0
- package/dist/components/AssetSelectorItem.js +144 -83
- package/dist/components/Canvas.js +162 -7
- package/dist/components/CompositionSelector.js +15 -42
- package/dist/components/CompositionSelectorItem.js +21 -13
- package/dist/components/ControlButton.js +1 -0
- package/dist/components/EditorContent.js +1 -1
- package/dist/components/EditorRuler/Ruler.js +5 -3
- package/dist/components/ExplorerPanel.js +2 -1
- package/dist/components/ExplorerPanelRef.d.ts +2 -0
- package/dist/components/ForceSpecificCursor.js +13 -1
- package/dist/components/GlobalKeybindings.js +7 -1
- package/dist/components/InlineAction.d.ts +2 -1
- package/dist/components/InlineAction.js +2 -2
- package/dist/components/InlineDropdown.d.ts +1 -1
- package/dist/components/InlineDropdown.js +3 -2
- package/dist/components/InspectorPanel/AlignmentControls.d.ts +2 -2
- package/dist/components/InspectorPanel/AlignmentControls.js +5 -2
- package/dist/components/InspectorPanel/CompositionInspector.js +8 -7
- package/dist/components/InspectorPanel/CompositionMetadata.js +170 -57
- package/dist/components/InspectorPanel/ConnectedCompositionsSection.d.ts +2 -2
- package/dist/components/InspectorPanel/SequenceInspectorHeader.d.ts +3 -3
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +7 -7
- package/dist/components/InspectorPanel/common.d.ts +17 -4
- package/dist/components/InspectorPanel/common.js +60 -6
- package/dist/components/InspectorPanel/use-composition-actions.js +1 -0
- package/dist/components/InspectorPanel/use-track-for-selection.d.ts +1 -1
- package/dist/components/InspectorSequenceSection.js +43 -19
- package/dist/components/KeyboardShortcutsExplainer.js +4 -2
- package/dist/components/Menu/MenuItem.js +2 -1
- package/dist/components/MenuCompositionName.js +30 -7
- package/dist/components/MenuToolbar.d.ts +0 -1
- package/dist/components/MenuToolbar.js +8 -7
- package/dist/components/MobilePanel.d.ts +2 -1
- package/dist/components/MobilePanel.js +29 -25
- package/dist/components/ModalContainer.d.ts +1 -0
- package/dist/components/ModalContainer.js +2 -2
- package/dist/components/Modals.js +1 -1
- package/dist/components/NewComposition/DismissableModal.d.ts +1 -0
- package/dist/components/NewComposition/DismissableModal.js +2 -2
- package/dist/components/NewComposition/InputDragger.d.ts +34 -0
- package/dist/components/NewComposition/InputDragger.js +262 -23
- package/dist/components/OutlineToggle.d.ts +1 -3
- package/dist/components/OutlineToggle.js +2 -2
- package/dist/components/PreviewToolbar.js +10 -4
- package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.d.ts +7 -0
- package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +44 -0
- package/dist/components/QuickSwitcher/NoResults.d.ts +1 -1
- package/dist/components/QuickSwitcher/NoResults.js +1 -0
- package/dist/components/QuickSwitcher/QuickSwitcher.d.ts +5 -0
- package/dist/components/QuickSwitcher/QuickSwitcher.js +6 -2
- package/dist/components/QuickSwitcher/QuickSwitcherContent.d.ts +5 -0
- package/dist/components/QuickSwitcher/QuickSwitcherContent.js +76 -12
- package/dist/components/QuickSwitcher/QuickSwitcherResult.d.ts +4 -0
- package/dist/components/QuickSwitcher/QuickSwitcherResult.js +11 -8
- package/dist/components/QuickSwitcher/asset-search.d.ts +9 -0
- package/dist/components/QuickSwitcher/asset-search.js +42 -0
- package/dist/components/SelectedOutlineCropControls.d.ts +8 -0
- package/dist/components/SelectedOutlineCropControls.js +299 -0
- package/dist/components/SelectedOutlineElement.js +83 -43
- package/dist/components/SelectedOutlineOverlay.d.ts +2 -2
- package/dist/components/SelectedOutlineOverlay.js +130 -8
- package/dist/components/SequencePropsSubscriptionProvider.d.ts +2 -0
- package/dist/components/SequencePropsSubscriptionProvider.js +31 -3
- package/dist/components/SidebarCollapserControls.d.ts +3 -1
- package/dist/components/SidebarCollapserControls.js +34 -29
- package/dist/components/SnappingToggle.d.ts +1 -3
- package/dist/components/SnappingToggle.js +2 -2
- package/dist/components/Splitter/SplitterContainer.d.ts +2 -0
- package/dist/components/Splitter/SplitterContainer.js +5 -1
- package/dist/components/Splitter/SplitterContext.d.ts +2 -0
- package/dist/components/Splitter/SplitterContext.js +2 -0
- package/dist/components/Splitter/SplitterElement.js +6 -1
- package/dist/components/Splitter/SplitterHandle.js +27 -2
- package/dist/components/Timeline/Timeline.js +1 -1
- package/dist/components/Timeline/TimelineAssetField.d.ts +9 -1
- package/dist/components/Timeline/TimelineAssetField.js +52 -100
- package/dist/components/Timeline/TimelineClipboardKeybindings.d.ts +7 -3
- package/dist/components/Timeline/TimelineClipboardKeybindings.js +65 -38
- package/dist/components/Timeline/TimelineColorField.js +20 -1
- package/dist/components/Timeline/TimelineEffectPropItem.js +8 -77
- package/dist/components/Timeline/TimelineExpandedKeyframeRow.js +1 -0
- package/dist/components/Timeline/TimelineHeightContainer.d.ts +2 -2
- package/dist/components/Timeline/TimelineInOutDragHandler.js +25 -1
- package/dist/components/Timeline/TimelineKeyframeTracksContext.d.ts +3 -3
- package/dist/components/Timeline/TimelineLayerEye.js +4 -1
- package/dist/components/Timeline/TimelineList.d.ts +2 -2
- package/dist/components/Timeline/TimelinePrimitiveFieldValue.js +7 -1
- package/dist/components/Timeline/TimelineSelection.d.ts +5 -5
- package/dist/components/Timeline/TimelineSelection.js +8 -6
- package/dist/components/Timeline/TimelineSequence.js +7 -6
- package/dist/components/Timeline/TimelineSequenceItem.js +57 -10
- package/dist/components/Timeline/TimelineSequenceName.js +1 -0
- package/dist/components/Timeline/TimelineSequencePropItem.js +27 -75
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +5 -1
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +29 -12
- package/dist/components/Timeline/TimelineTrack.d.ts +2 -2
- package/dist/components/Timeline/TimelineTracks.d.ts +2 -2
- package/dist/components/Timeline/find-track-for-node-path-info.d.ts +1 -1
- package/dist/components/Timeline/get-sequence-context-menu-items.js +14 -12
- package/dist/components/Timeline/reset-selected-timeline-props.js +18 -10
- package/dist/components/Timeline/save-effect-prop.d.ts +10 -0
- package/dist/components/Timeline/save-effect-prop.js +52 -1
- package/dist/components/Timeline/should-show-track-in-timeline.d.ts +2 -2
- package/dist/components/Timeline/timeline-asset-link.js +17 -1
- package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.d.ts +4 -0
- package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.js +9 -3
- package/dist/components/Timeline/use-timeline-height.d.ts +2 -2
- package/dist/components/Timeline/use-timeline-keyframe-drag.js +6 -4
- package/dist/components/TopPanel.js +3 -2
- package/dist/components/UndoRedoButtons.js +27 -5
- package/dist/components/composition-drop-preview.d.ts +33 -0
- package/dist/components/composition-drop-preview.js +68 -0
- package/dist/components/drop-handler-data.d.ts +1 -1
- package/dist/components/drop-handler-data.js +27 -60
- package/dist/components/effect-drag-and-drop.d.ts +1 -1
- package/dist/components/effect-drag-and-drop.js +7 -55
- package/dist/components/element-drag-and-drop.d.ts +1 -1
- package/dist/components/element-drag-and-drop.js +5 -17
- package/dist/components/handle-drop.js +0 -1
- package/dist/components/import-assets.d.ts +7 -8
- package/dist/components/import-assets.js +2 -9
- package/dist/components/menu-toolbar-height.d.ts +1 -0
- package/dist/components/menu-toolbar-height.js +4 -0
- package/dist/components/selected-outline-drag.d.ts +41 -4
- package/dist/components/selected-outline-drag.js +179 -2
- package/dist/components/selected-outline-geometry.d.ts +1 -0
- package/dist/components/selected-outline-measurement.d.ts +11 -0
- package/dist/components/selected-outline-measurement.js +64 -3
- package/dist/components/selected-outline-types.d.ts +44 -1
- package/dist/components/selected-outline-types.js +21 -1
- package/dist/error-overlay/remotion-overlay/Overlay.js +3 -3
- package/dist/error-overlay/remotion-overlay/ShortcutHint.js +2 -3
- package/dist/esm/{chunk-7a6q9hk2.js → chunk-dr1y1vm3.js} +11851 -9494
- package/dist/esm/internals.mjs +11851 -9494
- package/dist/esm/previewEntry.mjs +55150 -52795
- package/dist/esm/renderEntry.mjs +1 -1
- package/dist/helpers/calculate-timeline.d.ts +2 -2
- package/dist/helpers/calculate-timeline.js +8 -28
- package/dist/helpers/get-effective-translation.d.ts +13 -1
- package/dist/helpers/get-effective-translation.js +12 -6
- package/dist/helpers/get-timeline-sequence-sort-key.d.ts +3 -10
- package/dist/helpers/get-timeline-sequence-sort-key.js +5 -13
- package/dist/helpers/interactivity-enabled.d.ts +1 -0
- package/dist/helpers/interactivity-enabled.js +7 -2
- package/dist/helpers/is-mac.d.ts +1 -0
- package/dist/helpers/is-mac.js +4 -0
- package/dist/helpers/open-in-editor.d.ts +5 -1
- package/dist/helpers/open-in-editor.js +15 -1
- package/dist/helpers/ruler-canvas-size.d.ts +7 -0
- package/dist/helpers/ruler-canvas-size.js +14 -1
- package/dist/helpers/sort-by-nonce-history.js +97 -19
- package/dist/helpers/use-image-metadata.d.ts +1 -0
- package/dist/helpers/use-image-metadata.js +8 -5
- package/dist/helpers/use-keybinding.js +2 -3
- package/dist/helpers/use-media-metadata.d.ts +1 -0
- package/dist/helpers/use-media-metadata.js +8 -5
- package/dist/helpers/use-menu-structure.js +10 -1
- package/dist/icons/caret.d.ts +1 -0
- package/dist/icons/caret.js +2 -2
- package/dist/icons/pen.d.ts +5 -0
- package/dist/icons/pen.js +8 -0
- package/dist/state/modals.d.ts +5 -0
- package/package.json +13 -12
- package/dist/helpers/get-timeline-sequence-hash.d.ts +0 -6
- package/dist/helpers/get-timeline-sequence-hash.js +0 -33
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.SidebarCollapserControl = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const ShortcutHint_1 = require("../error-overlay/remotion-overlay/ShortcutHint");
|
|
@@ -18,7 +18,7 @@ const style = {
|
|
|
18
18
|
color: colors_1.CURRENT_COLOR,
|
|
19
19
|
position: 'relative',
|
|
20
20
|
};
|
|
21
|
-
const
|
|
21
|
+
const SidebarCollapserControl = ({ side }) => {
|
|
22
22
|
const { setSidebarCollapsedState, sidebarCollapsedStateRight } = (0, react_1.useContext)(sidebar_1.SidebarContext);
|
|
23
23
|
const keybindings = (0, use_keybinding_1.useKeybinding)();
|
|
24
24
|
const leftSidebarStatus = (0, TopPanel_1.useResponsiveSidebarStatus)();
|
|
@@ -83,15 +83,30 @@ const SidebarCollapserControls = () => {
|
|
|
83
83
|
toggleRight,
|
|
84
84
|
]);
|
|
85
85
|
(0, react_1.useEffect)(() => {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
86
|
+
if (side === 'left') {
|
|
87
|
+
const left = keybindings.registerKeybinding({
|
|
88
|
+
event: 'keydown',
|
|
89
|
+
key: 'b',
|
|
90
|
+
commandCtrlKey: true,
|
|
91
|
+
callback: toggleLeft,
|
|
92
|
+
preventDefault: true,
|
|
93
|
+
triggerIfInputFieldFocused: false,
|
|
94
|
+
keepRegisteredWhenNotHighestContext: false,
|
|
95
|
+
});
|
|
96
|
+
const zen = keybindings.registerKeybinding({
|
|
97
|
+
event: 'keydown',
|
|
98
|
+
key: 'g',
|
|
99
|
+
commandCtrlKey: true,
|
|
100
|
+
callback: toggleBoth,
|
|
101
|
+
preventDefault: true,
|
|
102
|
+
triggerIfInputFieldFocused: false,
|
|
103
|
+
keepRegisteredWhenNotHighestContext: false,
|
|
104
|
+
});
|
|
105
|
+
return () => {
|
|
106
|
+
left.unregister();
|
|
107
|
+
zen.unregister();
|
|
108
|
+
};
|
|
109
|
+
}
|
|
95
110
|
const right = keybindings.registerKeybinding({
|
|
96
111
|
event: 'keydown',
|
|
97
112
|
key: 'j',
|
|
@@ -101,21 +116,10 @@ const SidebarCollapserControls = () => {
|
|
|
101
116
|
triggerIfInputFieldFocused: false,
|
|
102
117
|
keepRegisteredWhenNotHighestContext: false,
|
|
103
118
|
});
|
|
104
|
-
const zen = keybindings.registerKeybinding({
|
|
105
|
-
event: 'keydown',
|
|
106
|
-
key: 'g',
|
|
107
|
-
commandCtrlKey: true,
|
|
108
|
-
callback: toggleBoth,
|
|
109
|
-
preventDefault: true,
|
|
110
|
-
triggerIfInputFieldFocused: false,
|
|
111
|
-
keepRegisteredWhenNotHighestContext: false,
|
|
112
|
-
});
|
|
113
119
|
return () => {
|
|
114
|
-
left.unregister();
|
|
115
120
|
right.unregister();
|
|
116
|
-
zen.unregister();
|
|
117
121
|
};
|
|
118
|
-
}, [keybindings, toggleBoth, toggleLeft, toggleRight]);
|
|
122
|
+
}, [keybindings, side, toggleBoth, toggleLeft, toggleRight]);
|
|
119
123
|
const toggleLeftTooltip = (0, use_keybinding_1.areKeyboardShortcutsDisabled)()
|
|
120
124
|
? 'Toggle Left Sidebar'
|
|
121
125
|
: `Toggle Left Sidebar (${ShortcutHint_1.cmdOrCtrlCharacter}+B)`;
|
|
@@ -129,13 +133,14 @@ const SidebarCollapserControls = () => {
|
|
|
129
133
|
};
|
|
130
134
|
}, []);
|
|
131
135
|
const toggleLeftAction = (0, react_1.useCallback)((color) => {
|
|
132
|
-
return (jsx_runtime_1.jsx("div", { style: colorStyle(color), title: toggleLeftTooltip, children: jsx_runtime_1.jsx("div", { style: leftIcon(color) }) }));
|
|
136
|
+
return (jsx_runtime_1.jsx("div", { "data-sidebar-toggle": "left", style: colorStyle(color), title: toggleLeftTooltip, children: jsx_runtime_1.jsx("div", { style: leftIcon(color) }) }));
|
|
133
137
|
}, [colorStyle, leftIcon, toggleLeftTooltip]);
|
|
134
138
|
const toggleRightAction = (0, react_1.useCallback)((color) => {
|
|
135
|
-
return (jsx_runtime_1.jsx("div", { style: colorStyle(color), title: toggleRightTooltip, children: jsx_runtime_1.jsx("div", { style: rightIcon(color) }) }));
|
|
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) }) }));
|
|
136
140
|
}, [colorStyle, rightIcon, toggleRightTooltip]);
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
141
|
+
if (side === 'left') {
|
|
142
|
+
return (jsx_runtime_1.jsx(InlineAction_1.InlineAction, { onClick: toggleLeft, renderAction: toggleLeftAction, unhoveredColor: colors_1.WHITE_ALPHA_80 }));
|
|
143
|
+
}
|
|
144
|
+
return (jsx_runtime_1.jsx(InlineAction_1.InlineAction, { onClick: toggleRight, renderAction: toggleRightAction, unhoveredColor: colors_1.WHITE_ALPHA_80 }));
|
|
140
145
|
};
|
|
141
|
-
exports.
|
|
146
|
+
exports.SidebarCollapserControl = SidebarCollapserControl;
|
|
@@ -9,7 +9,7 @@ const use_keybinding_1 = require("../helpers/use-keybinding");
|
|
|
9
9
|
const magnet_1 = require("../icons/magnet");
|
|
10
10
|
const editor_snapping_1 = require("../state/editor-snapping");
|
|
11
11
|
const ControlButton_1 = require("./ControlButton");
|
|
12
|
-
const SnappingToggle = (
|
|
12
|
+
const SnappingToggle = () => {
|
|
13
13
|
const { editorSnapping, setEditorSnapping } = (0, react_1.useContext)(editor_snapping_1.EditorSnappingContext);
|
|
14
14
|
const onClick = (0, react_1.useCallback)(() => {
|
|
15
15
|
setEditorSnapping((current) => !current);
|
|
@@ -21,6 +21,6 @@ const SnappingToggle = ({ disabled }) => {
|
|
|
21
21
|
]
|
|
22
22
|
.filter(no_react_1.NoReactInternals.truthy)
|
|
23
23
|
.join(' ');
|
|
24
|
-
return (jsx_runtime_1.jsx(ControlButton_1.ControlButton, { title: accessibilityLabel, "aria-label": accessibilityLabel, "aria-pressed": editorSnapping, "aria-keyshortcuts": "Shift+M",
|
|
24
|
+
return (jsx_runtime_1.jsx(ControlButton_1.ControlButton, { title: accessibilityLabel, "aria-label": accessibilityLabel, "aria-pressed": editorSnapping, "aria-keyshortcuts": "Shift+M", onClick: onClick, children: jsx_runtime_1.jsx(magnet_1.MagnetIcon, { style: { width: 17, height: 17 }, fill: color, "aria-hidden": "true", focusable: "false" }) }));
|
|
25
25
|
};
|
|
26
26
|
exports.SnappingToggle = SnappingToggle;
|
|
@@ -5,6 +5,8 @@ export declare const SplitterContainer: React.FC<{
|
|
|
5
5
|
readonly orientation: SplitterOrientation;
|
|
6
6
|
readonly maxFlex: number;
|
|
7
7
|
readonly minFlex: number;
|
|
8
|
+
readonly maxFlexerSize: number | null;
|
|
9
|
+
readonly maxAntiFlexerSize: number | null;
|
|
8
10
|
readonly id: string;
|
|
9
11
|
readonly defaultFlex: number;
|
|
10
12
|
readonly children: React.ReactNode;
|
|
@@ -19,7 +19,7 @@ exports.containerColumn = {
|
|
|
19
19
|
flex: 1,
|
|
20
20
|
height: 0,
|
|
21
21
|
};
|
|
22
|
-
const SplitterContainer = ({ orientation, children, defaultFlex, maxFlex, minFlex, id }) => {
|
|
22
|
+
const SplitterContainer = ({ orientation, children, defaultFlex, maxFlex, minFlex, maxFlexerSize, maxAntiFlexerSize, id, }) => {
|
|
23
23
|
const [initialTimelineFlex, persistFlex] = (0, timeline_1.useTimelineFlex)(id);
|
|
24
24
|
const [flexValue, setFlexValue] = (0, react_1.useState)(initialTimelineFlex !== null && initialTimelineFlex !== void 0 ? initialTimelineFlex : defaultFlex);
|
|
25
25
|
const ref = (0, react_1.useRef)(null);
|
|
@@ -34,6 +34,8 @@ const SplitterContainer = ({ orientation, children, defaultFlex, maxFlex, minFle
|
|
|
34
34
|
id,
|
|
35
35
|
maxFlex,
|
|
36
36
|
minFlex,
|
|
37
|
+
maxFlexerSize,
|
|
38
|
+
maxAntiFlexerSize,
|
|
37
39
|
defaultFlex,
|
|
38
40
|
persistFlex,
|
|
39
41
|
};
|
|
@@ -42,6 +44,8 @@ const SplitterContainer = ({ orientation, children, defaultFlex, maxFlex, minFle
|
|
|
42
44
|
flexValue,
|
|
43
45
|
id,
|
|
44
46
|
maxFlex,
|
|
47
|
+
maxFlexerSize,
|
|
48
|
+
maxAntiFlexerSize,
|
|
45
49
|
minFlex,
|
|
46
50
|
orientation,
|
|
47
51
|
persistFlex,
|
|
@@ -11,6 +11,8 @@ export type TSplitterContext = {
|
|
|
11
11
|
ref: React.RefObject<HTMLDivElement | null>;
|
|
12
12
|
maxFlex: number;
|
|
13
13
|
minFlex: number;
|
|
14
|
+
maxFlexerSize: number | null;
|
|
15
|
+
maxAntiFlexerSize: number | null;
|
|
14
16
|
defaultFlex: number;
|
|
15
17
|
id: string;
|
|
16
18
|
persistFlex: (value: number) => void;
|
|
@@ -8,6 +8,7 @@ const colors_1 = require("../../helpers/colors");
|
|
|
8
8
|
const SplitterContext_1 = require("./SplitterContext");
|
|
9
9
|
const SplitterElement = ({ children, type, sticky }) => {
|
|
10
10
|
const context = (0, react_1.useContext)(SplitterContext_1.SplitterContext);
|
|
11
|
+
const maxSize = type === 'flexer' ? context.maxFlexerSize : context.maxAntiFlexerSize;
|
|
11
12
|
const style = (0, react_1.useMemo)(() => {
|
|
12
13
|
return {
|
|
13
14
|
flex:
|
|
@@ -17,8 +18,12 @@ const SplitterElement = ({ children, type, sticky }) => {
|
|
|
17
18
|
position: 'relative',
|
|
18
19
|
overflow: 'hidden',
|
|
19
20
|
flexDirection: 'column',
|
|
21
|
+
maxWidth: context.orientation === 'vertical' ? (maxSize !== null && maxSize !== void 0 ? maxSize : undefined) : undefined,
|
|
22
|
+
maxHeight: context.orientation === 'horizontal'
|
|
23
|
+
? (maxSize !== null && maxSize !== void 0 ? maxSize : undefined)
|
|
24
|
+
: undefined,
|
|
20
25
|
};
|
|
21
|
-
}, [context.flexValue, type]);
|
|
26
|
+
}, [context.flexValue, context.orientation, maxSize, type]);
|
|
22
27
|
const stickStyle = (0, react_1.useMemo)(() => {
|
|
23
28
|
return {
|
|
24
29
|
position: 'absolute',
|
|
@@ -31,6 +31,8 @@ const SplitterHandle = ({ allowToCollapse, onCollapse }) => {
|
|
|
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
|
+
var _a;
|
|
35
|
+
var _b;
|
|
34
36
|
if (e.button !== 0) {
|
|
35
37
|
return;
|
|
36
38
|
}
|
|
@@ -40,7 +42,20 @@ const SplitterHandle = ({ allowToCollapse, onCollapse }) => {
|
|
|
40
42
|
// value updates on every pointermove, so it must not be re-read live.
|
|
41
43
|
const dragContext = latest.current.context;
|
|
42
44
|
const start = { x: e.clientX, y: e.clientY };
|
|
43
|
-
const
|
|
45
|
+
const { width: containerWidth, height: containerHeight } = (_b = (_a = dragContext.ref.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect()) !== null && _b !== void 0 ? _b : {
|
|
46
|
+
width: 0,
|
|
47
|
+
height: 0,
|
|
48
|
+
};
|
|
49
|
+
const availableSize = (dragContext.orientation === 'vertical'
|
|
50
|
+
? containerWidth
|
|
51
|
+
: containerHeight) - exports.SPLITTER_HANDLE_SIZE;
|
|
52
|
+
const minFlex = dragContext.maxAntiFlexerSize === null || availableSize <= 0
|
|
53
|
+
? dragContext.minFlex
|
|
54
|
+
: Math.max(dragContext.minFlex, 1 - dragContext.maxAntiFlexerSize / availableSize);
|
|
55
|
+
const maxFlex = dragContext.maxFlexerSize === null || availableSize <= 0
|
|
56
|
+
? dragContext.maxFlex
|
|
57
|
+
: Math.min(dragContext.maxFlex, dragContext.maxFlexerSize / availableSize);
|
|
58
|
+
const startFlex = Math.min(maxFlex, Math.max(minFlex, dragContext.flexValue));
|
|
44
59
|
dragContext.isDragging.current = start;
|
|
45
60
|
(0, ForceSpecificCursor_1.forceSpecificCursor)(dragContext.orientation === 'horizontal' ? 'row-resize' : 'col-resize');
|
|
46
61
|
current.classList.add('remotion-splitter-active');
|
|
@@ -54,7 +69,7 @@ const SplitterHandle = ({ allowToCollapse, onCollapse }) => {
|
|
|
54
69
|
: (ev.clientY - start.y) / (height - exports.SPLITTER_HANDLE_SIZE);
|
|
55
70
|
const newFlex = startFlex + change;
|
|
56
71
|
if (clamp) {
|
|
57
|
-
return Math.min(
|
|
72
|
+
return Math.min(maxFlex, Math.max(minFlex, newFlex));
|
|
58
73
|
}
|
|
59
74
|
return newFlex;
|
|
60
75
|
};
|
|
@@ -64,6 +79,8 @@ const SplitterHandle = ({ allowToCollapse, onCollapse }) => {
|
|
|
64
79
|
current.classList.remove('remotion-splitter-active');
|
|
65
80
|
window.removeEventListener('pointermove', onPointerMove);
|
|
66
81
|
window.removeEventListener('pointerup', onPointerUp);
|
|
82
|
+
window.removeEventListener('pointercancel', onPointerCancel);
|
|
83
|
+
window.removeEventListener('blur', onWindowBlur);
|
|
67
84
|
endDrag = null;
|
|
68
85
|
player_1.PlayerInternals.updateAllElementsSizes();
|
|
69
86
|
};
|
|
@@ -95,8 +112,16 @@ const SplitterHandle = ({ allowToCollapse, onCollapse }) => {
|
|
|
95
112
|
dragContext.persistFlex(getNewValue(ev, true));
|
|
96
113
|
endDrag === null || endDrag === void 0 ? void 0 : endDrag();
|
|
97
114
|
};
|
|
115
|
+
const onPointerCancel = () => {
|
|
116
|
+
endDrag === null || endDrag === void 0 ? void 0 : endDrag();
|
|
117
|
+
};
|
|
118
|
+
const onWindowBlur = () => {
|
|
119
|
+
endDrag === null || endDrag === void 0 ? void 0 : endDrag();
|
|
120
|
+
};
|
|
98
121
|
window.addEventListener('pointermove', onPointerMove);
|
|
99
122
|
window.addEventListener('pointerup', onPointerUp);
|
|
123
|
+
window.addEventListener('pointercancel', onPointerCancel);
|
|
124
|
+
window.addEventListener('blur', onWindowBlur);
|
|
100
125
|
};
|
|
101
126
|
current.addEventListener('pointerdown', onPointerDown);
|
|
102
127
|
return () => {
|
|
@@ -253,7 +253,7 @@ const TimelineInner = () => {
|
|
|
253
253
|
}
|
|
254
254
|
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));
|
|
255
255
|
}), (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: [
|
|
256
|
-
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, children: [
|
|
256
|
+
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: [
|
|
257
257
|
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: [
|
|
258
258
|
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, {})
|
|
259
259
|
] }) })
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { CanUpdateSequencePropStatusStatic } from 'remotion';
|
|
3
3
|
import type { SchemaFieldInfo, TimelineFieldOnDragValueChange, TimelineFieldOnSave } from '../../helpers/timeline-layout';
|
|
4
|
+
import { type InspectorInlineActionProps } from '../InspectorPanel/common';
|
|
5
|
+
export type InspectorSourceAction = Omit<InspectorInlineActionProps, 'variant'>;
|
|
6
|
+
type AssetSelectionContextValue = {
|
|
7
|
+
readonly initialQuery: string;
|
|
8
|
+
readonly getSourceAction: (src: string) => InspectorSourceAction | null;
|
|
9
|
+
readonly sourceAction: InspectorSourceAction | null;
|
|
10
|
+
};
|
|
11
|
+
export declare const AssetSelectionContext: React.Context<AssetSelectionContextValue>;
|
|
12
|
+
export declare const toFileToken: (name: string) => string;
|
|
4
13
|
type TimelineAssetFieldProps = {
|
|
5
14
|
readonly field: SchemaFieldInfo;
|
|
6
15
|
readonly propStatus: CanUpdateSequencePropStatusStatic;
|
|
@@ -9,6 +18,5 @@ type TimelineAssetFieldProps = {
|
|
|
9
18
|
readonly onDragValueChange: TimelineFieldOnDragValueChange;
|
|
10
19
|
readonly onDragEnd: () => void;
|
|
11
20
|
};
|
|
12
|
-
export declare const isStaticFileAssetValue: (value: unknown) => value is string;
|
|
13
21
|
export declare const TimelineAssetField: React.FC<TimelineAssetFieldProps>;
|
|
14
22
|
export {};
|
|
@@ -1,45 +1,46 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TimelineAssetField = exports.
|
|
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
6
|
const no_react_1 = require("remotion/no-react");
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
maxWidth: 180,
|
|
16
|
-
};
|
|
17
|
-
const remoteAssetStyle = {
|
|
18
|
-
display: 'inline-block',
|
|
19
|
-
marginLeft: 8,
|
|
20
|
-
maxWidth: 180,
|
|
21
|
-
overflow: 'hidden',
|
|
22
|
-
textOverflow: 'ellipsis',
|
|
23
|
-
verticalAlign: 'middle',
|
|
24
|
-
whiteSpace: 'nowrap',
|
|
7
|
+
const pen_1 = require("../../icons/pen");
|
|
8
|
+
const modals_1 = require("../../state/modals");
|
|
9
|
+
const InlineAction_1 = require("../InlineAction");
|
|
10
|
+
const common_1 = require("../InspectorPanel/common");
|
|
11
|
+
const penIcon = {
|
|
12
|
+
display: 'block',
|
|
13
|
+
height: 14,
|
|
14
|
+
width: 14,
|
|
25
15
|
};
|
|
16
|
+
exports.AssetSelectionContext = (0, react_1.createContext)({
|
|
17
|
+
getSourceAction: () => null,
|
|
18
|
+
initialQuery: '',
|
|
19
|
+
sourceAction: null,
|
|
20
|
+
});
|
|
26
21
|
const toFileToken = (name) => {
|
|
27
22
|
return `${no_react_1.NoReactInternals.FILE_TOKEN}${name
|
|
28
23
|
.split('/')
|
|
29
24
|
.map(encodeURIComponent)
|
|
30
25
|
.join('/')}`;
|
|
31
26
|
};
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
27
|
+
exports.toFileToken = toFileToken;
|
|
28
|
+
const TimelineAssetField = ({ field, effectiveValue, propStatus, onSave, onDragValueChange, onDragEnd, }) => {
|
|
29
|
+
if (field.fieldSchema.type !== 'asset') {
|
|
30
|
+
throw new Error('TimelineAssetField rendered for non-asset field');
|
|
31
|
+
}
|
|
32
|
+
const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
33
|
+
const { getSourceAction, initialQuery, sourceAction } = (0, react_1.useContext)(exports.AssetSelectionContext);
|
|
34
|
+
const inlineSourceAction = (0, react_1.useMemo)(() => {
|
|
35
|
+
if (field.key !== 'src') {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
return typeof effectiveValue === 'string'
|
|
39
|
+
? getSourceAction(effectiveValue)
|
|
40
|
+
: sourceAction;
|
|
41
|
+
}, [effectiveValue, field.key, getSourceAction, sourceAction]);
|
|
42
|
+
const onSelect = (0, react_1.useCallback)((assetName, previewValue) => {
|
|
43
|
+
const sourceValue = (0, exports.toFileToken)(assetName);
|
|
43
44
|
if (sourceValue === propStatus.codeValue) {
|
|
44
45
|
return;
|
|
45
46
|
}
|
|
@@ -48,78 +49,29 @@ const TimelineStaticFileAssetField = ({ propStatus, effectiveValue, onSave, onDr
|
|
|
48
49
|
onDragEnd();
|
|
49
50
|
});
|
|
50
51
|
}, [propStatus.codeValue, onDragValueChange, onSave, onDragEnd]);
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
try {
|
|
62
|
-
if (!existing) {
|
|
63
|
-
await (0, write_static_file_1.writeStaticFile)({
|
|
64
|
-
contents: await file.arrayBuffer(),
|
|
65
|
-
filePath: file.name,
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
const fileToken = toFileToken(file.name);
|
|
69
|
-
onSelect(fileToken, toStaticFileUrl(fileToken));
|
|
70
|
-
if (!existing) {
|
|
71
|
-
(0, NotificationCenter_1.showNotification)(`Created ${file.name} in public folder`, 3000);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
catch (error) {
|
|
75
|
-
(0, NotificationCenter_1.showNotification)(`Could not upload asset: ${error instanceof Error ? error.message : String(error)}`, 4000);
|
|
76
|
-
}
|
|
77
|
-
}, [onSelect, staticFiles]);
|
|
78
|
-
const items = (0, react_1.useMemo)(() => {
|
|
79
|
-
const publicFileItems = staticFiles.map((file) => {
|
|
80
|
-
const fileToken = toFileToken(file.name);
|
|
81
|
-
return {
|
|
82
|
-
type: 'item',
|
|
83
|
-
id: fileToken,
|
|
84
|
-
value: fileToken,
|
|
85
|
-
label: file.name,
|
|
86
|
-
onClick: () => onSelect(fileToken, file.src),
|
|
87
|
-
keyHint: null,
|
|
88
|
-
leftItem: fileToken === current ? jsx_runtime_1.jsx(Checkmark_1.Checkmark, {}) : null,
|
|
89
|
-
subMenu: null,
|
|
90
|
-
quickSwitcherLabel: null,
|
|
91
|
-
};
|
|
52
|
+
const openAssetSelection = (0, react_1.useCallback)(() => {
|
|
53
|
+
setSelectedModal({
|
|
54
|
+
type: 'quick-switcher',
|
|
55
|
+
mode: 'assets',
|
|
56
|
+
invocationTimestamp: Date.now(),
|
|
57
|
+
assetSelection: {
|
|
58
|
+
initialQuery,
|
|
59
|
+
onSelected: (asset) => onSelect(asset.name, asset.src),
|
|
60
|
+
},
|
|
92
61
|
});
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
onClick: () => {
|
|
102
|
-
upload().catch(() => undefined);
|
|
103
|
-
},
|
|
104
|
-
keyHint: null,
|
|
105
|
-
leftItem: null,
|
|
106
|
-
subMenu: null,
|
|
107
|
-
quickSwitcherLabel: null,
|
|
62
|
+
}, [initialQuery, onSelect, setSelectedModal]);
|
|
63
|
+
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 }) }));
|
|
64
|
+
if (inlineSourceAction === null) {
|
|
65
|
+
return action;
|
|
66
|
+
}
|
|
67
|
+
return (jsx_runtime_1.jsx(common_1.InspectorInlineAction, { ...inlineSourceAction, size: "compact", variant: {
|
|
68
|
+
type: 'segmented',
|
|
69
|
+
trailing: {
|
|
108
70
|
disabled: window.remotion_isReadOnlyStudio,
|
|
71
|
+
onClick: openAssetSelection,
|
|
72
|
+
renderIcon: (color) => jsx_runtime_1.jsx(pen_1.PenIcon, { color: color, style: penIcon }),
|
|
73
|
+
title: 'Change source',
|
|
109
74
|
},
|
|
110
|
-
|
|
111
|
-
}, [current, onSelect, staticFiles, upload]);
|
|
112
|
-
return (jsx_runtime_1.jsx(ComboBox_1.Combobox, { size: "small", title: current, selectedId: current, values: items, style: comboboxStyle }));
|
|
113
|
-
};
|
|
114
|
-
const TimelineAssetField = (props) => {
|
|
115
|
-
var _a;
|
|
116
|
-
if (props.field.fieldSchema.type !== 'asset') {
|
|
117
|
-
throw new Error('TimelineAssetField rendered for non-asset field');
|
|
118
|
-
}
|
|
119
|
-
if (!(0, exports.isStaticFileAssetValue)(props.effectiveValue)) {
|
|
120
|
-
const remote = String((_a = props.effectiveValue) !== null && _a !== void 0 ? _a : '');
|
|
121
|
-
return (jsx_runtime_1.jsx("span", { style: remoteAssetStyle, title: remote, children: remote }));
|
|
122
|
-
}
|
|
123
|
-
return jsx_runtime_1.jsx(TimelineStaticFileAssetField, { ...props });
|
|
75
|
+
} }));
|
|
124
76
|
};
|
|
125
77
|
exports.TimelineAssetField = TimelineAssetField;
|
|
@@ -14,16 +14,19 @@ export type PasteEffectsTarget = {
|
|
|
14
14
|
} | {
|
|
15
15
|
readonly type: 'unsupported';
|
|
16
16
|
};
|
|
17
|
-
|
|
18
|
-
readonly type: 'valid';
|
|
17
|
+
type PasteEffectPropEditTarget = {
|
|
19
18
|
readonly fileName: string;
|
|
20
19
|
readonly nodePath: SequencePropsSubscriptionKey;
|
|
21
20
|
readonly effectIndex: number;
|
|
22
21
|
readonly fieldKey: string;
|
|
23
22
|
readonly defaultValue: string | null;
|
|
24
23
|
readonly schema: InteractivitySchema;
|
|
24
|
+
};
|
|
25
|
+
export type PasteEffectPropTarget = {
|
|
26
|
+
readonly type: 'valid';
|
|
27
|
+
readonly targets: PasteEffectPropEditTarget[];
|
|
25
28
|
} | {
|
|
26
|
-
readonly type: 'none' | '
|
|
29
|
+
readonly type: 'none' | 'unsupported' | 'effect-type-mismatch' | 'prop-mismatch' | 'uncopyable';
|
|
27
30
|
};
|
|
28
31
|
export declare const getPasteEffectsTarget: (selectedItems: readonly TimelineSelection[]) => PasteEffectsTarget;
|
|
29
32
|
export declare const getSnapshotsFromSelection: ({ selection, propStatuses, }: {
|
|
@@ -72,3 +75,4 @@ export declare const getPasteEffectPropTarget: ({ selectedItems, payload, propSt
|
|
|
72
75
|
readonly overrideIdsToNodePaths: OverrideIdToNodePaths;
|
|
73
76
|
}) => PasteEffectPropTarget;
|
|
74
77
|
export declare const TimelineClipboardKeybindings: React.FC;
|
|
78
|
+
export {};
|