remotion 4.0.491 → 4.0.493
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.js +3 -0
- package/dist/cjs/CompositionManager.d.ts +2 -0
- package/dist/cjs/Img.d.ts +6 -0
- package/dist/cjs/Img.js +6 -0
- package/dist/cjs/ResolveCompositionConfig.d.ts +3 -0
- package/dist/cjs/ResolveCompositionConfig.js +2 -0
- package/dist/cjs/Sequence.d.ts +4 -0
- package/dist/cjs/Sequence.js +5 -1
- package/dist/cjs/animated-image/AnimatedImage.js +6 -0
- package/dist/cjs/enable-sequence-stack-traces.d.ts +4 -0
- package/dist/cjs/enable-sequence-stack-traces.js +27 -1
- package/dist/cjs/index.d.ts +3 -2
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/interactivity-schema.d.ts +7 -1
- package/dist/cjs/internals.d.ts +26 -3
- package/dist/cjs/internals.js +3 -0
- package/dist/cjs/resolve-video-config.d.ts +19 -1
- package/dist/cjs/resolve-video-config.js +61 -44
- package/dist/cjs/use-schema.js +6 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/wrap-remotion-context.d.ts +2 -0
- package/dist/esm/index.mjs +184 -124
- package/dist/esm/version.mjs +1 -1
- package/package.json +2 -2
package/dist/cjs/Composition.js
CHANGED
|
@@ -55,6 +55,7 @@ const InnerComposition = ({ width, height, fps, durationInFrames, id, defaultPro
|
|
|
55
55
|
}
|
|
56
56
|
const { folderName, parentName } = (0, react_1.useContext)(Folder_js_1.FolderContext);
|
|
57
57
|
const stack = (_b = compProps.stack) !== null && _b !== void 0 ? _b : null;
|
|
58
|
+
const componentFromProps = 'component' in compProps ? compProps.component : null;
|
|
58
59
|
(0, react_1.useEffect)(() => {
|
|
59
60
|
var _a;
|
|
60
61
|
// Ensure it's a URL safe id
|
|
@@ -74,6 +75,7 @@ const InnerComposition = ({ width, height, fps, durationInFrames, id, defaultPro
|
|
|
74
75
|
defaultProps: (0, input_props_serialization_js_1.serializeThenDeserializeInStudio)((defaultProps !== null && defaultProps !== void 0 ? defaultProps : {})),
|
|
75
76
|
nonce: nonce.get(),
|
|
76
77
|
parentFolderName: parentName,
|
|
78
|
+
componentFromProps,
|
|
77
79
|
schema: schema !== null && schema !== void 0 ? schema : null,
|
|
78
80
|
calculateMetadata: (_a = compProps.calculateMetadata) !== null && _a !== void 0 ? _a : null,
|
|
79
81
|
stack,
|
|
@@ -92,6 +94,7 @@ const InnerComposition = ({ width, height, fps, durationInFrames, id, defaultPro
|
|
|
92
94
|
width,
|
|
93
95
|
nonce,
|
|
94
96
|
parentName,
|
|
97
|
+
componentFromProps,
|
|
95
98
|
schema,
|
|
96
99
|
compProps.calculateMetadata,
|
|
97
100
|
stack,
|
|
@@ -16,6 +16,7 @@ export type TComposition<Schema extends AnyZodObject, Props extends Record<strin
|
|
|
16
16
|
folderName: string | null;
|
|
17
17
|
parentFolderName: string | null;
|
|
18
18
|
component: LazyExoticComponent<ComponentType<Props>> | ComponentType<Props>;
|
|
19
|
+
componentFromProps?: unknown;
|
|
19
20
|
nonce: NonceHistory;
|
|
20
21
|
schema: Schema | null;
|
|
21
22
|
calculateMetadata: CalculateMetadataFunction<InferProps<Schema, Props>> | null;
|
|
@@ -83,6 +84,7 @@ export type TSequence = {
|
|
|
83
84
|
effects: readonly EffectDefinition<unknown>[];
|
|
84
85
|
isInsideSeries: boolean;
|
|
85
86
|
frozenFrame: number | null;
|
|
87
|
+
singleChildComponent?: unknown;
|
|
86
88
|
} & EnhancedTSequenceData;
|
|
87
89
|
export type AudioOrVideoAsset = {
|
|
88
90
|
type: 'audio' | 'video';
|
package/dist/cjs/Img.d.ts
CHANGED
|
@@ -82,6 +82,12 @@ export declare const imgSchema: {
|
|
|
82
82
|
readonly hidden: import("./interactivity-schema.js").BooleanFieldSchema;
|
|
83
83
|
readonly name: import("./interactivity-schema.js").HiddenFieldSchema;
|
|
84
84
|
readonly showInTimeline: import("./interactivity-schema.js").HiddenFieldSchema;
|
|
85
|
+
readonly src: {
|
|
86
|
+
readonly type: "asset";
|
|
87
|
+
readonly default: undefined;
|
|
88
|
+
readonly description: "Source";
|
|
89
|
+
readonly keyframable: false;
|
|
90
|
+
};
|
|
85
91
|
};
|
|
86
92
|
export declare const Img: React.ComponentType<NativeImgProps & {
|
|
87
93
|
readonly maxRetries?: number | undefined;
|
package/dist/cjs/Img.js
CHANGED
|
@@ -198,6 +198,12 @@ const NativeImgInner = ({ hidden, name, stack, showInTimeline, src, from, trimBe
|
|
|
198
198
|
};
|
|
199
199
|
const CanvasImageWithPrivateProps = index_js_1.CanvasImage;
|
|
200
200
|
exports.imgSchema = {
|
|
201
|
+
src: {
|
|
202
|
+
type: 'asset',
|
|
203
|
+
default: undefined,
|
|
204
|
+
description: 'Source',
|
|
205
|
+
keyframable: false,
|
|
206
|
+
},
|
|
201
207
|
...interactivity_schema_js_1.baseSchema,
|
|
202
208
|
...interactivity_schema_js_1.transformSchema,
|
|
203
209
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { AnyComposition } from './CompositionManager.js';
|
|
2
|
+
import type { VideoConfigMetadataSource } from './resolve-video-config.js';
|
|
2
3
|
import type { VideoConfig } from './video-config.js';
|
|
3
4
|
type ResolveCompositionConfigContect = Record<string, VideoConfigState | undefined>;
|
|
4
5
|
export declare const ResolveCompositionContext: import("react").Context<ResolveCompositionConfigContect | null>;
|
|
@@ -12,9 +13,11 @@ type VideoConfigState = {
|
|
|
12
13
|
} | {
|
|
13
14
|
type: 'success';
|
|
14
15
|
result: VideoConfig;
|
|
16
|
+
metadataSource: VideoConfigMetadataSource | null;
|
|
15
17
|
} | {
|
|
16
18
|
type: 'success-and-refreshing';
|
|
17
19
|
result: VideoConfig;
|
|
20
|
+
metadataSource: VideoConfigMetadataSource | null;
|
|
18
21
|
} | {
|
|
19
22
|
type: 'error';
|
|
20
23
|
error: Error;
|
|
@@ -35,6 +35,7 @@ const useResolvedVideoConfig = (preferredCompositionId) => {
|
|
|
35
35
|
if (currentCompositionMetadata) {
|
|
36
36
|
return {
|
|
37
37
|
type: 'success',
|
|
38
|
+
metadataSource: null,
|
|
38
39
|
result: {
|
|
39
40
|
...currentCompositionMetadata,
|
|
40
41
|
id: composition.id,
|
|
@@ -52,6 +53,7 @@ const useResolvedVideoConfig = (preferredCompositionId) => {
|
|
|
52
53
|
(0, validate_dimensions_js_1.validateDimension)(composition.height, 'height', `in <Composition id="${composition.id}">`);
|
|
53
54
|
return {
|
|
54
55
|
type: 'success',
|
|
56
|
+
metadataSource: null,
|
|
55
57
|
result: {
|
|
56
58
|
width: composition.width,
|
|
57
59
|
height: composition.height,
|
package/dist/cjs/Sequence.d.ts
CHANGED
|
@@ -46,6 +46,10 @@ export type SequencePropsWithoutDuration = {
|
|
|
46
46
|
* @deprecated For internal use only.
|
|
47
47
|
*/
|
|
48
48
|
readonly _remotionInternalDocumentationLink?: string;
|
|
49
|
+
/**
|
|
50
|
+
* @deprecated For internal use only.
|
|
51
|
+
*/
|
|
52
|
+
readonly _remotionInternalSingleChildComponent?: unknown;
|
|
49
53
|
/**
|
|
50
54
|
* @deprecated For internal use only.
|
|
51
55
|
*/
|
package/dist/cjs/Sequence.js
CHANGED
|
@@ -19,7 +19,7 @@ const use_video_config_js_1 = require("./use-video-config.js");
|
|
|
19
19
|
const v5_flag_js_1 = require("./v5-flag.js");
|
|
20
20
|
const with_interactivity_schema_js_1 = require("./with-interactivity-schema.js");
|
|
21
21
|
const EMPTY_EFFECTS = [];
|
|
22
|
-
const RegularSequenceRefForwardingFunction = ({ from = 0, trimBefore = 0, freeze, durationInFrames = Infinity, children, name, height, width, showInTimeline = true, hidden = false, controls, _remotionInternalEffects, _remotionInternalLoopDisplay: loopDisplay, _remotionInternalStack: stack, _remotionInternalDocumentationLink: documentationLink, _remotionInternalPremountDisplay: premountDisplay, _remotionInternalPostmountDisplay: postmountDisplay, _remotionInternalIsMedia: isMedia, outlineRef: passedRefForOutline, ...other }, ref) => {
|
|
22
|
+
const RegularSequenceRefForwardingFunction = ({ from = 0, trimBefore = 0, freeze, durationInFrames = Infinity, children, name, height, width, showInTimeline = true, hidden = false, controls, _remotionInternalEffects, _remotionInternalLoopDisplay: loopDisplay, _remotionInternalStack: stack, _remotionInternalDocumentationLink: documentationLink, _remotionInternalSingleChildComponent: singleChildComponent, _remotionInternalPremountDisplay: premountDisplay, _remotionInternalPostmountDisplay: postmountDisplay, _remotionInternalIsMedia: isMedia, outlineRef: passedRefForOutline, ...other }, ref) => {
|
|
23
23
|
var _a, _b, _c;
|
|
24
24
|
const { layout = 'absolute-fill' } = other;
|
|
25
25
|
const [id] = (0, react_1.useState)(() => String(Math.random()));
|
|
@@ -210,6 +210,7 @@ const RegularSequenceRefForwardingFunction = ({ from = 0, trimBefore = 0, freeze
|
|
|
210
210
|
refForOutline: refForOutline !== null && refForOutline !== void 0 ? refForOutline : null,
|
|
211
211
|
isInsideSeries,
|
|
212
212
|
frozenFrame: registeredFrozenFrame,
|
|
213
|
+
singleChildComponent: singleChildComponent !== null && singleChildComponent !== void 0 ? singleChildComponent : null,
|
|
213
214
|
});
|
|
214
215
|
}
|
|
215
216
|
else {
|
|
@@ -241,6 +242,7 @@ const RegularSequenceRefForwardingFunction = ({ from = 0, trimBefore = 0, freeze
|
|
|
241
242
|
isInsideSeries,
|
|
242
243
|
frozenFrame: registeredFrozenFrame,
|
|
243
244
|
frozenMediaFrame,
|
|
245
|
+
singleChildComponent: singleChildComponent !== null && singleChildComponent !== void 0 ? singleChildComponent : null,
|
|
244
246
|
});
|
|
245
247
|
}
|
|
246
248
|
return () => {
|
|
@@ -268,6 +270,7 @@ const RegularSequenceRefForwardingFunction = ({ from = 0, trimBefore = 0, freeze
|
|
|
268
270
|
refForOutline: refForOutline !== null && refForOutline !== void 0 ? refForOutline : null,
|
|
269
271
|
isInsideSeries,
|
|
270
272
|
frozenFrame: registeredFrozenFrame,
|
|
273
|
+
singleChildComponent: singleChildComponent !== null && singleChildComponent !== void 0 ? singleChildComponent : null,
|
|
271
274
|
});
|
|
272
275
|
return () => {
|
|
273
276
|
unregisterSequence(id);
|
|
@@ -301,6 +304,7 @@ const RegularSequenceRefForwardingFunction = ({ from = 0, trimBefore = 0, freeze
|
|
|
301
304
|
startMediaFrom,
|
|
302
305
|
mediaFrameAtSequenceZero,
|
|
303
306
|
frozenMediaFrame,
|
|
307
|
+
singleChildComponent,
|
|
304
308
|
]);
|
|
305
309
|
// Ceil to support floats
|
|
306
310
|
// https://github.com/remotion-dev/remotion/issues/2958
|
|
@@ -17,6 +17,12 @@ const decode_image_js_1 = require("./decode-image.js");
|
|
|
17
17
|
const request_init_1 = require("./request-init");
|
|
18
18
|
const resolve_image_source_1 = require("./resolve-image-source");
|
|
19
19
|
const animatedImageSchema = {
|
|
20
|
+
src: {
|
|
21
|
+
type: 'asset',
|
|
22
|
+
default: undefined,
|
|
23
|
+
description: 'Source',
|
|
24
|
+
keyframable: false,
|
|
25
|
+
},
|
|
20
26
|
...interactivity_schema_js_1.baseSchema,
|
|
21
27
|
playbackRate: {
|
|
22
28
|
type: 'number',
|
|
@@ -1,2 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
export declare const getComponentsToAddStacksTo: () => unknown[];
|
|
2
3
|
export declare const addSequenceStackTraces: (component: unknown) => void;
|
|
4
|
+
export declare const setSequenceComponent: (component: unknown) => void;
|
|
5
|
+
export declare const getSequenceComponent: () => unknown;
|
|
6
|
+
export declare const getSingleChildComponent: (children: React.ReactNode) => unknown;
|
|
@@ -1,10 +1,36 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.addSequenceStackTraces = exports.getComponentsToAddStacksTo = void 0;
|
|
6
|
+
exports.getSingleChildComponent = exports.getSequenceComponent = exports.setSequenceComponent = exports.addSequenceStackTraces = exports.getComponentsToAddStacksTo = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
4
8
|
const componentsToAddStacksTo = [];
|
|
9
|
+
let sequenceComponent = null;
|
|
5
10
|
const getComponentsToAddStacksTo = () => componentsToAddStacksTo;
|
|
6
11
|
exports.getComponentsToAddStacksTo = getComponentsToAddStacksTo;
|
|
7
12
|
const addSequenceStackTraces = (component) => {
|
|
8
13
|
componentsToAddStacksTo.push(component);
|
|
9
14
|
};
|
|
10
15
|
exports.addSequenceStackTraces = addSequenceStackTraces;
|
|
16
|
+
const setSequenceComponent = (component) => {
|
|
17
|
+
sequenceComponent = component;
|
|
18
|
+
};
|
|
19
|
+
exports.setSequenceComponent = setSequenceComponent;
|
|
20
|
+
const getSequenceComponent = () => sequenceComponent;
|
|
21
|
+
exports.getSequenceComponent = getSequenceComponent;
|
|
22
|
+
const getSingleChildComponent = (children) => {
|
|
23
|
+
const mountedChildren = react_1.default.Children.toArray(children);
|
|
24
|
+
if (mountedChildren.length !== 1) {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
const child = mountedChildren[0];
|
|
28
|
+
if (!react_1.default.isValidElement(child)) {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
if (typeof child.type !== 'function' && typeof child.type !== 'object') {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
return child.type;
|
|
35
|
+
};
|
|
36
|
+
exports.getSingleChildComponent = getSingleChildComponent;
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import type { AnyCompMetadata, AnyComposition, AudioOrVideoAsset, JsxComponentId
|
|
|
5
5
|
import type { DelayRenderScope } from './delay-render.js';
|
|
6
6
|
import { type TFolder } from './Folder.js';
|
|
7
7
|
import type { StaticFile } from './get-static-files.js';
|
|
8
|
-
import type { ArrayFieldSchema, ArrayItemFieldSchema, InteractivitySchemaField, InteractivitySchema } from './interactivity-schema.js';
|
|
8
|
+
import type { AssetFieldSchema, ArrayFieldSchema, ArrayItemFieldSchema, InteractivitySchemaField, InteractivitySchema } from './interactivity-schema.js';
|
|
9
9
|
import type { LogLevel } from './log.js';
|
|
10
10
|
import type { ProResProfile } from './prores-profile.js';
|
|
11
11
|
import type { PixelFormat, VideoImageFormat } from './render-types.js';
|
|
@@ -43,6 +43,7 @@ declare global {
|
|
|
43
43
|
remotion_logLevel: LogLevel | undefined;
|
|
44
44
|
remotion_projectName: string;
|
|
45
45
|
remotion_cwd: string;
|
|
46
|
+
remotion_fileSystemPlatform: string | null;
|
|
46
47
|
remotion_studioServerCommand: string;
|
|
47
48
|
remotion_setFrame: (frame: number, composition: string, attempt: number) => void;
|
|
48
49
|
remotion_attempt: number;
|
|
@@ -182,4 +183,4 @@ export type _InternalTypes = {
|
|
|
182
183
|
TRenderAsset: TRenderAsset;
|
|
183
184
|
ProResProfile: ProResProfile;
|
|
184
185
|
};
|
|
185
|
-
export type { AnyComposition, ArrayFieldSchema, ArrayItemFieldSchema, DelayRenderScope, JsxComponentIdentity, LoopDisplay, SequenceControls, InteractivitySchemaField, InteractivitySchema, UseBufferState, };
|
|
186
|
+
export type { AnyComposition, AssetFieldSchema, ArrayFieldSchema, ArrayItemFieldSchema, DelayRenderScope, JsxComponentIdentity, LoopDisplay, SequenceControls, InteractivitySchemaField, InteractivitySchema, UseBufferState, };
|
package/dist/cjs/index.js
CHANGED
|
@@ -154,5 +154,6 @@ exports.Config = new Proxy(proxyObj, {
|
|
|
154
154
|
});
|
|
155
155
|
Sequence_js_1.Sequence.displayName = 'Sequence';
|
|
156
156
|
(0, enable_sequence_stack_traces_js_1.addSequenceStackTraces)(Sequence_js_1.Sequence);
|
|
157
|
+
(0, enable_sequence_stack_traces_js_1.setSequenceComponent)(Sequence_js_1.Sequence);
|
|
157
158
|
(0, enable_sequence_stack_traces_js_1.addSequenceStackTraces)(Composition_js_1.Composition);
|
|
158
159
|
(0, enable_sequence_stack_traces_js_1.addSequenceStackTraces)(Folder_js_1.Folder);
|
|
@@ -97,6 +97,12 @@ export type FontFamilyFieldSchema = {
|
|
|
97
97
|
description?: string;
|
|
98
98
|
keyframable?: false;
|
|
99
99
|
};
|
|
100
|
+
export type AssetFieldSchema = {
|
|
101
|
+
type: 'asset';
|
|
102
|
+
default: string | undefined;
|
|
103
|
+
description?: string;
|
|
104
|
+
keyframable?: false;
|
|
105
|
+
};
|
|
100
106
|
export type EnumFieldSchema = {
|
|
101
107
|
type: 'enum';
|
|
102
108
|
default: string;
|
|
@@ -126,7 +132,7 @@ export type ArrayFieldSchema = {
|
|
|
126
132
|
description?: string;
|
|
127
133
|
keyframable?: false;
|
|
128
134
|
};
|
|
129
|
-
export type VisibleFieldSchema = NumberFieldSchema | BooleanFieldSchema | RotationCssFieldSchema | RotationDegreesFieldSchema | TranslateFieldSchema | TransformOriginFieldSchema | ScaleFieldSchema | UvCoordinateFieldSchema | ColorFieldSchema | TextContentFieldSchema | FontFamilyFieldSchema | ArrayFieldSchema | EnumFieldSchema;
|
|
135
|
+
export type VisibleFieldSchema = NumberFieldSchema | BooleanFieldSchema | RotationCssFieldSchema | RotationDegreesFieldSchema | TranslateFieldSchema | TransformOriginFieldSchema | ScaleFieldSchema | UvCoordinateFieldSchema | ColorFieldSchema | TextContentFieldSchema | FontFamilyFieldSchema | AssetFieldSchema | ArrayFieldSchema | EnumFieldSchema;
|
|
130
136
|
export type InteractivitySchemaField = VisibleFieldSchema | HiddenFieldSchema;
|
|
131
137
|
export type InteractivitySchema = {
|
|
132
138
|
[key: string]: InteractivitySchemaField;
|
package/dist/cjs/internals.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import type { JsxComponentIdentity, TCompMetadata, TComposition, TRenderAsset, T
|
|
|
6
6
|
import type { CompositionManagerContext } from './CompositionManagerContext.js';
|
|
7
7
|
import * as CSSUtils from './default-css.js';
|
|
8
8
|
import type { SerializedJSONWithCustomFields } from './input-props-serialization.js';
|
|
9
|
-
import { type ArrayFieldSchema, type ArrayItemFieldSchema, type InteractivitySchemaField, type InteractivitySchema, type VisibleFieldSchema } from './interactivity-schema.js';
|
|
9
|
+
import { type AssetFieldSchema, type ArrayFieldSchema, type ArrayItemFieldSchema, type InteractivitySchemaField, type InteractivitySchema, type VisibleFieldSchema } from './interactivity-schema.js';
|
|
10
10
|
import type { LoggingContextValue } from './log-level-context.js';
|
|
11
11
|
import type { NonceHistory } from './nonce.js';
|
|
12
12
|
import type { RemotionEnvironment } from './remotion-environment-context.js';
|
|
@@ -612,7 +612,7 @@ export declare const Internals: {
|
|
|
612
612
|
readonly EditorPropsContext: import("react").Context<import("./EditorProps.js").EditorPropsContextType>;
|
|
613
613
|
readonly usePreload: (src: string) => string;
|
|
614
614
|
readonly NonceContext: import("react").Context<import("./nonce.js").TNonceContext>;
|
|
615
|
-
readonly resolveVideoConfig: (
|
|
615
|
+
readonly resolveVideoConfig: (params: {
|
|
616
616
|
compositionId: string;
|
|
617
617
|
compositionWidth: number | null;
|
|
618
618
|
compositionHeight: number | null;
|
|
@@ -640,15 +640,34 @@ export declare const Internals: {
|
|
|
640
640
|
type: "error";
|
|
641
641
|
error: Error;
|
|
642
642
|
};
|
|
643
|
+
readonly resolveVideoConfigWithMetadataOrCatch: (params: {
|
|
644
|
+
compositionId: string;
|
|
645
|
+
compositionWidth: number | null;
|
|
646
|
+
compositionHeight: number | null;
|
|
647
|
+
compositionFps: number | null;
|
|
648
|
+
compositionDurationInFrames: number | null;
|
|
649
|
+
calculateMetadata: import("./Composition.js").CalculateMetadataFunction<Record<string, unknown>> | null;
|
|
650
|
+
signal: AbortSignal;
|
|
651
|
+
defaultProps: Record<string, unknown>;
|
|
652
|
+
inputProps: Record<string, unknown>;
|
|
653
|
+
}) => {
|
|
654
|
+
type: "success";
|
|
655
|
+
result: Promise<import("./resolve-video-config.js").VideoConfigWithMetadata> | import("./resolve-video-config.js").VideoConfigWithMetadata;
|
|
656
|
+
} | {
|
|
657
|
+
type: "error";
|
|
658
|
+
error: Error;
|
|
659
|
+
};
|
|
643
660
|
readonly ResolveCompositionContext: import("react").Context<{
|
|
644
661
|
[x: string]: ({
|
|
645
662
|
type: "loading";
|
|
646
663
|
} | {
|
|
647
664
|
type: "success";
|
|
648
665
|
result: import("./video-config.js").VideoConfig;
|
|
666
|
+
metadataSource: import("./resolve-video-config.js").VideoConfigMetadataSource | null;
|
|
649
667
|
} | {
|
|
650
668
|
type: "success-and-refreshing";
|
|
651
669
|
result: import("./video-config.js").VideoConfig;
|
|
670
|
+
metadataSource: import("./resolve-video-config.js").VideoConfigMetadataSource | null;
|
|
652
671
|
} | {
|
|
653
672
|
type: "error";
|
|
654
673
|
error: Error;
|
|
@@ -659,9 +678,11 @@ export declare const Internals: {
|
|
|
659
678
|
} | {
|
|
660
679
|
type: "success";
|
|
661
680
|
result: import("./video-config.js").VideoConfig;
|
|
681
|
+
metadataSource: import("./resolve-video-config.js").VideoConfigMetadataSource | null;
|
|
662
682
|
} | {
|
|
663
683
|
type: "success-and-refreshing";
|
|
664
684
|
result: import("./video-config.js").VideoConfig;
|
|
685
|
+
metadataSource: import("./resolve-video-config.js").VideoConfigMetadataSource | null;
|
|
665
686
|
} | {
|
|
666
687
|
type: "error";
|
|
667
688
|
error: Error;
|
|
@@ -701,6 +722,8 @@ export declare const Internals: {
|
|
|
701
722
|
buffering: import("react").RefObject<boolean>;
|
|
702
723
|
} | null>;
|
|
703
724
|
readonly getComponentsToAddStacksTo: () => unknown[];
|
|
725
|
+
readonly getSequenceComponent: () => unknown;
|
|
726
|
+
readonly getSingleChildComponent: (children: import("react").ReactNode) => unknown;
|
|
704
727
|
readonly CurrentScaleContext: import("react").Context<import("./use-current-scale.js").CurrentScaleContextType | null>;
|
|
705
728
|
readonly PixelDensityContext: import("react").Context<number | null>;
|
|
706
729
|
readonly PreviewSizeContext: import("react").Context<import("./use-current-scale.js").PreviewSizeCtx>;
|
|
@@ -930,4 +953,4 @@ export declare const Internals: {
|
|
|
930
953
|
readonly hiddenFromList: true;
|
|
931
954
|
};
|
|
932
955
|
};
|
|
933
|
-
export type { ArrayFieldSchema, ArrayItemFieldSchema, CannotUpdateSequenceReason, CanUpdateEffectPropsResponse, CanUpdateEffectPropsResponseFalse, CanUpdateEffectPropsResponseTrue, CanUpdateSequencePropsResponse, CanUpdateSequencePropsResponseFalse, CanUpdateSequencePropsResponseTrue, CanUpdateSequencePropStatus, CanUpdateSequencePropStatusEasing, CanUpdateSequencePropStatusFalse, CanUpdateSequencePropStatusKeyframed, CanUpdateSequencePropStatusStatic, VideoConfigNumericExpression, CompositionManagerContext, CompProps, DragOverrides, DragOverrideValue, EffectDragOverrides, GetDragOverrides, GetEffectDragOverrides, GetEffectPropStatuses, GetPropStatuses, JsxComponentIdentity, LoggingContextValue, MediaVolumeContextValue, NonceHistory, OverrideIdsToNodePathsGettersContext, OverrideIdsToNodePathsSettersContext, OverrideIdToNodePaths, OverrideToNodePathGetters, OverrideToNodeSetters, PlaybackRateContextValue, PropStatuses, RemotionAudioContextState, RemotionEnvironment, ResolvedStackLocation, ScheduleAudioNodeOptions, ScheduleAudioNodeResult, InteractivitySchemaField, SequenceNodePath, SequencePropsSubscriptionKey, VideoConfigValues, InteractivitySchema, SerializedJSONWithCustomFields, SetMediaVolumeContextValue, SetTimelineContextValue, TCompMetadata, TComposition, TimelineContextValue, TRenderAsset, TSequence, VisibleFieldSchema, WatchRemotionStaticFilesPayload, };
|
|
956
|
+
export type { ArrayFieldSchema, AssetFieldSchema, ArrayItemFieldSchema, CannotUpdateSequenceReason, CanUpdateEffectPropsResponse, CanUpdateEffectPropsResponseFalse, CanUpdateEffectPropsResponseTrue, CanUpdateSequencePropsResponse, CanUpdateSequencePropsResponseFalse, CanUpdateSequencePropsResponseTrue, CanUpdateSequencePropStatus, CanUpdateSequencePropStatusEasing, CanUpdateSequencePropStatusFalse, CanUpdateSequencePropStatusKeyframed, CanUpdateSequencePropStatusStatic, VideoConfigNumericExpression, CompositionManagerContext, CompProps, DragOverrides, DragOverrideValue, EffectDragOverrides, GetDragOverrides, GetEffectDragOverrides, GetEffectPropStatuses, GetPropStatuses, JsxComponentIdentity, LoggingContextValue, MediaVolumeContextValue, NonceHistory, OverrideIdsToNodePathsGettersContext, OverrideIdsToNodePathsSettersContext, OverrideIdToNodePaths, OverrideToNodePathGetters, OverrideToNodeSetters, PlaybackRateContextValue, PropStatuses, RemotionAudioContextState, RemotionEnvironment, ResolvedStackLocation, ScheduleAudioNodeOptions, ScheduleAudioNodeResult, InteractivitySchemaField, SequenceNodePath, SequencePropsSubscriptionKey, VideoConfigValues, InteractivitySchema, SerializedJSONWithCustomFields, SetMediaVolumeContextValue, SetTimelineContextValue, TCompMetadata, TComposition, TimelineContextValue, TRenderAsset, TSequence, VisibleFieldSchema, WatchRemotionStaticFilesPayload, };
|
package/dist/cjs/internals.js
CHANGED
|
@@ -195,6 +195,7 @@ exports.Internals = {
|
|
|
195
195
|
NonceContext: nonce_js_1.NonceContext,
|
|
196
196
|
resolveVideoConfig: resolve_video_config_js_1.resolveVideoConfig,
|
|
197
197
|
resolveVideoConfigOrCatch: resolve_video_config_js_1.resolveVideoConfigOrCatch,
|
|
198
|
+
resolveVideoConfigWithMetadataOrCatch: resolve_video_config_js_1.resolveVideoConfigWithMetadataOrCatch,
|
|
198
199
|
ResolveCompositionContext: ResolveCompositionConfig_js_1.ResolveCompositionContext,
|
|
199
200
|
useResolvedVideoConfig: ResolveCompositionConfig_js_1.useResolvedVideoConfig,
|
|
200
201
|
resolveCompositionsRef: ResolveCompositionConfig_js_1.resolveCompositionsRef,
|
|
@@ -211,6 +212,8 @@ exports.Internals = {
|
|
|
211
212
|
BufferingProvider: buffering_js_1.BufferingProvider,
|
|
212
213
|
BufferingContextReact: buffering_js_1.BufferingContextReact,
|
|
213
214
|
getComponentsToAddStacksTo: enable_sequence_stack_traces_js_1.getComponentsToAddStacksTo,
|
|
215
|
+
getSequenceComponent: enable_sequence_stack_traces_js_1.getSequenceComponent,
|
|
216
|
+
getSingleChildComponent: enable_sequence_stack_traces_js_1.getSingleChildComponent,
|
|
214
217
|
CurrentScaleContext: use_current_scale_js_1.CurrentScaleContext,
|
|
215
218
|
PixelDensityContext: use_pixel_density_js_1.PixelDensityContext,
|
|
216
219
|
PreviewSizeContext: use_current_scale_js_1.PreviewSizeContext,
|
|
@@ -13,7 +13,25 @@ type ResolveVideoConfigParams = {
|
|
|
13
13
|
defaultProps: Record<string, unknown>;
|
|
14
14
|
inputProps: Record<string, unknown>;
|
|
15
15
|
};
|
|
16
|
-
export
|
|
16
|
+
export type VideoConfigMetadataSource = {
|
|
17
|
+
readonly durationInFrames: 'calculate-metadata' | 'composition';
|
|
18
|
+
readonly fps: 'calculate-metadata' | 'composition';
|
|
19
|
+
readonly height: 'calculate-metadata' | 'composition';
|
|
20
|
+
readonly width: 'calculate-metadata' | 'composition';
|
|
21
|
+
};
|
|
22
|
+
export type VideoConfigWithMetadata = {
|
|
23
|
+
readonly metadataSource: VideoConfigMetadataSource;
|
|
24
|
+
readonly videoConfig: VideoConfig;
|
|
25
|
+
};
|
|
26
|
+
export declare const resolveVideoConfigWithMetadata: ({ calculateMetadata, signal, defaultProps, inputProps: originalProps, compositionId, compositionDurationInFrames, compositionFps, compositionHeight, compositionWidth, }: ResolveVideoConfigParams) => Promise<VideoConfigWithMetadata> | VideoConfigWithMetadata;
|
|
27
|
+
export declare const resolveVideoConfig: (params: ResolveVideoConfigParams) => Promise<VideoConfig> | VideoConfig;
|
|
28
|
+
export declare const resolveVideoConfigWithMetadataOrCatch: (params: ResolveVideoConfigParams) => {
|
|
29
|
+
type: "success";
|
|
30
|
+
result: Promise<VideoConfigWithMetadata> | VideoConfigWithMetadata;
|
|
31
|
+
} | {
|
|
32
|
+
type: "error";
|
|
33
|
+
error: Error;
|
|
34
|
+
};
|
|
17
35
|
export declare const resolveVideoConfigOrCatch: (params: ResolveVideoConfigParams) => {
|
|
18
36
|
type: "success";
|
|
19
37
|
result: Promise<VideoConfig> | VideoConfig;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.resolveVideoConfigOrCatch = exports.resolveVideoConfig = void 0;
|
|
3
|
+
exports.resolveVideoConfigOrCatch = exports.resolveVideoConfigWithMetadataOrCatch = exports.resolveVideoConfig = exports.resolveVideoConfigWithMetadata = void 0;
|
|
4
4
|
const get_remotion_environment_js_1 = require("./get-remotion-environment.js");
|
|
5
5
|
const input_props_serialization_js_1 = require("./input-props-serialization.js");
|
|
6
6
|
const validate_default_codec_js_1 = require("./validation/validate-default-codec.js");
|
|
@@ -42,8 +42,40 @@ const validateCalculated = ({ calculated, compositionId, compositionFps, composi
|
|
|
42
42
|
defaultSampleRate,
|
|
43
43
|
};
|
|
44
44
|
};
|
|
45
|
-
const
|
|
45
|
+
const makeVideoConfigWithMetadata = ({ calculated, compositionDurationInFrames, compositionFps, compositionHeight, compositionId, compositionWidth, defaultProps, originalProps, }) => {
|
|
46
46
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
47
|
+
const data = validateCalculated({
|
|
48
|
+
calculated,
|
|
49
|
+
compositionDurationInFrames,
|
|
50
|
+
compositionFps,
|
|
51
|
+
compositionHeight,
|
|
52
|
+
compositionWidth,
|
|
53
|
+
compositionId,
|
|
54
|
+
});
|
|
55
|
+
return {
|
|
56
|
+
metadataSource: {
|
|
57
|
+
durationInFrames: (calculated === null || calculated === void 0 ? void 0 : calculated.durationInFrames) === undefined
|
|
58
|
+
? 'composition'
|
|
59
|
+
: 'calculate-metadata',
|
|
60
|
+
fps: (calculated === null || calculated === void 0 ? void 0 : calculated.fps) === undefined ? 'composition' : 'calculate-metadata',
|
|
61
|
+
height: (calculated === null || calculated === void 0 ? void 0 : calculated.height) === undefined ? 'composition' : 'calculate-metadata',
|
|
62
|
+
width: (calculated === null || calculated === void 0 ? void 0 : calculated.width) === undefined ? 'composition' : 'calculate-metadata',
|
|
63
|
+
},
|
|
64
|
+
videoConfig: {
|
|
65
|
+
...data,
|
|
66
|
+
id: compositionId,
|
|
67
|
+
defaultProps: (0, input_props_serialization_js_1.serializeThenDeserializeInStudio)(defaultProps !== null && defaultProps !== void 0 ? defaultProps : {}),
|
|
68
|
+
props: (0, input_props_serialization_js_1.serializeThenDeserializeInStudio)((_a = calculated === null || calculated === void 0 ? void 0 : calculated.props) !== null && _a !== void 0 ? _a : originalProps),
|
|
69
|
+
defaultCodec: (_b = data.defaultCodec) !== null && _b !== void 0 ? _b : null,
|
|
70
|
+
defaultOutName: (_c = data.defaultOutName) !== null && _c !== void 0 ? _c : null,
|
|
71
|
+
defaultVideoImageFormat: (_d = data.defaultVideoImageFormat) !== null && _d !== void 0 ? _d : null,
|
|
72
|
+
defaultPixelFormat: (_e = data.defaultPixelFormat) !== null && _e !== void 0 ? _e : null,
|
|
73
|
+
defaultProResProfile: (_f = data.defaultProResProfile) !== null && _f !== void 0 ? _f : null,
|
|
74
|
+
defaultSampleRate: (_g = data.defaultSampleRate) !== null && _g !== void 0 ? _g : null,
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
const resolveVideoConfigWithMetadata = ({ calculateMetadata, signal, defaultProps, inputProps: originalProps, compositionId, compositionDurationInFrames, compositionFps, compositionHeight, compositionWidth, }) => {
|
|
47
79
|
const calculatedProm = calculateMetadata
|
|
48
80
|
? calculateMetadata({
|
|
49
81
|
defaultProps,
|
|
@@ -57,68 +89,53 @@ const resolveVideoConfig = ({ calculateMetadata, signal, defaultProps, inputProp
|
|
|
57
89
|
typeof calculatedProm === 'object' &&
|
|
58
90
|
'then' in calculatedProm) {
|
|
59
91
|
return calculatedProm.then((c) => {
|
|
60
|
-
|
|
61
|
-
const { height, width, durationInFrames, fps, defaultCodec, defaultOutName, defaultVideoImageFormat, defaultPixelFormat, defaultProResProfile, defaultSampleRate, } = validateCalculated({
|
|
92
|
+
return makeVideoConfigWithMetadata({
|
|
62
93
|
calculated: c,
|
|
63
94
|
compositionDurationInFrames,
|
|
64
95
|
compositionFps,
|
|
65
96
|
compositionHeight,
|
|
66
97
|
compositionWidth,
|
|
67
98
|
compositionId,
|
|
99
|
+
defaultProps,
|
|
100
|
+
originalProps,
|
|
68
101
|
});
|
|
69
|
-
return {
|
|
70
|
-
width,
|
|
71
|
-
height,
|
|
72
|
-
fps,
|
|
73
|
-
durationInFrames,
|
|
74
|
-
id: compositionId,
|
|
75
|
-
defaultProps: (0, input_props_serialization_js_1.serializeThenDeserializeInStudio)(defaultProps),
|
|
76
|
-
props: (0, input_props_serialization_js_1.serializeThenDeserializeInStudio)((_a = c.props) !== null && _a !== void 0 ? _a : originalProps),
|
|
77
|
-
defaultCodec: defaultCodec !== null && defaultCodec !== void 0 ? defaultCodec : null,
|
|
78
|
-
defaultOutName: defaultOutName !== null && defaultOutName !== void 0 ? defaultOutName : null,
|
|
79
|
-
defaultVideoImageFormat: defaultVideoImageFormat !== null && defaultVideoImageFormat !== void 0 ? defaultVideoImageFormat : null,
|
|
80
|
-
defaultPixelFormat: defaultPixelFormat !== null && defaultPixelFormat !== void 0 ? defaultPixelFormat : null,
|
|
81
|
-
defaultProResProfile: defaultProResProfile !== null && defaultProResProfile !== void 0 ? defaultProResProfile : null,
|
|
82
|
-
defaultSampleRate: defaultSampleRate !== null && defaultSampleRate !== void 0 ? defaultSampleRate : null,
|
|
83
|
-
};
|
|
84
102
|
});
|
|
85
103
|
}
|
|
86
|
-
|
|
104
|
+
return makeVideoConfigWithMetadata({
|
|
87
105
|
calculated: calculatedProm,
|
|
88
106
|
compositionDurationInFrames,
|
|
89
107
|
compositionFps,
|
|
90
108
|
compositionHeight,
|
|
91
109
|
compositionWidth,
|
|
92
110
|
compositionId,
|
|
111
|
+
defaultProps,
|
|
112
|
+
originalProps,
|
|
93
113
|
});
|
|
94
|
-
|
|
114
|
+
};
|
|
115
|
+
exports.resolveVideoConfigWithMetadata = resolveVideoConfigWithMetadata;
|
|
116
|
+
const resolveVideoConfig = (params) => {
|
|
117
|
+
const resolved = (0, exports.resolveVideoConfigWithMetadata)(params);
|
|
118
|
+
if (typeof resolved === 'object' && 'then' in resolved) {
|
|
119
|
+
return resolved.then(({ videoConfig }) => videoConfig);
|
|
120
|
+
}
|
|
121
|
+
return resolved.videoConfig;
|
|
122
|
+
};
|
|
123
|
+
exports.resolveVideoConfig = resolveVideoConfig;
|
|
124
|
+
const resolveVideoConfigWithMetadataOrCatch = (params) => {
|
|
125
|
+
try {
|
|
95
126
|
return {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
defaultProResProfile: null,
|
|
105
|
-
defaultSampleRate: null,
|
|
127
|
+
type: 'success',
|
|
128
|
+
result: (0, exports.resolveVideoConfigWithMetadata)(params),
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
catch (err) {
|
|
132
|
+
return {
|
|
133
|
+
type: 'error',
|
|
134
|
+
error: err,
|
|
106
135
|
};
|
|
107
136
|
}
|
|
108
|
-
return {
|
|
109
|
-
...data,
|
|
110
|
-
id: compositionId,
|
|
111
|
-
defaultProps: (0, input_props_serialization_js_1.serializeThenDeserializeInStudio)(defaultProps !== null && defaultProps !== void 0 ? defaultProps : {}),
|
|
112
|
-
props: (0, input_props_serialization_js_1.serializeThenDeserializeInStudio)((_a = calculatedProm.props) !== null && _a !== void 0 ? _a : originalProps),
|
|
113
|
-
defaultCodec: (_b = calculatedProm.defaultCodec) !== null && _b !== void 0 ? _b : null,
|
|
114
|
-
defaultOutName: (_c = calculatedProm.defaultOutName) !== null && _c !== void 0 ? _c : null,
|
|
115
|
-
defaultVideoImageFormat: (_d = calculatedProm.defaultVideoImageFormat) !== null && _d !== void 0 ? _d : null,
|
|
116
|
-
defaultPixelFormat: (_e = calculatedProm.defaultPixelFormat) !== null && _e !== void 0 ? _e : null,
|
|
117
|
-
defaultProResProfile: (_f = calculatedProm.defaultProResProfile) !== null && _f !== void 0 ? _f : null,
|
|
118
|
-
defaultSampleRate: (_g = calculatedProm.defaultSampleRate) !== null && _g !== void 0 ? _g : null,
|
|
119
|
-
};
|
|
120
137
|
};
|
|
121
|
-
exports.
|
|
138
|
+
exports.resolveVideoConfigWithMetadataOrCatch = resolveVideoConfigWithMetadataOrCatch;
|
|
122
139
|
const resolveVideoConfigOrCatch = (params) => {
|
|
123
140
|
try {
|
|
124
141
|
const promiseOrReturnValue = (0, exports.resolveVideoConfig)(params);
|
package/dist/cjs/use-schema.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.computeEffectiveSchemaValuesDotNotation = exports.isKeyframedStatus = exports.getStaticDragOverrideValue = exports.makeKeyframedDragOverride = exports.makeStaticDragOverride = exports.DEFAULT_LINEAR_EASING = void 0;
|
|
4
4
|
const find_props_to_delete_js_1 = require("./find-props-to-delete.js");
|
|
5
5
|
const get_effective_visual_mode_value_js_1 = require("./get-effective-visual-mode-value.js");
|
|
6
|
+
const input_props_serialization_js_1 = require("./input-props-serialization.js");
|
|
6
7
|
const interpolate_keyframed_status_js_1 = require("./interpolate-keyframed-status.js");
|
|
7
8
|
exports.DEFAULT_LINEAR_EASING = {
|
|
8
9
|
type: 'linear',
|
|
@@ -132,6 +133,11 @@ const computeEffectiveSchemaValuesDotNotation = ({ schema, currentValue, overrid
|
|
|
132
133
|
shouldResortToDefaultValueIfUndefined: false,
|
|
133
134
|
});
|
|
134
135
|
}
|
|
136
|
+
if ((field === null || field === void 0 ? void 0 : field.type) === 'asset' &&
|
|
137
|
+
typeof value === 'string' &&
|
|
138
|
+
value.startsWith(input_props_serialization_js_1.FILE_TOKEN)) {
|
|
139
|
+
value = `${window.remotion_staticBase}/${value.slice(input_props_serialization_js_1.FILE_TOKEN.length)}`;
|
|
140
|
+
}
|
|
135
141
|
if (value === undefined) {
|
|
136
142
|
propsToDelete.add(key);
|
|
137
143
|
}
|
package/dist/cjs/version.d.ts
CHANGED
package/dist/cjs/version.js
CHANGED
|
@@ -15,9 +15,11 @@ export declare function useRemotionContexts(): {
|
|
|
15
15
|
} | {
|
|
16
16
|
type: "success";
|
|
17
17
|
result: import("./video-config.js").VideoConfig;
|
|
18
|
+
metadataSource: import("./resolve-video-config.js").VideoConfigMetadataSource | null;
|
|
18
19
|
} | {
|
|
19
20
|
type: "success-and-refreshing";
|
|
20
21
|
result: import("./video-config.js").VideoConfig;
|
|
22
|
+
metadataSource: import("./resolve-video-config.js").VideoConfigMetadataSource | null;
|
|
21
23
|
} | {
|
|
22
24
|
type: "error";
|
|
23
25
|
error: Error;
|