@remotion/studio 4.0.501 → 4.0.502
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 +2 -2
- package/dist/components/Canvas.js +3 -3
- package/dist/components/CompositionSelector.js +4 -4
- package/dist/components/CompositionSelectorItem.js +5 -5
- package/dist/components/EditorContent.js +1 -1
- package/dist/components/FullscreenToggle.d.ts +3 -1
- package/dist/components/FullscreenToggle.js +2 -2
- package/dist/components/InlineAction.js +1 -1
- package/dist/components/InspectorPanel/use-composition-actions.d.ts +1 -1
- package/dist/components/InspectorPanel/use-composition-actions.js +46 -3
- package/dist/components/LoopToggle.d.ts +1 -0
- package/dist/components/LoopToggle.js +9 -5
- package/dist/components/Menu/MenuSubItem.js +9 -1
- 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/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 +8 -6
- package/dist/components/Timeline/Timeline.js +2 -1
- package/dist/components/Timeline/TimelineAssetField.d.ts +1 -1
- package/dist/components/Timeline/TimelineAssetField.js +36 -1
- package/dist/components/Timeline/TimelineDragHandler.js +1 -1
- package/dist/components/Timeline/TimelineStack/get-stack.js +8 -0
- 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/TopPanel.js +1 -1
- package/dist/components/UpdateCheck.js +11 -4
- 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/import-assets.d.ts +4 -4
- package/dist/components/sequence-props-api.d.ts +4 -0
- package/dist/components/sequence-props-api.js +26 -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/esm/{chunk-n1kj09yv.js → chunk-fjv75ty4.js} +4122 -3579
- package/dist/esm/internals.mjs +4122 -3579
- package/dist/esm/previewEntry.mjs +4175 -3632
- package/dist/esm/renderEntry.mjs +1 -1
- package/dist/icons/upload.d.ts +4 -0
- package/dist/icons/upload.js +8 -0
- package/dist/state/modals.d.ts +1 -0
- package/package.json +13 -13
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const PreviewToolbarOverflowButton: React.FC<{
|
|
3
|
+
readonly readOnlyStudio: boolean;
|
|
4
|
+
readonly showFullscreen: boolean;
|
|
5
|
+
readonly showPlaybackRate: boolean;
|
|
6
|
+
readonly showLoop: boolean;
|
|
7
|
+
readonly showCompositionControls: boolean;
|
|
8
|
+
readonly playbackRate: number;
|
|
9
|
+
readonly setPlaybackRate: React.Dispatch<React.SetStateAction<number>>;
|
|
10
|
+
readonly loop: boolean;
|
|
11
|
+
readonly setLoop: React.Dispatch<React.SetStateAction<boolean>>;
|
|
12
|
+
}>;
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PreviewToolbarOverflowButton = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const remotion_1 = require("remotion");
|
|
7
|
+
const colors_1 = require("../helpers/colors");
|
|
8
|
+
const use_keybinding_1 = require("../helpers/use-keybinding");
|
|
9
|
+
const Checkmark_1 = require("../icons/Checkmark");
|
|
10
|
+
const ellipsis_1 = require("../icons/ellipsis");
|
|
11
|
+
const checkerboard_1 = require("../state/checkerboard");
|
|
12
|
+
const editor_outlines_1 = require("../state/editor-outlines");
|
|
13
|
+
const InlineDropdown_1 = require("./InlineDropdown");
|
|
14
|
+
const LoopToggle_1 = require("./LoopToggle");
|
|
15
|
+
const PlaybackRateSelector_1 = require("./PlaybackRateSelector");
|
|
16
|
+
const SizeSelector_1 = require("./SizeSelector");
|
|
17
|
+
const clickButton = (id) => {
|
|
18
|
+
var _a;
|
|
19
|
+
(_a = document.getElementById(id)) === null || _a === void 0 ? void 0 : _a.click();
|
|
20
|
+
};
|
|
21
|
+
const PreviewToolbarOverflowButton = ({ readOnlyStudio, showFullscreen, showPlaybackRate, showLoop, showCompositionControls, playbackRate, setPlaybackRate, loop, setLoop, }) => {
|
|
22
|
+
const video = remotion_1.Internals.useVideo();
|
|
23
|
+
const { checkerboard, setCheckerboard } = (0, react_1.useContext)(checkerboard_1.CheckerboardContext);
|
|
24
|
+
const { editorShowOutlines, setEditorShowOutlines } = (0, react_1.useContext)(editor_outlines_1.EditorShowOutlinesContext);
|
|
25
|
+
const { items: previewSizeItems, selectedId: selectedPreviewSize, zoomable, } = (0, SizeSelector_1.usePreviewSizeMenuItems)();
|
|
26
|
+
const { items: playbackRateItems, selectedId: selectedPlaybackRate } = (0, PlaybackRateSelector_1.usePlaybackRateMenuItems)({ playbackRate, setPlaybackRate });
|
|
27
|
+
const iconStyle = (0, react_1.useMemo)(() => {
|
|
28
|
+
return {
|
|
29
|
+
style: {
|
|
30
|
+
width: 14,
|
|
31
|
+
height: 14,
|
|
32
|
+
flexShrink: 0,
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
}, []);
|
|
36
|
+
const renderAction = (0, react_1.useCallback)((color) => jsx_runtime_1.jsx(ellipsis_1.EllipsisIcon, { fill: color, svgProps: iconStyle }), [iconStyle]);
|
|
37
|
+
const renderItems = (0, react_1.useMemo)(() => {
|
|
38
|
+
if (readOnlyStudio) {
|
|
39
|
+
return [
|
|
40
|
+
{
|
|
41
|
+
type: 'item',
|
|
42
|
+
id: 'client-render',
|
|
43
|
+
label: 'Render on web',
|
|
44
|
+
value: 'client-render',
|
|
45
|
+
onClick: () => clickButton('render-modal-button-client'),
|
|
46
|
+
keyHint: null,
|
|
47
|
+
leftItem: null,
|
|
48
|
+
subMenu: null,
|
|
49
|
+
quickSwitcherLabel: null,
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
type: 'item',
|
|
53
|
+
id: 'render-command',
|
|
54
|
+
label: 'Render via CLI',
|
|
55
|
+
value: 'render-command',
|
|
56
|
+
onClick: () => clickButton('render-modal-button-command'),
|
|
57
|
+
keyHint: null,
|
|
58
|
+
leftItem: null,
|
|
59
|
+
subMenu: null,
|
|
60
|
+
quickSwitcherLabel: null,
|
|
61
|
+
},
|
|
62
|
+
];
|
|
63
|
+
}
|
|
64
|
+
return [
|
|
65
|
+
{
|
|
66
|
+
type: 'item',
|
|
67
|
+
id: 'server-render',
|
|
68
|
+
label: 'Server-side render',
|
|
69
|
+
value: 'server-render',
|
|
70
|
+
onClick: () => clickButton('render-modal-button-server'),
|
|
71
|
+
keyHint: null,
|
|
72
|
+
leftItem: null,
|
|
73
|
+
subMenu: null,
|
|
74
|
+
quickSwitcherLabel: null,
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
type: 'item',
|
|
78
|
+
id: 'client-render',
|
|
79
|
+
label: 'Client-side render',
|
|
80
|
+
value: 'client-render',
|
|
81
|
+
onClick: () => clickButton('render-modal-button-client'),
|
|
82
|
+
keyHint: null,
|
|
83
|
+
leftItem: null,
|
|
84
|
+
subMenu: null,
|
|
85
|
+
quickSwitcherLabel: null,
|
|
86
|
+
},
|
|
87
|
+
];
|
|
88
|
+
}, [readOnlyStudio]);
|
|
89
|
+
const values = (0, react_1.useMemo)(() => {
|
|
90
|
+
const items = [];
|
|
91
|
+
if (zoomable) {
|
|
92
|
+
items.push({
|
|
93
|
+
type: 'item',
|
|
94
|
+
id: 'preview-size',
|
|
95
|
+
label: 'Preview Size',
|
|
96
|
+
value: 'preview-size',
|
|
97
|
+
onClick: () => undefined,
|
|
98
|
+
keyHint: null,
|
|
99
|
+
leftItem: null,
|
|
100
|
+
subMenu: {
|
|
101
|
+
items: previewSizeItems,
|
|
102
|
+
leaveLeftSpace: true,
|
|
103
|
+
preselectIndex: previewSizeItems.findIndex((item) => item.id === selectedPreviewSize),
|
|
104
|
+
},
|
|
105
|
+
quickSwitcherLabel: null,
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
if (showPlaybackRate) {
|
|
109
|
+
items.push({
|
|
110
|
+
type: 'item',
|
|
111
|
+
id: 'playback-rate',
|
|
112
|
+
label: 'Playback Rate',
|
|
113
|
+
value: 'playback-rate',
|
|
114
|
+
onClick: () => undefined,
|
|
115
|
+
keyHint: null,
|
|
116
|
+
leftItem: null,
|
|
117
|
+
subMenu: {
|
|
118
|
+
items: playbackRateItems,
|
|
119
|
+
leaveLeftSpace: true,
|
|
120
|
+
preselectIndex: playbackRateItems.findIndex((item) => item.id === selectedPlaybackRate),
|
|
121
|
+
},
|
|
122
|
+
quickSwitcherLabel: null,
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
if (showLoop) {
|
|
126
|
+
items.push({
|
|
127
|
+
type: 'item',
|
|
128
|
+
id: 'loop',
|
|
129
|
+
label: 'Loop',
|
|
130
|
+
value: 'loop',
|
|
131
|
+
onClick: () => (0, LoopToggle_1.toggleLoop)(setLoop),
|
|
132
|
+
keyHint: null,
|
|
133
|
+
leftItem: loop ? jsx_runtime_1.jsx(Checkmark_1.Checkmark, {}) : null,
|
|
134
|
+
subMenu: null,
|
|
135
|
+
quickSwitcherLabel: null,
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
if (showCompositionControls) {
|
|
139
|
+
items.push({
|
|
140
|
+
type: 'item',
|
|
141
|
+
id: 'checkerboard',
|
|
142
|
+
label: 'Transparency as checkerboard',
|
|
143
|
+
value: 'checkerboard',
|
|
144
|
+
onClick: () => setCheckerboard((current) => !current),
|
|
145
|
+
keyHint: (0, use_keybinding_1.areKeyboardShortcutsDisabled)() ? null : 'T',
|
|
146
|
+
leftItem: checkerboard ? jsx_runtime_1.jsx(Checkmark_1.Checkmark, {}) : null,
|
|
147
|
+
subMenu: null,
|
|
148
|
+
quickSwitcherLabel: null,
|
|
149
|
+
});
|
|
150
|
+
items.push({
|
|
151
|
+
type: 'item',
|
|
152
|
+
id: 'outlines',
|
|
153
|
+
label: 'Outlines',
|
|
154
|
+
value: 'outlines',
|
|
155
|
+
onClick: () => setEditorShowOutlines((current) => !current),
|
|
156
|
+
keyHint: null,
|
|
157
|
+
leftItem: editorShowOutlines ? jsx_runtime_1.jsx(Checkmark_1.Checkmark, {}) : null,
|
|
158
|
+
subMenu: null,
|
|
159
|
+
quickSwitcherLabel: null,
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
if (showFullscreen) {
|
|
163
|
+
items.push({
|
|
164
|
+
type: 'item',
|
|
165
|
+
id: 'fullscreen',
|
|
166
|
+
label: 'Fullscreen',
|
|
167
|
+
value: 'fullscreen',
|
|
168
|
+
onClick: () => clickButton('fullscreen-toggle'),
|
|
169
|
+
keyHint: (0, use_keybinding_1.areKeyboardShortcutsDisabled)() ? null : 'F',
|
|
170
|
+
leftItem: null,
|
|
171
|
+
subMenu: null,
|
|
172
|
+
quickSwitcherLabel: null,
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
if (video) {
|
|
176
|
+
items.push({
|
|
177
|
+
type: 'item',
|
|
178
|
+
id: 'render',
|
|
179
|
+
label: 'Render',
|
|
180
|
+
value: 'render',
|
|
181
|
+
onClick: () => undefined,
|
|
182
|
+
keyHint: null,
|
|
183
|
+
leftItem: null,
|
|
184
|
+
subMenu: {
|
|
185
|
+
items: renderItems,
|
|
186
|
+
leaveLeftSpace: false,
|
|
187
|
+
preselectIndex: 0,
|
|
188
|
+
},
|
|
189
|
+
quickSwitcherLabel: null,
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
return items;
|
|
193
|
+
}, [
|
|
194
|
+
previewSizeItems,
|
|
195
|
+
playbackRateItems,
|
|
196
|
+
renderItems,
|
|
197
|
+
selectedPlaybackRate,
|
|
198
|
+
selectedPreviewSize,
|
|
199
|
+
showFullscreen,
|
|
200
|
+
showLoop,
|
|
201
|
+
showPlaybackRate,
|
|
202
|
+
showCompositionControls,
|
|
203
|
+
loop,
|
|
204
|
+
checkerboard,
|
|
205
|
+
editorShowOutlines,
|
|
206
|
+
setCheckerboard,
|
|
207
|
+
setEditorShowOutlines,
|
|
208
|
+
setLoop,
|
|
209
|
+
video,
|
|
210
|
+
zoomable,
|
|
211
|
+
]);
|
|
212
|
+
if (values.length === 0) {
|
|
213
|
+
return null;
|
|
214
|
+
}
|
|
215
|
+
return (jsx_runtime_1.jsx(InlineDropdown_1.InlineDropdown, { renderAction: renderAction, values: values, title: "More actions", unhoveredColor: colors_1.WHITE }));
|
|
216
|
+
};
|
|
217
|
+
exports.PreviewToolbarOverflowButton = PreviewToolbarOverflowButton;
|
|
@@ -8,6 +8,7 @@ declare const QuickSwitcher: React.FC<{
|
|
|
8
8
|
readonly readOnlyStudio: boolean;
|
|
9
9
|
readonly assetSelection: {
|
|
10
10
|
readonly initialQuery: string;
|
|
11
|
+
readonly onSelectFile: () => void;
|
|
11
12
|
readonly onSelected: (asset: StaticFile) => void;
|
|
12
13
|
} | null;
|
|
13
14
|
readonly compositionSelection: {
|
|
@@ -8,6 +8,7 @@ export declare const QuickSwitcherContent: React.FC<{
|
|
|
8
8
|
readonly readOnlyStudio: boolean;
|
|
9
9
|
readonly assetSelection: {
|
|
10
10
|
readonly initialQuery: string;
|
|
11
|
+
readonly onSelectFile: () => void;
|
|
11
12
|
readonly onSelected: (asset: StaticFile) => void;
|
|
12
13
|
} | null;
|
|
13
14
|
readonly compositionSelection: {
|
|
@@ -156,7 +156,7 @@ const QuickSwitcherContent = ({ initialMode, invocationTimestamp, readOnlyStudio
|
|
|
156
156
|
return docResults.results;
|
|
157
157
|
}
|
|
158
158
|
if (mode === 'assets') {
|
|
159
|
-
|
|
159
|
+
const assetResults = (0, fuzzy_search_1.fuzzySearch)(assetSearch.query, assetSearch.assets.map((asset) => {
|
|
160
160
|
return {
|
|
161
161
|
id: 'asset-' + asset.name,
|
|
162
162
|
title: asset.name,
|
|
@@ -174,6 +174,21 @@ const QuickSwitcherContent = ({ initialMode, invocationTimestamp, readOnlyStudio
|
|
|
174
174
|
},
|
|
175
175
|
};
|
|
176
176
|
}));
|
|
177
|
+
if (assetSelection === null) {
|
|
178
|
+
return assetResults;
|
|
179
|
+
}
|
|
180
|
+
return [
|
|
181
|
+
{
|
|
182
|
+
id: 'select-file',
|
|
183
|
+
title: 'Select file...',
|
|
184
|
+
type: 'select-file',
|
|
185
|
+
onSelected: () => {
|
|
186
|
+
assetSelection.onSelectFile();
|
|
187
|
+
setSelectedModal(null);
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
...assetResults,
|
|
191
|
+
];
|
|
177
192
|
}
|
|
178
193
|
return (0, fuzzy_search_1.fuzzySearch)(actualQuery, compositions
|
|
179
194
|
.filter((c) => c.id !== (compositionSelection === null || compositionSelection === void 0 ? void 0 : compositionSelection.excludeCompositionId))
|
|
@@ -6,6 +6,7 @@ const react_1 = require("react");
|
|
|
6
6
|
const colors_1 = require("../../helpers/colors");
|
|
7
7
|
const use_keybinding_1 = require("../../helpers/use-keybinding");
|
|
8
8
|
const still_1 = require("../../icons/still");
|
|
9
|
+
const upload_1 = require("../../icons/upload");
|
|
9
10
|
const video_1 = require("../../icons/video");
|
|
10
11
|
const AssetFileIcon_1 = require("../AssetFileIcon");
|
|
11
12
|
const layout_1 = require("../layout");
|
|
@@ -35,6 +36,11 @@ const iconStyle = {
|
|
|
35
36
|
height: 18,
|
|
36
37
|
flexShrink: 0,
|
|
37
38
|
};
|
|
39
|
+
const selectFileIconStyle = {
|
|
40
|
+
...iconStyle,
|
|
41
|
+
width: 20,
|
|
42
|
+
height: 20,
|
|
43
|
+
};
|
|
38
44
|
const labelContainer = {
|
|
39
45
|
overflow: 'hidden',
|
|
40
46
|
flex: 1,
|
|
@@ -95,7 +101,7 @@ const QuickSwitcherResult = ({ result, selected }) => {
|
|
|
95
101
|
fontSize: shared_1.QUICK_SWITCHER_RESULT_LABEL_FONT_SIZE,
|
|
96
102
|
};
|
|
97
103
|
}, [hovered, result.type, selected]);
|
|
98
|
-
return (jsx_runtime_1.jsxs("div", { ref: ref, style: style, onClick: result.onSelected, children: [result.type === 'composition' ? (result.compositionType === 'still' ? (jsx_runtime_1.jsx(still_1.StillIcon, { color: selected || hovered ? colors_1.WHITE : colors_1.LIGHT_TEXT, style: iconStyle })) : (jsx_runtime_1.jsx(video_1.FilmIcon, { color: selected || hovered ? colors_1.WHITE : colors_1.LIGHT_TEXT, style: iconStyle }))) : result.type === 'asset' ? (jsx_runtime_1.jsx(AssetFileIcon_1.AssetFileIcon, { fileType: result.fileType, color: selected || hovered ? colors_1.WHITE : colors_1.LIGHT_TEXT, style: iconStyle })) : null, jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), jsx_runtime_1.jsx("div", { style: labelContainer, children: result.type === 'search-result' ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
104
|
+
return (jsx_runtime_1.jsxs("div", { ref: ref, style: style, onClick: result.onSelected, children: [result.type === 'composition' ? (result.compositionType === 'still' ? (jsx_runtime_1.jsx(still_1.StillIcon, { color: selected || hovered ? colors_1.WHITE : colors_1.LIGHT_TEXT, style: iconStyle })) : (jsx_runtime_1.jsx(video_1.FilmIcon, { color: selected || hovered ? colors_1.WHITE : colors_1.LIGHT_TEXT, style: iconStyle }))) : result.type === 'asset' ? (jsx_runtime_1.jsx(AssetFileIcon_1.AssetFileIcon, { fileType: result.fileType, color: selected || hovered ? colors_1.WHITE : colors_1.LIGHT_TEXT, style: iconStyle })) : result.type === 'select-file' ? (jsx_runtime_1.jsx(upload_1.UploadIcon, { color: selected || hovered ? colors_1.WHITE : colors_1.LIGHT_TEXT, style: selectFileIconStyle })) : null, jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), jsx_runtime_1.jsx("div", { style: labelContainer, children: result.type === 'search-result' ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
99
105
|
jsx_runtime_1.jsx("div", {
|
|
100
106
|
// eslint-disable-next-line react/no-danger
|
|
101
107
|
dangerouslySetInnerHTML: {
|
|
@@ -123,7 +123,7 @@ const getInitialRenderType = (readOnlyStudio) => {
|
|
|
123
123
|
}
|
|
124
124
|
return 'server-render';
|
|
125
125
|
};
|
|
126
|
-
const RenderButton = ({ readOnlyStudio, size: controlSize = 'default' }) => {
|
|
126
|
+
const RenderButton = ({ readOnlyStudio, size: controlSize = 'default', hidden }) => {
|
|
127
127
|
const { inFrame, outFrame } = (0, in_out_1.useTimelineInOutFramePosition)();
|
|
128
128
|
const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
129
129
|
const [preferredRenderType, setPreferredRenderType] = (0, react_1.useState)(() => getInitialRenderType(readOnlyStudio));
|
|
@@ -437,15 +437,17 @@ const RenderButton = ({ readOnlyStudio, size: controlSize = 'default' }) => {
|
|
|
437
437
|
return null;
|
|
438
438
|
}
|
|
439
439
|
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
440
|
-
jsx_runtime_1.jsx("button", { style: { display: 'none' }, id: "render-modal-button-server", disabled: !canServerRender, onClick: () => openServerRenderModal(false), type: "button" }), ' ', jsx_runtime_1.jsx("button", { style: { display: 'none' }, id: "render-modal-button-client", onClick: openClientRenderModal, type: "button" }), jsx_runtime_1.jsxs("div", { ref: containerRef, style: containerStyle, title: tooltip, children: [
|
|
441
|
-
jsx_runtime_1.jsx("button", { type: "button", style: controlSize === 'compact'
|
|
440
|
+
jsx_runtime_1.jsx("button", { style: { display: 'none' }, id: "render-modal-button-server", disabled: !canServerRender, onClick: () => openServerRenderModal(false), type: "button" }), ' ', jsx_runtime_1.jsx("button", { style: { display: 'none' }, id: "render-modal-button-client", onClick: openClientRenderModal, type: "button" }), jsx_runtime_1.jsx("button", { style: { display: 'none' }, id: "render-modal-button-command", onClick: () => openServerRenderModal(true), type: "button" }), hidden ? (jsx_runtime_1.jsx("button", { style: { display: 'none' }, onClick: onClick, id: "render-modal-button", type: "button" })) : (jsx_runtime_1.jsxs("div", { ref: containerRef, style: containerStyle, title: tooltip, children: [
|
|
441
|
+
jsx_runtime_1.jsx("button", { type: "button", style: controlSize === 'compact'
|
|
442
|
+
? compactMainButtonStyle
|
|
443
|
+
: mainButtonStyle, onClick: onClick, id: "render-modal-button", children: jsx_runtime_1.jsxs(layout_1.Row, { align: "center", style: controlSize === 'compact'
|
|
442
444
|
? compactMainButtonContent
|
|
443
445
|
: mainButtonContent, children: [
|
|
444
446
|
jsx_runtime_1.jsx(render_1.ThinRenderIcon, { fill: colors_1.CURRENT_COLOR_LOWERCASE, svgProps: iconStyle }), jsx_runtime_1.jsx(layout_1.Spacing, { x: controlSize === 'compact' ? 0.75 : 1 }), jsx_runtime_1.jsx("span", { style: controlSize === 'compact' ? compactLabel : label, children: renderLabel })
|
|
445
447
|
] }) }), jsx_runtime_1.jsx("div", { style: dividerStyle }), jsx_runtime_1.jsx("button", { ref: dropdownRef, type: "button", style: controlSize === 'compact'
|
|
446
448
|
? compactDropdownTriggerStyle
|
|
447
449
|
: dropdownTriggerStyle, className: is_menu_item_1.MENU_INITIATOR_CLASSNAME, onPointerDown: onPointerDown, onClick: onClickDropdown, children: jsx_runtime_1.jsx(caret_1.CaretDown, {}) })
|
|
448
|
-
] }), portalStyle
|
|
450
|
+
] })), portalStyle
|
|
449
451
|
? react_dom_1.default.createPortal(jsx_runtime_1.jsx("div", { style: styles_1.fullScreenOverlay, children: jsx_runtime_1.jsx("div", { style: styles_1.outerPortal, className: "css-reset", children: jsx_runtime_1.jsx(z_index_1.HigherZIndex, { onOutsideClick: onHideDropdown, onEscape: onHideDropdown, children: jsx_runtime_1.jsx("div", { style: portalStyle, onPointerDown: onMenuPointerDown, children: jsx_runtime_1.jsx(MenuContent_1.MenuContent, { onNextMenu: () => { }, onPreviousMenu: () => { }, values: dropdownValues, onHide: onHideDropdown, leaveLeftSpace: false, preselectIndex: dropdownValues.findIndex((v) => v.id === renderType), topItemCanBeUnselected: false, fixedHeight: derivedMaxHeight }) }) }) }) }), (0, portals_1.getPortal)(currentZIndex))
|
|
450
452
|
: null] }));
|
|
451
453
|
};
|
|
@@ -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: '--',
|
|
@@ -49,12 +49,14 @@ 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');
|
|
@@ -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'>;
|