@remotion/rive 4.0.478 → 4.0.479
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,10 +1,9 @@
|
|
|
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,
|
|
3
|
+
import type { EffectsProp, InteractiveBaseProps } 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;
|
|
7
|
-
type RiveSequenceInheritedProps = Pick<SequenceProps, 'durationInFrames' | 'name' | 'from' | 'freeze' | 'showInTimeline' | 'hidden'>;
|
|
8
7
|
type RemotionRiveCanvasOwnProps = {
|
|
9
8
|
readonly src: string;
|
|
10
9
|
readonly fit?: RemotionRiveCanvasFit;
|
|
@@ -18,12 +17,12 @@ type RemotionRiveCanvasOwnProps = {
|
|
|
18
17
|
readonly style?: React.CSSProperties;
|
|
19
18
|
readonly effects?: EffectsProp;
|
|
20
19
|
};
|
|
21
|
-
export type RemotionRiveCanvasProps = RemotionRiveCanvasOwnProps &
|
|
20
|
+
export type RemotionRiveCanvasProps = RemotionRiveCanvasOwnProps & InteractiveBaseProps;
|
|
22
21
|
export type RiveCanvasRef = {
|
|
23
22
|
getAnimationInstance: () => LinearAnimationInstance | null;
|
|
24
23
|
getArtboard: () => Artboard | null;
|
|
25
24
|
getRenderer: () => CanvasRenderer | null;
|
|
26
25
|
getCanvas: () => RiveCanvas | null;
|
|
27
26
|
};
|
|
28
|
-
export declare const RemotionRiveCanvas: React.ForwardRefExoticComponent<RemotionRiveCanvasOwnProps &
|
|
27
|
+
export declare const RemotionRiveCanvas: React.ForwardRefExoticComponent<RemotionRiveCanvasOwnProps & InteractiveBaseProps & React.RefAttributes<RiveCanvasRef>>;
|
|
29
28
|
export {};
|
|
@@ -42,7 +42,7 @@ const canvas_advanced_1 = __importDefault(require("@rive-app/canvas-advanced"));
|
|
|
42
42
|
const react_1 = __importStar(require("react"));
|
|
43
43
|
const remotion_1 = require("remotion");
|
|
44
44
|
const map_enums_js_1 = require("./map-enums.js");
|
|
45
|
-
const { addSequenceStackTraces,
|
|
45
|
+
const { addSequenceStackTraces, runEffectChain, useEffectChainState, useMemoizedEffectDefinitions, useMemoizedEffects, } = remotion_1.Internals;
|
|
46
46
|
const riveFitVariants = {
|
|
47
47
|
contain: {},
|
|
48
48
|
cover: {},
|
|
@@ -64,9 +64,7 @@ const riveAlignmentVariants = {
|
|
|
64
64
|
'top-right': {},
|
|
65
65
|
};
|
|
66
66
|
const riveCanvasSchema = {
|
|
67
|
-
|
|
68
|
-
from: fromField,
|
|
69
|
-
freeze: freezeField,
|
|
67
|
+
...remotion_1.Internals.baseSchema,
|
|
70
68
|
fit: {
|
|
71
69
|
type: 'enum',
|
|
72
70
|
default: 'contain',
|
|
@@ -79,8 +77,7 @@ const riveCanvasSchema = {
|
|
|
79
77
|
description: 'Alignment',
|
|
80
78
|
variants: riveAlignmentVariants,
|
|
81
79
|
},
|
|
82
|
-
...
|
|
83
|
-
hidden: hiddenField,
|
|
80
|
+
...remotion_1.Internals.transformSchema,
|
|
84
81
|
};
|
|
85
82
|
const RemotionRiveCanvasContentForwardRefFunction = ({ src, fit, alignment, artboard: artboardName, animation: animationIndex, onLoad = null, assetLoader, enableRiveAssetCdn, className, style, effects, controls, }, ref) => {
|
|
86
83
|
var _a;
|
|
@@ -288,15 +285,15 @@ const RemotionRiveCanvasContentForwardRefFunction = ({ src, fit, alignment, artb
|
|
|
288
285
|
return (jsx_runtime_1.jsx("canvas", { ref: canvas, width: width, height: height, className: className, style: canvasStyle }));
|
|
289
286
|
};
|
|
290
287
|
const RemotionRiveCanvasContent = (0, react_1.forwardRef)(RemotionRiveCanvasContentForwardRefFunction);
|
|
291
|
-
const RemotionRiveCanvasInnerForwardRefFunction = ({ src, fit = 'contain', alignment = 'center', artboard, animation, onLoad = null, assetLoader, enableRiveAssetCdn = true, className, style, effects = [],
|
|
288
|
+
const RemotionRiveCanvasInnerForwardRefFunction = ({ src, fit = 'contain', alignment = 'center', artboard, animation, onLoad = null, assetLoader, enableRiveAssetCdn = true, className, style, effects = [], controls, durationInFrames, name, from, freeze, showInTimeline, hidden, ...props }, ref) => {
|
|
292
289
|
props;
|
|
293
290
|
const memoizedEffectDefinitions = useMemoizedEffectDefinitions(effects);
|
|
294
291
|
return (jsx_runtime_1.jsx(remotion_1.Sequence, { layout: "none", from: from, freeze: freeze, hidden: hidden, showInTimeline: showInTimeline, name: name !== null && name !== void 0 ? name : '<RemotionRiveCanvas>', _remotionInternalDocumentationLink: name === undefined
|
|
295
292
|
? 'https://www.remotion.dev/docs/rive/remotionrivecanvas'
|
|
296
|
-
: undefined, durationInFrames: durationInFrames,
|
|
293
|
+
: undefined, durationInFrames: durationInFrames, controls: controls, _remotionInternalEffects: memoizedEffectDefinitions, ...props, 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: style, effects: effects, controls: controls }) }));
|
|
297
294
|
};
|
|
298
295
|
const RemotionRiveCanvasInner = (0, react_1.forwardRef)(RemotionRiveCanvasInnerForwardRefFunction);
|
|
299
|
-
exports.RemotionRiveCanvas =
|
|
296
|
+
exports.RemotionRiveCanvas = remotion_1.Interactive.withSchema({
|
|
300
297
|
Component: RemotionRiveCanvasInner,
|
|
301
298
|
componentIdentity: 'dev.remotion.rive.RemotionRiveCanvas',
|
|
302
299
|
schema: riveCanvasSchema,
|
package/dist/esm/index.mjs
CHANGED
|
@@ -10,6 +10,7 @@ import React, {
|
|
|
10
10
|
} from "react";
|
|
11
11
|
import {
|
|
12
12
|
Internals,
|
|
13
|
+
Interactive,
|
|
13
14
|
Sequence,
|
|
14
15
|
useCurrentFrame,
|
|
15
16
|
useDelayRender,
|
|
@@ -76,16 +77,10 @@ var mapToAlignment = (alignment, factory) => {
|
|
|
76
77
|
import { jsx } from "react/jsx-runtime";
|
|
77
78
|
var {
|
|
78
79
|
addSequenceStackTraces,
|
|
79
|
-
durationInFramesField,
|
|
80
|
-
freezeField,
|
|
81
|
-
fromField,
|
|
82
|
-
hiddenField,
|
|
83
80
|
runEffectChain,
|
|
84
|
-
sequenceVisualStyleSchema,
|
|
85
81
|
useEffectChainState,
|
|
86
82
|
useMemoizedEffectDefinitions,
|
|
87
|
-
useMemoizedEffects
|
|
88
|
-
wrapInSchema
|
|
83
|
+
useMemoizedEffects
|
|
89
84
|
} = Internals;
|
|
90
85
|
var riveFitVariants = {
|
|
91
86
|
contain: {},
|
|
@@ -108,9 +103,7 @@ var riveAlignmentVariants = {
|
|
|
108
103
|
"top-right": {}
|
|
109
104
|
};
|
|
110
105
|
var riveCanvasSchema = {
|
|
111
|
-
|
|
112
|
-
from: fromField,
|
|
113
|
-
freeze: freezeField,
|
|
106
|
+
...Internals.baseSchema,
|
|
114
107
|
fit: {
|
|
115
108
|
type: "enum",
|
|
116
109
|
default: "contain",
|
|
@@ -123,8 +116,7 @@ var riveCanvasSchema = {
|
|
|
123
116
|
description: "Alignment",
|
|
124
117
|
variants: riveAlignmentVariants
|
|
125
118
|
},
|
|
126
|
-
...
|
|
127
|
-
hidden: hiddenField
|
|
119
|
+
...Internals.transformSchema
|
|
128
120
|
};
|
|
129
121
|
var RemotionRiveCanvasContentForwardRefFunction = ({
|
|
130
122
|
src,
|
|
@@ -329,7 +321,7 @@ var RemotionRiveCanvasInnerForwardRefFunction = ({
|
|
|
329
321
|
className,
|
|
330
322
|
style,
|
|
331
323
|
effects = [],
|
|
332
|
-
|
|
324
|
+
controls,
|
|
333
325
|
durationInFrames,
|
|
334
326
|
name,
|
|
335
327
|
from,
|
|
@@ -348,7 +340,7 @@ var RemotionRiveCanvasInnerForwardRefFunction = ({
|
|
|
348
340
|
name: name ?? "<RemotionRiveCanvas>",
|
|
349
341
|
_remotionInternalDocumentationLink: name === undefined ? "https://www.remotion.dev/docs/rive/remotionrivecanvas" : undefined,
|
|
350
342
|
durationInFrames,
|
|
351
|
-
|
|
343
|
+
controls,
|
|
352
344
|
_remotionInternalEffects: memoizedEffectDefinitions,
|
|
353
345
|
...props,
|
|
354
346
|
children: /* @__PURE__ */ jsx(RemotionRiveCanvasContent, {
|
|
@@ -369,7 +361,7 @@ var RemotionRiveCanvasInnerForwardRefFunction = ({
|
|
|
369
361
|
});
|
|
370
362
|
};
|
|
371
363
|
var RemotionRiveCanvasInner = forwardRef(RemotionRiveCanvasInnerForwardRefFunction);
|
|
372
|
-
var RemotionRiveCanvas =
|
|
364
|
+
var RemotionRiveCanvas = Interactive.withSchema({
|
|
373
365
|
Component: RemotionRiveCanvasInner,
|
|
374
366
|
componentIdentity: "dev.remotion.rive.RemotionRiveCanvas",
|
|
375
367
|
schema: riveCanvasSchema,
|
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.479",
|
|
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",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"license": "See LICENSE.md",
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@rive-app/canvas-advanced": "2.31.5",
|
|
25
|
-
"remotion": "4.0.
|
|
25
|
+
"remotion": "4.0.479"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"react": ">=18.2.0",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"react": "19.2.3",
|
|
33
33
|
"react-dom": "19.2.3",
|
|
34
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
34
|
+
"@remotion/eslint-config-internal": "4.0.479",
|
|
35
35
|
"eslint": "9.19.0",
|
|
36
36
|
"@typescript/native-preview": "7.0.0-dev.20260217.1"
|
|
37
37
|
},
|