@remotion/studio 4.0.88 → 4.0.89
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +1 -1
- package/dist/Studio.d.ts +6 -0
- package/dist/Studio.js +19 -0
- package/dist/components/AssetSelector.js +4 -3
- package/dist/components/Button.d.ts +11 -0
- package/dist/components/Button.js +35 -0
- package/dist/components/CurrentCompositionSideEffects.js +1 -1
- package/dist/components/Editor.d.ts +3 -1
- package/dist/components/Editor.js +2 -22
- package/dist/components/MenuBuildIndicator.js +1 -1
- package/dist/components/Modals.js +2 -1
- package/dist/components/NewComposition/RemInput.d.ts +2 -2
- package/dist/components/NewComposition/RemInputTypeColor.d.ts +1 -1
- package/dist/components/NewComposition/RemTextarea.d.ts +1 -1
- package/dist/components/NoRegisterRoot.js +2 -3
- package/dist/components/Notifications/ServerDisconnected.js +1 -1
- package/dist/components/RenderButton.js +3 -3
- package/dist/components/RenderModal/DataEditor.js +4 -4
- package/dist/components/RenderPreview.js +2 -1
- package/dist/components/RenderQueue/index.js +2 -1
- package/dist/components/SidebarRenderButton.js +2 -1
- package/dist/components/StaticFilePreview.js +2 -1
- package/dist/components/Studio.d.ts +4 -0
- package/dist/components/Studio.js +16 -0
- package/dist/components/render-defaults.d.ts +40 -0
- package/dist/components/render-defaults.js +2 -0
- package/dist/error-overlay/react-overlay/utils/make-stack-frame.d.ts +7 -0
- package/dist/error-overlay/react-overlay/utils/make-stack-frame.js +25 -0
- package/dist/helpers/client-id.d.ts +6 -4
- package/dist/helpers/client-id.js +92 -9
- package/dist/helpers/colors.d.ts +1 -1
- package/dist/helpers/presets-labels.d.ts +1 -1
- package/dist/helpers/retry-payload.d.ts +3 -0
- package/dist/helpers/retry-payload.js +142 -0
- package/dist/helpers/use-file-existence.js +5 -6
- package/dist/helpers/use-menu-structure.js +1 -1
- package/dist/hot-middleware-client/client.d.ts +27 -0
- package/dist/hot-middleware-client/client.js +172 -0
- package/dist/hot-middleware-client/process-update.d.ts +12 -0
- package/dist/hot-middleware-client/process-update.js +157 -0
- package/dist/index.d.ts +4 -4
- package/dist/preview-server/dev-middleware/range-parser.d.ts +1 -1
- package/dist/previewEntry.js +22 -15
- package/dist/routes.d.ts +0 -1
- package/package.json +7 -7
- package/tsconfig.tsbuildinfo +1 -1
- package/.turbo/turbo-lint.log +0 -10
- package/dist/components/BufferingIndicator.d.ts +0 -2
- package/dist/components/BufferingIndicator.js +0 -23
- package/dist/helpers/event-source.d.ts +0 -3
- package/dist/helpers/event-source.js +0 -76
package/.turbo/turbo-build.log
CHANGED
package/dist/Studio.d.ts
ADDED
package/dist/Studio.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Studio = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_dom_1 = require("react-dom");
|
|
6
|
+
const remotion_1 = require("remotion");
|
|
7
|
+
require("../styles.css");
|
|
8
|
+
const Editor_1 = require("./components/Editor");
|
|
9
|
+
const EditorContexts_1 = require("./components/EditorContexts");
|
|
10
|
+
const ServerDisconnected_1 = require("./components/Notifications/ServerDisconnected");
|
|
11
|
+
const getServerDisconnectedDomElement = () => {
|
|
12
|
+
return document.getElementById('server-disconnected-overlay');
|
|
13
|
+
};
|
|
14
|
+
const Studio = ({ rootComponent, readOnly }) => {
|
|
15
|
+
return ((0, jsx_runtime_1.jsx)(remotion_1.Internals.RemotionRoot, { numberOfAudioTags: window.remotion_numberOfAudioTags, children: (0, jsx_runtime_1.jsxs)(EditorContexts_1.EditorContexts, { children: [(0, jsx_runtime_1.jsx)(Editor_1.Editor, { readOnlyStudio: readOnly, Root: rootComponent }), readOnly
|
|
16
|
+
? null
|
|
17
|
+
: (0, react_dom_1.createPortal)((0, jsx_runtime_1.jsx)(ServerDisconnected_1.ServerDisconnected, {}), getServerDisconnectedDomElement())] }) }));
|
|
18
|
+
};
|
|
19
|
+
exports.Studio = Studio;
|
|
@@ -27,9 +27,9 @@ exports.AssetSelector = void 0;
|
|
|
27
27
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
28
28
|
const react_1 = __importStar(require("react"));
|
|
29
29
|
const remotion_1 = require("remotion");
|
|
30
|
+
const client_id_1 = require("../helpers/client-id");
|
|
30
31
|
const colors_1 = require("../helpers/colors");
|
|
31
32
|
const create_folder_tree_1 = require("../helpers/create-folder-tree");
|
|
32
|
-
const event_source_1 = require("../helpers/event-source");
|
|
33
33
|
const persist_open_folders_1 = require("../helpers/persist-open-folders");
|
|
34
34
|
const folders_1 = require("../state/folders");
|
|
35
35
|
const z_index_1 = require("../state/z-index");
|
|
@@ -63,6 +63,7 @@ const list = {
|
|
|
63
63
|
const AssetSelector = () => {
|
|
64
64
|
const { tabIndex } = (0, z_index_1.useZIndex)();
|
|
65
65
|
const { assetFoldersExpanded, setAssetFoldersExpanded } = (0, react_1.useContext)(folders_1.FolderContext);
|
|
66
|
+
const { subscribeToEvent } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
66
67
|
const [{ publicFolderExists, staticFiles }, setState] = react_1.default.useState(() => {
|
|
67
68
|
return {
|
|
68
69
|
staticFiles: (0, remotion_1.getStaticFiles)(),
|
|
@@ -79,11 +80,11 @@ const AssetSelector = () => {
|
|
|
79
80
|
publicFolderExists: window.remotion_publicFolderExists,
|
|
80
81
|
});
|
|
81
82
|
};
|
|
82
|
-
const unsub =
|
|
83
|
+
const unsub = subscribeToEvent('new-public-folder', onUpdate);
|
|
83
84
|
return () => {
|
|
84
85
|
unsub();
|
|
85
86
|
};
|
|
86
|
-
}, []);
|
|
87
|
+
}, [subscribeToEvent]);
|
|
87
88
|
const toggleFolder = (0, react_1.useCallback)((folderName, parentName) => {
|
|
88
89
|
setAssetFoldersExpanded((p) => {
|
|
89
90
|
var _a;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const Button: React.ForwardRefExoticComponent<{
|
|
3
|
+
onClick: () => void;
|
|
4
|
+
disabled?: boolean | undefined;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
style?: React.CSSProperties | undefined;
|
|
7
|
+
buttonContainerStyle?: React.CSSProperties | undefined;
|
|
8
|
+
autoFocus?: boolean | undefined;
|
|
9
|
+
title?: string | undefined;
|
|
10
|
+
id?: string | undefined;
|
|
11
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Button = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const colors_1 = require("../helpers/colors");
|
|
7
|
+
const button = {
|
|
8
|
+
border: `1px solid ${colors_1.INPUT_BORDER_COLOR_UNHOVERED}`,
|
|
9
|
+
borderRadius: 4,
|
|
10
|
+
backgroundColor: colors_1.INPUT_BACKGROUND,
|
|
11
|
+
appearance: 'none',
|
|
12
|
+
fontFamily: 'inherit',
|
|
13
|
+
fontSize: 14,
|
|
14
|
+
color: 'white',
|
|
15
|
+
flexDirection: 'row',
|
|
16
|
+
};
|
|
17
|
+
const ButtonRefForwardFunction = ({ children, onClick, title, disabled, style, id, autoFocus, buttonContainerStyle, }, ref) => {
|
|
18
|
+
const combined = (0, react_1.useMemo)(() => {
|
|
19
|
+
return {
|
|
20
|
+
...button,
|
|
21
|
+
...(style !== null && style !== void 0 ? style : {}),
|
|
22
|
+
};
|
|
23
|
+
}, [style]);
|
|
24
|
+
const buttonContainer = (0, react_1.useMemo)(() => {
|
|
25
|
+
return {
|
|
26
|
+
padding: 10,
|
|
27
|
+
cursor: disabled ? 'inherit' : 'pointer',
|
|
28
|
+
fontSize: 14,
|
|
29
|
+
opacity: disabled ? 0.7 : 1,
|
|
30
|
+
...(buttonContainerStyle !== null && buttonContainerStyle !== void 0 ? buttonContainerStyle : {}),
|
|
31
|
+
};
|
|
32
|
+
}, [buttonContainerStyle, disabled]);
|
|
33
|
+
return ((0, jsx_runtime_1.jsx)("button", { ref: ref, id: id, style: combined, type: "button", disabled: disabled, onClick: onClick, autoFocus: autoFocus, title: title, children: (0, jsx_runtime_1.jsx)("div", { className: "css-reset", style: buttonContainer, children: children }) }));
|
|
34
|
+
};
|
|
35
|
+
exports.Button = (0, react_1.forwardRef)(ButtonRefForwardFunction);
|
|
@@ -36,7 +36,7 @@ exports.TitleUpdater = TitleUpdater;
|
|
|
36
36
|
const CurrentCompositionKeybindings = () => {
|
|
37
37
|
const keybindings = (0, use_keybinding_1.useKeybinding)();
|
|
38
38
|
const video = remotion_1.Internals.useVideo();
|
|
39
|
-
const { type } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
39
|
+
const { type } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx).previewServerState;
|
|
40
40
|
const openRenderModal = (0, react_1.useCallback)(() => {
|
|
41
41
|
if (!video) {
|
|
42
42
|
return;
|
|
@@ -11,7 +11,6 @@ const z_index_1 = require("../state/z-index");
|
|
|
11
11
|
const EditorContent_1 = require("./EditorContent");
|
|
12
12
|
const GlobalKeybindings_1 = require("./GlobalKeybindings");
|
|
13
13
|
const Modals_1 = require("./Modals");
|
|
14
|
-
const NoRegisterRoot_1 = require("./NoRegisterRoot");
|
|
15
14
|
const NotificationCenter_1 = require("./Notifications/NotificationCenter");
|
|
16
15
|
const background = {
|
|
17
16
|
backgroundColor: colors_1.BACKGROUND,
|
|
@@ -21,14 +20,7 @@ const background = {
|
|
|
21
20
|
flexDirection: 'column',
|
|
22
21
|
position: 'absolute',
|
|
23
22
|
};
|
|
24
|
-
const Editor = () => {
|
|
25
|
-
const [Root, setRoot] = (0, react_1.useState)(() => remotion_1.Internals.getRoot());
|
|
26
|
-
const [waitForRoot] = (0, react_1.useState)(() => {
|
|
27
|
-
if (Root) {
|
|
28
|
-
return 0;
|
|
29
|
-
}
|
|
30
|
-
return (0, remotion_1.delayRender)('Waiting for registerRoot()');
|
|
31
|
-
});
|
|
23
|
+
const Editor = ({ Root }) => {
|
|
32
24
|
(0, react_1.useEffect)(() => {
|
|
33
25
|
const listenToChanges = (e) => {
|
|
34
26
|
if (window.remotion_unsavedProps) {
|
|
@@ -40,18 +32,6 @@ const Editor = () => {
|
|
|
40
32
|
window.removeEventListener('beforeunload', listenToChanges);
|
|
41
33
|
};
|
|
42
34
|
}, []);
|
|
43
|
-
(0,
|
|
44
|
-
if (Root) {
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
const cleanup = remotion_1.Internals.waitForRoot((NewRoot) => {
|
|
48
|
-
setRoot(() => NewRoot);
|
|
49
|
-
(0, remotion_1.continueRender)(waitForRoot);
|
|
50
|
-
});
|
|
51
|
-
return () => {
|
|
52
|
-
cleanup();
|
|
53
|
-
};
|
|
54
|
-
}, [Root, waitForRoot]);
|
|
55
|
-
return ((0, jsx_runtime_1.jsx)(z_index_1.HigherZIndex, { onEscape: noop_1.noop, onOutsideClick: noop_1.noop, children: (0, jsx_runtime_1.jsxs)(timeline_zoom_1.TimelineZoomContext, { children: [(0, jsx_runtime_1.jsxs)("div", { style: background, children: [Root === null ? null : (0, jsx_runtime_1.jsx)(Root, {}), (0, jsx_runtime_1.jsxs)(remotion_1.Internals.CanUseRemotionHooksProvider, { children: [Root === null ? (0, jsx_runtime_1.jsx)(NoRegisterRoot_1.NoRegisterRoot, {}) : (0, jsx_runtime_1.jsx)(EditorContent_1.EditorContent, {}), (0, jsx_runtime_1.jsx)(GlobalKeybindings_1.GlobalKeybindings, {})] }), (0, jsx_runtime_1.jsx)(NotificationCenter_1.NotificationCenter, {})] }), (0, jsx_runtime_1.jsx)(Modals_1.Modals, {})] }) }));
|
|
35
|
+
return ((0, jsx_runtime_1.jsx)(z_index_1.HigherZIndex, { onEscape: noop_1.noop, onOutsideClick: noop_1.noop, children: (0, jsx_runtime_1.jsxs)(timeline_zoom_1.TimelineZoomContext, { children: [(0, jsx_runtime_1.jsxs)("div", { style: background, children: [(0, jsx_runtime_1.jsx)(Root, {}), (0, jsx_runtime_1.jsxs)(remotion_1.Internals.CanUseRemotionHooksProvider, { children: [(0, jsx_runtime_1.jsx)(EditorContent_1.EditorContent, {}), (0, jsx_runtime_1.jsx)(GlobalKeybindings_1.GlobalKeybindings, {})] }), (0, jsx_runtime_1.jsx)(NotificationCenter_1.NotificationCenter, {})] }), (0, jsx_runtime_1.jsx)(Modals_1.Modals, {})] }) }));
|
|
56
36
|
};
|
|
57
37
|
exports.Editor = Editor;
|
|
@@ -26,7 +26,7 @@ const noSpinner = {
|
|
|
26
26
|
};
|
|
27
27
|
const MenuBuildIndicator = () => {
|
|
28
28
|
const [isBuilding, setIsBuilding] = (0, react_1.useState)(false);
|
|
29
|
-
const ctx = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
29
|
+
const ctx = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx).previewServerState;
|
|
30
30
|
const showButton = window.remotion_editorName && ctx.type === 'connected';
|
|
31
31
|
(0, react_1.useEffect)(() => {
|
|
32
32
|
window.remotion_isBuilding = () => {
|
|
@@ -15,7 +15,8 @@ const RenderStatusModal_1 = require("./RenderModal/RenderStatusModal");
|
|
|
15
15
|
const UpdateModal_1 = require("./UpdateModal/UpdateModal");
|
|
16
16
|
const Modals = () => {
|
|
17
17
|
const { selectedModal: modalContextType } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
18
|
-
const canRender = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx).type ===
|
|
18
|
+
const canRender = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx).previewServerState.type ===
|
|
19
|
+
'connected';
|
|
19
20
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [modalContextType && modalContextType.type === 'new-comp' && ((0, jsx_runtime_1.jsx)(NewComposition_1.default, { initialCompType: modalContextType.compType })), modalContextType && canRender && modalContextType.type === 'render' && ((0, jsx_runtime_1.jsx)(RenderModal_1.RenderModalWithLoader, { initialFrame: modalContextType.initialFrame, compositionId: modalContextType.compositionId, initialVideoImageFormat: modalContextType.initialVideoImageFormat, initialJpegQuality: modalContextType.initialJpegQuality, initialScale: modalContextType.initialScale, initialLogLevel: modalContextType.initialLogLevel, initialOffthreadVideoCacheSizeInBytes: modalContextType.initialOffthreadVideoCacheSizeInBytes, initialConcurrency: modalContextType.initialConcurrency, maxConcurrency: modalContextType.maxConcurrency, minConcurrency: modalContextType.minConcurrency, initialStillImageFormat: modalContextType.initialStillImageFormat, initialMuted: modalContextType.initialMuted, initialEnforceAudioTrack: modalContextType.initialEnforceAudioTrack, initialProResProfile: modalContextType.initialProResProfile, initialx264Preset: modalContextType.initialx264Preset, initialPixelFormat: modalContextType.initialPixelFormat, initialAudioBitrate: modalContextType.initialAudioBitrate, initialVideoBitrate: modalContextType.initialVideoBitrate, initialEveryNthFrame: modalContextType.initialEveryNthFrame, initialNumberOfGifLoops: modalContextType.initialNumberOfGifLoops, initialDelayRenderTimeout: modalContextType.initialDelayRenderTimeout, initialEnvVariables: modalContextType.initialEnvVariables, initialDisableWebSecurity: modalContextType.initialDisableWebSecurity, initialGl: modalContextType.initialOpenGlRenderer, initialHeadless: modalContextType.initialHeadless, initialIgnoreCertificateErrors: modalContextType.initialIgnoreCertificateErrors, initialEncodingBufferSize: modalContextType.initialEncodingBufferSize, initialEncodingMaxRate: modalContextType.initialEncodingMaxRate, initialUserAgent: modalContextType.initialUserAgent, initialColorSpace: modalContextType.initialColorSpace, initialMultiProcessOnLinux: modalContextType.initialMultiProcessOnLinux, initialRepro: modalContextType.initialRepro, initialBeep: modalContextType.initialBeep, defaultProps: modalContextType.defaultProps, inFrameMark: modalContextType.inFrameMark, outFrameMark: modalContextType.outFrameMark, defaultConfigurationAudioCodec: modalContextType.defaultConfigurationAudioCodec, defaultConfigurationVideoCodec: modalContextType.defaultConfigurationVideoCodec })), modalContextType &&
|
|
20
21
|
canRender &&
|
|
21
22
|
modalContextType.type === 'render-progress' && ((0, jsx_runtime_1.jsx)(RenderStatusModal_1.RenderStatusModal, { jobId: modalContextType.jobId })), modalContextType && modalContextType.type === 'update' && ((0, jsx_runtime_1.jsx)(UpdateModal_1.UpdateModal, { info: modalContextType.info, knownBugs: modalContextType.knownBugs })), modalContextType && modalContextType.type === 'quick-switcher' && ((0, jsx_runtime_1.jsx)(QuickSwitcher_1.default, { invocationTimestamp: modalContextType.invocationTimestamp, initialMode: modalContextType.mode }))] }));
|
|
@@ -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
|
-
}) => "
|
|
16
|
-
export declare const RemotionInput: React.ForwardRefExoticComponent<Pick<Props,
|
|
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, "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,
|
|
7
|
+
export declare const RemInputTypeColor: React.ForwardRefExoticComponent<Pick<Props, "key" | "status" | keyof React.InputHTMLAttributes<HTMLInputElement>> & React.RefAttributes<HTMLInputElement>>;
|
|
8
8
|
export {};
|
|
@@ -2,5 +2,5 @@ import React from 'react';
|
|
|
2
2
|
type Props = React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement> & {
|
|
3
3
|
status: 'error' | 'warning' | 'ok';
|
|
4
4
|
};
|
|
5
|
-
export declare const RemTextarea: React.ForwardRefExoticComponent<Pick<Props, "
|
|
5
|
+
export declare const RemTextarea: React.ForwardRefExoticComponent<Pick<Props, "key" | "status" | keyof React.InputHTMLAttributes<HTMLTextAreaElement>> & React.RefAttributes<HTMLTextAreaElement>>;
|
|
6
6
|
export {};
|
|
@@ -3,16 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.NoRegisterRoot = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
+
const remotion_1 = require("remotion");
|
|
6
7
|
const label = {
|
|
7
8
|
fontSize: 13,
|
|
8
9
|
color: 'white',
|
|
9
10
|
fontFamily: 'Arial, Helvetica, sans-serif',
|
|
10
11
|
};
|
|
11
12
|
const container = {
|
|
12
|
-
display: 'flex',
|
|
13
13
|
justifyContent: 'center',
|
|
14
14
|
alignItems: 'center',
|
|
15
|
-
flex: 1,
|
|
16
15
|
flexDirection: 'column',
|
|
17
16
|
textAlign: 'center',
|
|
18
17
|
lineHeight: 1.5,
|
|
@@ -36,6 +35,6 @@ const NoRegisterRoot = () => {
|
|
|
36
35
|
if (!show) {
|
|
37
36
|
return null;
|
|
38
37
|
}
|
|
39
|
-
return ((0, jsx_runtime_1.jsxs)(
|
|
38
|
+
return ((0, jsx_runtime_1.jsxs)(remotion_1.AbsoluteFill, { style: container, children: [(0, jsx_runtime_1.jsx)("div", { style: label, children: "Waiting for registerRoot() to get called." }), (0, jsx_runtime_1.jsxs)("div", { style: label, children: ["Learn more:", ' ', (0, jsx_runtime_1.jsx)("a", { target: '_blank', style: link, href: "https://www.remotion.dev/docs/register-root", children: "remotion.dev/docs/register-root" })] })] }));
|
|
40
39
|
};
|
|
41
40
|
exports.NoRegisterRoot = NoRegisterRoot;
|
|
@@ -37,7 +37,7 @@ window.addEventListener('beforeunload', () => {
|
|
|
37
37
|
pageIsGoingToReload = true;
|
|
38
38
|
});
|
|
39
39
|
const ServerDisconnected = () => {
|
|
40
|
-
const ctx = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
40
|
+
const { previewServerState: ctx } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
41
41
|
const fav = document.getElementById('__remotion_favicon');
|
|
42
42
|
if (ctx.type !== 'disconnected') {
|
|
43
43
|
fav.setAttribute('href', '/remotion.png');
|
|
@@ -23,10 +23,10 @@ const label = {
|
|
|
23
23
|
const RenderButton = () => {
|
|
24
24
|
const { inFrame, outFrame } = (0, in_out_1.useTimelineInOutFramePosition)();
|
|
25
25
|
const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
26
|
-
const
|
|
27
|
-
|
|
26
|
+
const connectionStatus = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx)
|
|
27
|
+
.previewServerState.type;
|
|
28
28
|
const shortcut = (0, use_keybinding_1.areKeyboardShortcutsDisabled)() ? '' : '(R)';
|
|
29
|
-
const tooltip =
|
|
29
|
+
const tooltip = connectionStatus === 'connected'
|
|
30
30
|
? 'Export the current composition ' + shortcut
|
|
31
31
|
: 'Connect to the Studio server to render';
|
|
32
32
|
const iconStyle = (0, react_1.useMemo)(() => {
|
|
@@ -30,7 +30,6 @@ const remotion_1 = require("remotion");
|
|
|
30
30
|
const no_react_1 = require("remotion/no-react");
|
|
31
31
|
const client_id_1 = require("../../helpers/client-id");
|
|
32
32
|
const colors_1 = require("../../helpers/colors");
|
|
33
|
-
const event_source_1 = require("../../helpers/event-source");
|
|
34
33
|
const get_zod_if_possible_1 = require("../get-zod-if-possible");
|
|
35
34
|
const layout_1 = require("../layout");
|
|
36
35
|
const ValidationMessage_1 = require("../NewComposition/ValidationMessage");
|
|
@@ -182,12 +181,13 @@ const DataEditor = ({ unresolvedComposition, inputProps, setInputProps, mayShowS
|
|
|
182
181
|
(0, react_1.useEffect)(() => {
|
|
183
182
|
checkIfCanSaveDefaultProps();
|
|
184
183
|
}, [checkIfCanSaveDefaultProps]);
|
|
184
|
+
const { previewServerState, subscribeToEvent } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
185
185
|
(0, react_1.useEffect)(() => {
|
|
186
|
-
const unsub =
|
|
186
|
+
const unsub = subscribeToEvent('root-file-changed', checkIfCanSaveDefaultProps);
|
|
187
187
|
return () => {
|
|
188
188
|
unsub();
|
|
189
189
|
};
|
|
190
|
-
}, [checkIfCanSaveDefaultProps]);
|
|
190
|
+
}, [checkIfCanSaveDefaultProps, subscribeToEvent]);
|
|
191
191
|
const modeItems = (0, react_1.useMemo)(() => {
|
|
192
192
|
return [
|
|
193
193
|
{
|
|
@@ -248,7 +248,7 @@ const DataEditor = ({ unresolvedComposition, inputProps, setInputProps, mayShowS
|
|
|
248
248
|
unresolvedComposition.id,
|
|
249
249
|
unresolvedComposition.defaultProps,
|
|
250
250
|
]);
|
|
251
|
-
const connectionStatus =
|
|
251
|
+
const connectionStatus = previewServerState.type;
|
|
252
252
|
const warnings = (0, react_1.useMemo)(() => {
|
|
253
253
|
return (0, get_render_modal_warnings_1.getRenderModalWarnings)({
|
|
254
254
|
canSaveDefaultProps,
|
|
@@ -22,7 +22,8 @@ const errMsgStyle = {
|
|
|
22
22
|
const RenderPreview = ({ path, assetMetadata }) => {
|
|
23
23
|
const fileType = (0, Preview_1.getPreviewFileType)(path);
|
|
24
24
|
const src = get_asset_metadata_1.remotion_outputsBase + path;
|
|
25
|
-
const connectionStatus = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx)
|
|
25
|
+
const connectionStatus = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx)
|
|
26
|
+
.previewServerState.type;
|
|
26
27
|
if (connectionStatus === 'disconnected') {
|
|
27
28
|
return (0, jsx_runtime_1.jsx)("div", { style: errMsgStyle, children: "Studio server disconnected" });
|
|
28
29
|
}
|
|
@@ -58,7 +58,8 @@ const renderQueue = {
|
|
|
58
58
|
overflowY: 'auto',
|
|
59
59
|
};
|
|
60
60
|
const RenderQueue = () => {
|
|
61
|
-
const connectionStatus = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx)
|
|
61
|
+
const connectionStatus = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx)
|
|
62
|
+
.previewServerState.type;
|
|
62
63
|
const { jobs } = (0, react_1.useContext)(context_1.RenderQueueContext);
|
|
63
64
|
const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
64
65
|
const previousJobCount = react_1.default.useRef(jobs.length);
|
|
@@ -17,7 +17,8 @@ const SidebarRenderButton = ({ composition, visible }) => {
|
|
|
17
17
|
},
|
|
18
18
|
};
|
|
19
19
|
}, []);
|
|
20
|
-
const connectionStatus = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx)
|
|
20
|
+
const connectionStatus = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx)
|
|
21
|
+
.previewServerState.type;
|
|
21
22
|
const { props } = (0, react_1.useContext)(remotion_1.Internals.EditorPropsContext);
|
|
22
23
|
const onClick = (0, react_1.useCallback)((e) => {
|
|
23
24
|
var _a;
|
|
@@ -23,7 +23,8 @@ const StaticFilePreview = ({ currentAsset, assetMetadata }) => {
|
|
|
23
23
|
const fileType = (0, Preview_1.getPreviewFileType)(currentAsset);
|
|
24
24
|
const staticFileSrc = (0, remotion_1.staticFile)(currentAsset);
|
|
25
25
|
const staticFiles = (0, remotion_1.getStaticFiles)();
|
|
26
|
-
const connectionStatus = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx)
|
|
26
|
+
const connectionStatus = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx)
|
|
27
|
+
.previewServerState.type;
|
|
27
28
|
const exists = staticFiles.find((file) => file.name === currentAsset);
|
|
28
29
|
if (connectionStatus === 'disconnected') {
|
|
29
30
|
return (0, jsx_runtime_1.jsx)("div", { style: errMsgStyle, children: "Studio server disconnected" });
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Studio = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_dom_1 = require("react-dom");
|
|
6
|
+
const remotion_1 = require("remotion");
|
|
7
|
+
const Editor_1 = require("./Editor");
|
|
8
|
+
const EditorContexts_1 = require("./EditorContexts");
|
|
9
|
+
const ServerDisconnected_1 = require("./Notifications/ServerDisconnected");
|
|
10
|
+
const getServerDisconnectedDomElement = () => {
|
|
11
|
+
return document.getElementById('server-disconnected-overlay');
|
|
12
|
+
};
|
|
13
|
+
const Studio = ({ rootComponent }) => {
|
|
14
|
+
return ((0, jsx_runtime_1.jsx)(remotion_1.Internals.RemotionRoot, { numberOfAudioTags: window.remotion_numberOfAudioTags, children: (0, jsx_runtime_1.jsxs)(EditorContexts_1.EditorContexts, { children: [(0, jsx_runtime_1.jsx)(Editor_1.Editor, { Root: rootComponent }), (0, react_dom_1.createPortal)((0, jsx_runtime_1.jsx)(ServerDisconnected_1.ServerDisconnected, {}), getServerDisconnectedDomElement())] }) }));
|
|
15
|
+
};
|
|
16
|
+
exports.Studio = Studio;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { AudioCodec, Codec, ColorSpace, LogLevel, OpenGlRenderer, PixelFormat, ProResProfile, StillImageFormat, VideoImageFormat, X264Preset } from '@remotion/renderer';
|
|
2
|
+
export type RenderDefaults = {
|
|
3
|
+
jpegQuality: number;
|
|
4
|
+
scale: number;
|
|
5
|
+
logLevel: LogLevel;
|
|
6
|
+
codec: Codec;
|
|
7
|
+
concurrency: number;
|
|
8
|
+
minConcurrency: number;
|
|
9
|
+
muted: boolean;
|
|
10
|
+
maxConcurrency: number;
|
|
11
|
+
stillImageFormat: StillImageFormat;
|
|
12
|
+
videoImageFormat: VideoImageFormat;
|
|
13
|
+
audioCodec: AudioCodec | null;
|
|
14
|
+
enforceAudioTrack: boolean;
|
|
15
|
+
proResProfile: ProResProfile;
|
|
16
|
+
x264Preset: X264Preset;
|
|
17
|
+
pixelFormat: PixelFormat;
|
|
18
|
+
audioBitrate: string | null;
|
|
19
|
+
videoBitrate: string | null;
|
|
20
|
+
encodingBufferSize: string | null;
|
|
21
|
+
encodingMaxRate: string | null;
|
|
22
|
+
userAgent: string | null;
|
|
23
|
+
everyNthFrame: number;
|
|
24
|
+
numberOfGifLoops: number | null;
|
|
25
|
+
delayRenderTimeout: number;
|
|
26
|
+
disableWebSecurity: boolean;
|
|
27
|
+
openGlRenderer: OpenGlRenderer | null;
|
|
28
|
+
ignoreCertificateErrors: boolean;
|
|
29
|
+
offthreadVideoCacheSizeInBytes: number | null;
|
|
30
|
+
headless: boolean;
|
|
31
|
+
colorSpace: ColorSpace;
|
|
32
|
+
multiProcessOnLinux: boolean;
|
|
33
|
+
beepOnFinish: boolean;
|
|
34
|
+
repro: boolean;
|
|
35
|
+
};
|
|
36
|
+
declare global {
|
|
37
|
+
interface Window {
|
|
38
|
+
remotion_renderDefaults: RenderDefaults | undefined;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { StackFrame } from '@remotion/studio-shared';
|
|
2
|
+
export declare const makeStackFrame: ({ functionName, fileName, lineNumber, columnNumber, }: {
|
|
3
|
+
functionName: string | null;
|
|
4
|
+
fileName: string;
|
|
5
|
+
lineNumber: number;
|
|
6
|
+
columnNumber: number;
|
|
7
|
+
}) => StackFrame;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.makeStackFrame = void 0;
|
|
4
|
+
const makeStackFrame = ({ functionName, fileName, lineNumber, columnNumber, }) => {
|
|
5
|
+
if (functionName && functionName.indexOf('Object.') === 0) {
|
|
6
|
+
functionName = functionName.slice('Object.'.length);
|
|
7
|
+
}
|
|
8
|
+
if (
|
|
9
|
+
// Chrome has a bug with inferring function.name:
|
|
10
|
+
// https://github.com/facebook/create-react-app/issues/2097
|
|
11
|
+
// Let's ignore a meaningless name we get for top-level modules.
|
|
12
|
+
functionName === 'friendlySyntaxErrorLabel' ||
|
|
13
|
+
functionName === 'exports.__esModule' ||
|
|
14
|
+
functionName === '<anonymous>' ||
|
|
15
|
+
!functionName) {
|
|
16
|
+
functionName = null;
|
|
17
|
+
}
|
|
18
|
+
return {
|
|
19
|
+
columnNumber,
|
|
20
|
+
fileName,
|
|
21
|
+
functionName,
|
|
22
|
+
lineNumber,
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
exports.makeStackFrame = makeStackFrame;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { EventSourceEvent } from '../event-source-events';
|
|
2
3
|
type PreviewServerState = {
|
|
3
4
|
type: 'init';
|
|
4
5
|
} | {
|
|
@@ -7,10 +8,11 @@ type PreviewServerState = {
|
|
|
7
8
|
} | {
|
|
8
9
|
type: 'disconnected';
|
|
9
10
|
};
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
11
|
+
type Context = {
|
|
12
|
+
previewServerState: PreviewServerState;
|
|
13
|
+
subscribeToEvent: (type: EventSourceEvent['type'], listener: (event: EventSourceEvent) => void) => () => void;
|
|
14
|
+
};
|
|
15
|
+
export declare const StudioServerConnectionCtx: React.Context<Context>;
|
|
14
16
|
export declare const PreviewServerConnection: React.FC<{
|
|
15
17
|
children: React.ReactNode;
|
|
16
18
|
}>;
|
|
@@ -22,25 +22,108 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
22
|
__setModuleDefault(result, mod);
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
25
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.PreviewServerConnection = exports.
|
|
29
|
+
exports.PreviewServerConnection = exports.StudioServerConnectionCtx = void 0;
|
|
27
30
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
28
31
|
const react_1 = __importStar(require("react"));
|
|
32
|
+
const remotion_1 = require("remotion");
|
|
33
|
+
const NotificationCenter_1 = require("../components/Notifications/NotificationCenter");
|
|
34
|
+
const PlayBeepSound_1 = __importDefault(require("../components/PlayBeepSound"));
|
|
35
|
+
const context_1 = require("../components/RenderQueue/context");
|
|
29
36
|
exports.StudioServerConnectionCtx = react_1.default.createContext({
|
|
30
|
-
|
|
37
|
+
previewServerState: {
|
|
38
|
+
type: 'init',
|
|
39
|
+
},
|
|
40
|
+
subscribeToEvent: () => {
|
|
41
|
+
throw new Error('Context not initalized');
|
|
42
|
+
},
|
|
31
43
|
});
|
|
32
|
-
exports.studioServerConnectionRef = (0, react_1.createRef)();
|
|
33
44
|
const PreviewServerConnection = ({ children }) => {
|
|
45
|
+
const listeners = (0, react_1.useRef)([]);
|
|
46
|
+
const subscribeToEvent = (0, react_1.useCallback)((type, listener) => {
|
|
47
|
+
listeners.current.push({ type, listener });
|
|
48
|
+
return () => {
|
|
49
|
+
listeners.current = listeners.current.filter((l) => l.type !== type || l.listener !== listener);
|
|
50
|
+
};
|
|
51
|
+
}, []);
|
|
52
|
+
const openEventSource = (0, react_1.useCallback)(() => {
|
|
53
|
+
const source = new EventSource('/events');
|
|
54
|
+
source.addEventListener('message', (event) => {
|
|
55
|
+
var _a;
|
|
56
|
+
const newEvent = JSON.parse(event.data);
|
|
57
|
+
if (newEvent.type === 'new-input-props' ||
|
|
58
|
+
newEvent.type === 'new-env-variables') {
|
|
59
|
+
window.location.reload();
|
|
60
|
+
}
|
|
61
|
+
if (newEvent.type === 'init') {
|
|
62
|
+
setState({
|
|
63
|
+
type: 'connected',
|
|
64
|
+
clientId: newEvent.clientId,
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
if (newEvent.type === 'render-queue-updated') {
|
|
68
|
+
(_a = context_1.renderJobsRef.current) === null || _a === void 0 ? void 0 : _a.updateRenderJobs(newEvent.queue);
|
|
69
|
+
for (const job of newEvent.queue) {
|
|
70
|
+
if (job.status === 'done' && job.beepOnFinish) {
|
|
71
|
+
(0, PlayBeepSound_1.default)(job.id);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
if (newEvent.type === 'render-job-failed') {
|
|
76
|
+
(0, NotificationCenter_1.sendErrorNotification)(`Rendering "${newEvent.compositionId}" failed`);
|
|
77
|
+
}
|
|
78
|
+
if (newEvent.type === 'new-public-folder') {
|
|
79
|
+
const payload = {
|
|
80
|
+
files: newEvent.files,
|
|
81
|
+
};
|
|
82
|
+
window.dispatchEvent(new CustomEvent(remotion_1.Internals.WATCH_REMOTION_STATIC_FILES, {
|
|
83
|
+
detail: payload,
|
|
84
|
+
}));
|
|
85
|
+
window.remotion_staticFiles = newEvent.files;
|
|
86
|
+
window.remotion_publicFolderExists = newEvent.folderExists;
|
|
87
|
+
}
|
|
88
|
+
listeners.current.forEach((l) => {
|
|
89
|
+
if (l.type === newEvent.type) {
|
|
90
|
+
l.listener(newEvent);
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
source.addEventListener('open', () => {
|
|
95
|
+
source.addEventListener('error', () => {
|
|
96
|
+
setState({ type: 'disconnected' });
|
|
97
|
+
// Display an error message that the studio server has disconnected.
|
|
98
|
+
source === null || source === void 0 ? void 0 : source.close();
|
|
99
|
+
// Retry later
|
|
100
|
+
setTimeout(() => {
|
|
101
|
+
openEventSource();
|
|
102
|
+
}, 1000);
|
|
103
|
+
}, { once: true });
|
|
104
|
+
});
|
|
105
|
+
const close = () => {
|
|
106
|
+
source.close();
|
|
107
|
+
};
|
|
108
|
+
return {
|
|
109
|
+
close,
|
|
110
|
+
};
|
|
111
|
+
}, []);
|
|
112
|
+
(0, react_1.useEffect)(() => {
|
|
113
|
+
const { close } = openEventSource();
|
|
114
|
+
return () => {
|
|
115
|
+
close();
|
|
116
|
+
};
|
|
117
|
+
}, [openEventSource]);
|
|
34
118
|
const [state, setState] = react_1.default.useState({
|
|
35
119
|
type: 'init',
|
|
36
120
|
});
|
|
37
|
-
(0, react_1.
|
|
121
|
+
const context = (0, react_1.useMemo)(() => {
|
|
38
122
|
return {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
},
|
|
123
|
+
previewServerState: state,
|
|
124
|
+
subscribeToEvent,
|
|
42
125
|
};
|
|
43
|
-
}, []);
|
|
44
|
-
return ((0, jsx_runtime_1.jsx)(exports.StudioServerConnectionCtx.Provider, { value:
|
|
126
|
+
}, [state, subscribeToEvent]);
|
|
127
|
+
return ((0, jsx_runtime_1.jsx)(exports.StudioServerConnectionCtx.Provider, { value: context, children: children }));
|
|
45
128
|
};
|
|
46
129
|
exports.PreviewServerConnection = PreviewServerConnection;
|
package/dist/helpers/colors.d.ts
CHANGED
|
@@ -23,4 +23,4 @@ export declare const TIMELINE_TRACK_SEPARATOR = "rgba(0, 0, 0, 0.3)";
|
|
|
23
23
|
export declare const getBackgroundFromHoverState: ({ selected, hovered, }: {
|
|
24
24
|
selected: boolean;
|
|
25
25
|
hovered: boolean;
|
|
26
|
-
}) => "transparent" | "hsla(0, 0%, 100%, 0.
|
|
26
|
+
}) => "transparent" | "hsla(0, 0%, 100%, 0.15)" | "hsla(0, 0%, 100%, 0.25)" | "rgba(255, 255, 255, 0.06)";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { X264Preset } from '@remotion/renderer';
|
|
2
|
-
export declare const labelx264Preset: (profile: X264Preset) => "
|
|
2
|
+
export declare const labelx264Preset: (profile: X264Preset) => "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "medium" | "slow" | "slower" | "veryslow" | "placebo";
|