remotion 4.0.535 → 4.0.536
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/AbsoluteFill.d.ts +1 -1
- package/dist/cjs/HtmlInCanvas.d.ts +4 -2
- package/dist/cjs/HtmlInCanvas.js +4 -4
- package/dist/cjs/Img.d.ts +4 -2
- package/dist/cjs/Img.js +2 -2
- package/dist/cjs/Interactive.d.ts +21 -7
- package/dist/cjs/Interactive.js +22 -1
- package/dist/cjs/Sequence.js +47 -3
- package/dist/cjs/SequenceActivityBoundary.js +14 -1
- package/dist/cjs/SequenceActivityBudget.js +26 -11
- package/dist/cjs/SequenceActivitySuspensionProvider.d.ts +4 -0
- package/dist/cjs/SequenceActivitySuspensionProvider.js +45 -0
- package/dist/cjs/SequenceManager.d.ts +5 -0
- package/dist/cjs/SequenceManager.js +22 -4
- package/dist/cjs/Track.js +1 -2
- package/dist/cjs/animated-image/AnimatedImage.d.ts +3 -2
- package/dist/cjs/animated-image/AnimatedImage.js +6 -4
- package/dist/cjs/animated-image/canvas.d.ts +2 -1
- package/dist/cjs/animated-image/canvas.js +2 -2
- package/dist/cjs/animated-image/props.d.ts +2 -1
- package/dist/cjs/asset-types.d.ts +4 -0
- package/dist/cjs/audio/shared-audio-tags.d.ts +1 -1
- package/dist/cjs/audio/shared-audio-tags.js +1 -1
- package/dist/cjs/canvas-image/CanvasImage.d.ts +3 -2
- package/dist/cjs/canvas-image/CanvasImage.js +4 -4
- package/dist/cjs/canvas-image/props.d.ts +2 -1
- package/dist/cjs/effects/Solid.d.ts +3 -2
- package/dist/cjs/effects/Solid.js +4 -4
- package/dist/cjs/effects/effect-types.d.ts +4 -0
- package/dist/cjs/effects/index.d.ts +1 -1
- package/dist/cjs/effects/run-effect-chain.d.ts +3 -1
- package/dist/cjs/effects/run-effect-chain.js +94 -56
- package/dist/cjs/effects/use-effect-chain-state.d.ts +2 -1
- package/dist/cjs/effects/use-effect-chain-state.js +11 -2
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/interactivity-schema.d.ts +5 -5
- package/dist/cjs/interactivity-schema.js +2 -1
- package/dist/cjs/internals.d.ts +8 -10
- package/dist/cjs/internals.js +0 -1
- package/dist/cjs/interpolate.js +8 -1
- package/dist/cjs/no-react.d.ts +1 -1
- package/dist/cjs/sequence-activity-context.d.ts +1 -1
- package/dist/cjs/sequence-activity-context.js +4 -3
- package/dist/cjs/sequence-activity-defaults.d.ts +1 -1
- package/dist/cjs/sequence-activity-defaults.js +1 -1
- package/dist/cjs/timeline-track-context.d.ts +0 -1
- package/dist/cjs/timeline-track-context.js +1 -2
- package/dist/cjs/use-schema.js +3 -1
- package/dist/cjs/use-timeline-seek.d.ts +1 -0
- package/dist/cjs/use-timeline-seek.js +10 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/video/seek-until-right.js +11 -7
- package/dist/cjs/wrap-remotion-context.d.ts +0 -1
- package/dist/cjs/wrap-remotion-context.js +1 -4
- package/dist/esm/index.mjs +704 -557
- package/dist/esm/no-react.mjs +4 -3
- package/dist/esm/version.mjs +1 -1
- package/package.json +2 -2
- package/dist/cjs/nonce.d.ts +0 -11
- package/dist/cjs/nonce.js +0 -42
- package/dist/cjs/sequence-order-marker.d.ts +0 -58
- package/dist/cjs/sequence-order-marker.js +0 -44
|
@@ -184,7 +184,7 @@ export declare const absoluteFillSchema: {
|
|
|
184
184
|
readonly children: import("./interactivity-schema.js").InteractivitySchemaField;
|
|
185
185
|
readonly premountFor: {
|
|
186
186
|
readonly type: "number";
|
|
187
|
-
readonly default:
|
|
187
|
+
readonly default: undefined;
|
|
188
188
|
readonly description: "Premount For";
|
|
189
189
|
readonly min: 0;
|
|
190
190
|
readonly step: 1;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { EffectsProp } from './effects/effect-types.js';
|
|
2
|
+
import type { EffectsProp, EffectsOutputSize } from './effects/effect-types.js';
|
|
3
3
|
import type { InteractiveBaseProps, InteractiveCropProps } from './Interactive.js';
|
|
4
4
|
import type { AbsoluteFillLayout } from './Sequence.js';
|
|
5
5
|
declare global {
|
|
@@ -85,6 +85,7 @@ export type HtmlInCanvasProps = Omit<InteractiveBaseProps, 'children'> & Interac
|
|
|
85
85
|
readonly width: number;
|
|
86
86
|
readonly height: number;
|
|
87
87
|
readonly effects?: EffectsProp;
|
|
88
|
+
readonly effectsOutputSize?: EffectsOutputSize;
|
|
88
89
|
readonly children: React.ReactNode;
|
|
89
90
|
readonly onPaint?: HtmlInCanvasOnPaint;
|
|
90
91
|
readonly onInit?: HtmlInCanvasOnInit;
|
|
@@ -205,7 +206,7 @@ export declare const htmlInCanvasSchema: {
|
|
|
205
206
|
};
|
|
206
207
|
readonly premountFor: {
|
|
207
208
|
readonly type: "number";
|
|
208
|
-
readonly default:
|
|
209
|
+
readonly default: undefined;
|
|
209
210
|
readonly description: "Premount For";
|
|
210
211
|
readonly min: 0;
|
|
211
212
|
readonly step: 1;
|
|
@@ -313,6 +314,7 @@ export declare const HtmlInCanvas: React.ForwardRefExoticComponent<Omit<Interact
|
|
|
313
314
|
readonly width: number;
|
|
314
315
|
readonly height: number;
|
|
315
316
|
readonly effects?: EffectsProp | undefined;
|
|
317
|
+
readonly effectsOutputSize?: EffectsOutputSize | undefined;
|
|
316
318
|
readonly children: React.ReactNode;
|
|
317
319
|
readonly onPaint?: HtmlInCanvasOnPaint | undefined;
|
|
318
320
|
readonly onInit?: HtmlInCanvasOnInit | undefined;
|
package/dist/cjs/HtmlInCanvas.js
CHANGED
|
@@ -146,7 +146,7 @@ const defaultOnPaint = ({ canvas, elementImage, }) => {
|
|
|
146
146
|
ctx.drawElementImage(elementImage, 0, 0);
|
|
147
147
|
};
|
|
148
148
|
const HtmlInCanvasAncestorContext = (0, react_1.createContext)(null);
|
|
149
|
-
const HtmlInCanvasContent = (0, react_1.forwardRef)(({ width, height, effects, children, canvasSiblings, onPaint, onInit, pixelDensity, controls, style, renderFrame, }, ref) => {
|
|
149
|
+
const HtmlInCanvasContent = (0, react_1.forwardRef)(({ width, height, effects, effectsOutputSize, children, canvasSiblings, onPaint, onInit, pixelDensity, controls, style, renderFrame, }, ref) => {
|
|
150
150
|
var _a, _b;
|
|
151
151
|
const ancestorPaintState = (0, react_1.useContext)(HtmlInCanvasAncestorContext);
|
|
152
152
|
assertHtmlInCanvasDimensions(width, height);
|
|
@@ -221,7 +221,7 @@ const HtmlInCanvasContent = (0, react_1.forwardRef)(({ width, height, effects, c
|
|
|
221
221
|
ref.current = node;
|
|
222
222
|
}
|
|
223
223
|
}, [ref, paintTargetMode]);
|
|
224
|
-
const chainState = (0, use_effect_chain_state_js_1.useEffectChainState)();
|
|
224
|
+
const chainState = (0, use_effect_chain_state_js_1.useEffectChainState)(effectsOutputSize);
|
|
225
225
|
const memoizedEffects = (0, use_memoized_effects_js_1.useMemoizedEffects)({
|
|
226
226
|
effects,
|
|
227
227
|
overrideId: (_a = controls === null || controls === void 0 ? void 0 : controls.overrideId) !== null && _a !== void 0 ? _a : null,
|
|
@@ -561,7 +561,7 @@ const HtmlInCanvasContentForRendering = (0, react_1.forwardRef)((props, ref) =>
|
|
|
561
561
|
return jsx_runtime_1.jsx(HtmlInCanvasContent, { ...props, ref: ref, renderFrame: frame });
|
|
562
562
|
});
|
|
563
563
|
HtmlInCanvasContentForRendering.displayName = 'HtmlInCanvasContentForRendering';
|
|
564
|
-
const HtmlInCanvasInner = (0, react_1.forwardRef)(({ width, height, effects = [], children, onPaint, onInit, pixelDensity, _remotionInternalCanvasSiblings, controls, style, cropLeft, cropRight, cropTop, cropBottom, durationInFrames, premountFor, postmountFor, styleWhilePremounted, styleWhilePostmounted, name, ...sequenceProps }, ref) => {
|
|
564
|
+
const HtmlInCanvasInner = (0, react_1.forwardRef)(({ width, height, effects = [], effectsOutputSize, children, onPaint, onInit, pixelDensity, _remotionInternalCanvasSiblings, controls, style, cropLeft, cropRight, cropTop, cropBottom, durationInFrames, premountFor, postmountFor, styleWhilePremounted, styleWhilePostmounted, name, ...sequenceProps }, ref) => {
|
|
565
565
|
var _a;
|
|
566
566
|
const { isRendering } = (0, use_remotion_environment_js_1.useRemotionEnvironment)();
|
|
567
567
|
const Content = isRendering
|
|
@@ -600,7 +600,7 @@ const HtmlInCanvasInner = (0, react_1.forwardRef)(({ width, height, effects = []
|
|
|
600
600
|
style: premountingStyle,
|
|
601
601
|
componentName: '<HtmlInCanvas />',
|
|
602
602
|
});
|
|
603
|
-
return (jsx_runtime_1.jsx(freeze_js_1.Freeze, { frame: freezeFrame, active: isPremountingOrPostmounting, _remotionInternalIsPremounting: premountingActive, children: jsx_runtime_1.jsx(Sequence_js_1.Sequence, { layout: "none", durationInFrames: durationInFrames, name: name !== null && name !== void 0 ? name : '<HtmlInCanvas>', _remotionInternalDocumentationLink: "https://www.remotion.dev/docs/remotion/html-in-canvas", controls: controls, _remotionInternalEffects: memoizedEffectDefinitions, ...sequenceProps, _remotionInternalPremountDisplay: effectivePremountFor || null, _remotionInternalPostmountDisplay: effectivePostmountFor || null, _remotionInternalIsPremounting: premountingActive, _remotionInternalIsPostmounting: postmountingActive, children: jsx_runtime_1.jsx(Content, { ref: setCanvasRef, renderFrame: null, width: width, height: height, effects: effects, onPaint: onPaint, onInit: onInit, pixelDensity: pixelDensity, canvasSiblings: _remotionInternalCanvasSiblings !== null && _remotionInternalCanvasSiblings !== void 0 ? _remotionInternalCanvasSiblings : null, controls: controls, style: croppedStyle !== null && croppedStyle !== void 0 ? croppedStyle : undefined, children: children }) }) }));
|
|
603
|
+
return (jsx_runtime_1.jsx(freeze_js_1.Freeze, { frame: freezeFrame, active: isPremountingOrPostmounting, _remotionInternalIsPremounting: premountingActive, children: jsx_runtime_1.jsx(Sequence_js_1.Sequence, { layout: "none", durationInFrames: durationInFrames, name: name !== null && name !== void 0 ? name : '<HtmlInCanvas>', _remotionInternalDocumentationLink: "https://www.remotion.dev/docs/remotion/html-in-canvas", controls: controls, _remotionInternalEffects: memoizedEffectDefinitions, ...sequenceProps, _remotionInternalPremountDisplay: effectivePremountFor || null, _remotionInternalPostmountDisplay: effectivePostmountFor || null, _remotionInternalIsPremounting: premountingActive, _remotionInternalIsPostmounting: postmountingActive, children: jsx_runtime_1.jsx(Content, { ref: setCanvasRef, renderFrame: null, width: width, height: height, effects: effects, effectsOutputSize: effectsOutputSize !== null && effectsOutputSize !== void 0 ? effectsOutputSize : null, onPaint: onPaint, onInit: onInit, pixelDensity: pixelDensity, canvasSiblings: _remotionInternalCanvasSiblings !== null && _remotionInternalCanvasSiblings !== void 0 ? _remotionInternalCanvasSiblings : null, controls: controls, style: croppedStyle !== null && croppedStyle !== void 0 ? croppedStyle : undefined, children: children }) }) }));
|
|
604
604
|
});
|
|
605
605
|
HtmlInCanvasInner.displayName = 'HtmlInCanvas';
|
|
606
606
|
exports.htmlInCanvasSchema = {
|
package/dist/cjs/Img.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { EffectsProp } from './effects/effect-types.js';
|
|
2
|
+
import type { EffectsProp, EffectsOutputSize } from './effects/effect-types.js';
|
|
3
3
|
import type { InteractiveBaseProps, InteractiveCropProps, InteractivePremountProps } from './Interactive.js';
|
|
4
4
|
type NativeImgProps = Omit<React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, 'src'>;
|
|
5
5
|
export type ImgProps = NativeImgProps & {
|
|
@@ -11,6 +11,7 @@ export type ImgProps = NativeImgProps & {
|
|
|
11
11
|
readonly onImageError?: (error: Error) => void;
|
|
12
12
|
readonly src: string;
|
|
13
13
|
readonly effects?: EffectsProp;
|
|
14
|
+
readonly effectsOutputSize?: EffectsOutputSize;
|
|
14
15
|
readonly showInTimeline?: boolean;
|
|
15
16
|
readonly name?: string;
|
|
16
17
|
} & Omit<InteractiveBaseProps, 'playbackRate'> & InteractiveCropProps & InteractivePremountProps;
|
|
@@ -128,7 +129,7 @@ export declare const imgSchema: {
|
|
|
128
129
|
};
|
|
129
130
|
readonly premountFor: {
|
|
130
131
|
readonly type: "number";
|
|
131
|
-
readonly default:
|
|
132
|
+
readonly default: undefined;
|
|
132
133
|
readonly description: "Premount For";
|
|
133
134
|
readonly min: 0;
|
|
134
135
|
readonly step: 1;
|
|
@@ -229,6 +230,7 @@ export declare const Img: React.ComponentType<NativeImgProps & {
|
|
|
229
230
|
readonly onImageError?: ((error: Error) => void) | undefined;
|
|
230
231
|
readonly src: string;
|
|
231
232
|
readonly effects?: EffectsProp | undefined;
|
|
233
|
+
readonly effectsOutputSize?: EffectsOutputSize | undefined;
|
|
232
234
|
readonly showInTimeline?: boolean | undefined;
|
|
233
235
|
readonly name?: string | undefined;
|
|
234
236
|
} & Omit<InteractiveBaseProps, "playbackRate"> & InteractiveCropProps & InteractivePremountProps>;
|
package/dist/cjs/Img.js
CHANGED
|
@@ -286,7 +286,7 @@ const getFitFromObjectFit = (style) => {
|
|
|
286
286
|
}
|
|
287
287
|
return undefined;
|
|
288
288
|
};
|
|
289
|
-
const ImgInner = ({ effects = [], ref, hidden, name, showInTimeline, src, from, trimBefore, durationInFrames, freeze, premountFor, postmountFor, styleWhilePremounted, styleWhilePostmounted, controls, width, height, className, style, cropLeft, cropRight, cropTop, cropBottom, id, pauseWhenLoading, maxRetries, delayRenderRetries, delayRenderTimeoutInMilliseconds, onImageError, ...props }) => {
|
|
289
|
+
const ImgInner = ({ effects = [], effectsOutputSize, ref, hidden, name, showInTimeline, src, from, trimBefore, durationInFrames, freeze, premountFor, postmountFor, styleWhilePremounted, styleWhilePostmounted, controls, width, height, className, style, cropLeft, cropRight, cropTop, cropBottom, id, pauseWhenLoading, maxRetries, delayRenderRetries, delayRenderTimeoutInMilliseconds, onImageError, ...props }) => {
|
|
290
290
|
var _a;
|
|
291
291
|
const shouldPauseWhenLoading = (0, v5_flag_js_1.resolveV5Default)(pauseWhenLoading);
|
|
292
292
|
if (effects.length === 0) {
|
|
@@ -305,7 +305,7 @@ const ImgInner = ({ effects = [], ref, hidden, name, showInTimeline, src, from,
|
|
|
305
305
|
const canvasHeight = typeof height === 'number' ? height : undefined;
|
|
306
306
|
const canvasProps = props;
|
|
307
307
|
const canvasFit = (_a = getFitFromObjectFit(style)) !== null && _a !== void 0 ? _a : 'fill';
|
|
308
|
-
return (jsx_runtime_1.jsx(CanvasImageWithPrivateProps, { src: src, width: canvasWidth, height: canvasHeight, fit: canvasFit, effects: effects, className: className, style: style, cropLeft: cropLeft, cropRight: cropRight, cropTop: cropTop, cropBottom: cropBottom, id: id, onError: onImageError, pauseWhenLoading: shouldPauseWhenLoading, maxRetries: maxRetries, delayRenderRetries: delayRenderRetries, delayRenderTimeoutInMilliseconds: delayRenderTimeoutInMilliseconds, from: from, trimBefore: trimBefore, durationInFrames: durationInFrames, freeze: freeze, premountFor: premountFor, postmountFor: postmountFor, styleWhilePremounted: styleWhilePremounted, styleWhilePostmounted: styleWhilePostmounted, hidden: hidden, name: name !== null && name !== void 0 ? name : '<Img>', showInTimeline: showInTimeline, _remotionInternalDocumentationLink: "https://www.remotion.dev/docs/img", _remotionInternalCropComponentName: "<Img />", controls: controls, ...canvasProps }));
|
|
308
|
+
return (jsx_runtime_1.jsx(CanvasImageWithPrivateProps, { src: src, width: canvasWidth, height: canvasHeight, fit: canvasFit, effects: effects, effectsOutputSize: effectsOutputSize, className: className, style: style, cropLeft: cropLeft, cropRight: cropRight, cropTop: cropTop, cropBottom: cropBottom, id: id, onError: onImageError, pauseWhenLoading: shouldPauseWhenLoading, maxRetries: maxRetries, delayRenderRetries: delayRenderRetries, delayRenderTimeoutInMilliseconds: delayRenderTimeoutInMilliseconds, from: from, trimBefore: trimBefore, durationInFrames: durationInFrames, freeze: freeze, premountFor: premountFor, postmountFor: postmountFor, styleWhilePremounted: styleWhilePremounted, styleWhilePostmounted: styleWhilePostmounted, hidden: hidden, name: name !== null && name !== void 0 ? name : '<Img>', showInTimeline: showInTimeline, _remotionInternalDocumentationLink: "https://www.remotion.dev/docs/img", _remotionInternalCropComponentName: "<Img />", controls: controls, ...canvasProps }));
|
|
309
309
|
};
|
|
310
310
|
/*
|
|
311
311
|
* @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.
|
|
@@ -24,19 +24,25 @@ type StyleAcceptsCssProperties<Style> = true extends StyleMemberAcceptsCssProper
|
|
|
24
24
|
type PropsBranchAcceptsStyle<Props> = Props extends unknown ? 'style' extends keyof Props ? StyleAcceptsCssProperties<Props[Extract<'style', keyof Props>]> : false : never;
|
|
25
25
|
type EveryPropsBranchAcceptsStyle<Props> = [Props] extends [never] ? false : false extends PropsBranchAcceptsStyle<Props> ? false : true;
|
|
26
26
|
type ComponentAcceptingStyle<Component extends React.ElementType, ReservedKey extends PropertyKey> = ComponentWithoutReservedProps<Component, ReservedKey> & (EveryPropsBranchAcceptsStyle<React.ComponentPropsWithoutRef<Component>> extends true ? unknown : never);
|
|
27
|
-
type
|
|
28
|
-
|
|
27
|
+
type WithSchemaOptions<Options extends {
|
|
28
|
+
schema: InteractivitySchema;
|
|
29
|
+
componentName: string;
|
|
30
|
+
}, WithDefaults extends boolean> = WithDefaults extends true ? Omit<Options, 'schema' | 'componentName' | 'wrapInSequence'> & Partial<Pick<Options, 'schema' | 'componentName'>> : Options;
|
|
31
|
+
type WithSequence<WithDefaults extends boolean> = {
|
|
32
|
+
<S extends InteractivitySchema, Component extends React.ElementType>(options: WithSchemaOptions<Omit<WithInteractivitySchemaOptions<S, React.ComponentPropsWithoutRef<Component>>, 'Component' | 'supportsEffects'> & {
|
|
29
33
|
readonly Component: ComponentWithoutReservedProps<Component, WithSchemaReservedKey | 'style' | 'width' | 'height'>;
|
|
30
34
|
readonly wrapInSequence: true;
|
|
31
35
|
readonly layout: 'absolute-fill';
|
|
32
|
-
}): React.FC<React.ComponentPropsWithoutRef<Component> & InteractiveBaseProps & InteractivePremountProps & InteractiveCropProps & InteractiveTransformProps & Pick<SequenceProps, 'width' | 'height'> & {
|
|
36
|
+
}, WithDefaults>): React.FC<React.ComponentPropsWithoutRef<Component> & InteractiveBaseProps & InteractivePremountProps & InteractiveCropProps & InteractiveTransformProps & Pick<SequenceProps, 'width' | 'height'> & {
|
|
33
37
|
readonly ref?: React.Ref<HTMLDivElement>;
|
|
34
38
|
}>;
|
|
35
|
-
<S extends InteractivitySchema, Component extends React.ElementType>(options: Omit<WithInteractivitySchemaOptions<S, React.ComponentPropsWithoutRef<Component>>, 'Component' | 'supportsEffects'> & {
|
|
39
|
+
<S extends InteractivitySchema, Component extends React.ElementType>(options: WithSchemaOptions<Omit<WithInteractivitySchemaOptions<S, React.ComponentPropsWithoutRef<Component>>, 'Component' | 'supportsEffects'> & {
|
|
36
40
|
readonly Component: ComponentAcceptingStyle<Component, WithSchemaReservedKey>;
|
|
37
41
|
readonly wrapInSequence: true;
|
|
38
42
|
readonly layout?: 'none';
|
|
39
|
-
}): React.FC<React.ComponentPropsWithRef<Component> & InteractiveBaseProps & InteractivePremountProps & InteractiveCropProps>;
|
|
43
|
+
}, WithDefaults>): React.FC<React.ComponentPropsWithRef<Component> & InteractiveBaseProps & InteractivePremountProps & InteractiveCropProps>;
|
|
44
|
+
};
|
|
45
|
+
type WithSchema = WithSequence<false> & {
|
|
40
46
|
<S extends InteractivitySchema, Props extends object>(options: WithInteractivitySchemaOptions<S, Props> & {
|
|
41
47
|
readonly wrapInSequence?: false;
|
|
42
48
|
readonly layout?: never;
|
|
@@ -370,7 +376,7 @@ export declare const Interactive: {
|
|
|
370
376
|
premountSchema: {
|
|
371
377
|
readonly premountFor: {
|
|
372
378
|
readonly type: "number";
|
|
373
|
-
readonly default:
|
|
379
|
+
readonly default: undefined;
|
|
374
380
|
readonly description: "Premount For";
|
|
375
381
|
readonly min: 0;
|
|
376
382
|
readonly step: 1;
|
|
@@ -544,7 +550,7 @@ export declare const Interactive: {
|
|
|
544
550
|
};
|
|
545
551
|
readonly premountFor: {
|
|
546
552
|
readonly type: "number";
|
|
547
|
-
readonly default:
|
|
553
|
+
readonly default: undefined;
|
|
548
554
|
readonly description: "Premount For";
|
|
549
555
|
readonly min: 0;
|
|
550
556
|
readonly step: 1;
|
|
@@ -604,7 +610,15 @@ export declare const Interactive: {
|
|
|
604
610
|
};
|
|
605
611
|
};
|
|
606
612
|
};
|
|
613
|
+
/**
|
|
614
|
+
* @deprecated Use `Interactive.create()` instead: https://www.remotion.dev/docs/interactive-create
|
|
615
|
+
*/
|
|
607
616
|
withSchema: WithSchema;
|
|
617
|
+
/**
|
|
618
|
+
* @description Creates a component with timing props and editable Studio controls.
|
|
619
|
+
* @see [Documentation](https://www.remotion.dev/docs/interactive-create)
|
|
620
|
+
*/
|
|
621
|
+
create: WithSequence<true>;
|
|
608
622
|
_internalMakeRemotionComponentIdentity: ({ packageName, componentName, }: {
|
|
609
623
|
readonly packageName: RemotionComponentIdentityPackage;
|
|
610
624
|
readonly componentName: string;
|
package/dist/cjs/Interactive.js
CHANGED
|
@@ -164,7 +164,7 @@ const withSchema = (untypedOptions) => {
|
|
|
164
164
|
style: { overflow: 'hidden', ...croppedStyle },
|
|
165
165
|
ref: ref,
|
|
166
166
|
}
|
|
167
|
-
: {}), durationInFrames: durationInFrames, from: from, trimBefore: trimBefore, playbackRate: playbackRate, loop: loop, freeze: freeze, hidden: hidden, name: name !== null && name !== void 0 ? name : componentName, _remotionInternalDocumentationLink: "https://www.remotion.dev/docs/interactive-
|
|
167
|
+
: {}), durationInFrames: durationInFrames, from: from, trimBefore: trimBefore, playbackRate: playbackRate, loop: loop, freeze: freeze, hidden: hidden, name: name !== null && name !== void 0 ? name : componentName, _remotionInternalDocumentationLink: "https://www.remotion.dev/docs/interactive-create", showInTimeline: isCurrentComposition ? false : showInTimeline, controls: controls, _remotionInternalPremountDisplay: effectivePremountFor || null, _remotionInternalPostmountDisplay: effectivePostmountFor || null, _remotionInternalIsPremounting: premountingActive, _remotionInternalIsPostmounting: postmountingActive, children: react_1.default.createElement(Component, {
|
|
168
168
|
...componentPropsWithoutCropping,
|
|
169
169
|
...(layout === 'none'
|
|
170
170
|
? { style: croppedStyle !== null && croppedStyle !== void 0 ? croppedStyle : undefined, ref }
|
|
@@ -187,6 +187,19 @@ const withSchema = (untypedOptions) => {
|
|
|
187
187
|
(0, enable_sequence_stack_traces_js_1.addSequenceStackTraces)(Wrapped);
|
|
188
188
|
return Wrapped;
|
|
189
189
|
};
|
|
190
|
+
const create = (untypedOptions) => {
|
|
191
|
+
var _a;
|
|
192
|
+
var _b, _c;
|
|
193
|
+
const options = untypedOptions;
|
|
194
|
+
return withSchema({
|
|
195
|
+
...options,
|
|
196
|
+
wrapInSequence: true,
|
|
197
|
+
schema: (_b = options.schema) !== null && _b !== void 0 ? _b : {},
|
|
198
|
+
componentName: (_c = options.componentName) !== null && _c !== void 0 ? _c : (options.Component.displayName ||
|
|
199
|
+
((_a = options.Component.name) === null || _a === void 0 ? void 0 : _a.replace(/(.+)Inner$/, '$1')) ||
|
|
200
|
+
'Component'),
|
|
201
|
+
});
|
|
202
|
+
};
|
|
190
203
|
const makeInteractiveElement = (tag, displayName, schema) => {
|
|
191
204
|
const Inner = (0, react_1.forwardRef)((propsWithControls, ref) => {
|
|
192
205
|
const { durationInFrames, from, premountFor, postmountFor, styleWhilePremounted, styleWhilePostmounted, trimBefore, playbackRate, loop, freeze, hidden, name, showInTimeline, controls, cropLeft, cropRight, cropTop, cropBottom, style, ...props } = propsWithControls;
|
|
@@ -261,7 +274,15 @@ exports.Interactive = {
|
|
|
261
274
|
svgStrokeSchema: interactivity_schema_js_1.svgStrokeSchema,
|
|
262
275
|
premountSchema: interactivity_schema_js_1.premountSchema,
|
|
263
276
|
sequenceSchema: interactivity_schema_js_1.sequenceSchema,
|
|
277
|
+
/**
|
|
278
|
+
* @deprecated Use `Interactive.create()` instead: https://www.remotion.dev/docs/interactive-create
|
|
279
|
+
*/
|
|
264
280
|
withSchema,
|
|
281
|
+
/**
|
|
282
|
+
* @description Creates a component with timing props and editable Studio controls.
|
|
283
|
+
* @see [Documentation](https://www.remotion.dev/docs/interactive-create)
|
|
284
|
+
*/
|
|
285
|
+
create,
|
|
265
286
|
_internalMakeRemotionComponentIdentity: makeRemotionComponentIdentity,
|
|
266
287
|
A: makeInteractiveTextElement('a', '<Interactive.A>'),
|
|
267
288
|
Article: makeInteractiveTextElement('article', '<Interactive.Article>'),
|
package/dist/cjs/Sequence.js
CHANGED
|
@@ -1,8 +1,41 @@
|
|
|
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.SequenceWithoutFrom = exports.Sequence = exports.SequenceWithoutSchema = 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 AbsoluteFillElement_js_1 = require("./AbsoluteFillElement.js");
|
|
7
40
|
const committed_metadata_js_1 = require("./committed-metadata.js");
|
|
8
41
|
const component_identity_js_1 = require("./component-identity.js");
|
|
@@ -32,12 +65,14 @@ const SeriesContentVisibilityContext = (0, react_1.createContext)(true);
|
|
|
32
65
|
const SequenceContextProvider = (0, committed_metadata_js_1.withCommittedMetadata)(SequenceContext_js_1.SequenceContext.Provider);
|
|
33
66
|
const EMPTY_EFFECTS = [];
|
|
34
67
|
const RegularSequenceRefForwardingFunction = ({ from = 0, trimBefore = 0, playbackRate = 1, loop = false, freeze, durationInFrames, children, name, height, width, showInTimeline = true, hidden = false, controls, _remotionInternalEffects, _remotionInternalTimelineTrack: timelineTrackItem, _remotionInternalLoopDisplay: loopDisplay, _remotionInternalStack: stack, _remotionInternalSingleChildComponent: childComponentOverride, _remotionInternalDocumentationLink: documentationLink, _remotionInternalPremountDisplay: premountDisplay, _remotionInternalPostmountDisplay: postmountDisplay, _remotionInternalIsMedia: isMedia, cropLeft, cropRight, cropTop, cropBottom, ...other }, ref) => {
|
|
35
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
68
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
36
69
|
const { layout = 'absolute-fill' } = other;
|
|
37
70
|
const [id] = (0, react_1.useState)(() => String(Math.random()));
|
|
38
71
|
const parentSequence = (0, react_1.useContext)(SequenceContext_js_1.SequenceContext);
|
|
39
72
|
const activityRequested = (0, react_1.useContext)(sequence_activity_context_js_1.SequenceActivityContext);
|
|
40
73
|
const parentDormant = (0, react_1.useContext)(sequence_activity_context_js_1.SequenceActivityDormantContext);
|
|
74
|
+
const activitySuspended = (0, react_1.useContext)(sequence_activity_context_js_1.SequenceActivitySuspensionContext);
|
|
75
|
+
const hadActivity = (0, react_1.useRef)(false);
|
|
41
76
|
const env = (0, use_remotion_environment_js_1.useRemotionEnvironment)();
|
|
42
77
|
const activityEnabled = activityRequested && env.isStudio && !env.isRendering;
|
|
43
78
|
const timelineTrack = (0, react_1.useContext)(timeline_track_context_js_1.TimelineTrackContext);
|
|
@@ -521,7 +556,16 @@ const RegularSequenceRefForwardingFunction = ({ from = 0, trimBefore = 0, playba
|
|
|
521
556
|
(from + actualDurationInFrames) / parentPlaybackRate,
|
|
522
557
|
}
|
|
523
558
|
: null);
|
|
524
|
-
const renderActivity = activityEnabled &&
|
|
559
|
+
const renderActivity = activityEnabled &&
|
|
560
|
+
(!activityDormant ||
|
|
561
|
+
admitted ||
|
|
562
|
+
(activitySuspended && hadActivity.current));
|
|
563
|
+
// A scene visited during playback must keep its children and registrations
|
|
564
|
+
// when it leaves the viewport, even if it was outside the discovery budget.
|
|
565
|
+
const useCommitEffect = (_j = react_1.default.useInsertionEffect) !== null && _j !== void 0 ? _j : react_1.useLayoutEffect;
|
|
566
|
+
useCommitEffect(() => {
|
|
567
|
+
hadActivity.current = renderActivity;
|
|
568
|
+
}, [renderActivity]);
|
|
525
569
|
const content = (activityEnabled ? renderActivity : contentVisible)
|
|
526
570
|
? children
|
|
527
571
|
: null;
|
|
@@ -39,6 +39,19 @@ const react_1 = __importStar(require("react"));
|
|
|
39
39
|
const sequence_activity_context_js_1 = require("./sequence-activity-context.js");
|
|
40
40
|
const TimelineContext_js_1 = require("./TimelineContext.js");
|
|
41
41
|
const use_video_config_js_1 = require("./use-video-config.js");
|
|
42
|
+
// Resume through the context update, never through a wakeable callback. React
|
|
43
|
+
// 19.2 can retry an already unmounted Activity with a null Offscreen stateNode.
|
|
44
|
+
// Do not retain retry callbacks either: this token is shared by all activities.
|
|
45
|
+
const suspendedActivity = { then: () => undefined };
|
|
46
|
+
const SuspendSequenceActivity = ({ children, dormant }) => {
|
|
47
|
+
const suspended = (0, react_1.useContext)(sequence_activity_context_js_1.SequenceActivitySuspensionContext);
|
|
48
|
+
if (dormant && suspended) {
|
|
49
|
+
// The hidden Activity retains its last committed children when suspended,
|
|
50
|
+
// including the metadata used by Studio's timeline registry.
|
|
51
|
+
throw suspendedActivity;
|
|
52
|
+
}
|
|
53
|
+
return children;
|
|
54
|
+
};
|
|
42
55
|
const areActivityChildrenEqual = (previous, next) => {
|
|
43
56
|
if (Object.is(previous, next)) {
|
|
44
57
|
return true;
|
|
@@ -83,6 +96,6 @@ const SequenceActivityBoundary = ({ children, dormant, frame }) => {
|
|
|
83
96
|
// Keep the providers and Activity at the same position when activating a
|
|
84
97
|
// scene. Unlike Freeze, discovery does not reset SequenceContext origins or
|
|
85
98
|
// disable Series duration inference.
|
|
86
|
-
return (jsx_runtime_1.jsx(sequence_activity_context_js_1.SequenceActivityDormantContext.Provider, { value: dormant, children: jsx_runtime_1.jsx(sequence_activity_context_js_1.SequenceActivityTimelineContext.Provider, { value: dormant ? dormantTimeline : null, children: jsx_runtime_1.jsx(sequence_activity_context_js_1.SequenceActivityAbsoluteTimeContext.Provider, { value: dormant ? dormantTimeline : null, children: jsx_runtime_1.jsx(TimelineContext_js_1.TimelineContext.Provider, { value: dormant ? dormantTimeline : timeline, children: jsx_runtime_1.jsx(TimelineContext_js_1.AbsoluteTimeContext.Provider, { value: dormant ? dormantTimeline : absoluteTime, children: jsx_runtime_1.jsx(react_1.default.Activity, { mode: dormant && !parentDormant ? 'hidden' : 'visible', children: children }) }) }) }) }) }));
|
|
99
|
+
return (jsx_runtime_1.jsx(sequence_activity_context_js_1.SequenceActivityDormantContext.Provider, { value: dormant, children: jsx_runtime_1.jsx(sequence_activity_context_js_1.SequenceActivityTimelineContext.Provider, { value: dormant ? dormantTimeline : null, children: jsx_runtime_1.jsx(sequence_activity_context_js_1.SequenceActivityAbsoluteTimeContext.Provider, { value: dormant ? dormantTimeline : null, children: jsx_runtime_1.jsx(TimelineContext_js_1.TimelineContext.Provider, { value: dormant ? dormantTimeline : timeline, children: jsx_runtime_1.jsx(TimelineContext_js_1.AbsoluteTimeContext.Provider, { value: dormant ? dormantTimeline : absoluteTime, children: jsx_runtime_1.jsx(react_1.default.Activity, { mode: dormant && !parentDormant ? 'hidden' : 'visible', children: jsx_runtime_1.jsx(SuspendSequenceActivity, { dormant: dormant, children: children }) }) }) }) }) }) }));
|
|
87
100
|
};
|
|
88
101
|
exports.SequenceActivityBoundary = SequenceActivityBoundary;
|
|
@@ -50,8 +50,9 @@ const createActivityBudget = () => {
|
|
|
50
50
|
let frame = {};
|
|
51
51
|
let limit = sequence_activity_context_js_1.DEFAULT_SEQUENCE_ACTIVITY_LIMIT;
|
|
52
52
|
let scheduled = false;
|
|
53
|
+
let suspended = false;
|
|
53
54
|
const schedule = () => {
|
|
54
|
-
if (scheduled) {
|
|
55
|
+
if (scheduled || suspended) {
|
|
55
56
|
return;
|
|
56
57
|
}
|
|
57
58
|
scheduled = true;
|
|
@@ -59,6 +60,9 @@ const createActivityBudget = () => {
|
|
|
59
60
|
// whole commit, once all candidates and the root playhead are current.
|
|
60
61
|
queueMicrotask(() => {
|
|
61
62
|
scheduled = false;
|
|
63
|
+
if (suspended) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
62
66
|
const ranked = [...candidates.values()]
|
|
63
67
|
.filter((candidate) => candidate.end > candidate.from)
|
|
64
68
|
.map((candidate) => {
|
|
@@ -105,6 +109,12 @@ const createActivityBudget = () => {
|
|
|
105
109
|
};
|
|
106
110
|
return {
|
|
107
111
|
...registry,
|
|
112
|
+
setSuspended: (next) => {
|
|
113
|
+
if (suspended !== next) {
|
|
114
|
+
suspended = next;
|
|
115
|
+
schedule();
|
|
116
|
+
}
|
|
117
|
+
},
|
|
108
118
|
setLimit: (next) => {
|
|
109
119
|
if (limit !== next) {
|
|
110
120
|
limit = next;
|
|
@@ -133,10 +143,11 @@ const SequenceActivityBudgetProvider = ({ children }) => {
|
|
|
133
143
|
var _a;
|
|
134
144
|
const enabled = (0, react_1.useContext)(sequence_activity_context_js_1.SequenceActivityContext);
|
|
135
145
|
const settings = (0, react_1.useContext)(sequence_activity_context_js_1.SequenceActivitySettingsContext);
|
|
146
|
+
const suspended = (0, react_1.useContext)(sequence_activity_context_js_1.SequenceActivitySuspensionContext);
|
|
136
147
|
const limit = (_a = settings === null || settings === void 0 ? void 0 : settings.limit) !== null && _a !== void 0 ? _a : sequence_activity_context_js_1.DEFAULT_SEQUENCE_ACTIVITY_LIMIT;
|
|
137
|
-
const admitting = enabled && limit > 0;
|
|
148
|
+
const admitting = enabled && limit > 0 && limit !== Infinity;
|
|
138
149
|
const [budget] = (0, react_1.useState)(createActivityBudget);
|
|
139
|
-
const timeline = (0, react_1.useContext)(admitting ? TimelineContext_js_1.TimelineContext : InactiveTimelineContext);
|
|
150
|
+
const timeline = (0, react_1.useContext)(admitting && !suspended ? TimelineContext_js_1.TimelineContext : InactiveTimelineContext);
|
|
140
151
|
const selected = (0, use_sync_external_store_js_1.useSyncExternalStore)(budget.subscribe, budget.getSnapshot, budget.getSnapshot);
|
|
141
152
|
// Shrinking the setting must not keep the old, larger selection for a commit
|
|
142
153
|
// while the budget schedules its new snapshot.
|
|
@@ -146,26 +157,30 @@ const SequenceActivityBudgetProvider = ({ children }) => {
|
|
|
146
157
|
? new Set([...selected].slice(0, limit))
|
|
147
158
|
: selected, [admitting, limit, selected]);
|
|
148
159
|
useCommitEffect(() => {
|
|
160
|
+
// Retain the admitted trees while moving the playhead. Re-ranking would
|
|
161
|
+
// unmount their suspended content and remove its timeline registrations.
|
|
162
|
+
budget.setSuspended(suspended);
|
|
149
163
|
budget.setLimit(admitting ? limit : 0);
|
|
150
164
|
if (admitting && timeline !== null) {
|
|
151
165
|
budget.setFrame(timeline.frame);
|
|
152
166
|
}
|
|
153
|
-
}, [admitting, budget, limit, timeline]);
|
|
167
|
+
}, [admitting, budget, limit, suspended, timeline]);
|
|
154
168
|
return (jsx_runtime_1.jsx(ActivityBudgetContext.Provider, { value: admitting ? budget : null, children: jsx_runtime_1.jsx(ActivitySelectionContext.Provider, { value: admitted, children: children }) }));
|
|
155
169
|
};
|
|
156
170
|
exports.SequenceActivityBudgetProvider = SequenceActivityBudgetProvider;
|
|
157
171
|
const useSequenceActivityAdmission = (candidate) => {
|
|
158
|
-
var _a, _b, _c, _d, _e;
|
|
172
|
+
var _a, _b, _c, _d, _e, _f;
|
|
159
173
|
const budget = (0, react_1.useContext)(ActivityBudgetContext);
|
|
160
174
|
const enabled = (0, react_1.useContext)(sequence_activity_context_js_1.SequenceActivityContext);
|
|
161
175
|
const settings = (0, react_1.useContext)(sequence_activity_context_js_1.SequenceActivitySettingsContext);
|
|
162
|
-
const unlimited = enabled &&
|
|
176
|
+
const unlimited = enabled &&
|
|
177
|
+
((_a = settings === null || settings === void 0 ? void 0 : settings.limit) !== null && _a !== void 0 ? _a : sequence_activity_context_js_1.DEFAULT_SEQUENCE_ACTIVITY_LIMIT) === Infinity;
|
|
163
178
|
const selected = (0, react_1.useContext)(ActivitySelectionContext);
|
|
164
|
-
const id = (
|
|
165
|
-
const parent = (
|
|
166
|
-
const compositionId = (
|
|
167
|
-
const from = (
|
|
168
|
-
const end = (
|
|
179
|
+
const id = (_b = candidate === null || candidate === void 0 ? void 0 : candidate.id) !== null && _b !== void 0 ? _b : null;
|
|
180
|
+
const parent = (_c = candidate === null || candidate === void 0 ? void 0 : candidate.parent) !== null && _c !== void 0 ? _c : null;
|
|
181
|
+
const compositionId = (_d = candidate === null || candidate === void 0 ? void 0 : candidate.compositionId) !== null && _d !== void 0 ? _d : null;
|
|
182
|
+
const from = (_e = candidate === null || candidate === void 0 ? void 0 : candidate.from) !== null && _e !== void 0 ? _e : null;
|
|
183
|
+
const end = (_f = candidate === null || candidate === void 0 ? void 0 : candidate.end) !== null && _f !== void 0 ? _f : null;
|
|
169
184
|
const committedCandidate = (0, react_1.useMemo)(() => id !== null && compositionId !== null && from !== null && end !== null
|
|
170
185
|
? { id, parent, compositionId, from, end }
|
|
171
186
|
: null, [id, parent, compositionId, from, end]);
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SequenceActivitySuspensionProvider = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const sequence_activity_context_js_1 = require("./sequence-activity-context.js");
|
|
7
|
+
const TimelineContext_js_1 = require("./TimelineContext.js");
|
|
8
|
+
const SequenceActivitySuspensionProvider = ({ children }) => {
|
|
9
|
+
const enabled = (0, react_1.useContext)(sequence_activity_context_js_1.SequenceActivityContext);
|
|
10
|
+
const { isPlaying, subscribePlaying, seek } = (0, react_1.useContext)(TimelineContext_js_1.SetTimelineContext);
|
|
11
|
+
const [suspended, setSuspended] = (0, react_1.useState)(false);
|
|
12
|
+
(0, react_1.useEffect)(() => {
|
|
13
|
+
if (!enabled) {
|
|
14
|
+
setSuspended(false);
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
let timeout = null;
|
|
18
|
+
const update = () => {
|
|
19
|
+
setSuspended(isPlaying() || timeout !== null);
|
|
20
|
+
};
|
|
21
|
+
const unsubscribePlaying = subscribePlaying(update);
|
|
22
|
+
const unsubscribeSeek = seek === null || seek === void 0 ? void 0 : seek.subscribe(() => {
|
|
23
|
+
setSuspended(true);
|
|
24
|
+
if (timeout !== null) {
|
|
25
|
+
clearTimeout(timeout);
|
|
26
|
+
}
|
|
27
|
+
// Repeated pointer, keyboard, and API seeks keep discovery suspended.
|
|
28
|
+
// Resume only once navigation settles, using the latest scene props.
|
|
29
|
+
timeout = setTimeout(() => {
|
|
30
|
+
timeout = null;
|
|
31
|
+
update();
|
|
32
|
+
}, 150);
|
|
33
|
+
});
|
|
34
|
+
update();
|
|
35
|
+
return () => {
|
|
36
|
+
unsubscribePlaying();
|
|
37
|
+
unsubscribeSeek === null || unsubscribeSeek === void 0 ? void 0 : unsubscribeSeek();
|
|
38
|
+
if (timeout !== null) {
|
|
39
|
+
clearTimeout(timeout);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
}, [enabled, isPlaying, seek, subscribePlaying]);
|
|
43
|
+
return (jsx_runtime_1.jsx(sequence_activity_context_js_1.SequenceActivitySuspensionContext.Provider, { value: suspended, children: children }));
|
|
44
|
+
};
|
|
45
|
+
exports.SequenceActivitySuspensionProvider = SequenceActivitySuspensionProvider;
|
|
@@ -67,6 +67,11 @@ export type CanUpdateSequencePropsResponseTrue<Numeric = SourceNumericValue> = {
|
|
|
67
67
|
canUpdate: true;
|
|
68
68
|
props: Record<string, CanUpdateSequencePropStatus<Numeric>>;
|
|
69
69
|
effects: CanUpdateEffectPropsResponse<Numeric>[];
|
|
70
|
+
/** Source ranges also include interpolations outside the editable schema. */
|
|
71
|
+
durationDependentKeyframes: {
|
|
72
|
+
readonly scope: SequenceNodePath;
|
|
73
|
+
readonly inputRanges: readonly (readonly SourceNumericValue[] | null)[];
|
|
74
|
+
} | null;
|
|
70
75
|
};
|
|
71
76
|
export type CanUpdateSequencePropsResponseFalse = {
|
|
72
77
|
canUpdate: false;
|
|
@@ -35,6 +35,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
36
36
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
37
37
|
};
|
|
38
|
+
var _a;
|
|
38
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
40
|
exports.SequenceManagerProvider = exports.VisualModeBatchSettersContext = exports.VisualModeSettersContext = exports.useEffectDragOverridesForNodePath = exports.useActiveFromDragOverrideKeys = exports.useDragOverridesForNodePath = exports.VisualModeDragOverridesRefContext = exports.VisualModeDragOverridesContext = exports.VisualModePropStatusesRefContext = exports.VisualModePropStatusesContext = exports.makeSequencePropsSubscriptionKey = exports.VisualModeDragOverridesSubscriptionContext = void 0;
|
|
40
41
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
@@ -43,23 +44,26 @@ __exportStar(require("./sequence-registry-context.js"), exports);
|
|
|
43
44
|
const sequence_activity_context_js_1 = require("./sequence-activity-context.js");
|
|
44
45
|
const sequence_registry_context_js_1 = require("./sequence-registry-context.js");
|
|
45
46
|
const SequenceActivityBudget_js_1 = require("./SequenceActivityBudget.js");
|
|
47
|
+
const SequenceActivitySuspensionProvider_js_1 = require("./SequenceActivitySuspensionProvider.js");
|
|
46
48
|
const SequenceRegistryProvider_js_1 = require("./SequenceRegistryProvider.js");
|
|
47
49
|
const use_remotion_environment_js_1 = require("./use-remotion-environment.js");
|
|
48
50
|
const use_sync_external_store_js_1 = require("./use-sync-external-store.js");
|
|
49
51
|
const useIsomorphicLayoutEffect = typeof window === 'undefined' ? react_1.default.useEffect : react_1.default.useLayoutEffect;
|
|
52
|
+
const useCommitEffect = (_a = react_1.default.useInsertionEffect) !== null && _a !== void 0 ? _a : useIsomorphicLayoutEffect;
|
|
50
53
|
exports.VisualModeDragOverridesSubscriptionContext = react_1.default.createContext(null);
|
|
51
54
|
const ActiveFromDragOverrideKeysContext = react_1.default.createContext(null);
|
|
52
55
|
const SequenceManagerScopeProviders = ({ children, dragOverridesSubscription, fromKeys }) => {
|
|
56
|
+
var _a;
|
|
53
57
|
const { isStudio } = (0, use_remotion_environment_js_1.useRemotionEnvironment)();
|
|
54
58
|
const activitySettings = (0, react_1.useContext)(sequence_activity_context_js_1.SequenceActivitySettingsContext);
|
|
55
59
|
const commitRegistrationEnabled = (0, react_1.useContext)(sequence_registry_context_js_1.SequenceCommitRegistrationContext);
|
|
56
60
|
const manager = (0, react_1.useContext)(sequence_registry_context_js_1.SequenceManagerActionsContext);
|
|
57
61
|
const scopedDragOverridesSubscription = (0, react_1.useMemo)(() => ({ ...dragOverridesSubscription, manager }), [dragOverridesSubscription, manager]);
|
|
58
62
|
const activeFromDragOverrideKeys = (0, react_1.useMemo)(() => ({ manager, keys: fromKeys }), [fromKeys, manager]);
|
|
59
|
-
return (jsx_runtime_1.jsx(ActiveFromDragOverrideKeysContext.Provider, { value: activeFromDragOverrideKeys, children: jsx_runtime_1.jsx(exports.VisualModeDragOverridesSubscriptionContext.Provider, { value: scopedDragOverridesSubscription, children: jsx_runtime_1.jsx(sequence_activity_context_js_1.SequenceActivityContext.Provider, { value: (activitySettings === null || activitySettings === void 0 ? void 0 : activitySettings.
|
|
63
|
+
return (jsx_runtime_1.jsx(ActiveFromDragOverrideKeysContext.Provider, { value: activeFromDragOverrideKeys, children: jsx_runtime_1.jsx(exports.VisualModeDragOverridesSubscriptionContext.Provider, { value: scopedDragOverridesSubscription, children: jsx_runtime_1.jsx(sequence_activity_context_js_1.SequenceActivityContext.Provider, { value: ((_a = activitySettings === null || activitySettings === void 0 ? void 0 : activitySettings.limit) !== null && _a !== void 0 ? _a : sequence_activity_context_js_1.DEFAULT_SEQUENCE_ACTIVITY_LIMIT) > 0 &&
|
|
60
64
|
isStudio &&
|
|
61
65
|
commitRegistrationEnabled &&
|
|
62
|
-
typeof react_1.default.Activity !== 'undefined', children: jsx_runtime_1.jsx(SequenceActivityBudget_js_1.SequenceActivityBudgetProvider, { children: children }) }) }) }));
|
|
66
|
+
typeof react_1.default.Activity !== 'undefined', children: jsx_runtime_1.jsx(SequenceActivitySuspensionProvider_js_1.SequenceActivitySuspensionProvider, { children: jsx_runtime_1.jsx(SequenceActivityBudget_js_1.SequenceActivityBudgetProvider, { children: children }) }) }) }) }));
|
|
63
67
|
};
|
|
64
68
|
const emptyDragOverrides = {};
|
|
65
69
|
const emptyFromOverrideKeys = new Set();
|
|
@@ -84,6 +88,20 @@ const defaultVisualModeDragOverrides = {
|
|
|
84
88
|
};
|
|
85
89
|
exports.VisualModeDragOverridesContext = react_1.default.createContext(defaultVisualModeDragOverrides);
|
|
86
90
|
exports.VisualModeDragOverridesRefContext = react_1.default.createContext({ current: defaultVisualModeDragOverrides });
|
|
91
|
+
const useDragOverrideSnapshot = (subscribe, getSnapshot) => {
|
|
92
|
+
const dormant = (0, react_1.useContext)(sequence_activity_context_js_1.SequenceActivityDormantContext);
|
|
93
|
+
const [, forceUpdate] = (0, react_1.useState)(0);
|
|
94
|
+
const snapshot = (0, use_sync_external_store_js_1.useSyncExternalStore)(subscribe, getSnapshot, getSnapshot);
|
|
95
|
+
useCommitEffect(() => {
|
|
96
|
+
if (!dormant) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
// Activity disconnects passive subscriptions, including useSyncExternalStore.
|
|
100
|
+
// Insertion effects stay connected through nested hidden Activities.
|
|
101
|
+
return subscribe(() => forceUpdate((current) => current + 1));
|
|
102
|
+
}, [dormant, subscribe]);
|
|
103
|
+
return snapshot;
|
|
104
|
+
};
|
|
87
105
|
const useDragOverridesForNodePath = (nodePath) => {
|
|
88
106
|
const subscription = (0, react_1.useContext)(exports.VisualModeDragOverridesSubscriptionContext);
|
|
89
107
|
const manager = (0, react_1.useContext)(sequence_registry_context_js_1.SequenceManagerActionsContext);
|
|
@@ -97,7 +115,7 @@ const useDragOverridesForNodePath = (nodePath) => {
|
|
|
97
115
|
var _a;
|
|
98
116
|
return (_a = scopedSubscription === null || scopedSubscription === void 0 ? void 0 : scopedSubscription.getSnapshot(key)) !== null && _a !== void 0 ? _a : emptyDragOverrides;
|
|
99
117
|
}, [key, scopedSubscription]);
|
|
100
|
-
return (
|
|
118
|
+
return useDragOverrideSnapshot(subscribe, getSnapshot);
|
|
101
119
|
};
|
|
102
120
|
exports.useDragOverridesForNodePath = useDragOverridesForNodePath;
|
|
103
121
|
const useActiveFromDragOverrideKeys = () => {
|
|
@@ -119,7 +137,7 @@ const useEffectDragOverridesForNodePath = (nodePath) => {
|
|
|
119
137
|
var _a;
|
|
120
138
|
return (_a = scopedSubscription === null || scopedSubscription === void 0 ? void 0 : scopedSubscription.getEffectSnapshot(key)) !== null && _a !== void 0 ? _a : emptyEffectDragOverrides;
|
|
121
139
|
}, [key, scopedSubscription]);
|
|
122
|
-
return (
|
|
140
|
+
return useDragOverrideSnapshot(subscribe, getSnapshot);
|
|
123
141
|
};
|
|
124
142
|
exports.useEffectDragOverridesForNodePath = useEffectDragOverridesForNodePath;
|
|
125
143
|
exports.VisualModeSettersContext = react_1.default.createContext({
|
package/dist/cjs/Track.js
CHANGED
|
@@ -17,8 +17,7 @@ const trackSchema = {
|
|
|
17
17
|
};
|
|
18
18
|
const TrackWithoutSchema = ({ name = 'Track', children, layout = 'none', ...props }) => {
|
|
19
19
|
const [id] = (0, react_1.useState)(() => String(Math.random()));
|
|
20
|
-
const
|
|
21
|
-
const value = (0, react_1.useMemo)(() => (tracksEnabled ? { id, name } : null), [id, name, tracksEnabled]);
|
|
20
|
+
const value = (0, react_1.useMemo)(() => ({ id, name }), [id, name]);
|
|
22
21
|
return (jsx_runtime_1.jsx(timeline_track_context_js_1.TimelineTrackContext.Provider, { value: value, children: jsx_runtime_1.jsx(Sequence_js_1.SequenceWithoutSchema, { _remotionInternalDocumentationLink: "https://www.remotion.dev/docs/track", ...props, name: name, layout: layout, _remotionInternalTimelineTrack: { role: 'track', seriesOffset: null }, children: children }) }));
|
|
23
22
|
};
|
|
24
23
|
exports.TrackWithoutSchema = TrackWithoutSchema;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import type { SequenceControls } from '../CompositionManager.js';
|
|
3
|
-
import type { EffectsProp } from '../effects/effect-types.js';
|
|
3
|
+
import type { EffectsProp, EffectsOutputSize } from '../effects/effect-types.js';
|
|
4
4
|
export declare const animatedImageSchema: {
|
|
5
5
|
readonly 'style.transformOrigin': {
|
|
6
6
|
readonly type: "transform-origin";
|
|
@@ -115,7 +115,7 @@ export declare const animatedImageSchema: {
|
|
|
115
115
|
};
|
|
116
116
|
readonly premountFor: {
|
|
117
117
|
readonly type: "number";
|
|
118
|
-
readonly default:
|
|
118
|
+
readonly default: undefined;
|
|
119
119
|
readonly description: "Premount For";
|
|
120
120
|
readonly min: 0;
|
|
121
121
|
readonly step: 1;
|
|
@@ -236,6 +236,7 @@ export declare const AnimatedImage: React.ComponentType<import("../Interactive.j
|
|
|
236
236
|
requestInit?: RequestInit | undefined;
|
|
237
237
|
} & React.AriaAttributes & Record<`data-${string}`, string | undefined> & {
|
|
238
238
|
readonly effects?: EffectsProp | undefined;
|
|
239
|
+
readonly effectsOutputSize?: EffectsOutputSize | undefined;
|
|
239
240
|
} & {
|
|
240
241
|
readonly controls?: SequenceControls | undefined;
|
|
241
242
|
readonly ref?: React.Ref<HTMLCanvasElement> | undefined;
|