@remotion/studio 4.0.126 → 4.0.128
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/.turbo/turbo-build.log +1 -1
- package/dist/components/AssetSelectorItem.js +7 -0
- package/dist/components/ContextMenu.js +12 -5
- package/dist/components/InitialCompositionLoader.js +7 -0
- package/dist/components/Menu/styles.d.ts +1 -0
- package/dist/components/Menu/styles.js +2 -1
- package/dist/components/MobilePanel.d.ts +5 -0
- package/dist/components/MobilePanel.js +36 -0
- package/dist/components/NewComposition/ComboBox.js +16 -7
- package/dist/components/NewComposition/MenuContent.js +12 -6
- package/dist/components/NewComposition/RemInput.d.ts +1 -1
- package/dist/components/OptionsPanel.js +10 -7
- package/dist/components/RenderQueue/RenderQueueRepeat.js +7 -0
- package/dist/components/SidebarRenderButton.js +7 -0
- package/dist/components/TopPanel.js +7 -1
- package/dist/helpers/checkerboard-background.d.ts +1 -1
- package/dist/helpers/colors.d.ts +1 -1
- package/dist/helpers/presets-labels.d.ts +1 -1
- package/dist/state/sidebar.js +12 -4
- package/package.json +7 -7
- package/tsconfig.tsbuildinfo +1 -1
- package/.turbo/turbo-test.log +0 -157
- package/dist/helpers/use-el-size.d.ts +0 -5
- package/dist/helpers/use-el-size.js +0 -44
package/.turbo/turbo-build.log
CHANGED
|
@@ -33,11 +33,13 @@ const remotion_1 = require("remotion");
|
|
|
33
33
|
const no_react_1 = require("remotion/no-react");
|
|
34
34
|
const colors_1 = require("../helpers/colors");
|
|
35
35
|
const copy_text_1 = require("../helpers/copy-text");
|
|
36
|
+
const mobile_layout_1 = require("../helpers/mobile-layout");
|
|
36
37
|
const url_state_1 = require("../helpers/url-state");
|
|
37
38
|
const use_asset_drag_events_1 = __importDefault(require("../helpers/use-asset-drag-events"));
|
|
38
39
|
const clipboard_1 = require("../icons/clipboard");
|
|
39
40
|
const file_1 = require("../icons/file");
|
|
40
41
|
const folder_1 = require("../icons/folder");
|
|
42
|
+
const sidebar_1 = require("../state/sidebar");
|
|
41
43
|
const InlineAction_1 = require("./InlineAction");
|
|
42
44
|
const layout_1 = require("./layout");
|
|
43
45
|
const NotificationCenter_1 = require("./Notifications/NotificationCenter");
|
|
@@ -137,7 +139,9 @@ const AssetFolderTree = ({ item, level, name, parentFolder, toggleFolder, tabInd
|
|
|
137
139
|
};
|
|
138
140
|
exports.AssetFolderTree = AssetFolderTree;
|
|
139
141
|
const AssetSelectorItem = ({ item, tabIndex, level, parentFolder }) => {
|
|
142
|
+
const isMobileLayout = (0, mobile_layout_1.useMobileLayout)();
|
|
140
143
|
const [hovered, setHovered] = (0, react_1.useState)(false);
|
|
144
|
+
const { setSidebarCollapsedState } = (0, react_1.useContext)(sidebar_1.SidebarContext);
|
|
141
145
|
const onPointerEnter = (0, react_1.useCallback)(() => {
|
|
142
146
|
setHovered(true);
|
|
143
147
|
}, []);
|
|
@@ -158,6 +162,9 @@ const AssetSelectorItem = ({ item, tabIndex, level, parentFolder }) => {
|
|
|
158
162
|
: item.name;
|
|
159
163
|
setCanvasContent({ type: 'asset', asset: relativePath });
|
|
160
164
|
(0, url_state_1.pushUrl)(`/assets/${relativePath}`);
|
|
165
|
+
if (isMobileLayout) {
|
|
166
|
+
setSidebarCollapsedState({ left: 'collapsed', right: 'collapsed' });
|
|
167
|
+
}
|
|
161
168
|
}, [item.name, parentFolder, setCanvasContent]);
|
|
162
169
|
const style = (0, react_1.useMemo)(() => {
|
|
163
170
|
return {
|
|
@@ -8,6 +8,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
8
8
|
const player_1 = require("@remotion/player");
|
|
9
9
|
const react_1 = require("react");
|
|
10
10
|
const react_dom_1 = __importDefault(require("react-dom"));
|
|
11
|
+
const mobile_layout_1 = require("../helpers/mobile-layout");
|
|
11
12
|
const noop_1 = require("../helpers/noop");
|
|
12
13
|
const z_index_1 = require("../state/z-index");
|
|
13
14
|
const portals_1 = require("./Menu/portals");
|
|
@@ -24,6 +25,7 @@ const ContextMenu = ({ children, values }) => {
|
|
|
24
25
|
triggerOnWindowResize: true,
|
|
25
26
|
shouldApplyCssTransforms: true,
|
|
26
27
|
});
|
|
28
|
+
const isMobileLayout = (0, mobile_layout_1.useMobileLayout)();
|
|
27
29
|
(0, react_1.useEffect)(() => {
|
|
28
30
|
const { current } = ref;
|
|
29
31
|
if (!current) {
|
|
@@ -59,10 +61,15 @@ const ContextMenu = ({ children, values }) => {
|
|
|
59
61
|
if (!size) {
|
|
60
62
|
return;
|
|
61
63
|
}
|
|
62
|
-
const spaceToRight = size.windowSize.width -
|
|
63
|
-
const
|
|
64
|
+
const spaceToRight = size.windowSize.width - size.left;
|
|
65
|
+
const spaceToLeft = size.left + size.width;
|
|
66
|
+
const minSpaceRequired = isMobileLayout
|
|
67
|
+
? styles_1.MAX_MOBILE_MENU_WIDTH
|
|
68
|
+
: styles_1.MAX_MENU_WIDTH;
|
|
64
69
|
const verticalLayout = spaceToTop > spaceToBottom ? 'bottom' : 'top';
|
|
65
|
-
const
|
|
70
|
+
const canOpenOnLeft = spaceToLeft >= minSpaceRequired;
|
|
71
|
+
const canOpenOnRight = spaceToRight >= minSpaceRequired;
|
|
72
|
+
const horizontalLayout = canOpenOnRight ? 'left' : 'right';
|
|
66
73
|
return {
|
|
67
74
|
...styles_1.menuContainerTowardsTop,
|
|
68
75
|
...(verticalLayout === 'top'
|
|
@@ -77,10 +84,10 @@ const ContextMenu = ({ children, values }) => {
|
|
|
77
84
|
left: opened.left,
|
|
78
85
|
}
|
|
79
86
|
: {
|
|
80
|
-
right: size.windowSize.width - opened.left,
|
|
87
|
+
right: canOpenOnLeft ? size.windowSize.width - opened.left : 0,
|
|
81
88
|
}),
|
|
82
89
|
};
|
|
83
|
-
}, [opened,
|
|
90
|
+
}, [opened.type, size, isMobileLayout, spaceToTop, spaceToBottom]);
|
|
84
91
|
const onHide = (0, react_1.useCallback)(() => {
|
|
85
92
|
setOpened({ type: 'not-open' });
|
|
86
93
|
}, []);
|
|
@@ -3,8 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.InitialCompositionLoader = exports.useSelectComposition = exports.useSelectAsset = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const remotion_1 = require("remotion");
|
|
6
|
+
const mobile_layout_1 = require("../helpers/mobile-layout");
|
|
6
7
|
const url_state_1 = require("../helpers/url-state");
|
|
7
8
|
const folders_1 = require("../state/folders");
|
|
9
|
+
const sidebar_1 = require("../state/sidebar");
|
|
8
10
|
const CompositionSelector_1 = require("./CompositionSelector");
|
|
9
11
|
const ExplorerPanel_1 = require("./ExplorerPanel");
|
|
10
12
|
const ZoomPersistor_1 = require("./ZoomPersistor");
|
|
@@ -34,6 +36,8 @@ exports.useSelectAsset = useSelectAsset;
|
|
|
34
36
|
const useSelectComposition = () => {
|
|
35
37
|
const { setCompositionFoldersExpanded } = (0, react_1.useContext)(folders_1.FolderContext);
|
|
36
38
|
const { setCanvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
39
|
+
const isMobileLayout = (0, mobile_layout_1.useMobileLayout)();
|
|
40
|
+
const { setSidebarCollapsedState } = (0, react_1.useContext)(sidebar_1.SidebarContext);
|
|
37
41
|
return (c, push) => {
|
|
38
42
|
var _a;
|
|
39
43
|
if (push) {
|
|
@@ -53,6 +57,9 @@ const useSelectComposition = () => {
|
|
|
53
57
|
}
|
|
54
58
|
return newState;
|
|
55
59
|
});
|
|
60
|
+
if (isMobileLayout) {
|
|
61
|
+
setSidebarCollapsedState({ left: 'collapsed', right: 'collapsed' });
|
|
62
|
+
}
|
|
56
63
|
}
|
|
57
64
|
};
|
|
58
65
|
};
|
|
@@ -2,6 +2,7 @@ import type React from 'react';
|
|
|
2
2
|
export declare const MENU_VERTICAL_PADDING = 4;
|
|
3
3
|
export declare const SUBMENU_LEFT_INSET = -8;
|
|
4
4
|
export declare const MAX_MENU_WIDTH = 400;
|
|
5
|
+
export declare const MAX_MOBILE_MENU_WIDTH = 300;
|
|
5
6
|
export declare const SHADOW_TOWARDS_BOTTOM = "0 2px 8px rgba(0, 0, 0, 0.5)";
|
|
6
7
|
export declare const SHADOW_TOWARDS_TOP = "0 -2px 8px rgba(0, 0, 0, 0.5)";
|
|
7
8
|
export declare const menuContainerTowardsBottom: React.CSSProperties;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.inlineCodeSnippet = exports.outerPortal = exports.fullScreenOverlay = exports.menuContainerTowardsTop = exports.menuContainerTowardsBottom = exports.SHADOW_TOWARDS_TOP = exports.SHADOW_TOWARDS_BOTTOM = exports.MAX_MENU_WIDTH = exports.SUBMENU_LEFT_INSET = exports.MENU_VERTICAL_PADDING = void 0;
|
|
3
|
+
exports.inlineCodeSnippet = exports.outerPortal = exports.fullScreenOverlay = exports.menuContainerTowardsTop = exports.menuContainerTowardsBottom = exports.SHADOW_TOWARDS_TOP = exports.SHADOW_TOWARDS_BOTTOM = exports.MAX_MOBILE_MENU_WIDTH = exports.MAX_MENU_WIDTH = exports.SUBMENU_LEFT_INSET = exports.MENU_VERTICAL_PADDING = void 0;
|
|
4
4
|
const colors_1 = require("../../helpers/colors");
|
|
5
5
|
exports.MENU_VERTICAL_PADDING = 4;
|
|
6
6
|
exports.SUBMENU_LEFT_INSET = -8;
|
|
7
7
|
exports.MAX_MENU_WIDTH = 400;
|
|
8
|
+
exports.MAX_MOBILE_MENU_WIDTH = 300;
|
|
8
9
|
const menuContainer = {
|
|
9
10
|
backgroundColor: colors_1.BACKGROUND,
|
|
10
11
|
position: 'fixed',
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const react_dom_1 = __importDefault(require("react-dom"));
|
|
8
|
+
const colors_1 = require("../helpers/colors");
|
|
9
|
+
const z_index_1 = require("../state/z-index");
|
|
10
|
+
const portals_1 = require("./Menu/portals");
|
|
11
|
+
const CancelButton_1 = require("./NewComposition/CancelButton");
|
|
12
|
+
const container = {
|
|
13
|
+
position: 'fixed',
|
|
14
|
+
top: 0,
|
|
15
|
+
left: 0,
|
|
16
|
+
width: '100%',
|
|
17
|
+
height: '100%',
|
|
18
|
+
padding: '0 0px 50px 0px',
|
|
19
|
+
background: colors_1.BACKGROUND,
|
|
20
|
+
};
|
|
21
|
+
const buttonContainer = {
|
|
22
|
+
height: '40px',
|
|
23
|
+
width: '100%',
|
|
24
|
+
alignItems: 'center',
|
|
25
|
+
display: 'flex',
|
|
26
|
+
justifyContent: 'flex-end',
|
|
27
|
+
};
|
|
28
|
+
const button = {
|
|
29
|
+
height: 20,
|
|
30
|
+
width: 20,
|
|
31
|
+
};
|
|
32
|
+
function MobilePanel({ children, onClose, }) {
|
|
33
|
+
const { currentZIndex } = (0, z_index_1.useZIndex)();
|
|
34
|
+
return react_dom_1.default.createPortal((0, jsx_runtime_1.jsxs)("div", { style: container, children: [(0, jsx_runtime_1.jsx)("div", { style: buttonContainer, children: (0, jsx_runtime_1.jsx)(CancelButton_1.CancelButton, { style: button, onPress: onClose }) }), children] }), (0, portals_1.getPortal)(currentZIndex));
|
|
35
|
+
}
|
|
36
|
+
exports.default = MobilePanel;
|
|
@@ -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 mobile_layout_1 = require("../../helpers/mobile-layout");
|
|
12
13
|
const noop_1 = require("../../helpers/noop");
|
|
13
14
|
const caret_1 = require("../../icons/caret");
|
|
14
15
|
const z_index_1 = require("../../state/z-index");
|
|
@@ -108,14 +109,20 @@ const Combobox = ({ values, selectedId, style: customStyle, title }) => {
|
|
|
108
109
|
const derivedMaxHeight = (0, react_1.useMemo)(() => {
|
|
109
110
|
return spaceToTop > spaceToBottom ? spaceToTop : spaceToBottom;
|
|
110
111
|
}, [spaceToBottom, spaceToTop]);
|
|
112
|
+
const isMobileLayout = (0, mobile_layout_1.useMobileLayout)();
|
|
111
113
|
const portalStyle = (0, react_1.useMemo)(() => {
|
|
112
114
|
if (!opened || !size) {
|
|
113
115
|
return null;
|
|
114
116
|
}
|
|
115
|
-
const spaceToRight = size.windowSize.width -
|
|
116
|
-
const
|
|
117
|
+
const spaceToRight = size.windowSize.width - size.left;
|
|
118
|
+
const spaceToLeft = size.left + size.width;
|
|
119
|
+
const minSpaceRequired = isMobileLayout
|
|
120
|
+
? styles_1.MAX_MOBILE_MENU_WIDTH
|
|
121
|
+
: styles_1.MAX_MENU_WIDTH;
|
|
117
122
|
const verticalLayout = spaceToTop > spaceToBottom ? 'bottom' : 'top';
|
|
118
|
-
const
|
|
123
|
+
const canOpenOnLeft = spaceToLeft >= minSpaceRequired;
|
|
124
|
+
const canOpenOnRight = spaceToRight >= minSpaceRequired;
|
|
125
|
+
const horizontalLayout = canOpenOnRight ? 'left' : 'right';
|
|
119
126
|
return {
|
|
120
127
|
...(verticalLayout === 'top'
|
|
121
128
|
? {
|
|
@@ -130,11 +137,13 @@ const Combobox = ({ values, selectedId, style: customStyle, title }) => {
|
|
|
130
137
|
? {
|
|
131
138
|
left: size.left,
|
|
132
139
|
}
|
|
133
|
-
:
|
|
134
|
-
|
|
135
|
-
|
|
140
|
+
: canOpenOnLeft
|
|
141
|
+
? {
|
|
142
|
+
right: size.windowSize.width - size.left - size.width,
|
|
143
|
+
}
|
|
144
|
+
: { left: 0 }),
|
|
136
145
|
};
|
|
137
|
-
}, [opened, size, spaceToBottom, spaceToTop]);
|
|
146
|
+
}, [isMobileLayout, opened, size, spaceToBottom, spaceToTop]);
|
|
138
147
|
const selected = values.find((v) => v.id === selectedId);
|
|
139
148
|
const style = (0, react_1.useMemo)(() => {
|
|
140
149
|
return {
|
|
@@ -4,6 +4,7 @@ exports.MenuContent = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const colors_1 = require("../../helpers/colors");
|
|
7
|
+
const mobile_layout_1 = require("../../helpers/mobile-layout");
|
|
7
8
|
const use_keybinding_1 = require("../../helpers/use-keybinding");
|
|
8
9
|
const is_menu_item_1 = require("../Menu/is-menu-item");
|
|
9
10
|
const MenuDivider_1 = require("../Menu/MenuDivider");
|
|
@@ -23,6 +24,7 @@ const container = {
|
|
|
23
24
|
const MenuContent = ({ onHide, values, preselectIndex, onNextMenu, onPreviousMenu, leaveLeftSpace, topItemCanBeUnselected, fixedHeight, }) => {
|
|
24
25
|
const keybindings = (0, use_keybinding_1.useKeybinding)();
|
|
25
26
|
const containerRef = (0, react_1.useRef)(null);
|
|
27
|
+
const isMobileLayout = (0, mobile_layout_1.useMobileLayout)();
|
|
26
28
|
const [subMenuActivated, setSubMenuActivated] = (0, react_1.useState)(false);
|
|
27
29
|
if (values[0].type === 'divider') {
|
|
28
30
|
throw new Error('first value cant be divide');
|
|
@@ -107,14 +109,18 @@ const MenuContent = ({ onHide, values, preselectIndex, onNextMenu, onPreviousMen
|
|
|
107
109
|
setSubMenuActivated('without-mouse');
|
|
108
110
|
}, [onNextMenu, selectedItem, values]);
|
|
109
111
|
const containerWithHeight = (0, react_1.useMemo)(() => {
|
|
112
|
+
const containerStyles = { ...container };
|
|
110
113
|
if (fixedHeight === null) {
|
|
111
|
-
|
|
114
|
+
containerStyles.maxHeight = 600;
|
|
112
115
|
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
116
|
+
else {
|
|
117
|
+
containerStyles.maxHeight = fixedHeight;
|
|
118
|
+
}
|
|
119
|
+
if (isMobileLayout) {
|
|
120
|
+
containerStyles.maxWidth = styles_1.MAX_MOBILE_MENU_WIDTH;
|
|
121
|
+
}
|
|
122
|
+
return containerStyles;
|
|
123
|
+
}, [fixedHeight, isMobileLayout]);
|
|
118
124
|
(0, react_1.useEffect)(() => {
|
|
119
125
|
const escapeBinding = keybindings.registerKeybinding({
|
|
120
126
|
event: 'keydown',
|
|
@@ -12,6 +12,6 @@ export declare const getInputBorderColor: ({ status, isFocused, isHovered, }: {
|
|
|
12
12
|
status: 'error' | 'warning' | 'ok';
|
|
13
13
|
isFocused: boolean;
|
|
14
14
|
isHovered: boolean;
|
|
15
|
-
}) => "hsla(0, 0%, 100%, 0.15)" | "rgba(0, 0, 0, 0.6)" | "rgba(255, 255, 255, 0.05)" | "#
|
|
15
|
+
}) => "#ff3232" | "hsla(0, 0%, 100%, 0.15)" | "rgba(0, 0, 0, 0.6)" | "rgba(255, 255, 255, 0.05)" | "#f1c40f";
|
|
16
16
|
export declare const RemotionInput: React.ForwardRefExoticComponent<Omit<Props, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
17
17
|
export {};
|
|
@@ -6,18 +6,12 @@ const react_1 = require("react");
|
|
|
6
6
|
const remotion_1 = require("remotion");
|
|
7
7
|
const ShortcutHint_1 = require("../error-overlay/remotion-overlay/ShortcutHint");
|
|
8
8
|
const colors_1 = require("../helpers/colors");
|
|
9
|
+
const mobile_layout_1 = require("../helpers/mobile-layout");
|
|
9
10
|
const DataEditor_1 = require("./RenderModal/DataEditor");
|
|
10
11
|
const deep_equal_1 = require("./RenderModal/SchemaEditor/deep-equal");
|
|
11
12
|
const RenderQueue_1 = require("./RenderQueue");
|
|
12
13
|
const RendersTab_1 = require("./RendersTab");
|
|
13
14
|
const Tabs_1 = require("./Tabs");
|
|
14
|
-
const container = {
|
|
15
|
-
height: '100%',
|
|
16
|
-
width: '100%',
|
|
17
|
-
position: 'absolute',
|
|
18
|
-
display: 'flex',
|
|
19
|
-
flexDirection: 'column',
|
|
20
|
-
};
|
|
21
15
|
const circle = {
|
|
22
16
|
width: 8,
|
|
23
17
|
height: 8,
|
|
@@ -45,6 +39,15 @@ exports.optionsSidebarTabs = (0, react_1.createRef)();
|
|
|
45
39
|
const OptionsPanel = ({ readOnlyStudio }) => {
|
|
46
40
|
const { props, updateProps } = (0, react_1.useContext)(remotion_1.Internals.EditorPropsContext);
|
|
47
41
|
const [saving, setSaving] = (0, react_1.useState)(false);
|
|
42
|
+
const isMobileLayout = (0, mobile_layout_1.useMobileLayout)();
|
|
43
|
+
const container = (0, react_1.useMemo)(() => ({
|
|
44
|
+
height: '100%',
|
|
45
|
+
width: '100%',
|
|
46
|
+
display: 'flex',
|
|
47
|
+
position: isMobileLayout ? 'relative' : 'absolute',
|
|
48
|
+
flexDirection: 'column',
|
|
49
|
+
flex: 1,
|
|
50
|
+
}), [isMobileLayout]);
|
|
48
51
|
const [panel, setPanel] = (0, react_1.useState)(() => getSelectedPanel(readOnlyStudio));
|
|
49
52
|
const onPropsSelected = (0, react_1.useCallback)(() => {
|
|
50
53
|
setPanel('input-props');
|
|
@@ -3,15 +3,22 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.RenderQueueRepeatItem = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
+
const mobile_layout_1 = require("../../helpers/mobile-layout");
|
|
6
7
|
const retry_payload_1 = require("../../helpers/retry-payload");
|
|
7
8
|
const modals_1 = require("../../state/modals");
|
|
9
|
+
const sidebar_1 = require("../../state/sidebar");
|
|
8
10
|
const InlineAction_1 = require("../InlineAction");
|
|
9
11
|
const RenderQueueRepeatItem = ({ job }) => {
|
|
10
12
|
const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
13
|
+
const isMobileLayout = (0, mobile_layout_1.useMobileLayout)();
|
|
14
|
+
const { setSidebarCollapsedState } = (0, react_1.useContext)(sidebar_1.SidebarContext);
|
|
11
15
|
const onClick = (0, react_1.useCallback)((e) => {
|
|
12
16
|
e.stopPropagation();
|
|
13
17
|
const retryPayload = (0, retry_payload_1.makeRetryPayload)(job);
|
|
14
18
|
setSelectedModal(retryPayload);
|
|
19
|
+
if (isMobileLayout) {
|
|
20
|
+
setSidebarCollapsedState({ left: 'collapsed', right: 'collapsed' });
|
|
21
|
+
}
|
|
15
22
|
}, [job, setSelectedModal]);
|
|
16
23
|
const icon = (0, react_1.useMemo)(() => {
|
|
17
24
|
return {
|
|
@@ -5,11 +5,15 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const remotion_1 = require("remotion");
|
|
7
7
|
const client_id_1 = require("../helpers/client-id");
|
|
8
|
+
const mobile_layout_1 = require("../helpers/mobile-layout");
|
|
8
9
|
const render_1 = require("../icons/render");
|
|
9
10
|
const modals_1 = require("../state/modals");
|
|
11
|
+
const sidebar_1 = require("../state/sidebar");
|
|
10
12
|
const InlineAction_1 = require("./InlineAction");
|
|
11
13
|
const SidebarRenderButton = ({ composition, visible }) => {
|
|
12
14
|
const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
15
|
+
const { setSidebarCollapsedState } = (0, react_1.useContext)(sidebar_1.SidebarContext);
|
|
16
|
+
const isMobileLayout = (0, mobile_layout_1.useMobileLayout)();
|
|
13
17
|
const iconStyle = (0, react_1.useMemo)(() => {
|
|
14
18
|
return {
|
|
15
19
|
style: {
|
|
@@ -69,6 +73,9 @@ const SidebarRenderButton = ({ composition, visible }) => {
|
|
|
69
73
|
initialRepro: defaults.repro,
|
|
70
74
|
initialForSeamlessAacConcatenation: defaults.forSeamlessAacConcatenation,
|
|
71
75
|
});
|
|
76
|
+
if (isMobileLayout) {
|
|
77
|
+
setSidebarCollapsedState({ left: 'collapsed', right: 'collapsed' });
|
|
78
|
+
}
|
|
72
79
|
}, [composition.defaultProps, composition.id, props, setSelectedModal]);
|
|
73
80
|
const renderAction = (0, react_1.useCallback)((color) => {
|
|
74
81
|
return (0, jsx_runtime_1.jsx)(render_1.ThinRenderIcon, { fill: color, svgProps: iconStyle });
|
|
@@ -1,8 +1,12 @@
|
|
|
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.TopPanel = exports.useResponsiveSidebarStatus = void 0;
|
|
4
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
8
|
const react_1 = require("react");
|
|
9
|
+
const mobile_layout_1 = require("../helpers/mobile-layout");
|
|
6
10
|
const use_breakpoint_1 = require("../helpers/use-breakpoint");
|
|
7
11
|
const editor_rulers_1 = require("../state/editor-rulers");
|
|
8
12
|
const sidebar_1 = require("../state/sidebar");
|
|
@@ -10,6 +14,7 @@ const CanvasOrLoading_1 = require("./CanvasOrLoading");
|
|
|
10
14
|
const CurrentCompositionSideEffects_1 = require("./CurrentCompositionSideEffects");
|
|
11
15
|
const use_is_ruler_visible_1 = require("./EditorRuler/use-is-ruler-visible");
|
|
12
16
|
const ExplorerPanel_1 = require("./ExplorerPanel");
|
|
17
|
+
const MobilePanel_1 = __importDefault(require("./MobilePanel"));
|
|
13
18
|
const OptionsPanel_1 = require("./OptionsPanel");
|
|
14
19
|
const PreviewToolbar_1 = require("./PreviewToolbar");
|
|
15
20
|
const SplitterContainer_1 = require("./Splitter/SplitterContainer");
|
|
@@ -69,6 +74,7 @@ const TopPanel = ({ readOnlyStudio, onMounted, size, drawRef, bufferStateDelayIn
|
|
|
69
74
|
const onCollapseRight = (0, react_1.useCallback)(() => {
|
|
70
75
|
setSidebarCollapsedState({ left: null, right: 'collapsed' });
|
|
71
76
|
}, [setSidebarCollapsedState]);
|
|
72
|
-
|
|
77
|
+
const isMobileLayout = (0, mobile_layout_1.useMobileLayout)();
|
|
78
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: container, children: [(0, jsx_runtime_1.jsx)("div", { style: row, children: (0, jsx_runtime_1.jsxs)(SplitterContainer_1.SplitterContainer, { minFlex: 0.15, maxFlex: 0.4, defaultFlex: 0.2, id: "sidebar-to-preview", orientation: "vertical", children: [actualStateLeft === 'expanded' ? (isMobileLayout ? ((0, jsx_runtime_1.jsx)(MobilePanel_1.default, { onClose: onCollapseLeft, children: (0, jsx_runtime_1.jsx)(ExplorerPanel_1.ExplorerPanel, { readOnlyStudio: readOnlyStudio }) })) : ((0, jsx_runtime_1.jsx)(SplitterElement_1.SplitterElement, { sticky: null, type: "flexer", children: (0, jsx_runtime_1.jsx)(ExplorerPanel_1.ExplorerPanel, { readOnlyStudio: readOnlyStudio }) }))) : null, actualStateLeft === 'expanded' ? ((0, jsx_runtime_1.jsx)(SplitterHandle_1.SplitterHandle, { allowToCollapse: "left", onCollapse: onCollapseLeft })) : null, (0, jsx_runtime_1.jsx)(SplitterElement_1.SplitterElement, { sticky: null, type: "anti-flexer", children: (0, jsx_runtime_1.jsxs)(SplitterContainer_1.SplitterContainer, { minFlex: 0.5, maxFlex: 0.8, defaultFlex: 0.7, id: "canvas-to-right-sidebar", orientation: "vertical", children: [(0, jsx_runtime_1.jsx)(SplitterElement_1.SplitterElement, { sticky: null, type: "flexer", children: (0, jsx_runtime_1.jsx)("div", { ref: drawRef, style: canvasContainerStyle, children: size ? (0, jsx_runtime_1.jsx)(CanvasOrLoading_1.CanvasOrLoading, { size: size }) : null }) }), actualStateRight === 'expanded' ? ((0, jsx_runtime_1.jsx)(SplitterHandle_1.SplitterHandle, { allowToCollapse: "right", onCollapse: onCollapseRight })) : null, actualStateRight === 'expanded' ? (isMobileLayout ? ((0, jsx_runtime_1.jsx)(MobilePanel_1.default, { onClose: onCollapseRight, children: (0, jsx_runtime_1.jsx)(OptionsPanel_1.OptionsPanel, { readOnlyStudio: readOnlyStudio }) })) : ((0, jsx_runtime_1.jsx)(SplitterElement_1.SplitterElement, { sticky: null, type: "anti-flexer", children: (0, jsx_runtime_1.jsx)(OptionsPanel_1.OptionsPanel, { readOnlyStudio: readOnlyStudio }) }))) : null] }) })] }) }), (0, jsx_runtime_1.jsx)(PreviewToolbar_1.PreviewToolbar, { bufferStateDelayInMilliseconds: bufferStateDelayInMilliseconds, readOnlyStudio: readOnlyStudio }), (0, jsx_runtime_1.jsx)(CurrentCompositionSideEffects_1.CurrentCompositionKeybindings, { readOnlyStudio: readOnlyStudio }), (0, jsx_runtime_1.jsx)(CurrentCompositionSideEffects_1.TitleUpdater, {})] }));
|
|
73
79
|
};
|
|
74
80
|
exports.TopPanel = TopPanel;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare const getCheckerboardBackgroundSize: (size: number) => string;
|
|
2
2
|
export declare const getCheckerboardBackgroundPos: (size: number) => string;
|
|
3
|
-
export declare const checkerboardBackgroundColor: (checkerboard: boolean) => "
|
|
3
|
+
export declare const checkerboardBackgroundColor: (checkerboard: boolean) => "white" | "black";
|
|
4
4
|
export declare const checkerboardBackgroundImage: (checkerboard: boolean) => "\n linear-gradient(\n 45deg,\n rgba(0, 0, 0, 0.1) 25%,\n transparent 25%\n ),\n linear-gradient(135deg, rgba(0, 0, 0, 0.1) 25%, transparent 25%),\n linear-gradient(45deg, transparent 75%, rgba(0, 0, 0, 0.1) 75%),\n linear-gradient(135deg, transparent 75%, rgba(0, 0, 0, 0.1) 75%)\n " | undefined;
|
package/dist/helpers/colors.d.ts
CHANGED
|
@@ -23,4 +23,4 @@ export declare const TIMELINE_TRACK_SEPARATOR = "rgba(0, 0, 0, 0.3)";
|
|
|
23
23
|
export declare const getBackgroundFromHoverState: ({ selected, hovered, }: {
|
|
24
24
|
selected: boolean;
|
|
25
25
|
hovered: boolean;
|
|
26
|
-
}) => "transparent" | "
|
|
26
|
+
}) => "transparent" | "rgba(255, 255, 255, 0.06)" | "hsla(0, 0%, 100%, 0.15)" | "hsla(0, 0%, 100%, 0.25)";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { X264Preset } from '@remotion/renderer';
|
|
2
|
-
export declare const labelx264Preset: (profile: X264Preset) => "
|
|
2
|
+
export declare const labelx264Preset: (profile: X264Preset) => "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "medium" | "slow" | "slower" | "veryslow" | "placebo";
|
package/dist/state/sidebar.js
CHANGED
|
@@ -3,14 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.SidebarContextProvider = exports.SidebarContext = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
+
const mobile_layout_1 = require("../helpers/mobile-layout");
|
|
6
7
|
const storageKey = (sidebar) => {
|
|
7
8
|
if (sidebar === 'right') {
|
|
8
9
|
return 'remotion.sidebarRightCollapsing';
|
|
9
10
|
}
|
|
10
11
|
return 'remotion.sidebarCollapsing';
|
|
11
12
|
};
|
|
12
|
-
const getSavedCollapsedStateLeft = () => {
|
|
13
|
+
const getSavedCollapsedStateLeft = (isMobileLayout = false) => {
|
|
13
14
|
const state = window.localStorage.getItem(storageKey('left'));
|
|
15
|
+
if (isMobileLayout) {
|
|
16
|
+
return 'collapsed';
|
|
17
|
+
}
|
|
14
18
|
if (state === 'collapsed') {
|
|
15
19
|
return 'collapsed';
|
|
16
20
|
}
|
|
@@ -19,8 +23,11 @@ const getSavedCollapsedStateLeft = () => {
|
|
|
19
23
|
}
|
|
20
24
|
return 'responsive';
|
|
21
25
|
};
|
|
22
|
-
const getSavedCollapsedStateRight = () => {
|
|
26
|
+
const getSavedCollapsedStateRight = (isMobileLayout = false) => {
|
|
23
27
|
const state = window.localStorage.getItem(storageKey('right'));
|
|
28
|
+
if (isMobileLayout) {
|
|
29
|
+
return 'collapsed';
|
|
30
|
+
}
|
|
24
31
|
if (state === 'expanded') {
|
|
25
32
|
return 'expanded';
|
|
26
33
|
}
|
|
@@ -37,9 +44,10 @@ exports.SidebarContext = (0, react_1.createContext)({
|
|
|
37
44
|
sidebarCollapsedStateRight: 'collapsed',
|
|
38
45
|
});
|
|
39
46
|
const SidebarContextProvider = ({ children }) => {
|
|
47
|
+
const isMobileLayout = (0, mobile_layout_1.useMobileLayout)();
|
|
40
48
|
const [sidebarCollapsedState, setSidebarCollapsedState] = (0, react_1.useState)(() => ({
|
|
41
|
-
left: getSavedCollapsedStateLeft(),
|
|
42
|
-
right: getSavedCollapsedStateRight(),
|
|
49
|
+
left: getSavedCollapsedStateLeft(isMobileLayout),
|
|
50
|
+
right: getSavedCollapsedStateRight(isMobileLayout),
|
|
43
51
|
}));
|
|
44
52
|
const value = (0, react_1.useMemo)(() => {
|
|
45
53
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/studio",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.128",
|
|
4
4
|
"description": "Remotion Editor",
|
|
5
5
|
"main": "dist",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
"memfs": "3.4.3",
|
|
19
19
|
"source-map": "0.7.3",
|
|
20
20
|
"open": "^8.4.2",
|
|
21
|
-
"
|
|
22
|
-
"@remotion/
|
|
23
|
-
"remotion": "4.0.
|
|
24
|
-
"@remotion/
|
|
25
|
-
"@remotion/studio-shared": "4.0.
|
|
21
|
+
"remotion": "4.0.128",
|
|
22
|
+
"@remotion/player": "4.0.128",
|
|
23
|
+
"@remotion/media-utils": "4.0.128",
|
|
24
|
+
"@remotion/renderer": "4.0.128",
|
|
25
|
+
"@remotion/studio-shared": "4.0.128"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"react": "18.2.0",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"prettier-plugin-organize-imports": "3.2.4",
|
|
41
41
|
"vitest": "0.31.1",
|
|
42
42
|
"zod": "^3.22.3",
|
|
43
|
-
"@remotion/zod-types": "4.0.
|
|
43
|
+
"@remotion/zod-types": "4.0.128"
|
|
44
44
|
},
|
|
45
45
|
"publishConfig": {
|
|
46
46
|
"access": "public"
|