@amazon-devices/lottie-react-native 2.0.1758683737
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 +7 -0
- package/SystemBundles/90296ccfe5ff2db2f9fe68a18eca092f8b7c17d1125cfafc612d18788fe9bce6.bundle +10322 -0
- package/SystemBundles/90296ccfe5ff2db2f9fe68a18eca092f8b7c17d1125cfafc612d18788fe9bce6.map +1 -0
- package/SystemModules/amzn__lottie-react-native-2.modules.txt +13 -0
- package/SystemModules/amzn__lottie-react-native-2.private.modules.txt +92 -0
- package/SystemModules/keplerscript-system-bundle-config.json +7 -0
- package/THIRD_PARTY_NOTICES.txt +640 -0
- package/android/build.gradle +120 -0
- package/android/gradle.properties +27 -0
- package/android/src/main/AndroidManifest.xml +6 -0
- package/android/src/main/java/com/airbnb/android/react/lottie/LottieAnimationViewManagerImpl.kt +260 -0
- package/android/src/main/java/com/airbnb/android/react/lottie/LottieAnimationViewPropertyManager.kt +156 -0
- package/android/src/main/java/com/airbnb/android/react/lottie/LottiePackage.kt +18 -0
- package/android/src/newarch/com/airbnb/android/react/lottie/LottieAnimationViewManager.kt +219 -0
- package/android/src/oldarch/com/airbnb/android/react/lottie/LottieAnimationViewManager.kt +187 -0
- package/ios/Fabric/LottieAnimationViewComponentView.h +28 -0
- package/ios/Fabric/LottieAnimationViewComponentView.mm +140 -0
- package/ios/Fabric/LottieContainerView.h +33 -0
- package/ios/Fabric/RNLottieFabricConversions.h +29 -0
- package/ios/LottieReactNative/AnimationViewManagerModule.swift +88 -0
- package/ios/LottieReactNative/Bridging.h +4 -0
- package/ios/LottieReactNative/ContainerView.swift +281 -0
- package/ios/LottieReactNative/LRNAnimationViewManagerObjC.m +25 -0
- package/ios/LottieReactNative/PlatformColor.swift +31 -0
- package/ios/LottieReactNative/RCTConvert+Lottie.h +7 -0
- package/ios/LottieReactNative/RCTConvert+Lottie.m +24 -0
- package/ios/LottieReactNative.xcodeproj/project.pbxproj +449 -0
- package/ios/LottieReactNative.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/ios/LottieReactNative.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/kepler-compatibility.json +8 -0
- package/kepler-transformed-package-info.json +3 -0
- package/lib/commonjs/LottieView.js +207 -0
- package/lib/commonjs/LottieView.js.map +1 -0
- package/lib/commonjs/LottieView.types.js +6 -0
- package/lib/commonjs/LottieView.types.js.map +1 -0
- package/lib/commonjs/index.js +9 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/specs/LottieAnimationViewNativeComponent.js +97 -0
- package/lib/commonjs/specs/LottieAnimationViewNativeComponent.js.map +1 -0
- package/lib/module/LottieView.js +201 -0
- package/lib/module/LottieView.js.map +1 -0
- package/lib/module/LottieView.types.js +2 -0
- package/lib/module/LottieView.types.js.map +1 -0
- package/lib/module/index.js +3 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/specs/LottieAnimationViewNativeComponent.js +91 -0
- package/lib/module/specs/LottieAnimationViewNativeComponent.js.map +1 -0
- package/lib/typescript/LottieView.d.ts +27 -0
- package/lib/typescript/LottieView.types.d.ts +206 -0
- package/lib/typescript/index.d.ts +2 -0
- package/lib/typescript/specs/LottieAnimationViewNativeComponent.d.ts +61 -0
- package/lottie-react-native.podspec +44 -0
- package/package.json +1 -0
- package/react-native.config.js +32 -0
- package/src/LottieView.tsx +257 -0
- package/src/LottieView.types.ts +275 -0
- package/src/__tests__/__snapshots__/validate-public-api.test.js.snap +248 -0
- package/src/__tests__/validate-public-api.test.js +33 -0
- package/src/index.tsx +2 -0
- package/src/specs/LottieAnimationViewNativeComponent.ts +170 -0
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Portions of this file are copyright (c) 2023 Amazon.com, Inc. or its affiliates. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* PORTIONS OF THIS FILE ARE AMAZON PROPRIETARY/CONFIDENTIAL. USE IS SUBJECT TO LICENSE TERMS.
|
|
5
|
+
*
|
|
6
|
+
* Amazon modifications are indicated by [amznmod_* comments].
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/*
|
|
10
|
+
* Changelog:
|
|
11
|
+
* Set up lottie-react-native package to build for Kepler
|
|
12
|
+
* Add accessibility props
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import type {
|
|
16
|
+
StyleProp,
|
|
17
|
+
ViewStyle,
|
|
18
|
+
LayoutChangeEvent,
|
|
19
|
+
Animated,
|
|
20
|
+
AccessibilityProps,
|
|
21
|
+
} from 'react-native';
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Serialized animation as generated from After Effects
|
|
25
|
+
*/
|
|
26
|
+
export interface AnimationObject {
|
|
27
|
+
v: string;
|
|
28
|
+
fr: number;
|
|
29
|
+
ip: number;
|
|
30
|
+
op: number;
|
|
31
|
+
w: number;
|
|
32
|
+
h: number;
|
|
33
|
+
nm?: string;
|
|
34
|
+
ddd?: number;
|
|
35
|
+
assets: any[];
|
|
36
|
+
layers: any[];
|
|
37
|
+
markers?: any[];
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
type ColorFilter = {
|
|
41
|
+
keypath: string;
|
|
42
|
+
color: string;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
type TextFilterIOS = {
|
|
46
|
+
keypath: string;
|
|
47
|
+
text: string;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
type TextFilterAndroid = {
|
|
51
|
+
find: string;
|
|
52
|
+
replace: string;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
// amznmod_react - TextFilterKepler type
|
|
56
|
+
type TextFilterKepler = {
|
|
57
|
+
keypath: string;
|
|
58
|
+
text: string;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
// Animated.AnimatedInterpolation has been converted to a generic type
|
|
62
|
+
// in @types/react-native 0.70. This way we can maintain compatibility
|
|
63
|
+
// with all versions of @types/react-native`
|
|
64
|
+
type AnimatedInterpolation = ReturnType<Animated.Value['interpolate']>;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Properties of the AnimatedLottieView component
|
|
68
|
+
*/
|
|
69
|
+
// amznmod_react LottieView supports all AccessibilityProps
|
|
70
|
+
export interface AnimatedLottieViewProps extends AccessibilityProps{
|
|
71
|
+
/**
|
|
72
|
+
* The source of animation. Can be referenced as a local asset by a string, or remotely
|
|
73
|
+
* with an object with a `uri` property, or it can be an actual JS object of an
|
|
74
|
+
* animation, obtained (for example) with something like
|
|
75
|
+
* `require('../path/to/animation.json')`
|
|
76
|
+
*/
|
|
77
|
+
source: string | AnimationObject | { uri: string };
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* A number between 0 and 1, or an `Animated` number between 0 and 1. This number
|
|
81
|
+
* represents the normalized progress of the animation. If you update this prop, the
|
|
82
|
+
* animation will correspondingly update to the frame at that progress value. This
|
|
83
|
+
* prop is not required if you are using the imperative API.
|
|
84
|
+
*/
|
|
85
|
+
progress?: number | Animated.Value | AnimatedInterpolation;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* The speed the animation will progress. This only affects the imperative API. The
|
|
89
|
+
* default value is 1.
|
|
90
|
+
*/
|
|
91
|
+
speed?: number;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* The duration of the animation in ms. Takes precedence over speed when set.
|
|
95
|
+
* This only works when source is an actual JS object of an animation.
|
|
96
|
+
*/
|
|
97
|
+
duration?: number;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* A boolean flag indicating whether or not the animation should loop.
|
|
101
|
+
*/
|
|
102
|
+
loop?: boolean;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Style attributes for the view, as expected in a standard `View`:
|
|
106
|
+
* http://facebook.github.io/react-native/releases/0.39/docs/view.html#style
|
|
107
|
+
*
|
|
108
|
+
* **CAVEAT: border styling is not supported.**
|
|
109
|
+
*/
|
|
110
|
+
style?: StyleProp<ViewStyle>;
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Determines how to resize the animated view when the frame doesn't match the raw image
|
|
114
|
+
* dimensions.
|
|
115
|
+
*
|
|
116
|
+
* Refer to https://facebook.github.io/react-native/docs/image.html#resizemode
|
|
117
|
+
*/
|
|
118
|
+
resizeMode?: 'cover' | 'contain' | 'center';
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Determines how Lottie should render
|
|
122
|
+
* Refer to LottieAnimationView#setRenderMode(RenderMode) for more information.
|
|
123
|
+
*/
|
|
124
|
+
renderMode?: 'AUTOMATIC' | 'HARDWARE' | 'SOFTWARE';
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* A boolean flag indicating whether or not the animation should start automatically when
|
|
128
|
+
* mounted. This only affects the imperative API.
|
|
129
|
+
*/
|
|
130
|
+
autoPlay?: boolean;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* A boolean flag indicating whether or not the animation should size itself automatically
|
|
134
|
+
* according to the width in the animation's JSON. This only works when source is an actual
|
|
135
|
+
* JS object of an animation.
|
|
136
|
+
*/
|
|
137
|
+
autoSize?: boolean;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* A callback function which will be called when animation is finished. Note that this
|
|
141
|
+
* callback will be called only when `loop` is set to false.
|
|
142
|
+
*/
|
|
143
|
+
onAnimationFinish?: (isCancelled: boolean) => void;
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* A callback function which will be called when the view has been laid out.
|
|
147
|
+
*/
|
|
148
|
+
onLayout?: (event: LayoutChangeEvent) => void;
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* An array of layers you want to override its color filter.
|
|
152
|
+
*/
|
|
153
|
+
colorFilters?: Array<ColorFilter>;
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* A string to identify the component during testing.
|
|
157
|
+
*/
|
|
158
|
+
testID?: string;
|
|
159
|
+
|
|
160
|
+
// Android Props
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* A boolean flag to enable merge patching.
|
|
164
|
+
* @platform android
|
|
165
|
+
*/
|
|
166
|
+
enableMergePathsAndroidForKitKatAndAbove?: boolean;
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* A boolean flag indicating whether or not the animation should caching. Defaults to true.
|
|
170
|
+
* Refer to LottieAnimationView#setCacheComposition(boolean) for more information.
|
|
171
|
+
*
|
|
172
|
+
* @platform android
|
|
173
|
+
*/
|
|
174
|
+
cacheComposition?: boolean;
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* An array of objects denoting text values to find and replace.
|
|
178
|
+
*
|
|
179
|
+
* @platform android
|
|
180
|
+
*/
|
|
181
|
+
textFiltersAndroid?: Array<TextFilterAndroid>;
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Relative folder inside of assets containing image files to be animated.
|
|
185
|
+
* Make sure that the images that bodymovin export are in that folder with their names unchanged (should be img_#).
|
|
186
|
+
* Refer to https://github.com/airbnb/lottie-android#image-support for more details.
|
|
187
|
+
*
|
|
188
|
+
* @platform android
|
|
189
|
+
*/
|
|
190
|
+
imageAssetsFolder?: string;
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Uses hardware acceleration to perform the animation. This should only
|
|
194
|
+
* be used for animations where your width and height are equal to the composition width
|
|
195
|
+
* and height, e.g. you are not scaling the animation.
|
|
196
|
+
*
|
|
197
|
+
* @platform android
|
|
198
|
+
*/
|
|
199
|
+
hardwareAccelerationAndroid?: boolean;
|
|
200
|
+
|
|
201
|
+
// iOS Props
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* An array of objects denoting text layers by KeyPath and a new string value.
|
|
205
|
+
*
|
|
206
|
+
* @platform ios
|
|
207
|
+
*/
|
|
208
|
+
textFiltersIOS?: Array<TextFilterIOS>;
|
|
209
|
+
|
|
210
|
+
// Windows Props
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* A boolean flag to enable use of platform-level looping on Windows. This improves loop smoothness,
|
|
214
|
+
* but onAnimationLoop will not fire and changing the loop prop will restart playback.
|
|
215
|
+
*
|
|
216
|
+
* @platform windows
|
|
217
|
+
*/
|
|
218
|
+
useNativeLooping?: boolean;
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* A callback function which will be called when the animation loops.
|
|
222
|
+
*
|
|
223
|
+
* @platform windows
|
|
224
|
+
*/
|
|
225
|
+
onAnimationLoop?: () => void;
|
|
226
|
+
|
|
227
|
+
// amznmod_react - add onAnimationLoad callback
|
|
228
|
+
/**
|
|
229
|
+
* A callback function which will be called when animation json load is finished.
|
|
230
|
+
*
|
|
231
|
+
* @platform kepler
|
|
232
|
+
*/
|
|
233
|
+
onAnimationLoad?: () => void;
|
|
234
|
+
|
|
235
|
+
// PROJ*-136246 - deprecate onAnimationJsonLoad in MR33
|
|
236
|
+
// amznmod_react - add onAnimationJsonLoad callback
|
|
237
|
+
/**
|
|
238
|
+
* A callback function which will be called when animation json load is finished.
|
|
239
|
+
*
|
|
240
|
+
* @platform kepler
|
|
241
|
+
*/
|
|
242
|
+
onAnimationJsonLoad?: () => void;
|
|
243
|
+
|
|
244
|
+
// amznmod_react - add onAnimationPlay callback
|
|
245
|
+
/**
|
|
246
|
+
* A callback function which will be called when animation play is started.
|
|
247
|
+
*
|
|
248
|
+
* @platform kepler
|
|
249
|
+
*/
|
|
250
|
+
onAnimationPlay?: () => void;
|
|
251
|
+
|
|
252
|
+
// amznmod_react - add onAnimationPause callback
|
|
253
|
+
/**
|
|
254
|
+
* A callback function which will be called when animation is paused.
|
|
255
|
+
*
|
|
256
|
+
* @platform kepler
|
|
257
|
+
*/
|
|
258
|
+
onAnimationPause?: () => void;
|
|
259
|
+
|
|
260
|
+
// amznmod_react - add onAnimationResume callback
|
|
261
|
+
/**
|
|
262
|
+
* A callback function which will be called when animation is resumed.
|
|
263
|
+
*
|
|
264
|
+
* @platform kepler
|
|
265
|
+
*/
|
|
266
|
+
onAnimationResume?: () => void;
|
|
267
|
+
|
|
268
|
+
// amznmod_react - add textFiltersKepler prop
|
|
269
|
+
/**
|
|
270
|
+
* An array of objects denoting text values to find and replace.
|
|
271
|
+
*
|
|
272
|
+
* @platform kepler
|
|
273
|
+
*/
|
|
274
|
+
textFiltersKepler?: Array<TextFilterKepler>;
|
|
275
|
+
}
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`public API should not change unintentionally lib/typescript/LottieView.d.ts: LottieView.d.ts 1`] = `
|
|
4
|
+
"import React from 'react';
|
|
5
|
+
import { NativeSyntheticEvent } from 'react-native';
|
|
6
|
+
import type { AnimatedLottieViewProps } from './LottieView.types';
|
|
7
|
+
import NativeLottieAnimationView from './specs/LottieAnimationViewNativeComponent';
|
|
8
|
+
/**
|
|
9
|
+
* View hosting the lottie animation.
|
|
10
|
+
*/
|
|
11
|
+
export declare class AnimatedLottieView extends React.PureComponent<AnimatedLottieViewProps, {}> {
|
|
12
|
+
static defaultProps: AnimatedLottieViewProps;
|
|
13
|
+
_lottieAnimationViewRef: React.ElementRef<typeof NativeLottieAnimationView> | undefined;
|
|
14
|
+
constructor(props: AnimatedLottieViewProps);
|
|
15
|
+
componentDidUpdate(prevProps: AnimatedLottieViewProps): void;
|
|
16
|
+
play(startFrame?: number, endFrame?: number): void;
|
|
17
|
+
reset(): void;
|
|
18
|
+
pause(): void;
|
|
19
|
+
resume(): void;
|
|
20
|
+
onAnimationFinish: (evt: NativeSyntheticEvent<{
|
|
21
|
+
isCancelled: boolean;
|
|
22
|
+
}>) => void;
|
|
23
|
+
onAnimationLoad: () => void;
|
|
24
|
+
onAnimationJsonLoad: () => void;
|
|
25
|
+
onAnimationPlay: () => void;
|
|
26
|
+
onAnimationPause: () => void;
|
|
27
|
+
onAnimationResume: () => void;
|
|
28
|
+
_captureRef(ref: React.ElementRef<typeof NativeLottieAnimationView>): void;
|
|
29
|
+
render(): React.ReactNode;
|
|
30
|
+
}
|
|
31
|
+
"
|
|
32
|
+
`;
|
|
33
|
+
|
|
34
|
+
exports[`public API should not change unintentionally lib/typescript/LottieView.types.d.ts: LottieView.types.d.ts 1`] = `
|
|
35
|
+
"import type { StyleProp, ViewStyle, LayoutChangeEvent, Animated, AccessibilityProps } from 'react-native';
|
|
36
|
+
/**
|
|
37
|
+
* Serialized animation as generated from After Effects
|
|
38
|
+
*/
|
|
39
|
+
export interface AnimationObject {
|
|
40
|
+
v: string;
|
|
41
|
+
fr: number;
|
|
42
|
+
ip: number;
|
|
43
|
+
op: number;
|
|
44
|
+
w: number;
|
|
45
|
+
h: number;
|
|
46
|
+
nm?: string;
|
|
47
|
+
ddd?: number;
|
|
48
|
+
assets: any[];
|
|
49
|
+
layers: any[];
|
|
50
|
+
markers?: any[];
|
|
51
|
+
}
|
|
52
|
+
type ColorFilter = {
|
|
53
|
+
keypath: string;
|
|
54
|
+
color: string;
|
|
55
|
+
};
|
|
56
|
+
type TextFilterIOS = {
|
|
57
|
+
keypath: string;
|
|
58
|
+
text: string;
|
|
59
|
+
};
|
|
60
|
+
type TextFilterAndroid = {
|
|
61
|
+
find: string;
|
|
62
|
+
replace: string;
|
|
63
|
+
};
|
|
64
|
+
type TextFilterKepler = {
|
|
65
|
+
keypath: string;
|
|
66
|
+
text: string;
|
|
67
|
+
};
|
|
68
|
+
type AnimatedInterpolation = ReturnType<Animated.Value['interpolate']>;
|
|
69
|
+
/**
|
|
70
|
+
* Properties of the AnimatedLottieView component
|
|
71
|
+
*/
|
|
72
|
+
export interface AnimatedLottieViewProps extends AccessibilityProps {
|
|
73
|
+
/**
|
|
74
|
+
* The source of animation. Can be referenced as a local asset by a string, or remotely
|
|
75
|
+
* with an object with a \`uri\` property, or it can be an actual JS object of an
|
|
76
|
+
* animation, obtained (for example) with something like
|
|
77
|
+
* \`require('../path/to/animation.json')\`
|
|
78
|
+
*/
|
|
79
|
+
source: string | AnimationObject | {
|
|
80
|
+
uri: string;
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* A number between 0 and 1, or an \`Animated\` number between 0 and 1. This number
|
|
84
|
+
* represents the normalized progress of the animation. If you update this prop, the
|
|
85
|
+
* animation will correspondingly update to the frame at that progress value. This
|
|
86
|
+
* prop is not required if you are using the imperative API.
|
|
87
|
+
*/
|
|
88
|
+
progress?: number | Animated.Value | AnimatedInterpolation;
|
|
89
|
+
/**
|
|
90
|
+
* The speed the animation will progress. This only affects the imperative API. The
|
|
91
|
+
* default value is 1.
|
|
92
|
+
*/
|
|
93
|
+
speed?: number;
|
|
94
|
+
/**
|
|
95
|
+
* The duration of the animation in ms. Takes precedence over speed when set.
|
|
96
|
+
* This only works when source is an actual JS object of an animation.
|
|
97
|
+
*/
|
|
98
|
+
duration?: number;
|
|
99
|
+
/**
|
|
100
|
+
* A boolean flag indicating whether or not the animation should loop.
|
|
101
|
+
*/
|
|
102
|
+
loop?: boolean;
|
|
103
|
+
/**
|
|
104
|
+
* Style attributes for the view, as expected in a standard \`View\`:
|
|
105
|
+
* http://facebook.github.io/react-native/releases/0.39/docs/view.html#style
|
|
106
|
+
*
|
|
107
|
+
* **CAVEAT: border styling is not supported.**
|
|
108
|
+
*/
|
|
109
|
+
style?: StyleProp<ViewStyle>;
|
|
110
|
+
/**
|
|
111
|
+
* Determines how to resize the animated view when the frame doesn't match the raw image
|
|
112
|
+
* dimensions.
|
|
113
|
+
*
|
|
114
|
+
* Refer to https://facebook.github.io/react-native/docs/image.html#resizemode
|
|
115
|
+
*/
|
|
116
|
+
resizeMode?: 'cover' | 'contain' | 'center';
|
|
117
|
+
/**
|
|
118
|
+
* Determines how Lottie should render
|
|
119
|
+
* Refer to LottieAnimationView#setRenderMode(RenderMode) for more information.
|
|
120
|
+
*/
|
|
121
|
+
renderMode?: 'AUTOMATIC' | 'HARDWARE' | 'SOFTWARE';
|
|
122
|
+
/**
|
|
123
|
+
* A boolean flag indicating whether or not the animation should start automatically when
|
|
124
|
+
* mounted. This only affects the imperative API.
|
|
125
|
+
*/
|
|
126
|
+
autoPlay?: boolean;
|
|
127
|
+
/**
|
|
128
|
+
* A boolean flag indicating whether or not the animation should size itself automatically
|
|
129
|
+
* according to the width in the animation's JSON. This only works when source is an actual
|
|
130
|
+
* JS object of an animation.
|
|
131
|
+
*/
|
|
132
|
+
autoSize?: boolean;
|
|
133
|
+
/**
|
|
134
|
+
* A callback function which will be called when animation is finished. Note that this
|
|
135
|
+
* callback will be called only when \`loop\` is set to false.
|
|
136
|
+
*/
|
|
137
|
+
onAnimationFinish?: (isCancelled: boolean) => void;
|
|
138
|
+
/**
|
|
139
|
+
* A callback function which will be called when the view has been laid out.
|
|
140
|
+
*/
|
|
141
|
+
onLayout?: (event: LayoutChangeEvent) => void;
|
|
142
|
+
/**
|
|
143
|
+
* An array of layers you want to override its color filter.
|
|
144
|
+
*/
|
|
145
|
+
colorFilters?: Array<ColorFilter>;
|
|
146
|
+
/**
|
|
147
|
+
* A string to identify the component during testing.
|
|
148
|
+
*/
|
|
149
|
+
testID?: string;
|
|
150
|
+
/**
|
|
151
|
+
* A boolean flag to enable merge patching.
|
|
152
|
+
* @platform android
|
|
153
|
+
*/
|
|
154
|
+
enableMergePathsAndroidForKitKatAndAbove?: boolean;
|
|
155
|
+
/**
|
|
156
|
+
* A boolean flag indicating whether or not the animation should caching. Defaults to true.
|
|
157
|
+
* Refer to LottieAnimationView#setCacheComposition(boolean) for more information.
|
|
158
|
+
*
|
|
159
|
+
* @platform android
|
|
160
|
+
*/
|
|
161
|
+
cacheComposition?: boolean;
|
|
162
|
+
/**
|
|
163
|
+
* An array of objects denoting text values to find and replace.
|
|
164
|
+
*
|
|
165
|
+
* @platform android
|
|
166
|
+
*/
|
|
167
|
+
textFiltersAndroid?: Array<TextFilterAndroid>;
|
|
168
|
+
/**
|
|
169
|
+
* Relative folder inside of assets containing image files to be animated.
|
|
170
|
+
* Make sure that the images that bodymovin export are in that folder with their names unchanged (should be img_#).
|
|
171
|
+
* Refer to https://github.com/airbnb/lottie-android#image-support for more details.
|
|
172
|
+
*
|
|
173
|
+
* @platform android
|
|
174
|
+
*/
|
|
175
|
+
imageAssetsFolder?: string;
|
|
176
|
+
/**
|
|
177
|
+
* Uses hardware acceleration to perform the animation. This should only
|
|
178
|
+
* be used for animations where your width and height are equal to the composition width
|
|
179
|
+
* and height, e.g. you are not scaling the animation.
|
|
180
|
+
*
|
|
181
|
+
* @platform android
|
|
182
|
+
*/
|
|
183
|
+
hardwareAccelerationAndroid?: boolean;
|
|
184
|
+
/**
|
|
185
|
+
* An array of objects denoting text layers by KeyPath and a new string value.
|
|
186
|
+
*
|
|
187
|
+
* @platform ios
|
|
188
|
+
*/
|
|
189
|
+
textFiltersIOS?: Array<TextFilterIOS>;
|
|
190
|
+
/**
|
|
191
|
+
* A boolean flag to enable use of platform-level looping on Windows. This improves loop smoothness,
|
|
192
|
+
* but onAnimationLoop will not fire and changing the loop prop will restart playback.
|
|
193
|
+
*
|
|
194
|
+
* @platform windows
|
|
195
|
+
*/
|
|
196
|
+
useNativeLooping?: boolean;
|
|
197
|
+
/**
|
|
198
|
+
* A callback function which will be called when the animation loops.
|
|
199
|
+
*
|
|
200
|
+
* @platform windows
|
|
201
|
+
*/
|
|
202
|
+
onAnimationLoop?: () => void;
|
|
203
|
+
/**
|
|
204
|
+
* A callback function which will be called when animation json load is finished.
|
|
205
|
+
*
|
|
206
|
+
* @platform kepler
|
|
207
|
+
*/
|
|
208
|
+
onAnimationLoad?: () => void;
|
|
209
|
+
/**
|
|
210
|
+
* A callback function which will be called when animation json load is finished.
|
|
211
|
+
*
|
|
212
|
+
* @platform kepler
|
|
213
|
+
*/
|
|
214
|
+
onAnimationJsonLoad?: () => void;
|
|
215
|
+
/**
|
|
216
|
+
* A callback function which will be called when animation play is started.
|
|
217
|
+
*
|
|
218
|
+
* @platform kepler
|
|
219
|
+
*/
|
|
220
|
+
onAnimationPlay?: () => void;
|
|
221
|
+
/**
|
|
222
|
+
* A callback function which will be called when animation is paused.
|
|
223
|
+
*
|
|
224
|
+
* @platform kepler
|
|
225
|
+
*/
|
|
226
|
+
onAnimationPause?: () => void;
|
|
227
|
+
/**
|
|
228
|
+
* A callback function which will be called when animation is resumed.
|
|
229
|
+
*
|
|
230
|
+
* @platform kepler
|
|
231
|
+
*/
|
|
232
|
+
onAnimationResume?: () => void;
|
|
233
|
+
/**
|
|
234
|
+
* An array of objects denoting text values to find and replace.
|
|
235
|
+
*
|
|
236
|
+
* @platform kepler
|
|
237
|
+
*/
|
|
238
|
+
textFiltersKepler?: Array<TextFilterKepler>;
|
|
239
|
+
}
|
|
240
|
+
export {};
|
|
241
|
+
"
|
|
242
|
+
`;
|
|
243
|
+
|
|
244
|
+
exports[`public API should not change unintentionally lib/typescript/index.d.ts: index.d.ts 1`] = `
|
|
245
|
+
"import { AnimatedLottieView } from './LottieView';
|
|
246
|
+
export default AnimatedLottieView;
|
|
247
|
+
"
|
|
248
|
+
`;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright (c) 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
//
|
|
4
|
+
// PROPRIETARY/CONFIDENTIAL
|
|
5
|
+
// Use is subject to license terms.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
const {APIValidationOptions, validate_public_api} = require('@amazon-devices/react-native-kepler/jest/validatePublicAPI');
|
|
9
|
+
const glob = require('glob');
|
|
10
|
+
const path = require('path');
|
|
11
|
+
|
|
12
|
+
const PACKAGE_ROOT = path.resolve(__dirname, '../../');
|
|
13
|
+
const TS_FILES_PATTERN = 'lib/typescript/**/*.d.ts';
|
|
14
|
+
const IGNORE_PATTERNS = [
|
|
15
|
+
'**/__{tests,mocks,fixtures,flowtests}__/**',
|
|
16
|
+
'**/specs/**',
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
const sourceFiles = [
|
|
20
|
+
...glob.sync(TS_FILES_PATTERN, {
|
|
21
|
+
cwd: PACKAGE_ROOT,
|
|
22
|
+
ignore: IGNORE_PATTERNS,
|
|
23
|
+
nodir: true,
|
|
24
|
+
}),
|
|
25
|
+
];
|
|
26
|
+
|
|
27
|
+
let options = new APIValidationOptions;
|
|
28
|
+
// TODO(huntie): Re-enable once upstream flow-api-translator fixes are made
|
|
29
|
+
options.excludedPlatforms = ['win32'];
|
|
30
|
+
options.typeScriptOnly = true;
|
|
31
|
+
options.verifyTypeScriptDefGenerated = false;
|
|
32
|
+
|
|
33
|
+
validate_public_api(PACKAGE_ROOT, sourceFiles, options);
|
package/src/index.tsx
ADDED