remotion 4.0.493 → 4.0.495

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.
@@ -12,7 +12,6 @@ const interactivity_schema_js_1 = require("./interactivity-schema.js");
12
12
  const Sequence_js_1 = require("./Sequence.js");
13
13
  const use_delay_render_js_1 = require("./use-delay-render.js");
14
14
  const use_remotion_environment_js_1 = require("./use-remotion-environment.js");
15
- const use_video_config_js_1 = require("./use-video-config.js");
16
15
  const with_interactivity_schema_js_1 = require("./with-interactivity-schema.js");
17
16
  // Memoize the support check across the session — neither the platform
18
17
  // capability nor the chrome://flags toggle can change between calls.
@@ -357,8 +356,6 @@ const HtmlInCanvasContent = (0, react_1.forwardRef)(({ width, height, effects, c
357
356
  });
358
357
  HtmlInCanvasContent.displayName = 'HtmlInCanvasContent';
359
358
  const HtmlInCanvasInner = (0, react_1.forwardRef)(({ width, height, effects = [], children, onPaint, onInit, pixelDensity, controls, style, durationInFrames, name, ...sequenceProps }, ref) => {
360
- const { durationInFrames: videoDuration } = (0, use_video_config_js_1.useVideoConfig)();
361
- const resolvedDuration = durationInFrames !== null && durationInFrames !== void 0 ? durationInFrames : videoDuration;
362
359
  const memoizedEffectDefinitions = (0, use_memoized_effects_js_1.useMemoizedEffectDefinitions)(effects);
363
360
  const actualRef = (0, react_1.useRef)(null);
364
361
  const setCanvasRef = (0, react_1.useCallback)((node) => {
@@ -370,7 +367,7 @@ const HtmlInCanvasInner = (0, react_1.forwardRef)(({ width, height, effects = []
370
367
  ref.current = node;
371
368
  }
372
369
  }, [ref]);
373
- return (jsx_runtime_1.jsx(Sequence_js_1.Sequence, { durationInFrames: resolvedDuration, name: name !== null && name !== void 0 ? name : '<HtmlInCanvas>', _remotionInternalDocumentationLink: "https://www.remotion.dev/docs/remotion/html-in-canvas", controls: controls, _remotionInternalEffects: memoizedEffectDefinitions, outlineRef: actualRef, layout: "none", ...sequenceProps, children: jsx_runtime_1.jsx(HtmlInCanvasContent, { ref: setCanvasRef, width: width, height: height, effects: effects, onPaint: onPaint, onInit: onInit, pixelDensity: pixelDensity, controls: controls, style: style, children: children }) }));
370
+ return (jsx_runtime_1.jsx(Sequence_js_1.Sequence, { durationInFrames: durationInFrames, name: name !== null && name !== void 0 ? name : '<HtmlInCanvas>', _remotionInternalDocumentationLink: "https://www.remotion.dev/docs/remotion/html-in-canvas", controls: controls, _remotionInternalEffects: memoizedEffectDefinitions, outlineRef: actualRef, layout: "none", ...sequenceProps, children: jsx_runtime_1.jsx(HtmlInCanvasContent, { ref: setCanvasRef, width: width, height: height, effects: effects, onPaint: onPaint, onInit: onInit, pixelDensity: pixelDensity, controls: controls, style: style, children: children }) }));
374
371
  });
375
372
  HtmlInCanvasInner.displayName = 'HtmlInCanvas';
376
373
  exports.htmlInCanvasSchema = {
package/dist/cjs/Img.js CHANGED
@@ -187,7 +187,9 @@ const ImgContent = ({ onError, maxRetries = 2, src, pauseWhenLoading, delayRende
187
187
  requestsVideoFrame: false,
188
188
  isClientSideRendering,
189
189
  });
190
- // src gets set once we've loaded and decoded the image.
190
+ // `src` is assigned imperatively to this element in the layout effect above.
191
+ // The element may paint while `decode()` is pending; `delayRender()` only
192
+ // blocks frame rendering.
191
193
  return (jsx_runtime_1.jsx("img", { ...props, ref: imageCallbackRef, crossOrigin: crossOriginValue, onError: didGetError, decoding: isRendering ? 'sync' : decoding }));
192
194
  };
193
195
  const NativeImgInner = ({ hidden, name, stack, showInTimeline, src, from, trimBefore, durationInFrames, freeze, controls, outlineRef: refForOutline, ...props }) => {
@@ -175,6 +175,7 @@ export declare const Interactive: {
175
175
  readonly min: 0;
176
176
  readonly step: 1;
177
177
  readonly hiddenFromList: false;
178
+ readonly keyframable: false;
178
179
  };
179
180
  readonly postmountFor: {
180
181
  readonly type: "number";
@@ -182,12 +183,7 @@ export declare const Interactive: {
182
183
  readonly min: 0;
183
184
  readonly step: 1;
184
185
  readonly hiddenFromList: true;
185
- };
186
- readonly styleWhilePremounted: {
187
- readonly type: "hidden";
188
- };
189
- readonly styleWhilePostmounted: {
190
- readonly type: "hidden";
186
+ readonly keyframable: false;
191
187
  };
192
188
  };
193
189
  sequenceSchema: {
@@ -268,6 +264,7 @@ export declare const Interactive: {
268
264
  readonly min: 0;
269
265
  readonly step: 1;
270
266
  readonly hiddenFromList: false;
267
+ readonly keyframable: false;
271
268
  };
272
269
  readonly postmountFor: {
273
270
  readonly type: "number";
@@ -275,6 +272,7 @@ export declare const Interactive: {
275
272
  readonly min: 0;
276
273
  readonly step: 1;
277
274
  readonly hiddenFromList: true;
275
+ readonly keyframable: false;
278
276
  };
279
277
  readonly styleWhilePremounted: {
280
278
  readonly type: "hidden";
@@ -58,6 +58,9 @@ const makeRemotionComponentIdentity = ({ packageName, componentName, }) => {
58
58
  const interactiveElementSchema = {
59
59
  ...interactivity_schema_js_1.baseSchema,
60
60
  ...interactivity_schema_js_1.transformSchema,
61
+ };
62
+ const interactiveTextElementSchema = {
63
+ ...interactiveElementSchema,
61
64
  ...interactivity_schema_js_1.textSchema,
62
65
  ...interactivity_schema_js_1.textContentSchema,
63
66
  };
@@ -74,7 +77,7 @@ const withSchema = (options) => {
74
77
  (0, enable_sequence_stack_traces_js_1.addSequenceStackTraces)(Wrapped);
75
78
  return Wrapped;
76
79
  };
77
- const makeInteractiveElement = (tag, displayName) => {
80
+ const makeInteractiveElement = (tag, displayName, schema) => {
78
81
  const Inner = (0, react_1.forwardRef)((propsWithControls, ref) => {
79
82
  const { durationInFrames, from, trimBefore, freeze, hidden, name, showInTimeline, stack, controls, ...props } = propsWithControls;
80
83
  const refForOutline = (0, react_1.useRef)(null);
@@ -95,12 +98,18 @@ const makeInteractiveElement = (tag, displayName) => {
95
98
  packageName: 'remotion',
96
99
  componentName: displayName.slice(1, -1),
97
100
  }),
98
- schema: interactiveElementSchema,
101
+ schema,
99
102
  supportsEffects: false,
100
103
  });
101
104
  Wrapped.displayName = displayName;
102
105
  return Wrapped;
103
106
  };
107
+ const makeInteractiveTextElement = (tag, displayName) => {
108
+ return makeInteractiveElement(tag, displayName, interactiveTextElementSchema);
109
+ };
110
+ const makeInteractiveNonTextElement = (tag, displayName) => {
111
+ return makeInteractiveElement(tag, displayName, interactiveElementSchema);
112
+ };
104
113
  /**
105
114
  * @description HTML and SVG elements that are registered in the Remotion Studio timeline and can be visually edited.
106
115
  */
@@ -112,39 +121,39 @@ exports.Interactive = {
112
121
  sequenceSchema: interactivity_schema_js_1.sequenceSchema,
113
122
  withSchema,
114
123
  _internalMakeRemotionComponentIdentity: makeRemotionComponentIdentity,
115
- A: makeInteractiveElement('a', '<Interactive.A>'),
116
- Article: makeInteractiveElement('article', '<Interactive.Article>'),
117
- Aside: makeInteractiveElement('aside', '<Interactive.Aside>'),
118
- Button: makeInteractiveElement('button', '<Interactive.Button>'),
119
- Circle: makeInteractiveElement('circle', '<Interactive.Circle>'),
120
- Code: makeInteractiveElement('code', '<Interactive.Code>'),
121
- Div: makeInteractiveElement('div', '<Interactive.Div>'),
122
- Ellipse: makeInteractiveElement('ellipse', '<Interactive.Ellipse>'),
123
- Em: makeInteractiveElement('em', '<Interactive.Em>'),
124
- Footer: makeInteractiveElement('footer', '<Interactive.Footer>'),
125
- G: makeInteractiveElement('g', '<Interactive.G>'),
126
- H1: makeInteractiveElement('h1', '<Interactive.H1>'),
127
- H2: makeInteractiveElement('h2', '<Interactive.H2>'),
128
- H3: makeInteractiveElement('h3', '<Interactive.H3>'),
129
- H4: makeInteractiveElement('h4', '<Interactive.H4>'),
130
- H5: makeInteractiveElement('h5', '<Interactive.H5>'),
131
- H6: makeInteractiveElement('h6', '<Interactive.H6>'),
132
- Header: makeInteractiveElement('header', '<Interactive.Header>'),
133
- Label: makeInteractiveElement('label', '<Interactive.Label>'),
134
- Li: makeInteractiveElement('li', '<Interactive.Li>'),
135
- Line: makeInteractiveElement('line', '<Interactive.Line>'),
136
- Main: makeInteractiveElement('main', '<Interactive.Main>'),
137
- Nav: makeInteractiveElement('nav', '<Interactive.Nav>'),
138
- Ol: makeInteractiveElement('ol', '<Interactive.Ol>'),
139
- P: makeInteractiveElement('p', '<Interactive.P>'),
140
- Path: makeInteractiveElement('path', '<Interactive.Path>'),
141
- Pre: makeInteractiveElement('pre', '<Interactive.Pre>'),
142
- Rect: makeInteractiveElement('rect', '<Interactive.Rect>'),
143
- Section: makeInteractiveElement('section', '<Interactive.Section>'),
144
- Small: makeInteractiveElement('small', '<Interactive.Small>'),
145
- Span: makeInteractiveElement('span', '<Interactive.Span>'),
146
- Strong: makeInteractiveElement('strong', '<Interactive.Strong>'),
147
- Svg: makeInteractiveElement('svg', '<Interactive.Svg>'),
148
- Text: makeInteractiveElement('text', '<Interactive.Text>'),
149
- Ul: makeInteractiveElement('ul', '<Interactive.Ul>'),
124
+ A: makeInteractiveTextElement('a', '<Interactive.A>'),
125
+ Article: makeInteractiveTextElement('article', '<Interactive.Article>'),
126
+ Aside: makeInteractiveTextElement('aside', '<Interactive.Aside>'),
127
+ Button: makeInteractiveTextElement('button', '<Interactive.Button>'),
128
+ Circle: makeInteractiveNonTextElement('circle', '<Interactive.Circle>'),
129
+ Code: makeInteractiveTextElement('code', '<Interactive.Code>'),
130
+ Div: makeInteractiveTextElement('div', '<Interactive.Div>'),
131
+ Ellipse: makeInteractiveNonTextElement('ellipse', '<Interactive.Ellipse>'),
132
+ Em: makeInteractiveTextElement('em', '<Interactive.Em>'),
133
+ Footer: makeInteractiveTextElement('footer', '<Interactive.Footer>'),
134
+ G: makeInteractiveNonTextElement('g', '<Interactive.G>'),
135
+ H1: makeInteractiveTextElement('h1', '<Interactive.H1>'),
136
+ H2: makeInteractiveTextElement('h2', '<Interactive.H2>'),
137
+ H3: makeInteractiveTextElement('h3', '<Interactive.H3>'),
138
+ H4: makeInteractiveTextElement('h4', '<Interactive.H4>'),
139
+ H5: makeInteractiveTextElement('h5', '<Interactive.H5>'),
140
+ H6: makeInteractiveTextElement('h6', '<Interactive.H6>'),
141
+ Header: makeInteractiveTextElement('header', '<Interactive.Header>'),
142
+ Label: makeInteractiveTextElement('label', '<Interactive.Label>'),
143
+ Li: makeInteractiveTextElement('li', '<Interactive.Li>'),
144
+ Line: makeInteractiveNonTextElement('line', '<Interactive.Line>'),
145
+ Main: makeInteractiveTextElement('main', '<Interactive.Main>'),
146
+ Nav: makeInteractiveTextElement('nav', '<Interactive.Nav>'),
147
+ Ol: makeInteractiveTextElement('ol', '<Interactive.Ol>'),
148
+ P: makeInteractiveTextElement('p', '<Interactive.P>'),
149
+ Path: makeInteractiveNonTextElement('path', '<Interactive.Path>'),
150
+ Pre: makeInteractiveTextElement('pre', '<Interactive.Pre>'),
151
+ Rect: makeInteractiveNonTextElement('rect', '<Interactive.Rect>'),
152
+ Section: makeInteractiveTextElement('section', '<Interactive.Section>'),
153
+ Small: makeInteractiveTextElement('small', '<Interactive.Small>'),
154
+ Span: makeInteractiveTextElement('span', '<Interactive.Span>'),
155
+ Strong: makeInteractiveTextElement('strong', '<Interactive.Strong>'),
156
+ Svg: makeInteractiveNonTextElement('svg', '<Interactive.Svg>'),
157
+ Text: makeInteractiveTextElement('text', '<Interactive.Text>'),
158
+ Ul: makeInteractiveTextElement('ul', '<Interactive.Ul>'),
150
159
  };
@@ -8,12 +8,11 @@ const AbsoluteFill_js_1 = require("./AbsoluteFill.js");
8
8
  const freeze_js_1 = require("./freeze.js");
9
9
  const interactivity_schema_js_1 = require("./interactivity-schema.js");
10
10
  const nonce_js_1 = require("./nonce.js");
11
- const PremountContext_js_1 = require("./PremountContext.js");
12
11
  const SequenceContext_js_1 = require("./SequenceContext.js");
13
12
  const SequenceManager_js_1 = require("./SequenceManager.js");
14
13
  const is_inside_series_js_1 = require("./series/is-inside-series.js");
15
14
  const timeline_position_state_js_1 = require("./timeline-position-state.js");
16
- const use_current_frame_1 = require("./use-current-frame");
15
+ const use_premounting_js_1 = require("./use-premounting.js");
17
16
  const use_remotion_environment_js_1 = require("./use-remotion-environment.js");
18
17
  const use_video_config_js_1 = require("./use-video-config.js");
19
18
  const v5_flag_js_1 = require("./v5-flag.js");
@@ -343,41 +342,21 @@ const RegularSequenceRefForwardingFunction = ({ from = 0, trimBefore = 0, freeze
343
342
  };
344
343
  const RegularSequence = (0, react_1.forwardRef)(RegularSequenceRefForwardingFunction);
345
344
  const PremountedPostmountedSequenceRefForwardingFunction = (props, ref) => {
346
- const parentPremountContext = (0, react_1.useContext)(PremountContext_js_1.PremountContext);
347
- const frame = (0, use_current_frame_1.useCurrentFrame)() - parentPremountContext.premountFramesRemaining;
348
345
  if (props.layout === 'none') {
349
346
  throw new Error('`<Sequence>` with `premountFor` and `postmountFor` props does not support layout="none"');
350
347
  }
351
348
  const { style: passedStyle, from = 0, durationInFrames = Infinity, premountFor = 0, postmountFor = 0, styleWhilePremounted, styleWhilePostmounted, ...otherProps } = props;
352
- const endThreshold = Math.ceil(from + durationInFrames - 1);
353
- const premountingActive = frame < from && frame >= from - premountFor;
354
- const postmountingActive = frame > endThreshold && frame <= endThreshold + postmountFor;
355
- // Determine which freeze frame to use
356
- const freezeFrame = premountingActive
357
- ? from
358
- : postmountingActive
359
- ? from + durationInFrames - 1
360
- : 0;
361
- const isFreezingActive = premountingActive || postmountingActive;
362
- const style = (0, react_1.useMemo)(() => {
363
- var _a;
364
- return {
365
- ...passedStyle,
366
- opacity: premountingActive || postmountingActive ? 0 : 1,
367
- pointerEvents: premountingActive || postmountingActive
368
- ? 'none'
369
- : ((_a = passedStyle === null || passedStyle === void 0 ? void 0 : passedStyle.pointerEvents) !== null && _a !== void 0 ? _a : undefined),
370
- ...(premountingActive ? styleWhilePremounted : {}),
371
- ...(postmountingActive ? styleWhilePostmounted : {}),
372
- };
373
- }, [
374
- passedStyle,
375
- premountingActive,
376
- postmountingActive,
377
- styleWhilePremounted,
378
- styleWhilePostmounted,
379
- ]);
380
- return (jsx_runtime_1.jsx(freeze_js_1.Freeze, { frame: freezeFrame, active: isFreezingActive, children: jsx_runtime_1.jsx(SequenceInner, { ref: ref, from: from, durationInFrames: durationInFrames, style: style, _remotionInternalPremountDisplay: premountFor, _remotionInternalPostmountDisplay: postmountFor, _remotionInternalIsPremounting: premountingActive, _remotionInternalIsPostmounting: postmountingActive, ...otherProps }) }));
349
+ const { freezeFrame, isPremountingOrPostmounting, postmountingActive, premountingActive, premountingStyle, } = (0, use_premounting_js_1.usePremounting)({
350
+ from,
351
+ durationInFrames,
352
+ premountFor,
353
+ postmountFor,
354
+ style: passedStyle !== null && passedStyle !== void 0 ? passedStyle : null,
355
+ styleWhilePremounted: styleWhilePremounted !== null && styleWhilePremounted !== void 0 ? styleWhilePremounted : null,
356
+ styleWhilePostmounted: styleWhilePostmounted !== null && styleWhilePostmounted !== void 0 ? styleWhilePostmounted : null,
357
+ hideWhilePremounted: 'opacity',
358
+ });
359
+ return (jsx_runtime_1.jsx(freeze_js_1.Freeze, { frame: freezeFrame, active: isPremountingOrPostmounting, children: jsx_runtime_1.jsx(SequenceInner, { ref: ref, from: from, durationInFrames: durationInFrames, style: premountingStyle !== null && premountingStyle !== void 0 ? premountingStyle : undefined, _remotionInternalPremountDisplay: premountFor, _remotionInternalPostmountDisplay: postmountFor, _remotionInternalIsPremounting: premountingActive, _remotionInternalIsPostmounting: postmountingActive, ...otherProps }) }));
381
360
  };
382
361
  const PremountedPostmountedSequence = (0, react_1.forwardRef)(PremountedPostmountedSequenceRefForwardingFunction);
383
362
  const SequenceRefForwardingFunction = (props, ref) => {
@@ -14,6 +14,7 @@ const use_video_config_js_1 = require("../use-video-config.js");
14
14
  const with_interactivity_schema_js_1 = require("../with-interactivity-schema.js");
15
15
  const canvas_1 = require("./canvas");
16
16
  const decode_image_js_1 = require("./decode-image.js");
17
+ const get_current_time_js_1 = require("./get-current-time.js");
17
18
  const request_init_1 = require("./request-init");
18
19
  const resolve_image_source_1 = require("./resolve-image-source");
19
20
  const animatedImageSchema = {
@@ -55,7 +56,7 @@ const AnimatedImageContent = (0, react_1.forwardRef)(({ src, width, height, onEr
55
56
  const [decodeHandle] = (0, react_1.useState)(() => delayRender(`Rendering <AnimatedImage/> with src="${resolvedSrc}"`));
56
57
  const frame = (0, use_current_frame_js_1.useCurrentFrame)();
57
58
  const { fps } = (0, use_video_config_js_1.useVideoConfig)();
58
- const currentTime = frame / playbackRate / fps;
59
+ const currentTime = (0, get_current_time_js_1.getCurrentTime)({ frame, playbackRate, fps });
59
60
  const currentTimeRef = (0, react_1.useRef)(currentTime);
60
61
  currentTimeRef.current = currentTime;
61
62
  const requestInitKey = (0, request_init_1.serializeRequestInit)(requestInit);
@@ -168,8 +169,6 @@ const AnimatedImageContent = (0, react_1.forwardRef)(({ src, width, height, onEr
168
169
  });
169
170
  AnimatedImageContent.displayName = 'AnimatedImageContent';
170
171
  const AnimatedImageInner = ({ src, width, height, onError, fit, playbackRate, loopBehavior, id, className, style, durationInFrames, requestInit, effects = [], controls, ref, ...sequenceProps }) => {
171
- const { durationInFrames: videoDuration } = (0, use_video_config_js_1.useVideoConfig)();
172
- const resolvedDuration = durationInFrames !== null && durationInFrames !== void 0 ? durationInFrames : videoDuration;
173
172
  const actualRef = (0, react_1.useRef)(null);
174
173
  const memoizedEffectDefinitions = (0, use_memoized_effects_js_1.useMemoizedEffectDefinitions)(effects);
175
174
  (0, react_1.useImperativeHandle)(ref, () => {
@@ -190,7 +189,7 @@ const AnimatedImageInner = ({ src, width, height, onError, fit, playbackRate, lo
190
189
  requestInit,
191
190
  ...canvasProps,
192
191
  };
193
- return (jsx_runtime_1.jsx(Sequence_js_1.Sequence, { layout: "none", durationInFrames: resolvedDuration, name: "<AnimatedImage>", _remotionInternalDocumentationLink: "https://www.remotion.dev/docs/animatedimage", controls: controls, _remotionInternalEffects: memoizedEffectDefinitions, ...sequenceProps, outlineRef: actualRef, children: jsx_runtime_1.jsx(AnimatedImageContent, { ...animatedImageProps, ref: actualRef, effects: effects, controls: controls }) }));
192
+ return (jsx_runtime_1.jsx(Sequence_js_1.Sequence, { layout: "none", durationInFrames: durationInFrames, name: "<AnimatedImage>", _remotionInternalDocumentationLink: "https://www.remotion.dev/docs/animatedimage", controls: controls, _remotionInternalEffects: memoizedEffectDefinitions, ...sequenceProps, outlineRef: actualRef, children: jsx_runtime_1.jsx(AnimatedImageContent, { ...animatedImageProps, ref: actualRef, effects: effects, controls: controls }) }));
194
193
  };
195
194
  exports.AnimatedImage = (0, with_interactivity_schema_js_1.withInteractivitySchema)({
196
195
  Component: AnimatedImageInner,
@@ -0,0 +1,5 @@
1
+ export declare const getCurrentTime: ({ frame, playbackRate, fps, }: {
2
+ frame: number;
3
+ playbackRate: number;
4
+ fps: number;
5
+ }) => number;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getCurrentTime = void 0;
4
+ const getCurrentTime = ({ frame, playbackRate, fps, }) => {
5
+ return (frame * playbackRate) / fps;
6
+ };
7
+ exports.getCurrentTime = getCurrentTime;
@@ -305,6 +305,7 @@ export declare const premountSchema: {
305
305
  readonly min: 0;
306
306
  readonly step: 1;
307
307
  readonly hiddenFromList: false;
308
+ readonly keyframable: false;
308
309
  };
309
310
  readonly postmountFor: {
310
311
  readonly type: "number";
@@ -312,7 +313,10 @@ export declare const premountSchema: {
312
313
  readonly min: 0;
313
314
  readonly step: 1;
314
315
  readonly hiddenFromList: true;
316
+ readonly keyframable: false;
315
317
  };
318
+ };
319
+ export declare const premountStyleSchema: {
316
320
  readonly styleWhilePremounted: {
317
321
  readonly type: "hidden";
318
322
  };
@@ -328,6 +332,7 @@ export declare const sequencePremountSchema: {
328
332
  readonly min: 0;
329
333
  readonly step: 1;
330
334
  readonly hiddenFromList: false;
335
+ readonly keyframable: false;
331
336
  };
332
337
  readonly postmountFor: {
333
338
  readonly type: "number";
@@ -335,6 +340,7 @@ export declare const sequencePremountSchema: {
335
340
  readonly min: 0;
336
341
  readonly step: 1;
337
342
  readonly hiddenFromList: true;
343
+ readonly keyframable: false;
338
344
  };
339
345
  readonly styleWhilePremounted: {
340
346
  readonly type: "hidden";
@@ -386,6 +392,7 @@ export declare const sequenceStyleSchema: {
386
392
  readonly min: 0;
387
393
  readonly step: 1;
388
394
  readonly hiddenFromList: false;
395
+ readonly keyframable: false;
389
396
  };
390
397
  readonly postmountFor: {
391
398
  readonly type: "number";
@@ -393,6 +400,7 @@ export declare const sequenceStyleSchema: {
393
400
  readonly min: 0;
394
401
  readonly step: 1;
395
402
  readonly hiddenFromList: true;
403
+ readonly keyframable: false;
396
404
  };
397
405
  readonly styleWhilePremounted: {
398
406
  readonly type: "hidden";
@@ -541,6 +549,7 @@ export declare const sequenceSchema: {
541
549
  readonly min: 0;
542
550
  readonly step: 1;
543
551
  readonly hiddenFromList: false;
552
+ readonly keyframable: false;
544
553
  };
545
554
  readonly postmountFor: {
546
555
  readonly type: "number";
@@ -548,6 +557,7 @@ export declare const sequenceSchema: {
548
557
  readonly min: 0;
549
558
  readonly step: 1;
550
559
  readonly hiddenFromList: true;
560
+ readonly keyframable: false;
551
561
  };
552
562
  readonly styleWhilePremounted: {
553
563
  readonly type: "hidden";
@@ -657,6 +667,7 @@ export declare const sequenceSchemaWithoutFrom: {
657
667
  readonly min: 0;
658
668
  readonly step: 1;
659
669
  readonly hiddenFromList: false;
670
+ readonly keyframable: false;
660
671
  };
661
672
  readonly postmountFor: {
662
673
  readonly type: "number";
@@ -664,6 +675,7 @@ export declare const sequenceSchemaWithoutFrom: {
664
675
  readonly min: 0;
665
676
  readonly step: 1;
666
677
  readonly hiddenFromList: true;
678
+ readonly keyframable: false;
667
679
  };
668
680
  readonly styleWhilePremounted: {
669
681
  readonly type: "hidden";
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.sequenceSchemaDefaultLayoutNone = exports.sequenceSchemaWithoutFrom = exports.baseSchemaWithoutFrom = exports.sequenceSchema = exports.baseSchema = exports.freezeField = exports.trimBeforeField = exports.fromField = exports.durationInFramesField = exports.extendSchemaWithSequenceName = exports.sequenceNameField = exports.hiddenField = exports.sequenceStyleSchema = exports.sequencePremountSchema = exports.premountSchema = exports.textContentSchema = exports.textSchema = exports.sequenceVisualStyleSchema = exports.transformSchema = void 0;
3
+ exports.sequenceSchemaDefaultLayoutNone = exports.sequenceSchemaWithoutFrom = exports.baseSchemaWithoutFrom = exports.sequenceSchema = exports.baseSchema = exports.freezeField = exports.trimBeforeField = exports.fromField = exports.durationInFramesField = exports.extendSchemaWithSequenceName = exports.sequenceNameField = exports.hiddenField = exports.sequenceStyleSchema = exports.sequencePremountSchema = exports.premountStyleSchema = exports.premountSchema = exports.textContentSchema = exports.textSchema = exports.sequenceVisualStyleSchema = exports.transformSchema = void 0;
4
4
  exports.transformSchema = {
5
5
  'style.transformOrigin': {
6
6
  type: 'transform-origin',
@@ -132,6 +132,7 @@ exports.premountSchema = {
132
132
  min: 0,
133
133
  step: 1,
134
134
  hiddenFromList: false,
135
+ keyframable: false,
135
136
  },
136
137
  postmountFor: {
137
138
  type: 'number',
@@ -139,7 +140,10 @@ exports.premountSchema = {
139
140
  min: 0,
140
141
  step: 1,
141
142
  hiddenFromList: true,
143
+ keyframable: false,
142
144
  },
145
+ };
146
+ exports.premountStyleSchema = {
143
147
  styleWhilePremounted: {
144
148
  type: 'hidden',
145
149
  },
@@ -147,10 +151,13 @@ exports.premountSchema = {
147
151
  type: 'hidden',
148
152
  },
149
153
  };
150
- exports.sequencePremountSchema = exports.premountSchema;
154
+ exports.sequencePremountSchema = {
155
+ ...exports.premountSchema,
156
+ ...exports.premountStyleSchema,
157
+ };
151
158
  exports.sequenceStyleSchema = {
152
159
  ...exports.transformSchema,
153
- ...exports.premountSchema,
160
+ ...exports.sequencePremountSchema,
154
161
  };
155
162
  exports.hiddenField = {
156
163
  type: 'boolean',
@@ -186,6 +186,7 @@ export declare const Internals: {
186
186
  readonly min: 0;
187
187
  readonly step: 1;
188
188
  readonly hiddenFromList: false;
189
+ readonly keyframable: false;
189
190
  };
190
191
  readonly postmountFor: {
191
192
  readonly type: "number";
@@ -193,6 +194,7 @@ export declare const Internals: {
193
194
  readonly min: 0;
194
195
  readonly step: 1;
195
196
  readonly hiddenFromList: true;
197
+ readonly keyframable: false;
196
198
  };
197
199
  readonly styleWhilePremounted: {
198
200
  readonly type: "hidden";
@@ -249,6 +251,7 @@ export declare const Internals: {
249
251
  readonly min: 0;
250
252
  readonly step: 1;
251
253
  readonly hiddenFromList: false;
254
+ readonly keyframable: false;
252
255
  };
253
256
  readonly postmountFor: {
254
257
  readonly type: "number";
@@ -256,6 +259,7 @@ export declare const Internals: {
256
259
  readonly min: 0;
257
260
  readonly step: 1;
258
261
  readonly hiddenFromList: true;
262
+ readonly keyframable: false;
259
263
  };
260
264
  readonly styleWhilePremounted: {
261
265
  readonly type: "hidden";
@@ -309,6 +313,7 @@ export declare const Internals: {
309
313
  readonly min: 0;
310
314
  readonly step: 1;
311
315
  readonly hiddenFromList: false;
316
+ readonly keyframable: false;
312
317
  };
313
318
  readonly postmountFor: {
314
319
  readonly type: "number";
@@ -316,6 +321,7 @@ export declare const Internals: {
316
321
  readonly min: 0;
317
322
  readonly step: 1;
318
323
  readonly hiddenFromList: true;
324
+ readonly keyframable: false;
319
325
  };
320
326
  readonly styleWhilePremounted: {
321
327
  readonly type: "hidden";
@@ -446,6 +452,7 @@ export declare const Internals: {
446
452
  readonly min: 0;
447
453
  readonly step: 1;
448
454
  readonly hiddenFromList: false;
455
+ readonly keyframable: false;
449
456
  };
450
457
  readonly postmountFor: {
451
458
  readonly type: "number";
@@ -453,7 +460,10 @@ export declare const Internals: {
453
460
  readonly min: 0;
454
461
  readonly step: 1;
455
462
  readonly hiddenFromList: true;
463
+ readonly keyframable: false;
456
464
  };
465
+ };
466
+ readonly premountStyleSchema: {
457
467
  readonly styleWhilePremounted: {
458
468
  readonly type: "hidden";
459
469
  };
@@ -512,6 +522,24 @@ export declare const Internals: {
512
522
  readonly truthy: typeof truthy;
513
523
  readonly SequenceContext: import("react").Context<import("./SequenceContext.js").SequenceContextType | null>;
514
524
  readonly PremountContext: import("react").Context<import("./PremountContext.js").PremountContextValue>;
525
+ readonly usePremounting: ({ from, durationInFrames, premountFor, postmountFor, style, styleWhilePremounted, styleWhilePostmounted, hideWhilePremounted, }: {
526
+ readonly from: number;
527
+ readonly durationInFrames: number;
528
+ readonly premountFor: number | null;
529
+ readonly postmountFor: number | null;
530
+ readonly style: import("react").CSSProperties | null;
531
+ readonly styleWhilePremounted: import("react").CSSProperties | null;
532
+ readonly styleWhilePostmounted: import("react").CSSProperties | null;
533
+ readonly hideWhilePremounted: "display-none" | "opacity";
534
+ }) => {
535
+ effectivePremountFor: number;
536
+ effectivePostmountFor: number;
537
+ premountingActive: boolean;
538
+ postmountingActive: boolean;
539
+ isPremountingOrPostmounting: boolean;
540
+ freezeFrame: number;
541
+ premountingStyle: import("react").CSSProperties | null;
542
+ };
515
543
  readonly useRemotionContexts: typeof useRemotionContexts;
516
544
  readonly RemotionContextProvider: (props: import("./wrap-remotion-context.js").RemotionContextProviderProps) => import("react/jsx-runtime").JSX.Element;
517
545
  readonly CSSUtils: typeof CSSUtils;
@@ -724,7 +752,35 @@ export declare const Internals: {
724
752
  readonly getComponentsToAddStacksTo: () => unknown[];
725
753
  readonly getSequenceComponent: () => unknown;
726
754
  readonly getSingleChildComponent: (children: import("react").ReactNode) => unknown;
727
- readonly CurrentScaleContext: import("react").Context<import("./use-current-scale.js").CurrentScaleContextType | null>;
755
+ readonly CurrentScaleContext: import("react").Context<({
756
+ type: "scale";
757
+ scale: number;
758
+ } | ({
759
+ type: "canvas-size";
760
+ canvasSize: {
761
+ width: number;
762
+ height: number;
763
+ left: number;
764
+ top: number;
765
+ windowSize: {
766
+ width: number;
767
+ height: number;
768
+ };
769
+ refresh: () => void;
770
+ };
771
+ } & {
772
+ canvasSizeForAuto: {
773
+ width: number;
774
+ height: number;
775
+ left: number;
776
+ top: number;
777
+ windowSize: {
778
+ width: number;
779
+ height: number;
780
+ };
781
+ refresh: () => void;
782
+ };
783
+ })) | null>;
728
784
  readonly PixelDensityContext: import("react").Context<number | null>;
729
785
  readonly PreviewSizeContext: import("react").Context<import("./use-current-scale.js").PreviewSizeCtx>;
730
786
  readonly calculateScale: ({ canvasSize, compositionHeight, compositionWidth, previewSize, }: {
@@ -96,6 +96,7 @@ const use_lazy_component_js_1 = require("./use-lazy-component.js");
96
96
  const use_media_enabled_js_1 = require("./use-media-enabled.js");
97
97
  const use_media_in_timeline_js_1 = require("./use-media-in-timeline.js");
98
98
  const use_pixel_density_js_1 = require("./use-pixel-density.js");
99
+ const use_premounting_js_1 = require("./use-premounting.js");
99
100
  const use_schema_js_1 = require("./use-schema.js");
100
101
  const use_unsafe_video_config_js_1 = require("./use-unsafe-video-config.js");
101
102
  const use_video_js_1 = require("./use-video.js");
@@ -149,6 +150,7 @@ exports.Internals = {
149
150
  textSchema: interactivity_schema_js_1.textSchema,
150
151
  transformSchema: interactivity_schema_js_1.transformSchema,
151
152
  premountSchema: interactivity_schema_js_1.premountSchema,
153
+ premountStyleSchema: interactivity_schema_js_1.premountStyleSchema,
152
154
  flattenActiveSchema: flatten_schema_js_1.flattenActiveSchema,
153
155
  getFlatSchemaWithAllKeys: flatten_schema_js_1.getFlatSchemaWithAllKeys,
154
156
  RemotionRootContexts: RemotionRoot_js_1.RemotionRootContexts,
@@ -162,6 +164,7 @@ exports.Internals = {
162
164
  truthy: truthy_js_1.truthy,
163
165
  SequenceContext: SequenceContext_js_1.SequenceContext,
164
166
  PremountContext: PremountContext_js_1.PremountContext,
167
+ usePremounting: use_premounting_js_1.usePremounting,
165
168
  useRemotionContexts: wrap_remotion_context_js_1.useRemotionContexts,
166
169
  RemotionContextProvider: wrap_remotion_context_js_1.RemotionContextProvider,
167
170
  CSSUtils,
@@ -139,6 +139,7 @@ export declare const NoReactInternals: {
139
139
  readonly min: 0;
140
140
  readonly step: 1;
141
141
  readonly hiddenFromList: false;
142
+ readonly keyframable: false;
142
143
  };
143
144
  readonly postmountFor: {
144
145
  readonly type: "number";
@@ -146,6 +147,7 @@ export declare const NoReactInternals: {
146
147
  readonly min: 0;
147
148
  readonly step: 1;
148
149
  readonly hiddenFromList: true;
150
+ readonly keyframable: false;
149
151
  };
150
152
  readonly styleWhilePremounted: {
151
153
  readonly type: "hidden";
@@ -17,7 +17,14 @@ export type CurrentScaleContextType = {
17
17
  type: 'canvas-size';
18
18
  canvasSize: Size;
19
19
  };
20
- export declare const CurrentScaleContext: React.Context<CurrentScaleContextType | null>;
20
+ type InternalCurrentScaleContextType = Extract<CurrentScaleContextType, {
21
+ type: 'scale';
22
+ }> | (Extract<CurrentScaleContextType, {
23
+ type: 'canvas-size';
24
+ }> & {
25
+ canvasSizeForAuto: Size;
26
+ });
27
+ export declare const CurrentScaleContext: React.Context<InternalCurrentScaleContextType | null>;
21
28
  type Options = {
22
29
  dontThrowIfOutsideOfRemotion: boolean;
23
30
  };
@@ -83,7 +83,7 @@ const useCurrentScale = (options) => {
83
83
  return hasContext.scale;
84
84
  }
85
85
  return (0, exports.calculateScale)({
86
- canvasSize: hasContext.canvasSize,
86
+ canvasSize: hasContext.canvasSizeForAuto,
87
87
  compositionHeight: config.height,
88
88
  compositionWidth: config.width,
89
89
  previewSize: zoomContext.size.size,