@coorpacademy/components 10.30.4-alpha.2 → 10.30.7

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.
Files changed (73) hide show
  1. package/es/atom/choice/index.native.js +2 -4
  2. package/es/atom/choice/index.native.js.map +1 -1
  3. package/es/atom/html/index.native.js +1 -3
  4. package/es/atom/html/index.native.js.map +1 -1
  5. package/es/atom/review-presentation/index.native.js +56 -60
  6. package/es/atom/review-presentation/index.native.js.map +1 -1
  7. package/es/hoc/modal/select/index.native.js +3 -3
  8. package/es/hoc/modal/select/index.native.js.map +1 -1
  9. package/es/hoc/modal/select-item/index.native.js +13 -17
  10. package/es/hoc/modal/select-item/index.native.js.map +1 -1
  11. package/es/hoc/touchable/index.native.js +2 -2
  12. package/es/hoc/touchable/index.native.js.map +1 -1
  13. package/es/molecule/dashboard/cards-list/index.js +3 -7
  14. package/es/molecule/dashboard/cards-list/index.js.map +1 -1
  15. package/es/molecule/questions/free-text/index.native.js +26 -30
  16. package/es/molecule/questions/free-text/index.native.js.map +1 -1
  17. package/es/molecule/questions/mobile/slider/index.native.js +3 -5
  18. package/es/molecule/questions/mobile/slider/index.native.js.map +1 -1
  19. package/es/molecule/questions/mobile/template/index.native.js +1 -3
  20. package/es/molecule/questions/mobile/template/index.native.js.map +1 -1
  21. package/es/organism/review-congrats/index.js +1 -3
  22. package/es/organism/review-congrats/index.js.map +1 -1
  23. package/es/organism/review-slide/index.d.ts.map +1 -1
  24. package/es/organism/review-slide/index.js +6 -2
  25. package/es/organism/review-slide/index.js.map +1 -1
  26. package/es/organism/review-slide/index.native.d.ts.map +1 -1
  27. package/es/organism/review-slide/index.native.js +116 -79
  28. package/es/organism/review-slide/index.native.js.map +1 -1
  29. package/es/organism/review-slide/prop-types.d.ts +11 -0
  30. package/es/organism/review-slide/prop-types.d.ts.map +1 -1
  31. package/es/organism/review-slide/prop-types.js.map +1 -1
  32. package/es/template/app-player/popin-correction/style.css +1 -0
  33. package/es/template/common/dashboard/index.d.ts +0 -1
  34. package/es/template/common/dashboard/index.d.ts.map +1 -1
  35. package/es/template/common/dashboard/index.js +3 -26
  36. package/es/template/common/dashboard/index.js.map +1 -1
  37. package/lib/atom/choice/index.native.js +2 -4
  38. package/lib/atom/choice/index.native.js.map +1 -1
  39. package/lib/atom/html/index.native.js +1 -3
  40. package/lib/atom/html/index.native.js.map +1 -1
  41. package/lib/atom/review-presentation/index.native.js +56 -60
  42. package/lib/atom/review-presentation/index.native.js.map +1 -1
  43. package/lib/hoc/modal/select/index.native.js +3 -3
  44. package/lib/hoc/modal/select/index.native.js.map +1 -1
  45. package/lib/hoc/modal/select-item/index.native.js +13 -17
  46. package/lib/hoc/modal/select-item/index.native.js.map +1 -1
  47. package/lib/hoc/touchable/index.native.js +2 -2
  48. package/lib/hoc/touchable/index.native.js.map +1 -1
  49. package/lib/molecule/dashboard/cards-list/index.js +3 -7
  50. package/lib/molecule/dashboard/cards-list/index.js.map +1 -1
  51. package/lib/molecule/questions/free-text/index.native.js +26 -30
  52. package/lib/molecule/questions/free-text/index.native.js.map +1 -1
  53. package/lib/molecule/questions/mobile/slider/index.native.js +3 -5
  54. package/lib/molecule/questions/mobile/slider/index.native.js.map +1 -1
  55. package/lib/molecule/questions/mobile/template/index.native.js +1 -3
  56. package/lib/molecule/questions/mobile/template/index.native.js.map +1 -1
  57. package/lib/organism/review-congrats/index.js +1 -3
  58. package/lib/organism/review-congrats/index.js.map +1 -1
  59. package/lib/organism/review-slide/index.d.ts.map +1 -1
  60. package/lib/organism/review-slide/index.js +6 -2
  61. package/lib/organism/review-slide/index.js.map +1 -1
  62. package/lib/organism/review-slide/index.native.d.ts.map +1 -1
  63. package/lib/organism/review-slide/index.native.js +115 -78
  64. package/lib/organism/review-slide/index.native.js.map +1 -1
  65. package/lib/organism/review-slide/prop-types.d.ts +11 -0
  66. package/lib/organism/review-slide/prop-types.d.ts.map +1 -1
  67. package/lib/organism/review-slide/prop-types.js.map +1 -1
  68. package/lib/template/app-player/popin-correction/style.css +1 -0
  69. package/lib/template/common/dashboard/index.d.ts +0 -1
  70. package/lib/template/common/dashboard/index.d.ts.map +1 -1
  71. package/lib/template/common/dashboard/index.js +3 -30
  72. package/lib/template/common/dashboard/index.js.map +1 -1
  73. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"prop-types.js","names":["SlidePropsTypes","PropTypes","shape","position","number","loading","bool","loadingAriaLabel","string","animationType","isCorrect","animateCorrectionPopin","showCorrectionPopin","disableContent","parentContentTitle","questionText","answerUI","AnswerPropTypes","propTypes","slideIndex","slide","validateButton","label","isRequired","onClick","func","disabled","correctionPopinProps","klf","ReviewCorrectionPopinPropTypes","information","next","resultLabel","type"],"sources":["../../../src/organism/review-slide/prop-types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\nimport ReviewCorrectionPopinPropTypes, {\n ReviewCorrectionPopinProps\n} from '../../molecule/review-correction-popin/prop-types';\nimport AnswerPropTypes, {AnswerProps} from '../../molecule/answer/prop-types';\n\nexport const SlidePropsTypes = PropTypes.shape({\n position: PropTypes.number,\n loading: PropTypes.bool,\n loadingAriaLabel: PropTypes.string,\n animationType: PropTypes.string, // 'unstack' | 'restack'\n isCorrect: PropTypes.bool,\n animateCorrectionPopin: PropTypes.bool,\n showCorrectionPopin: PropTypes.bool,\n disableContent: PropTypes.bool,\n parentContentTitle: PropTypes.string,\n questionText: PropTypes.string,\n answerUI: PropTypes.shape(AnswerPropTypes)\n});\n\nconst propTypes = {\n slideIndex: PropTypes.string,\n slide: SlidePropsTypes,\n validateButton: PropTypes.shape({\n label: PropTypes.string.isRequired,\n onClick: PropTypes.func.isRequired,\n disabled: PropTypes.bool\n }),\n correctionPopinProps: PropTypes.shape({\n klf: ReviewCorrectionPopinPropTypes.klf,\n information: ReviewCorrectionPopinPropTypes.information,\n next: PropTypes.shape({\n label: PropTypes.string,\n 'aria-label': PropTypes.string // Pourquoi le onClick du next n'est pas ici !\n // updateSlidesOnNext: PropTypes.func.isRequired ???\n }),\n resultLabel: ReviewCorrectionPopinPropTypes.resultLabel,\n type: ReviewCorrectionPopinPropTypes.type\n })\n};\n\nexport default propTypes;\n\nexport type SlideProps = {\n position: number;\n loading: boolean;\n loadingAriaLabel?: string;\n animationType?: 'unstack' | 'restack';\n isCorrect?: boolean;\n animateCorrectionPopin?: boolean;\n showCorrectionPopin?: boolean;\n parentContentTitle?: string;\n questionText?: string;\n answerUI?: AnswerProps;\n};\n\nexport type ReviewSlideProps = {\n slideIndex: string;\n num: number;\n slide: SlideProps;\n correctionPopinProps?: ReviewCorrectionPopinProps;\n validateButton: {\n label: string;\n onClick: () => void;\n disabled: boolean;\n };\n};\n"],"mappings":";;;;;AAAA;;AACA;;AAGA;;;;AAEO,MAAMA,eAAe,GAAGC,kBAAA,CAAUC,KAAV,CAAgB;EAC7CC,QAAQ,EAAEF,kBAAA,CAAUG,MADyB;EAE7CC,OAAO,EAAEJ,kBAAA,CAAUK,IAF0B;EAG7CC,gBAAgB,EAAEN,kBAAA,CAAUO,MAHiB;EAI7CC,aAAa,EAAER,kBAAA,CAAUO,MAJoB;EAIZ;EACjCE,SAAS,EAAET,kBAAA,CAAUK,IALwB;EAM7CK,sBAAsB,EAAEV,kBAAA,CAAUK,IANW;EAO7CM,mBAAmB,EAAEX,kBAAA,CAAUK,IAPc;EAQ7CO,cAAc,EAAEZ,kBAAA,CAAUK,IARmB;EAS7CQ,kBAAkB,EAAEb,kBAAA,CAAUO,MATe;EAU7CO,YAAY,EAAEd,kBAAA,CAAUO,MAVqB;EAW7CQ,QAAQ,EAAEf,kBAAA,CAAUC,KAAV,CAAgBe,mBAAhB;AAXmC,CAAhB,CAAxB;;;AAcP,MAAMC,SAAS,GAAG;EAChBC,UAAU,EAAElB,kBAAA,CAAUO,MADN;EAEhBY,KAAK,EAAEpB,eAFS;EAGhBqB,cAAc,EAAEpB,kBAAA,CAAUC,KAAV,CAAgB;IAC9BoB,KAAK,EAAErB,kBAAA,CAAUO,MAAV,CAAiBe,UADM;IAE9BC,OAAO,EAAEvB,kBAAA,CAAUwB,IAAV,CAAeF,UAFM;IAG9BG,QAAQ,EAAEzB,kBAAA,CAAUK;EAHU,CAAhB,CAHA;EAQhBqB,oBAAoB,EAAE1B,kBAAA,CAAUC,KAAV,CAAgB;IACpC0B,GAAG,EAAEC,mBAAA,CAA+BD,GADA;IAEpCE,WAAW,EAAED,mBAAA,CAA+BC,WAFR;IAGpCC,IAAI,EAAE9B,kBAAA,CAAUC,KAAV,CAAgB;MACpBoB,KAAK,EAAErB,kBAAA,CAAUO,MADG;MAEpB,cAAcP,kBAAA,CAAUO,MAFJ,CAEW;MAC/B;;IAHoB,CAAhB,CAH8B;IAQpCwB,WAAW,EAAEH,mBAAA,CAA+BG,WARR;IASpCC,IAAI,EAAEJ,mBAAA,CAA+BI;EATD,CAAhB;AARN,CAAlB;eAqBef,S"}
1
+ {"version":3,"file":"prop-types.js","names":["SlidePropsTypes","PropTypes","shape","position","number","loading","bool","loadingAriaLabel","string","animationType","isCorrect","animateCorrectionPopin","showCorrectionPopin","disableContent","parentContentTitle","questionText","answerUI","AnswerPropTypes","propTypes","slideIndex","slide","validateButton","label","isRequired","onClick","func","disabled","correctionPopinProps","klf","ReviewCorrectionPopinPropTypes","information","next","resultLabel","type"],"sources":["../../../src/organism/review-slide/prop-types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\nimport ReviewCorrectionPopinPropTypes, {\n ReviewCorrectionPopinProps\n} from '../../molecule/review-correction-popin/prop-types';\nimport AnswerPropTypes, {AnswerProps} from '../../molecule/answer/prop-types';\n\nexport const SlidePropsTypes = PropTypes.shape({\n position: PropTypes.number,\n loading: PropTypes.bool,\n loadingAriaLabel: PropTypes.string,\n animationType: PropTypes.string, // 'unstack' | 'restack'\n isCorrect: PropTypes.bool,\n animateCorrectionPopin: PropTypes.bool,\n showCorrectionPopin: PropTypes.bool,\n disableContent: PropTypes.bool,\n parentContentTitle: PropTypes.string,\n questionText: PropTypes.string,\n answerUI: PropTypes.shape(AnswerPropTypes)\n});\n\nconst propTypes = {\n slideIndex: PropTypes.string,\n slide: SlidePropsTypes,\n validateButton: PropTypes.shape({\n label: PropTypes.string.isRequired,\n onClick: PropTypes.func.isRequired,\n disabled: PropTypes.bool\n }),\n correctionPopinProps: PropTypes.shape({\n klf: ReviewCorrectionPopinPropTypes.klf,\n information: ReviewCorrectionPopinPropTypes.information,\n next: PropTypes.shape({\n label: PropTypes.string,\n 'aria-label': PropTypes.string // Pourquoi le onClick du next n'est pas ici !\n // updateSlidesOnNext: PropTypes.func.isRequired ???\n }),\n resultLabel: ReviewCorrectionPopinPropTypes.resultLabel,\n type: ReviewCorrectionPopinPropTypes.type\n })\n};\n\nexport default propTypes;\n\nexport type PopinProps = {\n correctionPopinProps: ReviewCorrectionPopinProps;\n slideIndex: string;\n showCorrectionPopin?: boolean;\n animateCorrectionPopin?: boolean;\n};\n\nexport type ValidateButtonProps = {\n slideIndex: string;\n validateButton: ReviewSlideProps['validateButton'];\n primarySkinColor?: string;\n};\n\nexport type SlideProps = {\n position: number;\n loading: boolean;\n loadingAriaLabel?: string;\n animationType?: 'unstack' | 'restack';\n isCorrect?: boolean;\n animateCorrectionPopin?: boolean;\n showCorrectionPopin?: boolean;\n parentContentTitle?: string;\n questionText?: string;\n answerUI?: AnswerProps;\n};\n\nexport type ReviewSlideProps = {\n slideIndex: string;\n num: number;\n slide: SlideProps;\n correctionPopinProps?: ReviewCorrectionPopinProps;\n validateButton: {\n label: string;\n onClick: () => void;\n disabled: boolean;\n };\n};\n"],"mappings":";;;;;AAAA;;AACA;;AAGA;;;;AAEO,MAAMA,eAAe,GAAGC,kBAAA,CAAUC,KAAV,CAAgB;EAC7CC,QAAQ,EAAEF,kBAAA,CAAUG,MADyB;EAE7CC,OAAO,EAAEJ,kBAAA,CAAUK,IAF0B;EAG7CC,gBAAgB,EAAEN,kBAAA,CAAUO,MAHiB;EAI7CC,aAAa,EAAER,kBAAA,CAAUO,MAJoB;EAIZ;EACjCE,SAAS,EAAET,kBAAA,CAAUK,IALwB;EAM7CK,sBAAsB,EAAEV,kBAAA,CAAUK,IANW;EAO7CM,mBAAmB,EAAEX,kBAAA,CAAUK,IAPc;EAQ7CO,cAAc,EAAEZ,kBAAA,CAAUK,IARmB;EAS7CQ,kBAAkB,EAAEb,kBAAA,CAAUO,MATe;EAU7CO,YAAY,EAAEd,kBAAA,CAAUO,MAVqB;EAW7CQ,QAAQ,EAAEf,kBAAA,CAAUC,KAAV,CAAgBe,mBAAhB;AAXmC,CAAhB,CAAxB;;;AAcP,MAAMC,SAAS,GAAG;EAChBC,UAAU,EAAElB,kBAAA,CAAUO,MADN;EAEhBY,KAAK,EAAEpB,eAFS;EAGhBqB,cAAc,EAAEpB,kBAAA,CAAUC,KAAV,CAAgB;IAC9BoB,KAAK,EAAErB,kBAAA,CAAUO,MAAV,CAAiBe,UADM;IAE9BC,OAAO,EAAEvB,kBAAA,CAAUwB,IAAV,CAAeF,UAFM;IAG9BG,QAAQ,EAAEzB,kBAAA,CAAUK;EAHU,CAAhB,CAHA;EAQhBqB,oBAAoB,EAAE1B,kBAAA,CAAUC,KAAV,CAAgB;IACpC0B,GAAG,EAAEC,mBAAA,CAA+BD,GADA;IAEpCE,WAAW,EAAED,mBAAA,CAA+BC,WAFR;IAGpCC,IAAI,EAAE9B,kBAAA,CAAUC,KAAV,CAAgB;MACpBoB,KAAK,EAAErB,kBAAA,CAAUO,MADG;MAEpB,cAAcP,kBAAA,CAAUO,MAFJ,CAEW;MAC/B;;IAHoB,CAAhB,CAH8B;IAQpCwB,WAAW,EAAEH,mBAAA,CAA+BG,WARR;IASpCC,IAAI,EAAEJ,mBAAA,CAA+BI;EATD,CAAhB;AARN,CAAlB;eAqBef,S"}
@@ -136,6 +136,7 @@
136
136
  composes: text;
137
137
  margin-right: 5px;
138
138
  min-width: 120px;
139
+ flex-shrink: 0;
139
140
  }
140
141
 
141
142
  .answer {
@@ -4,7 +4,6 @@ declare namespace Dashboard {
4
4
  namespace propTypes {
5
5
  const hero: any;
6
6
  const welcome: any;
7
- const onLoadMoreSections: PropTypes.Requireable<(...args: any[]) => any>;
8
7
  const sections: PropTypes.Requireable<((PropTypes.InferPropsInner<Pick<any, any>> & Partial<PropTypes.InferPropsInner<Pick<any, never>>>) | null | undefined)[]>;
9
8
  const cookie: PropTypes.Requireable<PropTypes.InferProps<{
10
9
  content: PropTypes.Requireable<string>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/template/common/dashboard/index.js"],"names":[],"mappings":";AAqBA,oDA6DC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/template/common/dashboard/index.js"],"names":[],"mappings":";AAoBA,oDAoCC"}
@@ -3,7 +3,7 @@
3
3
  exports.__esModule = true;
4
4
  exports.default = void 0;
5
5
 
6
- var _react = _interopRequireWildcard(require("react"));
6
+ var _react = _interopRequireDefault(require("react"));
7
7
 
8
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
9
9
 
@@ -25,11 +25,6 @@ var _style = _interopRequireDefault(require("./style.css"));
25
25
 
26
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
27
27
 
28
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
29
-
30
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
31
-
32
- /* eslint-disable no-console */
33
28
  const Hero = /*#__PURE__*/_react.default.memo(function Hero({
34
29
  hero,
35
30
  welcome
@@ -49,8 +44,7 @@ const Dashboard = props => {
49
44
  sections = [],
50
45
  hero,
51
46
  welcome,
52
- cookie,
53
- onLoadMoreSections
47
+ cookie
54
48
  } = props;
55
49
 
56
50
  const buildSectionComponent = section => {
@@ -94,29 +88,9 @@ const Dashboard = props => {
94
88
  key: 'hero'
95
89
  }, ...sections].map(section => /*#__PURE__*/_react.default.createElement("div", {
96
90
  key: section.key
97
- }, buildSection(section))); // window.addEventListener('scroll', handleScroll, true);
98
-
99
- const ref = (0, _react.useRef)(); // The scroll listener
100
-
101
- const handleScroll = (0, _react.useCallback)(() => {
102
- console.log('scrolling');
103
-
104
- if (window.innerHeight + document.documentElement.scrollTop + 1 >= document.scrollingElement.scrollHeight) {
105
- onLoadMoreSections ? onLoadMoreSections() : null;
106
- }
107
-
108
- return;
109
- }, [onLoadMoreSections]); // Attach the scroll listener to the div
110
-
111
- (0, _react.useEffect)(() => {
112
- const div = ref.current;
113
- console.log('Div is', div); // Attach a scroll listener to the div
114
-
115
- div.addEventListener('scroll', handleScroll);
116
- }, [handleScroll]);
91
+ }, buildSection(section)));
117
92
  return /*#__PURE__*/_react.default.createElement("div", {
118
93
  className: _style.default.wrapper,
119
- ref: ref,
120
94
  "data-name": "dashboard"
121
95
  }, sectionsList, cookie ? /*#__PURE__*/_react.default.createElement(_cmPopin.default, cookie) : null);
122
96
  };
@@ -124,7 +98,6 @@ const Dashboard = props => {
124
98
  Dashboard.propTypes = process.env.NODE_ENV !== "production" ? {
125
99
  hero: Hero.propTypes.hero,
126
100
  welcome: Hero.propTypes.welcome,
127
- onLoadMoreSections: _propTypes.default.func,
128
101
  sections: _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.shape(_battleRequestList.default.propTypes), _propTypes.default.shape(_cardsList.default.propTypes), _propTypes.default.shape(_newsList.default.propTypes), _propTypes.default.shape(_startBattle.default.propTypes)])),
129
102
  cookie: _propTypes.default.shape(_cmPopin.default.propTypes)
130
103
  } : {};
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["Hero","React","memo","hero","welcome","style","propTypes","PropTypes","shape","HeroCard","Slide","Dashboard","props","sections","cookie","onLoadMoreSections","buildSectionComponent","section","type","buildSection","index","sectionView","sectionsList","key","map","ref","useRef","handleScroll","useCallback","console","log","window","innerHeight","document","documentElement","scrollTop","scrollingElement","scrollHeight","useEffect","div","current","addEventListener","wrapper","func","arrayOf","oneOfType","BattleRequestList","CardsList","NewsList","StartBattle","CMPopin"],"sources":["../../../../src/template/common/dashboard/index.js"],"sourcesContent":["/* eslint-disable no-console */\nimport React, {useRef, useCallback, useEffect} from 'react';\nimport PropTypes from 'prop-types';\nimport Slide from '../../../atom/slide';\nimport HeroCard from '../../../molecule/hero';\nimport BattleRequestList from '../../../molecule/dashboard/battle-request-list';\nimport CardsList from '../../../molecule/dashboard/cards-list';\nimport NewsList from '../../../molecule/dashboard/news-list';\nimport StartBattle from '../../../molecule/dashboard/start-battle';\nimport CMPopin from '../../../molecule/cm-popin';\nimport style from './style.css';\n\nconst Hero = React.memo(function Hero({hero, welcome}) {\n return <div className={style.hero}>{hero ? <HeroCard {...hero} /> : <Slide {...welcome} />}</div>;\n});\n\nHero.propTypes = {\n hero: PropTypes.shape(HeroCard.propTypes),\n welcome: PropTypes.shape(Slide.propTypes)\n};\n\nconst Dashboard = props => {\n const {sections = [], hero, welcome, cookie, onLoadMoreSections} = props;\n\n const buildSectionComponent = section => {\n const {type} = section;\n switch (type) {\n case 'hero':\n return <Hero hero={hero} welcome={welcome} />;\n case 'battleRequests':\n return <BattleRequestList {...section} />;\n case 'cards':\n return <CardsList {...section} />;\n case 'news':\n return <NewsList {...section} />;\n case 'battle':\n return <StartBattle {...section} />;\n default:\n return null;\n }\n };\n\n const buildSection = (section, index) => {\n const sectionView = buildSectionComponent(section);\n\n return <div key={index}>{sectionView}</div>;\n };\n\n const sectionsList = [{type: 'hero', key: 'hero'}, ...sections].map(section => (\n <div key={section.key}>{buildSection(section)}</div>\n ));\n\n // window.addEventListener('scroll', handleScroll, true);\n\n const ref = useRef();\n // The scroll listener\n const handleScroll = useCallback(() => {\n console.log('scrolling');\n if (\n window.innerHeight + document.documentElement.scrollTop + 1 >=\n document.scrollingElement.scrollHeight\n ) {\n onLoadMoreSections ? onLoadMoreSections() : null;\n }\n\n return;\n }, [onLoadMoreSections]);\n\n // Attach the scroll listener to the div\n useEffect(() => {\n const div = ref.current;\n console.log('Div is', div);\n // Attach a scroll listener to the div\n div.addEventListener('scroll', handleScroll);\n }, [handleScroll]);\n\n return (\n <div className={style.wrapper} ref={ref} data-name=\"dashboard\">\n {sectionsList}\n {cookie ? <CMPopin {...cookie} /> : null}\n </div>\n );\n};\n\nDashboard.propTypes = {\n hero: Hero.propTypes.hero,\n welcome: Hero.propTypes.welcome,\n onLoadMoreSections: PropTypes.func,\n sections: PropTypes.arrayOf(\n PropTypes.oneOfType([\n PropTypes.shape(BattleRequestList.propTypes),\n PropTypes.shape(CardsList.propTypes),\n PropTypes.shape(NewsList.propTypes),\n PropTypes.shape(StartBattle.propTypes)\n ])\n ),\n cookie: PropTypes.shape(CMPopin.propTypes)\n};\nexport default Dashboard;\n"],"mappings":";;;;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAVA;AAYA,MAAMA,IAAI,gBAAGC,cAAA,CAAMC,IAAN,CAAW,SAASF,IAAT,CAAc;EAACG,IAAD;EAAOC;AAAP,CAAd,EAA+B;EACrD,oBAAO;IAAK,SAAS,EAAEC,cAAA,CAAMF;EAAtB,GAA6BA,IAAI,gBAAG,6BAAC,aAAD,EAAcA,IAAd,CAAH,gBAA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CAClBtC,kBAAA,CAAUC,KAAV,CAAgBsC,0BAAA,CAAkBxC,SAAlC,CADkB,EAElBC,kBAAA,CAAUC,KAAV,CAAgBuC,kBAAA,CAAUzC,SAA1B,CAFkB,EAGlBC,kBAAA,CAAUC,KAAV,CAAgBwC,iBAAA,CAAS1C,SAAzB,CAHkB,EAIlBC,kBAAA,CAAUC,KAAV,CAAgByC,oBAAA,CAAY3C,SAA5B,CAJkB,CAApB,CADQ,CAJU;EAYpBQ,MAAM,EAAEP,kBAAA,CAAUC,KAAV,CAAgB0C,gBAAA,CAAQ5C,SAAxB;AAZY,CAAtB;eAceK,S"}
1
+ {"version":3,"file":"index.js","names":["Hero","React","memo","hero","welcome","style","propTypes","PropTypes","shape","HeroCard","Slide","Dashboard","props","sections","cookie","buildSectionComponent","section","type","buildSection","index","sectionView","sectionsList","key","map","wrapper","arrayOf","oneOfType","BattleRequestList","CardsList","NewsList","StartBattle","CMPopin"],"sources":["../../../../src/template/common/dashboard/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Slide from '../../../atom/slide';\nimport HeroCard from '../../../molecule/hero';\nimport BattleRequestList from '../../../molecule/dashboard/battle-request-list';\nimport CardsList from '../../../molecule/dashboard/cards-list';\nimport NewsList from '../../../molecule/dashboard/news-list';\nimport StartBattle from '../../../molecule/dashboard/start-battle';\nimport CMPopin from '../../../molecule/cm-popin';\nimport style from './style.css';\n\nconst Hero = React.memo(function Hero({hero, welcome}) {\n return <div className={style.hero}>{hero ? <HeroCard {...hero} /> : <Slide {...welcome} />}</div>;\n});\n\nHero.propTypes = {\n hero: PropTypes.shape(HeroCard.propTypes),\n welcome: PropTypes.shape(Slide.propTypes)\n};\n\nconst Dashboard = props => {\n const {sections = [], hero, welcome, cookie} = props;\n\n const buildSectionComponent = section => {\n const {type} = section;\n switch (type) {\n case 'hero':\n return <Hero hero={hero} welcome={welcome} />;\n case 'battleRequests':\n return <BattleRequestList {...section} />;\n case 'cards':\n return <CardsList {...section} />;\n case 'news':\n return <NewsList {...section} />;\n case 'battle':\n return <StartBattle {...section} />;\n default:\n return null;\n }\n };\n\n const buildSection = (section, index) => {\n const sectionView = buildSectionComponent(section);\n\n return <div key={index}>{sectionView}</div>;\n };\n\n const sectionsList = [{type: 'hero', key: 'hero'}, ...sections].map(section => (\n <div key={section.key}>{buildSection(section)}</div>\n ));\n return (\n <div className={style.wrapper} data-name=\"dashboard\">\n {sectionsList}\n {cookie ? <CMPopin {...cookie} /> : null}\n </div>\n );\n};\n\nDashboard.propTypes = {\n hero: Hero.propTypes.hero,\n welcome: Hero.propTypes.welcome,\n sections: PropTypes.arrayOf(\n PropTypes.oneOfType([\n PropTypes.shape(BattleRequestList.propTypes),\n PropTypes.shape(CardsList.propTypes),\n PropTypes.shape(NewsList.propTypes),\n PropTypes.shape(StartBattle.propTypes)\n ])\n ),\n cookie: PropTypes.shape(CMPopin.propTypes)\n};\nexport default Dashboard;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,IAAI,gBAAGC,cAAA,CAAMC,IAAN,CAAW,SAASF,IAAT,CAAc;EAACG,IAAD;EAAOC;AAAP,CAAd,EAA+B;EACrD,oBAAO;IAAK,SAAS,EAAEC,cAAA,CAAMF;EAAtB,GAA6BA,IAAI,gBAAG,6BAAC,aAAD,EAAcA,IAAd,CAAH,gBAA4B,6BAAC,cAAD,EAAWC,OAAX,CAA7D,CAAP;AACD,CAFY,CAAb;;AAIAJ,IAAI,CAACM,SAAL,2CAAiB;EACfH,IAAI,EAAEI,kBAAA,CAAUC,KAAV,CAAgBC,aAAA,CAASH,SAAzB,CADS;EAEfF,OAAO,EAAEG,kBAAA,CAAUC,KAAV,CAAgBE,cAAA,CAAMJ,SAAtB;AAFM,CAAjB;;AAKA,MAAMK,SAAS,GAAGC,KAAK,IAAI;EACzB,MAAM;IAACC,QAAQ,GAAG,EAAZ;IAAgBV,IAAhB;IA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AO,EAAEJ,IAAI,CAACM,SAAL,CAAeF,OAFJ;EAGpBS,QAAQ,EAAEN,kBAAA,CAAUkB,OAAV,CACRlB,kBAAA,CAAUmB,SAAV,CAAoB,CAClBnB,kBAAA,CAAUC,KAAV,CAAgBmB,0BAAA,CAAkBrB,SAAlC,CADkB,EAElBC,kBAAA,CAAUC,KAAV,CAAgBoB,kBAAA,CAAUtB,SAA1B,CAFkB,EAGlBC,kBAAA,CAAUC,KAAV,CAAgBqB,iBAAA,CAASvB,SAAzB,CAHkB,EAIlBC,kBAAA,CAAUC,KAAV,CAAgBsB,oBAAA,CAAYxB,SAA5B,CAJkB,CAApB,CADQ,CAHU;EAWpBQ,MAAM,EAAEP,kBAAA,CAAUC,KAAV,CAAgBuB,gBAAA,CAAQzB,SAAxB;AAXY,CAAtB;eAaeK,S"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coorpacademy/components",
3
- "version": "10.30.4-alpha.2+db64d42d7",
3
+ "version": "10.30.7",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -157,5 +157,5 @@
157
157
  "last 2 versions",
158
158
  "IE 11"
159
159
  ],
160
- "gitHead": "db64d42d73f7c97897c0906f5cbf6395113d4d10"
160
+ "gitHead": "295c63f6ee07fe83aff6286d2c3cff6a35414779"
161
161
  }