@remotion/cli 4.0.0-preload.13 → 4.0.0-spawn.13
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/compositions.js +13 -3
- package/dist/editor/components/AudioWaveform.js +2 -2
- package/dist/editor/components/AudioWaveformBar.js +1 -1
- package/dist/editor/components/Canvas.js +1 -1
- package/dist/editor/components/CheckboardToggle.js +1 -1
- package/dist/editor/components/ClipboardIcon.js +1 -1
- package/dist/editor/components/CollapsedCompositionSelector.d.ts +4 -0
- package/dist/editor/components/CollapsedCompositionSelector.js +39 -0
- package/dist/editor/components/CompositionManager.d.ts +4 -0
- package/dist/editor/components/CompositionManager.js +60 -0
- package/dist/editor/components/CompositionSelector.js +5 -45
- package/dist/editor/components/CompositionSelectorItem.js +3 -3
- package/dist/editor/components/ControlButton.js +1 -1
- package/dist/editor/components/CopyButton.js +2 -2
- package/dist/editor/components/CurrentComposition.js +2 -2
- package/dist/editor/components/Editor.js +6 -4
- package/dist/editor/components/EditorContent.js +3 -2
- package/dist/editor/components/FpsCounter.js +1 -1
- package/dist/editor/components/InitialCompositionLoader.d.ts +4 -0
- package/dist/editor/components/InitialCompositionLoader.js +60 -0
- package/dist/editor/components/KeyboardShortcutsModal.js +1 -1
- package/dist/editor/components/LoadingIndicator.js +1 -1
- package/dist/editor/components/LoopToggle.js +1 -1
- package/dist/editor/components/Menu/MenuDivider.js +1 -1
- package/dist/editor/components/Menu/MenuItem.js +3 -3
- package/dist/editor/components/Menu/MenuSubItem.js +3 -3
- package/dist/editor/components/Menu/SubMenu.js +1 -1
- package/dist/editor/components/MenuToolbar.js +68 -5
- package/dist/editor/components/ModalContainer.js +1 -1
- package/dist/editor/components/ModalHeader.js +1 -1
- package/dist/editor/components/MuteToggle.js +1 -1
- package/dist/editor/components/NewComposition/CancelButton.js +1 -1
- package/dist/editor/components/NewComposition/ComboBox.js +3 -3
- package/dist/editor/components/NewComposition/CopyHint.js +1 -1
- package/dist/editor/components/NewComposition/InputDragger.js +2 -2
- package/dist/editor/components/NewComposition/MenuContent.js +1 -1
- package/dist/editor/components/NewComposition/NewCompAspectRatio.js +1 -1
- package/dist/editor/components/NewComposition/NewCompDuration.js +1 -1
- package/dist/editor/components/NewComposition/NewComposition.js +4 -4
- package/dist/editor/components/NewComposition/RemInput.js +1 -1
- package/dist/editor/components/NewComposition/ToggleAspectRatio.js +1 -1
- package/dist/editor/components/NewComposition/ValidationMessage.js +2 -2
- package/dist/editor/components/PlayPause.js +40 -11
- package/dist/editor/components/PlaybackRateSelector.js +2 -2
- package/dist/editor/components/Preview.js +2 -2
- package/dist/editor/components/PreviewToolbar.js +1 -1
- package/dist/editor/components/RichTimelineToggle.js +1 -1
- package/dist/editor/components/SizeSelector.js +2 -2
- package/dist/editor/components/Splitter/SplitterContainer.js +1 -1
- package/dist/editor/components/Splitter/SplitterElement.js +4 -2
- package/dist/editor/components/Splitter/SplitterHandle.d.ts +4 -1
- package/dist/editor/components/Splitter/SplitterHandle.js +28 -7
- package/dist/editor/components/Thumbnail.js +1 -1
- package/dist/editor/components/TimeValue.js +1 -1
- package/dist/editor/components/Timeline/LoopedIndicator.js +2 -2
- package/dist/editor/components/Timeline/LoopedTimelineIndicators.js +3 -3
- package/dist/editor/components/Timeline/MaxTimelineTracks.js +1 -1
- package/dist/editor/components/Timeline/Timeline.js +2 -1
- package/dist/editor/components/Timeline/TimelineCollapseToggle.js +2 -2
- package/dist/editor/components/Timeline/TimelineDragHandler.js +1 -1
- package/dist/editor/components/Timeline/TimelineInOutPointer.js +2 -2
- package/dist/editor/components/Timeline/TimelineInOutPointerHandle.js +1 -1
- package/dist/editor/components/Timeline/TimelineList.js +1 -1
- package/dist/editor/components/Timeline/TimelineListItem.js +1 -1
- package/dist/editor/components/Timeline/TimelineSequence.js +1 -1
- package/dist/editor/components/Timeline/TimelineSequenceFrame.js +1 -1
- package/dist/editor/components/Timeline/TimelineSlider.js +1 -1
- package/dist/editor/components/Timeline/TimelineSliderHandle.js +1 -1
- package/dist/editor/components/Timeline/TimelineTracks.js +2 -2
- package/dist/editor/components/Timeline/TimelineVideoInfo.js +1 -1
- package/dist/editor/components/TimelineInOutToggle.js +1 -1
- package/dist/editor/components/TopPanel.js +23 -1
- package/dist/editor/components/UpdateCheck.js +1 -1
- package/dist/editor/components/UpdateModal/UpdateModal.js +1 -1
- package/dist/editor/components/layout.js +4 -4
- package/dist/editor/helpers/use-compact-ui.d.ts +1 -0
- package/dist/editor/helpers/use-compact-ui.js +18 -0
- package/dist/editor/icons/Checkmark.js +1 -1
- package/dist/editor/icons/caret.d.ts +1 -1
- package/dist/editor/icons/caret.js +4 -4
- package/dist/editor/icons/film.js +1 -1
- package/dist/editor/icons/folder.js +2 -2
- package/dist/editor/icons/jump-to-start.d.ts +2 -0
- package/dist/editor/icons/jump-to-start.js +8 -0
- package/dist/editor/icons/keys.js +3 -3
- package/dist/editor/icons/lock.js +2 -2
- package/dist/editor/icons/media-volume.js +2 -2
- package/dist/editor/icons/pause.js +1 -1
- package/dist/editor/icons/play.js +1 -1
- package/dist/editor/icons/step-back.js +1 -1
- package/dist/editor/icons/step-forward.js +1 -1
- package/dist/editor/icons/still.js +1 -1
- package/dist/editor/icons/timeline.js +1 -1
- package/dist/editor/icons/timelineInOutPointer.js +2 -2
- package/dist/editor/state/folders.d.ts +11 -0
- package/dist/editor/state/folders.js +23 -0
- package/dist/editor/state/highest-z-index.js +2 -2
- package/dist/editor/state/keybindings.js +1 -1
- package/dist/editor/state/sidebar.d.ts +12 -0
- package/dist/editor/state/sidebar.js +40 -0
- package/dist/editor/state/z-index.js +1 -1
- package/dist/get-cli-options.d.ts +2 -1
- package/dist/get-cli-options.js +6 -2
- package/dist/index.d.ts +2 -1
- package/dist/index.js +5 -1
- package/dist/parse-command-line.js +3 -0
- package/dist/previewEntry.js +2 -2
- package/dist/print-error.js +1 -0
- package/dist/render.js +25 -24
- package/dist/still.js +45 -15
- package/dist/upgrade.js +1 -0
- package/package.json +8 -8
|
@@ -8,6 +8,7 @@ const checkerboard_1 = require("../state/checkerboard");
|
|
|
8
8
|
const modals_1 = require("../state/modals");
|
|
9
9
|
const preview_size_1 = require("../state/preview-size");
|
|
10
10
|
const rich_timeline_1 = require("../state/rich-timeline");
|
|
11
|
+
const sidebar_1 = require("../state/sidebar");
|
|
11
12
|
const timeline_ref_1 = require("../state/timeline-ref");
|
|
12
13
|
const layout_1 = require("./layout");
|
|
13
14
|
const MenuItem_1 = require("./Menu/MenuItem");
|
|
@@ -44,6 +45,7 @@ const MenuToolbar = () => {
|
|
|
44
45
|
const { checkerboard, setCheckerboard } = (0, react_1.useContext)(checkerboard_1.CheckerboardContext);
|
|
45
46
|
const { richTimeline, setRichTimeline } = (0, react_1.useContext)(rich_timeline_1.RichTimelineContext);
|
|
46
47
|
const { size, setSize } = (0, react_1.useContext)(preview_size_1.PreviewSizeContext);
|
|
48
|
+
const { setSidebarCollapsedState, sidebarCollapsedState } = (0, react_1.useContext)(sidebar_1.SidebarContext);
|
|
47
49
|
const itemClicked = (0, react_1.useCallback)((itemId) => {
|
|
48
50
|
setSelected(itemId);
|
|
49
51
|
}, [setSelected]);
|
|
@@ -59,7 +61,7 @@ const MenuToolbar = () => {
|
|
|
59
61
|
return [
|
|
60
62
|
{
|
|
61
63
|
id: 'remotion',
|
|
62
|
-
label: ((0, jsx_runtime_1.jsx)(layout_1.Row, { align: "center", justify: "center", children: (0, jsx_runtime_1.jsx)("svg", { width: ICON_SIZE, height: ICON_SIZE, viewBox: "-100 -100 400 400", style: rotate, children: (0, jsx_runtime_1.jsx)("path", { fill: "#fff", stroke: "#fff", strokeWidth: "100", strokeLinejoin: "round", d: "M 2 172 a 196 100 0 0 0 195 5 A 196 240 0 0 0 100 2.259 A 196 240 0 0 0 2 172 z" }
|
|
64
|
+
label: ((0, jsx_runtime_1.jsx)(layout_1.Row, { align: "center", justify: "center", children: (0, jsx_runtime_1.jsx)("svg", { width: ICON_SIZE, height: ICON_SIZE, viewBox: "-100 -100 400 400", style: rotate, children: (0, jsx_runtime_1.jsx)("path", { fill: "#fff", stroke: "#fff", strokeWidth: "100", strokeLinejoin: "round", d: "M 2 172 a 196 100 0 0 0 195 5 A 196 240 0 0 0 100 2.259 A 196 240 0 0 0 2 172 z" }) }) })),
|
|
63
65
|
leaveLeftPadding: false,
|
|
64
66
|
items: [
|
|
65
67
|
{
|
|
@@ -162,7 +164,7 @@ const MenuToolbar = () => {
|
|
|
162
164
|
id: String(newSize),
|
|
163
165
|
keyHint: null,
|
|
164
166
|
label: (0, SizeSelector_1.getPreviewSizeLabel)(newSize),
|
|
165
|
-
leftItem: String(newSize) === String(size) ? (0, jsx_runtime_1.jsx)(Checkmark_1.Checkmark, {}
|
|
167
|
+
leftItem: String(newSize) === String(size) ? (0, jsx_runtime_1.jsx)(Checkmark_1.Checkmark, {}) : null,
|
|
166
168
|
onClick: () => {
|
|
167
169
|
close();
|
|
168
170
|
setSize(() => newSize);
|
|
@@ -173,6 +175,65 @@ const MenuToolbar = () => {
|
|
|
173
175
|
})),
|
|
174
176
|
},
|
|
175
177
|
},
|
|
178
|
+
{
|
|
179
|
+
id: 'timeline-divider',
|
|
180
|
+
type: 'divider',
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
id: 'left-sidebar',
|
|
184
|
+
label: 'Sidebar',
|
|
185
|
+
keyHint: null,
|
|
186
|
+
type: 'item',
|
|
187
|
+
value: 'preview-size',
|
|
188
|
+
leftItem: null,
|
|
189
|
+
subMenu: {
|
|
190
|
+
leaveLeftSpace: true,
|
|
191
|
+
preselectIndex: 0,
|
|
192
|
+
items: [
|
|
193
|
+
{
|
|
194
|
+
id: 'sidebar-responsive',
|
|
195
|
+
keyHint: null,
|
|
196
|
+
label: 'Responsive',
|
|
197
|
+
leftItem: sidebarCollapsedState === 'responsive' ? ((0, jsx_runtime_1.jsx)(Checkmark_1.Checkmark, {})) : null,
|
|
198
|
+
onClick: () => {
|
|
199
|
+
setSidebarCollapsedState('responsive');
|
|
200
|
+
},
|
|
201
|
+
subMenu: null,
|
|
202
|
+
type: 'item',
|
|
203
|
+
value: 'responsive',
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
id: 'sidebar-expanded',
|
|
207
|
+
keyHint: null,
|
|
208
|
+
label: 'Expanded',
|
|
209
|
+
leftItem: sidebarCollapsedState === 'expanded' ? (0, jsx_runtime_1.jsx)(Checkmark_1.Checkmark, {}) : null,
|
|
210
|
+
onClick: () => {
|
|
211
|
+
setSidebarCollapsedState('expanded');
|
|
212
|
+
},
|
|
213
|
+
subMenu: null,
|
|
214
|
+
type: 'item',
|
|
215
|
+
value: 'expanded',
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
id: 'sidebar-collapsed',
|
|
219
|
+
keyHint: null,
|
|
220
|
+
label: 'Collapsed',
|
|
221
|
+
leftItem: sidebarCollapsedState === 'collapsed' ? ((0, jsx_runtime_1.jsx)(Checkmark_1.Checkmark, {})) : null,
|
|
222
|
+
onClick: () => {
|
|
223
|
+
setSidebarCollapsedState('collapsed');
|
|
224
|
+
},
|
|
225
|
+
subMenu: null,
|
|
226
|
+
type: 'item',
|
|
227
|
+
value: 'collapsed',
|
|
228
|
+
},
|
|
229
|
+
],
|
|
230
|
+
},
|
|
231
|
+
onClick: () => undefined,
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
id: 'timeline-divider',
|
|
235
|
+
type: 'divider',
|
|
236
|
+
},
|
|
176
237
|
{
|
|
177
238
|
id: 'checkerboard',
|
|
178
239
|
keyHint: 'T',
|
|
@@ -183,7 +244,7 @@ const MenuToolbar = () => {
|
|
|
183
244
|
},
|
|
184
245
|
type: 'item',
|
|
185
246
|
value: 'checkerboard',
|
|
186
|
-
leftItem: checkerboard ? (0, jsx_runtime_1.jsx)(Checkmark_1.Checkmark, {}
|
|
247
|
+
leftItem: checkerboard ? (0, jsx_runtime_1.jsx)(Checkmark_1.Checkmark, {}) : null,
|
|
187
248
|
subMenu: null,
|
|
188
249
|
},
|
|
189
250
|
{
|
|
@@ -200,7 +261,7 @@ const MenuToolbar = () => {
|
|
|
200
261
|
},
|
|
201
262
|
type: 'item',
|
|
202
263
|
value: 'rich-timeline',
|
|
203
|
-
leftItem: richTimeline ? (0, jsx_runtime_1.jsx)(Checkmark_1.Checkmark, {}
|
|
264
|
+
leftItem: richTimeline ? (0, jsx_runtime_1.jsx)(Checkmark_1.Checkmark, {}) : null,
|
|
204
265
|
subMenu: null,
|
|
205
266
|
},
|
|
206
267
|
{
|
|
@@ -391,7 +452,9 @@ const MenuToolbar = () => {
|
|
|
391
452
|
setCheckerboard,
|
|
392
453
|
setRichTimeline,
|
|
393
454
|
setSelectedModal,
|
|
455
|
+
setSidebarCollapsedState,
|
|
394
456
|
setSize,
|
|
457
|
+
sidebarCollapsedState,
|
|
395
458
|
size,
|
|
396
459
|
]);
|
|
397
460
|
const menus = (0, react_1.useMemo)(() => {
|
|
@@ -421,6 +484,6 @@ const MenuToolbar = () => {
|
|
|
421
484
|
}, [setSelected]);
|
|
422
485
|
return ((0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", className: "css-reset", style: row, children: [structure.map((s) => {
|
|
423
486
|
return ((0, jsx_runtime_1.jsx)(MenuItem_1.MenuItem, { selected: selected === s.id, onItemSelected: itemClicked, onItemHovered: itemHovered, id: s.id, label: s.label, onItemQuit: onItemQuit, menu: s, onPreviousMenu: onPreviousMenu, onNextMenu: onNextMenu, leaveLeftPadding: s.leaveLeftPadding }, s.id));
|
|
424
|
-
}), (0, jsx_runtime_1.jsx)(UpdateCheck_1.UpdateCheck, {}
|
|
487
|
+
}), (0, jsx_runtime_1.jsx)(UpdateCheck_1.UpdateCheck, {}), (0, jsx_runtime_1.jsx)("div", { style: flex }), (0, jsx_runtime_1.jsx)("div", { style: cwd, title: window.remotion_cwd, children: window.remotion_projectName })] }));
|
|
425
488
|
};
|
|
426
489
|
exports.MenuToolbar = MenuToolbar;
|
|
@@ -20,6 +20,6 @@ const panel = {
|
|
|
20
20
|
color: 'white',
|
|
21
21
|
};
|
|
22
22
|
const ModalContainer = ({ children, onEscape, onOutsideClick }) => {
|
|
23
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: "css-reset", style: backgroundOverlay, role: "dialog", "aria-modal": "true", children: (0, jsx_runtime_1.jsx)(z_index_1.HigherZIndex, { onOutsideClick: onOutsideClick, onEscape: onEscape, children: (0, jsx_runtime_1.jsx)("div", { style: panel, children: children }
|
|
23
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: "css-reset", style: backgroundOverlay, role: "dialog", "aria-modal": "true", children: (0, jsx_runtime_1.jsx)(z_index_1.HigherZIndex, { onOutsideClick: onOutsideClick, onEscape: onEscape, children: (0, jsx_runtime_1.jsx)("div", { style: panel, children: children }) }) }));
|
|
24
24
|
};
|
|
25
25
|
exports.ModalContainer = ModalContainer;
|
|
@@ -23,6 +23,6 @@ const NewCompHeader = ({ title }) => {
|
|
|
23
23
|
const onPress = (0, react_1.useCallback)(() => {
|
|
24
24
|
setSelectedModal(null);
|
|
25
25
|
}, [setSelectedModal]);
|
|
26
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: container, children: [(0, jsx_runtime_1.jsx)("div", { children: title }
|
|
26
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: container, children: [(0, jsx_runtime_1.jsx)("div", { children: title }), (0, jsx_runtime_1.jsx)(layout_1.Flex, {}), (0, jsx_runtime_1.jsx)(CancelButton_1.CancelButton, { style: icon, onPress: onPress })] }));
|
|
27
27
|
};
|
|
28
28
|
exports.NewCompHeader = NewCompHeader;
|
|
@@ -19,6 +19,6 @@ const MuteToggle = ({ muted, setMuted }) => {
|
|
|
19
19
|
if (isStill) {
|
|
20
20
|
return null;
|
|
21
21
|
}
|
|
22
|
-
return ((0, jsx_runtime_1.jsx)(ControlButton_1.ControlButton, { title: accessibilityLabel, "aria-label": accessibilityLabel, onClick: onClick, children: muted ? (0, jsx_runtime_1.jsx)(media_volume_1.VolumeOffIcon, {}
|
|
22
|
+
return ((0, jsx_runtime_1.jsx)(ControlButton_1.ControlButton, { title: accessibilityLabel, "aria-label": accessibilityLabel, onClick: onClick, children: muted ? (0, jsx_runtime_1.jsx)(media_volume_1.VolumeOffIcon, {}) : (0, jsx_runtime_1.jsx)(media_volume_1.VolumeOnIcon, {}) }));
|
|
23
23
|
};
|
|
24
24
|
exports.MuteToggle = MuteToggle;
|
|
@@ -12,6 +12,6 @@ const style = {
|
|
|
12
12
|
};
|
|
13
13
|
const CancelButton = ({ onPress, ...props }) => {
|
|
14
14
|
const { tabIndex } = (0, z_index_1.useZIndex)();
|
|
15
|
-
return ((0, jsx_runtime_1.jsx)("button", { tabIndex: tabIndex, style: style, type: "button", onClick: onPress, children: (0, jsx_runtime_1.jsx)("svg", { viewBox: "0 0 320 512", ...props, children: (0, jsx_runtime_1.jsx)("path", { fill: "currentColor", d: "M207.6 256l107.72-107.72c6.23-6.23 6.23-16.34 0-22.58l-25.03-25.03c-6.23-6.23-16.34-6.23-22.58 0L160 208.4 52.28 100.68c-6.23-6.23-16.34-6.23-22.58 0L4.68 125.7c-6.23 6.23-6.23 16.34 0 22.58L112.4 256 4.68 363.72c-6.23 6.23-6.23 16.34 0 22.58l25.03 25.03c6.23 6.23 16.34 6.23 22.58 0L160 303.6l107.72 107.72c6.23 6.23 16.34 6.23 22.58 0l25.03-25.03c6.23-6.23 6.23-16.34 0-22.58L207.6 256z" }
|
|
15
|
+
return ((0, jsx_runtime_1.jsx)("button", { tabIndex: tabIndex, style: style, type: "button", onClick: onPress, children: (0, jsx_runtime_1.jsx)("svg", { viewBox: "0 0 320 512", ...props, children: (0, jsx_runtime_1.jsx)("path", { fill: "currentColor", d: "M207.6 256l107.72-107.72c6.23-6.23 6.23-16.34 0-22.58l-25.03-25.03c-6.23-6.23-16.34-6.23-22.58 0L160 208.4 52.28 100.68c-6.23-6.23-16.34-6.23-22.58 0L4.68 125.7c-6.23 6.23-6.23 16.34 0 22.58L112.4 256 4.68 363.72c-6.23 6.23-6.23 16.34 0 22.58l25.03 25.03c6.23 6.23 16.34 6.23 22.58 0L160 303.6l107.72 107.72c6.23 6.23 16.34 6.23 22.58 0l25.03-25.03c6.23-6.23 6.23-16.34 0-22.58L207.6 256z" }) }) }));
|
|
16
16
|
};
|
|
17
17
|
exports.CancelButton = CancelButton;
|
|
@@ -83,8 +83,8 @@ const Combobox = ({ values, selectedId, style: customStyle, title }) => {
|
|
|
83
83
|
: colors_1.INPUT_BORDER_COLOR_UNHOVERED,
|
|
84
84
|
};
|
|
85
85
|
}, [customStyle, hovered, opened]);
|
|
86
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("button", { ref: ref, title: title, tabIndex: tabIndex, type: "button", style: style, children: [selected.label, " ", (0, jsx_runtime_1.jsx)(layout_1.Flex, {}
|
|
87
|
-
? react_dom_1.default.createPortal((0, jsx_runtime_1.jsx)("div", { style: styles_1.outerPortal, className: "css-reset", children: (0, jsx_runtime_1.jsx)(z_index_1.HigherZIndex, { onOutsideClick: onHide, onEscape: onHide, children: (0, jsx_runtime_1.jsx)("div", { style: portalStyle, children: (0, jsx_runtime_1.jsx)(MenuContent_1.MenuContent, { onNextMenu: noop_1.noop, onPreviousMenu: noop_1.noop, values: values, onHide: onHide, leaveLeftSpace: true, preselectIndex: values.findIndex((v) => v.id === selected.id), topItemCanBeUnselected: false }
|
|
88
|
-
: null] }
|
|
86
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("button", { ref: ref, title: title, tabIndex: tabIndex, type: "button", style: style, children: [selected.label, " ", (0, jsx_runtime_1.jsx)(layout_1.Flex, {}), " ", (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1 }), " ", (0, jsx_runtime_1.jsx)(caret_1.CaretDown, {})] }), portalStyle
|
|
87
|
+
? react_dom_1.default.createPortal((0, jsx_runtime_1.jsx)("div", { style: styles_1.outerPortal, className: "css-reset", children: (0, jsx_runtime_1.jsx)(z_index_1.HigherZIndex, { onOutsideClick: onHide, onEscape: onHide, children: (0, jsx_runtime_1.jsx)("div", { style: portalStyle, children: (0, jsx_runtime_1.jsx)(MenuContent_1.MenuContent, { onNextMenu: noop_1.noop, onPreviousMenu: noop_1.noop, values: values, onHide: onHide, leaveLeftSpace: true, preselectIndex: values.findIndex((v) => v.id === selected.id), topItemCanBeUnselected: false }) }) }) }), (0, portals_1.getPortal)(currentZIndex))
|
|
88
|
+
: null] }));
|
|
89
89
|
};
|
|
90
90
|
exports.Combobox = Combobox;
|
|
@@ -24,6 +24,6 @@ const CopyHint = () => {
|
|
|
24
24
|
if (!projectInfo || !projectInfo.videoFile) {
|
|
25
25
|
return null;
|
|
26
26
|
}
|
|
27
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: style, children: ["Copy this into ", (0, jsx_runtime_1.jsx)("br", {}
|
|
27
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: style, children: ["Copy this into ", (0, jsx_runtime_1.jsx)("br", {}), " your", ' ', (0, jsx_runtime_1.jsx)("span", { style: style, title: projectInfo.videoFile, children: projectInfo.relativeVideoFile }), ' ', "file."] }));
|
|
28
28
|
};
|
|
29
29
|
exports.CopyHint = CopyHint;
|
|
@@ -75,8 +75,8 @@ const InputDragger = ({ onValueChange, min: _min, step: _step, value, ...props }
|
|
|
75
75
|
}
|
|
76
76
|
}, [inputFallback]);
|
|
77
77
|
if (inputFallback) {
|
|
78
|
-
return ((0, jsx_runtime_1.jsx)(z_index_1.HigherZIndex, { onEscape: onBlur, onOutsideClick: noop_1.noop, children: (0, jsx_runtime_1.jsx)(RemInput_1.RemotionInput, { ref: fallbackRef, autoFocus: true, onKeyPress: onKeyPress, onBlur: onBlur, value: value, min: _min, step: _step, ...props }
|
|
78
|
+
return ((0, jsx_runtime_1.jsx)(z_index_1.HigherZIndex, { onEscape: onBlur, onOutsideClick: noop_1.noop, children: (0, jsx_runtime_1.jsx)(RemInput_1.RemotionInput, { ref: fallbackRef, autoFocus: true, onKeyPress: onKeyPress, onBlur: onBlur, value: value, min: _min, step: _step, ...props }) }));
|
|
79
79
|
}
|
|
80
|
-
return ((0, jsx_runtime_1.jsx)("button", { type: "button", style: style, onClick: onClick, onPointerDown: onPointerDown, children: (0, jsx_runtime_1.jsx)("span", { style: span, children: value }
|
|
80
|
+
return ((0, jsx_runtime_1.jsx)("button", { type: "button", style: style, onClick: onClick, onPointerDown: onPointerDown, children: (0, jsx_runtime_1.jsx)("span", { style: span, children: value }) }));
|
|
81
81
|
};
|
|
82
82
|
exports.InputDragger = InputDragger;
|
|
@@ -167,6 +167,6 @@ const MenuContent = ({ onHide, values, preselectIndex, onNextMenu, onPreviousMen
|
|
|
167
167
|
item.onClick(item.id);
|
|
168
168
|
};
|
|
169
169
|
return ((0, jsx_runtime_1.jsx)(MenuSubItem_1.MenuSubItem, { selected: item.id === selectedItem, onActionChosen: onClick, onItemSelected: onItemSelected, label: item.label, id: item.id, keyHint: item.keyHint, leaveLeftSpace: leaveLeftSpace, leftItem: item.leftItem, subMenu: item.subMenu, onQuitMenu: onHide, onNextMenu: onNextMenu, subMenuActivated: subMenuActivated, setSubMenuActivated: setSubMenuActivated }, item.id));
|
|
170
|
-
}) }
|
|
170
|
+
}) }));
|
|
171
171
|
};
|
|
172
172
|
exports.MenuContent = MenuContent;
|
|
@@ -15,6 +15,6 @@ const container = {
|
|
|
15
15
|
};
|
|
16
16
|
const NewCompAspectRatio = ({ width, height, aspectRatioLocked, setAspectRatioLocked }) => {
|
|
17
17
|
const pixels = Number(width) * Number(height);
|
|
18
|
-
return ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsxs)("div", { style: container, children: [(0, jsx_runtime_1.jsx)("svg", { width: GUIDE_WIDTH, height: GUIDE_HEIGHT, children: (0, jsx_runtime_1.jsx)("path", { d: `M 0 0 L ${GUIDE_WIDTH} 0 L ${GUIDE_WIDTH} ${GUIDE_HEIGHT} L 0 ${GUIDE_HEIGHT}`, fill: "transparent", strokeWidth: "2", stroke: "rgba(255, 255, 255, 0.2)" }
|
|
18
|
+
return ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsxs)("div", { style: container, children: [(0, jsx_runtime_1.jsx)("svg", { width: GUIDE_WIDTH, height: GUIDE_HEIGHT, children: (0, jsx_runtime_1.jsx)("path", { d: `M 0 0 L ${GUIDE_WIDTH} 0 L ${GUIDE_WIDTH} ${GUIDE_HEIGHT} L 0 ${GUIDE_HEIGHT}`, fill: "transparent", strokeWidth: "2", stroke: "rgba(255, 255, 255, 0.2)" }) }), (0, jsx_runtime_1.jsx)(ToggleAspectRatio_1.ToggleAspectRatio, { aspectRatioLocked: Boolean(aspectRatioLocked), setAspectRatioLocked: setAspectRatioLocked }), pixels > 0 ? ((0, jsx_runtime_1.jsxs)("div", { style: new_comp_layout_1.rightLabel, children: ["Aspect ratio ", (0, render_aspect_ratio_1.aspectRatio)(Number(width), Number(height))] })) : null] }) }));
|
|
19
19
|
};
|
|
20
20
|
exports.NewCompAspectRatio = NewCompAspectRatio;
|
|
@@ -16,6 +16,6 @@ const NewCompDuration = ({ durationInFrames, setDurationInFrames, fps }) => {
|
|
|
16
16
|
setDurationInFrames(String(newVal));
|
|
17
17
|
}, [setDurationInFrames]);
|
|
18
18
|
const compDurationErrMessage = (0, validate_new_comp_data_1.validateCompositionDuration)(durationInFrames);
|
|
19
|
-
return ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("label", { children: (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: new_comp_layout_1.leftLabel, children: " Duration in frames" }
|
|
19
|
+
return ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("label", { children: (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: new_comp_layout_1.leftLabel, children: " Duration in frames" }), (0, jsx_runtime_1.jsxs)("div", { style: new_comp_layout_1.inputArea, children: [(0, jsx_runtime_1.jsx)(InputDragger_1.InputDragger, { type: "number", value: durationInFrames, onChange: onDurationInFramesChanged, placeholder: "Duration (frames)", name: "durationInFrames", min: 1, step: 1, max: 100000000, onValueChange: onDurationChangedDirectly }), compDurationErrMessage ? ((0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { message: compDurationErrMessage })) : null] }), (0, jsx_runtime_1.jsxs)("span", { style: new_comp_layout_1.rightLabel, children: [(Number(durationInFrames) / Number(fps)).toFixed(2), "sec"] })] }) }) }));
|
|
20
20
|
};
|
|
21
21
|
exports.NewCompDuration = NewCompDuration;
|
|
@@ -145,7 +145,7 @@ const NewComposition = (props) => {
|
|
|
145
145
|
type: 'item',
|
|
146
146
|
value: frameRate,
|
|
147
147
|
keyHint: null,
|
|
148
|
-
leftItem: String(frameRate) === selectedFrameRate ? (0, jsx_runtime_1.jsx)(Checkmark_1.Checkmark, {}
|
|
148
|
+
leftItem: String(frameRate) === selectedFrameRate ? (0, jsx_runtime_1.jsx)(Checkmark_1.Checkmark, {}) : null,
|
|
149
149
|
subMenu: null,
|
|
150
150
|
};
|
|
151
151
|
});
|
|
@@ -177,7 +177,7 @@ const NewComposition = (props) => {
|
|
|
177
177
|
},
|
|
178
178
|
];
|
|
179
179
|
}, [onTypeChanged]);
|
|
180
|
-
return ((0, jsx_runtime_1.jsxs)(ModalContainer_1.ModalContainer, { onOutsideClick: onQuit, onEscape: onQuit, children: [(0, jsx_runtime_1.jsx)(ModalHeader_1.NewCompHeader, { title: "New composition" }
|
|
180
|
+
return ((0, jsx_runtime_1.jsxs)(ModalContainer_1.ModalContainer, { onOutsideClick: onQuit, onEscape: onQuit, children: [(0, jsx_runtime_1.jsx)(ModalHeader_1.NewCompHeader, { title: "New composition" }), (0, jsx_runtime_1.jsxs)("div", { style: panelContent, children: [(0, jsx_runtime_1.jsxs)("div", { style: left, children: [(0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 3 }), (0, jsx_runtime_1.jsxs)("form", { children: [(0, jsx_runtime_1.jsxs)("label", { children: [(0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: new_comp_layout_1.leftLabel, children: "Type" }), (0, jsx_runtime_1.jsx)("div", { style: new_comp_layout_1.inputArea, children: (0, jsx_runtime_1.jsx)(ComboBox_1.Combobox, { title: "Type of composition", style: comboBoxStyle, values: typeValues, selectedId: type }) })] }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1 }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: new_comp_layout_1.leftLabel, children: "Name" }), (0, jsx_runtime_1.jsxs)("div", { style: new_comp_layout_1.inputArea, children: [(0, jsx_runtime_1.jsx)(RemInput_1.RemotionInput, { value: name, onChange: onNameChange, type: "text", placeholder: "Composition name" }), compNameErrMessage ? ((0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { message: compNameErrMessage })) : null] })] })] }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1 }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("label", { children: (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: new_comp_layout_1.leftLabel, children: "Width" }), (0, jsx_runtime_1.jsxs)("div", { style: new_comp_layout_1.inputArea, children: [(0, jsx_runtime_1.jsx)(InputDragger_1.InputDragger, { type: "number", value: size.width, placeholder: "Width (px)", onChange: onWidthChanged, name: "width", step: 2, min: 2, max: 100000000, onValueChange: onWidthDirectlyChanged }), compWidthErrMessage ? ((0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { message: compWidthErrMessage })) : null] })] }) }) }), (0, jsx_runtime_1.jsx)("div", {}), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1 }), (0, jsx_runtime_1.jsx)("div", {}), (0, jsx_runtime_1.jsx)("label", { children: (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: new_comp_layout_1.leftLabel, children: "Height" }), (0, jsx_runtime_1.jsxs)("div", { style: new_comp_layout_1.inputArea, children: [(0, jsx_runtime_1.jsx)(InputDragger_1.InputDragger, { type: "number", value: size.height, onChange: onHeightChanged, placeholder: "Height (px)", name: "height", step: 2, min: 2, max: 100000000, onValueChange: onHeightDirectlyChanged }), compHeightErrMessage ? ((0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { message: compHeightErrMessage })) : null] })] }) })] }), (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(NewCompAspectRatio_1.NewCompAspectRatio, { width: Number(size.width), height: Number(size.height), aspectRatioLocked: lockedAspectRatio, setAspectRatioLocked: setAspectRatioLocked }) })] }), (0, jsx_runtime_1.jsx)("div", {}), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1 }), type === 'composition' ? ((0, jsx_runtime_1.jsx)(NewCompDuration_1.NewCompDuration, { durationInFrames: durationInFrames, fps: selectedFrameRate, setDurationInFrames: setDurationInFrames })) : null, (0, jsx_runtime_1.jsx)("div", {}), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)("div", {}), type === 'composition' ? ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", {}), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1 }), (0, jsx_runtime_1.jsxs)("label", { children: [(0, jsx_runtime_1.jsx)("div", { style: new_comp_layout_1.leftLabel, children: "Framerate" }), (0, jsx_runtime_1.jsx)(ComboBox_1.Combobox, { title: "Framerate", style: comboBoxStyle, values: items, selectedId: selectedFrameRate })] })] })) : null] })] }), (0, jsx_runtime_1.jsxs)("div", { style: panelRight, children: [(0, jsx_runtime_1.jsx)("pre", { style: pre, children: (0, NewCompCode_1.getNewCompositionCode)({
|
|
181
181
|
type,
|
|
182
182
|
durationInFrames: Number(durationInFrames),
|
|
183
183
|
fps: Number(selectedFrameRate),
|
|
@@ -185,7 +185,7 @@ const NewComposition = (props) => {
|
|
|
185
185
|
width: Number(size.width),
|
|
186
186
|
name,
|
|
187
187
|
raw: false,
|
|
188
|
-
}) }
|
|
188
|
+
}) }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", style: copyRowStyle, children: [(0, jsx_runtime_1.jsx)(CopyHint_1.CopyHint, {}), (0, jsx_runtime_1.jsx)(layout_1.Flex, {}), (0, jsx_runtime_1.jsx)(CopyButton_1.CopyButton, { label: "Copy code", labelWhenCopied: "Copied!", textToCopy: (0, NewCompCode_1.getNewCompositionCode)({
|
|
189
189
|
type,
|
|
190
190
|
durationInFrames: Number(durationInFrames),
|
|
191
191
|
fps: Number(selectedFrameRate),
|
|
@@ -193,6 +193,6 @@ const NewComposition = (props) => {
|
|
|
193
193
|
width: Number(size.width),
|
|
194
194
|
name,
|
|
195
195
|
raw: true,
|
|
196
|
-
}) }
|
|
196
|
+
}) })] })] })] })] }));
|
|
197
197
|
};
|
|
198
198
|
exports.default = NewComposition;
|
|
@@ -54,6 +54,6 @@ const RemInputForwardRef = (props, ref) => {
|
|
|
54
54
|
current.removeEventListener('mouseleave', onMouseLeave);
|
|
55
55
|
};
|
|
56
56
|
}, [inputRef]);
|
|
57
|
-
return (0, jsx_runtime_1.jsx)("input", { ref: inputRef, tabIndex: tabIndex, ...props, style: style }
|
|
57
|
+
return (0, jsx_runtime_1.jsx)("input", { ref: inputRef, tabIndex: tabIndex, ...props, style: style });
|
|
58
58
|
};
|
|
59
59
|
exports.RemotionInput = (0, react_1.forwardRef)(RemInputForwardRef);
|
|
@@ -21,6 +21,6 @@ const ToggleAspectRatio = ({ aspectRatioLocked, setAspectRatioLocked }) => {
|
|
|
21
21
|
const onClick = (0, react_1.useCallback)(() => {
|
|
22
22
|
setAspectRatioLocked(!aspectRatioLocked);
|
|
23
23
|
}, [aspectRatioLocked, setAspectRatioLocked]);
|
|
24
|
-
return ((0, jsx_runtime_1.jsx)("button", { type: "button", onClick: onClick, style: buttonStyle, children: aspectRatioLocked ? ((0, jsx_runtime_1.jsx)(lock_1.LockIcon, { style: iconStyle }
|
|
24
|
+
return ((0, jsx_runtime_1.jsx)("button", { type: "button", onClick: onClick, style: buttonStyle, children: aspectRatioLocked ? ((0, jsx_runtime_1.jsx)(lock_1.LockIcon, { style: iconStyle })) : ((0, jsx_runtime_1.jsx)(lock_1.UnlockIcon, { style: iconStyle })) }));
|
|
25
25
|
};
|
|
26
26
|
exports.ToggleAspectRatio = ToggleAspectRatio;
|
|
@@ -4,7 +4,7 @@ exports.ValidationMessage = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const layout_1 = require("../layout");
|
|
6
6
|
const Triangle = (props) => {
|
|
7
|
-
return ((0, jsx_runtime_1.jsx)("svg", { viewBox: "0 0 576 512", ...props, children: (0, jsx_runtime_1.jsx)("path", { fill: "currentColor", d: "M248.747 204.705l6.588 112c.373 6.343 5.626 11.295 11.979 11.295h41.37a12 12 0 0 0 11.979-11.295l6.588-112c.405-6.893-5.075-12.705-11.979-12.705h-54.547c-6.903 0-12.383 5.812-11.978 12.705zM330 384c0 23.196-18.804 42-42 42s-42-18.804-42-42 18.804-42 42-42 42 18.804 42 42zm-.423-360.015c-18.433-31.951-64.687-32.009-83.154 0L6.477 440.013C-11.945 471.946 11.118 512 48.054 512H527.94c36.865 0 60.035-39.993 41.577-71.987L329.577 23.985zM53.191 455.002L282.803 57.008c2.309-4.002 8.085-4.002 10.394 0l229.612 397.993c2.308 4-.579 8.998-5.197 8.998H58.388c-4.617.001-7.504-4.997-5.197-8.997z" }
|
|
7
|
+
return ((0, jsx_runtime_1.jsx)("svg", { viewBox: "0 0 576 512", ...props, children: (0, jsx_runtime_1.jsx)("path", { fill: "currentColor", d: "M248.747 204.705l6.588 112c.373 6.343 5.626 11.295 11.979 11.295h41.37a12 12 0 0 0 11.979-11.295l6.588-112c.405-6.893-5.075-12.705-11.979-12.705h-54.547c-6.903 0-12.383 5.812-11.978 12.705zM330 384c0 23.196-18.804 42-42 42s-42-18.804-42-42 18.804-42 42-42 42 18.804 42 42zm-.423-360.015c-18.433-31.951-64.687-32.009-83.154 0L6.477 440.013C-11.945 471.946 11.118 512 48.054 512H527.94c36.865 0 60.035-39.993 41.577-71.987L329.577 23.985zM53.191 455.002L282.803 57.008c2.309-4.002 8.085-4.002 10.394 0l229.612 397.993c2.308 4-.579 8.998-5.197 8.998H58.388c-4.617.001-7.504-4.997-5.197-8.997z" }) }));
|
|
8
8
|
};
|
|
9
9
|
const style = {
|
|
10
10
|
width: 11,
|
|
@@ -18,6 +18,6 @@ const label = {
|
|
|
18
18
|
flex: 1,
|
|
19
19
|
};
|
|
20
20
|
const ValidationMessage = ({ message }) => {
|
|
21
|
-
return ((0, jsx_runtime_1.jsx)("div", { style: container, children: (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)(Triangle, { style: style, color: "#f1c40f" }
|
|
21
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: container, children: (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)(Triangle, { style: style, color: "#f1c40f" }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1 }), (0, jsx_runtime_1.jsx)("div", { style: label, children: message })] }) }));
|
|
22
22
|
};
|
|
23
23
|
exports.ValidationMessage = ValidationMessage;
|
|
@@ -7,6 +7,7 @@ const react_1 = require("react");
|
|
|
7
7
|
const remotion_1 = require("remotion");
|
|
8
8
|
const is_current_selected_still_1 = require("../helpers/is-current-selected-still");
|
|
9
9
|
const use_keybinding_1 = require("../helpers/use-keybinding");
|
|
10
|
+
const jump_to_start_1 = require("../icons/jump-to-start");
|
|
10
11
|
const pause_1 = require("../icons/pause");
|
|
11
12
|
const play_1 = require("../icons/play");
|
|
12
13
|
const step_back_1 = require("../icons/step-back");
|
|
@@ -14,7 +15,6 @@ const step_forward_1 = require("../icons/step-forward");
|
|
|
14
15
|
const ControlButton_1 = require("./ControlButton");
|
|
15
16
|
const forwardBackStyle = {
|
|
16
17
|
height: 16,
|
|
17
|
-
width: 16,
|
|
18
18
|
color: 'white',
|
|
19
19
|
};
|
|
20
20
|
const PlayPause = ({ playbackRate, loop }) => {
|
|
@@ -25,7 +25,7 @@ const PlayPause = ({ playbackRate, loop }) => {
|
|
|
25
25
|
loop,
|
|
26
26
|
playbackRate,
|
|
27
27
|
});
|
|
28
|
-
const { playing, play, pause, frameBack, frameForward, isLastFrame } = player_1.PlayerInternals.usePlayer();
|
|
28
|
+
const { playing, play, pause, frameBack, seek, frameForward, isLastFrame } = player_1.PlayerInternals.usePlayer();
|
|
29
29
|
const isStill = (0, is_current_selected_still_1.useIsStill)();
|
|
30
30
|
(0, react_1.useEffect)(() => {
|
|
31
31
|
if (isStill) {
|
|
@@ -46,44 +46,73 @@ const PlayPause = ({ playbackRate, loop }) => {
|
|
|
46
46
|
if (!videoFps) {
|
|
47
47
|
return null;
|
|
48
48
|
}
|
|
49
|
-
frameBack(e.shiftKey ? videoFps : 1);
|
|
50
49
|
e.preventDefault();
|
|
51
|
-
|
|
50
|
+
if (e.altKey) {
|
|
51
|
+
seek(0);
|
|
52
|
+
}
|
|
53
|
+
else if (e.shiftKey) {
|
|
54
|
+
frameBack(videoFps);
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
frameBack(1);
|
|
58
|
+
}
|
|
59
|
+
}, [frameBack, seek, videoFps]);
|
|
52
60
|
const onArrowRight = (0, react_1.useCallback)((e) => {
|
|
53
|
-
if (!
|
|
61
|
+
if (!video) {
|
|
54
62
|
return null;
|
|
55
63
|
}
|
|
56
|
-
|
|
64
|
+
if (e.altKey) {
|
|
65
|
+
seek(video.durationInFrames - 1);
|
|
66
|
+
}
|
|
67
|
+
else if (e.shiftKey) {
|
|
68
|
+
frameForward(video.fps);
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
frameForward(1);
|
|
72
|
+
}
|
|
57
73
|
e.preventDefault();
|
|
58
|
-
}, [frameForward,
|
|
74
|
+
}, [frameForward, seek, video]);
|
|
59
75
|
const oneFrameBack = (0, react_1.useCallback)(() => {
|
|
60
76
|
frameBack(1);
|
|
61
77
|
}, [frameBack]);
|
|
62
78
|
const oneFrameForward = (0, react_1.useCallback)(() => {
|
|
63
79
|
frameForward(1);
|
|
64
80
|
}, [frameForward]);
|
|
81
|
+
const jumpToStart = (0, react_1.useCallback)(() => {
|
|
82
|
+
seek(0);
|
|
83
|
+
}, [seek]);
|
|
84
|
+
const jumpToEnd = (0, react_1.useCallback)(() => {
|
|
85
|
+
if (!video) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
seek(video.durationInFrames - 1);
|
|
89
|
+
}, [seek, video]);
|
|
65
90
|
const keybindings = (0, use_keybinding_1.useKeybinding)();
|
|
66
91
|
(0, react_1.useEffect)(() => {
|
|
67
92
|
const arrowLeft = keybindings.registerKeybinding('keydown', 'ArrowLeft', onArrowLeft);
|
|
68
93
|
const arrowRight = keybindings.registerKeybinding('keydown', 'ArrowRight', onArrowRight);
|
|
69
94
|
const space = keybindings.registerKeybinding('keydown', ' ', onSpace);
|
|
95
|
+
const a = keybindings.registerKeybinding('keydown', 'a', jumpToStart);
|
|
96
|
+
const e = keybindings.registerKeybinding('keydown', 'e', jumpToEnd);
|
|
70
97
|
return () => {
|
|
71
98
|
arrowLeft.unregister();
|
|
72
99
|
arrowRight.unregister();
|
|
73
100
|
space.unregister();
|
|
101
|
+
a.unregister();
|
|
102
|
+
e.unregister();
|
|
74
103
|
};
|
|
75
|
-
}, [keybindings, onArrowLeft, onArrowRight, onSpace]);
|
|
104
|
+
}, [jumpToEnd, jumpToStart, keybindings, onArrowLeft, onArrowRight, onSpace]);
|
|
76
105
|
if (isStill) {
|
|
77
106
|
return null;
|
|
78
107
|
}
|
|
79
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ControlButton_1.ControlButton, { "aria-label": "Step back one frame", title: "Step back one frame", disabled: frame === 0, onClick: oneFrameBack, children: (0, jsx_runtime_1.jsx)(step_back_1.StepBack, { style: forwardBackStyle }
|
|
108
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ControlButton_1.ControlButton, { "aria-label": "Jump to beginning", title: "Jump to beginning", disabled: frame === 0, onClick: jumpToStart, children: (0, jsx_runtime_1.jsx)(jump_to_start_1.JumpToStart, { style: forwardBackStyle }) }), (0, jsx_runtime_1.jsx)(ControlButton_1.ControlButton, { "aria-label": "Step back one frame", title: "Step back one frame", disabled: frame === 0, onClick: oneFrameBack, children: (0, jsx_runtime_1.jsx)(step_back_1.StepBack, { style: forwardBackStyle }) }), (0, jsx_runtime_1.jsx)(ControlButton_1.ControlButton, { "aria-label": playing ? 'Pause' : 'Play', title: playing ? 'Pause' : 'Play', disabled: !video, onClick: playing ? pause : play, children: playing ? ((0, jsx_runtime_1.jsx)(pause_1.Pause, { style: {
|
|
80
109
|
height: 14,
|
|
81
110
|
width: 14,
|
|
82
111
|
color: 'white',
|
|
83
|
-
} }
|
|
112
|
+
} })) : ((0, jsx_runtime_1.jsx)(play_1.Play, { style: {
|
|
84
113
|
height: 14,
|
|
85
114
|
width: 14,
|
|
86
115
|
color: 'white',
|
|
87
|
-
} }
|
|
116
|
+
} })) }), (0, jsx_runtime_1.jsx)(ControlButton_1.ControlButton, { "aria-label": "Step forward one frame", title: "Step forward one frame", disabled: isLastFrame, onClick: oneFrameForward, children: (0, jsx_runtime_1.jsx)(step_forward_1.StepForward, { style: forwardBackStyle }) })] }));
|
|
88
117
|
};
|
|
89
118
|
exports.PlayPause = PlayPause;
|
|
@@ -40,13 +40,13 @@ const PlaybackRateSelector = ({ playbackRate, setPlaybackRate }) => {
|
|
|
40
40
|
type: 'item',
|
|
41
41
|
value: newPlaybackRate,
|
|
42
42
|
keyHint: null,
|
|
43
|
-
leftItem: String(playbackRate) === String(newPlaybackRate) ? ((0, jsx_runtime_1.jsx)(Checkmark_1.Checkmark, {}
|
|
43
|
+
leftItem: String(playbackRate) === String(newPlaybackRate) ? ((0, jsx_runtime_1.jsx)(Checkmark_1.Checkmark, {})) : null,
|
|
44
44
|
subMenu: null,
|
|
45
45
|
};
|
|
46
46
|
});
|
|
47
47
|
const middle = Math.floor(exports.commonPlaybackRates.length / 2);
|
|
48
48
|
return [...values.slice(0, middle), divider, ...values.slice(middle)];
|
|
49
49
|
}, [playbackRate, setPlaybackRate]);
|
|
50
|
-
return ((0, jsx_runtime_1.jsx)("div", { style: style, "aria-label": accessibilityLabel, children: (0, jsx_runtime_1.jsx)(ComboBox_1.Combobox, { title: accessibilityLabel, style: comboStyle, selectedId: String(playbackRate), values: items }
|
|
50
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: style, "aria-label": accessibilityLabel, children: (0, jsx_runtime_1.jsx)(ComboBox_1.Combobox, { title: accessibilityLabel, style: comboStyle, selectedId: String(playbackRate), values: items }) }));
|
|
51
51
|
};
|
|
52
52
|
exports.PlaybackRateSelector = PlaybackRateSelector;
|
|
@@ -68,13 +68,13 @@ const Inner = ({ canvasSize }) => {
|
|
|
68
68
|
]);
|
|
69
69
|
const Component = video ? video.component : null;
|
|
70
70
|
const inputProps = (0, remotion_1.getInputProps)();
|
|
71
|
-
return ((0, jsx_runtime_1.jsx)(react_1.Suspense, { fallback: (0, jsx_runtime_1.jsx)(LoadingIndicator_1.Loading, {}
|
|
71
|
+
return ((0, jsx_runtime_1.jsx)(react_1.Suspense, { fallback: (0, jsx_runtime_1.jsx)(LoadingIndicator_1.Loading, {}), children: (0, jsx_runtime_1.jsx)("div", { style: outer, children: (0, jsx_runtime_1.jsx)("div", { style: style, children: Component ? ((0, jsx_runtime_1.jsx)(Component, { ...((_a = video === null || video === void 0 ? void 0 : video.defaultProps) !== null && _a !== void 0 ? _a : {}), ...inputProps })) : null }) }) }));
|
|
72
72
|
};
|
|
73
73
|
const VideoPreview = ({ canvasSize }) => {
|
|
74
74
|
const config = remotion_1.Internals.useUnsafeVideoConfig();
|
|
75
75
|
if (!config) {
|
|
76
76
|
return null;
|
|
77
77
|
}
|
|
78
|
-
return (0, jsx_runtime_1.jsx)(Inner, { canvasSize: canvasSize }
|
|
78
|
+
return (0, jsx_runtime_1.jsx)(Inner, { canvasSize: canvasSize });
|
|
79
79
|
};
|
|
80
80
|
exports.VideoPreview = VideoPreview;
|
|
@@ -43,6 +43,6 @@ const PreviewToolbar = () => {
|
|
|
43
43
|
const { mediaMuted } = (0, react_1.useContext)(remotion_1.Internals.MediaVolumeContext);
|
|
44
44
|
const { setMediaMuted } = (0, react_1.useContext)(remotion_1.Internals.SetMediaVolumeContext);
|
|
45
45
|
const [loop, setLoop] = (0, react_1.useState)((0, loop_1.loadLoopOption)());
|
|
46
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: container, className: "css-reset", children: [(0, jsx_runtime_1.jsxs)("div", { style: sideContainer, children: [(0, jsx_runtime_1.jsx)("div", { style: padding }
|
|
46
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: container, className: "css-reset", children: [(0, jsx_runtime_1.jsxs)("div", { style: sideContainer, children: [(0, jsx_runtime_1.jsx)("div", { style: padding }), (0, jsx_runtime_1.jsx)(TimeValue_1.TimeValue, {})] }), (0, jsx_runtime_1.jsx)(layout_1.Flex, {}), (0, jsx_runtime_1.jsx)(SizeSelector_1.SizeSelector, {}), (0, jsx_runtime_1.jsx)(PlaybackRateSelector_1.PlaybackRateSelector, { setPlaybackRate: setPlaybackRate, playbackRate: playbackRate }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 2 }), (0, jsx_runtime_1.jsx)(PlayPause_1.PlayPause, { loop: loop, playbackRate: playbackRate }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 2 }), (0, jsx_runtime_1.jsx)(LoopToggle_1.LoopToggle, { loop: loop, setLoop: setLoop }), (0, jsx_runtime_1.jsx)(CheckboardToggle_1.CheckboardToggle, {}), (0, jsx_runtime_1.jsx)(RichTimelineToggle_1.RichTimelineToggle, {}), (0, jsx_runtime_1.jsx)(TimelineInOutToggle_1.TimelineInOutPointToggle, {}), (0, jsx_runtime_1.jsx)(MuteToggle_1.MuteToggle, { muted: mediaMuted, setMuted: setMediaMuted }), (0, jsx_runtime_1.jsx)(layout_1.Flex, {}), (0, jsx_runtime_1.jsxs)("div", { style: sideContainer, children: [(0, jsx_runtime_1.jsx)(layout_1.Flex, {}), (0, jsx_runtime_1.jsx)(FpsCounter_1.FpsCounter, { playbackSpeed: playbackRate }), (0, jsx_runtime_1.jsx)("div", { style: padding })] }), (0, jsx_runtime_1.jsx)(PlaybackKeyboardShortcutsManager_1.PlaybackKeyboardShortcutsManager, { setPlaybackRate: setPlaybackRate }), (0, jsx_runtime_1.jsx)(PlaybackRatePersistor_1.PlaybackRatePersistor, {})] }));
|
|
47
47
|
};
|
|
48
48
|
exports.PreviewToolbar = PreviewToolbar;
|
|
@@ -45,11 +45,11 @@ const SizeSelector = () => {
|
|
|
45
45
|
type: 'item',
|
|
46
46
|
value: newSize,
|
|
47
47
|
keyHint: null,
|
|
48
|
-
leftItem: String(size) === String(newSize) ? (0, jsx_runtime_1.jsx)(Checkmark_1.Checkmark, {}
|
|
48
|
+
leftItem: String(size) === String(newSize) ? (0, jsx_runtime_1.jsx)(Checkmark_1.Checkmark, {}) : null,
|
|
49
49
|
subMenu: null,
|
|
50
50
|
};
|
|
51
51
|
});
|
|
52
52
|
}, [setSize, size]);
|
|
53
|
-
return ((0, jsx_runtime_1.jsx)("div", { style: style, "aria-label": accessibilityLabel, children: (0, jsx_runtime_1.jsx)(ComboBox_1.Combobox, { title: accessibilityLabel, style: comboStyle, selectedId: String(size), values: items }
|
|
53
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: style, "aria-label": accessibilityLabel, children: (0, jsx_runtime_1.jsx)(ComboBox_1.Combobox, { title: accessibilityLabel, style: comboStyle, selectedId: String(size), values: items }) }));
|
|
54
54
|
};
|
|
55
55
|
exports.SizeSelector = SizeSelector;
|
|
@@ -62,6 +62,6 @@ const SplitterContainer = ({ orientation, children, defaultFlex, maxFlex, minFle
|
|
|
62
62
|
orientation,
|
|
63
63
|
persistFlex,
|
|
64
64
|
]);
|
|
65
|
-
return ((0, jsx_runtime_1.jsx)(SplitterContext_1.SplitterContext.Provider, { value: value, children: (0, jsx_runtime_1.jsx)("div", { ref: ref, style: orientation === 'horizontal' ? containerColumn : containerRow, children: children }
|
|
65
|
+
return ((0, jsx_runtime_1.jsx)(SplitterContext_1.SplitterContext.Provider, { value: value, children: (0, jsx_runtime_1.jsx)("div", { ref: ref, style: orientation === 'horizontal' ? containerColumn : containerRow, children: children }) }));
|
|
66
66
|
};
|
|
67
67
|
exports.SplitterContainer = SplitterContainer;
|
|
@@ -8,11 +8,13 @@ const SplitterElement = ({ children, type }) => {
|
|
|
8
8
|
const context = (0, react_1.useContext)(SplitterContext_1.SplitterContext);
|
|
9
9
|
const style = (0, react_1.useMemo)(() => {
|
|
10
10
|
return {
|
|
11
|
-
flex:
|
|
11
|
+
flex:
|
|
12
|
+
// Multiply by 1000 because if flex values don't add up to at least 1, they will not fill up the screen
|
|
13
|
+
(type === 'flexer' ? context.flexValue : 1 - context.flexValue) * 1000,
|
|
12
14
|
display: 'flex',
|
|
13
15
|
position: 'relative',
|
|
14
16
|
};
|
|
15
17
|
}, [context.flexValue, type]);
|
|
16
|
-
return (0, jsx_runtime_1.jsx)("div", { style: style, children: children }
|
|
18
|
+
return (0, jsx_runtime_1.jsx)("div", { style: style, children: children });
|
|
17
19
|
};
|
|
18
20
|
exports.SplitterElement = SplitterElement;
|