@coorpacademy/components 10.30.4-alpha.1 → 10.30.4-alpha.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/choice/index.native.js +4 -2
- package/es/atom/choice/index.native.js.map +1 -1
- package/es/atom/html/index.native.js +3 -1
- package/es/atom/html/index.native.js.map +1 -1
- package/es/atom/review-presentation/index.native.js +60 -56
- package/es/atom/review-presentation/index.native.js.map +1 -1
- package/es/hoc/modal/select/index.native.js +3 -3
- package/es/hoc/modal/select/index.native.js.map +1 -1
- package/es/hoc/modal/select-item/index.native.js +17 -13
- package/es/hoc/modal/select-item/index.native.js.map +1 -1
- package/es/hoc/touchable/index.native.js +2 -2
- package/es/hoc/touchable/index.native.js.map +1 -1
- package/es/molecule/dashboard/cards-list/index.js +7 -3
- package/es/molecule/dashboard/cards-list/index.js.map +1 -1
- package/es/molecule/questions/free-text/index.native.js +30 -26
- package/es/molecule/questions/free-text/index.native.js.map +1 -1
- package/es/molecule/questions/mobile/slider/index.native.js +5 -3
- package/es/molecule/questions/mobile/slider/index.native.js.map +1 -1
- package/es/molecule/questions/mobile/template/index.native.js +3 -1
- package/es/molecule/questions/mobile/template/index.native.js.map +1 -1
- package/es/organism/review-congrats/index.js +3 -1
- package/es/organism/review-congrats/index.js.map +1 -1
- package/es/organism/review-slide/index.native.js +51 -47
- package/es/organism/review-slide/index.native.js.map +1 -1
- package/es/template/common/dashboard/index.d.ts.map +1 -1
- package/es/template/common/dashboard/index.js +16 -5
- package/es/template/common/dashboard/index.js.map +1 -1
- package/lib/atom/choice/index.native.js +4 -2
- package/lib/atom/choice/index.native.js.map +1 -1
- package/lib/atom/html/index.native.js +3 -1
- package/lib/atom/html/index.native.js.map +1 -1
- package/lib/atom/review-presentation/index.native.js +60 -56
- package/lib/atom/review-presentation/index.native.js.map +1 -1
- package/lib/hoc/modal/select/index.native.js +3 -3
- package/lib/hoc/modal/select/index.native.js.map +1 -1
- package/lib/hoc/modal/select-item/index.native.js +17 -13
- package/lib/hoc/modal/select-item/index.native.js.map +1 -1
- package/lib/hoc/touchable/index.native.js +2 -2
- package/lib/hoc/touchable/index.native.js.map +1 -1
- package/lib/molecule/dashboard/cards-list/index.js +7 -3
- package/lib/molecule/dashboard/cards-list/index.js.map +1 -1
- package/lib/molecule/questions/free-text/index.native.js +30 -26
- package/lib/molecule/questions/free-text/index.native.js.map +1 -1
- package/lib/molecule/questions/mobile/slider/index.native.js +5 -3
- package/lib/molecule/questions/mobile/slider/index.native.js.map +1 -1
- package/lib/molecule/questions/mobile/template/index.native.js +3 -1
- package/lib/molecule/questions/mobile/template/index.native.js.map +1 -1
- package/lib/organism/review-congrats/index.js +3 -1
- package/lib/organism/review-congrats/index.js.map +1 -1
- package/lib/organism/review-slide/index.native.js +51 -47
- package/lib/organism/review-slide/index.native.js.map +1 -1
- package/lib/template/common/dashboard/index.d.ts.map +1 -1
- package/lib/template/common/dashboard/index.js +20 -5
- package/lib/template/common/dashboard/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.default = void 0;
|
|
5
5
|
|
|
6
|
-
var _react =
|
|
6
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
7
7
|
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
|
|
@@ -25,6 +25,11 @@ 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 */
|
|
28
33
|
const Hero = /*#__PURE__*/_react.default.memo(function Hero({
|
|
29
34
|
hero,
|
|
30
35
|
welcome
|
|
@@ -89,19 +94,29 @@ const Dashboard = props => {
|
|
|
89
94
|
key: 'hero'
|
|
90
95
|
}, ...sections].map(section => /*#__PURE__*/_react.default.createElement("div", {
|
|
91
96
|
key: section.key
|
|
92
|
-
}, buildSection(section)));
|
|
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');
|
|
93
103
|
|
|
94
|
-
const handleScroll = () => {
|
|
95
104
|
if (window.innerHeight + document.documentElement.scrollTop + 1 >= document.scrollingElement.scrollHeight) {
|
|
96
105
|
onLoadMoreSections ? onLoadMoreSections() : null;
|
|
97
106
|
}
|
|
98
107
|
|
|
99
108
|
return;
|
|
100
|
-
};
|
|
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
|
|
101
114
|
|
|
102
|
-
|
|
115
|
+
div.addEventListener('scroll', handleScroll);
|
|
116
|
+
}, [handleScroll]);
|
|
103
117
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
104
118
|
className: _style.default.wrapper,
|
|
119
|
+
ref: ref,
|
|
105
120
|
"data-name": "dashboard"
|
|
106
121
|
}, sectionsList, cookie ? /*#__PURE__*/_react.default.createElement(_cmPopin.default, cookie) : null);
|
|
107
122
|
};
|
|
@@ -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","handleScroll","window","innerHeight","document","documentElement","scrollTop","scrollingElement","scrollHeight","addEventListener","wrapper","func","arrayOf","oneOfType","BattleRequestList","CardsList","NewsList","StartBattle","CMPopin"],"sources":["../../../../src/template/common/dashboard/index.js"],"sourcesContent":["
|
|
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),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jB,GAApC;IAAyC,aAAU;EAAnD,GACGH,YADH,EAEGR,MAAM,gBAAG,6BAAC,gBAAD,EAAaA,MAAb,CAAH,GAA6B,IAFtC,CADF;AAMD,CA7DD;;AA+DAH,SAAS,CAACL,SAAV,2CAAsB;EACpBH,IAAI,EAAEH,IAAI,CAACM,SAAL,CAAeH,IADD;EAEpBC,OAAO,EAAEJ,IAAI,CAACM,SAAL,CAAeF,OAFJ;EAGpBW,kBAAkB,EAAER,kBAAA,CAAUoC,IAHV;EAIpB9B,QAAQ,EAAEN,kBAAA,CAAUqC,OAAV,CACRrC,kBAAA,CAAUsC,SAAV,CAAoB,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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coorpacademy/components",
|
|
3
|
-
"version": "10.30.4-alpha.
|
|
3
|
+
"version": "10.30.4-alpha.2+db64d42d7",
|
|
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": "
|
|
160
|
+
"gitHead": "db64d42d73f7c97897c0906f5cbf6395113d4d10"
|
|
161
161
|
}
|