@remotion/cli 4.0.18 → 4.0.19
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/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/RightPanel.js +45 -12
- package/dist/editor/helpers/create-folder-tree.d.ts +10 -1
- package/dist/editor/helpers/create-folder-tree.js +31 -1
- 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
|
@@ -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(() => {
|
|
@@ -4,8 +4,10 @@ exports.RightPanel = exports.rightSidebarTabs = exports.persistSelectedPanel = v
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const remotion_1 = require("remotion");
|
|
7
|
+
const ShortcutHint_1 = require("../../preview-server/error-overlay/remotion-overlay/ShortcutHint");
|
|
7
8
|
const colors_1 = require("../helpers/colors");
|
|
8
9
|
const DataEditor_1 = require("./RenderModal/DataEditor");
|
|
10
|
+
const deep_equal_1 = require("./RenderModal/SchemaEditor/deep-equal");
|
|
9
11
|
const RenderQueue_1 = require("./RenderQueue");
|
|
10
12
|
const RendersTab_1 = require("./RendersTab");
|
|
11
13
|
const Tabs_1 = require("./Tabs");
|
|
@@ -16,17 +18,10 @@ const container = {
|
|
|
16
18
|
display: 'flex',
|
|
17
19
|
flexDirection: 'column',
|
|
18
20
|
};
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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));
|
|
21
|
+
const circle = {
|
|
22
|
+
width: 8,
|
|
23
|
+
height: 8,
|
|
24
|
+
borderRadius: 4,
|
|
30
25
|
};
|
|
31
26
|
const localStorageKey = 'remotion.sidebarPanel';
|
|
32
27
|
const getSelectedPanel = () => {
|
|
@@ -45,6 +40,8 @@ const persistSelectedPanel = (panel) => {
|
|
|
45
40
|
exports.persistSelectedPanel = persistSelectedPanel;
|
|
46
41
|
exports.rightSidebarTabs = (0, react_1.createRef)();
|
|
47
42
|
const RightPanel = () => {
|
|
43
|
+
const { props, updateProps } = (0, react_1.useContext)(remotion_1.Internals.EditorPropsContext);
|
|
44
|
+
const [saving, setSaving] = (0, react_1.useState)(false);
|
|
48
45
|
const [panel, setPanel] = (0, react_1.useState)(() => getSelectedPanel());
|
|
49
46
|
const onCompositionsSelected = (0, react_1.useCallback)(() => {
|
|
50
47
|
setPanel('input-props');
|
|
@@ -63,6 +60,14 @@ const RightPanel = () => {
|
|
|
63
60
|
};
|
|
64
61
|
}, []);
|
|
65
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]);
|
|
66
71
|
const composition = (0, react_1.useMemo)(() => {
|
|
67
72
|
for (const comp of compositions) {
|
|
68
73
|
if (comp.id === currentComposition) {
|
|
@@ -71,9 +76,37 @@ const RightPanel = () => {
|
|
|
71
76
|
}
|
|
72
77
|
return null;
|
|
73
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]);
|
|
74
107
|
if (composition === null) {
|
|
75
108
|
return null;
|
|
76
109
|
}
|
|
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.
|
|
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: onCompositionsSelected, 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))] }));
|
|
78
111
|
};
|
|
79
112
|
exports.RightPanel = RightPanel;
|
|
@@ -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 {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/cli",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.19",
|
|
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
|
-
"@remotion/
|
|
40
|
-
"@remotion/
|
|
41
|
-
"remotion": "4.0.
|
|
42
|
-
"
|
|
38
|
+
"@remotion/bundler": "4.0.19",
|
|
39
|
+
"@remotion/media-utils": "4.0.19",
|
|
40
|
+
"@remotion/player": "4.0.19",
|
|
41
|
+
"@remotion/renderer": "4.0.19",
|
|
42
|
+
"remotion": "4.0.19"
|
|
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/
|
|
68
|
-
"@remotion/
|
|
67
|
+
"@remotion/zod-types": "4.0.19",
|
|
68
|
+
"@remotion/tailwind": "4.0.19"
|
|
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;
|