@coorpacademy/components 11.2.10 → 11.2.11
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 +9 -5
- package/es/atom/review-presentation/index.js.map +1 -1
- package/es/atom/review-presentation/prop-types.d.ts +8 -0
- package/es/atom/review-presentation/prop-types.d.ts.map +1 -1
- package/es/atom/review-presentation/prop-types.js +2 -1
- package/es/atom/review-presentation/prop-types.js.map +1 -1
- 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 +4 -47
- package/es/template/app-review/index.d.ts.map +1 -1
- package/es/template/app-review/index.js +0 -10
- package/es/template/app-review/index.js.map +1 -1
- package/es/template/app-review/index.native.d.ts.map +1 -1
- package/es/template/app-review/index.native.js +0 -8
- package/es/template/app-review/index.native.js.map +1 -1
- package/es/template/app-review/player/prop-types.d.ts +3 -3
- package/es/template/app-review/prop-types.d.ts +4 -51
- package/es/template/app-review/prop-types.d.ts.map +1 -1
- package/es/template/app-review/prop-types.js +1 -5
- package/es/template/app-review/prop-types.js.map +1 -1
- package/es/template/review-dashboard-skills/index.d.ts +4 -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 +9 -5
- package/lib/atom/review-presentation/index.js.map +1 -1
- package/lib/atom/review-presentation/prop-types.d.ts +8 -0
- package/lib/atom/review-presentation/prop-types.d.ts.map +1 -1
- package/lib/atom/review-presentation/prop-types.js +2 -1
- package/lib/atom/review-presentation/prop-types.js.map +1 -1
- 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 +4 -47
- package/lib/template/app-review/index.d.ts.map +1 -1
- package/lib/template/app-review/index.js +0 -12
- package/lib/template/app-review/index.js.map +1 -1
- package/lib/template/app-review/index.native.d.ts.map +1 -1
- package/lib/template/app-review/index.native.js +0 -9
- package/lib/template/app-review/index.native.js.map +1 -1
- package/lib/template/app-review/player/prop-types.d.ts +3 -3
- package/lib/template/app-review/prop-types.d.ts +4 -51
- package/lib/template/app-review/prop-types.d.ts.map +1 -1
- package/lib/template/app-review/prop-types.js +1 -7
- package/lib/template/app-review/prop-types.js.map +1 -1
- package/lib/template/review-dashboard-skills/index.d.ts +4 -0
- package/package.json +2 -2
|
@@ -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,MAAuB,YAAvB;AACA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAA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,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,KAAK,GAAG;EACZC,OAAO,EAAExB,SADG;EAEZyB,MAAM,EAAE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3
3
|
declare const AppReview: {
|
|
4
|
-
({ viewName,
|
|
4
|
+
({ viewName, slides }: AppReviewProps): JSX.Element;
|
|
5
5
|
propTypes: {
|
|
6
6
|
viewName: import("prop-types").Requireable<string>;
|
|
7
|
-
onboarding: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
8
|
-
'aria-label': import("prop-types").Requireable<string>;
|
|
9
|
-
reviewTitle: import("prop-types").Requireable<string>;
|
|
10
|
-
reviewText: import("prop-types").Requireable<string>;
|
|
11
|
-
labelsList: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
12
|
-
skills: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
13
|
-
text: import("prop-types").Requireable<string>;
|
|
14
|
-
tooltipText: import("prop-types").Requireable<string>;
|
|
15
|
-
}>>;
|
|
16
|
-
questions: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
17
|
-
text: import("prop-types").Requireable<string>;
|
|
18
|
-
tooltipText: import("prop-types").Requireable<string>;
|
|
19
|
-
}>>;
|
|
20
|
-
lifes: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
21
|
-
text: import("prop-types").Requireable<string>;
|
|
22
|
-
tooltipText: import("prop-types").Requireable<string>;
|
|
23
|
-
}>>;
|
|
24
|
-
allright: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
25
|
-
text: import("prop-types").Requireable<string>;
|
|
26
|
-
tooltipText: import("prop-types").Requireable<string>;
|
|
27
|
-
}>>;
|
|
28
|
-
}>>;
|
|
29
|
-
}>>;
|
|
30
|
-
skills: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
31
|
-
'aria-label': import("prop-types").Requireable<string>;
|
|
32
|
-
title: import("prop-types").Requireable<string>;
|
|
33
|
-
isLoading: import("prop-types").Requireable<boolean>;
|
|
34
|
-
isLoadingAriaLabel: import("prop-types").Requireable<string>;
|
|
35
|
-
listSkills: import("prop-types").Requireable<(import("prop-types").InferProps<{
|
|
36
|
-
'aria-label': import("prop-types").Requireable<string>;
|
|
37
|
-
skillTitle: import("prop-types").Requireable<string>;
|
|
38
|
-
skillAriaLabel: import("prop-types").Requireable<string>;
|
|
39
|
-
buttonLabel: import("prop-types").Requireable<string>;
|
|
40
|
-
buttonAriaLabel: import("prop-types").Requireable<string>;
|
|
41
|
-
reviseLabel: import("prop-types").Requireable<string>;
|
|
42
|
-
reviseAriaLabel: import("prop-types").Requireable<string>;
|
|
43
|
-
isCustom: import("prop-types").Requireable<boolean>;
|
|
44
|
-
onClick: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
45
|
-
}> | null | undefined)[]>;
|
|
46
|
-
titleNoSkills: import("prop-types").Requireable<string>;
|
|
47
|
-
textNoSkills: import("prop-types").Requireable<string>;
|
|
48
|
-
iconSkillAriaLabel: import("prop-types").Requireable<string>;
|
|
49
|
-
}>>;
|
|
50
7
|
slides: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
51
8
|
header: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
52
9
|
steps: import("prop-types").Requireable<(import("prop-types").InferProps<{
|
|
@@ -467,7 +424,7 @@ declare const AppReview: {
|
|
|
467
424
|
'aria-label': import("prop-types").Requireable<string>;
|
|
468
425
|
'data-name': import("prop-types").Requireable<string>;
|
|
469
426
|
animationLottie: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
470
|
-
'aria-label': import("prop-types").
|
|
427
|
+
'aria-label': import("prop-types").Requireable<string>;
|
|
471
428
|
'data-name': import("prop-types").Requireable<string>;
|
|
472
429
|
animationSrc: import("prop-types").Validator<string>;
|
|
473
430
|
loop: import("prop-types").Requireable<boolean>;
|
|
@@ -488,7 +445,7 @@ declare const AppReview: {
|
|
|
488
445
|
'aria-label': import("prop-types").Requireable<string>;
|
|
489
446
|
'data-name': import("prop-types").Requireable<string>;
|
|
490
447
|
animationLottie: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
491
|
-
'aria-label': import("prop-types").
|
|
448
|
+
'aria-label': import("prop-types").Requireable<string>;
|
|
492
449
|
'data-name': import("prop-types").Requireable<string>;
|
|
493
450
|
animationSrc: import("prop-types").Validator<string>;
|
|
494
451
|
loop: import("prop-types").Requireable<boolean>;
|
|
@@ -516,7 +473,7 @@ declare const AppReview: {
|
|
|
516
473
|
'aria-label': import("prop-types").Requireable<string>;
|
|
517
474
|
'data-name': import("prop-types").Requireable<string>;
|
|
518
475
|
animationLottie: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
519
|
-
'aria-label': import("prop-types").
|
|
476
|
+
'aria-label': import("prop-types").Requireable<string>;
|
|
520
477
|
'data-name': import("prop-types").Requireable<string>;
|
|
521
478
|
animationSrc: import("prop-types").Validator<string>;
|
|
522
479
|
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":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/app-review/index.tsx"],"names":[],"mappings":";AAGA,OAAkB,EAAC,cAAc,EAAC,MAAM,cAAc,CAAC;AAEvD,QAAA,MAAM,SAAS;2BAAwB,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOpD,CAAC;AAIF,eAAe,SAAS,CAAC"}
|
|
@@ -1,23 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import Loader from '../../atom/loader';
|
|
3
|
-
import Onboarding from './onboarding';
|
|
4
|
-
import Skills from './skills';
|
|
5
3
|
import Player from './player';
|
|
6
4
|
import propTypes from './prop-types';
|
|
7
5
|
|
|
8
6
|
const AppReview = ({
|
|
9
7
|
viewName,
|
|
10
|
-
onboarding,
|
|
11
|
-
skills,
|
|
12
8
|
slides
|
|
13
9
|
}) => {
|
|
14
10
|
switch (viewName) {
|
|
15
|
-
case 'skills':
|
|
16
|
-
return /*#__PURE__*/React.createElement(Skills, skills);
|
|
17
|
-
|
|
18
|
-
case 'onboarding':
|
|
19
|
-
return /*#__PURE__*/React.createElement(Onboarding, onboarding);
|
|
20
|
-
|
|
21
11
|
case 'slides':
|
|
22
12
|
return /*#__PURE__*/React.createElement(Player, slides);
|
|
23
13
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","Loader","
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","Loader","Player","propTypes","AppReview","viewName","slides"],"sources":["../../../src/template/app-review/index.tsx"],"sourcesContent":["import React from 'react';\nimport Loader from '../../atom/loader';\nimport Player from './player';\nimport propTypes, {AppReviewProps} from './prop-types';\n\nconst AppReview = ({viewName, slides}: AppReviewProps) => {\n switch (viewName) {\n case 'slides':\n return <Player {...slides} />;\n default:\n return <Loader />;\n }\n};\n\nAppReview.propTypes = propTypes;\n\nexport default AppReview;\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,MAAP,MAAmB,UAAnB;AACA,OAAOC,SAAP,MAAwC,cAAxC;;AAEA,MAAMC,SAAS,GAAG,CAAC;EAACC,QAAD;EAAWC;AAAX,CAAD,KAAwC;EACxD,QAAQD,QAAR;IACE,KAAK,QAAL;MACE,oBAAO,oBAAC,MAAD,EAAYC,MAAZ,CAAP;;IACF;MACE,oBAAO,oBAAC,MAAD,OAAP;EAJJ;AAMD,CAPD;;AASAF,SAAS,CAACD,SAAV,2CAAsBA,SAAtB;AAEA,eAAeC,SAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/template/app-review/index.native.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAC,cAAc,EAAC,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/template/app-review/index.native.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAC,cAAc,EAAC,MAAM,cAAc,CAAC;AAsB5C,QAAA,MAAM,SAAS,UAAW,cAAc,gBAsBvC,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React, { useEffect } from 'react';
|
|
2
2
|
import { Text, StyleSheet, View, BackHandler } from 'react-native';
|
|
3
3
|
import Player from './player';
|
|
4
|
-
import Skills from './skills';
|
|
5
4
|
const styles = StyleSheet.create({
|
|
6
5
|
rootView: {
|
|
7
6
|
flex: 1,
|
|
@@ -12,16 +11,9 @@ const styles = StyleSheet.create({
|
|
|
12
11
|
|
|
13
12
|
const Switch = ({
|
|
14
13
|
viewName,
|
|
15
|
-
skills,
|
|
16
14
|
slides
|
|
17
15
|
}) => {
|
|
18
16
|
switch (viewName) {
|
|
19
|
-
case 'onboarding':
|
|
20
|
-
return /*#__PURE__*/React.createElement(Text, null, "@todo view onboarding");
|
|
21
|
-
|
|
22
|
-
case 'skills':
|
|
23
|
-
return /*#__PURE__*/React.createElement(Skills, skills);
|
|
24
|
-
|
|
25
17
|
case 'slides':
|
|
26
18
|
return /*#__PURE__*/React.createElement(Player, slides);
|
|
27
19
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["React","useEffect","Text","StyleSheet","View","BackHandler","Player","
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["React","useEffect","Text","StyleSheet","View","BackHandler","Player","styles","create","rootView","flex","alignItems","justifyContent","Switch","viewName","slides","AppReview","props","navigateBack","backAction","backHandler","addEventListener","remove"],"sources":["../../../src/template/app-review/index.native.tsx"],"sourcesContent":["import React, {useEffect} from 'react';\nimport {Text, StyleSheet, View, BackHandler} from 'react-native';\nimport {AppReviewProps} from './prop-types';\nimport Player from './player';\n\nconst styles = StyleSheet.create({\n rootView: {\n flex: 1,\n alignItems: 'center',\n justifyContent: 'center'\n }\n});\n\nconst Switch = ({viewName, slides}: AppReviewProps) => {\n switch (viewName) {\n case 'slides':\n return <Player {...slides} />;\n case 'loader':\n return <Text>@todo loader</Text>;\n default:\n return <Text>unknown viewname: {viewName}</Text>;\n }\n};\n\nconst AppReview = (props: AppReviewProps) => {\n const {navigateBack} = props;\n\n useEffect(() => {\n const backAction = () => {\n if (navigateBack) {\n navigateBack();\n return true;\n }\n };\n\n // https://reactnative.dev/docs/backhandler\n const backHandler = BackHandler.addEventListener('hardwareBackPress', backAction);\n\n return () => backHandler.remove();\n }, [navigateBack]);\n\n return (\n <View style={styles.rootView}>\n <Switch {...props} />\n </View>\n );\n};\n\nexport default AppReview;\n"],"mappings":"AAAA,OAAOA,KAAP,IAAeC,SAAf,QAA+B,OAA/B;AACA,SAAQC,IAAR,EAAcC,UAAd,EAA0BC,IAA1B,EAAgCC,WAAhC,QAAkD,cAAlD;AAEA,OAAOC,MAAP,MAAmB,UAAnB;AAEA,MAAMC,MAAM,GAAGJ,UAAU,CAACK,MAAX,CAAkB;EAC/BC,QAAQ,EAAE;IACRC,IAAI,EAAE,CADE;IAERC,UAAU,EAAE,QAFJ;IAGRC,cAAc,EAAE;EAHR;AADqB,CAAlB,CAAf;;AAQA,MAAMC,MAAM,GAAG,CAAC;EAACC,QAAD;EAAWC;AAAX,CAAD,KAAwC;EACrD,QAAQD,QAAR;IACE,KAAK,QAAL;MACE,oBAAO,oBAAC,MAAD,EAAYC,MAAZ,CAAP;;IACF,KAAK,QAAL;MACE,oBAAO,oBAAC,IAAD,uBAAP;;IACF;MACE,oBAAO,oBAAC,IAAD,8BAAyBD,QAAzB,CAAP;EANJ;AAQD,CATD;;AAWA,MAAME,SAAS,GAAIC,KAAD,IAA2B;EAC3C,MAAM;IAACC;EAAD,IAAiBD,KAAvB;EAEAhB,SAAS,CAAC,MAAM;IACd,MAAMkB,UAAU,GAAG,MAAM;MACvB,IAAID,YAAJ,EAAkB;QAChBA,YAAY;QACZ,OAAO,IAAP;MACD;IACF,CALD,CADc,CAQd;;;IACA,MAAME,WAAW,GAAGf,WAAW,CAACgB,gBAAZ,CAA6B,mBAA7B,EAAkDF,UAAlD,CAApB;IAEA,OAAO,MAAMC,WAAW,CAACE,MAAZ,EAAb;EACD,CAZQ,EAYN,CAACJ,YAAD,CAZM,CAAT;EAcA,oBACE,oBAAC,IAAD;IAAM,KAAK,EAAEX,MAAM,CAACE;EAApB,gBACE,oBAAC,MAAD,EAAYQ,KAAZ,CADF,CADF;AAKD,CAtBD;;AAwBA,eAAeD,SAAf"}
|
|
@@ -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>;
|
|
@@ -1,60 +1,13 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
|
-
import Onboarding from './onboarding';
|
|
3
|
-
import { ReviewSkillsProps } from './skills/prop-types';
|
|
4
2
|
import { ReviewPlayerProps } from './player/prop-types';
|
|
5
|
-
export declare type ViewName = '
|
|
3
|
+
export declare type ViewName = 'slides' | 'loader';
|
|
6
4
|
export declare type AppReviewProps = {
|
|
7
5
|
viewName: ViewName;
|
|
8
6
|
slides?: ReviewPlayerProps;
|
|
9
|
-
skills?: ReviewSkillsProps;
|
|
10
|
-
onboarding?: PropTypes.InferProps<typeof Onboarding.propTypes>;
|
|
11
7
|
navigateBack?: () => void;
|
|
12
8
|
};
|
|
13
9
|
declare const propTypes: {
|
|
14
10
|
viewName: PropTypes.Requireable<string>;
|
|
15
|
-
onboarding: PropTypes.Requireable<PropTypes.InferProps<{
|
|
16
|
-
'aria-label': PropTypes.Requireable<string>;
|
|
17
|
-
reviewTitle: PropTypes.Requireable<string>;
|
|
18
|
-
reviewText: PropTypes.Requireable<string>;
|
|
19
|
-
labelsList: PropTypes.Requireable<PropTypes.InferProps<{
|
|
20
|
-
skills: PropTypes.Requireable<PropTypes.InferProps<{
|
|
21
|
-
text: PropTypes.Requireable<string>;
|
|
22
|
-
tooltipText: PropTypes.Requireable<string>;
|
|
23
|
-
}>>;
|
|
24
|
-
questions: PropTypes.Requireable<PropTypes.InferProps<{
|
|
25
|
-
text: PropTypes.Requireable<string>;
|
|
26
|
-
tooltipText: PropTypes.Requireable<string>;
|
|
27
|
-
}>>;
|
|
28
|
-
lifes: PropTypes.Requireable<PropTypes.InferProps<{
|
|
29
|
-
text: PropTypes.Requireable<string>;
|
|
30
|
-
tooltipText: PropTypes.Requireable<string>;
|
|
31
|
-
}>>;
|
|
32
|
-
allright: PropTypes.Requireable<PropTypes.InferProps<{
|
|
33
|
-
text: PropTypes.Requireable<string>;
|
|
34
|
-
tooltipText: PropTypes.Requireable<string>;
|
|
35
|
-
}>>;
|
|
36
|
-
}>>;
|
|
37
|
-
}>>;
|
|
38
|
-
skills: PropTypes.Requireable<PropTypes.InferProps<{
|
|
39
|
-
'aria-label': PropTypes.Requireable<string>;
|
|
40
|
-
title: PropTypes.Requireable<string>;
|
|
41
|
-
isLoading: PropTypes.Requireable<boolean>;
|
|
42
|
-
isLoadingAriaLabel: PropTypes.Requireable<string>;
|
|
43
|
-
listSkills: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
44
|
-
'aria-label': PropTypes.Requireable<string>;
|
|
45
|
-
skillTitle: PropTypes.Requireable<string>;
|
|
46
|
-
skillAriaLabel: PropTypes.Requireable<string>;
|
|
47
|
-
buttonLabel: PropTypes.Requireable<string>;
|
|
48
|
-
buttonAriaLabel: PropTypes.Requireable<string>;
|
|
49
|
-
reviseLabel: PropTypes.Requireable<string>;
|
|
50
|
-
reviseAriaLabel: PropTypes.Requireable<string>;
|
|
51
|
-
isCustom: PropTypes.Requireable<boolean>;
|
|
52
|
-
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
53
|
-
}> | null | undefined)[]>;
|
|
54
|
-
titleNoSkills: PropTypes.Requireable<string>;
|
|
55
|
-
textNoSkills: PropTypes.Requireable<string>;
|
|
56
|
-
iconSkillAriaLabel: PropTypes.Requireable<string>;
|
|
57
|
-
}>>;
|
|
58
11
|
slides: PropTypes.Requireable<PropTypes.InferProps<{
|
|
59
12
|
header: PropTypes.Requireable<PropTypes.InferProps<{
|
|
60
13
|
steps: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
@@ -475,7 +428,7 @@ declare const propTypes: {
|
|
|
475
428
|
'aria-label': PropTypes.Requireable<string>;
|
|
476
429
|
'data-name': PropTypes.Requireable<string>;
|
|
477
430
|
animationLottie: PropTypes.Requireable<PropTypes.InferProps<{
|
|
478
|
-
'aria-label': PropTypes.
|
|
431
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
479
432
|
'data-name': PropTypes.Requireable<string>;
|
|
480
433
|
animationSrc: PropTypes.Validator<string>;
|
|
481
434
|
loop: PropTypes.Requireable<boolean>;
|
|
@@ -496,7 +449,7 @@ declare const propTypes: {
|
|
|
496
449
|
'aria-label': PropTypes.Requireable<string>;
|
|
497
450
|
'data-name': PropTypes.Requireable<string>;
|
|
498
451
|
animationLottie: PropTypes.Requireable<PropTypes.InferProps<{
|
|
499
|
-
'aria-label': PropTypes.
|
|
452
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
500
453
|
'data-name': PropTypes.Requireable<string>;
|
|
501
454
|
animationSrc: PropTypes.Validator<string>;
|
|
502
455
|
loop: PropTypes.Requireable<boolean>;
|
|
@@ -524,7 +477,7 @@ declare const propTypes: {
|
|
|
524
477
|
'aria-label': PropTypes.Requireable<string>;
|
|
525
478
|
'data-name': PropTypes.Requireable<string>;
|
|
526
479
|
animationLottie: PropTypes.Requireable<PropTypes.InferProps<{
|
|
527
|
-
'aria-label': PropTypes.
|
|
480
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
528
481
|
'data-name': PropTypes.Requireable<string>;
|
|
529
482
|
animationSrc: PropTypes.Validator<string>;
|
|
530
483
|
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;
|
|
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;AAEnC,OAAO,EAAC,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AAEtD,oBAAY,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE3C,oBAAY,cAAc,GAAG;IAC3B,QAAQ,EAAE,QAAQ,CAAC;IACnB,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;CAC3B,CAAC;AAEF,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGd,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
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); }
|
|
2
2
|
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
|
-
import Onboarding from './onboarding';
|
|
5
|
-
import Skills from './skills';
|
|
6
4
|
import Player from './player';
|
|
7
5
|
const propTypes = {
|
|
8
|
-
viewName: PropTypes.oneOf(['
|
|
9
|
-
onboarding: PropTypes.shape(_extends({}, Onboarding.propTypes)),
|
|
10
|
-
skills: PropTypes.shape(_extends({}, Skills.propTypes)),
|
|
6
|
+
viewName: PropTypes.oneOf(['slides', 'loader']),
|
|
11
7
|
slides: PropTypes.shape(_extends({}, Player.propTypes))
|
|
12
8
|
};
|
|
13
9
|
export default propTypes;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prop-types.js","names":["PropTypes","
|
|
1
|
+
{"version":3,"file":"prop-types.js","names":["PropTypes","Player","propTypes","viewName","oneOf","slides","shape"],"sources":["../../../src/template/app-review/prop-types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\nimport Player from './player';\nimport {ReviewPlayerProps} from './player/prop-types';\n\nexport type ViewName = 'slides' | 'loader';\n\nexport type AppReviewProps = {\n viewName: ViewName;\n slides?: ReviewPlayerProps;\n navigateBack?: () => void;\n};\n\nconst propTypes = {\n viewName: PropTypes.oneOf(['slides', 'loader']),\n slides: PropTypes.shape({...Player.propTypes})\n};\n\nexport default propTypes;\n"],"mappings":";;AAAA,OAAOA,SAAP,MAAsB,YAAtB;AACA,OAAOC,MAAP,MAAmB,UAAnB;AAWA,MAAMC,SAAS,GAAG;EAChBC,QAAQ,EAAEH,SAAS,CAACI,KAAV,CAAgB,CAAC,QAAD,EAAW,QAAX,CAAhB,CADM;EAEhBC,MAAM,EAAEL,SAAS,CAACM,KAAV,cAAoBL,MAAM,CAACC,SAA3B;AAFQ,CAAlB;AAKA,eAAeA,SAAf"}
|
|
@@ -11,18 +11,22 @@ 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>;
|
|
14
15
|
}>>;
|
|
15
16
|
questions: PropTypes.Requireable<PropTypes.InferProps<{
|
|
16
17
|
text: PropTypes.Requireable<string>;
|
|
17
18
|
tooltipText: PropTypes.Requireable<string>;
|
|
19
|
+
moreDetailsAreaLabel: PropTypes.Requireable<string>;
|
|
18
20
|
}>>;
|
|
19
21
|
lifes: PropTypes.Requireable<PropTypes.InferProps<{
|
|
20
22
|
text: PropTypes.Requireable<string>;
|
|
21
23
|
tooltipText: PropTypes.Requireable<string>;
|
|
24
|
+
moreDetailsAreaLabel: PropTypes.Requireable<string>;
|
|
22
25
|
}>>;
|
|
23
26
|
allright: PropTypes.Requireable<PropTypes.InferProps<{
|
|
24
27
|
text: PropTypes.Requireable<string>;
|
|
25
28
|
tooltipText: PropTypes.Requireable<string>;
|
|
29
|
+
moreDetailsAreaLabel: PropTypes.Requireable<string>;
|
|
26
30
|
}>>;
|
|
27
31
|
}>>;
|
|
28
32
|
}>>;
|
|
@@ -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,IAAAC,YAAA,EAAI,qBAAJ,EAA2BF,MAA3B,CAAlB;EACA,MAAMG,WAAW,GAAG,IAAAC,YAAA,EAAI,UAAJ,EAAgBJ,MAAhB,CAApB;EACA,MAAMK,WAAW,GAAG,IAAAC,iBAAA,EAAS,KAAT,EAAgBL,SAAhB,CAApB;EACA,MAAMM,UAAU,GAAG,IAAAD,iBAAA,EAAS,UAAT,EAAqBL,SAArB,CAAnB;EAEA,OAAOE,WAAW,IAAKE,WAAW,IAAIE,UAAtC;AACD,CARD;;AAUO,MAAMC,qBAAqB,GAAG,OACnCC,OADmC,EAEnCC,MAFmC,EAGnCC,YAHmC,EAInCC,YAJmC,EAKnCC,IALmC,EAMnCC,mBANmC,EAOnCC,iBAPmC,EAQnCC,QARmC,KAShC;EACH,MAAMC,YAAY,GAAG,IAAIC,GAAJ,CAAQP,YAAR,EAAsBQ,QAAtB,EAArB;EACA,MAAMC,WAAW,GAAG,MAAMV,MAAM,CAACO,YAAD,EAAe;IAC7CI,OAAO,EAAE;MACP,oBAAoB,gBADb;MAEP,gBAAgB;IAFT;EADoC,CAAf,CAAhC;EAOA,MAAMC,aAAa,GAAG,MAAMF,WAAW,CAACG,IAAZ,EAA5B;;EAEA,MAAMC,SAAS,GACbf,OAAO,CAACgB,aAAR,IACAhB,OAAO,CAACgB,aAAR,CAAsB;IACpBC,SAAS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EACD,CAzBD,EAyBG,CACDX,wBADC,EAED1C,YAFC,EAGDG,iBAHC,EAIDF,IAJC,EAKDF,YALC,EAMDqC,OANC,EAODL,aAPC,EAQD3B,QARC,CAzBH;EAoCA,oBACE;IACE,GAAG,EAAEJ,YADP;IAEE,cAAYuB,SAFd;IAGE,aAAWD,QAHb;IAIE,SAAS,EAAEgB,gBAJb;IAKE,KAAK,eACCd,KAAK,IAAI;MACXA,KAAK,EAAG,GAAEA,KAAM,IADL;MAEX8B,QAAQ,EAAG,GAAE9B,KAAM;IAFR,CADV,EAKCC,MAAM,IAAI;MACZA,MAAM,EAAG,GAAEA,MAAO,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,EAAgBJ,MAAhB,CAApB;EACA,MAAMK,WAAW,GAAG,IAAAC,iBAAA,EAAS,KAAT,EAAgBL,SAAhB,CAApB;EACA,MAAMM,UAAU,GAAG,IAAAD,iBAAA,EAAS,UAAT,EAAqBL,SAArB,CAAnB;EAEA,OAAOE,WAAW,IAAKE,WAAW,IAAIE,UAAtC;AACD,CARD;;AAUO,MAAMC,qBAAqB,GAAG,OACnCC,OADmC,EAEnCC,MAFmC,EAGnCC,YAHmC,EAInCC,YAJmC,EAKnCC,IALmC,EAMnCC,mBANmC,EAOnCC,iBAPmC,EAQnCC,QARmC,KAShC;EACH,MAAMC,YAAY,GAAG,IAAIC,GAAJ,CAAQP,YAAR,EAAsBQ,QAAtB,EAArB;EACA,MAAMC,WAAW,GAAG,MAAMV,MAAM,CAACO,YAAD,EAAe;IAC7CI,OAAO,EAAE;MACP,oBAAoB,gBADb;MAEP,gBAAgB;IAFT;EADoC,CAAf,CAAhC;EAOA,MAAMC,aAAa,GAAG,MAAMF,WAAW,CAACG,IAAZ,EAA5B;;EAEA,MAAMC,SAAS,GACbf,OAAO,CAACgB,aAAR,IACAhB,OAAO,CAACgB,aAAR,CAAsB;IACpBC,SAAS,EAAEd,YAAY,CAACe,OADJ;IACa;IACjCC,QAAQ,EAAE,KAFU;IAGpBZ,QAHoB;IAIpBH,IAJoB;IAKpBS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EAODL,aAPC,EAQD3B,QARC,CAzBH;EAoCA,MAAMkD,kBAAkB,GAAG/B,SAAS,GAChC;IACE,cAAcA,SADhB;IAEEgC,IAAI,EAAE;EAFR,CADgC,GAKhC;IACE,eAAe,MADjB;IAEEA,IAAI,EAAE;EAFR,CALJ;EAUA,oBACE,iDACMD,kBADN;IAEE,GAAG,EAAEtD,YAFP;IAGE,aAAWsB,QAHb;IAIE,SAAS,EAAEgB,gBAJb;IAKE,KAAK,eACCd,KAAK,IAAI;MACXA,KAAK,EAAG,GAAEA,KAAM,IADL;MAEXgC,QAAQ,EAAG,GAAEhC,KAAM;IAFR,CADV,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>;
|