@coorpacademy/components 10.16.4-alpha.1 → 10.17.0

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 (36) hide show
  1. package/README.md +34 -0
  2. package/es/atom/lottie-wrapper/index.js +130 -0
  3. package/es/atom/lottie-wrapper/index.js.map +1 -0
  4. package/es/atom/lottie-wrapper/style.css +15 -0
  5. package/es/atom/lottie-wrapper/test/fixtures/confetti.js +17 -0
  6. package/es/atom/lottie-wrapper/test/fixtures/confetti.js.map +1 -0
  7. package/es/atom/lottie-wrapper/test/fixtures/default.js +17 -0
  8. package/es/atom/lottie-wrapper/test/fixtures/default.js.map +1 -0
  9. package/es/atom/lottie-wrapper/test/fixtures/rank.js +13 -0
  10. package/es/atom/lottie-wrapper/test/fixtures/rank.js.map +1 -0
  11. package/es/atom/lottie-wrapper/test/fixtures.js +17 -0
  12. package/es/atom/lottie-wrapper/test/fixtures.js.map +1 -0
  13. package/es/atom/lottie-wrapper/test/lottie.js +82 -0
  14. package/es/atom/lottie-wrapper/test/lottie.js.map +1 -0
  15. package/es/molecule/teams-popin/test/fixtures/loading-background.js +1 -1
  16. package/es/molecule/teams-popin/test/fixtures/loading-background.js.map +1 -1
  17. package/es/molecule/teams-popin/test/fixtures/login-background.js +1 -1
  18. package/es/molecule/teams-popin/test/fixtures/login-background.js.map +1 -1
  19. package/lib/atom/lottie-wrapper/index.js +152 -0
  20. package/lib/atom/lottie-wrapper/index.js.map +1 -0
  21. package/lib/atom/lottie-wrapper/style.css +15 -0
  22. package/lib/atom/lottie-wrapper/test/fixtures/confetti.js +22 -0
  23. package/lib/atom/lottie-wrapper/test/fixtures/confetti.js.map +1 -0
  24. package/lib/atom/lottie-wrapper/test/fixtures/default.js +22 -0
  25. package/lib/atom/lottie-wrapper/test/fixtures/default.js.map +1 -0
  26. package/lib/atom/lottie-wrapper/test/fixtures/rank.js +18 -0
  27. package/lib/atom/lottie-wrapper/test/fixtures/rank.js.map +1 -0
  28. package/lib/atom/lottie-wrapper/test/fixtures.js +28 -0
  29. package/lib/atom/lottie-wrapper/test/fixtures.js.map +1 -0
  30. package/lib/atom/lottie-wrapper/test/lottie.js +97 -0
  31. package/lib/atom/lottie-wrapper/test/lottie.js.map +1 -0
  32. package/lib/molecule/teams-popin/test/fixtures/loading-background.js +1 -1
  33. package/lib/molecule/teams-popin/test/fixtures/loading-background.js.map +1 -1
  34. package/lib/molecule/teams-popin/test/fixtures/login-background.js +1 -1
  35. package/lib/molecule/teams-popin/test/fixtures/login-background.js.map +1 -1
  36. package/package.json +5 -3
package/README.md CHANGED
@@ -91,6 +91,40 @@ example:
91
91
  ...
92
92
  ```
93
93
 
94
+ ### Using a Lottie Animation
95
+
96
+ To use a lottie animation, you need to use the LottieWrapper Atom.
97
+
98
+ Among the Lottie Atom's props, there are two *important* props: animationSrc & ie11ImageBackup,
99
+ that need an additional step, the ie11ImageBackup is needed as it's name implies because ie11 doesn't
100
+ support Lottie (more specifically Web Components due to the Shadow DOM).
101
+
102
+ First, you must upload to AWS S3 any new animation, in one of the static buckets (depending on the desired env), ex:
103
+ `https://static-staging.coorpacademy.com/animations/review/`.
104
+
105
+ This animation must be paired with a backup image (svg) that'll be used for the ie11 scenario.
106
+
107
+ Then, use the urls as props for animationSrc & ie11ImageBackup, ex:
108
+
109
+ ```javascript
110
+ const props = {
111
+ 'aria-label': 'aria lottie',
112
+ 'data-name': 'default-lottie',
113
+ className: undefined,
114
+ animationSrc: 'https://static-staging.coorpacademy.com/animations/review/rank.json',
115
+ loop: true,
116
+ height: 200,
117
+ width: 200,
118
+ ie11ImageBackup:
119
+ 'https://static-staging.coorpacademy.com/animations/review/rank_icon_congrats.svg'
120
+ }
121
+ ```
122
+
123
+ #### Additional information:
124
+
125
+ The props include classNames && size control to handle additional styling.
126
+
127
+
94
128
  ## Locally use in an external project
95
129
 
96
130
  Link your dependencies:
@@ -0,0 +1,130 @@
1
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+
3
+ import React, { useMemo, useRef, useEffect, useState } from 'react';
4
+ import PropTypes from 'prop-types';
5
+ import classnames from 'classnames';
6
+ import lottie from 'lottie-web';
7
+ import get from 'lodash/fp/get';
8
+ import has from 'lodash/fp/has';
9
+ import includes from 'lodash/fp/includes';
10
+ import unfetch from 'isomorphic-unfetch';
11
+ import style from './style.css';
12
+
13
+ const isIE11 = () => {
14
+ if (typeof window === 'undefined') return;
15
+ const userAgent = get('navigator.userAgent', window);
16
+ const hasMsCrypto = has('msCrypto', window);
17
+ const hasRevision = includes('rv:', userAgent);
18
+ const hasTrident = includes('Trident/', userAgent);
19
+ return hasMsCrypto || hasRevision && hasTrident;
20
+ };
21
+
22
+ export const fetchAndLoadAnimation = async (animationSrc, containerRef, loop, animationClassnames, hideOnTransparent, _lottie, _fetch) => {
23
+ const animationUrl = new URL(animationSrc).toString();
24
+ const fetchResult = await _fetch(animationUrl, {
25
+ headers: {
26
+ 'X-Requested-With': 'XMLHttpRequest',
27
+ 'Content-Type': 'application/json'
28
+ }
29
+ });
30
+ const animationData = await fetchResult.json();
31
+
32
+ const animation = _lottie.loadAnimation({
33
+ container: containerRef.current,
34
+ // the dom element that will contain the animation
35
+ renderer: 'svg',
36
+ autoplay: true,
37
+ loop,
38
+ animationData,
39
+ rendererSettings: {
40
+ className: animationClassnames,
41
+ hideOnTransparent,
42
+ preserveAspectRatio: 'xMidYMid meet' // same options as a preserveAspectRatio prop
43
+
44
+ }
45
+ });
46
+
47
+ return animation;
48
+ };
49
+
50
+ const LottieWrapper = props => {
51
+ const {
52
+ className,
53
+ 'data-name': dataName,
54
+ 'aria-label': ariaLabel,
55
+ animationSrc,
56
+ loop = false,
57
+ rendererSettings = {},
58
+ width,
59
+ height,
60
+ ie11ImageBackup,
61
+ backupImageClassName
62
+ } = props;
63
+ const {
64
+ className: animationClassName,
65
+ hideOnTransparent = true
66
+ } = rendererSettings;
67
+ const containerRef = useRef(null);
68
+ const [animationItem, setAnimationItem] = useState(null);
69
+
70
+ const _isIE11 = useMemo(() => isIE11(), []);
71
+
72
+ const wrapperClassName = useMemo(() => classnames(className, style.lottieContainer), [className]);
73
+ const lottieAnimationClassName = useMemo(() => classnames(animationClassName, style.animation), [animationClassName]);
74
+ const ie11BackupImageClassName = useMemo(() => classnames(backupImageClassName, style.backupImage), [backupImageClassName]);
75
+ useEffect(() => {
76
+ const loadAnimation = async () => {
77
+ if (!_isIE11 && !animationItem) {
78
+ /* istanbul ignore next */
79
+ if (typeof window !== 'undefined') {
80
+ window.lottie = lottie;
81
+ }
82
+
83
+ const animation = await fetchAndLoadAnimation(animationSrc, containerRef, loop, lottieAnimationClassName, hideOnTransparent, lottie, unfetch);
84
+ /* istanbul ignore next */
85
+
86
+ setAnimationItem(animation);
87
+ }
88
+ };
89
+
90
+ loadAnimation();
91
+ return () => animationItem &&
92
+ /* istanbul ignore next */
93
+ lottie.destroy(animationItem.name);
94
+ }, [lottieAnimationClassName, containerRef, hideOnTransparent, loop, animationSrc, _isIE11, animationItem]);
95
+ return /*#__PURE__*/React.createElement("div", {
96
+ ref: containerRef,
97
+ "aria-label": ariaLabel,
98
+ "data-name": dataName,
99
+ className: wrapperClassName,
100
+ style: _extends(_extends({}, width && {
101
+ width: `${width}px`,
102
+ maxWidth: `${width}px`
103
+ }), height && {
104
+ height: `${height}px`,
105
+ maxHeight: `${height}px`
106
+ })
107
+ }, _isIE11 ? /*#__PURE__*/React.createElement("img", {
108
+ src: ie11ImageBackup,
109
+ className: ie11BackupImageClassName,
110
+ "data-name": "ie11-backup-image"
111
+ }) : null);
112
+ };
113
+
114
+ LottieWrapper.propTypes = process.env.NODE_ENV !== "production" ? {
115
+ 'aria-label': PropTypes.string.isRequired,
116
+ 'data-name': PropTypes.string,
117
+ animationSrc: PropTypes.string.isRequired,
118
+ loop: PropTypes.bool,
119
+ rendererSettings: PropTypes.shape({
120
+ hideOnTransparent: PropTypes.bool,
121
+ className: PropTypes.string
122
+ }),
123
+ height: PropTypes.number,
124
+ width: PropTypes.number,
125
+ className: PropTypes.string,
126
+ ie11ImageBackup: PropTypes.string.isRequired,
127
+ backupImageClassName: PropTypes.string
128
+ } : {};
129
+ export default LottieWrapper;
130
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/atom/lottie-wrapper/index.js"],"names":["React","useMemo","useRef","useEffect","useState","PropTypes","classnames","lottie","get","has","includes","unfetch","style","isIE11","window","userAgent","hasMsCrypto","hasRevision","hasTrident","fetchAndLoadAnimation","animationSrc","containerRef","loop","animationClassnames","hideOnTransparent","_lottie","_fetch","animationUrl","URL","toString","fetchResult","headers","animationData","json","animation","loadAnimation","container","current","renderer","autoplay","rendererSettings","className","preserveAspectRatio","LottieWrapper","props","dataName","ariaLabel","width","height","ie11ImageBackup","backupImageClassName","animationClassName","animationItem","setAnimationItem","_isIE11","wrapperClassName","lottieContainer","lottieAnimationClassName","ie11BackupImageClassName","backupImage","destroy","name","maxWidth","maxHeight","propTypes","string","isRequired","bool","shape","number"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,OAAf,EAAwBC,MAAxB,EAAgCC,SAAhC,EAA2CC,QAA3C,QAA0D,OAA1D;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,MAAP,MAAmB,YAAnB;AACA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,QAAP,MAAqB,oBAArB;AACA,OAAOC,OAAP,MAAoB,oBAApB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,MAAM,GAAG,MAAM;AACnB,MAAI,OAAOC,MAAP,KAAkB,WAAtB,EAAmC;AACnC,QAAMC,SAAS,GAAGP,GAAG,CAAC,qBAAD,EAAwB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B,SAAS,CAAC8D,IADG;AAEhC1B,IAAAA,SAAS,EAAEpC,SAAS,CAAC4D;AAFW,GAAhB,CALM;AASxBjB,EAAAA,MAAM,EAAE3C,SAAS,CAACgE,MATM;AAUxBtB,EAAAA,KAAK,EAAE1C,SAAS,CAACgE,MAVO;AAWxB5B,EAAAA,SAAS,EAAEpC,SAAS,CAAC4D,MAXG;AAYxBhB,EAAAA,eAAe,EAAE5C,SAAS,CAAC4D,MAAV,CAAiBC,UAZV;AAaxBhB,EAAAA,oBAAoB,EAAE7C,SAAS,CAAC4D;AAbR,CAA1B;AAgBA,eAAetB,aAAf","sourcesContent":["import React, {useMemo, useRef, useEffect, useState} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport lottie from 'lottie-web';\nimport get from 'lodash/fp/get';\nimport has from 'lodash/fp/has';\nimport includes from 'lodash/fp/includes';\nimport unfetch from 'isomorphic-unfetch';\nimport style from './style.css';\n\nconst isIE11 = () => {\n if (typeof window === 'undefined') return;\n const userAgent = get('navigator.userAgent', window);\n const hasMsCrypto = has('msCrypto', window);\n const hasRevision = includes('rv:', userAgent);\n const hasTrident = includes('Trident/', userAgent);\n\n return hasMsCrypto || (hasRevision && hasTrident);\n};\n\nexport const fetchAndLoadAnimation = async (\n animationSrc,\n containerRef,\n loop,\n animationClassnames,\n hideOnTransparent,\n _lottie,\n _fetch\n) => {\n const animationUrl = new URL(animationSrc).toString();\n const fetchResult = await _fetch(animationUrl, {\n headers: {\n 'X-Requested-With': 'XMLHttpRequest',\n 'Content-Type': 'application/json'\n }\n });\n\n const animationData = await fetchResult.json();\n\n const animation = _lottie.loadAnimation({\n container: containerRef.current, // the dom element that will contain the animation\n renderer: 'svg',\n autoplay: true,\n loop,\n animationData,\n rendererSettings: {\n className: animationClassnames,\n hideOnTransparent,\n preserveAspectRatio: 'xMidYMid meet' // same options as a preserveAspectRatio prop\n }\n });\n return animation;\n};\n\nconst LottieWrapper = props => {\n const {\n className,\n 'data-name': dataName,\n 'aria-label': ariaLabel,\n animationSrc,\n loop = false,\n rendererSettings = {},\n width,\n height,\n ie11ImageBackup,\n backupImageClassName\n } = props;\n\n const {className: animationClassName, hideOnTransparent = true} = rendererSettings;\n\n const containerRef = useRef(null);\n\n const [animationItem, setAnimationItem] = useState(null);\n\n const _isIE11 = useMemo(() => isIE11(), []);\n\n const wrapperClassName = useMemo(() => classnames(className, style.lottieContainer), [className]);\n\n const lottieAnimationClassName = useMemo(() => classnames(animationClassName, style.animation), [\n animationClassName\n ]);\n\n const ie11BackupImageClassName = useMemo(\n () => classnames(backupImageClassName, style.backupImage),\n [backupImageClassName]\n );\n\n useEffect(() => {\n const loadAnimation = async () => {\n if (!_isIE11 && !animationItem) {\n /* istanbul ignore next */\n if (typeof window !== 'undefined') {\n window.lottie = lottie;\n }\n const animation = await fetchAndLoadAnimation(\n animationSrc,\n containerRef,\n loop,\n lottieAnimationClassName,\n hideOnTransparent,\n lottie,\n unfetch\n );\n\n /* istanbul ignore next */\n setAnimationItem(animation);\n }\n };\n\n loadAnimation();\n return () => animationItem && /* istanbul ignore next */ lottie.destroy(animationItem.name);\n }, [\n lottieAnimationClassName,\n containerRef,\n hideOnTransparent,\n loop,\n animationSrc,\n _isIE11,\n animationItem\n ]);\n\n return (\n <div\n ref={containerRef}\n aria-label={ariaLabel}\n data-name={dataName}\n className={wrapperClassName}\n style={{\n ...(width && {\n width: `${width}px`,\n maxWidth: `${width}px`\n }),\n ...(height && {\n height: `${height}px`,\n maxHeight: `${height}px`\n })\n }}\n >\n {_isIE11 ? (\n <img\n src={ie11ImageBackup}\n className={ie11BackupImageClassName}\n data-name=\"ie11-backup-image\"\n />\n ) : null}\n </div>\n );\n};\n\nLottieWrapper.propTypes = {\n 'aria-label': PropTypes.string.isRequired,\n 'data-name': PropTypes.string,\n animationSrc: PropTypes.string.isRequired,\n loop: PropTypes.bool,\n rendererSettings: PropTypes.shape({\n hideOnTransparent: PropTypes.bool,\n className: PropTypes.string\n }),\n height: PropTypes.number,\n width: PropTypes.number,\n className: PropTypes.string,\n ie11ImageBackup: PropTypes.string.isRequired,\n backupImageClassName: PropTypes.string\n};\n\nexport default LottieWrapper;\n"],"file":"index.js"}
@@ -0,0 +1,15 @@
1
+ .lottieContainer {
2
+ position: relative;
3
+ display: flex;
4
+ }
5
+
6
+ .animation {
7
+ display: flex;
8
+ height: 100%;
9
+ width: 100%;
10
+ }
11
+
12
+ .backupImage {
13
+ height: 100%;
14
+ width: 100%;
15
+ }
@@ -0,0 +1,17 @@
1
+ export default {
2
+ props: {
3
+ 'aria-label': 'aria lottie',
4
+ 'data-name': 'default-lottie',
5
+ className: undefined,
6
+ animationSrc: 'https://static-staging.coorpacademy.com/animations/review/confetti.json',
7
+ loop: undefined,
8
+ rendererSettings: {
9
+ hideOnTransparent: false,
10
+ animationClassName: ''
11
+ },
12
+ height: 600,
13
+ width: 1000,
14
+ ie11ImageBackup: 'https://static-staging.coorpacademy.com/animations/review/conffeti_congrats.svg'
15
+ }
16
+ };
17
+ //# sourceMappingURL=confetti.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/atom/lottie-wrapper/test/fixtures/confetti.js"],"names":["props","className","undefined","animationSrc","loop","rendererSettings","hideOnTransparent","animationClassName","height","width","ie11ImageBackup"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACL,kBAAc,aADT;AAEL,iBAAa,gBAFR;AAGLC,IAAAA,SAAS,EAAEC,SAHN;AAILC,IAAAA,YAAY,EAAE,yEAJT;AAKLC,IAAAA,IAAI,EAAEF,SALD;AAMLG,IAAAA,gBAAgB,EAAE;AAChBC,MAAAA,iBAAiB,EAAE,KADH;AAEhBC,MAAAA,kBAAkB,EAAE;AAFJ,KANb;AAULC,IAAAA,MAAM,EAAE,GAVH;AAWLC,IAAAA,KAAK,EAAE,IAXF;AAYLC,IAAAA,eAAe,EACb;AAbG;AADM,CAAf","sourcesContent":["export default {\n props: {\n 'aria-label': 'aria lottie',\n 'data-name': 'default-lottie',\n className: undefined,\n animationSrc: 'https://static-staging.coorpacademy.com/animations/review/confetti.json',\n loop: undefined,\n rendererSettings: {\n hideOnTransparent: false,\n animationClassName: ''\n },\n height: 600,\n width: 1000,\n ie11ImageBackup:\n 'https://static-staging.coorpacademy.com/animations/review/conffeti_congrats.svg'\n }\n};\n"],"file":"confetti.js"}
@@ -0,0 +1,17 @@
1
+ export default {
2
+ props: {
3
+ 'aria-label': 'aria lottie',
4
+ 'data-name': 'default-lottie',
5
+ className: undefined,
6
+ animationSrc: 'https://static-staging.coorpacademy.com/animations/review/star.json',
7
+ loop: false,
8
+ rendererSettings: {
9
+ hideOnTransparent: false,
10
+ animationClassName: ''
11
+ },
12
+ height: 200,
13
+ width: 200,
14
+ ie11ImageBackup: 'https://static-staging.coorpacademy.com/animations/review/stars_icon_congrats.svg'
15
+ }
16
+ };
17
+ //# sourceMappingURL=default.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/atom/lottie-wrapper/test/fixtures/default.js"],"names":["props","className","undefined","animationSrc","loop","rendererSettings","hideOnTransparent","animationClassName","height","width","ie11ImageBackup"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACL,kBAAc,aADT;AAEL,iBAAa,gBAFR;AAGLC,IAAAA,SAAS,EAAEC,SAHN;AAILC,IAAAA,YAAY,EAAE,qEAJT;AAKLC,IAAAA,IAAI,EAAE,KALD;AAMLC,IAAAA,gBAAgB,EAAE;AAChBC,MAAAA,iBAAiB,EAAE,KADH;AAEhBC,MAAAA,kBAAkB,EAAE;AAFJ,KANb;AAULC,IAAAA,MAAM,EAAE,GAVH;AAWLC,IAAAA,KAAK,EAAE,GAXF;AAYLC,IAAAA,eAAe,EACb;AAbG;AADM,CAAf","sourcesContent":["export default {\n props: {\n 'aria-label': 'aria lottie',\n 'data-name': 'default-lottie',\n className: undefined,\n animationSrc: 'https://static-staging.coorpacademy.com/animations/review/star.json',\n loop: false,\n rendererSettings: {\n hideOnTransparent: false,\n animationClassName: ''\n },\n height: 200,\n width: 200,\n ie11ImageBackup:\n 'https://static-staging.coorpacademy.com/animations/review/stars_icon_congrats.svg'\n }\n};\n"],"file":"default.js"}
@@ -0,0 +1,13 @@
1
+ export default {
2
+ props: {
3
+ 'aria-label': 'aria lottie',
4
+ 'data-name': 'default-lottie',
5
+ className: undefined,
6
+ animationSrc: 'https://static-staging.coorpacademy.com/animations/review/rank.json',
7
+ loop: true,
8
+ height: 200,
9
+ width: 200,
10
+ ie11ImageBackup: 'https://static-staging.coorpacademy.com/animations/review/rank_icon_congrats.svg'
11
+ }
12
+ };
13
+ //# sourceMappingURL=rank.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/atom/lottie-wrapper/test/fixtures/rank.js"],"names":["props","className","undefined","animationSrc","loop","height","width","ie11ImageBackup"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACL,kBAAc,aADT;AAEL,iBAAa,gBAFR;AAGLC,IAAAA,SAAS,EAAEC,SAHN;AAILC,IAAAA,YAAY,EAAE,qEAJT;AAKLC,IAAAA,IAAI,EAAE,IALD;AAMLC,IAAAA,MAAM,EAAE,GANH;AAOLC,IAAAA,KAAK,EAAE,GAPF;AAQLC,IAAAA,eAAe,EACb;AATG;AADM,CAAf","sourcesContent":["export default {\n props: {\n 'aria-label': 'aria lottie',\n 'data-name': 'default-lottie',\n className: undefined,\n animationSrc: 'https://static-staging.coorpacademy.com/animations/review/rank.json',\n loop: true,\n height: 200,\n width: 200,\n ie11ImageBackup:\n 'https://static-staging.coorpacademy.com/animations/review/rank_icon_congrats.svg'\n }\n};\n"],"file":"rank.js"}
@@ -0,0 +1,17 @@
1
+ import test from 'ava';
2
+ import forEach from 'lodash/forEach';
3
+ import renderComponentMacro from '../../../test/helpers/render-component';
4
+ import AtomLottieWrapper from '..';
5
+ import fixtureConfetti from './fixtures/confetti';
6
+ import fixtureDefault from './fixtures/default';
7
+ import fixtureRank from './fixtures/rank';
8
+ test('Atom › AtomLottieWrapper > should have valid propTypes', t => {
9
+ t.pass();
10
+ forEach(AtomLottieWrapper.propTypes, (value, key) => {
11
+ t.not(value, undefined, `PropType for "Atom.AtomLottieWrapper.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
12
+ });
13
+ });
14
+ test('Atom › AtomLottieWrapper › Confetti › should be rendered', renderComponentMacro, AtomLottieWrapper, fixtureConfetti);
15
+ test('Atom › AtomLottieWrapper › Default › should be rendered', renderComponentMacro, AtomLottieWrapper, fixtureDefault);
16
+ test('Atom › AtomLottieWrapper › Rank › should be rendered', renderComponentMacro, AtomLottieWrapper, fixtureRank);
17
+ //# sourceMappingURL=fixtures.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/atom/lottie-wrapper/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","AtomLottieWrapper","fixtureConfetti","fixtureDefault","fixtureRank","t","pass","propTypes","value","key","not","undefined"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,KAAjB;AACA,OAAOC,OAAP,MAAoB,gBAApB;AACA,OAAOC,oBAAP,MAAiC,wCAAjC;AACA,OAAOC,iBAAP,MAA8B,IAA9B;AACA,OAAOC,eAAP,MAA4B,qBAA5B;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,WAAP,MAAwB,iBAAxB;AAEAN,IAAI,CAAC,wDAAD,EAA2DO,CAAC,IAAI;AAClEA,EAAAA,CAAC,CAACC,IAAF;AACAP,EAAAA,OAAO,CAACE,iBAAiB,CAACM,SAAnB,EAA8B,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACnDJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,kDAAiDF,GAAI,mEAA9E;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAX,IAAI,CAAC,0DAAD,EAA6DE,oBAA7D,EAAmFC,iBAAnF,EAAsGC,eAAtG,CAAJ;AACAJ,IAAI,CAAC,yDAAD,EAA4DE,oBAA5D,EAAkFC,iBAAlF,EAAqGE,cAArG,CAAJ;AACAL,IAAI,CAAC,sDAAD,EAAyDE,oBAAzD,EAA+EC,iBAA/E,EAAkGG,WAAlG,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport AtomLottieWrapper from '..';\nimport fixtureConfetti from './fixtures/confetti';\nimport fixtureDefault from './fixtures/default';\nimport fixtureRank from './fixtures/rank';\n\ntest('Atom › AtomLottieWrapper > should have valid propTypes', t => {\n t.pass();\n forEach(AtomLottieWrapper.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Atom.AtomLottieWrapper.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Atom › AtomLottieWrapper › Confetti › should be rendered', renderComponentMacro, AtomLottieWrapper, fixtureConfetti);\ntest('Atom › AtomLottieWrapper › Default › should be rendered', renderComponentMacro, AtomLottieWrapper, fixtureDefault);\ntest('Atom › AtomLottieWrapper › Rank › should be rendered', renderComponentMacro, AtomLottieWrapper, fixtureRank);\n"],"file":"fixtures.js"}
@@ -0,0 +1,82 @@
1
+ import browserEnv from 'browser-env';
2
+ import test from 'ava';
3
+ import React from 'react';
4
+ import { mount, configure } from 'enzyme';
5
+ import Adapter from 'enzyme-adapter-react-16';
6
+ import LottieWrapper, { fetchAndLoadAnimation } from '..';
7
+ import starFixture from './fixtures/default';
8
+ browserEnv();
9
+ configure({
10
+ adapter: new Adapter()
11
+ });
12
+ test('should update && load the animation, should clean up after unmount', t => {
13
+ const wrapper = mount( /*#__PURE__*/React.createElement(LottieWrapper, starFixture.props));
14
+ wrapper.update();
15
+ const backupImage = wrapper.find('[data-name="ie11-backup-image"]');
16
+ t.false(backupImage.at(0).exists());
17
+ wrapper.unmount();
18
+ t.pass();
19
+ });
20
+ test('ie11: should load an image in place of the animation', t => {
21
+ window.msCrypto = () => {}; // eslint-disable-next-line lodash-fp/prefer-constant
22
+
23
+
24
+ window.navigator.__defineGetter__('userAgent', function () {
25
+ return 'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko';
26
+ });
27
+
28
+ const wrapper = mount( /*#__PURE__*/React.createElement(LottieWrapper, starFixture.props));
29
+ wrapper.update();
30
+ const backupImage = wrapper.find('[data-name="ie11-backup-image"]');
31
+ t.true(backupImage.at(0).exists());
32
+ wrapper.unmount();
33
+ delete window.msCrypto; // eslint-disable-next-line lodash-fp/prefer-constant
34
+
35
+ window.navigator.__defineGetter__('userAgent', function () {
36
+ return 'Mozilla/5.0 (darwin) AppleWebKit/537.36 (KHTML, like Gecko) jsdom/13.2.0';
37
+ });
38
+
39
+ t.pass();
40
+ });
41
+ test('other browser: should not load an image in place of the animation', t => {
42
+ // eslint-disable-next-line lodash-fp/prefer-constant
43
+ window.navigator.__defineGetter__('userAgent', function () {
44
+ return 'Mozilla/5.0 (other stuff; rv:77.0) like Gecko';
45
+ });
46
+
47
+ const wrapper = mount( /*#__PURE__*/React.createElement(LottieWrapper, starFixture.props));
48
+ const backupImage = wrapper.find('[data-name="ie11-backup-image"]');
49
+ t.false(backupImage.at(0).exists());
50
+ wrapper.unmount(); // eslint-disable-next-line lodash-fp/prefer-constant
51
+
52
+ window.navigator.__defineGetter__('userAgent', function () {
53
+ return 'Mozilla/5.0 (darwin) AppleWebKit/537.36 (KHTML, like Gecko) jsdom/13.2.0';
54
+ });
55
+
56
+ t.pass();
57
+ });
58
+ test('fetchAndLoadAnimation', async t => {
59
+ t.plan(3);
60
+ const props = starFixture.props;
61
+ const _lottie = {
62
+ loadAnimation: () => {
63
+ t.pass();
64
+ return {
65
+ name: 'animation'
66
+ };
67
+ }
68
+ };
69
+
70
+ const _fetch = () => {
71
+ t.pass();
72
+ return {
73
+ json: () => ({
74
+ animationData: 'some value'
75
+ })
76
+ };
77
+ };
78
+
79
+ const animation = await fetchAndLoadAnimation(props.animationSrc, '123456', true, 'test', true, _lottie, _fetch);
80
+ t.is(animation.name, 'animation');
81
+ });
82
+ //# sourceMappingURL=lottie.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/atom/lottie-wrapper/test/lottie.js"],"names":["browserEnv","test","React","mount","configure","Adapter","LottieWrapper","fetchAndLoadAnimation","starFixture","adapter","t","wrapper","props","update","backupImage","find","false","at","exists","unmount","pass","window","msCrypto","navigator","__defineGetter__","true","plan","_lottie","loadAnimation","name","_fetch","json","animationData","animation","animationSrc","is"],"mappings":"AAAA,OAAOA,UAAP,MAAuB,aAAvB;AACA,OAAOC,IAAP,MAAiB,KAAjB;AACA,OAAOC,KAAP,MAAkB,OAAlB;AACA,SAAQC,KAAR,EAAeC,SAAf,QAA+B,QAA/B;AACA,OAAOC,OAAP,MAAoB,yBAApB;AACA,OAAOC,aAAP,IAAuBC,qBAAvB,QAAmD,IAAnD;AACA,OAAOC,WAAP,MAAwB,oBAAxB;AAEAR,UAAU;AACVI,SAAS,CAAC;AAACK,EAAAA,OAAO,EAAE,IAAIJ,OAAJ;AAAV,CAAD,CAAT;AAEAJ,IAAI,CAAC,oEAAD,EAAuES,CAAC,IAAI;AAC9E,QAAMC,OAAO,GAAGR,KAAK,eAAC,oBAAC,aAAD,EAAmBK,WAAW,CAACI,KAA/B,CAAD,CAArB;AAEAD,EAAAA,OAAO,CAACE,MAAR;AAEA,QAAMC,WAAW,GAAGH,OAAO,CAACI,IAAR,CAAa,iCAAb,CAApB;AACAL,EAAAA,CAAC,CAACM,KAAF,CAAQF,WAAW,CAACG,EAAZ,CAAe,CAAf,EAAkBC,MAAlB,EAAR;AAEAP,EAAAA,OAAO,CAACQ,OAAR;AAEAT,EAAAA,CAAC,CAACU,IAAF;AACD,CAXG,CAAJ;AAaAnB,IAAI,CAAC,sDAAD,EAAyDS,CAAC,IAAI;AAChEW,EAAAA,MAAM,CAACC,QAAP,GAAkB,MAAM,CAAE,CAA1B,CADgE,CAEhE;;;AACAD,EAAAA,MAAM,CAACE,SAAP,CA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uBAAD,EAA0B,MAAMS,CAAN,IAAW;AACvCA,EAAAA,CAAC,CAACgB,IAAF,CAAO,CAAP;AACA,QAAMd,KAAK,GAAGJ,WAAW,CAACI,KAA1B;AACA,QAAMe,OAAO,GAAG;AACdC,IAAAA,aAAa,EAAE,MAAM;AACnBlB,MAAAA,CAAC,CAACU,IAAF;AACA,aAAO;AAACS,QAAAA,IAAI,EAAE;AAAP,OAAP;AACD;AAJa,GAAhB;;AAMA,QAAMC,MAAM,GAAG,MAAM;AACnBpB,IAAAA,CAAC,CAACU,IAAF;AACA,WAAO;AACLW,MAAAA,IAAI,EAAE,OAAO;AACXC,QAAAA,aAAa,EAAE;AADJ,OAAP;AADD,KAAP;AAKD,GAPD;;AAQA,QAAMC,SAAS,GAAG,MAAM1B,qBAAqB,CAC3CK,KAAK,CAACsB,YADqC,EAE3C,QAF2C,EAG3C,IAH2C,EAI3C,MAJ2C,EAK3C,IAL2C,EAM3CP,OAN2C,EAO3CG,MAP2C,CAA7C;AAUApB,EAAAA,CAAC,CAACyB,EAAF,CAAKF,SAAS,CAACJ,IAAf,EAAqB,WAArB;AACD,CA5BG,CAAJ","sourcesContent":["import browserEnv from 'browser-env';\nimport test from 'ava';\nimport React from 'react';\nimport {mount, configure} from 'enzyme';\nimport Adapter from 'enzyme-adapter-react-16';\nimport LottieWrapper, {fetchAndLoadAnimation} from '..';\nimport starFixture from './fixtures/default';\n\nbrowserEnv();\nconfigure({adapter: new Adapter()});\n\ntest('should update && load the animation, should clean up after unmount', t => {\n const wrapper = mount(<LottieWrapper {...starFixture.props} />);\n\n wrapper.update();\n\n const backupImage = wrapper.find('[data-name=\"ie11-backup-image\"]');\n t.false(backupImage.at(0).exists());\n\n wrapper.unmount();\n\n t.pass();\n});\n\ntest('ie11: should load an image in place of the animation', t => {\n window.msCrypto = () => {};\n // eslint-disable-next-line lodash-fp/prefer-constant\n window.navigator.__defineGetter__('userAgent', function () {\n return 'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko';\n });\n\n const wrapper = mount(<LottieWrapper {...starFixture.props} />);\n\n wrapper.update();\n\n const backupImage = wrapper.find('[data-name=\"ie11-backup-image\"]');\n t.true(backupImage.at(0).exists());\n\n wrapper.unmount();\n\n delete window.msCrypto;\n // eslint-disable-next-line lodash-fp/prefer-constant\n window.navigator.__defineGetter__('userAgent', function () {\n return 'Mozilla/5.0 (darwin) AppleWebKit/537.36 (KHTML, like Gecko) jsdom/13.2.0';\n });\n\n t.pass();\n});\n\ntest('other browser: should not load an image in place of the animation', t => {\n // eslint-disable-next-line lodash-fp/prefer-constant\n window.navigator.__defineGetter__('userAgent', function () {\n return 'Mozilla/5.0 (other stuff; rv:77.0) like Gecko';\n });\n\n const wrapper = mount(<LottieWrapper {...starFixture.props} />);\n\n const backupImage = wrapper.find('[data-name=\"ie11-backup-image\"]');\n t.false(backupImage.at(0).exists());\n\n wrapper.unmount();\n\n // eslint-disable-next-line lodash-fp/prefer-constant\n window.navigator.__defineGetter__('userAgent', function () {\n return 'Mozilla/5.0 (darwin) AppleWebKit/537.36 (KHTML, like Gecko) jsdom/13.2.0';\n });\n\n t.pass();\n});\n\ntest('fetchAndLoadAnimation', async t => {\n t.plan(3);\n const props = starFixture.props;\n const _lottie = {\n loadAnimation: () => {\n t.pass();\n return {name: 'animation'};\n }\n };\n const _fetch = () => {\n t.pass();\n return {\n json: () => ({\n animationData: 'some value'\n })\n };\n };\n const animation = await fetchAndLoadAnimation(\n props.animationSrc,\n '123456',\n true,\n 'test',\n true,\n _lottie,\n _fetch\n );\n\n t.is(animation.name, 'animation');\n});\n"],"file":"lottie.js"}
@@ -2,7 +2,7 @@ import _defaultsDeep from "lodash/fp/defaultsDeep";
2
2
  import Login from './login';
3
3
  export default {
4
4
  props: _defaultsDeep(Login.props, {
5
- backgroundImageUrl: 'https://static-staging.coorpacademy.com/content/BG_teams@2x.jpg',
5
+ backgroundImageUrl: 'https://static-staging.coorpacademy.com/content/teams/BG_teams@2x.jpg',
6
6
  isLoading: true
7
7
  })
8
8
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/molecule/teams-popin/test/fixtures/loading-background.js"],"names":["Login","props","backgroundImageUrl","isLoading"],"mappings":";AACA,OAAOA,KAAP,MAAkB,SAAlB;AAEA,eAAe;AACbC,EAAAA,KAAK,EAAE,cAAaD,KAAK,CAACC,KAAnB,EAA0B;AAC/BC,IAAAA,kBAAkB,EAAE,iEADW;AAE/BC,IAAAA,SAAS,EAAE;AAFoB,GAA1B;AADM,CAAf","sourcesContent":["import {defaultsDeep} from 'lodash/fp';\nimport Login from './login';\n\nexport default {\n props: defaultsDeep(Login.props, {\n backgroundImageUrl: 'https://static-staging.coorpacademy.com/content/BG_teams@2x.jpg',\n isLoading: true\n })\n};\n"],"file":"loading-background.js"}
1
+ {"version":3,"sources":["../../../../../src/molecule/teams-popin/test/fixtures/loading-background.js"],"names":["Login","props","backgroundImageUrl","isLoading"],"mappings":";AACA,OAAOA,KAAP,MAAkB,SAAlB;AAEA,eAAe;AACbC,EAAAA,KAAK,EAAE,cAAaD,KAAK,CAACC,KAAnB,EAA0B;AAC/BC,IAAAA,kBAAkB,EAAE,uEADW;AAE/BC,IAAAA,SAAS,EAAE;AAFoB,GAA1B;AADM,CAAf","sourcesContent":["import {defaultsDeep} from 'lodash/fp';\nimport Login from './login';\n\nexport default {\n props: defaultsDeep(Login.props, {\n backgroundImageUrl: 'https://static-staging.coorpacademy.com/content/teams/BG_teams@2x.jpg',\n isLoading: true\n })\n};\n"],"file":"loading-background.js"}
@@ -2,7 +2,7 @@ import _defaultsDeep from "lodash/fp/defaultsDeep";
2
2
  import Login from './login';
3
3
  export default {
4
4
  props: _defaultsDeep(Login.props, {
5
- backgroundImageUrl: 'https://static-staging.coorpacademy.com/content/BG_teams@2x.jpg'
5
+ backgroundImageUrl: 'https://static-staging.coorpacademy.com/content/teams/BG_teams@2x.jpg'
6
6
  })
7
7
  };
8
8
  //# sourceMappingURL=login-background.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/molecule/teams-popin/test/fixtures/login-background.js"],"names":["Login","props","backgroundImageUrl"],"mappings":";AACA,OAAOA,KAAP,MAAkB,SAAlB;AAEA,eAAe;AACbC,EAAAA,KAAK,EAAE,cAAaD,KAAK,CAACC,KAAnB,EAA0B;AAC/BC,IAAAA,kBAAkB,EAAE;AADW,GAA1B;AADM,CAAf","sourcesContent":["import {defaultsDeep} from 'lodash/fp';\nimport Login from './login';\n\nexport default {\n props: defaultsDeep(Login.props, {\n backgroundImageUrl: 'https://static-staging.coorpacademy.com/content/BG_teams@2x.jpg'\n })\n};\n"],"file":"login-background.js"}
1
+ {"version":3,"sources":["../../../../../src/molecule/teams-popin/test/fixtures/login-background.js"],"names":["Login","props","backgroundImageUrl"],"mappings":";AACA,OAAOA,KAAP,MAAkB,SAAlB;AAEA,eAAe;AACbC,EAAAA,KAAK,EAAE,cAAaD,KAAK,CAACC,KAAnB,EAA0B;AAC/BC,IAAAA,kBAAkB,EAAE;AADW,GAA1B;AADM,CAAf","sourcesContent":["import {defaultsDeep} from 'lodash/fp';\nimport Login from './login';\n\nexport default {\n props: defaultsDeep(Login.props, {\n backgroundImageUrl: 'https://static-staging.coorpacademy.com/content/teams/BG_teams@2x.jpg'\n })\n};\n"],"file":"login-background.js"}
@@ -0,0 +1,152 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = exports.fetchAndLoadAnimation = void 0;
5
+
6
+ var _react = _interopRequireWildcard(require("react"));
7
+
8
+ var _propTypes = _interopRequireDefault(require("prop-types"));
9
+
10
+ var _classnames = _interopRequireDefault(require("classnames"));
11
+
12
+ var _lottieWeb = _interopRequireDefault(require("lottie-web"));
13
+
14
+ var _get = _interopRequireDefault(require("lodash/fp/get"));
15
+
16
+ var _has = _interopRequireDefault(require("lodash/fp/has"));
17
+
18
+ var _includes = _interopRequireDefault(require("lodash/fp/includes"));
19
+
20
+ var _isomorphicUnfetch = _interopRequireDefault(require("isomorphic-unfetch"));
21
+
22
+ var _style = _interopRequireDefault(require("./style.css"));
23
+
24
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25
+
26
+ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
27
+
28
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
29
+
30
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
31
+
32
+ const isIE11 = () => {
33
+ if (typeof window === 'undefined') return;
34
+ const userAgent = (0, _get.default)('navigator.userAgent', window);
35
+ const hasMsCrypto = (0, _has.default)('msCrypto', window);
36
+ const hasRevision = (0, _includes.default)('rv:', userAgent);
37
+ const hasTrident = (0, _includes.default)('Trident/', userAgent);
38
+ return hasMsCrypto || hasRevision && hasTrident;
39
+ };
40
+
41
+ const fetchAndLoadAnimation = async (animationSrc, containerRef, loop, animationClassnames, hideOnTransparent, _lottie, _fetch) => {
42
+ const animationUrl = new URL(animationSrc).toString();
43
+ const fetchResult = await _fetch(animationUrl, {
44
+ headers: {
45
+ 'X-Requested-With': 'XMLHttpRequest',
46
+ 'Content-Type': 'application/json'
47
+ }
48
+ });
49
+ const animationData = await fetchResult.json();
50
+
51
+ const animation = _lottie.loadAnimation({
52
+ container: containerRef.current,
53
+ // the dom element that will contain the animation
54
+ renderer: 'svg',
55
+ autoplay: true,
56
+ loop,
57
+ animationData,
58
+ rendererSettings: {
59
+ className: animationClassnames,
60
+ hideOnTransparent,
61
+ preserveAspectRatio: 'xMidYMid meet' // same options as a preserveAspectRatio prop
62
+
63
+ }
64
+ });
65
+
66
+ return animation;
67
+ };
68
+
69
+ exports.fetchAndLoadAnimation = fetchAndLoadAnimation;
70
+
71
+ const LottieWrapper = props => {
72
+ const {
73
+ className,
74
+ 'data-name': dataName,
75
+ 'aria-label': ariaLabel,
76
+ animationSrc,
77
+ loop = false,
78
+ rendererSettings = {},
79
+ width,
80
+ height,
81
+ ie11ImageBackup,
82
+ backupImageClassName
83
+ } = props;
84
+ const {
85
+ className: animationClassName,
86
+ hideOnTransparent = true
87
+ } = rendererSettings;
88
+ const containerRef = (0, _react.useRef)(null);
89
+ const [animationItem, setAnimationItem] = (0, _react.useState)(null);
90
+
91
+ const _isIE11 = (0, _react.useMemo)(() => isIE11(), []);
92
+
93
+ const wrapperClassName = (0, _react.useMemo)(() => (0, _classnames.default)(className, _style.default.lottieContainer), [className]);
94
+ const lottieAnimationClassName = (0, _react.useMemo)(() => (0, _classnames.default)(animationClassName, _style.default.animation), [animationClassName]);
95
+ const ie11BackupImageClassName = (0, _react.useMemo)(() => (0, _classnames.default)(backupImageClassName, _style.default.backupImage), [backupImageClassName]);
96
+ (0, _react.useEffect)(() => {
97
+ const loadAnimation = async () => {
98
+ if (!_isIE11 && !animationItem) {
99
+ /* istanbul ignore next */
100
+ if (typeof window !== 'undefined') {
101
+ window.lottie = _lottieWeb.default;
102
+ }
103
+
104
+ const animation = await fetchAndLoadAnimation(animationSrc, containerRef, loop, lottieAnimationClassName, hideOnTransparent, _lottieWeb.default, _isomorphicUnfetch.default);
105
+ /* istanbul ignore next */
106
+
107
+ setAnimationItem(animation);
108
+ }
109
+ };
110
+
111
+ loadAnimation();
112
+ return () => animationItem &&
113
+ /* istanbul ignore next */
114
+ _lottieWeb.default.destroy(animationItem.name);
115
+ }, [lottieAnimationClassName, containerRef, hideOnTransparent, loop, animationSrc, _isIE11, animationItem]);
116
+ return /*#__PURE__*/_react.default.createElement("div", {
117
+ ref: containerRef,
118
+ "aria-label": ariaLabel,
119
+ "data-name": dataName,
120
+ className: wrapperClassName,
121
+ style: _extends(_extends({}, width && {
122
+ width: `${width}px`,
123
+ maxWidth: `${width}px`
124
+ }), height && {
125
+ height: `${height}px`,
126
+ maxHeight: `${height}px`
127
+ })
128
+ }, _isIE11 ? /*#__PURE__*/_react.default.createElement("img", {
129
+ src: ie11ImageBackup,
130
+ className: ie11BackupImageClassName,
131
+ "data-name": "ie11-backup-image"
132
+ }) : null);
133
+ };
134
+
135
+ LottieWrapper.propTypes = process.env.NODE_ENV !== "production" ? {
136
+ 'aria-label': _propTypes.default.string.isRequired,
137
+ 'data-name': _propTypes.default.string,
138
+ animationSrc: _propTypes.default.string.isRequired,
139
+ loop: _propTypes.default.bool,
140
+ rendererSettings: _propTypes.default.shape({
141
+ hideOnTransparent: _propTypes.default.bool,
142
+ className: _propTypes.default.string
143
+ }),
144
+ height: _propTypes.default.number,
145
+ width: _propTypes.default.number,
146
+ className: _propTypes.default.string,
147
+ ie11ImageBackup: _propTypes.default.string.isRequired,
148
+ backupImageClassName: _propTypes.default.string
149
+ } : {};
150
+ var _default = LottieWrapper;
151
+ exports.default = _default;
152
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/atom/lottie-wrapper/index.js"],"names":["isIE11","window","userAgent","hasMsCrypto","hasRevision","hasTrident","fetchAndLoadAnimation","animationSrc","containerRef","loop","animationClassnames","hideOnTransparent","_lottie","_fetch","animationUrl","URL","toString","fetchResult","headers","animationData","json","animation","loadAnimation","container","current","renderer","autoplay","rendererSettings","className","preserveAspectRatio","LottieWrapper","props","dataName","ariaLabel","width","height","ie11ImageBackup","backupImageClassName","animationClassName","animationItem","setAnimationItem","_isIE11","wrapperClassName","style","lottieContainer","lottieAnimationClassName","ie11BackupImageClassName","backupImage","lottie","unfetch","destroy","name","maxWidth","maxHeight","propTypes","PropTypes","string","isRequired","bool","shape","number"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,MAAM,GAAG,MAAM;AACnB,MAAI,OAAOC,MAAP,KAAkB,WAAtB,EAAmC;AACnC,QAAMC,SAAS,GAAG,kBAAI,qBAAJ,EAA2BD,MAA3B,CAAlB;AACA,QAAME,WAAW,GAAG,kBAAI,UAAJ,EAAgBF,MAAhB,CAApB;AACA,QAAMG,WAAW,GAAG,uBAAS,KAAT,EAAgBF,SAAhB,CAApB;AACA,QAAMG,UAAU,GAAG,uBAAS,UAAT,EAAqBH,SAArB,CAAnB;AAEA,SAAOC,WAAW,IAAKC,WAAW,IAAIC,UAAtC;AACD,CARD;;AAUO,MAAMC,qBAAqB,GAAG,OACnCC,YADmC,EAEnCC,YAFmC,EAGnCC,IAHmC,EAInCC,mBAJmC,EAKnCC,iBALmC,EAMnCC,OANmC,EAOnCC,MAPmC,KAQhC;AACH,QAAMC,YAAY,GAAG,IAAIC,GAAJ,CAAQR,YAAR,EAAsBS,QAAtB,EAArB;AACA,QAAMC,WAAW,GAAG,MAAMJ,MAAM,CAACC,YAAD,EAAe;AAC7CI,IAAAA,OAAO,EAAE;AACP,0BAAoB,gBADb;AAEP,sBAAgB;AAFT;AADoC,GAAf,CAAhC;AAOA,QAAMC,aAAa,GAAG,MAAMF,WAAW,CAACG,IAAZ,EAA5B;;AAEA,QAAMC,SAAS,GAAGT,OAAO,CAACU,aAAR,CAAsB;AACtCC,IAAAA,SAAS,EAAEf,YAAY,CAACgB,OADc;AACL;AACjCC,IAAAA,QAAQ,EAAE,KAF4B;AAGtCC,IAAAA,QAAQ,EAAE,IAH4B;AAItCjB,IAAAA,IAJsC;AAK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AAUC,MAFC;AAGxBjD,EAAAA,YAAY,EAAEgD,mBAAUC,MAAV,CAAiBC,UAHP;AAIxBhD,EAAAA,IAAI,EAAE8C,mBAAUG,IAJQ;AAKxB/B,EAAAA,gBAAgB,EAAE4B,mBAAUI,KAAV,CAAgB;AAChChD,IAAAA,iBAAiB,EAAE4C,mBAAUG,IADG;AAEhC9B,IAAAA,SAAS,EAAE2B,mBAAUC;AAFW,GAAhB,CALM;AASxBrB,EAAAA,MAAM,EAAEoB,mBAAUK,MATM;AAUxB1B,EAAAA,KAAK,EAAEqB,mBAAUK,MAVO;AAWxBhC,EAAAA,SAAS,EAAE2B,mBAAUC,MAXG;AAYxBpB,EAAAA,eAAe,EAAEmB,mBAAUC,MAAV,CAAiBC,UAZV;AAaxBpB,EAAAA,oBAAoB,EAAEkB,mBAAUC;AAbR,CAA1B;eAgBe1B,a","sourcesContent":["import React, {useMemo, useRef, useEffect, useState} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport lottie from 'lottie-web';\nimport get from 'lodash/fp/get';\nimport has from 'lodash/fp/has';\nimport includes from 'lodash/fp/includes';\nimport unfetch from 'isomorphic-unfetch';\nimport style from './style.css';\n\nconst isIE11 = () => {\n if (typeof window === 'undefined') return;\n const userAgent = get('navigator.userAgent', window);\n const hasMsCrypto = has('msCrypto', window);\n const hasRevision = includes('rv:', userAgent);\n const hasTrident = includes('Trident/', userAgent);\n\n return hasMsCrypto || (hasRevision && hasTrident);\n};\n\nexport const fetchAndLoadAnimation = async (\n animationSrc,\n containerRef,\n loop,\n animationClassnames,\n hideOnTransparent,\n _lottie,\n _fetch\n) => {\n const animationUrl = new URL(animationSrc).toString();\n const fetchResult = await _fetch(animationUrl, {\n headers: {\n 'X-Requested-With': 'XMLHttpRequest',\n 'Content-Type': 'application/json'\n }\n });\n\n const animationData = await fetchResult.json();\n\n const animation = _lottie.loadAnimation({\n container: containerRef.current, // the dom element that will contain the animation\n renderer: 'svg',\n autoplay: true,\n loop,\n animationData,\n rendererSettings: {\n className: animationClassnames,\n hideOnTransparent,\n preserveAspectRatio: 'xMidYMid meet' // same options as a preserveAspectRatio prop\n }\n });\n return animation;\n};\n\nconst LottieWrapper = props => {\n const {\n className,\n 'data-name': dataName,\n 'aria-label': ariaLabel,\n animationSrc,\n loop = false,\n rendererSettings = {},\n width,\n height,\n ie11ImageBackup,\n backupImageClassName\n } = props;\n\n const {className: animationClassName, hideOnTransparent = true} = rendererSettings;\n\n const containerRef = useRef(null);\n\n const [animationItem, setAnimationItem] = useState(null);\n\n const _isIE11 = useMemo(() => isIE11(), []);\n\n const wrapperClassName = useMemo(() => classnames(className, style.lottieContainer), [className]);\n\n const lottieAnimationClassName = useMemo(() => classnames(animationClassName, style.animation), [\n animationClassName\n ]);\n\n const ie11BackupImageClassName = useMemo(\n () => classnames(backupImageClassName, style.backupImage),\n [backupImageClassName]\n );\n\n useEffect(() => {\n const loadAnimation = async () => {\n if (!_isIE11 && !animationItem) {\n /* istanbul ignore next */\n if (typeof window !== 'undefined') {\n window.lottie = lottie;\n }\n const animation = await fetchAndLoadAnimation(\n animationSrc,\n containerRef,\n loop,\n lottieAnimationClassName,\n hideOnTransparent,\n lottie,\n unfetch\n );\n\n /* istanbul ignore next */\n setAnimationItem(animation);\n }\n };\n\n loadAnimation();\n return () => animationItem && /* istanbul ignore next */ lottie.destroy(animationItem.name);\n }, [\n lottieAnimationClassName,\n containerRef,\n hideOnTransparent,\n loop,\n animationSrc,\n _isIE11,\n animationItem\n ]);\n\n return (\n <div\n ref={containerRef}\n aria-label={ariaLabel}\n data-name={dataName}\n className={wrapperClassName}\n style={{\n ...(width && {\n width: `${width}px`,\n maxWidth: `${width}px`\n }),\n ...(height && {\n height: `${height}px`,\n maxHeight: `${height}px`\n })\n }}\n >\n {_isIE11 ? (\n <img\n src={ie11ImageBackup}\n className={ie11BackupImageClassName}\n data-name=\"ie11-backup-image\"\n />\n ) : null}\n </div>\n );\n};\n\nLottieWrapper.propTypes = {\n 'aria-label': PropTypes.string.isRequired,\n 'data-name': PropTypes.string,\n animationSrc: PropTypes.string.isRequired,\n loop: PropTypes.bool,\n rendererSettings: PropTypes.shape({\n hideOnTransparent: PropTypes.bool,\n className: PropTypes.string\n }),\n height: PropTypes.number,\n width: PropTypes.number,\n className: PropTypes.string,\n ie11ImageBackup: PropTypes.string.isRequired,\n backupImageClassName: PropTypes.string\n};\n\nexport default LottieWrapper;\n"],"file":"index.js"}
@@ -0,0 +1,15 @@
1
+ .lottieContainer {
2
+ position: relative;
3
+ display: flex;
4
+ }
5
+
6
+ .animation {
7
+ display: flex;
8
+ height: 100%;
9
+ width: 100%;
10
+ }
11
+
12
+ .backupImage {
13
+ height: 100%;
14
+ width: 100%;
15
+ }
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = void 0;
5
+ var _default = {
6
+ props: {
7
+ 'aria-label': 'aria lottie',
8
+ 'data-name': 'default-lottie',
9
+ className: undefined,
10
+ animationSrc: 'https://static-staging.coorpacademy.com/animations/review/confetti.json',
11
+ loop: undefined,
12
+ rendererSettings: {
13
+ hideOnTransparent: false,
14
+ animationClassName: ''
15
+ },
16
+ height: 600,
17
+ width: 1000,
18
+ ie11ImageBackup: 'https://static-staging.coorpacademy.com/animations/review/conffeti_congrats.svg'
19
+ }
20
+ };
21
+ exports.default = _default;
22
+ //# sourceMappingURL=confetti.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/atom/lottie-wrapper/test/fixtures/confetti.js"],"names":["props","className","undefined","animationSrc","loop","rendererSettings","hideOnTransparent","animationClassName","height","width","ie11ImageBackup"],"mappings":";;;;eAAe;AACbA,EAAAA,KAAK,EAAE;AACL,kBAAc,aADT;AAEL,iBAAa,gBAFR;AAGLC,IAAAA,SAAS,EAAEC,SAHN;AAILC,IAAAA,YAAY,EAAE,yEAJT;AAKLC,IAAAA,IAAI,EAAEF,SALD;AAMLG,IAAAA,gBAAgB,EAAE;AAChBC,MAAAA,iBAAiB,EAAE,KADH;AAEhBC,MAAAA,kBAAkB,EAAE;AAFJ,KANb;AAULC,IAAAA,MAAM,EAAE,GAVH;AAWLC,IAAAA,KAAK,EAAE,IAXF;AAYLC,IAAAA,eAAe,EACb;AAbG;AADM,C","sourcesContent":["export default {\n props: {\n 'aria-label': 'aria lottie',\n 'data-name': 'default-lottie',\n className: undefined,\n animationSrc: 'https://static-staging.coorpacademy.com/animations/review/confetti.json',\n loop: undefined,\n rendererSettings: {\n hideOnTransparent: false,\n animationClassName: ''\n },\n height: 600,\n width: 1000,\n ie11ImageBackup:\n 'https://static-staging.coorpacademy.com/animations/review/conffeti_congrats.svg'\n }\n};\n"],"file":"confetti.js"}
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = void 0;
5
+ var _default = {
6
+ props: {
7
+ 'aria-label': 'aria lottie',
8
+ 'data-name': 'default-lottie',
9
+ className: undefined,
10
+ animationSrc: 'https://static-staging.coorpacademy.com/animations/review/star.json',
11
+ loop: false,
12
+ rendererSettings: {
13
+ hideOnTransparent: false,
14
+ animationClassName: ''
15
+ },
16
+ height: 200,
17
+ width: 200,
18
+ ie11ImageBackup: 'https://static-staging.coorpacademy.com/animations/review/stars_icon_congrats.svg'
19
+ }
20
+ };
21
+ exports.default = _default;
22
+ //# sourceMappingURL=default.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/atom/lottie-wrapper/test/fixtures/default.js"],"names":["props","className","undefined","animationSrc","loop","rendererSettings","hideOnTransparent","animationClassName","height","width","ie11ImageBackup"],"mappings":";;;;eAAe;AACbA,EAAAA,KAAK,EAAE;AACL,kBAAc,aADT;AAEL,iBAAa,gBAFR;AAGLC,IAAAA,SAAS,EAAEC,SAHN;AAILC,IAAAA,YAAY,EAAE,qEAJT;AAKLC,IAAAA,IAAI,EAAE,KALD;AAMLC,IAAAA,gBAAgB,EAAE;AAChBC,MAAAA,iBAAiB,EAAE,KADH;AAEhBC,MAAAA,kBAAkB,EAAE;AAFJ,KANb;AAULC,IAAAA,MAAM,EAAE,GAVH;AAWLC,IAAAA,KAAK,EAAE,GAXF;AAYLC,IAAAA,eAAe,EACb;AAbG;AADM,C","sourcesContent":["export default {\n props: {\n 'aria-label': 'aria lottie',\n 'data-name': 'default-lottie',\n className: undefined,\n animationSrc: 'https://static-staging.coorpacademy.com/animations/review/star.json',\n loop: false,\n rendererSettings: {\n hideOnTransparent: false,\n animationClassName: ''\n },\n height: 200,\n width: 200,\n ie11ImageBackup:\n 'https://static-staging.coorpacademy.com/animations/review/stars_icon_congrats.svg'\n }\n};\n"],"file":"default.js"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = void 0;
5
+ var _default = {
6
+ props: {
7
+ 'aria-label': 'aria lottie',
8
+ 'data-name': 'default-lottie',
9
+ className: undefined,
10
+ animationSrc: 'https://static-staging.coorpacademy.com/animations/review/rank.json',
11
+ loop: true,
12
+ height: 200,
13
+ width: 200,
14
+ ie11ImageBackup: 'https://static-staging.coorpacademy.com/animations/review/rank_icon_congrats.svg'
15
+ }
16
+ };
17
+ exports.default = _default;
18
+ //# sourceMappingURL=rank.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/atom/lottie-wrapper/test/fixtures/rank.js"],"names":["props","className","undefined","animationSrc","loop","height","width","ie11ImageBackup"],"mappings":";;;;eAAe;AACbA,EAAAA,KAAK,EAAE;AACL,kBAAc,aADT;AAEL,iBAAa,gBAFR;AAGLC,IAAAA,SAAS,EAAEC,SAHN;AAILC,IAAAA,YAAY,EAAE,qEAJT;AAKLC,IAAAA,IAAI,EAAE,IALD;AAMLC,IAAAA,MAAM,EAAE,GANH;AAOLC,IAAAA,KAAK,EAAE,GAPF;AAQLC,IAAAA,eAAe,EACb;AATG;AADM,C","sourcesContent":["export default {\n props: {\n 'aria-label': 'aria lottie',\n 'data-name': 'default-lottie',\n className: undefined,\n animationSrc: 'https://static-staging.coorpacademy.com/animations/review/rank.json',\n loop: true,\n height: 200,\n width: 200,\n ie11ImageBackup:\n 'https://static-staging.coorpacademy.com/animations/review/rank_icon_congrats.svg'\n }\n};\n"],"file":"rank.js"}
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+
3
+ var _ava = _interopRequireDefault(require("ava"));
4
+
5
+ var _forEach = _interopRequireDefault(require("lodash/forEach"));
6
+
7
+ var _renderComponent = _interopRequireDefault(require("../../../test/helpers/render-component"));
8
+
9
+ var _ = _interopRequireDefault(require(".."));
10
+
11
+ var _confetti = _interopRequireDefault(require("./fixtures/confetti"));
12
+
13
+ var _default = _interopRequireDefault(require("./fixtures/default"));
14
+
15
+ var _rank = _interopRequireDefault(require("./fixtures/rank"));
16
+
17
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18
+
19
+ (0, _ava.default)('Atom › AtomLottieWrapper > should have valid propTypes', t => {
20
+ t.pass();
21
+ (0, _forEach.default)(_.default.propTypes, (value, key) => {
22
+ t.not(value, undefined, `PropType for "Atom.AtomLottieWrapper.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
23
+ });
24
+ });
25
+ (0, _ava.default)('Atom › AtomLottieWrapper › Confetti › should be rendered', _renderComponent.default, _.default, _confetti.default);
26
+ (0, _ava.default)('Atom › AtomLottieWrapper › Default › should be rendered', _renderComponent.default, _.default, _default.default);
27
+ (0, _ava.default)('Atom › AtomLottieWrapper › Rank › should be rendered', _renderComponent.default, _.default, _rank.default);
28
+ //# sourceMappingURL=fixtures.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/atom/lottie-wrapper/test/fixtures.js"],"names":["t","pass","AtomLottieWrapper","propTypes","value","key","not","undefined","renderComponentMacro","fixtureConfetti","fixtureDefault","fixtureRank"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,kBAAK,wDAAL,EAA+DA,CAAC,IAAI;AAClEA,EAAAA,CAAC,CAACC,IAAF;AACA,wBAAQC,UAAkBC,SAA1B,EAAqC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACnDL,IAAAA,CAAC,CAACM,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,kDAAiDF,GAAI,mEAA9E;AACD,GAFD;AAGD,CALD;AAOA,kBAAK,0DAAL,EAAiEG,wBAAjE,EAAuFN,SAAvF,EAA0GO,iBAA1G;AACA,kBAAK,yDAAL,EAAgED,wBAAhE,EAAsFN,SAAtF,EAAyGQ,gBAAzG;AACA,kBAAK,sDAAL,EAA6DF,wBAA7D,EAAmFN,SAAnF,EAAsGS,aAAtG","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport AtomLottieWrapper from '..';\nimport fixtureConfetti from './fixtures/confetti';\nimport fixtureDefault from './fixtures/default';\nimport fixtureRank from './fixtures/rank';\n\ntest('Atom › AtomLottieWrapper > should have valid propTypes', t => {\n t.pass();\n forEach(AtomLottieWrapper.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Atom.AtomLottieWrapper.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Atom › AtomLottieWrapper › Confetti › should be rendered', renderComponentMacro, AtomLottieWrapper, fixtureConfetti);\ntest('Atom › AtomLottieWrapper › Default › should be rendered', renderComponentMacro, AtomLottieWrapper, fixtureDefault);\ntest('Atom › AtomLottieWrapper › Rank › should be rendered', renderComponentMacro, AtomLottieWrapper, fixtureRank);\n"],"file":"fixtures.js"}
@@ -0,0 +1,97 @@
1
+ "use strict";
2
+
3
+ var _browserEnv = _interopRequireDefault(require("browser-env"));
4
+
5
+ var _ava = _interopRequireDefault(require("ava"));
6
+
7
+ var _react = _interopRequireDefault(require("react"));
8
+
9
+ var _enzyme = require("enzyme");
10
+
11
+ var _enzymeAdapterReact = _interopRequireDefault(require("enzyme-adapter-react-16"));
12
+
13
+ var _ = _interopRequireWildcard(require(".."));
14
+
15
+ var _default = _interopRequireDefault(require("./fixtures/default"));
16
+
17
+ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
18
+
19
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
20
+
21
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
22
+
23
+ (0, _browserEnv.default)();
24
+ (0, _enzyme.configure)({
25
+ adapter: new _enzymeAdapterReact.default()
26
+ });
27
+ (0, _ava.default)('should update && load the animation, should clean up after unmount', t => {
28
+ const wrapper = (0, _enzyme.mount)( /*#__PURE__*/_react.default.createElement(_.default, _default.default.props));
29
+ wrapper.update();
30
+ const backupImage = wrapper.find('[data-name="ie11-backup-image"]');
31
+ t.false(backupImage.at(0).exists());
32
+ wrapper.unmount();
33
+ t.pass();
34
+ });
35
+ (0, _ava.default)('ie11: should load an image in place of the animation', t => {
36
+ window.msCrypto = () => {}; // eslint-disable-next-line lodash-fp/prefer-constant
37
+
38
+
39
+ window.navigator.__defineGetter__('userAgent', function () {
40
+ return 'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko';
41
+ });
42
+
43
+ const wrapper = (0, _enzyme.mount)( /*#__PURE__*/_react.default.createElement(_.default, _default.default.props));
44
+ wrapper.update();
45
+ const backupImage = wrapper.find('[data-name="ie11-backup-image"]');
46
+ t.true(backupImage.at(0).exists());
47
+ wrapper.unmount();
48
+ delete window.msCrypto; // eslint-disable-next-line lodash-fp/prefer-constant
49
+
50
+ window.navigator.__defineGetter__('userAgent', function () {
51
+ return 'Mozilla/5.0 (darwin) AppleWebKit/537.36 (KHTML, like Gecko) jsdom/13.2.0';
52
+ });
53
+
54
+ t.pass();
55
+ });
56
+ (0, _ava.default)('other browser: should not load an image in place of the animation', t => {
57
+ // eslint-disable-next-line lodash-fp/prefer-constant
58
+ window.navigator.__defineGetter__('userAgent', function () {
59
+ return 'Mozilla/5.0 (other stuff; rv:77.0) like Gecko';
60
+ });
61
+
62
+ const wrapper = (0, _enzyme.mount)( /*#__PURE__*/_react.default.createElement(_.default, _default.default.props));
63
+ const backupImage = wrapper.find('[data-name="ie11-backup-image"]');
64
+ t.false(backupImage.at(0).exists());
65
+ wrapper.unmount(); // eslint-disable-next-line lodash-fp/prefer-constant
66
+
67
+ window.navigator.__defineGetter__('userAgent', function () {
68
+ return 'Mozilla/5.0 (darwin) AppleWebKit/537.36 (KHTML, like Gecko) jsdom/13.2.0';
69
+ });
70
+
71
+ t.pass();
72
+ });
73
+ (0, _ava.default)('fetchAndLoadAnimation', async t => {
74
+ t.plan(3);
75
+ const props = _default.default.props;
76
+ const _lottie = {
77
+ loadAnimation: () => {
78
+ t.pass();
79
+ return {
80
+ name: 'animation'
81
+ };
82
+ }
83
+ };
84
+
85
+ const _fetch = () => {
86
+ t.pass();
87
+ return {
88
+ json: () => ({
89
+ animationData: 'some value'
90
+ })
91
+ };
92
+ };
93
+
94
+ const animation = await (0, _.fetchAndLoadAnimation)(props.animationSrc, '123456', true, 'test', true, _lottie, _fetch);
95
+ t.is(animation.name, 'animation');
96
+ });
97
+ //# sourceMappingURL=lottie.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/atom/lottie-wrapper/test/lottie.js"],"names":["adapter","Adapter","t","wrapper","starFixture","props","update","backupImage","find","false","at","exists","unmount","pass","window","msCrypto","navigator","__defineGetter__","true","plan","_lottie","loadAnimation","name","_fetch","json","animationData","animation","animationSrc","is"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEA;AACA,uBAAU;AAACA,EAAAA,OAAO,EAAE,IAAIC,2BAAJ;AAAV,CAAV;AAEA,kBAAK,oEAAL,EAA2EC,CAAC,IAAI;AAC9E,QAAMC,OAAO,GAAG,iCAAM,6BAAC,SAAD,EAAmBC,iBAAYC,KAA/B,CAAN,CAAhB;AAEAF,EAAAA,OAAO,CAACG,MAAR;AAEA,QAAMC,WAAW,GAAGJ,OAAO,CAACK,IAAR,CAAa,iCAAb,CAApB;AACAN,EAAAA,CAAC,CAACO,KAAF,CAAQF,WAAW,CAACG,EAAZ,CAAe,CAAf,EAAkBC,MAAlB,EAAR;AAEAR,EAAAA,OAAO,CAACS,OAAR;AAEAV,EAAAA,CAAC,CAACW,IAAF;AACD,CAXD;AAaA,kBAAK,sDAAL,EAA6DX,CAAC,IAAI;AAChEY,EAAAA,MAAM,CAACC,QAAP,GAAkB,MAAM,CAAE,CAA1B,CADgE,CAEhE;;;AACAD,EAAAA,MAAM,CAACE,SAAP,CAAiBC,gBAAjB,CAAkC,WAAlC,EAA+C,YAAY;AACzD,WAAO,+DAAP;AACD,GAFD;;AAIA,QAAMd,OAAO,GAAG,iCAAM,6BAAC,SAAD,EAAmBC,iBAAYC,KAA/B,CAAN,CAAhB;AAEAF,EAAAA,OAAO,CAACG,MAAR;AAEA,QAAMC,WAAW,GAAGJ,OAAO,CAACK,IAAR,CAAa,iCAAb,CAApB;AACAN,EAAAA,CAAC,CAACgB,IAAF,CAAOX,WAAW,CAACG,EAAZ,CAAe,CAAf,EAAkBC,MAAlB,EAAP;AAEAR,EAAAA,OAAO,CAACS,OAAR;AAEA,SAAOE,MAAM,CAACC,QAAd,CAhBgE,CAiBhE;;AACAD,EAAAA,MAAM,CAACE,SAAP,CAAiBC,gBAAjB,CAA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tB,IAHsB,EAItB,MAJsB,EAKtB,IALsB,EAMtBP,OANsB,EAOtBG,MAPsB,CAAxB;AAUArB,EAAAA,CAAC,CAAC0B,EAAF,CAAKF,SAAS,CAACJ,IAAf,EAAqB,WAArB;AACD,CA5BD","sourcesContent":["import browserEnv from 'browser-env';\nimport test from 'ava';\nimport React from 'react';\nimport {mount, configure} from 'enzyme';\nimport Adapter from 'enzyme-adapter-react-16';\nimport LottieWrapper, {fetchAndLoadAnimation} from '..';\nimport starFixture from './fixtures/default';\n\nbrowserEnv();\nconfigure({adapter: new Adapter()});\n\ntest('should update && load the animation, should clean up after unmount', t => {\n const wrapper = mount(<LottieWrapper {...starFixture.props} />);\n\n wrapper.update();\n\n const backupImage = wrapper.find('[data-name=\"ie11-backup-image\"]');\n t.false(backupImage.at(0).exists());\n\n wrapper.unmount();\n\n t.pass();\n});\n\ntest('ie11: should load an image in place of the animation', t => {\n window.msCrypto = () => {};\n // eslint-disable-next-line lodash-fp/prefer-constant\n window.navigator.__defineGetter__('userAgent', function () {\n return 'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko';\n });\n\n const wrapper = mount(<LottieWrapper {...starFixture.props} />);\n\n wrapper.update();\n\n const backupImage = wrapper.find('[data-name=\"ie11-backup-image\"]');\n t.true(backupImage.at(0).exists());\n\n wrapper.unmount();\n\n delete window.msCrypto;\n // eslint-disable-next-line lodash-fp/prefer-constant\n window.navigator.__defineGetter__('userAgent', function () {\n return 'Mozilla/5.0 (darwin) AppleWebKit/537.36 (KHTML, like Gecko) jsdom/13.2.0';\n });\n\n t.pass();\n});\n\ntest('other browser: should not load an image in place of the animation', t => {\n // eslint-disable-next-line lodash-fp/prefer-constant\n window.navigator.__defineGetter__('userAgent', function () {\n return 'Mozilla/5.0 (other stuff; rv:77.0) like Gecko';\n });\n\n const wrapper = mount(<LottieWrapper {...starFixture.props} />);\n\n const backupImage = wrapper.find('[data-name=\"ie11-backup-image\"]');\n t.false(backupImage.at(0).exists());\n\n wrapper.unmount();\n\n // eslint-disable-next-line lodash-fp/prefer-constant\n window.navigator.__defineGetter__('userAgent', function () {\n return 'Mozilla/5.0 (darwin) AppleWebKit/537.36 (KHTML, like Gecko) jsdom/13.2.0';\n });\n\n t.pass();\n});\n\ntest('fetchAndLoadAnimation', async t => {\n t.plan(3);\n const props = starFixture.props;\n const _lottie = {\n loadAnimation: () => {\n t.pass();\n return {name: 'animation'};\n }\n };\n const _fetch = () => {\n t.pass();\n return {\n json: () => ({\n animationData: 'some value'\n })\n };\n };\n const animation = await fetchAndLoadAnimation(\n props.animationSrc,\n '123456',\n true,\n 'test',\n true,\n _lottie,\n _fetch\n );\n\n t.is(animation.name, 'animation');\n});\n"],"file":"lottie.js"}
@@ -11,7 +11,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
11
11
 
12
12
  var _default = {
13
13
  props: (0, _defaultsDeep2.default)(_login.default.props, {
14
- backgroundImageUrl: 'https://static-staging.coorpacademy.com/content/BG_teams@2x.jpg',
14
+ backgroundImageUrl: 'https://static-staging.coorpacademy.com/content/teams/BG_teams@2x.jpg',
15
15
  isLoading: true
16
16
  })
17
17
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/molecule/teams-popin/test/fixtures/loading-background.js"],"names":["props","Login","backgroundImageUrl","isLoading"],"mappings":";;;;;;;AACA;;;;eAEe;AACbA,EAAAA,KAAK,EAAE,4BAAaC,eAAMD,KAAnB,EAA0B;AAC/BE,IAAAA,kBAAkB,EAAE,iEADW;AAE/BC,IAAAA,SAAS,EAAE;AAFoB,GAA1B;AADM,C","sourcesContent":["import {defaultsDeep} from 'lodash/fp';\nimport Login from './login';\n\nexport default {\n props: defaultsDeep(Login.props, {\n backgroundImageUrl: 'https://static-staging.coorpacademy.com/content/BG_teams@2x.jpg',\n isLoading: true\n })\n};\n"],"file":"loading-background.js"}
1
+ {"version":3,"sources":["../../../../../src/molecule/teams-popin/test/fixtures/loading-background.js"],"names":["props","Login","backgroundImageUrl","isLoading"],"mappings":";;;;;;;AACA;;;;eAEe;AACbA,EAAAA,KAAK,EAAE,4BAAaC,eAAMD,KAAnB,EAA0B;AAC/BE,IAAAA,kBAAkB,EAAE,uEADW;AAE/BC,IAAAA,SAAS,EAAE;AAFoB,GAA1B;AADM,C","sourcesContent":["import {defaultsDeep} from 'lodash/fp';\nimport Login from './login';\n\nexport default {\n props: defaultsDeep(Login.props, {\n backgroundImageUrl: 'https://static-staging.coorpacademy.com/content/teams/BG_teams@2x.jpg',\n isLoading: true\n })\n};\n"],"file":"loading-background.js"}
@@ -11,7 +11,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
11
11
 
12
12
  var _default = {
13
13
  props: (0, _defaultsDeep2.default)(_login.default.props, {
14
- backgroundImageUrl: 'https://static-staging.coorpacademy.com/content/BG_teams@2x.jpg'
14
+ backgroundImageUrl: 'https://static-staging.coorpacademy.com/content/teams/BG_teams@2x.jpg'
15
15
  })
16
16
  };
17
17
  exports.default = _default;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/molecule/teams-popin/test/fixtures/login-background.js"],"names":["props","Login","backgroundImageUrl"],"mappings":";;;;;;;AACA;;;;eAEe;AACbA,EAAAA,KAAK,EAAE,4BAAaC,eAAMD,KAAnB,EAA0B;AAC/BE,IAAAA,kBAAkB,EAAE;AADW,GAA1B;AADM,C","sourcesContent":["import {defaultsDeep} from 'lodash/fp';\nimport Login from './login';\n\nexport default {\n props: defaultsDeep(Login.props, {\n backgroundImageUrl: 'https://static-staging.coorpacademy.com/content/BG_teams@2x.jpg'\n })\n};\n"],"file":"login-background.js"}
1
+ {"version":3,"sources":["../../../../../src/molecule/teams-popin/test/fixtures/login-background.js"],"names":["props","Login","backgroundImageUrl"],"mappings":";;;;;;;AACA;;;;eAEe;AACbA,EAAAA,KAAK,EAAE,4BAAaC,eAAMD,KAAnB,EAA0B;AAC/BE,IAAAA,kBAAkB,EAAE;AADW,GAA1B;AADM,C","sourcesContent":["import {defaultsDeep} from 'lodash/fp';\nimport Login from './login';\n\nexport default {\n props: defaultsDeep(Login.props, {\n backgroundImageUrl: 'https://static-staging.coorpacademy.com/content/teams/BG_teams@2x.jpg'\n })\n};\n"],"file":"login-background.js"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coorpacademy/components",
3
- "version": "10.16.4-alpha.1+c1edfc56d",
3
+ "version": "10.17.0",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -37,7 +37,7 @@
37
37
  "lint": "eslint . --ext .js,.json --cache --cache-location \"node_modules/.cache/.eslintcache\""
38
38
  },
39
39
  "engines": {
40
- "node": ">=8.3.0"
40
+ "node": ">=12.22.12"
41
41
  },
42
42
  "contributors": [
43
43
  "Arthur Weber <arthur.weber@coorpacademy.com>",
@@ -58,7 +58,9 @@
58
58
  "eslint-plugin-react-hooks": "^4.3.0",
59
59
  "extended-proptypes": "^1.3.0",
60
60
  "hammerjs": "^2.0.8",
61
+ "isomorphic-unfetch": "^3.1.0",
61
62
  "lodash": "^4.17.15",
63
+ "lottie-web": "^5.9.2",
62
64
  "postcss-calc": "^7.0.2",
63
65
  "postcss-color-function": "^4.1.0",
64
66
  "postcss-modules-values-replace": "^3.1.0",
@@ -119,5 +121,5 @@
119
121
  "webpack-hot-middleware": "^2.25.0"
120
122
  },
121
123
  "author": "CoorpAcademy",
122
- "gitHead": "c1edfc56d03ceb083424be46a525ac8f7376519d"
124
+ "gitHead": "ddddc43b9c0b7beb2547c9411cab45e8aa76dcb7"
123
125
  }