@remotion/studio 4.0.503 → 4.0.504
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/install-package.d.ts +2 -1
- package/dist/api/install-package.js +6 -2
- package/dist/components/AssetSelectorItem.js +2 -14
- package/dist/components/Canvas.js +12 -5
- package/dist/components/CheckboardToggle.js +3 -1
- package/dist/components/CompositionSelectorItem.js +2 -3
- package/dist/components/ControlButton.d.ts +4 -2
- package/dist/components/ControlButton.js +6 -20
- package/dist/components/EditorContent.js +1 -1
- package/dist/components/EffectPickerModal.js +68 -7
- package/dist/components/FullscreenToggle.js +1 -2
- package/dist/components/InitialCompositionLoader.js +1 -14
- package/dist/components/InlineAction.d.ts +3 -4
- package/dist/components/InlineAction.js +5 -3
- package/dist/components/InspectorPanel/CompositionMetadata.js +7 -6
- package/dist/components/InspectorPanel/KeyframeInspector.js +2 -3
- package/dist/components/InspectorPanel/styles.js +4 -0
- package/dist/components/LoopToggle.js +1 -1
- package/dist/components/MenuBuildIndicator.d.ts +3 -1
- package/dist/components/MenuBuildIndicator.js +5 -3
- package/dist/components/MenuToolbar.js +1 -1
- package/dist/components/MobilePanel.d.ts +1 -2
- package/dist/components/MobilePanel.js +6 -10
- package/dist/components/MuteToggle.js +2 -1
- package/dist/components/NewComposition/ComboBox.d.ts +1 -0
- package/dist/components/NewComposition/ComboBox.js +2 -2
- package/dist/components/NewComposition/InputDragger.d.ts +4 -0
- package/dist/components/NewComposition/InputDragger.js +7 -3
- package/dist/components/Notifications/NotificationCenter.js +12 -2
- package/dist/components/OutlineToggle.js +10 -2
- package/dist/components/PlayPause.js +1 -5
- package/dist/components/PlaybackRateSelector.js +2 -1
- package/dist/components/PreviewToolbar.js +8 -7
- package/dist/components/PreviewToolbarOverflowButton.d.ts +0 -1
- package/dist/components/PreviewToolbarOverflowButton.js +2 -75
- package/dist/components/QuickSwitcher/QuickSwitcherContent.js +1 -2
- package/dist/components/RenderButton.d.ts +0 -1
- package/dist/components/RenderButton.js +10 -9
- package/dist/components/RenderModal/FrameRangeSetting.js +6 -1
- package/dist/components/RenderModal/MultiRangeSlider.js +8 -8
- package/dist/components/RenderModal/RenderModalEnvironmentVariables.js +1 -9
- package/dist/components/RenderModal/RenderModalOutputName.js +11 -2
- package/dist/components/RenderModal/ServerRenderModal.js +2 -17
- package/dist/components/RenderModal/WebRenderModal.js +3 -17
- package/dist/components/RenderModal/layout.js +7 -5
- package/dist/components/RenderModal/render-modals.js +18 -15
- package/dist/components/RenderQueue/RenderQueueRepeat.js +1 -14
- package/dist/components/SelectedOutlineElement.js +4 -12
- package/dist/components/SidebarRenderButton.js +1 -15
- package/dist/components/SizeSelector.js +2 -1
- package/dist/components/SnappingToggle.js +1 -2
- package/dist/components/Spinner.d.ts +1 -0
- package/dist/components/Spinner.js +2 -2
- package/dist/components/Splitter/SplitterContainer.d.ts +1 -0
- package/dist/components/Splitter/SplitterContainer.js +4 -1
- package/dist/components/Splitter/SplitterContext.d.ts +4 -3
- package/dist/components/Splitter/SplitterContext.js +3 -2
- package/dist/components/Splitter/SplitterElement.js +6 -1
- package/dist/components/Splitter/SplitterHandle.js +1 -0
- package/dist/components/Tabs/vertical.d.ts +1 -0
- package/dist/components/Tabs/vertical.js +8 -10
- package/dist/components/TimeValue.js +26 -8
- package/dist/components/Timeline/Timeline.js +1 -1
- package/dist/components/Timeline/TimelineClipboardKeybindings.js +3 -6
- package/dist/components/Timeline/TimelineDeleteKeybindings.js +5 -7
- package/dist/components/Timeline/TimelineExpandedKeyframeRow.js +2 -1
- package/dist/components/Timeline/TimelineKeyframeEasingLine.d.ts +1 -1
- package/dist/components/Timeline/TimelineKeyframeEasingLine.js +2 -2
- package/dist/components/Timeline/TimelineSelection.js +2 -3
- package/dist/components/Timeline/TimelineZoomControls.d.ts +3 -1
- package/dist/components/Timeline/TimelineZoomControls.js +24 -12
- package/dist/components/Timeline/use-expanded-track-keyframe-rows.js +2 -3
- package/dist/components/Timeline/use-timeline-asset-drop.js +3 -3
- package/dist/components/TimelineInOutToggle.js +3 -3
- package/dist/components/TopPanel.js +3 -2
- package/dist/components/UndoRedoButtons.js +6 -5
- package/dist/components/UpdateCheck.js +18 -5
- package/dist/components/UpdateModal/UpdateModal.js +35 -12
- package/dist/components/composition-menu-items.d.ts +2 -4
- package/dist/components/composition-menu-items.js +31 -54
- package/dist/components/import-assets.d.ts +2 -1
- package/dist/components/import-assets.js +1 -1
- package/dist/esm/{chunk-bj1r1hh5.js → chunk-43m68z1k.js} +4824 -4457
- package/dist/esm/internals.mjs +4824 -4457
- package/dist/esm/previewEntry.mjs +4801 -4434
- package/dist/esm/renderEntry.mjs +1 -1
- package/dist/helpers/inject-css.js +40 -23
- package/dist/helpers/install-required-package.d.ts +3 -2
- package/dist/helpers/install-required-package.js +20 -15
- package/dist/helpers/use-menu-structure.js +85 -49
- package/dist/icons/audio.d.ts +1 -1
- package/dist/icons/audio.js +1 -1
- package/dist/icons/caret.js +1 -1
- package/dist/icons/certificate.d.ts +1 -1
- package/dist/icons/certificate.js +1 -1
- package/dist/icons/data.d.ts +1 -1
- package/dist/icons/data.js +2 -2
- package/dist/icons/effects.d.ts +5 -0
- package/dist/icons/effects.js +8 -0
- package/dist/icons/ellipsis.js +1 -1
- package/dist/icons/external-link.d.ts +5 -0
- package/dist/icons/external-link.js +10 -0
- package/dist/icons/fullscreen.js +1 -1
- package/dist/icons/gear.d.ts +1 -1
- package/dist/icons/gear.js +1 -1
- package/dist/icons/gif.d.ts +1 -1
- package/dist/icons/gif.js +1 -1
- package/dist/icons/input-props.d.ts +2 -0
- package/dist/icons/input-props.js +9 -0
- package/dist/icons/jump-to-start.js +2 -2
- package/dist/icons/magnet.d.ts +3 -1
- package/dist/icons/magnet.js +2 -2
- package/dist/icons/media-volume.d.ts +6 -2
- package/dist/icons/media-volume.js +8 -6
- package/dist/icons/minus.d.ts +3 -1
- package/dist/icons/minus.js +2 -2
- package/dist/icons/pause.js +1 -1
- package/dist/icons/play.js +1 -1
- package/dist/icons/plus.js +1 -1
- package/dist/icons/redo.js +2 -2
- package/dist/icons/step-back.js +2 -2
- package/dist/icons/step-forward.js +2 -2
- package/dist/icons/timelineInOutPointer.js +2 -2
- package/dist/icons/undo.js +2 -2
- package/package.json +12 -12
|
@@ -26,26 +26,22 @@ const panel = {
|
|
|
26
26
|
background: colors_1.BACKGROUND,
|
|
27
27
|
boxShadow: colors_1.SHADOW_BLACK,
|
|
28
28
|
};
|
|
29
|
-
const sidebarWidth =
|
|
30
|
-
|
|
31
|
-
right: 'min(245px, calc(100% - 50px))',
|
|
32
|
-
};
|
|
33
|
-
function MobilePanel({ children, onClose, side, }) {
|
|
29
|
+
const sidebarWidth = 'min(290px, calc(100% - 50px))';
|
|
30
|
+
function MobilePanel({ children, onClose, }) {
|
|
34
31
|
const { currentZIndex } = (0, z_index_1.useZIndex)();
|
|
35
32
|
const onOutsideClick = react_1.default.useCallback((target) => {
|
|
36
33
|
var _a;
|
|
37
34
|
const element = target instanceof Element ? target : null;
|
|
38
|
-
const toggleSelector =
|
|
35
|
+
const toggleSelector = '[data-sidebar-toggle="left"]';
|
|
39
36
|
if ((element === null || element === void 0 ? void 0 : element.closest(toggleSelector)) ||
|
|
40
37
|
((_a = element === null || element === void 0 ? void 0 : element.closest('button')) === null || _a === void 0 ? void 0 : _a.querySelector(toggleSelector))) {
|
|
41
38
|
return;
|
|
42
39
|
}
|
|
43
40
|
onClose();
|
|
44
|
-
}, [onClose
|
|
41
|
+
}, [onClose]);
|
|
45
42
|
return react_dom_1.default.createPortal(jsx_runtime_1.jsx("div", { style: overlay, children: jsx_runtime_1.jsx(z_index_1.HigherZIndex, { onEscape: onClose, onOutsideClick: onOutsideClick, children: jsx_runtime_1.jsx("div", { style: {
|
|
46
43
|
...panel,
|
|
47
|
-
width: sidebarWidth
|
|
48
|
-
left:
|
|
49
|
-
right: side === 'right' ? 0 : undefined,
|
|
44
|
+
width: sidebarWidth,
|
|
45
|
+
left: 0,
|
|
50
46
|
}, children: children }) }) }), (0, portals_1.getPortal)(currentZIndex));
|
|
51
47
|
}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.MuteToggle = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
+
const colors_1 = require("../helpers/colors");
|
|
6
7
|
const media_volume_1 = require("../icons/media-volume");
|
|
7
8
|
const mute_1 = require("../state/mute");
|
|
8
9
|
const ControlButton_1 = require("./ControlButton");
|
|
@@ -14,6 +15,6 @@ const MuteToggle = ({ muted, setMuted }) => {
|
|
|
14
15
|
});
|
|
15
16
|
}, [setMuted]);
|
|
16
17
|
const accessibilityLabel = muted ? 'Unmute video' : 'Mute video';
|
|
17
|
-
return (jsx_runtime_1.jsx(ControlButton_1.ControlButton, { title: accessibilityLabel, "aria-label": accessibilityLabel, onClick: onClick, children: muted ? jsx_runtime_1.jsx(media_volume_1.VolumeOffIcon, {}) : jsx_runtime_1.jsx(media_volume_1.VolumeOnIcon, {}) }));
|
|
18
|
+
return (jsx_runtime_1.jsx(ControlButton_1.ControlButton, { title: accessibilityLabel, "aria-label": accessibilityLabel, onClick: onClick, children: (color) => muted ? jsx_runtime_1.jsx(media_volume_1.VolumeOffIcon, { color: colors_1.BLUE }) : jsx_runtime_1.jsx(media_volume_1.VolumeOnIcon, { color: color }) }));
|
|
18
19
|
};
|
|
19
20
|
exports.MuteToggle = MuteToggle;
|
|
@@ -61,7 +61,7 @@ const smallLabel = {
|
|
|
61
61
|
fontSize: 11,
|
|
62
62
|
lineHeight: '12px',
|
|
63
63
|
};
|
|
64
|
-
const Combobox = ({ values, selectedId, style: customStyle, title, size: controlSize = 'default', }) => {
|
|
64
|
+
const Combobox = ({ values, selectedId, style: customStyle, title, size: controlSize = 'default', unhoveredIconColor = colors_1.LIGHT_TEXT, }) => {
|
|
65
65
|
const [hovered, setIsHovered] = (0, react_1.useState)(false);
|
|
66
66
|
const [opened, setOpened] = (0, react_1.useState)(false);
|
|
67
67
|
const ref = (0, react_1.useRef)(null);
|
|
@@ -206,7 +206,7 @@ const Combobox = ({ values, selectedId, style: customStyle, title, size: control
|
|
|
206
206
|
? compactLabel
|
|
207
207
|
: label;
|
|
208
208
|
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
209
|
-
jsx_runtime_1.jsxs("button", { ref: ref, title: title, tabIndex: tabIndex, type: "button", style: style, className: is_menu_item_1.MENU_INITIATOR_CLASSNAME, children: [selected ? (jsx_runtime_1.jsx("div", { title: typeof selected.label === 'string' ? selected.label : undefined, style: selectedLabelStyle, children: selected === null || selected === void 0 ? void 0 : selected.label })) : null, jsx_runtime_1.jsx(layout_1.Spacing, { x: controlSize === 'default' ? 1 : 0.5 }), ' ', jsx_runtime_1.jsx(caret_1.CaretDown, { small: controlSize === 'small' })
|
|
209
|
+
jsx_runtime_1.jsxs("button", { ref: ref, title: title, tabIndex: tabIndex, type: "button", style: style, className: is_menu_item_1.MENU_INITIATOR_CLASSNAME, children: [selected ? (jsx_runtime_1.jsx("div", { title: typeof selected.label === 'string' ? selected.label : undefined, style: selectedLabelStyle, children: selected === null || selected === void 0 ? void 0 : selected.label })) : null, jsx_runtime_1.jsx(layout_1.Spacing, { x: controlSize === 'default' ? 1 : 0.5 }), ' ', jsx_runtime_1.jsx(caret_1.CaretDown, { color: hovered || opened ? colors_1.WHITE : unhoveredIconColor, small: controlSize === 'small' })
|
|
210
210
|
] }), portalStyle
|
|
211
211
|
? react_dom_1.default.createPortal(jsx_runtime_1.jsx("div", { style: styles_1.fullScreenOverlay, onPointerDown: onOverlayPointerDown, children: jsx_runtime_1.jsx("div", { style: styles_1.outerPortal, className: "css-reset", children: jsx_runtime_1.jsx(z_index_1.HigherZIndex, { onOutsideClick: onHide, onEscape: onHide, children: jsx_runtime_1.jsx("div", { style: portalStyle, children: 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) => selected && v.id === selected.id), topItemCanBeUnselected: false, fixedHeight: derivedMaxHeight }) }) }) }) }), (0, portals_1.getPortal)(currentZIndex))
|
|
212
212
|
: null] }));
|
|
@@ -60,6 +60,10 @@ export declare const InputDragger: React.ForwardRefExoticComponent<InputHTMLAttr
|
|
|
60
60
|
readonly onTextChange: (newVal: string) => void;
|
|
61
61
|
readonly status: RemInputStatus;
|
|
62
62
|
readonly formatter?: ((str: string | number) => string) | undefined;
|
|
63
|
+
readonly formatterStyle?: React.CSSProperties | undefined;
|
|
64
|
+
readonly formatterSubtitle?: ((str: string | number) => string) | undefined;
|
|
65
|
+
readonly formatterSubtitleStyle?: React.CSSProperties | undefined;
|
|
66
|
+
readonly buttonStyle?: React.CSSProperties | undefined;
|
|
63
67
|
readonly rightAlign: boolean;
|
|
64
68
|
readonly small?: boolean | undefined;
|
|
65
69
|
readonly snapToStep?: boolean | undefined;
|
|
@@ -295,7 +295,7 @@ const deriveInputDraggerValueDiff = ({ dragSensitivity, step, xDistance, }) => {
|
|
|
295
295
|
return (0, remotion_1.interpolate)(xDistance, [-5, -4, 0, 4, 5], [-step * dragSensitivity, 0, 0, 0, step * dragSensitivity]);
|
|
296
296
|
};
|
|
297
297
|
exports.deriveInputDraggerValueDiff = deriveInputDraggerValueDiff;
|
|
298
|
-
const InputDraggerForwardRefFn = ({ onValueChange, onValueChangeEnd, min: _min, max: _max, step: _step, value, onTextChange, formatter = (q) => String(q), status, rightAlign, small, snapToStep = true, dragDecimalPlaces, dragSensitivity = 1, type: _type, ...props }, ref) => {
|
|
298
|
+
const InputDraggerForwardRefFn = ({ onValueChange, onValueChangeEnd, min: _min, max: _max, step: _step, value, onTextChange, formatter = (q) => String(q), formatterStyle, formatterSubtitle, formatterSubtitleStyle, buttonStyle, status, rightAlign, small, snapToStep = true, dragDecimalPlaces, dragSensitivity = 1, type: _type, ...props }, ref) => {
|
|
299
299
|
const [inputFallback, setInputFallback] = (0, react_1.useState)(false);
|
|
300
300
|
const [dragging, setDragging] = (0, react_1.useState)(false);
|
|
301
301
|
const fallbackRef = (0, react_1.useRef)(null);
|
|
@@ -314,7 +314,8 @@ const InputDraggerForwardRefFn = ({ onValueChange, onValueChangeEnd, min: _min,
|
|
|
314
314
|
WebkitUserSelect: 'none',
|
|
315
315
|
fontSize: small ? 12 : 14,
|
|
316
316
|
fontVariantNumeric: 'tabular-nums',
|
|
317
|
-
|
|
317
|
+
...formatterStyle,
|
|
318
|
+
}), [dragging, formatterStyle, small]);
|
|
318
319
|
const onFocus = (0, react_1.useCallback)(() => {
|
|
319
320
|
if (!small || pointerDownRef.current) {
|
|
320
321
|
return;
|
|
@@ -484,6 +485,9 @@ const InputDraggerForwardRefFn = ({ onValueChange, onValueChangeEnd, min: _min,
|
|
|
484
485
|
if (inputFallback) {
|
|
485
486
|
return (jsx_runtime_1.jsx(z_index_1.HigherZIndex, { onEscape: onEscape, onOutsideClick: noop_1.noop, children: jsx_runtime_1.jsx(RemInput_1.RemotionInput, { ref: fallbackRef, autoFocus: true, onKeyDown: onInputKeyDown, onBlur: onBlur, onChange: onInputChange, min: _min, max: _max, step: deriveStep, defaultValue: value, status: status, rightAlign: rightAlign, small: small, ...props, type: "text" }) }));
|
|
486
487
|
}
|
|
487
|
-
return (jsx_runtime_1.
|
|
488
|
+
return (jsx_runtime_1.jsxs("button", { ref: ref, type: "button", "aria-label": props['aria-label'], className: '__remotion_input_dragger', style: buttonStyle
|
|
489
|
+
? { ...exports.inputDraggerContainerStyle, ...buttonStyle }
|
|
490
|
+
: exports.inputDraggerContainerStyle, onClick: onClick, onFocus: onFocus, onKeyDown: onKeyDown, onPointerDown: onPointerDown, children: [
|
|
491
|
+
jsx_runtime_1.jsx("span", { style: span, children: formatter(value) }), formatterSubtitle ? (jsx_runtime_1.jsx("span", { style: formatterSubtitleStyle, children: formatterSubtitle(value) })) : null] }));
|
|
488
492
|
};
|
|
489
493
|
exports.InputDragger = react_1.default.forwardRef(InputDraggerForwardRefFn);
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.NotificationCenter = exports.showNotification = void 0;
|
|
4
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
8
|
const react_1 = require("react");
|
|
9
|
+
const react_dom_1 = __importDefault(require("react-dom"));
|
|
6
10
|
const colors_1 = require("../../helpers/colors");
|
|
11
|
+
const z_index_1 = require("../../state/z-index");
|
|
12
|
+
const portals_1 = require("../Menu/portals");
|
|
7
13
|
const Notification_1 = require("./Notification");
|
|
8
14
|
const container = {
|
|
9
15
|
position: 'absolute',
|
|
@@ -28,6 +34,7 @@ const showNotification = (content, durationInMs) => {
|
|
|
28
34
|
exports.showNotification = showNotification;
|
|
29
35
|
const NotificationCenter = () => {
|
|
30
36
|
const [notifications, setNotifications] = (0, react_1.useState)([]);
|
|
37
|
+
const { currentZIndex } = (0, z_index_1.useZIndex)();
|
|
31
38
|
const onRemove = (0, react_1.useCallback)((id) => {
|
|
32
39
|
setNotifications((not) => {
|
|
33
40
|
return not.filter((n) => n.id !== id);
|
|
@@ -60,8 +67,11 @@ const NotificationCenter = () => {
|
|
|
60
67
|
addNotification,
|
|
61
68
|
};
|
|
62
69
|
}, [addNotification]);
|
|
63
|
-
return (jsx_runtime_1.jsx("div", { style: container, children: notifications.map((n) => {
|
|
70
|
+
return react_dom_1.default.createPortal(jsx_runtime_1.jsx("div", { style: container, children: notifications.map((n) => {
|
|
64
71
|
return (jsx_runtime_1.jsx(Notification_1.Notification, { created: n.created, duration: n.duration, id: n.id, onRemove: onRemove, children: n.content }, n.id));
|
|
65
|
-
}) })
|
|
72
|
+
}) }),
|
|
73
|
+
// Notifications must be above overlays opened from the editor, such as the
|
|
74
|
+
// floating sidebars used in the mobile layout.
|
|
75
|
+
(0, portals_1.getPortal)(currentZIndex + 1));
|
|
66
76
|
};
|
|
67
77
|
exports.NotificationCenter = NotificationCenter;
|
|
@@ -11,10 +11,18 @@ const OutlineToggle = () => {
|
|
|
11
11
|
const onClick = (0, react_1.useCallback)(() => {
|
|
12
12
|
setEditorShowOutlines((current) => !current);
|
|
13
13
|
}, [setEditorShowOutlines]);
|
|
14
|
-
const color = editorShowOutlines ? colors_1.BLUE : colors_1.WHITE;
|
|
15
14
|
const accessibilityLabel = editorShowOutlines
|
|
16
15
|
? 'Hide outlines'
|
|
17
16
|
: 'Show outlines';
|
|
18
|
-
return (jsx_runtime_1.jsx(ControlButton_1.ControlButton, { title: accessibilityLabel, "aria-label": accessibilityLabel, onClick: onClick, children:
|
|
17
|
+
return (jsx_runtime_1.jsx(ControlButton_1.ControlButton, { title: accessibilityLabel, "aria-label": accessibilityLabel, onClick: onClick, children: (color) => {
|
|
18
|
+
const iconColor = editorShowOutlines ? colors_1.BLUE : color;
|
|
19
|
+
return (jsx_runtime_1.jsxs("svg", { style: { width: 17, height: 17 }, viewBox: "0 0 512 512", fill: "none", "aria-hidden": "true", focusable: "false", children: [
|
|
20
|
+
jsx_runtime_1.jsx("path", { d: "M64 64H448V448H64V64Z", stroke: iconColor, strokeWidth: "36" }), [
|
|
21
|
+
[16, 16],
|
|
22
|
+
[400, 16],
|
|
23
|
+
[16, 400],
|
|
24
|
+
[400, 400],
|
|
25
|
+
].map(([x, y]) => (jsx_runtime_1.jsx("rect", { x: x, y: y, width: "96", height: "96", rx: "24", fill: colors_1.BACKGROUND_HEX, stroke: iconColor, strokeWidth: "32" }, `${x}-${y}`)))] }));
|
|
26
|
+
} }));
|
|
19
27
|
};
|
|
20
28
|
exports.OutlineToggle = OutlineToggle;
|
|
@@ -5,7 +5,6 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const player_1 = require("@remotion/player");
|
|
6
6
|
const react_1 = require("react");
|
|
7
7
|
const remotion_1 = require("remotion");
|
|
8
|
-
const colors_1 = require("../helpers/colors");
|
|
9
8
|
const is_current_selected_still_1 = require("../helpers/is-current-selected-still");
|
|
10
9
|
const use_keybinding_1 = require("../helpers/use-keybinding");
|
|
11
10
|
const jump_to_start_1 = require("../icons/jump-to-start");
|
|
@@ -19,16 +18,13 @@ const imperative_state_1 = require("./Timeline/imperative-state");
|
|
|
19
18
|
const timeline_scroll_logic_1 = require("./Timeline/timeline-scroll-logic");
|
|
20
19
|
const backStyle = {
|
|
21
20
|
height: 18,
|
|
22
|
-
color: colors_1.WHITE,
|
|
23
21
|
};
|
|
24
22
|
const forwardBackStyle = {
|
|
25
23
|
height: 16,
|
|
26
|
-
color: colors_1.WHITE,
|
|
27
24
|
};
|
|
28
25
|
const iconButton = {
|
|
29
26
|
height: 14,
|
|
30
27
|
width: 14,
|
|
31
|
-
color: colors_1.WHITE,
|
|
32
28
|
};
|
|
33
29
|
const PlayPause = ({ playbackRate, loop, bufferStateDelayInMilliseconds, muted, hideNavigationControls, }) => {
|
|
34
30
|
const { inFrame, outFrame } = (0, in_out_1.useTimelineInOutFramePosition)();
|
|
@@ -198,6 +194,6 @@ const PlayPause = ({ playbackRate, loop, bufferStateDelayInMilliseconds, muted,
|
|
|
198
194
|
stopped = true;
|
|
199
195
|
};
|
|
200
196
|
}, [bufferStateDelayInMilliseconds, emitter]);
|
|
201
|
-
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [hideNavigationControls ? null : (jsx_runtime_1.jsx(ControlButton_1.ControlButton, { "aria-label": "Jump to beginning", title: "Jump to beginning", disabled: !videoConfig || isFirstFrame, onClick: jumpToStart, children: jsx_runtime_1.jsx(jump_to_start_1.JumpToStart, { style: backStyle }) })), hideNavigationControls ? null : (jsx_runtime_1.jsx(ControlButton_1.ControlButton, { "aria-label": "Step back one frame", title: "Step back one frame", disabled: !videoConfig || isFirstFrame, onClick: oneFrameBack, children: jsx_runtime_1.jsx(step_back_1.StepBack, { style: forwardBackStyle }) })), jsx_runtime_1.jsx(ControlButton_1.ControlButton, { "aria-label": playing ? 'Pause' : 'Play', title: playing ? 'Pause' : 'Play', onClick: playing ? pause : play, disabled: !videoConfig, children: playing ? (showBufferIndicator ? (jsx_runtime_1.jsx(player_1.PlayerInternals.BufferingIndicator, { type: "studio" })) : (jsx_runtime_1.jsx(pause_1.Pause, { style: iconButton }))) : (jsx_runtime_1.jsx(play_1.Play, { style: iconButton })) }), hideNavigationControls ? null : (jsx_runtime_1.jsx(ControlButton_1.ControlButton, { "aria-label": "Step forward one frame", title: "Step forward one frame", disabled: !videoConfig || isLastFrame, onClick: oneFrameForward, children: jsx_runtime_1.jsx(step_forward_1.StepForward, { style: forwardBackStyle }) }))] }));
|
|
197
|
+
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [hideNavigationControls ? null : (jsx_runtime_1.jsx(ControlButton_1.ControlButton, { "aria-label": "Jump to beginning", title: "Jump to beginning", disabled: !videoConfig || isFirstFrame, onClick: jumpToStart, children: (color) => jsx_runtime_1.jsx(jump_to_start_1.JumpToStart, { style: backStyle, color: color }) })), hideNavigationControls ? null : (jsx_runtime_1.jsx(ControlButton_1.ControlButton, { "aria-label": "Step back one frame", title: "Step back one frame", disabled: !videoConfig || isFirstFrame, onClick: oneFrameBack, children: (color) => jsx_runtime_1.jsx(step_back_1.StepBack, { style: forwardBackStyle, color: color }) })), jsx_runtime_1.jsx(ControlButton_1.ControlButton, { "aria-label": playing ? 'Pause' : 'Play', title: playing ? 'Pause' : 'Play', onClick: playing ? pause : play, disabled: !videoConfig, children: (color) => playing ? (showBufferIndicator ? (jsx_runtime_1.jsx(player_1.PlayerInternals.BufferingIndicator, { type: "studio", color: color })) : (jsx_runtime_1.jsx(pause_1.Pause, { style: iconButton, color: color }))) : (jsx_runtime_1.jsx(play_1.Play, { style: iconButton, color: color })) }), hideNavigationControls ? null : (jsx_runtime_1.jsx(ControlButton_1.ControlButton, { "aria-label": "Step forward one frame", title: "Step forward one frame", disabled: !videoConfig || isLastFrame, onClick: oneFrameForward, children: (color) => jsx_runtime_1.jsx(step_forward_1.StepForward, { style: forwardBackStyle, color: color }) }))] }));
|
|
202
198
|
};
|
|
203
199
|
exports.PlayPause = PlayPause;
|
|
@@ -4,6 +4,7 @@ exports.PlaybackRateSelector = exports.usePlaybackRateMenuItems = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const remotion_1 = require("remotion");
|
|
7
|
+
const colors_1 = require("../helpers/colors");
|
|
7
8
|
const is_current_selected_still_1 = require("../helpers/is-current-selected-still");
|
|
8
9
|
const Checkmark_1 = require("../icons/Checkmark");
|
|
9
10
|
const playbackrate_1 = require("../state/playbackrate");
|
|
@@ -65,6 +66,6 @@ const PlaybackRateSelector = ({ playbackRate, setPlaybackRate, }) => {
|
|
|
65
66
|
if (isStill || canvasContent === null || canvasContent.type === 'asset') {
|
|
66
67
|
return null;
|
|
67
68
|
}
|
|
68
|
-
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 }) }));
|
|
69
|
+
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, unhoveredIconColor: colors_1.WHITE_ALPHA_80 }) }));
|
|
69
70
|
};
|
|
70
71
|
exports.PlaybackRateSelector = PlaybackRateSelector;
|
|
@@ -25,7 +25,6 @@ const PreviewToolbarOverflowButton_1 = require("./PreviewToolbarOverflowButton")
|
|
|
25
25
|
const RenderButton_1 = require("./RenderButton");
|
|
26
26
|
const SizeSelector_1 = require("./SizeSelector");
|
|
27
27
|
const SnappingToggle_1 = require("./SnappingToggle");
|
|
28
|
-
const TimelineZoomControls_1 = require("./Timeline/TimelineZoomControls");
|
|
29
28
|
const TimelineInOutToggle_1 = require("./TimelineInOutToggle");
|
|
30
29
|
const TOOLBAR_HEIGHT = 40;
|
|
31
30
|
const container = {
|
|
@@ -80,12 +79,14 @@ const PreviewToolbar = ({ readOnlyStudio, bufferStateDelayInMilliseconds }) => {
|
|
|
80
79
|
const playPause = (jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(PlayPause_1.PlayPause, { bufferStateDelayInMilliseconds: bufferStateDelayInMilliseconds, loop: loop, playbackRate: playbackRate, muted: playerMuted, hideNavigationControls: isMobileLayout }) }));
|
|
81
80
|
return (jsx_runtime_1.jsxs("div", { style: container, className: "css-reset", children: [
|
|
82
81
|
jsx_runtime_1.jsxs("div", { style: sideContainer, children: [
|
|
83
|
-
jsx_runtime_1.jsx("div", { style: padding }), jsx_runtime_1.
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
82
|
+
jsx_runtime_1.jsx("div", { style: padding }), isMobileLayout ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
83
|
+
jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(PreviewToolbarOverflowButton_1.PreviewToolbarOverflowButton, { showFullscreen: Boolean(canvasContent && isFullscreenSupported), showPlaybackRate: isVideoComposition, showLoop: isVideoComposition, showCompositionControls: (canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) === 'composition', playbackRate: playbackRate, setPlaybackRate: setPlaybackRate, loop: loop, setLoop: setLoop }) }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1.5 })
|
|
84
|
+
] })) : null, isVideoComposition && isMobileLayout ? (jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(MuteToggle_1.MuteToggle, { muted: playerMuted, setMuted: setPlayerMuted }) })) : null] }), jsx_runtime_1.jsx(layout_1.Flex, {}), isMobileLayout ? null : (jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(SizeSelector_1.SizeSelector, {}) })), !isMobileLayout && (isStill || isVideoComposition) ? (jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(PlaybackRateSelector_1.PlaybackRateSelector, { setPlaybackRate: setPlaybackRate, playbackRate: playbackRate }) })) : null, isVideoComposition && isMobileLayout ? (jsx_runtime_1.jsx("div", { style: centeredPlayButton, children: playPause })) : null, isVideoComposition && !isMobileLayout ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
85
|
+
jsx_runtime_1.jsx(layout_1.Spacing, { x: 2 }), playPause, jsx_runtime_1.jsx(layout_1.Spacing, { x: 2 }), jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(LoopToggle_1.LoopToggle, { loop: loop, setLoop: setLoop }) }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.75 }), jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(MuteToggle_1.MuteToggle, { muted: playerMuted, setMuted: setPlayerMuted }) }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 2 }), jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(TimelineInOutToggle_1.TimelineInOutPointToggle, {}) }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 2 })
|
|
86
|
+
] })) : null, (canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) === 'composition' ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [isMobileLayout ? null : (jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(CheckboardToggle_1.CheckboardToggle, {}) })), isMobileLayout ? null : jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.25 }), isMobileLayout ? null : (jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(OutlineToggle_1.OutlineToggle, {}) })), readOnlyStudio || isMobileLayout ? null : (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
87
|
+
jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.25 }), jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(SnappingToggle_1.SnappingToggle, {}) })
|
|
88
|
+
] }))] })) : null, jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), canvasContent && isFullscreenSupported ? (jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(FullscreenToggle_1.FullScreenToggle, { hidden: isMobileLayout }) })) : null, jsx_runtime_1.jsx(layout_1.Flex, {}), jsx_runtime_1.jsxs("div", { style: sideContainer, children: [
|
|
89
|
+
jsx_runtime_1.jsx(layout_1.Flex, {}), jsx_runtime_1.jsx(FpsCounter_1.FpsCounter, { playbackSpeed: playbackRate }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 2 }), jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(RenderButton_1.RenderButton, { readOnlyStudio: readOnlyStudio, size: "compact" }) }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1.5 })
|
|
89
90
|
] }), jsx_runtime_1.jsx(PlaybackKeyboardShortcutsManager_1.PlaybackKeyboardShortcutsManager, { setPlaybackRate: setPlaybackRate }), jsx_runtime_1.jsx(PlaybackRatePersistor_1.PlaybackRatePersistor, {})
|
|
90
91
|
] }));
|
|
91
92
|
};
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.PreviewToolbarOverflowButton = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
-
const remotion_1 = require("remotion");
|
|
7
6
|
const colors_1 = require("../helpers/colors");
|
|
8
7
|
const use_keybinding_1 = require("../helpers/use-keybinding");
|
|
9
8
|
const Checkmark_1 = require("../icons/Checkmark");
|
|
@@ -18,8 +17,7 @@ const clickButton = (id) => {
|
|
|
18
17
|
var _a;
|
|
19
18
|
(_a = document.getElementById(id)) === null || _a === void 0 ? void 0 : _a.click();
|
|
20
19
|
};
|
|
21
|
-
const PreviewToolbarOverflowButton = ({
|
|
22
|
-
const video = remotion_1.Internals.useVideo();
|
|
20
|
+
const PreviewToolbarOverflowButton = ({ showFullscreen, showPlaybackRate, showLoop, showCompositionControls, playbackRate, setPlaybackRate, loop, setLoop, }) => {
|
|
23
21
|
const { checkerboard, setCheckerboard } = (0, react_1.useContext)(checkerboard_1.CheckerboardContext);
|
|
24
22
|
const { editorShowOutlines, setEditorShowOutlines } = (0, react_1.useContext)(editor_outlines_1.EditorShowOutlinesContext);
|
|
25
23
|
const { items: previewSizeItems, selectedId: selectedPreviewSize, zoomable, } = (0, SizeSelector_1.usePreviewSizeMenuItems)();
|
|
@@ -34,58 +32,6 @@ const PreviewToolbarOverflowButton = ({ readOnlyStudio, showFullscreen, showPlay
|
|
|
34
32
|
};
|
|
35
33
|
}, []);
|
|
36
34
|
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
35
|
const values = (0, react_1.useMemo)(() => {
|
|
90
36
|
const items = [];
|
|
91
37
|
if (zoomable) {
|
|
@@ -172,28 +118,10 @@ const PreviewToolbarOverflowButton = ({ readOnlyStudio, showFullscreen, showPlay
|
|
|
172
118
|
quickSwitcherLabel: null,
|
|
173
119
|
});
|
|
174
120
|
}
|
|
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
121
|
return items;
|
|
193
122
|
}, [
|
|
194
123
|
previewSizeItems,
|
|
195
124
|
playbackRateItems,
|
|
196
|
-
renderItems,
|
|
197
125
|
selectedPlaybackRate,
|
|
198
126
|
selectedPreviewSize,
|
|
199
127
|
showFullscreen,
|
|
@@ -206,12 +134,11 @@ const PreviewToolbarOverflowButton = ({ readOnlyStudio, showFullscreen, showPlay
|
|
|
206
134
|
setCheckerboard,
|
|
207
135
|
setEditorShowOutlines,
|
|
208
136
|
setLoop,
|
|
209
|
-
video,
|
|
210
137
|
zoomable,
|
|
211
138
|
]);
|
|
212
139
|
if (values.length === 0) {
|
|
213
140
|
return null;
|
|
214
141
|
}
|
|
215
|
-
return (jsx_runtime_1.jsx(InlineDropdown_1.InlineDropdown, { variant: null, renderAction: renderAction, values: values, title: "More actions", unhoveredColor: colors_1.
|
|
142
|
+
return (jsx_runtime_1.jsx(InlineDropdown_1.InlineDropdown, { variant: null, renderAction: renderAction, values: values, title: "More actions", unhoveredColor: colors_1.WHITE_ALPHA_80 }));
|
|
216
143
|
};
|
|
217
144
|
exports.PreviewToolbarOverflowButton = PreviewToolbarOverflowButton;
|
|
@@ -52,7 +52,6 @@ const modeInactive = {
|
|
|
52
52
|
const modeActive = {
|
|
53
53
|
...modeItem,
|
|
54
54
|
color: colors_1.WHITE,
|
|
55
|
-
fontWeight: 'bold',
|
|
56
55
|
};
|
|
57
56
|
const content = {
|
|
58
57
|
paddingLeft: 16,
|
|
@@ -353,7 +352,7 @@ const QuickSwitcherContent = ({ initialMode, invocationTimestamp, readOnlyStudio
|
|
|
353
352
|
: 'Search compositions...';
|
|
354
353
|
const container = (0, react_1.useMemo)(() => {
|
|
355
354
|
return {
|
|
356
|
-
width: showKeyboardShortcuts ? 800 :
|
|
355
|
+
width: showKeyboardShortcuts ? 800 : 400,
|
|
357
356
|
};
|
|
358
357
|
}, [showKeyboardShortcuts]);
|
|
359
358
|
const results = (0, react_1.useMemo)(() => {
|
|
@@ -123,11 +123,13 @@ 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' }) => {
|
|
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));
|
|
130
130
|
const [dropdownOpened, setDropdownOpened] = (0, react_1.useState)(false);
|
|
131
|
+
const [mainButtonHovered, setMainButtonHovered] = (0, react_1.useState)(false);
|
|
132
|
+
const [dropdownButtonHovered, setDropdownButtonHovered] = (0, react_1.useState)(false);
|
|
131
133
|
const dropdownRef = (0, react_1.useRef)(null);
|
|
132
134
|
const containerRef = (0, react_1.useRef)(null);
|
|
133
135
|
const { currentZIndex } = (0, z_index_1.useZIndex)();
|
|
@@ -192,7 +194,6 @@ const RenderButton = ({ readOnlyStudio, size: controlSize = 'default', hidden })
|
|
|
192
194
|
return {
|
|
193
195
|
style: {
|
|
194
196
|
height: controlSize === 'compact' ? 14 : 16,
|
|
195
|
-
color: colors_1.CURRENT_COLOR,
|
|
196
197
|
flexShrink: 0,
|
|
197
198
|
},
|
|
198
199
|
};
|
|
@@ -433,21 +434,21 @@ const RenderButton = ({ readOnlyStudio, size: controlSize = 'default', hidden })
|
|
|
433
434
|
: renderType === 'render-command'
|
|
434
435
|
? 'Render via CLI'
|
|
435
436
|
: 'Render on web';
|
|
437
|
+
const mainIconColor = mainButtonHovered ? colors_1.WHITE : colors_1.WHITE_ALPHA_80;
|
|
438
|
+
const dropdownIconColor = dropdownOpened || dropdownButtonHovered ? colors_1.WHITE : colors_1.WHITE_ALPHA_80;
|
|
436
439
|
if (!video) {
|
|
437
440
|
return null;
|
|
438
441
|
}
|
|
439
442
|
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.jsx("button", { style: { display: 'none' }, id: "render-modal-button-command", onClick: () => openServerRenderModal(true), type: "button" }),
|
|
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'
|
|
443
|
+
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" }), jsx_runtime_1.jsxs("div", { ref: containerRef, style: containerStyle, title: tooltip, children: [
|
|
444
|
+
jsx_runtime_1.jsx("button", { type: "button", style: controlSize === 'compact' ? compactMainButtonStyle : mainButtonStyle, onClick: onClick, onPointerEnter: () => setMainButtonHovered(true), onPointerLeave: () => setMainButtonHovered(false), id: "render-modal-button", children: jsx_runtime_1.jsxs(layout_1.Row, { align: "center", style: controlSize === 'compact'
|
|
444
445
|
? compactMainButtonContent
|
|
445
446
|
: mainButtonContent, children: [
|
|
446
|
-
jsx_runtime_1.jsx(render_1.ThinRenderIcon, { fill:
|
|
447
|
+
jsx_runtime_1.jsx(render_1.ThinRenderIcon, { fill: mainIconColor, 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 })
|
|
447
448
|
] }) }), jsx_runtime_1.jsx("div", { style: dividerStyle }), jsx_runtime_1.jsx("button", { ref: dropdownRef, type: "button", style: controlSize === 'compact'
|
|
448
449
|
? compactDropdownTriggerStyle
|
|
449
|
-
: dropdownTriggerStyle, className: is_menu_item_1.MENU_INITIATOR_CLASSNAME, onPointerDown: onPointerDown, onClick: onClickDropdown, children: jsx_runtime_1.jsx(caret_1.CaretDown, {}) })
|
|
450
|
-
] })
|
|
450
|
+
: dropdownTriggerStyle, className: is_menu_item_1.MENU_INITIATOR_CLASSNAME, onPointerDown: onPointerDown, onClick: onClickDropdown, onPointerEnter: () => setDropdownButtonHovered(true), onPointerLeave: () => setDropdownButtonHovered(false), children: jsx_runtime_1.jsx(caret_1.CaretDown, { color: dropdownIconColor }) })
|
|
451
|
+
] }), portalStyle
|
|
451
452
|
? 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))
|
|
452
453
|
: null] }));
|
|
453
454
|
};
|
|
@@ -7,6 +7,11 @@ const InputDragger_1 = require("../NewComposition/InputDragger");
|
|
|
7
7
|
const layout_1 = require("./layout");
|
|
8
8
|
const MultiRangeSlider_1 = require("./MultiRangeSlider");
|
|
9
9
|
const INPUT_WIDTH = 40;
|
|
10
|
+
const startFrameInputContainer = {
|
|
11
|
+
display: 'flex',
|
|
12
|
+
justifyContent: 'flex-end',
|
|
13
|
+
width: INPUT_WIDTH,
|
|
14
|
+
};
|
|
10
15
|
const FrameRangeSetting = ({ startFrame, endFrame, setEndFrame, durationInFrames, setStartFrame }) => {
|
|
11
16
|
const minStartFrame = 0;
|
|
12
17
|
const maxEndFrame = durationInFrames - 1;
|
|
@@ -24,7 +29,7 @@ const FrameRangeSetting = ({ startFrame, endFrame, setEndFrame, durationInFrames
|
|
|
24
29
|
}, [onEndFrameChangedDirectly]);
|
|
25
30
|
return (jsx_runtime_1.jsxs("div", { style: layout_1.optionRow, children: [
|
|
26
31
|
jsx_runtime_1.jsx("div", { style: layout_1.label, children: "Frame range" }), jsx_runtime_1.jsxs("div", { style: layout_1.rightRow, children: [
|
|
27
|
-
jsx_runtime_1.jsx("div", { style:
|
|
32
|
+
jsx_runtime_1.jsx("div", { style: startFrameInputContainer, children: jsx_runtime_1.jsx(InputDragger_1.InputDragger, { min: minStartFrame, max: endFrame - 1, name: "Start frame", value: startFrame, step: 1, onTextChange: onStartFrameChanged, onValueChange: onStartFrameChangedDirectly, status: "ok", rightAlign: true, style: { width: INPUT_WIDTH } }) }), jsx_runtime_1.jsx(MultiRangeSlider_1.MultiRangeSlider, { min: minStartFrame, max: maxEndFrame, start: startFrame, end: endFrame, step: 1, onLeftThumbDrag: onStartFrameChangedDirectly, onRightThumbDrag: onEndFrameChangedDirectly }), ' ', jsx_runtime_1.jsx("div", { style: { width: INPUT_WIDTH }, children: jsx_runtime_1.jsx(InputDragger_1.InputDragger, { min: startFrame + 1, max: maxEndFrame, name: "End frame", value: endFrame, step: 1, onTextChange: onEndFrameChanged, onValueChange: onEndFrameChangedDirectly, status: "ok", rightAlign: true, style: { width: INPUT_WIDTH } }) })
|
|
28
33
|
] })
|
|
29
34
|
] }));
|
|
30
35
|
};
|
|
@@ -5,23 +5,23 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const colors_1 = require("../../helpers/colors");
|
|
7
7
|
const container = {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
width: 220,
|
|
8
|
+
height: 6,
|
|
9
|
+
flex: 1,
|
|
10
|
+
minWidth: 80,
|
|
11
|
+
maxWidth: 220,
|
|
13
12
|
position: 'relative',
|
|
14
|
-
backgroundColor: colors_1.
|
|
13
|
+
backgroundColor: colors_1.WHITE_ALPHA_10,
|
|
15
14
|
marginLeft: 8,
|
|
16
15
|
marginRight: 8,
|
|
17
|
-
borderRadius:
|
|
16
|
+
borderRadius: 3,
|
|
18
17
|
};
|
|
19
18
|
// blue slider
|
|
20
19
|
const sliderRange = {
|
|
21
20
|
position: 'absolute',
|
|
22
21
|
top: 0,
|
|
23
22
|
backgroundColor: colors_1.BLUE,
|
|
24
|
-
height:
|
|
23
|
+
height: 6,
|
|
24
|
+
borderRadius: 3,
|
|
25
25
|
};
|
|
26
26
|
const MultiRangeSlider = ({ min, max, start, end, step, onLeftThumbDrag, onRightThumbDrag, }) => {
|
|
27
27
|
const getPercent = (0, react_1.useCallback)((value) => Math.round(((value - min) / (max - min)) * 100), [min, max]);
|
|
@@ -3,16 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.RenderModalEnvironmentVariables = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
-
const colors_1 = require("../../helpers/colors");
|
|
7
6
|
const Button_1 = require("../Button");
|
|
8
7
|
const layout_1 = require("../layout");
|
|
9
8
|
const EnvInput_1 = require("./EnvInput");
|
|
10
|
-
const title = {
|
|
11
|
-
fontSize: 14,
|
|
12
|
-
fontWeight: 'bold',
|
|
13
|
-
color: colors_1.LIGHT_TEXT,
|
|
14
|
-
marginLeft: 16,
|
|
15
|
-
};
|
|
16
9
|
const container = {
|
|
17
10
|
marginTop: 20,
|
|
18
11
|
};
|
|
@@ -41,8 +34,7 @@ const RenderModalEnvironmentVariables = ({ envVariables, setEnvVariables }) => {
|
|
|
41
34
|
setEnvVariables((oldEnv) => [...oldEnv, ['', '']]);
|
|
42
35
|
}, [setEnvVariables]);
|
|
43
36
|
const usedKeys = [];
|
|
44
|
-
return (jsx_runtime_1.jsxs("div", { style: container, children: [
|
|
45
|
-
jsx_runtime_1.jsx("strong", { style: title, children: "Environment variables" }), envVariables.map((env, i) => {
|
|
37
|
+
return (jsx_runtime_1.jsxs("div", { style: container, children: [envVariables.map((env, i) => {
|
|
46
38
|
let isDuplicate = false;
|
|
47
39
|
if (usedKeys.includes(env[0].toUpperCase())) {
|
|
48
40
|
isDuplicate = true;
|
|
@@ -28,6 +28,15 @@ const openIconStyle = {
|
|
|
28
28
|
height: 12,
|
|
29
29
|
flexShrink: 0,
|
|
30
30
|
};
|
|
31
|
+
const outputNameRow = {
|
|
32
|
+
...layout_2.optionRow,
|
|
33
|
+
columnGap: 16,
|
|
34
|
+
};
|
|
35
|
+
const outputNameInputContainer = {
|
|
36
|
+
flex: 1,
|
|
37
|
+
minWidth: 0,
|
|
38
|
+
maxWidth: 280,
|
|
39
|
+
};
|
|
31
40
|
const RenderModalOutputName = ({ existence, inputStyle, outName, onValueChange, validationMessage, label: labelText, }) => {
|
|
32
41
|
const openExistingOutput = (0, react_1.useCallback)(() => {
|
|
33
42
|
(0, actions_1.openInFileExplorer)({ directory: outName }).catch((err) => {
|
|
@@ -38,8 +47,8 @@ const RenderModalOutputName = ({ existence, inputStyle, outName, onValueChange,
|
|
|
38
47
|
return jsx_runtime_1.jsx(folder_1.ExpandedFolderIconSolid, { style: openIconStyle, color: color });
|
|
39
48
|
}, []);
|
|
40
49
|
const fileManagerName = (0, get_file_manager_name_1.getFileManagerName)(window.remotion_fileSystemPlatform);
|
|
41
|
-
return (jsx_runtime_1.jsxs("div", { style:
|
|
42
|
-
jsx_runtime_1.jsx(layout_1.Column, { children: jsx_runtime_1.jsx("div", { style: layout_2.label, children: labelText }) }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsxs("div", { children: [
|
|
50
|
+
return (jsx_runtime_1.jsxs("div", { style: outputNameRow, children: [
|
|
51
|
+
jsx_runtime_1.jsx(layout_1.Column, { children: jsx_runtime_1.jsx("div", { style: layout_2.label, children: labelText }) }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsxs("div", { style: outputNameInputContainer, children: [
|
|
43
52
|
jsx_runtime_1.jsx(RemInput_1.RemotionInput, { status: validationMessage ? 'error' : existence ? 'warning' : 'ok', style: inputStyle, type: "text", value: outName, onChange: onValueChange, rightAlign: true }), validationMessage ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
44
53
|
jsx_runtime_1.jsx(layout_1.Spacing, { y: 1, block: true }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { align: "flex-end", message: validationMessage, type: 'error' })
|
|
45
54
|
] })) : existence ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|