@coorpacademy/components 11.32.3 → 11.32.5
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/battle-opponent/index.d.ts.map +1 -1
- package/es/atom/battle-opponent/index.js +1 -1
- package/es/atom/battle-opponent/index.js.map +1 -1
- package/es/molecule/base-modal/index.d.ts +24 -1
- package/es/molecule/base-modal/index.d.ts.map +1 -1
- package/es/molecule/base-modal/index.js +26 -5
- package/es/molecule/base-modal/index.js.map +1 -1
- package/es/molecule/card/favorite.d.ts.map +1 -1
- package/es/molecule/card/favorite.js +1 -1
- package/es/molecule/card/favorite.js.map +1 -1
- package/es/molecule/discipline-associated-skills/index.d.ts +17 -0
- package/es/molecule/discipline-associated-skills/index.d.ts.map +1 -0
- package/es/molecule/discipline-associated-skills/index.js +73 -0
- package/es/molecule/discipline-associated-skills/index.js.map +1 -0
- package/es/molecule/discipline-associated-skills/style.css +71 -0
- package/es/molecule/learner-skill-card/index.d.ts +22 -0
- package/es/molecule/learner-skill-card/index.d.ts.map +1 -1
- package/es/molecule/learner-skill-card/index.js +7 -6
- package/es/molecule/learner-skill-card/index.js.map +1 -1
- package/es/molecule/learning-profile-radar-chart/index.d.ts +28 -1
- package/es/molecule/learning-profile-radar-chart/index.d.ts.map +1 -1
- package/es/molecule/learning-profile-radar-chart/index.js +115 -28
- package/es/molecule/learning-profile-radar-chart/index.js.map +1 -1
- package/es/molecule/learning-profile-radar-chart/style.css +14 -0
- package/es/molecule/learning-profile-radar-chart/types.d.ts +2 -0
- package/es/molecule/learning-profile-radar-chart/types.d.ts.map +1 -1
- package/es/molecule/learning-profile-radar-chart/types.js +2 -1
- package/es/molecule/learning-profile-radar-chart/types.js.map +1 -1
- package/es/molecule/review-correction-popin/index.d.ts.map +1 -1
- package/es/molecule/review-correction-popin/index.js +1 -1
- package/es/molecule/review-correction-popin/index.js.map +1 -1
- package/es/molecule/skill-picker-modal/index.d.ts.map +1 -1
- package/es/molecule/skill-picker-modal/index.js +2 -1
- package/es/molecule/skill-picker-modal/index.js.map +1 -1
- package/es/organism/user-preferences/index.d.ts.map +1 -1
- package/es/organism/user-preferences/index.js +1 -1
- package/es/organism/user-preferences/index.js.map +1 -1
- package/es/template/activity/engine-stars.d.ts.map +1 -1
- package/es/template/activity/engine-stars.js +1 -1
- package/es/template/activity/engine-stars.js.map +1 -1
- package/es/template/common/discipline/index.d.ts +6 -0
- package/es/template/common/discipline/index.d.ts.map +1 -1
- package/es/template/common/discipline/index.js +17 -2
- package/es/template/common/discipline/index.js.map +1 -1
- package/es/template/common/discipline/style.css +4 -1
- package/es/template/my-learning/index.d.ts +21 -0
- package/es/template/my-learning/index.d.ts.map +1 -1
- package/es/template/my-learning/index.js +41 -15
- package/es/template/my-learning/index.js.map +1 -1
- package/es/template/my-learning/style.css +6 -1
- package/lib/atom/battle-opponent/index.d.ts.map +1 -1
- package/lib/atom/battle-opponent/index.js +1 -1
- package/lib/atom/battle-opponent/index.js.map +1 -1
- package/lib/molecule/base-modal/index.d.ts +24 -1
- package/lib/molecule/base-modal/index.d.ts.map +1 -1
- package/lib/molecule/base-modal/index.js +26 -4
- package/lib/molecule/base-modal/index.js.map +1 -1
- package/lib/molecule/card/favorite.d.ts.map +1 -1
- package/lib/molecule/card/favorite.js +1 -1
- package/lib/molecule/card/favorite.js.map +1 -1
- package/lib/molecule/discipline-associated-skills/index.d.ts +17 -0
- package/lib/molecule/discipline-associated-skills/index.d.ts.map +1 -0
- package/lib/molecule/discipline-associated-skills/index.js +94 -0
- package/lib/molecule/discipline-associated-skills/index.js.map +1 -0
- package/lib/molecule/discipline-associated-skills/style.css +71 -0
- package/lib/molecule/learner-skill-card/index.d.ts +22 -0
- package/lib/molecule/learner-skill-card/index.d.ts.map +1 -1
- package/lib/molecule/learner-skill-card/index.js +7 -7
- package/lib/molecule/learner-skill-card/index.js.map +1 -1
- package/lib/molecule/learning-profile-radar-chart/index.d.ts +28 -1
- package/lib/molecule/learning-profile-radar-chart/index.d.ts.map +1 -1
- package/lib/molecule/learning-profile-radar-chart/index.js +117 -28
- package/lib/molecule/learning-profile-radar-chart/index.js.map +1 -1
- package/lib/molecule/learning-profile-radar-chart/style.css +14 -0
- package/lib/molecule/learning-profile-radar-chart/types.d.ts +2 -0
- package/lib/molecule/learning-profile-radar-chart/types.d.ts.map +1 -1
- package/lib/molecule/learning-profile-radar-chart/types.js +2 -1
- package/lib/molecule/learning-profile-radar-chart/types.js.map +1 -1
- package/lib/molecule/review-correction-popin/index.d.ts.map +1 -1
- package/lib/molecule/review-correction-popin/index.js +1 -1
- package/lib/molecule/review-correction-popin/index.js.map +1 -1
- package/lib/molecule/skill-picker-modal/index.d.ts.map +1 -1
- package/lib/molecule/skill-picker-modal/index.js +2 -1
- package/lib/molecule/skill-picker-modal/index.js.map +1 -1
- package/lib/organism/user-preferences/index.d.ts.map +1 -1
- package/lib/organism/user-preferences/index.js +1 -1
- package/lib/organism/user-preferences/index.js.map +1 -1
- package/lib/template/activity/engine-stars.d.ts.map +1 -1
- package/lib/template/activity/engine-stars.js +1 -1
- package/lib/template/activity/engine-stars.js.map +1 -1
- package/lib/template/common/discipline/index.d.ts +6 -0
- package/lib/template/common/discipline/index.d.ts.map +1 -1
- package/lib/template/common/discipline/index.js +18 -2
- package/lib/template/common/discipline/index.js.map +1 -1
- package/lib/template/common/discipline/style.css +4 -1
- package/lib/template/my-learning/index.d.ts +21 -0
- package/lib/template/my-learning/index.d.ts.map +1 -1
- package/lib/template/my-learning/index.js +39 -15
- package/lib/template/my-learning/index.js.map +1 -1
- package/lib/template/my-learning/style.css +6 -1
- package/locales/bs/global.json +3 -1
- package/locales/cs/global.json +4 -2
- package/locales/de/global.json +3 -1
- package/locales/en/global.json +3 -1
- package/locales/es/global.json +3 -1
- package/locales/et/global.json +3 -1
- package/locales/fi/global.json +3 -1
- package/locales/fr/global.json +3 -1
- package/locales/hr/global.json +3 -1
- package/locales/hu/global.json +3 -1
- package/locales/hy/global.json +3 -1
- package/locales/it/global.json +3 -1
- package/locales/ja/global.json +3 -1
- package/locales/ko/global.json +3 -1
- package/locales/nl/global.json +3 -1
- package/locales/pl/global.json +3 -1
- package/locales/pt/global.json +3 -1
- package/locales/ro/global.json +3 -1
- package/locales/ru/global.json +3 -1
- package/locales/sk/global.json +3 -1
- package/locales/sl/global.json +3 -1
- package/locales/sv/global.json +3 -1
- package/locales/th/global.json +1 -1
- package/locales/tl/global.json +4 -2
- package/locales/tr/global.json +3 -1
- package/locales/uk/global.json +3 -1
- package/locales/vi/global.json +4 -2
- package/locales/zh/global.json +3 -1
- package/locales/zh_TW/global.json +3 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["SkillPickerModal","props","context","skills","selectedSkills","skillsLocales","isOpen","isLoading","maxSelectedSkills","minSelectedSkills","onCancel","onConfirm","onClose","translate","selectedSkillList","setSelectedSkillList","useState","handleCancel","useCallback","handleClose","skillList","useMemo","map","skill","skillTitle","skillRef","focus","includes","isError","length","footer","footerDescription","skillNumber","text","cancelButton","label","disabled","confirmButton","iconName","name","backgroundColor","style","skillPickerContainer","loaderContainer","loader","marginBottom","display","gap","flexWrap","index","handleChipClick","newSelectedSkillList","filter","selectedSkill","contextTypes","Provider","childContextTypes","propTypes","PropTypes","arrayOf","string","objectOf","bool","number","func"],"sources":["../../../src/molecule/skill-picker-modal/index.js"],"sourcesContent":["import React, {useMemo, useState, useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport filter from 'lodash/fp/filter';\nimport BaseModal from '../base-modal';\nimport Chip from '../../atom/chip';\nimport Loader from '../../atom/loader';\nimport Provider from '../../atom/provider';\nimport style from './style.css';\n\nconst SkillPickerModal = (props, context) => {\n const {\n skills,\n selectedSkills,\n skillsLocales,\n isOpen,\n isLoading,\n maxSelectedSkills = 6,\n minSelectedSkills = 3,\n onCancel,\n onConfirm,\n onClose\n } = props;\n const {translate} = context;\n\n const [selectedSkillList, setSelectedSkillList] = useState(selectedSkills);\n\n const handleCancel = useCallback(() => {\n setSelectedSkillList(selectedSkills);\n onCancel();\n }, [setSelectedSkillList, selectedSkills, onCancel]);\n\n const handleClose = useCallback(() => {\n setSelectedSkillList(selectedSkills);\n onClose();\n }, [setSelectedSkillList, selectedSkills, onClose]);\n\n const skillList = useMemo(() => {\n return skills.map(skill => {\n return {\n skillTitle: skillsLocales[skill],\n skillRef: skill,\n focus: selectedSkillList.includes(skill)\n };\n });\n }, [skills, selectedSkillList, skillsLocales]);\n\n const isError = useMemo(\n () =>\n selectedSkillList.length > maxSelectedSkills || selectedSkillList.length < minSelectedSkills,\n [selectedSkillList, maxSelectedSkills]\n );\n\n const footer = useMemo(() => {\n const footerDescription =\n selectedSkillList.length > maxSelectedSkills\n ? translate('skill_focus_footer_error_description', {\n skillNumber: selectedSkillList.length - maxSelectedSkills\n })\n : translate('skill_focus_footer_description', {\n skillNumber: minSelectedSkills - selectedSkillList.length\n });\n return {\n text: isLoading || !isError ? '' : footerDescription,\n isError,\n cancelButton: {\n onCancel: handleCancel,\n label: translate('cancel'),\n disabled: isLoading || isError\n },\n confirmButton: {\n onConfirm: () => onConfirm(selectedSkillList),\n label: translate('confirm'),\n iconName: 'circle-check',\n disabled: isLoading || isError\n }\n };\n }, [\n isError,\n handleCancel,\n onConfirm,\n translate,\n selectedSkillList,\n isLoading,\n maxSelectedSkills,\n minSelectedSkills\n ]);\n\n if ((!isLoading && !skills) || !isOpen) return null;\n\n return (\n <BaseModal\n title={translate('skill_focus')}\n description={translate('skill_focus_description')}\n isOpen={isOpen}\n onClose={handleClose}\n footer={footer}\n headerIcon={{\n name: 'bullseye-arrow',\n backgroundColor: '#DDD1FF'\n }}\n >\n <div className={style.skillPickerContainer}>\n {isLoading ? (\n <div className={style.loaderContainer}>\n <Loader className={style.loader} theme=\"coorpmanager\" />\n </div>\n ) : (\n <>\n <div style={{marginBottom: '16px'}}>\n {`${selectedSkillList.length} ${translate('selected')}`}\n </div>\n <div style={{display: 'flex', gap: '16px', flexWrap: 'wrap'}}>\n {skillList.map((skill, index) => {\n const {skillTitle, skillRef, focus} = skill;\n function handleChipClick() {\n const newSelectedSkillList = focus\n ? filter(selectedSkill => selectedSkill !== skillRef, selectedSkillList)\n : [...selectedSkillList, skill.skillRef];\n setSelectedSkillList(newSelectedSkillList);\n }\n\n return (\n <Chip
|
|
1
|
+
{"version":3,"file":"index.js","names":["SkillPickerModal","props","context","skills","selectedSkills","skillsLocales","isOpen","isLoading","maxSelectedSkills","minSelectedSkills","onCancel","onConfirm","onClose","translate","selectedSkillList","setSelectedSkillList","useState","handleCancel","useCallback","handleClose","skillList","useMemo","map","skill","skillTitle","skillRef","focus","includes","isError","length","footer","footerDescription","skillNumber","text","cancelButton","label","disabled","confirmButton","iconName","name","backgroundColor","style","skillPickerContainer","loaderContainer","loader","marginBottom","display","gap","flexWrap","index","handleChipClick","newSelectedSkillList","filter","selectedSkill","contextTypes","Provider","childContextTypes","propTypes","PropTypes","arrayOf","string","objectOf","bool","number","func"],"sources":["../../../src/molecule/skill-picker-modal/index.js"],"sourcesContent":["import React, {useMemo, useState, useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport filter from 'lodash/fp/filter';\nimport BaseModal from '../base-modal';\nimport Chip from '../../atom/chip';\nimport Loader from '../../atom/loader';\nimport Provider from '../../atom/provider';\nimport style from './style.css';\n\nconst SkillPickerModal = (props, context) => {\n const {\n skills,\n selectedSkills,\n skillsLocales,\n isOpen,\n isLoading,\n maxSelectedSkills = 6,\n minSelectedSkills = 3,\n onCancel,\n onConfirm,\n onClose\n } = props;\n const {translate} = context;\n\n const [selectedSkillList, setSelectedSkillList] = useState(selectedSkills);\n\n const handleCancel = useCallback(() => {\n setSelectedSkillList(selectedSkills);\n onCancel();\n }, [setSelectedSkillList, selectedSkills, onCancel]);\n\n const handleClose = useCallback(() => {\n setSelectedSkillList(selectedSkills);\n onClose();\n }, [setSelectedSkillList, selectedSkills, onClose]);\n\n const skillList = useMemo(() => {\n return skills.map(skill => {\n return {\n skillTitle: skillsLocales[skill],\n skillRef: skill,\n focus: selectedSkillList.includes(skill)\n };\n });\n }, [skills, selectedSkillList, skillsLocales]);\n\n const isError = useMemo(\n () =>\n selectedSkillList.length > maxSelectedSkills || selectedSkillList.length < minSelectedSkills,\n [selectedSkillList, maxSelectedSkills]\n );\n\n const footer = useMemo(() => {\n const footerDescription =\n selectedSkillList.length > maxSelectedSkills\n ? translate('skill_focus_footer_error_description', {\n skillNumber: selectedSkillList.length - maxSelectedSkills\n })\n : translate('skill_focus_footer_description', {\n skillNumber: minSelectedSkills - selectedSkillList.length\n });\n return {\n text: isLoading || !isError ? '' : footerDescription,\n isError,\n cancelButton: {\n onCancel: handleCancel,\n label: translate('cancel'),\n disabled: isLoading || isError\n },\n confirmButton: {\n onConfirm: () => onConfirm(selectedSkillList),\n label: translate('confirm'),\n iconName: 'circle-check',\n disabled: isLoading || isError\n }\n };\n }, [\n isError,\n handleCancel,\n onConfirm,\n translate,\n selectedSkillList,\n isLoading,\n maxSelectedSkills,\n minSelectedSkills\n ]);\n\n if ((!isLoading && !skills) || !isOpen) return null;\n\n return (\n <BaseModal\n title={translate('skill_focus')}\n description={translate('skill_focus_description')}\n isOpen={isOpen}\n onClose={handleClose}\n footer={footer}\n headerIcon={{\n name: 'bullseye-arrow',\n backgroundColor: '#DDD1FF'\n }}\n >\n <div className={style.skillPickerContainer}>\n {isLoading ? (\n <div className={style.loaderContainer}>\n <Loader className={style.loader} theme=\"coorpmanager\" />\n </div>\n ) : (\n <>\n <div style={{marginBottom: '16px'}}>\n {`${selectedSkillList.length} ${translate('selected')}`}\n </div>\n <div style={{display: 'flex', gap: '16px', flexWrap: 'wrap'}}>\n {skillList.map((skill, index) => {\n const {skillTitle, skillRef, focus} = skill;\n function handleChipClick() {\n const newSelectedSkillList = focus\n ? filter(selectedSkill => selectedSkill !== skillRef, selectedSkillList)\n : [...selectedSkillList, skill.skillRef];\n setSelectedSkillList(newSelectedSkillList);\n }\n\n return (\n <Chip\n text={skillTitle}\n selected={focus}\n onClick={handleChipClick}\n key={index}\n backgroundColor=\"skin\"\n />\n );\n })}\n </div>\n </>\n )}\n </div>\n </BaseModal>\n );\n};\n\nSkillPickerModal.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nSkillPickerModal.propTypes = {\n skills: PropTypes.arrayOf(PropTypes.string),\n selectedSkills: PropTypes.arrayOf(PropTypes.string),\n skillsLocales: PropTypes.objectOf(PropTypes.string),\n isOpen: PropTypes.bool,\n isLoading: PropTypes.bool,\n minSelectedSkills: PropTypes.number,\n maxSelectedSkills: PropTypes.number,\n onCancel: PropTypes.func,\n onConfirm: PropTypes.func,\n onClose: PropTypes.func\n};\n\nexport default SkillPickerModal;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEA,MAAMA,gBAAgB,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EAC3C,MAAM;IACJC,MADI;IAEJC,cAFI;IAGJC,aAHI;IAIJC,MAJI;IAKJC,SALI;IAMJC,iBAAiB,GAAG,CANhB;IAOJC,iBAAiB,GAAG,CAPhB;IAQJC,QARI;IASJC,SATI;IAUJC;EAVI,IAWFX,KAXJ;EAYA,MAAM;IAACY;EAAD,IAAcX,OAApB;EAEA,MAAM,CAACY,iBAAD,EAAoBC,oBAApB,IAA4C,IAAAC,eAAA,EAASZ,cAAT,CAAlD;EAEA,MAAMa,YAAY,GAAG,IAAAC,kBAAA,EAAY,MAAM;IACrCH,oBAAoB,CAACX,cAAD,CAApB;IACAM,QAAQ;EACT,CAHoB,EAGlB,CAACK,oBAAD,EAAuBX,cAAvB,EAAuCM,QAAvC,CAHkB,CAArB;EAKA,MAAMS,WAAW,GAAG,IAAAD,kBAAA,EAAY,MAAM;IACpCH,oBAAoB,CAACX,cAAD,CAApB;IACAQ,OAAO;EACR,CAHmB,EAGjB,CAACG,oBAAD,EAAuBX,cAAvB,EAAuCQ,OAAvC,CAHi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|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/user-preferences/index.js"],"names":[],"mappings":";AA0CA,0DAeC"}
|
|
@@ -50,7 +50,7 @@ const Settings = (props, legacyContext) => {
|
|
|
50
50
|
tabIndex: 0
|
|
51
51
|
}, label), (0, _isEmpty.default)(description) ? null : /*#__PURE__*/_react.default.createElement(_tooltip.default, {
|
|
52
52
|
TooltipContent: description,
|
|
53
|
-
closeToolTipInformationTextAriaLabel: translate('
|
|
53
|
+
closeToolTipInformationTextAriaLabel: translate('close_tooltip_information'),
|
|
54
54
|
"data-testid": "user-preferences-tooltip",
|
|
55
55
|
"aria-label": moreInfoAriaLabel,
|
|
56
56
|
iconContainerClassName: _style.default.infoIconTooltip,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["Settings","props","legacyContext","translate","GetTranslateFromContext","label","description","moreInfoAriaLabel","settings","style","isEmpty","infoIconTooltip","propTypes","InputSwitch","PropTypes","string","isRequired","contextTypes","Provider","childContextTypes","UserPreferences","preferences","groupAriaLabel","map","arrayOf","shape"],"sources":["../../../src/organism/user-preferences/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport isEmpty from 'lodash/fp/isEmpty';\nimport map from 'lodash/fp/map';\nimport Provider, {GetTranslateFromContext} from '../../atom/provider';\nimport ToolTip from '../../atom/tooltip';\nimport InputSwitch from '../../atom/input-switch';\nimport style from './style.css';\n\nconst Settings = (props, legacyContext) => {\n const translate = GetTranslateFromContext(legacyContext);\n const {label, description, moreInfoAriaLabel, ...settings} = props;\n return (\n <div className={style.settings}>\n <InputSwitch {...{...settings, 'aria-label': label}} />\n <span className={style.label} tabIndex={0}>\n {label}\n </span>\n {isEmpty(description) ? null : (\n <ToolTip\n TooltipContent={description}\n closeToolTipInformationTextAriaLabel={translate(
|
|
1
|
+
{"version":3,"file":"index.js","names":["Settings","props","legacyContext","translate","GetTranslateFromContext","label","description","moreInfoAriaLabel","settings","style","isEmpty","infoIconTooltip","propTypes","InputSwitch","PropTypes","string","isRequired","contextTypes","Provider","childContextTypes","UserPreferences","preferences","groupAriaLabel","map","arrayOf","shape"],"sources":["../../../src/organism/user-preferences/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport isEmpty from 'lodash/fp/isEmpty';\nimport map from 'lodash/fp/map';\nimport Provider, {GetTranslateFromContext} from '../../atom/provider';\nimport ToolTip from '../../atom/tooltip';\nimport InputSwitch from '../../atom/input-switch';\nimport style from './style.css';\n\nconst Settings = (props, legacyContext) => {\n const translate = GetTranslateFromContext(legacyContext);\n const {label, description, moreInfoAriaLabel, ...settings} = props;\n return (\n <div className={style.settings}>\n <InputSwitch {...{...settings, 'aria-label': label}} />\n <span className={style.label} tabIndex={0}>\n {label}\n </span>\n {isEmpty(description) ? null : (\n <ToolTip\n TooltipContent={description}\n closeToolTipInformationTextAriaLabel={translate('close_tooltip_information')}\n data-testid=\"user-preferences-tooltip\"\n aria-label={moreInfoAriaLabel}\n iconContainerClassName={style.infoIconTooltip}\n fontSize={12}\n />\n )}\n </div>\n );\n};\n\nSettings.propTypes = {\n ...InputSwitch.propTypes,\n label: PropTypes.string.isRequired,\n description: PropTypes.string\n};\n\nSettings.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nconst UserPreferences = props => {\n const {preferences, moreInfoAriaLabel, groupAriaLabel} = props;\n\n return (\n <form>\n <div className={style.preferences} role=\"group\" aria-label={groupAriaLabel} tabIndex={0}>\n {map(\n settings => (\n <Settings {...settings} key={settings.label} moreInfoAriaLabel={moreInfoAriaLabel} />\n ),\n preferences\n )}\n </div>\n </form>\n );\n};\n\nUserPreferences.propTypes = {\n preferences: PropTypes.arrayOf(PropTypes.shape(Settings.propTypes)),\n moreInfoAriaLabel: PropTypes.string,\n groupAriaLabel: PropTypes.string\n};\n\nexport default UserPreferences;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;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C,YAAA,EACCf,QAAQ,iBACN,6BAAC,QAAD,eAAcA,QAAd;IAAwB,GAAG,EAAEA,QAAQ,CAACH,KAAtC;IAA6C,iBAAiB,EAAEE;EAAhE,GAFH,EAICc,WAJD,CADH,CADF,CADF;AAYD,CAfD;;AAiBAD,eAAe,CAACR,SAAhB,2CAA4B;EAC1BS,WAAW,EAAEP,kBAAA,CAAUU,OAAV,CAAkBV,kBAAA,CAAUW,KAAV,CAAgBzB,QAAQ,CAACY,SAAzB,CAAlB,CADa;EAE1BL,iBAAiB,EAAEO,kBAAA,CAAUC,MAFH;EAG1BO,cAAc,EAAER,kBAAA,CAAUC;AAHA,CAA5B;eAMeK,e"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine-stars.d.ts","sourceRoot":"","sources":["../../../src/template/activity/engine-stars.js"],"names":[],"mappings":";AAuEA,
|
|
1
|
+
{"version":3,"file":"engine-stars.d.ts","sourceRoot":"","sources":["../../../src/template/activity/engine-stars.js"],"names":[],"mappings":";AAuEA,0EA4IC"}
|
|
@@ -125,7 +125,7 @@ const EngineStars = (props, legacyContext) => {
|
|
|
125
125
|
onClick: toolTip.onClick
|
|
126
126
|
} : null, [primary, toolTip]);
|
|
127
127
|
const toolTipProps = {
|
|
128
|
-
closeToolTipInformationTextAriaLabel: translate('
|
|
128
|
+
closeToolTipInformationTextAriaLabel: translate('close_tooltip_information')
|
|
129
129
|
};
|
|
130
130
|
const TooltipContent = (0, _react.useCallback)(_props => /*#__PURE__*/_react.default.createElement(ToolTipContent, _extends({}, _extends({}, toolTipContentProps, _props), {
|
|
131
131
|
handleContentMouseOver: handleContentMouseOver
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine-stars.js","names":["ICONS","microlearning","TimerIcon","learner","LearnerIcon","battle","BoltIcon","certifications","CertificationIcon","bonus","BonusIcon","article","ArticleIcon","scorm","ScormIcon","video","VideoIcon","podcast","PodcastIcon","review","RevisionIcon","ToolTipContent","preMessage","linkMessage","endMessage","onClick","color","handleContentMouseOver","style","toolTipContent","propTypes","PropTypes","string","func","EngineStars","props","legacyContext","skin","GetSkinFromContext","translate","GetTranslateFromContext","toolTip","disabled","type","stars","title","active","className","handleClick","e","stopPropagation","preventDefault","dark","light","IconType","primary","engineStarsContentId","useState","uuidV5","URL","undefined","toolTipIsVisible","setToolTipIsVisible","mouseLeaveTimer","setMouseLeaveTimer","buttonRef","useRef","handleKeyPress","useCallback","event","toggleStateOnKeyPress","handleMouseOver","clearTimeout","handleMouseLeave","setTimeout","toolTipContentProps","useMemo","toolTipProps","closeToolTipInformationTextAriaLabel","TooltipContent","_props","classnames","engineStars","clickable","engineIcon","backgroundColor","iconHeader","score","iconStar","scoreTitle","isRequired","number","bool","shape","contextTypes","Provider","childContextTypes"],"sources":["../../../src/template/activity/engine-stars.js"],"sourcesContent":["import classnames from 'classnames';\nimport React, {useCallback, useMemo, useState, useRef} from 'react';\nimport PropTypes from 'prop-types';\nimport {get, noop} from 'lodash/fp';\nimport {v5 as uuidV5} from 'uuid';\nimport {\n NovaCompositionCoorpacademyStar as StarIcon,\n NovaCompositionCoorpacademyTimer as TimerIcon,\n NovaCompositionCoorpacademyBolt as BoltIcon,\n NovaSolidSchoolScienceGraduationHat as CertificationIcon,\n NovaSolidContentContentBook1 as LearnerIcon,\n NovaSolidVoteRewardsRewardsBadge1 as BonusIcon,\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, {GetSkinFromContext, GetTranslateFromContext} from '../../atom/provider';\nimport ToolTip, {toggleStateOnKeyPress} from '../../atom/tooltip';\nimport Link from '../../atom/link';\nimport style from './engine-stars.css';\n\nconst ICONS = {\n microlearning: TimerIcon,\n learner: LearnerIcon,\n battle: BoltIcon,\n certifications: CertificationIcon,\n bonus: BonusIcon,\n article: ArticleIcon,\n scorm: ScormIcon,\n video: VideoIcon,\n podcast: PodcastIcon,\n review: RevisionIcon\n};\n\nconst ToolTipContent = ({\n preMessage,\n linkMessage,\n endMessage,\n onClick,\n color,\n handleContentMouseOver\n}) => (\n <p\n className={style.toolTipContent}\n onMouseOver={handleContentMouseOver}\n data-testid=\"react-tooltip-content\"\n >\n <span>{preMessage}</span>\n <Link\n onClick={onClick}\n style={{\n color\n }}\n >\n {linkMessage}\n </Link>\n <span>{endMessage}</span>\n </p>\n);\n\nToolTipContent.propTypes = {\n preMessage: PropTypes.string,\n linkMessage: PropTypes.string,\n endMessage: PropTypes.string,\n color: PropTypes.string,\n onClick: PropTypes.func,\n handleContentMouseOver: PropTypes.func\n};\n\nconst EngineStars = (props, legacyContext) => {\n const skin = GetSkinFromContext(legacyContext);\n const translate = GetTranslateFromContext(legacyContext);\n const {\n toolTip = null,\n disabled,\n type,\n stars,\n title,\n active = false,\n onClick = noop,\n className\n } = props;\n\n const handleClick = e => {\n e.stopPropagation();\n e.preventDefault();\n onClick(e);\n };\n const dark = get('common.dark', skin);\n const light = get('common.light', skin);\n const IconType = ICONS[type];\n\n const primary = get('common.primary', skin);\n\n // to replace by useId when React17 is bumped to React18\n const [engineStarsContentId] = useState(\n disabled ? uuidV5('engine-stars', uuidV5.URL) : undefined\n );\n const [toolTipIsVisible, setToolTipIsVisible] = useState(false);\n const [mouseLeaveTimer, setMouseLeaveTimer] = useState(undefined);\n const buttonRef = useRef(null);\n\n const handleKeyPress = useCallback(\n event => {\n toggleStateOnKeyPress(toolTipIsVisible, setToolTipIsVisible, buttonRef)(event);\n },\n [toolTipIsVisible]\n );\n\n const handleMouseOver = useCallback(() => {\n mouseLeaveTimer && clearTimeout(mouseLeaveTimer);\n setToolTipIsVisible(true);\n }, [mouseLeaveTimer]);\n\n const handleContentMouseOver = useCallback(() => {\n mouseLeaveTimer && /* istanbul ignore next */ clearTimeout(mouseLeaveTimer);\n }, [mouseLeaveTimer]);\n\n const handleMouseLeave = useCallback(() => {\n setMouseLeaveTimer(setTimeout(() => setToolTipIsVisible(false), 500));\n }, []);\n\n const toolTipContentProps = useMemo(\n () =>\n toolTip\n ? {\n preMessage: toolTip.preMessage,\n linkMessage: toolTip.linkMessage,\n endMessage: toolTip.endMessage,\n color: primary,\n onClick: toolTip.onClick\n }\n : null,\n [primary, toolTip]\n );\n\n const toolTipProps = {\n closeToolTipInformationTextAriaLabel: translate(\n 'Press the escape key to close the information text'\n )\n };\n\n const TooltipContent = useCallback(\n _props => (\n <ToolTipContent\n {...{...toolTipContentProps, ..._props}}\n handleContentMouseOver={handleContentMouseOver}\n />\n ),\n [handleContentMouseOver, toolTipContentProps]\n );\n\n return (\n <button\n ref={buttonRef}\n data-tip={disabled}\n data-engine={type}\n data-testid={`engine-stars-${type}`}\n // eslint-disable-next-line no-nested-ternary\n onClick={disabled ? handleKeyPress : active ? noop : handleClick}\n data-for={engineStarsContentId}\n className={classnames([\n style.engineStars,\n disabled ? style.disabled : '',\n active ? style.active : '',\n onClick !== noop ? style.clickable : null,\n className\n ])}\n type=\"button\"\n data-tooltip-place=\"left\"\n onKeyDown={handleKeyPress}\n onMouseLeave={handleMouseLeave}\n onMouseOver={handleMouseOver}\n aria-label={`${title} - ${stars} ${translate('stars')}`}\n >\n {disabled ? (\n <ToolTip\n {...toolTipProps}\n anchorId={engineStarsContentId}\n toolTipIsVisible={toolTipIsVisible}\n TooltipContent={TooltipContent}\n mouseLeaveTimer={mouseLeaveTimer}\n />\n ) : null}\n <span\n className={style.engineIcon}\n style={{\n backgroundColor: onClick === noop ? light : primary\n }}\n >\n <IconType className={style.iconHeader} width=\"30\" />\n </span>\n <div\n className={style.score}\n style={{\n color: active ? primary : dark\n }}\n >\n <p data-name=\"star-counter\">{stars}</p>\n <span>\n <StarIcon\n className={style.iconStar}\n style={{\n color: active ? primary : dark\n }}\n />\n </span>\n </div>\n <div className={style.scoreTitle}>{title}</div>\n </button>\n );\n};\n\nEngineStars.propTypes = {\n type: PropTypes.string.isRequired,\n stars: PropTypes.number.isRequired,\n title: PropTypes.string.isRequired,\n active: PropTypes.bool,\n disabled: PropTypes.bool,\n onClick: PropTypes.func,\n className: PropTypes.string,\n toolTip: PropTypes.shape({\n preMessage: PropTypes.string,\n linkMessage: PropTypes.string,\n endMessage: PropTypes.string,\n onClick: PropTypes.func\n })\n};\n\nEngineStars.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nexport default EngineStars;\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;AACA;;AAaA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,KAAK,GAAG;EACZC,aAAa,EAAEC,2CADH;EAEZC,OAAO,EAAEC,uCAFG;EAGZC,MAAM,EAAEC,0CAHI;EAIZC,cAAc,EAAEC,8CAJJ;EAKZC,KAAK,EAAEC,4CALK;EAMZC,OAAO,EAAEC,6CANG;EAOZC,KAAK,EAAEC,2CAPK;EAQZC,KAAK,EAAEC,2CARK;EASZC,OAAO,EAAEC,gDATG;EAUZC,MAAM,EAAEC;AAVI,CAAd;;AAaA,MAAMC,cAAc,GAAG,CAAC;EACtBC,UADsB;EAEtBC,WAFsB;EAGtBC,UAHsB;EAItBC,OAJsB;EAKtBC,KALsB;EAMtBC;AANsB,CAAD,kBAQrB;EACE,SAAS,EAAEC,oBAAA,CAAMC,cADnB;EAEE,WAAW,EAAEF,sBAFf;EAGE,eAAY;AAHd,gBAKE,2CAAOL,UAAP,CALF,eAME,6BAAC,aAAD;EACE,OAAO,EAAEG,OADX;EAEE,KAAK,EAAE;IACLC;EADK;AAFT,GAMGH,WANH,CANF,eAcE,2CAAOC,UAAP,CAdF,CARF;;AA0BAH,cAAc,CAACS,SAAf,2CAA2B;EACzBR,UAAU,EAAES,kBAAA,CAAUC,MADG;EAEzBT,WAAW,EAAEQ,kBAAA,CAAUC,MAFE;EAGzBR,UAAU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}
|
|
1
|
+
{"version":3,"file":"engine-stars.js","names":["ICONS","microlearning","TimerIcon","learner","LearnerIcon","battle","BoltIcon","certifications","CertificationIcon","bonus","BonusIcon","article","ArticleIcon","scorm","ScormIcon","video","VideoIcon","podcast","PodcastIcon","review","RevisionIcon","ToolTipContent","preMessage","linkMessage","endMessage","onClick","color","handleContentMouseOver","style","toolTipContent","propTypes","PropTypes","string","func","EngineStars","props","legacyContext","skin","GetSkinFromContext","translate","GetTranslateFromContext","toolTip","disabled","type","stars","title","active","className","handleClick","e","stopPropagation","preventDefault","dark","light","IconType","primary","engineStarsContentId","useState","uuidV5","URL","undefined","toolTipIsVisible","setToolTipIsVisible","mouseLeaveTimer","setMouseLeaveTimer","buttonRef","useRef","handleKeyPress","useCallback","event","toggleStateOnKeyPress","handleMouseOver","clearTimeout","handleMouseLeave","setTimeout","toolTipContentProps","useMemo","toolTipProps","closeToolTipInformationTextAriaLabel","TooltipContent","_props","classnames","engineStars","clickable","engineIcon","backgroundColor","iconHeader","score","iconStar","scoreTitle","isRequired","number","bool","shape","contextTypes","Provider","childContextTypes"],"sources":["../../../src/template/activity/engine-stars.js"],"sourcesContent":["import classnames from 'classnames';\nimport React, {useCallback, useMemo, useState, useRef} from 'react';\nimport PropTypes from 'prop-types';\nimport {get, noop} from 'lodash/fp';\nimport {v5 as uuidV5} from 'uuid';\nimport {\n NovaCompositionCoorpacademyStar as StarIcon,\n NovaCompositionCoorpacademyTimer as TimerIcon,\n NovaCompositionCoorpacademyBolt as BoltIcon,\n NovaSolidSchoolScienceGraduationHat as CertificationIcon,\n NovaSolidContentContentBook1 as LearnerIcon,\n NovaSolidVoteRewardsRewardsBadge1 as BonusIcon,\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, {GetSkinFromContext, GetTranslateFromContext} from '../../atom/provider';\nimport ToolTip, {toggleStateOnKeyPress} from '../../atom/tooltip';\nimport Link from '../../atom/link';\nimport style from './engine-stars.css';\n\nconst ICONS = {\n microlearning: TimerIcon,\n learner: LearnerIcon,\n battle: BoltIcon,\n certifications: CertificationIcon,\n bonus: BonusIcon,\n article: ArticleIcon,\n scorm: ScormIcon,\n video: VideoIcon,\n podcast: PodcastIcon,\n review: RevisionIcon\n};\n\nconst ToolTipContent = ({\n preMessage,\n linkMessage,\n endMessage,\n onClick,\n color,\n handleContentMouseOver\n}) => (\n <p\n className={style.toolTipContent}\n onMouseOver={handleContentMouseOver}\n data-testid=\"react-tooltip-content\"\n >\n <span>{preMessage}</span>\n <Link\n onClick={onClick}\n style={{\n color\n }}\n >\n {linkMessage}\n </Link>\n <span>{endMessage}</span>\n </p>\n);\n\nToolTipContent.propTypes = {\n preMessage: PropTypes.string,\n linkMessage: PropTypes.string,\n endMessage: PropTypes.string,\n color: PropTypes.string,\n onClick: PropTypes.func,\n handleContentMouseOver: PropTypes.func\n};\n\nconst EngineStars = (props, legacyContext) => {\n const skin = GetSkinFromContext(legacyContext);\n const translate = GetTranslateFromContext(legacyContext);\n const {\n toolTip = null,\n disabled,\n type,\n stars,\n title,\n active = false,\n onClick = noop,\n className\n } = props;\n\n const handleClick = e => {\n e.stopPropagation();\n e.preventDefault();\n onClick(e);\n };\n const dark = get('common.dark', skin);\n const light = get('common.light', skin);\n const IconType = ICONS[type];\n\n const primary = get('common.primary', skin);\n\n // to replace by useId when React17 is bumped to React18\n const [engineStarsContentId] = useState(\n disabled ? uuidV5('engine-stars', uuidV5.URL) : undefined\n );\n const [toolTipIsVisible, setToolTipIsVisible] = useState(false);\n const [mouseLeaveTimer, setMouseLeaveTimer] = useState(undefined);\n const buttonRef = useRef(null);\n\n const handleKeyPress = useCallback(\n event => {\n toggleStateOnKeyPress(toolTipIsVisible, setToolTipIsVisible, buttonRef)(event);\n },\n [toolTipIsVisible]\n );\n\n const handleMouseOver = useCallback(() => {\n mouseLeaveTimer && clearTimeout(mouseLeaveTimer);\n setToolTipIsVisible(true);\n }, [mouseLeaveTimer]);\n\n const handleContentMouseOver = useCallback(() => {\n mouseLeaveTimer && /* istanbul ignore next */ clearTimeout(mouseLeaveTimer);\n }, [mouseLeaveTimer]);\n\n const handleMouseLeave = useCallback(() => {\n setMouseLeaveTimer(setTimeout(() => setToolTipIsVisible(false), 500));\n }, []);\n\n const toolTipContentProps = useMemo(\n () =>\n toolTip\n ? {\n preMessage: toolTip.preMessage,\n linkMessage: toolTip.linkMessage,\n endMessage: toolTip.endMessage,\n color: primary,\n onClick: toolTip.onClick\n }\n : null,\n [primary, toolTip]\n );\n\n const toolTipProps = {\n closeToolTipInformationTextAriaLabel: translate('close_tooltip_information')\n };\n\n const TooltipContent = useCallback(\n _props => (\n <ToolTipContent\n {...{...toolTipContentProps, ..._props}}\n handleContentMouseOver={handleContentMouseOver}\n />\n ),\n [handleContentMouseOver, toolTipContentProps]\n );\n\n return (\n <button\n ref={buttonRef}\n data-tip={disabled}\n data-engine={type}\n data-testid={`engine-stars-${type}`}\n // eslint-disable-next-line no-nested-ternary\n onClick={disabled ? handleKeyPress : active ? noop : handleClick}\n data-for={engineStarsContentId}\n className={classnames([\n style.engineStars,\n disabled ? style.disabled : '',\n active ? style.active : '',\n onClick !== noop ? style.clickable : null,\n className\n ])}\n type=\"button\"\n data-tooltip-place=\"left\"\n onKeyDown={handleKeyPress}\n onMouseLeave={handleMouseLeave}\n onMouseOver={handleMouseOver}\n aria-label={`${title} - ${stars} ${translate('stars')}`}\n >\n {disabled ? (\n <ToolTip\n {...toolTipProps}\n anchorId={engineStarsContentId}\n toolTipIsVisible={toolTipIsVisible}\n TooltipContent={TooltipContent}\n mouseLeaveTimer={mouseLeaveTimer}\n />\n ) : null}\n <span\n className={style.engineIcon}\n style={{\n backgroundColor: onClick === noop ? light : primary\n }}\n >\n <IconType className={style.iconHeader} width=\"30\" />\n </span>\n <div\n className={style.score}\n style={{\n color: active ? primary : dark\n }}\n >\n <p data-name=\"star-counter\">{stars}</p>\n <span>\n <StarIcon\n className={style.iconStar}\n style={{\n color: active ? primary : dark\n }}\n />\n </span>\n </div>\n <div className={style.scoreTitle}>{title}</div>\n </button>\n );\n};\n\nEngineStars.propTypes = {\n type: PropTypes.string.isRequired,\n stars: PropTypes.number.isRequired,\n title: PropTypes.string.isRequired,\n active: PropTypes.bool,\n disabled: PropTypes.bool,\n onClick: PropTypes.func,\n className: PropTypes.string,\n toolTip: PropTypes.shape({\n preMessage: PropTypes.string,\n linkMessage: PropTypes.string,\n endMessage: PropTypes.string,\n onClick: PropTypes.func\n })\n};\n\nEngineStars.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nexport default EngineStars;\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;AACA;;AAaA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,KAAK,GAAG;EACZC,aAAa,EAAEC,2CADH;EAEZC,OAAO,EAAEC,uCAFG;EAGZC,MAAM,EAAEC,0CAHI;EAIZC,cAAc,EAAEC,8CAJJ;EAKZC,KAAK,EAAEC,4CALK;EAMZC,OAAO,EAAEC,6CANG;EAOZC,KAAK,EAAEC,2CAPK;EAQZC,KAAK,EAAEC,2CARK;EASZC,OAAO,EAAEC,gDATG;EAUZC,MAAM,EAAEC;AAVI,CAAd;;AAaA,MAAMC,cAAc,GAAG,CAAC;EACtBC,UADsB;EAEtBC,WAFsB;EAGtBC,UAHsB;EAItBC,OAJsB;EAKtBC,KALsB;EAMtBC;AANsB,CAAD,kBAQrB;EACE,SAAS,EAAEC,oBAAA,CAAMC,cADnB;EAEE,WAAW,EAAEF,sBAFf;EAGE,eAAY;AAHd,gBAKE,2CAAOL,UAAP,CALF,eAME,6BAAC,aAAD;EACE,OAAO,EAAEG,OADX;EAEE,KAAK,EAAE;IACLC;EADK;AAFT,GA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xB;AAgBAC,WAAW,CAAC4D,YAAZ,GAA2B;EACzBzD,IAAI,EAAE0D,iBAAA,CAASC,iBAAT,CAA2B3D,IADR;EAEzBE,SAAS,EAAEwD,iBAAA,CAASC,iBAAT,CAA2BzD;AAFb,CAA3B;eAKeL,W"}
|
|
@@ -117,6 +117,12 @@ declare namespace Discipline {
|
|
|
117
117
|
const shareText: PropTypes.Requireable<string>;
|
|
118
118
|
const shareSuccessWording: PropTypes.Requireable<string>;
|
|
119
119
|
const shareErrorWording: PropTypes.Requireable<string>;
|
|
120
|
+
const skills: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
121
|
+
ref: PropTypes.Requireable<string>;
|
|
122
|
+
locale: PropTypes.Requireable<string>;
|
|
123
|
+
focused: PropTypes.Requireable<boolean>;
|
|
124
|
+
}> | null | undefined)[]>;
|
|
125
|
+
const onSkillClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
120
126
|
const addToMyListText: PropTypes.Requireable<string>;
|
|
121
127
|
const removeFromMyListText: PropTypes.Requireable<string>;
|
|
122
128
|
const addToMyListButton: PropTypes.Requireable<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/template/common/discipline/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/template/common/discipline/index.js"],"names":[],"mappings":";AAeA,mEAmKC"}
|
|
@@ -17,6 +17,8 @@ var _disciplinePartners = _interopRequireDefault(require("../../../molecule/disc
|
|
|
17
17
|
|
|
18
18
|
var _disciplineScope = _interopRequireDefault(require("../../../molecule/discipline-scope"));
|
|
19
19
|
|
|
20
|
+
var _disciplineAssociatedSkills = _interopRequireDefault(require("../../../molecule/discipline-associated-skills"));
|
|
21
|
+
|
|
20
22
|
var _share = _interopRequireWildcard(require("../../../molecule/share"));
|
|
21
23
|
|
|
22
24
|
var _addToMyList = _interopRequireWildcard(require("../../../molecule/add-to-my-list"));
|
|
@@ -43,6 +45,8 @@ const Discipline = (props, context) => {
|
|
|
43
45
|
start,
|
|
44
46
|
buy,
|
|
45
47
|
startLabel,
|
|
48
|
+
skills = [],
|
|
49
|
+
onSkillClick,
|
|
46
50
|
buyLabel,
|
|
47
51
|
shareWording,
|
|
48
52
|
shareText,
|
|
@@ -113,7 +117,10 @@ const Discipline = (props, context) => {
|
|
|
113
117
|
wording: shareWording,
|
|
114
118
|
text: shareText,
|
|
115
119
|
key: 'shareTablet'
|
|
116
|
-
})),
|
|
120
|
+
})), /*#__PURE__*/_react.default.createElement(_disciplineAssociatedSkills.default, {
|
|
121
|
+
skills: skills,
|
|
122
|
+
onSkillClick: onSkillClick
|
|
123
|
+
}), authorSection), disciplineContent), /*#__PURE__*/_react.default.createElement("div", {
|
|
117
124
|
className: _style.default.rightSection
|
|
118
125
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
119
126
|
className: _style.default.stickySection
|
|
@@ -132,7 +139,10 @@ const Discipline = (props, context) => {
|
|
|
132
139
|
favorite: favorite,
|
|
133
140
|
onFavoriteClick: onFavoriteClick,
|
|
134
141
|
key: 'addToMyListDesktop'
|
|
135
|
-
}))),
|
|
142
|
+
}))), /*#__PURE__*/_react.default.createElement(_disciplineAssociatedSkills.default, {
|
|
143
|
+
skills: skills,
|
|
144
|
+
onSkillClick: onSkillClick
|
|
145
|
+
}), authorSection)));
|
|
136
146
|
|
|
137
147
|
const shareFeedBack = disableShare ? null : /*#__PURE__*/_react.default.createElement(_share.ShareFeedback, {
|
|
138
148
|
errorWording: shareErrorWording,
|
|
@@ -167,6 +177,12 @@ Discipline.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
167
177
|
shareText: _share.default.propTypes.text,
|
|
168
178
|
shareSuccessWording: _share.ShareFeedback.propTypes.successWording,
|
|
169
179
|
shareErrorWording: _share.ShareFeedback.propTypes.errorWording,
|
|
180
|
+
skills: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
181
|
+
ref: _propTypes.default.string,
|
|
182
|
+
locale: _propTypes.default.string,
|
|
183
|
+
focused: _propTypes.default.bool
|
|
184
|
+
})),
|
|
185
|
+
onSkillClick: _propTypes.default.func,
|
|
170
186
|
addToMyListText: _addToMyList.AddToMyListFeedback.propTypes.addToMyListText,
|
|
171
187
|
removeFromMyListText: _addToMyList.AddToMyListFeedback.propTypes.removeFromMyListText,
|
|
172
188
|
addToMyListButton: _addToMyList.default.propTypes.addToMyListButton,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["Discipline","props","context","selected","level","levels","changeLevel","image","title","video","authors","description","start","buy","startLabel","buyLabel","shareWording","shareText","shareSuccessWording","shareErrorWording","addToMyListButton","favorite","onFavoriteClick","addToMyListText","removeFromMyListText","disableShare","disableAddToMyList","lastUpdated","authorSection","isEmpty","style","partners","disciplineCTA","disciplineContent","content","disciplineHeader","header","discipline","container","leftSection","mobileAuthorCtaSection","columnReverse","cta","addToMyListBtn","shareBtn","rightSection","stickySection","buttons","shareFeedBack","addToMyListFeedback","addToMyListProviderWrap","shareProviderWrap","propTypes","DisciplineHeader","DisciplineCTA","DisciplinePartners","DisciplineScope","onClick","Share","wording","text","ShareFeedback","successWording","errorWording","AddToMyListFeedback","AddToMyList","PropTypes","bool","contextTypes","translate","func"],"sources":["../../../../src/template/common/discipline/index.js"],"sourcesContent":["import React from 'react';\nimport isEmpty from 'lodash/fp/isEmpty';\nimport PropTypes from 'prop-types';\nimport DisciplineCTA from '../../../molecule/discipline-cta';\nimport DisciplineHeader from '../../../molecule/discipline-header';\nimport DisciplinePartners from '../../../molecule/discipline-partners';\nimport DisciplineScope from '../../../molecule/discipline-scope';\nimport Share, {ShareFeedback, ShareStatusProvider} from '../../../molecule/share';\nimport AddToMyList, {\n AddToMyListFeedback,\n AddToMyListStatusProvider\n} from '../../../molecule/add-to-my-list';\nimport style from './style.css';\n\nconst Discipline = (props, context) => {\n const {\n selected = 0,\n level,\n levels,\n changeLevel,\n image,\n title = '',\n video,\n authors = [],\n description = '',\n start,\n buy,\n startLabel,\n buyLabel,\n shareWording,\n shareText,\n shareSuccessWording,\n shareErrorWording,\n addToMyListButton,\n favorite,\n onFavoriteClick,\n addToMyListText,\n removeFromMyListText,\n disableShare = false,\n disableAddToMyList = false,\n lastUpdated\n } = props;\n\n const authorSection = isEmpty(authors) ? null : (\n <div className={style.partners}>\n <DisciplinePartners authors={authors} />\n </div>\n );\n\n const disciplineCTA = (\n <DisciplineCTA\n type={'discipline'}\n start={start}\n buy={buy}\n startLabel={startLabel}\n buyLabel={buyLabel}\n />\n );\n\n const disciplineContent = (\n <div className={style.content}>\n <DisciplineScope content={level} levels={levels} selected={selected} onClick={changeLevel} />\n </div>\n );\n\n const disciplineHeader = (\n <div className={style.header}>\n <DisciplineHeader\n image={image}\n video={video}\n title={title}\n description={description}\n lastUpdated={lastUpdated}\n />\n </div>\n );\n\n const discipline = (\n <div data-name=\"discipline\" className={style.container} key=\"discipline\">\n <div className={style.leftSection}>\n {disciplineHeader}\n <div className={style.mobileAuthorCtaSection}>\n <div className={style.columnReverse}>\n <div className={style.cta}>{disciplineCTA}</div>\n {disableAddToMyList ? null : (\n <AddToMyList\n style={style.addToMyListBtn}\n addToMyListButton={addToMyListButton}\n favorite={favorite}\n onFavoriteClick={onFavoriteClick}\n key={'addToMyListTablet'}\n />\n )}\n {disableShare ? null : (\n <Share\n style={style.shareBtn}\n wording={shareWording}\n text={shareText}\n key={'shareTablet'}\n />\n )}\n </div>\n {authorSection}\n </div>\n {disciplineContent}\n </div>\n <div className={style.rightSection}>\n <div className={style.stickySection}>\n <div className={style.cta}>\n {disciplineCTA}\n {disableShare && disableAddToMyList ? null : (\n <div className={style.buttons}>\n {disableShare ? null : (\n <Share\n style={style.shareBtn}\n wording={shareWording}\n text={shareText}\n key={'shareDesktop'}\n />\n )}\n {disableAddToMyList ? null : (\n <AddToMyList\n style={style.addToMyListBtn}\n addToMyListButton={addToMyListButton}\n favorite={favorite}\n onFavoriteClick={onFavoriteClick}\n key={'addToMyListDesktop'}\n />\n )}\n </div>\n )}\n </div>\n {authorSection}\n </div>\n </div>\n </div>\n );\n\n const shareFeedBack = disableShare ? null : (\n <ShareFeedback\n errorWording={shareErrorWording}\n successWording={shareSuccessWording}\n key=\"shareFeedBack\"\n />\n );\n\n const addToMyListFeedback = disableAddToMyList ? null : (\n <AddToMyListFeedback\n addToMyListText={addToMyListText}\n removeFromMyListText={removeFromMyListText}\n favorite={favorite}\n />\n );\n\n const addToMyListProviderWrap = disableAddToMyList ? (\n <>\n {shareFeedBack}\n {discipline}\n </>\n ) : (\n <AddToMyListStatusProvider>\n {shareFeedBack}\n {addToMyListFeedback}\n {discipline}\n </AddToMyListStatusProvider>\n );\n const shareProviderWrap = disableShare ? (\n addToMyListProviderWrap\n ) : (\n <ShareStatusProvider>{addToMyListProviderWrap}</ShareStatusProvider>\n );\n\n return shareProviderWrap;\n};\n\nDiscipline.propTypes = {\n image: DisciplineHeader.propTypes.image,\n video: DisciplineHeader.propTypes.video,\n title: DisciplineHeader.propTypes.title,\n description: DisciplineHeader.propTypes.description,\n start: DisciplineCTA.propTypes.start,\n buy: DisciplineCTA.propTypes.buy,\n startLabel: DisciplineCTA.propTypes.startLabel,\n buyLabel: DisciplineCTA.propTypes.buyLabel,\n authors: DisciplinePartners.propTypes.authors,\n level: DisciplineScope.propTypes.content,\n levels: DisciplineScope.propTypes.levels,\n selected: DisciplineScope.propTypes.selected,\n changeLevel: DisciplineScope.propTypes.onClick,\n shareWording: Share.propTypes.wording,\n shareText: Share.propTypes.text,\n shareSuccessWording: ShareFeedback.propTypes.successWording,\n shareErrorWording: ShareFeedback.propTypes.errorWording,\n addToMyListText: AddToMyListFeedback.propTypes.addToMyListText,\n removeFromMyListText: AddToMyListFeedback.propTypes.removeFromMyListText,\n addToMyListButton: AddToMyList.propTypes.addToMyListButton,\n onFavoriteClick: AddToMyList.propTypes.onFavoriteClick,\n favorite: AddToMyList.propTypes.favorite,\n disableShare: PropTypes.bool,\n disableAddToMyList: PropTypes.bool\n};\n\nDiscipline.contextTypes = {\n translate: PropTypes.func\n};\n\nexport default Discipline;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAIA;;;;;;;;AAEA,MAAMA,UAAU,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EACrC,MAAM;IACJC,QAAQ,GAAG,CADP;IAEJC,KAFI;IAGJC,MAHI;IAIJC,WAJI;IAKJC,KALI;IAMJC,KAAK,GAAG,EANJ;IAOJC,KAPI;IAQJC,OAAO,GAAG,EARN;IASJC,WAAW,GAAG,EATV;IAUJC,KAVI;IAWJC,GAXI;IAYJC,UAZI;IAaJC,QAbI;IAcJC,YAdI;IAeJC,SAfI;IAgBJC,mBAhBI;IAiBJC,iBAjBI;IAkBJC,iBAlBI;IAmBJC,QAnBI;IAoBJC,eApBI;IAqBJC,eArBI;IAsBJC,oBAtBI;IAuBJC,YAAY,GAAG,KAvBX;IAwBJC,kBAAkB,GAAG,KAxBjB;IAyBJC;EAzBI,IA0BF1B,KA1BJ;EA4BA,MAAM2B,aAAa,GAAG,IAAAC,gBAAA,EAAQnB,OAAR,IAAmB,IAAnB,gBACpB;IAAK,SAAS,EAAEoB,cAAA,CAAMC;EAAtB,gBACE,6BAAC,2BAAD;IAAoB,OAAO,EAAErB;EAA7B,EADF,CADF;;EAMA,MAAMsB,aAAa,gBACjB,6BAAC,sBAAD;IACE,IAAI,EAAE,YADR;IAEE,KAAK,EAAEpB,KAFT;IAGE,GAAG,EAAEC,GAHP;IAIE,UAAU,EAAEC,UAJd;IAKE,QAAQ,EAAEC;EALZ,EADF;;EAUA,MAAMkB,iBAAiB,gBACrB;IAAK,SAAS,EAAEH,cAAA,CAAMI;EAAtB,gBACE,6BAAC,wBAAD;IAAiB,OAAO,EAAE9B,KAA1B;IAAiC,MAAM,EAAEC,MAAzC;IAAiD,QAAQ,EAAEF,QAA3D;IAAqE,OAAO,EAA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C,kBAAA,CAAUC;AAxBT,CAAvB;AA2BAnE,UAAU,CAACoE,YAAX,GAA0B;EACxBC,SAAS,EAAEH,kBAAA,CAAUI;AADG,CAA1B;eAIetE,U"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["Discipline","props","context","selected","level","levels","changeLevel","image","title","video","authors","description","start","buy","startLabel","skills","onSkillClick","buyLabel","shareWording","shareText","shareSuccessWording","shareErrorWording","addToMyListButton","favorite","onFavoriteClick","addToMyListText","removeFromMyListText","disableShare","disableAddToMyList","lastUpdated","authorSection","isEmpty","style","partners","disciplineCTA","disciplineContent","content","disciplineHeader","header","discipline","container","leftSection","mobileAuthorCtaSection","columnReverse","cta","addToMyListBtn","shareBtn","rightSection","stickySection","buttons","shareFeedBack","addToMyListFeedback","addToMyListProviderWrap","shareProviderWrap","propTypes","DisciplineHeader","DisciplineCTA","DisciplinePartners","DisciplineScope","onClick","Share","wording","text","ShareFeedback","successWording","errorWording","PropTypes","arrayOf","shape","ref","string","locale","focused","bool","func","AddToMyListFeedback","AddToMyList","contextTypes","translate"],"sources":["../../../../src/template/common/discipline/index.js"],"sourcesContent":["import React from 'react';\nimport isEmpty from 'lodash/fp/isEmpty';\nimport PropTypes from 'prop-types';\nimport DisciplineCTA from '../../../molecule/discipline-cta';\nimport DisciplineHeader from '../../../molecule/discipline-header';\nimport DisciplinePartners from '../../../molecule/discipline-partners';\nimport DisciplineScope from '../../../molecule/discipline-scope';\nimport DisciplineAssociatedSkills from '../../../molecule/discipline-associated-skills';\nimport Share, {ShareFeedback, ShareStatusProvider} from '../../../molecule/share';\nimport AddToMyList, {\n AddToMyListFeedback,\n AddToMyListStatusProvider\n} from '../../../molecule/add-to-my-list';\nimport style from './style.css';\n\nconst Discipline = (props, context) => {\n const {\n selected = 0,\n level,\n levels,\n changeLevel,\n image,\n title = '',\n video,\n authors = [],\n description = '',\n start,\n buy,\n startLabel,\n skills = [],\n onSkillClick,\n buyLabel,\n shareWording,\n shareText,\n shareSuccessWording,\n shareErrorWording,\n addToMyListButton,\n favorite,\n onFavoriteClick,\n addToMyListText,\n removeFromMyListText,\n disableShare = false,\n disableAddToMyList = false,\n lastUpdated\n } = props;\n\n const authorSection = isEmpty(authors) ? null : (\n <div className={style.partners}>\n <DisciplinePartners authors={authors} />\n </div>\n );\n\n const disciplineCTA = (\n <DisciplineCTA\n type={'discipline'}\n start={start}\n buy={buy}\n startLabel={startLabel}\n buyLabel={buyLabel}\n />\n );\n\n const disciplineContent = (\n <div className={style.content}>\n <DisciplineScope content={level} levels={levels} selected={selected} onClick={changeLevel} />\n </div>\n );\n\n const disciplineHeader = (\n <div className={style.header}>\n <DisciplineHeader\n image={image}\n video={video}\n title={title}\n description={description}\n lastUpdated={lastUpdated}\n />\n </div>\n );\n\n const discipline = (\n <div data-name=\"discipline\" className={style.container} key=\"discipline\">\n <div className={style.leftSection}>\n {disciplineHeader}\n <div className={style.mobileAuthorCtaSection}>\n <div className={style.columnReverse}>\n <div className={style.cta}>{disciplineCTA}</div>\n {disableAddToMyList ? null : (\n <AddToMyList\n style={style.addToMyListBtn}\n addToMyListButton={addToMyListButton}\n favorite={favorite}\n onFavoriteClick={onFavoriteClick}\n key={'addToMyListTablet'}\n />\n )}\n {disableShare ? null : (\n <Share\n style={style.shareBtn}\n wording={shareWording}\n text={shareText}\n key={'shareTablet'}\n />\n )}\n </div>\n <DisciplineAssociatedSkills skills={skills} onSkillClick={onSkillClick} />\n {authorSection}\n </div>\n {disciplineContent}\n </div>\n <div className={style.rightSection}>\n <div className={style.stickySection}>\n <div className={style.cta}>\n {disciplineCTA}\n {disableShare && disableAddToMyList ? null : (\n <div className={style.buttons}>\n {disableShare ? null : (\n <Share\n style={style.shareBtn}\n wording={shareWording}\n text={shareText}\n key={'shareDesktop'}\n />\n )}\n {disableAddToMyList ? null : (\n <AddToMyList\n style={style.addToMyListBtn}\n addToMyListButton={addToMyListButton}\n favorite={favorite}\n onFavoriteClick={onFavoriteClick}\n key={'addToMyListDesktop'}\n />\n )}\n </div>\n )}\n </div>\n <DisciplineAssociatedSkills skills={skills} onSkillClick={onSkillClick} />\n {authorSection}\n </div>\n </div>\n </div>\n );\n\n const shareFeedBack = disableShare ? null : (\n <ShareFeedback\n errorWording={shareErrorWording}\n successWording={shareSuccessWording}\n key=\"shareFeedBack\"\n />\n );\n\n const addToMyListFeedback = disableAddToMyList ? null : (\n <AddToMyListFeedback\n addToMyListText={addToMyListText}\n removeFromMyListText={removeFromMyListText}\n favorite={favorite}\n />\n );\n\n const addToMyListProviderWrap = disableAddToMyList ? (\n <>\n {shareFeedBack}\n {discipline}\n </>\n ) : (\n <AddToMyListStatusProvider>\n {shareFeedBack}\n {addToMyListFeedback}\n {discipline}\n </AddToMyListStatusProvider>\n );\n const shareProviderWrap = disableShare ? (\n addToMyListProviderWrap\n ) : (\n <ShareStatusProvider>{addToMyListProviderWrap}</ShareStatusProvider>\n );\n\n return shareProviderWrap;\n};\n\nDiscipline.propTypes = {\n image: DisciplineHeader.propTypes.image,\n video: DisciplineHeader.propTypes.video,\n title: DisciplineHeader.propTypes.title,\n description: DisciplineHeader.propTypes.description,\n start: DisciplineCTA.propTypes.start,\n buy: DisciplineCTA.propTypes.buy,\n startLabel: DisciplineCTA.propTypes.startLabel,\n buyLabel: DisciplineCTA.propTypes.buyLabel,\n authors: DisciplinePartners.propTypes.authors,\n level: DisciplineScope.propTypes.content,\n levels: DisciplineScope.propTypes.levels,\n selected: DisciplineScope.propTypes.selected,\n changeLevel: DisciplineScope.propTypes.onClick,\n shareWording: Share.propTypes.wording,\n shareText: Share.propTypes.text,\n shareSuccessWording: ShareFeedback.propTypes.successWording,\n shareErrorWording: ShareFeedback.propTypes.errorWording,\n skills: PropTypes.arrayOf(\n PropTypes.shape({\n ref: PropTypes.string,\n locale: PropTypes.string,\n focused: PropTypes.bool\n })\n ),\n onSkillClick: PropTypes.func,\n addToMyListText: AddToMyListFeedback.propTypes.addToMyListText,\n removeFromMyListText: AddToMyListFeedback.propTypes.removeFromMyListText,\n addToMyListButton: AddToMyList.propTypes.addToMyListButton,\n onFavoriteClick: AddToMyList.propTypes.onFavoriteClick,\n favorite: AddToMyList.propTypes.favorite,\n disableShare: PropTypes.bool,\n disableAddToMyList: PropTypes.bool\n};\n\nDiscipline.contextTypes = {\n translate: PropTypes.func\n};\n\nexport default Discipline;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAIA;;;;;;;;AAEA,MAAMA,UAAU,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EACrC,MAAM;IACJC,QAAQ,GAAG,CADP;IAEJC,KAFI;IAGJC,MAHI;IAIJC,WAJI;IAKJC,KALI;IAMJC,KAAK,GAAG,EANJ;IAOJC,KAPI;IAQJC,OAAO,GAAG,EARN;IASJC,WAAW,GAAG,EATV;IAUJC,KAVI;IAWJC,GAXI;IAYJC,UAZI;IAaJC,MAAM,GAAG,EAbL;IAcJC,YAdI;IAeJC,QAfI;IAgBJC,YAhBI;IAiBJC,SAjBI;IAkBJC,mBAlBI;IAmBJC,iBAnBI;IAoBJC,iBApBI;IAqBJC,QArBI;IAsBJC,eAtBI;IAuBJC,eAvBI;IAwBJC,oBAxBI;IAyBJC,YAAY,GAAG,KAzBX;IA0BJC,kBAAkB,GAAG,KA1BjB;IA2BJC;EA3BI,IA4BF5B,KA5BJ;EA8BA,MAAM6B,aAAa,GAAG,IAAAC,gBAAA,EAAQrB,OAAR,IAAmB,IAAnB,gBACpB;IAAK,SAAS,EAAEsB,cAAA,CAAMC;EAAtB,gBACE,6BAAC,2BAAD;IAAoB,OAAO,EAAEvB;EAA7B,EADF,CADF;;EAMA,MAAMwB,aAAa,gBACjB,6BAAC,sBAAD;IACE,IAAI,EAAE,YADR;IAEE,KAAK,EAAEtB,KAFT;IAGE,GAAG,EAAEC,GAHP;IAIE,UAAU,EAAEC,UAJd;IAKE,QAAQ,EAAEG;EALZ,EADF;;EAUA,MAAMkB,iBAAiB,gBACrB;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AAgB;IACdC,GAAG,EAAEH,kBAAA,CAAUI,MADD;IAEdC,MAAM,EAAEL,kBAAA,CAAUI,MAFJ;IAGdE,OAAO,EAAEN,kBAAA,CAAUO;EAHL,CAAhB,CADM,CAlBa;EAyBrBzD,YAAY,EAAEkD,kBAAA,CAAUQ,IAzBH;EA0BrBjD,eAAe,EAAEkD,gCAAA,CAAoBrB,SAApB,CAA8B7B,eA1B1B;EA2BrBC,oBAAoB,EAAEiD,gCAAA,CAAoBrB,SAApB,CAA8B5B,oBA3B/B;EA4BrBJ,iBAAiB,EAAEsD,oBAAA,CAAYtB,SAAZ,CAAsBhC,iBA5BpB;EA6BrBE,eAAe,EAAEoD,oBAAA,CAAYtB,SAAZ,CAAsB9B,eA7BlB;EA8BrBD,QAAQ,EAAEqD,oBAAA,CAAYtB,SAAZ,CAAsB/B,QA9BX;EA+BrBI,YAAY,EAAEuC,kBAAA,CAAUO,IA/BH;EAgCrB7C,kBAAkB,EAAEsC,kBAAA,CAAUO;AAhCT,CAAvB;AAmCAzE,UAAU,CAAC6E,YAAX,GAA0B;EACxBC,SAAS,EAAEZ,kBAAA,CAAUQ;AADG,CAA1B;eAIe1E,U"}
|
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
|
|
15
15
|
.leftSection {
|
|
16
16
|
display: block;
|
|
17
|
-
overflow: hidden;
|
|
18
17
|
padding: 20px;
|
|
19
18
|
box-sizing: border-box;
|
|
20
19
|
position: relative;
|
|
@@ -109,6 +108,10 @@
|
|
|
109
108
|
margin-left: 0px;
|
|
110
109
|
}
|
|
111
110
|
|
|
111
|
+
.leftSection {
|
|
112
|
+
width: 100%
|
|
113
|
+
}
|
|
114
|
+
|
|
112
115
|
.mobileAuthorCtaSection {
|
|
113
116
|
composes: wrapper from '../layout.css';
|
|
114
117
|
position: inherit;
|
|
@@ -2,6 +2,27 @@ export default MyLearning;
|
|
|
2
2
|
declare function MyLearning(props: any, context: any): JSX.Element;
|
|
3
3
|
declare namespace MyLearning {
|
|
4
4
|
namespace contextTypes {
|
|
5
|
+
const skin: PropTypes.Requireable<PropTypes.InferProps<{
|
|
6
|
+
common: PropTypes.Requireable<{
|
|
7
|
+
[x: string]: any;
|
|
8
|
+
}>;
|
|
9
|
+
images: PropTypes.Requireable<PropTypes.InferProps<{
|
|
10
|
+
'logo-mobile': PropTypes.Requireable<any>;
|
|
11
|
+
logo: PropTypes.Requireable<any>;
|
|
12
|
+
'logo-email': PropTypes.Requireable<any>;
|
|
13
|
+
login: PropTypes.Requireable<any>;
|
|
14
|
+
}>>;
|
|
15
|
+
icons: PropTypes.Requireable<{
|
|
16
|
+
[x: string]: any;
|
|
17
|
+
}>;
|
|
18
|
+
mod: PropTypes.Requireable<{
|
|
19
|
+
[x: string]: any;
|
|
20
|
+
}>;
|
|
21
|
+
courses: PropTypes.Requireable<any[]>;
|
|
22
|
+
texts: PropTypes.Requireable<{
|
|
23
|
+
[x: string]: any;
|
|
24
|
+
}>;
|
|
25
|
+
}>>;
|
|
5
26
|
const translate: PropTypes.Requireable<(...args: any[]) => any>;
|
|
6
27
|
}
|
|
7
28
|
namespace propTypes {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/my-learning/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/my-learning/index.js"],"names":[],"mappings":";AAwHA,mEA2WC"}
|
|
@@ -13,7 +13,7 @@ var _map2 = _interopRequireDefault(require("lodash/fp/map"));
|
|
|
13
13
|
|
|
14
14
|
var _keys2 = _interopRequireDefault(require("lodash/fp/keys"));
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _get2 = _interopRequireDefault(require("lodash/fp/get"));
|
|
17
17
|
|
|
18
18
|
var _react = _interopRequireWildcard(require("react"));
|
|
19
19
|
|
|
@@ -62,7 +62,7 @@ const ChangeSkillFocusButton = (props, context) => {
|
|
|
62
62
|
skin,
|
|
63
63
|
translate
|
|
64
64
|
} = context;
|
|
65
|
-
const primarySkinColor = (0,
|
|
65
|
+
const primarySkinColor = (0, _get2.default)('common.primary', skin);
|
|
66
66
|
const handleMouseOver = (0, _react.useCallback)(() => setHovered(true), [setHovered]);
|
|
67
67
|
const handleMouseLeave = (0, _react.useCallback)(() => setHovered(false), [setHovered]);
|
|
68
68
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -91,6 +91,7 @@ const ChangeSkillFocusButton = (props, context) => {
|
|
|
91
91
|
};
|
|
92
92
|
|
|
93
93
|
ChangeSkillFocusButton.contextTypes = {
|
|
94
|
+
skin: _provider.default.childContextTypes.skin,
|
|
94
95
|
translate: _provider.default.childContextTypes.translate
|
|
95
96
|
};
|
|
96
97
|
ChangeSkillFocusButton.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
@@ -108,9 +109,13 @@ const FilterButton = (props, context) => {
|
|
|
108
109
|
skin,
|
|
109
110
|
translate
|
|
110
111
|
} = context;
|
|
111
|
-
const primarySkinColor = (0,
|
|
112
|
+
const primarySkinColor = (0, _get2.default)('common.primary', skin);
|
|
112
113
|
const Content = (0, _react.useCallback)(() => /*#__PURE__*/_react.default.createElement("div", null, filter, /*#__PURE__*/_react.default.createElement("span", {
|
|
113
|
-
className: active ? _style.default.skillFilterNumber : _style.default.skillFilterNumberInActive
|
|
114
|
+
className: active ? _style.default.skillFilterNumber : _style.default.skillFilterNumberInActive,
|
|
115
|
+
style: {
|
|
116
|
+
backgroundColor: active ? (0, _cssColorFunction.convert)(`color(${primarySkinColor} a(0.07))`) : '#EAEAEB',
|
|
117
|
+
color: active ? primarySkinColor : '#515161'
|
|
118
|
+
}
|
|
114
119
|
}, skillTotal)), [filter, skillTotal, active]);
|
|
115
120
|
const buttonProps = {
|
|
116
121
|
customStyle: {
|
|
@@ -127,6 +132,7 @@ const FilterButton = (props, context) => {
|
|
|
127
132
|
};
|
|
128
133
|
|
|
129
134
|
FilterButton.contextTypes = {
|
|
135
|
+
skin: _provider.default.childContextTypes.skin,
|
|
130
136
|
translate: _provider.default.childContextTypes.translate
|
|
131
137
|
};
|
|
132
138
|
FilterButton.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
@@ -149,14 +155,19 @@ const MyLearning = (props, context) => {
|
|
|
149
155
|
onExploreSkill
|
|
150
156
|
} = props;
|
|
151
157
|
const {
|
|
158
|
+
skin,
|
|
152
159
|
translate
|
|
153
160
|
} = context;
|
|
161
|
+
const primarySkinColor = (0, _get2.default)('common.primary', skin);
|
|
154
162
|
const [open, setOpen] = (0, _react.useState)(false);
|
|
155
163
|
const [selectedSkillsList, setSelectedSkillsList] = (0, _react.useState)(selectedSkills);
|
|
156
164
|
const [skillFocusSelectedOnChart, setSkillFocusSelectedOnChart] = (0, _react.useState)(undefined);
|
|
157
165
|
const [searchValue, setSearchValue] = (0, _react.useState)('');
|
|
158
|
-
const [searchResults, setSearchResults] = (0, _react.useState)(skills);
|
|
166
|
+
const [searchResults, setSearchResults] = (0, _react.useState)(skills.sort((a, b) => skillsInformation[b].stats.score - skillsInformation[a].stats.score));
|
|
159
167
|
const [activeFilter, setActiveFilter] = (0, _react.useState)('all');
|
|
168
|
+
const [hovered, setHovered] = (0, _react.useState)(false);
|
|
169
|
+
const handleMouseOver = (0, _react.useCallback)(() => setHovered(true), [setHovered]);
|
|
170
|
+
const handleMouseLeave = (0, _react.useCallback)(() => setHovered(false), [setHovered]);
|
|
160
171
|
const skillsReviewReady = (0, _react.useMemo)(() => {
|
|
161
172
|
return searchResults.filter(skill => skillsInformation[skill].availableForReview);
|
|
162
173
|
}, [searchResults, skillsInformation]);
|
|
@@ -201,7 +212,7 @@ const MyLearning = (props, context) => {
|
|
|
201
212
|
}
|
|
202
213
|
}];
|
|
203
214
|
const handleOnDotClick = (0, _react.useCallback)(skillRef => {
|
|
204
|
-
|
|
215
|
+
setSkillFocusSelectedOnChart(skillRef);
|
|
205
216
|
}, [setSkillFocusSelectedOnChart]);
|
|
206
217
|
const handleOpenSkillPicker = (0, _react.useCallback)(() => setOpen(true), [setOpen]);
|
|
207
218
|
const handleCloseSkillPicker = (0, _react.useCallback)(() => setOpen(false), [setOpen]);
|
|
@@ -270,14 +281,15 @@ const MyLearning = (props, context) => {
|
|
|
270
281
|
data: graphDatas,
|
|
271
282
|
legend: graphLegends,
|
|
272
283
|
onClick: handleOnDotClick,
|
|
284
|
+
onExploreClick: onExploreSkill,
|
|
273
285
|
colors: [{
|
|
274
286
|
gradient: {
|
|
275
287
|
fill: ['#0062ffff', '#8000ff85'],
|
|
276
288
|
stroke: ['#0062ffff', '#8000FF']
|
|
277
289
|
},
|
|
278
290
|
percentage: {
|
|
279
|
-
color:
|
|
280
|
-
background:
|
|
291
|
+
color: primarySkinColor,
|
|
292
|
+
background: (0, _cssColorFunction.convert)(`color(${primarySkinColor} a(0.07))`)
|
|
281
293
|
},
|
|
282
294
|
label: {
|
|
283
295
|
color: '#020202ff'
|
|
@@ -295,14 +307,18 @@ const MyLearning = (props, context) => {
|
|
|
295
307
|
className: _style.default.skillFocusEmptyTitle
|
|
296
308
|
}, translate('skills_focus_empty_title')), /*#__PURE__*/_react.default.createElement("div", {
|
|
297
309
|
className: _style.default.skillFocusEmptyDescription
|
|
298
|
-
}, translate('skills_focus_empty_description')), /*#__PURE__*/_react.default.createElement(
|
|
310
|
+
}, translate('skills_focus_empty_description')), /*#__PURE__*/_react.default.createElement("div", {
|
|
311
|
+
onMouseOver: handleMouseOver,
|
|
312
|
+
onMouseLeave: handleMouseLeave
|
|
313
|
+
}, /*#__PURE__*/_react.default.createElement(_buttonLink.default, {
|
|
299
314
|
label: translate('skills_choose_focus'),
|
|
300
315
|
type: "primary",
|
|
301
316
|
customStyle: {
|
|
302
|
-
width: '168px'
|
|
317
|
+
width: '168px',
|
|
318
|
+
backgroundColor: hovered ? (0, _cssColorFunction.convert)(`hsl(from ${primarySkinColor} h s calc(l*(1 - 0.08)))`) : primarySkinColor
|
|
303
319
|
},
|
|
304
320
|
onClick: handleOpenSkillPicker
|
|
305
|
-
}))) : null, /*#__PURE__*/_react.default.createElement("header", {
|
|
321
|
+
})))) : null, /*#__PURE__*/_react.default.createElement("header", {
|
|
306
322
|
className: _style.default.skillListHeader
|
|
307
323
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
308
324
|
className: _style.default.skillListHeaderIcon
|
|
@@ -324,7 +340,7 @@ const MyLearning = (props, context) => {
|
|
|
324
340
|
iconContainerClassName: _style.default.infoIconTooltip,
|
|
325
341
|
tooltipClassName: _style.default.tooltip,
|
|
326
342
|
TooltipContent: ReviewTooltipContent,
|
|
327
|
-
closeToolTipInformationTextAriaLabel: translate('
|
|
343
|
+
closeToolTipInformationTextAriaLabel: translate('close_tooltip_information')
|
|
328
344
|
})))), /*#__PURE__*/_react.default.createElement("div", {
|
|
329
345
|
className: _style.default.toolBarContainer
|
|
330
346
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -380,15 +396,22 @@ const MyLearning = (props, context) => {
|
|
|
380
396
|
onExploreSkill(skill);
|
|
381
397
|
}
|
|
382
398
|
|
|
399
|
+
const {
|
|
400
|
+
score,
|
|
401
|
+
courses: skillCourses,
|
|
402
|
+
questionsAnswered: skillQuestions,
|
|
403
|
+
coursesCompleted: completedCourses
|
|
404
|
+
} = skillsInformation[skill].stats;
|
|
383
405
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
384
406
|
key: index
|
|
385
407
|
}, /*#__PURE__*/_react.default.createElement(_learnerSkillCard.default, {
|
|
386
408
|
skillTitle: skillsLocales[skill],
|
|
387
409
|
focus: selectedSkills.includes(skill),
|
|
388
410
|
metrics: {
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
411
|
+
score,
|
|
412
|
+
skillCourses,
|
|
413
|
+
skillQuestions,
|
|
414
|
+
completedCourses
|
|
392
415
|
},
|
|
393
416
|
review: skillsInformation[skill].availableForReview,
|
|
394
417
|
onReviewClick: handleReviewSkill,
|
|
@@ -398,6 +421,7 @@ const MyLearning = (props, context) => {
|
|
|
398
421
|
};
|
|
399
422
|
|
|
400
423
|
MyLearning.contextTypes = {
|
|
424
|
+
skin: _provider.default.childContextTypes.skin,
|
|
401
425
|
translate: _provider.default.childContextTypes.translate
|
|
402
426
|
};
|
|
403
427
|
MyLearning.propTypes = process.env.NODE_ENV !== "production" ? {
|