@remotion/cli 4.0.18 → 4.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config/log.d.ts +1 -1
- package/dist/editor/components/AssetSelector.js +6 -5
- package/dist/editor/components/AssetSelectorItem.d.ts +17 -1
- package/dist/editor/components/AssetSelectorItem.js +58 -12
- package/dist/editor/components/NewComposition/RemInput.d.ts +2 -2
- package/dist/editor/components/NewComposition/RemInputTypeColor.d.ts +1 -1
- package/dist/editor/components/Notifications/ServerDisconnected.js +3 -0
- package/dist/editor/helpers/colors.d.ts +1 -1
- package/dist/editor/helpers/create-folder-tree.d.ts +10 -1
- package/dist/editor/helpers/create-folder-tree.js +31 -1
- package/dist/get-cli-options.d.ts +1 -1
- package/dist/index.d.ts +8 -8
- package/dist/log.d.ts +4 -4
- package/package.json +8 -8
- package/dist/editor/components/RenderModal/SchemaEditor/input-props-serialization.d.ts +0 -14
- package/dist/editor/components/RenderModal/SchemaEditor/input-props-serialization.js +0 -42
- package/dist/editor/components/RightPanel.d.ts +0 -8
- package/dist/editor/components/RightPanel.js +0 -79
package/dist/config/log.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const getLogLevel: () => "
|
|
1
|
+
export declare const getLogLevel: () => "error" | "verbose" | "info" | "warn", setLogLevel: (newLogLevel: "error" | "verbose" | "info" | "warn") => void;
|
|
@@ -29,6 +29,7 @@ const react_1 = __importStar(require("react"));
|
|
|
29
29
|
const remotion_1 = require("remotion");
|
|
30
30
|
const event_source_1 = require("../../event-source");
|
|
31
31
|
const colors_1 = require("../helpers/colors");
|
|
32
|
+
const create_folder_tree_1 = require("../helpers/create-folder-tree");
|
|
32
33
|
const z_index_1 = require("../state/z-index");
|
|
33
34
|
const AssetSelectorItem_1 = require("./AssetSelectorItem");
|
|
34
35
|
const styles_1 = require("./Menu/styles");
|
|
@@ -54,9 +55,8 @@ const label = {
|
|
|
54
55
|
fontSize: 14,
|
|
55
56
|
};
|
|
56
57
|
const list = {
|
|
58
|
+
height: '100%',
|
|
57
59
|
overflowY: 'auto',
|
|
58
|
-
paddingTop: 4,
|
|
59
|
-
paddingBottom: 4,
|
|
60
60
|
};
|
|
61
61
|
const AssetSelector = () => {
|
|
62
62
|
const { tabIndex } = (0, z_index_1.useZIndex)();
|
|
@@ -66,6 +66,9 @@ const AssetSelector = () => {
|
|
|
66
66
|
publicFolderExists: window.remotion_publicFolderExists,
|
|
67
67
|
};
|
|
68
68
|
});
|
|
69
|
+
const assetTree = (0, react_1.useMemo)(() => {
|
|
70
|
+
return (0, create_folder_tree_1.buildAssetFolderStructure)(staticFiles);
|
|
71
|
+
}, [staticFiles]);
|
|
69
72
|
(0, react_1.useEffect)(() => {
|
|
70
73
|
const onUpdate = () => {
|
|
71
74
|
setState({
|
|
@@ -78,8 +81,6 @@ const AssetSelector = () => {
|
|
|
78
81
|
unsub();
|
|
79
82
|
};
|
|
80
83
|
}, []);
|
|
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:
|
|
82
|
-
return ((0, jsx_runtime_1.jsx)(AssetSelectorItem_1.AssetSelectorItem, { item: file, tabIndex: tabIndex }, `${file.src}`));
|
|
83
|
-
}) })) }));
|
|
84
|
+
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: (0, jsx_runtime_1.jsx)(AssetSelectorItem_1.FolderTree, { item: assetTree, level: 0, parentFolder: null, name: null, tabIndex: tabIndex }) })) }));
|
|
84
85
|
};
|
|
85
86
|
exports.AssetSelector = AssetSelector;
|
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { StaticFile } from 'remotion';
|
|
3
|
+
import type { AssetFolder, Structure } from '../helpers/create-folder-tree';
|
|
4
|
+
export declare const AssetFolderItem: React.FC<{
|
|
5
|
+
item: AssetFolder;
|
|
6
|
+
tabIndex: number;
|
|
7
|
+
level: number;
|
|
8
|
+
parentFolder: string;
|
|
9
|
+
}>;
|
|
10
|
+
export declare const FolderTree: React.FC<{
|
|
11
|
+
item: Structure;
|
|
12
|
+
name: string | null;
|
|
13
|
+
parentFolder: string | null;
|
|
14
|
+
level: number;
|
|
15
|
+
tabIndex: number;
|
|
16
|
+
}>;
|
|
3
17
|
export declare const AssetSelectorItem: React.FC<{
|
|
4
|
-
item: StaticFile;
|
|
18
|
+
item: StaticFile | AssetFolder;
|
|
5
19
|
tabIndex: number;
|
|
20
|
+
level: number;
|
|
21
|
+
parentFolder: string;
|
|
6
22
|
}>;
|
|
@@ -23,9 +23,10 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.AssetSelectorItem = void 0;
|
|
26
|
+
exports.AssetSelectorItem = exports.FolderTree = exports.AssetFolderItem = void 0;
|
|
27
27
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
28
28
|
const react_1 = __importStar(require("react"));
|
|
29
|
+
const truthy_1 = require("../../truthy");
|
|
29
30
|
const colors_1 = require("../helpers/colors");
|
|
30
31
|
const copy_text_1 = require("../helpers/copy-text");
|
|
31
32
|
const clipboard_1 = require("../icons/clipboard");
|
|
@@ -36,6 +37,11 @@ const layout_1 = require("./layout");
|
|
|
36
37
|
const NotificationCenter_1 = require("./Notifications/NotificationCenter");
|
|
37
38
|
const actions_1 = require("./RenderQueue/actions");
|
|
38
39
|
const ASSET_ITEM_HEIGHT = 32;
|
|
40
|
+
const iconStyle = {
|
|
41
|
+
width: 18,
|
|
42
|
+
height: 18,
|
|
43
|
+
flexShrink: 0,
|
|
44
|
+
};
|
|
39
45
|
const itemStyle = {
|
|
40
46
|
paddingRight: 10,
|
|
41
47
|
paddingTop: 6,
|
|
@@ -62,30 +68,66 @@ const labelStyle = {
|
|
|
62
68
|
overflow: 'hidden',
|
|
63
69
|
textOverflow: 'ellipsis',
|
|
64
70
|
};
|
|
65
|
-
const iconStyle = {
|
|
66
|
-
width: 18,
|
|
67
|
-
height: 18,
|
|
68
|
-
flexShrink: 0,
|
|
69
|
-
};
|
|
70
71
|
const revealIconStyle = {
|
|
71
72
|
height: 12,
|
|
72
73
|
color: 'currentColor',
|
|
73
74
|
};
|
|
74
|
-
const
|
|
75
|
+
const AssetFolderItem = ({ tabIndex, item, level, parentFolder }) => {
|
|
75
76
|
const [hovered, setHovered] = (0, react_1.useState)(false);
|
|
77
|
+
const [expanded, setExpanded] = (0, react_1.useState)(false);
|
|
76
78
|
const onPointerEnter = (0, react_1.useCallback)(() => {
|
|
77
79
|
setHovered(true);
|
|
78
80
|
}, []);
|
|
79
81
|
const onPointerLeave = (0, react_1.useCallback)(() => {
|
|
80
82
|
setHovered(false);
|
|
81
83
|
}, []);
|
|
82
|
-
const
|
|
84
|
+
const folderStyle = (0, react_1.useMemo)(() => {
|
|
83
85
|
return {
|
|
84
86
|
...itemStyle,
|
|
85
|
-
paddingLeft:
|
|
87
|
+
paddingLeft: 4 + level * 8,
|
|
88
|
+
backgroundColor: hovered ? colors_1.CLEAR_HOVER : 'transparent',
|
|
89
|
+
};
|
|
90
|
+
}, [hovered, level]);
|
|
91
|
+
const label = (0, react_1.useMemo)(() => {
|
|
92
|
+
return {
|
|
93
|
+
...labelStyle,
|
|
86
94
|
color: colors_1.LIGHT_TEXT,
|
|
87
95
|
};
|
|
88
96
|
}, []);
|
|
97
|
+
const onClick = (0, react_1.useCallback)(() => {
|
|
98
|
+
setExpanded((e) => !e);
|
|
99
|
+
}, []);
|
|
100
|
+
const Icon = expanded ? folder_1.ExpandedFolderIcon : folder_1.CollapsedFolderIcon;
|
|
101
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { style: folderStyle, onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, tabIndex: tabIndex, title: item.name, onClick: onClick, children: (0, jsx_runtime_1.jsxs)(layout_1.Row, { children: [(0, jsx_runtime_1.jsx)(Icon, { 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 })] }) }), expanded ? ((0, jsx_runtime_1.jsx)(exports.FolderTree, { item: item.items, name: item.name, level: level, parentFolder: parentFolder, tabIndex: tabIndex }, item.name)) : null] }));
|
|
102
|
+
};
|
|
103
|
+
exports.AssetFolderItem = AssetFolderItem;
|
|
104
|
+
const FolderTree = ({ item, level, name, parentFolder, tabIndex }) => {
|
|
105
|
+
const combinedParents = (0, react_1.useMemo)(() => {
|
|
106
|
+
return [parentFolder, name].filter(truthy_1.truthy).join('/');
|
|
107
|
+
}, [name, parentFolder]);
|
|
108
|
+
return ((0, jsx_runtime_1.jsxs)("div", { children: [item.folders.map((folder) => {
|
|
109
|
+
return ((0, jsx_runtime_1.jsx)(exports.AssetFolderItem, { item: folder, tabIndex: tabIndex, level: level + 1, parentFolder: combinedParents }, folder.name));
|
|
110
|
+
}), item.files.map((file) => {
|
|
111
|
+
return ((0, jsx_runtime_1.jsx)(exports.AssetSelectorItem, { item: file, tabIndex: tabIndex, level: level + 1, parentFolder: combinedParents }, file.src));
|
|
112
|
+
})] }));
|
|
113
|
+
};
|
|
114
|
+
exports.FolderTree = FolderTree;
|
|
115
|
+
const AssetSelectorItem = ({ item, tabIndex, level, parentFolder }) => {
|
|
116
|
+
const [hovered, setHovered] = (0, react_1.useState)(false);
|
|
117
|
+
const onPointerEnter = (0, react_1.useCallback)(() => {
|
|
118
|
+
setHovered(true);
|
|
119
|
+
}, []);
|
|
120
|
+
const onPointerLeave = (0, react_1.useCallback)(() => {
|
|
121
|
+
setHovered(false);
|
|
122
|
+
}, []);
|
|
123
|
+
const style = (0, react_1.useMemo)(() => {
|
|
124
|
+
return {
|
|
125
|
+
...itemStyle,
|
|
126
|
+
color: colors_1.LIGHT_TEXT,
|
|
127
|
+
backgroundColor: hovered ? colors_1.CLEAR_HOVER : 'transparent',
|
|
128
|
+
paddingLeft: 12 + level * 8,
|
|
129
|
+
};
|
|
130
|
+
}, [hovered, level]);
|
|
89
131
|
const label = (0, react_1.useMemo)(() => {
|
|
90
132
|
return {
|
|
91
133
|
...labelStyle,
|
|
@@ -93,18 +135,22 @@ const AssetSelectorItem = ({ item, tabIndex }) => {
|
|
|
93
135
|
};
|
|
94
136
|
}, []);
|
|
95
137
|
const renderFileExplorerAction = (0, react_1.useCallback)((color) => {
|
|
96
|
-
return (0, jsx_runtime_1.jsx)(folder_1.
|
|
138
|
+
return (0, jsx_runtime_1.jsx)(folder_1.ExpandedFolderIcon, { style: revealIconStyle, color: color });
|
|
97
139
|
}, []);
|
|
98
140
|
const renderCopyAction = (0, react_1.useCallback)((color) => {
|
|
99
141
|
return (0, jsx_runtime_1.jsx)(clipboard_1.ClipboardIcon, { style: revealIconStyle, color: color });
|
|
100
142
|
}, []);
|
|
101
143
|
const revealInExplorer = react_1.default.useCallback(() => {
|
|
102
144
|
(0, actions_1.openInFileExplorer)({
|
|
103
|
-
directory: window.remotion_publicFolderExists +
|
|
145
|
+
directory: window.remotion_publicFolderExists +
|
|
146
|
+
'/' +
|
|
147
|
+
parentFolder +
|
|
148
|
+
'/' +
|
|
149
|
+
item.name,
|
|
104
150
|
}).catch((err) => {
|
|
105
151
|
(0, NotificationCenter_1.sendErrorNotification)(`Could not open file: ${err.message}`);
|
|
106
152
|
});
|
|
107
|
-
}, [item.name]);
|
|
153
|
+
}, [item.name, parentFolder]);
|
|
108
154
|
const copyToClipboard = (0, react_1.useCallback)(() => {
|
|
109
155
|
(0, copy_text_1.copyText)(`staticFile("${item.name}")`)
|
|
110
156
|
.then(() => {
|
|
@@ -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)" | "#
|
|
16
|
-
export declare const RemotionInput: React.ForwardRefExoticComponent<Pick<Props, "key" |
|
|
15
|
+
}) => "#ff3232" | "hsla(0, 0%, 100%, 0.15)" | "rgba(0, 0, 0, 0.6)" | "rgba(255, 255, 255, 0.05)" | "#f1c40f";
|
|
16
|
+
export declare const RemotionInput: React.ForwardRefExoticComponent<Pick<Props, "key" | "status" | "rightAlign" | keyof React.InputHTMLAttributes<HTMLInputElement>> & 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, "key" | keyof React.InputHTMLAttributes<HTMLInputElement
|
|
7
|
+
export declare const RemInputTypeColor: React.ForwardRefExoticComponent<Pick<Props, "key" | "status" | keyof React.InputHTMLAttributes<HTMLInputElement>> & React.RefAttributes<HTMLInputElement>>;
|
|
8
8
|
export {};
|
|
@@ -44,6 +44,9 @@ const ServerDisconnected = () => {
|
|
|
44
44
|
if (pageIsGoingToReload) {
|
|
45
45
|
return null;
|
|
46
46
|
}
|
|
47
|
+
const base64Favicon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAARiSURBVHgB7d1NThRBFAfw/2tGgru5gXMD8QZ4AmVjAi6kN0TiAm8gnkBcGARNumcx4E48Ae0JaE9gewLHlQSZelaNgyHGL/RVd1X3+y10RQL58+rVx1QBKKWUUkoppZRSSimllFJKKVUjQs32stEiJcktZiwxzKL9Fvqzb6S0/44JVBKbtwa9aj29U6JjagtkJzsYzBEyBi9d5utsQIULCcxvelgo03R5jBarJZCXw/17E+bt82r4Hy4gtuEQekUbK8h7IHvDV5vMZht+VAlRfmYw3EhXKrSA10Ce2X7RIzpGDVzlgM1wPb2bI2JeA9nN99/b/waoV+XCmTAex1g13gLZyUZrdjjJ0CAbTB5bMN4C2ctHxwxaRABiCsZLIG6KmxC/R2BiCCaBBwn4NgJk10B2GOWj3Wz/IQLlpUL28oOjyy4AG1AZppuhVYt4hWRZ1o8gDGc6rL4YHjxCQMQDOcNCEI38bxnmLTc9d30PARAPZAITZP/4A1ctx3bjcw0NEw8koeQ64tRnu25qeggTb+q2/BmRcyv9K7yw3MTOsmiFuLMOtICblJzS5+Mm+opoIBOgFYHMuL5yVHcoooFQuwJxag9FNJCIG/rv1BqKaCDfzshbqbZQxAJxK3SJI9qATUPJstdef0axQGJbof+jwRc6eQ2PxAIx4DZXx3duSrybv3oCTyR7yACdYR762sIXDKQbFfId4ZGPJi8YCA3QLf05YvF+IhYIEV1Dx9hNu8XdbLQFQV6OcDuFaFNyKiwWiJ19DNBN/VN8XoMQrRABDFqCEJ32CiBisT08rRAZAwjRQAKjgcgQO+rVQARMb3gJ0UAkML+DEA1EwAQkdkNMcnOx1Zcxf8V9ol7y88GSm4tdDKRy1xsgSIes/0BM4ndN5HZ7OzZkMePperqSQ5jkkFWhO6r76WrYJ4b2N+YTumF60QeeSG6/d2DI4rHvW1eCPaT9Q9YZw/sVOMlZVoUWM8zpg/Su97dVJGdZFVrKhbFR05MdYoFcwWmF1rF9kbG8UeP7KaI3qBp628QTHrueUccwdZHw/ZDWNHY7tU1u1B2GIxqIYSO2Dd0Ud79wnq/eaOpBgR4EMVDW/oijINu87d7U6hYaJBrInA0k0iu4bvVtZ1KrBRrm4Vr06GNkF3cO7RCVhvK4pmiFOISkjOStk1lVrBQIiPh5SAyN3fWKWeMuEBjxCmEkh3bVvokAzd5idL2iQqDEA1nASXmK+XFIfeTCo5gFAudllvo8G20TUeNVElMQ58QrxLHD1jbB3GumSnhsz7qHE9BhTEGc87aOm16KJHi7rfqj8yfI53E1j/l9eK8L651stJUQeXx/iuzU1QztZLGIsRp+xvtOh3Qo3/qCedumEC6qZetpJztwz7O6UAa4FNsP7ELTfXbWbskUdjgq9M9VCJoFcwvTlfyPDd9t3XNJjA+2IZcGpmxi+7tpjW3OupurJziZhtKWPzWhlFJKKaWUUkoppZRSSiml/uwrgZ/Bfwo/wccAAAAASUVORK5CYII=';
|
|
48
|
+
const fav = document.getElementById('__remotion_favicon');
|
|
49
|
+
fav.setAttribute('href', base64Favicon);
|
|
47
50
|
return ((0, jsx_runtime_1.jsx)("div", { style: container, className: "css-reset", children: (0, jsx_runtime_1.jsxs)("div", { style: message, children: ["The studio server has disconnected. ", (0, jsx_runtime_1.jsx)("br", {}), window.remotion_studioServerCommand ? ((0, jsx_runtime_1.jsxs)("span", { children: ["Run", ' ', (0, jsx_runtime_1.jsx)("code", { style: inlineCode, children: window.remotion_studioServerCommand }), ' ', "to run it again."] })) : ((0, jsx_runtime_1.jsx)("span", { children: "Fast refresh will not work." }))] }) }));
|
|
48
51
|
};
|
|
49
52
|
exports.ServerDisconnected = ServerDisconnected;
|
|
@@ -16,4 +16,4 @@ export declare const BLUE_DISABLED = "#284f73";
|
|
|
16
16
|
export declare const getBackgroundFromHoverState: ({ selected, hovered, }: {
|
|
17
17
|
selected: boolean;
|
|
18
18
|
hovered: boolean;
|
|
19
|
-
}) => "transparent" | "
|
|
19
|
+
}) => "transparent" | "rgba(255, 255, 255, 0.06)" | "hsla(0, 0%, 100%, 0.15)" | "hsla(0, 0%, 100%, 0.25)";
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
-
import type { AnyComposition, TFolder } from 'remotion';
|
|
1
|
+
import type { AnyComposition, StaticFile, TFolder } from 'remotion';
|
|
2
2
|
import type { CompositionSelectorItemType } from '../components/CompositionSelectorItem';
|
|
3
|
+
export type AssetFolder = {
|
|
4
|
+
name: string;
|
|
5
|
+
items: Structure;
|
|
6
|
+
};
|
|
7
|
+
export type Structure = {
|
|
8
|
+
files: StaticFile[];
|
|
9
|
+
folders: AssetFolder[];
|
|
10
|
+
};
|
|
11
|
+
export declare const buildAssetFolderStructure: (files: StaticFile[]) => Structure;
|
|
3
12
|
export declare const splitParentIntoNameAndParent: (name: string | null) => {
|
|
4
13
|
name: string | null;
|
|
5
14
|
parent: string | null;
|
|
@@ -1,7 +1,37 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createFolderTree = exports.splitParentIntoNameAndParent = void 0;
|
|
3
|
+
exports.createFolderTree = exports.splitParentIntoNameAndParent = exports.buildAssetFolderStructure = void 0;
|
|
4
4
|
const persist_open_folders_1 = require("./persist-open-folders");
|
|
5
|
+
const buildAssetFolderStructure = (files) => {
|
|
6
|
+
const notInFolder = files.filter((f) => !f.name.includes('/'));
|
|
7
|
+
const inFolder = files.filter((f) => f.name.includes('/'));
|
|
8
|
+
const groupedByFolder = {};
|
|
9
|
+
for (const item of inFolder) {
|
|
10
|
+
const folderName = item.name.split('/')[0];
|
|
11
|
+
if (!groupedByFolder[folderName]) {
|
|
12
|
+
groupedByFolder[folderName] = [];
|
|
13
|
+
}
|
|
14
|
+
groupedByFolder[folderName].push(item);
|
|
15
|
+
}
|
|
16
|
+
return {
|
|
17
|
+
files: notInFolder,
|
|
18
|
+
folders: Object.keys(groupedByFolder).map((folderName) => {
|
|
19
|
+
const filesInFolder = groupedByFolder[folderName];
|
|
20
|
+
const filesWithoutFolderName = filesInFolder.map((f) => {
|
|
21
|
+
return {
|
|
22
|
+
...f,
|
|
23
|
+
name: f.name.substring(folderName.length + 1),
|
|
24
|
+
};
|
|
25
|
+
});
|
|
26
|
+
return {
|
|
27
|
+
name: folderName,
|
|
28
|
+
items: (0, exports.buildAssetFolderStructure)(filesWithoutFolderName),
|
|
29
|
+
expanded: false,
|
|
30
|
+
};
|
|
31
|
+
}),
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
exports.buildAssetFolderStructure = buildAssetFolderStructure;
|
|
5
35
|
const splitParentIntoNameAndParent = (name) => {
|
|
6
36
|
if (name === null) {
|
|
7
37
|
return {
|
|
@@ -20,7 +20,7 @@ export declare const getCliOptions: (options: {
|
|
|
20
20
|
numberOfGifLoops: import("./config/number-of-gif-loops").Loop;
|
|
21
21
|
stillFrame: number;
|
|
22
22
|
browserExecutable: BrowserExecutable;
|
|
23
|
-
logLevel: "
|
|
23
|
+
logLevel: "error" | "verbose" | "info" | "warn";
|
|
24
24
|
scale: number;
|
|
25
25
|
chromiumOptions: ChromiumOptions;
|
|
26
26
|
overwrite: boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -63,24 +63,24 @@ export declare const CliInternals: {
|
|
|
63
63
|
verbose: (message?: any, ...optionalParams: any[]) => void;
|
|
64
64
|
verboseAdvanced: (options: {
|
|
65
65
|
indent: boolean;
|
|
66
|
-
logLevel: "
|
|
66
|
+
logLevel: "error" | "verbose" | "info" | "warn";
|
|
67
67
|
} & {
|
|
68
68
|
tag?: string | undefined;
|
|
69
69
|
}, message?: any, ...optionalParams: any[]) => void;
|
|
70
70
|
info: (message?: any, ...optionalParams: any[]) => void;
|
|
71
71
|
infoAdvanced: (options: {
|
|
72
72
|
indent: boolean;
|
|
73
|
-
logLevel: "
|
|
73
|
+
logLevel: "error" | "verbose" | "info" | "warn";
|
|
74
74
|
}, message?: any, ...optionalParams: any[]) => void;
|
|
75
75
|
warn: (message?: any, ...optionalParams: any[]) => void;
|
|
76
76
|
warnAdvanced: (options: {
|
|
77
77
|
indent: boolean;
|
|
78
|
-
logLevel: "
|
|
78
|
+
logLevel: "error" | "verbose" | "info" | "warn";
|
|
79
79
|
}, message?: any, ...optionalParams: any[]) => void;
|
|
80
80
|
error: (message?: any, ...optionalParams: any[]) => void;
|
|
81
81
|
errorAdvanced: (options: {
|
|
82
82
|
indent: boolean;
|
|
83
|
-
logLevel: "
|
|
83
|
+
logLevel: "error" | "verbose" | "info" | "warn";
|
|
84
84
|
} & {
|
|
85
85
|
tag?: string | undefined;
|
|
86
86
|
}, message?: any, ...optionalParams: any[]) => void;
|
|
@@ -105,7 +105,7 @@ export declare const CliInternals: {
|
|
|
105
105
|
numberOfGifLoops: import("./config/number-of-gif-loops").Loop;
|
|
106
106
|
stillFrame: number;
|
|
107
107
|
browserExecutable: import("@remotion/renderer").BrowserExecutable;
|
|
108
|
-
logLevel: "
|
|
108
|
+
logLevel: "error" | "verbose" | "info" | "warn";
|
|
109
109
|
scale: number;
|
|
110
110
|
chromiumOptions: import("@remotion/renderer").ChromiumOptions;
|
|
111
111
|
overwrite: boolean;
|
|
@@ -180,7 +180,7 @@ export declare const CliInternals: {
|
|
|
180
180
|
} & {
|
|
181
181
|
_: string[];
|
|
182
182
|
};
|
|
183
|
-
handleCommonError: (err: Error, logLevel: "
|
|
183
|
+
handleCommonError: (err: Error, logLevel: "error" | "verbose" | "info" | "warn") => Promise<void>;
|
|
184
184
|
formatBytes: (number: number, options?: Intl.NumberFormatOptions & {
|
|
185
185
|
locale: string;
|
|
186
186
|
bits?: boolean | undefined;
|
|
@@ -222,7 +222,7 @@ export declare const CliInternals: {
|
|
|
222
222
|
};
|
|
223
223
|
listOfRemotionPackages: string[];
|
|
224
224
|
shouldUseNonOverlayingLogger: ({ logLevel, }: {
|
|
225
|
-
logLevel: "
|
|
225
|
+
logLevel: "error" | "verbose" | "info" | "warn";
|
|
226
226
|
}) => boolean;
|
|
227
227
|
getCompositionWithDimensionOverride: ({ height, width, args, compositionIdFromUi, chromiumOptions, envVariables, port, puppeteerInstance, timeoutInMilliseconds, browserExecutable, serveUrlOrWebpackUrl, indent, serializedInputPropsWithCustomSchema, logLevel, server, }: {
|
|
228
228
|
height: number | null;
|
|
@@ -237,7 +237,7 @@ export declare const CliInternals: {
|
|
|
237
237
|
browserExecutable: import("@remotion/renderer").BrowserExecutable;
|
|
238
238
|
serveUrlOrWebpackUrl: string;
|
|
239
239
|
indent: boolean;
|
|
240
|
-
logLevel: "
|
|
240
|
+
logLevel: "error" | "verbose" | "info" | "warn";
|
|
241
241
|
serializedInputPropsWithCustomSchema: string;
|
|
242
242
|
server: import("@remotion/renderer").RemotionServer;
|
|
243
243
|
}) => Promise<{
|
package/dist/log.d.ts
CHANGED
|
@@ -2,24 +2,24 @@ export declare const Log: {
|
|
|
2
2
|
verbose: (message?: any, ...optionalParams: any[]) => void;
|
|
3
3
|
verboseAdvanced: (options: {
|
|
4
4
|
indent: boolean;
|
|
5
|
-
logLevel: "
|
|
5
|
+
logLevel: "error" | "verbose" | "info" | "warn";
|
|
6
6
|
} & {
|
|
7
7
|
tag?: string | undefined;
|
|
8
8
|
}, message?: any, ...optionalParams: any[]) => void;
|
|
9
9
|
info: (message?: any, ...optionalParams: any[]) => void;
|
|
10
10
|
infoAdvanced: (options: {
|
|
11
11
|
indent: boolean;
|
|
12
|
-
logLevel: "
|
|
12
|
+
logLevel: "error" | "verbose" | "info" | "warn";
|
|
13
13
|
}, message?: any, ...optionalParams: any[]) => void;
|
|
14
14
|
warn: (message?: any, ...optionalParams: any[]) => void;
|
|
15
15
|
warnAdvanced: (options: {
|
|
16
16
|
indent: boolean;
|
|
17
|
-
logLevel: "
|
|
17
|
+
logLevel: "error" | "verbose" | "info" | "warn";
|
|
18
18
|
}, message?: any, ...optionalParams: any[]) => void;
|
|
19
19
|
error: (message?: any, ...optionalParams: any[]) => void;
|
|
20
20
|
errorAdvanced: (options: {
|
|
21
21
|
indent: boolean;
|
|
22
|
-
logLevel: "
|
|
22
|
+
logLevel: "error" | "verbose" | "info" | "warn";
|
|
23
23
|
} & {
|
|
24
24
|
tag?: string | undefined;
|
|
25
25
|
}, message?: any, ...optionalParams: any[]) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/cli",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.20",
|
|
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/
|
|
39
|
-
"
|
|
40
|
-
"@remotion/
|
|
41
|
-
"remotion": "4.0.
|
|
42
|
-
"@remotion/
|
|
38
|
+
"@remotion/bundler": "4.0.20",
|
|
39
|
+
"remotion": "4.0.20",
|
|
40
|
+
"@remotion/player": "4.0.20",
|
|
41
|
+
"@remotion/renderer": "4.0.20",
|
|
42
|
+
"@remotion/media-utils": "4.0.20"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"react": ">=16.8.0",
|
|
@@ -64,8 +64,8 @@
|
|
|
64
64
|
"react-dom": "^18.0.0",
|
|
65
65
|
"vitest": "0.31.1",
|
|
66
66
|
"zod": "^3.21.4",
|
|
67
|
-
"@remotion/tailwind": "4.0.
|
|
68
|
-
"@remotion/zod-types": "4.0.
|
|
67
|
+
"@remotion/tailwind": "4.0.20",
|
|
68
|
+
"@remotion/zod-types": "4.0.20"
|
|
69
69
|
},
|
|
70
70
|
"keywords": [
|
|
71
71
|
"remotion",
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export type SerializedJSONWithCustomFields = {
|
|
2
|
-
serializedString: string;
|
|
3
|
-
customDateUsed: boolean;
|
|
4
|
-
customFileUsed: boolean;
|
|
5
|
-
mapUsed: boolean;
|
|
6
|
-
setUsed: boolean;
|
|
7
|
-
};
|
|
8
|
-
export declare const FILE_TOKEN = "remotion-file:";
|
|
9
|
-
export declare const serializeJSONWithDate: ({ data, indent, staticBase, }: {
|
|
10
|
-
data: unknown;
|
|
11
|
-
indent: number | undefined;
|
|
12
|
-
staticBase: string;
|
|
13
|
-
}) => SerializedJSONWithCustomFields;
|
|
14
|
-
export declare const deserializeJSONWithCustomFields: (data: string) => any;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.deserializeJSONWithCustomFields = exports.serializeJSONWithDate = exports.FILE_TOKEN = void 0;
|
|
4
|
-
const DATE_TOKEN = 'remotion-date:';
|
|
5
|
-
exports.FILE_TOKEN = 'remotion-file:';
|
|
6
|
-
const serializeJSONWithDate = ({ data, indent, staticBase, }) => {
|
|
7
|
-
let customDateUsed = false;
|
|
8
|
-
let customFileUsed = false;
|
|
9
|
-
let mapUsed = false;
|
|
10
|
-
let setUsed = false;
|
|
11
|
-
const serializedString = JSON.stringify(data, function (key, value) {
|
|
12
|
-
const item = this[key];
|
|
13
|
-
if (item instanceof Date) {
|
|
14
|
-
customDateUsed = true;
|
|
15
|
-
return `${DATE_TOKEN}${item.toISOString()}`;
|
|
16
|
-
}
|
|
17
|
-
if (item instanceof Map) {
|
|
18
|
-
mapUsed = true;
|
|
19
|
-
return value;
|
|
20
|
-
}
|
|
21
|
-
if (item instanceof Set) {
|
|
22
|
-
setUsed = true;
|
|
23
|
-
return value;
|
|
24
|
-
}
|
|
25
|
-
if (typeof item === 'string' && item.startsWith(staticBase)) {
|
|
26
|
-
customFileUsed = true;
|
|
27
|
-
return `${exports.FILE_TOKEN}${item.replace(staticBase + '/', '')}`;
|
|
28
|
-
}
|
|
29
|
-
return value;
|
|
30
|
-
}, indent);
|
|
31
|
-
return { serializedString, customDateUsed, customFileUsed, mapUsed, setUsed };
|
|
32
|
-
};
|
|
33
|
-
exports.serializeJSONWithDate = serializeJSONWithDate;
|
|
34
|
-
const deserializeJSONWithCustomFields = (data) => {
|
|
35
|
-
return JSON.parse(data, (_, value) => {
|
|
36
|
-
if (typeof value === 'string' && value.startsWith(DATE_TOKEN)) {
|
|
37
|
-
return new Date(value.replace(DATE_TOKEN, ''));
|
|
38
|
-
}
|
|
39
|
-
return value;
|
|
40
|
-
});
|
|
41
|
-
};
|
|
42
|
-
exports.deserializeJSONWithCustomFields = deserializeJSONWithCustomFields;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
type SidebarPanel = 'input-props' | 'renders';
|
|
3
|
-
export declare const persistSelectedPanel: (panel: SidebarPanel) => void;
|
|
4
|
-
export declare const rightSidebarTabs: React.RefObject<{
|
|
5
|
-
selectRendersPanel: () => void;
|
|
6
|
-
}>;
|
|
7
|
-
export declare const RightPanel: React.FC<{}>;
|
|
8
|
-
export {};
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RightPanel = exports.rightSidebarTabs = exports.persistSelectedPanel = 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 DataEditor_1 = require("./RenderModal/DataEditor");
|
|
9
|
-
const RenderQueue_1 = require("./RenderQueue");
|
|
10
|
-
const RendersTab_1 = require("./RendersTab");
|
|
11
|
-
const Tabs_1 = require("./Tabs");
|
|
12
|
-
const container = {
|
|
13
|
-
height: '100%',
|
|
14
|
-
width: '100%',
|
|
15
|
-
position: 'absolute',
|
|
16
|
-
display: 'flex',
|
|
17
|
-
flexDirection: 'column',
|
|
18
|
-
};
|
|
19
|
-
const PropsEditor = ({ composition }) => {
|
|
20
|
-
const { props, updateProps } = (0, react_1.useContext)(remotion_1.Internals.EditorPropsContext);
|
|
21
|
-
const setInputProps = (0, react_1.useCallback)((newProps) => {
|
|
22
|
-
updateProps({
|
|
23
|
-
id: composition.id,
|
|
24
|
-
defaultProps: composition.defaultProps,
|
|
25
|
-
newProps,
|
|
26
|
-
});
|
|
27
|
-
}, [composition.defaultProps, composition.id, updateProps]);
|
|
28
|
-
const actualProps = (0, react_1.useMemo)(() => { var _a, _b; return (_b = (_a = props[composition.id]) !== null && _a !== void 0 ? _a : composition.defaultProps) !== null && _b !== void 0 ? _b : {}; }, [composition.defaultProps, composition.id, props]);
|
|
29
|
-
return ((0, jsx_runtime_1.jsx)(DataEditor_1.DataEditor, { unresolvedComposition: composition, inputProps: actualProps, setInputProps: setInputProps, mayShowSaveButton: true, propsEditType: "default-props" }, composition.id));
|
|
30
|
-
};
|
|
31
|
-
const localStorageKey = 'remotion.sidebarPanel';
|
|
32
|
-
const getSelectedPanel = () => {
|
|
33
|
-
const panel = localStorage.getItem(localStorageKey);
|
|
34
|
-
if (panel === 'renders') {
|
|
35
|
-
return 'renders';
|
|
36
|
-
}
|
|
37
|
-
return 'input-props';
|
|
38
|
-
};
|
|
39
|
-
const tabsContainer = {
|
|
40
|
-
backgroundColor: colors_1.BACKGROUND,
|
|
41
|
-
};
|
|
42
|
-
const persistSelectedPanel = (panel) => {
|
|
43
|
-
localStorage.setItem(localStorageKey, panel);
|
|
44
|
-
};
|
|
45
|
-
exports.persistSelectedPanel = persistSelectedPanel;
|
|
46
|
-
exports.rightSidebarTabs = (0, react_1.createRef)();
|
|
47
|
-
const RightPanel = () => {
|
|
48
|
-
const [panel, setPanel] = (0, react_1.useState)(() => getSelectedPanel());
|
|
49
|
-
const onCompositionsSelected = (0, react_1.useCallback)(() => {
|
|
50
|
-
setPanel('input-props');
|
|
51
|
-
(0, exports.persistSelectedPanel)('input-props');
|
|
52
|
-
}, []);
|
|
53
|
-
const onRendersSelected = (0, react_1.useCallback)(() => {
|
|
54
|
-
setPanel('renders');
|
|
55
|
-
(0, exports.persistSelectedPanel)('renders');
|
|
56
|
-
}, []);
|
|
57
|
-
(0, react_1.useImperativeHandle)(exports.rightSidebarTabs, () => {
|
|
58
|
-
return {
|
|
59
|
-
selectRendersPanel: () => {
|
|
60
|
-
setPanel('renders');
|
|
61
|
-
(0, exports.persistSelectedPanel)('renders');
|
|
62
|
-
},
|
|
63
|
-
};
|
|
64
|
-
}, []);
|
|
65
|
-
const { compositions, currentComposition } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
66
|
-
const composition = (0, react_1.useMemo)(() => {
|
|
67
|
-
for (const comp of compositions) {
|
|
68
|
-
if (comp.id === currentComposition) {
|
|
69
|
-
return comp;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
return null;
|
|
73
|
-
}, [compositions, currentComposition]);
|
|
74
|
-
if (composition === null) {
|
|
75
|
-
return null;
|
|
76
|
-
}
|
|
77
|
-
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 === 'input-props', onClick: onCompositionsSelected, children: "Props" }), (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)(PropsEditor, { composition: composition }))] }));
|
|
78
|
-
};
|
|
79
|
-
exports.RightPanel = RightPanel;
|