@remotion/lottie 4.0.364 → 4.0.365
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/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"url": "https://github.com/remotion-dev/remotion/tree/main/packages/lottie"
|
|
4
4
|
},
|
|
5
5
|
"name": "@remotion/lottie",
|
|
6
|
-
"version": "4.0.
|
|
6
|
+
"version": "4.0.365",
|
|
7
7
|
"description": "Include Lottie animations in Remotion",
|
|
8
8
|
"main": "dist/cjs/index.js",
|
|
9
9
|
"types": "dist/cjs/index.d.ts",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
],
|
|
26
26
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"remotion": "4.0.
|
|
28
|
+
"remotion": "4.0.365"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
31
|
"lottie-web": "^5",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"react": "19.0.0",
|
|
46
46
|
"react-dom": "19.0.0",
|
|
47
47
|
"lottie-web": "5.13.0",
|
|
48
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
48
|
+
"@remotion/eslint-config-internal": "4.0.365",
|
|
49
49
|
"eslint": "9.19.0"
|
|
50
50
|
},
|
|
51
51
|
"keywords": [
|
package/bundle.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import {build} from 'bun';
|
|
2
|
-
|
|
3
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
4
|
-
throw new Error('This script must be run using NODE_ENV=production');
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
const output = await build({
|
|
8
|
-
entrypoints: ['src/index.ts'],
|
|
9
|
-
naming: '[name].mjs',
|
|
10
|
-
external: [
|
|
11
|
-
'react/jsx-runtime',
|
|
12
|
-
'react',
|
|
13
|
-
'remotion',
|
|
14
|
-
'remotion/no-react',
|
|
15
|
-
'lottie-web',
|
|
16
|
-
],
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
const [file] = output.outputs;
|
|
20
|
-
const text = await file.text();
|
|
21
|
-
|
|
22
|
-
await Bun.write('dist/esm/index.mjs', text);
|
|
23
|
-
|
|
24
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const bun_test_1 = require("bun:test");
|
|
7
|
-
const node_fs_1 = __importDefault(require("node:fs"));
|
|
8
|
-
const node_path_1 = __importDefault(require("node:path"));
|
|
9
|
-
const get_lottie_metadata_1 = require("../get-lottie-metadata");
|
|
10
|
-
(0, bun_test_1.test)('Should be able to get Lottie metadata', () => {
|
|
11
|
-
const file = node_fs_1.default.readFileSync(node_path_1.default.join(__dirname, 'example.json'), 'utf-8');
|
|
12
|
-
const parsed = JSON.parse(file);
|
|
13
|
-
(0, bun_test_1.expect)((0, get_lottie_metadata_1.getLottieMetadata)(parsed)).toEqual({
|
|
14
|
-
durationInFrames: 90,
|
|
15
|
-
durationInSeconds: 3.0030030030030037,
|
|
16
|
-
fps: 29.9700012207031,
|
|
17
|
-
height: 1080,
|
|
18
|
-
width: 1920,
|
|
19
|
-
});
|
|
20
|
-
});
|
|
21
|
-
(0, bun_test_1.test)('Should return null if invalid Lottie file', () => {
|
|
22
|
-
// @ts-expect-error
|
|
23
|
-
(0, bun_test_1.expect)((0, get_lottie_metadata_1.getLottieMetadata)({})).toEqual(null);
|
|
24
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const bun_test_1 = require("bun:test");
|
|
4
|
-
const utils_1 = require("../utils");
|
|
5
|
-
(0, bun_test_1.describe)('getNextFrame', () => {
|
|
6
|
-
(0, bun_test_1.describe)('when loop is falsy', () => {
|
|
7
|
-
(0, bun_test_1.it)('returns the current frame if smaller than total frames', () => {
|
|
8
|
-
(0, bun_test_1.expect)((0, utils_1.getLottieFrame)({ currentFrame: 23, totalFrames: 56 })).toBe(23);
|
|
9
|
-
});
|
|
10
|
-
(0, bun_test_1.it)('returns the last frame if current frame is bigger than total frames', () => {
|
|
11
|
-
(0, bun_test_1.expect)((0, utils_1.getLottieFrame)({ currentFrame: 23, totalFrames: 20 })).toBe(19);
|
|
12
|
-
});
|
|
13
|
-
(0, bun_test_1.it)('freezes on last valid frame to prevent animation disappearing', () => {
|
|
14
|
-
// This test specifically validates the fix for the issue where
|
|
15
|
-
// non-looping animations disappear after playing once
|
|
16
|
-
(0, bun_test_1.expect)((0, utils_1.getLottieFrame)({ currentFrame: 100, totalFrames: 30 })).toBe(29);
|
|
17
|
-
(0, bun_test_1.expect)((0, utils_1.getLottieFrame)({ currentFrame: 1000, totalFrames: 60 })).toBe(59);
|
|
18
|
-
});
|
|
19
|
-
});
|
|
20
|
-
(0, bun_test_1.describe)('when loop is truthy', () => {
|
|
21
|
-
(0, bun_test_1.it)('returns the current frame if smaller than total frames', () => {
|
|
22
|
-
(0, bun_test_1.expect)((0, utils_1.getLottieFrame)({ currentFrame: 23, totalFrames: 56, loop: true })).toBe(23);
|
|
23
|
-
});
|
|
24
|
-
(0, bun_test_1.it)('returns the modulo if current frame is bigger than total frames', () => {
|
|
25
|
-
(0, bun_test_1.expect)((0, utils_1.getLottieFrame)({ currentFrame: 23, totalFrames: 20, loop: true })).toBe(3);
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
(0, bun_test_1.describe)('when direction is reverse and loop is falsy', () => {
|
|
29
|
-
(0, bun_test_1.it)('returns the correct frame if current frame is smaller than total frames', () => {
|
|
30
|
-
(0, bun_test_1.expect)((0, utils_1.getLottieFrame)({
|
|
31
|
-
currentFrame: 15,
|
|
32
|
-
totalFrames: 20,
|
|
33
|
-
direction: 'backward',
|
|
34
|
-
})).toBe(5);
|
|
35
|
-
});
|
|
36
|
-
(0, bun_test_1.it)('returns frame zero if current frame is bigger than total frames', () => {
|
|
37
|
-
(0, bun_test_1.expect)((0, utils_1.getLottieFrame)({
|
|
38
|
-
currentFrame: 23,
|
|
39
|
-
totalFrames: 20,
|
|
40
|
-
direction: 'backward',
|
|
41
|
-
})).toBe(1);
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
(0, bun_test_1.describe)('when direction is reverse and loop is truthy', () => {
|
|
45
|
-
(0, bun_test_1.it)('returns the correct frame if current frame is smaller than total frames', () => {
|
|
46
|
-
(0, bun_test_1.expect)((0, utils_1.getLottieFrame)({
|
|
47
|
-
currentFrame: 15,
|
|
48
|
-
totalFrames: 20,
|
|
49
|
-
direction: 'backward',
|
|
50
|
-
loop: true,
|
|
51
|
-
})).toBe(5);
|
|
52
|
-
});
|
|
53
|
-
(0, bun_test_1.it)('returns (total-overflow) if current frame is bigger than total frames', () => {
|
|
54
|
-
(0, bun_test_1.expect)((0, utils_1.getLottieFrame)({
|
|
55
|
-
currentFrame: 23,
|
|
56
|
-
totalFrames: 20,
|
|
57
|
-
direction: 'backward',
|
|
58
|
-
loop: true,
|
|
59
|
-
})).toBe(17);
|
|
60
|
-
});
|
|
61
|
-
});
|
|
62
|
-
});
|