@remotion/cli 4.0.11 → 4.0.14

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.
Files changed (43) hide show
  1. package/dist/config/image-format.d.ts +1 -1
  2. package/dist/config/index.d.ts +1 -1
  3. package/dist/editor/components/AssetSelector.d.ts +2 -0
  4. package/dist/editor/components/AssetSelector.js +85 -0
  5. package/dist/editor/components/AssetSelectorItem.d.ts +6 -0
  6. package/dist/editor/components/AssetSelectorItem.js +125 -0
  7. package/dist/editor/components/CompositionSelector.js +3 -3
  8. package/dist/editor/components/CopyButton.js +8 -2
  9. package/dist/editor/components/ExplorerPanel.d.ts +8 -0
  10. package/dist/editor/components/ExplorerPanel.js +67 -0
  11. package/dist/editor/components/InlineAction.d.ts +1 -0
  12. package/dist/editor/components/InlineAction.js +2 -2
  13. package/dist/editor/components/NewComposition/RemInput.d.ts +1 -1
  14. package/dist/editor/components/NewComposition/RemInputTypeColor.d.ts +1 -1
  15. package/dist/editor/components/NewComposition/RemTextarea.d.ts +1 -1
  16. package/dist/editor/components/OptionsPanel.d.ts +8 -0
  17. package/dist/editor/components/OptionsPanel.js +112 -0
  18. package/dist/editor/components/RenderModal/CliCopyButton.js +2 -1
  19. package/dist/editor/components/RenderModal/MultiRangeSlider.js +4 -7
  20. package/dist/editor/components/RenderModal/RenderModal.js +7 -7
  21. package/dist/editor/components/RenderModal/human-readable-codec.d.ts +1 -1
  22. package/dist/editor/components/RenderQueue/RenderQueueOpenInFolder.js +2 -1
  23. package/dist/editor/components/TopPanel.js +4 -8
  24. package/dist/editor/components/UpdateModal/UpdateModal.js +4 -1
  25. package/dist/editor/helpers/copy-text.d.ts +1 -1
  26. package/dist/editor/helpers/copy-text.js +15 -10
  27. package/dist/editor/helpers/pick-color.js +12 -7
  28. package/dist/editor/icons/clipboard.d.ts +4 -0
  29. package/dist/editor/icons/clipboard.js +6 -0
  30. package/dist/editor/icons/file.d.ts +3 -1
  31. package/dist/editor/icons/file.js +1 -1
  32. package/dist/editor/icons/folder.d.ts +3 -0
  33. package/dist/editor/icons/folder.js +5 -1
  34. package/dist/event-source-events.d.ts +1 -0
  35. package/dist/event-source.js +1 -0
  36. package/dist/get-cli-options.d.ts +1 -1
  37. package/dist/index.d.ts +5 -5
  38. package/dist/preview-server/dev-middleware/range-parser.d.ts +1 -1
  39. package/dist/preview-server/public-folder.js +3 -0
  40. package/dist/preview-server/routes.js +1 -0
  41. package/dist/studio.js +8 -1
  42. package/package.json +8 -8
  43. package/styles/styles.css +7 -17
@@ -2,4 +2,4 @@ import type { StillImageFormat, VideoImageFormat } from '@remotion/renderer';
2
2
  export declare const setStillImageFormat: (format: StillImageFormat) => void;
3
3
  export declare const setVideoImageFormat: (format: VideoImageFormat) => void;
4
4
  export declare const getUserPreferredStillImageFormat: () => "png" | "jpeg" | "pdf" | "webp" | undefined;
5
- export declare const getUserPreferredVideoImageFormat: () => "png" | "jpeg" | "none" | undefined;
5
+ export declare const getUserPreferredVideoImageFormat: () => "none" | "png" | "jpeg" | undefined;
@@ -297,7 +297,7 @@ export declare const ConfigInternals: {
297
297
  getShouldOutputImageSequence: (frameRange: FrameRange | null) => boolean;
298
298
  getDotEnvLocation: () => string | null;
299
299
  getUserPreferredStillImageFormat: () => "png" | "jpeg" | "pdf" | "webp" | undefined;
300
- getUserPreferredVideoImageFormat: () => "png" | "jpeg" | "none" | undefined;
300
+ getUserPreferredVideoImageFormat: () => "none" | "png" | "jpeg" | undefined;
301
301
  getWebpackOverrideFn: () => WebpackOverrideFn;
302
302
  getWebpackCaching: () => boolean;
303
303
  getOutputLocation: () => string | null;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const AssetSelector: React.FC;
@@ -0,0 +1,85 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.AssetSelector = void 0;
27
+ const jsx_runtime_1 = require("react/jsx-runtime");
28
+ const react_1 = __importStar(require("react"));
29
+ const remotion_1 = require("remotion");
30
+ const event_source_1 = require("../../event-source");
31
+ const colors_1 = require("../helpers/colors");
32
+ const z_index_1 = require("../state/z-index");
33
+ const AssetSelectorItem_1 = require("./AssetSelectorItem");
34
+ const styles_1 = require("./Menu/styles");
35
+ const container = {
36
+ display: 'flex',
37
+ flexDirection: 'column',
38
+ flex: 1,
39
+ overflow: 'hidden',
40
+ backgroundColor: colors_1.BACKGROUND,
41
+ };
42
+ // Some redundancy with packages/cli/src/editor/components/RenderModal/SchemaEditor/SchemaErrorMessages.tsx
43
+ const emptyState = {
44
+ display: 'flex',
45
+ flex: 1,
46
+ justifyContent: 'center',
47
+ alignItems: 'center',
48
+ textAlign: 'center',
49
+ padding: '0 12px',
50
+ };
51
+ const label = {
52
+ color: colors_1.LIGHT_TEXT,
53
+ lineHeight: 1.5,
54
+ fontSize: 14,
55
+ };
56
+ const list = {
57
+ overflowY: 'auto',
58
+ paddingTop: 4,
59
+ paddingBottom: 4,
60
+ };
61
+ const AssetSelector = () => {
62
+ const { tabIndex } = (0, z_index_1.useZIndex)();
63
+ const [{ publicFolderExists, staticFiles }, setState] = react_1.default.useState(() => {
64
+ return {
65
+ staticFiles: (0, remotion_1.getStaticFiles)(),
66
+ publicFolderExists: window.remotion_publicFolderExists,
67
+ };
68
+ });
69
+ (0, react_1.useEffect)(() => {
70
+ const onUpdate = () => {
71
+ setState({
72
+ staticFiles: (0, remotion_1.getStaticFiles)(),
73
+ publicFolderExists: window.remotion_publicFolderExists,
74
+ });
75
+ };
76
+ const unsub = (0, event_source_1.subscribeToEvent)('new-public-folder', onUpdate);
77
+ return () => {
78
+ unsub();
79
+ };
80
+ }, []);
81
+ return ((0, jsx_runtime_1.jsx)("div", { style: container, children: staticFiles.length === 0 ? (publicFolderExists ? ((0, jsx_runtime_1.jsx)("div", { style: emptyState, children: (0, jsx_runtime_1.jsxs)("div", { style: label, children: ["To add assets, place a file in the", ' ', (0, jsx_runtime_1.jsx)("code", { style: styles_1.inlineCodeSnippet, children: "public" }), " folder of your project."] }) })) : ((0, jsx_runtime_1.jsx)("div", { style: emptyState, children: (0, jsx_runtime_1.jsxs)("div", { style: label, children: ["To add assets, create a folder called", ' ', (0, jsx_runtime_1.jsx)("code", { style: styles_1.inlineCodeSnippet, children: "public" }), " in the root of your project and place a file in it."] }) }))) : ((0, jsx_runtime_1.jsx)("div", { className: "__remotion-vertical-scrollbar", style: list, children: staticFiles.map((file) => {
82
+ return ((0, jsx_runtime_1.jsx)(AssetSelectorItem_1.AssetSelectorItem, { item: file, tabIndex: tabIndex }, `${file.src}`));
83
+ }) })) }));
84
+ };
85
+ exports.AssetSelector = AssetSelector;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import type { StaticFile } from 'remotion';
3
+ export declare const AssetSelectorItem: React.FC<{
4
+ item: StaticFile;
5
+ tabIndex: number;
6
+ }>;
@@ -0,0 +1,125 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.AssetSelectorItem = void 0;
27
+ const jsx_runtime_1 = require("react/jsx-runtime");
28
+ const react_1 = __importStar(require("react"));
29
+ const colors_1 = require("../helpers/colors");
30
+ const copy_text_1 = require("../helpers/copy-text");
31
+ const clipboard_1 = require("../icons/clipboard");
32
+ const file_1 = require("../icons/file");
33
+ const folder_1 = require("../icons/folder");
34
+ const InlineAction_1 = require("./InlineAction");
35
+ const layout_1 = require("./layout");
36
+ const NotificationCenter_1 = require("./Notifications/NotificationCenter");
37
+ const actions_1 = require("./RenderQueue/actions");
38
+ const ASSET_ITEM_HEIGHT = 32;
39
+ const itemStyle = {
40
+ paddingRight: 10,
41
+ paddingTop: 6,
42
+ paddingBottom: 6,
43
+ fontSize: 13,
44
+ display: 'flex',
45
+ textDecoration: 'none',
46
+ cursor: 'default',
47
+ alignItems: 'center',
48
+ marginBottom: 1,
49
+ appearance: 'none',
50
+ border: 'none',
51
+ width: '100%',
52
+ textAlign: 'left',
53
+ backgroundColor: colors_1.BACKGROUND,
54
+ height: ASSET_ITEM_HEIGHT,
55
+ };
56
+ const labelStyle = {
57
+ textAlign: 'left',
58
+ textDecoration: 'none',
59
+ fontSize: 13,
60
+ flex: '1 1 0%',
61
+ whiteSpace: 'nowrap',
62
+ overflow: 'hidden',
63
+ textOverflow: 'ellipsis',
64
+ };
65
+ const iconStyle = {
66
+ width: 18,
67
+ height: 18,
68
+ flexShrink: 0,
69
+ };
70
+ const revealIconStyle = {
71
+ height: 12,
72
+ color: 'currentColor',
73
+ };
74
+ const AssetSelectorItem = ({ item, tabIndex }) => {
75
+ const [hovered, setHovered] = (0, react_1.useState)(false);
76
+ const onPointerEnter = (0, react_1.useCallback)(() => {
77
+ setHovered(true);
78
+ }, []);
79
+ const onPointerLeave = (0, react_1.useCallback)(() => {
80
+ setHovered(false);
81
+ }, []);
82
+ const style = (0, react_1.useMemo)(() => {
83
+ return {
84
+ ...itemStyle,
85
+ paddingLeft: 12,
86
+ color: colors_1.LIGHT_TEXT,
87
+ };
88
+ }, []);
89
+ const label = (0, react_1.useMemo)(() => {
90
+ return {
91
+ ...labelStyle,
92
+ color: colors_1.LIGHT_TEXT,
93
+ };
94
+ }, []);
95
+ const renderFileExplorerAction = (0, react_1.useCallback)((color) => {
96
+ return (0, jsx_runtime_1.jsx)(folder_1.ExpandedFolderIconSolid, { style: revealIconStyle, color: color });
97
+ }, []);
98
+ const renderCopyAction = (0, react_1.useCallback)((color) => {
99
+ return (0, jsx_runtime_1.jsx)(clipboard_1.ClipboardIcon, { style: revealIconStyle, color: color });
100
+ }, []);
101
+ const revealInExplorer = react_1.default.useCallback(() => {
102
+ (0, actions_1.openInFileExplorer)({
103
+ directory: window.remotion_publicFolderExists + '/' + item.name,
104
+ }).catch((err) => {
105
+ (0, NotificationCenter_1.sendErrorNotification)(`Could not open file: ${err.message}`);
106
+ });
107
+ }, [item.name]);
108
+ const copyToClipboard = (0, react_1.useCallback)(() => {
109
+ (0, copy_text_1.copyText)(`staticFile("${item.name}")`)
110
+ .then(() => {
111
+ var _a;
112
+ (_a = NotificationCenter_1.notificationCenter.current) === null || _a === void 0 ? void 0 : _a.addNotification({
113
+ content: `Copied 'staticFile("${item.name}")' to clipboard`,
114
+ created: Date.now(),
115
+ duration: 1000,
116
+ id: String(Math.random()),
117
+ });
118
+ })
119
+ .catch((err) => {
120
+ (0, NotificationCenter_1.sendErrorNotification)(`Could not copy: ${err.message}`);
121
+ });
122
+ }, [item.name]);
123
+ return ((0, jsx_runtime_1.jsx)(layout_1.Row, { align: "center", children: (0, jsx_runtime_1.jsxs)("div", { style: style, onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, tabIndex: tabIndex, title: item.name, children: [(0, jsx_runtime_1.jsx)(file_1.FileIcon, { style: iconStyle, color: colors_1.LIGHT_TEXT }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1 }), (0, jsx_runtime_1.jsx)("div", { style: label, children: item.name }), hovered ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.5 }), (0, jsx_runtime_1.jsx)(InlineAction_1.InlineAction, { title: "Copy staticFile() name", renderAction: renderCopyAction, onClick: copyToClipboard }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.5 }), (0, jsx_runtime_1.jsx)(InlineAction_1.InlineAction, { title: "Open in Explorer", renderAction: renderFileExplorerAction, onClick: revealInExplorer })] })) : null] }) }));
124
+ };
125
+ exports.AssetSelectorItem = AssetSelectorItem;
@@ -12,10 +12,10 @@ const CompositionSelectorItem_1 = require("./CompositionSelectorItem");
12
12
  const CurrentComposition_1 = require("./CurrentComposition");
13
13
  const InitialCompositionLoader_1 = require("./InitialCompositionLoader");
14
14
  const container = {
15
- position: 'absolute',
16
- height: '100%',
17
- width: '100%',
15
+ display: 'flex',
16
+ flexDirection: 'column',
18
17
  flex: 1,
18
+ overflow: 'hidden',
19
19
  backgroundColor: colors_1.BACKGROUND,
20
20
  };
21
21
  const list = {
@@ -6,6 +6,7 @@ const react_1 = require("react");
6
6
  const Button_1 = require("../../preview-server/error-overlay/remotion-overlay/Button");
7
7
  const copy_text_1 = require("../helpers/copy-text");
8
8
  const layout_1 = require("./layout");
9
+ const NotificationCenter_1 = require("./Notifications/NotificationCenter");
9
10
  const iconStyle = {
10
11
  width: 16,
11
12
  height: 16,
@@ -22,8 +23,13 @@ const labelStyle = {
22
23
  const CopyButton = ({ textToCopy, label, labelWhenCopied }) => {
23
24
  const [copied, setCopied] = (0, react_1.useState)(false);
24
25
  const onClick = (0, react_1.useCallback)(() => {
25
- (0, copy_text_1.copyText)(textToCopy);
26
- setCopied(Date.now());
26
+ (0, copy_text_1.copyText)(textToCopy)
27
+ .then(() => {
28
+ setCopied(Date.now());
29
+ })
30
+ .catch((err) => {
31
+ (0, NotificationCenter_1.sendErrorNotification)(`Could not copy: ${err.message}`);
32
+ });
27
33
  }, [textToCopy]);
28
34
  (0, react_1.useEffect)(() => {
29
35
  if (!copied) {
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ type OptionsSidebarPanel = 'compositions' | 'assets';
3
+ export declare const persistSelectedOptionsSidebarPanel: (panel: OptionsSidebarPanel) => void;
4
+ export declare const optionsSidebarTabs: import("react").RefObject<{
5
+ selectRendersPanel: () => void;
6
+ }>;
7
+ export declare const ExplorerPanel: React.FC<{}>;
8
+ export {};
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ExplorerPanel = exports.optionsSidebarTabs = exports.persistSelectedOptionsSidebarPanel = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const remotion_1 = require("remotion");
7
+ const colors_1 = require("../helpers/colors");
8
+ const AssetSelector_1 = require("./AssetSelector");
9
+ const CompositionSelector_1 = require("./CompositionSelector");
10
+ const Tabs_1 = require("./Tabs");
11
+ const container = {
12
+ height: '100%',
13
+ width: '100%',
14
+ maxWidth: '100%',
15
+ display: 'flex',
16
+ flexDirection: 'column',
17
+ flex: 1,
18
+ };
19
+ const localStorageKey = 'remotion.sidebarPanel';
20
+ const getSelectedPanel = () => {
21
+ const panel = localStorage.getItem(localStorageKey);
22
+ if (panel === 'assets') {
23
+ return 'assets';
24
+ }
25
+ return 'compositions';
26
+ };
27
+ const tabsContainer = {
28
+ backgroundColor: colors_1.BACKGROUND,
29
+ };
30
+ const persistSelectedOptionsSidebarPanel = (panel) => {
31
+ localStorage.setItem(localStorageKey, panel);
32
+ };
33
+ exports.persistSelectedOptionsSidebarPanel = persistSelectedOptionsSidebarPanel;
34
+ exports.optionsSidebarTabs = (0, react_1.createRef)();
35
+ const ExplorerPanel = () => {
36
+ const [panel, setPanel] = (0, react_1.useState)(() => getSelectedPanel());
37
+ const onCompositionsSelected = (0, react_1.useCallback)(() => {
38
+ setPanel('compositions');
39
+ (0, exports.persistSelectedOptionsSidebarPanel)('compositions');
40
+ }, []);
41
+ const onAssetsSelected = (0, react_1.useCallback)(() => {
42
+ setPanel('assets');
43
+ (0, exports.persistSelectedOptionsSidebarPanel)('assets');
44
+ }, []);
45
+ (0, react_1.useImperativeHandle)(exports.optionsSidebarTabs, () => {
46
+ return {
47
+ selectRendersPanel: () => {
48
+ setPanel('assets');
49
+ (0, exports.persistSelectedOptionsSidebarPanel)('assets');
50
+ },
51
+ };
52
+ }, []);
53
+ const { compositions, currentComposition } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
54
+ const composition = (0, react_1.useMemo)(() => {
55
+ for (const comp of compositions) {
56
+ if (comp.id === currentComposition) {
57
+ return comp;
58
+ }
59
+ }
60
+ return null;
61
+ }, [compositions, currentComposition]);
62
+ if (composition === null) {
63
+ return null;
64
+ }
65
+ return ((0, jsx_runtime_1.jsxs)("div", { style: container, className: "css-reset", children: [(0, jsx_runtime_1.jsx)("div", { style: tabsContainer, children: (0, jsx_runtime_1.jsxs)(Tabs_1.Tabs, { children: [(0, jsx_runtime_1.jsx)(Tabs_1.Tab, { selected: panel === 'compositions', onClick: onCompositionsSelected, children: "Compositions" }), (0, jsx_runtime_1.jsx)(Tabs_1.Tab, { selected: panel === 'assets', onClick: onAssetsSelected, children: "Assets" })] }) }), panel === 'compositions' ? (0, jsx_runtime_1.jsx)(CompositionSelector_1.CompositionSelector, {}) : (0, jsx_runtime_1.jsx)(AssetSelector_1.AssetSelector, {})] }));
66
+ };
67
+ exports.ExplorerPanel = ExplorerPanel;
@@ -4,4 +4,5 @@ export declare const InlineAction: React.FC<{
4
4
  onClick: React.MouseEventHandler<HTMLAnchorElement>;
5
5
  disabled?: boolean;
6
6
  renderAction: RenderInlineAction;
7
+ title?: string;
7
8
  }>;
@@ -5,7 +5,7 @@ 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 z_index_1 = require("../state/z-index");
8
- const InlineAction = ({ renderAction, onClick, disabled }) => {
8
+ const InlineAction = ({ renderAction, onClick, disabled, title }) => {
9
9
  const { tabIndex } = (0, z_index_1.useZIndex)();
10
10
  const [hovered, setHovered] = (0, react_1.useState)(false);
11
11
  const onPointerEnter = (0, react_1.useCallback)(() => {
@@ -29,6 +29,6 @@ const InlineAction = ({ renderAction, onClick, disabled }) => {
29
29
  pointerEvents: disabled ? 'none' : 'auto',
30
30
  };
31
31
  }, [disabled, hovered]);
32
- return ((0, jsx_runtime_1.jsx)("a", { type: "button", onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, onClick: onClick, style: style, tabIndex: tabIndex, children: renderAction(hovered ? 'white' : colors_1.LIGHT_TEXT) }));
32
+ return ((0, jsx_runtime_1.jsx)("a", { type: "button", onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, onClick: onClick, style: style, tabIndex: tabIndex, title: title, children: renderAction(hovered ? 'white' : colors_1.LIGHT_TEXT) }));
33
33
  };
34
34
  exports.InlineAction = InlineAction;
@@ -13,5 +13,5 @@ export declare const getInputBorderColor: ({ status, isFocused, isHovered, }: {
13
13
  isFocused: boolean;
14
14
  isHovered: boolean;
15
15
  }) => "hsla(0, 0%, 100%, 0.15)" | "rgba(0, 0, 0, 0.6)" | "rgba(255, 255, 255, 0.05)" | "#ff3232" | "#f1c40f";
16
- export declare const RemotionInput: React.ForwardRefExoticComponent<Pick<Props, "status" | "key" | "rightAlign" | keyof React.InputHTMLAttributes<HTMLInputElement>> & React.RefAttributes<HTMLInputElement>>;
16
+ export declare const RemotionInput: React.ForwardRefExoticComponent<Pick<Props, "key" | keyof React.InputHTMLAttributes<HTMLInputElement> | "status" | "rightAlign"> & React.RefAttributes<HTMLInputElement>>;
17
17
  export {};
@@ -4,5 +4,5 @@ type Props = React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>
4
4
  status: RemInputStatus;
5
5
  name: string;
6
6
  };
7
- export declare const RemInputTypeColor: React.ForwardRefExoticComponent<Pick<Props, "status" | "key" | keyof React.InputHTMLAttributes<HTMLInputElement>> & React.RefAttributes<HTMLInputElement>>;
7
+ export declare const RemInputTypeColor: React.ForwardRefExoticComponent<Pick<Props, "key" | keyof React.InputHTMLAttributes<HTMLInputElement> | "status"> & React.RefAttributes<HTMLInputElement>>;
8
8
  export {};
@@ -3,5 +3,5 @@ type Props = React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLTextAreaEleme
3
3
  status: 'error' | 'warning' | 'ok';
4
4
  };
5
5
  export declare const inputBaseStyle: React.CSSProperties;
6
- export declare const RemTextarea: React.ForwardRefExoticComponent<Pick<Props, "status" | "key" | keyof React.InputHTMLAttributes<HTMLTextAreaElement>> & React.RefAttributes<HTMLTextAreaElement>>;
6
+ export declare const RemTextarea: React.ForwardRefExoticComponent<Pick<Props, "key" | "status" | keyof React.InputHTMLAttributes<HTMLTextAreaElement>> & React.RefAttributes<HTMLTextAreaElement>>;
7
7
  export {};
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ type OptionsSidebarPanel = 'input-props' | 'renders';
3
+ export declare const persistSelectedOptionsSidebarPanel: (panel: OptionsSidebarPanel) => void;
4
+ export declare const optionsSidebarTabs: React.RefObject<{
5
+ selectRendersPanel: () => void;
6
+ }>;
7
+ export declare const OptionsPanel: React.FC<{}>;
8
+ export {};
@@ -0,0 +1,112 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OptionsPanel = exports.optionsSidebarTabs = exports.persistSelectedOptionsSidebarPanel = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const remotion_1 = require("remotion");
7
+ const ShortcutHint_1 = require("../../preview-server/error-overlay/remotion-overlay/ShortcutHint");
8
+ const colors_1 = require("../helpers/colors");
9
+ const DataEditor_1 = require("./RenderModal/DataEditor");
10
+ const deep_equal_1 = require("./RenderModal/SchemaEditor/deep-equal");
11
+ const RenderQueue_1 = require("./RenderQueue");
12
+ const RendersTab_1 = require("./RendersTab");
13
+ 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
+ const circle = {
22
+ width: 8,
23
+ height: 8,
24
+ borderRadius: 4,
25
+ };
26
+ const localStorageKey = 'remotion.sidebarPanel';
27
+ const getSelectedPanel = () => {
28
+ const panel = localStorage.getItem(localStorageKey);
29
+ if (panel === 'renders') {
30
+ return 'renders';
31
+ }
32
+ return 'input-props';
33
+ };
34
+ const tabsContainer = {
35
+ backgroundColor: colors_1.BACKGROUND,
36
+ };
37
+ const persistSelectedOptionsSidebarPanel = (panel) => {
38
+ localStorage.setItem(localStorageKey, panel);
39
+ };
40
+ exports.persistSelectedOptionsSidebarPanel = persistSelectedOptionsSidebarPanel;
41
+ exports.optionsSidebarTabs = (0, react_1.createRef)();
42
+ const OptionsPanel = () => {
43
+ const { props, updateProps } = (0, react_1.useContext)(remotion_1.Internals.EditorPropsContext);
44
+ const [saving, setSaving] = (0, react_1.useState)(false);
45
+ const [panel, setPanel] = (0, react_1.useState)(() => getSelectedPanel());
46
+ const onPropsSelected = (0, react_1.useCallback)(() => {
47
+ setPanel('input-props');
48
+ (0, exports.persistSelectedOptionsSidebarPanel)('input-props');
49
+ }, []);
50
+ const onRendersSelected = (0, react_1.useCallback)(() => {
51
+ setPanel('renders');
52
+ (0, exports.persistSelectedOptionsSidebarPanel)('renders');
53
+ }, []);
54
+ (0, react_1.useImperativeHandle)(exports.optionsSidebarTabs, () => {
55
+ return {
56
+ selectRendersPanel: () => {
57
+ setPanel('renders');
58
+ (0, exports.persistSelectedOptionsSidebarPanel)('renders');
59
+ },
60
+ };
61
+ }, []);
62
+ const { compositions, currentComposition } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
63
+ const circleStyle = (0, react_1.useMemo)(() => {
64
+ const onTabColor = saving ? colors_1.LIGHT_TEXT : 'white';
65
+ return {
66
+ ...circle,
67
+ backgroundColor: panel === 'input-props' ? onTabColor : colors_1.LIGHT_TEXT,
68
+ cursor: 'help',
69
+ };
70
+ }, [panel, saving]);
71
+ const composition = (0, react_1.useMemo)(() => {
72
+ for (const comp of compositions) {
73
+ if (comp.id === currentComposition) {
74
+ return comp;
75
+ }
76
+ }
77
+ return null;
78
+ }, [compositions, currentComposition]);
79
+ const saveToolTip = (0, react_1.useMemo)(() => {
80
+ return process.env.KEYBOARD_SHORTCUTS_ENABLED
81
+ ? `Save using ${ShortcutHint_1.cmdOrCtrlCharacter}+S`
82
+ : 'There are unsaved changes';
83
+ }, []);
84
+ const setInputProps = (0, react_1.useCallback)((newProps) => {
85
+ if (composition === null) {
86
+ return;
87
+ }
88
+ updateProps({
89
+ id: composition.id,
90
+ defaultProps: composition.defaultProps,
91
+ newProps,
92
+ });
93
+ }, [composition, updateProps]);
94
+ const actualProps = (0, react_1.useMemo)(() => {
95
+ var _a, _b;
96
+ if (composition === null) {
97
+ return {};
98
+ }
99
+ return (_b = (_a = props[composition.id]) !== null && _a !== void 0 ? _a : composition.defaultProps) !== null && _b !== void 0 ? _b : {};
100
+ }, [composition, props]);
101
+ const unsavedChangesExist = (0, react_1.useMemo)(() => {
102
+ if (composition === null || composition.defaultProps === undefined) {
103
+ return false;
104
+ }
105
+ return !(0, deep_equal_1.deepEqual)(composition.defaultProps, actualProps);
106
+ }, [actualProps, composition]);
107
+ if (composition === null) {
108
+ return null;
109
+ }
110
+ return ((0, jsx_runtime_1.jsxs)("div", { style: container, className: "css-reset", children: [(0, jsx_runtime_1.jsx)("div", { style: tabsContainer, children: (0, jsx_runtime_1.jsxs)(Tabs_1.Tabs, { children: [(0, jsx_runtime_1.jsxs)(Tabs_1.Tab, { selected: panel === 'input-props', onClick: onPropsSelected, style: { justifyContent: 'space-between' }, children: ["Props", unsavedChangesExist ? ((0, jsx_runtime_1.jsx)("div", { title: saveToolTip, style: circleStyle })) : null] }), (0, jsx_runtime_1.jsx)(RendersTab_1.RendersTab, { onClick: onRendersSelected, selected: panel === 'renders' })] }) }), panel === 'renders' ? ((0, jsx_runtime_1.jsx)(RenderQueue_1.RenderQueue, {})) : ((0, jsx_runtime_1.jsx)(DataEditor_1.DataEditor, { unresolvedComposition: composition, inputProps: actualProps, setInputProps: setInputProps, mayShowSaveButton: true, propsEditType: "default-props", saving: saving, setSaving: setSaving }, composition.id))] }));
111
+ };
112
+ exports.OptionsPanel = OptionsPanel;
@@ -4,6 +4,7 @@ exports.CliCopyButton = 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 clipboard_1 = require("../../icons/clipboard");
7
8
  const svgStyle = {
8
9
  width: 16,
9
10
  height: 16,
@@ -32,7 +33,7 @@ const CliCopyButton = ({ valueToCopy, }) => {
32
33
  const fillColor = (0, react_1.useMemo)(() => {
33
34
  return hovered ? 'white' : colors_1.LIGHT_TEXT;
34
35
  }, [hovered]);
35
- const clipboardIcon = ((0, jsx_runtime_1.jsx)("svg", { "aria-hidden": "true", focusable: "false", "data-prefix": "far", "data-icon": "clipboard", className: "svg-inline--fa fa-clipboard fa-w-12", role: "img", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 384 512", style: svgStyle, children: (0, jsx_runtime_1.jsx)("path", { fill: fillColor, d: "M336 64h-80c0-35.3-28.7-64-64-64s-64 28.7-64 64H48C21.5 64 0 85.5 0 112v352c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V112c0-26.5-21.5-48-48-48zM192 40c13.3 0 24 10.7 24 24s-10.7 24-24 24-24-10.7-24-24 10.7-24 24-24zm144 418c0 3.3-2.7 6-6 6H54c-3.3 0-6-2.7-6-6V118c0-3.3 2.7-6 6-6h42v36c0 6.6 5.4 12 12 12h168c6.6 0 12-5.4 12-12v-36h42c3.3 0 6 2.7 6 6z" }) }));
36
+ const clipboardIcon = (0, jsx_runtime_1.jsx)(clipboard_1.ClipboardIcon, { color: fillColor, style: svgStyle });
36
37
  const checkSvg = ((0, jsx_runtime_1.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 448 512", style: svgStyle, children: (0, jsx_runtime_1.jsx)("path", { fill: fillColor, d: "M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z" }) }));
37
38
  const onPointerEnter = (0, react_1.useCallback)(() => {
38
39
  setHovered(true);
@@ -7,6 +7,7 @@ const colors_1 = require("../../helpers/colors");
7
7
  const container = {
8
8
  borderColor: 'black',
9
9
  borderStyle: 'solid',
10
+ borderWidth: '2px',
10
11
  height: 39,
11
12
  width: 220,
12
13
  position: 'relative',
@@ -15,16 +16,12 @@ const container = {
15
16
  marginRight: 8,
16
17
  borderRadius: 2,
17
18
  };
18
- const slider = {
19
- position: 'relative',
20
- height: 38,
21
- width: 220,
22
- };
19
+ // blue slider
23
20
  const sliderRange = {
24
21
  position: 'absolute',
25
22
  top: 0,
26
23
  backgroundColor: colors_1.BLUE,
27
- height: 39,
24
+ height: 35,
28
25
  };
29
26
  const MultiRangeSlider = ({ min, max, start, end, step, onLeftThumbDrag, onRightThumbDrag, }) => {
30
27
  const getPercent = (0, react_1.useCallback)((value) => Math.round(((value - min) / (max - min)) * 100), [min, max]);
@@ -45,6 +42,6 @@ const MultiRangeSlider = ({ min, max, start, end, step, onLeftThumbDrag, onRight
45
42
  const value = Math.max(Number(event.target.value), start + 1);
46
43
  onRightThumbDrag(value);
47
44
  }, [onRightThumbDrag, start]);
48
- return ((0, jsx_runtime_1.jsx)("div", { style: container, children: (0, jsx_runtime_1.jsxs)("div", { style: slider, children: [(0, jsx_runtime_1.jsx)("input", { type: "range", min: min, max: max, value: start, step: step, onChange: onChangeLeft, className: "__remotion_thumb" }), (0, jsx_runtime_1.jsx)("input", { type: "range", min: min, max: max, value: end, step: step, onChange: onChangeRight, className: "__remotion_thumb" }), (0, jsx_runtime_1.jsx)("div", { style: rangeStyle })] }) }));
45
+ return ((0, jsx_runtime_1.jsxs)("div", { style: container, children: [(0, jsx_runtime_1.jsx)("input", { type: "range", min: min, max: max, value: start, step: step, onChange: onChangeLeft, className: "__remotion_thumb" }), (0, jsx_runtime_1.jsx)("input", { type: "range", min: min, max: max, value: end, step: step, onChange: onChangeRight, className: "__remotion_thumb" }), (0, jsx_runtime_1.jsx)("div", { style: rangeStyle })] }));
49
46
  };
50
47
  exports.MultiRangeSlider = MultiRangeSlider;
@@ -24,8 +24,8 @@ const is_menu_item_1 = require("../Menu/is-menu-item");
24
24
  const styles_1 = require("../Menu/styles");
25
25
  const ModalContainer_1 = require("../ModalContainer");
26
26
  const ModalHeader_1 = require("../ModalHeader");
27
+ const OptionsPanel_1 = require("../OptionsPanel");
27
28
  const actions_1 = require("../RenderQueue/actions");
28
- const RightPanel_1 = require("../RightPanel");
29
29
  const SegmentedControl_1 = require("../SegmentedControl");
30
30
  const Spinner_1 = require("../Spinner");
31
31
  const vertical_1 = require("../Tabs/vertical");
@@ -63,7 +63,7 @@ const container = {
63
63
  padding: '12px 16px',
64
64
  borderBottom: '1px solid black',
65
65
  };
66
- const rightPanel = {
66
+ const optionsPanel = {
67
67
  display: 'flex',
68
68
  width: '100%',
69
69
  };
@@ -311,8 +311,8 @@ const RenderModal = ({ initialFrame, initialVideoImageFormat, initialStillImageF
311
311
  const onClickStill = (0, react_1.useCallback)(() => {
312
312
  var _a;
313
313
  setSidebarCollapsedState({ left: null, right: 'expanded' });
314
- (0, RightPanel_1.persistSelectedPanel)('renders');
315
- (_a = RightPanel_1.rightSidebarTabs.current) === null || _a === void 0 ? void 0 : _a.selectRendersPanel();
314
+ (0, OptionsPanel_1.persistSelectedOptionsSidebarPanel)('renders');
315
+ (_a = OptionsPanel_1.optionsSidebarTabs.current) === null || _a === void 0 ? void 0 : _a.selectRendersPanel();
316
316
  dispatchIfMounted({ type: 'start' });
317
317
  (0, actions_1.addStillRenderJob)({
318
318
  compositionId: resolvedComposition.id,
@@ -361,8 +361,8 @@ const RenderModal = ({ initialFrame, initialVideoImageFormat, initialStillImageF
361
361
  const onClickVideo = (0, react_1.useCallback)(() => {
362
362
  var _a;
363
363
  setSidebarCollapsedState({ left: null, right: 'expanded' });
364
- (0, RightPanel_1.persistSelectedPanel)('renders');
365
- (_a = RightPanel_1.rightSidebarTabs.current) === null || _a === void 0 ? void 0 : _a.selectRendersPanel();
364
+ (0, OptionsPanel_1.persistSelectedOptionsSidebarPanel)('renders');
365
+ (_a = OptionsPanel_1.optionsSidebarTabs.current) === null || _a === void 0 ? void 0 : _a.selectRendersPanel();
366
366
  dispatchIfMounted({ type: 'start' });
367
367
  (0, actions_1.addVideoRenderJob)({
368
368
  compositionId: resolvedComposition.id,
@@ -585,7 +585,7 @@ const RenderModal = ({ initialFrame, initialVideoImageFormat, initialStillImageF
585
585
  return ((0, jsx_runtime_1.jsxs)("div", { style: outer, children: [(0, jsx_runtime_1.jsx)(ModalHeader_1.NewCompHeader, { title: `Render ${resolvedComposition.id}` }), (0, jsx_runtime_1.jsxs)("div", { style: container, children: [(0, jsx_runtime_1.jsx)(SegmentedControl_1.SegmentedControl, { items: renderTabOptions, needsWrapping: false }), (0, jsx_runtime_1.jsx)("div", { style: flexer }), (0, jsx_runtime_1.jsxs)(Button_1.Button, { autoFocus: true, onClick: trigger, disabled: renderDisabled, style: {
586
586
  ...buttonStyle,
587
587
  backgroundColor: outnameValidation.valid ? colors_1.BLUE : colors_1.BLUE_DISABLED,
588
- }, children: [state.type === 'idle' ? `Render ${renderMode}` : 'Rendering...', (0, jsx_runtime_1.jsx)(ShortcutHint_1.ShortcutHint, { keyToPress: "\u21B5", cmdOrCtrl: true })] })] }), (0, jsx_runtime_1.jsxs)("div", { style: horizontalLayout, children: [(0, jsx_runtime_1.jsxs)("div", { style: leftSidebar, children: [shownTabs.includes('general') ? ((0, jsx_runtime_1.jsxs)(vertical_1.VerticalTab, { style: horizontalTab, selected: tab === 'general', onClick: () => setTab('general'), children: [(0, jsx_runtime_1.jsx)("div", { style: iconContainer, children: (0, jsx_runtime_1.jsx)(file_1.FileIcon, { style: icon }) }), "General"] })) : null, shownTabs.includes('data') ? ((0, jsx_runtime_1.jsxs)(vertical_1.VerticalTab, { style: horizontalTab, selected: tab === 'data', onClick: () => setTab('data'), children: [(0, jsx_runtime_1.jsx)("div", { style: iconContainer, children: (0, jsx_runtime_1.jsx)(data_1.DataIcon, { style: icon }) }), "Input Props"] })) : null, shownTabs.includes('picture') ? ((0, jsx_runtime_1.jsxs)(vertical_1.VerticalTab, { style: horizontalTab, selected: tab === 'picture', onClick: () => setTab('picture'), children: [(0, jsx_runtime_1.jsx)("div", { style: iconContainer, children: (0, jsx_runtime_1.jsx)(frame_1.PicIcon, { style: icon }) }), "Picture"] })) : null, shownTabs.includes('audio') ? ((0, jsx_runtime_1.jsxs)(vertical_1.VerticalTab, { style: horizontalTab, selected: tab === 'audio', onClick: () => setTab('audio'), children: [(0, jsx_runtime_1.jsx)("div", { style: iconContainer, children: (0, jsx_runtime_1.jsx)(audio_1.AudioIcon, { style: icon }) }), "Audio"] })) : null, shownTabs.includes('gif') ? ((0, jsx_runtime_1.jsxs)(vertical_1.VerticalTab, { style: horizontalTab, selected: tab === 'gif', onClick: () => setTab('gif'), children: [(0, jsx_runtime_1.jsx)("div", { style: iconContainer, children: (0, jsx_runtime_1.jsx)(gif_1.GifIcon, { style: icon }) }), "GIF"] })) : null, shownTabs.includes('advanced') ? ((0, jsx_runtime_1.jsxs)(vertical_1.VerticalTab, { style: horizontalTab, selected: tab === 'advanced', onClick: () => setTab('advanced'), children: [(0, jsx_runtime_1.jsx)("div", { style: iconContainer, children: (0, jsx_runtime_1.jsx)(gear_1.GearIcon, { style: icon }) }), "Other"] })) : null] }), (0, jsx_runtime_1.jsx)("div", { style: rightPanel, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: tab === 'general' ? ((0, jsx_runtime_1.jsx)(RenderModalBasic_1.RenderModalBasic, { codec: codec, resolvedComposition: resolvedComposition, frame: frame, imageFormatOptions: imageFormatOptions, outName: outName, proResProfile: proResProfile, renderMode: renderMode, setVideoCodec: setCodec, setFrame: setFrame, setOutName: setOutName, setProResProfile: setProResProfile, endFrame: endFrame, setEndFrame: setEndFrame, setStartFrame: setStartFrame, startFrame: startFrame, validationMessage: outnameValidation.valid ? null : outnameValidation.error.message })) : tab === 'picture' ? ((0, jsx_runtime_1.jsx)(RenderModalPicture_1.RenderModalPicture, { renderMode: renderMode, scale: scale, setScale: setScale, pixelFormat: pixelFormat, setPixelFormat: setPixelFormat, imageFormatOptions: imageFormatOptions, crf: crf, setCrf: setCrf, customTargetVideoBitrate: customTargetVideoBitrate, maxCrf: maxCrf, minCrf: minCrf, jpegQuality: jpegQuality, qualityControlType: qualityControlType, setJpegQuality: setJpegQuality, setCustomTargetVideoBitrateValue: setCustomTargetVideoBitrateValue, setQualityControl: setQualityControl, videoImageFormat: videoImageFormat, stillImageFormat: stillImageFormat, shouldDisplayQualityControlPicker: supportsBothQualityControls })) : tab === 'audio' ? ((0, jsx_runtime_1.jsx)(RenderModalAudio_1.RenderModalAudio, { muted: muted, renderMode: renderMode, setMuted: setMuted, codec: codec, audioCodec: audioCodec, setAudioCodec: setAudioCodec, enforceAudioTrack: enforceAudioTrack, setEnforceAudioTrackState: setEnforceAudioTrackState, customTargetAudioBitrate: customTargetAudioBitrate, setCustomTargetAudioBitrateValue: setCustomTargetAudioBitrateValue, setShouldHaveCustomTargetAudioBitrate: setShouldHaveCustomTargetAudioBitrate, shouldHaveCustomTargetAudioBitrate: shouldHaveCustomTargetAudioBitrate })) : tab === 'gif' ? ((0, jsx_runtime_1.jsx)(RenderModalGif_1.RenderModalGif, { everyNthFrame: everyNthFrame, limitNumberOfGifLoops: limitNumberOfGifLoops, numberOfGifLoopsSetting: numberOfGifLoopsSetting, setEveryNthFrameSetting: setEveryNthFrameSetting, setLimitNumberOfGifLoops: setLimitNumberOfGifLoops, setNumberOfGifLoopsSetting: setNumberOfGifLoopsSetting })) : tab === 'data' ? ((0, jsx_runtime_1.jsx)(DataEditor_1.DataEditor, { inputProps: inputProps, setInputProps: setInputProps, unresolvedComposition: unresolvedComposition, mayShowSaveButton: false, propsEditType: "input-props", saving: saving, setSaving: setSaving })) : ((0, jsx_runtime_1.jsx)(RenderModalAdvanced_1.RenderModalAdvanced, { concurrency: concurrency, maxConcurrency: maxConcurrency, minConcurrency: minConcurrency, renderMode: renderMode, setConcurrency: setConcurrency, setVerboseLogging: setVerboseLogging, verbose: verbose, delayRenderTimeout: delayRenderTimeout, setDelayRenderTimeout: setDelayRenderTimeout, disallowParallelEncoding: disallowParallelEncoding, setDisallowParallelEncoding: setDisallowParallelEncoding, setDisableWebSecurity: setDisableWebSecurity, setIgnoreCertificateErrors: setIgnoreCertificateErrors, setHeadless: setHeadless, headless: headless, ignoreCertificateErrors: ignoreCertificateErrors, disableWebSecurity: disableWebSecurity, openGlOption: openGlOption, setOpenGlOption: setOpenGlOption, setEnvVariables: setEnvVariables, envVariables: envVariables })) })] })] }));
588
+ }, children: [state.type === 'idle' ? `Render ${renderMode}` : 'Rendering...', (0, jsx_runtime_1.jsx)(ShortcutHint_1.ShortcutHint, { keyToPress: "\u21B5", cmdOrCtrl: true })] })] }), (0, jsx_runtime_1.jsxs)("div", { style: horizontalLayout, children: [(0, jsx_runtime_1.jsxs)("div", { style: leftSidebar, children: [shownTabs.includes('general') ? ((0, jsx_runtime_1.jsxs)(vertical_1.VerticalTab, { style: horizontalTab, selected: tab === 'general', onClick: () => setTab('general'), children: [(0, jsx_runtime_1.jsx)("div", { style: iconContainer, children: (0, jsx_runtime_1.jsx)(file_1.FileIcon, { style: icon }) }), "General"] })) : null, shownTabs.includes('data') ? ((0, jsx_runtime_1.jsxs)(vertical_1.VerticalTab, { style: horizontalTab, selected: tab === 'data', onClick: () => setTab('data'), children: [(0, jsx_runtime_1.jsx)("div", { style: iconContainer, children: (0, jsx_runtime_1.jsx)(data_1.DataIcon, { style: icon }) }), "Input Props"] })) : null, shownTabs.includes('picture') ? ((0, jsx_runtime_1.jsxs)(vertical_1.VerticalTab, { style: horizontalTab, selected: tab === 'picture', onClick: () => setTab('picture'), children: [(0, jsx_runtime_1.jsx)("div", { style: iconContainer, children: (0, jsx_runtime_1.jsx)(frame_1.PicIcon, { style: icon }) }), "Picture"] })) : null, shownTabs.includes('audio') ? ((0, jsx_runtime_1.jsxs)(vertical_1.VerticalTab, { style: horizontalTab, selected: tab === 'audio', onClick: () => setTab('audio'), children: [(0, jsx_runtime_1.jsx)("div", { style: iconContainer, children: (0, jsx_runtime_1.jsx)(audio_1.AudioIcon, { style: icon }) }), "Audio"] })) : null, shownTabs.includes('gif') ? ((0, jsx_runtime_1.jsxs)(vertical_1.VerticalTab, { style: horizontalTab, selected: tab === 'gif', onClick: () => setTab('gif'), children: [(0, jsx_runtime_1.jsx)("div", { style: iconContainer, children: (0, jsx_runtime_1.jsx)(gif_1.GifIcon, { style: icon }) }), "GIF"] })) : null, shownTabs.includes('advanced') ? ((0, jsx_runtime_1.jsxs)(vertical_1.VerticalTab, { style: horizontalTab, selected: tab === 'advanced', onClick: () => setTab('advanced'), children: [(0, jsx_runtime_1.jsx)("div", { style: iconContainer, children: (0, jsx_runtime_1.jsx)(gear_1.GearIcon, { style: icon }) }), "Other"] })) : null] }), (0, jsx_runtime_1.jsx)("div", { style: optionsPanel, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: tab === 'general' ? ((0, jsx_runtime_1.jsx)(RenderModalBasic_1.RenderModalBasic, { codec: codec, resolvedComposition: resolvedComposition, frame: frame, imageFormatOptions: imageFormatOptions, outName: outName, proResProfile: proResProfile, renderMode: renderMode, setVideoCodec: setCodec, setFrame: setFrame, setOutName: setOutName, setProResProfile: setProResProfile, endFrame: endFrame, setEndFrame: setEndFrame, setStartFrame: setStartFrame, startFrame: startFrame, validationMessage: outnameValidation.valid ? null : outnameValidation.error.message })) : tab === 'picture' ? ((0, jsx_runtime_1.jsx)(RenderModalPicture_1.RenderModalPicture, { renderMode: renderMode, scale: scale, setScale: setScale, pixelFormat: pixelFormat, setPixelFormat: setPixelFormat, imageFormatOptions: imageFormatOptions, crf: crf, setCrf: setCrf, customTargetVideoBitrate: customTargetVideoBitrate, maxCrf: maxCrf, minCrf: minCrf, jpegQuality: jpegQuality, qualityControlType: qualityControlType, setJpegQuality: setJpegQuality, setCustomTargetVideoBitrateValue: setCustomTargetVideoBitrateValue, setQualityControl: setQualityControl, videoImageFormat: videoImageFormat, stillImageFormat: stillImageFormat, shouldDisplayQualityControlPicker: supportsBothQualityControls })) : tab === 'audio' ? ((0, jsx_runtime_1.jsx)(RenderModalAudio_1.RenderModalAudio, { muted: muted, renderMode: renderMode, setMuted: setMuted, codec: codec, audioCodec: audioCodec, setAudioCodec: setAudioCodec, enforceAudioTrack: enforceAudioTrack, setEnforceAudioTrackState: setEnforceAudioTrackState, customTargetAudioBitrate: customTargetAudioBitrate, setCustomTargetAudioBitrateValue: setCustomTargetAudioBitrateValue, setShouldHaveCustomTargetAudioBitrate: setShouldHaveCustomTargetAudioBitrate, shouldHaveCustomTargetAudioBitrate: shouldHaveCustomTargetAudioBitrate })) : tab === 'gif' ? ((0, jsx_runtime_1.jsx)(RenderModalGif_1.RenderModalGif, { everyNthFrame: everyNthFrame, limitNumberOfGifLoops: limitNumberOfGifLoops, numberOfGifLoopsSetting: numberOfGifLoopsSetting, setEveryNthFrameSetting: setEveryNthFrameSetting, setLimitNumberOfGifLoops: setLimitNumberOfGifLoops, setNumberOfGifLoopsSetting: setNumberOfGifLoopsSetting })) : tab === 'data' ? ((0, jsx_runtime_1.jsx)(DataEditor_1.DataEditor, { inputProps: inputProps, setInputProps: setInputProps, unresolvedComposition: unresolvedComposition, mayShowSaveButton: false, propsEditType: "input-props", saving: saving, setSaving: setSaving })) : ((0, jsx_runtime_1.jsx)(RenderModalAdvanced_1.RenderModalAdvanced, { concurrency: concurrency, maxConcurrency: maxConcurrency, minConcurrency: minConcurrency, renderMode: renderMode, setConcurrency: setConcurrency, setVerboseLogging: setVerboseLogging, verbose: verbose, delayRenderTimeout: delayRenderTimeout, setDelayRenderTimeout: setDelayRenderTimeout, disallowParallelEncoding: disallowParallelEncoding, setDisallowParallelEncoding: setDisallowParallelEncoding, setDisableWebSecurity: setDisableWebSecurity, setIgnoreCertificateErrors: setIgnoreCertificateErrors, setHeadless: setHeadless, headless: headless, ignoreCertificateErrors: ignoreCertificateErrors, disableWebSecurity: disableWebSecurity, openGlOption: openGlOption, setOpenGlOption: setOpenGlOption, setEnvVariables: setEnvVariables, envVariables: envVariables })) })] })] }));
589
589
  };
590
590
  const RenderModalWithLoader = (props) => {
591
591
  const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
@@ -1,2 +1,2 @@
1
1
  import type { Codec } from '@remotion/renderer';
2
- export declare const humanReadableCodec: (codec: Codec) => "GIF" | "AAC" | "MP3" | "H.264" | "H.264 Matroska" | "H.265" | "ProRes" | "WebM VP8" | "WebM VP9" | "Waveform" | undefined;
2
+ export declare const humanReadableCodec: (codec: Codec) => "AAC" | "MP3" | "GIF" | "H.264" | "H.264 Matroska" | "H.265" | "ProRes" | "WebM VP8" | "WebM VP9" | "Waveform" | undefined;
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RenderQueueOpenInFinderItem = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
+ const folder_1 = require("../../icons/folder");
6
7
  const InlineAction_1 = require("../InlineAction");
7
8
  const NotificationCenter_1 = require("../Notifications/NotificationCenter");
8
9
  const actions_1 = require("./actions");
@@ -19,7 +20,7 @@ const RenderQueueOpenInFinderItem = ({ job, }) => {
19
20
  };
20
21
  }, []);
21
22
  const renderAction = (0, react_1.useCallback)((color) => {
22
- return ((0, jsx_runtime_1.jsx)("svg", { style: icon, viewBox: "0 0 576 512", children: (0, jsx_runtime_1.jsx)("path", { fill: color, d: "M384 480h48c11.4 0 21.9-6 27.6-15.9l112-192c5.8-9.9 5.8-22.1 .1-32.1S555.5 224 544 224H144c-11.4 0-21.9 6-27.6 15.9L48 357.1V96c0-8.8 7.2-16 16-16H181.5c4.2 0 8.3 1.7 11.3 4.7l26.5 26.5c21 21 49.5 32.8 79.2 32.8H416c8.8 0 16 7.2 16 16v32h48V160c0-35.3-28.7-64-64-64H298.5c-17 0-33.3-6.7-45.3-18.7L226.7 50.7c-12-12-28.3-18.7-45.3-18.7H64C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H87.7 384z" }) }));
23
+ return (0, jsx_runtime_1.jsx)(folder_1.ExpandedFolderIconSolid, { style: icon, color: color });
23
24
  }, [icon]);
24
25
  return (0, jsx_runtime_1.jsx)(InlineAction_1.InlineAction, { renderAction: renderAction, onClick: onClick });
25
26
  };
@@ -6,12 +6,12 @@ const react_1 = require("react");
6
6
  const use_breakpoint_1 = require("../helpers/use-breakpoint");
7
7
  const sidebar_1 = require("../state/sidebar");
8
8
  const CanvasOrLoading_1 = require("./CanvasOrLoading");
9
- const CompositionSelector_1 = require("./CompositionSelector");
10
9
  const CurrentCompositionSideEffects_1 = require("./CurrentCompositionSideEffects");
10
+ const ExplorerPanel_1 = require("./ExplorerPanel");
11
11
  const InitialCompositionLoader_1 = require("./InitialCompositionLoader");
12
12
  const MenuToolbar_1 = require("./MenuToolbar");
13
+ const OptionsPanel_1 = require("./OptionsPanel");
13
14
  const PreviewToolbar_1 = require("./PreviewToolbar");
14
- const RightPanel_1 = require("./RightPanel");
15
15
  const SplitterContainer_1 = require("./Splitter/SplitterContainer");
16
16
  const SplitterElement_1 = require("./Splitter/SplitterElement");
17
17
  const SplitterHandle_1 = require("./Splitter/SplitterHandle");
@@ -26,16 +26,12 @@ const row = {
26
26
  display: 'flex',
27
27
  flexDirection: 'row',
28
28
  flex: 1,
29
+ minHeight: 0,
29
30
  };
30
31
  const canvasContainer = {
31
32
  flex: 1,
32
33
  display: 'flex',
33
34
  };
34
- const leftContainer = {
35
- flex: 1,
36
- display: 'flex',
37
- maxWidth: '100%',
38
- };
39
35
  const useResponsiveSidebarStatus = () => {
40
36
  const { sidebarCollapsedStateLeft } = (0, react_1.useContext)(sidebar_1.SidebarContext);
41
37
  const responsiveLeftStatus = (0, use_breakpoint_1.useBreakpoint)(1200) ? 'collapsed' : 'expanded';
@@ -66,6 +62,6 @@ const TopPanel = () => {
66
62
  const onCollapseRight = (0, react_1.useCallback)(() => {
67
63
  setSidebarCollapsedState({ left: null, right: 'collapsed' });
68
64
  }, [setSidebarCollapsedState]);
69
- return ((0, jsx_runtime_1.jsxs)("div", { style: container, children: [(0, jsx_runtime_1.jsx)(InitialCompositionLoader_1.InitialCompositionLoader, {}), (0, jsx_runtime_1.jsx)(MenuToolbar_1.MenuToolbar, {}), (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' ? ((0, jsx_runtime_1.jsx)(SplitterElement_1.SplitterElement, { type: "flexer", children: (0, jsx_runtime_1.jsx)("div", { style: leftContainer, className: "css-reset", children: (0, jsx_runtime_1.jsx)(CompositionSelector_1.CompositionSelector, {}) }) })) : null, actualStateLeft === 'expanded' ? ((0, jsx_runtime_1.jsx)(SplitterHandle_1.SplitterHandle, { allowToCollapse: "left", onCollapse: onCollapseLeft })) : null, (0, jsx_runtime_1.jsx)(SplitterElement_1.SplitterElement, { 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, { type: "flexer", children: (0, jsx_runtime_1.jsx)("div", { style: canvasContainer, children: (0, jsx_runtime_1.jsx)(CanvasOrLoading_1.CanvasOrLoading, {}) }) }), actualStateRight === 'expanded' ? ((0, jsx_runtime_1.jsx)(SplitterHandle_1.SplitterHandle, { allowToCollapse: "right", onCollapse: onCollapseRight })) : null, actualStateRight === 'expanded' ? ((0, jsx_runtime_1.jsx)(SplitterElement_1.SplitterElement, { type: "anti-flexer", children: (0, jsx_runtime_1.jsx)(RightPanel_1.RightPanel, {}) })) : null] }) })] }) }), (0, jsx_runtime_1.jsx)(PreviewToolbar_1.PreviewToolbar, {}), (0, jsx_runtime_1.jsx)(CurrentCompositionSideEffects_1.CurrentCompositionKeybindings, {}), (0, jsx_runtime_1.jsx)(CurrentCompositionSideEffects_1.TitleUpdater, {})] }));
65
+ return ((0, jsx_runtime_1.jsxs)("div", { style: container, children: [(0, jsx_runtime_1.jsx)(InitialCompositionLoader_1.InitialCompositionLoader, {}), (0, jsx_runtime_1.jsx)(MenuToolbar_1.MenuToolbar, {}), (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' ? ((0, jsx_runtime_1.jsx)(SplitterElement_1.SplitterElement, { type: "flexer", children: (0, jsx_runtime_1.jsx)(ExplorerPanel_1.ExplorerPanel, {}) })) : null, actualStateLeft === 'expanded' ? ((0, jsx_runtime_1.jsx)(SplitterHandle_1.SplitterHandle, { allowToCollapse: "left", onCollapse: onCollapseLeft })) : null, (0, jsx_runtime_1.jsx)(SplitterElement_1.SplitterElement, { 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, { type: "flexer", children: (0, jsx_runtime_1.jsx)("div", { style: canvasContainer, children: (0, jsx_runtime_1.jsx)(CanvasOrLoading_1.CanvasOrLoading, {}) }) }), actualStateRight === 'expanded' ? ((0, jsx_runtime_1.jsx)(SplitterHandle_1.SplitterHandle, { allowToCollapse: "right", onCollapse: onCollapseRight })) : null, actualStateRight === 'expanded' ? ((0, jsx_runtime_1.jsx)(SplitterElement_1.SplitterElement, { type: "anti-flexer", children: (0, jsx_runtime_1.jsx)(OptionsPanel_1.OptionsPanel, {}) })) : null] }) })] }) }), (0, jsx_runtime_1.jsx)(PreviewToolbar_1.PreviewToolbar, {}), (0, jsx_runtime_1.jsx)(CurrentCompositionSideEffects_1.CurrentCompositionKeybindings, {}), (0, jsx_runtime_1.jsx)(CurrentCompositionSideEffects_1.TitleUpdater, {})] }));
70
66
  };
71
67
  exports.TopPanel = TopPanel;
@@ -10,6 +10,7 @@ const CopyButton_1 = require("../CopyButton");
10
10
  const layout_1 = require("../layout");
11
11
  const ModalContainer_1 = require("../ModalContainer");
12
12
  const ModalHeader_1 = require("../ModalHeader");
13
+ const NotificationCenter_1 = require("../Notifications/NotificationCenter");
13
14
  const container = {
14
15
  padding: 20,
15
16
  paddingTop: 0,
@@ -38,6 +39,8 @@ const UpdateModal = ({ info }) => {
38
39
  setSelectedModal(null);
39
40
  }, [setSelectedModal]);
40
41
  const command = commands[info.packageManager];
41
- return ((0, jsx_runtime_1.jsxs)(ModalContainer_1.ModalContainer, { onOutsideClick: onQuit, onEscape: onQuit, children: [(0, jsx_runtime_1.jsx)(ModalHeader_1.NewCompHeader, { title: "Update available" }), (0, jsx_runtime_1.jsxs)("div", { style: container, children: [(0, jsx_runtime_1.jsx)("p", { children: "A new update for Remotion is available! Run the following command:" }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)(layout_1.Flex, { children: (0, jsx_runtime_1.jsx)("pre", { onClick: () => (0, copy_text_1.copyText)(command), style: code, children: command }) }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1 }), (0, jsx_runtime_1.jsx)(CopyButton_1.CopyButton, { textToCopy: command, label: "Copy command", labelWhenCopied: "Copied!" })] }), (0, jsx_runtime_1.jsxs)("p", { children: ["This will upgrade Remotion from ", info.currentVersion, " to", ' ', info.latestVersion, "."] }), (0, jsx_runtime_1.jsxs)("p", { children: ["Read the", ' ', (0, jsx_runtime_1.jsx)("a", { style: link, target: "_blank", href: "https://github.com/remotion-dev/remotion/releases", children: "Release notes" }), ' ', "to know what", "'s", " new in Remotion."] })] })] }));
42
+ return ((0, jsx_runtime_1.jsxs)(ModalContainer_1.ModalContainer, { onOutsideClick: onQuit, onEscape: onQuit, children: [(0, jsx_runtime_1.jsx)(ModalHeader_1.NewCompHeader, { title: "Update available" }), (0, jsx_runtime_1.jsxs)("div", { style: container, children: [(0, jsx_runtime_1.jsx)("p", { children: "A new update for Remotion is available! Run the following command:" }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)(layout_1.Flex, { children: (0, jsx_runtime_1.jsx)("pre", { onClick: () => (0, copy_text_1.copyText)(command).catch((err) => {
43
+ (0, NotificationCenter_1.sendErrorNotification)(`Could not copy: ${err.message}`);
44
+ }), style: code, children: command }) }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1 }), (0, jsx_runtime_1.jsx)(CopyButton_1.CopyButton, { textToCopy: command, label: "Copy command", labelWhenCopied: "Copied!" })] }), (0, jsx_runtime_1.jsxs)("p", { children: ["This will upgrade Remotion from ", info.currentVersion, " to", ' ', info.latestVersion, "."] }), (0, jsx_runtime_1.jsxs)("p", { children: ["Read the", ' ', (0, jsx_runtime_1.jsx)("a", { style: link, target: "_blank", href: "https://github.com/remotion-dev/remotion/releases", children: "Release notes" }), ' ', "to know what", "'s", " new in Remotion."] })] })] }));
42
45
  };
43
46
  exports.UpdateModal = UpdateModal;
@@ -1 +1 @@
1
- export declare const copyText: (cmd: string) => void;
1
+ export declare const copyText: (cmd: string) => Promise<void>;
@@ -3,16 +3,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.copyText = void 0;
4
4
  const copyText = (cmd) => {
5
5
  const permissionName = 'clipboard-write';
6
- navigator.permissions
7
- .query({ name: permissionName })
8
- .then((result) => {
9
- if (result.state === 'granted' || result.state === 'prompt') {
10
- navigator.clipboard.writeText(cmd);
11
- }
12
- })
13
- .catch((err) => {
14
- // eslint-disable-next-line no-alert
15
- alert('Could not copy:' + err);
6
+ return new Promise((resolve, reject) => {
7
+ navigator.permissions
8
+ .query({ name: permissionName })
9
+ .then((result) => {
10
+ if (result.state === 'granted' || result.state === 'prompt') {
11
+ navigator.clipboard.writeText(cmd);
12
+ resolve();
13
+ }
14
+ else {
15
+ reject(new Error('Permission to copy not granted'));
16
+ }
17
+ })
18
+ .catch((err) => {
19
+ reject(err);
20
+ });
16
21
  });
17
22
  };
18
23
  exports.copyText = copyText;
@@ -11,13 +11,18 @@ const pickColor = () => {
11
11
  const open = new EyeDropper().open();
12
12
  open
13
13
  .then((color) => {
14
- var _a;
15
- (0, copy_text_1.copyText)(color.sRGBHex);
16
- (_a = NotificationCenter_1.notificationCenter.current) === null || _a === void 0 ? void 0 : _a.addNotification({
17
- content: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ColorDot_1.ColorDot, { color: color.sRGBHex }), " ", (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1 }), " Copied", ' ', color.sRGBHex] })),
18
- created: Date.now(),
19
- duration: 2000,
20
- id: String(Math.random()),
14
+ (0, copy_text_1.copyText)(color.sRGBHex)
15
+ .then(() => {
16
+ var _a;
17
+ (_a = NotificationCenter_1.notificationCenter.current) === null || _a === void 0 ? void 0 : _a.addNotification({
18
+ content: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ColorDot_1.ColorDot, { color: color.sRGBHex }), " ", (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1 }), " Copied", ' ', color.sRGBHex] })),
19
+ created: Date.now(),
20
+ duration: 2000,
21
+ id: String(Math.random()),
22
+ });
23
+ })
24
+ .catch((err) => {
25
+ (0, NotificationCenter_1.sendErrorNotification)(`Could not copy: ${err.message}`);
21
26
  });
22
27
  })
23
28
  .catch((err) => {
@@ -0,0 +1,4 @@
1
+ import type { SVGProps } from 'react';
2
+ export declare const ClipboardIcon: React.FC<SVGProps<SVGSVGElement> & {
3
+ color?: string;
4
+ }>;
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ClipboardIcon = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const ClipboardIcon = ({ color, ...props }) => ((0, jsx_runtime_1.jsx)("svg", { viewBox: "0 0 384 512", ...props, children: (0, jsx_runtime_1.jsx)("path", { fill: color, d: "M336 64h-80c0-35.3-28.7-64-64-64s-64 28.7-64 64H48C21.5 64 0 85.5 0 112v352c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V112c0-26.5-21.5-48-48-48zM192 40c13.3 0 24 10.7 24 24s-10.7 24-24 24-24-10.7-24-24 10.7-24 24-24zm144 418c0 3.3-2.7 6-6 6H54c-3.3 0-6-2.7-6-6V118c0-3.3 2.7-6 6-6h42v36c0 6.6 5.4 12 12 12h168c6.6 0 12-5.4 12-12v-36h42c3.3 0 6 2.7 6 6z" }) }));
6
+ exports.ClipboardIcon = ClipboardIcon;
@@ -1,2 +1,4 @@
1
1
  import type { SVGProps } from 'react';
2
- export declare const FileIcon: (props: SVGProps<SVGSVGElement>) => JSX.Element;
2
+ export declare const FileIcon: React.FC<SVGProps<SVGSVGElement> & {
3
+ color?: string;
4
+ }>;
@@ -2,5 +2,5 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.FileIcon = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
- const FileIcon = (props) => ((0, jsx_runtime_1.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 384 512", ...props, children: (0, jsx_runtime_1.jsx)("path", { fill: "currentcolor", d: "M0 64C0 28.65 28.65 0 64 0h156.1c12.7 0 25 5.057 34 14.06L369.9 129.9c9 9 14.1 21.3 14.1 34V448c0 35.3-28.7 64-64 64H64c-35.35 0-64-28.7-64-64V64zm352 128H240c-26.5 0-48-21.5-48-48V32H64c-17.67 0-32 14.33-32 32v384c0 17.7 14.33 32 32 32h256c17.7 0 32-14.3 32-32V192zm-4.7-39.4L231.4 36.69c-2-2.07-4.6-3.51-7.4-4.21V144c0 8.8 7.2 16 16 16h111.5c-.7-2.8-2.1-5.4-4.2-7.4z" }) }));
5
+ const FileIcon = ({ color, ...props }) => ((0, jsx_runtime_1.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 384 512", ...props, children: (0, jsx_runtime_1.jsx)("path", { fill: color !== null && color !== void 0 ? color : 'currentColor', d: "M0 64C0 28.65 28.65 0 64 0h156.1c12.7 0 25 5.057 34 14.06L369.9 129.9c9 9 14.1 21.3 14.1 34V448c0 35.3-28.7 64-64 64H64c-35.35 0-64-28.7-64-64V64zm352 128H240c-26.5 0-48-21.5-48-48V32H64c-17.67 0-32 14.33-32 32v384c0 17.7 14.33 32 32 32h256c17.7 0 32-14.3 32-32V192zm-4.7-39.4L231.4 36.69c-2-2.07-4.6-3.51-7.4-4.21V144c0 8.8 7.2 16 16 16h111.5c-.7-2.8-2.1-5.4-4.2-7.4z" }) }));
6
6
  exports.FileIcon = FileIcon;
@@ -6,3 +6,6 @@ export declare const CollapsedFolderIcon: React.FC<SVGProps<SVGSVGElement> & {
6
6
  export declare const ExpandedFolderIcon: React.FC<SVGProps<SVGSVGElement> & {
7
7
  color: string;
8
8
  }>;
9
+ export declare const ExpandedFolderIconSolid: React.FC<SVGProps<SVGSVGElement> & {
10
+ color: string;
11
+ }>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ExpandedFolderIcon = exports.CollapsedFolderIcon = void 0;
3
+ exports.ExpandedFolderIconSolid = exports.ExpandedFolderIcon = exports.CollapsedFolderIcon = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const CollapsedFolderIcon = ({ color, ...props }) => {
6
6
  return ((0, jsx_runtime_1.jsx)("svg", { viewBox: "0 0 512 512", ...props, children: (0, jsx_runtime_1.jsx)("path", { fill: color, d: "M447.1 96H272L226.7 50.75C214.7 38.74 198.5 32 181.5 32H63.1c-35.35 0-64 28.65-64 64v320c0 35.35 28.65 64 64 64h384c35.35 0 64-28.65 64-64V160C511.1 124.7 483.3 96 447.1 96zM480 416c0 17.64-14.36 32-32 32H64c-17.64 0-32-14.36-32-32V96c0-17.64 14.36-32 32-32h117.5c8.549 0 16.58 3.328 22.63 9.375L258.7 128H448c17.64 0 32 14.36 32 32V416z" }) }));
@@ -10,3 +10,7 @@ const ExpandedFolderIcon = ({ color, ...props }) => {
10
10
  return ((0, jsx_runtime_1.jsx)("svg", { viewBox: "0 0 576 512", ...props, children: (0, jsx_runtime_1.jsx)("path", { fill: color, d: "M566.6 211.6C557.5 199.1 543.4 192 527.1 192H134.2C114.3 192 96.2 204.5 89.23 223.1L32 375.8V96c0-17.64 14.36-32 32-32h117.5c8.549 0 16.58 3.328 22.63 9.375L258.7 128H448c17.64 0 32 14.36 32 32h32c0-35.35-28.65-64-64-64H272L226.7 50.75C214.7 38.74 198.5 32 181.5 32H64C28.65 32 0 60.65 0 96v320c0 35.35 28.65 64 64 64h403.1c21.11 0 39.53-13.53 45.81-33.69l60-192C578.4 239.6 575.8 224 566.6 211.6zM543.2 244.8l-60 192C481.1 443.5 475 448 467.1 448H64c-3.322 0-6.357-.9551-9.373-1.898c-2.184-1.17-4.109-2.832-5.596-4.977c-3.031-4.375-3.703-9.75-1.828-14.73l72-192C121.5 228.2 127.5 224 134.2 224h393.8c5.141 0 9.844 2.375 12.89 6.516C543.9 234.7 544.8 239.9 543.2 244.8z" }) }));
11
11
  };
12
12
  exports.ExpandedFolderIcon = ExpandedFolderIcon;
13
+ const ExpandedFolderIconSolid = ({ color, ...props }) => {
14
+ return ((0, jsx_runtime_1.jsx)("svg", { viewBox: "0 0 576 512", ...props, children: (0, jsx_runtime_1.jsx)("path", { fill: color, d: "M384 480h48c11.4 0 21.9-6 27.6-15.9l112-192c5.8-9.9 5.8-22.1 .1-32.1S555.5 224 544 224H144c-11.4 0-21.9 6-27.6 15.9L48 357.1V96c0-8.8 7.2-16 16-16H181.5c4.2 0 8.3 1.7 11.3 4.7l26.5 26.5c21 21 49.5 32.8 79.2 32.8H416c8.8 0 16 7.2 16 16v32h48V160c0-35.3-28.7-64-64-64H298.5c-17 0-33.3-6.7-45.3-18.7L226.7 50.7c-12-12-28.3-18.7-45.3-18.7H64C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H87.7 384z" }) }));
15
+ };
16
+ exports.ExpandedFolderIconSolid = ExpandedFolderIconSolid;
@@ -27,4 +27,5 @@ export type EventSourceEvent = {
27
27
  } | {
28
28
  type: 'new-public-folder';
29
29
  files: StaticFile[];
30
+ folderExists: string | null;
30
31
  };
@@ -36,6 +36,7 @@ const openEventSource = () => {
36
36
  }
37
37
  if (newEvent.type === 'new-public-folder') {
38
38
  window.remotion_staticFiles = newEvent.files;
39
+ window.remotion_publicFolderExists = newEvent.folderExists;
39
40
  }
40
41
  listeners.forEach((l) => {
41
42
  if (l.type === newEvent.type) {
@@ -33,5 +33,5 @@ export declare const getCliOptions: (options: {
33
33
  videoBitrate: string | null;
34
34
  height: number | null;
35
35
  width: number | null;
36
- configFileImageFormat: "png" | "jpeg" | "none" | undefined;
36
+ configFileImageFormat: "none" | "png" | "jpeg" | undefined;
37
37
  }>;
package/dist/index.d.ts CHANGED
@@ -118,7 +118,7 @@ export declare const CliInternals: {
118
118
  videoBitrate: string | null;
119
119
  height: number | null;
120
120
  width: number | null;
121
- configFileImageFormat: "png" | "jpeg" | "none" | undefined;
121
+ configFileImageFormat: "none" | "png" | "jpeg" | undefined;
122
122
  }>;
123
123
  loadConfig: (remotionRoot: string) => Promise<string | null>;
124
124
  initializeCli: (remotionRoot: string) => Promise<void>;
@@ -127,7 +127,7 @@ export declare const CliInternals: {
127
127
  parsedCli: {
128
128
  "browser-executable": import("@remotion/renderer").BrowserExecutable;
129
129
  "pixel-format": "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le";
130
- "image-format": "png" | "jpeg" | "pdf" | "webp" | "none";
130
+ "image-format": "none" | "png" | "jpeg" | "pdf" | "webp";
131
131
  "prores-profile": "4444-xq" | "4444" | "hq" | "standard" | "light" | "proxy";
132
132
  "bundle-cache": string;
133
133
  "env-file": string;
@@ -191,7 +191,7 @@ export declare const CliInternals: {
191
191
  downloadName: string | null;
192
192
  outName: string | null;
193
193
  configImageFormat: "png" | "jpeg" | "pdf" | "webp" | null;
194
- cliFlag: "png" | "jpeg" | "pdf" | "webp" | "none" | null;
194
+ cliFlag: "none" | "png" | "jpeg" | "pdf" | "webp" | null;
195
195
  isLambda: boolean;
196
196
  fromUi: "png" | "jpeg" | "pdf" | "webp" | null;
197
197
  }) => {
@@ -206,8 +206,8 @@ export declare const CliInternals: {
206
206
  };
207
207
  getVideoImageFormat: ({ codec, uiImageFormat, }: {
208
208
  codec: import("@remotion/renderer").CodecOrUndefined;
209
- uiImageFormat: "png" | "jpeg" | "none" | null;
210
- }) => "png" | "jpeg" | "none";
209
+ uiImageFormat: "none" | "png" | "jpeg" | null;
210
+ }) => "none" | "png" | "jpeg";
211
211
  printCompositions: (compositions: import("remotion").VideoConfig[]) => void;
212
212
  getFinalOutputCodec: ({ cliFlag, configFile, downloadName, outName, uiCodec, }: {
213
213
  cliFlag: import("@remotion/renderer").CodecOrUndefined;
@@ -11,5 +11,5 @@ type Range = {
11
11
  type Ranges = Range[] & {
12
12
  type?: string;
13
13
  };
14
- export declare function parseRange(size: number, str: string | string[]): -1 | Ranges | -2;
14
+ export declare function parseRange(size: number, str: string | string[]): -1 | -2 | Ranges;
15
15
  export {};
@@ -38,12 +38,15 @@ const watchPublicFolder = ({ publicDir, onUpdate, staticHash, }) => {
38
38
  onUpdate,
39
39
  staticHash,
40
40
  });
41
+ onUpdate();
41
42
  watcher.close();
42
43
  }
43
44
  };
44
45
  const watcher = (0, node_fs_1.watch)(parentDir, {}, onDirChange);
45
46
  return;
46
47
  }
48
+ // Known bug: If whole public folder is deleted, this will not be called on macOS.
49
+ // This is not severe, so a wontfix for now.
47
50
  (0, node_fs_1.watch)(publicDir, { recursive: (0, env_supports_fs_recursive_1.envSupportsFsRecursive)() }, () => {
48
51
  (0, exports.fetchFolder)({ publicDir, staticHash });
49
52
  onUpdate();
@@ -96,6 +96,7 @@ const handleFallback = async ({ remotionRoot, hash, response, getCurrentInputPro
96
96
  ignoreCertificateErrors,
97
97
  openGlRenderer,
98
98
  },
99
+ publicFolderExists: (0, node_fs_1.existsSync)(publicDir) ? publicDir : null,
99
100
  }));
100
101
  };
101
102
  const handleProjectInfo = async (remotionRoot, _, response) => {
package/dist/studio.js CHANGED
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.studioCommand = void 0;
7
7
  const node_crypto_1 = __importDefault(require("node:crypto"));
8
+ const node_fs_1 = require("node:fs");
8
9
  const node_path_1 = __importDefault(require("node:path"));
9
10
  const better_opn_1 = require("./better-opn");
10
11
  const chalk_1 = require("./chalk");
@@ -92,9 +93,15 @@ const studioCommand = async (remotionRoot, args) => {
92
93
  remotionRoot,
93
94
  onUpdate: () => {
94
95
  (0, live_events_1.waitForLiveEventsListener)().then((listener) => {
96
+ const files = (0, public_folder_1.getFiles)();
95
97
  listener.sendEventToClient({
96
98
  type: 'new-public-folder',
97
- files: (0, public_folder_1.getFiles)(),
99
+ files,
100
+ folderExists: files.length > 0
101
+ ? publicDir
102
+ : (0, node_fs_1.existsSync)(publicDir)
103
+ ? publicDir
104
+ : null,
98
105
  });
99
106
  });
100
107
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/cli",
3
- "version": "4.0.11",
3
+ "version": "4.0.14",
4
4
  "description": "CLI for Remotion",
5
5
  "main": "dist/index.js",
6
6
  "sideEffects": false,
@@ -35,11 +35,11 @@
35
35
  "prompts": "2.4.1",
36
36
  "semver": "7.5.3",
37
37
  "source-map": "0.6.1",
38
- "@remotion/bundler": "4.0.11",
39
- "@remotion/player": "4.0.11",
40
- "@remotion/media-utils": "4.0.11",
41
- "remotion": "4.0.11",
42
- "@remotion/renderer": "4.0.11"
38
+ "@remotion/bundler": "4.0.14",
39
+ "@remotion/media-utils": "4.0.14",
40
+ "@remotion/player": "4.0.14",
41
+ "@remotion/renderer": "4.0.14",
42
+ "remotion": "4.0.14"
43
43
  },
44
44
  "peerDependencies": {
45
45
  "react": ">=16.8.0",
@@ -65,8 +65,8 @@
65
65
  "typescript": "4.9.5",
66
66
  "vitest": "0.31.1",
67
67
  "zod": "^3.21.4",
68
- "@remotion/tailwind": "4.0.11",
69
- "@remotion/zod-types": "4.0.11"
68
+ "@remotion/zod-types": "4.0.14",
69
+ "@remotion/tailwind": "4.0.14"
70
70
  },
71
71
  "keywords": [
72
72
  "remotion",
package/styles/styles.css CHANGED
@@ -54,17 +54,18 @@ input[type='color'].__remotion_color_picker::-webkit-color-swatch {
54
54
  position: absolute;
55
55
  height: 0;
56
56
  outline: none;
57
- top: 51%;
58
- width: 100%;
57
+ top: 15.5px;
58
+ width: 221px;
59
+ margin-left: -2px;
59
60
  z-index: 2;
60
61
  }
61
62
 
62
63
  /* For Firefox browsers */
63
64
  .__remotion_thumb::-moz-range-thumb {
64
- border: none;
65
- border-radius: 0;
65
+ border: 1px solid black;
66
+ border-radius: 2px;
66
67
  cursor: pointer;
67
- height: 40px;
68
+ height: 37px;
68
69
  width: 10px;
69
70
  pointer-events: all;
70
71
  border-color: black;
@@ -72,26 +73,15 @@ input[type='color'].__remotion_color_picker::-webkit-color-swatch {
72
73
  position: relative;
73
74
  }
74
75
 
75
- .__remotion_thumb::-moz-range-thumb {
76
- border-width: 1px;
77
- border-style: solid;
78
- }
79
-
80
76
  /* For Chrome browsers */
81
77
  .__remotion_thumb::-webkit-slider-thumb {
82
78
  border: 1px solid black;
83
79
  border-radius: 2px;
84
80
  cursor: pointer;
85
- height: 40px;
81
+ height: 39px;
86
82
  width: 10px;
87
83
  pointer-events: all;
88
84
  border-color: black;
89
85
  background-color: white;
90
86
  position: relative;
91
87
  }
92
-
93
- .__remotion_thumb::-webkit-slider-thumb {
94
- border-width: 1px;
95
- border-style: solid;
96
- border-color: black;
97
- }