@remotion/cli 4.1.0-alpha4 → 4.1.0-alpha7
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/chalk/index.d.ts +2 -1
- package/dist/config/image-format.d.ts +1 -1
- package/dist/config/index.d.ts +1 -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/NewComposition/RemInputTypeColor.d.ts +1 -1
- package/dist/editor/components/NewComposition/RemTextarea.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/RenderModal.js +5 -2
- package/dist/editor/components/RenderModal/RenderModalBasic.d.ts +2 -3
- package/dist/editor/components/RenderModal/SchemaEditor/SchemaErrorMessages.js +1 -3
- package/dist/editor/components/RenderModal/SchemaEditor/ZodSwitch.js +0 -1
- package/dist/editor/components/RenderModal/SchemaEditor/local-state.js +9 -3
- package/dist/editor/components/RenderModal/human-readable-codec.d.ts +1 -1
- 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/colors.d.ts +1 -1
- 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/get-cli-options.d.ts +2 -2
- package/dist/get-composition-id.d.ts +2 -2
- package/dist/get-composition-id.js +5 -1
- package/dist/get-composition-with-dimension-override.d.ts +2 -2
- package/dist/handle-common-errors.js +8 -0
- package/dist/index.d.ts +16 -15
- package/dist/log.d.ts +3 -3
- package/dist/parse-command-line.js +1 -1
- package/dist/preview-server/dev-middleware/setup-hooks.js +1 -1
- package/dist/preview-server/error-overlay/remotion-overlay/Button.js +1 -0
- package/dist/preview-server/render-queue/open-directory-in-finder.js +11 -5
- package/dist/print-compositions.d.ts +2 -2
- package/package.json +10 -10
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TimelineInOutPointToggle = exports.inOutHandles = void 0;
|
|
3
|
+
exports.TimelineInOutPointToggle = exports.defaultInOutValue = exports.inOutHandles = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const remotion_1 = require("remotion");
|
|
@@ -10,7 +10,6 @@ const is_current_selected_still_1 = require("../helpers/is-current-selected-stil
|
|
|
10
10
|
const use_keybinding_1 = require("../helpers/use-keybinding");
|
|
11
11
|
const timelineInOutPointer_1 = require("../icons/timelineInOutPointer");
|
|
12
12
|
const in_out_1 = require("../state/in-out");
|
|
13
|
-
const marks_1 = require("../state/marks");
|
|
14
13
|
const ControlButton_1 = require("./ControlButton");
|
|
15
14
|
const getTooltipText = (pointType, key) => [
|
|
16
15
|
`Mark ${pointType}`,
|
|
@@ -24,19 +23,22 @@ const style = {
|
|
|
24
23
|
height: 16,
|
|
25
24
|
};
|
|
26
25
|
exports.inOutHandles = (0, react_1.createRef)();
|
|
26
|
+
exports.defaultInOutValue = { inFrame: null, outFrame: null };
|
|
27
27
|
const TimelineInOutPointToggle = () => {
|
|
28
28
|
const timelinePosition = remotion_1.Internals.Timeline.useTimelinePosition();
|
|
29
29
|
const { inFrame, outFrame } = (0, in_out_1.useTimelineInOutFramePosition)();
|
|
30
30
|
const { setInAndOutFrames } = (0, in_out_1.useTimelineSetInOutFramePosition)();
|
|
31
|
-
const { currentComposition } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
32
31
|
const isStill = (0, is_current_selected_still_1.useIsStill)();
|
|
33
32
|
const videoConfig = remotion_1.Internals.useUnsafeVideoConfig();
|
|
34
33
|
const keybindings = (0, use_keybinding_1.useKeybinding)();
|
|
35
|
-
const onInOutClear = (0, react_1.useCallback)(() => {
|
|
36
|
-
setInAndOutFrames(() => {
|
|
34
|
+
const onInOutClear = (0, react_1.useCallback)((composition) => {
|
|
35
|
+
setInAndOutFrames((prev) => {
|
|
37
36
|
return {
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
...prev,
|
|
38
|
+
[composition]: {
|
|
39
|
+
inFrame: null,
|
|
40
|
+
outFrame: null,
|
|
41
|
+
},
|
|
40
42
|
};
|
|
41
43
|
});
|
|
42
44
|
}, [setInAndOutFrames]);
|
|
@@ -45,35 +47,51 @@ const TimelineInOutPointToggle = () => {
|
|
|
45
47
|
return null;
|
|
46
48
|
}
|
|
47
49
|
if (e === null || e === void 0 ? void 0 : e.shiftKey) {
|
|
48
|
-
setInAndOutFrames((
|
|
50
|
+
setInAndOutFrames((prev) => {
|
|
51
|
+
var _a;
|
|
49
52
|
return {
|
|
50
|
-
...
|
|
51
|
-
|
|
53
|
+
...prev,
|
|
54
|
+
[videoConfig.id]: {
|
|
55
|
+
...((_a = prev[videoConfig.id]) !== null && _a !== void 0 ? _a : exports.defaultInOutValue),
|
|
56
|
+
inFrame: null,
|
|
57
|
+
},
|
|
52
58
|
};
|
|
53
59
|
});
|
|
54
60
|
return null;
|
|
55
61
|
}
|
|
56
62
|
setInAndOutFrames((prev) => {
|
|
57
|
-
|
|
63
|
+
var _a, _b, _c, _d, _e;
|
|
64
|
+
const prevOut = (_a = prev[videoConfig.id]) === null || _a === void 0 ? void 0 : _a.outFrame;
|
|
65
|
+
const biggestPossible = prevOut === undefined || prevOut === null ? Infinity : prevOut - 1;
|
|
58
66
|
const selected = Math.min(timelinePosition, biggestPossible);
|
|
59
67
|
if (selected === 0) {
|
|
60
68
|
return {
|
|
61
69
|
...prev,
|
|
62
|
-
|
|
70
|
+
[videoConfig.id]: {
|
|
71
|
+
...((_b = prev[videoConfig.id]) !== null && _b !== void 0 ? _b : exports.defaultInOutValue),
|
|
72
|
+
inFrame: null,
|
|
73
|
+
},
|
|
63
74
|
};
|
|
64
75
|
}
|
|
65
|
-
|
|
76
|
+
const prevIn = (_c = prev[videoConfig.id]) === null || _c === void 0 ? void 0 : _c.inFrame;
|
|
77
|
+
if (prevIn !== null && prevIn !== undefined) {
|
|
66
78
|
// Disable if already at this position
|
|
67
|
-
if (
|
|
79
|
+
if (prevIn === selected) {
|
|
68
80
|
return {
|
|
69
81
|
...prev,
|
|
70
|
-
|
|
82
|
+
[videoConfig.id]: {
|
|
83
|
+
...((_d = prev[videoConfig.id]) !== null && _d !== void 0 ? _d : exports.defaultInOutValue),
|
|
84
|
+
inFrame: null,
|
|
85
|
+
},
|
|
71
86
|
};
|
|
72
87
|
}
|
|
73
88
|
}
|
|
74
89
|
return {
|
|
75
90
|
...prev,
|
|
76
|
-
|
|
91
|
+
[videoConfig.id]: {
|
|
92
|
+
...((_e = prev[videoConfig.id]) !== null && _e !== void 0 ? _e : exports.defaultInOutValue),
|
|
93
|
+
inFrame: selected,
|
|
94
|
+
},
|
|
77
95
|
};
|
|
78
96
|
});
|
|
79
97
|
}, [setInAndOutFrames, timelinePosition, videoConfig]);
|
|
@@ -83,9 +101,13 @@ const TimelineInOutPointToggle = () => {
|
|
|
83
101
|
}
|
|
84
102
|
e.preventDefault();
|
|
85
103
|
setInAndOutFrames((f) => {
|
|
104
|
+
var _a;
|
|
86
105
|
return {
|
|
87
106
|
...f,
|
|
88
|
-
|
|
107
|
+
[videoConfig.id]: {
|
|
108
|
+
...((_a = f[videoConfig.id]) !== null && _a !== void 0 ? _a : exports.defaultInOutValue),
|
|
109
|
+
inFrame: null,
|
|
110
|
+
},
|
|
89
111
|
};
|
|
90
112
|
});
|
|
91
113
|
}, [setInAndOutFrames, videoConfig]);
|
|
@@ -95,9 +117,13 @@ const TimelineInOutPointToggle = () => {
|
|
|
95
117
|
}
|
|
96
118
|
e === null || e === void 0 ? void 0 : e.preventDefault();
|
|
97
119
|
setInAndOutFrames((f) => {
|
|
120
|
+
var _a;
|
|
98
121
|
return {
|
|
99
122
|
...f,
|
|
100
|
-
|
|
123
|
+
[videoConfig.id]: {
|
|
124
|
+
...((_a = f[videoConfig.id]) !== null && _a !== void 0 ? _a : exports.defaultInOutValue),
|
|
125
|
+
outFrame: null,
|
|
126
|
+
},
|
|
101
127
|
};
|
|
102
128
|
});
|
|
103
129
|
}, [setInAndOutFrames, videoConfig]);
|
|
@@ -107,37 +133,59 @@ const TimelineInOutPointToggle = () => {
|
|
|
107
133
|
}
|
|
108
134
|
if (e === null || e === void 0 ? void 0 : e.shiftKey) {
|
|
109
135
|
setInAndOutFrames((f) => {
|
|
136
|
+
var _a;
|
|
110
137
|
return {
|
|
111
138
|
...f,
|
|
112
|
-
|
|
139
|
+
[videoConfig.id]: {
|
|
140
|
+
...((_a = f[videoConfig.id]) !== null && _a !== void 0 ? _a : exports.defaultInOutValue),
|
|
141
|
+
outFrame: null,
|
|
142
|
+
},
|
|
113
143
|
};
|
|
114
144
|
});
|
|
115
145
|
return;
|
|
116
146
|
}
|
|
117
147
|
setInAndOutFrames((prev) => {
|
|
118
|
-
|
|
148
|
+
var _a, _b, _c, _d, _e;
|
|
149
|
+
const prevInFrame = (_a = prev[videoConfig.id]) === null || _a === void 0 ? void 0 : _a.inFrame;
|
|
150
|
+
const smallestPossible = prevInFrame === null || prevInFrame === undefined
|
|
151
|
+
? -Infinity
|
|
152
|
+
: prevInFrame + 1;
|
|
119
153
|
const selected = Math.max(timelinePosition, smallestPossible);
|
|
120
154
|
if (selected === videoConfig.durationInFrames - 1) {
|
|
121
155
|
return {
|
|
122
156
|
...prev,
|
|
123
|
-
|
|
157
|
+
[videoConfig.id]: {
|
|
158
|
+
...((_b = prev[videoConfig.id]) !== null && _b !== void 0 ? _b : exports.defaultInOutValue),
|
|
159
|
+
outFrame: null,
|
|
160
|
+
},
|
|
124
161
|
};
|
|
125
162
|
}
|
|
126
|
-
|
|
127
|
-
|
|
163
|
+
const prevOut = (_c = prev[videoConfig.id]) === null || _c === void 0 ? void 0 : _c.outFrame;
|
|
164
|
+
if (prevOut !== null && prevOut !== undefined) {
|
|
165
|
+
if (prevOut === selected) {
|
|
128
166
|
return {
|
|
129
167
|
...prev,
|
|
130
|
-
|
|
168
|
+
[videoConfig.id]: {
|
|
169
|
+
...((_d = prev[videoConfig.id]) !== null && _d !== void 0 ? _d : exports.defaultInOutValue),
|
|
170
|
+
outFrame: null,
|
|
171
|
+
},
|
|
131
172
|
};
|
|
132
173
|
}
|
|
133
174
|
}
|
|
134
175
|
return {
|
|
135
176
|
...prev,
|
|
136
|
-
|
|
177
|
+
[videoConfig.id]: {
|
|
178
|
+
...((_e = prev[videoConfig.id]) !== null && _e !== void 0 ? _e : exports.defaultInOutValue),
|
|
179
|
+
outFrame: selected,
|
|
180
|
+
},
|
|
137
181
|
};
|
|
138
182
|
});
|
|
139
183
|
}, [setInAndOutFrames, timelinePosition, videoConfig]);
|
|
184
|
+
const confId = videoConfig === null || videoConfig === void 0 ? void 0 : videoConfig.id;
|
|
140
185
|
(0, react_1.useEffect)(() => {
|
|
186
|
+
if (!confId) {
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
141
189
|
const iKey = keybindings.registerKeybinding({
|
|
142
190
|
event: 'keypress',
|
|
143
191
|
key: 'i',
|
|
@@ -162,7 +210,7 @@ const TimelineInOutPointToggle = () => {
|
|
|
162
210
|
event: 'keypress',
|
|
163
211
|
key: 'x',
|
|
164
212
|
callback: () => {
|
|
165
|
-
onInOutClear();
|
|
213
|
+
onInOutClear(confId);
|
|
166
214
|
},
|
|
167
215
|
commandCtrlKey: false,
|
|
168
216
|
preventDefault: true,
|
|
@@ -173,52 +221,19 @@ const TimelineInOutPointToggle = () => {
|
|
|
173
221
|
iKey.unregister();
|
|
174
222
|
xKey.unregister();
|
|
175
223
|
};
|
|
176
|
-
}, [keybindings, onInMark, onInOutClear, onOutMark]);
|
|
177
|
-
(0, react_1.useEffect)(() => {
|
|
178
|
-
if (!currentComposition || !videoConfig) {
|
|
179
|
-
return;
|
|
180
|
-
}
|
|
181
|
-
(0, marks_1.persistMarks)(currentComposition, videoConfig.durationInFrames, [
|
|
182
|
-
inFrame,
|
|
183
|
-
outFrame,
|
|
184
|
-
]);
|
|
185
|
-
}, [currentComposition, inFrame, outFrame, videoConfig]);
|
|
186
|
-
// If duration changes and it goes out of range, we reset
|
|
187
|
-
(0, react_1.useEffect)(() => {
|
|
188
|
-
if (outFrame === null) {
|
|
189
|
-
return;
|
|
190
|
-
}
|
|
191
|
-
if (!videoConfig) {
|
|
192
|
-
return;
|
|
193
|
-
}
|
|
194
|
-
if (outFrame >= videoConfig.durationInFrames - 1) {
|
|
195
|
-
onInOutClear();
|
|
196
|
-
}
|
|
197
|
-
}, [onInOutClear, outFrame, videoConfig]);
|
|
198
|
-
(0, react_1.useEffect)(() => {
|
|
199
|
-
if (inFrame === null) {
|
|
200
|
-
return;
|
|
201
|
-
}
|
|
202
|
-
if (!videoConfig) {
|
|
203
|
-
return;
|
|
204
|
-
}
|
|
205
|
-
if (inFrame >= videoConfig.durationInFrames - 1) {
|
|
206
|
-
onInOutClear();
|
|
207
|
-
}
|
|
208
|
-
}, [onInOutClear, inFrame, videoConfig]);
|
|
224
|
+
}, [confId, keybindings, onInMark, onInOutClear, onOutMark]);
|
|
209
225
|
(0, react_1.useImperativeHandle)(exports.inOutHandles, () => {
|
|
210
226
|
return {
|
|
211
|
-
clearMarks:
|
|
227
|
+
clearMarks: () => {
|
|
228
|
+
if (!confId) {
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
onInOutClear(confId);
|
|
232
|
+
},
|
|
212
233
|
inMarkClick: onInMark,
|
|
213
234
|
outMarkClick: onOutMark,
|
|
214
|
-
setMarks: ([newInFrame, newOutFrame]) => {
|
|
215
|
-
setInAndOutFrames({
|
|
216
|
-
inFrame: newInFrame,
|
|
217
|
-
outFrame: newOutFrame,
|
|
218
|
-
});
|
|
219
|
-
},
|
|
220
235
|
};
|
|
221
|
-
}, [onInMark, onInOutClear, onOutMark
|
|
236
|
+
}, [confId, onInMark, onInOutClear, onOutMark]);
|
|
222
237
|
if (isStill) {
|
|
223
238
|
return null;
|
|
224
239
|
}
|
|
@@ -16,4 +16,4 @@ export declare const BLUE_DISABLED = "#284f73";
|
|
|
16
16
|
export declare const getBackgroundFromHoverState: ({ selected, hovered, }: {
|
|
17
17
|
selected: boolean;
|
|
18
18
|
hovered: boolean;
|
|
19
|
-
}) => "transparent" | "hsla(0, 0%, 100%, 0.15)" | "
|
|
19
|
+
}) => "transparent" | "hsla(0, 0%, 100%, 0.15)" | "hsla(0, 0%, 100%, 0.25)" | "rgba(255, 255, 255, 0.06)";
|
|
@@ -13,16 +13,15 @@ const useIsStill = () => {
|
|
|
13
13
|
};
|
|
14
14
|
exports.useIsStill = useIsStill;
|
|
15
15
|
const useDimensions = () => {
|
|
16
|
-
const
|
|
17
|
-
const selected = (0, react_1.useMemo)(() => compositions.find((c) => c.id === currentComposition), [compositions, currentComposition]);
|
|
16
|
+
const config = remotion_1.Internals.useUnsafeVideoConfig();
|
|
18
17
|
return (0, react_1.useMemo)(() => {
|
|
19
|
-
if (!
|
|
18
|
+
if (!config) {
|
|
20
19
|
return null;
|
|
21
20
|
}
|
|
22
21
|
return {
|
|
23
|
-
width:
|
|
24
|
-
height:
|
|
22
|
+
width: config.width,
|
|
23
|
+
height: config.height,
|
|
25
24
|
};
|
|
26
|
-
}, [
|
|
25
|
+
}, [config]);
|
|
27
26
|
};
|
|
28
27
|
exports.useDimensions = useDimensions;
|
|
@@ -4,6 +4,7 @@ exports.ArrowRight = exports.ArrowLeft = exports.ShiftIcon = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const iconStyle = {
|
|
6
6
|
width: 10,
|
|
7
|
+
display: 'inline',
|
|
7
8
|
};
|
|
8
9
|
const ShiftIcon = () => {
|
|
9
10
|
return ((0, jsx_runtime_1.jsx)("svg", { style: iconStyle, viewBox: "0 0 448 512", children: (0, jsx_runtime_1.jsx)("path", { fill: "currentColor", d: "M48.048 304h73.798v128c0 26.51 21.49 48 48 48h108.308c26.51 0 48-21.49 48-48V304h73.789c42.638 0 64.151-51.731 33.941-81.941l-175.943-176c-18.745-18.745-49.137-18.746-67.882 0l-175.952 176C-16.042 252.208 5.325 304 48.048 304zM224 80l176 176H278.154v176H169.846V256H48L224 80z" }) }));
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
-
export type
|
|
2
|
+
export type InOutValue = {
|
|
3
3
|
inFrame: number | null;
|
|
4
4
|
outFrame: number | null;
|
|
5
5
|
};
|
|
6
|
+
export type TimelineInOutContextValue = Record<string, InOutValue>;
|
|
6
7
|
export type SetTimelineInOutContextValue = {
|
|
7
8
|
setInAndOutFrames: (u: React.SetStateAction<TimelineInOutContextValue>) => void;
|
|
8
9
|
};
|
|
9
10
|
export declare const TimelineInOutContext: React.Context<TimelineInOutContextValue>;
|
|
10
11
|
export declare const SetTimelineInOutContext: React.Context<SetTimelineInOutContextValue>;
|
|
11
|
-
export declare const useTimelineInOutFramePosition: () =>
|
|
12
|
+
export declare const useTimelineInOutFramePosition: () => InOutValue;
|
|
12
13
|
export declare const useTimelineSetInOutFramePosition: () => SetTimelineInOutContextValue;
|
|
@@ -2,18 +2,35 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useTimelineSetInOutFramePosition = exports.useTimelineInOutFramePosition = exports.SetTimelineInOutContext = exports.TimelineInOutContext = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
outFrame: null,
|
|
8
|
-
});
|
|
5
|
+
const remotion_1 = require("remotion");
|
|
6
|
+
exports.TimelineInOutContext = (0, react_1.createContext)({});
|
|
9
7
|
exports.SetTimelineInOutContext = (0, react_1.createContext)({
|
|
10
8
|
setInAndOutFrames: () => {
|
|
11
9
|
throw new Error('default');
|
|
12
10
|
},
|
|
13
11
|
});
|
|
14
12
|
const useTimelineInOutFramePosition = () => {
|
|
13
|
+
var _a, _b, _c, _d;
|
|
14
|
+
const videoConfig = remotion_1.Internals.useUnsafeVideoConfig();
|
|
15
15
|
const state = (0, react_1.useContext)(exports.TimelineInOutContext);
|
|
16
|
-
|
|
16
|
+
if (!videoConfig) {
|
|
17
|
+
return { inFrame: null, outFrame: null };
|
|
18
|
+
}
|
|
19
|
+
const maxFrame = videoConfig.durationInFrames - 1;
|
|
20
|
+
const actualInFrame = (_b = (_a = state[videoConfig.id]) === null || _a === void 0 ? void 0 : _a.inFrame) !== null && _b !== void 0 ? _b : null;
|
|
21
|
+
const actualOutFrame = (_d = (_c = state[videoConfig.id]) === null || _c === void 0 ? void 0 : _c.outFrame) !== null && _d !== void 0 ? _d : null;
|
|
22
|
+
return {
|
|
23
|
+
inFrame: actualInFrame === null
|
|
24
|
+
? null
|
|
25
|
+
: actualInFrame >= maxFrame
|
|
26
|
+
? null
|
|
27
|
+
: actualInFrame,
|
|
28
|
+
outFrame: actualOutFrame === null
|
|
29
|
+
? null
|
|
30
|
+
: actualOutFrame >= maxFrame
|
|
31
|
+
? null
|
|
32
|
+
: actualOutFrame,
|
|
33
|
+
};
|
|
17
34
|
};
|
|
18
35
|
exports.useTimelineInOutFramePosition = useTimelineInOutFramePosition;
|
|
19
36
|
const useTimelineSetInOutFramePosition = () => {
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const
|
|
1
|
+
import type { TimelineInOutContextValue } from './in-out';
|
|
2
|
+
export declare const persistMarks: (marks: TimelineInOutContextValue) => void;
|
|
3
|
+
export declare const loadMarks: () => TimelineInOutContextValue;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.loadMarks = exports.persistMarks = void 0;
|
|
4
|
-
const localStorageKey = (
|
|
5
|
-
const persistMarks = (
|
|
6
|
-
localStorage.setItem(localStorageKey(
|
|
4
|
+
const localStorageKey = () => `remotion.editor.marksv2`;
|
|
5
|
+
const persistMarks = (marks) => {
|
|
6
|
+
localStorage.setItem(localStorageKey(), JSON.stringify(marks));
|
|
7
7
|
};
|
|
8
8
|
exports.persistMarks = persistMarks;
|
|
9
|
-
const loadMarks = (
|
|
10
|
-
const item = localStorage.getItem(localStorageKey(
|
|
9
|
+
const loadMarks = () => {
|
|
10
|
+
const item = localStorage.getItem(localStorageKey());
|
|
11
11
|
if (item === null) {
|
|
12
|
-
return
|
|
12
|
+
return {};
|
|
13
13
|
}
|
|
14
14
|
return JSON.parse(item);
|
|
15
15
|
};
|
|
@@ -20,7 +20,7 @@ export declare const getCliOptions: (options: {
|
|
|
20
20
|
numberOfGifLoops: import("./config/number-of-gif-loops").Loop;
|
|
21
21
|
stillFrame: number;
|
|
22
22
|
browserExecutable: BrowserExecutable;
|
|
23
|
-
logLevel: "
|
|
23
|
+
logLevel: "verbose" | "info" | "warn" | "error";
|
|
24
24
|
scale: number;
|
|
25
25
|
chromiumOptions: ChromiumOptions;
|
|
26
26
|
overwrite: boolean;
|
|
@@ -33,5 +33,5 @@ export declare const getCliOptions: (options: {
|
|
|
33
33
|
videoBitrate: string | null;
|
|
34
34
|
height: number | null;
|
|
35
35
|
width: number | null;
|
|
36
|
-
configFileImageFormat: "
|
|
36
|
+
configFileImageFormat: "png" | "jpeg" | "none" | undefined;
|
|
37
37
|
}>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { BrowserExecutable, ChromiumOptions, HeadlessBrowser, LogLevel, RemotionServer } from '@remotion/renderer';
|
|
2
|
-
import type {
|
|
2
|
+
import type { VideoConfig } from 'remotion';
|
|
3
3
|
export declare const getCompositionId: ({ args, compositionIdFromUi, inputProps, puppeteerInstance, envVariables, timeoutInMilliseconds, chromiumOptions, port, browserExecutable, serveUrlOrWebpackUrl, logLevel, indent, server, }: {
|
|
4
4
|
args: string[];
|
|
5
5
|
compositionIdFromUi: string | null;
|
|
@@ -17,6 +17,6 @@ export declare const getCompositionId: ({ args, compositionIdFromUi, inputProps,
|
|
|
17
17
|
}) => Promise<{
|
|
18
18
|
compositionId: string;
|
|
19
19
|
reason: string;
|
|
20
|
-
config:
|
|
20
|
+
config: VideoConfig;
|
|
21
21
|
argsAfterComposition: string[];
|
|
22
22
|
}>;
|
|
@@ -4,6 +4,7 @@ exports.getCompositionId = void 0;
|
|
|
4
4
|
const renderer_1 = require("@remotion/renderer");
|
|
5
5
|
const log_1 = require("./log");
|
|
6
6
|
const show_compositions_picker_1 = require("./show-compositions-picker");
|
|
7
|
+
const format_bytes_1 = require("./format-bytes");
|
|
7
8
|
const getCompName = ({ cliArgs, compositionIdFromUi, }) => {
|
|
8
9
|
if (compositionIdFromUi) {
|
|
9
10
|
return {
|
|
@@ -21,7 +22,7 @@ const getCompositionId = async ({ args, compositionIdFromUi, inputProps, puppete
|
|
|
21
22
|
compositionIdFromUi,
|
|
22
23
|
});
|
|
23
24
|
if (compName) {
|
|
24
|
-
const config = await renderer_1.RenderInternals.internalSelectComposition({
|
|
25
|
+
const { metadata: config, propsSize } = await renderer_1.RenderInternals.internalSelectComposition({
|
|
25
26
|
id: compName,
|
|
26
27
|
inputProps,
|
|
27
28
|
puppeteerInstance,
|
|
@@ -36,6 +37,9 @@ const getCompositionId = async ({ args, compositionIdFromUi, inputProps, puppete
|
|
|
36
37
|
indent,
|
|
37
38
|
onBrowserLog: null,
|
|
38
39
|
});
|
|
40
|
+
if (propsSize > 10000000) {
|
|
41
|
+
log_1.Log.warn(`The props of your composition are large (${(0, format_bytes_1.formatBytes)(propsSize)}). This may cause slowdown.`);
|
|
42
|
+
}
|
|
39
43
|
if (!config) {
|
|
40
44
|
throw new Error(`Cannot find composition with ID "${compName}"`);
|
|
41
45
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { BrowserExecutable, ChromiumOptions, HeadlessBrowser, LogLevel, RemotionServer } from '@remotion/renderer';
|
|
2
|
-
import type {
|
|
2
|
+
import type { VideoConfig } from 'remotion';
|
|
3
3
|
export declare const getCompositionWithDimensionOverride: ({ height, width, args, compositionIdFromUi, chromiumOptions, envVariables, port, puppeteerInstance, timeoutInMilliseconds, browserExecutable, serveUrlOrWebpackUrl, indent, inputProps, logLevel, server, }: {
|
|
4
4
|
height: number | null;
|
|
5
5
|
width: number | null;
|
|
@@ -19,6 +19,6 @@ export declare const getCompositionWithDimensionOverride: ({ height, width, args
|
|
|
19
19
|
}) => Promise<{
|
|
20
20
|
compositionId: string;
|
|
21
21
|
reason: string;
|
|
22
|
-
config:
|
|
22
|
+
config: VideoConfig;
|
|
23
23
|
argsAfterComposition: string[];
|
|
24
24
|
}>;
|
|
@@ -48,5 +48,13 @@ const handleCommonError = async (err, logLevel) => {
|
|
|
48
48
|
log_1.Log.info(' Oftentimes, this happens if the component is missing the `export` keyword');
|
|
49
49
|
log_1.Log.info(' or if the component was renamed and the import statement not properly adjusted.');
|
|
50
50
|
}
|
|
51
|
+
if (err.message.includes('GLIBC_')) {
|
|
52
|
+
log_1.Log.info('💡 Remotion requires at least Libc 2.34.');
|
|
53
|
+
log_1.Log.info('💡 Get help for this issue: https://github.com/remotion-dev/remotion/issues/2439');
|
|
54
|
+
}
|
|
55
|
+
if (err.message.includes('EBADF')) {
|
|
56
|
+
log_1.Log.info('💡 This error might be fixed by changing your Node version:');
|
|
57
|
+
log_1.Log.info(' https://github.com/remotion-dev/remotion/issues/2452');
|
|
58
|
+
}
|
|
51
59
|
};
|
|
52
60
|
exports.handleCommonError = handleCommonError;
|
package/dist/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export declare const CliInternals: {
|
|
|
9
9
|
indent: boolean;
|
|
10
10
|
}) => import("./progress-bar").OverwriteableCliOutput;
|
|
11
11
|
chalk: {
|
|
12
|
-
enabled: boolean;
|
|
12
|
+
enabled: () => boolean;
|
|
13
13
|
visible: boolean;
|
|
14
14
|
styles: Record<string, {
|
|
15
15
|
codes: [number, number];
|
|
@@ -33,6 +33,7 @@ export declare const CliInternals: {
|
|
|
33
33
|
yellow: (str: string) => string;
|
|
34
34
|
blue: (str: string) => string;
|
|
35
35
|
magenta: (str: string) => string;
|
|
36
|
+
cyan: (str: string) => string;
|
|
36
37
|
white: (str: string) => string;
|
|
37
38
|
gray: (str: string) => string;
|
|
38
39
|
bgBlack: (str: string) => string;
|
|
@@ -62,19 +63,19 @@ export declare const CliInternals: {
|
|
|
62
63
|
verbose: (message?: any, ...optionalParams: any[]) => void;
|
|
63
64
|
verboseAdvanced: (options: {
|
|
64
65
|
indent: boolean;
|
|
65
|
-
logLevel: "
|
|
66
|
+
logLevel: "verbose" | "info" | "warn" | "error";
|
|
66
67
|
} & {
|
|
67
68
|
tag?: string | undefined;
|
|
68
69
|
}, message?: any, ...optionalParams: any[]) => void;
|
|
69
70
|
info: (message?: any, ...optionalParams: any[]) => void;
|
|
70
71
|
infoAdvanced: (options: {
|
|
71
72
|
indent: boolean;
|
|
72
|
-
logLevel: "
|
|
73
|
+
logLevel: "verbose" | "info" | "warn" | "error";
|
|
73
74
|
}, message?: any, ...optionalParams: any[]) => void;
|
|
74
75
|
warn: (message?: any, ...optionalParams: any[]) => void;
|
|
75
76
|
warnAdvanced: (options: {
|
|
76
77
|
indent: boolean;
|
|
77
|
-
logLevel: "
|
|
78
|
+
logLevel: "verbose" | "info" | "warn" | "error";
|
|
78
79
|
}, message?: any, ...optionalParams: any[]) => void;
|
|
79
80
|
error: (message?: any, ...optionalParams: any[]) => void;
|
|
80
81
|
};
|
|
@@ -98,7 +99,7 @@ export declare const CliInternals: {
|
|
|
98
99
|
numberOfGifLoops: import("./config/number-of-gif-loops").Loop;
|
|
99
100
|
stillFrame: number;
|
|
100
101
|
browserExecutable: import("@remotion/renderer").BrowserExecutable;
|
|
101
|
-
logLevel: "
|
|
102
|
+
logLevel: "verbose" | "info" | "warn" | "error";
|
|
102
103
|
scale: number;
|
|
103
104
|
chromiumOptions: import("@remotion/renderer").ChromiumOptions;
|
|
104
105
|
overwrite: boolean;
|
|
@@ -111,7 +112,7 @@ export declare const CliInternals: {
|
|
|
111
112
|
videoBitrate: string | null;
|
|
112
113
|
height: number | null;
|
|
113
114
|
width: number | null;
|
|
114
|
-
configFileImageFormat: "
|
|
115
|
+
configFileImageFormat: "png" | "jpeg" | "none" | undefined;
|
|
115
116
|
}>;
|
|
116
117
|
loadConfig: (remotionRoot: string) => Promise<string | null>;
|
|
117
118
|
initializeCli: (remotionRoot: string) => Promise<void>;
|
|
@@ -120,7 +121,7 @@ export declare const CliInternals: {
|
|
|
120
121
|
parsedCli: {
|
|
121
122
|
"browser-executable": import("@remotion/renderer").BrowserExecutable;
|
|
122
123
|
"pixel-format": "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le";
|
|
123
|
-
"image-format": "
|
|
124
|
+
"image-format": "png" | "jpeg" | "pdf" | "webp" | "none";
|
|
124
125
|
"prores-profile": "4444-xq" | "4444" | "hq" | "standard" | "light" | "proxy";
|
|
125
126
|
"bundle-cache": string;
|
|
126
127
|
"env-file": string;
|
|
@@ -172,7 +173,7 @@ export declare const CliInternals: {
|
|
|
172
173
|
} & {
|
|
173
174
|
_: string[];
|
|
174
175
|
};
|
|
175
|
-
handleCommonError: (err: Error, logLevel: "
|
|
176
|
+
handleCommonError: (err: Error, logLevel: "verbose" | "info" | "warn" | "error") => Promise<void>;
|
|
176
177
|
formatBytes: (number: number, options?: Intl.NumberFormatOptions & {
|
|
177
178
|
locale: string;
|
|
178
179
|
bits?: boolean | undefined;
|
|
@@ -184,7 +185,7 @@ export declare const CliInternals: {
|
|
|
184
185
|
downloadName: string | null;
|
|
185
186
|
outName: string | null;
|
|
186
187
|
configImageFormat: "png" | "jpeg" | "pdf" | "webp" | null;
|
|
187
|
-
cliFlag: "
|
|
188
|
+
cliFlag: "png" | "jpeg" | "pdf" | "webp" | "none" | null;
|
|
188
189
|
isLambda: boolean;
|
|
189
190
|
fromUi: "png" | "jpeg" | "pdf" | "webp" | null;
|
|
190
191
|
}) => {
|
|
@@ -199,9 +200,9 @@ export declare const CliInternals: {
|
|
|
199
200
|
};
|
|
200
201
|
getVideoImageFormat: ({ codec, uiImageFormat, }: {
|
|
201
202
|
codec: import("@remotion/renderer").CodecOrUndefined;
|
|
202
|
-
uiImageFormat: "
|
|
203
|
-
}) => "
|
|
204
|
-
printCompositions: (compositions: import("remotion").
|
|
203
|
+
uiImageFormat: "png" | "jpeg" | "none" | null;
|
|
204
|
+
}) => "png" | "jpeg" | "none";
|
|
205
|
+
printCompositions: (compositions: import("remotion").VideoConfig[]) => void;
|
|
205
206
|
getFinalOutputCodec: ({ cliFlag, configFile, downloadName, outName, uiCodec, }: {
|
|
206
207
|
cliFlag: import("@remotion/renderer").CodecOrUndefined;
|
|
207
208
|
outName: string | null;
|
|
@@ -214,7 +215,7 @@ export declare const CliInternals: {
|
|
|
214
215
|
};
|
|
215
216
|
listOfRemotionPackages: string[];
|
|
216
217
|
shouldUseNonOverlayingLogger: ({ logLevel, }: {
|
|
217
|
-
logLevel: "
|
|
218
|
+
logLevel: "verbose" | "info" | "warn" | "error";
|
|
218
219
|
}) => boolean;
|
|
219
220
|
getCompositionWithDimensionOverride: ({ height, width, args, compositionIdFromUi, chromiumOptions, envVariables, port, puppeteerInstance, timeoutInMilliseconds, browserExecutable, serveUrlOrWebpackUrl, indent, inputProps, logLevel, server, }: {
|
|
220
221
|
height: number | null;
|
|
@@ -229,13 +230,13 @@ export declare const CliInternals: {
|
|
|
229
230
|
browserExecutable: import("@remotion/renderer").BrowserExecutable;
|
|
230
231
|
serveUrlOrWebpackUrl: string;
|
|
231
232
|
indent: boolean;
|
|
232
|
-
logLevel: "
|
|
233
|
+
logLevel: "verbose" | "info" | "warn" | "error";
|
|
233
234
|
inputProps: Record<string, unknown>;
|
|
234
235
|
server: import("@remotion/renderer").RemotionServer;
|
|
235
236
|
}) => Promise<{
|
|
236
237
|
compositionId: string;
|
|
237
238
|
reason: string;
|
|
238
|
-
config: import("remotion").
|
|
239
|
+
config: import("remotion").VideoConfig;
|
|
239
240
|
argsAfterComposition: string[];
|
|
240
241
|
}>;
|
|
241
242
|
};
|
package/dist/log.d.ts
CHANGED
|
@@ -2,19 +2,19 @@ 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
|
};
|
|
@@ -88,7 +88,7 @@ const parseCommandLine = () => {
|
|
|
88
88
|
config_1.ConfigInternals.setStillFrame(Number(exports.parsedCli.frame));
|
|
89
89
|
}
|
|
90
90
|
if (exports.parsedCli.png) {
|
|
91
|
-
throw new Error('The --png flag has been
|
|
91
|
+
throw new Error('The --png flag has been removed. Use --sequence --image-format=png from now on.');
|
|
92
92
|
}
|
|
93
93
|
if (exports.parsedCli.sequence) {
|
|
94
94
|
config_1.Config.setImageSequence(true);
|