@coorpacademy/components 10.24.1 → 10.24.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/atom/provider/web-context.js +1 -1
- package/es/atom/provider/web-context.js.map +1 -1
- package/es/hoc/animation-scheduler/index.js +3 -3
- package/es/hoc/animation-scheduler/index.js.map +1 -1
- package/es/hoc/swapper/index.js +1 -1
- package/es/hoc/swapper/index.js.map +1 -1
- package/es/hoc/transition/index.js +1 -1
- package/es/hoc/transition/index.js.map +1 -1
- package/es/molecule/add-to-my-list/index.js +1 -1
- package/es/molecule/add-to-my-list/index.js.map +1 -1
- package/es/molecule/card/index.js +1 -1
- package/es/molecule/card/index.js.map +1 -1
- package/es/molecule/cm-popin/index.js.map +1 -1
- package/es/molecule/dashboard/battle-request-list/index.js +1 -1
- package/es/molecule/dashboard/battle-request-list/index.js.map +1 -1
- package/es/molecule/dashboard/news-list/index.js +1 -1
- package/es/molecule/dashboard/news-list/index.js.map +1 -1
- package/es/molecule/dashboard/review-banner/index.js +1 -1
- package/es/molecule/dashboard/review-banner/index.js.map +1 -1
- package/es/molecule/dashboard/start-battle/index.js +1 -1
- package/es/molecule/dashboard/start-battle/index.js.map +1 -1
- package/es/molecule/draggable/style.css +2 -0
- package/es/molecule/share/index.js +1 -1
- package/es/molecule/share/index.js.map +1 -1
- package/es/organism/review-stacked-slides/index.js +6 -3
- package/es/organism/review-stacked-slides/index.js.map +1 -1
- package/es/organism/review-stacked-slides/index.native.js +6 -3
- package/es/organism/review-stacked-slides/index.native.js.map +1 -1
- package/es/template/app-player/popin-end/summary.js +4 -3
- package/es/template/app-player/popin-end/summary.js.map +1 -1
- package/es/template/app-review/template-context.js +1 -1
- package/es/template/app-review/template-context.js.map +1 -1
- package/es/template/common/dashboard/index.js +1 -1
- package/es/template/common/dashboard/index.js.map +1 -1
- package/lib/atom/provider/web-context.js +1 -1
- package/lib/atom/provider/web-context.js.map +1 -1
- package/lib/hoc/animation-scheduler/index.js +3 -3
- package/lib/hoc/animation-scheduler/index.js.map +1 -1
- package/lib/hoc/swapper/index.js +1 -1
- package/lib/hoc/swapper/index.js.map +1 -1
- package/lib/hoc/transition/index.js +1 -1
- package/lib/hoc/transition/index.js.map +1 -1
- package/lib/molecule/add-to-my-list/index.js +1 -1
- package/lib/molecule/add-to-my-list/index.js.map +1 -1
- package/lib/molecule/card/index.js +1 -1
- package/lib/molecule/card/index.js.map +1 -1
- package/lib/molecule/cm-popin/index.js.map +1 -1
- package/lib/molecule/dashboard/battle-request-list/index.js +1 -1
- package/lib/molecule/dashboard/battle-request-list/index.js.map +1 -1
- package/lib/molecule/dashboard/news-list/index.js +1 -1
- package/lib/molecule/dashboard/news-list/index.js.map +1 -1
- package/lib/molecule/dashboard/review-banner/index.js +1 -1
- package/lib/molecule/dashboard/review-banner/index.js.map +1 -1
- package/lib/molecule/dashboard/start-battle/index.js +1 -1
- package/lib/molecule/dashboard/start-battle/index.js.map +1 -1
- package/lib/molecule/draggable/style.css +2 -0
- package/lib/molecule/share/index.js +1 -1
- package/lib/molecule/share/index.js.map +1 -1
- package/lib/organism/review-stacked-slides/index.js +6 -3
- package/lib/organism/review-stacked-slides/index.js.map +1 -1
- package/lib/organism/review-stacked-slides/index.native.js +6 -3
- package/lib/organism/review-stacked-slides/index.native.js.map +1 -1
- package/lib/template/app-player/popin-end/summary.js +4 -3
- package/lib/template/app-player/popin-end/summary.js.map +1 -1
- package/lib/template/app-review/template-context.js +1 -1
- package/lib/template/app-review/template-context.js.map +1 -1
- package/lib/template/common/dashboard/index.js +1 -1
- package/lib/template/common/dashboard/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["CMPopin","props","content","mode","firstButton","secondButton","onClose","header","icon","backgroundImageUrl","descriptionText","thirdButton","cookieTitle","descriptionBtnTxt","listBtnSwicth","logo","AlertDiamond","WindowUpload","MoonRocket","LogoComponent","backgroundImageStyle","backgroundImage","backgroundSize","renderHeader","style","headerBackground","cookieHeader","cookieIconContainer","cookieIcon","getClassBtnSwitch","index","btnList","firstBtnSwitchContainer","length","lastBtnSwitchContainer","singleSwitchContainer","renderBtnSwitch","map","convert","cap","el","type","title","value","onChange","titlePosition","theme","details","requiredSelection","disabled","id","dataName","background","popinCookie","popin","popinHeader","titleContainer","contentSection","message","__html","descriptionBtn","buttonContainer","largeButton","button","label","handleOnclick","customStyle","propTypes","PropTypes","string","oneOf","shape","func","bool","Cta","arrayOf","InputSwitch"],"sources":["../../../src/molecule/cm-popin/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {\n NovaSolidInterfaceFeedbackInterfaceAlertDiamond as AlertDiamond,\n NovaSolidApplicationsWindowUpload3 as WindowUpload,\n NovaLineSettingsCookie as Cookie,\n NovaSolidSpaceMoonRocket as MoonRocket\n} from '@coorpacademy/nova-icons';\nimport map from 'lodash/fp/map';\nimport Cta from '../../atom/button-link';\nimport ButtonLinkIconOnly from '../../atom/button-link-icon-only';\nimport InputSwitch from '../../atom/input-switch';\nimport style from './style.css';\n\nconst CMPopin = props => {\n const {\n content,\n mode = 'alert',\n firstButton,\n secondButton,\n onClose,\n header,\n icon,\n backgroundImageUrl,\n descriptionText,\n thirdButton,\n cookieTitle,\n descriptionBtnTxt,\n listBtnSwicth\n } = props;\n\n const logo = {\n AlertDiamond,\n WindowUpload,\n MoonRocket\n };\n const LogoComponent = logo[icon];\n\n const backgroundImageStyle = backgroundImageUrl\n ? {\n backgroundImage: `url(${backgroundImageUrl})`,\n backgroundSize: 'cover'\n }\n : null;\n const renderHeader = () => {\n if (header) return <img className={style.headerBackground} src={header} />;\n if (mode === 'cookie')\n return (\n <div className={style.cookieHeader}>\n <div className={style.cookieIconContainer}>\n <Cookie className={style.cookieIcon} />\n </div>\n <div className={style.cookieTitle}>{cookieTitle}</div>\n </div>\n );\n return null;\n };\n const getClassBtnSwitch = (index, btnList) => {\n switch (index) {\n case 0:\n return style.firstBtnSwitchContainer;\n case btnList.length - 1:\n return style.lastBtnSwitchContainer;\n default:\n return style.singleSwitchContainer;\n }\n };\n const renderBtnSwitch = () => {\n return map.convert({cap: false})((el, index) => {\n const {\n type,\n title,\n value,\n onChange,\n titlePosition,\n theme,\n details,\n requiredSelection,\n disabled,\n id,\n 'data-name': dataName\n } = el;\n return (\n <div key={index} className={getClassBtnSwitch(index, listBtnSwicth)}>\n <InputSwitch\n {...{\n type,\n title,\n value,\n onChange,\n titlePosition,\n theme,\n details,\n requiredSelection,\n disabled,\n id,\n 'data-name': dataName\n }}\n />\n </div>\n );\n })(listBtnSwicth);\n };\n return (\n <div\n className={mode !== 'cookie' ? style.background : null}\n style={backgroundImageStyle}\n data-name={'cm-popin-container'}\n >\n <div className={mode === 'cookie' ? style.popinCookie : style.popin}>\n <header className={style.popinHeader}>\n {renderHeader()}\n {onClose ? (\n <ButtonLinkIconOnly\n onClick={onClose}\n data-name={'close-icon'}\n aria-label={'close-icon'}\n size=\"small\"\n icon=\"close\"\n />\n ) : null}\n </header>\n <div className={style.titleContainer}>\n <div className={style.contentSection}>\n {LogoComponent ? <LogoComponent className={style.icon} /> : null}\n {content ? (\n <p\n className={mode === 'alert' ? style.content : style.message}\n data-name={'cm-popin-content'}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: content}}\n />\n ) : null}\n </div>\n {descriptionText ? (\n <p\n className={style.descriptionText}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: descriptionText}}\n />\n ) : null}\n </div>\n {descriptionBtnTxt ? <div className={style.descriptionBtn}>{descriptionBtnTxt}</div> : null}\n {renderBtnSwitch()}\n <div className={style.buttonContainer}>\n {firstButton ? (\n <div className={firstButton.largeButton ? style.largeButton : style.button}>\n <Cta\n label={firstButton.label}\n onClick={firstButton.handleOnclick}\n data-name={'cm-popin-cta'}\n aria-label={firstButton['aria-label']}\n type={firstButton.type}\n customStyle={firstButton.customStyle}\n />\n </div>\n ) : null}\n {secondButton ? (\n <div className={secondButton.largeButton ? style.largeButton : style.button}>\n <Cta\n label={secondButton.label}\n onClick={secondButton.handleOnclick}\n data-name={`cm-popin-cta-${secondButton.type}`}\n aria-label={secondButton['aria-label']}\n type={secondButton.type}\n />\n </div>\n ) : null}\n {thirdButton ? (\n <div className={thirdButton.largeButton ? style.largeButton : style.button}>\n <Cta\n label={thirdButton.label}\n onClick={thirdButton.handleOnclick}\n data-name={`cm-popin-cta-${thirdButton.type}`}\n aria-label={thirdButton['aria-label']}\n type={thirdButton.type}\n customStyle={thirdButton.customStyle}\n />\n </div>\n ) : null}\n </div>\n </div>\n </div>\n );\n};\n\nCMPopin.propTypes = {\n content: PropTypes.string,\n mode: PropTypes.oneOf(['alert', 'information', 'cookie']),\n header: PropTypes.string,\n firstButton: PropTypes.shape({\n label: PropTypes.string,\n handleOnclick: PropTypes.func,\n 'aria-label': PropTypes.string,\n largeButton: PropTypes.bool,\n type: PropTypes.oneOf(['dangerous', 'primary', 'secondary', 'tertiary']),\n customStyle: Cta.propTypes.customStyle\n }),\n secondButton: PropTypes.shape({\n label: PropTypes.string,\n handleOnclick: PropTypes.func,\n type: PropTypes.oneOf(['dangerous', 'primary', 'secondary']),\n 'aria-label': PropTypes.string,\n largeButton: PropTypes.bool,\n customStyle: Cta.propTypes.customStyle\n }),\n thirdButton: PropTypes.shape({\n label: PropTypes.string,\n handleOnclick: PropTypes.func,\n type: PropTypes.oneOf(['dangerous', 'primary', 'secondary']),\n 'aria-label': PropTypes.string,\n largeButton: PropTypes.bool,\n customStyle: Cta.propTypes.customStyle\n }),\n onClose: PropTypes.func,\n icon: PropTypes.string,\n backgroundImageUrl: PropTypes.string,\n descriptionText: PropTypes.string,\n cookieTitle: PropTypes.string,\n descriptionBtnTxt: PropTypes.string,\n listBtnSwicth: PropTypes.arrayOf(PropTypes.shape(InputSwitch.propTypes))\n};\n\nexport default CMPopin;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AAMA;;AACA;;AACA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;eAqCenE,O"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["CMPopin","props","content","mode","firstButton","secondButton","onClose","header","icon","backgroundImageUrl","descriptionText","thirdButton","cookieTitle","descriptionBtnTxt","listBtnSwicth","logo","AlertDiamond","WindowUpload","MoonRocket","LogoComponent","backgroundImageStyle","backgroundImage","backgroundSize","renderHeader","style","headerBackground","cookieHeader","cookieIconContainer","cookieIcon","getClassBtnSwitch","index","btnList","firstBtnSwitchContainer","length","lastBtnSwitchContainer","singleSwitchContainer","renderBtnSwitch","map","convert","cap","el","type","title","value","onChange","titlePosition","theme","details","requiredSelection","disabled","id","dataName","background","popinCookie","popin","popinHeader","titleContainer","contentSection","message","__html","descriptionBtn","buttonContainer","largeButton","button","label","handleOnclick","customStyle","propTypes","PropTypes","string","oneOf","shape","func","bool","Cta","arrayOf","InputSwitch"],"sources":["../../../src/molecule/cm-popin/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {\n NovaSolidInterfaceFeedbackInterfaceAlertDiamond as AlertDiamond,\n NovaSolidApplicationsWindowUpload3 as WindowUpload,\n NovaLineSettingsCookie as Cookie,\n NovaSolidSpaceMoonRocket as MoonRocket\n} from '@coorpacademy/nova-icons';\nimport map from 'lodash/fp/map';\nimport Cta from '../../atom/button-link';\nimport ButtonLinkIconOnly from '../../atom/button-link-icon-only';\nimport InputSwitch from '../../atom/input-switch';\nimport style from './style.css';\n\nconst CMPopin = props => {\n const {\n content,\n mode = 'alert',\n firstButton,\n secondButton,\n onClose,\n header,\n icon,\n backgroundImageUrl,\n descriptionText,\n thirdButton,\n cookieTitle,\n descriptionBtnTxt,\n listBtnSwicth\n } = props;\n\n const logo = {\n AlertDiamond,\n WindowUpload,\n MoonRocket\n };\n const LogoComponent = logo[icon];\n\n const backgroundImageStyle = backgroundImageUrl\n ? {\n backgroundImage: `url(${backgroundImageUrl})`,\n backgroundSize: 'cover'\n }\n : null;\n const renderHeader = () => {\n if (header) return <img className={style.headerBackground} src={header} />;\n if (mode === 'cookie')\n return (\n <div className={style.cookieHeader}>\n <div className={style.cookieIconContainer}>\n <Cookie className={style.cookieIcon} />\n </div>\n <div className={style.cookieTitle}>{cookieTitle}</div>\n </div>\n );\n return null;\n };\n const getClassBtnSwitch = (index, btnList) => {\n switch (index) {\n case 0:\n return style.firstBtnSwitchContainer;\n case btnList.length - 1:\n return style.lastBtnSwitchContainer;\n default:\n return style.singleSwitchContainer;\n }\n };\n const renderBtnSwitch = () => {\n return map.convert({cap: false})((el, index) => {\n const {\n type,\n title,\n value,\n onChange,\n titlePosition,\n theme,\n details,\n requiredSelection,\n disabled,\n id,\n 'data-name': dataName\n } = el;\n return (\n <div key={index} className={getClassBtnSwitch(index, listBtnSwicth)}>\n <InputSwitch\n {...{\n type,\n title,\n value,\n onChange,\n titlePosition,\n theme,\n details,\n requiredSelection,\n disabled,\n id,\n 'data-name': dataName\n }}\n />\n </div>\n );\n })(listBtnSwicth);\n };\n return (\n <div\n className={mode !== 'cookie' ? style.background : null}\n style={backgroundImageStyle}\n data-name={'cm-popin-container'}\n >\n <div className={mode === 'cookie' ? style.popinCookie : style.popin}>\n <header className={style.popinHeader}>\n {renderHeader()}\n {onClose ? (\n <ButtonLinkIconOnly\n onClick={onClose}\n data-name={'close-icon'}\n aria-label={'close-icon'}\n size=\"small\"\n icon=\"close\"\n />\n ) : null}\n </header>\n <div className={style.titleContainer}>\n <div className={style.contentSection}>\n {LogoComponent ? <LogoComponent className={style.icon} /> : null}\n {content ? (\n <p\n className={mode === 'alert' ? style.content : style.message}\n data-name={'cm-popin-content'}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: content}}\n />\n ) : null}\n </div>\n {descriptionText ? (\n <p\n className={style.descriptionText}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: descriptionText}}\n />\n ) : null}\n </div>\n {descriptionBtnTxt ? <div className={style.descriptionBtn}>{descriptionBtnTxt}</div> : null}\n {renderBtnSwitch()}\n <div className={style.buttonContainer}>\n {firstButton ? (\n <div className={firstButton.largeButton ? style.largeButton : style.button}>\n <Cta\n label={firstButton.label}\n onClick={firstButton.handleOnclick}\n data-name={'cm-popin-cta'}\n aria-label={firstButton['aria-label']}\n type={firstButton.type}\n customStyle={firstButton.customStyle}\n />\n </div>\n ) : null}\n {secondButton ? (\n <div className={secondButton.largeButton ? style.largeButton : style.button}>\n <Cta\n label={secondButton.label}\n onClick={secondButton.handleOnclick}\n data-name={`cm-popin-cta-${secondButton.type}`}\n aria-label={secondButton['aria-label']}\n type={secondButton.type}\n />\n </div>\n ) : null}\n {thirdButton ? (\n <div className={thirdButton.largeButton ? style.largeButton : style.button}>\n <Cta\n label={thirdButton.label}\n onClick={thirdButton.handleOnclick}\n data-name={`cm-popin-cta-${thirdButton.type}`}\n aria-label={thirdButton['aria-label']}\n type={thirdButton.type}\n customStyle={thirdButton.customStyle}\n />\n </div>\n ) : null}\n </div>\n </div>\n </div>\n );\n};\n\nCMPopin.propTypes = {\n content: PropTypes.string,\n mode: PropTypes.oneOf(['alert', 'information', 'cookie']),\n header: PropTypes.string,\n firstButton: PropTypes.shape({\n label: PropTypes.string,\n handleOnclick: PropTypes.func,\n 'aria-label': PropTypes.string,\n largeButton: PropTypes.bool,\n type: PropTypes.oneOf(['dangerous', 'primary', 'secondary', 'tertiary']),\n customStyle: Cta.propTypes.customStyle\n }),\n secondButton: PropTypes.shape({\n label: PropTypes.string,\n handleOnclick: PropTypes.func,\n type: PropTypes.oneOf(['dangerous', 'primary', 'secondary']),\n 'aria-label': PropTypes.string,\n largeButton: PropTypes.bool,\n customStyle: Cta.propTypes.customStyle\n }),\n thirdButton: PropTypes.shape({\n label: PropTypes.string,\n handleOnclick: PropTypes.func,\n type: PropTypes.oneOf(['dangerous', 'primary', 'secondary']),\n 'aria-label': PropTypes.string,\n largeButton: PropTypes.bool,\n customStyle: Cta.propTypes.customStyle\n }),\n onClose: PropTypes.func,\n icon: PropTypes.string,\n backgroundImageUrl: PropTypes.string,\n descriptionText: PropTypes.string,\n cookieTitle: PropTypes.string,\n descriptionBtnTxt: PropTypes.string,\n listBtnSwicth: PropTypes.arrayOf(PropTypes.shape(InputSwitch.propTypes))\n};\n\nexport default CMPopin;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AAMA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,OAAO,GAAGC,KAAK,IAAI;EACvB,MAAM;IACJC,OADI;IAEJC,IAAI,GAAG,OAFH;IAGJC,WAHI;IAIJC,YAJI;IAKJC,OALI;IAMJC,MANI;IAOJC,IAPI;IAQJC,kBARI;IASJC,eATI;IAUJC,WAVI;IAWJC,WAXI;IAYJC,iBAZI;IAaJC;EAbI,IAcFb,KAdJ;EAgBA,MAAMc,IAAI,GAAG;IACXC,YAAY,EAAZA,0DADW;IAEXC,YAAY,EAAZA,6CAFW;IAGXC,UAAU,EAAVA;EAHW,CAAb;EAKA,MAAMC,aAAa,GAAGJ,IAAI,CAACP,IAAD,CAA1B;EAEA,MAAMY,oBAAoB,GAAGX,kBAAkB,GAC3C;IACEY,eAAe,EAAG,OAAMZ,kBAAmB,GAD7C;IAEEa,cAAc,EAAE;EAFlB,CAD2C,GAK3C,IALJ;;EAMA,MAAMC,YAAY,GAAG,MAAM;IACzB,IAAIhB,MAAJ,EAAY,oBAAO;MAAK,SAAS,EAAEiB,cAAA,CAAMC,gBAAtB;MAAwC,GAAG,EAAElB;IAA7C,EAAP;IACZ,IAAIJ,IAAI,KAAK,QAAb,EACE,oBACE;MAAK,SAAS,EAAEqB,cAAA,CAAME;IAAtB,gBACE;MAAK,SAAS,EAAEF,cAAA,CAAMG;IAAtB,gBACE,6BAAC,iCAAD;MAAQ,SAAS,EAAEH,cAAA,CAAMI;IAAzB,EADF,CADF,eAIE;MAAK,SAAS,EAAEJ,cAAA,CAAMZ;IAAtB,GAAoCA,WAApC,CAJF,CADF;IAQF,OAAO,IAAP;EACD,CAZD;;EAaA,MAAMiB,iBAAiB,GAAG,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kBAAA,CAAUC,MAhCL;EAiClBxD,iBAAiB,EAAEuD,kBAAA,CAAUC,MAjCX;EAkClBvD,aAAa,EAAEsD,kBAAA,CAAUO,OAAV,CAAkBP,kBAAA,CAAUG,KAAV,CAAgBK,oBAAA,CAAYT,SAA5B,CAAlB;AAlCG,CAApB;eAqCenE,O"}
|
|
@@ -13,7 +13,7 @@ var _style = _interopRequireDefault(require("./style.css"));
|
|
|
13
13
|
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
15
|
|
|
16
|
-
const BattleRequestList =
|
|
16
|
+
const BattleRequestList = _react.default.memo(function BattleRequestList(props) {
|
|
17
17
|
const {
|
|
18
18
|
requests
|
|
19
19
|
} = props;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["BattleRequestList","React","memo","props","requests","cards","map","request","key","style","card","list","propTypes","PropTypes","arrayOf","shape","BattleRequest"],"sources":["../../../../src/molecule/dashboard/battle-request-list/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport BattleRequest from '../../battle-request';\nimport style from './style.css';\n\nconst BattleRequestList = React.memo(function BattleRequestList(props) {\n const {requests} = props;\n\n const cards = requests.map((request, key) => {\n return (\n <div className={style.card} key={key}>\n <BattleRequest {...request} />\n </div>\n );\n });\n\n return (\n <div className={style.list} data-name=\"battle-request-list\">\n {cards}\n </div>\n );\n});\n\nBattleRequestList.propTypes = {\n requests: PropTypes.arrayOf(PropTypes.shape(BattleRequest.propTypes))\n};\n\nexport default BattleRequestList;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,iBAAiB,
|
|
1
|
+
{"version":3,"file":"index.js","names":["BattleRequestList","React","memo","props","requests","cards","map","request","key","style","card","list","propTypes","PropTypes","arrayOf","shape","BattleRequest"],"sources":["../../../../src/molecule/dashboard/battle-request-list/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport BattleRequest from '../../battle-request';\nimport style from './style.css';\n\nconst BattleRequestList = React.memo(function BattleRequestList(props) {\n const {requests} = props;\n\n const cards = requests.map((request, key) => {\n return (\n <div className={style.card} key={key}>\n <BattleRequest {...request} />\n </div>\n );\n });\n\n return (\n <div className={style.list} data-name=\"battle-request-list\">\n {cards}\n </div>\n );\n});\n\nBattleRequestList.propTypes = {\n requests: PropTypes.arrayOf(PropTypes.shape(BattleRequest.propTypes))\n};\n\nexport default BattleRequestList;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,iBAAiB,GAAGC,cAAA,CAAMC,IAAN,CAAW,SAASF,iBAAT,CAA2BG,KAA3B,EAAkC;EACrE,MAAM;IAACC;EAAD,IAAaD,KAAnB;EAEA,MAAME,KAAK,GAAGD,QAAQ,CAACE,GAAT,CAAa,CAACC,OAAD,EAAUC,GAAV,KAAkB;IAC3C,oBACE;MAAK,SAAS,EAAEC,cAAA,CAAMC,IAAtB;MAA4B,GAAG,EAAEF;IAAjC,gBACE,6BAAC,sBAAD,EAAmBD,OAAnB,CADF,CADF;EAKD,CANa,CAAd;EAQA,oBACE;IAAK,SAAS,EAAEE,cAAA,CAAME,IAAtB;IAA4B,aAAU;EAAtC,GACGN,KADH,CADF;AAKD,CAhByB,CAA1B;;AAkBAL,iBAAiB,CAACY,SAAlB,2CAA8B;EAC5BR,QAAQ,EAAES,kBAAA,CAAUC,OAAV,CAAkBD,kBAAA,CAAUE,KAAV,CAAgBC,sBAAA,CAAcJ,SAA9B,CAAlB;AADkB,CAA9B;eAIeZ,iB"}
|
|
@@ -15,7 +15,7 @@ var _style = _interopRequireDefault(require("./style.css"));
|
|
|
15
15
|
|
|
16
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
17
|
|
|
18
|
-
const NewsList =
|
|
18
|
+
const NewsList = _react.default.memo(function NewsList(props) {
|
|
19
19
|
const {
|
|
20
20
|
title,
|
|
21
21
|
news,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["NewsList","React","memo","props","title","news","more","loading","loadingView","style","loader","moreView","onClick","label","cardsView","map","nws","key","card","wrapper","list","propTypes","PropTypes","string","arrayOf","shape","News","func","bool"],"sources":["../../../../src/molecule/dashboard/news-list/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport News from '../../news';\nimport Loader from '../../../atom/loader';\nimport style from './style.css';\n\nconst NewsList = React.memo(function NewsList(props) {\n const {title, news, more, loading = false} = props;\n\n const loadingView = (\n <div className={style.loader}>\n <Loader />\n </div>\n );\n\n const moreView = more ? (\n // eslint-disable-next-line react/jsx-handler-names\n <div className={style.more} onClick={more.onClick}>\n {more.label}\n </div>\n ) : null;\n\n const cardsView = news.map((nws, key) => {\n return (\n <div className={style.card} key={key}>\n <News {...nws} />\n </div>\n );\n });\n\n return (\n <div className={style.wrapper} data-name=\"news-list\">\n <div className={style.list}>\n <div className={style.title}>{title}</div>\n {cardsView}\n {loading ? loadingView : moreView}\n </div>\n </div>\n );\n});\n\nNewsList.propTypes = {\n title: PropTypes.string,\n news: PropTypes.arrayOf(PropTypes.shape(News.propTypes)),\n more: PropTypes.shape({\n label: PropTypes.string,\n onClick: PropTypes.func\n }),\n loading: PropTypes.bool\n};\n\nexport default NewsList;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,QAAQ,
|
|
1
|
+
{"version":3,"file":"index.js","names":["NewsList","React","memo","props","title","news","more","loading","loadingView","style","loader","moreView","onClick","label","cardsView","map","nws","key","card","wrapper","list","propTypes","PropTypes","string","arrayOf","shape","News","func","bool"],"sources":["../../../../src/molecule/dashboard/news-list/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport News from '../../news';\nimport Loader from '../../../atom/loader';\nimport style from './style.css';\n\nconst NewsList = React.memo(function NewsList(props) {\n const {title, news, more, loading = false} = props;\n\n const loadingView = (\n <div className={style.loader}>\n <Loader />\n </div>\n );\n\n const moreView = more ? (\n // eslint-disable-next-line react/jsx-handler-names\n <div className={style.more} onClick={more.onClick}>\n {more.label}\n </div>\n ) : null;\n\n const cardsView = news.map((nws, key) => {\n return (\n <div className={style.card} key={key}>\n <News {...nws} />\n </div>\n );\n });\n\n return (\n <div className={style.wrapper} data-name=\"news-list\">\n <div className={style.list}>\n <div className={style.title}>{title}</div>\n {cardsView}\n {loading ? loadingView : moreView}\n </div>\n </div>\n );\n});\n\nNewsList.propTypes = {\n title: PropTypes.string,\n news: PropTypes.arrayOf(PropTypes.shape(News.propTypes)),\n more: PropTypes.shape({\n label: PropTypes.string,\n onClick: PropTypes.func\n }),\n loading: PropTypes.bool\n};\n\nexport default NewsList;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,QAAQ,GAAGC,cAAA,CAAMC,IAAN,CAAW,SAASF,QAAT,CAAkBG,KAAlB,EAAyB;EACnD,MAAM;IAACC,KAAD;IAAQC,IAAR;IAAcC,IAAd;IAAoBC,OAAO,GAAG;EAA9B,IAAuCJ,KAA7C;;EAEA,MAAMK,WAAW,gBACf;IAAK,SAAS,EAAEC,cAAA,CAAMC;EAAtB,gBACE,6BAAC,eAAD,OADF,CADF;;EAMA,MAAMC,QAAQ,GAAGL,IAAI;EAAA;EACnB;EACA;IAAK,SAAS,EAAEG,cAAA,CAAMH,IAAtB;IAA4B,OAAO,EAAEA,IAAI,CAACM;EAA1C,GACGN,IAAI,CAACO,KADR,CAFmB,GAKjB,IALJ;EAOA,MAAMC,SAAS,GAAGT,IAAI,CAACU,GAAL,CAAS,CAACC,GAAD,EAAMC,GAAN,KAAc;IACvC,oBACE;MAAK,SAAS,EAAER,cAAA,CAAMS,IAAtB;MAA4B,GAAG,EAAED;IAAjC,gBACE,6BAAC,aAAD,EAAUD,GAAV,CADF,CADF;EAKD,CANiB,CAAlB;EAQA,oBACE;IAAK,SAAS,EAAEP,cAAA,CAAMU,OAAtB;IAA+B,aAAU;EAAzC,gBACE;IAAK,SAAS,EAAEV,cAAA,CAAMW;EAAtB,gBACE;IAAK,SAAS,EAAEX,cAAA,CAAML;EAAtB,GAA8BA,KAA9B,CADF,EAEGU,SAFH,EAGGP,OAAO,GAAGC,WAAH,GAAiBG,QAH3B,CADF,CADF;AASD,CAjCgB,CAAjB;;AAmCAX,QAAQ,CAACqB,SAAT,2CAAqB;EACnBjB,KAAK,EAAEkB,kBAAA,CAAUC,MADE;EAEnBlB,IAAI,EAAEiB,kBAAA,CAAUE,OAAV,CAAkBF,kBAAA,CAAUG,KAAV,CAAgBC,aAAA,CAAKL,SAArB,CAAlB,CAFa;EAGnBf,IAAI,EAAEgB,kBAAA,CAAUG,KAAV,CAAgB;IACpBZ,KAAK,EAAES,kBAAA,CAAUC,MADG;IAEpBX,OAAO,EAAEU,kBAAA,CAAUK;EAFC,CAAhB,CAHa;EAOnBpB,OAAO,EAAEe,kBAAA,CAAUM;AAPA,CAArB;eAUe5B,Q"}
|
|
@@ -15,7 +15,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
15
15
|
|
|
16
16
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
17
17
|
|
|
18
|
-
const ReviewBanner =
|
|
18
|
+
const ReviewBanner = _react.default.memo(function ReviewBanner(props) {
|
|
19
19
|
const {
|
|
20
20
|
title,
|
|
21
21
|
subtitle,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["ReviewBanner","React","memo","props","title","subtitle","cta","buttonProps","type","style","root","container","banner","left","image","middle","right","propTypes","PropTypes","string","shape","onClick","func","label"],"sources":["../../../../src/molecule/dashboard/review-banner/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport ButtonLink from '../../../atom/button-link';\nimport style from './style.css';\n\nconst ReviewBanner = React.memo(function ReviewBanner(props) {\n const {title, subtitle, cta} = props;\n\n const buttonProps = {\n ...cta,\n type: 'primary'\n };\n\n return (\n <div className={style.root} data-name=\"start-review-banner\">\n <div className={style.container}>\n <div className={style.banner}>\n <div className={style.left} role=\"img\" aria-label=\"Left image container\">\n <img\n className={style.image}\n src=\"https://static.coorpacademy.com/site/book.png\"\n alt=\"Book image\"\n />\n </div>\n <div className={style.middle}>\n <span className={style.title} data-name=\"review-banner-title\" aria-label=\"{title}\">\n {title}\n </span>\n <span\n className={style.subtitle}\n data-name=\"review-banner-subtitle\"\n aria-label=\"{subtitle}\"\n >\n {subtitle}\n </span>\n <ButtonLink {...buttonProps} className={style.cta} />\n </div>\n <div className={style.right} role=\"img\" aria-label=\"Rigth image container\">\n <img\n className={style.image}\n src=\"https://static.coorpacademy.com/site/dumbell.png\"\n alt=\"Dumbbell image\"\n />\n </div>\n </div>\n </div>\n </div>\n );\n});\n\nReviewBanner.propTypes = {\n title: PropTypes.string,\n subtitle: PropTypes.string,\n cta: PropTypes.shape({\n onClick: PropTypes.func,\n label: PropTypes.string\n })\n};\n\nexport default ReviewBanner;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;;;;;AAEA,MAAMA,YAAY,
|
|
1
|
+
{"version":3,"file":"index.js","names":["ReviewBanner","React","memo","props","title","subtitle","cta","buttonProps","type","style","root","container","banner","left","image","middle","right","propTypes","PropTypes","string","shape","onClick","func","label"],"sources":["../../../../src/molecule/dashboard/review-banner/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport ButtonLink from '../../../atom/button-link';\nimport style from './style.css';\n\nconst ReviewBanner = React.memo(function ReviewBanner(props) {\n const {title, subtitle, cta} = props;\n\n const buttonProps = {\n ...cta,\n type: 'primary'\n };\n\n return (\n <div className={style.root} data-name=\"start-review-banner\">\n <div className={style.container}>\n <div className={style.banner}>\n <div className={style.left} role=\"img\" aria-label=\"Left image container\">\n <img\n className={style.image}\n src=\"https://static.coorpacademy.com/site/book.png\"\n alt=\"Book image\"\n />\n </div>\n <div className={style.middle}>\n <span className={style.title} data-name=\"review-banner-title\" aria-label=\"{title}\">\n {title}\n </span>\n <span\n className={style.subtitle}\n data-name=\"review-banner-subtitle\"\n aria-label=\"{subtitle}\"\n >\n {subtitle}\n </span>\n <ButtonLink {...buttonProps} className={style.cta} />\n </div>\n <div className={style.right} role=\"img\" aria-label=\"Rigth image container\">\n <img\n className={style.image}\n src=\"https://static.coorpacademy.com/site/dumbell.png\"\n alt=\"Dumbbell image\"\n />\n </div>\n </div>\n </div>\n </div>\n );\n});\n\nReviewBanner.propTypes = {\n title: PropTypes.string,\n subtitle: PropTypes.string,\n cta: PropTypes.shape({\n onClick: PropTypes.func,\n label: PropTypes.string\n })\n};\n\nexport default ReviewBanner;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;;;;;AAEA,MAAMA,YAAY,GAAGC,cAAA,CAAMC,IAAN,CAAW,SAASF,YAAT,CAAsBG,KAAtB,EAA6B;EAC3D,MAAM;IAACC,KAAD;IAAQC,QAAR;IAAkBC;EAAlB,IAAyBH,KAA/B;;EAEA,MAAMI,WAAW,gBACZD,GADY;IAEfE,IAAI,EAAE;EAFS,EAAjB;;EAKA,oBACE;IAAK,SAAS,EAAEC,cAAA,CAAMC,IAAtB;IAA4B,aAAU;EAAtC,gBACE;IAAK,SAAS,EAAED,cAAA,CAAME;EAAtB,gBACE;IAAK,SAAS,EAAEF,cAAA,CAAMG;EAAtB,gBACE;IAAK,SAAS,EAAEH,cAAA,CAAMI,IAAtB;IAA4B,IAAI,EAAC,KAAjC;IAAuC,cAAW;EAAlD,gBACE;IACE,SAAS,EAAEJ,cAAA,CAAMK,KADnB;IAEE,GAAG,EAAC,+CAFN;IAGE,GAAG,EAAC;EAHN,EADF,CADF,eAQE;IAAK,SAAS,EAAEL,cAAA,CAAMM;EAAtB,gBACE;IAAM,SAAS,EAAEN,cAAA,CAAML,KAAvB;IAA8B,aAAU,qBAAxC;IAA8D,cAAW;EAAzE,GACGA,KADH,CADF,eAIE;IACE,SAAS,EAAEK,cAAA,CAAMJ,QADnB;IAEE,aAAU,wBAFZ;IAGE,cAAW;EAHb,GAKGA,QALH,CAJF,eAWE,6BAAC,mBAAD,eAAgBE,WAAhB;IAA6B,SAAS,EAAEE,cAAA,CAAMH;EAA9C,GAXF,CARF,eAqBE;IAAK,SAAS,EAAEG,cAAA,CAAMO,KAAtB;IAA6B,IAAI,EAAC,KAAlC;IAAwC,cAAW;EAAnD,gBACE;IACE,SAAS,EAAEP,cAAA,CAAMK,KADnB;IAEE,GAAG,EAAC,kDAFN;IAGE,GAAG,EAAC;EAHN,EADF,CArBF,CADF,CADF,CADF;AAmCD,CA3CoB,CAArB;;AA6CAd,YAAY,CAACiB,SAAb,2CAAyB;EACvBb,KAAK,EAAEc,kBAAA,CAAUC,MADM;EAEvBd,QAAQ,EAAEa,kBAAA,CAAUC,MAFG;EAGvBb,GAAG,EAAEY,kBAAA,CAAUE,KAAV,CAAgB;IACnBC,OAAO,EAAEH,kBAAA,CAAUI,IADA;IAEnBC,KAAK,EAAEL,kBAAA,CAAUC;EAFE,CAAhB;AAHkB,CAAzB;eASenB,Y"}
|
|
@@ -17,7 +17,7 @@ var _style = _interopRequireDefault(require("./style.css"));
|
|
|
17
17
|
|
|
18
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
19
|
|
|
20
|
-
const StartBattle =
|
|
20
|
+
const StartBattle = _react.default.memo(function StartBattle(props) {
|
|
21
21
|
const {
|
|
22
22
|
startBattleText,
|
|
23
23
|
becomeAChampionText,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["StartBattle","React","memo","props","startBattleText","becomeAChampionText","challengeText","onClick","href","style","root","container","wrapper","start","leftFlashes","bigFlashLeft","smallFlashLeft","middle","becomeText","smallFlashLeftMobile","smallFlashRightMobile","button","rightFlashes","bigFlashRight","smallFlashRight","contextTypes","skin","Provider","childContextTypes","propTypes","PropTypes","string","func"],"sources":["../../../../src/molecule/dashboard/start-battle/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {\n NovaCompositionCoorpacademyBigFlashRight as FlashRight,\n NovaCompositionCoorpacademyBigFlashLeft as FlashLeft\n} from '@coorpacademy/nova-icons';\nimport Provider from '../../../atom/provider';\nimport Link from '../../../atom/link';\nimport style from './style.css';\n\nconst StartBattle = React.memo(function StartBattle(props) {\n const {startBattleText, becomeAChampionText, challengeText, onClick, href} = props;\n\n return (\n <div className={style.root} data-name=\"start-battle\">\n <div className={style.container}>\n <div className={style.wrapper}>\n <div className={style.start}>\n <div className={style.leftFlashes}>\n <FlashLeft className={style.bigFlashLeft} />\n <FlashLeft className={style.smallFlashLeft} />\n </div>\n <div className={style.middle}>\n <div className={style.becomeText}>\n <FlashLeft className={style.smallFlashLeftMobile} />\n {becomeAChampionText}\n <FlashRight className={style.smallFlashRightMobile} />\n </div>\n <div className={style.challengeText}>{challengeText}</div>\n <Link className={style.button} onClick={onClick} href={href}>\n {startBattleText}\n </Link>\n </div>\n <div className={style.rightFlashes}>\n <FlashRight className={style.bigFlashRight} />\n <FlashRight className={style.smallFlashRight} />\n </div>\n </div>\n </div>\n </div>\n </div>\n );\n});\n\nStartBattle.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nStartBattle.propTypes = {\n startBattleText: PropTypes.string,\n becomeAChampionText: PropTypes.string,\n challengeText: PropTypes.string,\n onClick: PropTypes.func,\n href: PropTypes.string\n};\n\nexport default StartBattle;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AAIA;;AACA;;AACA;;;;AAEA,MAAMA,WAAW,
|
|
1
|
+
{"version":3,"file":"index.js","names":["StartBattle","React","memo","props","startBattleText","becomeAChampionText","challengeText","onClick","href","style","root","container","wrapper","start","leftFlashes","bigFlashLeft","smallFlashLeft","middle","becomeText","smallFlashLeftMobile","smallFlashRightMobile","button","rightFlashes","bigFlashRight","smallFlashRight","contextTypes","skin","Provider","childContextTypes","propTypes","PropTypes","string","func"],"sources":["../../../../src/molecule/dashboard/start-battle/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {\n NovaCompositionCoorpacademyBigFlashRight as FlashRight,\n NovaCompositionCoorpacademyBigFlashLeft as FlashLeft\n} from '@coorpacademy/nova-icons';\nimport Provider from '../../../atom/provider';\nimport Link from '../../../atom/link';\nimport style from './style.css';\n\nconst StartBattle = React.memo(function StartBattle(props) {\n const {startBattleText, becomeAChampionText, challengeText, onClick, href} = props;\n\n return (\n <div className={style.root} data-name=\"start-battle\">\n <div className={style.container}>\n <div className={style.wrapper}>\n <div className={style.start}>\n <div className={style.leftFlashes}>\n <FlashLeft className={style.bigFlashLeft} />\n <FlashLeft className={style.smallFlashLeft} />\n </div>\n <div className={style.middle}>\n <div className={style.becomeText}>\n <FlashLeft className={style.smallFlashLeftMobile} />\n {becomeAChampionText}\n <FlashRight className={style.smallFlashRightMobile} />\n </div>\n <div className={style.challengeText}>{challengeText}</div>\n <Link className={style.button} onClick={onClick} href={href}>\n {startBattleText}\n </Link>\n </div>\n <div className={style.rightFlashes}>\n <FlashRight className={style.bigFlashRight} />\n <FlashRight className={style.smallFlashRight} />\n </div>\n </div>\n </div>\n </div>\n </div>\n );\n});\n\nStartBattle.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nStartBattle.propTypes = {\n startBattleText: PropTypes.string,\n becomeAChampionText: PropTypes.string,\n challengeText: PropTypes.string,\n onClick: PropTypes.func,\n href: PropTypes.string\n};\n\nexport default StartBattle;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AAIA;;AACA;;AACA;;;;AAEA,MAAMA,WAAW,GAAGC,cAAA,CAAMC,IAAN,CAAW,SAASF,WAAT,CAAqBG,KAArB,EAA4B;EACzD,MAAM;IAACC,eAAD;IAAkBC,mBAAl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WAAW,CAAC6B,SAAZ,2CAAwB;EACtBzB,eAAe,EAAE0B,kBAAA,CAAUC,MADL;EAEtB1B,mBAAmB,EAAEyB,kBAAA,CAAUC,MAFT;EAGtBzB,aAAa,EAAEwB,kBAAA,CAAUC,MAHH;EAItBxB,OAAO,EAAEuB,kBAAA,CAAUE,IAJG;EAKtBxB,IAAI,EAAEsB,kBAAA,CAAUC;AALM,CAAxB;eAQe/B,W"}
|
|
@@ -55,7 +55,7 @@ const copyTextViaExecCommand = text => {
|
|
|
55
55
|
return status;
|
|
56
56
|
};
|
|
57
57
|
|
|
58
|
-
const StatusContext =
|
|
58
|
+
const StatusContext = _react.default.createContext(SHARE_STATUS.IDLE);
|
|
59
59
|
|
|
60
60
|
const ShareStatusProvider = ({
|
|
61
61
|
children
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["SHARE_STATUS","IDLE","ERROR","SUCCESS","copyTextViaExecCommand","text","textarea","document","createElement","style","border","padding","visibility","position","setAttribute","value","body","appendChild","status","select","setSelectionRange","length","execCommand","error","removeChild","StatusContext","React","createContext","ShareStatusProvider","children","setStatus","useState","useEffect","timeoutId","DURATION","setTimeout","clearTimeout","useMemo","ShareFeedback","successWording","errorWording","useContext","classnames","styles","feedback","errorFeedback","checkIcon","Share","wording","onClick","useCallback","browserSupportsClipboardWriteText","navigator","clipboard","writeText","copyStatus","container","cta","wrapper","shareIcon","propTypes","PropTypes","node","string"],"sources":["../../../src/molecule/share/index.js"],"sourcesContent":["import React, {useState, useMemo, useCallback, useContext, useEffect} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {\n NovaCompositionCoorpacademyCheck as CheckIcon,\n NovaCompositionCoorpacademyShare as ShareIcon,\n NovaCompositionCoorpacademyAttention as AttentionIcon\n} from '@coorpacademy/nova-icons';\nimport Link from '../../atom/link';\nimport styles from './style.css';\n\nconst SHARE_STATUS = {\n IDLE: 'IDLE',\n ERROR: 'ERROR',\n SUCCESS: 'SUCCESS'\n};\n\nconst copyTextViaExecCommand = text => {\n const textarea = document.createElement('textarea');\n\n textarea.style.border = '0';\n textarea.style.padding = '0';\n textarea.style.visibility = 'hidden';\n textarea.style.position = 'absolute';\n textarea.setAttribute('readonly', '');\n textarea.value = text;\n\n // Element.append is not supported on IE11 :/\n // eslint-disable-next-line unicorn/prefer-node-append\n document.body.appendChild(textarea);\n let status = SHARE_STATUS.IDLE;\n\n try {\n textarea.select();\n textarea.setSelectionRange(0, textarea.value.length);\n document.execCommand('copy');\n status = SHARE_STATUS.SUCCESS;\n } catch (error) {\n status = SHARE_STATUS.ERROR;\n }\n\n // Element.remove is not supported on IE11 :/\n // eslint-disable-next-line unicorn/prefer-node-remove\n document.body.removeChild(textarea);\n\n return status;\n};\n\nconst StatusContext = React.createContext(SHARE_STATUS.IDLE);\n\nexport const ShareStatusProvider = ({children}) => {\n const [status, setStatus] = useState(SHARE_STATUS.IDLE);\n useEffect(() => {\n let timeoutId;\n const DURATION = 3000;\n if (status !== SHARE_STATUS.IDLE) {\n timeoutId = setTimeout(() => setStatus(SHARE_STATUS.IDLE), DURATION);\n }\n return () => clearTimeout(timeoutId);\n }, [status]);\n\n const value = useMemo(() => [status, setStatus], [status]);\n\n return <StatusContext.Provider value={value}>{children}</StatusContext.Provider>;\n};\n\nexport const ShareFeedback = ({successWording, errorWording}) => {\n const [status] = useContext(StatusContext);\n if (status === SHARE_STATUS.IDLE) return null;\n\n return (\n <div\n className={classnames(styles.feedback, status === SHARE_STATUS.ERROR && styles.errorFeedback)}\n >\n {status === SHARE_STATUS.SUCCESS ? (\n <CheckIcon className={styles.checkIcon} width={13} height={13} />\n ) : (\n <AttentionIcon className={styles.checkIcon} width={13} height={13} />\n )}\n <p>{status === SHARE_STATUS.SUCCESS ? successWording : errorWording}</p>\n </div>\n );\n};\n\nconst Share = ({style, text, wording}) => {\n const [, setStatus] = useContext(StatusContext);\n const onClick = useCallback(async () => {\n const browserSupportsClipboardWriteText =\n 'clipboard' in navigator && 'writeText' in navigator.clipboard;\n if (browserSupportsClipboardWriteText) {\n try {\n await navigator.clipboard.writeText(text);\n setStatus(SHARE_STATUS.SUCCESS);\n } catch (error) {\n setStatus(SHARE_STATUS.ERROR);\n }\n return;\n } else {\n const copyStatus = copyTextViaExecCommand(text);\n setStatus(copyStatus);\n }\n return;\n }, [setStatus, text]);\n\n return (\n <div className={(styles.container, style)}>\n <Link onClick={onClick} className={styles.cta} data-name={'share-button'}>\n <div className={styles.wrapper}>\n <ShareIcon className={styles.shareIcon} width={18} height={18} />\n <p>{wording}</p>\n </div>\n </Link>\n </div>\n );\n};\n\nShareStatusProvider.propTypes = {\n children: PropTypes.node\n};\n\nShareFeedback.propTypes = {\n successWording: PropTypes.string,\n errorWording: PropTypes.string\n};\n\nShare.propTypes = {\n style: PropTypes.string,\n text: PropTypes.string,\n wording: PropTypes.string\n};\n\nexport default Share;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AAKA;;AACA;;;;;;;;AAEA,MAAMA,YAAY,GAAG;EACnBC,IAAI,EAAE,MADa;EAEnBC,KAAK,EAAE,OAFY;EAGnBC,OAAO,EAAE;AAHU,CAArB;;AAMA,MAAMC,sBAAsB,GAAGC,IAAI,IAAI;EACrC,MAAMC,QAAQ,GAAGC,QAAQ,CAACC,aAAT,CAAuB,UAAvB,CAAjB;EAEAF,QAAQ,CAACG,KAAT,CAAeC,MAAf,GAAwB,GAAxB;EACAJ,QAAQ,CAACG,KAAT,CAAeE,OAAf,GAAyB,GAAzB;EACAL,QAAQ,CAACG,KAAT,CAAeG,UAAf,GAA4B,QAA5B;EACAN,QAAQ,CAACG,KAAT,CAAeI,QAAf,GAA0B,UAA1B;EACAP,QAAQ,CAACQ,YAAT,CAAsB,UAAtB,EAAkC,EAAlC;EACAR,QAAQ,CAACS,KAAT,GAAiBV,IAAjB,CARqC,CAUrC;EACA;;EACAE,QAAQ,CAACS,IAAT,CAAcC,WAAd,CAA0BX,QAA1B;EACA,IAAIY,MAAM,GAAGlB,YAAY,CAACC,IAA1B;;EAEA,IAAI;IACFK,QAAQ,CAACa,MAAT;IACAb,QAAQ,CAACc,iBAAT,CAA2B,CAA3B,EAA8Bd,QAAQ,CAACS,KAAT,CAAeM,MAA7C;IACAd,QAAQ,CAACe,WAAT,CAAqB,MAArB;IACAJ,MAAM,GAAGlB,YAAY,CAACG,OAAtB;EACD,CALD,CAKE,OAAOoB,KAAP,EAAc;IACdL,MAAM,GAAGlB,YAAY,CAACE,KAAtB;EACD,CAtBoC,CAwBrC;EACA;;;EACAK,QAAQ,CAACS,IAAT,CAAcQ,WAAd,CAA0BlB,QAA1B;EAEA,OAAOY,MAAP;AACD,CA7BD;;AA+BA,MAAMO,aAAa,
|
|
1
|
+
{"version":3,"file":"index.js","names":["SHARE_STATUS","IDLE","ERROR","SUCCESS","copyTextViaExecCommand","text","textarea","document","createElement","style","border","padding","visibility","position","setAttribute","value","body","appendChild","status","select","setSelectionRange","length","execCommand","error","removeChild","StatusContext","React","createContext","ShareStatusProvider","children","setStatus","useState","useEffect","timeoutId","DURATION","setTimeout","clearTimeout","useMemo","ShareFeedback","successWording","errorWording","useContext","classnames","styles","feedback","errorFeedback","checkIcon","Share","wording","onClick","useCallback","browserSupportsClipboardWriteText","navigator","clipboard","writeText","copyStatus","container","cta","wrapper","shareIcon","propTypes","PropTypes","node","string"],"sources":["../../../src/molecule/share/index.js"],"sourcesContent":["import React, {useState, useMemo, useCallback, useContext, useEffect} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {\n NovaCompositionCoorpacademyCheck as CheckIcon,\n NovaCompositionCoorpacademyShare as ShareIcon,\n NovaCompositionCoorpacademyAttention as AttentionIcon\n} from '@coorpacademy/nova-icons';\nimport Link from '../../atom/link';\nimport styles from './style.css';\n\nconst SHARE_STATUS = {\n IDLE: 'IDLE',\n ERROR: 'ERROR',\n SUCCESS: 'SUCCESS'\n};\n\nconst copyTextViaExecCommand = text => {\n const textarea = document.createElement('textarea');\n\n textarea.style.border = '0';\n textarea.style.padding = '0';\n textarea.style.visibility = 'hidden';\n textarea.style.position = 'absolute';\n textarea.setAttribute('readonly', '');\n textarea.value = text;\n\n // Element.append is not supported on IE11 :/\n // eslint-disable-next-line unicorn/prefer-node-append\n document.body.appendChild(textarea);\n let status = SHARE_STATUS.IDLE;\n\n try {\n textarea.select();\n textarea.setSelectionRange(0, textarea.value.length);\n document.execCommand('copy');\n status = SHARE_STATUS.SUCCESS;\n } catch (error) {\n status = SHARE_STATUS.ERROR;\n }\n\n // Element.remove is not supported on IE11 :/\n // eslint-disable-next-line unicorn/prefer-node-remove\n document.body.removeChild(textarea);\n\n return status;\n};\n\nconst StatusContext = React.createContext(SHARE_STATUS.IDLE);\n\nexport const ShareStatusProvider = ({children}) => {\n const [status, setStatus] = useState(SHARE_STATUS.IDLE);\n useEffect(() => {\n let timeoutId;\n const DURATION = 3000;\n if (status !== SHARE_STATUS.IDLE) {\n timeoutId = setTimeout(() => setStatus(SHARE_STATUS.IDLE), DURATION);\n }\n return () => clearTimeout(timeoutId);\n }, [status]);\n\n const value = useMemo(() => [status, setStatus], [status]);\n\n return <StatusContext.Provider value={value}>{children}</StatusContext.Provider>;\n};\n\nexport const ShareFeedback = ({successWording, errorWording}) => {\n const [status] = useContext(StatusContext);\n if (status === SHARE_STATUS.IDLE) return null;\n\n return (\n <div\n className={classnames(styles.feedback, status === SHARE_STATUS.ERROR && styles.errorFeedback)}\n >\n {status === SHARE_STATUS.SUCCESS ? (\n <CheckIcon className={styles.checkIcon} width={13} height={13} />\n ) : (\n <AttentionIcon className={styles.checkIcon} width={13} height={13} />\n )}\n <p>{status === SHARE_STATUS.SUCCESS ? successWording : errorWording}</p>\n </div>\n );\n};\n\nconst Share = ({style, text, wording}) => {\n const [, setStatus] = useContext(StatusContext);\n const onClick = useCallback(async () => {\n const browserSupportsClipboardWriteText =\n 'clipboard' in navigator && 'writeText' in navigator.clipboard;\n if (browserSupportsClipboardWriteText) {\n try {\n await navigator.clipboard.writeText(text);\n setStatus(SHARE_STATUS.SUCCESS);\n } catch (error) {\n setStatus(SHARE_STATUS.ERROR);\n }\n return;\n } else {\n const copyStatus = copyTextViaExecCommand(text);\n setStatus(copyStatus);\n }\n return;\n }, [setStatus, text]);\n\n return (\n <div className={(styles.container, style)}>\n <Link onClick={onClick} className={styles.cta} data-name={'share-button'}>\n <div className={styles.wrapper}>\n <ShareIcon className={styles.shareIcon} width={18} height={18} />\n <p>{wording}</p>\n </div>\n </Link>\n </div>\n );\n};\n\nShareStatusProvider.propTypes = {\n children: PropTypes.node\n};\n\nShareFeedback.propTypes = {\n successWording: PropTypes.string,\n errorWording: PropTypes.string\n};\n\nShare.propTypes = {\n style: PropTypes.string,\n text: PropTypes.string,\n wording: PropTypes.string\n};\n\nexport default Share;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AAKA;;AACA;;;;;;;;AAEA,MAAMA,YAAY,GAAG;EACnBC,IAAI,EAAE,MADa;EAEnBC,KAAK,EAAE,OAFY;EAGnBC,OAAO,EAAE;AAHU,CAArB;;AAMA,MAAMC,sBAAsB,GAAGC,IAAI,IAAI;EACrC,MAAMC,QAAQ,GAAGC,QAAQ,CAACC,aAAT,CAAuB,UAAvB,CAAjB;EAEAF,QAAQ,CAACG,KAAT,CAAeC,MAAf,GAAwB,GAAxB;EACAJ,QAAQ,CAACG,KAAT,CAAeE,OAAf,GAAyB,GAAzB;EACAL,QAAQ,CAACG,KAAT,CAAeG,UAAf,GAA4B,QAA5B;EACAN,QAAQ,CAACG,KAAT,CAAeI,QAAf,GAA0B,UAA1B;EACAP,QAAQ,CAACQ,YAAT,CAAsB,UAAtB,EAAkC,EAAlC;EACAR,QAAQ,CAACS,KAAT,GAAiBV,IAAjB,CARqC,CAUrC;EACA;;EACAE,QAAQ,CAACS,IAAT,CAAcC,WAAd,CAA0BX,QAA1B;EACA,IAAIY,MAAM,GAAGlB,YAAY,CAACC,IAA1B;;EAEA,IAAI;IACFK,QAAQ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AAGnD,sBAAsB,CAACC,IAAD,CAAzC;MACAyB,SAAS,CAACyB,UAAD,CAAT;IACD;;IACD;EACD,CAhBe,EAgBb,CAACzB,SAAD,EAAYzB,IAAZ,CAhBa,CAAhB;EAkBA,oBACE;IAAK,SAAS,GAAGsC,cAAA,CAAOa,SAAP,EAAkB/C,KAArB;EAAd,gBACE,6BAAC,aAAD;IAAM,OAAO,EAAEwC,OAAf;IAAwB,SAAS,EAAEN,cAAA,CAAOc,GAA1C;IAA+C,aAAW;EAA1D,gBACE;IAAK,SAAS,EAAEd,cAAA,CAAOe;EAAvB,gBACE,6BAAC,2CAAD;IAAW,SAAS,EAAEf,cAAA,CAAOgB,SAA7B;IAAwC,KAAK,EAAE,EAA/C;IAAmD,MAAM,EAAE;EAA3D,EADF,eAEE,wCAAIX,OAAJ,CAFF,CADF,CADF,CADF;AAUD,CA9BD;;AAgCApB,mBAAmB,CAACgC,SAApB,2CAAgC;EAC9B/B,QAAQ,EAAEgC,kBAAA,CAAUC;AADU,CAAhC;AAIAxB,aAAa,CAACsB,SAAd,2CAA0B;EACxBrB,cAAc,EAAEsB,kBAAA,CAAUE,MADF;EAExBvB,YAAY,EAAEqB,kBAAA,CAAUE;AAFA,CAA1B;AAKAhB,KAAK,CAACa,SAAN,2CAAkB;EAChBnD,KAAK,EAAEoD,kBAAA,CAAUE,MADD;EAEhB1D,IAAI,EAAEwD,kBAAA,CAAUE,MAFA;EAGhBf,OAAO,EAAEa,kBAAA,CAAUE;AAHH,CAAlB;eAMehB,K"}
|
|
@@ -17,6 +17,8 @@ var _style = _interopRequireDefault(require("./style.css"));
|
|
|
17
17
|
|
|
18
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
19
|
|
|
20
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
21
|
+
|
|
20
22
|
const TOTAL_SLIDES_STACK = 5;
|
|
21
23
|
exports.TOTAL_SLIDES_STACK = TOTAL_SLIDES_STACK;
|
|
22
24
|
const stylesByPosition = {
|
|
@@ -59,13 +61,14 @@ const StackedSlides = ({
|
|
|
59
61
|
key: `slide-${slideIndex}`,
|
|
60
62
|
"data-name": `slide-${slideIndex}`,
|
|
61
63
|
className: (0, _classnames.default)(_style.default.slideBase, getSlideAnimation(animationType, position), endReview ? _style.default.endReview : null)
|
|
62
|
-
}, /*#__PURE__*/_react.default.createElement(_reviewSlide.default, {
|
|
64
|
+
}, /*#__PURE__*/_react.default.createElement(_reviewSlide.default, _extends({
|
|
63
65
|
slideIndex: (0, _toString2.default)(slideIndex),
|
|
64
66
|
slide,
|
|
65
67
|
validateButton,
|
|
66
|
-
correctionPopinProps
|
|
68
|
+
correctionPopinProps
|
|
69
|
+
}, {
|
|
67
70
|
key: slideIndex
|
|
68
|
-
}));
|
|
71
|
+
})));
|
|
69
72
|
|
|
70
73
|
stackedSlides.push(slideView);
|
|
71
74
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["TOTAL_SLIDES_STACK","stylesByPosition","style","position0","position1","position2","position3","position4","getSlideAnimation","action","position","slideOutHideAndIn","slideOutAndIn","hiddenSlide","StackedSlides","slides","endReview","validateButton","correctionPopinProps","stackedSlides","slideIndex","slide","_toString","animationType","slideView","classnames","slideBase","push","stackedSlidesYAxisOverflowContainer","stackedSlidesContainer","propTypes"],"sources":["../../../src/organism/review-stacked-slides/index.js"],"sourcesContent":["import React from 'react';\nimport classnames from 'classnames';\nimport _toString from 'lodash/fp/toString';\nimport ReviewSlide from '../review-slide';\nimport propTypes from './prop-types';\nimport style from './style.css';\n\nexport const TOTAL_SLIDES_STACK = 5;\n\nconst stylesByPosition = {\n 0: style.position0,\n 1: style.position1,\n 2: style.position2,\n 3: style.position3,\n 4: style.position4\n};\n\nconst getSlideAnimation = (action, position) => {\n switch (action) {\n case 'unstack':\n return style.slideOutHideAndIn;\n case 'restack':\n return style.slideOutAndIn;\n default:\n return position < 0 ? style.hiddenSlide : stylesByPosition[position];\n }\n};\n\nconst StackedSlides = ({slides, endReview, validateButton, correctionPopinProps}) => {\n const stackedSlides = [];\n // eslint-disable-next-line fp/no-loops\n for (let slideIndex = 0; slideIndex < TOTAL_SLIDES_STACK; slideIndex++) {\n const slide = slides[_toString(slideIndex)];\n const {animationType, position} = slide;\n\n const slideView = (\n <div\n key={`slide-${slideIndex}`}\n data-name={`slide-${slideIndex}`}\n className={classnames(\n style.slideBase,\n getSlideAnimation(animationType, position),\n endReview ? style.endReview : null\n )}\n >\n <ReviewSlide\n {...{\n slideIndex: _toString(slideIndex),\n slide,\n validateButton,\n correctionPopinProps\n }}\n key={slideIndex}\n />\n </div>\n );\n stackedSlides.push(slideView);\n }\n\n return (\n <div\n key=\"stacked-slides-container-y-overflow\"\n className={style.stackedSlidesYAxisOverflowContainer}\n >\n <div\n key=\"stacked-slides-container\"\n data-name=\"stacked-slides-container\"\n className={style.stackedSlidesContainer}\n >\n {stackedSlides}\n </div>\n </div>\n );\n};\n\nStackedSlides.propTypes = propTypes;\n\nexport default StackedSlides;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA
|
|
1
|
+
{"version":3,"file":"index.js","names":["TOTAL_SLIDES_STACK","stylesByPosition","style","position0","position1","position2","position3","position4","getSlideAnimation","action","position","slideOutHideAndIn","slideOutAndIn","hiddenSlide","StackedSlides","slides","endReview","validateButton","correctionPopinProps","stackedSlides","slideIndex","slide","_toString","animationType","slideView","classnames","slideBase","push","stackedSlidesYAxisOverflowContainer","stackedSlidesContainer","propTypes"],"sources":["../../../src/organism/review-stacked-slides/index.js"],"sourcesContent":["import React from 'react';\nimport classnames from 'classnames';\nimport _toString from 'lodash/fp/toString';\nimport ReviewSlide from '../review-slide';\nimport propTypes from './prop-types';\nimport style from './style.css';\n\nexport const TOTAL_SLIDES_STACK = 5;\n\nconst stylesByPosition = {\n 0: style.position0,\n 1: style.position1,\n 2: style.position2,\n 3: style.position3,\n 4: style.position4\n};\n\nconst getSlideAnimation = (action, position) => {\n switch (action) {\n case 'unstack':\n return style.slideOutHideAndIn;\n case 'restack':\n return style.slideOutAndIn;\n default:\n return position < 0 ? style.hiddenSlide : stylesByPosition[position];\n }\n};\n\nconst StackedSlides = ({slides, endReview, validateButton, correctionPopinProps}) => {\n const stackedSlides = [];\n // eslint-disable-next-line fp/no-loops\n for (let slideIndex = 0; slideIndex < TOTAL_SLIDES_STACK; slideIndex++) {\n const slide = slides[_toString(slideIndex)];\n const {animationType, position} = slide;\n\n const slideView = (\n <div\n key={`slide-${slideIndex}`}\n data-name={`slide-${slideIndex}`}\n className={classnames(\n style.slideBase,\n getSlideAnimation(animationType, position),\n endReview ? style.endReview : null\n )}\n >\n <ReviewSlide\n {...{\n slideIndex: _toString(slideIndex),\n slide,\n validateButton,\n correctionPopinProps\n }}\n key={slideIndex}\n />\n </div>\n );\n stackedSlides.push(slideView);\n }\n\n return (\n <div\n key=\"stacked-slides-container-y-overflow\"\n className={style.stackedSlidesYAxisOverflowContainer}\n >\n <div\n key=\"stacked-slides-container\"\n data-name=\"stacked-slides-container\"\n className={style.stackedSlidesContainer}\n >\n {stackedSlides}\n </div>\n </div>\n );\n};\n\nStackedSlides.propTypes = propTypes;\n\nexport default StackedSlides;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEO,MAAMA,kBAAkB,GAAG,CAA3B;;AAEP,MAAMC,gBAAgB,GAAG;EACvB,GAAGC,cAAA,CAAMC,SADc;EAEvB,GAAGD,cAAA,CAAME,SAFc;EAGvB,GAAGF,cAAA,CAAMG,SAHc;EAIvB,GAAGH,cAAA,CAAMI,SAJc;EAKvB,GAAGJ,cAAA,CAAMK;AALc,CAAzB;;AAQA,MAAMC,iBAAiB,GAAG,CAACC,MAAD,EAASC,QAA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,EAAE1B,cAAA,CAAM2B;EAHnB,GAKGV,aALH,CAJF,CADF;AAcD,CA7CD;;AA+CAL,aAAa,CAACgB,SAAd,2CAA0BA,kBAA1B;eAEehB,a"}
|
|
@@ -13,6 +13,8 @@ var _index = _interopRequireDefault(require("../review-slide/index.native"));
|
|
|
13
13
|
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
15
|
|
|
16
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
17
|
+
|
|
16
18
|
const TOTAL_SLIDES_STACK = 5;
|
|
17
19
|
exports.TOTAL_SLIDES_STACK = TOTAL_SLIDES_STACK;
|
|
18
20
|
|
|
@@ -34,14 +36,15 @@ const StackedSlides = props => {
|
|
|
34
36
|
const stackedSlides = indexes.map(slideIndex => {
|
|
35
37
|
const slide = slides[slideIndex]; // const {animationType, hidden, position} = slide;
|
|
36
38
|
|
|
37
|
-
return /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
39
|
+
return /*#__PURE__*/_react.default.createElement(_index.default, _extends({
|
|
38
40
|
num: Number.parseInt(slideIndex),
|
|
39
41
|
slideIndex,
|
|
40
42
|
slide,
|
|
41
43
|
validateButton,
|
|
42
|
-
correctionPopinProps
|
|
44
|
+
correctionPopinProps
|
|
45
|
+
}, {
|
|
43
46
|
key: slideIndex
|
|
44
|
-
});
|
|
47
|
+
}));
|
|
45
48
|
});
|
|
46
49
|
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
47
50
|
style: style.slides
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["TOTAL_SLIDES_STACK","style","StyleSheet","create","slides","flex","height","width","StackedSlides","props","validateButton","correctionPopinProps","indexes","keys","reverse","stackedSlides","map","slideIndex","slide","num","Number","parseInt"],"sources":["../../../src/organism/review-stacked-slides/index.native.tsx"],"sourcesContent":["import React from 'react';\nimport {StyleSheet, View} from 'react-native';\nimport keys from 'lodash/fp/keys';\nimport Slide from '../review-slide/index.native';\nimport {Props} from './prop-types';\n\nexport const TOTAL_SLIDES_STACK = 5;\n\nconst style = StyleSheet.create({\n slides: {\n flex: 1,\n height: '100%',\n width: '100%'\n }\n});\n\nconst StackedSlides = (props: Props) => {\n const {slides, validateButton, correctionPopinProps} = props;\n\n const indexes = keys(slides).reverse();\n const stackedSlides = indexes.map(slideIndex => {\n const slide = slides[slideIndex];\n // const {animationType, hidden, position} = slide;\n\n return (\n <Slide\n {...{\n num: Number.parseInt(slideIndex),\n slideIndex,\n slide,\n validateButton,\n correctionPopinProps\n }}\n key={slideIndex}\n />\n );\n });\n\n return <View style={style.slides}>{stackedSlides}</View>;\n};\n\nexport default StackedSlides;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["TOTAL_SLIDES_STACK","style","StyleSheet","create","slides","flex","height","width","StackedSlides","props","validateButton","correctionPopinProps","indexes","keys","reverse","stackedSlides","map","slideIndex","slide","num","Number","parseInt"],"sources":["../../../src/organism/review-stacked-slides/index.native.tsx"],"sourcesContent":["import React from 'react';\nimport {StyleSheet, View} from 'react-native';\nimport keys from 'lodash/fp/keys';\nimport Slide from '../review-slide/index.native';\nimport {Props} from './prop-types';\n\nexport const TOTAL_SLIDES_STACK = 5;\n\nconst style = StyleSheet.create({\n slides: {\n flex: 1,\n height: '100%',\n width: '100%'\n }\n});\n\nconst StackedSlides = (props: Props) => {\n const {slides, validateButton, correctionPopinProps} = props;\n\n const indexes = keys(slides).reverse();\n const stackedSlides = indexes.map(slideIndex => {\n const slide = slides[slideIndex];\n // const {animationType, hidden, position} = slide;\n\n return (\n <Slide\n {...{\n num: Number.parseInt(slideIndex),\n slideIndex,\n slide,\n validateButton,\n correctionPopinProps\n }}\n key={slideIndex}\n />\n );\n });\n\n return <View style={style.slides}>{stackedSlides}</View>;\n};\n\nexport default StackedSlides;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;;;;;AAGO,MAAMA,kBAAkB,GAAG,CAA3B;;;AAEP,MAAMC,KAAK,GAAGC,uBAAA,CAAWC,MAAX,CAAkB;EAC9BC,MAAM,EAAE;IACNC,IAAI,EAAE,CADA;IAENC,MAAM,EAAE,MAFF;IAGNC,KAAK,EAAE;EAHD;AADsB,CAAlB,CAAd;;AAQA,MAAMC,aAAa,GAAIC,KAAD,IAAkB;EACtC,MAAM;IAACL,MAAD;IAASM,cAAT;IAAyBC;EAAzB,IAAiDF,KAAvD;EAEA,MAAMG,OAAO,GAAG,IAAAC,aAAA,EAAKT,MAAL,EAAaU,OAAb,EAAhB;EACA,MAAMC,aAAa,GAAGH,OAAO,CAACI,GAAR,CAAYC,UAAU,IAAI;IAC9C,MAAMC,KAAK,GAAGd,MAAM,CAACa,UAAD,CAApB,CAD8C,CAE9C;;IAEA,oBACE,6BAAC,cAAD,WACM;MACFE,GAAG,EAAEC,MAAM,CAACC,QAAP,CAAgBJ,UAAhB,CADH;MAEFA,UAFE;MAGFC,KAHE;MAIFR,cAJE;MAKFC;IALE,CADN;MAQE,GAAG,EAAEM;IARP,GADF;EAYD,CAhBqB,CAAtB;EAkBA,oBAAO,6BAAC,iBAAD;IAAM,KAAK,EAAEhB,KAAK,CAACG;EAAnB,GAA4BW,aAA5B,CAAP;AACD,CAvBD;;eAyBeP,a"}
|
|
@@ -331,7 +331,7 @@ const BackgroundScorm = props => {
|
|
|
331
331
|
className: _summary.default.organismPlayerResultContainerScorm
|
|
332
332
|
}, failed === false ? /*#__PURE__*/_react.default.createElement("div", {
|
|
333
333
|
className: _summary.default.animationContainer
|
|
334
|
-
}, /*#__PURE__*/_react.default.createElement(_lottieWrapper.default, {
|
|
334
|
+
}, /*#__PURE__*/_react.default.createElement(_lottieWrapper.default, _extends({
|
|
335
335
|
'aria-label': 'aria lottie',
|
|
336
336
|
'data-name': 'default-lottie',
|
|
337
337
|
className: undefined,
|
|
@@ -343,14 +343,15 @@ const BackgroundScorm = props => {
|
|
|
343
343
|
animationClassName: ''
|
|
344
344
|
},
|
|
345
345
|
ie11ImageBackup: 'https://static-staging.coorpacademy.com/animations/review/conffeti_congrats.svg',
|
|
346
|
-
animationControl: undefined
|
|
346
|
+
animationControl: undefined
|
|
347
|
+
}, {
|
|
347
348
|
loop: false,
|
|
348
349
|
animationControl: 'play',
|
|
349
350
|
autoplay: true,
|
|
350
351
|
"data-name": "lottie-wrapper",
|
|
351
352
|
className: _summary.default.lottie,
|
|
352
353
|
backupImageClassName: _summary.default.ie11Backup
|
|
353
|
-
})) : null, /*#__PURE__*/_react.default.createElement("div", {
|
|
354
|
+
}))) : null, /*#__PURE__*/_react.default.createElement("div", {
|
|
354
355
|
className: _summary.default.background
|
|
355
356
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
356
357
|
className: _summary.default.largeCircle
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"summary.js","names":["Header","props","SimpleAction","color","prefix","title","button","buttonTitle","linkProps","style","simpleWrapper","simpleTexts","simplePrefix","classnames","simpleTitle","innerHTML","__html","backgroundColor","simpleButton","propTypes","PropTypes","string","shape","Button","NextCourse","card","nextCourseWrapper","nextCourseTexts","nextCoursePrefix","nextCourseTitle","nextCourseCard","CardsList","Subscribe","description","subscribeWrapper","subscribeTexts","subscribeDescription","subscribeTitle","subscribeButtonWrapper","subscribeButton","submitValue","actions","simple","subscribe","nextCourse","Action","type","actionProps","Type","oneOf","CardsLoader","loaderWrapper","CommentConfirmation","context","onClick","commentSectionTitle","confirmationLinkText","skin","dark","commentSection","commentSectionIconWrapper","commentSectionIcon","commentSectionTexts","commentSectionLink","node","Link","children","contextTypes","Provider","childContextTypes","CommentSection","isSent","edition","confirmation","bool","Discussion","Cards","cards","cardsWrapper","Footer","footer","Summary","header","recommendation","comment","action","feedback","mode","primary","commentView","discussionWrapper","footerView","feedbackView","failed","summaryWrapper","BackgroundScorm","organismPlayerResultContainerScorm","animationContainer","className","undefined","animationSrc","loop","autoplay","rendererSettings","hideOnTransparent","animationClassName","ie11ImageBackup","animationControl","lottie","ie11Backup","background","largeCircle","mediumCircle","smallCircle","content","PopinHeader","href","func","isRequired","Feedback"],"sources":["../../../../src/template/app-player/popin-end/summary.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {get, getOr, keys, isEmpty} from 'lodash/fp';\nimport classnames from 'classnames';\nimport {NovaSolidStatusCheckCircle2 as CheckIcon} from '@coorpacademy/nova-icons';\nimport Provider from '../../../atom/provider';\nimport Button from '../../../atom/button';\nimport Link from '../../../atom/link';\nimport Discussion from '../../../organism/discussion';\nimport Loader from '../../../atom/loader';\nimport Card from '../../../molecule/card';\nimport Feedback from '../../../molecule/feedback';\nimport CardsList from '../../../molecule/dashboard/cards-list';\nimport PopinHeader from '../popin-header';\nimport AtomLottieWrapper from '../../../atom/lottie-wrapper';\nimport style from './summary.css';\n\nconst Header = props => <PopinHeader {...props} />;\n\nconst SimpleAction = ({color, prefix, title, button}) => {\n const {title: buttonTitle, ...linkProps} = button;\n return (\n <div data-name=\"simpleAction\" className={style.simpleWrapper}>\n <div className={style.simpleTexts}>\n <span data-name=\"simplePrefix\" className={style.simplePrefix}>\n {prefix}\n </span>\n <span\n data-name=\"simpleTitle\"\n className={classnames(style.simpleTitle, style.innerHTML)}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n </div>\n <Button\n {...linkProps}\n type=\"link\"\n style={{\n backgroundColor: color\n }}\n className={style.simpleButton}\n submitValue={buttonTitle}\n />\n </div>\n );\n};\nSimpleAction.propTypes = {\n color: PropTypes.string,\n prefix: PropTypes.string,\n title: PropTypes.string,\n button: PropTypes.shape(Button.propTypes)\n};\n\nconst NextCourse = ({title, prefix, card}) => (\n <div data-name=\"nextCourse\" className={style.nextCourseWrapper}>\n <div className={style.nextCourseTexts}>\n <div className={style.nextCoursePrefix}>{prefix}</div>\n <div\n className={classnames(style.nextCourseTitle, style.innerHTML)}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n </div>\n <div className={style.nextCourseCard}>\n <Card {...card} dataName={'popin-end-next-course'} />\n </div>\n </div>\n);\nNextCourse.propTypes = {\n title: PropTypes.string,\n prefix: PropTypes.string,\n card: PropTypes.shape(CardsList.propTypes)\n};\n\nconst Subscribe = ({title, description, button, card}) => {\n const {title: buttonTitle, ...linkProps} = button;\n return (\n <div className={style.subscribeWrapper}>\n <div className={style.subscribeTexts}>\n <div className={style.subscribeDescription}>{description}</div>\n <div\n className={classnames(style.subscribeTitle, style.innerHTML)}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n <div className={style.subscribeButtonWrapper}>\n <Button\n {...linkProps}\n type=\"link\"\n className={style.subscribeButton}\n submitValue={buttonTitle}\n />\n </div>\n </div>\n <div>\n <Card {...card} dataName={'popin-end-subscribe'} />\n </div>\n </div>\n );\n};\n\nSubscribe.propTypes = {\n ...Button.propTypes.propTypes,\n title: Button.propTypes.submitValue\n};\n\nconst actions = {\n simple: SimpleAction,\n subscribe: Subscribe,\n nextCourse: NextCourse\n};\n\nconst Action = props => {\n const {type, ...actionProps} = props;\n const Type = get(type, actions);\n\n return Type ? <Type {...actionProps} /> : null;\n};\n\nAction.propTypes = {\n type: PropTypes.oneOf(keys(actions))\n};\n\nconst CardsLoader = () => (\n <div className={style.loaderWrapper}>\n <Loader />\n </div>\n);\n\nconst CommentConfirmation = (props, context) => {\n const {onClick, commentSectionTitle, confirmationLinkText} = props;\n const {skin} = context;\n const dark = get('common.dark', skin);\n\n return (\n <div className={style.commentSection}>\n <div className={style.commentSectionIconWrapper}>\n <CheckIcon className={style.commentSectionIcon} color={dark} />\n </div>\n <div className={style.commentSectionTexts}>\n <p>{commentSectionTitle}</p>\n <Link onClick={onClick} className={style.commentSectionLink}>\n {confirmationLinkText}\n </Link>\n </div>\n </div>\n );\n};\n\nCommentConfirmation.propTypes = {\n commentSectionTitle: PropTypes.node,\n confirmationLinkText: Link.propTypes.children,\n onClick: Link.propTypes.onClick\n};\n\nCommentConfirmation.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nconst CommentSection = props => {\n const {isSent, edition, confirmation} = props;\n if (isSent) {\n const {onClick, commentSectionTitle, confirmationLinkText} = confirmation;\n return (\n <CommentConfirmation\n onClick={onClick}\n commentSectionTitle={commentSectionTitle}\n confirmationLinkText={confirmationLinkText}\n />\n );\n }\n\n return <Discussion {...edition} />;\n};\n\nCommentSection.propTypes = {\n isSent: PropTypes.bool,\n edition: PropTypes.shape(Discussion.propTypes),\n confirmation: PropTypes.shape(CommentConfirmation.propTypes)\n};\n\nconst Cards = props => {\n const {cards} = props;\n\n return get('cards', props) === null ? (\n <CardsLoader />\n ) : (\n (isEmpty(cards) ? null : (\n <div className={style.cardsWrapper}>\n <CardsList {...props} dataName={'popin-end-recommendation'} />\n </div>\n )) || null\n );\n};\n\nCards.propTypes = CardsList.propTypes;\n\nconst Footer = ({title, color, ...linkProps}) => (\n <Link\n {...linkProps}\n style={{\n color\n }}\n className={style.footer}\n data-name=\"nextLink\"\n data-popin=\"popinEnd\"\n data-next=\"home\"\n >\n {title}\n </Link>\n);\n\nFooter.propTypes = {\n ...Link.propTypes,\n title: Link.propTypes.children,\n color: PropTypes.string\n};\n\nconst Summary = (props, context) => {\n const {header, recommendation, comment, footer, action, feedback, mode} = props;\n const {skin} = context;\n const primary = getOr('#f0f', 'common.primary', skin);\n const commentView =\n mode !== 'scorm' && comment && header ? (\n <div className={style.discussionWrapper}>\n <CommentSection {...comment} />\n </div>\n ) : null;\n const footerView =\n mode !== 'scorm' && footer && header ? <Footer {...footer} color={primary} /> : null;\n const feedbackView = feedback ? <Feedback {...feedback} mode={mode} /> : null;\n\n return (\n <BackgroundScorm mode={mode} failed={header.failed}>\n <div className={mode !== 'scorm' ? style.summaryWrapper : null}>\n <Header {...header} mode={mode} />\n {feedbackView}\n <Action {...action} color={primary} />\n <Cards {...recommendation} />\n {commentView}\n {footerView}\n </div>\n </BackgroundScorm>\n );\n};\n\nconst BackgroundScorm = props => {\n const {mode = 'default', children, failed} = props;\n if (mode === 'scorm')\n return (\n <div className={style.organismPlayerResultContainerScorm}>\n {failed === false ? (\n <div className={style.animationContainer}>\n <AtomLottieWrapper\n {...{\n 'aria-label': 'aria lottie',\n 'data-name': 'default-lottie',\n className: undefined,\n animationSrc:\n 'https://static-staging.coorpacademy.com/animations/review/confetti.json',\n loop: undefined,\n autoplay: true,\n rendererSettings: {\n hideOnTransparent: false,\n animationClassName: ''\n },\n ie11ImageBackup:\n 'https://static-staging.coorpacademy.com/animations/review/conffeti_congrats.svg',\n animationControl: undefined\n }}\n loop={false}\n animationControl={'play'}\n autoplay\n data-name=\"lottie-wrapper\"\n className={style.lottie}\n backupImageClassName={style.ie11Backup}\n />\n </div>\n ) : null}\n <div className={style.background}>\n <div className={style.largeCircle} />\n <div className={style.mediumCircle} />\n <div className={style.smallCircle} />\n </div>\n <div className={style.content}>{children}</div>\n </div>\n );\n return children;\n};\n\nSummary.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nSummary.propTypes = {\n header: PropTypes.shape(PopinHeader.propTypes),\n footer: PropTypes.shape({\n title: PropTypes.string,\n href: Link.propTypes.href,\n onClick: PropTypes.func\n }),\n comment: PropTypes.shape(CommentSection.propTypes),\n action: PropTypes.shape({\n type: PropTypes.oneOf(keys(actions)).isRequired\n }),\n recommendation: PropTypes.shape(CardsList.propTypes),\n feedback: PropTypes.shape(Feedback.propTypes),\n mode: PropTypes.oneOf(['scorm', 'default'])\n};\n\nexport default Summary;\n"],"mappings":";;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;AAEA,MAA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AAA,CAAUiG;EAHG,CAAhB,CAFU;EAOlBjC,OAAO,EAAEhE,kBAAA,CAAUE,KAAV,CAAgBgD,cAAc,CAACnD,SAA/B,CAPS;EAQlBkE,MAAM,EAAEjE,kBAAA,CAAUE,KAAV,CAAgB;IACtBwB,IAAI,EAAE1B,kBAAA,CAAU6B,KAAV,CAAgB,oBAAKR,OAAL,CAAhB,EAA+B6E;EADf,CAAhB,CARU;EAWlBnC,cAAc,EAAE/D,kBAAA,CAAUE,KAAV,CAAgBS,kBAAA,CAAUZ,SAA1B,CAXE;EAYlBmE,QAAQ,EAAElE,kBAAA,CAAUE,KAAV,CAAgBiG,iBAAA,CAASpG,SAAzB,CAZQ;EAalBoE,IAAI,EAAEnE,kBAAA,CAAU6B,KAAV,CAAgB,CAAC,OAAD,EAAU,SAAV,CAAhB;AAbY,CAApB;eAgBegC,O"}
|
|
1
|
+
{"version":3,"file":"summary.js","names":["Header","props","SimpleAction","color","prefix","title","button","buttonTitle","linkProps","style","simpleWrapper","simpleTexts","simplePrefix","classnames","simpleTitle","innerHTML","__html","backgroundColor","simpleButton","propTypes","PropTypes","string","shape","Button","NextCourse","card","nextCourseWrapper","nextCourseTexts","nextCoursePrefix","nextCourseTitle","nextCourseCard","CardsList","Subscribe","description","subscribeWrapper","subscribeTexts","subscribeDescription","subscribeTitle","subscribeButtonWrapper","subscribeButton","submitValue","actions","simple","subscribe","nextCourse","Action","type","actionProps","Type","oneOf","CardsLoader","loaderWrapper","CommentConfirmation","context","onClick","commentSectionTitle","confirmationLinkText","skin","dark","commentSection","commentSectionIconWrapper","commentSectionIcon","commentSectionTexts","commentSectionLink","node","Link","children","contextTypes","Provider","childContextTypes","CommentSection","isSent","edition","confirmation","bool","Discussion","Cards","cards","cardsWrapper","Footer","footer","Summary","header","recommendation","comment","action","feedback","mode","primary","commentView","discussionWrapper","footerView","feedbackView","failed","summaryWrapper","BackgroundScorm","organismPlayerResultContainerScorm","animationContainer","className","undefined","animationSrc","loop","autoplay","rendererSettings","hideOnTransparent","animationClassName","ie11ImageBackup","animationControl","lottie","ie11Backup","background","largeCircle","mediumCircle","smallCircle","content","PopinHeader","href","func","isRequired","Feedback"],"sources":["../../../../src/template/app-player/popin-end/summary.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {get, getOr, keys, isEmpty} from 'lodash/fp';\nimport classnames from 'classnames';\nimport {NovaSolidStatusCheckCircle2 as CheckIcon} from '@coorpacademy/nova-icons';\nimport Provider from '../../../atom/provider';\nimport Button from '../../../atom/button';\nimport Link from '../../../atom/link';\nimport Discussion from '../../../organism/discussion';\nimport Loader from '../../../atom/loader';\nimport Card from '../../../molecule/card';\nimport Feedback from '../../../molecule/feedback';\nimport CardsList from '../../../molecule/dashboard/cards-list';\nimport PopinHeader from '../popin-header';\nimport AtomLottieWrapper from '../../../atom/lottie-wrapper';\nimport style from './summary.css';\n\nconst Header = props => <PopinHeader {...props} />;\n\nconst SimpleAction = ({color, prefix, title, button}) => {\n const {title: buttonTitle, ...linkProps} = button;\n return (\n <div data-name=\"simpleAction\" className={style.simpleWrapper}>\n <div className={style.simpleTexts}>\n <span data-name=\"simplePrefix\" className={style.simplePrefix}>\n {prefix}\n </span>\n <span\n data-name=\"simpleTitle\"\n className={classnames(style.simpleTitle, style.innerHTML)}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n </div>\n <Button\n {...linkProps}\n type=\"link\"\n style={{\n backgroundColor: color\n }}\n className={style.simpleButton}\n submitValue={buttonTitle}\n />\n </div>\n );\n};\nSimpleAction.propTypes = {\n color: PropTypes.string,\n prefix: PropTypes.string,\n title: PropTypes.string,\n button: PropTypes.shape(Button.propTypes)\n};\n\nconst NextCourse = ({title, prefix, card}) => (\n <div data-name=\"nextCourse\" className={style.nextCourseWrapper}>\n <div className={style.nextCourseTexts}>\n <div className={style.nextCoursePrefix}>{prefix}</div>\n <div\n className={classnames(style.nextCourseTitle, style.innerHTML)}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n </div>\n <div className={style.nextCourseCard}>\n <Card {...card} dataName={'popin-end-next-course'} />\n </div>\n </div>\n);\nNextCourse.propTypes = {\n title: PropTypes.string,\n prefix: PropTypes.string,\n card: PropTypes.shape(CardsList.propTypes)\n};\n\nconst Subscribe = ({title, description, button, card}) => {\n const {title: buttonTitle, ...linkProps} = button;\n return (\n <div className={style.subscribeWrapper}>\n <div className={style.subscribeTexts}>\n <div className={style.subscribeDescription}>{description}</div>\n <div\n className={classnames(style.subscribeTitle, style.innerHTML)}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n <div className={style.subscribeButtonWrapper}>\n <Button\n {...linkProps}\n type=\"link\"\n className={style.subscribeButton}\n submitValue={buttonTitle}\n />\n </div>\n </div>\n <div>\n <Card {...card} dataName={'popin-end-subscribe'} />\n </div>\n </div>\n );\n};\n\nSubscribe.propTypes = {\n ...Button.propTypes.propTypes,\n title: Button.propTypes.submitValue\n};\n\nconst actions = {\n simple: SimpleAction,\n subscribe: Subscribe,\n nextCourse: NextCourse\n};\n\nconst Action = props => {\n const {type, ...actionProps} = props;\n const Type = get(type, actions);\n\n return Type ? <Type {...actionProps} /> : null;\n};\n\nAction.propTypes = {\n type: PropTypes.oneOf(keys(actions))\n};\n\nconst CardsLoader = () => (\n <div className={style.loaderWrapper}>\n <Loader />\n </div>\n);\n\nconst CommentConfirmation = (props, context) => {\n const {onClick, commentSectionTitle, confirmationLinkText} = props;\n const {skin} = context;\n const dark = get('common.dark', skin);\n\n return (\n <div className={style.commentSection}>\n <div className={style.commentSectionIconWrapper}>\n <CheckIcon className={style.commentSectionIcon} color={dark} />\n </div>\n <div className={style.commentSectionTexts}>\n <p>{commentSectionTitle}</p>\n <Link onClick={onClick} className={style.commentSectionLink}>\n {confirmationLinkText}\n </Link>\n </div>\n </div>\n );\n};\n\nCommentConfirmation.propTypes = {\n commentSectionTitle: PropTypes.node,\n confirmationLinkText: Link.propTypes.children,\n onClick: Link.propTypes.onClick\n};\n\nCommentConfirmation.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nconst CommentSection = props => {\n const {isSent, edition, confirmation} = props;\n if (isSent) {\n const {onClick, commentSectionTitle, confirmationLinkText} = confirmation;\n return (\n <CommentConfirmation\n onClick={onClick}\n commentSectionTitle={commentSectionTitle}\n confirmationLinkText={confirmationLinkText}\n />\n );\n }\n\n return <Discussion {...edition} />;\n};\n\nCommentSection.propTypes = {\n isSent: PropTypes.bool,\n edition: PropTypes.shape(Discussion.propTypes),\n confirmation: PropTypes.shape(CommentConfirmation.propTypes)\n};\n\nconst Cards = props => {\n const {cards} = props;\n\n return get('cards', props) === null ? (\n <CardsLoader />\n ) : (\n (isEmpty(cards) ? null : (\n <div className={style.cardsWrapper}>\n <CardsList {...props} dataName={'popin-end-recommendation'} />\n </div>\n )) || null\n );\n};\n\nCards.propTypes = CardsList.propTypes;\n\nconst Footer = ({title, color, ...linkProps}) => (\n <Link\n {...linkProps}\n style={{\n color\n }}\n className={style.footer}\n data-name=\"nextLink\"\n data-popin=\"popinEnd\"\n data-next=\"home\"\n >\n {title}\n </Link>\n);\n\nFooter.propTypes = {\n ...Link.propTypes,\n title: Link.propTypes.children,\n color: PropTypes.string\n};\n\nconst Summary = (props, context) => {\n const {header, recommendation, comment, footer, action, feedback, mode} = props;\n const {skin} = context;\n const primary = getOr('#f0f', 'common.primary', skin);\n const commentView =\n mode !== 'scorm' && comment && header ? (\n <div className={style.discussionWrapper}>\n <CommentSection {...comment} />\n </div>\n ) : null;\n const footerView =\n mode !== 'scorm' && footer && header ? <Footer {...footer} color={primary} /> : null;\n const feedbackView = feedback ? <Feedback {...feedback} mode={mode} /> : null;\n\n return (\n <BackgroundScorm mode={mode} failed={header.failed}>\n <div className={mode !== 'scorm' ? style.summaryWrapper : null}>\n <Header {...header} mode={mode} />\n {feedbackView}\n <Action {...action} color={primary} />\n <Cards {...recommendation} />\n {commentView}\n {footerView}\n </div>\n </BackgroundScorm>\n );\n};\n\nconst BackgroundScorm = props => {\n const {mode = 'default', children, failed} = props;\n if (mode === 'scorm')\n return (\n <div className={style.organismPlayerResultContainerScorm}>\n {failed === false ? (\n <div className={style.animationContainer}>\n <AtomLottieWrapper\n {...{\n 'aria-label': 'aria lottie',\n 'data-name': 'default-lottie',\n className: undefined,\n animationSrc:\n 'https://static-staging.coorpacademy.com/animations/review/confetti.json',\n loop: undefined,\n autoplay: true,\n rendererSettings: {\n hideOnTransparent: false,\n animationClassName: ''\n },\n ie11ImageBackup:\n 'https://static-staging.coorpacademy.com/animations/review/conffeti_congrats.svg',\n animationControl: undefined\n }}\n loop={false}\n animationControl={'play'}\n autoplay\n data-name=\"lottie-wrapper\"\n className={style.lottie}\n backupImageClassName={style.ie11Backup}\n />\n </div>\n ) : null}\n <div className={style.background}>\n <div className={style.largeCircle} />\n <div className={style.mediumCircle} />\n <div className={style.smallCircle} />\n </div>\n <div className={style.content}>{children}</div>\n </div>\n );\n return children;\n};\n\nSummary.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nSummary.propTypes = {\n header: PropTypes.shape(PopinHeader.propTypes),\n footer: PropTypes.shape({\n title: PropTypes.string,\n href: Link.propTypes.href,\n onClick: PropTypes.func\n }),\n comment: PropTypes.shape(CommentSection.propTypes),\n action: PropTypes.shape({\n type: PropTypes.oneOf(keys(actions)).isRequired\n }),\n recommendation: PropTypes.shape(CardsList.propTypes),\n feedback: PropTypes.shape(Feedback.propTypes),\n mode: PropTypes.oneOf(['scorm', 'default'])\n};\n\nexport default Summary;\n"],"mappings":";;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;AAEA,MAAMA,MAAM,GAAGC,KAAK,iBAAI,6BAAC,oBAAD,EAAiBA,KAAjB,CAAxB;;AAEA,MAAMC,YAAY,GAAG,CAAC;EAACC,KAAD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AA/B,CAPS;EAQlBkE,MAAM,EAAEjE,kBAAA,CAAUE,KAAV,CAAgB;IACtBwB,IAAI,EAAE1B,kBAAA,CAAU6B,KAAV,CAAgB,oBAAKR,OAAL,CAAhB,EAA+B6E;EADf,CAAhB,CARU;EAWlBnC,cAAc,EAAE/D,kBAAA,CAAUE,KAAV,CAAgBS,kBAAA,CAAUZ,SAA1B,CAXE;EAYlBmE,QAAQ,EAAElE,kBAAA,CAAUE,KAAV,CAAgBiG,iBAAA,CAASpG,SAAzB,CAZQ;EAalBoE,IAAI,EAAEnE,kBAAA,CAAU6B,KAAV,CAAgB,CAAC,OAAD,EAAU,SAAV,CAAhB;AAbY,CAApB;eAgBegC,O"}
|
|
@@ -15,7 +15,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
15
15
|
|
|
16
16
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
17
17
|
|
|
18
|
-
const Context =
|
|
18
|
+
const Context = (0, _react.createContext)({
|
|
19
19
|
theme: _theme.default,
|
|
20
20
|
translations: {},
|
|
21
21
|
display: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template-context.js","names":["Context","createContext","theme","defaultTheme","translations","display","headerHeight","statusBarHeight","store","useTemplateContext","context","useContext","Error","TemplateContext","values","children"],"sources":["../../../src/template/app-review/template-context.tsx"],"sourcesContent":["import React, {createContext, useContext} from 'react';\nimport {Translations} from '../../types/translations';\nimport {Analytics} from '../../variables/analytics';\nimport defaultTheme, {Theme} from '../../variables/theme.native';\nimport {Vibration} from '../../variables/vibration';\n\nexport type HandleBlur = () => void;\nexport type HandleFocus = (id: string) => () => void;\nexport type FocusedSelectId = string | null;\n\nexport type TemplateContextValues = {\n analytics?: Analytics;\n brandTheme?: any;\n theme: Theme;\n translations: Translations;\n vibration?: Vibration;\n display: {\n headerHeight: number;\n statusBarHeight: number;\n };\n store: {\n focusedSelectId?: FocusedSelectId;\n handleBlur?: HandleBlur;\n handleFocus?: HandleFocus;\n };\n};\n\ntype Props = {values: TemplateContextValues; children: any};\n\nconst Context = createContext({\n theme: defaultTheme,\n translations: {},\n display: {\n headerHeight: 67,\n statusBarHeight: 42\n },\n store: {}\n});\n\nconst useTemplateContext = (): TemplateContextValues => {\n const context = useContext(Context);\n\n if (!context) {\n throw new Error(\n `❌ [TemplateContext] useTemplateContext must be used within a provider <TemplateContext>`\n );\n }\n\n return context;\n};\n\nconst TemplateContext = ({values, children}: Props) => {\n return <Context.Provider value={{...values}}>{children}</Context.Provider>;\n};\n\nexport {TemplateContext, useTemplateContext};\n"],"mappings":";;;;;AAAA;;AAGA;;;;;;;;;;AA0BA,MAAMA,OAAO,
|
|
1
|
+
{"version":3,"file":"template-context.js","names":["Context","createContext","theme","defaultTheme","translations","display","headerHeight","statusBarHeight","store","useTemplateContext","context","useContext","Error","TemplateContext","values","children"],"sources":["../../../src/template/app-review/template-context.tsx"],"sourcesContent":["import React, {createContext, useContext} from 'react';\nimport {Translations} from '../../types/translations';\nimport {Analytics} from '../../variables/analytics';\nimport defaultTheme, {Theme} from '../../variables/theme.native';\nimport {Vibration} from '../../variables/vibration';\n\nexport type HandleBlur = () => void;\nexport type HandleFocus = (id: string) => () => void;\nexport type FocusedSelectId = string | null;\n\nexport type TemplateContextValues = {\n analytics?: Analytics;\n brandTheme?: any;\n theme: Theme;\n translations: Translations;\n vibration?: Vibration;\n display: {\n headerHeight: number;\n statusBarHeight: number;\n };\n store: {\n focusedSelectId?: FocusedSelectId;\n handleBlur?: HandleBlur;\n handleFocus?: HandleFocus;\n };\n};\n\ntype Props = {values: TemplateContextValues; children: any};\n\nconst Context = createContext({\n theme: defaultTheme,\n translations: {},\n display: {\n headerHeight: 67,\n statusBarHeight: 42\n },\n store: {}\n});\n\nconst useTemplateContext = (): TemplateContextValues => {\n const context = useContext(Context);\n\n if (!context) {\n throw new Error(\n `❌ [TemplateContext] useTemplateContext must be used within a provider <TemplateContext>`\n );\n }\n\n return context;\n};\n\nconst TemplateContext = ({values, children}: Props) => {\n return <Context.Provider value={{...values}}>{children}</Context.Provider>;\n};\n\nexport {TemplateContext, useTemplateContext};\n"],"mappings":";;;;;AAAA;;AAGA;;;;;;;;;;AA0BA,MAAMA,OAAO,GAAG,IAAAC,oBAAA,EAAc;EAC5BC,KAAK,EAAEC,cADqB;EAE5BC,YAAY,EAAE,EAFc;EAG5BC,OAAO,EAAE;IACPC,YAAY,EAAE,EADP;IAEPC,eAAe,EAAE;EAFV,CAHmB;EAO5BC,KAAK,EAAE;AAPqB,CAAd,CAAhB;;AAUA,MAAMC,kBAAkB,GAAG,MAA6B;EACtD,MAAMC,OAAO,GAAG,IAAAC,iBAAA,EAAWX,OAAX,CAAhB;;EAEA,IAAI,CAACU,OAAL,EAAc;IACZ,MAAM,IAAIE,KAAJ,CACH,yFADG,CAAN;EAGD;;EAED,OAAOF,OAAP;AACD,CAVD;;;;AAYA,MAAMG,eAAe,GAAG,CAAC;EAACC,MAAD;EAASC;AAAT,CAAD,KAA+B;EACrD,oBAAO,6BAAC,OAAD,CAAS,QAAT;IAAkB,KAAK,eAAMD,MAAN;EAAvB,GAAuCC,QAAvC,CAAP;AACD,CAFD"}
|
|
@@ -25,7 +25,7 @@ var _style = _interopRequireDefault(require("./style.css"));
|
|
|
25
25
|
|
|
26
26
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
27
27
|
|
|
28
|
-
const Hero =
|
|
28
|
+
const Hero = _react.default.memo(function Hero({
|
|
29
29
|
hero,
|
|
30
30
|
welcome
|
|
31
31
|
}) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["Hero","React","memo","hero","welcome","style","propTypes","PropTypes","shape","HeroCard","Slide","Dashboard","props","sections","cookie","buildSectionComponent","section","type","buildSection","index","sectionView","sectionsList","key","map","wrapper","arrayOf","oneOfType","BattleRequestList","CardsList","NewsList","StartBattle","CMPopin"],"sources":["../../../../src/template/common/dashboard/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Slide from '../../../atom/slide';\nimport HeroCard from '../../../molecule/hero';\nimport BattleRequestList from '../../../molecule/dashboard/battle-request-list';\nimport CardsList from '../../../molecule/dashboard/cards-list';\nimport NewsList from '../../../molecule/dashboard/news-list';\nimport StartBattle from '../../../molecule/dashboard/start-battle';\nimport CMPopin from '../../../molecule/cm-popin';\nimport style from './style.css';\n\nconst Hero = React.memo(function Hero({hero, welcome}) {\n return <div className={style.hero}>{hero ? <HeroCard {...hero} /> : <Slide {...welcome} />}</div>;\n});\n\nHero.propTypes = {\n hero: PropTypes.shape(HeroCard.propTypes),\n welcome: PropTypes.shape(Slide.propTypes)\n};\n\nconst Dashboard = props => {\n const {sections = [], hero, welcome, cookie} = props;\n\n const buildSectionComponent = section => {\n const {type} = section;\n switch (type) {\n case 'hero':\n return <Hero hero={hero} welcome={welcome} />;\n case 'battleRequests':\n return <BattleRequestList {...section} />;\n case 'cards':\n return <CardsList {...section} />;\n case 'news':\n return <NewsList {...section} />;\n case 'battle':\n return <StartBattle {...section} />;\n default:\n return null;\n }\n };\n\n const buildSection = (section, index) => {\n const sectionView = buildSectionComponent(section);\n\n return <div key={index}>{sectionView}</div>;\n };\n\n const sectionsList = [{type: 'hero', key: 'hero'}, ...sections].map(section => (\n <div key={section.key}>{buildSection(section)}</div>\n ));\n return (\n <div className={style.wrapper} data-name=\"dashboard\">\n {sectionsList}\n {cookie ? <CMPopin {...cookie} /> : null}\n </div>\n );\n};\n\nDashboard.propTypes = {\n hero: Hero.propTypes.hero,\n welcome: Hero.propTypes.welcome,\n sections: PropTypes.arrayOf(\n PropTypes.oneOfType([\n PropTypes.shape(BattleRequestList.propTypes),\n PropTypes.shape(CardsList.propTypes),\n PropTypes.shape(NewsList.propTypes),\n PropTypes.shape(StartBattle.propTypes)\n ])\n ),\n cookie: PropTypes.shape(CMPopin.propTypes)\n};\nexport default Dashboard;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,IAAI,
|
|
1
|
+
{"version":3,"file":"index.js","names":["Hero","React","memo","hero","welcome","style","propTypes","PropTypes","shape","HeroCard","Slide","Dashboard","props","sections","cookie","buildSectionComponent","section","type","buildSection","index","sectionView","sectionsList","key","map","wrapper","arrayOf","oneOfType","BattleRequestList","CardsList","NewsList","StartBattle","CMPopin"],"sources":["../../../../src/template/common/dashboard/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Slide from '../../../atom/slide';\nimport HeroCard from '../../../molecule/hero';\nimport BattleRequestList from '../../../molecule/dashboard/battle-request-list';\nimport CardsList from '../../../molecule/dashboard/cards-list';\nimport NewsList from '../../../molecule/dashboard/news-list';\nimport StartBattle from '../../../molecule/dashboard/start-battle';\nimport CMPopin from '../../../molecule/cm-popin';\nimport style from './style.css';\n\nconst Hero = React.memo(function Hero({hero, welcome}) {\n return <div className={style.hero}>{hero ? <HeroCard {...hero} /> : <Slide {...welcome} />}</div>;\n});\n\nHero.propTypes = {\n hero: PropTypes.shape(HeroCard.propTypes),\n welcome: PropTypes.shape(Slide.propTypes)\n};\n\nconst Dashboard = props => {\n const {sections = [], hero, welcome, cookie} = props;\n\n const buildSectionComponent = section => {\n const {type} = section;\n switch (type) {\n case 'hero':\n return <Hero hero={hero} welcome={welcome} />;\n case 'battleRequests':\n return <BattleRequestList {...section} />;\n case 'cards':\n return <CardsList {...section} />;\n case 'news':\n return <NewsList {...section} />;\n case 'battle':\n return <StartBattle {...section} />;\n default:\n return null;\n }\n };\n\n const buildSection = (section, index) => {\n const sectionView = buildSectionComponent(section);\n\n return <div key={index}>{sectionView}</div>;\n };\n\n const sectionsList = [{type: 'hero', key: 'hero'}, ...sections].map(section => (\n <div key={section.key}>{buildSection(section)}</div>\n ));\n return (\n <div className={style.wrapper} data-name=\"dashboard\">\n {sectionsList}\n {cookie ? <CMPopin {...cookie} /> : null}\n </div>\n );\n};\n\nDashboard.propTypes = {\n hero: Hero.propTypes.hero,\n welcome: Hero.propTypes.welcome,\n sections: PropTypes.arrayOf(\n PropTypes.oneOfType([\n PropTypes.shape(BattleRequestList.propTypes),\n PropTypes.shape(CardsList.propTypes),\n PropTypes.shape(NewsList.propTypes),\n PropTypes.shape(StartBattle.propTypes)\n ])\n ),\n cookie: PropTypes.shape(CMPopin.propTypes)\n};\nexport default Dashboard;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,IAAI,GAAGC,cAAA,CAAMC,IAAN,CAAW,SAASF,IAAT,CAAc;EAACG,IAAD;EAAOC;AAAP,CAAd,EAA+B;EACrD,oBAAO;IAAK,SAAS,EAAEC,cAAA,CAAMF;EAAtB,GAA6BA,IAAI,gBAAG,6BAAC,aAAD,EAAcA,IAAd,CAAH,gBAA4B,6BAAC,cAAD,EAAWC,OAAX,CAA7D,CAAP;AACD,CAFY,CAAb;;AAIAJ,IAAI,CAACM,SAAL,2CAAiB;EACfH,IAAI,EAAEI,kBAAA,CAAUC,KAAV,CAAgBC,aAAA,CAASH,SAAzB,CADS;EAEfF,OAAO,EAAEG,kBAAA,CAAUC,KAAV,CAAgBE,cAAA,CAAMJ,SAAtB;AAFM,CAAjB;;AAKA,MAAMK,SAAS,GAAGC,KAAK,IAAI;EACzB,MAAM;IAACC,QAAQ,GAAG,EAAZ;IAAgBV,IAAhB;IAAsBC,OAAtB;IAA+BU;EAA/B,IAAyCF,KAA/C;;EAEA,MAAMG,qBAAqB,GAAGC,OAAO,IAAI;IACvC,MAAM;MAACC;IAAD,IAASD,OAAf;;IACA,QAAQC,IAAR;MACE,KAAK,MAAL;QACE,oBAAO,6BAAC,IAAD;UAAM,IA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,EAElBC,kBAAA,CAAUC,KAAV,CAAgBoB,kBAAA,CAAUtB,SAA1B,CAFkB,EAGlBC,kBAAA,CAAUC,KAAV,CAAgBqB,iBAAA,CAASvB,SAAzB,CAHkB,EAIlBC,kBAAA,CAAUC,KAAV,CAAgBsB,oBAAA,CAAYxB,SAA5B,CAJkB,CAApB,CADQ,CAHU;EAWpBQ,MAAM,EAAEP,kBAAA,CAAUC,KAAV,CAAgBuB,gBAAA,CAAQzB,SAAxB;AAXY,CAAtB;eAaeK,S"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coorpacademy/components",
|
|
3
|
-
"version": "10.24.
|
|
3
|
+
"version": "10.24.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -151,5 +151,5 @@
|
|
|
151
151
|
"last 2 versions",
|
|
152
152
|
"IE 11"
|
|
153
153
|
],
|
|
154
|
-
"gitHead": "
|
|
154
|
+
"gitHead": "90d579426a1435f4eb29884b34623ec4adbb4d70"
|
|
155
155
|
}
|