@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,7 +1,7 @@
|
|
|
1
1
|
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); }
|
|
2
2
|
|
|
3
3
|
import React, { createContext, useContext } from 'react';
|
|
4
|
-
const Context =
|
|
4
|
+
const Context = createContext({
|
|
5
5
|
translate: key => key
|
|
6
6
|
});
|
|
7
7
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web-context.js","names":["React","createContext","useContext","Context","translate","key","WebContext","skin","children","values","useWebContext","context","Error"],"sources":["../../../src/atom/provider/web-context.tsx"],"sourcesContent":["import React, {createContext, useContext} from 'react';\n\ntype Skin = {\n common: {\n primary: string;\n };\n};\n\ntype WebContextValues = {\n skin?: Skin;\n translate: (key: string) => string;\n};\n\nconst Context = createContext({\n translate: (key: string) => key\n});\n\ntype Props = WebContextValues & {\n children: any;\n};\n\nconst WebContext = ({skin, translate, children}: Props) => {\n const values = {skin, translate};\n return <Context.Provider value={{...values}}>{children}</Context.Provider>;\n};\n\nexport const useWebContext = (): WebContextValues => {\n const context = useContext(Context);\n\n if (!context) {\n throw new Error('❌ [WebContext] useWebContext must be used within a provider <WebContext>');\n }\n\n return context;\n};\n\nexport default WebContext;\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,aAAf,EAA8BC,UAA9B,QAA+C,OAA/C;AAaA,MAAMC,OAAO,
|
|
1
|
+
{"version":3,"file":"web-context.js","names":["React","createContext","useContext","Context","translate","key","WebContext","skin","children","values","useWebContext","context","Error"],"sources":["../../../src/atom/provider/web-context.tsx"],"sourcesContent":["import React, {createContext, useContext} from 'react';\n\ntype Skin = {\n common: {\n primary: string;\n };\n};\n\ntype WebContextValues = {\n skin?: Skin;\n translate: (key: string) => string;\n};\n\nconst Context = createContext({\n translate: (key: string) => key\n});\n\ntype Props = WebContextValues & {\n children: any;\n};\n\nconst WebContext = ({skin, translate, children}: Props) => {\n const values = {skin, translate};\n return <Context.Provider value={{...values}}>{children}</Context.Provider>;\n};\n\nexport const useWebContext = (): WebContextValues => {\n const context = useContext(Context);\n\n if (!context) {\n throw new Error('❌ [WebContext] useWebContext must be used within a provider <WebContext>');\n }\n\n return context;\n};\n\nexport default WebContext;\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,aAAf,EAA8BC,UAA9B,QAA+C,OAA/C;AAaA,MAAMC,OAAO,GAAGF,aAAa,CAAC;EAC5BG,SAAS,EAAGC,GAAD,IAAiBA;AADA,CAAD,CAA7B;;AAQA,MAAMC,UAAU,GAAG,CAAC;EAACC,IAAD;EAAOH,SAAP;EAAkBI;AAAlB,CAAD,KAAwC;EACzD,MAAMC,MAAM,GAAG;IAACF,IAAD;IAAOH;EAAP,CAAf;EACA,oBAAO,oBAAC,OAAD,CAAS,QAAT;IAAkB,KAAK,eAAMK,MAAN;EAAvB,GAAuCD,QAAvC,CAAP;AACD,CAHD;;AAKA,OAAO,MAAME,aAAa,GAAG,MAAwB;EACnD,MAAMC,OAAO,GAAGT,UAAU,CAACC,OAAD,CAA1B;;EAEA,IAAI,CAACQ,OAAL,EAAc;IACZ,MAAM,IAAIC,KAAJ,CAAU,0EAAV,CAAN;EACD;;EAED,OAAOD,OAAP;AACD,CARM;AAUP,eAAeL,UAAf"}
|
|
@@ -26,7 +26,7 @@ const AnimationAdapter = ({
|
|
|
26
26
|
name,
|
|
27
27
|
children
|
|
28
28
|
}) => {
|
|
29
|
-
return React.Children.map(children, child =>
|
|
29
|
+
return React.Children.map(children, child => React.cloneElement(child, {
|
|
30
30
|
animated,
|
|
31
31
|
onAnimationEnd: () => onAnimationEnd(name)
|
|
32
32
|
}));
|
|
@@ -47,7 +47,7 @@ const walker = (type, handler) => children => {
|
|
|
47
47
|
if (_isNil(child) || _isString(child)) return child;
|
|
48
48
|
const newChild = child.type === type ? handler(child) : child;
|
|
49
49
|
if (React.Children.count(newChild.props.children) === 0) return newChild;
|
|
50
|
-
return
|
|
50
|
+
return React.cloneElement(newChild, {}, walker(type, handler)(newChild.props.children));
|
|
51
51
|
});
|
|
52
52
|
};
|
|
53
53
|
|
|
@@ -136,7 +136,7 @@ class AnimationScheduler extends React.Component {
|
|
|
136
136
|
onAnimationEnd = _noop,
|
|
137
137
|
after
|
|
138
138
|
} = child.props;
|
|
139
|
-
return
|
|
139
|
+
return React.cloneElement(child, {
|
|
140
140
|
animated: parentAnimated ? this.isAnimated(after) || animated : animated,
|
|
141
141
|
onAnimationEnd: name => {
|
|
142
142
|
this.handlerAnimationEnd(name);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","Animation","Transition","AnimationAdapter","animated","onAnimationEnd","name","children","Children","map","child","cloneElement","propTypes","string","isRequired","func","bool","pickByWithKey","convert","cap","walker","type","handler","index","newChild","count","props","reduceChildren","fun","acc","newAcc","getAnimationNames","mergeAnimationStates","animations","names","value","key","AnimationScheduler","Component","getDerivedStateFromProps","state","constructor","isAnimated","after","handlerAnimationEnd","setState","hasPendingAnimation","processAnimation","parentAnimated","render","bind","node"],"sources":["../../../src/hoc/animation-scheduler/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {\n assign,\n every,\n getOr,\n get,\n includes,\n isArray,\n isNil,\n isString,\n noop,\n pickBy,\n some,\n negate,\n identity,\n values,\n pipe,\n reduce,\n set\n} from 'lodash/fp';\nimport Animation from '../animation';\nimport Transition from '../transition';\n\nconst AnimationAdapter = ({animated, onAnimationEnd = noop, name, children}) => {\n return React.Children.map(children, child =>\n React.cloneElement(child, {\n animated,\n onAnimationEnd: () => onAnimationEnd(name)\n })\n );\n};\n\nAnimationAdapter.propTypes = {\n name: PropTypes.string.isRequired,\n onAnimationEnd: PropTypes.func,\n animated: PropTypes.bool\n};\n\nconst pickByWithKey = pickBy.convert({cap: true});\n\nconst walker = (type, handler) => children => {\n return React.Children.map(children, (child, index) => {\n if (isNil(child) || isString(child)) return child;\n const newChild = child.type === type ? handler(child) : child;\n if (React.Children.count(newChild.props.children) === 0) return newChild;\n return React.cloneElement(newChild, {}, walker(type, handler)(newChild.props.children));\n });\n};\n\nconst reduceChildren = fun => acc => children => {\n let newAcc = acc;\n React.Children.map(children, child => {\n newAcc = fun(newAcc, child);\n return child;\n });\n return newAcc;\n};\n\nconst getAnimationNames = reduceChildren((acc, child) => {\n if (isString(child)) return acc;\n\n const {\n type,\n props: {children}\n } = child;\n if (Animation !== type && Transition !== type && AnimationAdapter !== type)\n return [...acc, ...getAnimationNames(children)];\n\n const {\n props: {name}\n } = child;\n return [name, ...acc, ...getAnimationNames(children)];\n})([]);\n\nconst mergeAnimationStates = (animations, children) => {\n const names = getAnimationNames(children);\n\n return pipe(\n pickByWithKey((value, key) => includes(key, names)),\n assign(reduce((acc, name) => set(name, false, acc), {}, names))\n )(animations);\n};\n\nclass AnimationScheduler extends React.Component {\n static propTypes = {\n onAnimationEnd: PropTypes.func,\n animated: PropTypes.bool,\n children: PropTypes.node\n };\n\n static getDerivedStateFromProps(props, state) {\n const {children} = props;\n const {animations} = state;\n return {\n animations: mergeAnimationStates(animations, children)\n };\n }\n\n constructor(props) {\n super(props);\n\n const {children} = props;\n this.state = {\n animations: mergeAnimationStates({}, children)\n };\n }\n\n isAnimated(after) {\n if (isNil(after)) return true;\n\n const {animations} = this.state;\n\n const isAnimated = every(\n name => getOr(false, name, animations),\n isArray(after) ? after : [after]\n );\n\n return isAnimated;\n }\n\n handlerAnimationEnd(name) {\n this.setState(set(['animations', name], true), () => {\n const hasPendingAnimation = pipe(\n get('state.animations'),\n values,\n some(negate(identity))\n )(this);\n const {onAnimationEnd = noop} = this.props;\n if (!hasPendingAnimation) return onAnimationEnd();\n });\n }\n\n processAnimation(child) {\n const {animated: parentAnimated} = this.props;\n const {animated, onAnimationEnd = noop, after} = child.props;\n\n return React.cloneElement(child, {\n animated: parentAnimated ? this.isAnimated(after) || animated : animated,\n onAnimationEnd: name => {\n this.handlerAnimationEnd(name);\n return onAnimationEnd(name);\n }\n });\n }\n\n render() {\n const {children} = this.props;\n return pipe(\n walker(Animation, this.processAnimation.bind(this)),\n walker(Transition, this.processAnimation.bind(this)),\n walker(AnimationAdapter, this.processAnimation.bind(this))\n )(children);\n }\n}\n\nexport default AnimationScheduler;\n\nexport {AnimationAdapter};\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAoBA,OAAOC,SAAP,MAAsB,cAAtB;AACA,OAAOC,UAAP,MAAuB,eAAvB;;AAEA,MAAMC,gBAAgB,GAAG,CAAC;EAACC,QAAD;EAAWC,cAAc,QAAzB;EAAkCC,IAAlC;EAAwCC;AAAxC,CAAD,KAAuD;EAC9E,OAAOR,KAAK,CAACS,QAAN,CAAeC,GAAf,CAAmBF,QAAnB,EAA6BG,KAAK,
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","Animation","Transition","AnimationAdapter","animated","onAnimationEnd","name","children","Children","map","child","cloneElement","propTypes","string","isRequired","func","bool","pickByWithKey","convert","cap","walker","type","handler","index","newChild","count","props","reduceChildren","fun","acc","newAcc","getAnimationNames","mergeAnimationStates","animations","names","value","key","AnimationScheduler","Component","getDerivedStateFromProps","state","constructor","isAnimated","after","handlerAnimationEnd","setState","hasPendingAnimation","processAnimation","parentAnimated","render","bind","node"],"sources":["../../../src/hoc/animation-scheduler/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {\n assign,\n every,\n getOr,\n get,\n includes,\n isArray,\n isNil,\n isString,\n noop,\n pickBy,\n some,\n negate,\n identity,\n values,\n pipe,\n reduce,\n set\n} from 'lodash/fp';\nimport Animation from '../animation';\nimport Transition from '../transition';\n\nconst AnimationAdapter = ({animated, onAnimationEnd = noop, name, children}) => {\n return React.Children.map(children, child =>\n React.cloneElement(child, {\n animated,\n onAnimationEnd: () => onAnimationEnd(name)\n })\n );\n};\n\nAnimationAdapter.propTypes = {\n name: PropTypes.string.isRequired,\n onAnimationEnd: PropTypes.func,\n animated: PropTypes.bool\n};\n\nconst pickByWithKey = pickBy.convert({cap: true});\n\nconst walker = (type, handler) => children => {\n return React.Children.map(children, (child, index) => {\n if (isNil(child) || isString(child)) return child;\n const newChild = child.type === type ? handler(child) : child;\n if (React.Children.count(newChild.props.children) === 0) return newChild;\n return React.cloneElement(newChild, {}, walker(type, handler)(newChild.props.children));\n });\n};\n\nconst reduceChildren = fun => acc => children => {\n let newAcc = acc;\n React.Children.map(children, child => {\n newAcc = fun(newAcc, child);\n return child;\n });\n return newAcc;\n};\n\nconst getAnimationNames = reduceChildren((acc, child) => {\n if (isString(child)) return acc;\n\n const {\n type,\n props: {children}\n } = child;\n if (Animation !== type && Transition !== type && AnimationAdapter !== type)\n return [...acc, ...getAnimationNames(children)];\n\n const {\n props: {name}\n } = child;\n return [name, ...acc, ...getAnimationNames(children)];\n})([]);\n\nconst mergeAnimationStates = (animations, children) => {\n const names = getAnimationNames(children);\n\n return pipe(\n pickByWithKey((value, key) => includes(key, names)),\n assign(reduce((acc, name) => set(name, false, acc), {}, names))\n )(animations);\n};\n\nclass AnimationScheduler extends React.Component {\n static propTypes = {\n onAnimationEnd: PropTypes.func,\n animated: PropTypes.bool,\n children: PropTypes.node\n };\n\n static getDerivedStateFromProps(props, state) {\n const {children} = props;\n const {animations} = state;\n return {\n animations: mergeAnimationStates(animations, children)\n };\n }\n\n constructor(props) {\n super(props);\n\n const {children} = props;\n this.state = {\n animations: mergeAnimationStates({}, children)\n };\n }\n\n isAnimated(after) {\n if (isNil(after)) return true;\n\n const {animations} = this.state;\n\n const isAnimated = every(\n name => getOr(false, name, animations),\n isArray(after) ? after : [after]\n );\n\n return isAnimated;\n }\n\n handlerAnimationEnd(name) {\n this.setState(set(['animations', name], true), () => {\n const hasPendingAnimation = pipe(\n get('state.animations'),\n values,\n some(negate(identity))\n )(this);\n const {onAnimationEnd = noop} = this.props;\n if (!hasPendingAnimation) return onAnimationEnd();\n });\n }\n\n processAnimation(child) {\n const {animated: parentAnimated} = this.props;\n const {animated, onAnimationEnd = noop, after} = child.props;\n\n return React.cloneElement(child, {\n animated: parentAnimated ? this.isAnimated(after) || animated : animated,\n onAnimationEnd: name => {\n this.handlerAnimationEnd(name);\n return onAnimationEnd(name);\n }\n });\n }\n\n render() {\n const {children} = this.props;\n return pipe(\n walker(Animation, this.processAnimation.bind(this)),\n walker(Transition, this.processAnimation.bind(this)),\n walker(AnimationAdapter, this.processAnimation.bind(this))\n )(children);\n }\n}\n\nexport default AnimationScheduler;\n\nexport {AnimationAdapter};\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAoBA,OAAOC,SAAP,MAAsB,cAAtB;AACA,OAAOC,UAAP,MAAuB,eAAvB;;AAEA,MAAMC,gBAAgB,GAAG,CAAC;EAACC,QAAD;EAAWC,cAAc,QAAzB;EAAkCC,IAAlC;EAAwCC;AAAxC,CAAD,KAAuD;EAC9E,OAAOR,KAAK,CAACS,QAAN,CAAeC,GAAf,CAAmBF,QAAnB,EAA6BG,KAAK,IACvCX,KAAK,CAACY,YAAN,CAAmBD,KAAnB,EAA0B;IACxBN,QADwB;IAExBC,cAAc,EAAE,MAAMA,cAAc,CAACC,IAAD;EAFZ,CAA1B,CADK,CAAP;AAMD,CAPD;;AASAH,gBAAgB,CAACS,SAAjB,2CAA6B;EAC3BN,IAAI,EAAEN,SAAS,CAACa,MAAV,CAAiBC,UADI;EAE3BT,cAAc,EAAEL,SAAS,CAACe,IAFC;EAG3BX,QAAQ,EAAEJ,SAAS,CAACgB;AAHO,CAA7B;;AAMA,MAAMC,aAAa,GAAG,QAAOC,OAAP,CAAe;EAACC,GAAG,EAAE;AAAN,CAAf,CAAtB;;AAEA,MAAMC,MAAM,GAAG,CAACC,IAAD,EAAOC,OAAP,KAAmBf,QAAQ,IAAI;EAC5C,OAAOR,KAAK,CAACS,QAAN,CAAeC,GAAf,CAAmBF,QAAnB,EAA6B,CAACG,KAAD,EAAQa,KAAR,KAAkB;IACpD,IAAI,OAAMb,KAAN,KAAgB,UAASA,KAAT,CAApB,EAAqC,OAAOA,KAAP;IAC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KD;;AArE8C;;AAA3C8B,kB,CACGzB,S,2CAAY;EACjBP,cAAc,EAAEL,SAAS,CAACe,IADT;EAEjBX,QAAQ,EAAEJ,SAAS,CAACgB,IAFH;EAGjBT,QAAQ,EAAEP,SAAS,CAACmD;AAHH,C;AAuErB,eAAed,kBAAf;AAEA,SAAQlC,gBAAR"}
|
package/es/hoc/swapper/index.js
CHANGED
|
@@ -40,7 +40,7 @@ class Swapper extends React.Component {
|
|
|
40
40
|
props = _objectWithoutPropertiesLoose(_this$props, _excluded);
|
|
41
41
|
|
|
42
42
|
const child = React.Children.only(children);
|
|
43
|
-
return init ?
|
|
43
|
+
return init ? React.cloneElement(child, props) : child;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","safeCancelAnimationFrame","requestId","cancelAnimationFrame","Swapper","Component","constructor","props","state","init","componentDidMount","requestAnimationFrame","requestID","setState","componentWillUnmount","undefined","render","children","child","Children","only","cloneElement","propTypes","node"],"sources":["../../../src/hoc/swapper/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\nexport const safeCancelAnimationFrame = requestId => requestId && cancelAnimationFrame(requestId);\n\nclass Swapper extends React.Component {\n static propTypes = {\n children: PropTypes.node\n };\n\n constructor(props) {\n super(props);\n\n this.state = {\n init: true\n };\n }\n\n componentDidMount() {\n if (typeof requestAnimationFrame !== 'undefined') {\n this.requestID = requestAnimationFrame(() => this.setState({init: false}));\n }\n }\n\n componentWillUnmount() {\n if (this.requestID !== undefined) {\n safeCancelAnimationFrame(this.requestID);\n }\n }\n\n render() {\n const {init} = this.state;\n const {children, ...props} = this.props;\n const child = React.Children.only(children);\n\n return init ? React.cloneElement(child, props) : child;\n }\n}\n\nexport default Swapper;\n"],"mappings":";;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAO,MAAMC,wBAAwB,GAAGC,SAAS,IAAIA,SAAS,IAAIC,oBAAoB,CAACD,SAAD,CAA/E;;AAEP,MAAME,OAAN,SAAsBL,KAAK,CAACM,SAA5B,CAAsC;EAKpCC,WAAW,CAACC,KAAD,EAAQ;IACjB,MAAMA,KAAN;IAEA,KAAKC,KAAL,GAAa;MACXC,IAAI,EAAE;IADK,CAAb;EAGD;;EAEDC,iBAAiB,GAAG;IAClB,IAAI,OAAOC,qBAAP,KAAiC,WAArC,EAAkD;MAChD,KAAKC,SAAL,GAAiBD,qBAAqB,CAAC,MAAM,KAAKE,QAAL,CAAc;QAACJ,IAAI,EAAE;MAAP,CAAd,CAAP,CAAtC;IACD;EACF;;EAEDK,oBAAoB,GAAG;IACrB,IAAI,KAAKF,SAAL,KAAmBG,SAAvB,EAAkC;MAChCd,wBAAwB,CAAC,KAAKW,SAAN,CAAxB;IACD;EACF;;EAEDI,MAAM,GAAG;IACP,MAAM;MAACP;IAAD,IAAS,KAAKD,KAApB;;IACA,oBAA6B,KAAKD,KAAlC;IAAA,MAAM;MAACU;IAAD,CAAN;IAAA,MAAoBV,KAApB;;IACA,MAAMW,KAAK,GAAGnB,KAAK,CAACoB,QAAN,CAAeC,IAAf,CAAoBH,QAApB,CAAd;IAEA,OAAOR,IAAI,
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","safeCancelAnimationFrame","requestId","cancelAnimationFrame","Swapper","Component","constructor","props","state","init","componentDidMount","requestAnimationFrame","requestID","setState","componentWillUnmount","undefined","render","children","child","Children","only","cloneElement","propTypes","node"],"sources":["../../../src/hoc/swapper/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\nexport const safeCancelAnimationFrame = requestId => requestId && cancelAnimationFrame(requestId);\n\nclass Swapper extends React.Component {\n static propTypes = {\n children: PropTypes.node\n };\n\n constructor(props) {\n super(props);\n\n this.state = {\n init: true\n };\n }\n\n componentDidMount() {\n if (typeof requestAnimationFrame !== 'undefined') {\n this.requestID = requestAnimationFrame(() => this.setState({init: false}));\n }\n }\n\n componentWillUnmount() {\n if (this.requestID !== undefined) {\n safeCancelAnimationFrame(this.requestID);\n }\n }\n\n render() {\n const {init} = this.state;\n const {children, ...props} = this.props;\n const child = React.Children.only(children);\n\n return init ? React.cloneElement(child, props) : child;\n }\n}\n\nexport default Swapper;\n"],"mappings":";;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAO,MAAMC,wBAAwB,GAAGC,SAAS,IAAIA,SAAS,IAAIC,oBAAoB,CAACD,SAAD,CAA/E;;AAEP,MAAME,OAAN,SAAsBL,KAAK,CAACM,SAA5B,CAAsC;EAKpCC,WAAW,CAACC,KAAD,EAAQ;IACjB,MAAMA,KAAN;IAEA,KAAKC,KAAL,GAAa;MACXC,IAAI,EAAE;IADK,CAAb;EAGD;;EAEDC,iBAAiB,GAAG;IAClB,IAAI,OAAOC,qBAAP,KAAiC,WAArC,EAAkD;MAChD,KAAKC,SAAL,GAAiBD,qBAAqB,CAAC,MAAM,KAAKE,QAAL,CAAc;QAACJ,IAAI,EAAE;MAAP,CAAd,CAAP,CAAtC;IACD;EACF;;EAEDK,oBAAoB,GAAG;IACrB,IAAI,KAAKF,SAAL,KAAmBG,SAAvB,EAAkC;MAChCd,wBAAwB,CAAC,KAAKW,SAAN,CAAxB;IACD;EACF;;EAEDI,MAAM,GAAG;IACP,MAAM;MAACP;IAAD,IAAS,KAAKD,KAApB;;IACA,oBAA6B,KAAKD,KAAlC;IAAA,MAAM;MAACU;IAAD,CAAN;IAAA,MAAoBV,KAApB;;IACA,MAAMW,KAAK,GAAGnB,KAAK,CAACoB,QAAN,CAAeC,IAAf,CAAoBH,QAApB,CAAd;IAEA,OAAOR,IAAI,GAAGV,KAAK,CAACsB,YAAN,CAAmBH,KAAnB,EAA0BX,KAA1B,CAAH,GAAsCW,KAAjD;EACD;;AA/BmC;;AAAhCd,O,CACGkB,S,2CAAY;EACjBL,QAAQ,EAAEjB,SAAS,CAACuB;AADH,C;AAiCrB,eAAenB,OAAf"}
|
|
@@ -24,7 +24,7 @@ const Transition = props => {
|
|
|
24
24
|
const handlerAnimationEnd = useMemo(() => () => {
|
|
25
25
|
return onAnimationEnd(name);
|
|
26
26
|
}, []);
|
|
27
|
-
return
|
|
27
|
+
return React.cloneElement(child, {
|
|
28
28
|
className: classnames(propClassName, className),
|
|
29
29
|
onTransitionEnd: handlerAnimationEnd,
|
|
30
30
|
onAnimationEnd: handlerAnimationEnd
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useMemo","PropTypes","classnames","Transition","props","name","children","className","animated","onAnimationEnd","Child","child","propClassName","handlerAnimationEnd","cloneElement","onTransitionEnd","Children","map","propTypes","string","isRequired","func","bool"],"sources":["../../../src/hoc/transition/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport {noop} from 'lodash/fp';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\n\nconst Transition = props => {\n const {name, children, className, animated, onAnimationEnd = noop} = props;\n\n if (!animated) return children;\n\n const Child = ({child}) => {\n const {\n props: {className: propClassName}\n } = child;\n\n const handlerAnimationEnd = useMemo(\n () => () => {\n return onAnimationEnd(name);\n },\n []\n );\n\n return React.cloneElement(child, {\n className: classnames(propClassName, className),\n onTransitionEnd: handlerAnimationEnd,\n onAnimationEnd: handlerAnimationEnd\n });\n };\n\n return React.Children.map(children, child => <Child child={child} />);\n};\n\nTransition.propTypes = {\n name: PropTypes.string.isRequired,\n onAnimationEnd: PropTypes.func,\n animated: PropTypes.bool\n};\n\nexport default Transition;\n"],"mappings":";AAAA,OAAOA,KAAP,IAAeC,OAAf,QAA6B,OAA7B;AAEA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;;AAEA,MAAMC,UAAU,GAAGC,KAAK,IAAI;EAC1B,MAAM;IAACC,IAAD;IAAOC,QAAP;IAAiBC,SAAjB;IAA4BC,QAA5B;IAAsCC,cAAc;EAApD,IAA+DL,KAArE;EAEA,IAAI,CAACI,QAAL,EAAe,OAAOF,QAAP;;EAEf,MAAMI,KAAK,GAAG,CAAC;IAACC;EAAD,CAAD,KAAa;IACzB,MAAM;MACJP,KAAK,EAAE;QAACG,SAAS,EAAEK;MAAZ;IADH,IAEFD,KAFJ;IAIA,MAAME,mBAAmB,GAAGb,OAAO,CACjC,MAAM,MAAM;MACV,OAAOS,cAAc,CAACJ,IAAD,CAArB;IACD,CAHgC,EAIjC,EAJiC,CAAnC;IAOA,
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useMemo","PropTypes","classnames","Transition","props","name","children","className","animated","onAnimationEnd","Child","child","propClassName","handlerAnimationEnd","cloneElement","onTransitionEnd","Children","map","propTypes","string","isRequired","func","bool"],"sources":["../../../src/hoc/transition/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport {noop} from 'lodash/fp';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\n\nconst Transition = props => {\n const {name, children, className, animated, onAnimationEnd = noop} = props;\n\n if (!animated) return children;\n\n const Child = ({child}) => {\n const {\n props: {className: propClassName}\n } = child;\n\n const handlerAnimationEnd = useMemo(\n () => () => {\n return onAnimationEnd(name);\n },\n []\n );\n\n return React.cloneElement(child, {\n className: classnames(propClassName, className),\n onTransitionEnd: handlerAnimationEnd,\n onAnimationEnd: handlerAnimationEnd\n });\n };\n\n return React.Children.map(children, child => <Child child={child} />);\n};\n\nTransition.propTypes = {\n name: PropTypes.string.isRequired,\n onAnimationEnd: PropTypes.func,\n animated: PropTypes.bool\n};\n\nexport default Transition;\n"],"mappings":";AAAA,OAAOA,KAAP,IAAeC,OAAf,QAA6B,OAA7B;AAEA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;;AAEA,MAAMC,UAAU,GAAGC,KAAK,IAAI;EAC1B,MAAM;IAACC,IAAD;IAAOC,QAAP;IAAiBC,SAAjB;IAA4BC,QAA5B;IAAsCC,cAAc;EAApD,IAA+DL,KAArE;EAEA,IAAI,CAACI,QAAL,EAAe,OAAOF,QAAP;;EAEf,MAAMI,KAAK,GAAG,CAAC;IAACC;EAAD,CAAD,KAAa;IACzB,MAAM;MACJP,KAAK,EAAE;QAACG,SAAS,EAAEK;MAAZ;IADH,IAEFD,KAFJ;IAIA,MAAME,mBAAmB,GAAGb,OAAO,CACjC,MAAM,MAAM;MACV,OAAOS,cAAc,CAACJ,IAAD,CAArB;IACD,CAHgC,EAIjC,EAJiC,CAAnC;IAOA,OAAON,KAAK,CAACe,YAAN,CAAmBH,KAAnB,EAA0B;MAC/BJ,SAAS,EAAEL,UAAU,CAACU,aAAD,EAAgBL,SAAhB,CADU;MAE/BQ,eAAe,EAAEF,mBAFc;MAG/BJ,cAAc,EAAEI;IAHe,CAA1B,CAAP;EAKD,CAjBD;;EAmBA,OAAOd,KAAK,CAACiB,QAAN,CAAeC,GAAf,CAAmBX,QAAnB,EAA6BK,KAAK,iBAAI,oBAAC,KAAD;IAAO,KAAK,EAAEA;EAAd,EAAtC,CAAP;AACD,CAzBD;;AA2BAR,UAAU,CAACe,SAAX,2CAAuB;EACrBb,IAAI,EAAEJ,SAAS,CAACkB,MAAV,CAAiBC,UADF;EAErBX,cAAc,EAAER,SAAS,CAACoB,IAFL;EAGrBb,QAAQ,EAAEP,SAAS,CAACqB;AAHC,CAAvB;AAMA,eAAenB,UAAf"}
|
|
@@ -8,7 +8,7 @@ const ADD_TO_MY_LIST_STATUS = {
|
|
|
8
8
|
IDLE: 'IDLE',
|
|
9
9
|
SUCCESS: 'SUCCESS'
|
|
10
10
|
};
|
|
11
|
-
const StatusContext =
|
|
11
|
+
const StatusContext = React.createContext(ADD_TO_MY_LIST_STATUS.IDLE);
|
|
12
12
|
export const AddToMyListStatusProvider = ({
|
|
13
13
|
children
|
|
14
14
|
}) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useState","useContext","useEffect","useMemo","PropTypes","classnames","NovaCompositionCoorpacademyCheck","CheckIcon","NovaCompositionNavigationMore","MoreIcon","Link","styles","ADD_TO_MY_LIST_STATUS","IDLE","SUCCESS","StatusContext","createContext","AddToMyListStatusProvider","children","status","setStatus","timeoutId","DURATION","setTimeout","clearTimeout","statusValue","AddToMyListFeedback","addToMyListText","removeFromMyListText","favorite","feedback","checkIcon","AddToMyList","style","addToMyListButton","onFavoriteClick","cb","onClick","container","cta","wrapper","shareIcon","propTypes","node","string","bool","func"],"sources":["../../../src/molecule/add-to-my-list/index.js"],"sourcesContent":["import React, {useState, useContext, useEffect, useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {\n NovaCompositionCoorpacademyCheck as CheckIcon,\n NovaCompositionNavigationMore as MoreIcon\n} from '@coorpacademy/nova-icons';\nimport Link from '../../atom/link';\nimport styles from './style.css';\n\nconst ADD_TO_MY_LIST_STATUS = {\n IDLE: 'IDLE',\n SUCCESS: 'SUCCESS'\n};\n\nconst StatusContext = React.createContext(ADD_TO_MY_LIST_STATUS.IDLE);\n\nexport const AddToMyListStatusProvider = ({children}) => {\n const [status, setStatus] = useState(ADD_TO_MY_LIST_STATUS.IDLE);\n useEffect(() => {\n let timeoutId;\n const DURATION = 3000;\n if (status !== ADD_TO_MY_LIST_STATUS.IDLE) {\n timeoutId = setTimeout(() => setStatus(ADD_TO_MY_LIST_STATUS.IDLE), DURATION);\n }\n return () => clearTimeout(timeoutId);\n }, [status]);\n const statusValue = useMemo(() => [status, setStatus], [status, setStatus]);\n return <StatusContext.Provider value={statusValue}>{children}</StatusContext.Provider>;\n};\n\nexport const AddToMyListFeedback = ({addToMyListText, removeFromMyListText, favorite}) => {\n const [status] = useContext(StatusContext);\n if (status === ADD_TO_MY_LIST_STATUS.IDLE) return null;\n\n return (\n <div className={classnames(styles.feedback)} data-name={'add-to-my-list-feedback'}>\n <CheckIcon className={styles.checkIcon} width={13} height={13} />\n <p>{favorite ? addToMyListText : removeFromMyListText}</p>\n </div>\n );\n};\n\nconst AddToMyList = ({style, addToMyListButton, favorite, onFavoriteClick}) => {\n const [, setStatus] = useContext(StatusContext);\n const cb = () => setStatus(ADD_TO_MY_LIST_STATUS.SUCCESS);\n\n function onClick() {\n onFavoriteClick(cb);\n }\n\n return (\n <div className={(styles.container, style)}>\n <Link data-name={'add-to-my-list-button'} onClick={onClick} className={styles.cta}>\n <div className={styles.wrapper}>\n {favorite ? (\n <CheckIcon className={styles.shareIcon} width={15} height={15} />\n ) : (\n <MoreIcon className={styles.shareIcon} width={12} height={12} />\n )}\n <p>{addToMyListButton}</p>\n </div>\n </Link>\n </div>\n );\n};\n\nAddToMyListStatusProvider.propTypes = {\n children: PropTypes.node\n};\n\nAddToMyListFeedback.propTypes = {\n addToMyListText: PropTypes.string,\n removeFromMyListText: PropTypes.string,\n favorite: PropTypes.bool\n};\n\nAddToMyList.propTypes = {\n style: PropTypes.string,\n addToMyListButton: PropTypes.string,\n favorite: PropTypes.bool,\n onFavoriteClick: PropTypes.func\n};\n\nexport default AddToMyList;\n"],"mappings":"AAAA,OAAOA,KAAP,IAAeC,QAAf,EAAyBC,UAAzB,EAAqCC,SAArC,EAAgDC,OAAhD,QAA8D,OAA9D;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,SACEC,gCAAgC,IAAIC,SADtC,EAEEC,6BAA6B,IAAIC,QAFnC,QAGO,0BAHP;AAIA,OAAOC,IAAP,MAAiB,iBAAjB;AACA,OAAOC,MAAP,MAAmB,aAAnB;AAEA,MAAMC,qBAAqB,GAAG;EAC5BC,IAAI,EAAE,MADsB;EAE5BC,OAAO,EAAE;AAFmB,CAA9B;AAKA,MAAMC,aAAa,
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useState","useContext","useEffect","useMemo","PropTypes","classnames","NovaCompositionCoorpacademyCheck","CheckIcon","NovaCompositionNavigationMore","MoreIcon","Link","styles","ADD_TO_MY_LIST_STATUS","IDLE","SUCCESS","StatusContext","createContext","AddToMyListStatusProvider","children","status","setStatus","timeoutId","DURATION","setTimeout","clearTimeout","statusValue","AddToMyListFeedback","addToMyListText","removeFromMyListText","favorite","feedback","checkIcon","AddToMyList","style","addToMyListButton","onFavoriteClick","cb","onClick","container","cta","wrapper","shareIcon","propTypes","node","string","bool","func"],"sources":["../../../src/molecule/add-to-my-list/index.js"],"sourcesContent":["import React, {useState, useContext, useEffect, useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {\n NovaCompositionCoorpacademyCheck as CheckIcon,\n NovaCompositionNavigationMore as MoreIcon\n} from '@coorpacademy/nova-icons';\nimport Link from '../../atom/link';\nimport styles from './style.css';\n\nconst ADD_TO_MY_LIST_STATUS = {\n IDLE: 'IDLE',\n SUCCESS: 'SUCCESS'\n};\n\nconst StatusContext = React.createContext(ADD_TO_MY_LIST_STATUS.IDLE);\n\nexport const AddToMyListStatusProvider = ({children}) => {\n const [status, setStatus] = useState(ADD_TO_MY_LIST_STATUS.IDLE);\n useEffect(() => {\n let timeoutId;\n const DURATION = 3000;\n if (status !== ADD_TO_MY_LIST_STATUS.IDLE) {\n timeoutId = setTimeout(() => setStatus(ADD_TO_MY_LIST_STATUS.IDLE), DURATION);\n }\n return () => clearTimeout(timeoutId);\n }, [status]);\n const statusValue = useMemo(() => [status, setStatus], [status, setStatus]);\n return <StatusContext.Provider value={statusValue}>{children}</StatusContext.Provider>;\n};\n\nexport const AddToMyListFeedback = ({addToMyListText, removeFromMyListText, favorite}) => {\n const [status] = useContext(StatusContext);\n if (status === ADD_TO_MY_LIST_STATUS.IDLE) return null;\n\n return (\n <div className={classnames(styles.feedback)} data-name={'add-to-my-list-feedback'}>\n <CheckIcon className={styles.checkIcon} width={13} height={13} />\n <p>{favorite ? addToMyListText : removeFromMyListText}</p>\n </div>\n );\n};\n\nconst AddToMyList = ({style, addToMyListButton, favorite, onFavoriteClick}) => {\n const [, setStatus] = useContext(StatusContext);\n const cb = () => setStatus(ADD_TO_MY_LIST_STATUS.SUCCESS);\n\n function onClick() {\n onFavoriteClick(cb);\n }\n\n return (\n <div className={(styles.container, style)}>\n <Link data-name={'add-to-my-list-button'} onClick={onClick} className={styles.cta}>\n <div className={styles.wrapper}>\n {favorite ? (\n <CheckIcon className={styles.shareIcon} width={15} height={15} />\n ) : (\n <MoreIcon className={styles.shareIcon} width={12} height={12} />\n )}\n <p>{addToMyListButton}</p>\n </div>\n </Link>\n </div>\n );\n};\n\nAddToMyListStatusProvider.propTypes = {\n children: PropTypes.node\n};\n\nAddToMyListFeedback.propTypes = {\n addToMyListText: PropTypes.string,\n removeFromMyListText: PropTypes.string,\n favorite: PropTypes.bool\n};\n\nAddToMyList.propTypes = {\n style: PropTypes.string,\n addToMyListButton: PropTypes.string,\n favorite: PropTypes.bool,\n onFavoriteClick: PropTypes.func\n};\n\nexport default AddToMyList;\n"],"mappings":"AAAA,OAAOA,KAAP,IAAeC,QAAf,EAAyBC,UAAzB,EAAqCC,SAArC,EAAgDC,OAAhD,QAA8D,OAA9D;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,SACEC,gCAAgC,IAAIC,SADtC,EAEEC,6BAA6B,IAAIC,QAFnC,QAGO,0BAHP;AAIA,OAAOC,IAAP,MAAiB,iBAAjB;AACA,OAAOC,MAAP,MAAmB,aAAnB;AAEA,MAAMC,qBAAqB,GAAG;EAC5BC,IAAI,EAAE,MADsB;EAE5BC,OAAO,EAAE;AAFmB,CAA9B;AAKA,MAAMC,aAAa,GAAGhB,KAAK,CAACiB,aAAN,CAAoBJ,qBAAqB,CAACC,IAA1C,CAAtB;AAEA,OAAO,MAAMI,yBAAyB,GAAG,CAAC;EAACC;AAAD,CAAD,KAAgB;EACvD,MAAM,CAACC,MAAD,EAASC,SAAT,IAAsBpB,QAAQ,CAACY,qBAAqB,CAACC,IAAvB,CAApC;EACAX,SAAS,CAAC,MAAM;IACd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|
'aria-label': PropTypes.string
|
|
109
109
|
} : {};
|
|
110
|
-
const Card =
|
|
110
|
+
const Card = memo(function Card(props, context) {
|
|
111
111
|
const {
|
|
112
112
|
skin
|
|
113
113
|
} = context;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useMemo","memo","PropTypes","classnames","NovaSolidLoginLocked","LockIcon","NovaCompositionCoorpacademyPictures","PicturesIcon","isExternalContent","EXTERNAL_CONTENT_ICONS","Provider","CardContentInfo","MODES","Customer","Favorite","Selectable","Notification","style","THEMES","default","coorpmanager","CardBackground","type","image","empty","ariaLabel","skin","externalContent","primaryColor","whiteColor","IconType","icon","iconColor","color","backgroundIcon","externalIconCircleWrapper","externalIcon","_backgroundIcon","externalIconCircleWithImageWrapper","backgroundColor","externalIconWithImage","imageWrapper","backgroundImage","externalContentHeader","externalBackground","emptyIcon","chapterImageWrapper","contextTypes","childContextTypes","propTypes","string","bool","Card","props","context","badge","adaptiv","disabled","hidden","title","author","customer","certifiedAuthor","progress","favorite","addFavoriteToolTip","removeFavoriteToolTip","onClick","onFavoriteClick","isSelected","notification","badgeCategory","badgeLabel","theme","cardArialabel","backgroundAriaLabel","favoriteAriaLabel","selectableAriaLabel","customerAriaLabel","badgeAriaLabel","disabledArialabel","cardContentLabelAriaLabel","cardStyle","chapter","course","lazy","grid","handleClick","e","lock","lockIcon","inlineBadgeStyle","getType","contentType","CARD","lockWrapper","shape","number","func","oneOf"],"sources":["../../../src/molecule/card/index.js"],"sourcesContent":["import React, {useMemo, memo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {get, isEmpty, isUndefined, pick, keys} from 'lodash/fp';\nimport {\n NovaSolidLoginLocked as LockIcon,\n NovaCompositionCoorpacademyPictures as PicturesIcon\n} from '@coorpacademy/nova-icons';\nimport {isExternalContent, EXTERNAL_CONTENT_ICONS} from '../../util/external-content';\nimport Provider from '../../atom/provider';\nimport CardContentInfo, {MODES} from '../card-content';\nimport Customer from './customer';\nimport Favorite from './favorite';\nimport Selectable from './selectable';\nimport Notification from './notification';\nimport style from './style.css';\n\nexport const THEMES = {\n default: null,\n coorpmanager: style.coorpmanager\n};\n\nconst CardBackground = ({type, image, empty, 'aria-label': ariaLabel}, {skin}) => {\n const externalContent = isExternalContent(type);\n const primaryColor = get('common.primary', skin);\n const whiteColor = get('common.white', skin);\n\n if (externalContent && EXTERNAL_CONTENT_ICONS[type]) {\n const IconType = EXTERNAL_CONTENT_ICONS[type].icon;\n const iconColor = EXTERNAL_CONTENT_ICONS[type].color;\n const backgroundIcon = (\n <div className={style.externalIconCircleWrapper}>\n <IconType className={style.externalIcon} />\n </div>\n );\n\n if (image) {\n const _backgroundIcon = (\n <div\n className={classnames(\n style.externalIconCircleWrapper,\n style.externalIconCircleWithImageWrapper\n )}\n style={{\n backgroundColor: iconColor\n }}\n >\n <IconType className={style.externalIconWithImage} />\n </div>\n );\n\n return (\n <div className={style.imageWrapper}>\n <div\n data-name=\"cover\"\n aria-label={ariaLabel}\n style={{\n backgroundColor: iconColor,\n backgroundImage: `url('${image}')`\n }}\n className={classnames(style.externalContentHeader, style.externalBackground)}\n >\n {_backgroundIcon}\n </div>\n </div>\n );\n }\n return (\n <div className={style.imageWrapper}>\n <div\n data-name=\"cover\"\n aria-label={ariaLabel}\n style={{\n backgroundColor: iconColor\n }}\n className={style.externalContentHeader}\n >\n {backgroundIcon}\n </div>\n </div>\n );\n }\n\n const emptyIcon = empty ? <PicturesIcon className={style.emptyIcon} color={whiteColor} /> : null;\n return (\n <div\n className={classnames(\n style.imageWrapper,\n type === 'chapter' ? style.chapterImageWrapper : null\n )}\n >\n <div\n data-name=\"cover\"\n aria-label={ariaLabel}\n className={style.image}\n style={{\n backgroundColor: primaryColor,\n backgroundImage: image ? `url('${image}')` : 'none'\n }}\n >\n {emptyIcon}\n </div>\n </div>\n );\n};\n\nCardBackground.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nCardBackground.propTypes = {\n type: PropTypes.string,\n image: PropTypes.string,\n empty: PropTypes.bool,\n 'aria-label': PropTypes.string\n};\n\nconst Card = memo(function Card(props, context) {\n const {skin} = context;\n const {\n image,\n badge,\n adaptiv,\n disabled: hidden = false,\n type = 'course',\n title,\n author,\n customer,\n certifiedAuthor,\n progress,\n favorite,\n addFavoriteToolTip,\n removeFavoriteToolTip,\n onClick,\n onFavoriteClick,\n isSelected,\n notification,\n badgeCategory,\n badgeLabel,\n theme = 'default',\n 'aria-label': cardArialabel,\n 'background-aria-label': backgroundAriaLabel,\n 'favorite-aria-label': favoriteAriaLabel,\n 'selectable-aria-label': selectableAriaLabel,\n 'customer-aria-label': customerAriaLabel,\n 'badge-aria-label': badgeAriaLabel,\n 'disabled-aria-label': disabledArialabel,\n 'card-content-aria-label': cardContentLabelAriaLabel\n } = props;\n const empty = isEmpty(pick(['title', 'type', 'author', 'image'], props));\n const primaryColor = get('common.primary', skin);\n const whiteColor = get('common.white', skin);\n const cardStyle = classnames(\n THEMES[theme],\n type === 'chapter' ? style.chapter : style.course,\n title ? null : style.lazy,\n style.grid,\n empty ? style.empty : null\n );\n const disabled = hidden && (!isSelected || isUndefined(isSelected));\n const handleClick = useMemo(() => e => !disabled && onClick(e), [disabled, onClick]);\n const lock = disabled ? (\n <LockIcon className={style.lockIcon} color={whiteColor} height={40} />\n ) : null;\n const inlineBadgeStyle = {color: primaryColor};\n const getType = contentType => {\n switch (contentType) {\n case 'chapter':\n return 'microlearning';\n case 'course':\n return 'learner';\n default:\n return contentType;\n }\n };\n\n return (\n <div\n className={cardStyle}\n data-name=\"card\"\n data-lock={disabled}\n data-type={getType(type)}\n disabled={disabled}\n onClick={handleClick}\n aria-label={cardArialabel}\n >\n <CardBackground type={type} image={image} empty={empty} aria-label={backgroundAriaLabel} />\n {isUndefined(isSelected) && !isUndefined(favorite) ? (\n <Favorite\n className={style.favorite}\n favorite={favorite}\n disabled={disabled}\n onFavoriteClick={onFavoriteClick}\n addFavoriteToolTip={addFavoriteToolTip}\n removeFavoriteToolTip={removeFavoriteToolTip}\n aria-label={favoriteAriaLabel}\n />\n ) : null}\n <Selectable isSelected={isSelected} hidden={hidden} aria-label={selectableAriaLabel} />\n {notification ? <Notification {...notification} /> : null}\n {customer ? (\n <Customer\n {...customer}\n theme={theme}\n type={type}\n disabled={disabled}\n aria-label={customerAriaLabel}\n />\n ) : null}\n <CardContentInfo\n mode={MODES.CARD}\n adaptiv={adaptiv}\n author={author}\n certifiedAuthor={certifiedAuthor}\n disabled={disabled}\n empty={empty}\n progress={progress}\n title={title}\n type={type}\n badgeCategory={badgeCategory}\n badgeLabel={badgeLabel}\n theme={theme}\n aria-label={cardContentLabelAriaLabel}\n />\n {badge ? (\n <div className={style.badge} style={inlineBadgeStyle} aria-label={badgeAriaLabel}>\n {badge}\n </div>\n ) : null}\n {disabled ? (\n <div className={style.lockWrapper} aria-label={disabledArialabel}>\n {lock}\n </div>\n ) : null}\n </div>\n );\n});\n\nCard.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nCard.propTypes = {\n badge: PropTypes.string,\n image: PropTypes.string,\n disabled: PropTypes.bool,\n adaptiv: PropTypes.bool,\n type: PropTypes.string,\n title: PropTypes.string,\n author: PropTypes.string,\n certifiedAuthor: PropTypes.bool,\n customer: PropTypes.shape(Customer.propTypes),\n progress: PropTypes.number,\n favorite: PropTypes.bool,\n addFavoriteToolTip: PropTypes.string,\n removeFavoriteToolTip: PropTypes.string,\n onClick: PropTypes.func,\n onFavoriteClick: PropTypes.func,\n isSelected: PropTypes.bool,\n notification: PropTypes.shape(Notification.propTypes),\n badgeCategory: CardContentInfo.propTypes.badgeCategory,\n badgeLabel: CardContentInfo.propTypes.badgeLabel,\n theme: PropTypes.oneOf(keys(THEMES)),\n 'aria-label': PropTypes.string,\n 'background-aria-label': PropTypes.string,\n 'favorite-aria-label': Favorite.propTypes['aria-label'],\n 'selectable-aria-label': Selectable.propTypes['aria-label'],\n 'customer-aria-label': Customer.propTypes['aria-label'],\n 'badge-aria-label': PropTypes.string,\n 'disabled-aria-label': PropTypes.string,\n 'card-content-aria-label': CardContentInfo.propTypes['aria-label']\n};\nexport default Card;\n"],"mappings":";;;;;;;;AAAA,OAAOA,KAAP,IAAeC,OAAf,EAAwBC,IAAxB,QAAmC,OAAnC;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAEA,SACEC,oBAAoB,IAAIC,QAD1B,EAEEC,mCAAmC,IAAIC,YAFzC,QAGO,0BAHP;AAIA,SAAQC,iBAAR,EAA2BC,sBAA3B,QAAwD,6BAAxD;AACA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAAOC,eAAP,IAAyBC,KAAzB,QAAqC,iBAArC;AACA,OAAOC,QAAP,MAAqB,YAArB;AACA,OAAOC,QAAP,MAAqB,YAArB;AACA,OAAOC,UAAP,MAAuB,cAAvB;AACA,OAAOC,YAAP,MAAyB,gBAAzB;AACA,OAAOC,KAAP,MAAkB,aAAlB;AAEA,OAAO,MAAMC,MAAM,GAAG;EACpBC,OAAO,EAAE,IADW;EAEpBC,YAAY,EAAEH,KAAK,CAACG;AAFA,CAAf;;AAKP,MAAMC,cAAc,GAAG,CAAC;EAACC,IAAD;EAAOC,KAAP;EAAcC,KAAd;EAAqB,cAAcC;AAAnC,CAAD,EAAgD;EAACC;AAAD,CAAhD,KAA2D;EAChF,MAAMC,eAAe,GAAGnB,iBAAiB,CAACc,IAAD,CAAzC;;EACA,MAAMM,YAAY,GAAG,KAAI,gBAAJ,EAAsBF,IAAtB,CAArB;;EACA,MAAMG,UAAU,GAAG,KAAI,cAAJ,EAAoBH,IAApB,CAAnB;;EAEA,IAAIC,eAAe,IAAIlB,sBAAsB,CAACa,IAAD,CAA7C,EAAqD;IACnD,MAAMQ,QAAQ,GAAGrB,sBAAsB,CAACa,IAAD,CAAtB,CAA6BS,IAA9C;IACA,MAAMC,SAAS,GAAGvB,sBAAsB,CAACa,IAAD,CAAtB,CAA6BW,KAA/C;I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EAkBfsB,aAAa,EAAE5D,eAAe,CAACsC,SAAhB,CAA0BsB,aAlB1B;EAmBfC,UAAU,EAAE7D,eAAe,CAACsC,SAAhB,CAA0BuB,UAnBvB;EAoBfC,KAAK,EAAEvE,SAAS,CAACiG,KAAV,CAAgB,MAAKjF,MAAL,CAAhB,CApBQ;EAqBf,cAAchB,SAAS,CAACgD,MArBT;EAsBf,yBAAyBhD,SAAS,CAACgD,MAtBpB;EAuBf,uBAAuBpC,QAAQ,CAACmC,SAAT,CAAmB,YAAnB,CAvBR;EAwBf,yBAAyBlC,UAAU,CAACkC,SAAX,CAAqB,YAArB,CAxBV;EAyBf,uBAAuBpC,QAAQ,CAACoC,SAAT,CAAmB,YAAnB,CAzBR;EA0Bf,oBAAoB/C,SAAS,CAACgD,MA1Bf;EA2Bf,uBAAuBhD,SAAS,CAACgD,MA3BlB;EA4Bf,2BAA2BvC,eAAe,CAACsC,SAAhB,CAA0B,YAA1B;AA5BZ,CAAjB;AA8BA,eAAeG,IAAf"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useMemo","memo","PropTypes","classnames","NovaSolidLoginLocked","LockIcon","NovaCompositionCoorpacademyPictures","PicturesIcon","isExternalContent","EXTERNAL_CONTENT_ICONS","Provider","CardContentInfo","MODES","Customer","Favorite","Selectable","Notification","style","THEMES","default","coorpmanager","CardBackground","type","image","empty","ariaLabel","skin","externalContent","primaryColor","whiteColor","IconType","icon","iconColor","color","backgroundIcon","externalIconCircleWrapper","externalIcon","_backgroundIcon","externalIconCircleWithImageWrapper","backgroundColor","externalIconWithImage","imageWrapper","backgroundImage","externalContentHeader","externalBackground","emptyIcon","chapterImageWrapper","contextTypes","childContextTypes","propTypes","string","bool","Card","props","context","badge","adaptiv","disabled","hidden","title","author","customer","certifiedAuthor","progress","favorite","addFavoriteToolTip","removeFavoriteToolTip","onClick","onFavoriteClick","isSelected","notification","badgeCategory","badgeLabel","theme","cardArialabel","backgroundAriaLabel","favoriteAriaLabel","selectableAriaLabel","customerAriaLabel","badgeAriaLabel","disabledArialabel","cardContentLabelAriaLabel","cardStyle","chapter","course","lazy","grid","handleClick","e","lock","lockIcon","inlineBadgeStyle","getType","contentType","CARD","lockWrapper","shape","number","func","oneOf"],"sources":["../../../src/molecule/card/index.js"],"sourcesContent":["import React, {useMemo, memo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {get, isEmpty, isUndefined, pick, keys} from 'lodash/fp';\nimport {\n NovaSolidLoginLocked as LockIcon,\n NovaCompositionCoorpacademyPictures as PicturesIcon\n} from '@coorpacademy/nova-icons';\nimport {isExternalContent, EXTERNAL_CONTENT_ICONS} from '../../util/external-content';\nimport Provider from '../../atom/provider';\nimport CardContentInfo, {MODES} from '../card-content';\nimport Customer from './customer';\nimport Favorite from './favorite';\nimport Selectable from './selectable';\nimport Notification from './notification';\nimport style from './style.css';\n\nexport const THEMES = {\n default: null,\n coorpmanager: style.coorpmanager\n};\n\nconst CardBackground = ({type, image, empty, 'aria-label': ariaLabel}, {skin}) => {\n const externalContent = isExternalContent(type);\n const primaryColor = get('common.primary', skin);\n const whiteColor = get('common.white', skin);\n\n if (externalContent && EXTERNAL_CONTENT_ICONS[type]) {\n const IconType = EXTERNAL_CONTENT_ICONS[type].icon;\n const iconColor = EXTERNAL_CONTENT_ICONS[type].color;\n const backgroundIcon = (\n <div className={style.externalIconCircleWrapper}>\n <IconType className={style.externalIcon} />\n </div>\n );\n\n if (image) {\n const _backgroundIcon = (\n <div\n className={classnames(\n style.externalIconCircleWrapper,\n style.externalIconCircleWithImageWrapper\n )}\n style={{\n backgroundColor: iconColor\n }}\n >\n <IconType className={style.externalIconWithImage} />\n </div>\n );\n\n return (\n <div className={style.imageWrapper}>\n <div\n data-name=\"cover\"\n aria-label={ariaLabel}\n style={{\n backgroundColor: iconColor,\n backgroundImage: `url('${image}')`\n }}\n className={classnames(style.externalContentHeader, style.externalBackground)}\n >\n {_backgroundIcon}\n </div>\n </div>\n );\n }\n return (\n <div className={style.imageWrapper}>\n <div\n data-name=\"cover\"\n aria-label={ariaLabel}\n style={{\n backgroundColor: iconColor\n }}\n className={style.externalContentHeader}\n >\n {backgroundIcon}\n </div>\n </div>\n );\n }\n\n const emptyIcon = empty ? <PicturesIcon className={style.emptyIcon} color={whiteColor} /> : null;\n return (\n <div\n className={classnames(\n style.imageWrapper,\n type === 'chapter' ? style.chapterImageWrapper : null\n )}\n >\n <div\n data-name=\"cover\"\n aria-label={ariaLabel}\n className={style.image}\n style={{\n backgroundColor: primaryColor,\n backgroundImage: image ? `url('${image}')` : 'none'\n }}\n >\n {emptyIcon}\n </div>\n </div>\n );\n};\n\nCardBackground.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nCardBackground.propTypes = {\n type: PropTypes.string,\n image: PropTypes.string,\n empty: PropTypes.bool,\n 'aria-label': PropTypes.string\n};\n\nconst Card = memo(function Card(props, context) {\n const {skin} = context;\n const {\n image,\n badge,\n adaptiv,\n disabled: hidden = false,\n type = 'course',\n title,\n author,\n customer,\n certifiedAuthor,\n progress,\n favorite,\n addFavoriteToolTip,\n removeFavoriteToolTip,\n onClick,\n onFavoriteClick,\n isSelected,\n notification,\n badgeCategory,\n badgeLabel,\n theme = 'default',\n 'aria-label': cardArialabel,\n 'background-aria-label': backgroundAriaLabel,\n 'favorite-aria-label': favoriteAriaLabel,\n 'selectable-aria-label': selectableAriaLabel,\n 'customer-aria-label': customerAriaLabel,\n 'badge-aria-label': badgeAriaLabel,\n 'disabled-aria-label': disabledArialabel,\n 'card-content-aria-label': cardContentLabelAriaLabel\n } = props;\n const empty = isEmpty(pick(['title', 'type', 'author', 'image'], props));\n const primaryColor = get('common.primary', skin);\n const whiteColor = get('common.white', skin);\n const cardStyle = classnames(\n THEMES[theme],\n type === 'chapter' ? style.chapter : style.course,\n title ? null : style.lazy,\n style.grid,\n empty ? style.empty : null\n );\n const disabled = hidden && (!isSelected || isUndefined(isSelected));\n const handleClick = useMemo(() => e => !disabled && onClick(e), [disabled, onClick]);\n const lock = disabled ? (\n <LockIcon className={style.lockIcon} color={whiteColor} height={40} />\n ) : null;\n const inlineBadgeStyle = {color: primaryColor};\n const getType = contentType => {\n switch (contentType) {\n case 'chapter':\n return 'microlearning';\n case 'course':\n return 'learner';\n default:\n return contentType;\n }\n };\n\n return (\n <div\n className={cardStyle}\n data-name=\"card\"\n data-lock={disabled}\n data-type={getType(type)}\n disabled={disabled}\n onClick={handleClick}\n aria-label={cardArialabel}\n >\n <CardBackground type={type} image={image} empty={empty} aria-label={backgroundAriaLabel} />\n {isUndefined(isSelected) && !isUndefined(favorite) ? (\n <Favorite\n className={style.favorite}\n favorite={favorite}\n disabled={disabled}\n onFavoriteClick={onFavoriteClick}\n addFavoriteToolTip={addFavoriteToolTip}\n removeFavoriteToolTip={removeFavoriteToolTip}\n aria-label={favoriteAriaLabel}\n />\n ) : null}\n <Selectable isSelected={isSelected} hidden={hidden} aria-label={selectableAriaLabel} />\n {notification ? <Notification {...notification} /> : null}\n {customer ? (\n <Customer\n {...customer}\n theme={theme}\n type={type}\n disabled={disabled}\n aria-label={customerAriaLabel}\n />\n ) : null}\n <CardContentInfo\n mode={MODES.CARD}\n adaptiv={adaptiv}\n author={author}\n certifiedAuthor={certifiedAuthor}\n disabled={disabled}\n empty={empty}\n progress={progress}\n title={title}\n type={type}\n badgeCategory={badgeCategory}\n badgeLabel={badgeLabel}\n theme={theme}\n aria-label={cardContentLabelAriaLabel}\n />\n {badge ? (\n <div className={style.badge} style={inlineBadgeStyle} aria-label={badgeAriaLabel}>\n {badge}\n </div>\n ) : null}\n {disabled ? (\n <div className={style.lockWrapper} aria-label={disabledArialabel}>\n {lock}\n </div>\n ) : null}\n </div>\n );\n});\n\nCard.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nCard.propTypes = {\n badge: PropTypes.string,\n image: PropTypes.string,\n disabled: PropTypes.bool,\n adaptiv: PropTypes.bool,\n type: PropTypes.string,\n title: PropTypes.string,\n author: PropTypes.string,\n certifiedAuthor: PropTypes.bool,\n customer: PropTypes.shape(Customer.propTypes),\n progress: PropTypes.number,\n favorite: PropTypes.bool,\n addFavoriteToolTip: PropTypes.string,\n removeFavoriteToolTip: PropTypes.string,\n onClick: PropTypes.func,\n onFavoriteClick: PropTypes.func,\n isSelected: PropTypes.bool,\n notification: PropTypes.shape(Notification.propTypes),\n badgeCategory: CardContentInfo.propTypes.badgeCategory,\n badgeLabel: CardContentInfo.propTypes.badgeLabel,\n theme: PropTypes.oneOf(keys(THEMES)),\n 'aria-label': PropTypes.string,\n 'background-aria-label': PropTypes.string,\n 'favorite-aria-label': Favorite.propTypes['aria-label'],\n 'selectable-aria-label': Selectable.propTypes['aria-label'],\n 'customer-aria-label': Customer.propTypes['aria-label'],\n 'badge-aria-label': PropTypes.string,\n 'disabled-aria-label': PropTypes.string,\n 'card-content-aria-label': CardContentInfo.propTypes['aria-label']\n};\nexport default Card;\n"],"mappings":";;;;;;;;AAAA,OAAOA,KAAP,IAAeC,OAAf,EAAwBC,IAAxB,QAAmC,OAAnC;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAEA,SACEC,oBAAoB,IAAIC,QAD1B,EAEEC,mCAAmC,IAAIC,YAFzC,QAGO,0BAHP;AAIA,SAAQC,iBAAR,EAA2BC,sBAA3B,QAAwD,6BAAxD;AACA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAAOC,eAAP,IAAyBC,KAAzB,QAAqC,iBAArC;AACA,OAAOC,QAAP,MAAqB,YAArB;AACA,OAAOC,QAAP,MAAqB,YAArB;AACA,OAAOC,UAAP,MAAuB,cAAvB;AACA,OAAOC,YAAP,MAAyB,gBAAzB;AACA,OAAOC,KAAP,MAAkB,aAAlB;AAEA,OAAO,MAAMC,MAAM,GAAG;EACpBC,OAAO,EAAE,IADW;EAEpBC,YAAY,EAAEH,KAAK,CAACG;AAFA,CAAf;;AAKP,MAAMC,cAAc,GAAG,CAAC;EAACC,IAAD;EAA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pload","NovaLineSettingsCookie","Cookie","NovaSolidSpaceMoonRocket","MoonRocket","map","Cta","ButtonLinkIconOnly","InputSwitch","style","CMPopin","props","content","mode","firstButton","secondButton","onClose","header","icon","backgroundImageUrl","descriptionText","thirdButton","cookieTitle","descriptionBtnTxt","listBtnSwicth","logo","LogoComponent","backgroundImageStyle","backgroundImage","backgroundSize","renderHeader","headerBackground","cookieHeader","cookieIconContainer","cookieIcon","getClassBtnSwitch","index","btnList","firstBtnSwitchContainer","length","lastBtnSwitchContainer","singleSwitchContainer","renderBtnSwitch","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","string","oneOf","shape","func","bool","arrayOf"],"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,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,SACEC,+CAA+C,IAAIC,YADrD,EAEEC,kCAAkC,IAAIC,YAFxC,EAGEC,sBAAsB,IAAIC,MAH5B,EAIEC,wBAAwB,IAAIC,UAJ9B,QAKO,0BALP;AAMA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,GAAP,MAAgB,wBAAhB;AACA,OAAOC,kBAAP,MAA+B,kCAA/B;AACA,OAAOC,WAAP,MAAwB,yBAAxB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,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;IACX3B,YADW;IAEXE,YAFW;IAGXI;EAHW,CAAb;EAKA,MAAMsB,aAAa,GAAGD,IAAI,CAACP,IAAD,CAA1B;EAEA,MAAMS,oBAAoB,GAAGR,kBAAkB,GAC3C;IACES,eAAe,EAAG,OAAMT,kBAAmB,GAD7C;IAEEU,cAAc,EAAE;EAFlB,CAD2C,GAK3C,IALJ;;EAMA,MAAMC,YAAY,GAAG,MAAM;IACzB,IAAIb,MAAJ,EAAY,oBAAO;MAAK,SAAS,EAAER,KAAK,CAACsB,gBAAtB;MAAwC,GAAG,EAAEd;IAA7C,EAAP;IACZ,IAAIJ,IAAI,KAAK,QAAb,EACE,oBACE;MAAK,SAAS,EAAEJ,KAAK,CAACuB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AhB,CApBK;EA4BlBvD,OAAO,EAAEpB,SAAS,CAACgF,IA5BD;EA6BlB1D,IAAI,EAAEtB,SAAS,CAAC6E,MA7BE;EA8BlBtD,kBAAkB,EAAEvB,SAAS,CAAC6E,MA9BZ;EA+BlBrD,eAAe,EAAExB,SAAS,CAAC6E,MA/BT;EAgClBnD,WAAW,EAAE1B,SAAS,CAAC6E,MAhCL;EAiClBlD,iBAAiB,EAAE3B,SAAS,CAAC6E,MAjCX;EAkClBjD,aAAa,EAAE5B,SAAS,CAACkF,OAAV,CAAkBlF,SAAS,CAAC+E,KAAV,CAAgBnE,WAAW,CAACgE,SAA5B,CAAlB;AAlCG,CAApB;AAqCA,eAAe9D,OAAf"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","NovaSolidInterfaceFeedbackInterfaceAlertDiamond","AlertDiamond","NovaSolidApplicationsWindowUpload3","WindowUpload","NovaLineSettingsCookie","Cookie","NovaSolidSpaceMoonRocket","MoonRocket","map","Cta","ButtonLinkIconOnly","InputSwitch","style","CMPopin","props","content","mode","firstButton","secondButton","onClose","header","icon","backgroundImageUrl","descriptionText","thirdButton","cookieTitle","descriptionBtnTxt","listBtnSwicth","logo","LogoComponent","backgroundImageStyle","backgroundImage","backgroundSize","renderHeader","headerBackground","cookieHeader","cookieIconContainer","cookieIcon","getClassBtnSwitch","index","btnList","firstBtnSwitchContainer","length","lastBtnSwitchContainer","singleSwitchContainer","renderBtnSwitch","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","string","oneOf","shape","func","bool","arrayOf"],"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,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,SACEC,+CAA+C,IAAIC,YADrD,EAEEC,kCAAkC,IAAIC,YAFxC,EAGEC,sBAAsB,IAAIC,MAH5B,EAIEC,wBAAwB,IAAIC,UAJ9B,QAKO,0BALP;AAMA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,GAAP,MAAgB,wBAAhB;AACA,OAAOC,kBAAP,MAA+B,kCAA/B;AACA,OAAOC,WAAP,MAAwB,yBAAxB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,OAAO,GAAGC,KAAK,IAAI;EACvB,MAAM;IACJC,OADI;IAEJC,IAAI,GAAG,OAFH;IAGJC,WAHI;IAIJC,YAJI;IAKJC,OALI;IAMJC,MANI;IAOJC,IAPI;IAQJC,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EAAyB,WAAzB,CAAhB,CAHsB;IAI5B,cAAc9E,SAAS,CAAC6E,MAJI;IAK5BN,WAAW,EAAEvE,SAAS,CAACiF,IALK;IAM5BN,WAAW,EAAEjE,GAAG,CAACkE,SAAJ,CAAcD;EANC,CAAhB,CAZI;EAoBlBlD,WAAW,EAAEzB,SAAS,CAAC+E,KAAV,CAAgB;IAC3BN,KAAK,EAAEzE,SAAS,CAAC6E,MADU;IAE3BH,aAAa,EAAE1E,SAAS,CAACgF,IAFE;IAG3B9B,IAAI,EAAElD,SAAS,CAAC8E,KAAV,CAAgB,CAAC,WAAD,EAAc,SAAd,EAAyB,WAAzB,CAAhB,CAHqB;IAI3B,cAAc9E,SAAS,CAAC6E,MAJG;IAK3BN,WAAW,EAAEvE,SAAS,CAACiF,IALI;IAM3BN,WAAW,EAAEjE,GAAG,CAACkE,SAAJ,CAAcD;EANA,CAAhB,CApBK;EA4BlBvD,OAAO,EAAEpB,SAAS,CAACgF,IA5BD;EA6BlB1D,IAAI,EAAEtB,SAAS,CAAC6E,MA7BE;EA8BlBtD,kBAAkB,EAAEvB,SAAS,CAAC6E,MA9BZ;EA+BlBrD,eAAe,EAAExB,SAAS,CAAC6E,MA/BT;EAgClBnD,WAAW,EAAE1B,SAAS,CAAC6E,MAhCL;EAiClBlD,iBAAiB,EAAE3B,SAAS,CAAC6E,MAjCX;EAkClBjD,aAAa,EAAE5B,SAAS,CAACkF,OAAV,CAAkBlF,SAAS,CAAC+E,KAAV,CAAgBnE,WAAW,CAACgE,SAA5B,CAAlB;AAlCG,CAApB;AAqCA,eAAe9D,OAAf"}
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import BattleRequest from '../../battle-request';
|
|
4
4
|
import style from './style.css';
|
|
5
|
-
const BattleRequestList =
|
|
5
|
+
const BattleRequestList = React.memo(function BattleRequestList(props) {
|
|
6
6
|
const {
|
|
7
7
|
requests
|
|
8
8
|
} = props;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","BattleRequest","style","BattleRequestList","memo","props","requests","cards","map","request","key","card","list","propTypes","arrayOf","shape"],"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,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,aAAP,MAA0B,sBAA1B;AACA,OAAOC,KAAP,MAAkB,aAAlB;AAEA,MAAMC,iBAAiB,
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","BattleRequest","style","BattleRequestList","memo","props","requests","cards","map","request","key","card","list","propTypes","arrayOf","shape"],"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,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,aAAP,MAA0B,sBAA1B;AACA,OAAOC,KAAP,MAAkB,aAAlB;AAEA,MAAMC,iBAAiB,GAAGJ,KAAK,CAACK,IAAN,CAAW,SAASD,iBAAT,CAA2BE,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,EAAER,KAAK,CAACS,IAAtB;MAA4B,GAAG,EAAED;IAAjC,gBACE,oBAAC,aAAD,EAAmBD,OAAnB,CADF,CADF;EAKD,CANa,CAAd;EAQA,oBACE;IAAK,SAAS,EAAEP,KAAK,CAACU,IAAtB;IAA4B,aAAU;EAAtC,GACGL,KADH,CADF;AAKD,CAhByB,CAA1B;AAkBAJ,iBAAiB,CAACU,SAAlB,2CAA8B;EAC5BP,QAAQ,EAAEN,SAAS,CAACc,OAAV,CAAkBd,SAAS,CAACe,KAAV,CAAgBd,aAAa,CAACY,SAA9B,CAAlB;AADkB,CAA9B;AAIA,eAAeV,iBAAf"}
|
|
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import News from '../../news';
|
|
4
4
|
import Loader from '../../../atom/loader';
|
|
5
5
|
import style from './style.css';
|
|
6
|
-
const NewsList =
|
|
6
|
+
const NewsList = React.memo(function NewsList(props) {
|
|
7
7
|
const {
|
|
8
8
|
title,
|
|
9
9
|
news,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","News","Loader","style","NewsList","memo","props","title","news","more","loading","loadingView","loader","moreView","onClick","label","cardsView","map","nws","key","card","wrapper","list","propTypes","string","arrayOf","shape","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,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,IAAP,MAAiB,YAAjB;AACA,OAAOC,MAAP,MAAmB,sBAAnB;AACA,OAAOC,KAAP,MAAkB,aAAlB;AAEA,MAAMC,QAAQ,
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","News","Loader","style","NewsList","memo","props","title","news","more","loading","loadingView","loader","moreView","onClick","label","cardsView","map","nws","key","card","wrapper","list","propTypes","string","arrayOf","shape","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,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,IAAP,MAAiB,YAAjB;AACA,OAAOC,MAAP,MAAmB,sBAAnB;AACA,OAAOC,KAAP,MAAkB,aAAlB;AAEA,MAAMC,QAAQ,GAAGL,KAAK,CAACM,IAAN,CAAW,SAASD,QAAT,CAAkBE,KAAlB,EAAyB;EACnD,MAAM;IAACC,KAAD;IAAQC,IAAR;IAAcC,IAAd;IAAoBC,OAAO,GAAG;EAA9B,IAAuCJ,KAA7C;EAEA,MAAMK,WAAW,gBACf;IAAK,SAAS,EAAER,KAAK,CAACS;EAAtB,gBACE,oBAAC,MAAD,OADF,CADF;EAMA,MAAMC,QAAQ,GAAGJ,IAAI;EAAA;EACnB;EACA;IAAK,SAAS,EAAEN,KAAK,CAACM,IAAtB;IAA4B,OAAO,EAAEA,IAAI,CAACK;EAA1C,GACGL,IAAI,CAACM,KADR,CAFmB,GAKjB,IALJ;EAOA,MAAMC,SAAS,GAAGR,IAAI,CAACS,GAAL,CAAS,CAACC,GAAD,EAAMC,GAAN,KAAc;IACvC,oBACE;MAAK,SAAS,EAAEhB,KAAK,CAACiB,IAAtB;MAA4B,GAAG,EAAED;IAAjC,gBACE,oBAAC,IAAD,EAAUD,GAAV,CADF,CADF;EAKD,CANiB,CAAlB;EAQA,oBACE;IAAK,SAAS,EAAEf,KAAK,CAACkB,OAAtB;IAA+B,aAAU;EAAzC,gBACE;IAAK,SAAS,EAAElB,KAAK,CAACmB;EAAtB,gBACE;IAAK,SAAS,EAAEnB,KAAK,CAACI;EAAtB,GAA8BA,KAA9B,CADF,EAEGS,SAFH,EAGGN,OAAO,GAAGC,WAAH,GAAiBE,QAH3B,CADF,CADF;AASD,CAjCgB,CAAjB;AAmCAT,QAAQ,CAACmB,SAAT,2CAAqB;EACnBhB,KAAK,EAAEP,SAAS,CAACwB,MADE;EAEnBhB,IAAI,EAAER,SAAS,CAACyB,OAAV,CAAkBzB,SAAS,CAAC0B,KAAV,CAAgBzB,IAAI,CAACsB,SAArB,CAAlB,CAFa;EAGnBd,IAAI,EAAET,SAAS,CAAC0B,KAAV,CAAgB;IACpBX,KAAK,EAAEf,SAAS,CAACwB,MADG;IAEpBV,OAAO,EAAEd,SAAS,CAAC2B;EAFC,CAAhB,CAHa;EAOnBjB,OAAO,EAAEV,SAAS,CAAC4B;AAPA,CAArB;AAUA,eAAexB,QAAf"}
|
|
@@ -4,7 +4,7 @@ import React from 'react';
|
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import ButtonLink from '../../../atom/button-link';
|
|
6
6
|
import style from './style.css';
|
|
7
|
-
const ReviewBanner =
|
|
7
|
+
const ReviewBanner = React.memo(function ReviewBanner(props) {
|
|
8
8
|
const {
|
|
9
9
|
title,
|
|
10
10
|
subtitle,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","ButtonLink","style","ReviewBanner","memo","props","title","subtitle","cta","buttonProps","type","root","container","banner","left","image","middle","right","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,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,2BAAvB;AACA,OAAOC,KAAP,MAAkB,aAAlB;AAEA,MAAMC,YAAY,
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","ButtonLink","style","ReviewBanner","memo","props","title","subtitle","cta","buttonProps","type","root","container","banner","left","image","middle","right","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,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,2BAAvB;AACA,OAAOC,KAAP,MAAkB,aAAlB;AAEA,MAAMC,YAAY,GAAGJ,KAAK,CAACK,IAAN,CAAW,SAASD,YAAT,CAAsBE,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,EAAER,KAAK,CAACS,IAAtB;IAA4B,aAAU;EAAtC,gBACE;IAAK,SAAS,EAAET,KAAK,CAACU;EAAtB,gBACE;IAAK,SAAS,EAAEV,KAAK,CAACW;EAAtB,gBACE;IAAK,SAAS,EAAEX,KAAK,CAACY,IAAtB;IAA4B,IAAI,EAAC,KAAjC;IAAuC,cAAW;EAAlD,gBACE;IACE,SAAS,EAAEZ,KAAK,CAACa,KADnB;IAEE,GAAG,EAAC,+CAFN;IAGE,GAAG,EAAC;EAHN,EADF,CADF,eAQE;IAAK,SAAS,EAAEb,KAAK,CAACc;EAAtB,gBACE;IAAM,SAAS,EAAEd,KAAK,CAACI,KAAvB;IAA8B,aAAU,qBAAxC;IAA8D,cAAW;EAAzE,GACGA,KADH,CADF,eAIE;IACE,SAAS,EAAEJ,KAAK,CAACK,QADnB;IAEE,aAAU,wBAFZ;IAGE,cAAW;EAHb,GAKGA,QALH,CAJF,eAWE,oBAAC,UAAD,eAAgBE,WAAhB;IAA6B,SAAS,EAAEP,KAAK,CAACM;EAA9C,GAXF,CARF,eAqBE;IAAK,SAAS,EAAEN,KAAK,CAACe,KAAtB;IAA6B,IAAI,EAAC,KAAlC;IAAwC,cAAW;EAAnD,gBACE;IACE,SAAS,EAAEf,KAAK,CAACa,KADnB;IAEE,GAAG,EAAC,kDAFN;IAGE,GAAG,EAAC;EAHN,EADF,CArBF,CADF,CADF,CADF;AAmCD,CA3CoB,CAArB;AA6CAZ,YAAY,CAACe,SAAb,2CAAyB;EACvBZ,KAAK,EAAEN,SAAS,CAACmB,MADM;EAEvBZ,QAAQ,EAAEP,SAAS,CAACmB,MAFG;EAGvBX,GAAG,EAAER,SAAS,CAACoB,KAAV,CAAgB;IACnBC,OAAO,EAAErB,SAAS,CAACsB,IADA;IAEnBC,KAAK,EAAEvB,SAAS,CAACmB;EAFE,CAAhB;AAHkB,CAAzB;AASA,eAAehB,YAAf"}
|
|
@@ -4,7 +4,7 @@ import { NovaCompositionCoorpacademyBigFlashRight as FlashRight, NovaComposition
|
|
|
4
4
|
import Provider from '../../../atom/provider';
|
|
5
5
|
import Link from '../../../atom/link';
|
|
6
6
|
import style from './style.css';
|
|
7
|
-
const StartBattle =
|
|
7
|
+
const StartBattle = React.memo(function StartBattle(props) {
|
|
8
8
|
const {
|
|
9
9
|
startBattleText,
|
|
10
10
|
becomeAChampionText,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","NovaCompositionCoorpacademyBigFlashRight","FlashRight","NovaCompositionCoorpacademyBigFlashLeft","FlashLeft","Provider","Link","style","StartBattle","memo","props","startBattleText","becomeAChampionText","challengeText","onClick","href","root","container","wrapper","start","leftFlashes","bigFlashLeft","smallFlashLeft","middle","becomeText","smallFlashLeftMobile","smallFlashRightMobile","button","rightFlashes","bigFlashRight","smallFlashRight","contextTypes","skin","childContextTypes","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,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,SACEC,wCAAwC,IAAIC,UAD9C,EAEEC,uCAAuC,IAAIC,SAF7C,QAGO,0BAHP;AAIA,OAAOC,QAAP,MAAqB,wBAArB;AACA,OAAOC,IAAP,MAAiB,oBAAjB;AACA,OAAOC,KAAP,MAAkB,aAAlB;AAEA,MAAMC,WAAW,
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","NovaCompositionCoorpacademyBigFlashRight","FlashRight","NovaCompositionCoorpacademyBigFlashLeft","FlashLeft","Provider","Link","style","StartBattle","memo","props","startBattleText","becomeAChampionText","challengeText","onClick","href","root","container","wrapper","start","leftFlashes","bigFlashLeft","smallFlashLeft","middle","becomeText","smallFlashLeftMobile","smallFlashRightMobile","button","rightFlashes","bigFlashRight","smallFlashRight","contextTypes","skin","childContextTypes","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,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,SACEC,wCAAwC,IAAIC,UAD9C,EAEEC,uCAAuC,IAAIC,SAF7C,QAGO,0BAHP;AAIA,OAAOC,QAAP,MAAqB,wBAArB;AACA,OAAOC,IAAP,MAAiB,oBAAjB;AACA,OAAOC,KAAP,MAAkB,aAAlB;AAEA,MAAMC,WAAW,GAAGT,KAAK,CAACU,IAAN,CAAW,SAASD,WAAT,CAAqBE,KAArB,EAA4B;EACzD,MAAM;IAACC,eAAD;IAAkBC,mBAAlB;IAAuCC,aAAvC;IAAsDC,OAAtD;IAA+DC;EAA/D,IAAuEL,KAA7E;EAEA,oBACE;IAAK,SAAS,EAAEH,KAAK,CAACS,IAAtB;IAA4B,aAAU;EAAtC,gBACE;IAAK,SAAS,EAAET,KAAK,CAACU;EAAtB,gBACE;IAAK,SAAS,EAAEV,KAAK,CAACW;EAAtB,gBACE;IAAK,SAAS,EAAEX,KAAK,CAACY;EAAtB,gBACE;IAAK,SAAS,EAAEZ,KAAK,CAACa;EAAtB,gBACE,oBAAC,SAAD;IAAW,SAAS,EAAEb,KAAK,CAACc;EAA5B,EADF,eAEE,oBAAC,SAAD;IAAW,SAAS,EAAEd,KAAK,CAACe;EAA5B,EAFF,CADF,eAKE;IAAK,SAAS,EAAEf,KAAK,CAACgB;EAAtB,gBACE;IAAK,SAAS,EAAEhB,KAAK,CAACiB;EAAtB,gBACE,oBAAC,SAAD;IAAW,SAAS,EAAEjB,KAAK,CAACkB;EAA5B,EADF,EAEGb,mBAFH,eAGE,oBAAC,UAAD;IAAY,SAAS,EAAEL,KAAK,CAACmB;EAA7B,EAHF,CADF,eAME;IAAK,SAAS,EAAEnB,KAAK,CAACM;EAAtB,GAAsCA,aAAtC,CANF,eAOE,oBAAC,IAAD;IAAM,SAAS,EAAEN,KAAK,CAACoB,MAAvB;IAA+B,OAAO,EAAEb,OAAxC;IAAiD,IAAI,EAAEC;EAAvD,GACGJ,eADH,CAPF,CALF,eAgBE;IAAK,SAAS,EAAEJ,KAAK,CAACqB;EAAtB,gBACE,oBAAC,UAAD;IAAY,SAAS,EAAErB,KAAK,CAACsB;EAA7B,EADF,eAEE,oBAAC,UAAD;IAAY,SAAS,EAAEtB,KAAK,CAACuB;EAA7B,EAFF,CAhBF,CADF,CADF,CADF,CADF;AA6BD,CAhCmB,CAApB;AAkCAtB,WAAW,CAACuB,YAAZ,GAA2B;EACzBC,IAAI,EAAE3B,QAAQ,CAAC4B,iBAAT,CAA2BD;AADR,CAA3B;AAIAxB,WAAW,CAAC0B,SAAZ,2CAAwB;EACtBvB,eAAe,EAAEX,SAAS,CAACmC,MADL;EAEtBvB,mBAAmB,EAAEZ,SAAS,CAACmC,MAFT;EAGtBtB,aAAa,EAAEb,SAAS,CAACmC,MAHH;EAItBrB,OAAO,EAAEd,SAAS,CAACoC,IAJG;EAKtBrB,IAAI,EAAEf,SAAS,CAACmC;AALM,CAAxB;AAQA,eAAe3B,WAAf"}
|
|
@@ -38,7 +38,7 @@ const copyTextViaExecCommand = text => {
|
|
|
38
38
|
return status;
|
|
39
39
|
};
|
|
40
40
|
|
|
41
|
-
const StatusContext =
|
|
41
|
+
const StatusContext = React.createContext(SHARE_STATUS.IDLE);
|
|
42
42
|
export const ShareStatusProvider = ({
|
|
43
43
|
children
|
|
44
44
|
}) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useState","useMemo","useCallback","useContext","useEffect","PropTypes","classnames","NovaCompositionCoorpacademyCheck","CheckIcon","NovaCompositionCoorpacademyShare","ShareIcon","NovaCompositionCoorpacademyAttention","AttentionIcon","Link","styles","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","createContext","ShareStatusProvider","children","setStatus","timeoutId","DURATION","setTimeout","clearTimeout","ShareFeedback","successWording","errorWording","feedback","errorFeedback","checkIcon","Share","wording","onClick","browserSupportsClipboardWriteText","navigator","clipboard","writeText","copyStatus","container","cta","wrapper","shareIcon","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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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":["React","useState","useMemo","useCallback","useContext","useEffect","PropTypes","classnames","NovaCompositionCoorpacademyCheck","CheckIcon","NovaCompositionCoorpacademyShare","ShareIcon","NovaCompositionCoorpacademyAttention","AttentionIcon","Link","styles","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","createContext","ShareStatusProvider","children","setStatus","timeoutId","DURATION","setTimeout","clearTimeout","ShareFeedback","successWording","errorWording","feedback","errorFeedback","checkIcon","Share","wording","onClick","browserSupportsClipboardWriteText","navigator","clipboard","writeText","copyStatus","container","cta","wrapper","shareIcon","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,OAAOA,KAAP,IAAeC,QAAf,EAAyBC,OAAzB,EAAkCC,WAAlC,EAA+CC,UAA/C,EAA2DC,SAA3D,QAA2E,OAA3E;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,SACEC,gCAAgC,IAAIC,SADtC,EAEEC,gCAAgC,IAAIC,SAFtC,EAGEC,oCAAoC,IAAIC,aAH1C,QAIO,0BAJP;AAKA,OAAOC,IAAP,MAAiB,iBAAjB;AACA,OAAOC,MAAP,MAAmB,aAAnB;AAEA,MAAMC,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;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;QACdM,SAAS,CAAC7B,YAAY,CAACE,KAAd,CAAT;MACD;;MACD;IACD,CARD,MAQO;MACL,MAAM6C,UAAU,GAAG3C,sBAAsB,CAACC,IAAD,CAAzC;MACAwB,SAAS,CAACkB,UAAD,CAAT;IACD;;IACD;EACD,CAhB0B,EAgBxB,CAAClB,SAAD,EAAYxB,IAAZ,CAhBwB,CAA3B;EAkBA,oBACE;IAAK,SAAS,GAAGN,MAAM,CAACiD,SAAP,EAAkBvC,KAArB;EAAd,gBACE,oBAAC,IAAD;IAAM,OAAO,EAAEiC,OAAf;IAAwB,SAAS,EAAE3C,MAAM,CAACkD,GAA1C;IAA+C,aAAW;EAA1D,gBACE;IAAK,SAAS,EAAElD,MAAM,CAACmD;EAAvB,gBACE,oBAAC,SAAD;IAAW,SAAS,EAAEnD,MAAM,CAACoD,SAA7B;IAAwC,KAAK,EAAE,EAA/C;IAAmD,MAAM,EAAE;EAA3D,EADF,eAEE,+BAAIV,OAAJ,CAFF,CADF,CADF,CADF;AAUD,CA9BD;;AAgCAd,mBAAmB,CAACyB,SAApB,2CAAgC;EAC9BxB,QAAQ,EAAEtC,SAAS,CAAC+D;AADU,CAAhC;AAIAnB,aAAa,CAACkB,SAAd,2CAA0B;EACxBjB,cAAc,EAAE7C,SAAS,CAACgE,MADF;EAExBlB,YAAY,EAAE9C,SAAS,CAACgE;AAFA,CAA1B;AAKAd,KAAK,CAACY,SAAN,2CAAkB;EAChB3C,KAAK,EAAEnB,SAAS,CAACgE,MADD;EAEhBjD,IAAI,EAAEf,SAAS,CAACgE,MAFA;EAGhBb,OAAO,EAAEnD,SAAS,CAACgE;AAHH,CAAlB;AAMA,eAAed,KAAf"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
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); }
|
|
2
|
+
|
|
1
3
|
import React from 'react';
|
|
2
4
|
import classnames from 'classnames';
|
|
3
5
|
import _toString from 'lodash/fp/toString';
|
|
@@ -45,13 +47,14 @@ const StackedSlides = ({
|
|
|
45
47
|
key: `slide-${slideIndex}`,
|
|
46
48
|
"data-name": `slide-${slideIndex}`,
|
|
47
49
|
className: classnames(style.slideBase, getSlideAnimation(animationType, position), endReview ? style.endReview : null)
|
|
48
|
-
}, /*#__PURE__*/React.createElement(ReviewSlide, {
|
|
50
|
+
}, /*#__PURE__*/React.createElement(ReviewSlide, _extends({
|
|
49
51
|
slideIndex: _toString(slideIndex),
|
|
50
52
|
slide,
|
|
51
53
|
validateButton,
|
|
52
|
-
correctionPopinProps
|
|
54
|
+
correctionPopinProps
|
|
55
|
+
}, {
|
|
53
56
|
key: slideIndex
|
|
54
|
-
}));
|
|
57
|
+
})));
|
|
55
58
|
stackedSlides.push(slideView);
|
|
56
59
|
}
|
|
57
60
|
|