@coorpacademy/components 10.30.3 → 10.30.4-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/template/common/dashboard/index.d.ts +1 -0
- package/es/template/common/dashboard/index.d.ts.map +1 -1
- package/es/template/common/dashboard/index.js +13 -1
- package/es/template/common/dashboard/index.js.map +1 -1
- package/lib/template/common/dashboard/index.d.ts +1 -0
- package/lib/template/common/dashboard/index.d.ts.map +1 -1
- package/lib/template/common/dashboard/index.js +13 -1
- package/lib/template/common/dashboard/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -4,6 +4,7 @@ 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>;
|
|
7
8
|
const sections: PropTypes.Requireable<((PropTypes.InferPropsInner<Pick<any, any>> & Partial<PropTypes.InferPropsInner<Pick<any, never>>>) | null | undefined)[]>;
|
|
8
9
|
const cookie: PropTypes.Requireable<PropTypes.InferProps<{
|
|
9
10
|
content: PropTypes.Requireable<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/template/common/dashboard/index.js"],"names":[],"mappings":";AAoBA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/template/common/dashboard/index.js"],"names":[],"mappings":";AAoBA,oDA8CC"}
|
|
@@ -26,7 +26,8 @@ const Dashboard = props => {
|
|
|
26
26
|
sections = [],
|
|
27
27
|
hero,
|
|
28
28
|
welcome,
|
|
29
|
-
cookie
|
|
29
|
+
cookie,
|
|
30
|
+
onLoadMoreSections
|
|
30
31
|
} = props;
|
|
31
32
|
|
|
32
33
|
const buildSectionComponent = section => {
|
|
@@ -71,6 +72,16 @@ const Dashboard = props => {
|
|
|
71
72
|
}, ...sections].map(section => /*#__PURE__*/React.createElement("div", {
|
|
72
73
|
key: section.key
|
|
73
74
|
}, buildSection(section)));
|
|
75
|
+
|
|
76
|
+
const handleScroll = () => {
|
|
77
|
+
if (window.innerHeight + document.documentElement.scrollTop + 1 >= document.scrollingElement.scrollHeight) {
|
|
78
|
+
onLoadMoreSections ? onLoadMoreSections() : null;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return;
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
window.addEventListener('scroll', handleScroll, true);
|
|
74
85
|
return /*#__PURE__*/React.createElement("div", {
|
|
75
86
|
className: style.wrapper,
|
|
76
87
|
"data-name": "dashboard"
|
|
@@ -80,6 +91,7 @@ const Dashboard = props => {
|
|
|
80
91
|
Dashboard.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
81
92
|
hero: Hero.propTypes.hero,
|
|
82
93
|
welcome: Hero.propTypes.welcome,
|
|
94
|
+
onLoadMoreSections: PropTypes.func,
|
|
83
95
|
sections: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.shape(BattleRequestList.propTypes), PropTypes.shape(CardsList.propTypes), PropTypes.shape(NewsList.propTypes), PropTypes.shape(StartBattle.propTypes)])),
|
|
84
96
|
cookie: PropTypes.shape(CMPopin.propTypes)
|
|
85
97
|
} : {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","Slide","HeroCard","BattleRequestList","CardsList","NewsList","StartBattle","CMPopin","style","Hero","memo","hero","welcome","propTypes","shape","Dashboard","props","sections","cookie","buildSectionComponent","section","type","buildSection","index","sectionView","sectionsList","key","map","wrapper","arrayOf","oneOfType"],"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,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,KAAP,MAAkB,qBAAlB;AACA,OAAOC,QAAP,MAAqB,wBAArB;AACA,OAAOC,iBAAP,MAA8B,iDAA9B;AACA,OAAOC,SAAP,MAAsB,wCAAtB;AACA,OAAOC,QAAP,MAAqB,uCAArB;AACA,OAAOC,WAAP,MAAwB,0CAAxB;AACA,OAAOC,OAAP,MAAoB,4BAApB;AACA,OAAOC,KAAP,MAAkB,aAAlB;AAEA,MAAMC,IAAI,gBAAGV,KAAK,CAACW,IAAN,CAAW,SAASD,IAAT,CAAc;EAACE,IAAD;EAAOC;AAAP,CAAd,EAA+B;EACrD,oBAAO;IAAK,SAAS,EAAEJ,KAAK,CAACG;EAAtB,GAA6BA,IAAI,gBAAG,oBAAC,QAAD,EAAcA,IAAd,CAAH,gBAA4B,oBAAC,KAAD,EAAWC,OAAX,CAA7D,CAAP;AACD,CAFY,CAAb;AAIAH,IAAI,CAACI,SAAL,2CAAiB;EACfF,IAAI,EAAEX,SAAS,CAACc,KAAV,CAAgBZ,QAAQ,CAACW,SAAzB,CADS;EAEfD,OAAO,EAAEZ,SAAS,CAACc,KAAV,CAAgBb,KAAK,CAACY,SAAtB;AAFM,CAAjB;;AAKA,MAAME,SAAS,GAAGC,KAAK,IAAI;EACzB,MAAM;IAACC,QAAQ,GAAG,EAAZ;IAAgBN,IAAhB;IAAsBC,OAAtB;IAA+BM
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","Slide","HeroCard","BattleRequestList","CardsList","NewsList","StartBattle","CMPopin","style","Hero","memo","hero","welcome","propTypes","shape","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"],"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, onLoadMoreSections} = props;\n\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\n const sectionsList = [{type: 'hero', key: 'hero'}, ...sections].map(section => (\n <div key={section.key}>{buildSection(section)}</div>\n ));\n\n const handleScroll = () => {\n if (window.innerHeight + document.documentElement.scrollTop + 1 >= document.scrollingElement.scrollHeight) {\n onLoadMoreSections ? onLoadMoreSections() : null;\n }\n return;\n };\n window.addEventListener('scroll', handleScroll, true)\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 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":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAs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AEnB,SAAS,CAACuC,IAHV;EAIpBtB,QAAQ,EAAEjB,SAAS,CAACwC,OAAV,CACRxC,SAAS,CAACyC,SAAV,CAAoB,CAClBzC,SAAS,CAACc,KAAV,CAAgBX,iBAAiB,CAACU,SAAlC,CADkB,EAElBb,SAAS,CAACc,KAAV,CAAgBV,SAAS,CAACS,SAA1B,CAFkB,EAGlBb,SAAS,CAACc,KAAV,CAAgBT,QAAQ,CAACQ,SAAzB,CAHkB,EAIlBb,SAAS,CAACc,KAAV,CAAgBR,WAAW,CAACO,SAA5B,CAJkB,CAApB,CADQ,CAJU;EAYpBK,MAAM,EAAElB,SAAS,CAACc,KAAV,CAAgBP,OAAO,CAACM,SAAxB;AAZY,CAAtB;AAcA,eAAeE,SAAf"}
|
|
@@ -4,6 +4,7 @@ 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>;
|
|
7
8
|
const sections: PropTypes.Requireable<((PropTypes.InferPropsInner<Pick<any, any>> & Partial<PropTypes.InferPropsInner<Pick<any, never>>>) | null | undefined)[]>;
|
|
8
9
|
const cookie: PropTypes.Requireable<PropTypes.InferProps<{
|
|
9
10
|
content: PropTypes.Requireable<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/template/common/dashboard/index.js"],"names":[],"mappings":";AAoBA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/template/common/dashboard/index.js"],"names":[],"mappings":";AAoBA,oDA8CC"}
|
|
@@ -44,7 +44,8 @@ const Dashboard = props => {
|
|
|
44
44
|
sections = [],
|
|
45
45
|
hero,
|
|
46
46
|
welcome,
|
|
47
|
-
cookie
|
|
47
|
+
cookie,
|
|
48
|
+
onLoadMoreSections
|
|
48
49
|
} = props;
|
|
49
50
|
|
|
50
51
|
const buildSectionComponent = section => {
|
|
@@ -89,6 +90,16 @@ const Dashboard = props => {
|
|
|
89
90
|
}, ...sections].map(section => /*#__PURE__*/_react.default.createElement("div", {
|
|
90
91
|
key: section.key
|
|
91
92
|
}, buildSection(section)));
|
|
93
|
+
|
|
94
|
+
const handleScroll = () => {
|
|
95
|
+
if (window.innerHeight + document.documentElement.scrollTop + 1 >= document.scrollingElement.scrollHeight) {
|
|
96
|
+
onLoadMoreSections ? onLoadMoreSections() : null;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return;
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
window.addEventListener('scroll', handleScroll, true);
|
|
92
103
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
93
104
|
className: _style.default.wrapper,
|
|
94
105
|
"data-name": "dashboard"
|
|
@@ -98,6 +109,7 @@ const Dashboard = props => {
|
|
|
98
109
|
Dashboard.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
99
110
|
hero: Hero.propTypes.hero,
|
|
100
111
|
welcome: Hero.propTypes.welcome,
|
|
112
|
+
onLoadMoreSections: _propTypes.default.func,
|
|
101
113
|
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)])),
|
|
102
114
|
cookie: _propTypes.default.shape(_cmPopin.default.propTypes)
|
|
103
115
|
} : {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["Hero","React","memo","hero","welcome","style","propTypes","PropTypes","shape","HeroCard","Slide","Dashboard","props","sections","cookie","buildSectionComponent","section","type","buildSection","index","sectionView","sectionsList","key","map","wrapper","arrayOf","oneOfType","BattleRequestList","CardsList","NewsList","StartBattle","CMPopin"],"sources":["../../../../src/template/common/dashboard/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Slide from '../../../atom/slide';\nimport HeroCard from '../../../molecule/hero';\nimport BattleRequestList from '../../../molecule/dashboard/battle-request-list';\nimport CardsList from '../../../molecule/dashboard/cards-list';\nimport NewsList from '../../../molecule/dashboard/news-list';\nimport StartBattle from '../../../molecule/dashboard/start-battle';\nimport CMPopin from '../../../molecule/cm-popin';\nimport style from './style.css';\n\nconst Hero = React.memo(function Hero({hero, welcome}) {\n return <div className={style.hero}>{hero ? <HeroCard {...hero} /> : <Slide {...welcome} />}</div>;\n});\n\nHero.propTypes = {\n hero: PropTypes.shape(HeroCard.propTypes),\n welcome: PropTypes.shape(Slide.propTypes)\n};\n\nconst Dashboard = props => {\n const {sections = [], hero, welcome, cookie} = props;\n\n const buildSectionComponent = section => {\n const {type} = section;\n switch (type) {\n case 'hero':\n return <Hero hero={hero} welcome={welcome} />;\n case 'battleRequests':\n return <BattleRequestList {...section} />;\n case 'cards':\n return <CardsList {...section} />;\n case 'news':\n return <NewsList {...section} />;\n case 'battle':\n return <StartBattle {...section} />;\n default:\n return null;\n }\n };\n\n const buildSection = (section, index) => {\n const sectionView = buildSectionComponent(section);\n\n return <div key={index}>{sectionView}</div>;\n };\n\n const sectionsList = [{type: 'hero', key: 'hero'}, ...sections].map(section => (\n <div key={section.key}>{buildSection(section)}</div>\n ));\n return (\n <div className={style.wrapper} data-name=\"dashboard\">\n {sectionsList}\n {cookie ? <CMPopin {...cookie} /> : null}\n </div>\n );\n};\n\nDashboard.propTypes = {\n hero: Hero.propTypes.hero,\n welcome: Hero.propTypes.welcome,\n sections: PropTypes.arrayOf(\n PropTypes.oneOfType([\n PropTypes.shape(BattleRequestList.propTypes),\n PropTypes.shape(CardsList.propTypes),\n PropTypes.shape(NewsList.propTypes),\n PropTypes.shape(StartBattle.propTypes)\n ])\n ),\n cookie: PropTypes.shape(CMPopin.propTypes)\n};\nexport default Dashboard;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,IAAI,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;IAAsBC,OAAtB;IAA+BU
|
|
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":["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, onLoadMoreSections} = props;\n\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\n const sectionsList = [{type: 'hero', key: 'hero'}, ...sections].map(section => (\n <div key={section.key}>{buildSection(section)}</div>\n ));\n\n const handleScroll = () => {\n if (window.innerHeight + document.documentElement.scrollTop + 1 >= document.scrollingElement.scrollHeight) {\n onLoadMoreSections ? onLoadMoreSections() : null;\n }\n return;\n };\n window.addEventListener('scroll', handleScroll, true)\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 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":";;;;;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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5B,CAJkB,CAApB,CADQ,CAJU;EAYpBQ,MAAM,EAAEP,kBAAA,CAAUC,KAAV,CAAgBkC,gBAAA,CAAQpC,SAAxB;AAZY,CAAtB;eAceK,S"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coorpacademy/components",
|
|
3
|
-
"version": "10.30.
|
|
3
|
+
"version": "10.30.4-alpha.1+de6d379ee",
|
|
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": "de6d379ee6c64b973d79254f80509f0d02a98423"
|
|
161
161
|
}
|