@remotion/lottie 3.2.21 → 3.2.23-ensure-ffmpeg.123

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/LICENSE.md CHANGED
@@ -1,34 +1,34 @@
1
1
  # Remotion License
2
2
 
3
- Depending on the type of your legal entity, you are granted permission to use Remotion for your project. Individuals and small companies are allowed to use Remotion create videos for free (even commercial), while a company license is required for for-profit organisations of a certain size. This two-tier system was designed to ensure funding for this project while still allowing the source code to be available and the program to be free for most. Read below for the exact terms of use.
3
+ Depending on the type of your legal entity, you are granted permission to use Remotion for your project. Individuals and small companies are allowed to use Remotion to create videos for free (even commercial), while a company license is required for for-profit organizations of a certain size. This two-tier system was designed to ensure funding for this project while still allowing the source code to be available and the program to be free for most. Read below for the exact terms of use.
4
4
 
5
5
  - [Free license](#free-license)
6
6
  - [Company license](#company-license)
7
7
 
8
8
  ## Free license
9
9
 
10
- Copyright © 2022 [Jonny Burger](https://jonny.io)
10
+ Copyright © 2022 [Remotion](https://www.remotion.dev/)
11
11
 
12
12
  ### Eligibility
13
13
 
14
14
  You are eligible to use Remotion for free if you are:
15
15
 
16
16
  - an individual
17
- - a for-profit organisation with up to 3 employees
18
- - a non-profit or not-for-profit organisation
17
+ - a for-profit organization with up to 3 employees
18
+ - a non-profit or not-for-profit organization
19
19
  - evaluating whether Remotion is a good fit, and are not yet using it in a commercial way
20
20
 
21
21
  ### Allowed use cases
22
22
 
23
- Permission is hereby granted, free of charge, to any person eligible for the "Free license", to use the software non-commercially or commercially for the purpose of creating videos and images and to modify and the software to their own liking, for the purpose of fulfilling their custom use case or to contribute bug fixes or improvements back to Remotion.
23
+ Permission is hereby granted, free of charge, to any person eligible for the "Free license", to use the software non-commercially or commercially for the purpose of creating videos and images and to modify the software to their own liking, for the purpose of fulfilling their custom use case or to contribute bug fixes or improvements back to Remotion.
24
24
 
25
25
  ### Disallowed use cases
26
26
 
27
- It is not allowed to copy or modify Remotion code for the purpose of selling, renting, licensing, relicensing, sublicensing your own derivate of Remotion.
27
+ It is not allowed to copy or modify Remotion code for the purpose of selling, renting, licensing, relicensing, or sublicensing your own derivate of Remotion.
28
28
 
29
29
  ### Warranty notice
30
30
 
31
- The software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the author or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.
31
+ The software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and non-infringement. In no event shall the author or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.
32
32
 
33
33
  ### Support
34
34
 
@@ -36,6 +36,6 @@ Support is provided on a best-we-can-do basis via GitHub Issues and Discord.
36
36
 
37
37
  ## Company license
38
38
 
39
- You are required to obtain a company license to use Remotion if you are not within the group of entities eligible for a free license. This license will enable you to use Remotion for the allowed use cases specified in the free license, and give you access to prioritized support.
39
+ You are required to obtain a company license to use Remotion if you are not within the group of entities eligible for a free license. This license will enable you to use Remotion for the allowed use cases specified in the free license, and give you access to prioritized support (read the [Support Policy](/docs/support)).
40
40
 
41
41
  Visit [companies.remotion.dev](https://companies.remotion.dev) for pricing and to buy a license.
package/dist/Lottie.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  /// <reference types="react" />
2
2
  import type { LottieProps } from './types';
3
- export declare const Lottie: ({ animationData, className, direction, loop, playbackRate, style, }: LottieProps) => JSX.Element;
3
+ export declare const Lottie: ({ animationData, className, direction, loop, playbackRate, style, onAnimationLoaded, }: LottieProps) => JSX.Element;
package/dist/Lottie.js CHANGED
@@ -11,7 +11,7 @@ const remotion_1 = require("remotion");
11
11
  const utils_1 = require("./utils");
12
12
  const validate_loop_1 = require("./validate-loop");
13
13
  const validate_playbackrate_1 = require("./validate-playbackrate");
14
- const Lottie = ({ animationData, className, direction, loop, playbackRate, style, }) => {
14
+ const Lottie = ({ animationData, className, direction, loop, playbackRate, style, onAnimationLoaded, }) => {
15
15
  if (typeof animationData !== 'object') {
16
16
  throw new Error('animationData should be provided as an object. If you only have the path to the JSON file, load it and pass it as animationData. See https://remotion.dev/docs/lottie/lottie#example for more information.');
17
17
  }
@@ -20,9 +20,12 @@ const Lottie = ({ animationData, className, direction, loop, playbackRate, style
20
20
  const animationRef = (0, react_1.useRef)();
21
21
  const lastFrameRef = (0, react_1.useRef)(null);
22
22
  const containerRef = (0, react_1.useRef)(null);
23
+ const onAnimationLoadedRef = (0, react_1.useRef)();
24
+ onAnimationLoadedRef.current = onAnimationLoaded;
23
25
  const [handle] = (0, react_1.useState)(() => (0, remotion_1.delayRender)('Waiting for Lottie animation to load'));
24
26
  const frame = (0, remotion_1.useCurrentFrame)();
25
27
  (0, react_1.useEffect)(() => {
28
+ var _a;
26
29
  if (!containerRef.current) {
27
30
  return;
28
31
  }
@@ -39,6 +42,7 @@ const Lottie = ({ animationData, className, direction, loop, playbackRate, style
39
42
  (0, remotion_1.continueRender)(handle);
40
43
  };
41
44
  animation.addEventListener('DOMLoaded', onComplete);
45
+ (_a = onAnimationLoadedRef.current) === null || _a === void 0 ? void 0 : _a.call(onAnimationLoadedRef, animation);
42
46
  return () => {
43
47
  lastFrameRef.current = animation.currentFrame;
44
48
  animation.removeEventListener('DOMLoaded', onComplete);
@@ -56,6 +60,7 @@ const Lottie = ({ animationData, className, direction, loop, playbackRate, style
56
60
  }
57
61
  }, [playbackRate]);
58
62
  (0, react_1.useEffect)(() => {
63
+ var _a;
59
64
  if (!animationRef.current) {
60
65
  return;
61
66
  }
@@ -67,6 +72,15 @@ const Lottie = ({ animationData, className, direction, loop, playbackRate, style
67
72
  totalFrames,
68
73
  });
69
74
  animationRef.current.goToAndStop(nextFrame, true);
75
+ const images = (_a = containerRef.current) === null || _a === void 0 ? void 0 : _a.querySelectorAll('image');
76
+ images.forEach((img) => {
77
+ const imgHandle = (0, remotion_1.delayRender)(`Waiting for lottie image with src="${img.href.baseVal}" to load`);
78
+ // https://stackoverflow.com/a/46839799
79
+ img.addEventListener('load', () => {
80
+ (0, remotion_1.continueRender)(imgHandle);
81
+ }, { once: true });
82
+ img.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', img.href.baseVal);
83
+ });
70
84
  }, [direction, frame, loop, playbackRate]);
71
85
  return (0, jsx_runtime_1.jsx)("div", { ref: containerRef, className: className, style: style });
72
86
  };
File without changes
File without changes
package/dist/index.d.ts CHANGED
File without changes
package/dist/index.js CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
package/dist/types.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import type { AnimationItem } from 'lottie-web';
1
2
  import type { CSSProperties } from 'react';
2
3
  export declare type LottieAnimationData = {
3
4
  fr: number;
@@ -30,4 +31,8 @@ export declare type LottieProps = {
30
31
  * CSS properties to apply to the container of the animation.
31
32
  */
32
33
  style?: CSSProperties;
34
+ /**
35
+ * Callback that gets invoked when new animation data has been initialized
36
+ */
37
+ onAnimationLoaded?: (animation: AnimationItem) => void;
33
38
  };
package/dist/types.js CHANGED
File without changes
package/dist/utils.d.ts CHANGED
File without changes
package/dist/utils.js CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/lottie",
3
- "version": "3.2.21",
3
+ "version": "3.2.23-ensure-ffmpeg.123+3ffa18f9e",
4
4
  "description": "Remotion Lottie",
5
5
  "main": "dist/index.js",
6
6
  "sideEffects": false,
@@ -27,7 +27,7 @@
27
27
  ],
28
28
  "license": "SEE LICENSE IN LICENSE.md",
29
29
  "dependencies": {
30
- "remotion": "3.2.21"
30
+ "remotion": "3.2.23-ensure-ffmpeg.123+3ffa18f9e"
31
31
  },
32
32
  "peerDependencies": {
33
33
  "lottie-web": "^5",
@@ -37,15 +37,15 @@
37
37
  "devDependencies": {
38
38
  "@jonny/eslint-config": "3.0.266",
39
39
  "@types/node": "^16.7.5",
40
- "@types/react": "18.0.1",
40
+ "@types/react": "18.0.23",
41
41
  "@types/react-dom": "18.0.0",
42
- "eslint": "8.13.0",
43
- "prettier": "^2.0.5",
42
+ "eslint": "8.25.0",
43
+ "prettier": "^2.7.1",
44
44
  "prettier-plugin-organize-imports": "^2.3.4",
45
45
  "react": "^18.0.0",
46
46
  "react-dom": "^18.0.0",
47
47
  "typescript": "^4.7.0",
48
- "vitest": "^0.18.0"
48
+ "vitest": "0.24.3"
49
49
  },
50
50
  "keywords": [
51
51
  "remotion",
@@ -58,5 +58,5 @@
58
58
  "publishConfig": {
59
59
  "access": "public"
60
60
  },
61
- "gitHead": "7236c416c1efcc6079ad262d6d5afa10e6775b81"
61
+ "gitHead": "3ffa18f9eafd4322373c51c92816c671b92e3258"
62
62
  }