@coorpacademy/components 10.21.3 → 10.22.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/README.md +1 -1
- package/es/atom/content-badge/index.js +15 -3
- package/es/atom/content-badge/index.js.map +1 -1
- package/es/atom/content-badge/style.css +6 -0
- package/es/atom/lottie-wrapper/index.js +2 -24
- package/es/atom/lottie-wrapper/index.js.map +1 -1
- package/es/atom/lottie-wrapper/prop-types.js +26 -0
- package/es/atom/lottie-wrapper/prop-types.js.map +1 -0
- package/es/atom/review-background/index.js +2 -4
- package/es/atom/review-background/index.js.map +1 -1
- package/es/atom/review-background/prop-types.js +5 -0
- package/es/atom/review-background/prop-types.js.map +1 -0
- package/es/atom/review-header-step-item/index.js +2 -6
- package/es/atom/review-header-step-item/index.js.map +1 -1
- package/es/atom/review-header-step-item/prop-types.js +7 -0
- package/es/atom/review-header-step-item/prop-types.js.map +1 -0
- package/es/atom/review-presentation/index.js +2 -15
- package/es/atom/review-presentation/index.js.map +1 -1
- package/es/atom/review-presentation/prop-types.js +18 -0
- package/es/atom/review-presentation/prop-types.js.map +1 -0
- package/es/atom/spinner/index.js +1 -0
- package/es/atom/spinner/index.js.map +1 -1
- package/es/atom/tab/index.js +1 -0
- package/es/atom/tab/index.js.map +1 -1
- package/es/hoc/touchable/index.native.js +61 -0
- package/es/hoc/touchable/index.native.js.map +1 -0
- package/es/molecule/answer/index.js +5 -26
- package/es/molecule/answer/index.js.map +1 -1
- package/es/molecule/answer/prop-types.js +32 -0
- package/es/molecule/answer/prop-types.js.map +1 -0
- package/es/molecule/banner/index.js +9 -4
- package/es/molecule/banner/index.js.map +1 -1
- package/es/molecule/banner/style.css +41 -6
- package/es/molecule/card/index.js +5 -1
- package/es/molecule/card/index.js.map +1 -1
- package/es/molecule/card/selectable.css +49 -2
- package/es/molecule/card/selectable.js +10 -2
- package/es/molecule/card/selectable.js.map +1 -1
- package/es/molecule/cm-popin/index.js +12 -5
- package/es/molecule/cm-popin/index.js.map +1 -1
- package/es/molecule/cm-popin/style.css +28 -0
- package/es/molecule/dashboard/battle-request-list/index.js +3 -5
- package/es/molecule/dashboard/battle-request-list/index.js.map +1 -1
- package/es/molecule/dashboard/news-list/index.js +3 -5
- package/es/molecule/dashboard/news-list/index.js.map +1 -1
- package/es/molecule/dashboard/review-banner/index.js +3 -5
- package/es/molecule/dashboard/review-banner/index.js.map +1 -1
- package/es/molecule/dashboard/start-battle/index.js +3 -5
- package/es/molecule/dashboard/start-battle/index.js.map +1 -1
- package/es/molecule/external-content-viewer/index.js +2 -1
- package/es/molecule/external-content-viewer/index.js.map +1 -1
- package/es/molecule/go1-banner/index.js +56 -0
- package/es/molecule/go1-banner/index.js.map +1 -0
- package/es/molecule/go1-banner/style.css +90 -0
- package/es/molecule/questions/free-text/index.native.js +88 -0
- package/es/molecule/questions/free-text/index.native.js.map +1 -0
- package/es/molecule/questions/qcm/index.native.js +50 -0
- package/es/molecule/questions/qcm/index.native.js.map +1 -0
- package/es/molecule/review-card-congrats/index.js +2 -13
- package/es/molecule/review-card-congrats/index.js.map +1 -1
- package/es/molecule/review-card-congrats/prop-types.js +15 -0
- package/es/molecule/review-card-congrats/prop-types.js.map +1 -0
- package/es/molecule/review-correction-popin/index.js +2 -20
- package/es/molecule/review-correction-popin/index.js.map +1 -1
- package/es/molecule/review-correction-popin/prop-types.js +21 -0
- package/es/molecule/review-correction-popin/prop-types.js.map +1 -0
- package/es/molecule/review-header-steps/index.js +2 -4
- package/es/molecule/review-header-steps/index.js.map +1 -1
- package/es/molecule/review-header-steps/prop-types.js +6 -0
- package/es/molecule/review-header-steps/prop-types.js.map +1 -0
- package/es/molecule/skill-card/index.js +2 -12
- package/es/molecule/skill-card/index.js.map +1 -1
- package/es/molecule/skill-card/prop-types.js +13 -0
- package/es/molecule/skill-card/prop-types.js.map +1 -0
- package/es/molecule/video-player/index.js +2 -17
- package/es/molecule/video-player/index.js.map +1 -1
- package/es/molecule/video-player/jwplayer-prop-types.js +38 -0
- package/es/molecule/video-player/jwplayer-prop-types.js.map +1 -0
- package/es/molecule/video-player/jwplayer.js +2 -37
- package/es/molecule/video-player/jwplayer.js.map +1 -1
- package/es/molecule/video-player/prop-types.js +53 -0
- package/es/molecule/video-player/prop-types.js.map +1 -0
- package/es/organism/brand-dashboard/index.js +6 -3
- package/es/organism/brand-dashboard/index.js.map +1 -1
- package/es/organism/review-congrats/index.js +2 -19
- package/es/organism/review-congrats/index.js.map +1 -1
- package/es/organism/review-congrats/prop-types.js +22 -0
- package/es/organism/review-congrats/prop-types.js.map +1 -0
- package/es/organism/review-header/index.js +2 -10
- package/es/organism/review-header/index.js.map +1 -1
- package/es/organism/review-header/prop-types.js +12 -0
- package/es/organism/review-header/prop-types.js.map +1 -0
- package/es/organism/review-skills/index.js +4 -19
- package/es/organism/review-skills/index.js.map +1 -1
- package/es/organism/review-skills/prop-types.js +19 -0
- package/es/organism/review-skills/prop-types.js.map +1 -0
- package/es/template/app-player/loading/index.js +1 -0
- package/es/template/app-player/loading/index.js.map +1 -1
- package/es/template/app-review/demo-ts/index.js +2 -0
- package/es/template/app-review/demo-ts/index.js.map +1 -1
- package/es/template/app-review/demo-ts/index.native.js +9 -0
- package/es/template/app-review/demo-ts/index.native.js.map +1 -0
- package/es/template/app-review/demo-ts/typings.js +7 -0
- package/es/template/app-review/demo-ts/typings.js.map +1 -0
- package/es/template/app-review/index.js +4 -0
- package/es/template/app-review/index.js.map +1 -1
- package/es/template/app-review/index.native.js +24 -28
- package/es/template/app-review/index.native.js.map +1 -1
- package/es/template/app-review/onboarding/index.native.js +2 -2
- package/es/template/app-review/onboarding/index.native.js.map +1 -1
- package/es/template/app-review/skills/index.native.js +2 -2
- package/es/template/app-review/skills/index.native.js.map +1 -1
- package/es/template/app-review/slides/index.js +4 -5
- package/es/template/app-review/slides/index.js.map +1 -1
- package/es/template/app-review/slides/index.native.js +65 -25
- package/es/template/app-review/slides/index.native.js.map +1 -1
- package/es/template/app-review/slides/prop-types.js +15 -15
- package/es/template/app-review/slides/prop-types.js.map +1 -1
- package/es/template/app-review/template-context.js +33 -0
- package/es/template/app-review/template-context.js.map +1 -0
- package/es/variables/analytics.js +22 -0
- package/es/variables/analytics.js.map +1 -0
- package/es/variables/colors.css +4 -0
- package/es/variables/theme.native.js +65 -0
- package/es/variables/theme.native.js.map +1 -0
- package/es/variables/vibration.js +10 -0
- package/es/variables/vibration.js.map +1 -0
- package/lib/atom/content-badge/index.js +17 -4
- package/lib/atom/content-badge/index.js.map +1 -1
- package/lib/atom/content-badge/style.css +6 -0
- package/lib/atom/lottie-wrapper/index.js +6 -30
- package/lib/atom/lottie-wrapper/index.js.map +1 -1
- package/lib/atom/lottie-wrapper/prop-types.js +37 -0
- package/lib/atom/lottie-wrapper/prop-types.js.map +1 -0
- package/lib/atom/review-background/index.js +3 -5
- package/lib/atom/review-background/index.js.map +1 -1
- package/lib/atom/review-background/prop-types.js +14 -0
- package/lib/atom/review-background/prop-types.js.map +1 -0
- package/lib/atom/review-header-step-item/index.js +3 -7
- package/lib/atom/review-header-step-item/index.js.map +1 -1
- package/lib/atom/review-header-step-item/prop-types.js +16 -0
- package/lib/atom/review-header-step-item/prop-types.js.map +1 -0
- package/lib/atom/review-presentation/index.js +3 -15
- package/lib/atom/review-presentation/index.js.map +1 -1
- package/lib/atom/review-presentation/prop-types.js +28 -0
- package/lib/atom/review-presentation/prop-types.js.map +1 -0
- package/lib/atom/spinner/index.js +1 -0
- package/lib/atom/spinner/index.js.map +1 -1
- package/lib/atom/tab/index.js +1 -0
- package/lib/atom/tab/index.js.map +1 -1
- package/lib/hoc/touchable/index.native.js +74 -0
- package/lib/hoc/touchable/index.native.js.map +1 -0
- package/lib/molecule/answer/index.js +14 -35
- package/lib/molecule/answer/index.js.map +1 -1
- package/lib/molecule/answer/prop-types.js +49 -0
- package/lib/molecule/answer/prop-types.js.map +1 -0
- package/lib/molecule/banner/index.js +9 -4
- package/lib/molecule/banner/index.js.map +1 -1
- package/lib/molecule/banner/style.css +41 -6
- package/lib/molecule/card/index.js +3 -1
- package/lib/molecule/card/index.js.map +1 -1
- package/lib/molecule/card/selectable.css +49 -2
- package/lib/molecule/card/selectable.js +9 -1
- package/lib/molecule/card/selectable.js.map +1 -1
- package/lib/molecule/cm-popin/index.js +12 -5
- package/lib/molecule/cm-popin/index.js.map +1 -1
- package/lib/molecule/cm-popin/style.css +28 -0
- package/lib/molecule/dashboard/battle-request-list/index.js +3 -5
- package/lib/molecule/dashboard/battle-request-list/index.js.map +1 -1
- package/lib/molecule/dashboard/news-list/index.js +3 -5
- package/lib/molecule/dashboard/news-list/index.js.map +1 -1
- package/lib/molecule/dashboard/review-banner/index.js +3 -5
- package/lib/molecule/dashboard/review-banner/index.js.map +1 -1
- package/lib/molecule/dashboard/start-battle/index.js +3 -5
- package/lib/molecule/dashboard/start-battle/index.js.map +1 -1
- package/lib/molecule/external-content-viewer/index.js +2 -1
- package/lib/molecule/external-content-viewer/index.js.map +1 -1
- package/lib/molecule/go1-banner/index.js +67 -0
- package/lib/molecule/go1-banner/index.js.map +1 -0
- package/lib/molecule/go1-banner/style.css +90 -0
- package/lib/molecule/questions/free-text/index.native.js +101 -0
- package/lib/molecule/questions/free-text/index.native.js.map +1 -0
- package/lib/molecule/questions/qcm/index.native.js +62 -0
- package/lib/molecule/questions/qcm/index.native.js.map +1 -0
- package/lib/molecule/review-card-congrats/index.js +3 -14
- package/lib/molecule/review-card-congrats/index.js.map +1 -1
- package/lib/molecule/review-card-congrats/prop-types.js +25 -0
- package/lib/molecule/review-card-congrats/prop-types.js.map +1 -0
- package/lib/molecule/review-correction-popin/index.js +3 -21
- package/lib/molecule/review-correction-popin/index.js.map +1 -1
- package/lib/molecule/review-correction-popin/prop-types.js +30 -0
- package/lib/molecule/review-correction-popin/prop-types.js.map +1 -0
- package/lib/molecule/review-header-steps/index.js +3 -5
- package/lib/molecule/review-header-steps/index.js.map +1 -1
- package/lib/molecule/review-header-steps/prop-types.js +16 -0
- package/lib/molecule/review-header-steps/prop-types.js.map +1 -0
- package/lib/molecule/skill-card/index.js +3 -13
- package/lib/molecule/skill-card/index.js.map +1 -1
- package/lib/molecule/skill-card/prop-types.js +22 -0
- package/lib/molecule/skill-card/prop-types.js.map +1 -0
- package/lib/molecule/video-player/index.js +3 -19
- package/lib/molecule/video-player/index.js.map +1 -1
- package/lib/molecule/video-player/jwplayer-prop-types.js +48 -0
- package/lib/molecule/video-player/jwplayer-prop-types.js.map +1 -0
- package/lib/molecule/video-player/jwplayer.js +3 -39
- package/lib/molecule/video-player/jwplayer.js.map +1 -1
- package/lib/molecule/video-player/prop-types.js +64 -0
- package/lib/molecule/video-player/prop-types.js.map +1 -0
- package/lib/organism/brand-dashboard/index.js +7 -3
- package/lib/organism/brand-dashboard/index.js.map +1 -1
- package/lib/organism/review-congrats/index.js +3 -20
- package/lib/organism/review-congrats/index.js.map +1 -1
- package/lib/organism/review-congrats/prop-types.js +33 -0
- package/lib/organism/review-congrats/prop-types.js.map +1 -0
- package/lib/organism/review-header/index.js +3 -11
- package/lib/organism/review-header/index.js.map +1 -1
- package/lib/organism/review-header/prop-types.js +22 -0
- package/lib/organism/review-header/prop-types.js.map +1 -0
- package/lib/organism/review-skills/index.js +10 -23
- package/lib/organism/review-skills/index.js.map +1 -1
- package/lib/organism/review-skills/prop-types.js +33 -0
- package/lib/organism/review-skills/prop-types.js.map +1 -0
- package/lib/template/app-player/loading/index.js +1 -0
- package/lib/template/app-player/loading/index.js.map +1 -1
- package/lib/template/app-review/demo-ts/index.js +3 -0
- package/lib/template/app-review/demo-ts/index.js.map +1 -1
- package/lib/template/app-review/demo-ts/index.native.js +18 -0
- package/lib/template/app-review/demo-ts/index.native.js.map +1 -0
- package/lib/template/app-review/demo-ts/typings.js +16 -0
- package/lib/template/app-review/demo-ts/typings.js.map +1 -0
- package/lib/template/app-review/index.js +5 -0
- package/lib/template/app-review/index.js.map +1 -1
- package/lib/template/app-review/index.native.js +25 -26
- package/lib/template/app-review/index.native.js.map +1 -1
- package/lib/template/app-review/onboarding/index.native.js +2 -2
- package/lib/template/app-review/onboarding/index.native.js.map +1 -1
- package/lib/template/app-review/skills/index.native.js +4 -4
- package/lib/template/app-review/skills/index.native.js.map +1 -1
- package/lib/template/app-review/slides/index.js +4 -5
- package/lib/template/app-review/slides/index.js.map +1 -1
- package/lib/template/app-review/slides/index.native.js +76 -38
- package/lib/template/app-review/slides/index.native.js.map +1 -1
- package/lib/template/app-review/slides/prop-types.js +16 -16
- package/lib/template/app-review/slides/prop-types.js.map +1 -1
- package/lib/template/app-review/template-context.js +47 -0
- package/lib/template/app-review/template-context.js.map +1 -0
- package/lib/variables/analytics.js +27 -0
- package/lib/variables/analytics.js.map +1 -0
- package/lib/variables/colors.css +4 -0
- package/lib/variables/theme.native.js +70 -0
- package/lib/variables/theme.native.js.map +1 -0
- package/lib/variables/vibration.js +15 -0
- package/lib/variables/vibration.js.map +1 -0
- package/package.json +6 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/atom/tab/index.js"],"names":["Tab","onClick","links","title","targetContent","handleTabClick","style","tab","link","propTypes","PropTypes","string","arrayOf","objectOf","func"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;;;;;;;AAEA,MAAMA,GAAG,GAAG,CAAC;AAACC,EAAAA,OAAD;AAAUC,EAAAA,KAAV;AAAiBC,EAAAA,KAAjB;AAAwBC,EAAAA;AAAxB,CAAD,KAA4C;AACtD,QAAMC,cAAc,GAAG,oBAAQ,MAAM,MAAMJ,OAAO,CAACG,aAAD,CAA3B,EAA4C,CAACH,OAAD,EAAUG,aAAV,CAA5C,CAAvB;AAEA,sBACE;AAAK,IAAA,SAAS,EAAEE,eAAMC,
|
|
1
|
+
{"version":3,"sources":["../../../src/atom/tab/index.js"],"names":["Tab","onClick","links","title","targetContent","handleTabClick","style","tab","link","propTypes","PropTypes","string","arrayOf","objectOf","func"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;;;;;;;AAEA,MAAMA,GAAG,GAAG,CAAC;AAACC,EAAAA,OAAD;AAAUC,EAAAA,KAAV;AAAiBC,EAAAA,KAAjB;AAAwBC,EAAAA;AAAxB,CAAD,KAA4C;AACtD,QAAMC,cAAc,GAAG,oBAAQ,MAAM,MAAMJ,OAAO,CAACG,aAAD,CAA3B,EAA4C,CAACH,OAAD,EAAUG,aAAV,CAA5C,CAAvB;AAEA,sBACE;AAAK,iBAAU,KAAf;AAAqB,IAAA,SAAS,EAAEE,eAAMC,GAAtC;AAA2C,IAAA,OAAO,EAAEF;AAApD,kBACE;AAAK,IAAA,SAAS,EAAEC,eAAMH;AAAtB,KAA8BA,KAA9B,CADF,eAEE;AAAK,IAAA,SAAS,EAAEG,eAAME;AAAtB,KACG,mBACCA,IAAI,iBACF;AAAK,IAAA,GAAG,EAAEA,IAAI,CAACL;AAAf,KAAuBK,IAAI,CAACL,KAA5B,CAFH,EAICD,KAJD,CADH,CAFF,CADF;AAaD,CAhBD;;AAkBAF,GAAG,CAACS,SAAJ,2CAAgB;AACdN,EAAAA,KAAK,EAAEO,mBAAUC,MADH;AAEdT,EAAAA,KAAK,EAAEQ,mBAAUE,OAAV,CAAkBF,mBAAUG,QAAV,CAAmBH,mBAAUC,MAA7B,CAAlB,CAFO;AAGdV,EAAAA,OAAO,EAAES,mBAAUI,IAHL;AAIdV,EAAAA,aAAa,EAAEM,mBAAUC;AAJX,CAAhB;eAOeX,G","sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport {map} from 'lodash/fp';\nimport style from './style.css';\n\nconst Tab = ({onClick, links, title, targetContent}) => {\n const handleTabClick = useMemo(() => () => onClick(targetContent), [onClick, targetContent]);\n\n return (\n <div data-name=\"tab\" className={style.tab} onClick={handleTabClick}>\n <div className={style.title}>{title}</div>\n <div className={style.link}>\n {map(\n link => (\n <div key={link.title}>{link.title}</div>\n ),\n links\n )}\n </div>\n </div>\n );\n};\n\nTab.propTypes = {\n title: PropTypes.string,\n links: PropTypes.arrayOf(PropTypes.objectOf(PropTypes.string)),\n onClick: PropTypes.func,\n targetContent: PropTypes.string\n};\n\nexport default Tab;\n"],"file":"index.js"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
|
|
6
|
+
var _reactNative = require("react-native");
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
|
|
10
|
+
var _templateContext = require("../../template/app-review/template-context");
|
|
11
|
+
|
|
12
|
+
var _analytics = require("../../variables/analytics");
|
|
13
|
+
|
|
14
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
|
15
|
+
|
|
16
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
|
+
|
|
18
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
19
|
+
|
|
20
|
+
const logEvent = (eventName, analyticsID, analytics, analyticsParams) => {
|
|
21
|
+
analytics && analytics.logEvent(eventName, _extends(_extends({}, analyticsParams || {}), {}, {
|
|
22
|
+
id: analyticsID
|
|
23
|
+
}));
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const Touchable = props => {
|
|
27
|
+
const templateContext = (0, _templateContext.useTemplateContext)();
|
|
28
|
+
const {
|
|
29
|
+
theme,
|
|
30
|
+
vibration,
|
|
31
|
+
analytics
|
|
32
|
+
} = templateContext;
|
|
33
|
+
const {
|
|
34
|
+
analyticsID,
|
|
35
|
+
analyticsParams,
|
|
36
|
+
onPress,
|
|
37
|
+
onLongPress,
|
|
38
|
+
isWithoutFeedback,
|
|
39
|
+
isHighlight,
|
|
40
|
+
activeOpacity,
|
|
41
|
+
disabled
|
|
42
|
+
} = props;
|
|
43
|
+
const handlePress = (0, _react.useMemo)(() => event => {
|
|
44
|
+
if (!onPress) return;
|
|
45
|
+
vibration?.vibrate();
|
|
46
|
+
analytics && logEvent(_analytics.ANALYTICS_EVENT_TYPE.PRESS, analyticsID, analytics, analyticsParams);
|
|
47
|
+
onPress(event);
|
|
48
|
+
}, [analytics, analyticsID, analyticsParams, onPress, vibration]);
|
|
49
|
+
const handleLongPress = (0, _react.useMemo)(() => event => {
|
|
50
|
+
if (!onLongPress) return;
|
|
51
|
+
vibration?.vibrate();
|
|
52
|
+
analytics && logEvent(_analytics.ANALYTICS_EVENT_TYPE.LONG_PRESS, analyticsID, analytics, analyticsParams);
|
|
53
|
+
onLongPress(event);
|
|
54
|
+
}, [analytics, analyticsID, analyticsParams, onLongPress, vibration]);
|
|
55
|
+
|
|
56
|
+
if (isHighlight) {
|
|
57
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.TouchableHighlight, _extends({}, props, {
|
|
58
|
+
underlayColor: theme.colors.gray.light,
|
|
59
|
+
onPress: handlePress,
|
|
60
|
+
onLongPress: handleLongPress,
|
|
61
|
+
activeOpacity: activeOpacity || (disabled ? 1 : 0.85)
|
|
62
|
+
}));
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, _extends({}, props, {
|
|
66
|
+
onPress: handlePress,
|
|
67
|
+
onLongPress: handleLongPress,
|
|
68
|
+
activeOpacity: isWithoutFeedback && 1 || activeOpacity || (disabled ? 1 : 0.2)
|
|
69
|
+
}));
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
var _default = Touchable;
|
|
73
|
+
exports.default = _default;
|
|
74
|
+
//# sourceMappingURL=index.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/hoc/touchable/index.native.tsx"],"names":["logEvent","eventName","analyticsID","analytics","analyticsParams","id","Touchable","props","templateContext","theme","vibration","onPress","onLongPress","isWithoutFeedback","isHighlight","activeOpacity","disabled","handlePress","event","vibrate","ANALYTICS_EVENT_TYPE","PRESS","handleLongPress","LONG_PRESS","colors","gray","light"],"mappings":";;;;;AAAA;;AAQA;;AACA;;AACA;;;;;;;;AAgCA,MAAMA,QAAQ,GAAG,CACfC,SADe,EAEfC,WAFe,EAGfC,SAHe,EAIfC,eAJe,KAKZ;AACHD,EAAAA,SAAS,IACPA,SAAS,CAACH,QAAV,CAAmBC,SAAnB,wBACMG,eAAe,IAAI,EADzB;AAEEC,IAAAA,EAAE,EAAEH;AAFN,KADF;AAKD,CAXD;;AAaA,MAAMI,SAAS,GAAIC,KAAD,IAAkB;AAClC,QAAMC,eAAe,GAAG,0CAAxB;AAEA,QAAM;AAACC,IAAAA,KAAD;AAAQC,IAAAA,SAAR;AAAmBP,IAAAA;AAAnB,MAAgCK,eAAtC;AAEA,QAAM;AACJN,IAAAA,WADI;AAEJE,IAAAA,eAFI;AAGJO,IAAAA,OAHI;AAIJC,IAAAA,WAJI;AAKJC,IAAAA,iBALI;AAMJC,IAAAA,WANI;AAOJC,IAAAA,aAPI;AAQJC,IAAAA;AARI,MASFT,KATJ;AAWA,QAAMU,WAAW,GAAG,oBAClB,MAAOC,KAAD,IAAuB;AAC3B,QAAI,CAACP,OAAL,EAAc;AAEdD,IAAAA,SAAS,EAAES,OAAX;AAE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\n FocusEvent,\n PressEvent\n} from 'react-native/Libraries/Types/CoreEventTypes';\n\nimport React, {useMemo} from 'react';\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {ANALYTICS_EVENT_TYPE, Analytics, AnalyticsEventParams} from '../../variables/analytics';\nimport {Vibration} from '../../variables/vibration';\n\nexport type Props = {\n accessible?: boolean;\n children?: React.ReactNode;\n delayLongPress?: number;\n delayPressIn?: number;\n delayPressOut?: number;\n disabled?: boolean;\n focusable?: boolean;\n hitSlop?: number /* TODO: fix type EdgeInsetsProp,*/;\n onBlur?: (event: BlurEvent) => any;\n onFocus?: (event: FocusEvent) => any;\n onLayout?: (event: LayoutEvent) => any;\n onLongPress?: (event: PressEvent) => any;\n onPress?: (event: PressEvent) => any;\n onPressIn?: (event: PressEvent) => any;\n onPressOut?: (event: PressEvent) => any;\n testID?: string;\n isHighlight?: boolean;\n isWithoutFeedback?: boolean;\n // for TouchableOpacity\n activeOpacity?: number;\n style?: ViewStyle;\n // Analytics\n analytics?: Analytics;\n analyticsID: string;\n analyticsParams?: AnalyticsEventParams;\n vibration?: Vibration;\n};\n\nconst logEvent = (\n eventName: string,\n analyticsID: String,\n analytics: Analytics,\n analyticsParams: AnalyticsEventParams | undefined\n) => {\n analytics &&\n analytics.logEvent(eventName, {\n ...(analyticsParams || {}),\n id: analyticsID\n });\n};\n\nconst Touchable = (props: Props) => {\n const templateContext = useTemplateContext();\n\n const {theme, vibration, analytics} = templateContext;\n\n const {\n analyticsID,\n analyticsParams,\n onPress,\n onLongPress,\n isWithoutFeedback,\n isHighlight,\n activeOpacity,\n disabled\n } = props;\n\n const handlePress = useMemo(\n () => (event: PressEvent) => {\n if (!onPress) return;\n\n vibration?.vibrate();\n\n analytics && logEvent(ANALYTICS_EVENT_TYPE.PRESS, analyticsID, analytics, analyticsParams);\n onPress(event);\n },\n [analytics, analyticsID, analyticsParams, onPress, vibration]\n );\n\n const handleLongPress = useMemo(\n () => (event: PressEvent) => {\n if (!onLongPress) return;\n\n vibration?.vibrate();\n\n analytics &&\n logEvent(ANALYTICS_EVENT_TYPE.LONG_PRESS, analyticsID, analytics, analyticsParams);\n onLongPress(event);\n },\n [analytics, analyticsID, analyticsParams, onLongPress, vibration]\n );\n\n if (isHighlight) {\n return (\n <TouchableHighlight\n {...props}\n underlayColor={theme.colors.gray.light}\n onPress={handlePress}\n onLongPress={handleLongPress}\n activeOpacity={activeOpacity || (disabled ? 1 : 0.85)}\n />\n );\n }\n\n return (\n <TouchableOpacity\n {...props}\n onPress={handlePress}\n onLongPress={handleLongPress}\n activeOpacity={(isWithoutFeedback && 1) || activeOpacity || (disabled ? 1 : 0.2)}\n />\n );\n};\n\nexport default Touchable;\n"],"file":"index.native.js"}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.default =
|
|
4
|
+
exports.default = void 0;
|
|
5
5
|
|
|
6
6
|
var _omit2 = _interopRequireDefault(require("lodash/fp/omit"));
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
10
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
|
|
12
10
|
var _videoPlayer = _interopRequireDefault(require("../video-player"));
|
|
13
11
|
|
|
14
12
|
var _dropDown = _interopRequireDefault(require("../questions/drop-down"));
|
|
@@ -29,19 +27,18 @@ var _audio = _interopRequireDefault(require("../audio"));
|
|
|
29
27
|
|
|
30
28
|
var _style = _interopRequireDefault(require("./style.css"));
|
|
31
29
|
|
|
30
|
+
var _propTypes = _interopRequireWildcard(require("./prop-types"));
|
|
31
|
+
|
|
32
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
|
33
|
+
|
|
34
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
35
|
+
|
|
32
36
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
33
37
|
|
|
34
38
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
35
39
|
|
|
36
40
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
37
41
|
|
|
38
|
-
const TYPE_IMAGE = 'img';
|
|
39
|
-
exports.TYPE_IMAGE = TYPE_IMAGE;
|
|
40
|
-
const TYPE_VIDEO = 'video';
|
|
41
|
-
exports.TYPE_VIDEO = TYPE_VIDEO;
|
|
42
|
-
const TYPE_AUDIO = 'audio';
|
|
43
|
-
exports.TYPE_AUDIO = TYPE_AUDIO;
|
|
44
|
-
|
|
45
42
|
const MediaView = ({
|
|
46
43
|
media
|
|
47
44
|
}) => {
|
|
@@ -52,7 +49,7 @@ const MediaView = ({
|
|
|
52
49
|
childProps = _objectWithoutPropertiesLoose(media, ["videoId", "type"]);
|
|
53
50
|
|
|
54
51
|
switch (type) {
|
|
55
|
-
case TYPE_IMAGE:
|
|
52
|
+
case _propTypes.TYPE_IMAGE:
|
|
56
53
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
57
54
|
className: _style.default.media,
|
|
58
55
|
style: {
|
|
@@ -60,7 +57,7 @@ const MediaView = ({
|
|
|
60
57
|
}
|
|
61
58
|
});
|
|
62
59
|
|
|
63
|
-
case TYPE_VIDEO:
|
|
60
|
+
case _propTypes.TYPE_VIDEO:
|
|
64
61
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
65
62
|
className: _style.default.video
|
|
66
63
|
}, /*#__PURE__*/_react.default.createElement(_videoPlayer.default, _extends({}, (0, _omit2.default)('id', childProps), {
|
|
@@ -69,7 +66,7 @@ const MediaView = ({
|
|
|
69
66
|
width: "100%"
|
|
70
67
|
})));
|
|
71
68
|
|
|
72
|
-
case TYPE_AUDIO:
|
|
69
|
+
case _propTypes.TYPE_AUDIO:
|
|
73
70
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
74
71
|
className: _style.default.audio
|
|
75
72
|
}, /*#__PURE__*/_react.default.createElement(_audio.default, _extends({}, (0, _omit2.default)('id', childProps), {
|
|
@@ -82,21 +79,7 @@ const MediaView = ({
|
|
|
82
79
|
}
|
|
83
80
|
};
|
|
84
81
|
|
|
85
|
-
|
|
86
|
-
const videoPropType = process.env.NODE_ENV !== "production" ? _propTypes.default.shape(_extends(_extends({}, _videoPlayer.default.propTypes), {}, {
|
|
87
|
-
type: isType(TYPE_VIDEO).isRequired
|
|
88
|
-
})) : {};
|
|
89
|
-
const imgPropType = process.env.NODE_ENV !== "production" ? _propTypes.default.shape({
|
|
90
|
-
type: isType(TYPE_IMAGE).isRequired,
|
|
91
|
-
url: _propTypes.default.string.isRequired
|
|
92
|
-
}) : {};
|
|
93
|
-
const audioPropType = process.env.NODE_ENV !== "production" ? _propTypes.default.shape({
|
|
94
|
-
type: isType(TYPE_AUDIO).isRequired,
|
|
95
|
-
mediaUrl: _propTypes.default.string.isRequired
|
|
96
|
-
}) : {};
|
|
97
|
-
MediaView.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
98
|
-
media: _propTypes.default.oneOfType([videoPropType, imgPropType, audioPropType])
|
|
99
|
-
} : {};
|
|
82
|
+
MediaView.propTypes = process.env.NODE_ENV !== "production" ? _propTypes.MediaViewPropTypes : {};
|
|
100
83
|
|
|
101
84
|
const Answer = props => {
|
|
102
85
|
const {
|
|
@@ -106,6 +89,8 @@ const Answer = props => {
|
|
|
106
89
|
} = props;
|
|
107
90
|
|
|
108
91
|
const buildAnswer = () => {
|
|
92
|
+
// (propTypes model.type is properly defined)
|
|
93
|
+
// eslint-disable-next-line react/prop-types
|
|
109
94
|
const {
|
|
110
95
|
type
|
|
111
96
|
} = model;
|
|
@@ -145,13 +130,7 @@ const Answer = props => {
|
|
|
145
130
|
}) : null, answerView);
|
|
146
131
|
};
|
|
147
132
|
|
|
148
|
-
Answer.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
149
|
-
model: _propTypes.default.shape({
|
|
150
|
-
type: _propTypes.default.oneOf(['qcmDrag', 'qcm', 'qcmGraphic', 'freeText', 'dropDown', 'slider', 'template']).isRequired
|
|
151
|
-
}),
|
|
152
|
-
help: _propTypes.default.string,
|
|
153
|
-
media: MediaView.propTypes.media
|
|
154
|
-
} : {};
|
|
133
|
+
Answer.propTypes = process.env.NODE_ENV !== "production" ? _propTypes.default : {};
|
|
155
134
|
var _default = Answer;
|
|
156
135
|
exports.default = _default;
|
|
157
136
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/molecule/answer/index.js"],"names":["
|
|
1
|
+
{"version":3,"sources":["../../../src/molecule/answer/index.js"],"names":["MediaView","media","videoId","type","childProps","TYPE_IMAGE","style","backgroundImage","url","TYPE_VIDEO","video","TYPE_AUDIO","audio","propTypes","MediaViewPropTypes","Answer","props","model","help","buildAnswer","answerView","wrapper"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAC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P;;AACF,WAAK,KAAL;AACE,4BAAO,6BAAC,YAAD,EAASD,KAAT,CAAP;;AACF,WAAK,YAAL;AACE,4BAAO,6BAAC,mBAAD,EAAgBA,KAAhB,CAAP;;AACF,WAAK,UAAL;AACE,4BAAO,6BAAC,iBAAD,EAAcA,KAAd,CAAP;;AACF,WAAK,UAAL;AACE,4BAAO,6BAAC,iBAAD,EAAcA,KAAd,CAAP;;AACF,WAAK,QAAL;AACE,4BAAO,6BAAC,sBAAD,EAAmBA,KAAnB,CAAP;;AACF,WAAK,UAAL;AACE,4BAAO,6BAAC,iBAAD,EAAcA,KAAd,CAAP;AAdJ;AAgBD,GArBD;;AAsBA,QAAMG,UAAU,GAAGD,WAAW,CAACF,KAAD,CAA9B;AAEA,sBACE;AAAK,iBAAU,QAAf;AAAwB,IAAA,SAAS,EAAEX,eAAMe;AAAzC,KACGpB,KAAK,gBAAG,6BAAC,SAAD;AAAW,IAAA,KAAK,EAAEA;AAAlB,IAAH,GAAiC,IADzC,EAEGmB,UAFH,CADF;AAMD,CAhCD;;AAkCAL,MAAM,CAACF,SAAP,2CAAmBA,kBAAnB;eAEeE,M","sourcesContent":["import React from 'react';\nimport {omit} from 'lodash/fp';\nimport VideoPlayer from '../video-player';\nimport DropDown from '../questions/drop-down';\nimport FreeText from '../questions/free-text';\nimport QcmDrag from '../questions/qcm-drag';\nimport Qcm from '../questions/qcm';\nimport QcmGraphic from '../questions/qcm-graphic';\nimport QuestionRange from '../questions/question-range';\nimport Template from '../questions/template';\nimport Audio from '../audio';\nimport style from './style.css';\nimport propTypes, {MediaViewPropTypes, TYPE_AUDIO, TYPE_IMAGE, TYPE_VIDEO} from './prop-types';\n\nconst MediaView = ({media}) => {\n const {videoId, type, ...childProps} = media;\n switch (type) {\n case TYPE_IMAGE:\n return (\n <div\n className={style.media}\n style={{\n backgroundImage: `url(${media.url})`\n }}\n />\n );\n case TYPE_VIDEO:\n return (\n <div className={style.video}>\n <VideoPlayer {...omit('id', childProps)} id={videoId} height=\"100%\" width=\"100%\" />\n </div>\n );\n case TYPE_AUDIO:\n return (\n <div className={style.audio}>\n <Audio {...omit('id', childProps)} height=\"100%\" width=\"100%\" />\n </div>\n );\n default:\n return null;\n }\n};\n\nMediaView.propTypes = MediaViewPropTypes;\n\nconst Answer = props => {\n const {model, media, help} = props;\n const buildAnswer = () => {\n // (propTypes model.type is properly defined)\n // eslint-disable-next-line react/prop-types\n const {type} = model;\n\n switch (type) {\n case 'qcmDrag':\n return <QcmDrag {...model} help={help} />;\n case 'qcm':\n return <Qcm {...model} />;\n case 'qcmGraphic':\n return <QcmGraphic {...model} />;\n case 'freeText':\n return <FreeText {...model} />;\n case 'dropDown':\n return <DropDown {...model} />;\n case 'slider':\n return <QuestionRange {...model} />;\n case 'template':\n return <Template {...model} />;\n }\n };\n const answerView = buildAnswer(model);\n\n return (\n <div data-name=\"answer\" className={style.wrapper}>\n {media ? <MediaView media={media} /> : null}\n {answerView}\n </div>\n );\n};\n\nAnswer.propTypes = propTypes;\n\nexport default Answer;\n"],"file":"index.js"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = exports.MediaViewPropTypes = exports.TYPE_AUDIO = exports.TYPE_VIDEO = exports.TYPE_IMAGE = void 0;
|
|
5
|
+
|
|
6
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
7
|
+
|
|
8
|
+
var _propTypes2 = _interopRequireDefault(require("../video-player/prop-types"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
12
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
13
|
+
|
|
14
|
+
const TYPE_IMAGE = 'img';
|
|
15
|
+
exports.TYPE_IMAGE = TYPE_IMAGE;
|
|
16
|
+
const TYPE_VIDEO = 'video';
|
|
17
|
+
exports.TYPE_VIDEO = TYPE_VIDEO;
|
|
18
|
+
const TYPE_AUDIO = 'audio';
|
|
19
|
+
exports.TYPE_AUDIO = TYPE_AUDIO;
|
|
20
|
+
|
|
21
|
+
const isType = name => _propTypes.default.oneOf([name]);
|
|
22
|
+
|
|
23
|
+
const videoPropType = _propTypes.default.shape(_extends(_extends({}, _propTypes2.default), {}, {
|
|
24
|
+
type: isType(TYPE_VIDEO).isRequired
|
|
25
|
+
}));
|
|
26
|
+
|
|
27
|
+
const imgPropType = _propTypes.default.shape({
|
|
28
|
+
type: isType(TYPE_IMAGE).isRequired,
|
|
29
|
+
url: _propTypes.default.string.isRequired
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
const audioPropType = _propTypes.default.shape({
|
|
33
|
+
type: isType(TYPE_AUDIO).isRequired,
|
|
34
|
+
mediaUrl: _propTypes.default.string.isRequired
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
const MediaViewPropTypes = {
|
|
38
|
+
media: _propTypes.default.oneOfType([videoPropType, imgPropType, audioPropType])
|
|
39
|
+
};
|
|
40
|
+
exports.MediaViewPropTypes = MediaViewPropTypes;
|
|
41
|
+
var _default = {
|
|
42
|
+
model: _propTypes.default.shape({
|
|
43
|
+
type: _propTypes.default.oneOf(['qcmDrag', 'qcm', 'qcmGraphic', 'freeText', 'dropDown', 'slider', 'template']).isRequired
|
|
44
|
+
}),
|
|
45
|
+
help: _propTypes.default.string,
|
|
46
|
+
media: MediaViewPropTypes.media
|
|
47
|
+
};
|
|
48
|
+
exports.default = _default;
|
|
49
|
+
//# sourceMappingURL=prop-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/molecule/answer/prop-types.js"],"names":["TYPE_IMAGE","TYPE_VIDEO","TYPE_AUDIO","isType","name","PropTypes","oneOf","videoPropType","shape","VideoPlayerPropTypes","type","isRequired","imgPropType","url","string","audioPropType","mediaUrl","MediaViewPropTypes","media","oneOfType","model","help"],"mappings":";;;;;AAAA;;AACA;;;;;;AAEO,MAAMA,UAAU,GAAG,KAAnB;;AACA,MAAMC,UAAU,GAAG,OAAnB;;AACA,MAAMC,UAAU,GAAG,OAAnB;;;AAEP,MAAMC,MAAM,GAAGC,IAAI,IAAIC,mBAAUC,KAAV,CAAgB,CAACF,IAAD,CAAhB,CAAvB;;AAEA,MAAMG,aAAa,GAAGF,mBAAUG,KAAV,uBACjBC,mBADiB;AAEpBC,EAAAA,IAAI,EAAEP,MAAM,CAACF,UAAD,CAAN,CAAmBU;AAFL,GAAtB;;AAKA,MAAMC,WAAW,GAAGP,mBAAUG,KAAV,CAAgB;AAClCE,EAAAA,IAAI,EAAEP,MAAM,CAACH,UAAD,CAAN,CAAmBW,UADS;AAElCE,EAAAA,GAAG,EAAER,mBAAUS,MAAV,CAAiBH;AAFY,CAAhB,CAApB;;AAKA,MAAMI,aAAa,GAAGV,mBAAUG,KAAV,CAAgB;AACpCE,EAAAA,IAAI,EAAEP,MAAM,CAACD,UAAD,CAAN,CAAmBS,UADW;AAEpCK,EAAAA,QAAQ,EAAEX,mBAAUS,MAAV,CAAiBH;AAFS,CAAhB,CAAtB;;AAKO,MAAMM,kBAAkB,GAAG;AAChCC,EAAAA,KAAK,EAAEb,mBAAUc,SAAV,CAAoB,CAACZ,aAAD,EAAgBK,WAAhB,EAA6BG,aAA7B,CAApB;AADyB,CAA3B;;eAIQ;AACbK,EAAAA,KAAK,EAAEf,mBAAUG,KAAV,CAAgB;AACrBE,IAAAA,IAAI,EAAEL,mBAAUC,KAAV,CAAgB,CACpB,SADoB,EAEpB,KAFoB,EAGpB,YAHoB,EAIpB,UAJoB,EAKpB,UALoB,EAMpB,QANoB,EAOpB,UAPoB,CAAhB,EAQHK;AATkB,GAAhB,CADM;AAYbU,EAAAA,IAAI,EAAEhB,mBAAUS,MAZH;AAabI,EAAAA,KAAK,EAAED,kBAAkB,CAACC;AAbb,C","sourcesContent":["import PropTypes from 'prop-types';\nimport VideoPlayerPropTypes from '../video-player/prop-types';\n\nexport const TYPE_IMAGE = 'img';\nexport const TYPE_VIDEO = 'video';\nexport const TYPE_AUDIO = 'audio';\n\nconst isType = name => PropTypes.oneOf([name]);\n\nconst videoPropType = PropTypes.shape({\n ...VideoPlayerPropTypes,\n type: isType(TYPE_VIDEO).isRequired\n});\n\nconst imgPropType = PropTypes.shape({\n type: isType(TYPE_IMAGE).isRequired,\n url: PropTypes.string.isRequired\n});\n\nconst audioPropType = PropTypes.shape({\n type: isType(TYPE_AUDIO).isRequired,\n mediaUrl: PropTypes.string.isRequired\n});\n\nexport const MediaViewPropTypes = {\n media: PropTypes.oneOfType([videoPropType, imgPropType, audioPropType])\n};\n\nexport default {\n model: PropTypes.shape({\n type: PropTypes.oneOf([\n 'qcmDrag',\n 'qcm',\n 'qcmGraphic',\n 'freeText',\n 'dropDown',\n 'slider',\n 'template'\n ]).isRequired\n }),\n help: PropTypes.string,\n media: MediaViewPropTypes.media\n};\n"],"file":"prop-types.js"}
|
|
@@ -24,6 +24,11 @@ const ICONS = {
|
|
|
24
24
|
error: _novaIcons.NovaSolidInterfaceFeedbackInterfaceAlertDiamond,
|
|
25
25
|
warning: _novaIcons.NovaSolidInterfaceFeedbackInterfaceAlertDiamond
|
|
26
26
|
};
|
|
27
|
+
const STYLES = {
|
|
28
|
+
success: _style.default.success,
|
|
29
|
+
error: _style.default.error,
|
|
30
|
+
warning: _style.default.warning
|
|
31
|
+
};
|
|
27
32
|
|
|
28
33
|
const Banner = props => {
|
|
29
34
|
const {
|
|
@@ -40,7 +45,7 @@ const Banner = props => {
|
|
|
40
45
|
const Icon = ICONS[type];
|
|
41
46
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
42
47
|
key: bannerKey,
|
|
43
|
-
className: (0, _classnames.default)(_style.default.banner, type
|
|
48
|
+
className: (0, _classnames.default)(_style.default.banner, STYLES[type], temporary && _style.default.temporaryBanner),
|
|
44
49
|
onAnimationEnd: onEnd,
|
|
45
50
|
title: message
|
|
46
51
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -49,7 +54,7 @@ const Banner = props => {
|
|
|
49
54
|
}, /*#__PURE__*/_react.default.createElement(Icon, {
|
|
50
55
|
className: (0, _classnames.default)(_style.default.icon, temporary && _style.default.temporaryIcon)
|
|
51
56
|
}), message), firstCTALabel ? /*#__PURE__*/_react.default.createElement("div", {
|
|
52
|
-
className: _style.default.button
|
|
57
|
+
className: (0, _classnames.default)(_style.default.button, STYLES[type])
|
|
53
58
|
}, /*#__PURE__*/_react.default.createElement(_buttonLink.default, {
|
|
54
59
|
"data-name": "first-banner-cta",
|
|
55
60
|
"aria-label": firstCTALabel,
|
|
@@ -57,9 +62,9 @@ const Banner = props => {
|
|
|
57
62
|
onClick: firstCTA,
|
|
58
63
|
type: "text"
|
|
59
64
|
})) : null, firstCTALabel && secondCTALabel ? /*#__PURE__*/_react.default.createElement("div", {
|
|
60
|
-
className: _style.default.buttonsBar
|
|
65
|
+
className: (0, _classnames.default)(_style.default.buttonsBar, STYLES[type])
|
|
61
66
|
}) : null, secondCTALabel ? /*#__PURE__*/_react.default.createElement("div", {
|
|
62
|
-
className: _style.default.button
|
|
67
|
+
className: (0, _classnames.default)(_style.default.button, STYLES[type])
|
|
63
68
|
}, /*#__PURE__*/_react.default.createElement(_buttonLink.default, {
|
|
64
69
|
"data-name": "second-banner-cta",
|
|
65
70
|
onClick: secondCTA,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/molecule/banner/index.js"],"names":["ICONS","success","ValidateIcon","error","QuestionIcon","warning","Banner","props","type","message","firstCTA","firstCTALabel","secondCTALabel","secondCTA","temporary","bannerKey","onEnd","Icon","
|
|
1
|
+
{"version":3,"sources":["../../../src/molecule/banner/index.js"],"names":["ICONS","success","ValidateIcon","error","QuestionIcon","warning","STYLES","style","Banner","props","type","message","firstCTA","firstCTALabel","secondCTALabel","secondCTA","temporary","bannerKey","onEnd","Icon","banner","temporaryBanner","icon","temporaryIcon","button","buttonsBar","propTypes","PropTypes","string","oneOf","isRequired","func","bool"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAEA;;AAIA;;AACA;;;;AAEA,MAAMA,KAAK,GAAG;AACZC,EAAAA,OAAO,EAAEC,8CADG;AAEZC,EAAAA,KAAK,EAAEC,0DAFK;AAGZC,EAAAA,OAAO,EAAED;AAHG,CAAd;AAMA,MAAME,MAAM,GAAG;AACbL,EAAAA,OAAO,EAAEM,eAAMN,OADF;AAEbE,EAAAA,KAAK,EAAEI,eAAMJ,KAFA;AAGbE,EAAAA,OAAO,EAAEE,eAAMF;AAHF,CAAf;;AAMA,MAAMG,MAAM,GAAGC,KAAK,IAAI;AACtB,QAAM;AACJC,IAAAA,IADI;AAEJC,IAAAA,OAFI;AAGJC,IAAAA,QAHI;AAIJC,IAAAA,aAJI;AAKJC,IAAAA,cALI;AAMJC,IAAAA,SANI;AAOJC,IAAAA,SAPI;AAQJC,IAAAA,SARI;AASJC,IAAAA;AATI,MAUFT,KAVJ;AAWA,QAAMU,IAAI,GAAGnB,KAAK,CAACU,IAAD,CAAlB;AACA,sBACE;AACE,IAAA,GAAG,EAAEO,SADP;AAEE,IAAA,SAAS,EAAE,yBAAWV,eAAMa,MAAjB,EAAyBd,MAAM,CAACI,IAAD,CAA/B,EAAuCM,SAAS,IAAIT,eAAMc,eAA1D,CAFb;AAGE,IAAA,cAAc,EAAEH,KAHlB;AAIE,IAAA,KAAK,EAAEP;AAJT,kBAME;AAAK,iBAAY,GAAED,IAAK,iBAAxB;AAA0C,IAAA,SAAS,EAAEH,eAAMI;AAA3D,kBACE,6BAAC,IAAD;AAAM,IAAA,SAAS,EAAE,yBAAWJ,eAAMe,IAAjB,EAAuBN,SAAS,IAAIT,eAAMgB,aAA1C;AAAjB,IADF,EAEGZ,OAFH,CANF,EAUGE,aAAa,gBACZ;AAAK,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prop-types';\nimport classnames from 'classnames';\nimport {keys} from 'lodash/fp';\nimport {\n NovaSolidInterfaceFeedbackInterfaceAlertDiamond as QuestionIcon,\n NovaCompositionCoorpacademyValidate as ValidateIcon\n} from '@coorpacademy/nova-icons';\nimport Link from '../../atom/button-link';\nimport style from './style.css';\n\nconst ICONS = {\n success: ValidateIcon,\n error: QuestionIcon,\n warning: QuestionIcon\n};\n\nconst STYLES = {\n success: style.success,\n error: style.error,\n warning: style.warning\n};\n\nconst Banner = props => {\n const {\n type,\n message,\n firstCTA,\n firstCTALabel,\n secondCTALabel,\n secondCTA,\n temporary,\n bannerKey,\n onEnd\n } = props;\n const Icon = ICONS[type];\n return (\n <div\n key={bannerKey}\n className={classnames(style.banner, STYLES[type], temporary && style.temporaryBanner)}\n onAnimationEnd={onEnd}\n title={message}\n >\n <div data-name={`${type}-banner-message`} className={style.message}>\n <Icon className={classnames(style.icon, temporary && style.temporaryIcon)} />\n {message}\n </div>\n {firstCTALabel ? (\n <div className={classnames(style.button, STYLES[type])}>\n <Link\n data-name=\"first-banner-cta\"\n aria-label={firstCTALabel}\n label={firstCTALabel}\n onClick={firstCTA}\n type=\"text\"\n />\n </div>\n ) : null}\n {firstCTALabel && secondCTALabel ? (\n <div className={classnames(style.buttonsBar, STYLES[type])} />\n ) : null}\n {secondCTALabel ? (\n <div className={classnames(style.button, STYLES[type])}>\n <Link\n data-name=\"second-banner-cta\"\n onClick={secondCTA}\n aria-label={secondCTALabel}\n label={secondCTALabel}\n type=\"text\"\n />\n </div>\n ) : null}\n </div>\n );\n};\n\nBanner.propTypes = {\n bannerKey: PropTypes.string,\n type: PropTypes.oneOf(keys(ICONS)),\n message: PropTypes.string.isRequired,\n firstCTA: PropTypes.func,\n firstCTALabel: PropTypes.string,\n secondCTALabel: PropTypes.string,\n secondCTA: PropTypes.func,\n temporary: PropTypes.bool,\n onEnd: PropTypes.func\n};\n\nexport default Banner;\n"],"file":"index.js"}
|
|
@@ -36,16 +36,19 @@
|
|
|
36
36
|
gap: 8px;
|
|
37
37
|
padding: 16px 24px;
|
|
38
38
|
border-radius: 5px;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.banner.warning {
|
|
39
42
|
background-color: cm_warning_50;
|
|
40
43
|
color: cm_yellow_200;
|
|
41
|
-
border-radius: 5px;
|
|
42
44
|
}
|
|
43
45
|
|
|
44
|
-
.
|
|
46
|
+
.banner.error {
|
|
45
47
|
background-color: cm_negative_50;
|
|
46
48
|
color: cm_negative_200;
|
|
47
49
|
}
|
|
48
|
-
|
|
50
|
+
|
|
51
|
+
.banner.success {
|
|
49
52
|
background-color: color(cm_positive_100 a(15%));
|
|
50
53
|
color: cm_positive_100;
|
|
51
54
|
}
|
|
@@ -71,22 +74,54 @@
|
|
|
71
74
|
|
|
72
75
|
.button{
|
|
73
76
|
background-color: transparent;
|
|
74
|
-
color: cm_yellow_200;
|
|
75
77
|
white-space: nowrap;
|
|
76
78
|
}
|
|
77
79
|
|
|
78
|
-
.button
|
|
79
|
-
color:
|
|
80
|
+
.button.warning {
|
|
81
|
+
color: cm_yellow_200;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.button.warning:hover {
|
|
85
|
+
color: color(cm_yellow_200 blackness(+12%));
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.button.error {
|
|
89
|
+
color: cm_negative_200;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.button.error:hover {
|
|
93
|
+
color: color(cm_negative_200 blackness(+12%));
|
|
80
94
|
}
|
|
81
95
|
|
|
96
|
+
.button.success {
|
|
97
|
+
color: cm_positive_100;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.button.success:hover {
|
|
101
|
+
color: color(cm_positive_100 blackness(+12%));
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
|
|
82
105
|
.buttonsBar {
|
|
83
106
|
width: 2px;
|
|
84
107
|
align-self: stretch;
|
|
85
108
|
flex-grow: 0;
|
|
86
109
|
opacity: 0.3;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.buttonsBar.warning {
|
|
87
113
|
background-color: cm_yellow_200;
|
|
88
114
|
}
|
|
89
115
|
|
|
116
|
+
.buttonsBar.error {
|
|
117
|
+
background-color: cm_negative_200;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.buttonsBar.success {
|
|
121
|
+
background-color: cm_positive_100;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
|
|
90
125
|
.icon {
|
|
91
126
|
height: 22px;
|
|
92
127
|
margin-right: 16px;
|
|
@@ -142,7 +142,7 @@ const Card = (0, _react.memo)(function Card(props, context) {
|
|
|
142
142
|
image,
|
|
143
143
|
badge,
|
|
144
144
|
adaptiv,
|
|
145
|
-
disabled = false,
|
|
145
|
+
disabled: hidden = false,
|
|
146
146
|
type = 'course',
|
|
147
147
|
title,
|
|
148
148
|
author,
|
|
@@ -172,6 +172,7 @@ const Card = (0, _react.memo)(function Card(props, context) {
|
|
|
172
172
|
const primaryColor = (0, _get2.default)('common.primary', skin);
|
|
173
173
|
const whiteColor = (0, _get2.default)('common.white', skin);
|
|
174
174
|
const cardStyle = (0, _classnames.default)(THEMES[theme], type === 'chapter' ? _style.default.chapter : _style.default.course, title ? null : _style.default.lazy, _style.default.grid, empty ? _style.default.empty : null);
|
|
175
|
+
const disabled = hidden && (!isSelected || (0, _isUndefined2.default)(isSelected));
|
|
175
176
|
const handleClick = (0, _react.useMemo)(() => e => !disabled && onClick(e), [disabled, onClick]);
|
|
176
177
|
const lock = disabled ? /*#__PURE__*/_react.default.createElement(_novaIcons.NovaSolidLoginLocked, {
|
|
177
178
|
className: _style.default.lockIcon,
|
|
@@ -218,6 +219,7 @@ const Card = (0, _react.memo)(function Card(props, context) {
|
|
|
218
219
|
"aria-label": favoriteAriaLabel
|
|
219
220
|
}) : null, /*#__PURE__*/_react.default.createElement(_selectable.default, {
|
|
220
221
|
isSelected: isSelected,
|
|
222
|
+
hidden: hidden,
|
|
221
223
|
"aria-label": selectableAriaLabel
|
|
222
224
|
}), notification ? /*#__PURE__*/_react.default.createElement(_notification.default, notification) : null, customer ? /*#__PURE__*/_react.default.createElement(_customer.default, _extends({}, customer, {
|
|
223
225
|
theme: theme,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/molecule/card/index.js"],"names":["THEMES","default","coorpmanager","style","CardBackground","type","image","empty","ariaLabel","skin","externalContent","primaryColor","whiteColor","EXTERNAL_CONTENT_ICONS","IconType","icon","iconColor","color","backgroundIcon","externalIconCircleWrapper","externalIcon","_backgroundIcon","externalIconCircleWithImageWrapper","backgroundColor","externalIconWithImage","imageWrapper","backgroundImage","externalContentHeader","externalBackground","emptyIcon","chapterImageWrapper","contextTypes","Provider","childContextTypes","propTypes","PropTypes","string","bool","Card","props","context","badge","adaptiv","disabled","title","author","customer","certifiedAuthor","progress","favorite","addFavoriteToolTip","removeFavoriteToolTip","onClick","onFavoriteClick","isSelected","notification","badgeCategory","badgeLabel","theme","cardArialabel","backgroundAriaLabel","favoriteAriaLabel","selectableAriaLabel","customerAriaLabel","badgeAriaLabel","disabledArialabel","cardContentLabelAriaLabel","cardStyle","chapter","course","lazy","grid","handleClick","e","lock","lockIcon","inlineBadgeStyle","getType","contentType","MODES","CARD","lockWrapper","shape","Customer","number","func","Notification","CardContentInfo","oneOf","Favorite","Selectable"],"mappings":";;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;AAIA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEO,MAAMA,MAAM,GAAG;AACpBC,EAAAA,OAAO,EAAE,IADW;AAEpBC,EAAAA,YAAY,EAAEC,eAAMD;AAFA,CAAf;;;AAKP,MAAME,cAAc,GAAG,CAAC;AAACC,EAAAA,IAAD;AAAOC,EAAAA,KAAP;AAAcC,EAAAA,KAAd;AAAqB,gBAAcC;AAAnC,CAAD,EAAgD;AAACC,EAAAA;AAAD,CAAhD,KAA2D;AAChF,QAAM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'prop-types';\nimport classnames from 'classnames';\nimport {get, isEmpty, isUndefined, pick, keys} from 'lodash/fp';\nimport {\n NovaSolidLoginLocked as LockIcon,\n NovaCompositionCoorpacademyPictures as PicturesIcon\n} from '@coorpacademy/nova-icons';\nimport {isExternalContent, EXTERNAL_CONTENT_ICONS} from '../../util/external-content';\nimport Provider from '../../atom/provider';\nimport CardContentInfo, {MODES} from '../card-content';\nimport Customer from './customer';\nimport Favorite from './favorite';\nimport Selectable from './selectable';\nimport Notification from './notification';\nimport style from './style.css';\n\nexport const THEMES = {\n default: null,\n coorpmanager: style.coorpmanager\n};\n\nconst CardBackground = ({type, image, empty, 'aria-label': ariaLabel}, {skin}) => {\n const externalContent = isExternalContent(type);\n const primaryColor = get('common.primary', skin);\n const whiteColor = get('common.white', skin);\n\n if (externalContent && EXTERNAL_CONTENT_ICONS[type]) {\n const IconType = EXTERNAL_CONTENT_ICONS[type].icon;\n const iconColor = EXTERNAL_CONTENT_ICONS[type].color;\n const backgroundIcon = (\n <div className={style.externalIconCircleWrapper}>\n <IconType className={style.externalIcon} />\n </div>\n );\n\n if (image) {\n const _backgroundIcon = (\n <div\n className={classnames(\n style.externalIconCircleWrapper,\n style.externalIconCircleWithImageWrapper\n )}\n style={{\n backgroundColor: iconColor\n }}\n >\n <IconType className={style.externalIconWithImage} />\n </div>\n );\n\n return (\n <div className={style.imageWrapper}>\n <div\n data-name=\"cover\"\n aria-label={ariaLabel}\n style={{\n backgroundColor: iconColor,\n backgroundImage: `url('${image}')`\n }}\n className={classnames(style.externalContentHeader, style.externalBackground)}\n >\n {_backgroundIcon}\n </div>\n </div>\n );\n }\n return (\n <div className={style.imageWrapper}>\n <div\n data-name=\"cover\"\n aria-label={ariaLabel}\n style={{\n backgroundColor: iconColor\n }}\n className={style.externalContentHeader}\n >\n {backgroundIcon}\n </div>\n </div>\n );\n }\n\n const emptyIcon = empty ? <PicturesIcon className={style.emptyIcon} color={whiteColor} /> : null;\n return (\n <div\n className={classnames(\n style.imageWrapper,\n type === 'chapter' ? style.chapterImageWrapper : null\n )}\n >\n <div\n data-name=\"cover\"\n aria-label={ariaLabel}\n className={style.image}\n style={{\n backgroundColor: primaryColor,\n backgroundImage: image ? `url('${image}')` : 'none'\n }}\n >\n {emptyIcon}\n </div>\n </div>\n );\n};\n\nCardBackground.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nCardBackground.propTypes = {\n type: PropTypes.string,\n image: PropTypes.string,\n empty: PropTypes.bool,\n 'aria-label': PropTypes.string\n};\n\nconst Card = memo(function Card(props, context) {\n const {skin} = context;\n const {\n image,\n badge,\n adaptiv,\n disabled = false,\n type = 'course',\n title,\n author,\n customer,\n certifiedAuthor,\n progress,\n favorite,\n addFavoriteToolTip,\n removeFavoriteToolTip,\n onClick,\n onFavoriteClick,\n isSelected,\n notification,\n badgeCategory,\n badgeLabel,\n theme = 'default',\n 'aria-label': cardArialabel,\n 'background-aria-label': backgroundAriaLabel,\n 'favorite-aria-label': favoriteAriaLabel,\n 'selectable-aria-label': selectableAriaLabel,\n 'customer-aria-label': customerAriaLabel,\n 'badge-aria-label': badgeAriaLabel,\n 'disabled-aria-label': disabledArialabel,\n 'card-content-aria-label': cardContentLabelAriaLabel\n } = props;\n const empty = isEmpty(pick(['title', 'type', 'author', 'image'], props));\n const primaryColor = get('common.primary', skin);\n const whiteColor = get('common.white', skin);\n const cardStyle = classnames(\n THEMES[theme],\n type === 'chapter' ? style.chapter : style.course,\n title ? null : style.lazy,\n style.grid,\n empty ? style.empty : null\n );\n const handleClick = useMemo(() => e => !disabled && onClick(e), [disabled, onClick]);\n const lock = disabled ? (\n <LockIcon className={style.lockIcon} color={whiteColor} height={40} />\n ) : null;\n const inlineBadgeStyle = {color: primaryColor};\n const getType = contentType => {\n switch (contentType) {\n case 'chapter':\n return 'microlearning';\n case 'course':\n return 'learner';\n default:\n return contentType;\n }\n };\n\n return (\n <div\n className={cardStyle}\n data-name=\"card\"\n data-lock={disabled}\n data-type={getType(type)}\n disabled={disabled}\n onClick={handleClick}\n aria-label={cardArialabel}\n >\n <CardBackground type={type} image={image} empty={empty} aria-label={backgroundAriaLabel} />\n {isUndefined(isSelected) && !isUndefined(favorite) ? (\n <Favorite\n className={style.favorite}\n favorite={favorite}\n disabled={disabled}\n onFavoriteClick={onFavoriteClick}\n addFavoriteToolTip={addFavoriteToolTip}\n removeFavoriteToolTip={removeFavoriteToolTip}\n aria-label={favoriteAriaLabel}\n />\n ) : null}\n <Selectable isSelected={isSelected} aria-label={selectableAriaLabel} />\n {notification ? <Notification {...notification} /> : null}\n {customer ? (\n <Customer\n {...customer}\n theme={theme}\n type={type}\n disabled={disabled}\n aria-label={customerAriaLabel}\n />\n ) : null}\n <CardContentInfo\n mode={MODES.CARD}\n adaptiv={adaptiv}\n author={author}\n certifiedAuthor={certifiedAuthor}\n disabled={disabled}\n empty={empty}\n progress={progress}\n title={title}\n type={type}\n badgeCategory={badgeCategory}\n badgeLabel={badgeLabel}\n theme={theme}\n aria-label={cardContentLabelAriaLabel}\n />\n {badge ? (\n <div className={style.badge} style={inlineBadgeStyle} aria-label={badgeAriaLabel}>\n {badge}\n </div>\n ) : null}\n {disabled ? (\n <div className={style.lockWrapper} aria-label={disabledArialabel}>\n {lock}\n </div>\n ) : null}\n </div>\n );\n});\n\nCard.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nCard.propTypes = {\n badge: PropTypes.string,\n image: PropTypes.string,\n disabled: PropTypes.bool,\n adaptiv: PropTypes.bool,\n type: PropTypes.string,\n title: PropTypes.string,\n author: PropTypes.string,\n certifiedAuthor: PropTypes.bool,\n customer: PropTypes.shape(Customer.propTypes),\n progress: PropTypes.number,\n favorite: PropTypes.bool,\n addFavoriteToolTip: PropTypes.string,\n removeFavoriteToolTip: PropTypes.string,\n onClick: PropTypes.func,\n onFavoriteClick: PropTypes.func,\n isSelected: PropTypes.bool,\n notification: PropTypes.shape(Notification.propTypes),\n badgeCategory: CardContentInfo.propTypes.badgeCategory,\n badgeLabel: CardContentInfo.propTypes.badgeLabel,\n theme: PropTypes.oneOf(keys(THEMES)),\n 'aria-label': PropTypes.string,\n 'background-aria-label': PropTypes.string,\n 'favorite-aria-label': Favorite.propTypes['aria-label'],\n 'selectable-aria-label': Selectable.propTypes['aria-label'],\n 'customer-aria-label': Customer.propTypes['aria-label'],\n 'badge-aria-label': PropTypes.string,\n 'disabled-aria-label': PropTypes.string,\n 'card-content-aria-label': CardContentInfo.propTypes['aria-label']\n};\nexport default Card;\n"],"file":"index.js"}
|
|
1
|
+
{"version":3,"sources":["../../../src/molecule/card/index.js"],"names":["THEMES","default","coorpmanager","style","CardBackground","type","image","empty","ariaLabel","skin","externalContent","primaryColor","whiteColor","EXTERNAL_CONTENT_ICONS","IconType","icon","iconColor","color","backgroundIcon","externalIconCircleWrapper","externalIcon","_backgroundIcon","externalIconCircleWithImageWrapper","backgroundColor","externalIconWithImage","imageWrapper","backgroundImage","externalContentHeader","externalBackground","emptyIcon","chapterImageWrapper","contextTypes","Provider","childContextTypes","propTypes","PropTypes","string","bool","Card","props","context","badge","adaptiv","disabled","hidden","title","author","customer","certifiedAuthor","progress","favorite","addFavoriteToolTip","removeFavoriteToolTip","onClick","onFavoriteClick","isSelected","notification","badgeCategory","badgeLabel","theme","cardArialabel","backgroundAriaLabel","favoriteAriaLabel","selectableAriaLabel","customerAriaLabel","badgeAriaLabel","disabledArialabel","cardContentLabelAriaLabel","cardStyle","chapter","course","lazy","grid","handleClick","e","lock","lockIcon","inlineBadgeStyle","getType","contentType","MODES","CARD","lockWrapper","shape","Customer","number","func","Notification","CardContentInfo","oneOf","Favorite","Selectable"],"mappings":";;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;AAIA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEO,MAAMA,MAAM,GAAG;AACpBC,EAAAA,OAAO,EAAE,IADW;AAEpBC,EAAAA,YAAY,EAAEC,eAAMD;AAFA,CAAf;;;AAKP,MAAME,cA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yByD,oBAAWzD,SAAX,CAAqB,YAArB,CAxBV;AAyBf,yBAAuBkD,kBAASlD,SAAT,CAAmB,YAAnB,CAzBR;AA0Bf,sBAAoBC,mBAAUC,MA1Bf;AA2Bf,yBAAuBD,mBAAUC,MA3BlB;AA4Bf,6BAA2BoD,qBAAgBtD,SAAhB,CAA0B,YAA1B;AA5BZ,CAAjB;eA8BeI,I","sourcesContent":["import React, {useMemo, memo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {get, isEmpty, isUndefined, pick, keys} from 'lodash/fp';\nimport {\n NovaSolidLoginLocked as LockIcon,\n NovaCompositionCoorpacademyPictures as PicturesIcon\n} from '@coorpacademy/nova-icons';\nimport {isExternalContent, EXTERNAL_CONTENT_ICONS} from '../../util/external-content';\nimport Provider from '../../atom/provider';\nimport CardContentInfo, {MODES} from '../card-content';\nimport Customer from './customer';\nimport Favorite from './favorite';\nimport Selectable from './selectable';\nimport Notification from './notification';\nimport style from './style.css';\n\nexport const THEMES = {\n default: null,\n coorpmanager: style.coorpmanager\n};\n\nconst CardBackground = ({type, image, empty, 'aria-label': ariaLabel}, {skin}) => {\n const externalContent = isExternalContent(type);\n const primaryColor = get('common.primary', skin);\n const whiteColor = get('common.white', skin);\n\n if (externalContent && EXTERNAL_CONTENT_ICONS[type]) {\n const IconType = EXTERNAL_CONTENT_ICONS[type].icon;\n const iconColor = EXTERNAL_CONTENT_ICONS[type].color;\n const backgroundIcon = (\n <div className={style.externalIconCircleWrapper}>\n <IconType className={style.externalIcon} />\n </div>\n );\n\n if (image) {\n const _backgroundIcon = (\n <div\n className={classnames(\n style.externalIconCircleWrapper,\n style.externalIconCircleWithImageWrapper\n )}\n style={{\n backgroundColor: iconColor\n }}\n >\n <IconType className={style.externalIconWithImage} />\n </div>\n );\n\n return (\n <div className={style.imageWrapper}>\n <div\n data-name=\"cover\"\n aria-label={ariaLabel}\n style={{\n backgroundColor: iconColor,\n backgroundImage: `url('${image}')`\n }}\n className={classnames(style.externalContentHeader, style.externalBackground)}\n >\n {_backgroundIcon}\n </div>\n </div>\n );\n }\n return (\n <div className={style.imageWrapper}>\n <div\n data-name=\"cover\"\n aria-label={ariaLabel}\n style={{\n backgroundColor: iconColor\n }}\n className={style.externalContentHeader}\n >\n {backgroundIcon}\n </div>\n </div>\n );\n }\n\n const emptyIcon = empty ? <PicturesIcon className={style.emptyIcon} color={whiteColor} /> : null;\n return (\n <div\n className={classnames(\n style.imageWrapper,\n type === 'chapter' ? style.chapterImageWrapper : null\n )}\n >\n <div\n data-name=\"cover\"\n aria-label={ariaLabel}\n className={style.image}\n style={{\n backgroundColor: primaryColor,\n backgroundImage: image ? `url('${image}')` : 'none'\n }}\n >\n {emptyIcon}\n </div>\n </div>\n );\n};\n\nCardBackground.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nCardBackground.propTypes = {\n type: PropTypes.string,\n image: PropTypes.string,\n empty: PropTypes.bool,\n 'aria-label': PropTypes.string\n};\n\nconst Card = memo(function Card(props, context) {\n const {skin} = context;\n const {\n image,\n badge,\n adaptiv,\n disabled: hidden = false,\n type = 'course',\n title,\n author,\n customer,\n certifiedAuthor,\n progress,\n favorite,\n addFavoriteToolTip,\n removeFavoriteToolTip,\n onClick,\n onFavoriteClick,\n isSelected,\n notification,\n badgeCategory,\n badgeLabel,\n theme = 'default',\n 'aria-label': cardArialabel,\n 'background-aria-label': backgroundAriaLabel,\n 'favorite-aria-label': favoriteAriaLabel,\n 'selectable-aria-label': selectableAriaLabel,\n 'customer-aria-label': customerAriaLabel,\n 'badge-aria-label': badgeAriaLabel,\n 'disabled-aria-label': disabledArialabel,\n 'card-content-aria-label': cardContentLabelAriaLabel\n } = props;\n const empty = isEmpty(pick(['title', 'type', 'author', 'image'], props));\n const primaryColor = get('common.primary', skin);\n const whiteColor = get('common.white', skin);\n const cardStyle = classnames(\n THEMES[theme],\n type === 'chapter' ? style.chapter : style.course,\n title ? null : style.lazy,\n style.grid,\n empty ? style.empty : null\n );\n const disabled = hidden && (!isSelected || isUndefined(isSelected));\n const handleClick = useMemo(() => e => !disabled && onClick(e), [disabled, onClick]);\n const lock = disabled ? (\n <LockIcon className={style.lockIcon} color={whiteColor} height={40} />\n ) : null;\n const inlineBadgeStyle = {color: primaryColor};\n const getType = contentType => {\n switch (contentType) {\n case 'chapter':\n return 'microlearning';\n case 'course':\n return 'learner';\n default:\n return contentType;\n }\n };\n\n return (\n <div\n className={cardStyle}\n data-name=\"card\"\n data-lock={disabled}\n data-type={getType(type)}\n disabled={disabled}\n onClick={handleClick}\n aria-label={cardArialabel}\n >\n <CardBackground type={type} image={image} empty={empty} aria-label={backgroundAriaLabel} />\n {isUndefined(isSelected) && !isUndefined(favorite) ? (\n <Favorite\n className={style.favorite}\n favorite={favorite}\n disabled={disabled}\n onFavoriteClick={onFavoriteClick}\n addFavoriteToolTip={addFavoriteToolTip}\n removeFavoriteToolTip={removeFavoriteToolTip}\n aria-label={favoriteAriaLabel}\n />\n ) : null}\n <Selectable isSelected={isSelected} hidden={hidden} aria-label={selectableAriaLabel} />\n {notification ? <Notification {...notification} /> : null}\n {customer ? (\n <Customer\n {...customer}\n theme={theme}\n type={type}\n disabled={disabled}\n aria-label={customerAriaLabel}\n />\n ) : null}\n <CardContentInfo\n mode={MODES.CARD}\n adaptiv={adaptiv}\n author={author}\n certifiedAuthor={certifiedAuthor}\n disabled={disabled}\n empty={empty}\n progress={progress}\n title={title}\n type={type}\n badgeCategory={badgeCategory}\n badgeLabel={badgeLabel}\n theme={theme}\n aria-label={cardContentLabelAriaLabel}\n />\n {badge ? (\n <div className={style.badge} style={inlineBadgeStyle} aria-label={badgeAriaLabel}>\n {badge}\n </div>\n ) : null}\n {disabled ? (\n <div className={style.lockWrapper} aria-label={disabledArialabel}>\n {lock}\n </div>\n ) : null}\n </div>\n );\n});\n\nCard.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nCard.propTypes = {\n badge: PropTypes.string,\n image: PropTypes.string,\n disabled: PropTypes.bool,\n adaptiv: PropTypes.bool,\n type: PropTypes.string,\n title: PropTypes.string,\n author: PropTypes.string,\n certifiedAuthor: PropTypes.bool,\n customer: PropTypes.shape(Customer.propTypes),\n progress: PropTypes.number,\n favorite: PropTypes.bool,\n addFavoriteToolTip: PropTypes.string,\n removeFavoriteToolTip: PropTypes.string,\n onClick: PropTypes.func,\n onFavoriteClick: PropTypes.func,\n isSelected: PropTypes.bool,\n notification: PropTypes.shape(Notification.propTypes),\n badgeCategory: CardContentInfo.propTypes.badgeCategory,\n badgeLabel: CardContentInfo.propTypes.badgeLabel,\n theme: PropTypes.oneOf(keys(THEMES)),\n 'aria-label': PropTypes.string,\n 'background-aria-label': PropTypes.string,\n 'favorite-aria-label': Favorite.propTypes['aria-label'],\n 'selectable-aria-label': Selectable.propTypes['aria-label'],\n 'customer-aria-label': Customer.propTypes['aria-label'],\n 'badge-aria-label': PropTypes.string,\n 'disabled-aria-label': PropTypes.string,\n 'card-content-aria-label': CardContentInfo.propTypes['aria-label']\n};\nexport default Card;\n"],"file":"index.js"}
|