@coorpacademy/components 11.2.10 → 11.2.11-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/atom/lottie-wrapper/index.d.ts.map +1 -1
- package/es/atom/lottie-wrapper/index.js +9 -3
- package/es/atom/lottie-wrapper/index.js.map +1 -1
- package/es/atom/lottie-wrapper/prop-types.d.ts +2 -2
- package/es/atom/lottie-wrapper/prop-types.d.ts.map +1 -1
- package/es/atom/lottie-wrapper/prop-types.js +1 -1
- package/es/atom/lottie-wrapper/prop-types.js.map +1 -1
- package/es/atom/review-presentation/index.d.ts.map +1 -1
- package/es/atom/review-presentation/index.js +82 -20
- package/es/atom/review-presentation/index.js.map +1 -1
- package/es/atom/review-presentation/prop-types.d.ts +12 -0
- package/es/atom/review-presentation/prop-types.d.ts.map +1 -1
- package/es/atom/review-presentation/prop-types.js +3 -1
- package/es/atom/review-presentation/prop-types.js.map +1 -1
- package/es/atom/review-presentation/style.css +3 -14
- package/es/molecule/review-card-congrats/prop-types.d.ts +1 -1
- package/es/organism/review-congrats/index.d.ts.map +1 -1
- package/es/organism/review-congrats/index.js +8 -6
- package/es/organism/review-congrats/index.js.map +1 -1
- package/es/organism/review-congrats/prop-types.d.ts +3 -3
- package/es/organism/user-preferences/index.d.ts +1 -0
- package/es/organism/user-preferences/index.d.ts.map +1 -1
- package/es/organism/user-preferences/index.js +11 -6
- package/es/organism/user-preferences/index.js.map +1 -1
- package/es/template/activity/index.d.ts +2 -0
- package/es/template/activity/index.d.ts.map +1 -1
- package/es/template/activity/index.js +4 -1
- package/es/template/activity/index.js.map +1 -1
- package/es/template/activity/progression-item.d.ts +1 -0
- package/es/template/activity/progression-item.d.ts.map +1 -1
- package/es/template/activity/progression-item.js +5 -2
- package/es/template/activity/progression-item.js.map +1 -1
- package/es/template/app-review/index.d.ts +11 -3
- package/es/template/app-review/index.d.ts.map +1 -1
- package/es/template/app-review/player/prop-types.d.ts +3 -3
- package/es/template/app-review/prop-types.d.ts +11 -3
- package/es/template/app-review/prop-types.d.ts.map +1 -1
- package/es/template/review-dashboard-skills/index.d.ts +8 -0
- package/lib/atom/lottie-wrapper/index.d.ts.map +1 -1
- package/lib/atom/lottie-wrapper/index.js +9 -3
- package/lib/atom/lottie-wrapper/index.js.map +1 -1
- package/lib/atom/lottie-wrapper/prop-types.d.ts +2 -2
- package/lib/atom/lottie-wrapper/prop-types.d.ts.map +1 -1
- package/lib/atom/lottie-wrapper/prop-types.js +1 -1
- package/lib/atom/lottie-wrapper/prop-types.js.map +1 -1
- package/lib/atom/review-presentation/index.d.ts.map +1 -1
- package/lib/atom/review-presentation/index.js +86 -20
- package/lib/atom/review-presentation/index.js.map +1 -1
- package/lib/atom/review-presentation/prop-types.d.ts +12 -0
- package/lib/atom/review-presentation/prop-types.d.ts.map +1 -1
- package/lib/atom/review-presentation/prop-types.js +3 -1
- package/lib/atom/review-presentation/prop-types.js.map +1 -1
- package/lib/atom/review-presentation/style.css +3 -14
- package/lib/molecule/review-card-congrats/prop-types.d.ts +1 -1
- package/lib/organism/review-congrats/index.d.ts.map +1 -1
- package/lib/organism/review-congrats/index.js +3 -1
- package/lib/organism/review-congrats/index.js.map +1 -1
- package/lib/organism/review-congrats/prop-types.d.ts +3 -3
- package/lib/organism/user-preferences/index.d.ts +1 -0
- package/lib/organism/user-preferences/index.d.ts.map +1 -1
- package/lib/organism/user-preferences/index.js +11 -6
- package/lib/organism/user-preferences/index.js.map +1 -1
- package/lib/template/activity/index.d.ts +2 -0
- package/lib/template/activity/index.d.ts.map +1 -1
- package/lib/template/activity/index.js +4 -1
- package/lib/template/activity/index.js.map +1 -1
- package/lib/template/activity/progression-item.d.ts +1 -0
- package/lib/template/activity/progression-item.d.ts.map +1 -1
- package/lib/template/activity/progression-item.js +5 -2
- package/lib/template/activity/progression-item.js.map +1 -1
- package/lib/template/app-review/index.d.ts +11 -3
- package/lib/template/app-review/index.d.ts.map +1 -1
- package/lib/template/app-review/player/prop-types.d.ts +3 -3
- package/lib/template/app-review/prop-types.d.ts +11 -3
- package/lib/template/app-review/prop-types.d.ts.map +1 -1
- package/lib/template/review-dashboard-skills/index.d.ts +8 -0
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _isEmpty from "lodash/fp/isEmpty";
|
|
2
2
|
import _map from "lodash/fp/map";
|
|
3
|
-
const _excluded = ["label", "description"];
|
|
3
|
+
const _excluded = ["label", "description", "moreInfoAriaLabel"];
|
|
4
4
|
|
|
5
5
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
6
6
|
|
|
@@ -15,7 +15,8 @@ import style from './style.css';
|
|
|
15
15
|
const Settings = props => {
|
|
16
16
|
const {
|
|
17
17
|
label,
|
|
18
|
-
description
|
|
18
|
+
description,
|
|
19
|
+
moreInfoAriaLabel
|
|
19
20
|
} = props,
|
|
20
21
|
settings = _objectWithoutPropertiesLoose(props, _excluded);
|
|
21
22
|
|
|
@@ -28,7 +29,8 @@ const Settings = props => {
|
|
|
28
29
|
}, /*#__PURE__*/React.createElement(InfoIcon, {
|
|
29
30
|
height: 16,
|
|
30
31
|
width: 16,
|
|
31
|
-
className: style.infoIcon
|
|
32
|
+
className: style.infoIcon,
|
|
33
|
+
"aria-label": moreInfoAriaLabel
|
|
32
34
|
}), /*#__PURE__*/React.createElement("div", {
|
|
33
35
|
className: style.showToolTip
|
|
34
36
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -43,17 +45,20 @@ Settings.propTypes = process.env.NODE_ENV !== "production" ? _extends({}, InputS
|
|
|
43
45
|
|
|
44
46
|
const UserPreferences = props => {
|
|
45
47
|
const {
|
|
46
|
-
preferences = []
|
|
48
|
+
preferences = [],
|
|
49
|
+
moreInfoAriaLabel
|
|
47
50
|
} = props;
|
|
48
51
|
return /*#__PURE__*/React.createElement("div", {
|
|
49
52
|
className: style.preferences
|
|
50
53
|
}, _map(settings => /*#__PURE__*/React.createElement(Settings, _extends({}, settings, {
|
|
51
|
-
key: settings.label
|
|
54
|
+
key: settings.label,
|
|
55
|
+
moreInfoAriaLabel: moreInfoAriaLabel
|
|
52
56
|
})), preferences));
|
|
53
57
|
};
|
|
54
58
|
|
|
55
59
|
UserPreferences.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
56
|
-
preferences: PropTypes.arrayOf(PropTypes.shape(Settings.propTypes))
|
|
60
|
+
preferences: PropTypes.arrayOf(PropTypes.shape(Settings.propTypes)),
|
|
61
|
+
moreInfoAriaLabel: PropTypes.string
|
|
57
62
|
} : {};
|
|
58
63
|
export default UserPreferences;
|
|
59
64
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","NovaCompositionCoorpacademyInformationIcon","InfoIcon","InputSwitch","style","Settings","props","label","description","settings","infoIconWrapper","infoIcon","showToolTip","descriptionLabel","propTypes","string","isRequired","UserPreferences","preferences","arrayOf","shape"],"sources":["../../../src/organism/user-preferences/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {map, isEmpty} from 'lodash/fp';\nimport {NovaCompositionCoorpacademyInformationIcon as InfoIcon} from '@coorpacademy/nova-icons';\nimport InputSwitch from '../../atom/input-switch';\nimport style from './style.css';\n\nconst Settings = props => {\n const {label, description, ...settings} = props;\n return (\n <div className={style.settings}>\n <InputSwitch {...settings} />\n <span className={style.label}>{label}</span>\n {isEmpty(description) ? null : (\n <div className={style.infoIconWrapper}>\n <InfoIcon
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","NovaCompositionCoorpacademyInformationIcon","InfoIcon","InputSwitch","style","Settings","props","label","description","moreInfoAriaLabel","settings","infoIconWrapper","infoIcon","showToolTip","descriptionLabel","propTypes","string","isRequired","UserPreferences","preferences","arrayOf","shape"],"sources":["../../../src/organism/user-preferences/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {map, isEmpty} from 'lodash/fp';\nimport {NovaCompositionCoorpacademyInformationIcon as InfoIcon} from '@coorpacademy/nova-icons';\nimport InputSwitch from '../../atom/input-switch';\nimport style from './style.css';\n\nconst Settings = props => {\n const {label, description, moreInfoAriaLabel, ...settings} = props;\n return (\n <div className={style.settings}>\n <InputSwitch {...settings} />\n <span className={style.label}>{label}</span>\n {isEmpty(description) ? null : (\n <div className={style.infoIconWrapper}>\n <InfoIcon\n height={16}\n width={16}\n className={style.infoIcon}\n aria-label={moreInfoAriaLabel}\n />\n <div className={style.showToolTip}>\n <div className={style.descriptionLabel}>{description}</div>\n </div>\n </div>\n )}\n </div>\n );\n};\n\nSettings.propTypes = {\n ...InputSwitch.propTypes,\n label: PropTypes.string.isRequired,\n description: PropTypes.string\n};\n\nconst UserPreferences = props => {\n const {preferences = [], moreInfoAriaLabel} = props;\n\n return (\n <div className={style.preferences}>\n {map(\n settings => (\n <Settings {...settings} key={settings.label} moreInfoAriaLabel={moreInfoAriaLabel} />\n ),\n preferences\n )}\n </div>\n );\n};\n\nUserPreferences.propTypes = {\n preferences: PropTypes.arrayOf(PropTypes.shape(Settings.propTypes)),\n moreInfoAriaLabel: PropTypes.string\n};\n\nexport default UserPreferences;\n"],"mappings":";;;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,SAAQC,0CAA0C,IAAIC,QAAtD,QAAqE,0BAArE;AACA,OAAOC,WAAP,MAAwB,yBAAxB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,QAAQ,GAAGC,KAAK,IAAI;EACxB,MAAM;IAACC,KAAD;IAAQC,WAAR;IAAqBC;EAArB,IAAuDH,KAA7D;EAAA,MAAiDI,QAAjD,iCAA6DJ,KAA7D;;EACA,oBACE;IAAK,SAAS,EA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Types: {
|
|
4
4
|
mainTitle: PropTypes.Validator<string>;
|
|
5
5
|
mainSubtitle: PropTypes.Validator<string>;
|
|
6
|
+
adaptiveAriaLabel: PropTypes.Requireable<string>;
|
|
6
7
|
total: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
7
8
|
label: PropTypes.Validator<string>;
|
|
8
9
|
stars: PropTypes.Validator<number>;
|
|
@@ -32,6 +33,7 @@ declare class Progression extends React.Component<any, any, any> {
|
|
|
32
33
|
label: PropTypes.Validator<string>;
|
|
33
34
|
level: PropTypes.Validator<string>;
|
|
34
35
|
state: PropTypes.Validator<string>;
|
|
36
|
+
adaptiveAriaLabel: PropTypes.Requireable<string>;
|
|
35
37
|
type: PropTypes.Validator<string>;
|
|
36
38
|
adaptive: PropTypes.Validator<boolean>;
|
|
37
39
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/activity/index.js"],"names":[],"mappings":";AAaA;IACE
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/activity/index.js"],"names":[],"mappings":";AAaA;IACE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAwBE;IAEF;;;;;;;;;;;;;;;;;;;;;;MAEE;IAEF,sCAIC;IAED,8BAME;IAEF,oCAKE;IAEF,sBAoFC;CACF"}
|
|
@@ -51,6 +51,7 @@ class Progression extends React.Component {
|
|
|
51
51
|
mainSubtitle,
|
|
52
52
|
recommendation = {},
|
|
53
53
|
progressions = [],
|
|
54
|
+
adaptiveAriaLabel,
|
|
54
55
|
total,
|
|
55
56
|
engines = [],
|
|
56
57
|
themeFilter = {},
|
|
@@ -66,7 +67,8 @@ class Progression extends React.Component {
|
|
|
66
67
|
className: style.loader
|
|
67
68
|
}, /*#__PURE__*/React.createElement(Loader, null)) : null;
|
|
68
69
|
const allProgressions = progressions.map(progression => /*#__PURE__*/React.createElement(ProgressionItem, _extends({}, _omit(['ref'], progression), {
|
|
69
|
-
key: progression.ref
|
|
70
|
+
key: progression.ref,
|
|
71
|
+
adaptiveAriaLabel: adaptiveAriaLabel
|
|
70
72
|
})));
|
|
71
73
|
const coreProgression = /*#__PURE__*/React.createElement("div", {
|
|
72
74
|
"data-name": "activityCore",
|
|
@@ -127,6 +129,7 @@ Progression.contextTypes = {
|
|
|
127
129
|
Progression.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
128
130
|
mainTitle: PropTypes.string.isRequired,
|
|
129
131
|
mainSubtitle: PropTypes.string.isRequired,
|
|
132
|
+
adaptiveAriaLabel: PropTypes.string,
|
|
130
133
|
total: PropTypes.shape({
|
|
131
134
|
label: PropTypes.string.isRequired,
|
|
132
135
|
stars: PropTypes.number.isRequired
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","classnames","Provider","Button","Select","Loader","ProgressionItem","EngineStars","StarsSummary","style","Progression","Component","constructor","props","context","handleClick","e","recommendation","stopPropagation","preventDefault","onClick","handleSelectTheme","themeFilter","onChange","bind","render","mainTitle","mainSubtitle","progressions","total","engines","loading","skin","primary","loader","allProgressions","map","progression","ref","coreProgression","core","themeSelect","options","selectBorder","select","recommendationSection","recommendationWrapper","title","subtitle","course","innerHTML","__html","courseTitle","cta","backgroundColor","default","headerProgression","wrapperCta","wrapperProgression","contextTypes","childContextTypes","propTypes","string","isRequired","shape","label","stars","number","arrayOf","bool","func"],"sources":["../../../src/template/activity/index.js"],"sourcesContent":["import React from 'react';\nimport {get, omit, isEmpty} from 'lodash/fp';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport Provider from '../../atom/provider';\nimport Button from '../../atom/button';\nimport Select from '../../atom/select';\nimport Loader from '../../atom/loader';\nimport ProgressionItem from './progression-item';\nimport EngineStars from './engine-stars';\nimport StarsSummary from './stars-summary';\nimport style from './style.css';\n\nclass Progression extends React.Component {\n static propTypes = {\n mainTitle: PropTypes.string.isRequired,\n mainSubtitle: PropTypes.string.isRequired,\n total: PropTypes.shape({\n label: PropTypes.string.isRequired,\n stars: PropTypes.number.isRequired\n }).isRequired,\n engines: PropTypes.arrayOf(PropTypes.shape(EngineStars.propTypes)),\n loading: PropTypes.bool.isRequired,\n progressions: PropTypes.arrayOf(\n PropTypes.shape({...ProgressionItem.propTypes, ref: PropTypes.string.isRequired})\n ),\n themeFilter: PropTypes.shape({\n options: Select.propTypes.options.isRequired,\n onChange: Select.propTypes.onChange\n }),\n recommendation: PropTypes.shape({\n cta: PropTypes.string.isRequired,\n title: PropTypes.string.isRequired,\n subtitle: PropTypes.string.isRequired,\n courseTitle: PropTypes.string.isRequired,\n onClick: PropTypes.func\n })\n };\n\n static contextTypes = {\n skin: Provider.childContextTypes.skin\n };\n\n constructor(props, context) {\n super(props, context);\n this.handleClick = this.handleClick.bind(this);\n this.handleSelectTheme = this.handleSelectTheme.bind(this);\n }\n\n handleClick = e => {\n const {recommendation} = this.props;\n e.stopPropagation();\n e.preventDefault();\n const {onClick} = recommendation;\n onClick && onClick(e);\n };\n\n handleSelectTheme = e => {\n const {\n themeFilter: {onChange}\n } = this.props;\n onChange && onChange(e);\n };\n\n render() {\n const {\n mainTitle,\n mainSubtitle,\n recommendation = {},\n progressions = [],\n total,\n engines = [],\n themeFilter = {},\n loading\n } = this.props;\n const {skin} = this.context;\n\n const primary = get('common.primary', skin);\n const loader = loading ? (\n <div className={style.loader}>\n <Loader />\n </div>\n ) : null;\n const allProgressions = progressions.map(progression => (\n <ProgressionItem
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","classnames","Provider","Button","Select","Loader","ProgressionItem","EngineStars","StarsSummary","style","Progression","Component","constructor","props","context","handleClick","e","recommendation","stopPropagation","preventDefault","onClick","handleSelectTheme","themeFilter","onChange","bind","render","mainTitle","mainSubtitle","progressions","adaptiveAriaLabel","total","engines","loading","skin","primary","loader","allProgressions","map","progression","ref","coreProgression","core","themeSelect","options","selectBorder","select","recommendationSection","recommendationWrapper","title","subtitle","course","innerHTML","__html","courseTitle","cta","backgroundColor","default","headerProgression","wrapperCta","wrapperProgression","contextTypes","childContextTypes","propTypes","string","isRequired","shape","label","stars","number","arrayOf","bool","func"],"sources":["../../../src/template/activity/index.js"],"sourcesContent":["import React from 'react';\nimport {get, omit, isEmpty} from 'lodash/fp';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport Provider from '../../atom/provider';\nimport Button from '../../atom/button';\nimport Select from '../../atom/select';\nimport Loader from '../../atom/loader';\nimport ProgressionItem from './progression-item';\nimport EngineStars from './engine-stars';\nimport StarsSummary from './stars-summary';\nimport style from './style.css';\n\nclass Progression extends React.Component {\n static propTypes = {\n mainTitle: PropTypes.string.isRequired,\n mainSubtitle: PropTypes.string.isRequired,\n adaptiveAriaLabel: PropTypes.string,\n total: PropTypes.shape({\n label: PropTypes.string.isRequired,\n stars: PropTypes.number.isRequired\n }).isRequired,\n engines: PropTypes.arrayOf(PropTypes.shape(EngineStars.propTypes)),\n loading: PropTypes.bool.isRequired,\n progressions: PropTypes.arrayOf(\n PropTypes.shape({...ProgressionItem.propTypes, ref: PropTypes.string.isRequired})\n ),\n themeFilter: PropTypes.shape({\n options: Select.propTypes.options.isRequired,\n onChange: Select.propTypes.onChange\n }),\n recommendation: PropTypes.shape({\n cta: PropTypes.string.isRequired,\n title: PropTypes.string.isRequired,\n subtitle: PropTypes.string.isRequired,\n courseTitle: PropTypes.string.isRequired,\n onClick: PropTypes.func\n })\n };\n\n static contextTypes = {\n skin: Provider.childContextTypes.skin\n };\n\n constructor(props, context) {\n super(props, context);\n this.handleClick = this.handleClick.bind(this);\n this.handleSelectTheme = this.handleSelectTheme.bind(this);\n }\n\n handleClick = e => {\n const {recommendation} = this.props;\n e.stopPropagation();\n e.preventDefault();\n const {onClick} = recommendation;\n onClick && onClick(e);\n };\n\n handleSelectTheme = e => {\n const {\n themeFilter: {onChange}\n } = this.props;\n onChange && onChange(e);\n };\n\n render() {\n const {\n mainTitle,\n mainSubtitle,\n recommendation = {},\n progressions = [],\n adaptiveAriaLabel,\n total,\n engines = [],\n themeFilter = {},\n loading\n } = this.props;\n const {skin} = this.context;\n\n const primary = get('common.primary', skin);\n const loader = loading ? (\n <div className={style.loader}>\n <Loader />\n </div>\n ) : null;\n const allProgressions = progressions.map(progression => (\n <ProgressionItem\n {...omit(['ref'], progression)}\n key={progression.ref}\n adaptiveAriaLabel={adaptiveAriaLabel}\n />\n ));\n\n const coreProgression = (\n <div data-name=\"activityCore\" className={style.core}>\n {allProgressions}\n </div>\n );\n const themeSelect = !isEmpty(themeFilter.options) ? (\n <Select\n borderClassName={style.selectBorder}\n className={style.select}\n theme=\"thematiques\"\n options={themeFilter.options}\n onChange={this.handleSelectTheme}\n />\n ) : null;\n const recommendationSection = !isEmpty(recommendation) ? (\n <div className={style.recommendationWrapper}>\n <p className={style.recommendationSection}>{recommendation.title} </p>\n <p className={style.recommendationSection}>\n <span>{recommendation.subtitle} </span>\n <span\n className={classnames(style.course, style.innerHTML)}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: recommendation.courseTitle}}\n />\n </p>\n <Button\n type=\"link\"\n onClick={this.handleClick}\n submitValue={recommendation.cta}\n style={{\n backgroundColor: primary\n }}\n className={style.cta}\n />\n </div>\n ) : null;\n return (\n <div className={style.default}>\n <div data-name=\"activity-header\">\n <div className={style.mainTitle}>\n <span>{mainTitle}</span> {mainSubtitle}\n </div>\n <div className={style.headerProgression}>\n <div className={style.wrapperCta}>\n {themeSelect}\n {recommendationSection}\n </div>\n <StarsSummary engines={engines} total={total} />\n </div>\n </div>\n <div className={style.wrapperProgression} data-name=\"activityList\">\n {coreProgression}\n {loader}\n </div>\n </div>\n );\n }\n}\n\nexport default Progression;\n"],"mappings":";;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAEA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,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OAAO,EAAE/B,SAAS,CAACqE,OAAV,CAAkBrE,SAAS,CAACiE,KAAV,CAAgB1D,WAAW,CAACuD,SAA5B,CAAlB,CARQ;EASjB9B,OAAO,EAAEhC,SAAS,CAACsE,IAAV,CAAeN,UATP;EAUjBpC,YAAY,EAAE5B,SAAS,CAACqE,OAAV,CACZrE,SAAS,CAACiE,KAAV,cAAoB3D,eAAe,CAACwD,SAApC;IAA+CvB,GAAG,EAAEvC,SAAS,CAAC+D,MAAV,CAAiBC;EAArE,GADY,CAVG;EAajB1C,WAAW,EAAEtB,SAAS,CAACiE,KAAV,CAAgB;IAC3BtB,OAAO,EAAEvC,MAAM,CAAC0D,SAAP,CAAiBnB,OAAjB,CAAyBqB,UADP;IAE3BzC,QAAQ,EAAEnB,MAAM,CAAC0D,SAAP,CAAiBvC;EAFA,CAAhB,CAbI;EAiBjBN,cAAc,EAAEjB,SAAS,CAACiE,KAAV,CAAgB;IAC9BX,GAAG,EAAEtD,SAAS,CAAC+D,MAAV,CAAiBC,UADQ;IAE9BhB,KAAK,EAAEhD,SAAS,CAAC+D,MAAV,CAAiBC,UAFM;IAG9Bf,QAAQ,EAAEjD,SAAS,CAAC+D,MAAV,CAAiBC,UAHG;IAI9BX,WAAW,EAAErD,SAAS,CAAC+D,MAAV,CAAiBC,UAJA;IAK9B5C,OAAO,EAAEpB,SAAS,CAACuE;EALW,CAAhB;AAjBC,C;AA0IrB,eAAe7D,WAAf"}
|
|
@@ -10,6 +10,7 @@ declare namespace ProgressionItem {
|
|
|
10
10
|
const label: PropTypes.Validator<string>;
|
|
11
11
|
const level: PropTypes.Validator<string>;
|
|
12
12
|
const state: PropTypes.Validator<string>;
|
|
13
|
+
const adaptiveAriaLabel: PropTypes.Requireable<string>;
|
|
13
14
|
const type: PropTypes.Validator<string>;
|
|
14
15
|
const adaptive: PropTypes.Validator<boolean>;
|
|
15
16
|
const onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progression-item.d.ts","sourceRoot":"","sources":["../../../src/template/activity/progression-item.js"],"names":[],"mappings":";AAmCA,
|
|
1
|
+
{"version":3,"file":"progression-item.d.ts","sourceRoot":"","sources":["../../../src/template/activity/progression-item.js"],"names":[],"mappings":";AAmCA,wEAyFC"}
|
|
@@ -35,7 +35,8 @@ const ProgressionItem = (props, context) => {
|
|
|
35
35
|
maxStars,
|
|
36
36
|
state,
|
|
37
37
|
type,
|
|
38
|
-
steps = 0
|
|
38
|
+
steps = 0,
|
|
39
|
+
adaptiveAriaLabel
|
|
39
40
|
} = props;
|
|
40
41
|
|
|
41
42
|
const dark = _get('common.dark', skin);
|
|
@@ -52,7 +53,8 @@ const ProgressionItem = (props, context) => {
|
|
|
52
53
|
}
|
|
53
54
|
}, /*#__PURE__*/React.createElement(AdaptiveIcon, {
|
|
54
55
|
color: white,
|
|
55
|
-
height: 14
|
|
56
|
+
height: 14,
|
|
57
|
+
"aria-label": adaptiveAriaLabel
|
|
56
58
|
})) : null;
|
|
57
59
|
const handleCTAClick = useMemo(() => e => {
|
|
58
60
|
e.stopPropagation();
|
|
@@ -125,6 +127,7 @@ ProgressionItem.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
125
127
|
label: PropTypes.string.isRequired,
|
|
126
128
|
level: PropTypes.string.isRequired,
|
|
127
129
|
state: PropTypes.string.isRequired,
|
|
130
|
+
adaptiveAriaLabel: PropTypes.string,
|
|
128
131
|
type: PropTypes.string.isRequired,
|
|
129
132
|
adaptive: PropTypes.bool.isRequired,
|
|
130
133
|
onClick: PropTypes.func
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progression-item.js","names":["React","useMemo","PropTypes","classnames","NovaCompositionNavigationArrowRight","ArrowRightIcon","NovaCompositionCoorpacademyStar","StarIcon","NovaCompositionCoorpacademyTimer","TimerIcon","NovaCompositionCoorpacademyBolt","BoltIcon","NovaSolidSchoolScienceGraduationHat","CertificationIcon","NovaCompositionCoorpacademyAdaptive","AdaptiveIcon","NovaSolidContentContentBook1","LearnerIcon","NovaCompositionCoorpacademyScorm","ScormIcon","NovaCompositionCoorpacademyArticle","ArticleIcon","NovaCompositionCoorpacademyVideo","VideoIcon","NovaCompositionCoorpacademyMicrophone","PodcastIcon","NovaCompositionCoorpacademyRevision","RevisionIcon","Provider","ProgressBar","Link","style","ICONS","chapter","course","battle","certification","article","scorm","video","podcast","review","ProgressionItem","props","context","skin","disabled","adaptive","completion","label","level","onClick","stars","maxStars","state","type","steps","dark","primary","white","IconType","adaptiveIcon","backgroundColor","handleCTAClick","e","stopPropagation","preventDefault","link","color","cta","progressionItem","wrapperTitle","iconType","innerHTML","__html","smallStars","iconStar","borderRadius","propTypes","number","isRequired","bool","string","func","contextTypes","childContextTypes"],"sources":["../../../src/template/activity/progression-item.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {get, noop} from 'lodash/fp';\nimport {\n NovaCompositionNavigationArrowRight as ArrowRightIcon,\n NovaCompositionCoorpacademyStar as StarIcon,\n NovaCompositionCoorpacademyTimer as TimerIcon,\n NovaCompositionCoorpacademyBolt as BoltIcon,\n NovaSolidSchoolScienceGraduationHat as CertificationIcon,\n NovaCompositionCoorpacademyAdaptive as AdaptiveIcon,\n NovaSolidContentContentBook1 as LearnerIcon,\n NovaCompositionCoorpacademyScorm as ScormIcon,\n NovaCompositionCoorpacademyArticle as ArticleIcon,\n NovaCompositionCoorpacademyVideo as VideoIcon,\n NovaCompositionCoorpacademyMicrophone as PodcastIcon,\n NovaCompositionCoorpacademyRevision as RevisionIcon\n} from '@coorpacademy/nova-icons';\nimport Provider from '../../atom/provider';\nimport ProgressBar from '../../molecule/progress-bar';\nimport Link from '../../atom/link';\nimport style from './progression-item.css';\n\nconst ICONS = {\n chapter: TimerIcon,\n course: LearnerIcon,\n battle: BoltIcon,\n certification: CertificationIcon,\n article: ArticleIcon,\n scorm: ScormIcon,\n video: VideoIcon,\n podcast: PodcastIcon,\n review: RevisionIcon\n};\n\nconst ProgressionItem = (props, context) => {\n const {skin} = context;\n const {\n disabled = false,\n adaptive,\n completion,\n label,\n level,\n onClick = noop,\n stars,\n maxStars,\n state,\n type,\n steps = 0\n } = props;\n\n const dark = get('common.dark', skin);\n const primary = get('common.primary', skin);\n const white = get('common.white', skin);\n const IconType = ICONS[type];\n\n const adaptiveIcon = adaptive ? (\n <div\n className={style.adaptiveIcon}\n style={{\n backgroundColor: primary\n }}\n >\n <AdaptiveIcon color={white} height={14} />\n </div>\n ) : null;\n\n const handleCTAClick = useMemo(\n () => e => {\n e.stopPropagation();\n e.preventDefault();\n onClick && onClick(e);\n },\n [onClick]\n );\n\n const link = disabled ? null : (\n <Link style={{color: primary}} onClick={handleCTAClick} data-progression-state={state}>\n <span className={style.cta}>\n {state} <ArrowRightIcon color={primary} height={12} width={20} />\n </span>\n </Link>\n );\n\n return (\n <div className={classnames(style.progressionItem, disabled ? style.disabled : '')}>\n <div className={style.wrapperTitle}>\n <IconType className={style.iconType} color={dark} />\n <div data-name=\"activityLabel\" className={style.label} title={label}>\n <div\n className={style.innerHTML}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: label}}\n />\n {adaptiveIcon}\n </div>\n\n <div\n data-name=\"activityStars\"\n className={style.stars}\n style={{\n color: primary\n }}\n >\n {stars}\n {maxStars ? ' /' : null}\n {maxStars ? <span className={style.smallStars}>{maxStars}</span> : null}{' '}\n <StarIcon className={style.iconStar} color={primary} />\n </div>\n </div>\n <ProgressBar\n className={style.completion}\n value={completion * 100}\n max={100}\n steps={steps}\n style={{backgroundColor: primary, borderRadius: 0}}\n />\n <div className={style.state}>\n {link}\n <span className={style.level}>{level}</span>\n </div>\n </div>\n );\n};\n\nProgressionItem.propTypes = {\n completion: PropTypes.number.isRequired,\n stars: PropTypes.number.isRequired,\n maxStars: PropTypes.number,\n steps: PropTypes.number,\n disabled: PropTypes.bool,\n label: PropTypes.string.isRequired,\n level: PropTypes.string.isRequired,\n state: PropTypes.string.isRequired,\n type: PropTypes.string.isRequired,\n adaptive: PropTypes.bool.isRequired,\n onClick: PropTypes.func\n};\n\nProgressionItem.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nexport default ProgressionItem;\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,OAAf,QAA6B,OAA7B;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAEA,SACEC,mCAAmC,IAAIC,cADzC,EAEEC,+BAA+B,IAAIC,QAFrC,EAGEC,gCAAgC,IAAIC,SAHtC,EAIEC,+BAA+B,IAAIC,QAJrC,EAKEC,mCAAmC,IAAIC,iBALzC,EAMEC,mCAAmC,IAAIC,YANzC,EAOEC,4BAA4B,IAAIC,WAPlC,EAQEC,gCAAgC,IAAIC,SARtC,EASEC,kCAAkC,IAAIC,WATxC,EAUEC,gCAAgC,IAAIC,SAVtC,EAWEC,qCAAqC,IAAIC,WAX3C,EAYEC,mCAAmC,IAAIC,YAZzC,QAaO,0BAbP;AAcA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAAOC,WAAP,MAAwB,6BAAxB;AACA,OAAOC,IAAP,MAAiB,iBAAjB;AACA,OAAOC,KAAP,MAAkB,wBAAlB;AAEA,MAAMC,KAAK,GAAG;EACZC,OAAO,EAAExB,SADG;EAEZyB,MAAM,EAAEjB,WAFI;EAGZkB,MAAM,EAAExB,QAHI;EAIZyB,aAAa,EAAEvB,iBAJH;EAKZwB,OAAO,EAAEhB,WALG;EAMZiB,KAAK,EAAEnB,SANK;EAOZoB,KAAK,EAAEhB,SAPK;EAQZiB,OAAO,EAAEf,WARG;EASZgB,MAAM,EAAEd;AATI,CAAd;;AAYA,MAAMe,eAAe,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EAC1C,MAAM;IAACC;EAAD,IAASD,OAAf;EACA,MAAM;IACJE,QAAQ,GAAG,KADP;IAEJC,QAFI;IAGJC,UAHI;IAIJC,KAJI;IAKJC,KALI;IAMJC,OAAO,QANH;IAOJC,KAPI;IAQJC,QARI;IASJC,KATI;IAUJC,IAVI;IAWJC,KAAK,GAAG;
|
|
1
|
+
{"version":3,"file":"progression-item.js","names":["React","useMemo","PropTypes","classnames","NovaCompositionNavigationArrowRight","ArrowRightIcon","NovaCompositionCoorpacademyStar","StarIcon","NovaCompositionCoorpacademyTimer","TimerIcon","NovaCompositionCoorpacademyBolt","BoltIcon","NovaSolidSchoolScienceGraduationHat","CertificationIcon","NovaCompositionCoorpacademyAdaptive","AdaptiveIcon","NovaSolidContentContentBook1","LearnerIcon","NovaCompositionCoorpacademyScorm","ScormIcon","NovaCompositionCoorpacademyArticle","ArticleIcon","NovaCompositionCoorpacademyVideo","VideoIcon","NovaCompositionCoorpacademyMicrophone","PodcastIcon","NovaCompositionCoorpacademyRevision","RevisionIcon","Provider","ProgressBar","Link","style","ICONS","chapter","course","battle","certification","article","scorm","video","podcast","review","ProgressionItem","props","context","skin","disabled","adaptive","completion","label","level","onClick","stars","maxStars","state","type","steps","adaptiveAriaLabel","dark","primary","white","IconType","adaptiveIcon","backgroundColor","handleCTAClick","e","stopPropagation","preventDefault","link","color","cta","progressionItem","wrapperTitle","iconType","innerHTML","__html","smallStars","iconStar","borderRadius","propTypes","number","isRequired","bool","string","func","contextTypes","childContextTypes"],"sources":["../../../src/template/activity/progression-item.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {get, noop} from 'lodash/fp';\nimport {\n NovaCompositionNavigationArrowRight as ArrowRightIcon,\n NovaCompositionCoorpacademyStar as StarIcon,\n NovaCompositionCoorpacademyTimer as TimerIcon,\n NovaCompositionCoorpacademyBolt as BoltIcon,\n NovaSolidSchoolScienceGraduationHat as CertificationIcon,\n NovaCompositionCoorpacademyAdaptive as AdaptiveIcon,\n NovaSolidContentContentBook1 as LearnerIcon,\n NovaCompositionCoorpacademyScorm as ScormIcon,\n NovaCompositionCoorpacademyArticle as ArticleIcon,\n NovaCompositionCoorpacademyVideo as VideoIcon,\n NovaCompositionCoorpacademyMicrophone as PodcastIcon,\n NovaCompositionCoorpacademyRevision as RevisionIcon\n} from '@coorpacademy/nova-icons';\nimport Provider from '../../atom/provider';\nimport ProgressBar from '../../molecule/progress-bar';\nimport Link from '../../atom/link';\nimport style from './progression-item.css';\n\nconst ICONS = {\n chapter: TimerIcon,\n course: LearnerIcon,\n battle: BoltIcon,\n certification: CertificationIcon,\n article: ArticleIcon,\n scorm: ScormIcon,\n video: VideoIcon,\n podcast: PodcastIcon,\n review: RevisionIcon\n};\n\nconst ProgressionItem = (props, context) => {\n const {skin} = context;\n const {\n disabled = false,\n adaptive,\n completion,\n label,\n level,\n onClick = noop,\n stars,\n maxStars,\n state,\n type,\n steps = 0,\n adaptiveAriaLabel\n } = props;\n\n const dark = get('common.dark', skin);\n const primary = get('common.primary', skin);\n const white = get('common.white', skin);\n const IconType = ICONS[type];\n\n const adaptiveIcon = adaptive ? (\n <div\n className={style.adaptiveIcon}\n style={{\n backgroundColor: primary\n }}\n >\n <AdaptiveIcon color={white} height={14} aria-label={adaptiveAriaLabel} />\n </div>\n ) : null;\n\n const handleCTAClick = useMemo(\n () => e => {\n e.stopPropagation();\n e.preventDefault();\n onClick && onClick(e);\n },\n [onClick]\n );\n\n const link = disabled ? null : (\n <Link style={{color: primary}} onClick={handleCTAClick} data-progression-state={state}>\n <span className={style.cta}>\n {state} <ArrowRightIcon color={primary} height={12} width={20} />\n </span>\n </Link>\n );\n\n return (\n <div className={classnames(style.progressionItem, disabled ? style.disabled : '')}>\n <div className={style.wrapperTitle}>\n <IconType className={style.iconType} color={dark} />\n <div data-name=\"activityLabel\" className={style.label} title={label}>\n <div\n className={style.innerHTML}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: label}}\n />\n {adaptiveIcon}\n </div>\n\n <div\n data-name=\"activityStars\"\n className={style.stars}\n style={{\n color: primary\n }}\n >\n {stars}\n {maxStars ? ' /' : null}\n {maxStars ? <span className={style.smallStars}>{maxStars}</span> : null}{' '}\n <StarIcon className={style.iconStar} color={primary} />\n </div>\n </div>\n <ProgressBar\n className={style.completion}\n value={completion * 100}\n max={100}\n steps={steps}\n style={{backgroundColor: primary, borderRadius: 0}}\n />\n <div className={style.state}>\n {link}\n <span className={style.level}>{level}</span>\n </div>\n </div>\n );\n};\n\nProgressionItem.propTypes = {\n completion: PropTypes.number.isRequired,\n stars: PropTypes.number.isRequired,\n maxStars: PropTypes.number,\n steps: PropTypes.number,\n disabled: PropTypes.bool,\n label: PropTypes.string.isRequired,\n level: PropTypes.string.isRequired,\n state: PropTypes.string.isRequired,\n adaptiveAriaLabel: PropTypes.string,\n type: PropTypes.string.isRequired,\n adaptive: PropTypes.bool.isRequired,\n onClick: PropTypes.func\n};\n\nProgressionItem.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nexport default ProgressionItem;\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,OAAf,QAA6B,OAA7B;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAEA,SACEC,mCAAmC,IAAIC,cADzC,EAEEC,+BAA+B,IAAIC,QAFrC,EAGEC,gCAAgC,IAAIC,SAHtC,EAIEC,+BAA+B,IAAIC,QAJrC,EAKEC,mCAAmC,IAAIC,iBALzC,EAMEC,mCAAmC,IAAIC,YANzC,EAOEC,4BAA4B,IAAIC,WAPlC,EAQEC,gCAAgC,IAAIC,SARtC,EASEC,kCAAkC,IAAIC,WATxC,EAUEC,gCAAgC,IAAIC,SAVtC,EAWEC,qCAAqC,IAAIC,WAX3C,EAYEC,mCAAmC,IAAIC,YAZzC,QAaO,0BAbP;AAcA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAAOC,WAAP,MAAwB,6BAAxB;AACA,OAAOC,IAAP,MAAiB,iBAAjB;AACA,OAAOC,KAAP,MAAkB,wBAAlB;AAEA,MAAMC,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
|
|
|
12
12
|
skills: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
13
13
|
text: import("prop-types").Requireable<string>;
|
|
14
14
|
tooltipText: import("prop-types").Requireable<string>;
|
|
15
|
+
moreDetailsAreaLabel: import("prop-types").Requireable<string>;
|
|
16
|
+
closeToolTipInformationTextAriaLabel: import("prop-types").Requireable<string>;
|
|
15
17
|
}>>;
|
|
16
18
|
questions: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
17
19
|
text: import("prop-types").Requireable<string>;
|
|
18
20
|
tooltipText: import("prop-types").Requireable<string>;
|
|
21
|
+
moreDetailsAreaLabel: import("prop-types").Requireable<string>;
|
|
22
|
+
closeToolTipInformationTextAriaLabel: import("prop-types").Requireable<string>;
|
|
19
23
|
}>>;
|
|
20
24
|
lifes: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
21
25
|
text: import("prop-types").Requireable<string>;
|
|
22
26
|
tooltipText: import("prop-types").Requireable<string>;
|
|
27
|
+
moreDetailsAreaLabel: import("prop-types").Requireable<string>;
|
|
28
|
+
closeToolTipInformationTextAriaLabel: import("prop-types").Requireable<string>;
|
|
23
29
|
}>>;
|
|
24
30
|
allright: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
25
31
|
text: import("prop-types").Requireable<string>;
|
|
26
32
|
tooltipText: import("prop-types").Requireable<string>;
|
|
33
|
+
moreDetailsAreaLabel: import("prop-types").Requireable<string>;
|
|
34
|
+
closeToolTipInformationTextAriaLabel: import("prop-types").Requireable<string>;
|
|
27
35
|
}>>;
|
|
28
36
|
}>>;
|
|
29
37
|
}>>;
|
|
@@ -467,7 +475,7 @@ declare const AppReview: {
|
|
|
467
475
|
'aria-label': import("prop-types").Requireable<string>;
|
|
468
476
|
'data-name': import("prop-types").Requireable<string>;
|
|
469
477
|
animationLottie: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
470
|
-
'aria-label': import("prop-types").
|
|
478
|
+
'aria-label': import("prop-types").Requireable<string>;
|
|
471
479
|
'data-name': import("prop-types").Requireable<string>;
|
|
472
480
|
animationSrc: import("prop-types").Validator<string>;
|
|
473
481
|
loop: import("prop-types").Requireable<boolean>;
|
|
@@ -488,7 +496,7 @@ declare const AppReview: {
|
|
|
488
496
|
'aria-label': import("prop-types").Requireable<string>;
|
|
489
497
|
'data-name': import("prop-types").Requireable<string>;
|
|
490
498
|
animationLottie: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
491
|
-
'aria-label': import("prop-types").
|
|
499
|
+
'aria-label': import("prop-types").Requireable<string>;
|
|
492
500
|
'data-name': import("prop-types").Requireable<string>;
|
|
493
501
|
animationSrc: import("prop-types").Validator<string>;
|
|
494
502
|
loop: import("prop-types").Requireable<boolean>;
|
|
@@ -516,7 +524,7 @@ declare const AppReview: {
|
|
|
516
524
|
'aria-label': import("prop-types").Requireable<string>;
|
|
517
525
|
'data-name': import("prop-types").Requireable<string>;
|
|
518
526
|
animationLottie: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
519
|
-
'aria-label': import("prop-types").
|
|
527
|
+
'aria-label': import("prop-types").Requireable<string>;
|
|
520
528
|
'data-name': import("prop-types").Requireable<string>;
|
|
521
529
|
animationSrc: import("prop-types").Validator<string>;
|
|
522
530
|
loop: import("prop-types").Requireable<boolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/app-review/index.tsx"],"names":[],"mappings":";AAKA,OAAkB,EAAC,cAAc,EAAC,MAAM,cAAc,CAAC;AAEvD,QAAA,MAAM,SAAS;+CAA4C,cAAc
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/app-review/index.tsx"],"names":[],"mappings":";AAKA,OAAkB,EAAC,cAAc,EAAC,MAAM,cAAc,CAAC;AAEvD,QAAA,MAAM,SAAS;+CAA4C,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAWxE,CAAC;AAIF,eAAe,SAAS,CAAC"}
|
|
@@ -423,7 +423,7 @@ declare const propTypes: {
|
|
|
423
423
|
'aria-label': PropTypes.Requireable<string>;
|
|
424
424
|
'data-name': PropTypes.Requireable<string>;
|
|
425
425
|
animationLottie: PropTypes.Requireable<PropTypes.InferProps<{
|
|
426
|
-
'aria-label': PropTypes.
|
|
426
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
427
427
|
'data-name': PropTypes.Requireable<string>;
|
|
428
428
|
animationSrc: PropTypes.Validator<string>;
|
|
429
429
|
loop: PropTypes.Requireable<boolean>;
|
|
@@ -444,7 +444,7 @@ declare const propTypes: {
|
|
|
444
444
|
'aria-label': PropTypes.Requireable<string>;
|
|
445
445
|
'data-name': PropTypes.Requireable<string>;
|
|
446
446
|
animationLottie: PropTypes.Requireable<PropTypes.InferProps<{
|
|
447
|
-
'aria-label': PropTypes.
|
|
447
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
448
448
|
'data-name': PropTypes.Requireable<string>;
|
|
449
449
|
animationSrc: PropTypes.Validator<string>;
|
|
450
450
|
loop: PropTypes.Requireable<boolean>;
|
|
@@ -472,7 +472,7 @@ declare const propTypes: {
|
|
|
472
472
|
'aria-label': PropTypes.Requireable<string>;
|
|
473
473
|
'data-name': PropTypes.Requireable<string>;
|
|
474
474
|
animationLottie: PropTypes.Requireable<PropTypes.InferProps<{
|
|
475
|
-
'aria-label': PropTypes.
|
|
475
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
476
476
|
'data-name': PropTypes.Requireable<string>;
|
|
477
477
|
animationSrc: PropTypes.Validator<string>;
|
|
478
478
|
loop: PropTypes.Requireable<boolean>;
|
|
@@ -20,18 +20,26 @@ declare const propTypes: {
|
|
|
20
20
|
skills: PropTypes.Requireable<PropTypes.InferProps<{
|
|
21
21
|
text: PropTypes.Requireable<string>;
|
|
22
22
|
tooltipText: PropTypes.Requireable<string>;
|
|
23
|
+
moreDetailsAreaLabel: PropTypes.Requireable<string>;
|
|
24
|
+
closeToolTipInformationTextAriaLabel: PropTypes.Requireable<string>;
|
|
23
25
|
}>>;
|
|
24
26
|
questions: PropTypes.Requireable<PropTypes.InferProps<{
|
|
25
27
|
text: PropTypes.Requireable<string>;
|
|
26
28
|
tooltipText: PropTypes.Requireable<string>;
|
|
29
|
+
moreDetailsAreaLabel: PropTypes.Requireable<string>;
|
|
30
|
+
closeToolTipInformationTextAriaLabel: PropTypes.Requireable<string>;
|
|
27
31
|
}>>;
|
|
28
32
|
lifes: PropTypes.Requireable<PropTypes.InferProps<{
|
|
29
33
|
text: PropTypes.Requireable<string>;
|
|
30
34
|
tooltipText: PropTypes.Requireable<string>;
|
|
35
|
+
moreDetailsAreaLabel: PropTypes.Requireable<string>;
|
|
36
|
+
closeToolTipInformationTextAriaLabel: PropTypes.Requireable<string>;
|
|
31
37
|
}>>;
|
|
32
38
|
allright: PropTypes.Requireable<PropTypes.InferProps<{
|
|
33
39
|
text: PropTypes.Requireable<string>;
|
|
34
40
|
tooltipText: PropTypes.Requireable<string>;
|
|
41
|
+
moreDetailsAreaLabel: PropTypes.Requireable<string>;
|
|
42
|
+
closeToolTipInformationTextAriaLabel: PropTypes.Requireable<string>;
|
|
35
43
|
}>>;
|
|
36
44
|
}>>;
|
|
37
45
|
}>>;
|
|
@@ -475,7 +483,7 @@ declare const propTypes: {
|
|
|
475
483
|
'aria-label': PropTypes.Requireable<string>;
|
|
476
484
|
'data-name': PropTypes.Requireable<string>;
|
|
477
485
|
animationLottie: PropTypes.Requireable<PropTypes.InferProps<{
|
|
478
|
-
'aria-label': PropTypes.
|
|
486
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
479
487
|
'data-name': PropTypes.Requireable<string>;
|
|
480
488
|
animationSrc: PropTypes.Validator<string>;
|
|
481
489
|
loop: PropTypes.Requireable<boolean>;
|
|
@@ -496,7 +504,7 @@ declare const propTypes: {
|
|
|
496
504
|
'aria-label': PropTypes.Requireable<string>;
|
|
497
505
|
'data-name': PropTypes.Requireable<string>;
|
|
498
506
|
animationLottie: PropTypes.Requireable<PropTypes.InferProps<{
|
|
499
|
-
'aria-label': PropTypes.
|
|
507
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
500
508
|
'data-name': PropTypes.Requireable<string>;
|
|
501
509
|
animationSrc: PropTypes.Validator<string>;
|
|
502
510
|
loop: PropTypes.Requireable<boolean>;
|
|
@@ -524,7 +532,7 @@ declare const propTypes: {
|
|
|
524
532
|
'aria-label': PropTypes.Requireable<string>;
|
|
525
533
|
'data-name': PropTypes.Requireable<string>;
|
|
526
534
|
animationLottie: PropTypes.Requireable<PropTypes.InferProps<{
|
|
527
|
-
'aria-label': PropTypes.
|
|
535
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
528
536
|
'data-name': PropTypes.Requireable<string>;
|
|
529
537
|
animationSrc: PropTypes.Validator<string>;
|
|
530
538
|
loop: PropTypes.Requireable<boolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prop-types.d.ts","sourceRoot":"","sources":["../../../src/template/app-review/prop-types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,UAAU,MAAM,cAAc,CAAC;AAGtC,OAAO,EAAC,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAC,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AAEtD,oBAAY,QAAQ,GAAG,QAAQ,GAAG,YAAY,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAErE,oBAAY,cAAc,GAAG;IAC3B,QAAQ,EAAE,QAAQ,CAAC;IACnB,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,UAAU,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC,OAAO,UAAU,CAAC,SAAS,CAAC,CAAC;IAC/D,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;CAC3B,CAAC;AAEF,QAAA,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"prop-types.d.ts","sourceRoot":"","sources":["../../../src/template/app-review/prop-types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,UAAU,MAAM,cAAc,CAAC;AAGtC,OAAO,EAAC,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAC,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AAEtD,oBAAY,QAAQ,GAAG,QAAQ,GAAG,YAAY,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAErE,oBAAY,cAAc,GAAG;IAC3B,QAAQ,EAAE,QAAQ,CAAC;IACnB,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,UAAU,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC,OAAO,UAAU,CAAC,SAAS,CAAC,CAAC;IAC/D,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;CAC3B,CAAC;AAEF,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKd,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -11,18 +11,26 @@ declare namespace ReviewDashboardSkills {
|
|
|
11
11
|
skills: PropTypes.Requireable<PropTypes.InferProps<{
|
|
12
12
|
text: PropTypes.Requireable<string>;
|
|
13
13
|
tooltipText: PropTypes.Requireable<string>;
|
|
14
|
+
moreDetailsAreaLabel: PropTypes.Requireable<string>;
|
|
15
|
+
closeToolTipInformationTextAriaLabel: PropTypes.Requireable<string>;
|
|
14
16
|
}>>;
|
|
15
17
|
questions: PropTypes.Requireable<PropTypes.InferProps<{
|
|
16
18
|
text: PropTypes.Requireable<string>;
|
|
17
19
|
tooltipText: PropTypes.Requireable<string>;
|
|
20
|
+
moreDetailsAreaLabel: PropTypes.Requireable<string>;
|
|
21
|
+
closeToolTipInformationTextAriaLabel: PropTypes.Requireable<string>;
|
|
18
22
|
}>>;
|
|
19
23
|
lifes: PropTypes.Requireable<PropTypes.InferProps<{
|
|
20
24
|
text: PropTypes.Requireable<string>;
|
|
21
25
|
tooltipText: PropTypes.Requireable<string>;
|
|
26
|
+
moreDetailsAreaLabel: PropTypes.Requireable<string>;
|
|
27
|
+
closeToolTipInformationTextAriaLabel: PropTypes.Requireable<string>;
|
|
22
28
|
}>>;
|
|
23
29
|
allright: PropTypes.Requireable<PropTypes.InferProps<{
|
|
24
30
|
text: PropTypes.Requireable<string>;
|
|
25
31
|
tooltipText: PropTypes.Requireable<string>;
|
|
32
|
+
moreDetailsAreaLabel: PropTypes.Requireable<string>;
|
|
33
|
+
closeToolTipInformationTextAriaLabel: PropTypes.Requireable<string>;
|
|
26
34
|
}>>;
|
|
27
35
|
}>>;
|
|
28
36
|
}>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/lottie-wrapper/index.js"],"names":[],"mappings":"AAsBO,iMAmCN;;AAED,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/lottie-wrapper/index.js"],"names":[],"mappings":"AAsBO,iMAmCN;;AAED,wDA4HC"}
|
|
@@ -132,9 +132,15 @@ const LottieWrapper = props => {
|
|
|
132
132
|
/* istanbul ignore next */
|
|
133
133
|
_lottieWeb.default.destroy(animationItem.name);
|
|
134
134
|
}, [lottieAnimationClassName, containerRef, hideOnTransparent, loop, animationSrc, _isIE11, animationItem, autoplay]);
|
|
135
|
-
|
|
135
|
+
const accessibilityProps = ariaLabel ? {
|
|
136
|
+
'aria-label': ariaLabel,
|
|
137
|
+
role: 'img'
|
|
138
|
+
} : {
|
|
139
|
+
'aria-hidden': 'true',
|
|
140
|
+
role: 'presentation'
|
|
141
|
+
};
|
|
142
|
+
return /*#__PURE__*/_react.default.createElement("div", _extends({}, accessibilityProps, {
|
|
136
143
|
ref: containerRef,
|
|
137
|
-
"aria-label": ariaLabel,
|
|
138
144
|
"data-name": dataName,
|
|
139
145
|
className: wrapperClassName,
|
|
140
146
|
style: _extends({}, width && {
|
|
@@ -147,7 +153,7 @@ const LottieWrapper = props => {
|
|
|
147
153
|
opacity: isAnimationVisible ? 1 : 0,
|
|
148
154
|
transition: 'opacity 0.25s ease-in'
|
|
149
155
|
})
|
|
150
|
-
}, _isIE11 ? /*#__PURE__*/_react.default.createElement("img", {
|
|
156
|
+
}), _isIE11 ? /*#__PURE__*/_react.default.createElement("img", {
|
|
151
157
|
src: ie11ImageBackup,
|
|
152
158
|
className: ie11BackupImageClassName,
|
|
153
159
|
"data-name": "ie11-backup-image"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["isIE11","window","userAgent","get","hasMsCrypto","has","hasRevision","includes","hasTrident","fetchAndLoadAnimation","_lottie","_fetch","animationSrc","containerRef","loop","animationClassnames","hideOnTransparent","autoplay","animationUrl","URL","toString","fetchResult","headers","animationData","json","animation","loadAnimation","container","current","renderer","rendererSettings","className","preserveAspectRatio","LottieWrapper","props","dataName","ariaLabel","width","height","ie11ImageBackup","backupImageClassName","animationControl","animationClassName","useRef","animationItem","setAnimationItem","useState","isAnimationVisible","setIsAnimationVisible","_isIE11","useMemo","wrapperClassName","classnames","style","lottieContainer","lottieAnimationClassName","ie11BackupImageClassName","backupImage","useEffect","keys","omit","ANIMATION_CONTROL","stop","lottie","unfetch","destroy","name","maxWidth","maxHeight","opacity","transition","propTypes"],"sources":["../../../src/atom/lottie-wrapper/index.js"],"sourcesContent":["import React, {useMemo, useRef, useEffect, useState} from 'react';\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 keys from 'lodash/fp/keys';\nimport omit from 'lodash/fp/omit';\nimport unfetch from 'isomorphic-unfetch';\nimport style from './style.css';\nimport propTypes, {ANIMATION_CONTROL} from './prop-types';\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 _lottie,\n _fetch,\n animationSrc,\n containerRef,\n loop,\n animationClassnames,\n hideOnTransparent,\n autoplay\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 =\n _lottie.loadAnimation &&\n _lottie.loadAnimation({\n container: containerRef.current, // the dom element that will contain the animation\n renderer: 'svg',\n autoplay,\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 autoplay = true,\n animationControl\n } = props;\n\n const {className: animationClassName, hideOnTransparent = true} = rendererSettings;\n\n const containerRef = useRef(null);\n\n // lottie's animation instance\n const [animationItem, setAnimationItem] = useState(null);\n\n const [isAnimationVisible, setIsAnimationVisible] = useState(autoplay);\n\n const _isIE11 = useMemo(() => isIE11(), []);\n\n const wrapperClassName = useMemo(() => classnames(className, style.lottieContainer), [className]);\n\n const lottieAnimationClassName = useMemo(\n () => classnames(animationClassName, style.animation),\n [animationClassName]\n );\n\n const ie11BackupImageClassName = useMemo(\n () => classnames(backupImageClassName, style.backupImage),\n [backupImageClassName]\n );\n\n useEffect(() => {\n // enzyme does not handle well the state update after an async useEffect in tests\n // to remove when the migration towards @testing-library/react is done\n /* istanbul ignore next */\n if (includes(animationControl, keys(omit('loading', ANIMATION_CONTROL))) && !autoplay) {\n setIsAnimationVisible(true);\n if (animationItem) animationItem[animationControl]();\n if (animationControl === ANIMATION_CONTROL.stop) setIsAnimationVisible(false);\n }\n }, [animationControl, animationItem, autoplay]);\n\n useEffect(() => {\n const loadAnimation = async () => {\n if (!_isIE11 && !animationItem) {\n /* istanbul ignore else */\n if (typeof window !== 'undefined') {\n window.lottie = lottie;\n }\n const animation = await fetchAndLoadAnimation(\n lottie,\n unfetch,\n animationSrc,\n containerRef,\n loop,\n lottieAnimationClassName,\n hideOnTransparent,\n autoplay\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 autoplay\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 opacity: isAnimationVisible ? 1 : 0,\n transition: 'opacity 0.25s ease-in'\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 = propTypes;\n\nexport default LottieWrapper;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,MAAM,GAAG,MAAM;EACnB,IAAI,OAAOC,MAAP,KAAkB,WAAtB,EAAmC;EACnC,MAAMC,SAAS,GAAG,I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AAO,IADN;MAEZ8B,SAAS,EAAG,GAAE9B,MAAO;IAFT,CALX;MASH+B,OAAO,EAAEtB,kBAAkB,GAAG,CAAH,GAAO,CAT/B;MAUHuB,UAAU,EAAE;IAVT;EALP,GAkBGrB,OAAO,gBACN;IACE,GAAG,EAAEV,eADP;IAEE,SAAS,EAAEiB,wBAFb;IAGE,aAAU;EAHZ,EADM,GAMJ,IAxBN,CADF;AA4BD,CAlHD;;AAoHAvB,aAAa,CAACsC,SAAd,2CAA0BA,kBAA1B;eAEetC,a"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["isIE11","window","userAgent","get","hasMsCrypto","has","hasRevision","includes","hasTrident","fetchAndLoadAnimation","_lottie","_fetch","animationSrc","containerRef","loop","animationClassnames","hideOnTransparent","autoplay","animationUrl","URL","toString","fetchResult","headers","animationData","json","animation","loadAnimation","container","current","renderer","rendererSettings","className","preserveAspectRatio","LottieWrapper","props","dataName","ariaLabel","width","height","ie11ImageBackup","backupImageClassName","animationControl","animationClassName","useRef","animationItem","setAnimationItem","useState","isAnimationVisible","setIsAnimationVisible","_isIE11","useMemo","wrapperClassName","classnames","style","lottieContainer","lottieAnimationClassName","ie11BackupImageClassName","backupImage","useEffect","keys","omit","ANIMATION_CONTROL","stop","lottie","unfetch","destroy","name","accessibilityProps","role","maxWidth","maxHeight","opacity","transition","propTypes"],"sources":["../../../src/atom/lottie-wrapper/index.js"],"sourcesContent":["import React, {useMemo, useRef, useEffect, useState} from 'react';\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 keys from 'lodash/fp/keys';\nimport omit from 'lodash/fp/omit';\nimport unfetch from 'isomorphic-unfetch';\nimport style from './style.css';\nimport propTypes, {ANIMATION_CONTROL} from './prop-types';\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 _lottie,\n _fetch,\n animationSrc,\n containerRef,\n loop,\n animationClassnames,\n hideOnTransparent,\n autoplay\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 =\n _lottie.loadAnimation &&\n _lottie.loadAnimation({\n container: containerRef.current, // the dom element that will contain the animation\n renderer: 'svg',\n autoplay,\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 autoplay = true,\n animationControl\n } = props;\n\n const {className: animationClassName, hideOnTransparent = true} = rendererSettings;\n\n const containerRef = useRef(null);\n\n // lottie's animation instance\n const [animationItem, setAnimationItem] = useState(null);\n\n const [isAnimationVisible, setIsAnimationVisible] = useState(autoplay);\n\n const _isIE11 = useMemo(() => isIE11(), []);\n\n const wrapperClassName = useMemo(() => classnames(className, style.lottieContainer), [className]);\n\n const lottieAnimationClassName = useMemo(\n () => classnames(animationClassName, style.animation),\n [animationClassName]\n );\n\n const ie11BackupImageClassName = useMemo(\n () => classnames(backupImageClassName, style.backupImage),\n [backupImageClassName]\n );\n\n useEffect(() => {\n // enzyme does not handle well the state update after an async useEffect in tests\n // to remove when the migration towards @testing-library/react is done\n /* istanbul ignore next */\n if (includes(animationControl, keys(omit('loading', ANIMATION_CONTROL))) && !autoplay) {\n setIsAnimationVisible(true);\n if (animationItem) animationItem[animationControl]();\n if (animationControl === ANIMATION_CONTROL.stop) setIsAnimationVisible(false);\n }\n }, [animationControl, animationItem, autoplay]);\n\n useEffect(() => {\n const loadAnimation = async () => {\n if (!_isIE11 && !animationItem) {\n /* istanbul ignore else */\n if (typeof window !== 'undefined') {\n window.lottie = lottie;\n }\n const animation = await fetchAndLoadAnimation(\n lottie,\n unfetch,\n animationSrc,\n containerRef,\n loop,\n lottieAnimationClassName,\n hideOnTransparent,\n autoplay\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 autoplay\n ]);\n\n const accessibilityProps = ariaLabel\n ? {\n 'aria-label': ariaLabel,\n role: 'img'\n }\n : {\n 'aria-hidden': 'true',\n role: 'presentation'\n };\n\n return (\n <div\n {...accessibilityProps}\n ref={containerRef}\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 opacity: isAnimationVisible ? 1 : 0,\n transition: 'opacity 0.25s ease-in'\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 = propTypes;\n\nexport default LottieWrapper;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,MAAM,GAAG,MAAM;EACnB,IAAI,OAAOC,MAAP,KAAkB,WAAtB,EAAmC;EACnC,MAAMC,SAAS,GAAG,IAAAC,YAAA,EAAI,qBAAJ,EAA2BF,MAA3B,CAAlB;EACA,MAAMG,WAAW,GAAG,IAAAC,YAAA,EAAI,UAAJ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V,EAKCC,MAAM,IAAI;MACZA,MAAM,EAAG,GAAEA,MAAO,IADN;MAEZgC,SAAS,EAAG,GAAEhC,MAAO;IAFT,CALX;MASHiC,OAAO,EAAExB,kBAAkB,GAAG,CAAH,GAAO,CAT/B;MAUHyB,UAAU,EAAE;IAVT;EALP,IAkBGvB,OAAO,gBACN;IACE,GAAG,EAAEV,eADP;IAEE,SAAS,EAAEiB,wBAFb;IAGE,aAAU;EAHZ,EADM,GAMJ,IAxBN,CADF;AA4BD,CA5HD;;AA8HAvB,aAAa,CAACwC,SAAd,2CAA0BA,kBAA1B;eAEexC,a"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
2
|
export declare type LottieAnimationProps = {
|
|
3
|
-
'aria-label'
|
|
3
|
+
'aria-label'?: string;
|
|
4
4
|
'data-name'?: string;
|
|
5
5
|
animationSrc: string;
|
|
6
6
|
loop?: boolean;
|
|
@@ -23,7 +23,7 @@ export declare const ANIMATION_CONTROL: {
|
|
|
23
23
|
loading: string;
|
|
24
24
|
};
|
|
25
25
|
declare const propTypes: {
|
|
26
|
-
'aria-label': PropTypes.
|
|
26
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
27
27
|
'data-name': PropTypes.Requireable<string>;
|
|
28
28
|
animationSrc: PropTypes.Validator<string>;
|
|
29
29
|
loop: PropTypes.Requireable<boolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prop-types.d.ts","sourceRoot":"","sources":["../../../src/atom/lottie-wrapper/prop-types.ts"],"names":[],"mappings":"AACA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,oBAAY,oBAAoB,GAAG;IACjC,YAAY,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"prop-types.d.ts","sourceRoot":"","sources":["../../../src/atom/lottie-wrapper/prop-types.ts"],"names":[],"mappings":"AACA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,oBAAY,oBAAoB,GAAG;IACjC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,gBAAgB,CAAC,EAAE;QACjB,iBAAiB,CAAC,EAAE,OAAO,CAAC;QAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;CAC1D,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;;;CAK7B,CAAC;AAEF,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;CAgBd,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -17,7 +17,7 @@ const ANIMATION_CONTROL = {
|
|
|
17
17
|
};
|
|
18
18
|
exports.ANIMATION_CONTROL = ANIMATION_CONTROL;
|
|
19
19
|
const propTypes = {
|
|
20
|
-
'aria-label': _propTypes.default.string
|
|
20
|
+
'aria-label': _propTypes.default.string,
|
|
21
21
|
'data-name': _propTypes.default.string,
|
|
22
22
|
animationSrc: _propTypes.default.string.isRequired,
|
|
23
23
|
loop: _propTypes.default.bool,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prop-types.js","names":["ANIMATION_CONTROL","play","pause","stop","loading","propTypes","PropTypes","string","
|
|
1
|
+
{"version":3,"file":"prop-types.js","names":["ANIMATION_CONTROL","play","pause","stop","loading","propTypes","PropTypes","string","animationSrc","isRequired","loop","bool","rendererSettings","shape","hideOnTransparent","className","height","number","width","ie11ImageBackup","backupImageClassName","autoplay","animationControl","oneOf","keys"],"sources":["../../../src/atom/lottie-wrapper/prop-types.ts"],"sourcesContent":["import keys from 'lodash/fp/keys';\nimport PropTypes from 'prop-types';\n\nexport type LottieAnimationProps = {\n 'aria-label'?: string;\n 'data-name'?: string;\n animationSrc: string;\n loop?: boolean;\n rendererSettings?: {\n hideOnTransparent?: boolean;\n className?: string;\n };\n height?: number;\n width?: number;\n className?: string;\n ie11ImageBackup: string;\n backupImageClassName?: string;\n autoplay?: boolean;\n animationControl?: 'play' | 'pause' | 'stop' | 'loading';\n};\n\nexport const ANIMATION_CONTROL = {\n play: 'play',\n pause: 'pause',\n stop: 'stop',\n loading: 'loading'\n};\n\nconst propTypes = {\n 'aria-label': PropTypes.string,\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 autoplay: PropTypes.bool,\n animationControl: PropTypes.oneOf(keys(ANIMATION_CONTROL))\n};\n\nexport default propTypes;\n"],"mappings":";;;;;AAAA;;AACA;;;;AAoBO,MAAMA,iBAAiB,GAAG;EAC/BC,IAAI,EAAE,MADyB;EAE/BC,KAAK,EAAE,OAFwB;EAG/BC,IAAI,EAAE,MAHyB;EAI/BC,OAAO,EAAE;AAJsB,CAA1B;;AAOP,MAAMC,SAAS,GAAG;EAChB,cAAcC,kBAAA,CAAUC,MADR;EAEhB,aAAaD,kBAAA,CAAUC,MAFP;EAGhBC,YAAY,EAAEF,kBAAA,CAAUC,MAAV,CAAiBE,UAHf;EAIhBC,IAAI,EAAEJ,kBAAA,CAAUK,IAJA;EAKhBC,gBAAgB,EAAEN,kBAAA,CAAUO,KAAV,CAAgB;IAChCC,iBAAiB,EAAER,kBAAA,CAAUK,IADG;IAEhCI,SAAS,EAAET,kBAAA,CAAUC;EAFW,CAAhB,CALF;EAShBS,MAAM,EAAEV,kBAAA,CAAUW,MATF;EAUhBC,KAAK,EAAEZ,kBAAA,CAAUW,MAVD;EAWhBF,SAAS,EAAET,kBAAA,CAAUC,MAXL;EAYhBY,eAAe,EAAEb,kBAAA,CAAUC,MAAV,CAAiBE,UAZlB;EAahBW,oBAAoB,EAAEd,kBAAA,CAAUC,MAbhB;EAchBc,QAAQ,EAAEf,kBAAA,CAAUK,IAdJ;EAehBW,gBAAgB,EAAEhB,kBAAA,CAAUiB,KAAV,CAAgB,IAAAC,aAAA,EAAKxB,iBAAL,CAAhB;AAfF,CAAlB;eAkBeK,S"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/review-presentation/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/review-presentation/index.js"],"names":[],"mappings":";AAuGA,6DA+BC"}
|