@coorpacademy/components 11.13.7-alpha.9 → 11.14.1-alpha.2
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/button/index.d.ts.map +1 -1
- package/es/atom/button/index.js +18 -13
- package/es/atom/button/index.js.map +1 -1
- package/es/molecule/cm-popin/index.d.ts.map +1 -1
- package/es/molecule/cm-popin/index.js +5 -4
- package/es/molecule/cm-popin/index.js.map +1 -1
- package/es/molecule/cm-popin/style.css +61 -40
- package/es/molecule/discipline-header/index.d.ts +1 -0
- package/es/molecule/discipline-header/index.d.ts.map +1 -1
- package/es/molecule/discipline-header/index.js +24 -9
- package/es/molecule/discipline-header/index.js.map +1 -1
- package/es/molecule/discipline-header/style.css +34 -7
- package/es/template/common/discipline/index.d.ts.map +1 -1
- package/es/template/common/discipline/index.js +4 -2
- package/es/template/common/discipline/index.js.map +1 -1
- package/es/template/external-course/index.d.ts +69 -21
- package/es/template/external-course/index.d.ts.map +1 -1
- package/es/template/external-course/index.js +73 -56
- package/es/template/external-course/index.js.map +1 -1
- package/es/template/external-course/style.css +1 -1
- package/es/template/mobile-login/welcome/index.native.d.ts +18 -0
- package/es/template/mobile-login/welcome/index.native.d.ts.map +1 -0
- package/es/template/mobile-login/welcome/index.native.js +195 -0
- package/es/template/mobile-login/welcome/index.native.js.map +1 -0
- package/lib/atom/button/index.d.ts.map +1 -1
- package/lib/atom/button/index.js +18 -13
- package/lib/atom/button/index.js.map +1 -1
- package/lib/molecule/cm-popin/index.d.ts.map +1 -1
- package/lib/molecule/cm-popin/index.js +4 -3
- package/lib/molecule/cm-popin/index.js.map +1 -1
- package/lib/molecule/cm-popin/style.css +61 -40
- package/lib/molecule/discipline-header/index.d.ts +1 -0
- package/lib/molecule/discipline-header/index.d.ts.map +1 -1
- package/lib/molecule/discipline-header/index.js +25 -9
- package/lib/molecule/discipline-header/index.js.map +1 -1
- package/lib/molecule/discipline-header/style.css +34 -7
- package/lib/template/common/discipline/index.d.ts.map +1 -1
- package/lib/template/common/discipline/index.js +4 -2
- package/lib/template/common/discipline/index.js.map +1 -1
- package/lib/template/external-course/index.d.ts +69 -21
- package/lib/template/external-course/index.d.ts.map +1 -1
- package/lib/template/external-course/index.js +76 -54
- package/lib/template/external-course/index.js.map +1 -1
- package/lib/template/external-course/style.css +1 -1
- package/lib/template/mobile-login/welcome/index.native.d.ts +18 -0
- package/lib/template/mobile-login/welcome/index.native.d.ts.map +1 -0
- package/lib/template/mobile-login/welcome/index.native.js +212 -0
- package/lib/template/mobile-login/welcome/index.native.js.map +1 -0
- package/package.json +3 -3
- package/es/atom/form-text-input/index.d.ts +0 -27
- package/es/atom/form-text-input/index.d.ts.map +0 -1
- package/es/atom/form-text-input/index.js +0 -96
- package/es/atom/form-text-input/index.js.map +0 -1
- package/es/atom/form-text-input/prop-types.d.ts +0 -56
- package/es/atom/form-text-input/prop-types.d.ts.map +0 -1
- package/es/atom/form-text-input/prop-types.js +0 -35
- package/es/atom/form-text-input/prop-types.js.map +0 -1
- package/es/atom/form-text-input/style.css +0 -53
- package/lib/atom/form-text-input/index.d.ts +0 -27
- package/lib/atom/form-text-input/index.d.ts.map +0 -1
- package/lib/atom/form-text-input/index.js +0 -114
- package/lib/atom/form-text-input/index.js.map +0 -1
- package/lib/atom/form-text-input/prop-types.d.ts +0 -56
- package/lib/atom/form-text-input/prop-types.d.ts.map +0 -1
- package/lib/atom/form-text-input/prop-types.js +0 -46
- package/lib/atom/form-text-input/prop-types.js.map +0 -1
- package/lib/atom/form-text-input/style.css +0 -53
|
@@ -13,6 +13,8 @@ var _getOr = _interopRequireDefault(require("lodash/fp/getOr"));
|
|
|
13
13
|
|
|
14
14
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
15
|
|
|
16
|
+
var _novaIcons = require("@coorpacademy/nova-icons");
|
|
17
|
+
|
|
16
18
|
var _videoPlayer = _interopRequireDefault(require("../video-player"));
|
|
17
19
|
|
|
18
20
|
var _picture = _interopRequireDefault(require("../../atom/picture"));
|
|
@@ -79,7 +81,8 @@ class DisciplineHeader extends _react.default.Component {
|
|
|
79
81
|
image,
|
|
80
82
|
title,
|
|
81
83
|
description,
|
|
82
|
-
video
|
|
84
|
+
video,
|
|
85
|
+
lastUpdated
|
|
83
86
|
} = this.props;
|
|
84
87
|
const {
|
|
85
88
|
fullDisplay,
|
|
@@ -88,19 +91,23 @@ class DisciplineHeader extends _react.default.Component {
|
|
|
88
91
|
const {
|
|
89
92
|
translate
|
|
90
93
|
} = this.context;
|
|
91
|
-
const
|
|
94
|
+
const maxHeightCourseInfos = 209;
|
|
95
|
+
const hasMediaContent = image || video;
|
|
92
96
|
const toggleLabel = fullDisplay ? translate('See less') : translate('Show more');
|
|
93
|
-
const
|
|
97
|
+
const shortCourseText = offsetHeightShowMore <= maxHeightCourseInfos;
|
|
98
|
+
const courseSeeMoreButtonStyle = shortCourseText ? _style.default.showMoreHidden : _style.default.showMore;
|
|
94
99
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
95
100
|
"data-name": "disciplineHeader",
|
|
96
101
|
className: _style.default.wrapper
|
|
97
|
-
},
|
|
102
|
+
}, hasMediaContent ? /*#__PURE__*/_react.default.createElement("div", {
|
|
98
103
|
className: _style.default.imgWrapper
|
|
99
104
|
}, /*#__PURE__*/_react.default.createElement(Preview, {
|
|
100
105
|
image: image,
|
|
101
106
|
video: video
|
|
102
107
|
})) : null, /*#__PURE__*/_react.default.createElement("div", {
|
|
103
108
|
className: _style.default.courseWrapper
|
|
109
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
110
|
+
className: fullDisplay ? _style.default.courseTextWrapperFull : _style.default.courseTextWrapperShort
|
|
104
111
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
105
112
|
"data-name": "title",
|
|
106
113
|
className: (0, _classnames.default)(_style.default.title, _style.default.innerHTML) // eslint-disable-next-line react/no-danger
|
|
@@ -109,8 +116,6 @@ class DisciplineHeader extends _react.default.Component {
|
|
|
109
116
|
__html: title
|
|
110
117
|
}
|
|
111
118
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
112
|
-
className: fullDisplay ? _style.default.desc : _style.default.shortDesc
|
|
113
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
114
119
|
className: _style.default.innerHTML // eslint-disable-next-line react/no-danger
|
|
115
120
|
,
|
|
116
121
|
dangerouslySetInnerHTML: {
|
|
@@ -118,9 +123,19 @@ class DisciplineHeader extends _react.default.Component {
|
|
|
118
123
|
},
|
|
119
124
|
ref: this.setHandle
|
|
120
125
|
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
121
|
-
className:
|
|
126
|
+
className: courseSeeMoreButtonStyle,
|
|
122
127
|
onClick: this.handleToggleDisplay
|
|
123
|
-
}, toggleLabel)
|
|
128
|
+
}, toggleLabel), lastUpdated ? /*#__PURE__*/_react.default.createElement("div", {
|
|
129
|
+
className: (0, _classnames.default)(_style.default.lastUpdatedWrapper, shortCourseText ? _style.default.lastUpdatedWrapperShort : null)
|
|
130
|
+
}, /*#__PURE__*/_react.default.createElement(_novaIcons.NovaSolidSynchronizeSynchronize3, {
|
|
131
|
+
className: _style.default.syncIcon
|
|
132
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
133
|
+
className: (0, _classnames.default)(_style.default.lastUpdatedText, _style.default.innerHTML) // eslint-disable-next-line react/no-danger
|
|
134
|
+
,
|
|
135
|
+
dangerouslySetInnerHTML: {
|
|
136
|
+
__html: lastUpdated
|
|
137
|
+
}
|
|
138
|
+
})) : null));
|
|
124
139
|
}
|
|
125
140
|
|
|
126
141
|
}
|
|
@@ -132,7 +147,8 @@ DisciplineHeader.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
132
147
|
title: _propTypes.default.string,
|
|
133
148
|
description: _propTypes.default.string,
|
|
134
149
|
image: Preview.propTypes.image,
|
|
135
|
-
video: Preview.propTypes.video
|
|
150
|
+
video: Preview.propTypes.video,
|
|
151
|
+
lastUpdated: _propTypes.default.string
|
|
136
152
|
} : {};
|
|
137
153
|
var _default = DisciplineHeader;
|
|
138
154
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["Preview","image","video","mimeType","get","id","jwpOptions","style","propTypes","Picture","src","PropTypes","shape","VideoPlayer","DisciplineHeader","React","Component","constructor","props","state","fullDisplay","offsetHeightShowMore","handleToggleDisplay","bind","setHandle","setState","prevState","el","getOr","render","title","description","translate","context","
|
|
1
|
+
{"version":3,"file":"index.js","names":["Preview","image","video","mimeType","get","id","jwpOptions","style","propTypes","Picture","src","PropTypes","shape","VideoPlayer","DisciplineHeader","React","Component","constructor","props","state","fullDisplay","offsetHeightShowMore","handleToggleDisplay","bind","setHandle","setState","prevState","el","getOr","render","title","description","lastUpdated","translate","context","maxHeightCourseInfos","hasMediaContent","toggleLabel","shortCourseText","courseSeeMoreButtonStyle","showMoreHidden","showMore","wrapper","imgWrapper","courseWrapper","courseTextWrapperFull","courseTextWrapperShort","classnames","innerHTML","__html","lastUpdatedWrapper","lastUpdatedWrapperShort","syncIcon","lastUpdatedText","contextTypes","func","string"],"sources":["../../../src/molecule/discipline-header/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport classnames from 'classnames';\nimport {NovaSolidSynchronizeSynchronize3 as SyncIcon} from '@coorpacademy/nova-icons';\nimport VideoPlayer from '../video-player';\nimport Picture from '../../atom/picture';\nimport style from './style.css';\n\nconst Preview = ({image, video}) => {\n const mimeType = get('mimeType', video);\n const id = get('id', video);\n const jwpOptions = get('jwpOptions', video);\n if (id) {\n return <VideoPlayer mimeType={mimeType} id={id} width=\"380px\" height=\"250px\" />;\n } else if (jwpOptions) {\n return <VideoPlayer {...video} />;\n } else {\n return <Picture className={style.image} src={image} />;\n }\n};\n\nPreview.propTypes = {\n image: Picture.propTypes.src,\n video: PropTypes.shape(VideoPlayer.propTypes)\n};\n\nclass DisciplineHeader extends React.Component {\n static propTypes = {\n title: PropTypes.string,\n description: PropTypes.string,\n image: Preview.propTypes.image,\n video: Preview.propTypes.video,\n lastUpdated: PropTypes.string\n };\n\n static contextTypes = {\n translate: PropTypes.func\n };\n\n constructor(props) {\n super(props);\n this.state = {\n fullDisplay: false,\n offsetHeightShowMore: 0\n };\n this.handleToggleDisplay = this.handleToggleDisplay.bind(this);\n this.setHandle = this.setHandle.bind(this);\n }\n\n handleToggleDisplay() {\n this.setState(prevState => ({\n fullDisplay: !prevState.fullDisplay\n }));\n }\n\n setHandle(el) {\n this.setState({offsetHeightShowMore: getOr(0, 'offsetHeight', el)});\n }\n\n render() {\n const {image, title, description, video, lastUpdated} = this.props;\n const {fullDisplay, offsetHeightShowMore} = this.state;\n const {translate} = this.context;\n const maxHeightCourseInfos = 209;\n const hasMediaContent = image || video;\n const toggleLabel = fullDisplay ? translate('See less') : translate('Show more');\n const shortCourseText = offsetHeightShowMore <= maxHeightCourseInfos;\n const courseSeeMoreButtonStyle = shortCourseText ? style.showMoreHidden : style.showMore;\n\n return (\n <div data-name=\"disciplineHeader\" className={style.wrapper}>\n {hasMediaContent ? (\n <div className={style.imgWrapper}>\n <Preview image={image} video={video} />\n </div>\n ) : null}\n <div className={style.courseWrapper}>\n <div className={fullDisplay ? style.courseTextWrapperFull : style.courseTextWrapperShort}>\n <div\n data-name=\"title\"\n className={classnames(style.title, style.innerHTML)}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n <div\n className={style.innerHTML}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: description}}\n ref={this.setHandle}\n />\n </div>\n <div className={courseSeeMoreButtonStyle} onClick={this.handleToggleDisplay}>\n {toggleLabel}\n </div>\n {lastUpdated ? (\n <div\n className={classnames(\n style.lastUpdatedWrapper,\n shortCourseText ? style.lastUpdatedWrapperShort : null\n )}\n >\n <SyncIcon className={style.syncIcon} />\n <div\n className={classnames(style.lastUpdatedText, style.innerHTML)}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: lastUpdated}}\n />\n </div>\n ) : null}\n </div>\n </div>\n );\n }\n}\n\nexport default DisciplineHeader;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,OAAO,GAAG,CAAC;EAACC,KAAD;EAAQC;AAAR,CAAD,KAAoB;EAClC,MAAMC,QAAQ,GAAG,IAAAC,YAAA,EAAI,UAAJ,EAAgBF,KAAhB,CAAjB;EACA,MAAMG,EAAE,GAAG,IAAAD,YAAA,EAAI,IAAJ,EAAUF,KAAV,CAAX;EACA,MAAMI,UAAU,GAAG,IAAAF,YAAA,EAAI,YAAJ,EAAkBF,KAAlB,CAAnB;;EACA,IAAIG,EAAJ,EAAQ;IACN,oBAAO,6BAAC,oBAAD;MAAa,QAAQ,EAAEF,QAAvB;MAAiC,EAAE,EAAEE,EAArC;MAAyC,KAAK,EAAC,OAA/C;MAAuD,MAAM,EAAC;IAA9D,EAAP;EACD,CAFD,MAEO,IAAIC,UAAJ,EAAgB;IACrB,oBAAO,6BAAC,oBAAD,EAAiBJ,KAAjB,CAAP;EACD,CAFM,MAEA;IACL,oBAAO,6BAAC,gBAAD;MAAS,SAAS,EAAEK,cAAA,CAAMN,KAA1B;MAAiC,GAAG,EAAEA;IAAtC,EAAP;EACD;AACF,CAXD;;AAaAD,OAAO,CAACQ,SAAR,2CAAoB;EAClBP,KAAK,EAAEQ,gBAAA,CAAQD,SAAR,CAAkBE,GADP;EAElBR,KAAK,EAAES,kBAAA,CAAUC,KAAV,CAAgBC,oBAAA,CAAYL,SAA5B;AAFW,CAApB;;AAKA,MAAMM,gBAAN,SAA+BC,cAAA,CAAMC,SAArC,CAA+C;EAa7CC,WAAW,CAACC,KAAD,EAAQ;IACjB,MAAMA,KAAN;IACA,KAAKC,KAAL,GAAa;MACXC,WAAW,EAAE,KADF;MAEXC,oBAA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,SAAR,CAAkBP,KAHR;EAIjBC,KAAK,EAAEF,OAAO,CAACQ,SAAR,CAAkBN,KAJR;EAKjB8B,WAAW,EAAErB,kBAAA,CAAU6C;AALN,C;eAwFN1C,gB"}
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
color: dark;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
.
|
|
48
|
+
.courseTextWrapperFull {
|
|
49
49
|
font-family: "Gilroy";
|
|
50
50
|
font-size: 15px;
|
|
51
51
|
color: black;
|
|
@@ -53,14 +53,14 @@
|
|
|
53
53
|
line-height: 22px;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
.
|
|
56
|
+
.courseTextWrapperFull a {
|
|
57
57
|
font-family: Gilroy;
|
|
58
58
|
font-weight: 600;
|
|
59
59
|
color: brand;
|
|
60
60
|
text-decoration: none;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
.
|
|
63
|
+
.courseTextWrapperFull a:hover {
|
|
64
64
|
text-decoration: underline;
|
|
65
65
|
}
|
|
66
66
|
|
|
@@ -68,10 +68,36 @@
|
|
|
68
68
|
display: none;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
+
.lastUpdatedWrapperShort {
|
|
72
|
+
height: 31px;
|
|
73
|
+
align-items: flex-end;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.lastUpdatedWrapper {
|
|
77
|
+
display: flex;
|
|
78
|
+
margin-top: 8px;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.lastUpdatedText {
|
|
82
|
+
font-family: 'Gilroy';
|
|
83
|
+
font-style: normal;
|
|
84
|
+
font-weight: 600;
|
|
85
|
+
font-size: 12px;
|
|
86
|
+
line-height: 14px;
|
|
87
|
+
color: #536E7A;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.syncIcon {
|
|
91
|
+
height: 13px;
|
|
92
|
+
color: #536E7A;
|
|
93
|
+
margin-right: 3px;
|
|
94
|
+
align-items: center;
|
|
95
|
+
padding-bottom: 1px;
|
|
96
|
+
}
|
|
97
|
+
|
|
71
98
|
.showMore {
|
|
72
99
|
display: block;
|
|
73
100
|
font-size: 14px;
|
|
74
|
-
margin: 0 14px 0 0;
|
|
75
101
|
transition: all time ease-in-out;
|
|
76
102
|
cursor: pointer;
|
|
77
103
|
order: 1;
|
|
@@ -85,9 +111,9 @@
|
|
|
85
111
|
opacity: 0.8;
|
|
86
112
|
}
|
|
87
113
|
|
|
88
|
-
.
|
|
89
|
-
composes:
|
|
90
|
-
height:
|
|
114
|
+
.courseTextWrapperShort {
|
|
115
|
+
composes: courseTextWrapperFull;
|
|
116
|
+
height: 213px;
|
|
91
117
|
overflow: hidden;
|
|
92
118
|
}
|
|
93
119
|
|
|
@@ -106,6 +132,7 @@
|
|
|
106
132
|
margin-top: 20px;
|
|
107
133
|
padding-left: 0;
|
|
108
134
|
}
|
|
135
|
+
|
|
109
136
|
}
|
|
110
137
|
|
|
111
138
|
.innerHTML {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/template/common/discipline/index.js"],"names":[],"mappings":";AAcA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/template/common/discipline/index.js"],"names":[],"mappings":";AAcA,mEA+JC"}
|
|
@@ -54,7 +54,8 @@ const Discipline = (props, context) => {
|
|
|
54
54
|
addToMyListText,
|
|
55
55
|
removeFromMyListText,
|
|
56
56
|
disableShare = false,
|
|
57
|
-
disableAddToMyList = false
|
|
57
|
+
disableAddToMyList = false,
|
|
58
|
+
lastUpdated
|
|
58
59
|
} = props;
|
|
59
60
|
const authorSection = (0, _isEmpty.default)(authors) ? null : /*#__PURE__*/_react.default.createElement("div", {
|
|
60
61
|
className: _style.default.partners
|
|
@@ -85,7 +86,8 @@ const Discipline = (props, context) => {
|
|
|
85
86
|
image: image,
|
|
86
87
|
video: video,
|
|
87
88
|
title: title,
|
|
88
|
-
description: description
|
|
89
|
+
description: description,
|
|
90
|
+
lastUpdated: lastUpdated
|
|
89
91
|
}));
|
|
90
92
|
|
|
91
93
|
const discipline = /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -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","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 } = 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 image={image} video={video} title={title} description={description} />\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,OA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CAAcF,SAAd,CAAwBpC,QARb;EASrBL,OAAO,EAAE4C,2BAAA,CAAmBH,SAAnB,CAA6BzC,OATjB;EAUrBN,KAAK,EAAEmD,wBAAA,CAAgBJ,SAAhB,CAA0BlB,OAVZ;EAWrB5B,MAAM,EAAEkD,wBAAA,CAAgBJ,SAAhB,CAA0B9C,MAXb;EAYrBF,QAAQ,EAAEoD,wBAAA,CAAgBJ,SAAhB,CAA0BhD,QAZf;EAarBG,WAAW,EAAEiD,wBAAA,CAAgBJ,SAAhB,CAA0BK,OAblB;EAcrBxC,YAAY,EAAEyC,cAAA,CAAMN,SAAN,CAAgBO,OAdT;EAerBzC,SAAS,EAAEwC,cAAA,CAAMN,SAAN,CAAgBQ,IAfN;EAgBrBzC,mBAAmB,EAAE0C,oBAAA,CAAcT,SAAd,CAAwBU,cAhBxB;EAiBrB1C,iBAAiB,EAAEyC,oBAAA,CAAcT,SAAd,CAAwBW,YAjBtB;EAkBrBvC,eAAe,EAAEwC,gCAAA,CAAoBZ,SAApB,CAA8B5B,eAlB1B;EAmBrBC,oBAAoB,EAAEuC,gCAAA,CAAoBZ,SAApB,CAA8B3B,oBAnB/B;EAoBrBJ,iBAAiB,EAAE4C,oBAAA,CAAYb,SAAZ,CAAsB/B,iBApBpB;EAqBrBE,eAAe,EAAE0C,oBAAA,CAAYb,SAAZ,CAAsB7B,eArBlB;EAsBrBD,QAAQ,EAAE2C,oBAAA,CAAYb,SAAZ,CAAsB9B,QAtBX;EAuBrBI,YAAY,EAAEwC,kBAAA,CAAUC,IAvBH;EAwBrBxC,kBAAkB,EAAEuC,kBAAA,CAAUC;AAxBT,CAAvB;AA2BAlE,UAAU,CAACmE,YAAX,GAA0B;EACxBC,SAAS,EAAEH,kBAAA,CAAUI;AADG,CAA1B;eAIerE,U"}
|
|
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;IA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AgBJ,SAAhB,CAA0B/C,MAXb;EAYrBF,QAAQ,EAAEqD,wBAAA,CAAgBJ,SAAhB,CAA0BjD,QAZf;EAarBG,WAAW,EAAEkD,wBAAA,CAAgBJ,SAAhB,CAA0BK,OAblB;EAcrBzC,YAAY,EAAE0C,cAAA,CAAMN,SAAN,CAAgBO,OAdT;EAerB1C,SAAS,EAAEyC,cAAA,CAAMN,SAAN,CAAgBQ,IAfN;EAgBrB1C,mBAAmB,EAAE2C,oBAAA,CAAcT,SAAd,CAAwBU,cAhBxB;EAiBrB3C,iBAAiB,EAAE0C,oBAAA,CAAcT,SAAd,CAAwBW,YAjBtB;EAkBrBxC,eAAe,EAAEyC,gCAAA,CAAoBZ,SAApB,CAA8B7B,eAlB1B;EAmBrBC,oBAAoB,EAAEwC,gCAAA,CAAoBZ,SAApB,CAA8B5B,oBAnB/B;EAoBrBJ,iBAAiB,EAAE6C,oBAAA,CAAYb,SAAZ,CAAsBhC,iBApBpB;EAqBrBE,eAAe,EAAE2C,oBAAA,CAAYb,SAAZ,CAAsB9B,eArBlB;EAsBrBD,QAAQ,EAAE4C,oBAAA,CAAYb,SAAZ,CAAsB/B,QAtBX;EAuBrBI,YAAY,EAAEyC,kBAAA,CAAUC,IAvBH;EAwBrBzC,kBAAkB,EAAEwC,kBAAA,CAAUC;AAxBT,CAAvB;AA2BAnE,UAAU,CAACoE,YAAX,GAA0B;EACxBC,SAAS,EAAEH,kBAAA,CAAUI;AADG,CAA1B;eAIetE,U"}
|
|
@@ -1,29 +1,82 @@
|
|
|
1
1
|
export default ExternalCourse;
|
|
2
|
-
declare
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
declare function ExternalCourse(props: any, context: any): JSX.Element;
|
|
3
|
+
declare namespace ExternalCourse {
|
|
4
|
+
namespace propTypes {
|
|
5
|
+
const name: PropTypes.Requireable<string>;
|
|
6
|
+
const type: PropTypes.Requireable<string>;
|
|
7
|
+
const url: PropTypes.Validator<string>;
|
|
8
|
+
const quit: PropTypes.Requireable<PropTypes.InferProps<{
|
|
8
9
|
label: PropTypes.Validator<string>;
|
|
9
10
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
10
11
|
}>>;
|
|
11
|
-
complete: PropTypes.Requireable<PropTypes.InferProps<{
|
|
12
|
+
const complete: PropTypes.Requireable<PropTypes.InferProps<{
|
|
12
13
|
label: PropTypes.Validator<string>;
|
|
13
14
|
disabled: PropTypes.Requireable<boolean>;
|
|
14
15
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
15
16
|
}>>;
|
|
16
|
-
warning: PropTypes.Requireable<PropTypes.InferProps<{
|
|
17
|
+
const warning: PropTypes.Requireable<PropTypes.InferProps<{
|
|
17
18
|
label: PropTypes.Validator<string>;
|
|
18
19
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
19
20
|
}>>;
|
|
20
|
-
loading: PropTypes.Requireable<boolean>;
|
|
21
|
-
backgroundImageUrl: PropTypes.Requireable<string>;
|
|
22
|
-
contentType: PropTypes.Requireable<string>;
|
|
23
|
-
mode: PropTypes.Requireable<string>;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
const loading: PropTypes.Requireable<boolean>;
|
|
22
|
+
const backgroundImageUrl: PropTypes.Requireable<string>;
|
|
23
|
+
const contentType: PropTypes.Requireable<string>;
|
|
24
|
+
const mode: PropTypes.Requireable<string>;
|
|
25
|
+
const closePopin: PropTypes.Requireable<PropTypes.InferProps<{
|
|
26
|
+
content: PropTypes.Requireable<string>;
|
|
27
|
+
mode: PropTypes.Requireable<string>;
|
|
28
|
+
header: PropTypes.Requireable<string>;
|
|
29
|
+
firstButton: PropTypes.Requireable<PropTypes.InferProps<{
|
|
30
|
+
label: PropTypes.Requireable<string>;
|
|
31
|
+
handleOnclick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
32
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
33
|
+
largeButton: PropTypes.Requireable<boolean>;
|
|
34
|
+
type: PropTypes.Requireable<string>;
|
|
35
|
+
customStyle: PropTypes.Requireable<PropTypes.InferProps<{}>>;
|
|
36
|
+
}>>;
|
|
37
|
+
secondButton: PropTypes.Requireable<PropTypes.InferProps<{
|
|
38
|
+
label: PropTypes.Requireable<string>;
|
|
39
|
+
handleOnclick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
40
|
+
type: PropTypes.Requireable<string>;
|
|
41
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
42
|
+
largeButton: PropTypes.Requireable<boolean>;
|
|
43
|
+
customStyle: PropTypes.Requireable<PropTypes.InferProps<{}>>;
|
|
44
|
+
}>>;
|
|
45
|
+
thirdButton: PropTypes.Requireable<PropTypes.InferProps<{
|
|
46
|
+
label: PropTypes.Requireable<string>;
|
|
47
|
+
handleOnclick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
48
|
+
type: PropTypes.Requireable<string>;
|
|
49
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
50
|
+
largeButton: PropTypes.Requireable<boolean>;
|
|
51
|
+
customStyle: PropTypes.Requireable<PropTypes.InferProps<{}>>;
|
|
52
|
+
}>>;
|
|
53
|
+
onClose: PropTypes.Requireable<(...args: any[]) => any>;
|
|
54
|
+
icon: PropTypes.Requireable<string>;
|
|
55
|
+
backgroundImageUrl: PropTypes.Requireable<string>;
|
|
56
|
+
descriptionText: PropTypes.Requireable<string>;
|
|
57
|
+
cookieTitle: PropTypes.Requireable<string>;
|
|
58
|
+
descriptionBtnTxt: PropTypes.Requireable<string>;
|
|
59
|
+
listBtnSwicth: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
60
|
+
title: PropTypes.Requireable<string>;
|
|
61
|
+
name: PropTypes.Requireable<string>;
|
|
62
|
+
id: PropTypes.Requireable<string>;
|
|
63
|
+
value: PropTypes.Requireable<boolean>;
|
|
64
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
65
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
66
|
+
description: PropTypes.Requireable<string>;
|
|
67
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
68
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
69
|
+
modified: PropTypes.Requireable<boolean>;
|
|
70
|
+
titlePosition: PropTypes.Requireable<string>;
|
|
71
|
+
theme: PropTypes.Requireable<string>;
|
|
72
|
+
details: PropTypes.Requireable<string>;
|
|
73
|
+
'data-name': PropTypes.Requireable<string>;
|
|
74
|
+
requiredSelection: PropTypes.Requireable<boolean>;
|
|
75
|
+
}> | null | undefined)[]>;
|
|
76
|
+
}>>;
|
|
77
|
+
}
|
|
78
|
+
namespace contextTypes {
|
|
79
|
+
const skin: PropTypes.Requireable<PropTypes.InferProps<{
|
|
27
80
|
common: PropTypes.Requireable<{
|
|
28
81
|
[x: string]: any;
|
|
29
82
|
}>;
|
|
@@ -44,12 +97,7 @@ declare class ExternalCourse extends React.Component<any, any, any> {
|
|
|
44
97
|
[x: string]: any;
|
|
45
98
|
}>;
|
|
46
99
|
}>>;
|
|
47
|
-
}
|
|
48
|
-
constructor(props: any);
|
|
49
|
-
constructor(props: any, context: any);
|
|
50
|
-
handleOnClick: (field: any) => (e: any) => any;
|
|
51
|
-
render(): JSX.Element;
|
|
100
|
+
}
|
|
52
101
|
}
|
|
53
|
-
import React from "react";
|
|
54
102
|
import PropTypes from "prop-types";
|
|
55
103
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/external-course/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/external-course/index.js"],"names":[],"mappings":";AAoBA,uEAwIC"}
|
|
@@ -13,9 +13,9 @@ var _keys2 = _interopRequireDefault(require("lodash/fp/keys"));
|
|
|
13
13
|
|
|
14
14
|
var _getOr2 = _interopRequireDefault(require("lodash/fp/getOr"));
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _noop2 = _interopRequireDefault(require("lodash/fp/noop"));
|
|
17
17
|
|
|
18
|
-
var _react =
|
|
18
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
19
19
|
|
|
20
20
|
var _novaIcons = require("@coorpacademy/nova-icons");
|
|
21
21
|
|
|
@@ -35,48 +35,46 @@ var _button = _interopRequireDefault(require("../../atom/button"));
|
|
|
35
35
|
|
|
36
36
|
var _externalContentViewer = _interopRequireDefault(require("../../molecule/external-content-viewer"));
|
|
37
37
|
|
|
38
|
+
var _cmPopin = _interopRequireDefault(require("../../molecule/cm-popin"));
|
|
39
|
+
|
|
38
40
|
var _style = _interopRequireDefault(require("./style.css"));
|
|
39
41
|
|
|
42
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
43
|
+
|
|
44
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
45
|
+
|
|
40
46
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
41
47
|
|
|
48
|
+
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); }
|
|
49
|
+
|
|
42
50
|
const defaultWrapperStyle = {
|
|
43
51
|
default: _style.default.default,
|
|
44
52
|
cockpit: _style.default.defaultCockpit,
|
|
45
53
|
mobile: _style.default.default
|
|
46
54
|
};
|
|
47
55
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
contentType,
|
|
71
|
-
mode = 'default'
|
|
72
|
-
} = this.props;
|
|
73
|
-
const {
|
|
74
|
-
skin
|
|
75
|
-
} = this.context;
|
|
76
|
-
const primary = (0, _getOr2.default)('#00B0FF', 'common.primary', skin);
|
|
77
|
-
const IconType = _externalContent.EXTERNAL_CONTENT_ICONS[type].icon;
|
|
78
|
-
const IconColor = _externalContent.EXTERNAL_CONTENT_ICONS[type].color;
|
|
79
|
-
const mainContentSlot = loading ? /*#__PURE__*/_react.default.createElement("div", {
|
|
56
|
+
const ExternalCourse = (props, context) => {
|
|
57
|
+
const {
|
|
58
|
+
name,
|
|
59
|
+
type,
|
|
60
|
+
url,
|
|
61
|
+
quit,
|
|
62
|
+
complete,
|
|
63
|
+
warning,
|
|
64
|
+
loading,
|
|
65
|
+
backgroundImageUrl,
|
|
66
|
+
contentType,
|
|
67
|
+
mode = 'default',
|
|
68
|
+
closePopin
|
|
69
|
+
} = props;
|
|
70
|
+
const {
|
|
71
|
+
skin
|
|
72
|
+
} = context;
|
|
73
|
+
const primary = (0, _getOr2.default)('#00B0FF', 'common.primary', skin);
|
|
74
|
+
const IconType = _externalContent.EXTERNAL_CONTENT_ICONS[type].icon;
|
|
75
|
+
const IconColor = _externalContent.EXTERNAL_CONTENT_ICONS[type].color;
|
|
76
|
+
const mainContentSlot = (0, _react.useMemo)(() => {
|
|
77
|
+
return loading ? /*#__PURE__*/_react.default.createElement("div", {
|
|
80
78
|
className: _style.default.loader
|
|
81
79
|
}, /*#__PURE__*/_react.default.createElement(_loader.default, null)) : /*#__PURE__*/_react.default.createElement(_externalContentViewer.default, {
|
|
82
80
|
url: url,
|
|
@@ -84,34 +82,51 @@ class ExternalCourse extends _react.default.Component {
|
|
|
84
82
|
backgroundImageUrl: backgroundImageUrl,
|
|
85
83
|
contentType: contentType
|
|
86
84
|
});
|
|
87
|
-
|
|
85
|
+
}, [loading, url, mode, contentType, backgroundImageUrl]);
|
|
86
|
+
const handleOnClick = (0, _react.useCallback)(field => {
|
|
87
|
+
const onClick = (0, _getOr2.default)(_noop2.default, ['onClick'], field);
|
|
88
|
+
return e => {
|
|
89
|
+
e.stopPropagation();
|
|
90
|
+
e.preventDefault();
|
|
91
|
+
return onClick(e);
|
|
92
|
+
};
|
|
93
|
+
}, []);
|
|
94
|
+
const completeButton = (0, _react.useMemo)(() => {
|
|
95
|
+
return !(0, _isNil2.default)(complete) ? /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
88
96
|
type: "button",
|
|
89
97
|
disabled: loading ? true : complete.disabled,
|
|
90
|
-
onClick: loading ? _identity2.default :
|
|
98
|
+
onClick: loading ? _identity2.default : handleOnClick(complete),
|
|
91
99
|
submitValue: complete.label,
|
|
92
100
|
style: {
|
|
93
101
|
backgroundColor: complete.disabled || loading ? (0, _cssColorFunction.convert)(`color(${primary} a(-50%))`) : primary,
|
|
94
102
|
cursor: loading ? 'progress' : 'pointer'
|
|
95
103
|
},
|
|
96
|
-
className: (0, _classnames.default)(_style.default.completeCta, complete.disabled || loading ? _style.default.disabled : null, loading ? _style.default.loading : null)
|
|
104
|
+
className: (0, _classnames.default)(_style.default.completeCta, complete.disabled || loading ? _style.default.disabled : null, loading ? _style.default.loading : null),
|
|
105
|
+
"data-testid": "complete-button"
|
|
97
106
|
}) : null;
|
|
98
|
-
|
|
107
|
+
}, [complete, loading, primary, handleOnClick]);
|
|
108
|
+
const warningButton = (0, _react.useMemo)(() => {
|
|
109
|
+
return !(0, _isNil2.default)(warning) ? /*#__PURE__*/_react.default.createElement("div", {
|
|
99
110
|
className: _style.default.leftSection
|
|
100
111
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
101
|
-
onClick:
|
|
112
|
+
onClick: handleOnClick(warning),
|
|
102
113
|
className: (0, _classnames.default)(_style.default.iconLabel, _style.default.link)
|
|
103
114
|
}, /*#__PURE__*/_react.default.createElement(_novaIcons.NovaSolidInterfaceFeedbackInterfaceQuestionMark, {
|
|
104
115
|
className: _style.default.iconQuestion,
|
|
105
116
|
width: 24,
|
|
106
117
|
height: 24
|
|
107
118
|
}), /*#__PURE__*/_react.default.createElement("span", null, warning.label))) : null;
|
|
108
|
-
|
|
119
|
+
}, [handleOnClick, warning]);
|
|
120
|
+
const quitButton = (0, _react.useMemo)(() => {
|
|
121
|
+
return !(0, _isNil2.default)(quit) ? /*#__PURE__*/_react.default.createElement("div", {
|
|
109
122
|
className: _style.default.leftSection
|
|
110
123
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
111
124
|
className: (0, _classnames.default)(_style.default.quitCta, loading ? _style.default.loading : null),
|
|
112
|
-
onClick: loading ? _identity2.default :
|
|
125
|
+
onClick: loading ? _identity2.default : handleOnClick(quit)
|
|
113
126
|
}, quit.label)) : null;
|
|
114
|
-
|
|
127
|
+
}, [quit, loading, handleOnClick]);
|
|
128
|
+
const titleSection = (0, _react.useMemo)(() => {
|
|
129
|
+
return !(0, _isNil2.default)(name) ? /*#__PURE__*/_react.default.createElement("div", {
|
|
115
130
|
className: (0, _classnames.default)(_style.default.iconLabel, _style.default.title)
|
|
116
131
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
117
132
|
className: _style.default.oval,
|
|
@@ -127,26 +142,29 @@ class ExternalCourse extends _react.default.Component {
|
|
|
127
142
|
__html: name
|
|
128
143
|
}
|
|
129
144
|
})) : null;
|
|
130
|
-
|
|
145
|
+
}, [name, IconColor]);
|
|
146
|
+
const header = (0, _react.useMemo)(() => {
|
|
147
|
+
return !(0, _isNil2.default)(quit) || !(0, _isEmpty2.default)(name) ? /*#__PURE__*/_react.default.createElement("div", {
|
|
131
148
|
className: _style.default.header
|
|
132
149
|
}, quitButton, titleSection, (0, _isNil2.default)(quit) ? null : /*#__PURE__*/_react.default.createElement("div", {
|
|
133
150
|
className: _style.default.rightSection
|
|
134
151
|
})) : null;
|
|
135
|
-
|
|
152
|
+
}, [name, titleSection, quit, quitButton]);
|
|
153
|
+
const footer = (0, _react.useMemo)(() => {
|
|
154
|
+
return !(0, _isNil2.default)(warning) || !(0, _isNil2.default)(complete) ? /*#__PURE__*/_react.default.createElement("div", {
|
|
136
155
|
className: _style.default.footer
|
|
137
156
|
}, warningButton, completeButton, (0, _isNil2.default)(warning) ? null : /*#__PURE__*/_react.default.createElement("div", {
|
|
138
157
|
className: _style.default.rightSection
|
|
139
158
|
})) : null;
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
ExternalCourse.contextTypes = {
|
|
148
|
-
skin: _provider.default.childContextTypes.skin
|
|
159
|
+
}, [warning, warningButton, complete, completeButton]);
|
|
160
|
+
const popin = (0, _react.useMemo)(() => {
|
|
161
|
+
return !(0, _isNil2.default)(closePopin) ? /*#__PURE__*/_react.default.createElement(_cmPopin.default, closePopin) : null;
|
|
162
|
+
}, [closePopin]);
|
|
163
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
164
|
+
className: defaultWrapperStyle[mode]
|
|
165
|
+
}, header, popin, mainContentSlot, footer);
|
|
149
166
|
};
|
|
167
|
+
|
|
150
168
|
ExternalCourse.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
151
169
|
name: _propTypes.default.string,
|
|
152
170
|
type: _propTypes.default.oneOf((0, _keys2.default)(_externalContent.EXTERNAL_CONTENT_ICONS)),
|
|
@@ -167,8 +185,12 @@ ExternalCourse.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
167
185
|
loading: _propTypes.default.bool,
|
|
168
186
|
backgroundImageUrl: _propTypes.default.string,
|
|
169
187
|
contentType: _propTypes.default.string,
|
|
170
|
-
mode: _propTypes.default.string
|
|
188
|
+
mode: _propTypes.default.string,
|
|
189
|
+
closePopin: _propTypes.default.shape(_extends({}, _cmPopin.default.propTypes))
|
|
171
190
|
} : {};
|
|
191
|
+
ExternalCourse.contextTypes = {
|
|
192
|
+
skin: _provider.default.childContextTypes.skin
|
|
193
|
+
};
|
|
172
194
|
var _default = ExternalCourse;
|
|
173
195
|
exports.default = _default;
|
|
174
196
|
//# sourceMappingURL=index.js.map
|