@remotion/cli 4.0.43 → 4.0.45
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/index.d.ts +1 -1
- package/dist/config/log.d.ts +1 -1
- package/dist/editor/components/AssetSelector.js +19 -3
- package/dist/editor/components/AssetSelectorItem.d.ts +6 -4
- package/dist/editor/components/AssetSelectorItem.js +48 -23
- package/dist/editor/components/Canvas.d.ts +4 -1
- package/dist/editor/components/Canvas.js +54 -30
- package/dist/editor/components/CanvasOrLoading.js +9 -1
- package/dist/editor/components/CompositionSelector.js +8 -6
- package/dist/editor/components/CompositionSelectorItem.d.ts +1 -1
- package/dist/editor/components/CompositionSelectorItem.js +1 -7
- package/dist/editor/components/CurrentCompositionSideEffects.js +15 -4
- package/dist/editor/components/DownloadButton.d.ts +0 -0
- package/dist/editor/components/DownloadButton.js +1 -0
- package/dist/editor/components/EditorContent.js +6 -1
- package/dist/editor/components/ExplorerPanel.js +0 -13
- package/dist/editor/components/FilePreview.d.ts +9 -0
- package/dist/editor/components/FilePreview.js +40 -0
- package/dist/editor/components/FramePersistor.d.ts +0 -1
- package/dist/editor/components/FramePersistor.js +1 -5
- package/dist/editor/components/InitialCompositionLoader.js +68 -18
- package/dist/editor/components/LoopToggle.js +0 -5
- package/dist/editor/components/MuteToggle.js +0 -5
- package/dist/editor/components/NewComposition/RemInput.d.ts +2 -2
- package/dist/editor/components/NewComposition/RemInputTypeColor.d.ts +1 -1
- package/dist/editor/components/NewComposition/RemTextarea.d.ts +1 -1
- package/dist/editor/components/OptionsPanel.js +7 -7
- package/dist/editor/components/PlayPause.js +0 -3
- package/dist/editor/components/PlaybackRateSelector.js +3 -1
- package/dist/editor/components/Preview.d.ts +8 -0
- package/dist/editor/components/Preview.js +97 -30
- package/dist/editor/components/PreviewToolbar.js +4 -1
- package/dist/editor/components/RenderPreview.d.ts +6 -0
- package/dist/editor/components/RenderPreview.js +31 -0
- package/dist/editor/components/RenderQueue/RenderQueueCopyToClipboard.js +3 -2
- package/dist/editor/components/RenderQueue/RenderQueueItem.d.ts +1 -0
- package/dist/editor/components/RenderQueue/RenderQueueItem.js +55 -2
- package/dist/editor/components/RenderQueue/RenderQueueItemCancelButton.js +2 -1
- package/dist/editor/components/RenderQueue/RenderQueueItemStatus.js +35 -4
- package/dist/editor/components/RenderQueue/RenderQueueOpenInFolder.js +3 -2
- package/dist/editor/components/RenderQueue/RenderQueueOutputName.js +3 -11
- package/dist/editor/components/RenderQueue/RenderQueueRemoveItem.js +2 -1
- package/dist/editor/components/RenderQueue/RenderQueueRepeat.js +2 -1
- package/dist/editor/components/RenderQueue/index.js +16 -1
- package/dist/editor/components/RendersTab.js +9 -1
- package/dist/editor/components/SizeSelector.js +24 -0
- package/dist/editor/components/StaticFilePreview.d.ts +6 -0
- package/dist/editor/components/StaticFilePreview.js +39 -0
- package/dist/editor/components/TextViewer.d.ts +4 -0
- package/dist/editor/components/TextViewer.js +26 -0
- package/dist/editor/components/Timeline/TimelineZoomControls.js +3 -1
- package/dist/editor/components/TimelineInOutToggle.js +0 -5
- package/dist/editor/components/ZoomPersistor.d.ts +2 -0
- package/dist/editor/components/ZoomPersistor.js +35 -7
- package/dist/editor/components/layout.d.ts +2 -1
- package/dist/editor/components/layout.js +2 -2
- package/dist/editor/helpers/checkerboard-background.d.ts +1 -1
- package/dist/editor/helpers/colors.d.ts +1 -1
- package/dist/editor/helpers/create-folder-tree.d.ts +4 -3
- package/dist/editor/helpers/create-folder-tree.js +6 -3
- package/dist/editor/helpers/document-title.d.ts +1 -1
- package/dist/editor/helpers/document-title.js +14 -8
- package/dist/editor/helpers/get-asset-metadata.d.ts +11 -0
- package/dist/editor/helpers/get-asset-metadata.js +64 -0
- package/dist/editor/helpers/is-current-selected-still.d.ts +4 -3
- package/dist/editor/helpers/is-current-selected-still.js +12 -13
- package/dist/editor/helpers/persist-open-folders.d.ts +4 -2
- package/dist/editor/helpers/persist-open-folders.js +7 -5
- package/dist/editor/state/folders.d.ts +4 -2
- package/dist/editor/state/folders.js +13 -6
- package/dist/get-cli-options.d.ts +2 -2
- package/dist/index.d.ts +10 -10
- package/dist/log.d.ts +4 -4
- package/dist/preview-server/routes.d.ts +5 -3
- package/dist/preview-server/routes.js +52 -8
- package/dist/preview-server/serve-static.d.ts +6 -1
- package/dist/preview-server/serve-static.js +1 -4
- package/dist/preview-server/start-server.d.ts +4 -2
- package/dist/preview-server/start-server.js +4 -2
- package/dist/studio.js +9 -4
- package/package.json +8 -8
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createFolderTree = exports.splitParentIntoNameAndParent = exports.buildAssetFolderStructure = void 0;
|
|
4
4
|
const persist_open_folders_1 = require("./persist-open-folders");
|
|
5
|
-
const buildAssetFolderStructure = (files) => {
|
|
5
|
+
const buildAssetFolderStructure = (files, parentFolderName, foldersExpanded) => {
|
|
6
6
|
const notInFolder = files.filter((f) => !f.name.includes('/'));
|
|
7
7
|
const inFolder = files.filter((f) => f.name.includes('/'));
|
|
8
8
|
const groupedByFolder = {};
|
|
@@ -16,6 +16,7 @@ const buildAssetFolderStructure = (files) => {
|
|
|
16
16
|
return {
|
|
17
17
|
files: notInFolder,
|
|
18
18
|
folders: Object.keys(groupedByFolder).map((folderName) => {
|
|
19
|
+
var _a;
|
|
19
20
|
const filesInFolder = groupedByFolder[folderName];
|
|
20
21
|
const filesWithoutFolderName = filesInFolder.map((f) => {
|
|
21
22
|
return {
|
|
@@ -23,10 +24,12 @@ const buildAssetFolderStructure = (files) => {
|
|
|
23
24
|
name: f.name.substring(folderName.length + 1),
|
|
24
25
|
};
|
|
25
26
|
});
|
|
27
|
+
const key = [parentFolderName, folderName].filter(Boolean).join('/');
|
|
28
|
+
const isExpanded = (_a = foldersExpanded[key]) !== null && _a !== void 0 ? _a : false;
|
|
26
29
|
return {
|
|
27
30
|
name: folderName,
|
|
28
|
-
items: (0, exports.buildAssetFolderStructure)(filesWithoutFolderName),
|
|
29
|
-
expanded:
|
|
31
|
+
items: (0, exports.buildAssetFolderStructure)(filesWithoutFolderName, [parentFolderName, folderName].filter(Boolean).join('/'), foldersExpanded),
|
|
32
|
+
expanded: isExpanded,
|
|
30
33
|
};
|
|
31
34
|
}),
|
|
32
35
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { RenderJob } from '../../preview-server/render-queue/job';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const setCurrentCanvasContentId: (id: string | null) => void;
|
|
3
3
|
export declare const setUnsavedProps: (unsaved: boolean) => void;
|
|
4
4
|
export declare const setRenderJobs: (jobs: RenderJob[]) => void;
|
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setRenderJobs = exports.setUnsavedProps = exports.
|
|
3
|
+
exports.setRenderJobs = exports.setUnsavedProps = exports.setCurrentCanvasContentId = void 0;
|
|
4
4
|
const truthy_1 = require("../../truthy");
|
|
5
|
-
let
|
|
5
|
+
let currentItemName = null;
|
|
6
6
|
let unsavedProps = false;
|
|
7
7
|
let tabInactive = false;
|
|
8
8
|
let renderJobs = [];
|
|
9
|
-
const
|
|
10
|
-
|
|
9
|
+
const setCurrentCanvasContentId = (id) => {
|
|
10
|
+
if (!id) {
|
|
11
|
+
currentItemName = id;
|
|
12
|
+
updateTitle();
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
const idWithoutFolder = id.split('/').pop();
|
|
16
|
+
currentItemName = idWithoutFolder;
|
|
11
17
|
updateTitle();
|
|
12
18
|
};
|
|
13
|
-
exports.
|
|
19
|
+
exports.setCurrentCanvasContentId = setCurrentCanvasContentId;
|
|
14
20
|
const setUnsavedProps = (unsaved) => {
|
|
15
21
|
window.remotion_unsavedProps = unsaved;
|
|
16
22
|
unsavedProps = unsaved;
|
|
@@ -28,13 +34,13 @@ document.addEventListener('visibilitychange', () => {
|
|
|
28
34
|
const productName = 'Remotion Studio';
|
|
29
35
|
const suffix = `- ${productName}`;
|
|
30
36
|
const updateTitle = () => {
|
|
31
|
-
if (!
|
|
37
|
+
if (!currentItemName) {
|
|
32
38
|
document.title = productName;
|
|
33
39
|
return;
|
|
34
40
|
}
|
|
35
|
-
const currentCompTitle = `${
|
|
41
|
+
const currentCompTitle = `${currentItemName} / ${window.remotion_projectName}`;
|
|
36
42
|
document.title = [
|
|
37
|
-
getProgressInBrackets(
|
|
43
|
+
getProgressInBrackets(currentItemName, renderJobs),
|
|
38
44
|
unsavedProps && tabInactive ? '✏️' : null,
|
|
39
45
|
`${currentCompTitle} ${suffix}`,
|
|
40
46
|
]
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { CanvasContent } from 'remotion';
|
|
2
|
+
import type { Dimensions } from './is-current-selected-still';
|
|
3
|
+
export declare const remotion_outputsBase: string;
|
|
4
|
+
export type AssetMetadata = {
|
|
5
|
+
type: 'not-found';
|
|
6
|
+
} | {
|
|
7
|
+
type: 'found';
|
|
8
|
+
size: number;
|
|
9
|
+
dimensions: Dimensions | 'none' | null;
|
|
10
|
+
};
|
|
11
|
+
export declare const getAssetMetadata: (canvasContent: CanvasContent) => Promise<AssetMetadata>;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAssetMetadata = exports.remotion_outputsBase = void 0;
|
|
4
|
+
const media_utils_1 = require("@remotion/media-utils");
|
|
5
|
+
const remotion_1 = require("remotion");
|
|
6
|
+
const Preview_1 = require("../components/Preview");
|
|
7
|
+
exports.remotion_outputsBase = window.remotion_staticBase.replace('static', 'outputs');
|
|
8
|
+
const getSrcFromCanvasContent = (canvasContent) => {
|
|
9
|
+
if (canvasContent.type === 'asset') {
|
|
10
|
+
return (0, remotion_1.staticFile)(canvasContent.asset);
|
|
11
|
+
}
|
|
12
|
+
if (canvasContent.type === 'composition') {
|
|
13
|
+
throw new Error('cannot get dimensions for composition');
|
|
14
|
+
}
|
|
15
|
+
return exports.remotion_outputsBase + canvasContent.path;
|
|
16
|
+
};
|
|
17
|
+
const getAssetMetadata = async (canvasContent) => {
|
|
18
|
+
const src = getSrcFromCanvasContent(canvasContent);
|
|
19
|
+
const file = await fetch(src, {
|
|
20
|
+
method: 'HEAD',
|
|
21
|
+
});
|
|
22
|
+
if (file.status === 404) {
|
|
23
|
+
return { type: 'not-found' };
|
|
24
|
+
}
|
|
25
|
+
if (file.status !== 200) {
|
|
26
|
+
throw new Error(`Expected status code 200 or 404 for file, got ${file.status}`);
|
|
27
|
+
}
|
|
28
|
+
const size = file.headers.get('content-length');
|
|
29
|
+
if (!size) {
|
|
30
|
+
throw new Error('Unexpected error: content-length is null');
|
|
31
|
+
}
|
|
32
|
+
const fileType = (0, Preview_1.getPreviewFileType)(src);
|
|
33
|
+
if (fileType === 'video') {
|
|
34
|
+
const resolution = await (0, media_utils_1.getVideoMetadata)(src);
|
|
35
|
+
return {
|
|
36
|
+
type: 'found',
|
|
37
|
+
size: Number(size),
|
|
38
|
+
dimensions: { width: resolution.width, height: resolution.height },
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
if (fileType === 'image') {
|
|
42
|
+
const resolution = await new Promise((resolve, reject) => {
|
|
43
|
+
const img = new Image();
|
|
44
|
+
img.onload = () => {
|
|
45
|
+
resolve({
|
|
46
|
+
type: 'found',
|
|
47
|
+
size: Number(size),
|
|
48
|
+
dimensions: { width: img.width, height: img.height },
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
img.onerror = () => {
|
|
52
|
+
reject(new Error('Failed to load image'));
|
|
53
|
+
};
|
|
54
|
+
img.src = src;
|
|
55
|
+
});
|
|
56
|
+
return resolution;
|
|
57
|
+
}
|
|
58
|
+
return {
|
|
59
|
+
type: 'found',
|
|
60
|
+
dimensions: 'none',
|
|
61
|
+
size: Number(size),
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
exports.getAssetMetadata = getAssetMetadata;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export
|
|
2
|
-
export declare const useDimensions: () => {
|
|
1
|
+
export type Dimensions = {
|
|
3
2
|
width: number;
|
|
4
3
|
height: number;
|
|
5
|
-
}
|
|
4
|
+
};
|
|
5
|
+
export declare const useIsStill: () => boolean;
|
|
6
|
+
export declare const useIsVideoComposition: () => boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.useIsVideoComposition = exports.useIsStill = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const remotion_1 = require("remotion");
|
|
6
6
|
const is_composition_still_1 = require("./is-composition-still");
|
|
@@ -12,16 +12,15 @@ const useIsStill = () => {
|
|
|
12
12
|
return (0, is_composition_still_1.isCompositionStill)(resolved.result);
|
|
13
13
|
};
|
|
14
14
|
exports.useIsStill = useIsStill;
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}, [config]);
|
|
15
|
+
const useIsVideoComposition = () => {
|
|
16
|
+
const isStill = (0, exports.useIsStill)();
|
|
17
|
+
const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
18
|
+
if (canvasContent === null) {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
if (isStill) {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
return canvasContent.type === 'composition';
|
|
26
25
|
};
|
|
27
|
-
exports.
|
|
26
|
+
exports.useIsVideoComposition = useIsVideoComposition;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export declare const openFolderKey: (folderName: string, parentName: string | null) => string;
|
|
2
2
|
export type ExpandedFoldersState = Record<string, boolean>;
|
|
3
|
-
|
|
4
|
-
export declare const
|
|
3
|
+
type PersistanceType = 'assets' | 'compositions';
|
|
4
|
+
export declare const persistExpandedFolders: (type: PersistanceType, state: ExpandedFoldersState) => void;
|
|
5
|
+
export declare const loadExpandedFolders: (type: PersistanceType) => ExpandedFoldersState;
|
|
6
|
+
export {};
|
|
@@ -5,13 +5,15 @@ const openFolderKey = (folderName, parentName) => {
|
|
|
5
5
|
return [parentName !== null && parentName !== void 0 ? parentName : 'no-parent', folderName].join('/');
|
|
6
6
|
};
|
|
7
7
|
exports.openFolderKey = openFolderKey;
|
|
8
|
-
const localStorageKey = '
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
const localStorageKey = (type) => type === 'compositions'
|
|
9
|
+
? 'remotion.expandedFolders'
|
|
10
|
+
: 'remotion.expandedAssetFolders';
|
|
11
|
+
const persistExpandedFolders = (type, state) => {
|
|
12
|
+
window.localStorage.setItem(localStorageKey(type), JSON.stringify(state));
|
|
11
13
|
};
|
|
12
14
|
exports.persistExpandedFolders = persistExpandedFolders;
|
|
13
|
-
const loadExpandedFolders = () => {
|
|
14
|
-
const item = window.localStorage.getItem(localStorageKey);
|
|
15
|
+
const loadExpandedFolders = (type) => {
|
|
16
|
+
const item = window.localStorage.getItem(localStorageKey(type));
|
|
15
17
|
if (item === null) {
|
|
16
18
|
return {};
|
|
17
19
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ExpandedFoldersState } from '../helpers/persist-open-folders';
|
|
3
3
|
type TFolderContext = {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
compositionFoldersExpanded: ExpandedFoldersState;
|
|
5
|
+
setCompositionFoldersExpanded: React.Dispatch<React.SetStateAction<ExpandedFoldersState>>;
|
|
6
|
+
assetFoldersExpanded: ExpandedFoldersState;
|
|
7
|
+
setAssetFoldersExpanded: React.Dispatch<React.SetStateAction<ExpandedFoldersState>>;
|
|
6
8
|
};
|
|
7
9
|
export declare const FolderContext: React.Context<TFolderContext>;
|
|
8
10
|
export declare const FolderContextProvider: React.FC<{
|
|
@@ -5,19 +5,26 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const persist_open_folders_1 = require("../helpers/persist-open-folders");
|
|
7
7
|
exports.FolderContext = (0, react_1.createContext)({
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
compositionFoldersExpanded: {},
|
|
9
|
+
setCompositionFoldersExpanded: () => {
|
|
10
|
+
throw new Error('default state');
|
|
11
|
+
},
|
|
12
|
+
assetFoldersExpanded: {},
|
|
13
|
+
setAssetFoldersExpanded: () => {
|
|
10
14
|
throw new Error('default state');
|
|
11
15
|
},
|
|
12
16
|
});
|
|
13
17
|
const FolderContextProvider = ({ children }) => {
|
|
14
|
-
const [
|
|
18
|
+
const [compositionFoldersExpanded, setCompositionFoldersExpanded] = (0, react_1.useState)(() => (0, persist_open_folders_1.loadExpandedFolders)('compositions'));
|
|
19
|
+
const [assetFoldersExpanded, setAssetFoldersExpanded] = (0, react_1.useState)(() => (0, persist_open_folders_1.loadExpandedFolders)('assets'));
|
|
15
20
|
const value = (0, react_1.useMemo)(() => {
|
|
16
21
|
return {
|
|
17
|
-
|
|
18
|
-
|
|
22
|
+
compositionFoldersExpanded,
|
|
23
|
+
setCompositionFoldersExpanded,
|
|
24
|
+
assetFoldersExpanded,
|
|
25
|
+
setAssetFoldersExpanded,
|
|
19
26
|
};
|
|
20
|
-
}, [
|
|
27
|
+
}, [assetFoldersExpanded, compositionFoldersExpanded]);
|
|
21
28
|
return ((0, jsx_runtime_1.jsx)(exports.FolderContext.Provider, { value: value, children: children }));
|
|
22
29
|
};
|
|
23
30
|
exports.FolderContextProvider = FolderContextProvider;
|
|
@@ -15,13 +15,13 @@ export declare const getCliOptions: (options: {
|
|
|
15
15
|
browser: "chrome";
|
|
16
16
|
crf: import("@remotion/renderer").Crf | null;
|
|
17
17
|
pixelFormat: "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le";
|
|
18
|
-
proResProfile: "
|
|
18
|
+
proResProfile: "4444-xq" | "4444" | "hq" | "standard" | "light" | "proxy" | undefined;
|
|
19
19
|
x264Preset: "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "slow" | "slower" | "veryslow" | "placebo" | undefined;
|
|
20
20
|
everyNthFrame: number;
|
|
21
21
|
numberOfGifLoops: import("./config/number-of-gif-loops").Loop;
|
|
22
22
|
stillFrame: number;
|
|
23
23
|
browserExecutable: BrowserExecutable;
|
|
24
|
-
logLevel: "
|
|
24
|
+
logLevel: "verbose" | "info" | "warn" | "error";
|
|
25
25
|
scale: number;
|
|
26
26
|
chromiumOptions: ChromiumOptions;
|
|
27
27
|
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: "verbose" | "info" | "warn" | "error";
|
|
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: "verbose" | "info" | "warn" | "error";
|
|
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: "verbose" | "info" | "warn" | "error";
|
|
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: "verbose" | "info" | "warn" | "error";
|
|
84
84
|
} & {
|
|
85
85
|
tag?: string | undefined;
|
|
86
86
|
}, message?: any, ...optionalParams: any[]) => void;
|
|
@@ -100,13 +100,13 @@ export declare const CliInternals: {
|
|
|
100
100
|
browser: "chrome";
|
|
101
101
|
crf: import("@remotion/renderer").Crf | null;
|
|
102
102
|
pixelFormat: "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le";
|
|
103
|
-
proResProfile: "
|
|
103
|
+
proResProfile: "4444-xq" | "4444" | "hq" | "standard" | "light" | "proxy" | undefined;
|
|
104
104
|
x264Preset: "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "slow" | "slower" | "veryslow" | "placebo" | undefined;
|
|
105
105
|
everyNthFrame: number;
|
|
106
106
|
numberOfGifLoops: import("./config/number-of-gif-loops").Loop;
|
|
107
107
|
stillFrame: number;
|
|
108
108
|
browserExecutable: import("@remotion/renderer").BrowserExecutable;
|
|
109
|
-
logLevel: "
|
|
109
|
+
logLevel: "verbose" | "info" | "warn" | "error";
|
|
110
110
|
scale: number;
|
|
111
111
|
chromiumOptions: import("@remotion/renderer").ChromiumOptions;
|
|
112
112
|
overwrite: boolean;
|
|
@@ -132,7 +132,7 @@ export declare const CliInternals: {
|
|
|
132
132
|
"browser-executable": import("@remotion/renderer").BrowserExecutable;
|
|
133
133
|
"pixel-format": "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le";
|
|
134
134
|
"image-format": "none" | "png" | "jpeg" | "pdf" | "webp";
|
|
135
|
-
"prores-profile": "
|
|
135
|
+
"prores-profile": "4444-xq" | "4444" | "hq" | "standard" | "light" | "proxy";
|
|
136
136
|
"x264-preset": "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "slow" | "slower" | "veryslow" | "placebo";
|
|
137
137
|
"bundle-cache": string;
|
|
138
138
|
"env-file": string;
|
|
@@ -190,7 +190,7 @@ export declare const CliInternals: {
|
|
|
190
190
|
} & {
|
|
191
191
|
_: string[];
|
|
192
192
|
};
|
|
193
|
-
printError: (err: Error, logLevel: "
|
|
193
|
+
printError: (err: Error, logLevel: "verbose" | "info" | "warn" | "error") => Promise<void>;
|
|
194
194
|
formatBytes: (number: number, options?: Intl.NumberFormatOptions & {
|
|
195
195
|
locale: string;
|
|
196
196
|
bits?: boolean | undefined;
|
|
@@ -232,7 +232,7 @@ export declare const CliInternals: {
|
|
|
232
232
|
};
|
|
233
233
|
listOfRemotionPackages: string[];
|
|
234
234
|
shouldUseNonOverlayingLogger: ({ logLevel, }: {
|
|
235
|
-
logLevel: "
|
|
235
|
+
logLevel: "verbose" | "info" | "warn" | "error";
|
|
236
236
|
}) => boolean;
|
|
237
237
|
getCompositionWithDimensionOverride: ({ height, width, args, compositionIdFromUi, chromiumOptions, envVariables, port, puppeteerInstance, timeoutInMilliseconds, browserExecutable, serveUrlOrWebpackUrl, indent, serializedInputPropsWithCustomSchema, logLevel, server, offthreadVideoCacheSizeInBytes, }: {
|
|
238
238
|
height: number | null;
|
|
@@ -247,7 +247,7 @@ export declare const CliInternals: {
|
|
|
247
247
|
browserExecutable: import("@remotion/renderer").BrowserExecutable;
|
|
248
248
|
serveUrlOrWebpackUrl: string;
|
|
249
249
|
indent: boolean;
|
|
250
|
-
logLevel: "
|
|
250
|
+
logLevel: "verbose" | "info" | "warn" | "error";
|
|
251
251
|
serializedInputPropsWithCustomSchema: string;
|
|
252
252
|
server: import("@remotion/renderer").RemotionServer;
|
|
253
253
|
offthreadVideoCacheSizeInBytes: number | null;
|
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: "verbose" | "info" | "warn" | "error";
|
|
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: "verbose" | "info" | "warn" | "error";
|
|
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: "verbose" | "info" | "warn" | "error";
|
|
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: "verbose" | "info" | "warn" | "error";
|
|
23
23
|
} & {
|
|
24
24
|
tag?: string | undefined;
|
|
25
25
|
}, message?: any, ...optionalParams: any[]) => void;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import type { IncomingMessage, ServerResponse } from 'node:http';
|
|
3
3
|
import type { LiveEventsServer } from './live-events';
|
|
4
|
-
export declare const handleRoutes: ({
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
export declare const handleRoutes: ({ staticHash, staticHashPrefix, outputHash, outputHashPrefix, request, response, liveEventsServer, getCurrentInputProps, getEnvVariables, remotionRoot, entryPoint, publicDir, }: {
|
|
5
|
+
staticHash: string;
|
|
6
|
+
staticHashPrefix: string;
|
|
7
|
+
outputHash: string;
|
|
8
|
+
outputHashPrefix: string;
|
|
7
9
|
request: IncomingMessage;
|
|
8
10
|
response: ServerResponse;
|
|
9
11
|
liveEventsServer: LiveEventsServer;
|
|
@@ -1,13 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
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;
|
|
4
24
|
};
|
|
5
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
26
|
exports.handleRoutes = void 0;
|
|
7
27
|
const bundler_1 = require("@remotion/bundler");
|
|
8
28
|
const renderer_1 = require("@remotion/renderer");
|
|
9
29
|
const node_fs_1 = require("node:fs");
|
|
10
|
-
const node_path_1 =
|
|
30
|
+
const node_path_1 = __importStar(require("node:path"));
|
|
11
31
|
const node_url_1 = require("node:url");
|
|
12
32
|
const config_1 = require("../config");
|
|
13
33
|
const number_of_shared_audio_tags_1 = require("../config/number-of-shared-audio-tags");
|
|
@@ -27,6 +47,10 @@ const static404 = (response) => {
|
|
|
27
47
|
response.writeHead(404);
|
|
28
48
|
response.end('The static/ prefix has been changed, this URL is no longer valid.');
|
|
29
49
|
};
|
|
50
|
+
const output404 = (response) => {
|
|
51
|
+
response.writeHead(404);
|
|
52
|
+
response.end('The outputs/ prefix has been changed, this URL is no longer valid.');
|
|
53
|
+
};
|
|
30
54
|
const handleFallback = async ({ remotionRoot, hash, response, getCurrentInputProps, getEnvVariables, publicDir, }) => {
|
|
31
55
|
var _a, _b, _c;
|
|
32
56
|
const [edit] = await editorGuess;
|
|
@@ -176,7 +200,7 @@ const handleFavicon = (_, response) => {
|
|
|
176
200
|
const readStream = (0, node_fs_1.createReadStream)(filePath);
|
|
177
201
|
readStream.pipe(response);
|
|
178
202
|
};
|
|
179
|
-
const handleRoutes = ({
|
|
203
|
+
const handleRoutes = ({ staticHash, staticHashPrefix, outputHash, outputHashPrefix, request, response, liveEventsServer, getCurrentInputProps, getEnvVariables, remotionRoot, entryPoint, publicDir, }) => {
|
|
180
204
|
const url = new URL(request.url, 'http://localhost');
|
|
181
205
|
if (url.pathname === '/api/project-info') {
|
|
182
206
|
return handleProjectInfo(remotionRoot, request, response);
|
|
@@ -209,15 +233,35 @@ const handleRoutes = ({ hash, hashPrefix, request, response, liveEventsServer, g
|
|
|
209
233
|
if (url.pathname === '/events') {
|
|
210
234
|
return liveEventsServer.router(request, response);
|
|
211
235
|
}
|
|
212
|
-
if (url.pathname.startsWith(
|
|
213
|
-
|
|
236
|
+
if (url.pathname.startsWith(staticHash)) {
|
|
237
|
+
const filename = new URL(request.url, 'http://localhost').pathname.replace(new RegExp(`^${staticHash}`), '');
|
|
238
|
+
const filePath = (0, node_path_1.join)(publicDir, decodeURIComponent(filename));
|
|
239
|
+
return (0, serve_static_1.serveStatic)({
|
|
240
|
+
root: publicDir,
|
|
241
|
+
path: filePath,
|
|
242
|
+
req: request,
|
|
243
|
+
res: response,
|
|
244
|
+
});
|
|
214
245
|
}
|
|
215
|
-
if (url.pathname.startsWith(
|
|
246
|
+
if (url.pathname.startsWith(staticHashPrefix)) {
|
|
216
247
|
return static404(response);
|
|
217
248
|
}
|
|
249
|
+
if (url.pathname.startsWith(outputHash)) {
|
|
250
|
+
const filename = new URL(request.url, 'http://localhost').pathname.replace(new RegExp(`^${outputHash}`), '');
|
|
251
|
+
const filePath = (0, node_path_1.join)(remotionRoot, decodeURIComponent(filename));
|
|
252
|
+
return (0, serve_static_1.serveStatic)({
|
|
253
|
+
root: remotionRoot,
|
|
254
|
+
path: filePath,
|
|
255
|
+
req: request,
|
|
256
|
+
res: response,
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
if (url.pathname.startsWith(outputHashPrefix)) {
|
|
260
|
+
return output404(response);
|
|
261
|
+
}
|
|
218
262
|
return handleFallback({
|
|
219
263
|
remotionRoot,
|
|
220
|
-
hash,
|
|
264
|
+
hash: staticHash,
|
|
221
265
|
response,
|
|
222
266
|
getCurrentInputProps,
|
|
223
267
|
getEnvVariables,
|
|
@@ -6,4 +6,9 @@
|
|
|
6
6
|
* MIT Licensed
|
|
7
7
|
*/
|
|
8
8
|
import type { IncomingMessage, ServerResponse } from 'node:http';
|
|
9
|
-
export declare const serveStatic: (root
|
|
9
|
+
export declare const serveStatic: ({ root, path, req, res, }: {
|
|
10
|
+
root: string;
|
|
11
|
+
path: string;
|
|
12
|
+
req: IncomingMessage;
|
|
13
|
+
res: ServerResponse;
|
|
14
|
+
}) => Promise<void>;
|
|
@@ -10,10 +10,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
10
10
|
exports.serveStatic = void 0;
|
|
11
11
|
const renderer_1 = require("@remotion/renderer");
|
|
12
12
|
const node_fs_1 = require("node:fs");
|
|
13
|
-
const node_path_1 = require("node:path");
|
|
14
13
|
const middleware_1 = require("./dev-middleware/middleware");
|
|
15
14
|
const range_parser_1 = require("./dev-middleware/range-parser");
|
|
16
|
-
const serveStatic = async function (root,
|
|
15
|
+
const serveStatic = async function ({ root, path, req, res, }) {
|
|
17
16
|
if (req.method !== 'GET' && req.method !== 'HEAD') {
|
|
18
17
|
// method not allowed
|
|
19
18
|
res.statusCode = 405;
|
|
@@ -22,8 +21,6 @@ const serveStatic = async function (root, hash, req, res) {
|
|
|
22
21
|
res.end();
|
|
23
22
|
return;
|
|
24
23
|
}
|
|
25
|
-
const filename = new URL(req.url, 'http://localhost').pathname.replace(new RegExp(`^${hash}`), '');
|
|
26
|
-
const path = (0, node_path_1.join)(root, decodeURIComponent(filename));
|
|
27
24
|
if (!renderer_1.RenderInternals.isPathInside(path, root)) {
|
|
28
25
|
res.writeHead(500);
|
|
29
26
|
res.write('Not allowed to read');
|
|
@@ -13,8 +13,10 @@ export declare const startServer: (options: {
|
|
|
13
13
|
publicDir: string;
|
|
14
14
|
userPassedPublicDir: string | null;
|
|
15
15
|
poll: number | null;
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
staticHash: string;
|
|
17
|
+
staticHashPrefix: string;
|
|
18
|
+
outputHash: string;
|
|
19
|
+
outputHashPrefix: string;
|
|
18
20
|
}) => Promise<{
|
|
19
21
|
port: number;
|
|
20
22
|
liveEventsServer: LiveEventsServer;
|
|
@@ -50,8 +50,10 @@ const startServer = async (options) => {
|
|
|
50
50
|
})
|
|
51
51
|
.then(() => {
|
|
52
52
|
(0, routes_1.handleRoutes)({
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
staticHash: options.staticHash,
|
|
54
|
+
staticHashPrefix: options.staticHashPrefix,
|
|
55
|
+
outputHash: options.outputHash,
|
|
56
|
+
outputHashPrefix: options.outputHashPrefix,
|
|
55
57
|
request: request,
|
|
56
58
|
response,
|
|
57
59
|
liveEventsServer,
|
package/dist/studio.js
CHANGED
|
@@ -86,8 +86,11 @@ const studioCommand = async (remotionRoot, args) => {
|
|
|
86
86
|
userPassedPublicDir: config_1.ConfigInternals.getPublicDir(),
|
|
87
87
|
remotionRoot,
|
|
88
88
|
});
|
|
89
|
-
const
|
|
90
|
-
const
|
|
89
|
+
const hash = node_crypto_1.default.randomBytes(6).toString('hex');
|
|
90
|
+
const outputHashPrefix = '/outputs-';
|
|
91
|
+
const outputHash = `${outputHashPrefix}${hash}`;
|
|
92
|
+
const staticHashPrefix = '/static-';
|
|
93
|
+
const staticHash = `${staticHashPrefix}${hash}`;
|
|
91
94
|
(0, public_folder_1.initPublicFolderWatch)({
|
|
92
95
|
publicDir,
|
|
93
96
|
remotionRoot,
|
|
@@ -121,8 +124,10 @@ const studioCommand = async (remotionRoot, args) => {
|
|
|
121
124
|
webpackOverride: config_1.ConfigInternals.getWebpackOverrideFn(),
|
|
122
125
|
poll: config_1.ConfigInternals.getWebpackPolling(),
|
|
123
126
|
userPassedPublicDir: config_1.ConfigInternals.getPublicDir(),
|
|
124
|
-
|
|
125
|
-
|
|
127
|
+
staticHash,
|
|
128
|
+
staticHashPrefix,
|
|
129
|
+
outputHash,
|
|
130
|
+
outputHashPrefix,
|
|
126
131
|
});
|
|
127
132
|
(0, live_events_1.setLiveEventsListener)(liveEventsServer);
|
|
128
133
|
const networkAddress = (0, get_network_address_1.getNetworkAddress)();
|