remotion 4.0.0-alpha17 → 4.0.0-alpha19
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/cjs/Composition.d.ts +2 -2
- package/dist/cjs/props-if-has-props.d.ts +1 -1
- package/dist/cjs/resolve-video-config.js +4 -3
- package/dist/cjs/series/index.js +1 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/video/OffthreadVideo.js +4 -2
- package/dist/esm/index.mjs +10 -7
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
|
@@ -10,14 +10,14 @@ export type CompProps<Props> = {
|
|
|
10
10
|
} | {
|
|
11
11
|
component: LooseComponentType<Props>;
|
|
12
12
|
};
|
|
13
|
-
export type CalcMetadataReturnType<T> = {
|
|
13
|
+
export type CalcMetadataReturnType<T extends Record<string, unknown> | undefined> = {
|
|
14
14
|
durationInFrames?: number;
|
|
15
15
|
fps?: number;
|
|
16
16
|
width?: number;
|
|
17
17
|
height?: number;
|
|
18
18
|
props?: T;
|
|
19
19
|
};
|
|
20
|
-
export type CalculateMetadataFunction<T> = (options: {
|
|
20
|
+
export type CalculateMetadataFunction<T extends Record<string, unknown> | undefined> = (options: {
|
|
21
21
|
defaultProps: T;
|
|
22
22
|
props: T;
|
|
23
23
|
abortSignal: AbortSignal;
|
|
@@ -5,6 +5,6 @@ export type PropsIfHasProps<Schema extends AnyZodObject, Props extends Record<st
|
|
|
5
5
|
} : {
|
|
6
6
|
defaultProps: InferProps<Schema, Props>;
|
|
7
7
|
};
|
|
8
|
-
export type InferProps<Schema extends AnyZodObject, Props> = AnyZodObject extends Schema ? {} extends Props ? unknown : Props : {} extends Props ? z.infer<Schema> : // Props and schema specified
|
|
8
|
+
export type InferProps<Schema extends AnyZodObject, Props extends Record<string, unknown> | undefined> = AnyZodObject extends Schema ? {} extends Props ? Record<string, unknown> : Props : {} extends Props ? z.infer<Schema> : // Props and schema specified
|
|
9
9
|
z.infer<Schema> & Props;
|
|
10
10
|
export {};
|
|
@@ -6,7 +6,7 @@ const get_environment_js_1 = require("./get-environment.js");
|
|
|
6
6
|
const validate_dimensions_js_1 = require("./validation/validate-dimensions.js");
|
|
7
7
|
const validate_duration_in_frames_js_1 = require("./validation/validate-duration-in-frames.js");
|
|
8
8
|
const resolveVideoConfig = ({ composition, editorProps: editorPropsOrUndefined, signal, }) => {
|
|
9
|
-
var _a, _b, _c, _d, _e;
|
|
9
|
+
var _a, _b, _c, _d, _e, _f;
|
|
10
10
|
const calculatedProm = composition.calculateMetadata
|
|
11
11
|
? composition.calculateMetadata({
|
|
12
12
|
defaultProps: (_a = composition.defaultProps) !== null && _a !== void 0 ? _a : {},
|
|
@@ -26,6 +26,7 @@ const resolveVideoConfig = ({ composition, editorProps: editorPropsOrUndefined,
|
|
|
26
26
|
typeof calculatedProm === 'object' &&
|
|
27
27
|
'then' in calculatedProm) {
|
|
28
28
|
return calculatedProm.then((c) => {
|
|
29
|
+
var _a, _b;
|
|
29
30
|
const { height, width, durationInFrames, fps } = validateCalculated({
|
|
30
31
|
calculated: c,
|
|
31
32
|
composition,
|
|
@@ -36,7 +37,7 @@ const resolveVideoConfig = ({ composition, editorProps: editorPropsOrUndefined,
|
|
|
36
37
|
fps,
|
|
37
38
|
durationInFrames,
|
|
38
39
|
id: composition.id,
|
|
39
|
-
defaultProps: c.props,
|
|
40
|
+
defaultProps: (_b = (_a = c.props) !== null && _a !== void 0 ? _a : composition.defaultProps) !== null && _b !== void 0 ? _b : {},
|
|
40
41
|
};
|
|
41
42
|
});
|
|
42
43
|
}
|
|
@@ -54,7 +55,7 @@ const resolveVideoConfig = ({ composition, editorProps: editorPropsOrUndefined,
|
|
|
54
55
|
return {
|
|
55
56
|
...data,
|
|
56
57
|
id: composition.id,
|
|
57
|
-
defaultProps: ((_e = calculatedProm === null || calculatedProm === void 0 ? void 0 : calculatedProm.props) !== null && _e !== void 0 ? _e : {}
|
|
58
|
+
defaultProps: (_f = (_e = calculatedProm === null || calculatedProm === void 0 ? void 0 : calculatedProm.props) !== null && _e !== void 0 ? _e : composition.defaultProps) !== null && _f !== void 0 ? _f : {},
|
|
58
59
|
};
|
|
59
60
|
};
|
|
60
61
|
exports.resolveVideoConfig = resolveVideoConfig;
|
package/dist/cjs/series/index.js
CHANGED
|
@@ -38,7 +38,7 @@ const Series = ({ children }) => {
|
|
|
38
38
|
throw new TypeError(`A <Series.Sequence /> component (${debugInfo}) was detected to not have any children. Delete it to fix this error.`);
|
|
39
39
|
}
|
|
40
40
|
const durationInFramesProp = castedChild.props.durationInFrames;
|
|
41
|
-
const { durationInFrames, children: _children, ...passedProps } = castedChild.props;
|
|
41
|
+
const { durationInFrames, children: _children, from, ...passedProps } = castedChild.props; // `from` is not accepted and must be filtered out if used in JS
|
|
42
42
|
if (i !== flattenedChildren.length - 1 ||
|
|
43
43
|
durationInFramesProp !== Infinity) {
|
|
44
44
|
(0, validate_duration_in_frames_js_1.validateDurationInFrames)({
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "4.0.0-
|
|
1
|
+
export declare const VERSION = "4.0.0-alpha19";
|
package/dist/cjs/version.js
CHANGED
|
@@ -14,7 +14,9 @@ const VideoForDevelopment_js_1 = require("./VideoForDevelopment.js");
|
|
|
14
14
|
* @see [Documentation](https://www.remotion.dev/docs/offthreadvideo)
|
|
15
15
|
*/
|
|
16
16
|
const OffthreadVideo = (props) => {
|
|
17
|
-
|
|
17
|
+
// Should only destruct `startFrom` and `endAt` from props,
|
|
18
|
+
// rest gets drilled down
|
|
19
|
+
const { startFrom, endAt, ...otherProps } = props;
|
|
18
20
|
const environment = (0, get_environment_js_1.useRemotionEnvironment)();
|
|
19
21
|
const onDuration = (0, react_1.useCallback)(() => undefined, []);
|
|
20
22
|
if (typeof props.src !== 'string') {
|
|
@@ -31,7 +33,7 @@ const OffthreadVideo = (props) => {
|
|
|
31
33
|
}
|
|
32
34
|
(0, validate_media_props_js_1.validateMediaProps)(props, 'Video');
|
|
33
35
|
if (environment === 'rendering') {
|
|
34
|
-
return (
|
|
36
|
+
return (0, jsx_runtime_1.jsx)(OffthreadVideoForRendering_js_1.OffthreadVideoForRendering, { ...otherProps });
|
|
35
37
|
}
|
|
36
38
|
return ((0, jsx_runtime_1.jsx)(VideoForDevelopment_js_1.VideoForDevelopment, { onDuration: onDuration, onlyWarnForMediaSeekingError: true, ...otherProps }));
|
|
37
39
|
};
|
package/dist/esm/index.mjs
CHANGED
|
@@ -58,7 +58,7 @@ function truthy(value) {
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
// Automatically generated on publish
|
|
61
|
-
const VERSION = '4.0.0-
|
|
61
|
+
const VERSION = '4.0.0-alpha19';
|
|
62
62
|
|
|
63
63
|
const checkMultipleRemotionVersions = () => {
|
|
64
64
|
if (typeof globalThis === 'undefined') {
|
|
@@ -378,7 +378,7 @@ const validateDurationInFrames = ({ allowFloats, component, durationInFrames, })
|
|
|
378
378
|
};
|
|
379
379
|
|
|
380
380
|
const resolveVideoConfig = ({ composition, editorProps: editorPropsOrUndefined, signal, }) => {
|
|
381
|
-
var _a, _b, _c, _d, _e;
|
|
381
|
+
var _a, _b, _c, _d, _e, _f;
|
|
382
382
|
const calculatedProm = composition.calculateMetadata
|
|
383
383
|
? composition.calculateMetadata({
|
|
384
384
|
defaultProps: (_a = composition.defaultProps) !== null && _a !== void 0 ? _a : {},
|
|
@@ -398,6 +398,7 @@ const resolveVideoConfig = ({ composition, editorProps: editorPropsOrUndefined,
|
|
|
398
398
|
typeof calculatedProm === 'object' &&
|
|
399
399
|
'then' in calculatedProm) {
|
|
400
400
|
return calculatedProm.then((c) => {
|
|
401
|
+
var _a, _b;
|
|
401
402
|
const { height, width, durationInFrames, fps } = validateCalculated({
|
|
402
403
|
calculated: c,
|
|
403
404
|
composition,
|
|
@@ -408,7 +409,7 @@ const resolveVideoConfig = ({ composition, editorProps: editorPropsOrUndefined,
|
|
|
408
409
|
fps,
|
|
409
410
|
durationInFrames,
|
|
410
411
|
id: composition.id,
|
|
411
|
-
defaultProps: c.props,
|
|
412
|
+
defaultProps: (_b = (_a = c.props) !== null && _a !== void 0 ? _a : composition.defaultProps) !== null && _b !== void 0 ? _b : {},
|
|
412
413
|
};
|
|
413
414
|
});
|
|
414
415
|
}
|
|
@@ -426,7 +427,7 @@ const resolveVideoConfig = ({ composition, editorProps: editorPropsOrUndefined,
|
|
|
426
427
|
return {
|
|
427
428
|
...data,
|
|
428
429
|
id: composition.id,
|
|
429
|
-
defaultProps: ((_e = calculatedProm === null || calculatedProm === void 0 ? void 0 : calculatedProm.props) !== null && _e !== void 0 ? _e : {}
|
|
430
|
+
defaultProps: (_f = (_e = calculatedProm === null || calculatedProm === void 0 ? void 0 : calculatedProm.props) !== null && _e !== void 0 ? _e : composition.defaultProps) !== null && _f !== void 0 ? _f : {},
|
|
430
431
|
};
|
|
431
432
|
};
|
|
432
433
|
const validateCalculated = ({ composition, calculated, }) => {
|
|
@@ -3707,7 +3708,7 @@ const Series = ({ children }) => {
|
|
|
3707
3708
|
throw new TypeError(`A <Series.Sequence /> component (${debugInfo}) was detected to not have any children. Delete it to fix this error.`);
|
|
3708
3709
|
}
|
|
3709
3710
|
const durationInFramesProp = castedChild.props.durationInFrames;
|
|
3710
|
-
const { durationInFrames, children: _children, ...passedProps } = castedChild.props;
|
|
3711
|
+
const { durationInFrames, children: _children, from, ...passedProps } = castedChild.props; // `from` is not accepted and must be filtered out if used in JS
|
|
3711
3712
|
if (i !== flattenedChildren.length - 1 ||
|
|
3712
3713
|
durationInFramesProp !== Infinity) {
|
|
3713
3714
|
validateDurationInFrames({
|
|
@@ -4327,7 +4328,9 @@ const VideoForDevelopment = forwardRef(VideoForDevelopmentRefForwardingFunction)
|
|
|
4327
4328
|
* @see [Documentation](https://www.remotion.dev/docs/offthreadvideo)
|
|
4328
4329
|
*/
|
|
4329
4330
|
const OffthreadVideo = (props) => {
|
|
4330
|
-
|
|
4331
|
+
// Should only destruct `startFrom` and `endAt` from props,
|
|
4332
|
+
// rest gets drilled down
|
|
4333
|
+
const { startFrom, endAt, ...otherProps } = props;
|
|
4331
4334
|
const environment = useRemotionEnvironment();
|
|
4332
4335
|
const onDuration = useCallback(() => undefined, []);
|
|
4333
4336
|
if (typeof props.src !== 'string') {
|
|
@@ -4344,7 +4347,7 @@ const OffthreadVideo = (props) => {
|
|
|
4344
4347
|
}
|
|
4345
4348
|
validateMediaProps(props, 'Video');
|
|
4346
4349
|
if (environment === 'rendering') {
|
|
4347
|
-
return
|
|
4350
|
+
return jsx(OffthreadVideoForRendering, { ...otherProps });
|
|
4348
4351
|
}
|
|
4349
4352
|
return (jsx(VideoForDevelopment, { onDuration: onDuration, onlyWarnForMediaSeekingError: true, ...otherProps }));
|
|
4350
4353
|
};
|
package/dist/esm/version.mjs
CHANGED