remotion 4.0.490 → 4.0.492
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 +4 -0
- package/dist/cjs/HtmlInCanvas.js +116 -67
- package/dist/cjs/Img.d.ts +6 -0
- package/dist/cjs/Img.js +6 -0
- package/dist/cjs/Sequence.d.ts +4 -0
- package/dist/cjs/Sequence.js +7 -1
- package/dist/cjs/SequenceManager.d.ts +7 -0
- package/dist/cjs/SequenceManager.js +1 -1
- package/dist/cjs/animated-image/AnimatedImage.js +6 -0
- package/dist/cjs/audio/shared-audio-tags.js +19 -10
- 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 +6 -4
- package/dist/cjs/internals.js +2 -0
- package/dist/cjs/interpolate-translate.d.ts +8 -0
- package/dist/cjs/interpolate-translate.js +70 -0
- package/dist/cjs/series/index.js +107 -34
- package/dist/cjs/use-media-in-timeline.js +1 -0
- package/dist/cjs/use-schema.d.ts +17 -0
- 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-in-schema.d.ts +3 -3
- package/dist/cjs/wrap-in-schema.js +2 -2
- package/dist/esm/index.mjs +341 -180
- package/dist/esm/version.mjs +1 -1
- package/package.json +2 -2
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';
|
|
@@ -14,11 +14,11 @@ import type { OverrideIdToNodePaths, OverrideToNodePathGetters, OverrideToNodeSe
|
|
|
14
14
|
import { OverrideIdsToNodePathsGettersContext, OverrideIdsToNodePathsSettersContext } from './sequence-node-path.js';
|
|
15
15
|
import type { ResolvedStackLocation } from './sequence-stack-traces.js';
|
|
16
16
|
import type { CannotUpdateSequenceReason } from './SequenceManager.js';
|
|
17
|
-
import { type CanUpdateEffectPropsResponse, type CanUpdateEffectPropsResponseFalse, type CanUpdateEffectPropsResponseTrue, type CanUpdateSequencePropsResponse, type CanUpdateSequencePropsResponseFalse, type CanUpdateSequencePropsResponseTrue, type SequenceNodePath, type SequencePropsSubscriptionKey } from './SequenceManager.js';
|
|
17
|
+
import { type CanUpdateEffectPropsResponse, type CanUpdateEffectPropsResponseFalse, type CanUpdateEffectPropsResponseTrue, type CanUpdateSequencePropsResponse, type CanUpdateSequencePropsResponseFalse, type CanUpdateSequencePropsResponseTrue, type SequenceNodePath, type SequencePropsSubscriptionKey, type VideoConfigValues } from './SequenceManager.js';
|
|
18
18
|
import * as TimelinePosition from './timeline-position-state.js';
|
|
19
19
|
import { type PlaybackRateContextValue, type SetTimelineContextValue, type TimelineContextValue } from './TimelineContext.js';
|
|
20
20
|
import { truthy } from './truthy.js';
|
|
21
|
-
import type { CanUpdateSequencePropStatusFalse, CanUpdateSequencePropStatusEasing, CanUpdateSequencePropStatusKeyframed, CanUpdateSequencePropStatusStatic, DragOverrideValue, GetDragOverrides, GetEffectDragOverrides, GetEffectPropStatuses, GetPropStatuses } from './use-schema.js';
|
|
21
|
+
import type { CanUpdateSequencePropStatusFalse, CanUpdateSequencePropStatusEasing, CanUpdateSequencePropStatusKeyframed, CanUpdateSequencePropStatusStatic, DragOverrideValue, GetDragOverrides, GetEffectDragOverrides, GetEffectPropStatuses, GetPropStatuses, VideoConfigNumericExpression } from './use-schema.js';
|
|
22
22
|
import { type CanUpdateSequencePropStatus, type DragOverrides, type EffectDragOverrides, type PropStatuses } from './use-schema.js';
|
|
23
23
|
import type { MediaVolumeContextValue, SetMediaVolumeContextValue } from './volume-position-state.js';
|
|
24
24
|
import type { WatchRemotionStaticFilesPayload } from './watch-static-file.js';
|
|
@@ -701,6 +701,8 @@ export declare const Internals: {
|
|
|
701
701
|
buffering: import("react").RefObject<boolean>;
|
|
702
702
|
} | null>;
|
|
703
703
|
readonly getComponentsToAddStacksTo: () => unknown[];
|
|
704
|
+
readonly getSequenceComponent: () => unknown;
|
|
705
|
+
readonly getSingleChildComponent: (children: import("react").ReactNode) => unknown;
|
|
704
706
|
readonly CurrentScaleContext: import("react").Context<import("./use-current-scale.js").CurrentScaleContextType | null>;
|
|
705
707
|
readonly PixelDensityContext: import("react").Context<number | null>;
|
|
706
708
|
readonly PreviewSizeContext: import("react").Context<import("./use-current-scale.js").PreviewSizeCtx>;
|
|
@@ -930,4 +932,4 @@ export declare const Internals: {
|
|
|
930
932
|
readonly hiddenFromList: true;
|
|
931
933
|
};
|
|
932
934
|
};
|
|
933
|
-
export type { ArrayFieldSchema, ArrayItemFieldSchema, CannotUpdateSequenceReason, CanUpdateEffectPropsResponse, CanUpdateEffectPropsResponseFalse, CanUpdateEffectPropsResponseTrue, CanUpdateSequencePropsResponse, CanUpdateSequencePropsResponseFalse, CanUpdateSequencePropsResponseTrue, CanUpdateSequencePropStatus, CanUpdateSequencePropStatusEasing, CanUpdateSequencePropStatusFalse, CanUpdateSequencePropStatusKeyframed, CanUpdateSequencePropStatusStatic, 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, InteractivitySchema, SerializedJSONWithCustomFields, SetMediaVolumeContextValue, SetTimelineContextValue, TCompMetadata, TComposition, TimelineContextValue, TRenderAsset, TSequence, VisibleFieldSchema, WatchRemotionStaticFilesPayload, };
|
|
935
|
+
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
|
@@ -211,6 +211,8 @@ exports.Internals = {
|
|
|
211
211
|
BufferingProvider: buffering_js_1.BufferingProvider,
|
|
212
212
|
BufferingContextReact: buffering_js_1.BufferingContextReact,
|
|
213
213
|
getComponentsToAddStacksTo: enable_sequence_stack_traces_js_1.getComponentsToAddStacksTo,
|
|
214
|
+
getSequenceComponent: enable_sequence_stack_traces_js_1.getSequenceComponent,
|
|
215
|
+
getSingleChildComponent: enable_sequence_stack_traces_js_1.getSingleChildComponent,
|
|
214
216
|
CurrentScaleContext: use_current_scale_js_1.CurrentScaleContext,
|
|
215
217
|
PixelDensityContext: use_pixel_density_js_1.PixelDensityContext,
|
|
216
218
|
PreviewSizeContext: use_current_scale_js_1.PreviewSizeContext,
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type InterpolateOptions } from './interpolate.js';
|
|
2
|
+
export type InterpolateTranslateOptions = InterpolateOptions;
|
|
3
|
+
export declare const interpolateTranslate: (input: number, inputRange: readonly number[], outputRange: readonly string[], options?: Partial<{
|
|
4
|
+
easing: import("./interpolate.js").EasingFunction | readonly import("./interpolate.js").EasingFunction[];
|
|
5
|
+
extrapolateLeft: import("./interpolate.js").ExtrapolateType;
|
|
6
|
+
extrapolateRight: import("./interpolate.js").ExtrapolateType;
|
|
7
|
+
posterize: number;
|
|
8
|
+
}> | undefined) => string;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.interpolateTranslate = void 0;
|
|
4
|
+
const interpolate_js_1 = require("./interpolate.js");
|
|
5
|
+
const pixelValueRegex = /^([+-]?(?:\d+\.?\d*|\.\d+))px$/;
|
|
6
|
+
const parseTranslate = (value) => {
|
|
7
|
+
if (typeof value !== 'string') {
|
|
8
|
+
throw new TypeError(`outputRange must contain only strings, but got ${typeof value}`);
|
|
9
|
+
}
|
|
10
|
+
const parts = value.trim().split(/\s+/);
|
|
11
|
+
if (parts.length < 1 || parts.length > 3 || parts[0] === '') {
|
|
12
|
+
throw new TypeError(`translate values must contain 1 to 3 pixel values, but got "${value}"`);
|
|
13
|
+
}
|
|
14
|
+
return parts.map((part) => {
|
|
15
|
+
const match = pixelValueRegex.exec(part);
|
|
16
|
+
if (match === null) {
|
|
17
|
+
throw new TypeError(`interpolateTranslate() only supports px values, but got "${part}" in "${value}"`);
|
|
18
|
+
}
|
|
19
|
+
return Number(match[1]);
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
/*
|
|
23
|
+
* @description Allows you to map a range of values to CSS translate values using pixel units.
|
|
24
|
+
* @see [Documentation](https://remotion.dev/docs/interpolate-translate)
|
|
25
|
+
*/
|
|
26
|
+
const interpolateTranslate = (input, inputRange, outputRange, options) => {
|
|
27
|
+
var _a;
|
|
28
|
+
if (typeof input === 'undefined') {
|
|
29
|
+
throw new TypeError('input can not be undefined');
|
|
30
|
+
}
|
|
31
|
+
if (typeof inputRange === 'undefined') {
|
|
32
|
+
throw new TypeError('inputRange can not be undefined');
|
|
33
|
+
}
|
|
34
|
+
if (typeof outputRange === 'undefined') {
|
|
35
|
+
throw new TypeError('outputRange can not be undefined');
|
|
36
|
+
}
|
|
37
|
+
if (inputRange.length !== outputRange.length) {
|
|
38
|
+
throw new TypeError('inputRange (' +
|
|
39
|
+
inputRange.length +
|
|
40
|
+
' values provided) and outputRange (' +
|
|
41
|
+
outputRange.length +
|
|
42
|
+
' values provided) must have the same length');
|
|
43
|
+
}
|
|
44
|
+
const parsedOutputRange = outputRange.map((translateValue) => parseTranslate(translateValue));
|
|
45
|
+
const firstValueLength = (_a = parsedOutputRange[0]) === null || _a === void 0 ? void 0 : _a.length;
|
|
46
|
+
if (firstValueLength === undefined) {
|
|
47
|
+
throw new TypeError('outputRange must have at least 1 element');
|
|
48
|
+
}
|
|
49
|
+
for (const parsedTranslate of parsedOutputRange) {
|
|
50
|
+
if (parsedTranslate.length !== firstValueLength) {
|
|
51
|
+
throw new TypeError(`All translate values must have the same number of pixel values, but got ${firstValueLength} and ${parsedTranslate.length}`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return new Array(firstValueLength)
|
|
55
|
+
.fill(true)
|
|
56
|
+
.map((_, index) => {
|
|
57
|
+
const outputValues = [];
|
|
58
|
+
for (const translateValue of parsedOutputRange) {
|
|
59
|
+
const value = translateValue[index];
|
|
60
|
+
if (value === undefined) {
|
|
61
|
+
throw new TypeError(`All translate values must have the same number of pixel values, but got ${firstValueLength} and ${translateValue.length}`);
|
|
62
|
+
}
|
|
63
|
+
outputValues.push(value);
|
|
64
|
+
}
|
|
65
|
+
const interpolatedValue = (0, interpolate_js_1.interpolate)(input, inputRange, outputValues, options);
|
|
66
|
+
return `${interpolatedValue}px`;
|
|
67
|
+
})
|
|
68
|
+
.join(' ');
|
|
69
|
+
};
|
|
70
|
+
exports.interpolateTranslate = interpolateTranslate;
|
package/dist/cjs/series/index.js
CHANGED
|
@@ -1,63 +1,136 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
36
|
exports.Series = void 0;
|
|
4
37
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 = require("react");
|
|
38
|
+
const react_1 = __importStar(require("react"));
|
|
6
39
|
const enable_sequence_stack_traces_js_1 = require("../enable-sequence-stack-traces.js");
|
|
40
|
+
const Interactive_js_1 = require("../Interactive.js");
|
|
7
41
|
const interactivity_schema_js_1 = require("../interactivity-schema.js");
|
|
8
42
|
const Sequence_js_1 = require("../Sequence.js");
|
|
9
43
|
const validate_duration_in_frames_js_1 = require("../validation/validate-duration-in-frames.js");
|
|
10
44
|
const with_interactivity_schema_js_1 = require("../with-interactivity-schema.js");
|
|
11
45
|
const flatten_children_js_1 = require("./flatten-children.js");
|
|
12
46
|
const is_inside_series_js_1 = require("./is-inside-series.js");
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
47
|
+
const seriesSequenceSchema = {
|
|
48
|
+
durationInFrames: Interactive_js_1.Interactive.baseSchema.durationInFrames,
|
|
49
|
+
name: Interactive_js_1.Interactive.sequenceSchema.name,
|
|
50
|
+
hidden: Interactive_js_1.Interactive.sequenceSchema.hidden,
|
|
51
|
+
showInTimeline: Interactive_js_1.Interactive.sequenceSchema.showInTimeline,
|
|
52
|
+
freeze: Interactive_js_1.Interactive.baseSchema.freeze,
|
|
53
|
+
layout: Interactive_js_1.Interactive.sequenceSchema.layout,
|
|
17
54
|
};
|
|
18
|
-
const
|
|
55
|
+
const SeriesSequenceInner = (0, react_1.forwardRef)(({ offset = 0, className = '', stack = null, _remotionInternalRender = null, ...props }, ref) => {
|
|
56
|
+
(0, is_inside_series_js_1.useRequireToBeInsideSeries)();
|
|
57
|
+
if (_remotionInternalRender) {
|
|
58
|
+
return _remotionInternalRender({ ...props, offset, className: className || undefined, stack }, ref);
|
|
59
|
+
}
|
|
60
|
+
return (jsx_runtime_1.jsx(is_inside_series_js_1.IsNotInsideSeriesProvider, { children: props.children }));
|
|
61
|
+
});
|
|
62
|
+
const SeriesSequence = Interactive_js_1.Interactive.withSchema({
|
|
63
|
+
Component: SeriesSequenceInner,
|
|
64
|
+
componentName: '<Series.Sequence>',
|
|
65
|
+
componentIdentity: 'dev.remotion.remotion.Series.Sequence',
|
|
66
|
+
schema: seriesSequenceSchema,
|
|
67
|
+
supportsEffects: false,
|
|
68
|
+
});
|
|
19
69
|
const SequenceWithoutSchemaWithRef = Sequence_js_1.SequenceWithoutSchema;
|
|
70
|
+
const validateSeriesSequenceProps = ({ durationInFrames, offset: offsetProp, index, childrenLength, }) => {
|
|
71
|
+
const debugInfo = `index = ${index}, duration = ${durationInFrames}`;
|
|
72
|
+
if (index !== childrenLength - 1 || durationInFrames !== Infinity) {
|
|
73
|
+
(0, validate_duration_in_frames_js_1.validateDurationInFrames)(durationInFrames, {
|
|
74
|
+
component: `of a <Series.Sequence /> component`,
|
|
75
|
+
allowFloats: true,
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
const offset = offsetProp !== null && offsetProp !== void 0 ? offsetProp : 0;
|
|
79
|
+
if (Number.isNaN(offset)) {
|
|
80
|
+
throw new TypeError(`The "offset" property of a <Series.Sequence /> must not be NaN, but got NaN (${debugInfo}).`);
|
|
81
|
+
}
|
|
82
|
+
if (!Number.isFinite(offset)) {
|
|
83
|
+
throw new TypeError(`The "offset" property of a <Series.Sequence /> must be finite, but got ${offset} (${debugInfo}).`);
|
|
84
|
+
}
|
|
85
|
+
if (offset % 1 !== 0) {
|
|
86
|
+
throw new TypeError(`The "offset" property of a <Series.Sequence /> must be finite, but got ${offset} (${debugInfo}).`);
|
|
87
|
+
}
|
|
88
|
+
return offset;
|
|
89
|
+
};
|
|
20
90
|
const SeriesInner = (props) => {
|
|
21
91
|
const childrenValue = (0, react_1.useMemo)(() => {
|
|
22
|
-
let startFrame = 0;
|
|
23
92
|
const flattenedChildren = (0, flatten_children_js_1.flattenChildren)(props.children);
|
|
24
|
-
|
|
25
|
-
|
|
93
|
+
const renderChildren = (i, startFrame) => {
|
|
94
|
+
if (i === flattenedChildren.length) {
|
|
95
|
+
return null;
|
|
96
|
+
}
|
|
97
|
+
const child = flattenedChildren[i];
|
|
26
98
|
const castedChild = child;
|
|
27
99
|
if (typeof castedChild === 'string') {
|
|
28
100
|
// Don't throw if it's just some accidential whitespace
|
|
29
101
|
if (castedChild.trim() === '') {
|
|
30
|
-
return
|
|
102
|
+
return renderChildren(i + 1, startFrame);
|
|
31
103
|
}
|
|
32
104
|
throw new TypeError(`The <Series /> component only accepts a list of <Series.Sequence /> components as its children, but you passed a string "${castedChild}"`);
|
|
33
105
|
}
|
|
34
106
|
if (castedChild.type !== SeriesSequence) {
|
|
35
107
|
throw new TypeError(`The <Series /> component only accepts a list of <Series.Sequence /> components as its children, but got ${castedChild} instead`);
|
|
36
108
|
}
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
109
|
+
const castedElement = castedChild;
|
|
110
|
+
validateSeriesSequenceProps({
|
|
111
|
+
durationInFrames: castedElement.props.durationInFrames,
|
|
112
|
+
offset: castedElement.props.offset,
|
|
113
|
+
index: i,
|
|
114
|
+
childrenLength: flattenedChildren.length,
|
|
115
|
+
});
|
|
116
|
+
return react_1.default.cloneElement(castedElement, {
|
|
117
|
+
_remotionInternalRender: (resolvedProps, ref) => {
|
|
118
|
+
const durationInFramesProp = resolvedProps.durationInFrames;
|
|
119
|
+
const { durationInFrames: _durationInFrames, children: sequenceChildren, offset: offsetProp, controls, stack, from: _from, name, ...passedProps } = resolvedProps; // `from` is not accepted and must be filtered out if used in JS
|
|
120
|
+
const offset = validateSeriesSequenceProps({
|
|
121
|
+
durationInFrames: durationInFramesProp,
|
|
122
|
+
offset: offsetProp,
|
|
123
|
+
index: i,
|
|
124
|
+
childrenLength: flattenedChildren.length,
|
|
125
|
+
});
|
|
126
|
+
const currentStartFrame = startFrame + offset;
|
|
127
|
+
const nextStartFrame = startFrame + durationInFramesProp + offset;
|
|
128
|
+
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
129
|
+
jsx_runtime_1.jsx(SequenceWithoutSchemaWithRef, { ref: ref, name: name || '<Series.Sequence>', _remotionInternalDocumentationLink: name ? undefined : 'https://www.remotion.dev/docs/series', _remotionInternalStack: stack !== null && stack !== void 0 ? stack : undefined, controls: controls !== null && controls !== void 0 ? controls : undefined, from: currentStartFrame, durationInFrames: durationInFramesProp, ...passedProps, children: jsx_runtime_1.jsx(is_inside_series_js_1.IsNotInsideSeriesProvider, { children: sequenceChildren }) }), renderChildren(i + 1, nextStartFrame)] }));
|
|
130
|
+
},
|
|
131
|
+
});
|
|
132
|
+
};
|
|
133
|
+
return renderChildren(0, 0);
|
|
61
134
|
}, [props.children]);
|
|
62
135
|
return (jsx_runtime_1.jsx(is_inside_series_js_1.IsInsideSeriesContainer, { children: jsx_runtime_1.jsx(Sequence_js_1.Sequence, { layout: "none", name: "<Series>", _remotionInternalDocumentationLink: "https://www.remotion.dev/docs/series", ...props, children: childrenValue }) }));
|
|
63
136
|
};
|
|
@@ -133,6 +133,7 @@ const useMediaInTimeline = ({ volume, mediaVolume, src, mediaType, playbackRate,
|
|
|
133
133
|
showInTimeline: true,
|
|
134
134
|
nonce: nonce.get(),
|
|
135
135
|
startMediaFrom: 0 - startsAt,
|
|
136
|
+
mediaFrameAtSequenceZero: null,
|
|
136
137
|
doesVolumeChange,
|
|
137
138
|
loopDisplay,
|
|
138
139
|
playbackRate,
|
package/dist/cjs/use-schema.d.ts
CHANGED
|
@@ -4,10 +4,27 @@ import type { CanUpdateSequencePropsResponse, SequencePropsSubscriptionKey } fro
|
|
|
4
4
|
export type CanUpdateSequencePropStatusStatic = {
|
|
5
5
|
status: 'static';
|
|
6
6
|
codeValue: unknown;
|
|
7
|
+
numericExpression?: VideoConfigNumericExpression;
|
|
7
8
|
};
|
|
8
9
|
export type CanUpdateSequencePropStatusKeyframe = {
|
|
9
10
|
frame: number;
|
|
10
11
|
value: unknown;
|
|
12
|
+
frameExpression?: VideoConfigNumericExpression;
|
|
13
|
+
};
|
|
14
|
+
export type VideoConfigNumericExpression = {
|
|
15
|
+
type: 'literal';
|
|
16
|
+
value: number;
|
|
17
|
+
} | {
|
|
18
|
+
type: 'video-config-value';
|
|
19
|
+
identifier: string;
|
|
20
|
+
value: number;
|
|
21
|
+
} | {
|
|
22
|
+
type: 'video-config-multiplication';
|
|
23
|
+
identifier: string;
|
|
24
|
+
multiplier: number;
|
|
25
|
+
multiplicand: number;
|
|
26
|
+
factorPosition: 'left' | 'right';
|
|
27
|
+
value: number;
|
|
11
28
|
};
|
|
12
29
|
export type CanUpdateSequencePropStatusLinearEasing = {
|
|
13
30
|
type: 'linear';
|
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
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { SequenceControls } from './CompositionManager.js';
|
|
3
|
-
import { type
|
|
3
|
+
import { type SequenceSchema } from './sequence-field-schema.js';
|
|
4
4
|
export declare const getNestedValue: (obj: Record<string, unknown>, key: string) => unknown;
|
|
5
5
|
export declare const readValuesFromProps: (props: Record<string, unknown>, keys: string[]) => Record<string, unknown>;
|
|
6
|
-
export declare const selectActiveKeys: (schema:
|
|
6
|
+
export declare const selectActiveKeys: (schema: SequenceSchema, values: Record<string, unknown>) => string[];
|
|
7
7
|
export declare const mergeValues: ({ props, valuesDotNotation, schemaKeys, propsToDelete, }: {
|
|
8
8
|
props: Record<string, unknown>;
|
|
9
9
|
valuesDotNotation: Record<string, unknown>;
|
|
10
10
|
schemaKeys: string[];
|
|
11
11
|
propsToDelete: Set<string>;
|
|
12
12
|
}) => Record<string, unknown>;
|
|
13
|
-
export declare const wrapInSchema: <S extends
|
|
13
|
+
export declare const wrapInSchema: <S extends SequenceSchema, Props extends object>({ Component, componentIdentity, schema, supportsEffects, }: {
|
|
14
14
|
Component: React.ComponentType<Props & {
|
|
15
15
|
readonly _experimentalControls: SequenceControls | undefined;
|
|
16
16
|
}>;
|
|
@@ -38,7 +38,7 @@ const react_1 = __importStar(require("react"));
|
|
|
38
38
|
const delete_nested_key_js_1 = require("./delete-nested-key.js");
|
|
39
39
|
const use_memoized_effects_js_1 = require("./effects/use-memoized-effects.js");
|
|
40
40
|
const flatten_schema_js_1 = require("./flatten-schema.js");
|
|
41
|
-
const
|
|
41
|
+
const sequence_field_schema_js_1 = require("./sequence-field-schema.js");
|
|
42
42
|
const sequence_node_path_js_1 = require("./sequence-node-path.js");
|
|
43
43
|
const SequenceManager_js_1 = require("./SequenceManager.js");
|
|
44
44
|
const use_current_frame_js_1 = require("./use-current-frame.js");
|
|
@@ -100,7 +100,7 @@ exports.mergeValues = mergeValues;
|
|
|
100
100
|
const stackToOverrideMap = {};
|
|
101
101
|
const wrapInSchema = ({ Component, componentIdentity, schema, supportsEffects, }) => {
|
|
102
102
|
// Schema is static for a component, so we move this outside
|
|
103
|
-
const schemaWithSequenceName = (0,
|
|
103
|
+
const schemaWithSequenceName = (0, sequence_field_schema_js_1.extendSchemaWithSequenceName)(schema);
|
|
104
104
|
const flatSchema = (0, flatten_schema_js_1.getFlatSchemaWithAllKeys)(schemaWithSequenceName);
|
|
105
105
|
const flatKeys = Object.keys(flatSchema);
|
|
106
106
|
const Wrapped = (0, react_1.forwardRef)((props, ref) => {
|