@remotion/rive 4.0.526 → 4.0.528
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Artboard, CanvasRenderer, File, FileAsset, LinearAnimationInstance, RiveCanvas } from '@rive-app/canvas-advanced';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import type { EffectsProp, InteractiveBaseProps, InteractiveCropProps, InteractivitySchema } from 'remotion';
|
|
3
|
+
import type { EffectsProp, InteractiveBaseProps, InteractivePremountProps, InteractiveCropProps, InteractivitySchema } from 'remotion';
|
|
4
4
|
import type { RemotionRiveCanvasAlignment, RemotionRiveCanvasFit } from './map-enums.js';
|
|
5
5
|
type assetLoadCallback = (asset: FileAsset, bytes: Uint8Array) => boolean;
|
|
6
6
|
type onLoadCallback = (file: File) => void;
|
|
@@ -17,7 +17,7 @@ type RemotionRiveCanvasOwnProps = {
|
|
|
17
17
|
readonly style?: React.CSSProperties;
|
|
18
18
|
readonly effects?: EffectsProp;
|
|
19
19
|
};
|
|
20
|
-
export type RemotionRiveCanvasProps = RemotionRiveCanvasOwnProps & InteractiveBaseProps & InteractiveCropProps;
|
|
20
|
+
export type RemotionRiveCanvasProps = RemotionRiveCanvasOwnProps & InteractiveBaseProps & InteractivePremountProps & InteractiveCropProps;
|
|
21
21
|
export type RiveCanvasRef = {
|
|
22
22
|
getAnimationInstance: () => LinearAnimationInstance | null;
|
|
23
23
|
getArtboard: () => Artboard | null;
|
|
@@ -25,5 +25,5 @@ export type RiveCanvasRef = {
|
|
|
25
25
|
getCanvas: () => RiveCanvas | null;
|
|
26
26
|
};
|
|
27
27
|
export declare const riveCanvasSchema: InteractivitySchema;
|
|
28
|
-
export declare const RemotionRiveCanvas: React.ForwardRefExoticComponent<RemotionRiveCanvasOwnProps & InteractiveBaseProps & InteractiveCropProps & React.RefAttributes<RiveCanvasRef>>;
|
|
28
|
+
export declare const RemotionRiveCanvas: React.ForwardRefExoticComponent<RemotionRiveCanvasOwnProps & InteractiveBaseProps & InteractivePremountProps & InteractiveCropProps & React.RefAttributes<RiveCanvasRef>>;
|
|
29
29
|
export {};
|
|
@@ -65,6 +65,7 @@ const riveAlignmentVariants = {
|
|
|
65
65
|
};
|
|
66
66
|
exports.riveCanvasSchema = {
|
|
67
67
|
...remotion_1.Internals.baseSchema,
|
|
68
|
+
...remotion_1.Internals.premountSchema,
|
|
68
69
|
fit: {
|
|
69
70
|
type: 'enum',
|
|
70
71
|
default: 'contain',
|
|
@@ -289,21 +290,31 @@ const RemotionRiveCanvasContentForwardRefFunction = ({ src, fit, alignment, artb
|
|
|
289
290
|
return (jsx_runtime_1.jsx("canvas", { ref: canvasRef, width: width, height: height, className: className, style: canvasStyle }));
|
|
290
291
|
};
|
|
291
292
|
const RemotionRiveCanvasContent = (0, react_1.forwardRef)(RemotionRiveCanvasContentForwardRefFunction);
|
|
292
|
-
const RemotionRiveCanvasInnerForwardRefFunction = ({ src, fit = 'contain', alignment = 'center', artboard, animation, onLoad = null, assetLoader, enableRiveAssetCdn = true, className, style, effects = [], controls, durationInFrames, name, from, trimBefore, freeze, showInTimeline, hidden, cropLeft, cropRight, cropTop, cropBottom, ...props }, ref) => {
|
|
293
|
+
const RemotionRiveCanvasInnerForwardRefFunction = ({ src, fit = 'contain', alignment = 'center', artboard, animation, onLoad = null, assetLoader, enableRiveAssetCdn = true, className, style, effects = [], controls, durationInFrames, name, from, premountFor, postmountFor, styleWhilePremounted, styleWhilePostmounted, trimBefore, playbackRate, freeze, showInTimeline, hidden, cropLeft, cropRight, cropTop, cropBottom, ...props }, ref) => {
|
|
293
294
|
props;
|
|
294
295
|
const memoizedEffectDefinitions = useMemoizedEffectDefinitions(effects);
|
|
295
296
|
const canvasRef = (0, react_1.useRef)(null);
|
|
297
|
+
const { effectivePremountFor, effectivePostmountFor, freezeFrame, isPremountingOrPostmounting, premountingActive, postmountingActive, premountingStyle, } = remotion_1.Internals.usePremounting({
|
|
298
|
+
from: from !== null && from !== void 0 ? from : 0,
|
|
299
|
+
durationInFrames: durationInFrames !== null && durationInFrames !== void 0 ? durationInFrames : Infinity,
|
|
300
|
+
premountFor: premountFor !== null && premountFor !== void 0 ? premountFor : null,
|
|
301
|
+
postmountFor: postmountFor !== null && postmountFor !== void 0 ? postmountFor : null,
|
|
302
|
+
style: style !== null && style !== void 0 ? style : null,
|
|
303
|
+
styleWhilePremounted: styleWhilePremounted !== null && styleWhilePremounted !== void 0 ? styleWhilePremounted : null,
|
|
304
|
+
styleWhilePostmounted: styleWhilePostmounted !== null && styleWhilePostmounted !== void 0 ? styleWhilePostmounted : null,
|
|
305
|
+
hideWhilePremounted: 'opacity',
|
|
306
|
+
});
|
|
296
307
|
const croppedStyle = remotion_1.Internals.useCropStyle({
|
|
297
308
|
cropLeft,
|
|
298
309
|
cropRight,
|
|
299
310
|
cropTop,
|
|
300
311
|
cropBottom,
|
|
301
|
-
style:
|
|
312
|
+
style: premountingStyle,
|
|
302
313
|
componentName: '<RemotionRiveCanvas />',
|
|
303
314
|
});
|
|
304
|
-
return (jsx_runtime_1.jsx(remotion_1.Sequence, { layout: "none", from: from, trimBefore: trimBefore, freeze: freeze, hidden: hidden, showInTimeline: showInTimeline, name: name !== null && name !== void 0 ? name : '<RemotionRiveCanvas>', _remotionInternalDocumentationLink: name === undefined
|
|
305
|
-
|
|
306
|
-
|
|
315
|
+
return (jsx_runtime_1.jsx(remotion_1.Freeze, { frame: freezeFrame, active: isPremountingOrPostmounting, children: jsx_runtime_1.jsx(remotion_1.Sequence, { layout: "none", from: from, trimBefore: trimBefore, playbackRate: playbackRate, freeze: freeze, hidden: hidden, showInTimeline: showInTimeline, name: name !== null && name !== void 0 ? name : '<RemotionRiveCanvas>', _remotionInternalDocumentationLink: name === undefined
|
|
316
|
+
? 'https://www.remotion.dev/docs/rive/remotionrivecanvas'
|
|
317
|
+
: undefined, durationInFrames: durationInFrames, controls: controls, _remotionInternalEffects: memoizedEffectDefinitions, outlineRef: canvasRef, ...props, _remotionInternalPremountDisplay: effectivePremountFor || null, _remotionInternalPostmountDisplay: effectivePostmountFor || null, _remotionInternalIsPremounting: premountingActive, _remotionInternalIsPostmounting: postmountingActive, children: jsx_runtime_1.jsx(RemotionRiveCanvasContent, { ref: ref, src: src, fit: fit, alignment: alignment, artboard: artboard, animation: animation, onLoad: onLoad, assetLoader: assetLoader, enableRiveAssetCdn: enableRiveAssetCdn, className: className, style: croppedStyle !== null && croppedStyle !== void 0 ? croppedStyle : undefined, effects: effects, controls: controls, canvasRef: canvasRef }) }) }));
|
|
307
318
|
};
|
|
308
319
|
const RemotionRiveCanvasInner = (0, react_1.forwardRef)(RemotionRiveCanvasInnerForwardRefFunction);
|
|
309
320
|
exports.RemotionRiveCanvas = remotion_1.Interactive.withSchema({
|
package/dist/esm/index.mjs
CHANGED
|
@@ -9,9 +9,10 @@ import React, {
|
|
|
9
9
|
useState
|
|
10
10
|
} from "react";
|
|
11
11
|
import {
|
|
12
|
+
Freeze,
|
|
13
|
+
Sequence,
|
|
12
14
|
Internals,
|
|
13
15
|
Interactive,
|
|
14
|
-
Sequence,
|
|
15
16
|
useCurrentFrame,
|
|
16
17
|
useDelayRender,
|
|
17
18
|
useVideoConfig
|
|
@@ -103,6 +104,7 @@ var riveAlignmentVariants = {
|
|
|
103
104
|
};
|
|
104
105
|
var riveCanvasSchema = {
|
|
105
106
|
...Internals.baseSchema,
|
|
107
|
+
...Internals.premountSchema,
|
|
106
108
|
fit: {
|
|
107
109
|
type: "enum",
|
|
108
110
|
default: "contain",
|
|
@@ -329,7 +331,12 @@ var RemotionRiveCanvasInnerForwardRefFunction = ({
|
|
|
329
331
|
durationInFrames,
|
|
330
332
|
name,
|
|
331
333
|
from,
|
|
334
|
+
premountFor,
|
|
335
|
+
postmountFor,
|
|
336
|
+
styleWhilePremounted,
|
|
337
|
+
styleWhilePostmounted,
|
|
332
338
|
trimBefore,
|
|
339
|
+
playbackRate,
|
|
333
340
|
freeze,
|
|
334
341
|
showInTimeline,
|
|
335
342
|
hidden,
|
|
@@ -341,43 +348,70 @@ var RemotionRiveCanvasInnerForwardRefFunction = ({
|
|
|
341
348
|
}, ref) => {
|
|
342
349
|
const memoizedEffectDefinitions = useMemoizedEffectDefinitions(effects);
|
|
343
350
|
const canvasRef = useRef(null);
|
|
351
|
+
const {
|
|
352
|
+
effectivePremountFor,
|
|
353
|
+
effectivePostmountFor,
|
|
354
|
+
freezeFrame,
|
|
355
|
+
isPremountingOrPostmounting,
|
|
356
|
+
premountingActive,
|
|
357
|
+
postmountingActive,
|
|
358
|
+
premountingStyle
|
|
359
|
+
} = Internals.usePremounting({
|
|
360
|
+
from: from ?? 0,
|
|
361
|
+
durationInFrames: durationInFrames ?? Infinity,
|
|
362
|
+
premountFor: premountFor ?? null,
|
|
363
|
+
postmountFor: postmountFor ?? null,
|
|
364
|
+
style: style ?? null,
|
|
365
|
+
styleWhilePremounted: styleWhilePremounted ?? null,
|
|
366
|
+
styleWhilePostmounted: styleWhilePostmounted ?? null,
|
|
367
|
+
hideWhilePremounted: "opacity"
|
|
368
|
+
});
|
|
344
369
|
const croppedStyle = Internals.useCropStyle({
|
|
345
370
|
cropLeft,
|
|
346
371
|
cropRight,
|
|
347
372
|
cropTop,
|
|
348
373
|
cropBottom,
|
|
349
|
-
style:
|
|
374
|
+
style: premountingStyle,
|
|
350
375
|
componentName: "<RemotionRiveCanvas />"
|
|
351
376
|
});
|
|
352
|
-
return /* @__PURE__ */ jsx(
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
children: /* @__PURE__ */ jsx(RemotionRiveCanvasContent, {
|
|
367
|
-
ref,
|
|
368
|
-
src,
|
|
369
|
-
fit,
|
|
370
|
-
alignment,
|
|
371
|
-
artboard,
|
|
372
|
-
animation,
|
|
373
|
-
onLoad,
|
|
374
|
-
assetLoader,
|
|
375
|
-
enableRiveAssetCdn,
|
|
376
|
-
className,
|
|
377
|
-
style: croppedStyle ?? undefined,
|
|
378
|
-
effects,
|
|
377
|
+
return /* @__PURE__ */ jsx(Freeze, {
|
|
378
|
+
frame: freezeFrame,
|
|
379
|
+
active: isPremountingOrPostmounting,
|
|
380
|
+
children: /* @__PURE__ */ jsx(Sequence, {
|
|
381
|
+
layout: "none",
|
|
382
|
+
from,
|
|
383
|
+
trimBefore,
|
|
384
|
+
playbackRate,
|
|
385
|
+
freeze,
|
|
386
|
+
hidden,
|
|
387
|
+
showInTimeline,
|
|
388
|
+
name: name ?? "<RemotionRiveCanvas>",
|
|
389
|
+
_remotionInternalDocumentationLink: name === undefined ? "https://www.remotion.dev/docs/rive/remotionrivecanvas" : undefined,
|
|
390
|
+
durationInFrames,
|
|
379
391
|
controls,
|
|
380
|
-
|
|
392
|
+
_remotionInternalEffects: memoizedEffectDefinitions,
|
|
393
|
+
outlineRef: canvasRef,
|
|
394
|
+
...props,
|
|
395
|
+
_remotionInternalPremountDisplay: effectivePremountFor || null,
|
|
396
|
+
_remotionInternalPostmountDisplay: effectivePostmountFor || null,
|
|
397
|
+
_remotionInternalIsPremounting: premountingActive,
|
|
398
|
+
_remotionInternalIsPostmounting: postmountingActive,
|
|
399
|
+
children: /* @__PURE__ */ jsx(RemotionRiveCanvasContent, {
|
|
400
|
+
ref,
|
|
401
|
+
src,
|
|
402
|
+
fit,
|
|
403
|
+
alignment,
|
|
404
|
+
artboard,
|
|
405
|
+
animation,
|
|
406
|
+
onLoad,
|
|
407
|
+
assetLoader,
|
|
408
|
+
enableRiveAssetCdn,
|
|
409
|
+
className,
|
|
410
|
+
style: croppedStyle ?? undefined,
|
|
411
|
+
effects,
|
|
412
|
+
controls,
|
|
413
|
+
canvasRef
|
|
414
|
+
})
|
|
381
415
|
})
|
|
382
416
|
});
|
|
383
417
|
};
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"url": "https://github.com/remotion-dev/remotion/tree/main/packages/rive"
|
|
4
4
|
},
|
|
5
5
|
"name": "@remotion/rive",
|
|
6
|
-
"version": "4.0.
|
|
6
|
+
"version": "4.0.528",
|
|
7
7
|
"description": "Embed Rive animations in a Remotion video",
|
|
8
8
|
"main": "dist/cjs/index.js",
|
|
9
9
|
"types": "dist/cjs/index.d.ts",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"license": "See LICENSE.md",
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@rive-app/canvas-advanced": "2.31.5",
|
|
26
|
-
"remotion": "4.0.
|
|
26
|
+
"remotion": "4.0.528"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"react": ">=18.2.0",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"react": "19.2.3",
|
|
34
34
|
"react-dom": "19.2.3",
|
|
35
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
35
|
+
"@remotion/eslint-config-internal": "4.0.528",
|
|
36
36
|
"eslint": "9.19.0",
|
|
37
37
|
"@typescript/native-preview": "7.0.0-dev.20260217.1"
|
|
38
38
|
},
|