@coorpacademy/components 10.21.4 → 10.22.1
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/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/tab/index.js +1 -0
- package/es/atom/tab/index.js.map +1 -1
- 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/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 +47 -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/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-review/index.native.js +26 -20
- 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 +49 -12
- 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 +30 -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/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/tab/index.js +1 -0
- package/lib/atom/tab/index.js.map +1 -1
- 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/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 +58 -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/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-review/index.native.js +28 -19
- 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 +60 -25
- 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 +41 -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/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
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); }
|
|
2
2
|
|
|
3
3
|
import React, { useMemo, useRef, useEffect, useState } from 'react';
|
|
4
|
-
import PropTypes from 'prop-types';
|
|
5
4
|
import classnames from 'classnames';
|
|
6
5
|
import lottie from 'lottie-web';
|
|
7
6
|
import get from 'lodash/fp/get';
|
|
@@ -11,12 +10,7 @@ import keys from 'lodash/fp/keys';
|
|
|
11
10
|
import omit from 'lodash/fp/omit';
|
|
12
11
|
import unfetch from 'isomorphic-unfetch';
|
|
13
12
|
import style from './style.css';
|
|
14
|
-
|
|
15
|
-
play: 'play',
|
|
16
|
-
pause: 'pause',
|
|
17
|
-
stop: 'stop',
|
|
18
|
-
loading: 'loading'
|
|
19
|
-
};
|
|
13
|
+
import propTypes, { ANIMATION_CONTROL } from './prop-types';
|
|
20
14
|
|
|
21
15
|
const isIE11 = () => {
|
|
22
16
|
if (typeof window === 'undefined') return;
|
|
@@ -137,22 +131,6 @@ const LottieWrapper = props => {
|
|
|
137
131
|
}) : null);
|
|
138
132
|
};
|
|
139
133
|
|
|
140
|
-
LottieWrapper.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
141
|
-
'aria-label': PropTypes.string.isRequired,
|
|
142
|
-
'data-name': PropTypes.string,
|
|
143
|
-
animationSrc: PropTypes.string.isRequired,
|
|
144
|
-
loop: PropTypes.bool,
|
|
145
|
-
rendererSettings: PropTypes.shape({
|
|
146
|
-
hideOnTransparent: PropTypes.bool,
|
|
147
|
-
className: PropTypes.string
|
|
148
|
-
}),
|
|
149
|
-
height: PropTypes.number,
|
|
150
|
-
width: PropTypes.number,
|
|
151
|
-
className: PropTypes.string,
|
|
152
|
-
ie11ImageBackup: PropTypes.string.isRequired,
|
|
153
|
-
backupImageClassName: PropTypes.string,
|
|
154
|
-
autoplay: PropTypes.bool,
|
|
155
|
-
animationControl: PropTypes.oneOf(keys(ANIMATION_CONTROL))
|
|
156
|
-
} : {};
|
|
134
|
+
LottieWrapper.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
|
|
157
135
|
export default LottieWrapper;
|
|
158
136
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/atom/lottie-wrapper/index.js"],"names":["React","useMemo","useRef","useEffect","useState","PropTypes","classnames","lottie","get","has","includes","keys","omit","unfetch","style","ANIMATION_CONTROL","play","pause","stop","loading","isIE11","window","userAgent","hasMsCrypto","hasRevision","hasTrident","fetchAndLoadAnimation","_lottie","_fetch","animationSrc","containerRef","loop","animationClassnames","hideOnTransparent","autoplay","animationUrl","URL","toString","fetchResult","headers","animationData","json","animation","loadAnimation","container","current","renderer","rendererSettings","className","preserveAspectRatio","LottieWrapper","props","dataName","ariaLabel","width","height","ie11ImageBackup","backupImageClassName","animationControl","animationClassName","animationItem","setAnimationItem","isAnimationVisible","setIsAnimationVisible","_isIE11","wrapperClassName","lottieContainer","lottieAnimationClassName","ie11BackupImageClassName","backupImage","destroy","name","maxWidth","maxHeight","opacity","transition","propTypes","string","isRequired","bool","shape","number","oneOf"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,OAAf,EAAwBC,MAAxB,EAAgCC,SAAhC,EAA2CC,QAA3C,QAA0D,OAA1D;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,MAAP,MAAmB,YAAnB;AACA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,GAAP,MAAgB,e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iB,EAAE5B,SAAS,CAAC0E,IADG;AAEhC/B,IAAAA,SAAS,EAAE3C,SAAS,CAACwE;AAFW,GAAhB,CALM;AASxBtB,EAAAA,MAAM,EAAElD,SAAS,CAAC4E,MATM;AAUxB3B,EAAAA,KAAK,EAAEjD,SAAS,CAAC4E,MAVO;AAWxBjC,EAAAA,SAAS,EAAE3C,SAAS,CAACwE,MAXG;AAYxBrB,EAAAA,eAAe,EAAEnD,SAAS,CAACwE,MAAV,CAAiBC,UAZV;AAaxBrB,EAAAA,oBAAoB,EAAEpD,SAAS,CAACwE,MAbR;AAcxB3C,EAAAA,QAAQ,EAAE7B,SAAS,CAAC0E,IAdI;AAexBrB,EAAAA,gBAAgB,EAAErD,SAAS,CAAC6E,KAAV,CAAgBvE,IAAI,CAACI,iBAAD,CAApB;AAfM,CAA1B;AAkBA,eAAemC,aAAf","sourcesContent":["import React, {useMemo, useRef, useEffect, useState} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport lottie from 'lottie-web';\nimport get from 'lodash/fp/get';\nimport has from 'lodash/fp/has';\nimport includes from 'lodash/fp/includes';\nimport keys from 'lodash/fp/keys';\nimport omit from 'lodash/fp/omit';\nimport unfetch from 'isomorphic-unfetch';\nimport style from './style.css';\n\nexport const ANIMATION_CONTROL = {\n play: 'play',\n pause: 'pause',\n stop: 'stop',\n loading: 'loading'\n};\n\nconst isIE11 = () => {\n if (typeof window === 'undefined') return;\n const userAgent = get('navigator.userAgent', window);\n const hasMsCrypto = has('msCrypto', window);\n const hasRevision = includes('rv:', userAgent);\n const hasTrident = includes('Trident/', userAgent);\n\n return hasMsCrypto || (hasRevision && hasTrident);\n};\n\nexport const fetchAndLoadAnimation = async (\n _lottie,\n _fetch,\n animationSrc,\n containerRef,\n loop,\n animationClassnames,\n hideOnTransparent,\n autoplay\n) => {\n const animationUrl = new URL(animationSrc).toString();\n const fetchResult = await _fetch(animationUrl, {\n headers: {\n 'X-Requested-With': 'XMLHttpRequest',\n 'Content-Type': 'application/json'\n }\n });\n\n const animationData = await fetchResult.json();\n\n const animation =\n _lottie.loadAnimation &&\n _lottie.loadAnimation({\n container: containerRef.current, // the dom element that will contain the animation\n renderer: 'svg',\n autoplay,\n loop,\n animationData,\n rendererSettings: {\n className: animationClassnames,\n hideOnTransparent,\n preserveAspectRatio: 'xMidYMid meet' // same options as a preserveAspectRatio prop\n }\n });\n return animation;\n};\n\nconst LottieWrapper = props => {\n const {\n className,\n 'data-name': dataName,\n 'aria-label': ariaLabel,\n animationSrc,\n loop = false,\n rendererSettings = {},\n width,\n height,\n ie11ImageBackup,\n backupImageClassName,\n autoplay = true,\n animationControl\n } = props;\n\n const {className: animationClassName, hideOnTransparent = true} = rendererSettings;\n\n const containerRef = useRef(null);\n\n // lottie's animation instance\n const [animationItem, setAnimationItem] = useState(null);\n\n const [isAnimationVisible, setIsAnimationVisible] = useState(autoplay);\n\n const _isIE11 = useMemo(() => isIE11(), []);\n\n const wrapperClassName = useMemo(() => classnames(className, style.lottieContainer), [className]);\n\n const lottieAnimationClassName = useMemo(() => classnames(animationClassName, style.animation), [\n animationClassName\n ]);\n\n const ie11BackupImageClassName = useMemo(\n () => classnames(backupImageClassName, style.backupImage),\n [backupImageClassName]\n );\n\n useEffect(() => {\n // enzyme does not handle well the state update after an async useEffect in tests\n // to remove when the migration towards @testing-library/react is done\n /* istanbul ignore next */\n if (includes(animationControl, keys(omit('loading', ANIMATION_CONTROL))) && !autoplay) {\n setIsAnimationVisible(true);\n if (animationItem) animationItem[animationControl]();\n if (animationControl === ANIMATION_CONTROL.stop) setIsAnimationVisible(false);\n }\n }, [animationControl, animationItem, autoplay]);\n\n useEffect(() => {\n const loadAnimation = async () => {\n if (!_isIE11 && !animationItem) {\n /* istanbul ignore else */\n if (typeof window !== 'undefined') {\n window.lottie = lottie;\n }\n const animation = await fetchAndLoadAnimation(\n lottie,\n unfetch,\n animationSrc,\n containerRef,\n loop,\n lottieAnimationClassName,\n hideOnTransparent,\n autoplay\n );\n\n /* istanbul ignore next */\n setAnimationItem(animation);\n }\n };\n\n loadAnimation();\n return () => animationItem && /* istanbul ignore next */ lottie.destroy(animationItem.name);\n }, [\n lottieAnimationClassName,\n containerRef,\n hideOnTransparent,\n loop,\n animationSrc,\n _isIE11,\n animationItem,\n autoplay\n ]);\n\n return (\n <div\n ref={containerRef}\n aria-label={ariaLabel}\n data-name={dataName}\n className={wrapperClassName}\n style={{\n ...(width && {\n width: `${width}px`,\n maxWidth: `${width}px`\n }),\n ...(height && {\n height: `${height}px`,\n maxHeight: `${height}px`\n }),\n opacity: isAnimationVisible ? 1 : 0,\n transition: 'opacity 0.25s ease-in'\n }}\n >\n {_isIE11 ? (\n <img\n src={ie11ImageBackup}\n className={ie11BackupImageClassName}\n data-name=\"ie11-backup-image\"\n />\n ) : null}\n </div>\n );\n};\n\nLottieWrapper.propTypes = {\n 'aria-label': PropTypes.string.isRequired,\n 'data-name': PropTypes.string,\n animationSrc: PropTypes.string.isRequired,\n loop: PropTypes.bool,\n rendererSettings: PropTypes.shape({\n hideOnTransparent: PropTypes.bool,\n className: PropTypes.string\n }),\n height: PropTypes.number,\n width: PropTypes.number,\n className: PropTypes.string,\n ie11ImageBackup: PropTypes.string.isRequired,\n backupImageClassName: PropTypes.string,\n autoplay: PropTypes.bool,\n animationControl: PropTypes.oneOf(keys(ANIMATION_CONTROL))\n};\n\nexport default LottieWrapper;\n"],"file":"index.js"}
|
|
1
|
+
{"version":3,"sources":["../../../src/atom/lottie-wrapper/index.js"],"names":["React","useMemo","useRef","useEffect","useState","classnames","lottie","get","has","includes","keys","omit","unfetch","style","propTypes","ANIMATION_CONTROL","isIE11","window","userAgent","hasMsCrypto","hasRevision","hasTrident","fetchAndLoadAnimation","_lottie","_fetch","animationSrc","containerRef","loop","animationClassnames","hideOnTransparent","autoplay","animationUrl","URL","toString","fetchResult","headers","animationData","json","animation","loadAnimation","container","current","renderer","rendererSettings","className","preserveAspectRatio","LottieWrapper","props","dataName","ariaLabel","width","height","ie11ImageBackup","backupImageClassName","animationControl","animationClassName","animationItem","setAnimationItem","isAnimationVisible","setIsAnimationVisible","_isIE11","wrapperClassName","lottieContainer","lottieAnimationClassName","ie11BackupImageClassName","backupImage","stop","destroy","name","maxWidth","maxHeight","opacity","transition"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,OAAf,EAAwBC,MAAxB,EAAgCC,SAAhC,EAA2CC,QAA3C,QAA0D,OAA1D;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,MAAP,MAAmB,YAAnB;AACA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,QAAP,MAAqB,oBAArB;AACA,OAAOC,IAAP,MAAiB,gBAAjB;AACA,OAAOC,IAAP,MAAiB,gBAAjB;AACA,OAAOC,OAAP,MAAoB,oBAApB;AACA,OAAOC,KAAP,MAAkB,aAAlB;AACA,OAAOC,SAAP,IAAmBC,iBAAnB,QAA2C,cAA3C;;AAEA,MAAMC,MAAM,GAAG,MAAM;AACnB,MAAI,OAAOC,MAAP,KAAkB,WAAtB,EAAmC;AACnC,QAAMC,SAAS,GAAGX,GAAG,CAAC,qBAAD,EAAwBU,MAAxB,CAArB;AACA,QAAME,WAAW,GAAGX,GAAG,CAAC,UAAD,EAAaS,MAAb,CAAvB;AACA,QAAMG,WAAW,GAAGX,QAAQ,CAAC,KAAD,EAAQS,SAAR,CAA5B;AACA,QAAMG,UAAU,GAAGZ,QAAQ,CAAC,UAAD,EAAaS,SAAb,CAA3B;AAEA,SAAOC,WAAW,IAAKC,WAAW,IAAIC,UAAtC;AACD,CARD;;AAUA,OAAO,MAAMC,qBAAqB,GAAG,OACnCC,OADmC,EAEnCC,MAFmC,EAGnCC,YAHmC,EAInCC,YAJmC,EAKnCC,IALmC,EAMnCC,mBANmC,EAOnCC,iBAPmC,EAQnCC,QARmC,KAShC;AACH,QAAMC,YAAY,GAAG,IAAIC,GAAJ,CAAQP,YAAR,EAAsB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egC,aAAf","sourcesContent":["import React, {useMemo, useRef, useEffect, useState} from 'react';\nimport classnames from 'classnames';\nimport lottie from 'lottie-web';\nimport get from 'lodash/fp/get';\nimport has from 'lodash/fp/has';\nimport includes from 'lodash/fp/includes';\nimport keys from 'lodash/fp/keys';\nimport omit from 'lodash/fp/omit';\nimport unfetch from 'isomorphic-unfetch';\nimport style from './style.css';\nimport propTypes, {ANIMATION_CONTROL} from './prop-types';\n\nconst isIE11 = () => {\n if (typeof window === 'undefined') return;\n const userAgent = get('navigator.userAgent', window);\n const hasMsCrypto = has('msCrypto', window);\n const hasRevision = includes('rv:', userAgent);\n const hasTrident = includes('Trident/', userAgent);\n\n return hasMsCrypto || (hasRevision && hasTrident);\n};\n\nexport const fetchAndLoadAnimation = async (\n _lottie,\n _fetch,\n animationSrc,\n containerRef,\n loop,\n animationClassnames,\n hideOnTransparent,\n autoplay\n) => {\n const animationUrl = new URL(animationSrc).toString();\n const fetchResult = await _fetch(animationUrl, {\n headers: {\n 'X-Requested-With': 'XMLHttpRequest',\n 'Content-Type': 'application/json'\n }\n });\n\n const animationData = await fetchResult.json();\n\n const animation =\n _lottie.loadAnimation &&\n _lottie.loadAnimation({\n container: containerRef.current, // the dom element that will contain the animation\n renderer: 'svg',\n autoplay,\n loop,\n animationData,\n rendererSettings: {\n className: animationClassnames,\n hideOnTransparent,\n preserveAspectRatio: 'xMidYMid meet' // same options as a preserveAspectRatio prop\n }\n });\n return animation;\n};\n\nconst LottieWrapper = props => {\n const {\n className,\n 'data-name': dataName,\n 'aria-label': ariaLabel,\n animationSrc,\n loop = false,\n rendererSettings = {},\n width,\n height,\n ie11ImageBackup,\n backupImageClassName,\n autoplay = true,\n animationControl\n } = props;\n\n const {className: animationClassName, hideOnTransparent = true} = rendererSettings;\n\n const containerRef = useRef(null);\n\n // lottie's animation instance\n const [animationItem, setAnimationItem] = useState(null);\n\n const [isAnimationVisible, setIsAnimationVisible] = useState(autoplay);\n\n const _isIE11 = useMemo(() => isIE11(), []);\n\n const wrapperClassName = useMemo(() => classnames(className, style.lottieContainer), [className]);\n\n const lottieAnimationClassName = useMemo(() => classnames(animationClassName, style.animation), [\n animationClassName\n ]);\n\n const ie11BackupImageClassName = useMemo(\n () => classnames(backupImageClassName, style.backupImage),\n [backupImageClassName]\n );\n\n useEffect(() => {\n // enzyme does not handle well the state update after an async useEffect in tests\n // to remove when the migration towards @testing-library/react is done\n /* istanbul ignore next */\n if (includes(animationControl, keys(omit('loading', ANIMATION_CONTROL))) && !autoplay) {\n setIsAnimationVisible(true);\n if (animationItem) animationItem[animationControl]();\n if (animationControl === ANIMATION_CONTROL.stop) setIsAnimationVisible(false);\n }\n }, [animationControl, animationItem, autoplay]);\n\n useEffect(() => {\n const loadAnimation = async () => {\n if (!_isIE11 && !animationItem) {\n /* istanbul ignore else */\n if (typeof window !== 'undefined') {\n window.lottie = lottie;\n }\n const animation = await fetchAndLoadAnimation(\n lottie,\n unfetch,\n animationSrc,\n containerRef,\n loop,\n lottieAnimationClassName,\n hideOnTransparent,\n autoplay\n );\n\n /* istanbul ignore next */\n setAnimationItem(animation);\n }\n };\n\n loadAnimation();\n return () => animationItem && /* istanbul ignore next */ lottie.destroy(animationItem.name);\n }, [\n lottieAnimationClassName,\n containerRef,\n hideOnTransparent,\n loop,\n animationSrc,\n _isIE11,\n animationItem,\n autoplay\n ]);\n\n return (\n <div\n ref={containerRef}\n aria-label={ariaLabel}\n data-name={dataName}\n className={wrapperClassName}\n style={{\n ...(width && {\n width: `${width}px`,\n maxWidth: `${width}px`\n }),\n ...(height && {\n height: `${height}px`,\n maxHeight: `${height}px`\n }),\n opacity: isAnimationVisible ? 1 : 0,\n transition: 'opacity 0.25s ease-in'\n }}\n >\n {_isIE11 ? (\n <img\n src={ie11ImageBackup}\n className={ie11BackupImageClassName}\n data-name=\"ie11-backup-image\"\n />\n ) : null}\n </div>\n );\n};\n\nLottieWrapper.propTypes = propTypes;\n\nexport default LottieWrapper;\n"],"file":"index.js"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import keys from 'lodash/fp/keys';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
export const ANIMATION_CONTROL = {
|
|
4
|
+
play: 'play',
|
|
5
|
+
pause: 'pause',
|
|
6
|
+
stop: 'stop',
|
|
7
|
+
loading: 'loading'
|
|
8
|
+
};
|
|
9
|
+
export default {
|
|
10
|
+
'aria-label': PropTypes.string.isRequired,
|
|
11
|
+
'data-name': PropTypes.string,
|
|
12
|
+
animationSrc: PropTypes.string.isRequired,
|
|
13
|
+
loop: PropTypes.bool,
|
|
14
|
+
rendererSettings: PropTypes.shape({
|
|
15
|
+
hideOnTransparent: PropTypes.bool,
|
|
16
|
+
className: PropTypes.string
|
|
17
|
+
}),
|
|
18
|
+
height: PropTypes.number,
|
|
19
|
+
width: PropTypes.number,
|
|
20
|
+
className: PropTypes.string,
|
|
21
|
+
ie11ImageBackup: PropTypes.string.isRequired,
|
|
22
|
+
backupImageClassName: PropTypes.string,
|
|
23
|
+
autoplay: PropTypes.bool,
|
|
24
|
+
animationControl: PropTypes.oneOf(keys(ANIMATION_CONTROL))
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=prop-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/atom/lottie-wrapper/prop-types.js"],"names":["keys","PropTypes","ANIMATION_CONTROL","play","pause","stop","loading","string","isRequired","animationSrc","loop","bool","rendererSettings","shape","hideOnTransparent","className","height","number","width","ie11ImageBackup","backupImageClassName","autoplay","animationControl","oneOf"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,gBAAjB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAO,MAAMC,iBAAiB,GAAG;AAC/BC,EAAAA,IAAI,EAAE,MADyB;AAE/BC,EAAAA,KAAK,EAAE,OAFwB;AAG/BC,EAAAA,IAAI,EAAE,MAHyB;AAI/BC,EAAAA,OAAO,EAAE;AAJsB,CAA1B;AAOP,eAAe;AACb,gBAAcL,SAAS,CAACM,MAAV,CAAiBC,UADlB;AAEb,eAAaP,SAAS,CAACM,MAFV;AAGbE,EAAAA,YAAY,EAAER,SAAS,CAACM,MAAV,CAAiBC,UAHlB;AAIbE,EAAAA,IAAI,EAAET,SAAS,CAACU,IAJH;AAKbC,EAAAA,gBAAgB,EAAEX,SAAS,CAACY,KAAV,CAAgB;AAChCC,IAAAA,iBAAiB,EAAEb,SAAS,CAACU,IADG;AAEhCI,IAAAA,SAAS,EAAEd,SAAS,CAACM;AAFW,GAAhB,CALL;AASbS,EAAAA,MAAM,EAAEf,SAAS,CAACgB,MATL;AAUbC,EAAAA,KAAK,EAAEjB,SAAS,CAACgB,MAVJ;AAWbF,EAAAA,SAAS,EAAEd,SAAS,CAACM,MAXR;AAYbY,EAAAA,eAAe,EAAElB,SAAS,CAACM,MAAV,CAAiBC,UAZrB;AAabY,EAAAA,oBAAoB,EAAEnB,SAAS,CAACM,MAbnB;AAcbc,EAAAA,QAAQ,EAAEpB,SAAS,CAACU,IAdP;AAebW,EAAAA,gBAAgB,EAAErB,SAAS,CAACsB,KAAV,CAAgBvB,IAAI,CAACE,iBAAD,CAApB;AAfL,CAAf","sourcesContent":["import keys from 'lodash/fp/keys';\nimport PropTypes from 'prop-types';\n\nexport const ANIMATION_CONTROL = {\n play: 'play',\n pause: 'pause',\n stop: 'stop',\n loading: 'loading'\n};\n\nexport default {\n 'aria-label': PropTypes.string.isRequired,\n 'data-name': PropTypes.string,\n animationSrc: PropTypes.string.isRequired,\n loop: PropTypes.bool,\n rendererSettings: PropTypes.shape({\n hideOnTransparent: PropTypes.bool,\n className: PropTypes.string\n }),\n height: PropTypes.number,\n width: PropTypes.number,\n className: PropTypes.string,\n ie11ImageBackup: PropTypes.string.isRequired,\n backupImageClassName: PropTypes.string,\n autoplay: PropTypes.bool,\n animationControl: PropTypes.oneOf(keys(ANIMATION_CONTROL))\n};\n"],"file":"prop-types.js"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
2
|
import style from './style.css';
|
|
3
|
+
import propTypes from './prop-types';
|
|
4
4
|
|
|
5
5
|
const ReviewBackground = props => {
|
|
6
6
|
const {
|
|
@@ -28,8 +28,6 @@ const ReviewBackground = props => {
|
|
|
28
28
|
})));
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
-
ReviewBackground.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
32
|
-
'aria-label': PropTypes.string
|
|
33
|
-
} : {};
|
|
31
|
+
ReviewBackground.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
|
|
34
32
|
export default ReviewBackground;
|
|
35
33
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/atom/review-background/index.js"],"names":["React","
|
|
1
|
+
{"version":3,"sources":["../../../src/atom/review-background/index.js"],"names":["React","style","propTypes","ReviewBackground","props","ariaLabel","mainContainer","container","interrogationLeft","interrogationRight","recYellow","recRed","recBlue","recGreen","recGreenLight"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,KAAP,MAAkB,aAAlB;AACA,OAAOC,SAAP,MAAsB,cAAtB;;AAEA,MAAMC,gBAAgB,GAAGC,KAAK,IAAI;AAChC,QAAM;AAAC,kBAAcC;AAAf,MAA4BD,KAAlC;AACA,sBACE;AAAK,IAAA,SAAS,EAAEH,KAAK,CAACK,aAAtB;AAAqC,kBAAYD;AAAjD,kBACE;AAAK,IAAA,SAAS,EAAEJ,KAAK,CAACM;AAAtB,kBACE;AAAM,IAAA,SAAS,EAAEN,KAAK,CAACO;AAAvB,SADF,eAEE;AAAM,IAAA,SAAS,EAAEP,KAAK,CAACQ;AAAvB,SAFF,eAGE;AAAK,IAAA,SAAS,EAAER,KAAK,CAACS;AAAtB,IAHF,eAIE;AAAK,IAAA,SAAS,EAAET,KAAK,CAACU;AAAtB,IAJF,eAKE;AAAK,IAAA,SAAS,EAAEV,KAAK,CAACW;AAAtB,IALF,eAME;AAAK,IAAA,SAAS,EAAEX,KAAK,CAACY;AAAtB,IANF,eAOE;AAAK,IAAA,SAAS,EAAEZ,KAAK,CAACa;AAAtB,IAPF,CADF,CADF;AAaD,CAfD;;AAiBAX,gBAAgB,CAACD,SAAjB,2CAA6BA,SAA7B;AAEA,eAAeC,gBAAf","sourcesContent":["import React from 'react';\nimport style from './style.css';\nimport propTypes from './prop-types';\n\nconst ReviewBackground = props => {\n const {'aria-label': ariaLabel} = props;\n return (\n <div className={style.mainContainer} aria-label={ariaLabel}>\n <div className={style.container}>\n <span className={style.interrogationLeft}>?</span>\n <span className={style.interrogationRight}>?</span>\n <div className={style.recYellow} />\n <div className={style.recRed} />\n <div className={style.recBlue} />\n <div className={style.recGreen} />\n <div className={style.recGreenLight} />\n </div>\n </div>\n );\n};\n\nReviewBackground.propTypes = propTypes;\n\nexport default ReviewBackground;\n"],"file":"index.js"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/atom/review-background/prop-types.js"],"names":["PropTypes","string"],"mappings":"AAAA,OAAOA,SAAP,MAAsB,YAAtB;AAEA,eAAe;AAAC,gBAAcA,SAAS,CAACC;AAAzB,CAAf","sourcesContent":["import PropTypes from 'prop-types';\n\nexport default {'aria-label': PropTypes.string};\n"],"file":"prop-types.js"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import classnames from 'classnames';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
3
|
import { NovaCompositionCoorpacademyCheck as RightIcon, NovaSolidStatusClose as WrongIcon } from '@coorpacademy/nova-icons';
|
|
5
4
|
import style from './style.css';
|
|
5
|
+
import propTypes from './prop-types';
|
|
6
6
|
export const ICON_VALUES = {
|
|
7
7
|
right: 'right',
|
|
8
8
|
wrong: 'wrong',
|
|
@@ -51,10 +51,6 @@ const ReviewHeaderStepItem = props => {
|
|
|
51
51
|
}, /*#__PURE__*/React.createElement(Content, props));
|
|
52
52
|
};
|
|
53
53
|
|
|
54
|
-
ReviewHeaderStepItem.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
55
|
-
icon: PropTypes.string,
|
|
56
|
-
current: PropTypes.bool,
|
|
57
|
-
value: PropTypes.string
|
|
58
|
-
} : {};
|
|
54
|
+
ReviewHeaderStepItem.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
|
|
59
55
|
export default ReviewHeaderStepItem;
|
|
60
56
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/atom/review-header-step-item/index.js"],"names":["React","classnames","
|
|
1
|
+
{"version":3,"sources":["../../../src/atom/review-header-step-item/index.js"],"names":["React","classnames","NovaCompositionCoorpacademyCheck","RightIcon","NovaSolidStatusClose","WrongIcon","style","propTypes","ICON_VALUES","right","wrong","Content","icon","current","value","rightIcon","currentRightIcon","wrongIcon","currentWrongIcon","ReviewHeaderStepItem","props","default"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,SACEC,gCAAgC,IAAIC,SADtC,EAEEC,oBAAoB,IAAIC,SAF1B,QAGO,0BAHP;AAIA,OAAOC,KAAP,MAAkB,aAAlB;AACA,OAAOC,SAAP,MAAsB,cAAtB;AAEA,OAAO,MAAMC,WAAW,GAAG;AACzBC,EAAAA,KAAK,EAAE,OADkB;AAEzBC,EAAAA,KAAK,EAAE,OAFkB;AAGzB,eAAa;AAHY,CAApB;;AAMP,MAAMC,OAAO,GAAG,CAAC;AAACC,EAAAA,IAAD;AAAOC,EAAAA,OAAP;AAAgBC,EAAAA;AAAhB,CAAD,KAA4B;AAC1C,MAAIF,IAAI,KAAKJ,WAAW,CAAC,WAAD,CAAxB,EAAuC;AACrC,wBACE;AAAM,MAAA,SAAS,EAAEF,KAAK,CAACQ,KAAvB;AAA8B,oBAAa,QAAOA,KAAM;AAAxD,OACGA,KADH,CADF;AAKD;;AAED,MAAIF,IAAI,KAAKJ,WAAW,CAACC,KAAzB,EAAgC;AAC9B,wBACE;AAAM,MAAA,SAAS,EAAEH,KAAK,CAACQ,KAAvB;AAA8B,oBAAa,QAAOA,KAAM;AAAxD,oBACE,oBAAC,SAAD;AAAW,MAAA,SAAS,EAAEb,UAAU,CAACK,KAAK,CAACS,SAAP,EAAkBF,OAAO,IAAIP,KAAK,CAACU,gBAAnC;AAAhC,MADF,CADF;AAKD;;AAED,MAAIJ,IAAI,KAAKJ,WAAW,CAACE,KAAzB,EAAgC;AAC9B,wBACE;AAAM,MAAA,SAAS,EAAEJ,KAAK,CAACQ,KAAvB;AAA8B,oBAAa,QAAOA,KAAM;AAAxD,oBACE,oBAAC,SAAD;AAAW,MAAA,SAAS,EAAEb,UAAU,CAACK,KAAK,CAACW,SAAP,EAAkBJ,OAAO,IAAIP,KAAK,CAACY,gBAAnC;AAAhC,MADF,CADF;AAKD;AACF,CAxBD;;AA0BA,MAAMC,oBAAoB,GAAGC,KAAK,IAAI;AACpC,QAAM;AAACR,IAAAA,IAAD;AAAOC,IAAAA;AAAP,MAAkBO,KAAxB;AACA,sBACE;AACE,IAAA,SAAS,EAAEnB,UAAU,CACnBK,KAAK,CAACe,OADa,EAEnBT,IAAI,KAAKJ,WAAW,CAACC,KAArB,IAA8BH,KAAK,CAACG,KAFjB,EAGnBG,IAAI,KAAKJ,WAAW,CAACE,KAArB,IAA8BJ,KAAK,CAACI,KAHjB,EAInBG,OAAO,IAAIP,KAAK,CAACO,OAJE,CADvB;AAOE,iBAAU;AAPZ,kBASE,oBAAC,OAAD,EAAaO,KAAb,CATF,CADF;AAaD,CAfD;;AAiBAD,oBAAoB,CAACZ,SAArB,2CAAiCA,SAAjC;AAEA,eAAeY,oBAAf","sourcesContent":["import React from 'react';\nimport classnames from 'classnames';\nimport {\n NovaCompositionCoorpacademyCheck as RightIcon,\n NovaSolidStatusClose as WrongIcon\n} from '@coorpacademy/nova-icons';\nimport style from './style.css';\nimport propTypes from './prop-types';\n\nexport const ICON_VALUES = {\n right: 'right',\n wrong: 'wrong',\n 'no-answer': 'no-answer'\n};\n\nconst Content = ({icon, current, value}) => {\n if (icon === ICON_VALUES['no-answer']) {\n return (\n <span className={style.value} aria-label={`step ${value}`}>\n {value}\n </span>\n );\n }\n\n if (icon === ICON_VALUES.right) {\n return (\n <span className={style.value} aria-label={`step ${value}`}>\n <RightIcon className={classnames(style.rightIcon, current && style.currentRightIcon)} />\n </span>\n );\n }\n\n if (icon === ICON_VALUES.wrong) {\n return (\n <span className={style.value} aria-label={`step ${value}`}>\n <WrongIcon className={classnames(style.wrongIcon, current && style.currentWrongIcon)} />\n </span>\n );\n }\n};\n\nconst ReviewHeaderStepItem = props => {\n const {icon, current} = props;\n return (\n <div\n className={classnames(\n style.default,\n icon === ICON_VALUES.right && style.right,\n icon === ICON_VALUES.wrong && style.wrong,\n current && style.current\n )}\n data-name=\"header-step-item\"\n >\n <Content {...props} />\n </div>\n );\n};\n\nReviewHeaderStepItem.propTypes = propTypes;\n\nexport default ReviewHeaderStepItem;\n"],"file":"index.js"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/atom/review-header-step-item/prop-types.js"],"names":["PropTypes","icon","string","current","bool","value"],"mappings":"AAAA,OAAOA,SAAP,MAAsB,YAAtB;AAEA,eAAe;AACbC,EAAAA,IAAI,EAAED,SAAS,CAACE,MADH;AAEbC,EAAAA,OAAO,EAAEH,SAAS,CAACI,IAFN;AAGbC,EAAAA,KAAK,EAAEL,SAAS,CAACE;AAHJ,CAAf","sourcesContent":["import PropTypes from 'prop-types';\n\nexport default {\n icon: PropTypes.string,\n current: PropTypes.bool,\n value: PropTypes.string\n};\n"],"file":"prop-types.js"}
|
|
@@ -4,6 +4,7 @@ import getOr from 'lodash/fp/getOr';
|
|
|
4
4
|
import map from 'lodash/fp/map';
|
|
5
5
|
import { NovaSolidStatusCheckCircle2 as CheckIcon, NovaSolidVoteRewardsVoteHeart as HeartIcon, NovaCompositionCoorpacademyInformationIcon as InformationIcon, NovaSolidInterfaceFeedbackInterfaceQuestionMark as QuestionIcon, NovaLineSelectionCursorsCursorArrowTarget as TargetIcon } from '@coorpacademy/nova-icons';
|
|
6
6
|
import style from './style.css';
|
|
7
|
+
import propTypes from './prop-types';
|
|
7
8
|
const ICONS = {
|
|
8
9
|
skills: TargetIcon,
|
|
9
10
|
questions: QuestionIcon,
|
|
@@ -86,23 +87,9 @@ const ReviewPresentation = props => {
|
|
|
86
87
|
}, labelsList)));
|
|
87
88
|
};
|
|
88
89
|
|
|
89
|
-
const levelItem = process.env.NODE_ENV !== "production" ? PropTypes.shape({
|
|
90
|
-
text: PropTypes.string,
|
|
91
|
-
tooltipText: PropTypes.string
|
|
92
|
-
}) : {};
|
|
93
90
|
ToolTip.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
94
91
|
tooltipText: PropTypes.string
|
|
95
92
|
} : {};
|
|
96
|
-
ReviewPresentation.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
97
|
-
'aria-label': PropTypes.string,
|
|
98
|
-
reviewTitle: PropTypes.string,
|
|
99
|
-
reviewText: PropTypes.string,
|
|
100
|
-
labelsList: PropTypes.shape({
|
|
101
|
-
skills: levelItem,
|
|
102
|
-
questions: levelItem,
|
|
103
|
-
lifes: levelItem,
|
|
104
|
-
allright: levelItem
|
|
105
|
-
})
|
|
106
|
-
} : {};
|
|
93
|
+
ReviewPresentation.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
|
|
107
94
|
export default ReviewPresentation;
|
|
108
95
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/atom/review-presentation/index.js"],"names":["React","PropTypes","getOr","map","NovaSolidStatusCheckCircle2","CheckIcon","NovaSolidVoteRewardsVoteHeart","HeartIcon","NovaCompositionCoorpacademyInformationIcon","InformationIcon","NovaSolidInterfaceFeedbackInterfaceQuestionMark","QuestionIcon","NovaLineSelectionCursorsCursorArrowTarget","TargetIcon","style","ICONS","skills","questions","lifes","allright","getIcon","icon","Icon","labelIcon","ToolTip","tooltipText","tooltipContainer","tooltipIconContainer","informationIcon","toolTip","ReviewPresentation","props","ariaLabel","reviewTitle","reviewText","labelsList","reviewWrapper","__html","reviewListWrapper","convert","cap","label","key","reviewList","reviewListItemWrapper","reviewListText","text","
|
|
1
|
+
{"version":3,"sources":["../../../src/atom/review-presentation/index.js"],"names":["React","PropTypes","getOr","map","NovaSolidStatusCheckCircle2","CheckIcon","NovaSolidVoteRewardsVoteHeart","HeartIcon","NovaCompositionCoorpacademyInformationIcon","InformationIcon","NovaSolidInterfaceFeedbackInterfaceQuestionMark","QuestionIcon","NovaLineSelectionCursorsCursorArrowTarget","TargetIcon","style","propTypes","ICONS","skills","questions","lifes","allright","getIcon","icon","Icon","labelIcon","ToolTip","tooltipText","tooltipContainer","tooltipIconContainer","informationIcon","toolTip","ReviewPresentation","props","ariaLabel","reviewTitle","reviewText","labelsList","reviewWrapper","__html","reviewListWrapper","convert","cap","label","key","reviewList","reviewListItemWrapper","reviewListText","text","string"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,KAAP,MAAkB,iBAAlB;AACA,OAAOC,GAAP,MAAgB,eAAhB;AACA,SACEC,2BAA2B,IAAIC,SADjC,EAEEC,6BAA6B,IAAIC,SAFnC,EAGEC,0CAA0C,IAAIC,eAHhD,EAIEC,+CAA+C,IAAIC,YAJrD,EAKEC,yCAAyC,IAAIC,UAL/C,QAMO,0BANP;AAOA,OAAOC,KAAP,MAAkB,aAAlB;AACA,OAAOC,SAAP,MAAsB,cAAtB;AAEA,MAAMC,KAAK,GAAG;AACZC,EAAAA,MAAM,EAAEJ,UADI;AAEZK,EAAAA,SAAS,EAAEP,YAFC;AAGZQ,EAAAA,KAAK,EAAEZ,SAHK;AAIZa,EAAAA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F;AAGE,IAAA,uBAAuB,EAAE;AAACG,MAAAA,MAAM,EAAEH;AAAT;AAH3B,IANF,eAWE;AAAI,IAAA,SAAS,EAAErB,KAAK,CAACyB;AAArB,KACGpC,GAAG,CAACqC,OAAJ,CAAY;AAACC,IAAAA,GAAG,EAAE;AAAN,GAAZ,EAA0B,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACzC,wBACE;AAAI,MAAA,GAAG,EAAG,QAAOA,GAAI,EAArB;AAAwB,MAAA,SAAS,EAAE7B,KAAK,CAAC8B;AAAzC,oBACE;AAAK,MAAA,SAAS,EAAE9B,KAAK,CAAC+B,qBAAtB;AAA6C,sBAA7C;AAAsD,kBAAS;AAA/D,oBACE;AAAK,MAAA,SAAS,EAAE/B,KAAK,CAACgC;AAAtB,OACGzB,OAAO,CAACsB,GAAD,CADV,OACkBD,KAAK,CAACK,IADxB,CADF,eAIE,oBAAC,OAAD;AAAS,MAAA,WAAW,EAAEL,KAAK,CAAChB;AAA5B,MAJF,CADF,CADF;AAUD,GAXA,EAWEU,UAXF,CADH,CAXF,CADF;AA4BD,CA/BD;;AAiCAX,OAAO,CAACV,SAAR,2CAAoB;AAClBW,EAAAA,WAAW,EAAEzB,SAAS,CAAC+C;AADL,CAApB;AAIAjB,kBAAkB,CAAChB,SAAnB,2CAA+BA,SAA/B;AAEA,eAAegB,kBAAf","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport getOr from 'lodash/fp/getOr';\nimport map from 'lodash/fp/map';\nimport {\n NovaSolidStatusCheckCircle2 as CheckIcon,\n NovaSolidVoteRewardsVoteHeart as HeartIcon,\n NovaCompositionCoorpacademyInformationIcon as InformationIcon,\n NovaSolidInterfaceFeedbackInterfaceQuestionMark as QuestionIcon,\n NovaLineSelectionCursorsCursorArrowTarget as TargetIcon\n} from '@coorpacademy/nova-icons';\nimport style from './style.css';\nimport propTypes from './prop-types';\n\nconst ICONS = {\n skills: TargetIcon,\n questions: QuestionIcon,\n lifes: HeartIcon,\n allright: CheckIcon\n};\n\nconst getIcon = icon => {\n const Icon = getOr(null, icon, ICONS);\n\n /* istanbul ignore next */\n if (!Icon) {\n return <div className={style.labelIcon} />;\n }\n return <Icon className={style.labelIcon} />;\n};\n\nconst ToolTip = ({tooltipText}) => {\n return (\n <div className={style.tooltipContainer}>\n <div className={style.tooltipIconContainer}>\n <InformationIcon className={style.informationIcon} width={12} height={12} />\n </div>\n <div className={style.toolTip}>\n <div className={style.tooltipText}>{tooltipText}</div>\n </div>\n </div>\n );\n};\n\nconst ReviewPresentation = props => {\n const {'aria-label': ariaLabel, reviewTitle, reviewText, labelsList} = props;\n\n return (\n <div className={style.reviewWrapper} aria-label={ariaLabel}>\n <div\n className={style.reviewTitle}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: reviewTitle}}\n />\n <div\n className={style.reviewText}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: reviewText}}\n />\n <ul className={style.reviewListWrapper}>\n {map.convert({cap: false})((label, key) => {\n return (\n <li key={`step-${key}`} className={style.reviewList}>\n <div className={style.reviewListItemWrapper} data-tip data-for=\"reviewListItem\">\n <div className={style.reviewListText}>\n {getIcon(key)} {label.text}\n </div>\n <ToolTip tooltipText={label.tooltipText} />\n </div>\n </li>\n );\n }, labelsList)}\n </ul>\n </div>\n );\n};\n\nToolTip.propTypes = {\n tooltipText: PropTypes.string\n};\n\nReviewPresentation.propTypes = propTypes;\n\nexport default ReviewPresentation;\n"],"file":"index.js"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
const levelItem = PropTypes.shape({
|
|
3
|
+
text: PropTypes.string,
|
|
4
|
+
tooltipText: PropTypes.string
|
|
5
|
+
});
|
|
6
|
+
const propTypes = {
|
|
7
|
+
'aria-label': PropTypes.string,
|
|
8
|
+
reviewTitle: PropTypes.string,
|
|
9
|
+
reviewText: PropTypes.string,
|
|
10
|
+
labelsList: PropTypes.shape({
|
|
11
|
+
skills: levelItem,
|
|
12
|
+
questions: levelItem,
|
|
13
|
+
lifes: levelItem,
|
|
14
|
+
allright: levelItem
|
|
15
|
+
})
|
|
16
|
+
};
|
|
17
|
+
export default propTypes;
|
|
18
|
+
//# sourceMappingURL=prop-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/atom/review-presentation/prop-types.js"],"names":["PropTypes","levelItem","shape","text","string","tooltipText","propTypes","reviewTitle","reviewText","labelsList","skills","questions","lifes","allright"],"mappings":"AAAA,OAAOA,SAAP,MAAsB,YAAtB;AAEA,MAAMC,SAAS,GAAGD,SAAS,CAACE,KAAV,CAAgB;AAChCC,EAAAA,IAAI,EAAEH,SAAS,CAACI,MADgB;AAEhCC,EAAAA,WAAW,EAAEL,SAAS,CAACI;AAFS,CAAhB,CAAlB;AAKA,MAAME,SAAS,GAAG;AAChB,gBAAcN,SAAS,CAACI,MADR;AAEhBG,EAAAA,WAAW,EAAEP,SAAS,CAACI,MAFP;AAGhBI,EAAAA,UAAU,EAAER,SAAS,CAACI,MAHN;AAIhBK,EAAAA,UAAU,EAAET,SAAS,CAACE,KAAV,CAAgB;AAC1BQ,IAAAA,MAAM,EAAET,SADkB;AAE1BU,IAAAA,SAAS,EAAEV,SAFe;AAG1BW,IAAAA,KAAK,EAAEX,SAHmB;AAI1BY,IAAAA,QAAQ,EAAEZ;AAJgB,GAAhB;AAJI,CAAlB;AAYA,eAAeK,SAAf","sourcesContent":["import PropTypes from 'prop-types';\n\nconst levelItem = PropTypes.shape({\n text: PropTypes.string,\n tooltipText: PropTypes.string\n});\n\nconst propTypes = {\n 'aria-label': PropTypes.string,\n reviewTitle: PropTypes.string,\n reviewText: PropTypes.string,\n labelsList: PropTypes.shape({\n skills: levelItem,\n questions: levelItem,\n lifes: levelItem,\n allright: levelItem\n })\n};\n\nexport default propTypes;\n"],"file":"prop-types.js"}
|
package/es/atom/tab/index.js
CHANGED
|
@@ -11,6 +11,7 @@ const Tab = ({
|
|
|
11
11
|
}) => {
|
|
12
12
|
const handleTabClick = useMemo(() => () => onClick(targetContent), [onClick, targetContent]);
|
|
13
13
|
return /*#__PURE__*/React.createElement("div", {
|
|
14
|
+
"data-name": "tab",
|
|
14
15
|
className: style.tab,
|
|
15
16
|
onClick: handleTabClick
|
|
16
17
|
}, /*#__PURE__*/React.createElement("div", {
|
package/es/atom/tab/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/atom/tab/index.js"],"names":["React","useMemo","PropTypes","style","Tab","onClick","links","title","targetContent","handleTabClick","tab","link","propTypes","string","arrayOf","objectOf","func"],"mappings":";AAAA,OAAOA,KAAP,IAAeC,OAAf,QAA6B,OAA7B;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,GAAG,GAAG,CAAC;AAACC,EAAAA,OAAD;AAAUC,EAAAA,KAAV;AAAiBC,EAAAA,KAAjB;AAAwBC,EAAAA;AAAxB,CAAD,KAA4C;AACtD,QAAMC,cAAc,GAAGR,OAAO,CAAC,MAAM,MAAMI,OAAO,CAACG,aAAD,CAApB,EAAqC,CAACH,OAAD,EAAUG,aAAV,CAArC,CAA9B;AAEA,sBACE;AAAK,IAAA,SAAS,EAAEL,KAAK,CAACO,
|
|
1
|
+
{"version":3,"sources":["../../../src/atom/tab/index.js"],"names":["React","useMemo","PropTypes","style","Tab","onClick","links","title","targetContent","handleTabClick","tab","link","propTypes","string","arrayOf","objectOf","func"],"mappings":";AAAA,OAAOA,KAAP,IAAeC,OAAf,QAA6B,OAA7B;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,GAAG,GAAG,CAAC;AAACC,EAAAA,OAAD;AAAUC,EAAAA,KAAV;AAAiBC,EAAAA,KAAjB;AAAwBC,EAAAA;AAAxB,CAAD,KAA4C;AACtD,QAAMC,cAAc,GAAGR,OAAO,CAAC,MAAM,MAAMI,OAAO,CAACG,aAAD,CAApB,EAAqC,CAACH,OAAD,EAAUG,aAAV,CAArC,CAA9B;AAEA,sBACE;AAAK,iBAAU,KAAf;AAAqB,IAAA,SAAS,EAAEL,KAAK,CAACO,GAAtC;AAA2C,IAAA,OAAO,EAAED;AAApD,kBACE;AAAK,IAAA,SAAS,EAAEN,KAAK,CAACI;AAAtB,KAA8BA,KAA9B,CADF,eAEE;AAAK,IAAA,SAAS,EAAEJ,KAAK,CAACQ;AAAtB,KACG,KACCA,IAAI,iBACF;AAAK,IAAA,GAAG,EAAEA,IAAI,CAACJ;AAAf,KAAuBI,IAAI,CAACJ,KAA5B,CAFH,EAICD,KAJD,CADH,CAFF,CADF;AAaD,CAhBD;;AAkBAF,GAAG,CAACQ,SAAJ,2CAAgB;AACdL,EAAAA,KAAK,EAAEL,SAAS,CAACW,MADH;AAEdP,EAAAA,KAAK,EAAEJ,SAAS,CAACY,OAAV,CAAkBZ,SAAS,CAACa,QAAV,CAAmBb,SAAS,CAACW,MAA7B,CAAlB,CAFO;AAGdR,EAAAA,OAAO,EAAEH,SAAS,CAACc,IAHL;AAIdR,EAAAA,aAAa,EAAEN,SAAS,CAACW;AAJX,CAAhB;AAOA,eAAeT,GAAf","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"}
|
|
@@ -5,7 +5,6 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
5
5
|
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; }
|
|
6
6
|
|
|
7
7
|
import React from 'react';
|
|
8
|
-
import PropTypes from 'prop-types';
|
|
9
8
|
import VideoPlayer from '../video-player';
|
|
10
9
|
import DropDown from '../questions/drop-down';
|
|
11
10
|
import FreeText from '../questions/free-text';
|
|
@@ -16,9 +15,7 @@ import QuestionRange from '../questions/question-range';
|
|
|
16
15
|
import Template from '../questions/template';
|
|
17
16
|
import Audio from '../audio';
|
|
18
17
|
import style from './style.css';
|
|
19
|
-
|
|
20
|
-
export const TYPE_VIDEO = 'video';
|
|
21
|
-
export const TYPE_AUDIO = 'audio';
|
|
18
|
+
import propTypes, { MediaViewPropTypes, TYPE_AUDIO, TYPE_IMAGE, TYPE_VIDEO } from './prop-types';
|
|
22
19
|
|
|
23
20
|
const MediaView = ({
|
|
24
21
|
media
|
|
@@ -60,21 +57,7 @@ const MediaView = ({
|
|
|
60
57
|
}
|
|
61
58
|
};
|
|
62
59
|
|
|
63
|
-
|
|
64
|
-
const videoPropType = process.env.NODE_ENV !== "production" ? PropTypes.shape(_extends(_extends({}, VideoPlayer.propTypes), {}, {
|
|
65
|
-
type: isType(TYPE_VIDEO).isRequired
|
|
66
|
-
})) : {};
|
|
67
|
-
const imgPropType = process.env.NODE_ENV !== "production" ? PropTypes.shape({
|
|
68
|
-
type: isType(TYPE_IMAGE).isRequired,
|
|
69
|
-
url: PropTypes.string.isRequired
|
|
70
|
-
}) : {};
|
|
71
|
-
const audioPropType = process.env.NODE_ENV !== "production" ? PropTypes.shape({
|
|
72
|
-
type: isType(TYPE_AUDIO).isRequired,
|
|
73
|
-
mediaUrl: PropTypes.string.isRequired
|
|
74
|
-
}) : {};
|
|
75
|
-
MediaView.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
76
|
-
media: PropTypes.oneOfType([videoPropType, imgPropType, audioPropType])
|
|
77
|
-
} : {};
|
|
60
|
+
MediaView.propTypes = process.env.NODE_ENV !== "production" ? MediaViewPropTypes : {};
|
|
78
61
|
|
|
79
62
|
const Answer = props => {
|
|
80
63
|
const {
|
|
@@ -84,6 +67,8 @@ const Answer = props => {
|
|
|
84
67
|
} = props;
|
|
85
68
|
|
|
86
69
|
const buildAnswer = () => {
|
|
70
|
+
// (propTypes model.type is properly defined)
|
|
71
|
+
// eslint-disable-next-line react/prop-types
|
|
87
72
|
const {
|
|
88
73
|
type
|
|
89
74
|
} = model;
|
|
@@ -123,12 +108,6 @@ const Answer = props => {
|
|
|
123
108
|
}) : null, answerView);
|
|
124
109
|
};
|
|
125
110
|
|
|
126
|
-
Answer.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
127
|
-
model: PropTypes.shape({
|
|
128
|
-
type: PropTypes.oneOf(['qcmDrag', 'qcm', 'qcmGraphic', 'freeText', 'dropDown', 'slider', 'template']).isRequired
|
|
129
|
-
}),
|
|
130
|
-
help: PropTypes.string,
|
|
131
|
-
media: MediaView.propTypes.media
|
|
132
|
-
} : {};
|
|
111
|
+
Answer.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
|
|
133
112
|
export default Answer;
|
|
134
113
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/molecule/answer/index.js"],"names":["React","
|
|
1
|
+
{"version":3,"sources":["../../../src/molecule/answer/index.js"],"names":["React","VideoPlayer","DropDown","FreeText","QcmDrag","Qcm","QcmGraphic","QuestionRange","Template","Audio","style","propTypes","MediaViewPropTypes","TYPE_AUDIO","TYPE_IMAGE","TYPE_VIDEO","MediaView","media","videoId","type","childProps","backgroundImage","url","video","audio","Answer","props","model","help","buildAnswer","answerView","wrapper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ideoPlayer 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,32 @@
|
|
|
1
|
+
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); }
|
|
2
|
+
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import VideoPlayerPropTypes from '../video-player/prop-types';
|
|
5
|
+
export const TYPE_IMAGE = 'img';
|
|
6
|
+
export const TYPE_VIDEO = 'video';
|
|
7
|
+
export const TYPE_AUDIO = 'audio';
|
|
8
|
+
|
|
9
|
+
const isType = name => PropTypes.oneOf([name]);
|
|
10
|
+
|
|
11
|
+
const videoPropType = PropTypes.shape(_extends(_extends({}, VideoPlayerPropTypes), {}, {
|
|
12
|
+
type: isType(TYPE_VIDEO).isRequired
|
|
13
|
+
}));
|
|
14
|
+
const imgPropType = PropTypes.shape({
|
|
15
|
+
type: isType(TYPE_IMAGE).isRequired,
|
|
16
|
+
url: PropTypes.string.isRequired
|
|
17
|
+
});
|
|
18
|
+
const audioPropType = PropTypes.shape({
|
|
19
|
+
type: isType(TYPE_AUDIO).isRequired,
|
|
20
|
+
mediaUrl: PropTypes.string.isRequired
|
|
21
|
+
});
|
|
22
|
+
export const MediaViewPropTypes = {
|
|
23
|
+
media: PropTypes.oneOfType([videoPropType, imgPropType, audioPropType])
|
|
24
|
+
};
|
|
25
|
+
export default {
|
|
26
|
+
model: PropTypes.shape({
|
|
27
|
+
type: PropTypes.oneOf(['qcmDrag', 'qcm', 'qcmGraphic', 'freeText', 'dropDown', 'slider', 'template']).isRequired
|
|
28
|
+
}),
|
|
29
|
+
help: PropTypes.string,
|
|
30
|
+
media: MediaViewPropTypes.media
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=prop-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/molecule/answer/prop-types.js"],"names":["PropTypes","VideoPlayerPropTypes","TYPE_IMAGE","TYPE_VIDEO","TYPE_AUDIO","isType","name","oneOf","videoPropType","shape","type","isRequired","imgPropType","url","string","audioPropType","media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ADM;AAYbU,EAAAA,IAAI,EAAErB,SAAS,CAACc,MAZH;AAabI,EAAAA,KAAK,EAAED,kBAAkB,CAACC;AAbb,CAAf","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"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { View, StyleSheet, TextInput } from 'react-native';
|
|
2
|
+
import React, { useState, useEffect, useMemo } from 'react';
|
|
3
|
+
import { useTemplateContext } from '../../../template/app-review/template-context';
|
|
4
|
+
import { ANALYTICS_EVENT_TYPE } from '../../../variables/analytics';
|
|
5
|
+
|
|
6
|
+
const createStyleSheet = (brandTheme, theme) => StyleSheet.create({
|
|
7
|
+
input: {
|
|
8
|
+
padding: theme.spacing.tiny,
|
|
9
|
+
borderWidth: 1,
|
|
10
|
+
borderColor: theme.colors.gray.lightMedium,
|
|
11
|
+
borderRadius: theme.radius.common,
|
|
12
|
+
backgroundColor: theme.colors.white,
|
|
13
|
+
minWidth: 175
|
|
14
|
+
},
|
|
15
|
+
text: {
|
|
16
|
+
borderColor: brandTheme?.colors.primary,
|
|
17
|
+
color: brandTheme?.colors.primary || theme.colors.gray.medium,
|
|
18
|
+
fontWeight: theme.fontWeight.bold,
|
|
19
|
+
fontSize: theme.fontSize.regular,
|
|
20
|
+
textAlign: 'center'
|
|
21
|
+
},
|
|
22
|
+
spaced: {
|
|
23
|
+
paddingVertical: theme.spacing.tiny
|
|
24
|
+
},
|
|
25
|
+
fullWitdh: {
|
|
26
|
+
width: '100%'
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const logEvent = (eventName, analytics, questionType) => {
|
|
31
|
+
analytics && analytics.logEvent(eventName, {
|
|
32
|
+
id: `question-input-text`,
|
|
33
|
+
questionType
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const FreeText = props => {
|
|
38
|
+
const templateContext = useTemplateContext();
|
|
39
|
+
const [styleSheet, setStylesheet] = useState(null);
|
|
40
|
+
const {
|
|
41
|
+
brandTheme,
|
|
42
|
+
theme,
|
|
43
|
+
translations
|
|
44
|
+
} = templateContext;
|
|
45
|
+
const PLACEHOLDER_COLOR = theme.colors.gray.medium; // ------------------------------------
|
|
46
|
+
|
|
47
|
+
const {
|
|
48
|
+
analytics,
|
|
49
|
+
questionType,
|
|
50
|
+
fullWitdh,
|
|
51
|
+
testID,
|
|
52
|
+
onChange,
|
|
53
|
+
isDisabled,
|
|
54
|
+
value
|
|
55
|
+
} = props; // ------------------------------------
|
|
56
|
+
|
|
57
|
+
const handleFocus = useMemo(() => analytics && logEvent(ANALYTICS_EVENT_TYPE.INPUT_FOCUS, analytics, questionType), [analytics, questionType]);
|
|
58
|
+
const handleBlur = useMemo(() => analytics && logEvent(ANALYTICS_EVENT_TYPE.INPUT_BLUR, analytics, questionType), [analytics, questionType]); // ------------------------------------
|
|
59
|
+
|
|
60
|
+
useEffect(() => {
|
|
61
|
+
const _stylesheet = createStyleSheet(brandTheme, theme);
|
|
62
|
+
|
|
63
|
+
setStylesheet(_stylesheet);
|
|
64
|
+
}, [brandTheme, theme]); // ------------------------------------
|
|
65
|
+
|
|
66
|
+
if (!styleSheet) {
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
71
|
+
style: [styleSheet.spaced, fullWitdh && styleSheet.fullWitdh],
|
|
72
|
+
testID: testID
|
|
73
|
+
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
74
|
+
style: [styleSheet.input, styleSheet.text],
|
|
75
|
+
onFocus: handleFocus,
|
|
76
|
+
onBlur: handleBlur,
|
|
77
|
+
onChangeText: onChange,
|
|
78
|
+
placeholder: translations.typeHere,
|
|
79
|
+
placeholderTextColor: PLACEHOLDER_COLOR,
|
|
80
|
+
value: value,
|
|
81
|
+
testID: testID,
|
|
82
|
+
editable: !isDisabled,
|
|
83
|
+
selectTextOnFocus: !isDisabled
|
|
84
|
+
}));
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
export default FreeText;
|
|
88
|
+
//# sourceMappingURL=index.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/molecule/questions/free-text/index.native.tsx"],"names":["View","StyleSheet","TextInput","React","useState","useEffect","useMemo","useTemplateContext","ANALYTICS_EVENT_TYPE","createStyleSheet","brandTheme","theme","create","input","padding","spacing","tiny","borderWidth","borderColor","colors","gray","lightMedium","borderRadius","radius","common","backgroundColor","white","minWidth","text","primary","color","medium","fontWeight","bold","fontSize","regular","textAlign","spaced","paddingVertical","fullWitdh","width","logEvent","eventName","analytics","questionType","id","FreeText","props","templateContext","styleSheet","setStylesheet","translations","PLACEHOLDER_COLOR","testID","onChange","isDisabled","value","handleFocus","INPUT_FOCUS","handleBlur","INPUT_BLUR","_stylesheet","typeHere"],"mappings":"AAAA,SAAQA,IAAR,EAAcC,UAAd,EAA0BC,SAA1B,QAA0C,cAA1C;AACA,OAAOC,KAAP,IAA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BjC;;AAEA,MAAI,CAACsC,UAAL,EAAiB;AACf,WAAO,IAAP;AACD;;AAED,sBACE,oBAAC,IAAD;AAAM,IAAA,KAAK,EAAE,CAACA,UAAU,CAACZ,MAAZ,EAAoBE,SAAS,IAAIU,UAAU,CAACV,SAA5C,CAAb;AAAqE,IAAA,MAAM,EAAEc;AAA7E,kBACE,oBAAC,SAAD;AACE,IAAA,KAAK,EAAE,CAACJ,UAAU,CAACpC,KAAZ,EAAmBoC,UAAU,CAACrB,IAA9B,CADT;AAEE,IAAA,OAAO,EAAE6B,WAFX;AAGE,IAAA,MAAM,EAAEE,UAHV;AAIE,IAAA,YAAY,EAAEL,QAJhB;AAKE,IAAA,WAAW,EAAEH,YAAY,CAACW,QAL5B;AAME,IAAA,oBAAoB,EAAEV,iBANxB;AAOE,IAAA,KAAK,EAAEI,KAPT;AAQE,IAAA,MAAM,EAAEH,MARV;AASE,IAAA,QAAQ,EAAE,CAACE,UATb;AAUE,IAAA,iBAAiB,EAAE,CAACA;AAVtB,IADF,CADF;AAgBD,CAnDD;;AAqDA,eAAeT,QAAf","sourcesContent":["import {View, StyleSheet, TextInput} from 'react-native';\nimport React, {useState, useEffect, useMemo} from 'react';\nimport {useTemplateContext} from '../../../template/app-review/template-context';\nimport {ANALYTICS_EVENT_TYPE, Analytics} from '../../../variables/analytics';\n\ntype QuestionType = 'basic' | 'template';\n\ninterface Props {\n children: string;\n fullWitdh: boolean;\n testID: string;\n questionType: QuestionType;\n analytics?: Analytics;\n onChange: Function;\n isDisabled: boolean;\n value: string;\n}\n\ntype StyleSheetType = {\n input: {\n padding: string;\n borderWidth: number;\n borderColor: string;\n borderRadius: number;\n backgroundColor: string;\n minWidth: number;\n };\n text: {\n color: string;\n fontWeight: number;\n fontSize: number;\n textAlign: string;\n };\n spaced: {\n paddingVertical: number;\n };\n fullWitdh: {\n width: string;\n };\n};\n\nconst createStyleSheet = (brandTheme, theme) =>\n StyleSheet.create({\n input: {\n padding: theme.spacing.tiny,\n borderWidth: 1,\n borderColor: theme.colors.gray.lightMedium,\n borderRadius: theme.radius.common,\n backgroundColor: theme.colors.white,\n minWidth: 175\n },\n text: {\n borderColor: brandTheme?.colors.primary,\n color: brandTheme?.colors.primary || theme.colors.gray.medium,\n fontWeight: theme.fontWeight.bold,\n fontSize: theme.fontSize.regular,\n textAlign: 'center'\n },\n spaced: {\n paddingVertical: theme.spacing.tiny\n },\n fullWitdh: {\n width: '100%'\n }\n });\n\nconst logEvent = (eventName: string, analytics: Analytics, questionType: QuestionType) => {\n analytics &&\n analytics.logEvent(eventName, {\n id: `question-input-text`,\n questionType\n });\n};\n\nconst FreeText = (props: Props) => {\n const templateContext = useTemplateContext();\n const [styleSheet, setStylesheet] = useState<StyleSheetType | null>(null);\n const {brandTheme, theme, translations} = templateContext;\n const PLACEHOLDER_COLOR = theme.colors.gray.medium;\n\n // ------------------------------------\n\n const {analytics, questionType, fullWitdh, testID, onChange, isDisabled, value} = props;\n\n // ------------------------------------\n\n const handleFocus = useMemo(\n () => analytics && logEvent(ANALYTICS_EVENT_TYPE.INPUT_FOCUS, analytics, questionType),\n [analytics, questionType]\n );\n\n const handleBlur = useMemo(\n () => analytics && logEvent(ANALYTICS_EVENT_TYPE.INPUT_BLUR, analytics, questionType),\n [analytics, questionType]\n );\n\n // ------------------------------------\n\n useEffect(() => {\n const _stylesheet = createStyleSheet(brandTheme, theme);\n setStylesheet(_stylesheet);\n }, [brandTheme, theme]);\n\n // ------------------------------------\n\n if (!styleSheet) {\n return null;\n }\n\n return (\n <View style={[styleSheet.spaced, fullWitdh && styleSheet.fullWitdh]} testID={testID}>\n <TextInput\n style={[styleSheet.input, styleSheet.text]}\n onFocus={handleFocus}\n onBlur={handleBlur}\n onChangeText={onChange}\n placeholder={translations.typeHere}\n placeholderTextColor={PLACEHOLDER_COLOR}\n value={value}\n testID={testID}\n editable={!isDisabled}\n selectTextOnFocus={!isDisabled}\n />\n </View>\n );\n};\n\nexport default FreeText;\n"],"file":"index.native.js"}
|