@remotion/cli 4.1.0-alpha5 → 4.1.0-alpha8
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/benchmark.js +13 -2
- package/dist/codemods/stringify-with-path.js +3 -3
- package/dist/compositions.js +6 -1
- package/dist/config/log.d.ts +1 -1
- package/dist/editor/components/CanvasOrLoading.js +20 -1
- package/dist/editor/components/CopyButton.js +5 -2
- package/dist/editor/components/Editor.js +1 -3
- package/dist/editor/components/FramePersistor.d.ts +0 -2
- package/dist/editor/components/FramePersistor.js +4 -24
- package/dist/editor/components/InitialCompositionLoader.js +1 -22
- package/dist/editor/components/NewComposition/RemInput.d.ts +1 -1
- package/dist/editor/components/OpenEditorButton.js +5 -2
- package/dist/editor/components/QuickSwitcher/QuickSwitcherResult.js +3 -3
- package/dist/editor/components/RenderModal/DataEditor.js +3 -3
- package/dist/editor/components/RenderModal/RenderModal.js +5 -2
- package/dist/editor/components/RenderModal/RenderModalBasic.d.ts +2 -3
- package/dist/editor/components/RenderModal/RenderModalJSONPropsEditor.d.ts +1 -1
- package/dist/editor/components/RenderModal/RenderModalJSONPropsEditor.js +2 -2
- package/dist/editor/components/RenderModal/SchemaEditor/SchemaEditor.d.ts +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/SchemaErrorMessages.js +1 -3
- package/dist/editor/components/RenderModal/SchemaEditor/ZodSwitch.js +0 -1
- package/dist/editor/components/RenderQueue/actions.d.ts +1 -1
- package/dist/editor/components/RenderQueue/actions.js +12 -4
- package/dist/editor/components/SetTimelineInOutProvider.js +5 -4
- package/dist/editor/components/SidebarRenderButton.js +3 -1
- package/dist/editor/components/Timeline/TimelineDragHandler.js +45 -19
- package/dist/editor/components/TimelineInOutToggle.d.ts +2 -1
- package/dist/editor/components/TimelineInOutToggle.js +82 -67
- package/dist/editor/helpers/is-composition-still.d.ts +1 -1
- package/dist/editor/helpers/is-current-selected-still.js +5 -6
- package/dist/editor/icons/keys.js +1 -0
- package/dist/editor/state/in-out.d.ts +3 -2
- package/dist/editor/state/in-out.js +22 -5
- package/dist/editor/state/marks.d.ts +3 -2
- package/dist/editor/state/marks.js +6 -6
- package/dist/error-with-stack-frame.d.ts +19 -0
- package/dist/error-with-stack-frame.js +81 -0
- package/dist/get-composition-id.d.ts +2 -2
- package/dist/get-composition-id.js +7 -4
- package/dist/get-composition-with-dimension-override.d.ts +2 -2
- package/dist/get-composition-with-dimension-override.js +2 -2
- package/dist/handle-common-errors.js +4 -0
- package/dist/handle-javascript-error.d.ts +20 -0
- package/dist/handle-javascript-error.js +81 -0
- package/dist/index.d.ts +3 -3
- package/dist/log.d.ts +3 -3
- package/dist/parse-command-line.js +1 -1
- package/dist/preview-server/error-overlay/remotion-overlay/Button.js +1 -0
- package/dist/preview-server/render-queue/job.d.ts +2 -2
- package/dist/preview-server/render-queue/make-retry-payload.js +3 -2
- package/dist/preview-server/render-queue/open-directory-in-finder.js +11 -5
- package/dist/preview-server/render-queue/process-still.js +1 -1
- package/dist/preview-server/render-queue/process-video.js +1 -1
- package/dist/preview-server/routes/add-render.js +2 -2
- package/dist/preview-server/routes/update-default-props.js +2 -2
- package/dist/print-compositions.d.ts +2 -2
- package/dist/render-flows/render.d.ts +2 -2
- package/dist/render-flows/render.js +18 -7
- package/dist/render-flows/still.d.ts +2 -2
- package/dist/render-flows/still.js +12 -6
- package/dist/render.js +6 -1
- package/dist/still.js +6 -1
- package/dist/symbolicate-error.d.ts +3 -0
- package/dist/symbolicate-error.js +24 -0
- package/dist/symbolicate-errors.d.ts +7 -0
- package/dist/symbolicate-errors.js +90 -0
- package/dist/symbolicate-stacktrace.d.ts +28 -0
- package/dist/symbolicate-stacktrace.js +135 -0
- package/dist/symbolicateable-error.d.ts +16 -0
- package/dist/symbolicateable-error.js +18 -0
- package/package.json +10 -10
package/dist/benchmark.js
CHANGED
|
@@ -18,6 +18,7 @@ const setup_cache_1 = require("./setup-cache");
|
|
|
18
18
|
const should_use_non_overlaying_logger_1 = require("./should-use-non-overlaying-logger");
|
|
19
19
|
const show_compositions_picker_1 = require("./show-compositions-picker");
|
|
20
20
|
const truthy_1 = require("./truthy");
|
|
21
|
+
const remotion_1 = require("remotion");
|
|
21
22
|
const DEFAULT_RUNS = 3;
|
|
22
23
|
const getValidConcurrency = (cliConcurrency) => {
|
|
23
24
|
const { concurrencies } = parse_command_line_1.parsedCli;
|
|
@@ -125,9 +126,14 @@ const benchmarkCommand = async (remotionRoot, args) => {
|
|
|
125
126
|
});
|
|
126
127
|
(0, cleanup_before_quit_1.registerCleanupJob)(() => cleanupBundle());
|
|
127
128
|
const puppeteerInstance = await browserInstance;
|
|
129
|
+
const serializedInputPropsWithCustomSchema = remotion_1.Internals.serializeJSONWithDate({
|
|
130
|
+
data: inputProps !== null && inputProps !== void 0 ? inputProps : {},
|
|
131
|
+
indent: undefined,
|
|
132
|
+
staticBase: null,
|
|
133
|
+
}).serializedString;
|
|
128
134
|
const comps = await renderer_1.RenderInternals.internalGetCompositions({
|
|
129
135
|
serveUrlOrWebpackUrl: bundleLocation,
|
|
130
|
-
|
|
136
|
+
serializedInputPropsWithCustomSchema,
|
|
131
137
|
envVariables,
|
|
132
138
|
chromiumOptions,
|
|
133
139
|
timeoutInMilliseconds: puppeteerTimeout,
|
|
@@ -191,7 +197,7 @@ const benchmarkCommand = async (remotionRoot, args) => {
|
|
|
191
197
|
codec,
|
|
192
198
|
uiImageFormat: null,
|
|
193
199
|
}),
|
|
194
|
-
|
|
200
|
+
serializedInputPropsWithCustomSchema,
|
|
195
201
|
overwrite,
|
|
196
202
|
pixelFormat,
|
|
197
203
|
proResProfile,
|
|
@@ -223,6 +229,11 @@ const benchmarkCommand = async (remotionRoot, args) => {
|
|
|
223
229
|
onStart: () => undefined,
|
|
224
230
|
preferLossless: false,
|
|
225
231
|
server: undefined,
|
|
232
|
+
serializedResolvedPropsWithCustomSchema: remotion_1.Internals.serializeJSONWithDate({
|
|
233
|
+
data: composition.props,
|
|
234
|
+
indent: undefined,
|
|
235
|
+
staticBase: null,
|
|
236
|
+
}).serializedString,
|
|
226
237
|
}, (run, progress) => {
|
|
227
238
|
benchmarkProgress.update(makeBenchmarkProgressBar({
|
|
228
239
|
totalRuns: runs,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.stringifyDefaultProps = void 0;
|
|
4
|
-
const
|
|
4
|
+
const remotion_1 = require("remotion");
|
|
5
5
|
const doesMatchPath = (path1, enumPaths) => {
|
|
6
6
|
return enumPaths.some((p) => path1.every((item, index) => {
|
|
7
7
|
if (p[index] === '[]' && !Number.isNaN(Number(item))) {
|
|
@@ -21,8 +21,8 @@ const stringifyDefaultProps = ({ props, enumPaths, }) => JSON.stringify(props, r
|
|
|
21
21
|
if (typeof item === 'string' && doesMatchPath(path, enumPaths)) {
|
|
22
22
|
return `${item}__ADD_AS_CONST__`;
|
|
23
23
|
}
|
|
24
|
-
if (typeof item === 'string' && item.startsWith(
|
|
25
|
-
return `__REMOVEQUOTE____WRAP_IN_STATIC_FILE_START__${decodeURIComponent(item.replace(
|
|
24
|
+
if (typeof item === 'string' && item.startsWith(remotion_1.Internals.FILE_TOKEN)) {
|
|
25
|
+
return `__REMOVEQUOTE____WRAP_IN_STATIC_FILE_START__${decodeURIComponent(item.replace(remotion_1.Internals.FILE_TOKEN, ''))}__WRAP_IN_STATIC_FILE_END____REMOVEQUOTE__`;
|
|
26
26
|
}
|
|
27
27
|
return value;
|
|
28
28
|
}))
|
package/dist/compositions.js
CHANGED
|
@@ -9,6 +9,7 @@ const get_cli_options_1 = require("./get-cli-options");
|
|
|
9
9
|
const log_1 = require("./log");
|
|
10
10
|
const print_compositions_1 = require("./print-compositions");
|
|
11
11
|
const setup_cache_1 = require("./setup-cache");
|
|
12
|
+
const remotion_1 = require("remotion");
|
|
12
13
|
const listCompositionsCommand = async (remotionRoot, args) => {
|
|
13
14
|
const { file, reason } = (0, entry_point_1.findEntryPoint)(args, remotionRoot);
|
|
14
15
|
if (!file) {
|
|
@@ -44,7 +45,11 @@ const listCompositionsCommand = async (remotionRoot, args) => {
|
|
|
44
45
|
browserExecutable,
|
|
45
46
|
chromiumOptions,
|
|
46
47
|
envVariables,
|
|
47
|
-
|
|
48
|
+
serializedInputPropsWithCustomSchema: remotion_1.Internals.serializeJSONWithDate({
|
|
49
|
+
data: inputProps,
|
|
50
|
+
staticBase: null,
|
|
51
|
+
indent: undefined,
|
|
52
|
+
}).serializedString,
|
|
48
53
|
timeoutInMilliseconds: puppeteerTimeout,
|
|
49
54
|
port,
|
|
50
55
|
indent: false,
|
package/dist/config/log.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const getLogLevel: () => "
|
|
1
|
+
export declare const getLogLevel: () => "error" | "verbose" | "info" | "warn", setLogLevel: (newLogLevel: "error" | "verbose" | "info" | "warn") => void;
|
|
@@ -10,6 +10,11 @@ const Canvas_1 = require("./Canvas");
|
|
|
10
10
|
const layout_1 = require("./layout");
|
|
11
11
|
const styles_1 = require("./Menu/styles");
|
|
12
12
|
const Spinner_1 = require("./Spinner");
|
|
13
|
+
const FramePersistor_1 = require("./FramePersistor");
|
|
14
|
+
const ZoomPersistor_1 = require("./ZoomPersistor");
|
|
15
|
+
const timeline_scroll_logic_1 = require("./Timeline/timeline-scroll-logic");
|
|
16
|
+
const timeline_zoom_1 = require("../state/timeline-zoom");
|
|
17
|
+
const imperative_state_1 = require("./Timeline/imperative-state");
|
|
13
18
|
const container = {
|
|
14
19
|
color: 'white',
|
|
15
20
|
flex: 1,
|
|
@@ -22,6 +27,7 @@ const container = {
|
|
|
22
27
|
const CanvasOrLoading = () => {
|
|
23
28
|
const resolved = remotion_1.Internals.useResolvedVideoConfig(null);
|
|
24
29
|
const [takesALongTime, setTakesALongTime] = (0, react_1.useState)(false);
|
|
30
|
+
const { setZoom } = (0, react_1.useContext)(timeline_zoom_1.TimelineZoomCtx);
|
|
25
31
|
(0, react_1.useEffect)(() => {
|
|
26
32
|
const timeout = setTimeout(() => {
|
|
27
33
|
setTakesALongTime(true);
|
|
@@ -30,6 +36,19 @@ const CanvasOrLoading = () => {
|
|
|
30
36
|
clearTimeout(timeout);
|
|
31
37
|
};
|
|
32
38
|
}, []);
|
|
39
|
+
(0, react_1.useEffect)(() => {
|
|
40
|
+
if ((resolved === null || resolved === void 0 ? void 0 : resolved.type) !== 'success') {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
const c = resolved.result;
|
|
44
|
+
setTimeout(() => {
|
|
45
|
+
(0, timeline_scroll_logic_1.ensureFrameIsInViewport)({
|
|
46
|
+
direction: 'center',
|
|
47
|
+
frame: (0, imperative_state_1.getCurrentFrame)(),
|
|
48
|
+
durationInFrames: c.durationInFrames,
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
}, [resolved, setZoom]);
|
|
33
52
|
const style = (0, react_1.useMemo)(() => {
|
|
34
53
|
return {
|
|
35
54
|
...loaderLabel,
|
|
@@ -46,7 +65,7 @@ const CanvasOrLoading = () => {
|
|
|
46
65
|
if (resolved.type === 'error') {
|
|
47
66
|
return (0, jsx_runtime_1.jsx)(exports.ErrorLoading, { error: resolved.error });
|
|
48
67
|
}
|
|
49
|
-
return (0, jsx_runtime_1.jsx)(Canvas_1.Canvas, {});
|
|
68
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(FramePersistor_1.FramePersistor, {}), (0, jsx_runtime_1.jsx)(ZoomPersistor_1.ZoomPersistor, {}), (0, jsx_runtime_1.jsx)(Canvas_1.Canvas, {})] }));
|
|
50
69
|
};
|
|
51
70
|
exports.CanvasOrLoading = CanvasOrLoading;
|
|
52
71
|
const loaderLabel = {
|
|
@@ -10,7 +10,10 @@ const iconStyle = {
|
|
|
10
10
|
width: 16,
|
|
11
11
|
height: 16,
|
|
12
12
|
color: 'white',
|
|
13
|
-
|
|
13
|
+
};
|
|
14
|
+
const buttonContainerStyle = {
|
|
15
|
+
display: 'flex',
|
|
16
|
+
minWidth: '114px',
|
|
14
17
|
};
|
|
15
18
|
const copyIcon = ((0, jsx_runtime_1.jsx)("svg", { "aria-hidden": "true", focusable: "false", "data-prefix": "far", "data-icon": "clipboard", className: "svg-inline--fa fa-clipboard fa-w-12", role: "img", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 384 512", style: iconStyle, children: (0, jsx_runtime_1.jsx)("path", { fill: "currentColor", d: "M336 64h-80c0-35.3-28.7-64-64-64s-64 28.7-64 64H48C21.5 64 0 85.5 0 112v352c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V112c0-26.5-21.5-48-48-48zM192 40c13.3 0 24 10.7 24 24s-10.7 24-24 24-24-10.7-24-24 10.7-24 24-24zm144 418c0 3.3-2.7 6-6 6H54c-3.3 0-6-2.7-6-6V118c0-3.3 2.7-6 6-6h42v36c0 6.6 5.4 12 12 12h168c6.6 0 12-5.4 12-12v-36h42c3.3 0 6 2.7 6 6z" }) }));
|
|
16
19
|
const labelStyle = {
|
|
@@ -29,6 +32,6 @@ const CopyButton = ({ textToCopy, label, labelWhenCopied }) => {
|
|
|
29
32
|
const to = setTimeout(() => setCopied(false), 2000);
|
|
30
33
|
return () => clearTimeout(to);
|
|
31
34
|
}, [copied]);
|
|
32
|
-
return ((0, jsx_runtime_1.jsxs)(Button_1.Button, { onClick: onClick, children: [copyIcon, (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1.5 }), ' ', (0, jsx_runtime_1.jsx)("span", { style: labelStyle, children: copied ? labelWhenCopied : label })] }));
|
|
35
|
+
return ((0, jsx_runtime_1.jsxs)(Button_1.Button, { onClick: onClick, style: {}, buttonContainerStyle: buttonContainerStyle, children: [copyIcon, (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1.5 }), ' ', (0, jsx_runtime_1.jsx)("span", { style: labelStyle, children: copied ? labelWhenCopied : label })] }));
|
|
33
36
|
};
|
|
34
37
|
exports.CopyButton = CopyButton;
|
|
@@ -9,12 +9,10 @@ const noop_1 = require("../helpers/noop");
|
|
|
9
9
|
const timeline_zoom_1 = require("../state/timeline-zoom");
|
|
10
10
|
const z_index_1 = require("../state/z-index");
|
|
11
11
|
const EditorContent_1 = require("./EditorContent");
|
|
12
|
-
const FramePersistor_1 = require("./FramePersistor");
|
|
13
12
|
const GlobalKeybindings_1 = require("./GlobalKeybindings");
|
|
14
13
|
const Modals_1 = require("./Modals");
|
|
15
14
|
const NoRegisterRoot_1 = require("./NoRegisterRoot");
|
|
16
15
|
const NotificationCenter_1 = require("./Notifications/NotificationCenter");
|
|
17
|
-
const ZoomPersistor_1 = require("./ZoomPersistor");
|
|
18
16
|
const background = {
|
|
19
17
|
backgroundColor: colors_1.BACKGROUND,
|
|
20
18
|
display: 'flex',
|
|
@@ -41,6 +39,6 @@ const Editor = () => {
|
|
|
41
39
|
});
|
|
42
40
|
return () => cleanup();
|
|
43
41
|
}, [Root, waitForRoot]);
|
|
44
|
-
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: [
|
|
42
|
+
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, {})] }) }));
|
|
45
43
|
};
|
|
46
44
|
exports.Editor = Editor;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
export declare const getCurrentCompositionFromUrl: () => string;
|
|
3
|
-
export declare const persistCurrentFrame: (frame: number) => void;
|
|
4
|
-
export declare const getFrameForComposition: (composition: string) => number;
|
|
5
3
|
export declare const FramePersistor: React.FC;
|
|
@@ -1,41 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FramePersistor = exports.
|
|
3
|
+
exports.FramePersistor = exports.getCurrentCompositionFromUrl = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const remotion_1 = require("remotion");
|
|
6
6
|
const getCurrentCompositionFromUrl = () => {
|
|
7
7
|
return window.location.pathname.substr(1);
|
|
8
8
|
};
|
|
9
9
|
exports.getCurrentCompositionFromUrl = getCurrentCompositionFromUrl;
|
|
10
|
-
const makeKey = (composition) => {
|
|
11
|
-
return `remotion.time.${composition}`;
|
|
12
|
-
};
|
|
13
|
-
const persistCurrentFrame = (frame) => {
|
|
14
|
-
const currentComposition = (0, exports.getCurrentCompositionFromUrl)();
|
|
15
|
-
if (!currentComposition) {
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
|
-
localStorage.setItem(makeKey(currentComposition), String(frame));
|
|
19
|
-
};
|
|
20
|
-
exports.persistCurrentFrame = persistCurrentFrame;
|
|
21
|
-
const getFrameForComposition = (composition) => {
|
|
22
|
-
const frame = localStorage.getItem(makeKey(composition));
|
|
23
|
-
return frame ? Number(frame) : 0;
|
|
24
|
-
};
|
|
25
|
-
exports.getFrameForComposition = getFrameForComposition;
|
|
26
10
|
const FramePersistor = () => {
|
|
27
11
|
const [playing] = remotion_1.Internals.Timeline.usePlayingState();
|
|
12
|
+
const config = (0, remotion_1.useVideoConfig)();
|
|
28
13
|
const frame = remotion_1.Internals.Timeline.useTimelinePosition();
|
|
29
|
-
const { currentComposition } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
30
|
-
const isActive = currentComposition === (0, exports.getCurrentCompositionFromUrl)();
|
|
31
14
|
(0, react_1.useEffect)(() => {
|
|
32
|
-
if (!isActive) {
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
15
|
if (!playing) {
|
|
36
|
-
(
|
|
16
|
+
remotion_1.Internals.persistCurrentFrame(frame, config.id);
|
|
37
17
|
}
|
|
38
|
-
}, [
|
|
18
|
+
}, [config.id, frame, playing]);
|
|
39
19
|
return null;
|
|
40
20
|
};
|
|
41
21
|
exports.FramePersistor = FramePersistor;
|
|
@@ -4,37 +4,16 @@ exports.InitialCompositionLoader = exports.useSelectComposition = void 0;
|
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const remotion_1 = require("remotion");
|
|
6
6
|
const folders_1 = require("../state/folders");
|
|
7
|
-
const marks_1 = require("../state/marks");
|
|
8
|
-
const timeline_zoom_1 = require("../state/timeline-zoom");
|
|
9
7
|
const CompositionSelector_1 = require("./CompositionSelector");
|
|
10
8
|
const FramePersistor_1 = require("./FramePersistor");
|
|
11
|
-
const timeline_scroll_logic_1 = require("./Timeline/timeline-scroll-logic");
|
|
12
|
-
const TimelineInOutToggle_1 = require("./TimelineInOutToggle");
|
|
13
|
-
const ZoomPersistor_1 = require("./ZoomPersistor");
|
|
14
9
|
const useSelectComposition = () => {
|
|
15
|
-
const setCurrentFrame = remotion_1.Internals.Timeline.useTimelineSetFrame();
|
|
16
|
-
const { setCurrentComposition } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
17
10
|
const { setFoldersExpanded } = (0, react_1.useContext)(folders_1.FolderContext);
|
|
18
|
-
const {
|
|
11
|
+
const { setCurrentComposition } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
19
12
|
return (c, push) => {
|
|
20
|
-
var _a;
|
|
21
|
-
(_a = TimelineInOutToggle_1.inOutHandles.current) === null || _a === void 0 ? void 0 : _a.setMarks((0, marks_1.loadMarks)(c.id, c.durationInFrames));
|
|
22
13
|
if (push) {
|
|
23
14
|
window.history.pushState({}, 'Studio', `/${c.id}`);
|
|
24
15
|
}
|
|
25
|
-
const frame = (0, FramePersistor_1.getFrameForComposition)(c.id);
|
|
26
|
-
const zoom = (0, ZoomPersistor_1.getZoomForComposition)(c.id);
|
|
27
|
-
const frameInBounds = Math.min(c.durationInFrames - 1, frame);
|
|
28
|
-
setCurrentFrame(frameInBounds);
|
|
29
16
|
setCurrentComposition(c.id);
|
|
30
|
-
setZoom(() => zoom);
|
|
31
|
-
setTimeout(() => {
|
|
32
|
-
(0, timeline_scroll_logic_1.ensureFrameIsInViewport)({
|
|
33
|
-
direction: 'center',
|
|
34
|
-
frame,
|
|
35
|
-
durationInFrames: c.durationInFrames,
|
|
36
|
-
});
|
|
37
|
-
});
|
|
38
17
|
const { folderName, parentFolderName } = c;
|
|
39
18
|
if (folderName !== null) {
|
|
40
19
|
setFoldersExpanded((ex) => {
|
|
@@ -12,6 +12,6 @@ export declare const getInputBorderColor: ({ status, isFocused, isHovered, }: {
|
|
|
12
12
|
status: 'error' | 'warning' | 'ok';
|
|
13
13
|
isFocused: boolean;
|
|
14
14
|
isHovered: boolean;
|
|
15
|
-
}) => "hsla(0, 0%, 100%, 0.15)" | "rgba(
|
|
15
|
+
}) => "hsla(0, 0%, 100%, 0.15)" | "rgba(0, 0, 0, 0.6)" | "rgba(255, 255, 255, 0.05)" | "#ff3232" | "#f1c40f";
|
|
16
16
|
export declare const RemotionInput: React.ForwardRefExoticComponent<Pick<Props, "key" | keyof React.InputHTMLAttributes<HTMLInputElement> | "status" | "rightAlign"> & React.RefAttributes<HTMLInputElement>>;
|
|
17
17
|
export {};
|
|
@@ -12,8 +12,11 @@ const svgStyle = {
|
|
|
12
12
|
};
|
|
13
13
|
const buttonStyle = {
|
|
14
14
|
border: 'none',
|
|
15
|
-
width: '
|
|
16
|
-
height: '
|
|
15
|
+
width: '20px',
|
|
16
|
+
height: '20px',
|
|
17
|
+
display: 'flex',
|
|
18
|
+
justifyContent: 'center',
|
|
19
|
+
alignItems: 'center',
|
|
17
20
|
};
|
|
18
21
|
const OpenEditorButton = () => {
|
|
19
22
|
const [hovered, setHovered] = (0, react_1.useState)(false);
|
|
@@ -98,14 +98,14 @@ const QuickSwitcherResult = ({ result, selected }) => {
|
|
|
98
98
|
fontSize: 15,
|
|
99
99
|
};
|
|
100
100
|
}, [hovered, result.type, selected]);
|
|
101
|
-
return ((0, jsx_runtime_1.jsxs)("div", { ref: ref, style: style, onClick: result.onSelected, children: [result.type === 'composition' ? (result.compositionType === 'still' ? ((0, jsx_runtime_1.jsx)(still_1.StillIcon, { color: selected ? 'white' : colors_1.LIGHT_TEXT, style: iconStyle })) : ((0, jsx_runtime_1.jsx)(video_1.FilmIcon, { color: selected ? 'white' : colors_1.LIGHT_TEXT, style: iconStyle }))) : null, (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1 }), (0, jsx_runtime_1.jsx)("div", { style: labelContainer, children: result.type === 'search-result' ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", {
|
|
101
|
+
return ((0, jsx_runtime_1.jsxs)("div", { ref: ref, style: style, onClick: result.onSelected, children: [result.type === 'composition' ? (result.compositionType === 'still' ? ((0, jsx_runtime_1.jsx)(still_1.StillIcon, { color: selected ? 'white' : colors_1.LIGHT_TEXT, style: iconStyle })) : ((0, jsx_runtime_1.jsx)(video_1.FilmIcon, { color: selected ? 'white' : colors_1.LIGHT_TEXT, style: iconStyle }))) : null, (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1 }), (0, jsx_runtime_1.jsx)("div", { style: labelContainer, children: result.type === 'search-result' ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", {
|
|
102
102
|
// eslint-disable-next-line react/no-danger
|
|
103
103
|
dangerouslySetInnerHTML: {
|
|
104
104
|
__html: result.titleLine,
|
|
105
|
-
} }), (0, jsx_runtime_1.jsx)("div", {
|
|
105
|
+
}, style: labelStyle }), (0, jsx_runtime_1.jsx)("div", {
|
|
106
106
|
// eslint-disable-next-line react/no-danger
|
|
107
107
|
dangerouslySetInnerHTML: {
|
|
108
108
|
__html: result.subtitleLine,
|
|
109
|
-
} })] })) : ((0, jsx_runtime_1.jsx)("div", { style: labelStyle, children: result.title })) })] }, result.id));
|
|
109
|
+
}, style: labelStyle })] })) : ((0, jsx_runtime_1.jsx)("div", { style: labelStyle, children: result.title })) })] }, result.id));
|
|
110
110
|
};
|
|
111
111
|
exports.QuickSwitcherResult = QuickSwitcherResult;
|
|
@@ -39,7 +39,6 @@ const SegmentedControl_1 = require("../SegmentedControl");
|
|
|
39
39
|
const get_render_modal_warnings_1 = require("./get-render-modal-warnings");
|
|
40
40
|
const RenderModalJSONPropsEditor_1 = require("./RenderModalJSONPropsEditor");
|
|
41
41
|
const extract_enum_json_paths_1 = require("./SchemaEditor/extract-enum-json-paths");
|
|
42
|
-
const input_props_serialization_1 = require("./SchemaEditor/input-props-serialization");
|
|
43
42
|
const SchemaEditor_1 = require("./SchemaEditor/SchemaEditor");
|
|
44
43
|
const SchemaErrorMessages_1 = require("./SchemaEditor/SchemaErrorMessages");
|
|
45
44
|
const WarningIndicatorButton_1 = require("./WarningIndicatorButton");
|
|
@@ -99,7 +98,7 @@ const DataEditor = ({ unresolvedComposition, inputProps, setInputProps, mayShowS
|
|
|
99
98
|
return null;
|
|
100
99
|
}
|
|
101
100
|
const value = inputProps;
|
|
102
|
-
return
|
|
101
|
+
return remotion_1.Internals.serializeJSONWithDate({
|
|
103
102
|
data: value,
|
|
104
103
|
indent: 2,
|
|
105
104
|
staticBase: window.remotion_staticBase,
|
|
@@ -226,12 +225,13 @@ const DataEditor = ({ unresolvedComposition, inputProps, setInputProps, mayShowS
|
|
|
226
225
|
setSaving(false);
|
|
227
226
|
}, [fastRefreshes]);
|
|
228
227
|
const onSave = (0, react_1.useCallback)((updater) => {
|
|
228
|
+
var _a;
|
|
229
229
|
if (schema === 'no-zod' || schema === 'no-schema' || z === null) {
|
|
230
230
|
(0, NotificationCenter_1.sendErrorNotification)('Cannot update default props: No Zod schema');
|
|
231
231
|
return;
|
|
232
232
|
}
|
|
233
233
|
setSaving(true);
|
|
234
|
-
(0, actions_1.updateDefaultProps)(unresolvedComposition.id, updater(unresolvedComposition.defaultProps), (0, extract_enum_json_paths_1.extractEnumJsonPaths)(schema, z, []))
|
|
234
|
+
(0, actions_1.updateDefaultProps)(unresolvedComposition.id, updater((_a = unresolvedComposition.defaultProps) !== null && _a !== void 0 ? _a : {}), (0, extract_enum_json_paths_1.extractEnumJsonPaths)(schema, z, []))
|
|
235
235
|
.then((response) => {
|
|
236
236
|
if (!response.success) {
|
|
237
237
|
console.log(response.stack);
|
|
@@ -567,7 +567,7 @@ const RenderModal = ({ initialFrame, initialVideoImageFormat, initialStillImageF
|
|
|
567
567
|
}
|
|
568
568
|
}, [onClickStill, onClickVideo, renderDisabled, renderMode]);
|
|
569
569
|
(0, react_1.useEffect)(() => {
|
|
570
|
-
registerKeybinding({
|
|
570
|
+
const enter = registerKeybinding({
|
|
571
571
|
callback() {
|
|
572
572
|
trigger();
|
|
573
573
|
},
|
|
@@ -575,8 +575,11 @@ const RenderModal = ({ initialFrame, initialVideoImageFormat, initialStillImageF
|
|
|
575
575
|
key: 'Enter',
|
|
576
576
|
event: 'keydown',
|
|
577
577
|
preventDefault: true,
|
|
578
|
-
triggerIfInputFieldFocused:
|
|
578
|
+
triggerIfInputFieldFocused: true,
|
|
579
579
|
});
|
|
580
|
+
return () => {
|
|
581
|
+
enter.unregister();
|
|
582
|
+
};
|
|
580
583
|
}, [registerKeybinding, trigger]);
|
|
581
584
|
return ((0, jsx_runtime_1.jsxs)("div", { style: outer, children: [(0, jsx_runtime_1.jsx)(ModalHeader_1.NewCompHeader, { title: `Render ${resolvedComposition.id}` }), (0, jsx_runtime_1.jsxs)("div", { style: container, children: [(0, jsx_runtime_1.jsx)(SegmentedControl_1.SegmentedControl, { items: renderTabOptions, needsWrapping: false }), (0, jsx_runtime_1.jsx)("div", { style: flexer }), (0, jsx_runtime_1.jsxs)(Button_1.Button, { autoFocus: true, onClick: trigger, disabled: renderDisabled, style: {
|
|
582
585
|
...buttonStyle,
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import type { Codec, ProResProfile } from '@remotion/renderer';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import type { TCompMetadata } from 'remotion';
|
|
4
|
-
import type { AnyZodObject } from 'zod';
|
|
5
3
|
import type { SegmentedControlItem } from '../SegmentedControl';
|
|
6
4
|
import type { RenderType } from './RenderModalAdvanced';
|
|
5
|
+
import type { VideoConfig } from 'remotion';
|
|
7
6
|
export declare const RenderModalBasic: React.FC<{
|
|
8
7
|
renderMode: RenderType;
|
|
9
8
|
imageFormatOptions: SegmentedControlItem[];
|
|
@@ -14,7 +13,7 @@ export declare const RenderModalBasic: React.FC<{
|
|
|
14
13
|
setProResProfile: React.Dispatch<React.SetStateAction<ProResProfile>>;
|
|
15
14
|
frame: number;
|
|
16
15
|
setFrame: React.Dispatch<React.SetStateAction<number>>;
|
|
17
|
-
resolvedComposition:
|
|
16
|
+
resolvedComposition: VideoConfig;
|
|
18
17
|
setOutName: (value: React.SetStateAction<string>) => void;
|
|
19
18
|
setEndFrame: React.Dispatch<React.SetStateAction<number | null>>;
|
|
20
19
|
startFrame: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { z } from 'zod';
|
|
3
|
-
import type { SerializedJSONWithCustomFields } from '
|
|
3
|
+
import type { SerializedJSONWithCustomFields } from 'remotion';
|
|
4
4
|
export type EditType = 'inputProps' | 'defaultProps';
|
|
5
5
|
export declare const RenderModalJSONPropsEditor: React.FC<{
|
|
6
6
|
value: unknown;
|
|
@@ -32,8 +32,8 @@ const use_keybinding_1 = require("../../helpers/use-keybinding");
|
|
|
32
32
|
const layout_1 = require("../layout");
|
|
33
33
|
const RemTextarea_1 = require("../NewComposition/RemTextarea");
|
|
34
34
|
const ValidationMessage_1 = require("../NewComposition/ValidationMessage");
|
|
35
|
-
const input_props_serialization_1 = require("./SchemaEditor/input-props-serialization");
|
|
36
35
|
const ZodErrorMessages_1 = require("./SchemaEditor/ZodErrorMessages");
|
|
36
|
+
const remotion_1 = require("remotion");
|
|
37
37
|
const style = {
|
|
38
38
|
fontFamily: 'monospace',
|
|
39
39
|
flex: 1,
|
|
@@ -46,7 +46,7 @@ const scrollable = {
|
|
|
46
46
|
};
|
|
47
47
|
const parseJSON = (str, schema) => {
|
|
48
48
|
try {
|
|
49
|
-
const value =
|
|
49
|
+
const value = remotion_1.Internals.deserializeJSONWithCustomFields(str);
|
|
50
50
|
const zodValidation = schema.safeParse(value);
|
|
51
51
|
return { str, value, validJSON: true, zodValidation };
|
|
52
52
|
}
|
|
@@ -6,7 +6,7 @@ export declare const SchemaEditor: React.FC<{
|
|
|
6
6
|
setValue: React.Dispatch<React.SetStateAction<Record<string, unknown>>>;
|
|
7
7
|
zodValidationResult: z.SafeParseReturnType<unknown, unknown>;
|
|
8
8
|
defaultProps: Record<string, unknown>;
|
|
9
|
-
onSave: (updater: (oldState: unknown) => unknown) => void;
|
|
9
|
+
onSave: (updater: (oldState: Record<string, unknown>) => Record<string, unknown>) => void;
|
|
10
10
|
showSaveButton: boolean;
|
|
11
11
|
saving: boolean;
|
|
12
12
|
saveDisabledByParent: boolean;
|
|
@@ -32,9 +32,7 @@ const errorContainer = {
|
|
|
32
32
|
overflowY: 'auto',
|
|
33
33
|
};
|
|
34
34
|
const openDocs = () => {
|
|
35
|
-
window.open(
|
|
36
|
-
// TODO: Make sure to update this link when we release v4
|
|
37
|
-
'https://v4.remotion.dev/docs/parametrized-rendering#define-a-schema-');
|
|
35
|
+
window.open('https://www.remotion.dev/docs/parameterized-rendering#define-a-schema-');
|
|
38
36
|
};
|
|
39
37
|
const ZodNotInstalled = () => {
|
|
40
38
|
return ((0, jsx_runtime_1.jsxs)("div", { style: explainer, children: [(0, jsx_runtime_1.jsxs)("div", { style: errorExplanation, children: ["Install ", (0, jsx_runtime_1.jsx)("code", { style: styles_1.inlineCodeSnippet, children: "zod" }), " as a dependency to interactively control the props of the composition."] }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 2, block: true }), (0, jsx_runtime_1.jsx)(Button_1.Button, { onClick: openDocs, children: "Learn how" })] }));
|
|
@@ -27,7 +27,6 @@ const ZodSwitch = ({ schema, jsonPath, value, setValue, defaultValue, onSave, sh
|
|
|
27
27
|
throw new Error('expected zod');
|
|
28
28
|
}
|
|
29
29
|
const zodTypes = (0, get_zod_if_possible_1.useZodTypesIfPossible)();
|
|
30
|
-
// TODO: (Maybe?) enable saving of inserted input props by cmd+s /ctrl + s (also for JSON view)
|
|
31
30
|
if (typeName === z.ZodFirstPartyTypeKind.ZodObject) {
|
|
32
31
|
return ((0, jsx_runtime_1.jsx)(ZodObjectEditor_1.ZodObjectEditor, { setValue: setValue, value: value, defaultValue: defaultValue, jsonPath: jsonPath, schema: schema, onSave: onSave, showSaveButton: showSaveButton, onRemove: onRemove, saving: saving, saveDisabledByParent: saveDisabledByParent, mayPad: mayPad }));
|
|
33
32
|
}
|
|
@@ -56,5 +56,5 @@ export declare const openInFileExplorer: ({ directory }: {
|
|
|
56
56
|
export declare const removeRenderJob: (job: RenderJob) => Promise<undefined>;
|
|
57
57
|
export declare const cancelRenderJob: (job: RenderJob) => Promise<import("../../../preview-server/render-queue/job").CancelRenderResponse>;
|
|
58
58
|
export declare const updateAvailable: (signal: AbortSignal) => Promise<import("../../../preview-server/render-queue/job").UpdateAvailableResponse>;
|
|
59
|
-
export declare const updateDefaultProps: (compositionId: string, defaultProps:
|
|
59
|
+
export declare const updateDefaultProps: (compositionId: string, defaultProps: Record<string, unknown>, enumPaths: EnumPath[]) => Promise<import("../../../preview-server/render-queue/job").UpdateDefaultPropsResponse>;
|
|
60
60
|
export declare const canUpdateDefaultProps: (compositionId: string) => Promise<import("../../../preview-server/render-queue/job").CanUpdateDefaultPropsResponse>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.canUpdateDefaultProps = exports.updateDefaultProps = exports.updateAvailable = exports.cancelRenderJob = exports.removeRenderJob = exports.openInFileExplorer = exports.subscribeToFileExistenceWatcher = exports.unsubscribeFromFileExistenceWatcher = exports.addVideoRenderJob = exports.addStillRenderJob = void 0;
|
|
4
|
-
const
|
|
4
|
+
const remotion_1 = require("remotion");
|
|
5
5
|
const callApi = (endpoint, body, signal) => {
|
|
6
6
|
return new Promise((resolve, reject) => {
|
|
7
7
|
fetch(endpoint, {
|
|
@@ -39,7 +39,11 @@ const addStillRenderJob = ({ compositionId, outName, imageFormat, jpegQuality, f
|
|
|
39
39
|
chromiumOptions,
|
|
40
40
|
delayRenderTimeout,
|
|
41
41
|
envVariables,
|
|
42
|
-
|
|
42
|
+
serializedInputPropsWithCustomSchema: remotion_1.Internals.serializeJSONWithDate({
|
|
43
|
+
data: inputProps,
|
|
44
|
+
staticBase: window.remotion_staticBase,
|
|
45
|
+
indent: undefined,
|
|
46
|
+
}).serializedString,
|
|
43
47
|
});
|
|
44
48
|
};
|
|
45
49
|
exports.addStillRenderJob = addStillRenderJob;
|
|
@@ -70,7 +74,11 @@ const addVideoRenderJob = ({ compositionId, outName, imageFormat, jpegQuality, s
|
|
|
70
74
|
disallowParallelEncoding,
|
|
71
75
|
chromiumOptions,
|
|
72
76
|
envVariables,
|
|
73
|
-
|
|
77
|
+
serializedInputPropsWithCustomSchema: remotion_1.Internals.serializeJSONWithDate({
|
|
78
|
+
data: inputProps,
|
|
79
|
+
staticBase: window.remotion_staticBase,
|
|
80
|
+
indent: undefined,
|
|
81
|
+
}).serializedString,
|
|
74
82
|
});
|
|
75
83
|
};
|
|
76
84
|
exports.addVideoRenderJob = addVideoRenderJob;
|
|
@@ -112,7 +120,7 @@ exports.updateAvailable = updateAvailable;
|
|
|
112
120
|
const updateDefaultProps = (compositionId, defaultProps, enumPaths) => {
|
|
113
121
|
return callApi('/api/update-default-props', {
|
|
114
122
|
compositionId,
|
|
115
|
-
defaultProps:
|
|
123
|
+
defaultProps: remotion_1.Internals.serializeJSONWithDate({
|
|
116
124
|
data: defaultProps,
|
|
117
125
|
indent: undefined,
|
|
118
126
|
staticBase: window.remotion_staticBase,
|
|
@@ -4,16 +4,17 @@ exports.SetTimelineInOutProvider = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const in_out_1 = require("../state/in-out");
|
|
7
|
+
const marks_1 = require("../state/marks");
|
|
7
8
|
const SetTimelineInOutProvider = ({ children }) => {
|
|
8
|
-
const [inAndOutFrames, setInAndOutFrames] = (0, react_1.useState)(
|
|
9
|
-
inFrame: null,
|
|
10
|
-
outFrame: null,
|
|
11
|
-
});
|
|
9
|
+
const [inAndOutFrames, setInAndOutFrames] = (0, react_1.useState)(() => (0, marks_1.loadMarks)());
|
|
12
10
|
const setTimelineInOutContextValue = (0, react_1.useMemo)(() => {
|
|
13
11
|
return {
|
|
14
12
|
setInAndOutFrames,
|
|
15
13
|
};
|
|
16
14
|
}, []);
|
|
15
|
+
(0, react_1.useEffect)(() => {
|
|
16
|
+
(0, marks_1.persistMarks)(inAndOutFrames);
|
|
17
|
+
}, [inAndOutFrames]);
|
|
17
18
|
return ((0, jsx_runtime_1.jsx)(in_out_1.TimelineInOutContext.Provider, { value: inAndOutFrames, children: (0, jsx_runtime_1.jsx)(in_out_1.SetTimelineInOutContext.Provider, { value: setTimelineInOutContextValue, children: children }) }));
|
|
18
19
|
};
|
|
19
20
|
exports.SetTimelineInOutProvider = SetTimelineInOutProvider;
|
|
@@ -22,7 +22,9 @@ const SidebarRenderButton = ({ composition, visible }) => {
|
|
|
22
22
|
}, []);
|
|
23
23
|
const connectionStatus = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx).type;
|
|
24
24
|
const { props } = (0, react_1.useContext)(remotion_1.Internals.EditorPropsContext);
|
|
25
|
-
const isVideo = composition.durationInFrames
|
|
25
|
+
const isVideo = typeof composition.durationInFrames === 'undefined'
|
|
26
|
+
? true
|
|
27
|
+
: composition.durationInFrames > 1;
|
|
26
28
|
const onClick = (0, react_1.useCallback)((e) => {
|
|
27
29
|
var _a;
|
|
28
30
|
const defaults = window.remotion_renderDefaults;
|