@remotion/rive 4.0.541 → 4.0.542

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.
@@ -32,7 +32,6 @@ const riveAlignmentVariants = {
32
32
  };
33
33
  exports.riveCanvasSchema = {
34
34
  ...remotion_1.Internals.baseSchema,
35
- ...remotion_1.Internals.premountSchema,
36
35
  fit: {
37
36
  type: 'enum',
38
37
  default: 'contain',
@@ -52,7 +51,7 @@ exports.riveCanvasSchema = {
52
51
  ...remotion_1.Interactive.cropSchema,
53
52
  };
54
53
  const RemotionRiveCanvasContentForwardRefFunction = ({ src, fit, alignment, artboard: artboardName, animation: animationIndex, onLoad = null, assetLoader, enableRiveAssetCdn, className, style, effects, effectsOutputSize, controls, canvasRef, }, ref) => {
55
- var _a, _b, _c;
54
+ var _a, _b, _c, _d;
56
55
  const { width, fps, height } = (0, remotion_1.useVideoConfig)();
57
56
  const frame = (0, remotion_1.useCurrentFrame)();
58
57
  const [loadedRuntime, setLoadedRuntime] = (0, react_1.useState)(null);
@@ -72,7 +71,8 @@ const RemotionRiveCanvasContentForwardRefFunction = ({ src, fit, alignment, artb
72
71
  const memoizedEffects = useMemoizedEffects({
73
72
  effects,
74
73
  overrideId: (_b = controls === null || controls === void 0 ? void 0 : controls.overrideId) !== null && _b !== void 0 ? _b : null,
75
- videoConfigValues: (_c = controls === null || controls === void 0 ? void 0 : controls.videoConfigValues) !== null && _c !== void 0 ? _c : null,
74
+ runtimeValues: (_c = controls === null || controls === void 0 ? void 0 : controls.runtimeValues) !== null && _c !== void 0 ? _c : null,
75
+ videoConfigValues: (_d = controls === null || controls === void 0 ? void 0 : controls.videoConfigValues) !== null && _d !== void 0 ? _d : null,
76
76
  });
77
77
  if (err) {
78
78
  throw err;
@@ -288,6 +288,7 @@ const RemotionRiveCanvasContentForwardRefFunction = ({ src, fit, alignment, artb
288
288
  const RemotionRiveCanvasContent = (0, react_1.forwardRef)(RemotionRiveCanvasContentForwardRefFunction);
289
289
  const RemotionRiveCanvasInnerForwardRefFunction = ({ src, fit = 'contain', alignment = 'center', artboard, animation, onLoad = null, assetLoader, enableRiveAssetCdn = true, className, style, effects = [], effectsOutputSize, controls, durationInFrames, name, from, premountFor, postmountFor, styleWhilePremounted, styleWhilePostmounted, trimBefore, playbackRate, loop, freeze, showInTimeline, hidden, cropLeft, cropRight, cropTop, cropBottom, ...props }, ref) => {
290
290
  props;
291
+ const videoEnabled = remotion_1.Internals.useVideoEnabled();
291
292
  const memoizedEffectDefinitions = useMemoizedEffectDefinitions(effects);
292
293
  const canvasRef = (0, react_1.useRef)(null);
293
294
  const { effectivePremountFor, effectivePostmountFor, freezeFrame, isPremountingOrPostmounting, premountingActive, postmountingActive, premountingStyle, } = remotion_1.Internals.usePremounting({
@@ -312,6 +313,9 @@ const RemotionRiveCanvasInnerForwardRefFunction = ({ src, fit = 'contain', align
312
313
  style: premountingStyle,
313
314
  componentName: '<RemotionRiveCanvas />',
314
315
  });
316
+ if (!videoEnabled) {
317
+ return null;
318
+ }
315
319
  return ((0, jsx_runtime_1.jsx)(remotion_1.Freeze, { frame: freezeFrame, active: isPremountingOrPostmounting, children: (0, jsx_runtime_1.jsx)(remotion_1.Sequence, { layout: "none", from: from, trimBefore: trimBefore, playbackRate: playbackRate, loop: loop, freeze: freeze, hidden: hidden, showInTimeline: showInTimeline, name: name !== null && name !== void 0 ? name : '<RemotionRiveCanvas>', _remotionInternalDocumentationLink: "https://www.remotion.dev/docs/rive/remotionrivecanvas", durationInFrames: durationInFrames, controls: controls, _remotionInternalEffects: memoizedEffectDefinitions, ...props, _remotionInternalPremountDisplay: effectivePremountFor || null, _remotionInternalPostmountDisplay: effectivePostmountFor || null, _remotionInternalIsPremounting: premountingActive, _remotionInternalIsPostmounting: postmountingActive, children: (0, 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, effectsOutputSize: effectsOutputSize !== null && effectsOutputSize !== void 0 ? effectsOutputSize : null, controls: controls, canvasRef: canvasRef }) }) }));
316
320
  };
317
321
  const RemotionRiveCanvasInner = (0, react_1.forwardRef)(RemotionRiveCanvasInnerForwardRefFunction);
@@ -105,7 +105,6 @@ var riveAlignmentVariants = {
105
105
  };
106
106
  var riveCanvasSchema = {
107
107
  ...Internals.baseSchema,
108
- ...Internals.premountSchema,
109
108
  fit: {
110
109
  type: "enum",
111
110
  default: "contain",
@@ -157,6 +156,7 @@ var RemotionRiveCanvasContentForwardRefFunction = ({
157
156
  const memoizedEffects = useMemoizedEffects({
158
157
  effects,
159
158
  overrideId: controls?.overrideId ?? null,
159
+ runtimeValues: controls?.runtimeValues ?? null,
160
160
  videoConfigValues: controls?.videoConfigValues ?? null
161
161
  });
162
162
  if (err) {
@@ -379,6 +379,7 @@ var RemotionRiveCanvasInnerForwardRefFunction = ({
379
379
  cropBottom,
380
380
  ...props
381
381
  }, ref) => {
382
+ const videoEnabled = Internals.useVideoEnabled();
382
383
  const memoizedEffectDefinitions = useMemoizedEffectDefinitions(effects);
383
384
  const canvasRef = useRef(null);
384
385
  const {
@@ -411,6 +412,9 @@ var RemotionRiveCanvasInnerForwardRefFunction = ({
411
412
  style: premountingStyle,
412
413
  componentName: "<RemotionRiveCanvas />"
413
414
  });
415
+ if (!videoEnabled) {
416
+ return null;
417
+ }
414
418
  return /* @__PURE__ */ jsx(Freeze, {
415
419
  frame: freezeFrame,
416
420
  active: isPremountingOrPostmounting,
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.541",
6
+ "version": "4.0.542",
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",
@@ -13,7 +13,7 @@
13
13
  "format": "oxfmt src",
14
14
  "lint": "eslint src",
15
15
  "test": "bun test src/test",
16
- "make": "tsc -d && bun --env-file=../.env.bundle bundle.ts"
16
+ "make": "node ../.monorepo/tsrs.cjs -d && bun --env-file=../.env.bundle bundle.ts"
17
17
  },
18
18
  "bugs": {
19
19
  "url": "https://github.com/remotion-dev/remotion/issues"
@@ -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.541"
26
+ "remotion": "4.0.542"
27
27
  },
28
28
  "peerDependencies": {
29
29
  "react": ">=18.2.0",
@@ -32,7 +32,7 @@
32
32
  "devDependencies": {
33
33
  "react": "19.3.1",
34
34
  "react-dom": "19.3.1",
35
- "@remotion/eslint-config-internal": "4.0.541",
35
+ "@remotion/eslint-config-internal": "4.0.542",
36
36
  "eslint": "9.19.0",
37
37
  "typescript": "7.1.0-beta"
38
38
  },