@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.
Files changed (60) hide show
  1. package/LICENSE +7 -0
  2. package/SystemBundles/90296ccfe5ff2db2f9fe68a18eca092f8b7c17d1125cfafc612d18788fe9bce6.bundle +10322 -0
  3. package/SystemBundles/90296ccfe5ff2db2f9fe68a18eca092f8b7c17d1125cfafc612d18788fe9bce6.map +1 -0
  4. package/SystemModules/amzn__lottie-react-native-2.modules.txt +13 -0
  5. package/SystemModules/amzn__lottie-react-native-2.private.modules.txt +92 -0
  6. package/SystemModules/keplerscript-system-bundle-config.json +7 -0
  7. package/THIRD_PARTY_NOTICES.txt +640 -0
  8. package/android/build.gradle +120 -0
  9. package/android/gradle.properties +27 -0
  10. package/android/src/main/AndroidManifest.xml +6 -0
  11. package/android/src/main/java/com/airbnb/android/react/lottie/LottieAnimationViewManagerImpl.kt +260 -0
  12. package/android/src/main/java/com/airbnb/android/react/lottie/LottieAnimationViewPropertyManager.kt +156 -0
  13. package/android/src/main/java/com/airbnb/android/react/lottie/LottiePackage.kt +18 -0
  14. package/android/src/newarch/com/airbnb/android/react/lottie/LottieAnimationViewManager.kt +219 -0
  15. package/android/src/oldarch/com/airbnb/android/react/lottie/LottieAnimationViewManager.kt +187 -0
  16. package/ios/Fabric/LottieAnimationViewComponentView.h +28 -0
  17. package/ios/Fabric/LottieAnimationViewComponentView.mm +140 -0
  18. package/ios/Fabric/LottieContainerView.h +33 -0
  19. package/ios/Fabric/RNLottieFabricConversions.h +29 -0
  20. package/ios/LottieReactNative/AnimationViewManagerModule.swift +88 -0
  21. package/ios/LottieReactNative/Bridging.h +4 -0
  22. package/ios/LottieReactNative/ContainerView.swift +281 -0
  23. package/ios/LottieReactNative/LRNAnimationViewManagerObjC.m +25 -0
  24. package/ios/LottieReactNative/PlatformColor.swift +31 -0
  25. package/ios/LottieReactNative/RCTConvert+Lottie.h +7 -0
  26. package/ios/LottieReactNative/RCTConvert+Lottie.m +24 -0
  27. package/ios/LottieReactNative.xcodeproj/project.pbxproj +449 -0
  28. package/ios/LottieReactNative.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  29. package/ios/LottieReactNative.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  30. package/kepler-compatibility.json +8 -0
  31. package/kepler-transformed-package-info.json +3 -0
  32. package/lib/commonjs/LottieView.js +207 -0
  33. package/lib/commonjs/LottieView.js.map +1 -0
  34. package/lib/commonjs/LottieView.types.js +6 -0
  35. package/lib/commonjs/LottieView.types.js.map +1 -0
  36. package/lib/commonjs/index.js +9 -0
  37. package/lib/commonjs/index.js.map +1 -0
  38. package/lib/commonjs/specs/LottieAnimationViewNativeComponent.js +97 -0
  39. package/lib/commonjs/specs/LottieAnimationViewNativeComponent.js.map +1 -0
  40. package/lib/module/LottieView.js +201 -0
  41. package/lib/module/LottieView.js.map +1 -0
  42. package/lib/module/LottieView.types.js +2 -0
  43. package/lib/module/LottieView.types.js.map +1 -0
  44. package/lib/module/index.js +3 -0
  45. package/lib/module/index.js.map +1 -0
  46. package/lib/module/specs/LottieAnimationViewNativeComponent.js +91 -0
  47. package/lib/module/specs/LottieAnimationViewNativeComponent.js.map +1 -0
  48. package/lib/typescript/LottieView.d.ts +27 -0
  49. package/lib/typescript/LottieView.types.d.ts +206 -0
  50. package/lib/typescript/index.d.ts +2 -0
  51. package/lib/typescript/specs/LottieAnimationViewNativeComponent.d.ts +61 -0
  52. package/lottie-react-native.podspec +44 -0
  53. package/package.json +1 -0
  54. package/react-native.config.js +32 -0
  55. package/src/LottieView.tsx +257 -0
  56. package/src/LottieView.types.ts +275 -0
  57. package/src/__tests__/__snapshots__/validate-public-api.test.js.snap +248 -0
  58. package/src/__tests__/validate-public-api.test.js +33 -0
  59. package/src/index.tsx +2 -0
  60. package/src/specs/LottieAnimationViewNativeComponent.ts +170 -0
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_LottieAnimationViewNativeComponent","_interopRequireWildcard","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","_defineProperty","_toPropertyKey","value","enumerable","configurable","writable","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","AnimatedNativeLottieView","Animated","createAnimatedComponent","NativeLottieAnimationView","defaultProps","source","undefined","progress","speed","loop","autoPlay","autoSize","enableMergePathsAndroidForKitKatAndAbove","cacheComposition","useNativeLooping","resizeMode","colorFilters","textFiltersAndroid","textFiltersIOS","textFiltersKepler","AnimatedLottieView","React","PureComponent","constructor","props","evt","onAnimationFinish","nativeEvent","isCancelled","onAnimationLoad","console","warn","onAnimationJsonLoad","onAnimationPlay","onAnimationPause","onAnimationResume","play","reset","pause","resume","_captureRef","componentDidUpdate","prevProps","startFrame","endFrame","Commands","_lottieAnimationViewRef","ref","render","_this$props$colorFilt","style","duration","rest","sourceName","sourceJson","uri","JSON","stringify","sourceURL","aspectRatioStyle","aspectRatio","w","h","styleObject","StyleSheet","flatten","sizeStyle","width","height","absoluteFill","fr","Math","round","op","map","colorFilter","color","processColor","baseStyle","overflow","createElement","View","exports"],"sources":["LottieView.tsx"],"sourcesContent":["/*\n * Portions of this file are copyright (c) 2023 Amazon.com, Inc. or its affiliates. All rights reserved.\n *\n * PORTIONS OF THIS FILE ARE AMAZON PROPRIETARY/CONFIDENTIAL. USE IS SUBJECT TO LICENSE TERMS.\n *\n * Amazon modifications are indicated by [amznmod_* comments].\n */\n\n/*\n * Changelog:\n * Set up lottie-react-native package to build for Kepler\n */\n\nimport React from 'react';\nimport {\n View,\n StyleSheet,\n NativeSyntheticEvent,\n Animated,\n processColor,\n} from 'react-native';\n\nimport type { AnimatedLottieViewProps } from './LottieView.types';\n\nimport NativeLottieAnimationView, {\n Commands,\n} from './specs/LottieAnimationViewNativeComponent';\n\nconst AnimatedNativeLottieView = Animated.createAnimatedComponent(\n NativeLottieAnimationView,\n);\n\n// amznmod_react - add textFiltersKepler prop for Kepler\nconst defaultProps: AnimatedLottieViewProps = {\n source: undefined,\n progress: 0,\n speed: 1,\n loop: true,\n autoPlay: false,\n autoSize: false,\n enableMergePathsAndroidForKitKatAndAbove: false,\n cacheComposition: true,\n useNativeLooping: false,\n resizeMode: 'contain',\n colorFilters: [],\n textFiltersAndroid: [],\n textFiltersIOS: [],\n textFiltersKepler: [],\n};\n\n/**\n * View hosting the lottie animation.\n */\nexport class AnimatedLottieView extends React.PureComponent<\n AnimatedLottieViewProps,\n {}\n> {\n static defaultProps = defaultProps;\n\n _lottieAnimationViewRef:\n | React.ElementRef<typeof NativeLottieAnimationView>\n | undefined;\n\n constructor(props: AnimatedLottieViewProps) {\n super(props);\n this.play = this.play.bind(this);\n this.reset = this.reset.bind(this);\n this.pause = this.pause.bind(this);\n this.resume = this.resume.bind(this);\n this.onAnimationFinish = this.onAnimationFinish.bind(this);\n this._captureRef = this._captureRef.bind(this);\n // amznmod_react - add onAnimation... callbacks\n this.onAnimationLoad = this.onAnimationLoad.bind(this);\n this.onAnimationPlay = this.onAnimationPlay.bind(this);\n this.onAnimationPause = this.onAnimationPause.bind(this);\n this.onAnimationResume = this.onAnimationResume.bind(this);\n this.onAnimationJsonLoad = this.onAnimationJsonLoad.bind(this);\n }\n\n componentDidUpdate(prevProps: AnimatedLottieViewProps) {\n if (\n this.props.autoPlay === true &&\n this.props.source !== prevProps.source &&\n !!this.props.source\n ) {\n this.play();\n }\n }\n\n play(startFrame?: number, endFrame?: number): void {\n Commands.play(\n this._lottieAnimationViewRef,\n startFrame ?? -1,\n endFrame ?? -1,\n );\n }\n\n reset() {\n Commands.reset(this._lottieAnimationViewRef);\n }\n\n pause() {\n Commands.pause(this._lottieAnimationViewRef);\n }\n\n resume() {\n Commands.resume(this._lottieAnimationViewRef);\n }\n\n onAnimationFinish = (evt: NativeSyntheticEvent<{ isCancelled: boolean }>) => {\n if (this.props.onAnimationFinish) {\n this.props.onAnimationFinish(evt.nativeEvent.isCancelled);\n }\n };\n\n // amznmod_react - onAnimationLoad callback\n onAnimationLoad = () => {\n if (this.props.onAnimationLoad) {\n this.props.onAnimationLoad();\n }\n };\n\n // PROJ*-136246 - deprecate onAnimationJsonLoad in MR33\n // amznmod_react - onAnimationLoad callback\n onAnimationJsonLoad = () => {\n console.warn(\"onAnimationJsonLoad will be deprecated in favor of onAnimationLoad in MR33. Migrate to use onAnimationLoad.\")\n if (this.props.onAnimationJsonLoad) {\n this.props.onAnimationJsonLoad();\n }\n };\n\n // amznmod_react - onAnimationPlay callback\n onAnimationPlay = () => {\n if (this.props.onAnimationPlay) {\n this.props.onAnimationPlay();\n }\n };\n\n // amznmod_react - onAnimationPause callback\n onAnimationPause = () => {\n if (this.props.onAnimationPause) {\n this.props.onAnimationPause();\n }\n };\n\n // amznmod_react - onAnimationResume callback\n onAnimationResume = () => {\n if (this.props.onAnimationResume) {\n this.props.onAnimationResume();\n }\n };\n\n _captureRef(ref: React.ElementRef<typeof NativeLottieAnimationView>) {\n if (ref === null) {\n return;\n }\n\n this._lottieAnimationViewRef = ref;\n // amznmod_react - Fix for a crash on autoplay + progress with animation\n if (this._lottieAnimationViewRef && this.props.autoPlay === true) {\n this.play();\n }\n }\n\n render(): React.ReactNode {\n // amznmod_react - add textFiltersKepler prop\n const {\n style,\n source,\n autoSize,\n autoPlay,\n duration,\n textFiltersAndroid,\n textFiltersIOS,\n textFiltersKepler,\n ...rest\n } = this.props;\n\n const sourceName = typeof source === 'string' ? source : undefined;\n const sourceJson =\n typeof source === 'object' && !(source as any).uri\n ? JSON.stringify(source)\n : undefined;\n const sourceURL =\n typeof source === 'object' && (source as any).uri\n ? (source as any).uri\n : undefined;\n\n const aspectRatioStyle = sourceJson\n ? { aspectRatio: (source as any).w / (source as any).h }\n : undefined;\n\n const styleObject = StyleSheet.flatten(style);\n let sizeStyle;\n if (\n !styleObject ||\n (styleObject.width === undefined && styleObject.height === undefined)\n ) {\n sizeStyle =\n autoSize && sourceJson\n ? { width: (source as any).w }\n : StyleSheet.absoluteFill;\n }\n\n const speed =\n duration && sourceJson && (source as any).fr\n ? Math.round(\n (((source as any).op / (source as any).fr) * 1000) / duration,\n )\n : this.props.speed;\n\n const colorFilters = this.props.colorFilters?.map((colorFilter) => ({\n ...colorFilter,\n color: processColor(colorFilter.color),\n }));\n // amznmod_react - Clip LottieView on ReactNative\n const baseStyle= {\n overflow: 'hidden',\n };\n\n return (\n // amznmod_react - Clip LottieView on ReactNative\n <View style={[aspectRatioStyle, sizeStyle, style, baseStyle]}>\n <AnimatedNativeLottieView\n ref={this._captureRef}\n {...rest}\n // amznmod_react - add autoPlay prop\n autoPlay={autoPlay}\n colorFilters={colorFilters}\n textFiltersAndroid={textFiltersAndroid}\n textFiltersIOS={textFiltersIOS}\n // amznmod_react - add textFiltersKepler prop\n // amznmod_react - Clip LottieView on ReactNative\n textFiltersKepler={textFiltersKepler}\n speed={speed}\n style={[\n aspectRatioStyle,\n sizeStyle || { width: '100%', height: '100%' },\n style,\n baseStyle\n ]}\n sourceName={sourceName}\n sourceJson={sourceJson}\n sourceURL={sourceURL}\n onAnimationFinish={this.onAnimationFinish}\n //amznmod_react - add onAnimation... callbacks\n onAnimationLoad={this.onAnimationLoad}\n onAnimationPlay={this.onAnimationPlay}\n onAnimationPause={this.onAnimationPause}\n onAnimationResume={this.onAnimationResume}\n // PROJ*-136246 - deprecate onAnimationJsonLoad in MR33\n onAnimationJsonLoad={this.onAnimationJsonLoad}\n />\n </View>\n );\n }\n}\n"],"mappings":";;;;;;AAaA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAUA,IAAAE,mCAAA,GAAAC,uBAAA,CAAAH,OAAA;AAEoD,SAAAI,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAA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S,GAAE;MACfC,QAAQ,EAAE;IACZ,CAAC;IAED;MAAA;MACE;MACA3H,MAAA,CAAAY,OAAA,CAAAgH,aAAA,CAACzH,YAAA,CAAA0H,IAAI;QAAC/B,KAAK,EAAE,CAACS,gBAAgB,EAAEO,SAAS,EAAEhB,KAAK,EAAE4B,SAAS;MAAE,gBAC3D1H,MAAA,CAAAY,OAAA,CAAAgH,aAAA,CAAChF,wBAAwB,EAAAlB,QAAA;QACvBiE,GAAG,EAAE,IAAI,CAACP;MAAY,GAClBY,IAAI;QACR;QACA1C,QAAQ,EAAEA,QAAS;QACnBM,YAAY,EAAEA,YAAa;QAC3BC,kBAAkB,EAAEA,kBAAmB;QACvCC,cAAc,EAAEA;QAChB;QACA;QAAA;QACAC,iBAAiB,EAAEA,iBAAkB;QACrCX,KAAK,EAAEA,KAAM;QACb0C,KAAK,EAAE,CACLS,gBAAgB,EAChBO,SAAS,IAAI;UAAEC,KAAK,EAAE,MAAM;UAAEC,MAAM,EAAE;QAAO,CAAC,EAC9ClB,KAAK,EACL4B,SAAS,CACT;QACFzB,UAAU,EAAEA,UAAW;QACvBC,UAAU,EAAEA,UAAW;QACvBI,SAAS,EAAEA,SAAU;QACrBhC,iBAAiB,EAAE,IAAI,CAACA;QACxB;QAAA;QACAG,eAAe,EAAE,IAAI,CAACA,eAAgB;QACtCI,eAAe,EAAE,IAAI,CAACA,eAAgB;QACtCC,gBAAgB,EAAE,IAAI,CAACA,gBAAiB;QACxCC,iBAAiB,EAAE,IAAI,CAACA;QACxB;QAAA;QACAH,mBAAmB,EAAE,IAAI,CAACA;MAAoB,EAC/C,CACG;IAAC;EAEX;AACF;AAACkD,OAAA,CAAA9D,kBAAA,GAAAA,kBAAA;AAAAhC,eAAA,CA3MYgC,kBAAkB,kBAIPhB,YAAY","ignoreList":[]}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ //# sourceMappingURL=LottieView.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["LottieView.types.ts"],"sourcesContent":["/*\n * Portions of this file are copyright (c) 2023 Amazon.com, Inc. or its affiliates. All rights reserved.\n *\n * PORTIONS OF THIS FILE ARE AMAZON PROPRIETARY/CONFIDENTIAL. USE IS SUBJECT TO LICENSE TERMS.\n *\n * Amazon modifications are indicated by [amznmod_* comments].\n */\n\n/*\n * Changelog:\n * Set up lottie-react-native package to build for Kepler\n * Add accessibility props\n */\n\nimport type {\n StyleProp,\n ViewStyle,\n LayoutChangeEvent,\n Animated,\n AccessibilityProps,\n} from 'react-native';\n\n/**\n * Serialized animation as generated from After Effects\n */\nexport interface AnimationObject {\n v: string;\n fr: number;\n ip: number;\n op: number;\n w: number;\n h: number;\n nm?: string;\n ddd?: number;\n assets: any[];\n layers: any[];\n markers?: any[];\n}\n\ntype ColorFilter = {\n keypath: string;\n color: string;\n};\n\ntype TextFilterIOS = {\n keypath: string;\n text: string;\n};\n\ntype TextFilterAndroid = {\n find: string;\n replace: string;\n};\n\n// amznmod_react - TextFilterKepler type\ntype TextFilterKepler = {\n keypath: string;\n text: string;\n};\n\n// Animated.AnimatedInterpolation has been converted to a generic type\n// in @types/react-native 0.70. This way we can maintain compatibility\n// with all versions of @types/react-native`\ntype AnimatedInterpolation = ReturnType<Animated.Value['interpolate']>;\n\n/**\n * Properties of the AnimatedLottieView component\n */\n// amznmod_react LottieView supports all AccessibilityProps\nexport interface AnimatedLottieViewProps extends AccessibilityProps{\n /**\n * The source of animation. Can be referenced as a local asset by a string, or remotely\n * with an object with a `uri` property, or it can be an actual JS object of an\n * animation, obtained (for example) with something like\n * `require('../path/to/animation.json')`\n */\n source: string | AnimationObject | { uri: string };\n\n /**\n * A number between 0 and 1, or an `Animated` number between 0 and 1. This number\n * represents the normalized progress of the animation. If you update this prop, the\n * animation will correspondingly update to the frame at that progress value. This\n * prop is not required if you are using the imperative API.\n */\n progress?: number | Animated.Value | AnimatedInterpolation;\n\n /**\n * The speed the animation will progress. This only affects the imperative API. The\n * default value is 1.\n */\n speed?: number;\n\n /**\n * The duration of the animation in ms. Takes precedence over speed when set.\n * This only works when source is an actual JS object of an animation.\n */\n duration?: number;\n\n /**\n * A boolean flag indicating whether or not the animation should loop.\n */\n loop?: boolean;\n\n /**\n * Style attributes for the view, as expected in a standard `View`:\n * http://facebook.github.io/react-native/releases/0.39/docs/view.html#style\n *\n * **CAVEAT: border styling is not supported.**\n */\n style?: StyleProp<ViewStyle>;\n\n /**\n * Determines how to resize the animated view when the frame doesn't match the raw image\n * dimensions.\n *\n * Refer to https://facebook.github.io/react-native/docs/image.html#resizemode\n */\n resizeMode?: 'cover' | 'contain' | 'center';\n\n /**\n * Determines how Lottie should render\n * Refer to LottieAnimationView#setRenderMode(RenderMode) for more information.\n */\n renderMode?: 'AUTOMATIC' | 'HARDWARE' | 'SOFTWARE';\n\n /**\n * A boolean flag indicating whether or not the animation should start automatically when\n * mounted. This only affects the imperative API.\n */\n autoPlay?: boolean;\n\n /**\n * A boolean flag indicating whether or not the animation should size itself automatically\n * according to the width in the animation's JSON. This only works when source is an actual\n * JS object of an animation.\n */\n autoSize?: boolean;\n\n /**\n * A callback function which will be called when animation is finished. Note that this\n * callback will be called only when `loop` is set to false.\n */\n onAnimationFinish?: (isCancelled: boolean) => void;\n\n /**\n * A callback function which will be called when the view has been laid out.\n */\n onLayout?: (event: LayoutChangeEvent) => void;\n\n /**\n * An array of layers you want to override its color filter.\n */\n colorFilters?: Array<ColorFilter>;\n\n /**\n * A string to identify the component during testing.\n */\n testID?: string;\n\n // Android Props\n\n /**\n * A boolean flag to enable merge patching.\n * @platform android\n */\n enableMergePathsAndroidForKitKatAndAbove?: boolean;\n\n /**\n * A boolean flag indicating whether or not the animation should caching. Defaults to true.\n * Refer to LottieAnimationView#setCacheComposition(boolean) for more information.\n *\n * @platform android\n */\n cacheComposition?: boolean;\n\n /**\n * An array of objects denoting text values to find and replace.\n *\n * @platform android\n */\n textFiltersAndroid?: Array<TextFilterAndroid>;\n\n /**\n * Relative folder inside of assets containing image files to be animated.\n * Make sure that the images that bodymovin export are in that folder with their names unchanged (should be img_#).\n * Refer to https://github.com/airbnb/lottie-android#image-support for more details.\n *\n * @platform android\n */\n imageAssetsFolder?: string;\n\n /**\n * Uses hardware acceleration to perform the animation. This should only\n * be used for animations where your width and height are equal to the composition width\n * and height, e.g. you are not scaling the animation.\n *\n * @platform android\n */\n hardwareAccelerationAndroid?: boolean;\n\n // iOS Props\n\n /**\n * An array of objects denoting text layers by KeyPath and a new string value.\n *\n * @platform ios\n */\n textFiltersIOS?: Array<TextFilterIOS>;\n\n // Windows Props\n\n /**\n * A boolean flag to enable use of platform-level looping on Windows. This improves loop smoothness,\n * but onAnimationLoop will not fire and changing the loop prop will restart playback.\n *\n * @platform windows\n */\n useNativeLooping?: boolean;\n\n /**\n * A callback function which will be called when the animation loops.\n *\n * @platform windows\n */\n onAnimationLoop?: () => void;\n\n // amznmod_react - add onAnimationLoad callback\n /**\n * A callback function which will be called when animation json load is finished.\n *\n * @platform kepler\n */\n onAnimationLoad?: () => void;\n\n // PROJ*-136246 - deprecate onAnimationJsonLoad in MR33\n // amznmod_react - add onAnimationJsonLoad callback\n /**\n * A callback function which will be called when animation json load is finished.\n *\n * @platform kepler\n */\n onAnimationJsonLoad?: () => void;\n\n // amznmod_react - add onAnimationPlay callback\n /**\n * A callback function which will be called when animation play is started.\n *\n * @platform kepler\n */\n onAnimationPlay?: () => void;\n\n // amznmod_react - add onAnimationPause callback\n /**\n * A callback function which will be called when animation is paused.\n *\n * @platform kepler\n */\n onAnimationPause?: () => void;\n\n // amznmod_react - add onAnimationResume callback\n /**\n * A callback function which will be called when animation is resumed.\n *\n * @platform kepler\n */\n onAnimationResume?: () => void;\n\n // amznmod_react - add textFiltersKepler prop\n /**\n * An array of objects denoting text values to find and replace.\n *\n * @platform kepler\n */\n textFiltersKepler?: Array<TextFilterKepler>;\n}\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _LottieView = require("./LottieView");
8
+ var _default = exports.default = _LottieView.AnimatedLottieView;
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_LottieView","require","_default","exports","default","AnimatedLottieView"],"sources":["index.tsx"],"sourcesContent":["import { AnimatedLottieView } from './LottieView';\nexport default AnimatedLottieView;"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAAkD,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GACnCC,8BAAkB","ignoreList":[]}
@@ -0,0 +1,97 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = exports.Commands = void 0;
7
+ var _codegenNativeCommands = _interopRequireDefault(require("react-native/Libraries/Utilities/codegenNativeCommands"));
8
+ var _registerGeneratedViewConfig = _interopRequireDefault(require("@amazon-devices/react-native-kepler/Libraries/Utilities/registerGeneratedViewConfig"));
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
+ /*
11
+ * Portions of this file are copyright (c) 2023 Amazon.com, Inc. or its affiliates. All rights reserved.
12
+ *
13
+ * PORTIONS OF THIS FILE ARE AMAZON PROPRIETARY/CONFIDENTIAL. USE IS SUBJECT TO LICENSE TERMS.
14
+ *
15
+ * Amazon modifications are indicated by [amznmod_* comments].
16
+ */
17
+
18
+ /*
19
+ * Changelog:
20
+ * Set up lottie-react-native package to build for Kepler
21
+ */
22
+
23
+ // amznmod_react - add EmptyEvent type
24
+
25
+ // amznmod_react - change NativeComponentType to HostComponent
26
+
27
+ const Commands = exports.Commands = (0, _codegenNativeCommands.default)({
28
+ supportedCommands: ['play', 'reset', 'pause', 'resume']
29
+ });
30
+
31
+ // amznmod_react - native component registration to build for Kepler
32
+ const LottieNativeComponent = 'LottieAnimationView';
33
+ const viewConfig = {
34
+ autoPlay: true,
35
+ sourceName: true,
36
+ resizeMode: true,
37
+ renderMode: true,
38
+ sourceJson: true,
39
+ sourceURL: true,
40
+ imageAssetsFolder: true,
41
+ progress: true,
42
+ speed: true,
43
+ loop: true,
44
+ enableMergePathsAndroidForKitKatAndAbove: true,
45
+ hardwareAccelerationAndroid: true,
46
+ cacheComposition: true,
47
+ colorFilters: true,
48
+ textFiltersAndroid: true,
49
+ textFiltersIOS: true,
50
+ textFiltersKepler: true
51
+ };
52
+ const bubblingEventTypes = {
53
+ topOnAnimationFinish: {
54
+ phasedRegistrationNames: {
55
+ bubbled: 'onAnimationFinish',
56
+ captured: 'onAnimationFinishCapture'
57
+ }
58
+ },
59
+ topOnAnimationLoad: {
60
+ phasedRegistrationNames: {
61
+ bubbled: 'onAnimationLoad',
62
+ captured: 'onAnimationLoadCapture'
63
+ }
64
+ },
65
+ // PROJ*-136246 - deprecate onAnimationJsonLoad in MR33
66
+ topOnAnimationJsonLoad: {
67
+ phasedRegistrationNames: {
68
+ bubbled: 'onAnimationJsonLoad',
69
+ captured: 'onAnimationJsonLoadCapture'
70
+ }
71
+ },
72
+ topOnAnimationPlay: {
73
+ phasedRegistrationNames: {
74
+ bubbled: 'onAnimationPlay',
75
+ captured: 'onAnimationPlayCapture'
76
+ }
77
+ },
78
+ topOnAnimationPause: {
79
+ phasedRegistrationNames: {
80
+ bubbled: 'onAnimationPause',
81
+ captured: 'onAnimationPauseCapture'
82
+ }
83
+ },
84
+ topOnAnimationResume: {
85
+ phasedRegistrationNames: {
86
+ bubbled: 'onAnimationResume',
87
+ captured: 'onAnimationResumeCapture'
88
+ }
89
+ }
90
+ };
91
+ (0, _registerGeneratedViewConfig.default)(LottieNativeComponent, {
92
+ uiViewClassName: LottieNativeComponent,
93
+ validAttributes: viewConfig,
94
+ bubblingEventTypes: bubblingEventTypes
95
+ });
96
+ var _default = exports.default = LottieNativeComponent;
97
+ //# sourceMappingURL=LottieAnimationViewNativeComponent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_codegenNativeCommands","_interopRequireDefault","require","_registerGeneratedViewConfig","e","__esModule","default","Commands","exports","codegenNativeCommands","supportedCommands","LottieNativeComponent","viewConfig","autoPlay","sourceName","resizeMode","renderMode","sourceJson","sourceURL","imageAssetsFolder","progress","speed","loop","enableMergePathsAndroidForKitKatAndAbove","hardwareAccelerationAndroid","cacheComposition","colorFilters","textFiltersAndroid","textFiltersIOS","textFiltersKepler","bubblingEventTypes","topOnAnimationFinish","phasedRegistrationNames","bubbled","captured","topOnAnimationLoad","topOnAnimationJsonLoad","topOnAnimationPlay","topOnAnimationPause","topOnAnimationResume","register","uiViewClassName","validAttributes","_default"],"sources":["LottieAnimationViewNativeComponent.ts"],"sourcesContent":["/*\n * Portions of this file are copyright (c) 2023 Amazon.com, Inc. or its affiliates. All rights reserved.\n *\n * PORTIONS OF THIS FILE ARE AMAZON PROPRIETARY/CONFIDENTIAL. USE IS SUBJECT TO LICENSE TERMS.\n *\n * Amazon modifications are indicated by [amznmod_* comments].\n */\n\n/*\n * Changelog:\n * Set up lottie-react-native package to build for Kepler\n */\n\nimport type {\n BubblingEventHandler,\n Int32,\n Double,\n Float,\n} from 'react-native/Libraries/Types/CodegenTypes';\nimport codegenNativeCommands from 'react-native/Libraries/Utilities/codegenNativeCommands';\nimport type { HostComponent, ProcessedColorValue, ViewProps } from 'react-native';\nimport register from '@amazon-devices/react-native-kepler/Libraries/Utilities/registerGeneratedViewConfig';\n\nexport type OnAnimationFinishEvent = Readonly<{\n isCancelled: boolean;\n}>;\n\n// amznmod_react - add EmptyEvent type\nexport type EmptyEvent = {\n // Nothing to return in this event\n};\n\ntype ColorFilterStruct = Readonly<{\n keypath: string;\n color: ProcessedColorValue;\n}>;\n\ntype TextFilterIOSStruct = Readonly<{\n keypath: string;\n text: string;\n}>;\n\ntype TextFilterAndroidStruct = Readonly<{\n find: string;\n replace: string;\n}>;\n\ntype TextFilterKeplerStruct = Readonly<{\n keypath: string;\n text: string;\n}>;\n\nexport interface NativeProps extends ViewProps {\n // amznmod_react - add autoPlay as native prop to avoid component mount race condition\n autoPlay?: boolean;\n resizeMode?: string;\n renderMode?: string;\n sourceName?: string;\n sourceJson?: string;\n sourceURL?: string;\n imageAssetsFolder?: string;\n progress?: Float;\n speed?: Double;\n loop?: boolean;\n enableMergePathsAndroidForKitKatAndAbove?: boolean;\n hardwareAccelerationAndroid?: boolean;\n cacheComposition?: boolean;\n colorFilters?: ReadonlyArray<ColorFilterStruct>;\n // dummy that solves codegen issue when there's a ReadonlyArray<Object> without another Object prop\n // https://github.com/reactwg/react-native-new-architecture/discussions/104\n dummy?: Readonly<{ dummy: boolean }>;\n textFiltersAndroid?: ReadonlyArray<TextFilterAndroidStruct>;\n textFiltersIOS?: ReadonlyArray<TextFilterIOSStruct>;\n // amznmod_react - add textFiltersKepler prop\n textFiltersKepler?: ReadonlyArray<TextFilterKeplerStruct>;\n onAnimationFinish?: BubblingEventHandler<\n OnAnimationFinishEvent,\n 'onAnimationFinish'\n >;\n // amznmod_react - add onAnimation... callbacks\n onAnimationLoad?: BubblingEventHandler<EmptyEvent>;\n onAnimationPlay?: BubblingEventHandler<EmptyEvent>;\n onAnimationPause?: BubblingEventHandler<EmptyEvent>;\n onAnimationResume?: BubblingEventHandler<EmptyEvent>;\n // PROJ*-136246 - deprecate onAnimationJsonLoad in MR33\n onAnimationJsonLoad?: BubblingEventHandler<EmptyEvent>;\n}\n\n// amznmod_react - change NativeComponentType to HostComponent\ntype LottieViewNativeComponentType = HostComponent<NativeProps>;\n\ninterface NativeCommands {\n play: (\n viewRef: React.ElementRef<LottieViewNativeComponentType>,\n startFrame: Int32,\n endFrame: Int32,\n ) => void;\n reset: (viewRef: React.ElementRef<LottieViewNativeComponentType>) => void;\n pause: (viewRef: React.ElementRef<LottieViewNativeComponentType>) => void;\n resume: (viewRef: React.ElementRef<LottieViewNativeComponentType>) => void;\n}\n\nexport const Commands: NativeCommands = codegenNativeCommands<NativeCommands>({\n supportedCommands: ['play', 'reset', 'pause', 'resume'],\n});\n\n// amznmod_react - native component registration to build for Kepler\nconst LottieNativeComponent = 'LottieAnimationView'\nconst viewConfig = {\n autoPlay: true,\n sourceName: true,\n resizeMode: true,\n renderMode: true,\n sourceJson: true,\n sourceURL: true,\n imageAssetsFolder: true,\n progress: true,\n speed: true,\n loop: true,\n enableMergePathsAndroidForKitKatAndAbove: true,\n hardwareAccelerationAndroid: true,\n cacheComposition: true,\n colorFilters: true,\n textFiltersAndroid: true,\n textFiltersIOS: true,\n textFiltersKepler: true,\n};\n\nconst bubblingEventTypes = {\n topOnAnimationFinish: {\n phasedRegistrationNames: {\n bubbled: 'onAnimationFinish',\n captured: 'onAnimationFinishCapture'\n }\n },\n topOnAnimationLoad: {\n phasedRegistrationNames: {\n bubbled: 'onAnimationLoad',\n captured: 'onAnimationLoadCapture'\n }\n },\n // PROJ*-136246 - deprecate onAnimationJsonLoad in MR33\n topOnAnimationJsonLoad: {\n phasedRegistrationNames: {\n bubbled: 'onAnimationJsonLoad',\n captured: 'onAnimationJsonLoadCapture'\n }\n },\n topOnAnimationPlay: {\n phasedRegistrationNames: {\n bubbled: 'onAnimationPlay',\n captured: 'onAnimationPlayCapture'\n }\n },\n topOnAnimationPause: {\n phasedRegistrationNames: {\n bubbled: 'onAnimationPause',\n captured: 'onAnimationPauseCapture'\n }\n },\n topOnAnimationResume: {\n phasedRegistrationNames: {\n bubbled: 'onAnimationResume',\n captured: 'onAnimationResumeCapture'\n }\n }\n};\n\nregister(LottieNativeComponent, {uiViewClassName: LottieNativeComponent, validAttributes: viewConfig, bubblingEventTypes: bubblingEventTypes});\nexport default (LottieNativeComponent as unknown) as HostComponent<NativeProps>;"],"mappings":";;;;;;AAmBA,IAAAA,sBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,4BAAA,GAAAF,sBAAA,CAAAC,OAAA;AAAiG,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAA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;MAC1BC,QAAQ,EAAE;IACZ;EACF,CAAC;EACDI,mBAAmB,EAAE;IACnBN,uBAAuB,EAAE;MACvBC,OAAO,EAAE,kBAAkB;MAC3BC,QAAQ,EAAE;IACZ;EACF,CAAC;EACDK,oBAAoB,EAAE;IACpBP,uBAAuB,EAAE;MACvBC,OAAO,EAAE,mBAAmB;MAC5BC,QAAQ,EAAE;IACZ;EACF;AACF,CAAC;AAED,IAAAM,oCAAQ,EAAC7B,qBAAqB,EAAE;EAAC8B,eAAe,EAAE9B,qBAAqB;EAAE+B,eAAe,EAAE9B,UAAU;EAAEkB,kBAAkB,EAAEA;AAAkB,CAAC,CAAC;AAAC,IAAAa,QAAA,GAAAnC,OAAA,CAAAF,OAAA,GAC/HK,qBAAqB","ignoreList":[]}
@@ -0,0 +1,201 @@
1
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
3
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
4
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
5
+ /*
6
+ * Portions of this file are copyright (c) 2023 Amazon.com, Inc. or its affiliates. All rights reserved.
7
+ *
8
+ * PORTIONS OF THIS FILE ARE AMAZON PROPRIETARY/CONFIDENTIAL. USE IS SUBJECT TO LICENSE TERMS.
9
+ *
10
+ * Amazon modifications are indicated by [amznmod_* comments].
11
+ */
12
+
13
+ /*
14
+ * Changelog:
15
+ * Set up lottie-react-native package to build for Kepler
16
+ */
17
+
18
+ import React from 'react';
19
+ import { View, StyleSheet, Animated, processColor } from 'react-native';
20
+ import NativeLottieAnimationView, { Commands } from './specs/LottieAnimationViewNativeComponent';
21
+ const AnimatedNativeLottieView = Animated.createAnimatedComponent(NativeLottieAnimationView);
22
+
23
+ // amznmod_react - add textFiltersKepler prop for Kepler
24
+ const defaultProps = {
25
+ source: undefined,
26
+ progress: 0,
27
+ speed: 1,
28
+ loop: true,
29
+ autoPlay: false,
30
+ autoSize: false,
31
+ enableMergePathsAndroidForKitKatAndAbove: false,
32
+ cacheComposition: true,
33
+ useNativeLooping: false,
34
+ resizeMode: 'contain',
35
+ colorFilters: [],
36
+ textFiltersAndroid: [],
37
+ textFiltersIOS: [],
38
+ textFiltersKepler: []
39
+ };
40
+
41
+ /**
42
+ * View hosting the lottie animation.
43
+ */
44
+ export class AnimatedLottieView extends React.PureComponent {
45
+ constructor(props) {
46
+ super(props);
47
+ _defineProperty(this, "_lottieAnimationViewRef", void 0);
48
+ _defineProperty(this, "onAnimationFinish", evt => {
49
+ if (this.props.onAnimationFinish) {
50
+ this.props.onAnimationFinish(evt.nativeEvent.isCancelled);
51
+ }
52
+ });
53
+ // amznmod_react - onAnimationLoad callback
54
+ _defineProperty(this, "onAnimationLoad", () => {
55
+ if (this.props.onAnimationLoad) {
56
+ this.props.onAnimationLoad();
57
+ }
58
+ });
59
+ // PROJ*-136246 - deprecate onAnimationJsonLoad in MR33
60
+ // amznmod_react - onAnimationLoad callback
61
+ _defineProperty(this, "onAnimationJsonLoad", () => {
62
+ console.warn("onAnimationJsonLoad will be deprecated in favor of onAnimationLoad in MR33. Migrate to use onAnimationLoad.");
63
+ if (this.props.onAnimationJsonLoad) {
64
+ this.props.onAnimationJsonLoad();
65
+ }
66
+ });
67
+ // amznmod_react - onAnimationPlay callback
68
+ _defineProperty(this, "onAnimationPlay", () => {
69
+ if (this.props.onAnimationPlay) {
70
+ this.props.onAnimationPlay();
71
+ }
72
+ });
73
+ // amznmod_react - onAnimationPause callback
74
+ _defineProperty(this, "onAnimationPause", () => {
75
+ if (this.props.onAnimationPause) {
76
+ this.props.onAnimationPause();
77
+ }
78
+ });
79
+ // amznmod_react - onAnimationResume callback
80
+ _defineProperty(this, "onAnimationResume", () => {
81
+ if (this.props.onAnimationResume) {
82
+ this.props.onAnimationResume();
83
+ }
84
+ });
85
+ this.play = this.play.bind(this);
86
+ this.reset = this.reset.bind(this);
87
+ this.pause = this.pause.bind(this);
88
+ this.resume = this.resume.bind(this);
89
+ this.onAnimationFinish = this.onAnimationFinish.bind(this);
90
+ this._captureRef = this._captureRef.bind(this);
91
+ // amznmod_react - add onAnimation... callbacks
92
+ this.onAnimationLoad = this.onAnimationLoad.bind(this);
93
+ this.onAnimationPlay = this.onAnimationPlay.bind(this);
94
+ this.onAnimationPause = this.onAnimationPause.bind(this);
95
+ this.onAnimationResume = this.onAnimationResume.bind(this);
96
+ this.onAnimationJsonLoad = this.onAnimationJsonLoad.bind(this);
97
+ }
98
+ componentDidUpdate(prevProps) {
99
+ if (this.props.autoPlay === true && this.props.source !== prevProps.source && !!this.props.source) {
100
+ this.play();
101
+ }
102
+ }
103
+ play(startFrame, endFrame) {
104
+ Commands.play(this._lottieAnimationViewRef, startFrame !== null && startFrame !== void 0 ? startFrame : -1, endFrame !== null && endFrame !== void 0 ? endFrame : -1);
105
+ }
106
+ reset() {
107
+ Commands.reset(this._lottieAnimationViewRef);
108
+ }
109
+ pause() {
110
+ Commands.pause(this._lottieAnimationViewRef);
111
+ }
112
+ resume() {
113
+ Commands.resume(this._lottieAnimationViewRef);
114
+ }
115
+ _captureRef(ref) {
116
+ if (ref === null) {
117
+ return;
118
+ }
119
+ this._lottieAnimationViewRef = ref;
120
+ // amznmod_react - Fix for a crash on autoplay + progress with animation
121
+ if (this._lottieAnimationViewRef && this.props.autoPlay === true) {
122
+ this.play();
123
+ }
124
+ }
125
+ render() {
126
+ var _this$props$colorFilt;
127
+ // amznmod_react - add textFiltersKepler prop
128
+ const {
129
+ style,
130
+ source,
131
+ autoSize,
132
+ autoPlay,
133
+ duration,
134
+ textFiltersAndroid,
135
+ textFiltersIOS,
136
+ textFiltersKepler,
137
+ ...rest
138
+ } = this.props;
139
+ const sourceName = typeof source === 'string' ? source : undefined;
140
+ const sourceJson = typeof source === 'object' && !source.uri ? JSON.stringify(source) : undefined;
141
+ const sourceURL = typeof source === 'object' && source.uri ? source.uri : undefined;
142
+ const aspectRatioStyle = sourceJson ? {
143
+ aspectRatio: source.w / source.h
144
+ } : undefined;
145
+ const styleObject = StyleSheet.flatten(style);
146
+ let sizeStyle;
147
+ if (!styleObject || styleObject.width === undefined && styleObject.height === undefined) {
148
+ sizeStyle = autoSize && sourceJson ? {
149
+ width: source.w
150
+ } : StyleSheet.absoluteFill;
151
+ }
152
+ const speed = duration && sourceJson && source.fr ? Math.round(source.op / source.fr * 1000 / duration) : this.props.speed;
153
+ const colorFilters = (_this$props$colorFilt = this.props.colorFilters) === null || _this$props$colorFilt === void 0 ? void 0 : _this$props$colorFilt.map(colorFilter => ({
154
+ ...colorFilter,
155
+ color: processColor(colorFilter.color)
156
+ }));
157
+ // amznmod_react - Clip LottieView on ReactNative
158
+ const baseStyle = {
159
+ overflow: 'hidden'
160
+ };
161
+ return (
162
+ /*#__PURE__*/
163
+ // amznmod_react - Clip LottieView on ReactNative
164
+ React.createElement(View, {
165
+ style: [aspectRatioStyle, sizeStyle, style, baseStyle]
166
+ }, /*#__PURE__*/React.createElement(AnimatedNativeLottieView, _extends({
167
+ ref: this._captureRef
168
+ }, rest, {
169
+ // amznmod_react - add autoPlay prop
170
+ autoPlay: autoPlay,
171
+ colorFilters: colorFilters,
172
+ textFiltersAndroid: textFiltersAndroid,
173
+ textFiltersIOS: textFiltersIOS
174
+ // amznmod_react - add textFiltersKepler prop
175
+ // amznmod_react - Clip LottieView on ReactNative
176
+ ,
177
+ textFiltersKepler: textFiltersKepler,
178
+ speed: speed,
179
+ style: [aspectRatioStyle, sizeStyle || {
180
+ width: '100%',
181
+ height: '100%'
182
+ }, style, baseStyle],
183
+ sourceName: sourceName,
184
+ sourceJson: sourceJson,
185
+ sourceURL: sourceURL,
186
+ onAnimationFinish: this.onAnimationFinish
187
+ //amznmod_react - add onAnimation... callbacks
188
+ ,
189
+ onAnimationLoad: this.onAnimationLoad,
190
+ onAnimationPlay: this.onAnimationPlay,
191
+ onAnimationPause: this.onAnimationPause,
192
+ onAnimationResume: this.onAnimationResume
193
+ // PROJ*-136246 - deprecate onAnimationJsonLoad in MR33
194
+ ,
195
+ onAnimationJsonLoad: this.onAnimationJsonLoad
196
+ })))
197
+ );
198
+ }
199
+ }
200
+ _defineProperty(AnimatedLottieView, "defaultProps", defaultProps);
201
+ //# sourceMappingURL=LottieView.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","View","StyleSheet","Animated","processColor","NativeLottieAnimationView","Commands","AnimatedNativeLottieView","createAnimatedComponent","defaultProps","source","undefined","progress","speed","loop","autoPlay","autoSize","enableMergePathsAndroidForKitKatAndAbove","cacheComposition","useNativeLooping","resizeMode","colorFilters","textFiltersAndroid","textFiltersIOS","textFiltersKepler","AnimatedLottieView","PureComponent","constructor","props","_defineProperty","evt","onAnimationFinish","nativeEvent","isCancelled","onAnimationLoad","console","warn","onAnimationJsonLoad","onAnimationPlay","onAnimationPause","onAnimationResume","play","bind","reset","pause","resume","_captureRef","componentDidUpdate","prevProps","startFrame","endFrame","_lottieAnimationViewRef","ref","render","_this$props$colorFilt","style","duration","rest","sourceName","sourceJson","uri","JSON","stringify","sourceURL","aspectRatioStyle","aspectRatio","w","h","styleObject","flatten","sizeStyle","width","height","absoluteFill","fr","Math","round","op","map","colorFilter","color","baseStyle","overflow","createElement","_extends"],"sources":["LottieView.tsx"],"sourcesContent":["/*\n * Portions of this file are copyright (c) 2023 Amazon.com, Inc. or its affiliates. All rights reserved.\n *\n * PORTIONS OF THIS FILE ARE AMAZON PROPRIETARY/CONFIDENTIAL. USE IS SUBJECT TO LICENSE TERMS.\n *\n * Amazon modifications are indicated by [amznmod_* comments].\n */\n\n/*\n * Changelog:\n * Set up lottie-react-native package to build for Kepler\n */\n\nimport React from 'react';\nimport {\n View,\n StyleSheet,\n NativeSyntheticEvent,\n Animated,\n processColor,\n} from 'react-native';\n\nimport type { AnimatedLottieViewProps } from './LottieView.types';\n\nimport NativeLottieAnimationView, {\n Commands,\n} from './specs/LottieAnimationViewNativeComponent';\n\nconst AnimatedNativeLottieView = Animated.createAnimatedComponent(\n NativeLottieAnimationView,\n);\n\n// amznmod_react - add textFiltersKepler prop for Kepler\nconst defaultProps: AnimatedLottieViewProps = {\n source: undefined,\n progress: 0,\n speed: 1,\n loop: true,\n autoPlay: false,\n autoSize: false,\n enableMergePathsAndroidForKitKatAndAbove: false,\n cacheComposition: true,\n useNativeLooping: false,\n resizeMode: 'contain',\n colorFilters: [],\n textFiltersAndroid: [],\n textFiltersIOS: [],\n textFiltersKepler: [],\n};\n\n/**\n * View hosting the lottie animation.\n */\nexport class AnimatedLottieView extends React.PureComponent<\n AnimatedLottieViewProps,\n {}\n> {\n static defaultProps = defaultProps;\n\n _lottieAnimationViewRef:\n | React.ElementRef<typeof NativeLottieAnimationView>\n | undefined;\n\n constructor(props: AnimatedLottieViewProps) {\n super(props);\n this.play = this.play.bind(this);\n this.reset = this.reset.bind(this);\n this.pause = this.pause.bind(this);\n this.resume = this.resume.bind(this);\n this.onAnimationFinish = this.onAnimationFinish.bind(this);\n this._captureRef = this._captureRef.bind(this);\n // amznmod_react - add onAnimation... callbacks\n this.onAnimationLoad = this.onAnimationLoad.bind(this);\n this.onAnimationPlay = this.onAnimationPlay.bind(this);\n this.onAnimationPause = this.onAnimationPause.bind(this);\n this.onAnimationResume = this.onAnimationResume.bind(this);\n this.onAnimationJsonLoad = this.onAnimationJsonLoad.bind(this);\n }\n\n componentDidUpdate(prevProps: AnimatedLottieViewProps) {\n if (\n this.props.autoPlay === true &&\n this.props.source !== prevProps.source &&\n !!this.props.source\n ) {\n this.play();\n }\n }\n\n play(startFrame?: number, endFrame?: number): void {\n Commands.play(\n this._lottieAnimationViewRef,\n startFrame ?? -1,\n endFrame ?? -1,\n );\n }\n\n reset() {\n Commands.reset(this._lottieAnimationViewRef);\n }\n\n pause() {\n Commands.pause(this._lottieAnimationViewRef);\n }\n\n resume() {\n Commands.resume(this._lottieAnimationViewRef);\n }\n\n onAnimationFinish = (evt: NativeSyntheticEvent<{ isCancelled: boolean }>) => {\n if (this.props.onAnimationFinish) {\n this.props.onAnimationFinish(evt.nativeEvent.isCancelled);\n }\n };\n\n // amznmod_react - onAnimationLoad callback\n onAnimationLoad = () => {\n if (this.props.onAnimationLoad) {\n this.props.onAnimationLoad();\n }\n };\n\n // PROJ*-136246 - deprecate onAnimationJsonLoad in MR33\n // amznmod_react - onAnimationLoad callback\n onAnimationJsonLoad = () => {\n console.warn(\"onAnimationJsonLoad will be deprecated in favor of onAnimationLoad in MR33. Migrate to use onAnimationLoad.\")\n if (this.props.onAnimationJsonLoad) {\n this.props.onAnimationJsonLoad();\n }\n };\n\n // amznmod_react - onAnimationPlay callback\n onAnimationPlay = () => {\n if (this.props.onAnimationPlay) {\n this.props.onAnimationPlay();\n }\n };\n\n // amznmod_react - onAnimationPause callback\n onAnimationPause = () => {\n if (this.props.onAnimationPause) {\n this.props.onAnimationPause();\n }\n };\n\n // amznmod_react - onAnimationResume callback\n onAnimationResume = () => {\n if (this.props.onAnimationResume) {\n this.props.onAnimationResume();\n }\n };\n\n _captureRef(ref: React.ElementRef<typeof NativeLottieAnimationView>) {\n if (ref === null) {\n return;\n }\n\n this._lottieAnimationViewRef = ref;\n // amznmod_react - Fix for a crash on autoplay + progress with animation\n if (this._lottieAnimationViewRef && this.props.autoPlay === true) {\n this.play();\n }\n }\n\n render(): React.ReactNode {\n // amznmod_react - add textFiltersKepler prop\n const {\n style,\n source,\n autoSize,\n autoPlay,\n duration,\n textFiltersAndroid,\n textFiltersIOS,\n textFiltersKepler,\n ...rest\n } = this.props;\n\n const sourceName = typeof source === 'string' ? source : undefined;\n const sourceJson =\n typeof source === 'object' && !(source as any).uri\n ? JSON.stringify(source)\n : undefined;\n const sourceURL =\n typeof source === 'object' && (source as any).uri\n ? (source as any).uri\n : undefined;\n\n const aspectRatioStyle = sourceJson\n ? { aspectRatio: (source as any).w / (source as any).h }\n : undefined;\n\n const styleObject = StyleSheet.flatten(style);\n let sizeStyle;\n if (\n !styleObject ||\n (styleObject.width === undefined && styleObject.height === undefined)\n ) {\n sizeStyle =\n autoSize && sourceJson\n ? { width: (source as any).w }\n : StyleSheet.absoluteFill;\n }\n\n const speed =\n duration && sourceJson && (source as any).fr\n ? Math.round(\n (((source as any).op / (source as any).fr) * 1000) / duration,\n )\n : this.props.speed;\n\n const colorFilters = this.props.colorFilters?.map((colorFilter) => ({\n ...colorFilter,\n color: processColor(colorFilter.color),\n }));\n // amznmod_react - Clip LottieView on ReactNative\n const baseStyle= {\n overflow: 'hidden',\n };\n\n return (\n // amznmod_react - Clip LottieView on ReactNative\n <View style={[aspectRatioStyle, sizeStyle, style, baseStyle]}>\n <AnimatedNativeLottieView\n ref={this._captureRef}\n {...rest}\n // amznmod_react - add autoPlay prop\n autoPlay={autoPlay}\n colorFilters={colorFilters}\n textFiltersAndroid={textFiltersAndroid}\n textFiltersIOS={textFiltersIOS}\n // amznmod_react - add textFiltersKepler prop\n // amznmod_react - Clip LottieView on ReactNative\n textFiltersKepler={textFiltersKepler}\n speed={speed}\n style={[\n aspectRatioStyle,\n sizeStyle || { width: '100%', height: '100%' },\n style,\n baseStyle\n ]}\n sourceName={sourceName}\n sourceJson={sourceJson}\n sourceURL={sourceURL}\n onAnimationFinish={this.onAnimationFinish}\n //amznmod_react - add onAnimation... callbacks\n onAnimationLoad={this.onAnimationLoad}\n onAnimationPlay={this.onAnimationPlay}\n onAnimationPause={this.onAnimationPause}\n onAnimationResume={this.onAnimationResume}\n // PROJ*-136246 - deprecate onAnimationJsonLoad in MR33\n onAnimationJs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tCC,gBAAgB,EAAE,IAAI,CAACA,gBAAiB;QACxCC,iBAAiB,EAAE,IAAI,CAACA;QACxB;QAAA;QACAH,mBAAmB,EAAE,IAAI,CAACA;MAAoB,EAC/C,CACG;IAAC;EAEX;AACF;AAACR,eAAA,CA3MYJ,kBAAkB,kBAIPhB,YAAY","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=LottieView.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["LottieView.types.ts"],"sourcesContent":["/*\n * Portions of this file are copyright (c) 2023 Amazon.com, Inc. or its affiliates. All rights reserved.\n *\n * PORTIONS OF THIS FILE ARE AMAZON PROPRIETARY/CONFIDENTIAL. USE IS SUBJECT TO LICENSE TERMS.\n *\n * Amazon modifications are indicated by [amznmod_* comments].\n */\n\n/*\n * Changelog:\n * Set up lottie-react-native package to build for Kepler\n * Add accessibility props\n */\n\nimport type {\n StyleProp,\n ViewStyle,\n LayoutChangeEvent,\n Animated,\n AccessibilityProps,\n} from 'react-native';\n\n/**\n * Serialized animation as generated from After Effects\n */\nexport interface AnimationObject {\n v: string;\n fr: number;\n ip: number;\n op: number;\n w: number;\n h: number;\n nm?: string;\n ddd?: number;\n assets: any[];\n layers: any[];\n markers?: any[];\n}\n\ntype ColorFilter = {\n keypath: string;\n color: string;\n};\n\ntype TextFilterIOS = {\n keypath: string;\n text: string;\n};\n\ntype TextFilterAndroid = {\n find: string;\n replace: string;\n};\n\n// amznmod_react - TextFilterKepler type\ntype TextFilterKepler = {\n keypath: string;\n text: string;\n};\n\n// Animated.AnimatedInterpolation has been converted to a generic type\n// in @types/react-native 0.70. This way we can maintain compatibility\n// with all versions of @types/react-native`\ntype AnimatedInterpolation = ReturnType<Animated.Value['interpolate']>;\n\n/**\n * Properties of the AnimatedLottieView component\n */\n// amznmod_react LottieView supports all AccessibilityProps\nexport interface AnimatedLottieViewProps extends AccessibilityProps{\n /**\n * The source of animation. Can be referenced as a local asset by a string, or remotely\n * with an object with a `uri` property, or it can be an actual JS object of an\n * animation, obtained (for example) with something like\n * `require('../path/to/animation.json')`\n */\n source: string | AnimationObject | { uri: string };\n\n /**\n * A number between 0 and 1, or an `Animated` number between 0 and 1. This number\n * represents the normalized progress of the animation. If you update this prop, the\n * animation will correspondingly update to the frame at that progress value. This\n * prop is not required if you are using the imperative API.\n */\n progress?: number | Animated.Value | AnimatedInterpolation;\n\n /**\n * The speed the animation will progress. This only affects the imperative API. The\n * default value is 1.\n */\n speed?: number;\n\n /**\n * The duration of the animation in ms. Takes precedence over speed when set.\n * This only works when source is an actual JS object of an animation.\n */\n duration?: number;\n\n /**\n * A boolean flag indicating whether or not the animation should loop.\n */\n loop?: boolean;\n\n /**\n * Style attributes for the view, as expected in a standard `View`:\n * http://facebook.github.io/react-native/releases/0.39/docs/view.html#style\n *\n * **CAVEAT: border styling is not supported.**\n */\n style?: StyleProp<ViewStyle>;\n\n /**\n * Determines how to resize the animated view when the frame doesn't match the raw image\n * dimensions.\n *\n * Refer to https://facebook.github.io/react-native/docs/image.html#resizemode\n */\n resizeMode?: 'cover' | 'contain' | 'center';\n\n /**\n * Determines how Lottie should render\n * Refer to LottieAnimationView#setRenderMode(RenderMode) for more information.\n */\n renderMode?: 'AUTOMATIC' | 'HARDWARE' | 'SOFTWARE';\n\n /**\n * A boolean flag indicating whether or not the animation should start automatically when\n * mounted. This only affects the imperative API.\n */\n autoPlay?: boolean;\n\n /**\n * A boolean flag indicating whether or not the animation should size itself automatically\n * according to the width in the animation's JSON. This only works when source is an actual\n * JS object of an animation.\n */\n autoSize?: boolean;\n\n /**\n * A callback function which will be called when animation is finished. Note that this\n * callback will be called only when `loop` is set to false.\n */\n onAnimationFinish?: (isCancelled: boolean) => void;\n\n /**\n * A callback function which will be called when the view has been laid out.\n */\n onLayout?: (event: LayoutChangeEvent) => void;\n\n /**\n * An array of layers you want to override its color filter.\n */\n colorFilters?: Array<ColorFilter>;\n\n /**\n * A string to identify the component during testing.\n */\n testID?: string;\n\n // Android Props\n\n /**\n * A boolean flag to enable merge patching.\n * @platform android\n */\n enableMergePathsAndroidForKitKatAndAbove?: boolean;\n\n /**\n * A boolean flag indicating whether or not the animation should caching. Defaults to true.\n * Refer to LottieAnimationView#setCacheComposition(boolean) for more information.\n *\n * @platform android\n */\n cacheComposition?: boolean;\n\n /**\n * An array of objects denoting text values to find and replace.\n *\n * @platform android\n */\n textFiltersAndroid?: Array<TextFilterAndroid>;\n\n /**\n * Relative folder inside of assets containing image files to be animated.\n * Make sure that the images that bodymovin export are in that folder with their names unchanged (should be img_#).\n * Refer to https://github.com/airbnb/lottie-android#image-support for more details.\n *\n * @platform android\n */\n imageAssetsFolder?: string;\n\n /**\n * Uses hardware acceleration to perform the animation. This should only\n * be used for animations where your width and height are equal to the composition width\n * and height, e.g. you are not scaling the animation.\n *\n * @platform android\n */\n hardwareAccelerationAndroid?: boolean;\n\n // iOS Props\n\n /**\n * An array of objects denoting text layers by KeyPath and a new string value.\n *\n * @platform ios\n */\n textFiltersIOS?: Array<TextFilterIOS>;\n\n // Windows Props\n\n /**\n * A boolean flag to enable use of platform-level looping on Windows. This improves loop smoothness,\n * but onAnimationLoop will not fire and changing the loop prop will restart playback.\n *\n * @platform windows\n */\n useNativeLooping?: boolean;\n\n /**\n * A callback function which will be called when the animation loops.\n *\n * @platform windows\n */\n onAnimationLoop?: () => void;\n\n // amznmod_react - add onAnimationLoad callback\n /**\n * A callback function which will be called when animation json load is finished.\n *\n * @platform kepler\n */\n onAnimationLoad?: () => void;\n\n // PROJ*-136246 - deprecate onAnimationJsonLoad in MR33\n // amznmod_react - add onAnimationJsonLoad callback\n /**\n * A callback function which will be called when animation json load is finished.\n *\n * @platform kepler\n */\n onAnimationJsonLoad?: () => void;\n\n // amznmod_react - add onAnimationPlay callback\n /**\n * A callback function which will be called when animation play is started.\n *\n * @platform kepler\n */\n onAnimationPlay?: () => void;\n\n // amznmod_react - add onAnimationPause callback\n /**\n * A callback function which will be called when animation is paused.\n *\n * @platform kepler\n */\n onAnimationPause?: () => void;\n\n // amznmod_react - add onAnimationResume callback\n /**\n * A callback function which will be called when animation is resumed.\n *\n * @platform kepler\n */\n onAnimationResume?: () => void;\n\n // amznmod_react - add textFiltersKepler prop\n /**\n * An array of objects denoting text values to find and replace.\n *\n * @platform kepler\n */\n textFiltersKepler?: Array<TextFilterKepler>;\n}\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,3 @@
1
+ import { AnimatedLottieView } from './LottieView';
2
+ export default AnimatedLottieView;
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["AnimatedLottieView"],"sources":["index.tsx"],"sourcesContent":["import { AnimatedLottieView } from './LottieView';\nexport default AnimatedLottieView;"],"mappings":"AAAA,SAASA,kBAAkB,QAAQ,cAAc;AACjD,eAAeA,kBAAkB","ignoreList":[]}
@@ -0,0 +1,91 @@
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
+ */
13
+
14
+ import codegenNativeCommands from 'react-native/Libraries/Utilities/codegenNativeCommands';
15
+ import register from '@amazon-devices/react-native-kepler/Libraries/Utilities/registerGeneratedViewConfig';
16
+
17
+ // amznmod_react - add EmptyEvent type
18
+
19
+ // amznmod_react - change NativeComponentType to HostComponent
20
+
21
+ export const Commands = codegenNativeCommands({
22
+ supportedCommands: ['play', 'reset', 'pause', 'resume']
23
+ });
24
+
25
+ // amznmod_react - native component registration to build for Kepler
26
+ const LottieNativeComponent = 'LottieAnimationView';
27
+ const viewConfig = {
28
+ autoPlay: true,
29
+ sourceName: true,
30
+ resizeMode: true,
31
+ renderMode: true,
32
+ sourceJson: true,
33
+ sourceURL: true,
34
+ imageAssetsFolder: true,
35
+ progress: true,
36
+ speed: true,
37
+ loop: true,
38
+ enableMergePathsAndroidForKitKatAndAbove: true,
39
+ hardwareAccelerationAndroid: true,
40
+ cacheComposition: true,
41
+ colorFilters: true,
42
+ textFiltersAndroid: true,
43
+ textFiltersIOS: true,
44
+ textFiltersKepler: true
45
+ };
46
+ const bubblingEventTypes = {
47
+ topOnAnimationFinish: {
48
+ phasedRegistrationNames: {
49
+ bubbled: 'onAnimationFinish',
50
+ captured: 'onAnimationFinishCapture'
51
+ }
52
+ },
53
+ topOnAnimationLoad: {
54
+ phasedRegistrationNames: {
55
+ bubbled: 'onAnimationLoad',
56
+ captured: 'onAnimationLoadCapture'
57
+ }
58
+ },
59
+ // PROJ*-136246 - deprecate onAnimationJsonLoad in MR33
60
+ topOnAnimationJsonLoad: {
61
+ phasedRegistrationNames: {
62
+ bubbled: 'onAnimationJsonLoad',
63
+ captured: 'onAnimationJsonLoadCapture'
64
+ }
65
+ },
66
+ topOnAnimationPlay: {
67
+ phasedRegistrationNames: {
68
+ bubbled: 'onAnimationPlay',
69
+ captured: 'onAnimationPlayCapture'
70
+ }
71
+ },
72
+ topOnAnimationPause: {
73
+ phasedRegistrationNames: {
74
+ bubbled: 'onAnimationPause',
75
+ captured: 'onAnimationPauseCapture'
76
+ }
77
+ },
78
+ topOnAnimationResume: {
79
+ phasedRegistrationNames: {
80
+ bubbled: 'onAnimationResume',
81
+ captured: 'onAnimationResumeCapture'
82
+ }
83
+ }
84
+ };
85
+ register(LottieNativeComponent, {
86
+ uiViewClassName: LottieNativeComponent,
87
+ validAttributes: viewConfig,
88
+ bubblingEventTypes: bubblingEventTypes
89
+ });
90
+ export default LottieNativeComponent;
91
+ //# sourceMappingURL=LottieAnimationViewNativeComponent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["codegenNativeCommands","register","Commands","supportedCommands","LottieNativeComponent","viewConfig","autoPlay","sourceName","resizeMode","renderMode","sourceJson","sourceURL","imageAssetsFolder","progress","speed","loop","enableMergePathsAndroidForKitKatAndAbove","hardwareAccelerationAndroid","cacheComposition","colorFilters","textFiltersAndroid","textFiltersIOS","textFiltersKepler","bubblingEventTypes","topOnAnimationFinish","phasedRegistrationNames","bubbled","captured","topOnAnimationLoad","topOnAnimationJsonLoad","topOnAnimationPlay","topOnAnimationPause","topOnAnimationResume","uiViewClassName","validAttributes"],"sources":["LottieAnimationViewNativeComponent.ts"],"sourcesContent":["/*\n * Portions of this file are copyright (c) 2023 Amazon.com, Inc. or its affiliates. All rights reserved.\n *\n * PORTIONS OF THIS FILE ARE AMAZON PROPRIETARY/CONFIDENTIAL. USE IS SUBJECT TO LICENSE TERMS.\n *\n * Amazon modifications are indicated by [amznmod_* comments].\n */\n\n/*\n * Changelog:\n * Set up lottie-react-native package to build for Kepler\n */\n\nimport type {\n BubblingEventHandler,\n Int32,\n Double,\n Float,\n} from 'react-native/Libraries/Types/CodegenTypes';\nimport codegenNativeCommands from 'react-native/Libraries/Utilities/codegenNativeCommands';\nimport type { HostComponent, ProcessedColorValue, ViewProps } from 'react-native';\nimport register from '@amazon-devices/react-native-kepler/Libraries/Utilities/registerGeneratedViewConfig';\n\nexport type OnAnimationFinishEvent = Readonly<{\n isCancelled: boolean;\n}>;\n\n// amznmod_react - add EmptyEvent type\nexport type EmptyEvent = {\n // Nothing to return in this event\n};\n\ntype ColorFilterStruct = Readonly<{\n keypath: string;\n color: ProcessedColorValue;\n}>;\n\ntype TextFilterIOSStruct = Readonly<{\n keypath: string;\n text: string;\n}>;\n\ntype TextFilterAndroidStruct = Readonly<{\n find: string;\n replace: string;\n}>;\n\ntype TextFilterKeplerStruct = Readonly<{\n keypath: string;\n text: string;\n}>;\n\nexport interface NativeProps extends ViewProps {\n // amznmod_react - add autoPlay as native prop to avoid component mount race condition\n autoPlay?: boolean;\n resizeMode?: string;\n renderMode?: string;\n sourceName?: string;\n sourceJson?: string;\n sourceURL?: string;\n imageAssetsFolder?: string;\n progress?: Float;\n speed?: Double;\n loop?: boolean;\n enableMergePathsAndroidForKitKatAndAbove?: boolean;\n hardwareAccelerationAndroid?: boolean;\n cacheComposition?: boolean;\n colorFilters?: ReadonlyArray<ColorFilterStruct>;\n // dummy that solves codegen issue when there's a ReadonlyArray<Object> without another Object prop\n // https://github.com/reactwg/react-native-new-architecture/discussions/104\n dummy?: Readonly<{ dummy: boolean }>;\n textFiltersAndroid?: ReadonlyArray<TextFilterAndroidStruct>;\n textFiltersIOS?: ReadonlyArray<TextFilterIOSStruct>;\n // amznmod_react - add textFiltersKepler prop\n textFiltersKepler?: ReadonlyArray<TextFilterKeplerStruct>;\n onAnimationFinish?: BubblingEventHandler<\n OnAnimationFinishEvent,\n 'onAnimationFinish'\n >;\n // amznmod_react - add onAnimation... callbacks\n onAnimationLoad?: BubblingEventHandler<EmptyEvent>;\n onAnimationPlay?: BubblingEventHandler<EmptyEvent>;\n onAnimationPause?: BubblingEventHandler<EmptyEvent>;\n onAnimationResume?: BubblingEventHandler<EmptyEvent>;\n // PROJ*-136246 - deprecate onAnimationJsonLoad in MR33\n onAnimationJsonLoad?: BubblingEventHandler<EmptyEvent>;\n}\n\n// amznmod_react - change NativeComponentType to HostComponent\ntype LottieViewNativeComponentType = HostComponent<NativeProps>;\n\ninterface NativeCommands {\n play: (\n viewRef: React.ElementRef<LottieViewNativeComponentType>,\n startFrame: Int32,\n endFrame: Int32,\n ) => void;\n reset: (viewRef: React.ElementRef<LottieViewNativeComponentType>) => void;\n pause: (viewRef: React.ElementRef<LottieViewNativeComponentType>) => void;\n resume: (viewRef: React.ElementRef<LottieViewNativeComponentType>) => void;\n}\n\nexport const Commands: NativeCommands = codegenNativeCommands<NativeCommands>({\n supportedCommands: ['play', 'reset', 'pause', 'resume'],\n});\n\n// amznmod_react - native component registration to build for Kepler\nconst LottieNativeComponent = 'LottieAnimationView'\nconst viewConfig = {\n autoPlay: true,\n sourceName: true,\n resizeMode: true,\n renderMode: true,\n sourceJson: true,\n sourceURL: true,\n imageAssetsFolder: true,\n progress: true,\n speed: true,\n loop: true,\n enableMergePathsAndroidForKitKatAndAbove: true,\n hardwareAccelerationAndroid: true,\n cacheComposition: true,\n colorFilters: true,\n textFiltersAndroid: true,\n textFiltersIOS: true,\n textFiltersKepler: true,\n};\n\nconst bubblingEventTypes = {\n topOnAnimationFinish: {\n phasedRegistrationNames: {\n bubbled: 'onAnimationFinish',\n captured: 'onAnimationFinishCapture'\n }\n },\n topOnAnimationLoad: {\n phasedRegistrationNames: {\n bubbled: 'onAnimationLoad',\n captured: 'onAnimationLoadCapture'\n }\n },\n // PROJ*-136246 - deprecate onAnimationJsonLoad in MR33\n topOnAnimationJsonLoad: {\n phasedRegistrationNames: {\n bubbled: 'onAnimationJsonLoad',\n captured: 'onAnimationJsonLoadCapture'\n }\n },\n topOnAnimationPlay: {\n phasedRegistrationNames: {\n bubbled: 'onAnimationPlay',\n captured: 'onAnimationPlayCapture'\n }\n },\n topOnAnimationPause: {\n phasedRegistrationNames: {\n bubbled: 'onAnimationPause',\n captured: 'onAnimationPauseCapture'\n }\n },\n topOnAnimationResume: {\n phasedRegistrationNames: {\n bubbled: 'onAnimationResume',\n captured: 'onAnimationResumeCapture'\n }\n }\n};\n\nregister(LottieNativeComponent, {uiViewClassName: LottieNativeComponent, validAttributes: viewConfig, bubblingEventTypes: bubblingEventTypes});\nexport default (LottieNativeComponent as unknown) as HostComponent<NativeProps>;"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAQA,OAAOA,qBAAqB,MAAM,wDAAwD;AAE1F,OAAOC,QAAQ,MAAM,2EAA2E;;AAMhG;;AA6DA;;AAcA,OAAO,MAAMC,QAAwB,GAAGF,qBAAqB,CAAiB;EAC5EG,iBAAiB,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ;AACxD,CAAC,CAAC;;AAEF;AACA,MAAMC,qBAAqB,GAAG,qBAAqB;AACn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eAAe,EAAE7B,UAAU;EAAEkB,kBAAkB,EAAEA;AAAkB,CAAC,CAAC;AAC9I,eAAgBnB,qBAAqB","ignoreList":[]}
@@ -0,0 +1,27 @@
1
+ import React from 'react';
2
+ import { NativeSyntheticEvent } from 'react-native';
3
+ import type { AnimatedLottieViewProps } from './LottieView.types';
4
+ import NativeLottieAnimationView from './specs/LottieAnimationViewNativeComponent';
5
+ /**
6
+ * View hosting the lottie animation.
7
+ */
8
+ export declare class AnimatedLottieView extends React.PureComponent<AnimatedLottieViewProps, {}> {
9
+ static defaultProps: AnimatedLottieViewProps;
10
+ _lottieAnimationViewRef: React.ElementRef<typeof NativeLottieAnimationView> | undefined;
11
+ constructor(props: AnimatedLottieViewProps);
12
+ componentDidUpdate(prevProps: AnimatedLottieViewProps): void;
13
+ play(startFrame?: number, endFrame?: number): void;
14
+ reset(): void;
15
+ pause(): void;
16
+ resume(): void;
17
+ onAnimationFinish: (evt: NativeSyntheticEvent<{
18
+ isCancelled: boolean;
19
+ }>) => void;
20
+ onAnimationLoad: () => void;
21
+ onAnimationJsonLoad: () => void;
22
+ onAnimationPlay: () => void;
23
+ onAnimationPause: () => void;
24
+ onAnimationResume: () => void;
25
+ _captureRef(ref: React.ElementRef<typeof NativeLottieAnimationView>): void;
26
+ render(): React.ReactNode;
27
+ }