remotion 4.0.494 → 4.0.496
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/HtmlInCanvas.js +5 -5
- package/dist/cjs/Img.js +3 -1
- package/dist/cjs/Interactive.d.ts +4 -6
- package/dist/cjs/Interactive.js +46 -37
- package/dist/cjs/Sequence.js +12 -33
- package/dist/cjs/interactivity-schema.d.ts +12 -0
- package/dist/cjs/interactivity-schema.js +10 -3
- package/dist/cjs/internals.d.ts +57 -1
- package/dist/cjs/internals.js +3 -0
- package/dist/cjs/no-react.d.ts +2 -0
- package/dist/cjs/use-current-scale.d.ts +8 -1
- package/dist/cjs/use-current-scale.js +1 -1
- package/dist/cjs/use-premounting.d.ts +19 -0
- package/dist/cjs/use-premounting.js +62 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/index.mjs +293 -224
- package/dist/esm/no-react.mjs +12 -4
- package/dist/esm/version.mjs +1 -1
- package/package.json +2 -2
package/dist/cjs/HtmlInCanvas.js
CHANGED
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.HtmlInCanvas = exports.htmlInCanvasSchema = exports.HTML_IN_CANVAS_UNSUPPORTED_MESSAGE = exports.isHtmlInCanvasSupported = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
-
const delay_render_js_1 = require("./delay-render.js");
|
|
7
6
|
const run_effect_chain_js_1 = require("./effects/run-effect-chain.js");
|
|
8
7
|
const use_effect_chain_state_js_1 = require("./effects/use-effect-chain-state.js");
|
|
9
8
|
const use_memoized_effects_js_1 = require("./effects/use-memoized-effects.js");
|
|
@@ -87,7 +86,7 @@ const HtmlInCanvasContent = (0, react_1.forwardRef)(({ width, height, effects, c
|
|
|
87
86
|
const resolvedPixelDensity = resolveHtmlInCanvasPixelDensity(pixelDensity);
|
|
88
87
|
const canvasWidth = Math.ceil(width * resolvedPixelDensity);
|
|
89
88
|
const canvasHeight = Math.ceil(height * resolvedPixelDensity);
|
|
90
|
-
const { continueRender, cancelRender } = (0, use_delay_render_js_1.useDelayRender)();
|
|
89
|
+
const { delayRender, continueRender, cancelRender } = (0, use_delay_render_js_1.useDelayRender)();
|
|
91
90
|
const { isClientSideRendering, isRendering } = (0, use_remotion_environment_js_1.useRemotionEnvironment)();
|
|
92
91
|
const canRetryMissingPaintRecord = !isRendering || isClientSideRendering;
|
|
93
92
|
const usesDirectLayoutCanvas = onPaint === undefined && onInit === undefined;
|
|
@@ -144,7 +143,7 @@ const HtmlInCanvasContent = (0, react_1.forwardRef)(({ width, height, effects, c
|
|
|
144
143
|
if (!placeholderCanvas) {
|
|
145
144
|
throw new Error('Canvas not found');
|
|
146
145
|
}
|
|
147
|
-
const handle =
|
|
146
|
+
const handle = delayRender('onPaint');
|
|
148
147
|
if (!initializedRef.current) {
|
|
149
148
|
const currentOnInit = onInitRef.current;
|
|
150
149
|
if (!currentOnInit) {
|
|
@@ -265,6 +264,7 @@ const HtmlInCanvasContent = (0, react_1.forwardRef)(({ width, height, effects, c
|
|
|
265
264
|
chainState,
|
|
266
265
|
continueRender,
|
|
267
266
|
cancelRender,
|
|
267
|
+
delayRender,
|
|
268
268
|
resolvedPixelDensity,
|
|
269
269
|
canRetryMissingPaintRecord,
|
|
270
270
|
]);
|
|
@@ -323,14 +323,14 @@ const HtmlInCanvasContent = (0, react_1.forwardRef)(({ width, height, effects, c
|
|
|
323
323
|
if (!canvas) {
|
|
324
324
|
return;
|
|
325
325
|
}
|
|
326
|
-
const handle =
|
|
326
|
+
const handle = delayRender('waiting for first paint after canvas resize');
|
|
327
327
|
canvas.addEventListener('paint', () => {
|
|
328
328
|
continueRender(handle);
|
|
329
329
|
}, { once: true });
|
|
330
330
|
return () => {
|
|
331
331
|
continueRender(handle);
|
|
332
332
|
};
|
|
333
|
-
}, [width, height, continueRender, canvasSizeKey]);
|
|
333
|
+
}, [width, height, continueRender, delayRender, canvasSizeKey]);
|
|
334
334
|
const innerStyle = (0, react_1.useMemo)(() => {
|
|
335
335
|
return {
|
|
336
336
|
width,
|
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
|
|
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";
|
package/dist/cjs/Interactive.js
CHANGED
|
@@ -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
|
|
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:
|
|
116
|
-
Article:
|
|
117
|
-
Aside:
|
|
118
|
-
Button:
|
|
119
|
-
Circle:
|
|
120
|
-
Code:
|
|
121
|
-
Div:
|
|
122
|
-
Ellipse:
|
|
123
|
-
Em:
|
|
124
|
-
Footer:
|
|
125
|
-
G:
|
|
126
|
-
H1:
|
|
127
|
-
H2:
|
|
128
|
-
H3:
|
|
129
|
-
H4:
|
|
130
|
-
H5:
|
|
131
|
-
H6:
|
|
132
|
-
Header:
|
|
133
|
-
Label:
|
|
134
|
-
Li:
|
|
135
|
-
Line:
|
|
136
|
-
Main:
|
|
137
|
-
Nav:
|
|
138
|
-
Ol:
|
|
139
|
-
P:
|
|
140
|
-
Path:
|
|
141
|
-
Pre:
|
|
142
|
-
Rect:
|
|
143
|
-
Section:
|
|
144
|
-
Small:
|
|
145
|
-
Span:
|
|
146
|
-
Strong:
|
|
147
|
-
Svg:
|
|
148
|
-
Text:
|
|
149
|
-
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
|
};
|
package/dist/cjs/Sequence.js
CHANGED
|
@@ -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
|
|
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
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
?
|
|
358
|
-
:
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
var _a;
|
|
364
|
-
return {
|
|
365
|
-
...passedStyle,
|
|
366
|
-
opacity: premountingActive || postmountingActive ? 0 : passedStyle === null || passedStyle === void 0 ? void 0 : passedStyle.opacity,
|
|
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) => {
|
|
@@ -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 =
|
|
154
|
+
exports.sequencePremountSchema = {
|
|
155
|
+
...exports.premountSchema,
|
|
156
|
+
...exports.premountStyleSchema,
|
|
157
|
+
};
|
|
151
158
|
exports.sequenceStyleSchema = {
|
|
152
159
|
...exports.transformSchema,
|
|
153
|
-
...exports.
|
|
160
|
+
...exports.sequencePremountSchema,
|
|
154
161
|
};
|
|
155
162
|
exports.hiddenField = {
|
|
156
163
|
type: 'boolean',
|
package/dist/cjs/internals.d.ts
CHANGED
|
@@ -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<
|
|
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, }: {
|
package/dist/cjs/internals.js
CHANGED
|
@@ -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,
|
package/dist/cjs/no-react.d.ts
CHANGED
|
@@ -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
|
-
|
|
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.
|
|
86
|
+
canvasSize: hasContext.canvasSizeForAuto,
|
|
87
87
|
compositionHeight: config.height,
|
|
88
88
|
compositionWidth: config.width,
|
|
89
89
|
previewSize: zoomContext.size.size,
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
export declare const usePremounting: ({ from, durationInFrames, premountFor, postmountFor, style, styleWhilePremounted, styleWhilePostmounted, hideWhilePremounted, }: {
|
|
3
|
+
readonly from: number;
|
|
4
|
+
readonly durationInFrames: number;
|
|
5
|
+
readonly premountFor: number | null;
|
|
6
|
+
readonly postmountFor: number | null;
|
|
7
|
+
readonly style: React.CSSProperties | null;
|
|
8
|
+
readonly styleWhilePremounted: React.CSSProperties | null;
|
|
9
|
+
readonly styleWhilePostmounted: React.CSSProperties | null;
|
|
10
|
+
readonly hideWhilePremounted: "display-none" | "opacity";
|
|
11
|
+
}) => {
|
|
12
|
+
effectivePremountFor: number;
|
|
13
|
+
effectivePostmountFor: number;
|
|
14
|
+
premountingActive: boolean;
|
|
15
|
+
postmountingActive: boolean;
|
|
16
|
+
isPremountingOrPostmounting: boolean;
|
|
17
|
+
freezeFrame: number;
|
|
18
|
+
premountingStyle: React.CSSProperties | null;
|
|
19
|
+
};
|