remotion 4.0.476 → 4.0.477
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/CompositionManager.d.ts +2 -0
- package/dist/cjs/HtmlInCanvas.js +2 -0
- package/dist/cjs/Img.d.ts +8 -2
- package/dist/cjs/Img.js +7 -5
- package/dist/cjs/Interactive.d.ts +1 -1
- package/dist/cjs/Interactive.js +4 -2
- package/dist/cjs/Sequence.d.ts +1 -0
- package/dist/cjs/Sequence.js +29 -2
- package/dist/cjs/animated-image/AnimatedImage.js +2 -0
- package/dist/cjs/canvas-image/CanvasImage.d.ts +7 -1
- package/dist/cjs/canvas-image/CanvasImage.js +4 -2
- package/dist/cjs/canvas-image/props.d.ts +1 -1
- package/dist/cjs/effects/Solid.d.ts +1 -1
- package/dist/cjs/effects/Solid.js +4 -2
- package/dist/cjs/index.d.ts +2 -2
- package/dist/cjs/internals.d.ts +16 -3
- package/dist/cjs/internals.js +1 -0
- package/dist/cjs/interpolate-translate.d.ts +8 -0
- package/dist/cjs/interpolate-translate.js +70 -0
- package/dist/cjs/no-react.d.ts +6 -0
- package/dist/cjs/sequence-field-schema.d.ts +19 -1
- package/dist/cjs/sequence-field-schema.js +9 -1
- package/dist/cjs/series/index.d.ts +1 -1
- package/dist/cjs/series/index.js +1 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/wrap-in-schema.d.ts +2 -1
- package/dist/cjs/wrap-in-schema.js +2 -1
- package/dist/esm/index.mjs +130 -66
- package/dist/esm/no-react.mjs +8 -0
- package/dist/esm/version.mjs +1 -1
- package/package.json +2 -2
|
@@ -50,11 +50,13 @@ export type LoopDisplay = {
|
|
|
50
50
|
startOffset: number;
|
|
51
51
|
durationInFrames: number;
|
|
52
52
|
};
|
|
53
|
+
export type JsxComponentIdentity = string;
|
|
53
54
|
export type SequenceControls = {
|
|
54
55
|
schema: SequenceSchema;
|
|
55
56
|
currentRuntimeValueDotNotation: Record<string, unknown>;
|
|
56
57
|
overrideId: string;
|
|
57
58
|
supportsEffects: boolean;
|
|
59
|
+
componentIdentity: JsxComponentIdentity | null;
|
|
58
60
|
};
|
|
59
61
|
export type TSequence = {
|
|
60
62
|
from: number;
|
package/dist/cjs/HtmlInCanvas.js
CHANGED
|
@@ -296,11 +296,13 @@ HtmlInCanvasInner.displayName = 'HtmlInCanvas';
|
|
|
296
296
|
const htmlInCanvasSchema = {
|
|
297
297
|
durationInFrames: sequence_field_schema_js_1.durationInFramesField,
|
|
298
298
|
from: sequence_field_schema_js_1.fromField,
|
|
299
|
+
freeze: sequence_field_schema_js_1.freezeField,
|
|
299
300
|
...sequence_field_schema_js_1.sequenceVisualStyleSchema,
|
|
300
301
|
hidden: sequence_field_schema_js_1.hiddenField,
|
|
301
302
|
};
|
|
302
303
|
const HtmlInCanvasWrapped = (0, wrap_in_schema_js_1.wrapInSchema)({
|
|
303
304
|
Component: HtmlInCanvasInner,
|
|
305
|
+
componentIdentity: 'dev.remotion.remotion.HtmlInCanvas',
|
|
304
306
|
schema: htmlInCanvasSchema,
|
|
305
307
|
supportsEffects: true,
|
|
306
308
|
});
|
package/dist/cjs/Img.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export type ImgProps = NativeImgProps & {
|
|
|
16
16
|
* @deprecated For internal use only
|
|
17
17
|
*/
|
|
18
18
|
readonly stack?: string;
|
|
19
|
-
} & Pick<SequenceProps, 'durationInFrames' | 'from' | 'hidden'>;
|
|
19
|
+
} & Pick<SequenceProps, 'durationInFrames' | 'from' | 'freeze' | 'hidden'>;
|
|
20
20
|
export declare const imgSchema: {
|
|
21
21
|
readonly 'style.transformOrigin': {
|
|
22
22
|
readonly type: "transform-origin";
|
|
@@ -65,6 +65,12 @@ export declare const imgSchema: {
|
|
|
65
65
|
readonly step: 1;
|
|
66
66
|
readonly hiddenFromList: true;
|
|
67
67
|
};
|
|
68
|
+
readonly freeze: {
|
|
69
|
+
readonly type: "number";
|
|
70
|
+
readonly default: null;
|
|
71
|
+
readonly step: 1;
|
|
72
|
+
readonly hiddenFromList: true;
|
|
73
|
+
};
|
|
68
74
|
readonly hidden: import("./sequence-field-schema.js").SequenceFieldSchema;
|
|
69
75
|
};
|
|
70
76
|
export declare const Img: React.ComponentType<NativeImgProps & {
|
|
@@ -81,5 +87,5 @@ export declare const Img: React.ComponentType<NativeImgProps & {
|
|
|
81
87
|
* @deprecated For internal use only
|
|
82
88
|
*/
|
|
83
89
|
readonly stack?: string | undefined;
|
|
84
|
-
} & Pick<SequenceProps, "durationInFrames" | "from" | "hidden">>;
|
|
90
|
+
} & Pick<SequenceProps, "durationInFrames" | "freeze" | "from" | "hidden">>;
|
|
85
91
|
export {};
|
package/dist/cjs/Img.js
CHANGED
|
@@ -183,16 +183,17 @@ const ImgContent = ({ onError, maxRetries = 2, src, pauseWhenLoading, delayRende
|
|
|
183
183
|
// src gets set once we've loaded and decoded the image.
|
|
184
184
|
return (jsx_runtime_1.jsx("img", { ...props, ref: imageCallbackRef, crossOrigin: crossOriginValue, onError: didGetError, decoding: isRendering ? 'sync' : decoding }));
|
|
185
185
|
};
|
|
186
|
-
const NativeImgInner = ({ hidden, name, stack, showInTimeline, src, from, durationInFrames, _experimentalControls: controls, _remotionInternalRefForOutline: refForOutline, ...props }) => {
|
|
186
|
+
const NativeImgInner = ({ hidden, name, stack, showInTimeline, src, from, durationInFrames, freeze, _experimentalControls: controls, _remotionInternalRefForOutline: refForOutline, ...props }) => {
|
|
187
187
|
if (!src) {
|
|
188
188
|
throw new Error('No "src" prop was passed to <Img>.');
|
|
189
189
|
}
|
|
190
|
-
return (jsx_runtime_1.jsx(Sequence_js_1.Sequence, { layout: "none", from: from !== null && from !== void 0 ? from : 0, durationInFrames: durationInFrames !== null && durationInFrames !== void 0 ? durationInFrames : Infinity, _remotionInternalStack: stack, _remotionInternalDocumentationLink: "https://www.remotion.dev/docs/img", _remotionInternalIsMedia: { type: 'image', src }, name: name !== null && name !== void 0 ? name : '<Img>', _experimentalControls: controls, showInTimeline: showInTimeline !== null && showInTimeline !== void 0 ? showInTimeline : true, hidden: hidden, _remotionInternalRefForOutline: refForOutline, children: jsx_runtime_1.jsx(ImgContent, { src: src, refForOutline: refForOutline, ...props }) }));
|
|
190
|
+
return (jsx_runtime_1.jsx(Sequence_js_1.Sequence, { layout: "none", from: from !== null && from !== void 0 ? from : 0, durationInFrames: durationInFrames !== null && durationInFrames !== void 0 ? durationInFrames : Infinity, freeze: freeze, _remotionInternalStack: stack, _remotionInternalDocumentationLink: "https://www.remotion.dev/docs/img", _remotionInternalIsMedia: { type: 'image', src }, name: name !== null && name !== void 0 ? name : '<Img>', _experimentalControls: controls, showInTimeline: showInTimeline !== null && showInTimeline !== void 0 ? showInTimeline : true, hidden: hidden, _remotionInternalRefForOutline: refForOutline, children: jsx_runtime_1.jsx(ImgContent, { src: src, refForOutline: refForOutline, ...props }) }));
|
|
191
191
|
};
|
|
192
192
|
const CanvasImageWithPrivateProps = index_js_1.CanvasImage;
|
|
193
193
|
exports.imgSchema = {
|
|
194
194
|
durationInFrames: sequence_field_schema_js_1.durationInFramesField,
|
|
195
195
|
from: sequence_field_schema_js_1.fromField,
|
|
196
|
+
freeze: sequence_field_schema_js_1.freezeField,
|
|
196
197
|
...sequence_field_schema_js_1.sequenceVisualStyleSchema,
|
|
197
198
|
hidden: sequence_field_schema_js_1.hiddenField,
|
|
198
199
|
};
|
|
@@ -235,11 +236,11 @@ const getFitFromObjectFit = (style) => {
|
|
|
235
236
|
}
|
|
236
237
|
return undefined;
|
|
237
238
|
};
|
|
238
|
-
const ImgInner = ({ effects = [], ref, hidden, name, stack, showInTimeline, src, from, durationInFrames, _experimentalControls: controls, width, height, className, style, id, pauseWhenLoading, maxRetries, delayRenderRetries, delayRenderTimeoutInMilliseconds, ...props }) => {
|
|
239
|
+
const ImgInner = ({ effects = [], ref, hidden, name, stack, showInTimeline, src, from, durationInFrames, freeze, _experimentalControls: controls, width, height, className, style, id, pauseWhenLoading, maxRetries, delayRenderRetries, delayRenderTimeoutInMilliseconds, ...props }) => {
|
|
239
240
|
var _a;
|
|
240
241
|
const refForOutline = (0, react_1.useRef)(null);
|
|
241
242
|
if (effects.length === 0) {
|
|
242
|
-
return (jsx_runtime_1.jsx(NativeImgInner, { ...props, ref: ref, hidden: hidden, name: name, stack: stack, showInTimeline: showInTimeline, src: src, from: from, durationInFrames: durationInFrames, _experimentalControls: controls, width: width, height: height, className: className, style: style, id: id, pauseWhenLoading: pauseWhenLoading, maxRetries: maxRetries, delayRenderRetries: delayRenderRetries, delayRenderTimeoutInMilliseconds: delayRenderTimeoutInMilliseconds, _remotionInternalRefForOutline: refForOutline }));
|
|
243
|
+
return (jsx_runtime_1.jsx(NativeImgInner, { ...props, ref: ref, hidden: hidden, name: name, stack: stack, showInTimeline: showInTimeline, src: src, from: from, durationInFrames: durationInFrames, freeze: freeze, _experimentalControls: controls, width: width, height: height, className: className, style: style, id: id, pauseWhenLoading: pauseWhenLoading, maxRetries: maxRetries, delayRenderRetries: delayRenderRetries, delayRenderTimeoutInMilliseconds: delayRenderTimeoutInMilliseconds, _remotionInternalRefForOutline: refForOutline }));
|
|
243
244
|
}
|
|
244
245
|
if (!src) {
|
|
245
246
|
throw new Error('No "src" prop was passed to <Img>.');
|
|
@@ -254,7 +255,7 @@ const ImgInner = ({ effects = [], ref, hidden, name, stack, showInTimeline, src,
|
|
|
254
255
|
const canvasHeight = typeof height === 'number' ? height : undefined;
|
|
255
256
|
const canvasProps = props;
|
|
256
257
|
const canvasFit = (_a = getFitFromObjectFit(style)) !== null && _a !== void 0 ? _a : 'fill';
|
|
257
|
-
return (jsx_runtime_1.jsx(CanvasImageWithPrivateProps, { src: src, width: canvasWidth, height: canvasHeight, fit: canvasFit, effects: effects, className: className, style: style, id: id, pauseWhenLoading: pauseWhenLoading, maxRetries: maxRetries, delayRenderRetries: delayRenderRetries, delayRenderTimeoutInMilliseconds: delayRenderTimeoutInMilliseconds, from: from, durationInFrames: durationInFrames, hidden: hidden, name: name !== null && name !== void 0 ? name : '<Img>', showInTimeline: showInTimeline, stack: stack, _remotionInternalDocumentationLink: "https://www.remotion.dev/docs/img", _experimentalControls: controls, _remotionInternalRefForOutline: refForOutline, ...canvasProps }));
|
|
258
|
+
return (jsx_runtime_1.jsx(CanvasImageWithPrivateProps, { src: src, width: canvasWidth, height: canvasHeight, fit: canvasFit, effects: effects, className: className, style: style, id: id, pauseWhenLoading: pauseWhenLoading, maxRetries: maxRetries, delayRenderRetries: delayRenderRetries, delayRenderTimeoutInMilliseconds: delayRenderTimeoutInMilliseconds, from: from, durationInFrames: durationInFrames, freeze: freeze, hidden: hidden, name: name !== null && name !== void 0 ? name : '<Img>', showInTimeline: showInTimeline, stack: stack, _remotionInternalDocumentationLink: "https://www.remotion.dev/docs/img", _experimentalControls: controls, _remotionInternalRefForOutline: refForOutline, ...canvasProps }));
|
|
258
259
|
};
|
|
259
260
|
/*
|
|
260
261
|
* @description Works just like a regular HTML img tag. When you use the <Img> tag, Remotion will ensure that the image is loaded before rendering the frame.
|
|
@@ -262,6 +263,7 @@ const ImgInner = ({ effects = [], ref, hidden, name, stack, showInTimeline, src,
|
|
|
262
263
|
*/
|
|
263
264
|
exports.Img = (0, wrap_in_schema_js_1.wrapInSchema)({
|
|
264
265
|
Component: ImgInner,
|
|
266
|
+
componentIdentity: 'dev.remotion.remotion.Img',
|
|
265
267
|
schema: exports.imgSchema,
|
|
266
268
|
supportsEffects: true,
|
|
267
269
|
});
|
|
@@ -4,7 +4,7 @@ type InteractiveHtmlTag = 'a' | 'article' | 'aside' | 'button' | 'code' | 'div'
|
|
|
4
4
|
type InteractiveSvgTag = 'circle' | 'ellipse' | 'g' | 'line' | 'path' | 'rect' | 'svg' | 'text';
|
|
5
5
|
type InteractiveTag = InteractiveHtmlTag | InteractiveSvgTag;
|
|
6
6
|
type ElementForTag<Tag extends InteractiveTag> = Tag extends keyof HTMLElementTagNameMap ? HTMLElementTagNameMap[Tag] : Tag extends keyof SVGElementTagNameMap ? SVGElementTagNameMap[Tag] : Element;
|
|
7
|
-
type InteractiveSequenceProps = Pick<SequenceProps, 'durationInFrames' | 'from' | 'hidden' | 'name' | 'showInTimeline'> & {
|
|
7
|
+
type InteractiveSequenceProps = Pick<SequenceProps, 'durationInFrames' | 'from' | 'freeze' | 'hidden' | 'name' | 'showInTimeline'> & {
|
|
8
8
|
/**
|
|
9
9
|
* @deprecated For internal use only
|
|
10
10
|
*/
|
package/dist/cjs/Interactive.js
CHANGED
|
@@ -43,6 +43,7 @@ const wrap_in_schema_js_1 = require("./wrap-in-schema.js");
|
|
|
43
43
|
const interactiveElementSchema = {
|
|
44
44
|
durationInFrames: sequence_field_schema_js_1.durationInFramesField,
|
|
45
45
|
from: sequence_field_schema_js_1.fromField,
|
|
46
|
+
freeze: sequence_field_schema_js_1.freezeField,
|
|
46
47
|
...sequence_field_schema_js_1.sequenceVisualStyleSchema,
|
|
47
48
|
hidden: sequence_field_schema_js_1.hiddenField,
|
|
48
49
|
};
|
|
@@ -56,13 +57,13 @@ const setRef = (ref, value) => {
|
|
|
56
57
|
};
|
|
57
58
|
const makeInteractiveElement = (tag, displayName) => {
|
|
58
59
|
const Inner = (0, react_1.forwardRef)((propsWithControls, ref) => {
|
|
59
|
-
const { durationInFrames, from, hidden, name, showInTimeline, stack, _experimentalControls, ...props } = propsWithControls;
|
|
60
|
+
const { durationInFrames, from, freeze, hidden, name, showInTimeline, stack, _experimentalControls, ...props } = propsWithControls;
|
|
60
61
|
const refForOutline = (0, react_1.useRef)(null);
|
|
61
62
|
const callbackRef = (0, react_1.useCallback)((element) => {
|
|
62
63
|
refForOutline.current = element;
|
|
63
64
|
setRef(ref, element);
|
|
64
65
|
}, [ref]);
|
|
65
|
-
return (jsx_runtime_1.jsx(Sequence_js_1.Sequence, { layout: "none", from: from !== null && from !== void 0 ? from : 0, durationInFrames: durationInFrames !== null && durationInFrames !== void 0 ? durationInFrames : Infinity, hidden: hidden, name: name !== null && name !== void 0 ? name : displayName, showInTimeline: showInTimeline !== null && showInTimeline !== void 0 ? showInTimeline : true, _experimentalControls: _experimentalControls, _remotionInternalStack: stack, _remotionInternalDocumentationLink: "https://www.remotion.dev/docs/interactive", _remotionInternalRefForOutline: refForOutline, children: react_1.default.createElement(tag, {
|
|
66
|
+
return (jsx_runtime_1.jsx(Sequence_js_1.Sequence, { layout: "none", from: from !== null && from !== void 0 ? from : 0, durationInFrames: durationInFrames !== null && durationInFrames !== void 0 ? durationInFrames : Infinity, freeze: freeze, hidden: hidden, name: name !== null && name !== void 0 ? name : displayName, showInTimeline: showInTimeline !== null && showInTimeline !== void 0 ? showInTimeline : true, _experimentalControls: _experimentalControls, _remotionInternalStack: stack, _remotionInternalDocumentationLink: "https://www.remotion.dev/docs/interactive", _remotionInternalRefForOutline: refForOutline, children: react_1.default.createElement(tag, {
|
|
66
67
|
...props,
|
|
67
68
|
ref: callbackRef,
|
|
68
69
|
}) }));
|
|
@@ -70,6 +71,7 @@ const makeInteractiveElement = (tag, displayName) => {
|
|
|
70
71
|
Inner.displayName = displayName;
|
|
71
72
|
const Wrapped = (0, wrap_in_schema_js_1.wrapInSchema)({
|
|
72
73
|
Component: Inner,
|
|
74
|
+
componentIdentity: `dev.remotion.remotion.${displayName.slice(1, -1)}`,
|
|
73
75
|
schema: interactiveElementSchema,
|
|
74
76
|
supportsEffects: false,
|
|
75
77
|
});
|
package/dist/cjs/Sequence.d.ts
CHANGED
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 wrap_in_schema_js_1 = require("./wrap-in-schema.js");
|
|
21
21
|
const EMPTY_EFFECTS = [];
|
|
22
|
-
const RegularSequenceRefForwardingFunction = ({ from = 0, durationInFrames = Infinity, children, name, height, width, showInTimeline = true, hidden = false, _experimentalControls: controls, _remotionInternalEffects, _remotionInternalLoopDisplay: loopDisplay, _remotionInternalStack: stack, _remotionInternalDocumentationLink: documentationLink, _remotionInternalPremountDisplay: premountDisplay, _remotionInternalPostmountDisplay: postmountDisplay, _remotionInternalIsMedia: isMedia, _remotionInternalRefForOutline:
|
|
22
|
+
const RegularSequenceRefForwardingFunction = ({ from = 0, freeze, durationInFrames = Infinity, children, name, height, width, showInTimeline = true, hidden = false, _experimentalControls: controls, _remotionInternalEffects, _remotionInternalLoopDisplay: loopDisplay, _remotionInternalStack: stack, _remotionInternalDocumentationLink: documentationLink, _remotionInternalPremountDisplay: premountDisplay, _remotionInternalPostmountDisplay: postmountDisplay, _remotionInternalIsMedia: isMedia, _remotionInternalRefForOutline: passedRefForOutline, ...other }, ref) => {
|
|
23
23
|
var _a, _b;
|
|
24
24
|
const { layout = 'absolute-fill' } = other;
|
|
25
25
|
const [id] = (0, react_1.useState)(() => String(Math.random()));
|
|
@@ -51,6 +51,17 @@ const RegularSequenceRefForwardingFunction = ({ from = 0, durationInFrames = Inf
|
|
|
51
51
|
if (!Number.isFinite(from)) {
|
|
52
52
|
throw new TypeError(`The "from" prop of a sequence must be finite, but got ${from}.`);
|
|
53
53
|
}
|
|
54
|
+
if (typeof freeze !== 'undefined' && freeze !== null) {
|
|
55
|
+
if (typeof freeze !== 'number') {
|
|
56
|
+
throw new TypeError(`The "freeze" prop of <Sequence /> must be a number, but is of type ${typeof freeze}.`);
|
|
57
|
+
}
|
|
58
|
+
if (Number.isNaN(freeze)) {
|
|
59
|
+
throw new TypeError(`The "freeze" prop of <Sequence /> must be a real number, but it is NaN.`);
|
|
60
|
+
}
|
|
61
|
+
if (!Number.isFinite(freeze)) {
|
|
62
|
+
throw new TypeError(`The "freeze" prop of <Sequence /> must be finite, but it is ${freeze}.`);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
54
65
|
const absoluteFrame = (0, timeline_position_state_js_1.useTimelinePosition)();
|
|
55
66
|
const videoConfig = (0, use_video_config_js_1.useVideoConfig)();
|
|
56
67
|
const parentSequenceDuration = parentSequence
|
|
@@ -58,6 +69,10 @@ const RegularSequenceRefForwardingFunction = ({ from = 0, durationInFrames = Inf
|
|
|
58
69
|
: durationInFrames;
|
|
59
70
|
const actualDurationInFrames = Math.max(0, Math.min(videoConfig.durationInFrames - from, parentSequenceDuration));
|
|
60
71
|
const { registerSequence, unregisterSequence } = (0, react_1.useContext)(SequenceManager_js_1.SequenceManager);
|
|
72
|
+
const wrapperRefForOutline = (0, react_1.useRef)(null);
|
|
73
|
+
const refForOutline = other.layout === 'none'
|
|
74
|
+
? (passedRefForOutline !== null && passedRefForOutline !== void 0 ? passedRefForOutline : null)
|
|
75
|
+
: (passedRefForOutline !== null && passedRefForOutline !== void 0 ? passedRefForOutline : wrapperRefForOutline);
|
|
61
76
|
const premounting = (0, react_1.useMemo)(() => {
|
|
62
77
|
// || is intentional, ?? would not trigger on `false`
|
|
63
78
|
return ((parentSequence === null || parentSequence === void 0 ? void 0 : parentSequence.premounting) ||
|
|
@@ -248,7 +263,17 @@ const RegularSequenceRefForwardingFunction = ({ from = 0, durationInFrames = Inf
|
|
|
248
263
|
: absoluteFrame > endThreshold
|
|
249
264
|
? null
|
|
250
265
|
: children;
|
|
266
|
+
const frozenContent = content === null || typeof freeze === 'undefined' || freeze === null ? (content) : (jsx_runtime_1.jsx(freeze_js_1.Freeze, { frame: freeze, children: content }));
|
|
251
267
|
const styleIfThere = other.layout === 'none' ? undefined : other.style;
|
|
268
|
+
const sequenceRef = (0, react_1.useCallback)((node) => {
|
|
269
|
+
wrapperRefForOutline.current = node;
|
|
270
|
+
if (typeof ref === 'function') {
|
|
271
|
+
ref(node);
|
|
272
|
+
}
|
|
273
|
+
else if (ref) {
|
|
274
|
+
ref.current = node;
|
|
275
|
+
}
|
|
276
|
+
}, [ref]);
|
|
252
277
|
const defaultStyle = (0, react_1.useMemo)(() => {
|
|
253
278
|
return {
|
|
254
279
|
flexDirection: undefined,
|
|
@@ -263,7 +288,7 @@ const RegularSequenceRefForwardingFunction = ({ from = 0, durationInFrames = Inf
|
|
|
263
288
|
if (hidden) {
|
|
264
289
|
return null;
|
|
265
290
|
}
|
|
266
|
-
return (jsx_runtime_1.jsx(SequenceContext_js_1.SequenceContext.Provider, { value: contextValue, children:
|
|
291
|
+
return (jsx_runtime_1.jsx(SequenceContext_js_1.SequenceContext.Provider, { value: contextValue, children: frozenContent === null ? null : other.layout === 'none' ? (frozenContent) : (jsx_runtime_1.jsx(AbsoluteFill_js_1.AbsoluteFill, { ref: sequenceRef, style: defaultStyle, className: other.className, children: frozenContent })) }));
|
|
267
292
|
};
|
|
268
293
|
const RegularSequence = (0, react_1.forwardRef)(RegularSequenceRefForwardingFunction);
|
|
269
294
|
const PremountedPostmountedSequenceRefForwardingFunction = (props, ref) => {
|
|
@@ -326,11 +351,13 @@ exports.SequenceWithoutSchema = SequenceInner;
|
|
|
326
351
|
*/
|
|
327
352
|
exports.Sequence = (0, wrap_in_schema_js_1.wrapInSchema)({
|
|
328
353
|
Component: SequenceInner,
|
|
354
|
+
componentIdentity: 'dev.remotion.remotion.Sequence',
|
|
329
355
|
schema: sequence_field_schema_js_1.sequenceSchema,
|
|
330
356
|
supportsEffects: false,
|
|
331
357
|
});
|
|
332
358
|
exports.SequenceWithoutFrom = (0, wrap_in_schema_js_1.wrapInSchema)({
|
|
333
359
|
Component: SequenceInner,
|
|
360
|
+
componentIdentity: null,
|
|
334
361
|
schema: sequence_field_schema_js_1.sequenceSchemaWithoutFrom,
|
|
335
362
|
supportsEffects: false,
|
|
336
363
|
});
|
|
@@ -19,6 +19,7 @@ const resolve_image_source_1 = require("./resolve-image-source");
|
|
|
19
19
|
const animatedImageSchema = {
|
|
20
20
|
durationInFrames: sequence_field_schema_js_1.durationInFramesField,
|
|
21
21
|
from: sequence_field_schema_js_1.fromField,
|
|
22
|
+
freeze: sequence_field_schema_js_1.freezeField,
|
|
22
23
|
playbackRate: {
|
|
23
24
|
type: 'number',
|
|
24
25
|
min: 0,
|
|
@@ -177,6 +178,7 @@ const AnimatedImageInner = ({ src, width, height, onError, fit, playbackRate, lo
|
|
|
177
178
|
};
|
|
178
179
|
exports.AnimatedImage = (0, wrap_in_schema_js_1.wrapInSchema)({
|
|
179
180
|
Component: AnimatedImageInner,
|
|
181
|
+
componentIdentity: 'dev.remotion.remotion.AnimatedImage',
|
|
180
182
|
schema: animatedImageSchema,
|
|
181
183
|
supportsEffects: true,
|
|
182
184
|
});
|
|
@@ -49,6 +49,12 @@ export declare const canvasImageSchema: {
|
|
|
49
49
|
readonly step: 1;
|
|
50
50
|
readonly hiddenFromList: true;
|
|
51
51
|
};
|
|
52
|
+
readonly freeze: {
|
|
53
|
+
readonly type: "number";
|
|
54
|
+
readonly default: null;
|
|
55
|
+
readonly step: 1;
|
|
56
|
+
readonly hiddenFromList: true;
|
|
57
|
+
};
|
|
52
58
|
readonly fit: {
|
|
53
59
|
readonly type: "enum";
|
|
54
60
|
readonly default: "fill";
|
|
@@ -61,7 +67,7 @@ export declare const canvasImageSchema: {
|
|
|
61
67
|
};
|
|
62
68
|
readonly hidden: import("../sequence-field-schema.js").SequenceFieldSchema;
|
|
63
69
|
};
|
|
64
|
-
export declare const CanvasImage: import("react").ComponentType<Pick<import("../Sequence.js").SequenceProps, "durationInFrames" | "from" | "hidden" | "name" | "showInTimeline"> & {
|
|
70
|
+
export declare const CanvasImage: import("react").ComponentType<Pick<import("../Sequence.js").SequenceProps, "durationInFrames" | "freeze" | "from" | "hidden" | "name" | "showInTimeline"> & {
|
|
65
71
|
readonly stack?: string | undefined;
|
|
66
72
|
} & CanvasImageCanvasProps & {
|
|
67
73
|
readonly src: string;
|
|
@@ -19,6 +19,7 @@ const wrap_in_schema_js_1 = require("../wrap-in-schema.js");
|
|
|
19
19
|
exports.canvasImageSchema = {
|
|
20
20
|
durationInFrames: sequence_field_schema_js_1.durationInFramesField,
|
|
21
21
|
from: sequence_field_schema_js_1.fromField,
|
|
22
|
+
freeze: sequence_field_schema_js_1.freezeField,
|
|
22
23
|
fit: {
|
|
23
24
|
type: 'enum',
|
|
24
25
|
default: 'fill',
|
|
@@ -236,7 +237,7 @@ const CanvasImageContent = (0, react_1.forwardRef)(({ src, width, height, fit =
|
|
|
236
237
|
return (jsx_runtime_1.jsx("canvas", { ...canvasProps, ref: canvasRef, width: width, height: height, className: className, style: style, id: id }));
|
|
237
238
|
});
|
|
238
239
|
CanvasImageContent.displayName = 'CanvasImageContent';
|
|
239
|
-
const CanvasImageInner = (0, react_1.forwardRef)(({ src, width, height, fit, effects = [], className, style, id, onError, pauseWhenLoading, maxRetries, delayRenderRetries, delayRenderTimeoutInMilliseconds, durationInFrames, from, hidden, name, showInTimeline, stack, _experimentalControls: controls, _remotionInternalDocumentationLink, _remotionInternalRefForOutline, ...canvasProps }, ref) => {
|
|
240
|
+
const CanvasImageInner = (0, react_1.forwardRef)(({ src, width, height, fit, effects = [], className, style, id, onError, pauseWhenLoading, maxRetries, delayRenderRetries, delayRenderTimeoutInMilliseconds, durationInFrames, from, freeze, hidden, name, showInTimeline, stack, _experimentalControls: controls, _remotionInternalDocumentationLink, _remotionInternalRefForOutline, ...canvasProps }, ref) => {
|
|
240
241
|
if (!src) {
|
|
241
242
|
throw new Error('No "src" prop was passed to <CanvasImage>.');
|
|
242
243
|
}
|
|
@@ -245,7 +246,7 @@ const CanvasImageInner = (0, react_1.forwardRef)(({ src, width, height, fit, eff
|
|
|
245
246
|
(0, react_1.useImperativeHandle)(ref, () => {
|
|
246
247
|
return actualRef.current;
|
|
247
248
|
}, []);
|
|
248
|
-
return (jsx_runtime_1.jsx(Sequence_js_1.Sequence, { layout: "none", from: from !== null && from !== void 0 ? from : 0, durationInFrames: durationInFrames !== null && durationInFrames !== void 0 ? durationInFrames : Infinity, hidden: hidden, showInTimeline: showInTimeline !== null && showInTimeline !== void 0 ? showInTimeline : true, name: name !== null && name !== void 0 ? name : '<CanvasImage>', _remotionInternalDocumentationLink: _remotionInternalDocumentationLink !== null && _remotionInternalDocumentationLink !== void 0 ? _remotionInternalDocumentationLink : 'https://www.remotion.dev/docs/canvasimage', _experimentalControls: controls, _remotionInternalEffects: memoizedEffectDefinitions, _remotionInternalIsMedia: { type: 'image', src }, _remotionInternalStack: stack, _remotionInternalRefForOutline: _remotionInternalRefForOutline !== null && _remotionInternalRefForOutline !== void 0 ? _remotionInternalRefForOutline : actualRef, children: jsx_runtime_1.jsx(CanvasImageContent, { ref: actualRef, src: src, width: width, height: height, fit: fit, effects: effects, controls: controls, className: className, style: style, id: id, onError: onError, pauseWhenLoading: pauseWhenLoading, maxRetries: maxRetries, delayRenderRetries: delayRenderRetries, delayRenderTimeoutInMilliseconds: delayRenderTimeoutInMilliseconds, refForOutline: _remotionInternalRefForOutline !== null && _remotionInternalRefForOutline !== void 0 ? _remotionInternalRefForOutline : null, ...canvasProps }) }));
|
|
249
|
+
return (jsx_runtime_1.jsx(Sequence_js_1.Sequence, { layout: "none", from: from !== null && from !== void 0 ? from : 0, durationInFrames: durationInFrames !== null && durationInFrames !== void 0 ? durationInFrames : Infinity, freeze: freeze, hidden: hidden, showInTimeline: showInTimeline !== null && showInTimeline !== void 0 ? showInTimeline : true, name: name !== null && name !== void 0 ? name : '<CanvasImage>', _remotionInternalDocumentationLink: _remotionInternalDocumentationLink !== null && _remotionInternalDocumentationLink !== void 0 ? _remotionInternalDocumentationLink : 'https://www.remotion.dev/docs/canvasimage', _experimentalControls: controls, _remotionInternalEffects: memoizedEffectDefinitions, _remotionInternalIsMedia: { type: 'image', src }, _remotionInternalStack: stack, _remotionInternalRefForOutline: _remotionInternalRefForOutline !== null && _remotionInternalRefForOutline !== void 0 ? _remotionInternalRefForOutline : actualRef, children: jsx_runtime_1.jsx(CanvasImageContent, { ref: actualRef, src: src, width: width, height: height, fit: fit, effects: effects, controls: controls, className: className, style: style, id: id, onError: onError, pauseWhenLoading: pauseWhenLoading, maxRetries: maxRetries, delayRenderRetries: delayRenderRetries, delayRenderTimeoutInMilliseconds: delayRenderTimeoutInMilliseconds, refForOutline: _remotionInternalRefForOutline !== null && _remotionInternalRefForOutline !== void 0 ? _remotionInternalRefForOutline : null, ...canvasProps }) }));
|
|
249
250
|
});
|
|
250
251
|
/*
|
|
251
252
|
* @description Renders a static image to a `<canvas>` and applies Remotion effects.
|
|
@@ -253,6 +254,7 @@ const CanvasImageInner = (0, react_1.forwardRef)(({ src, width, height, fit, eff
|
|
|
253
254
|
*/
|
|
254
255
|
exports.CanvasImage = (0, wrap_in_schema_js_1.wrapInSchema)({
|
|
255
256
|
Component: CanvasImageInner,
|
|
257
|
+
componentIdentity: 'dev.remotion.remotion.CanvasImage',
|
|
256
258
|
schema: exports.canvasImageSchema,
|
|
257
259
|
supportsEffects: true,
|
|
258
260
|
});
|
|
@@ -2,7 +2,7 @@ import type React from 'react';
|
|
|
2
2
|
import type { ImageFit } from '../calculate-image-fit.js';
|
|
3
3
|
import type { EffectsProp } from '../effects/effect-types.js';
|
|
4
4
|
import type { SequenceProps } from '../Sequence.js';
|
|
5
|
-
type CanvasImageSequenceProps = Pick<SequenceProps, 'durationInFrames' | 'from' | 'hidden' | 'name' | 'showInTimeline'> & {
|
|
5
|
+
type CanvasImageSequenceProps = Pick<SequenceProps, 'durationInFrames' | 'from' | 'freeze' | 'hidden' | 'name' | 'showInTimeline'> & {
|
|
6
6
|
/**
|
|
7
7
|
* @deprecated For internal use only.
|
|
8
8
|
*/
|
|
@@ -13,5 +13,5 @@ type OptionalProps = {
|
|
|
13
13
|
readonly pixelDensity: number | undefined;
|
|
14
14
|
};
|
|
15
15
|
export type SolidProps = MandatoryProps & Partial<OptionalProps>;
|
|
16
|
-
export declare const Solid: React.ComponentType<MandatoryProps & Partial<OptionalProps> & Pick<SequenceProps, "durationInFrames" | "from" | "hidden" | "name" | "showInTimeline"> & React.RefAttributes<HTMLCanvasElement>>;
|
|
16
|
+
export declare const Solid: React.ComponentType<MandatoryProps & Partial<OptionalProps> & Pick<SequenceProps, "durationInFrames" | "freeze" | "from" | "hidden" | "name" | "showInTimeline"> & React.RefAttributes<HTMLCanvasElement>>;
|
|
17
17
|
export {};
|
|
@@ -25,6 +25,7 @@ const resolveSolidPixelDensity = (pixelDensity) => {
|
|
|
25
25
|
const solidSchema = {
|
|
26
26
|
durationInFrames: sequence_field_schema_js_1.durationInFramesField,
|
|
27
27
|
from: sequence_field_schema_js_1.fromField,
|
|
28
|
+
freeze: sequence_field_schema_js_1.freezeField,
|
|
28
29
|
color: {
|
|
29
30
|
type: 'color',
|
|
30
31
|
default: 'transparent',
|
|
@@ -140,7 +141,7 @@ const SolidInner = ({ color, width, height, effects = [], className, style, pixe
|
|
|
140
141
|
}, [height, style, width]);
|
|
141
142
|
return (jsx_runtime_1.jsx("canvas", { ref: canvasRef, width: canvasWidth, height: canvasHeight, className: className, style: canvasStyle }));
|
|
142
143
|
};
|
|
143
|
-
const SolidOuter = (0, react_1.forwardRef)(({ effects = [], _experimentalControls: controls, color, height, width, className, durationInFrames, style, name, from, hidden, showInTimeline, pixelDensity, ...props }, ref) => {
|
|
144
|
+
const SolidOuter = (0, react_1.forwardRef)(({ effects = [], _experimentalControls: controls, color, height, width, className, durationInFrames, style, name, from, freeze, hidden, showInTimeline, pixelDensity, ...props }, ref) => {
|
|
144
145
|
var _a;
|
|
145
146
|
props;
|
|
146
147
|
const memoizedEffectDefinitions = (0, use_memoized_effects_js_1.useMemoizedEffectDefinitions)(effects);
|
|
@@ -148,10 +149,11 @@ const SolidOuter = (0, react_1.forwardRef)(({ effects = [], _experimentalControl
|
|
|
148
149
|
(0, react_1.useImperativeHandle)(ref, () => {
|
|
149
150
|
return actualRef.current;
|
|
150
151
|
}, []);
|
|
151
|
-
return (jsx_runtime_1.jsx(Sequence_js_1.Sequence, { layout: "none", from: from, hidden: hidden, showInTimeline: showInTimeline, _experimentalControls: controls, _remotionInternalEffects: memoizedEffectDefinitions, durationInFrames: durationInFrames, name: name !== null && name !== void 0 ? name : '<Solid>', _remotionInternalRefForOutline: actualRef, _remotionInternalDocumentationLink: "https://www.remotion.dev/docs/solid", ...props, children: jsx_runtime_1.jsx(SolidInner, { reference: actualRef, overrideId: (_a = controls === null || controls === void 0 ? void 0 : controls.overrideId) !== null && _a !== void 0 ? _a : null, color: color, height: height, width: width, className: className, style: style, effects: effects, pixelDensity: pixelDensity }) }));
|
|
152
|
+
return (jsx_runtime_1.jsx(Sequence_js_1.Sequence, { layout: "none", from: from, freeze: freeze, hidden: hidden, showInTimeline: showInTimeline, _experimentalControls: controls, _remotionInternalEffects: memoizedEffectDefinitions, durationInFrames: durationInFrames, name: name !== null && name !== void 0 ? name : '<Solid>', _remotionInternalRefForOutline: actualRef, _remotionInternalDocumentationLink: "https://www.remotion.dev/docs/solid", ...props, children: jsx_runtime_1.jsx(SolidInner, { reference: actualRef, overrideId: (_a = controls === null || controls === void 0 ? void 0 : controls.overrideId) !== null && _a !== void 0 ? _a : null, color: color, height: height, width: width, className: className, style: style, effects: effects, pixelDensity: pixelDensity }) }));
|
|
152
153
|
});
|
|
153
154
|
exports.Solid = (0, wrap_in_schema_js_1.wrapInSchema)({
|
|
154
155
|
Component: SolidOuter,
|
|
156
|
+
componentIdentity: 'dev.remotion.remotion.Solid',
|
|
155
157
|
schema: solidSchema,
|
|
156
158
|
supportsEffects: true,
|
|
157
159
|
});
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import './_check-rsc.js';
|
|
2
2
|
import './asset-types.js';
|
|
3
3
|
import type { Codec } from './codec.js';
|
|
4
|
-
import type { AnyCompMetadata, AnyComposition, AudioOrVideoAsset, LoopDisplay, SequenceControls, TRenderAsset } from './CompositionManager.js';
|
|
4
|
+
import type { AnyCompMetadata, AnyComposition, AudioOrVideoAsset, JsxComponentIdentity, LoopDisplay, SequenceControls, TRenderAsset } from './CompositionManager.js';
|
|
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';
|
|
@@ -182,4 +182,4 @@ export type _InternalTypes = {
|
|
|
182
182
|
TRenderAsset: TRenderAsset;
|
|
183
183
|
ProResProfile: ProResProfile;
|
|
184
184
|
};
|
|
185
|
-
export type { AnyComposition, ArrayFieldSchema, ArrayItemFieldSchema, DelayRenderScope, LoopDisplay, SequenceControls, SequenceFieldSchema, SequenceSchema, UseBufferState, };
|
|
185
|
+
export type { AnyComposition, ArrayFieldSchema, ArrayItemFieldSchema, DelayRenderScope, JsxComponentIdentity, LoopDisplay, SequenceControls, SequenceFieldSchema, SequenceSchema, UseBufferState, };
|
package/dist/cjs/internals.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { ScheduleAudioNodeResult } from './audio/shared-audio-tags.js';
|
|
|
2
2
|
import { type ScheduleAudioNodeOptions } from './audio/shared-audio-tags.js';
|
|
3
3
|
import type { RemotionAudioContextState } from './audio/use-audio-context.js';
|
|
4
4
|
import { type CompProps } from './Composition.js';
|
|
5
|
-
import type { TCompMetadata, TComposition, TRenderAsset, TSequence } from './CompositionManager.js';
|
|
5
|
+
import type { JsxComponentIdentity, TCompMetadata, TComposition, TRenderAsset, TSequence } from './CompositionManager.js';
|
|
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';
|
|
@@ -77,10 +77,11 @@ export declare const Internals: {
|
|
|
77
77
|
readonly SequenceManager: import("react").Context<import("./SequenceManager.js").SequenceManagerContext>;
|
|
78
78
|
readonly SequenceManagerRefContext: import("react").Context<import("./SequenceManager.js").SequenceManagerRef>;
|
|
79
79
|
readonly SequenceStackTracesUpdateContext: import("react").Context<import("./sequence-stack-traces.js").UpdateResolvedStackTraceFn>;
|
|
80
|
-
readonly wrapInSchema: <S extends SequenceSchema, Props extends object>({ Component, schema, supportsEffects, }: {
|
|
80
|
+
readonly wrapInSchema: <S extends SequenceSchema, Props extends object>({ Component, componentIdentity, schema, supportsEffects, }: {
|
|
81
81
|
Component: import("react").ComponentType<Props & {
|
|
82
82
|
readonly _experimentalControls: import("./CompositionManager.js").SequenceControls | undefined;
|
|
83
83
|
}>;
|
|
84
|
+
componentIdentity: string | null;
|
|
84
85
|
schema: S;
|
|
85
86
|
supportsEffects: boolean;
|
|
86
87
|
}) => import("react").ComponentType<Props>;
|
|
@@ -93,6 +94,12 @@ export declare const Internals: {
|
|
|
93
94
|
readonly step: 1;
|
|
94
95
|
readonly hiddenFromList: true;
|
|
95
96
|
};
|
|
97
|
+
readonly freeze: {
|
|
98
|
+
readonly type: "number";
|
|
99
|
+
readonly default: null;
|
|
100
|
+
readonly step: 1;
|
|
101
|
+
readonly hiddenFromList: true;
|
|
102
|
+
};
|
|
96
103
|
readonly durationInFrames: {
|
|
97
104
|
readonly type: "number";
|
|
98
105
|
readonly default: undefined;
|
|
@@ -739,6 +746,12 @@ export declare const Internals: {
|
|
|
739
746
|
readonly step: 1;
|
|
740
747
|
readonly hiddenFromList: true;
|
|
741
748
|
};
|
|
749
|
+
readonly freezeField: {
|
|
750
|
+
readonly type: "number";
|
|
751
|
+
readonly default: null;
|
|
752
|
+
readonly step: 1;
|
|
753
|
+
readonly hiddenFromList: true;
|
|
754
|
+
};
|
|
742
755
|
readonly fromField: {
|
|
743
756
|
readonly type: "number";
|
|
744
757
|
readonly default: 0;
|
|
@@ -746,4 +759,4 @@ export declare const Internals: {
|
|
|
746
759
|
readonly hiddenFromList: true;
|
|
747
760
|
};
|
|
748
761
|
};
|
|
749
|
-
export type { ArrayFieldSchema, ArrayItemFieldSchema, CannotUpdateSequenceReason, CanUpdateEffectPropsResponse, CanUpdateEffectPropsResponseFalse, CanUpdateEffectPropsResponseTrue, CanUpdateSequencePropsResponse, CanUpdateSequencePropsResponseFalse, CanUpdateSequencePropsResponseTrue, CanUpdateSequencePropStatus, CanUpdateSequencePropStatusFalse, CanUpdateSequencePropStatusKeyframed, CanUpdateSequencePropStatusStatic, CompositionManagerContext, CompProps, DragOverrides, DragOverrideValue, EffectDragOverrides, GetDragOverrides, GetEffectDragOverrides, GetEffectPropStatuses, GetPropStatuses, LoggingContextValue, MediaVolumeContextValue, NonceHistory, OverrideIdsToNodePathsGettersContext, OverrideIdsToNodePathsSettersContext, OverrideIdToNodePaths, OverrideToNodePathGetters, OverrideToNodeSetters, PlaybackRateContextValue, PropStatuses, RemotionAudioContextState, RemotionEnvironment, ResolvedStackLocation, ScheduleAudioNodeOptions, ScheduleAudioNodeResult, SequenceFieldSchema, SequenceNodePath, SequencePropsSubscriptionKey, SequenceSchema, SerializedJSONWithCustomFields, SetMediaVolumeContextValue, SetTimelineContextValue, TCompMetadata, TComposition, TimelineContextValue, TRenderAsset, TSequence, VisibleFieldSchema, WatchRemotionStaticFilesPayload, };
|
|
762
|
+
export type { ArrayFieldSchema, ArrayItemFieldSchema, CannotUpdateSequenceReason, CanUpdateEffectPropsResponse, CanUpdateEffectPropsResponseFalse, CanUpdateEffectPropsResponseTrue, CanUpdateSequencePropsResponse, CanUpdateSequencePropsResponseFalse, CanUpdateSequencePropsResponseTrue, CanUpdateSequencePropStatus, 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, SequenceFieldSchema, SequenceNodePath, SequencePropsSubscriptionKey, SequenceSchema, SerializedJSONWithCustomFields, SetMediaVolumeContextValue, SetTimelineContextValue, TCompMetadata, TComposition, TimelineContextValue, TRenderAsset, TSequence, VisibleFieldSchema, WatchRemotionStaticFilesPayload, };
|
package/dist/cjs/internals.js
CHANGED
|
@@ -262,5 +262,6 @@ exports.Internals = {
|
|
|
262
262
|
getEffectPropStatusesCtx: use_memoized_effects_js_1.getEffectPropStatusesCtx,
|
|
263
263
|
hiddenField: sequence_field_schema_js_1.hiddenField,
|
|
264
264
|
durationInFramesField: sequence_field_schema_js_1.durationInFramesField,
|
|
265
|
+
freezeField: sequence_field_schema_js_1.freezeField,
|
|
265
266
|
fromField: sequence_field_schema_js_1.fromField,
|
|
266
267
|
};
|
|
@@ -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/no-react.d.ts
CHANGED
|
@@ -70,6 +70,12 @@ export declare const NoReactInternals: {
|
|
|
70
70
|
readonly step: 1;
|
|
71
71
|
readonly hiddenFromList: true;
|
|
72
72
|
};
|
|
73
|
+
readonly freeze: {
|
|
74
|
+
readonly type: "number";
|
|
75
|
+
readonly default: null;
|
|
76
|
+
readonly step: 1;
|
|
77
|
+
readonly hiddenFromList: true;
|
|
78
|
+
};
|
|
73
79
|
readonly durationInFrames: {
|
|
74
80
|
readonly type: "number";
|
|
75
81
|
readonly default: undefined;
|
|
@@ -7,7 +7,7 @@ export type NumberFieldSchema = {
|
|
|
7
7
|
min?: number;
|
|
8
8
|
max?: number;
|
|
9
9
|
step?: number;
|
|
10
|
-
default: number | undefined;
|
|
10
|
+
default: number | null | undefined;
|
|
11
11
|
description?: string;
|
|
12
12
|
hiddenFromList: boolean;
|
|
13
13
|
keyframable?: boolean;
|
|
@@ -242,6 +242,12 @@ export declare const fromField: {
|
|
|
242
242
|
readonly step: 1;
|
|
243
243
|
readonly hiddenFromList: true;
|
|
244
244
|
};
|
|
245
|
+
export declare const freezeField: {
|
|
246
|
+
readonly type: "number";
|
|
247
|
+
readonly default: null;
|
|
248
|
+
readonly step: 1;
|
|
249
|
+
readonly hiddenFromList: true;
|
|
250
|
+
};
|
|
245
251
|
export declare const sequenceSchema: {
|
|
246
252
|
readonly hidden: BooleanFieldSchema;
|
|
247
253
|
readonly showInTimeline: HiddenFieldSchema;
|
|
@@ -251,6 +257,12 @@ export declare const sequenceSchema: {
|
|
|
251
257
|
readonly step: 1;
|
|
252
258
|
readonly hiddenFromList: true;
|
|
253
259
|
};
|
|
260
|
+
readonly freeze: {
|
|
261
|
+
readonly type: "number";
|
|
262
|
+
readonly default: null;
|
|
263
|
+
readonly step: 1;
|
|
264
|
+
readonly hiddenFromList: true;
|
|
265
|
+
};
|
|
254
266
|
readonly durationInFrames: {
|
|
255
267
|
readonly type: "number";
|
|
256
268
|
readonly default: undefined;
|
|
@@ -329,6 +341,12 @@ export declare const sequenceSchema: {
|
|
|
329
341
|
export declare const sequenceSchemaWithoutFrom: {
|
|
330
342
|
readonly hidden: BooleanFieldSchema;
|
|
331
343
|
readonly showInTimeline: HiddenFieldSchema;
|
|
344
|
+
readonly freeze: {
|
|
345
|
+
readonly type: "number";
|
|
346
|
+
readonly default: null;
|
|
347
|
+
readonly step: 1;
|
|
348
|
+
readonly hiddenFromList: true;
|
|
349
|
+
};
|
|
332
350
|
readonly durationInFrames: {
|
|
333
351
|
readonly type: "number";
|
|
334
352
|
readonly default: undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.sequenceSchemaDefaultLayoutNone = exports.sequenceSchemaWithoutFrom = exports.sequenceSchema = exports.fromField = exports.durationInFramesField = exports.extendSchemaWithSequenceName = exports.sequenceNameField = exports.hiddenField = exports.sequenceStyleSchema = exports.sequencePremountSchema = exports.sequenceVisualStyleSchema = void 0;
|
|
3
|
+
exports.sequenceSchemaDefaultLayoutNone = exports.sequenceSchemaWithoutFrom = exports.sequenceSchema = exports.freezeField = exports.fromField = exports.durationInFramesField = exports.extendSchemaWithSequenceName = exports.sequenceNameField = exports.hiddenField = exports.sequenceStyleSchema = exports.sequencePremountSchema = exports.sequenceVisualStyleSchema = void 0;
|
|
4
4
|
exports.sequenceVisualStyleSchema = {
|
|
5
5
|
'style.transformOrigin': {
|
|
6
6
|
type: 'transform-origin',
|
|
@@ -95,10 +95,17 @@ exports.fromField = {
|
|
|
95
95
|
step: 1,
|
|
96
96
|
hiddenFromList: true,
|
|
97
97
|
};
|
|
98
|
+
exports.freezeField = {
|
|
99
|
+
type: 'number',
|
|
100
|
+
default: null,
|
|
101
|
+
step: 1,
|
|
102
|
+
hiddenFromList: true,
|
|
103
|
+
};
|
|
98
104
|
exports.sequenceSchema = (0, exports.extendSchemaWithSequenceName)({
|
|
99
105
|
hidden: exports.hiddenField,
|
|
100
106
|
showInTimeline: showInTimelineField,
|
|
101
107
|
from: exports.fromField,
|
|
108
|
+
freeze: exports.freezeField,
|
|
102
109
|
durationInFrames: exports.durationInFramesField,
|
|
103
110
|
layout: {
|
|
104
111
|
type: 'enum',
|
|
@@ -113,6 +120,7 @@ exports.sequenceSchema = (0, exports.extendSchemaWithSequenceName)({
|
|
|
113
120
|
exports.sequenceSchemaWithoutFrom = (0, exports.extendSchemaWithSequenceName)({
|
|
114
121
|
hidden: exports.hiddenField,
|
|
115
122
|
showInTimeline: showInTimelineField,
|
|
123
|
+
freeze: exports.freezeField,
|
|
116
124
|
durationInFrames: exports.durationInFramesField,
|
|
117
125
|
layout: exports.sequenceSchema.layout,
|
|
118
126
|
});
|