@react-native-ohos/lottie-react-native 7.2.3-rc.1 → 7.2.3-rc.2
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 +200 -200
- package/README.OpenSource +10 -10
- package/README.md +12 -12
- package/harmony/lottie/BuildProfile.ets +20 -20
- package/harmony/lottie/build-profile.json5 +8 -8
- package/harmony/lottie/hvigorfile.ts +5 -5
- package/harmony/lottie/index.ets +5 -5
- package/harmony/lottie/oh-package.json5 +14 -14
- package/harmony/lottie/src/main/cpp/CMakeLists.txt +9 -9
- package/harmony/lottie/src/main/cpp/LottieAnimationViewPackage.h +12 -12
- package/harmony/lottie/src/main/cpp/generated/RNOH/generated/BaseLottieReactNativePackage.h +68 -68
- package/harmony/lottie/src/main/cpp/generated/RNOH/generated/components/LottieAnimationViewJSIBinder.h +43 -43
- package/harmony/lottie/src/main/cpp/generated/react/renderer/components/lottie_react_native/ComponentDescriptors.h +22 -22
- package/harmony/lottie/src/main/cpp/generated/react/renderer/components/lottie_react_native/EventEmitters.cpp +44 -44
- package/harmony/lottie/src/main/cpp/generated/react/renderer/components/lottie_react_native/EventEmitters.h +39 -39
- package/harmony/lottie/src/main/cpp/generated/react/renderer/components/lottie_react_native/Props.cpp +41 -41
- package/harmony/lottie/src/main/cpp/generated/react/renderer/components/lottie_react_native/Props.h +42 -42
- package/harmony/lottie/src/main/cpp/generated/react/renderer/components/lottie_react_native/ShadowNodes.cpp +19 -19
- package/harmony/lottie/src/main/cpp/generated/react/renderer/components/lottie_react_native/ShadowNodes.h +34 -34
- package/harmony/lottie/src/main/cpp/generated/react/renderer/components/lottie_react_native/States.cpp +18 -18
- package/harmony/lottie/src/main/cpp/generated/react/renderer/components/lottie_react_native/States.h +35 -35
- package/harmony/lottie/src/main/ets/LottieAnimationTools.ets +20 -20
- package/harmony/lottie/src/main/ets/LottieAnimationView.ets +396 -393
- package/harmony/lottie/src/main/ets/LottieAnimationViewPackage.ts +16 -16
- package/harmony/lottie/src/main/ets/LottieCompositionCache.ets +29 -29
- package/harmony/lottie/src/main/ets/common/TextUtils.ets +17 -17
- package/harmony/lottie/src/main/ets/generated/components/LottieAnimationView.ts +181 -181
- package/harmony/lottie/src/main/ets/generated/components/ts.ts +5 -5
- package/harmony/lottie/src/main/ets/generated/index.ets +5 -5
- package/harmony/lottie/src/main/ets/generated/ts.ts +6 -6
- package/harmony/lottie/src/main/ets/generated/turboModules/ts.ts +5 -5
- package/harmony/lottie/src/main/module.json5 +9 -9
- package/harmony/lottie/src/main/resources/base/element/string.json +8 -8
- package/harmony/lottie/src/main/resources/en_US/element/string.json +8 -8
- package/harmony/lottie/src/main/resources/zh_CN/element/string.json +8 -8
- package/harmony/lottie/ts.ts +4 -4
- package/harmony/lottie.har +0 -0
- package/lib/commonjs/LottieAnimationViewNativeComponent.js.map +1 -1
- package/lib/commonjs/codegenUtils.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/LottieAnimationViewNativeComponent.js.map +1 -1
- package/lib/module/codegenUtils.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/package.json +131 -131
- package/src/LottieAnimationViewNativeComponent.ts +77 -77
- package/src/codegenUtils.ts +8 -8
- package/src/index.tsx +7 -7
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["LottieView"],"sourceRoot":"
|
|
1
|
+
{"version":3,"names":["LottieView"],"sourceRoot":"..\\..\\src","sources":["index.tsx"],"mappings":"AAAA;AACA;AACA;;AAEA,SAASA,UAAU,QAAQ,oCAAoC;AAC/D,cAAc,+BAA+B;AAC7C,eAAeA,UAAU","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,131 +1,131 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@react-native-ohos/lottie-react-native",
|
|
3
|
-
"version": "7.2.3-rc.
|
|
4
|
-
"description": "c-api-foundation",
|
|
5
|
-
"main": "lib/commonjs/index.js",
|
|
6
|
-
"module": "lib/module/index.js",
|
|
7
|
-
"react-native": "src/index.tsx",
|
|
8
|
-
"types": "lib/typescript/index.d.ts",
|
|
9
|
-
"source": "src/index.tsx",
|
|
10
|
-
"sideEffects": false,
|
|
11
|
-
"files": [
|
|
12
|
-
"src",
|
|
13
|
-
"lib",
|
|
14
|
-
"harmony",
|
|
15
|
-
"!harmony/oh_modules",
|
|
16
|
-
"!harmony/**/build",
|
|
17
|
-
"!harmony/**/oh_modules",
|
|
18
|
-
"*.podspec",
|
|
19
|
-
"react-native.config.js"
|
|
20
|
-
],
|
|
21
|
-
"author": "Emilio Rodriguez <emiliorodriguez@gmail.com>",
|
|
22
|
-
"homepage": "https://github.com/airbnb/lottie-react-native#readme",
|
|
23
|
-
"harmony": {
|
|
24
|
-
"alias": "lottie-react-native"
|
|
25
|
-
},
|
|
26
|
-
"license": "Apache-2.0",
|
|
27
|
-
"keywords": [
|
|
28
|
-
"lottie",
|
|
29
|
-
"animation",
|
|
30
|
-
"react",
|
|
31
|
-
"react-native",
|
|
32
|
-
"keyframe"
|
|
33
|
-
],
|
|
34
|
-
"repository": "https://github.com/react-native-oh-library/lottie-react-native.git",
|
|
35
|
-
"bugs": {
|
|
36
|
-
"url": "https://github.com/react-native-oh-library/lottie-react-native/issues"
|
|
37
|
-
},
|
|
38
|
-
"publishConfig": {
|
|
39
|
-
"registry": "https://registry.npmjs.org/",
|
|
40
|
-
"access": "public"
|
|
41
|
-
},
|
|
42
|
-
"scripts": {
|
|
43
|
-
"build": "bob build",
|
|
44
|
-
"prepack": "npm run build",
|
|
45
|
-
"release": "release-it",
|
|
46
|
-
"lint:swift": "swiftlint ios",
|
|
47
|
-
"codegen-lib": "react-native codegen-lib-harmony --no-safety-check --npm-package-name lottie-react-native --cpp-output-path ./harmony/lottie/src/main/cpp/generated --ets-output-path ./harmony/lottie/src/main/ets/generated --arkts-components-spec-paths ./src/LottieAnimationViewNativeComponent.ts",
|
|
48
|
-
"lint-fix:swift": "swiftlint --fix ios"
|
|
49
|
-
},
|
|
50
|
-
"peerDependencies": {
|
|
51
|
-
"@dotlottie/react-player": "^1.6.1",
|
|
52
|
-
"@lottiefiles/dotlottie-react": "^0.6.5",
|
|
53
|
-
"@lottiefiles/react-lottie-player": "^3.5.3",
|
|
54
|
-
"react": "*",
|
|
55
|
-
"react-native": ">=0.46",
|
|
56
|
-
"react-native-windows": ">=0.63.x"
|
|
57
|
-
},
|
|
58
|
-
"peerDependenciesMeta": {
|
|
59
|
-
"@dotlottie/react-player": {
|
|
60
|
-
"optional": true
|
|
61
|
-
},
|
|
62
|
-
"@lottiefiles/dotlottie-react": {
|
|
63
|
-
"optional": true
|
|
64
|
-
},
|
|
65
|
-
"@lottiefiles/react-lottie-player": {
|
|
66
|
-
"optional": true
|
|
67
|
-
},
|
|
68
|
-
"react-native-windows": {
|
|
69
|
-
"optional": true
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
"devDependencies": {
|
|
73
|
-
"@react-native-community/eslint-config": "^3.1.0",
|
|
74
|
-
"@release-it/conventional-changelog": "^5.1.1",
|
|
75
|
-
"@types/react": "^18.2.12",
|
|
76
|
-
"@types/react-native": "^0.70.14",
|
|
77
|
-
"@typescript-eslint/eslint-plugin": "^5.59.11",
|
|
78
|
-
"@typescript-eslint/parser": "^5.59.11",
|
|
79
|
-
"eslint": "^8.43.0",
|
|
80
|
-
"eslint-config-prettier": "^8.8.0",
|
|
81
|
-
"eslint-plugin-prettier": "^4.2.1",
|
|
82
|
-
"metro-react-native-babel-preset": "^0.73.10",
|
|
83
|
-
"prettier": "^2.8.8",
|
|
84
|
-
"react": "18.3.1",
|
|
85
|
-
"react-native": "0.77.1",
|
|
86
|
-
"react-native-builder-bob": "^0.20.4",
|
|
87
|
-
"release-it": "^15.11.0",
|
|
88
|
-
"typescript": "^5.1.3",
|
|
89
|
-
"react-native-harmony-cli": "npm:@react-native-oh/react-native-harmony-cli@^0.0.27"
|
|
90
|
-
},
|
|
91
|
-
"contributors": [
|
|
92
|
-
{
|
|
93
|
-
"name": "Matin Zadeh Dolatabad",
|
|
94
|
-
"email": "me@matinzd.dev"
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
"name": "Parsa Nasirimehr",
|
|
98
|
-
"email": "p.nasirimehr@gmail.com"
|
|
99
|
-
}
|
|
100
|
-
],
|
|
101
|
-
"react-native-builder-bob": {
|
|
102
|
-
"source": "src",
|
|
103
|
-
"output": "lib",
|
|
104
|
-
"targets": [
|
|
105
|
-
"commonjs",
|
|
106
|
-
"module",
|
|
107
|
-
"typescript"
|
|
108
|
-
]
|
|
109
|
-
},
|
|
110
|
-
"release-it": {
|
|
111
|
-
"git": {
|
|
112
|
-
"commitMessage": "chore: release ${version}",
|
|
113
|
-
"tagName": "v${version}"
|
|
114
|
-
},
|
|
115
|
-
"npm": {
|
|
116
|
-
"publish": true
|
|
117
|
-
},
|
|
118
|
-
"github": {
|
|
119
|
-
"release": true
|
|
120
|
-
},
|
|
121
|
-
"plugins": {
|
|
122
|
-
"@release-it/conventional-changelog": {
|
|
123
|
-
"preset": "angular",
|
|
124
|
-
"infile": "../../CHANGELOG.md"
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
},
|
|
128
|
-
"dependencies": {
|
|
129
|
-
"lottie-react-native": "7.2.2"
|
|
130
|
-
}
|
|
131
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@react-native-ohos/lottie-react-native",
|
|
3
|
+
"version": "7.2.3-rc.2",
|
|
4
|
+
"description": "c-api-foundation",
|
|
5
|
+
"main": "lib/commonjs/index.js",
|
|
6
|
+
"module": "lib/module/index.js",
|
|
7
|
+
"react-native": "src/index.tsx",
|
|
8
|
+
"types": "lib/typescript/index.d.ts",
|
|
9
|
+
"source": "src/index.tsx",
|
|
10
|
+
"sideEffects": false,
|
|
11
|
+
"files": [
|
|
12
|
+
"src",
|
|
13
|
+
"lib",
|
|
14
|
+
"harmony",
|
|
15
|
+
"!harmony/oh_modules",
|
|
16
|
+
"!harmony/**/build",
|
|
17
|
+
"!harmony/**/oh_modules",
|
|
18
|
+
"*.podspec",
|
|
19
|
+
"react-native.config.js"
|
|
20
|
+
],
|
|
21
|
+
"author": "Emilio Rodriguez <emiliorodriguez@gmail.com>",
|
|
22
|
+
"homepage": "https://github.com/airbnb/lottie-react-native#readme",
|
|
23
|
+
"harmony": {
|
|
24
|
+
"alias": "lottie-react-native"
|
|
25
|
+
},
|
|
26
|
+
"license": "Apache-2.0",
|
|
27
|
+
"keywords": [
|
|
28
|
+
"lottie",
|
|
29
|
+
"animation",
|
|
30
|
+
"react",
|
|
31
|
+
"react-native",
|
|
32
|
+
"keyframe"
|
|
33
|
+
],
|
|
34
|
+
"repository": "https://github.com/react-native-oh-library/lottie-react-native.git",
|
|
35
|
+
"bugs": {
|
|
36
|
+
"url": "https://github.com/react-native-oh-library/lottie-react-native/issues"
|
|
37
|
+
},
|
|
38
|
+
"publishConfig": {
|
|
39
|
+
"registry": "https://registry.npmjs.org/",
|
|
40
|
+
"access": "public"
|
|
41
|
+
},
|
|
42
|
+
"scripts": {
|
|
43
|
+
"build": "bob build",
|
|
44
|
+
"prepack": "npm run build",
|
|
45
|
+
"release": "release-it",
|
|
46
|
+
"lint:swift": "swiftlint ios",
|
|
47
|
+
"codegen-lib": "react-native codegen-lib-harmony --no-safety-check --npm-package-name lottie-react-native --cpp-output-path ./harmony/lottie/src/main/cpp/generated --ets-output-path ./harmony/lottie/src/main/ets/generated --arkts-components-spec-paths ./src/LottieAnimationViewNativeComponent.ts",
|
|
48
|
+
"lint-fix:swift": "swiftlint --fix ios"
|
|
49
|
+
},
|
|
50
|
+
"peerDependencies": {
|
|
51
|
+
"@dotlottie/react-player": "^1.6.1",
|
|
52
|
+
"@lottiefiles/dotlottie-react": "^0.6.5",
|
|
53
|
+
"@lottiefiles/react-lottie-player": "^3.5.3",
|
|
54
|
+
"react": "*",
|
|
55
|
+
"react-native": ">=0.46",
|
|
56
|
+
"react-native-windows": ">=0.63.x"
|
|
57
|
+
},
|
|
58
|
+
"peerDependenciesMeta": {
|
|
59
|
+
"@dotlottie/react-player": {
|
|
60
|
+
"optional": true
|
|
61
|
+
},
|
|
62
|
+
"@lottiefiles/dotlottie-react": {
|
|
63
|
+
"optional": true
|
|
64
|
+
},
|
|
65
|
+
"@lottiefiles/react-lottie-player": {
|
|
66
|
+
"optional": true
|
|
67
|
+
},
|
|
68
|
+
"react-native-windows": {
|
|
69
|
+
"optional": true
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"devDependencies": {
|
|
73
|
+
"@react-native-community/eslint-config": "^3.1.0",
|
|
74
|
+
"@release-it/conventional-changelog": "^5.1.1",
|
|
75
|
+
"@types/react": "^18.2.12",
|
|
76
|
+
"@types/react-native": "^0.70.14",
|
|
77
|
+
"@typescript-eslint/eslint-plugin": "^5.59.11",
|
|
78
|
+
"@typescript-eslint/parser": "^5.59.11",
|
|
79
|
+
"eslint": "^8.43.0",
|
|
80
|
+
"eslint-config-prettier": "^8.8.0",
|
|
81
|
+
"eslint-plugin-prettier": "^4.2.1",
|
|
82
|
+
"metro-react-native-babel-preset": "^0.73.10",
|
|
83
|
+
"prettier": "^2.8.8",
|
|
84
|
+
"react": "18.3.1",
|
|
85
|
+
"react-native": "0.77.1",
|
|
86
|
+
"react-native-builder-bob": "^0.20.4",
|
|
87
|
+
"release-it": "^15.11.0",
|
|
88
|
+
"typescript": "^5.1.3",
|
|
89
|
+
"react-native-harmony-cli": "npm:@react-native-oh/react-native-harmony-cli@^0.0.27"
|
|
90
|
+
},
|
|
91
|
+
"contributors": [
|
|
92
|
+
{
|
|
93
|
+
"name": "Matin Zadeh Dolatabad",
|
|
94
|
+
"email": "me@matinzd.dev"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"name": "Parsa Nasirimehr",
|
|
98
|
+
"email": "p.nasirimehr@gmail.com"
|
|
99
|
+
}
|
|
100
|
+
],
|
|
101
|
+
"react-native-builder-bob": {
|
|
102
|
+
"source": "src",
|
|
103
|
+
"output": "lib",
|
|
104
|
+
"targets": [
|
|
105
|
+
"commonjs",
|
|
106
|
+
"module",
|
|
107
|
+
"typescript"
|
|
108
|
+
]
|
|
109
|
+
},
|
|
110
|
+
"release-it": {
|
|
111
|
+
"git": {
|
|
112
|
+
"commitMessage": "chore: release ${version}",
|
|
113
|
+
"tagName": "v${version}"
|
|
114
|
+
},
|
|
115
|
+
"npm": {
|
|
116
|
+
"publish": true
|
|
117
|
+
},
|
|
118
|
+
"github": {
|
|
119
|
+
"release": true
|
|
120
|
+
},
|
|
121
|
+
"plugins": {
|
|
122
|
+
"@release-it/conventional-changelog": {
|
|
123
|
+
"preset": "angular",
|
|
124
|
+
"infile": "../../CHANGELOG.md"
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
"dependencies": {
|
|
129
|
+
"lottie-react-native": "7.2.2"
|
|
130
|
+
}
|
|
131
|
+
}
|
|
@@ -1,78 +1,78 @@
|
|
|
1
|
-
// Copyright (c) 2025 Huawei Device Co., Ltd. All rights reserved
|
|
2
|
-
// Use of this source code is governed by a Apache-2.0 license that can be
|
|
3
|
-
// found in the LICENSE file.
|
|
4
|
-
|
|
5
|
-
import type {
|
|
6
|
-
DirectEventHandler,
|
|
7
|
-
Int32,
|
|
8
|
-
Double,
|
|
9
|
-
Float,
|
|
10
|
-
} from 'react-native/Libraries/Types/CodegenTypes';
|
|
11
|
-
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
|
|
12
|
-
import codegenNativeCommands from 'react-native/Libraries/Utilities/codegenNativeCommands';
|
|
13
|
-
import type {ProcessedColorValue,ViewProps, HostComponent } from 'react-native';
|
|
14
|
-
import type { UnsafeMixed } from './codegenUtils';
|
|
15
|
-
|
|
16
|
-
export type OnAnimationFinishEvent = Readonly<{
|
|
17
|
-
isCancelled: boolean;
|
|
18
|
-
}>;
|
|
19
|
-
|
|
20
|
-
export type AnimationFailureEvent = Readonly<{
|
|
21
|
-
error: string;
|
|
22
|
-
}>;
|
|
23
|
-
|
|
24
|
-
export type AnimationLoadedEvent = Readonly<{}>
|
|
25
|
-
|
|
26
|
-
type ColorFilterStruct = Readonly<{
|
|
27
|
-
keypath: string;
|
|
28
|
-
color: ProcessedColorValue;
|
|
29
|
-
}>;
|
|
30
|
-
|
|
31
|
-
export interface NativeProps extends ViewProps {
|
|
32
|
-
resizeMode?: string;
|
|
33
|
-
renderMode?: string;
|
|
34
|
-
sourceName?: string;
|
|
35
|
-
sourceJson?: string;
|
|
36
|
-
sourceURL?: string;
|
|
37
|
-
imageAssetsFolder?: string;
|
|
38
|
-
progress?: Float;
|
|
39
|
-
speed?: Double;
|
|
40
|
-
loop?: boolean;
|
|
41
|
-
autoPlay?: boolean;
|
|
42
|
-
enableMergePathsAndroidForKitKatAndAbove?: boolean;
|
|
43
|
-
hardwareAccelerationAndroid?: boolean;
|
|
44
|
-
cacheComposition?: boolean;
|
|
45
|
-
colorFilters?:UnsafeMixed<ReadonlyArray<ColorFilterStruct>>;
|
|
46
|
-
onAnimationFinish?: DirectEventHandler<
|
|
47
|
-
OnAnimationFinishEvent,
|
|
48
|
-
'onAnimationFinish'
|
|
49
|
-
>;
|
|
50
|
-
onAnimationFailure?: DirectEventHandler<
|
|
51
|
-
AnimationFailureEvent,
|
|
52
|
-
'onAnimationFailure'
|
|
53
|
-
>;
|
|
54
|
-
onAnimationLoaded?: DirectEventHandler<
|
|
55
|
-
AnimationLoadedEvent,
|
|
56
|
-
'onAnimationLoaded'
|
|
57
|
-
>;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
type LottieViewNativeComponentType = HostComponent<NativeProps>;
|
|
61
|
-
|
|
62
|
-
interface NativeCommands {
|
|
63
|
-
play: (
|
|
64
|
-
viewRef: React.ElementRef<LottieViewNativeComponentType>,
|
|
65
|
-
startFrame: Int32,
|
|
66
|
-
endFrame: Int32,
|
|
67
|
-
) => void;
|
|
68
|
-
reset: (viewRef: React.ElementRef<LottieViewNativeComponentType>) => void;
|
|
69
|
-
pause: (viewRef: React.ElementRef<LottieViewNativeComponentType>) => void;
|
|
70
|
-
resume: (viewRef: React.ElementRef<LottieViewNativeComponentType>) => void;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export const Commands: NativeCommands = codegenNativeCommands<NativeCommands>({
|
|
74
|
-
supportedCommands: ['play', 'reset', 'pause', 'resume'],
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
export default codegenNativeComponent<NativeProps>('LottieAnimationView') as HostComponent<NativeProps>;
|
|
1
|
+
// Copyright (c) 2025 Huawei Device Co., Ltd. All rights reserved
|
|
2
|
+
// Use of this source code is governed by a Apache-2.0 license that can be
|
|
3
|
+
// found in the LICENSE file.
|
|
4
|
+
|
|
5
|
+
import type {
|
|
6
|
+
DirectEventHandler,
|
|
7
|
+
Int32,
|
|
8
|
+
Double,
|
|
9
|
+
Float,
|
|
10
|
+
} from 'react-native/Libraries/Types/CodegenTypes';
|
|
11
|
+
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
|
|
12
|
+
import codegenNativeCommands from 'react-native/Libraries/Utilities/codegenNativeCommands';
|
|
13
|
+
import type {ProcessedColorValue,ViewProps, HostComponent } from 'react-native';
|
|
14
|
+
import type { UnsafeMixed } from './codegenUtils';
|
|
15
|
+
|
|
16
|
+
export type OnAnimationFinishEvent = Readonly<{
|
|
17
|
+
isCancelled: boolean;
|
|
18
|
+
}>;
|
|
19
|
+
|
|
20
|
+
export type AnimationFailureEvent = Readonly<{
|
|
21
|
+
error: string;
|
|
22
|
+
}>;
|
|
23
|
+
|
|
24
|
+
export type AnimationLoadedEvent = Readonly<{}>
|
|
25
|
+
|
|
26
|
+
type ColorFilterStruct = Readonly<{
|
|
27
|
+
keypath: string;
|
|
28
|
+
color: ProcessedColorValue;
|
|
29
|
+
}>;
|
|
30
|
+
|
|
31
|
+
export interface NativeProps extends ViewProps {
|
|
32
|
+
resizeMode?: string;
|
|
33
|
+
renderMode?: string;
|
|
34
|
+
sourceName?: string;
|
|
35
|
+
sourceJson?: string;
|
|
36
|
+
sourceURL?: string;
|
|
37
|
+
imageAssetsFolder?: string;
|
|
38
|
+
progress?: Float;
|
|
39
|
+
speed?: Double;
|
|
40
|
+
loop?: boolean;
|
|
41
|
+
autoPlay?: boolean;
|
|
42
|
+
enableMergePathsAndroidForKitKatAndAbove?: boolean;
|
|
43
|
+
hardwareAccelerationAndroid?: boolean;
|
|
44
|
+
cacheComposition?: boolean;
|
|
45
|
+
colorFilters?:UnsafeMixed<ReadonlyArray<ColorFilterStruct>>;
|
|
46
|
+
onAnimationFinish?: DirectEventHandler<
|
|
47
|
+
OnAnimationFinishEvent,
|
|
48
|
+
'onAnimationFinish'
|
|
49
|
+
>;
|
|
50
|
+
onAnimationFailure?: DirectEventHandler<
|
|
51
|
+
AnimationFailureEvent,
|
|
52
|
+
'onAnimationFailure'
|
|
53
|
+
>;
|
|
54
|
+
onAnimationLoaded?: DirectEventHandler<
|
|
55
|
+
AnimationLoadedEvent,
|
|
56
|
+
'onAnimationLoaded'
|
|
57
|
+
>;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
type LottieViewNativeComponentType = HostComponent<NativeProps>;
|
|
61
|
+
|
|
62
|
+
interface NativeCommands {
|
|
63
|
+
play: (
|
|
64
|
+
viewRef: React.ElementRef<LottieViewNativeComponentType>,
|
|
65
|
+
startFrame: Int32,
|
|
66
|
+
endFrame: Int32,
|
|
67
|
+
) => void;
|
|
68
|
+
reset: (viewRef: React.ElementRef<LottieViewNativeComponentType>) => void;
|
|
69
|
+
pause: (viewRef: React.ElementRef<LottieViewNativeComponentType>) => void;
|
|
70
|
+
resume: (viewRef: React.ElementRef<LottieViewNativeComponentType>) => void;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export const Commands: NativeCommands = codegenNativeCommands<NativeCommands>({
|
|
74
|
+
supportedCommands: ['play', 'reset', 'pause', 'resume'],
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
export default codegenNativeComponent<NativeProps>('LottieAnimationView') as HostComponent<NativeProps>;
|
|
78
78
|
|
package/src/codegenUtils.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
// Copyright (c) 2025 Huawei Device Co., Ltd. All rights reserved
|
|
2
|
-
// Use of this source code is governed by a Apache-2.0 license that can be
|
|
3
|
-
// found in the LICENSE file.
|
|
4
|
-
|
|
5
|
-
export type UnsafeMixed<T> = T;
|
|
6
|
-
|
|
7
|
-
// Fabric doesn't support optional props, so we need to use UnsafeMixed
|
|
8
|
-
// https://github.com/rnmapbox/maps/pull/3082#discussion_r1339858750
|
|
1
|
+
// Copyright (c) 2025 Huawei Device Co., Ltd. All rights reserved
|
|
2
|
+
// Use of this source code is governed by a Apache-2.0 license that can be
|
|
3
|
+
// found in the LICENSE file.
|
|
4
|
+
|
|
5
|
+
export type UnsafeMixed<T> = T;
|
|
6
|
+
|
|
7
|
+
// Fabric doesn't support optional props, so we need to use UnsafeMixed
|
|
8
|
+
// https://github.com/rnmapbox/maps/pull/3082#discussion_r1339858750
|
|
9
9
|
export type OptionalProp<T> = UnsafeMixed<T>;
|
package/src/index.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
// Copyright (c) 2025 Huawei Device Co., Ltd. All rights reserved
|
|
2
|
-
// Use of this source code is governed by a Apache-2.0 license that can be
|
|
3
|
-
// found in the LICENSE file.
|
|
4
|
-
|
|
5
|
-
import { LottieView } from 'lottie-react-native/src/LottieView';
|
|
6
|
-
export * from 'lottie-react-native/src/types';
|
|
7
|
-
export default LottieView;
|
|
1
|
+
// Copyright (c) 2025 Huawei Device Co., Ltd. All rights reserved
|
|
2
|
+
// Use of this source code is governed by a Apache-2.0 license that can be
|
|
3
|
+
// found in the LICENSE file.
|
|
4
|
+
|
|
5
|
+
import { LottieView } from 'lottie-react-native/src/LottieView';
|
|
6
|
+
export * from 'lottie-react-native/src/types';
|
|
7
|
+
export default LottieView;
|