@remotion/studio 4.0.503 → 4.0.505
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 +4 -16
- package/dist/components/AudioWaveform.d.ts +1 -1
- package/dist/components/AudioWaveform.js +36 -3
- package/dist/components/Canvas.js +12 -5
- package/dist/components/CheckboardToggle.js +3 -1
- package/dist/components/CompositionContextButton.d.ts +1 -1
- package/dist/components/CompositionContextButton.js +2 -2
- package/dist/components/CompositionSelector.js +2 -2
- package/dist/components/CompositionSelectorItem.js +6 -7
- package/dist/components/ContextMenu.d.ts +5 -7
- package/dist/components/ContextMenu.js +54 -21
- 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/EditorGuides/Guide.js +2 -2
- package/dist/components/EffectPickerModal.js +70 -9
- 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 +16 -13
- package/dist/components/InlineDropdown.d.ts +3 -2
- package/dist/components/InlineDropdown.js +16 -5
- package/dist/components/InspectorPanel/CompositionMetadata.js +7 -6
- package/dist/components/InspectorPanel/ConnectedCompositionsSection.js +2 -2
- package/dist/components/InspectorPanel/KeyframeInspector.js +2 -3
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +1 -1
- package/dist/components/InspectorPanel/common.js +24 -34
- package/dist/components/InspectorPanel/styles.js +4 -0
- package/dist/components/InspectorSequenceSection.js +1 -1
- package/dist/components/LoopToggle.js +1 -1
- package/dist/components/Menu/MenuItem.js +16 -12
- package/dist/components/MenuBuildIndicator.d.ts +3 -1
- package/dist/components/MenuBuildIndicator.js +14 -59
- package/dist/components/MenuCompositionName.js +3 -63
- package/dist/components/MenuToolbar.js +23 -3
- 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 +5 -0
- package/dist/components/NewComposition/InputDragger.js +11 -6
- package/dist/components/NewComposition/MenuContent.d.ts +1 -1
- package/dist/components/NewComposition/menu-typeahead.d.ts +1 -1
- package/dist/components/Notifications/NotificationCenter.js +12 -2
- package/dist/components/OutlineToggle.js +10 -2
- package/dist/components/PlayPause.js +2 -6
- package/dist/components/PlaybackRateSelector.js +4 -9
- package/dist/components/PreviewToolbar.js +12 -8
- 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 +1 -1
- package/dist/components/RenderButton.js +55 -37
- 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 +13 -22
- package/dist/components/SelectedOutlineOverlay.js +5 -1
- package/dist/components/SidebarRenderButton.js +1 -15
- package/dist/components/SizeSelector.js +4 -9
- 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 +5 -5
- package/dist/components/Timeline/TimelineClipboardKeybindings.js +3 -6
- package/dist/components/Timeline/TimelineDeleteKeybindings.js +5 -7
- package/dist/components/Timeline/TimelineDragHandler.js +3 -0
- package/dist/components/Timeline/TimelineEffectItem.js +6 -2
- package/dist/components/Timeline/TimelineEffectPropItem.js +6 -3
- package/dist/components/Timeline/TimelineExpandedKeyframeRow.d.ts +6 -6
- package/dist/components/Timeline/TimelineExpandedKeyframeRow.js +34 -2
- package/dist/components/Timeline/TimelineHeightContainer.d.ts +1 -0
- package/dist/components/Timeline/TimelineHeightContainer.js +2 -2
- package/dist/components/Timeline/TimelineInOutDragHandler.js +3 -3
- package/dist/components/Timeline/TimelineKeyframeEasingLine.d.ts +5 -3
- package/dist/components/Timeline/TimelineKeyframeEasingLine.js +32 -30
- package/dist/components/Timeline/TimelineList.d.ts +1 -0
- package/dist/components/Timeline/TimelineList.js +2 -3
- package/dist/components/Timeline/TimelineScaleField.js +1 -1
- package/dist/components/Timeline/TimelineSelection.js +2 -3
- package/dist/components/Timeline/TimelineSequence.js +34 -28
- package/dist/components/Timeline/TimelineSequenceItem.d.ts +3 -3
- package/dist/components/Timeline/TimelineSequenceItem.js +34 -23
- package/dist/components/Timeline/TimelineSequencePropItem.d.ts +10 -2
- package/dist/components/Timeline/TimelineSequencePropItem.js +64 -12
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +2 -2
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +38 -5
- package/dist/components/Timeline/TimelineTimeIndicators.js +36 -3
- package/dist/components/Timeline/TimelineVideoInfo.d.ts +1 -1
- package/dist/components/Timeline/TimelineVideoInfo.js +36 -3
- package/dist/components/Timeline/TimelineZoomControls.d.ts +3 -1
- package/dist/components/Timeline/TimelineZoomControls.js +59 -20
- package/dist/components/Timeline/use-expanded-track-keyframe-rows.js +2 -3
- package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.d.ts +1 -1
- package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.js +7 -18
- package/dist/components/Timeline/use-timeline-asset-drop.js +3 -3
- package/dist/components/Timeline/use-timeline-height.d.ts +2 -1
- package/dist/components/Timeline/use-timeline-height.js +3 -2
- package/dist/components/TimelineCombobox.d.ts +11 -0
- package/dist/components/TimelineCombobox.js +181 -0
- package/dist/components/TimelineInOutToggle.js +3 -3
- package/dist/components/TopPanel.js +8 -8
- 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/components/selected-outline-types.d.ts +1 -1
- package/dist/esm/{chunk-bj1r1hh5.js → chunk-7pgk8h5m.js} +9174 -8486
- package/dist/esm/internals.mjs +9174 -8486
- package/dist/esm/previewEntry.mjs +8991 -8303
- package/dist/esm/renderEntry.mjs +1 -1
- package/dist/helpers/hoverable.d.ts +11 -0
- package/dist/helpers/hoverable.js +70 -0
- package/dist/helpers/inject-css.js +43 -23
- package/dist/helpers/install-required-package.d.ts +3 -2
- package/dist/helpers/install-required-package.js +20 -15
- package/dist/helpers/use-is-fullscreen.d.ts +1 -0
- package/dist/helpers/use-is-fullscreen.js +25 -0
- package/dist/helpers/use-menu-structure.js +88 -59
- package/dist/icons/audio.d.ts +1 -1
- package/dist/icons/audio.js +1 -1
- package/dist/icons/canvas-zoom.d.ts +10 -0
- package/dist/icons/canvas-zoom.js +21 -0
- 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/playback-rate.d.ts +5 -0
- package/dist/icons/playback-rate.js +31 -0
- package/dist/icons/plus.js +1 -1
- package/dist/icons/redo.js +2 -2
- package/dist/icons/search.d.ts +5 -0
- package/dist/icons/search.js +10 -0
- 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
|
@@ -9,6 +9,7 @@ const player_1 = require("@remotion/player");
|
|
|
9
9
|
const react_1 = require("react");
|
|
10
10
|
const react_dom_1 = __importDefault(require("react-dom"));
|
|
11
11
|
const colors_1 = require("../../helpers/colors");
|
|
12
|
+
const hoverable_1 = require("../../helpers/hoverable");
|
|
12
13
|
const pointer_session_1 = require("../../helpers/pointer-session");
|
|
13
14
|
const z_index_1 = require("../../state/z-index");
|
|
14
15
|
const MenuContent_1 = require("../NewComposition/MenuContent");
|
|
@@ -17,7 +18,6 @@ const portals_1 = require("./portals");
|
|
|
17
18
|
const styles_1 = require("./styles");
|
|
18
19
|
const container = {
|
|
19
20
|
fontSize: 13,
|
|
20
|
-
color: colors_1.WHITE_ALPHA_80,
|
|
21
21
|
paddingLeft: 10,
|
|
22
22
|
paddingRight: 10,
|
|
23
23
|
cursor: 'default',
|
|
@@ -28,7 +28,6 @@ const container = {
|
|
|
28
28
|
border: 'none',
|
|
29
29
|
};
|
|
30
30
|
const MenuItem = ({ label: itemName, selected, id, onItemSelected, onItemHovered, onItemQuit, onPreviousMenu, onNextMenu, menu, }) => {
|
|
31
|
-
const [hovered, setHovered] = (0, react_1.useState)(false);
|
|
32
31
|
const ref = (0, react_1.useRef)(null);
|
|
33
32
|
const size = player_1.PlayerInternals.useElementSize(ref, {
|
|
34
33
|
triggerOnWindowResize: true,
|
|
@@ -38,13 +37,20 @@ const MenuItem = ({ label: itemName, selected, id, onItemSelected, onItemHovered
|
|
|
38
37
|
const containerStyle = (0, react_1.useMemo)(() => {
|
|
39
38
|
return {
|
|
40
39
|
...container,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
...(0, hoverable_1.hoverableStyle)({
|
|
41
|
+
idleBackground: (0, colors_1.getBackgroundFromHoverState)({
|
|
42
|
+
hovered: false,
|
|
43
|
+
selected,
|
|
44
|
+
}),
|
|
45
|
+
hoverBackground: (0, colors_1.getBackgroundFromHoverState)({
|
|
46
|
+
hovered: true,
|
|
47
|
+
selected,
|
|
48
|
+
}),
|
|
49
|
+
idleColor: selected ? colors_1.WHITE : colors_1.WHITE_ALPHA_80,
|
|
50
|
+
hoverColor: colors_1.WHITE,
|
|
45
51
|
}),
|
|
46
52
|
};
|
|
47
|
-
}, [
|
|
53
|
+
}, [selected]);
|
|
48
54
|
const portalStyle = (0, react_1.useMemo)(() => {
|
|
49
55
|
if (!selected || !size) {
|
|
50
56
|
return null;
|
|
@@ -55,13 +61,11 @@ const MenuItem = ({ label: itemName, selected, id, onItemSelected, onItemHovered
|
|
|
55
61
|
top: size.top + size.height,
|
|
56
62
|
};
|
|
57
63
|
}, [selected, size]);
|
|
64
|
+
// Not for styling (which is done via CSS :hover), but for switching
|
|
65
|
+
// between menus when a menu is already open.
|
|
58
66
|
const onPointerEnter = (0, react_1.useCallback)(() => {
|
|
59
67
|
onItemHovered(id);
|
|
60
|
-
setHovered(true);
|
|
61
68
|
}, [id, onItemHovered]);
|
|
62
|
-
const onPointerLeave = (0, react_1.useCallback)(() => {
|
|
63
|
-
setHovered(false);
|
|
64
|
-
}, []);
|
|
65
69
|
const onPointerDown = (0, react_1.useCallback)((e) => {
|
|
66
70
|
// Prevent deselection of currently selected items
|
|
67
71
|
e.stopPropagation();
|
|
@@ -105,7 +109,7 @@ const MenuItem = ({ label: itemName, selected, id, onItemSelected, onItemHovered
|
|
|
105
109
|
};
|
|
106
110
|
}, [size]);
|
|
107
111
|
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
108
|
-
jsx_runtime_1.jsx("button", { ref: ref, role: "button", tabIndex: tabIndex, onPointerEnter: onPointerEnter,
|
|
112
|
+
jsx_runtime_1.jsx("button", { ref: ref, role: "button", tabIndex: tabIndex, onPointerEnter: onPointerEnter, onPointerDown: onPointerDown, onClick: onClick, style: containerStyle, type: "button", className: `${is_menu_item_1.MENU_INITIATOR_CLASSNAME} ${hoverable_1.HOVERABLE_CLASS_NAME}`, children: itemName }), portalStyle
|
|
109
113
|
? react_dom_1.default.createPortal(jsx_runtime_1.jsx("div", { className: "css-reset", style: outerStyle, children: jsx_runtime_1.jsx(z_index_1.HigherZIndex, { onEscape: onItemQuit, onOutsideClick: onItemQuit, children: jsx_runtime_1.jsx("div", { style: portalStyle, onPointerDown: onMenuPointerDown, children: jsx_runtime_1.jsx(MenuContent_1.MenuContent, { onNextMenu: onPreviousMenu, onPreviousMenu: onNextMenu, values: menu.items, onHide: onItemQuit, leaveLeftSpace: menu.leaveLeftPadding, preselectIndex: false, topItemCanBeUnselected: true, fixedHeight: null }) }) }) }), (0, portals_1.getPortal)(currentZIndex))
|
|
110
114
|
: null] }));
|
|
111
115
|
};
|
|
@@ -3,12 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.MenuBuildIndicator = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const open_in_editor_1 = require("../helpers/open-in-editor");
|
|
6
|
+
const colors_1 = require("../helpers/colors");
|
|
7
|
+
const InspectorOpenInEditor_1 = require("./InspectorOpenInEditor");
|
|
9
8
|
const layout_1 = require("./layout");
|
|
10
9
|
const MenuCompositionName_1 = require("./MenuCompositionName");
|
|
11
|
-
const NotificationCenter_1 = require("./Notifications/NotificationCenter");
|
|
12
10
|
const Spinner_1 = require("./Spinner");
|
|
13
11
|
const cwd = {
|
|
14
12
|
fontSize: 13,
|
|
@@ -27,60 +25,15 @@ const noSpinner = {
|
|
|
27
25
|
position: 'relative',
|
|
28
26
|
width: spinnerSize,
|
|
29
27
|
};
|
|
30
|
-
const
|
|
31
|
-
color: 'inherit',
|
|
32
|
-
textDecoration: 'none',
|
|
33
|
-
cursor: 'pointer',
|
|
34
|
-
fontSize: 'inherit',
|
|
35
|
-
textUnderlineOffset: 2,
|
|
36
|
-
};
|
|
37
|
-
const projectNameLink = {
|
|
38
|
-
...projectNameLinkBase,
|
|
39
|
-
};
|
|
40
|
-
const projectNameLinkHovered = {
|
|
41
|
-
...projectNameLinkBase,
|
|
42
|
-
textDecoration: 'underline',
|
|
43
|
-
};
|
|
44
|
-
const MenuBuildIndicator = () => {
|
|
28
|
+
const MenuBuildIndicator = ({ mobileLayout }) => {
|
|
45
29
|
const [isBuilding, setIsBuilding] = (0, react_1.useState)(false);
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
originalFileName: `${window.remotion_cwd}`,
|
|
54
|
-
originalLineNumber: 1,
|
|
55
|
-
originalColumnNumber: 1,
|
|
56
|
-
originalFunctionName: null,
|
|
57
|
-
originalScriptCode: null,
|
|
58
|
-
}, null)
|
|
59
|
-
.then(({ success }) => {
|
|
60
|
-
if (!success) {
|
|
61
|
-
(0, NotificationCenter_1.showNotification)(`Could not open ${window.remotion_editorName}`, 2000);
|
|
62
|
-
}
|
|
63
|
-
})
|
|
64
|
-
.catch((err) => {
|
|
65
|
-
// eslint-disable-next-line no-console
|
|
66
|
-
console.error(err);
|
|
67
|
-
(0, NotificationCenter_1.showNotification)(`Could not open ${window.remotion_editorName}`, 2000);
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
else if (showGitLink) {
|
|
71
|
-
window.open((0, get_git_menu_item_1.getGitSourceBranchUrl)(window.remotion_gitSource), '_blank');
|
|
72
|
-
}
|
|
73
|
-
}, [showEditorLink, showGitLink]);
|
|
74
|
-
const projectNameTitle = (0, react_1.useMemo)(() => {
|
|
75
|
-
if (showEditorLink) {
|
|
76
|
-
return `Open in ${window.remotion_editorName}`;
|
|
77
|
-
}
|
|
78
|
-
if (showGitLink) {
|
|
79
|
-
return `Open ${(0, get_git_menu_item_1.getGitSourceName)(window.remotion_gitSource)} Repo`;
|
|
80
|
-
}
|
|
81
|
-
return undefined;
|
|
82
|
-
}, [showEditorLink, showGitLink]);
|
|
83
|
-
const isClickable = showEditorLink || showGitLink;
|
|
30
|
+
const folderLocation = (0, react_1.useMemo)(() => {
|
|
31
|
+
return {
|
|
32
|
+
source: window.remotion_cwd,
|
|
33
|
+
line: 1,
|
|
34
|
+
column: 1,
|
|
35
|
+
};
|
|
36
|
+
}, []);
|
|
84
37
|
(0, react_1.useEffect)(() => {
|
|
85
38
|
window.remotion_isBuilding = () => {
|
|
86
39
|
setIsBuilding(true);
|
|
@@ -93,7 +46,9 @@ const MenuBuildIndicator = () => {
|
|
|
93
46
|
window.remotion_finishedBuilding = undefined;
|
|
94
47
|
};
|
|
95
48
|
}, []);
|
|
96
|
-
return (jsx_runtime_1.jsxs("div", { style: cwd, title: window.remotion_cwd, children: [
|
|
97
|
-
|
|
49
|
+
return (jsx_runtime_1.jsxs("div", { style: cwd, title: window.remotion_cwd, children: [
|
|
50
|
+
jsx_runtime_1.jsx(layout_1.Spacing, { x: mobileLayout ? 0.5 : 2 }), window.remotion_projectName, jsx_runtime_1.jsx(MenuCompositionName_1.MenuCompositionName, {}), jsx_runtime_1.jsx(InspectorOpenInEditor_1.InspectorOpenInEditor, { location: folderLocation }), mobileLayout ? null : jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }), mobileLayout ? (isBuilding ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
51
|
+
jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }), jsx_runtime_1.jsx("div", { style: spinner, children: jsx_runtime_1.jsx(Spinner_1.Spinner, { duration: 0.5, size: spinnerSize, color: colors_1.WHITE_ALPHA_80 }) })
|
|
52
|
+
] })) : null) : isBuilding ? (jsx_runtime_1.jsx("div", { style: spinner, children: jsx_runtime_1.jsx(Spinner_1.Spinner, { duration: 0.5, size: spinnerSize, color: colors_1.WHITE_ALPHA_80 }) })) : (jsx_runtime_1.jsx("div", { style: noSpinner }))] }));
|
|
98
53
|
};
|
|
99
54
|
exports.MenuBuildIndicator = MenuBuildIndicator;
|
|
@@ -4,13 +4,7 @@ exports.MenuCompositionName = 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 client_id_1 = require("../helpers/client-id");
|
|
8
7
|
const colors_1 = require("../helpers/colors");
|
|
9
|
-
const get_file_manager_name_1 = require("../helpers/get-file-manager-name");
|
|
10
|
-
const open_in_editor_1 = require("../helpers/open-in-editor");
|
|
11
|
-
const NotificationCenter_1 = require("./Notifications/NotificationCenter");
|
|
12
|
-
const actions_1 = require("./RenderQueue/actions");
|
|
13
|
-
const use_resolved_stack_1 = require("./Timeline/use-resolved-stack");
|
|
14
8
|
const baseStyle = {
|
|
15
9
|
color: 'inherit',
|
|
16
10
|
textDecoration: 'none',
|
|
@@ -22,14 +16,6 @@ const compositionNameStyle = {
|
|
|
22
16
|
...baseStyle,
|
|
23
17
|
cursor: 'default',
|
|
24
18
|
};
|
|
25
|
-
const clickableStyle = {
|
|
26
|
-
...baseStyle,
|
|
27
|
-
cursor: 'pointer',
|
|
28
|
-
};
|
|
29
|
-
const clickableHoveredStyle = {
|
|
30
|
-
...clickableStyle,
|
|
31
|
-
textDecoration: 'underline',
|
|
32
|
-
};
|
|
33
19
|
const slashStyle = {
|
|
34
20
|
color: colors_1.LIGHT_TEXT,
|
|
35
21
|
marginInline: 4,
|
|
@@ -37,12 +23,8 @@ const slashStyle = {
|
|
|
37
23
|
top: 1,
|
|
38
24
|
};
|
|
39
25
|
const MenuCompositionName = () => {
|
|
40
|
-
var _a
|
|
26
|
+
var _a;
|
|
41
27
|
const { canvasContent, compositions } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
42
|
-
const connectionStatus = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx)
|
|
43
|
-
.previewServerState.type;
|
|
44
|
-
const [opening, setOpening] = (0, react_1.useState)(false);
|
|
45
|
-
const [hovered, setHovered] = (0, react_1.useState)(false);
|
|
46
28
|
const composition = (0, react_1.useMemo)(() => {
|
|
47
29
|
var _a;
|
|
48
30
|
if (canvasContent === null || canvasContent.type !== 'composition') {
|
|
@@ -51,54 +33,12 @@ const MenuCompositionName = () => {
|
|
|
51
33
|
return ((_a = compositions.find((c) => c.id === canvasContent.compositionId)) !== null && _a !== void 0 ? _a : null);
|
|
52
34
|
}, [canvasContent, compositions]);
|
|
53
35
|
const asset = (canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) === 'asset' ? canvasContent.asset : null;
|
|
54
|
-
const resolvedLocation = (0, use_resolved_stack_1.useResolvedStack)((_a = composition === null || composition === void 0 ? void 0 : composition.stack) !== null && _a !== void 0 ? _a : null);
|
|
55
|
-
const fileManagerName = (0, get_file_manager_name_1.getFileManagerName)(window.remotion_fileSystemPlatform);
|
|
56
|
-
const canOpenComposition = resolvedLocation &&
|
|
57
|
-
window.remotion_editorName &&
|
|
58
|
-
connectionStatus === 'connected';
|
|
59
|
-
const canOpenAsset = asset !== null &&
|
|
60
|
-
window.remotion_publicFolderExists !== null &&
|
|
61
|
-
connectionStatus === 'connected';
|
|
62
|
-
const canOpen = canOpenComposition || canOpenAsset;
|
|
63
|
-
const handleClick = (0, react_1.useCallback)(async () => {
|
|
64
|
-
if (!canOpen || opening) {
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
setOpening(true);
|
|
68
|
-
try {
|
|
69
|
-
if (asset !== null && window.remotion_publicFolderExists !== null) {
|
|
70
|
-
await (0, actions_1.openInFileExplorer)({
|
|
71
|
-
directory: `${window.remotion_publicFolderExists}/${asset}`,
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
else if (resolvedLocation) {
|
|
75
|
-
await (0, open_in_editor_1.openOriginalPositionInEditor)(resolvedLocation, null);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
catch (err) {
|
|
79
|
-
(0, NotificationCenter_1.showNotification)(err.message, 2000);
|
|
80
|
-
}
|
|
81
|
-
finally {
|
|
82
|
-
setOpening(false);
|
|
83
|
-
}
|
|
84
|
-
}, [asset, canOpen, opening, resolvedLocation]);
|
|
85
36
|
if (!composition && asset === null) {
|
|
86
37
|
return null;
|
|
87
38
|
}
|
|
88
|
-
const name = (
|
|
89
|
-
const title = composition
|
|
90
|
-
? canOpenComposition
|
|
91
|
-
? `Open in ${window.remotion_editorName}`
|
|
92
|
-
: composition.id
|
|
93
|
-
: canOpenAsset
|
|
94
|
-
? `Show in ${fileManagerName}`
|
|
95
|
-
: (asset !== null && asset !== void 0 ? asset : undefined);
|
|
39
|
+
const name = (_a = composition === null || composition === void 0 ? void 0 : composition.id) !== null && _a !== void 0 ? _a : asset;
|
|
96
40
|
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
97
|
-
jsx_runtime_1.jsx("span", { style: slashStyle, children: "/" }), jsx_runtime_1.jsx("
|
|
98
|
-
? hovered
|
|
99
|
-
? clickableHoveredStyle
|
|
100
|
-
: clickableStyle
|
|
101
|
-
: compositionNameStyle, title: title, onClick: handleClick, onPointerEnter: () => setHovered(true), onPointerLeave: () => setHovered(false), children: name })
|
|
41
|
+
jsx_runtime_1.jsx("span", { style: slashStyle, children: "/" }), jsx_runtime_1.jsx("span", { style: compositionNameStyle, children: name })
|
|
102
42
|
] }));
|
|
103
43
|
};
|
|
104
44
|
exports.MenuCompositionName = MenuCompositionName;
|
|
@@ -3,11 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.MenuToolbar = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
+
const ShortcutHint_1 = require("../error-overlay/remotion-overlay/ShortcutHint");
|
|
6
7
|
const browser_studio_operations_1 = require("../helpers/browser-studio-operations");
|
|
7
8
|
const client_id_1 = require("../helpers/client-id");
|
|
8
9
|
const colors_1 = require("../helpers/colors");
|
|
9
10
|
const mobile_layout_1 = require("../helpers/mobile-layout");
|
|
11
|
+
const use_keybinding_1 = require("../helpers/use-keybinding");
|
|
10
12
|
const use_menu_structure_1 = require("../helpers/use-menu-structure");
|
|
13
|
+
const search_1 = require("../icons/search");
|
|
14
|
+
const modals_1 = require("../state/modals");
|
|
15
|
+
const InlineAction_1 = require("./InlineAction");
|
|
11
16
|
const layout_1 = require("./layout");
|
|
12
17
|
const menu_toolbar_height_1 = require("./menu-toolbar-height");
|
|
13
18
|
const MenuItem_1 = require("./Menu/MenuItem");
|
|
@@ -34,6 +39,7 @@ const flex = {
|
|
|
34
39
|
const MenuToolbar = ({ readOnlyStudio }) => {
|
|
35
40
|
const [selected, setSelected] = (0, react_1.useState)(null);
|
|
36
41
|
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
42
|
+
const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
37
43
|
const browserStudioOperations = (0, browser_studio_operations_1.getBrowserStudioOperations)();
|
|
38
44
|
const canUndoAndRedo = !readOnlyStudio ||
|
|
39
45
|
(previewServerState.type === 'connected' &&
|
|
@@ -104,11 +110,25 @@ const MenuToolbar = ({ readOnlyStudio }) => {
|
|
|
104
110
|
// Prevent deselection of currently selected items
|
|
105
111
|
e.stopPropagation();
|
|
106
112
|
}, []);
|
|
113
|
+
const openQuickSwitcher = (0, react_1.useCallback)(() => {
|
|
114
|
+
setSelectedModal({
|
|
115
|
+
type: 'quick-switcher',
|
|
116
|
+
mode: 'compositions',
|
|
117
|
+
invocationTimestamp: Date.now(),
|
|
118
|
+
assetSelection: null,
|
|
119
|
+
compositionSelection: null,
|
|
120
|
+
});
|
|
121
|
+
}, [setSelectedModal]);
|
|
122
|
+
const renderSearchIcon = (0, react_1.useCallback)((color) => {
|
|
123
|
+
return jsx_runtime_1.jsx(search_1.SearchIcon, { color: color, width: 18, height: 18 });
|
|
124
|
+
}, []);
|
|
125
|
+
const searchTooltip = (0, use_keybinding_1.areKeyboardShortcutsDisabled)()
|
|
126
|
+
? 'Quick Switcher'
|
|
127
|
+
: `Quick Switcher (${ShortcutHint_1.cmdOrCtrlCharacter}+K)`;
|
|
107
128
|
return (jsx_runtime_1.jsxs(layout_1.Row, { align: "center", className: "css-reset", style: row, onPointerDown: onPointerDown, children: [
|
|
108
|
-
jsx_runtime_1.jsxs("div", { style: fixedWidthLeft, children: [
|
|
109
|
-
jsx_runtime_1.jsx(SidebarCollapserControls_1.SidebarCollapserControl, { side: "left" }), structure.map((s) => {
|
|
129
|
+
jsx_runtime_1.jsxs("div", { style: fixedWidthLeft, children: [mobileLayout ? (jsx_runtime_1.jsx(InlineAction_1.InlineAction, { variant: null, onClick: openQuickSwitcher, renderAction: renderSearchIcon, title: searchTooltip })) : (jsx_runtime_1.jsx(SidebarCollapserControls_1.SidebarCollapserControl, { side: "left" })), structure.map((s) => {
|
|
110
130
|
return (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));
|
|
111
|
-
}), readOnlyStudio ? null : jsx_runtime_1.jsx(UpdateCheck_1.UpdateCheck, {})] }), jsx_runtime_1.jsx("div", { style: flex }), jsx_runtime_1.jsx(MenuBuildIndicator_1.MenuBuildIndicator, {}), jsx_runtime_1.jsx("div", { style: flex }), jsx_runtime_1.jsxs("div", { style: fixedWidthRight, children: [canUndoAndRedo ? jsx_runtime_1.jsx(UndoRedoButtons_1.UndoRedoButtons, {}) : null, jsx_runtime_1.jsx(SidebarCollapserControls_1.SidebarCollapserControl, { side: "right" })
|
|
131
|
+
}), readOnlyStudio || browserStudioOperations ? null : jsx_runtime_1.jsx(UpdateCheck_1.UpdateCheck, {})] }), mobileLayout ? null : jsx_runtime_1.jsx("div", { style: flex }), jsx_runtime_1.jsx(MenuBuildIndicator_1.MenuBuildIndicator, { mobileLayout: mobileLayout }), jsx_runtime_1.jsx("div", { style: flex }), jsx_runtime_1.jsxs("div", { style: fixedWidthRight, children: [canUndoAndRedo ? jsx_runtime_1.jsx(UndoRedoButtons_1.UndoRedoButtons, {}) : null, jsx_runtime_1.jsx(SidebarCollapserControls_1.SidebarCollapserControl, { side: "right" })
|
|
112
132
|
] })
|
|
113
133
|
] }));
|
|
114
134
|
};
|
|
@@ -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,8 +60,13 @@ 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;
|
|
69
|
+
readonly allowStepMismatch?: boolean | undefined;
|
|
65
70
|
readonly snapToStep?: boolean | undefined;
|
|
66
71
|
readonly dragDecimalPlaces?: number | undefined;
|
|
67
72
|
readonly dragSensitivity?: number | 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, allowStepMismatch = false, 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);
|
|
@@ -307,6 +307,7 @@ const InputDraggerForwardRefFn = ({ onValueChange, onValueChangeEnd, min: _min,
|
|
|
307
307
|
step: _step,
|
|
308
308
|
});
|
|
309
309
|
}, [_min, _step, snapToStep]);
|
|
310
|
+
const validationStep = allowStepMismatch ? 'any' : deriveStep;
|
|
310
311
|
const span = (0, react_1.useMemo)(() => ({
|
|
311
312
|
color: dragging ? 'var(--remotion-cli-internals-blue-hovered)' : colors_1.BLUE,
|
|
312
313
|
cursor: 'ew-resize',
|
|
@@ -314,7 +315,8 @@ const InputDraggerForwardRefFn = ({ onValueChange, onValueChangeEnd, min: _min,
|
|
|
314
315
|
WebkitUserSelect: 'none',
|
|
315
316
|
fontSize: small ? 12 : 14,
|
|
316
317
|
fontVariantNumeric: 'tabular-nums',
|
|
317
|
-
|
|
318
|
+
...formatterStyle,
|
|
319
|
+
}), [dragging, formatterStyle, small]);
|
|
318
320
|
const onFocus = (0, react_1.useCallback)(() => {
|
|
319
321
|
if (!small || pointerDownRef.current) {
|
|
320
322
|
return;
|
|
@@ -365,7 +367,7 @@ const InputDraggerForwardRefFn = ({ onValueChange, onValueChangeEnd, min: _min,
|
|
|
365
367
|
const validation = (0, exports.validateInputDraggerValue)({
|
|
366
368
|
max: _max,
|
|
367
369
|
min: _min,
|
|
368
|
-
step:
|
|
370
|
+
step: validationStep,
|
|
369
371
|
value: newValue,
|
|
370
372
|
});
|
|
371
373
|
if (validation.valid) {
|
|
@@ -377,7 +379,7 @@ const InputDraggerForwardRefFn = ({ onValueChange, onValueChangeEnd, min: _min,
|
|
|
377
379
|
fallbackRef.current.setCustomValidity(validation.message);
|
|
378
380
|
fallbackRef.current.reportValidity();
|
|
379
381
|
}
|
|
380
|
-
}, [_max, _min,
|
|
382
|
+
}, [_max, _min, onEscape, onValueChangeEnd, validationStep]);
|
|
381
383
|
const onInputKeyDown = (0, react_1.useCallback)((e) => {
|
|
382
384
|
var _a;
|
|
383
385
|
if (e.key === 'Enter') {
|
|
@@ -482,8 +484,11 @@ const InputDraggerForwardRefFn = ({ onValueChange, onValueChangeEnd, min: _min,
|
|
|
482
484
|
}
|
|
483
485
|
}, [inputFallback]);
|
|
484
486
|
if (inputFallback) {
|
|
485
|
-
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:
|
|
487
|
+
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: validationStep, defaultValue: value, status: status, rightAlign: rightAlign, small: small, ...props, type: "text" }) }));
|
|
486
488
|
}
|
|
487
|
-
return (jsx_runtime_1.
|
|
489
|
+
return (jsx_runtime_1.jsxs("button", { ref: ref, type: "button", "aria-label": props['aria-label'], className: '__remotion_input_dragger', style: buttonStyle
|
|
490
|
+
? { ...exports.inputDraggerContainerStyle, ...buttonStyle }
|
|
491
|
+
: exports.inputDraggerContainerStyle, onClick: onClick, onFocus: onFocus, onKeyDown: onKeyDown, onPointerDown: onPointerDown, children: [
|
|
492
|
+
jsx_runtime_1.jsx("span", { style: span, children: formatter(value) }), formatterSubtitle ? (jsx_runtime_1.jsx("span", { style: formatterSubtitleStyle, children: formatterSubtitle(value) })) : null] }));
|
|
488
493
|
};
|
|
489
494
|
exports.InputDragger = react_1.default.forwardRef(InputDraggerForwardRefFn);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ComboboxValue } from './ComboBox';
|
|
3
3
|
export declare const MenuContent: React.FC<{
|
|
4
|
-
readonly values: ComboboxValue[];
|
|
4
|
+
readonly values: readonly ComboboxValue[];
|
|
5
5
|
readonly onHide: () => void;
|
|
6
6
|
readonly onNextMenu: () => void;
|
|
7
7
|
readonly onPreviousMenu: () => void;
|
|
@@ -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,22 +18,19 @@ 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)();
|
|
35
31
|
const videoConfig = remotion_1.Internals.useUnsafeVideoConfig();
|
|
36
32
|
const [showBufferIndicator, setShowBufferState] = (0, react_1.useState)(false);
|
|
37
|
-
const { playing, play, pause, pauseAndReturnToPlayStart, frameBack, seek, frameForward,
|
|
33
|
+
const { playing, play, pause, pauseAndReturnToPlayStart, frameBack, seek, frameForward, emitter, getCurrentFrame, } = player_1.PlayerInternals.usePlayer();
|
|
38
34
|
player_1.PlayerInternals.usePlayback({
|
|
39
35
|
loop,
|
|
40
36
|
playbackRate,
|
|
@@ -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
|
|
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, 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, 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, onClick: oneFrameForward, children: (color) => jsx_runtime_1.jsx(step_forward_1.StepForward, { style: forwardBackStyle, color: color }) }))] }));
|
|
202
198
|
};
|
|
203
199
|
exports.PlayPause = PlayPause;
|