@coorpacademy/components 10.24.4 → 10.24.5
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/index.d.ts +1 -1
- 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/answer/prop-types.d.ts +6 -6
- 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/share/index.js +1 -1
- package/es/molecule/share/index.js.map +1 -1
- package/es/organism/review-slide/prop-types.d.ts +8 -8
- 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/organism/review-stacked-slides/prop-types.d.ts +22 -22
- package/es/template/app-player/popin-end/summary.css +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/player/prop-types.d.ts +22 -22
- 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/index.d.ts +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/answer/prop-types.d.ts +6 -6
- 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/share/index.js +1 -1
- package/lib/molecule/share/index.js.map +1 -1
- package/lib/organism/review-slide/prop-types.d.ts +8 -8
- 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/organism/review-stacked-slides/prop-types.d.ts +22 -22
- package/lib/template/app-player/popin-end/summary.css +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/player/prop-types.d.ts +22 -22
- 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
|
@@ -39,7 +39,7 @@ declare const propTypes: {
|
|
|
39
39
|
resultLabel: PropTypes.Requireable<string>;
|
|
40
40
|
type: PropTypes.Requireable<string>;
|
|
41
41
|
}>>;
|
|
42
|
-
slides: PropTypes.Validator<
|
|
42
|
+
slides: PropTypes.Validator<PropTypes.InferProps<{
|
|
43
43
|
'0': PropTypes.Requireable<PropTypes.InferProps<{
|
|
44
44
|
position: PropTypes.Requireable<number>;
|
|
45
45
|
loading: PropTypes.Requireable<boolean>;
|
|
@@ -51,7 +51,7 @@ declare const propTypes: {
|
|
|
51
51
|
parentContentTitle: PropTypes.Requireable<string>;
|
|
52
52
|
questionText: PropTypes.Requireable<string>;
|
|
53
53
|
answerUI: PropTypes.Requireable<PropTypes.InferProps<{
|
|
54
|
-
model: PropTypes.Validator<
|
|
54
|
+
model: PropTypes.Validator<PropTypes.InferProps<{
|
|
55
55
|
type: PropTypes.Validator<string>;
|
|
56
56
|
answer: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
57
57
|
title: PropTypes.Validator<string>;
|
|
@@ -69,9 +69,9 @@ declare const propTypes: {
|
|
|
69
69
|
type: PropTypes.Requireable<string>;
|
|
70
70
|
name: PropTypes.Requireable<string>;
|
|
71
71
|
}> | null | undefined)[]>;
|
|
72
|
-
}
|
|
72
|
+
}>>;
|
|
73
73
|
help: PropTypes.Requireable<string>;
|
|
74
|
-
media: PropTypes.Requireable<
|
|
74
|
+
media: PropTypes.Requireable<PropTypes.InferProps<{
|
|
75
75
|
type: PropTypes.Validator<string>;
|
|
76
76
|
id: PropTypes.Requireable<string>;
|
|
77
77
|
width: PropTypes.Requireable<string>;
|
|
@@ -111,7 +111,7 @@ declare const propTypes: {
|
|
|
111
111
|
}> | PropTypes.InferProps<{
|
|
112
112
|
type: PropTypes.Validator<string>;
|
|
113
113
|
mediaUrl: PropTypes.Validator<string>;
|
|
114
|
-
}
|
|
114
|
+
}>>;
|
|
115
115
|
}>>;
|
|
116
116
|
}>>;
|
|
117
117
|
'1': PropTypes.Requireable<PropTypes.InferProps<{
|
|
@@ -125,7 +125,7 @@ declare const propTypes: {
|
|
|
125
125
|
parentContentTitle: PropTypes.Requireable<string>;
|
|
126
126
|
questionText: PropTypes.Requireable<string>;
|
|
127
127
|
answerUI: PropTypes.Requireable<PropTypes.InferProps<{
|
|
128
|
-
model: PropTypes.Validator<
|
|
128
|
+
model: PropTypes.Validator<PropTypes.InferProps<{
|
|
129
129
|
type: PropTypes.Validator<string>;
|
|
130
130
|
answer: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
131
131
|
title: PropTypes.Validator<string>;
|
|
@@ -143,9 +143,9 @@ declare const propTypes: {
|
|
|
143
143
|
type: PropTypes.Requireable<string>;
|
|
144
144
|
name: PropTypes.Requireable<string>;
|
|
145
145
|
}> | null | undefined)[]>;
|
|
146
|
-
}
|
|
146
|
+
}>>;
|
|
147
147
|
help: PropTypes.Requireable<string>;
|
|
148
|
-
media: PropTypes.Requireable<
|
|
148
|
+
media: PropTypes.Requireable<PropTypes.InferProps<{
|
|
149
149
|
type: PropTypes.Validator<string>;
|
|
150
150
|
id: PropTypes.Requireable<string>;
|
|
151
151
|
width: PropTypes.Requireable<string>;
|
|
@@ -185,7 +185,7 @@ declare const propTypes: {
|
|
|
185
185
|
}> | PropTypes.InferProps<{
|
|
186
186
|
type: PropTypes.Validator<string>;
|
|
187
187
|
mediaUrl: PropTypes.Validator<string>;
|
|
188
|
-
}
|
|
188
|
+
}>>;
|
|
189
189
|
}>>;
|
|
190
190
|
}>>;
|
|
191
191
|
'2': PropTypes.Requireable<PropTypes.InferProps<{
|
|
@@ -199,7 +199,7 @@ declare const propTypes: {
|
|
|
199
199
|
parentContentTitle: PropTypes.Requireable<string>;
|
|
200
200
|
questionText: PropTypes.Requireable<string>;
|
|
201
201
|
answerUI: PropTypes.Requireable<PropTypes.InferProps<{
|
|
202
|
-
model: PropTypes.Validator<
|
|
202
|
+
model: PropTypes.Validator<PropTypes.InferProps<{
|
|
203
203
|
type: PropTypes.Validator<string>;
|
|
204
204
|
answer: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
205
205
|
title: PropTypes.Validator<string>;
|
|
@@ -217,9 +217,9 @@ declare const propTypes: {
|
|
|
217
217
|
type: PropTypes.Requireable<string>;
|
|
218
218
|
name: PropTypes.Requireable<string>;
|
|
219
219
|
}> | null | undefined)[]>;
|
|
220
|
-
}
|
|
220
|
+
}>>;
|
|
221
221
|
help: PropTypes.Requireable<string>;
|
|
222
|
-
media: PropTypes.Requireable<
|
|
222
|
+
media: PropTypes.Requireable<PropTypes.InferProps<{
|
|
223
223
|
type: PropTypes.Validator<string>;
|
|
224
224
|
id: PropTypes.Requireable<string>;
|
|
225
225
|
width: PropTypes.Requireable<string>;
|
|
@@ -259,7 +259,7 @@ declare const propTypes: {
|
|
|
259
259
|
}> | PropTypes.InferProps<{
|
|
260
260
|
type: PropTypes.Validator<string>;
|
|
261
261
|
mediaUrl: PropTypes.Validator<string>;
|
|
262
|
-
}
|
|
262
|
+
}>>;
|
|
263
263
|
}>>;
|
|
264
264
|
}>>;
|
|
265
265
|
'3': PropTypes.Requireable<PropTypes.InferProps<{
|
|
@@ -273,7 +273,7 @@ declare const propTypes: {
|
|
|
273
273
|
parentContentTitle: PropTypes.Requireable<string>;
|
|
274
274
|
questionText: PropTypes.Requireable<string>;
|
|
275
275
|
answerUI: PropTypes.Requireable<PropTypes.InferProps<{
|
|
276
|
-
model: PropTypes.Validator<
|
|
276
|
+
model: PropTypes.Validator<PropTypes.InferProps<{
|
|
277
277
|
type: PropTypes.Validator<string>;
|
|
278
278
|
answer: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
279
279
|
title: PropTypes.Validator<string>;
|
|
@@ -291,9 +291,9 @@ declare const propTypes: {
|
|
|
291
291
|
type: PropTypes.Requireable<string>;
|
|
292
292
|
name: PropTypes.Requireable<string>;
|
|
293
293
|
}> | null | undefined)[]>;
|
|
294
|
-
}
|
|
294
|
+
}>>;
|
|
295
295
|
help: PropTypes.Requireable<string>;
|
|
296
|
-
media: PropTypes.Requireable<
|
|
296
|
+
media: PropTypes.Requireable<PropTypes.InferProps<{
|
|
297
297
|
type: PropTypes.Validator<string>;
|
|
298
298
|
id: PropTypes.Requireable<string>;
|
|
299
299
|
width: PropTypes.Requireable<string>;
|
|
@@ -333,7 +333,7 @@ declare const propTypes: {
|
|
|
333
333
|
}> | PropTypes.InferProps<{
|
|
334
334
|
type: PropTypes.Validator<string>;
|
|
335
335
|
mediaUrl: PropTypes.Validator<string>;
|
|
336
|
-
}
|
|
336
|
+
}>>;
|
|
337
337
|
}>>;
|
|
338
338
|
}>>;
|
|
339
339
|
'4': PropTypes.Requireable<PropTypes.InferProps<{
|
|
@@ -347,7 +347,7 @@ declare const propTypes: {
|
|
|
347
347
|
parentContentTitle: PropTypes.Requireable<string>;
|
|
348
348
|
questionText: PropTypes.Requireable<string>;
|
|
349
349
|
answerUI: PropTypes.Requireable<PropTypes.InferProps<{
|
|
350
|
-
model: PropTypes.Validator<
|
|
350
|
+
model: PropTypes.Validator<PropTypes.InferProps<{
|
|
351
351
|
type: PropTypes.Validator<string>;
|
|
352
352
|
answer: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
353
353
|
title: PropTypes.Validator<string>;
|
|
@@ -365,9 +365,9 @@ declare const propTypes: {
|
|
|
365
365
|
type: PropTypes.Requireable<string>;
|
|
366
366
|
name: PropTypes.Requireable<string>;
|
|
367
367
|
}> | null | undefined)[]>;
|
|
368
|
-
}
|
|
368
|
+
}>>;
|
|
369
369
|
help: PropTypes.Requireable<string>;
|
|
370
|
-
media: PropTypes.Requireable<
|
|
370
|
+
media: PropTypes.Requireable<PropTypes.InferProps<{
|
|
371
371
|
type: PropTypes.Validator<string>;
|
|
372
372
|
id: PropTypes.Requireable<string>;
|
|
373
373
|
width: PropTypes.Requireable<string>;
|
|
@@ -407,10 +407,10 @@ declare const propTypes: {
|
|
|
407
407
|
}> | PropTypes.InferProps<{
|
|
408
408
|
type: PropTypes.Validator<string>;
|
|
409
409
|
mediaUrl: PropTypes.Validator<string>;
|
|
410
|
-
}
|
|
410
|
+
}>>;
|
|
411
411
|
}>>;
|
|
412
412
|
}>>;
|
|
413
|
-
}
|
|
413
|
+
}>>;
|
|
414
414
|
endReview: PropTypes.Requireable<boolean>;
|
|
415
415
|
}>>;
|
|
416
416
|
reviewBackgroundAriaLabel: PropTypes.Requireable<string>;
|
|
@@ -2,7 +2,7 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
2
2
|
|
|
3
3
|
import React, { createContext, useContext } from 'react';
|
|
4
4
|
import defaultTheme from '../../variables/theme.native';
|
|
5
|
-
const Context =
|
|
5
|
+
const Context = createContext({
|
|
6
6
|
theme: defaultTheme,
|
|
7
7
|
translations: {},
|
|
8
8
|
display: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template-context.js","names":["React","createContext","useContext","defaultTheme","Context","theme","translations","display","headerHeight","statusBarHeight","store","useTemplateContext","context","Error","TemplateContext","values","children"],"sources":["../../../src/template/app-review/template-context.tsx"],"sourcesContent":["import React, {createContext, useContext} from 'react';\nimport {Translations} from '../../types/translations';\nimport {Analytics} from '../../variables/analytics';\nimport defaultTheme, {Theme} from '../../variables/theme.native';\nimport {Vibration} from '../../variables/vibration';\n\nexport type HandleBlur = () => void;\nexport type HandleFocus = (id: string) => () => void;\nexport type FocusedSelectId = string | null;\n\nexport type TemplateContextValues = {\n analytics?: Analytics;\n brandTheme?: any;\n theme: Theme;\n translations: Translations;\n vibration?: Vibration;\n display: {\n headerHeight: number;\n statusBarHeight: number;\n };\n store: {\n focusedSelectId?: FocusedSelectId;\n handleBlur?: HandleBlur;\n handleFocus?: HandleFocus;\n };\n};\n\ntype Props = {values: TemplateContextValues; children: any};\n\nconst Context = createContext({\n theme: defaultTheme,\n translations: {},\n display: {\n headerHeight: 67,\n statusBarHeight: 42\n },\n store: {}\n});\n\nconst useTemplateContext = (): TemplateContextValues => {\n const context = useContext(Context);\n\n if (!context) {\n throw new Error(\n `❌ [TemplateContext] useTemplateContext must be used within a provider <TemplateContext>`\n );\n }\n\n return context;\n};\n\nconst TemplateContext = ({values, children}: Props) => {\n return <Context.Provider value={{...values}}>{children}</Context.Provider>;\n};\n\nexport {TemplateContext, useTemplateContext};\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,aAAf,EAA8BC,UAA9B,QAA+C,OAA/C;AAGA,OAAOC,YAAP,MAAkC,8BAAlC;AA0BA,MAAMC,OAAO,
|
|
1
|
+
{"version":3,"file":"template-context.js","names":["React","createContext","useContext","defaultTheme","Context","theme","translations","display","headerHeight","statusBarHeight","store","useTemplateContext","context","Error","TemplateContext","values","children"],"sources":["../../../src/template/app-review/template-context.tsx"],"sourcesContent":["import React, {createContext, useContext} from 'react';\nimport {Translations} from '../../types/translations';\nimport {Analytics} from '../../variables/analytics';\nimport defaultTheme, {Theme} from '../../variables/theme.native';\nimport {Vibration} from '../../variables/vibration';\n\nexport type HandleBlur = () => void;\nexport type HandleFocus = (id: string) => () => void;\nexport type FocusedSelectId = string | null;\n\nexport type TemplateContextValues = {\n analytics?: Analytics;\n brandTheme?: any;\n theme: Theme;\n translations: Translations;\n vibration?: Vibration;\n display: {\n headerHeight: number;\n statusBarHeight: number;\n };\n store: {\n focusedSelectId?: FocusedSelectId;\n handleBlur?: HandleBlur;\n handleFocus?: HandleFocus;\n };\n};\n\ntype Props = {values: TemplateContextValues; children: any};\n\nconst Context = createContext({\n theme: defaultTheme,\n translations: {},\n display: {\n headerHeight: 67,\n statusBarHeight: 42\n },\n store: {}\n});\n\nconst useTemplateContext = (): TemplateContextValues => {\n const context = useContext(Context);\n\n if (!context) {\n throw new Error(\n `❌ [TemplateContext] useTemplateContext must be used within a provider <TemplateContext>`\n );\n }\n\n return context;\n};\n\nconst TemplateContext = ({values, children}: Props) => {\n return <Context.Provider value={{...values}}>{children}</Context.Provider>;\n};\n\nexport {TemplateContext, useTemplateContext};\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,aAAf,EAA8BC,UAA9B,QAA+C,OAA/C;AAGA,OAAOC,YAAP,MAAkC,8BAAlC;AA0BA,MAAMC,OAAO,GAAGH,aAAa,CAAC;EAC5BI,KAAK,EAAEF,YADqB;EAE5BG,YAAY,EAAE,EAFc;EAG5BC,OAAO,EAAE;IACPC,YAAY,EAAE,EADP;IAEPC,eAAe,EAAE;EAFV,CAHmB;EAO5BC,KAAK,EAAE;AAPqB,CAAD,CAA7B;;AAUA,MAAMC,kBAAkB,GAAG,MAA6B;EACtD,MAAMC,OAAO,GAAGV,UAAU,CAACE,OAAD,CAA1B;;EAEA,IAAI,CAACQ,OAAL,EAAc;IACZ,MAAM,IAAIC,KAAJ,CACH,yFADG,CAAN;EAGD;;EAED,OAAOD,OAAP;AACD,CAVD;;AAYA,MAAME,eAAe,GAAG,CAAC;EAACC,MAAD;EAASC;AAAT,CAAD,KAA+B;EACrD,oBAAO,oBAAC,OAAD,CAAS,QAAT;IAAkB,KAAK,eAAMD,MAAN;EAAvB,GAAuCC,QAAvC,CAAP;AACD,CAFD;;AAIA,SAAQF,eAAR,EAAyBH,kBAAzB"}
|
|
@@ -8,7 +8,7 @@ import NewsList from '../../../molecule/dashboard/news-list';
|
|
|
8
8
|
import StartBattle from '../../../molecule/dashboard/start-battle';
|
|
9
9
|
import CMPopin from '../../../molecule/cm-popin';
|
|
10
10
|
import style from './style.css';
|
|
11
|
-
const Hero =
|
|
11
|
+
const Hero = React.memo(function Hero({
|
|
12
12
|
hero,
|
|
13
13
|
welcome
|
|
14
14
|
}) {
|
|
@@ -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,
|
|
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,GAAGV,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,oB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,OAAO,CAACM;EAAlB,GAAwBJ,YAAY,CAACF,OAAD,CAApC,CADmB,CAArB;EAGA,oBACE;IAAK,SAAS,EAAEZ,KAAK,CAACoB,OAAtB;IAA+B,aAAU;EAAzC,GACGH,YADH,EAEGP,MAAM,gBAAG,oBAAC,OAAD,EAAaA,MAAb,CAAH,GAA6B,IAFtC,CADF;AAMD,CApCD;;AAsCAH,SAAS,CAACF,SAAV,2CAAsB;EACpBF,IAAI,EAAEF,IAAI,CAACI,SAAL,CAAeF,IADD;EAEpBC,OAAO,EAAEH,IAAI,CAACI,SAAL,CAAeD,OAFJ;EAGpBK,QAAQ,EAAEjB,SAAS,CAAC6B,OAAV,CACR7B,SAAS,CAAC8B,SAAV,CAAoB,CAClB9B,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,CAHU;EAWpBK,MAAM,EAAElB,SAAS,CAACc,KAAV,CAAgBP,OAAO,CAACM,SAAxB;AAXY,CAAtB;AAaA,eAAeE,SAAf"}
|
|
@@ -30,7 +30,7 @@ declare class Provider extends React.Component<any, any, any> {
|
|
|
30
30
|
}>;
|
|
31
31
|
}>>;
|
|
32
32
|
translate: PropTypes.Requireable<(...args: any[]) => any>;
|
|
33
|
-
children: PropTypes.Validator<
|
|
33
|
+
children: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
|
|
34
34
|
Vimeo: PropTypes.Requireable<PropTypes.InferProps<{
|
|
35
35
|
common: PropTypes.Requireable<(...args: any[]) => any>;
|
|
36
36
|
}>>;
|
|
@@ -11,7 +11,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
11
11
|
|
|
12
12
|
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); }
|
|
13
13
|
|
|
14
|
-
const Context =
|
|
14
|
+
const Context = (0, _react.createContext)({
|
|
15
15
|
translate: key => key
|
|
16
16
|
});
|
|
17
17
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web-context.js","names":["Context","createContext","translate","key","WebContext","skin","children","values","useWebContext","context","useContext","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;;;;;;;;AAaA,MAAMA,OAAO,
|
|
1
|
+
{"version":3,"file":"web-context.js","names":["Context","createContext","translate","key","WebContext","skin","children","values","useWebContext","context","useContext","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;;;;;;;;AAaA,MAAMA,OAAO,GAAG,IAAAC,oBAAA,EAAc;EAC5BC,SAAS,EAAGC,GAAD,IAAiBA;AADA,CAAd,CAAhB;;AAQA,MAAMC,UAAU,GAAG,CAAC;EAACC,IAAD;EAAOH,SAAP;EAAkBI;AAAlB,CAAD,KAAwC;EACzD,MAAMC,MAAM,GAAG;IAACF,IAAD;IAAOH;EAAP,CAAf;EACA,oBAAO,6BAAC,OAAD,CAAS,QAAT;IAAkB,KAAK,eAAMK,MAAN;EAAvB,GAAuCD,QAAvC,CAAP;AACD,CAHD;;AAKO,MAAME,aAAa,GAAG,MAAwB;EACnD,MAAMC,OAAO,GAAG,IAAAC,iBAAA,EAAWV,OAAX,CAAhB;;EAEA,IAAI,CAACS,OAAL,EAAc;IACZ,MAAM,IAAIE,KAAJ,CAAU,0EAAV,CAAN;EACD;;EAED,OAAOF,OAAP;AACD,CARM;;;eAUQL,U"}
|
|
@@ -53,7 +53,7 @@ const AnimationAdapter = ({
|
|
|
53
53
|
name,
|
|
54
54
|
children
|
|
55
55
|
}) => {
|
|
56
|
-
return _react.default.Children.map(children, child =>
|
|
56
|
+
return _react.default.Children.map(children, child => _react.default.cloneElement(child, {
|
|
57
57
|
animated,
|
|
58
58
|
onAnimationEnd: () => onAnimationEnd(name)
|
|
59
59
|
}));
|
|
@@ -75,7 +75,7 @@ const walker = (type, handler) => children => {
|
|
|
75
75
|
if ((0, _isNil2.default)(child) || (0, _isString2.default)(child)) return child;
|
|
76
76
|
const newChild = child.type === type ? handler(child) : child;
|
|
77
77
|
if (_react.default.Children.count(newChild.props.children) === 0) return newChild;
|
|
78
|
-
return
|
|
78
|
+
return _react.default.cloneElement(newChild, {}, walker(type, handler)(newChild.props.children));
|
|
79
79
|
});
|
|
80
80
|
};
|
|
81
81
|
|
|
@@ -163,7 +163,7 @@ class AnimationScheduler extends _react.default.Component {
|
|
|
163
163
|
onAnimationEnd = _noop2.default,
|
|
164
164
|
after
|
|
165
165
|
} = child.props;
|
|
166
|
-
return
|
|
166
|
+
return _react.default.cloneElement(child, {
|
|
167
167
|
animated: parentAnimated ? this.isAnimated(after) || animated : animated,
|
|
168
168
|
onAnimationEnd: name => {
|
|
169
169
|
this.handlerAnimationEnd(name);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["AnimationAdapter","animated","onAnimationEnd","name","children","React","Children","map","child","cloneElement","propTypes","PropTypes","string","isRequired","func","bool","pickByWithKey","convert","cap","walker","type","handler","index","newChild","count","props","reduceChildren","fun","acc","newAcc","getAnimationNames","Animation","Transition","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;;AACA;;AAoBA;;AACA;;;;AAEA,MAAMA,gBAAgB,GAAG,CAAC;EAACC,QAAD;EAAWC,cAAc,iBAAzB;EAAkCC,IAAlC;EAAwCC;AAAxC,CAAD,KAAuD;EAC9E,OAAOC,cAAA,CAAMC,QAAN,CAAeC,GAAf,CAAmBH,QAAnB,EAA6BI,KAAK,
|
|
1
|
+
{"version":3,"file":"index.js","names":["AnimationAdapter","animated","onAnimationEnd","name","children","React","Children","map","child","cloneElement","propTypes","PropTypes","string","isRequired","func","bool","pickByWithKey","convert","cap","walker","type","handler","index","newChild","count","props","reduceChildren","fun","acc","newAcc","getAnimationNames","Animation","Transition","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;;AACA;;AAoBA;;AACA;;;;AAEA,MAAMA,gBAAgB,GAAG,CAAC;EAACC,QAAD;EAAWC,cAAc,iBAAzB;EAAkCC,IAAlC;EAAwCC;AAAxC,CAAD,KAAuD;EAC9E,OAAOC,cAAA,CAAMC,QAAN,CAAeC,GAAf,CAAmBH,QAAnB,EAA6BI,KAAK,IACvCH,cAAA,CAAMI,YAAN,CAAmBD,KAAnB,EAA0B;IACxBP,QADwB;IAExBC,cAAc,EAAE,MAAMA,cAAc,CAACC,IAAD;EAFZ,CAA1B,CADK,CAAP;AAMD,CAPD;;;AASAH,gBAAgB,CAACU,SAAjB,2CAA6B;EAC3BP,IAAI,EAAEQ,kBAAA,CAAUC,MAAV,CAAiBC,UADI;EAE3BX,cAAc,EAAES,kBAAA,CAAUG,IAFC;EAG3Bb,QAAQ,EAAEU,kBAAA,CAAUI;AAHO,CAA7B;;AAMA,MAAMC,aAAa,GAAG,iBAAOC,OAAP,CAAe;EAACC,GAAG,EAAE;AAAN,CAAf,CAAtB;;AAEA,MAAMC,MAAM,GAAG,CAACC,IAAD,EAAOC,OAAP,KAAmBjB,QAAQ,IAAI;EAC5C,OAAOC,cAAA,CAAMC,QAAN,CAAeC,GAAf,CAAmBH,QAAnB,EAA6B,CAACI,KAAD,EAAQc,KAAR,KAAkB;IACpD,IAAI,qBAAMd,KAAN,KAAgB,wBAASA,KAAT,CAApB,EAAqC,OAAOA,KAAP;IACrC,MAAMe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D,EAIL/C,QAJK,CAAP;EAKD;;AArE8C;;AAA3CkC,kB,CACG5B,S,2CAAY;EACjBR,cAAc,EAAES,kBAAA,CAAUG,IADT;EAEjBb,QAAQ,EAAEU,kBAAA,CAAUI,IAFH;EAGjBX,QAAQ,EAAEO,kBAAA,CAAUyC;AAHH,C;eAuENd,kB"}
|
package/lib/hoc/swapper/index.js
CHANGED
|
@@ -52,7 +52,7 @@ class Swapper extends _react.default.Component {
|
|
|
52
52
|
|
|
53
53
|
const child = _react.default.Children.only(children);
|
|
54
54
|
|
|
55
|
-
return init ?
|
|
55
|
+
return init ? _react.default.cloneElement(child, props) : child;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["safeCancelAnimationFrame","requestId","cancelAnimationFrame","Swapper","React","Component","constructor","props","state","init","componentDidMount","requestAnimationFrame","requestID","setState","componentWillUnmount","undefined","render","children","child","Children","only","cloneElement","propTypes","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;;AACA;;;;;;;;AAEO,MAAMA,wBAAwB,GAAGC,SAAS,IAAIA,SAAS,IAAIC,oBAAoB,CAACD,SAAD,CAA/E;;;;AAEP,MAAME,OAAN,SAAsBC,cAAA,CAAMC,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;MAChCf,wBAAwB,CAAC,KAAKY,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,GAAGd,cAAA,CAAMe,QAAN,CAAeC,IAAf,CAAoBH,QAApB,CAAd;;IAEA,OAAOR,IAAI,
|
|
1
|
+
{"version":3,"file":"index.js","names":["safeCancelAnimationFrame","requestId","cancelAnimationFrame","Swapper","React","Component","constructor","props","state","init","componentDidMount","requestAnimationFrame","requestID","setState","componentWillUnmount","undefined","render","children","child","Children","only","cloneElement","propTypes","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;;AACA;;;;;;;;AAEO,MAAMA,wBAAwB,GAAGC,SAAS,IAAIA,SAAS,IAAIC,oBAAoB,CAACD,SAAD,CAA/E;;;;AAEP,MAAME,OAAN,SAAsBC,cAAA,CAAMC,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;MAChCf,wBAAwB,CAAC,KAAKY,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,GAAGd,cAAA,CAAMe,QAAN,CAAeC,IAAf,CAAoBH,QAApB,CAAd;;IAEA,OAAOR,IAAI,GAAGL,cAAA,CAAMiB,YAAN,CAAmBH,KAAnB,EAA0BX,KAA1B,CAAH,GAAsCW,KAAjD;EACD;;AA/BmC;;AAAhCf,O,CACGmB,S,2CAAY;EACjBL,QAAQ,EAAEM,kBAAA,CAAUC;AADH,C;eAiCNrB,O"}
|
|
@@ -38,7 +38,7 @@ const Transition = props => {
|
|
|
38
38
|
const handlerAnimationEnd = (0, _react.useMemo)(() => () => {
|
|
39
39
|
return onAnimationEnd(name);
|
|
40
40
|
}, []);
|
|
41
|
-
return
|
|
41
|
+
return _react.default.cloneElement(child, {
|
|
42
42
|
className: (0, _classnames.default)(propClassName, className),
|
|
43
43
|
onTransitionEnd: handlerAnimationEnd,
|
|
44
44
|
onAnimationEnd: handlerAnimationEnd
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["Transition","props","name","children","className","animated","onAnimationEnd","Child","child","propClassName","handlerAnimationEnd","useMemo","React","cloneElement","classnames","onTransitionEnd","Children","map","propTypes","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;;AAEA;;AACA;;;;;;;;AAEA,MAAMA,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,GAAG,IAAAC,cAAA,EAC1B,MAAM,MAAM;MACV,OAAOL,cAAc,CAACJ,IAAD,CAArB;IACD,CAHyB,EAI1B,EAJ0B,CAA5B;IAOA,
|
|
1
|
+
{"version":3,"file":"index.js","names":["Transition","props","name","children","className","animated","onAnimationEnd","Child","child","propClassName","handlerAnimationEnd","useMemo","React","cloneElement","classnames","onTransitionEnd","Children","map","propTypes","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;;AAEA;;AACA;;;;;;;;AAEA,MAAMA,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,GAAG,IAAAC,cAAA,EAC1B,MAAM,MAAM;MACV,OAAOL,cAAc,CAACJ,IAAD,CAArB;IACD,CAHyB,EAI1B,EAJ0B,CAA5B;IAOA,OAAOU,cAAA,CAAMC,YAAN,CAAmBL,KAAnB,EAA0B;MAC/BJ,SAAS,EAAE,IAAAU,mBAAA,EAAWL,aAAX,EAA0BL,SAA1B,CADoB;MAE/BW,eAAe,EAAEL,mBAFc;MAG/BJ,cAAc,EAAEI;IAHe,CAA1B,CAAP;EAKD,CAjBD;;EAmBA,OAAOE,cAAA,CAAMI,QAAN,CAAeC,GAAf,CAAmBd,QAAnB,EAA6BK,KAAK,iBAAI,6BAAC,KAAD;IAAO,KAAK,EAAEA;EAAd,EAAtC,CAAP;AACD,CAzBD;;AA2BAR,UAAU,CAACkB,SAAX,2CAAuB;EACrBhB,IAAI,EAAEiB,kBAAA,CAAUC,MAAV,CAAiBC,UADF;EAErBf,cAAc,EAAEa,kBAAA,CAAUG,IAFL;EAGrBjB,QAAQ,EAAEc,kBAAA,CAAUI;AAHC,CAAvB;eAMevB,U"}
|
|
@@ -26,7 +26,7 @@ const ADD_TO_MY_LIST_STATUS = {
|
|
|
26
26
|
SUCCESS: 'SUCCESS'
|
|
27
27
|
};
|
|
28
28
|
|
|
29
|
-
const StatusContext =
|
|
29
|
+
const StatusContext = _react.default.createContext(ADD_TO_MY_LIST_STATUS.IDLE);
|
|
30
30
|
|
|
31
31
|
const AddToMyListStatusProvider = ({
|
|
32
32
|
children
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["ADD_TO_MY_LIST_STATUS","IDLE","SUCCESS","StatusContext","React","createContext","AddToMyListStatusProvider","children","status","setStatus","useState","useEffect","timeoutId","DURATION","setTimeout","clearTimeout","statusValue","useMemo","AddToMyListFeedback","addToMyListText","removeFromMyListText","favorite","useContext","classnames","styles","feedback","checkIcon","AddToMyList","style","addToMyListButton","onFavoriteClick","cb","onClick","container","cta","wrapper","shareIcon","propTypes","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;;AACA;;AACA;;AACA;;AAIA;;AACA;;;;;;;;AAEA,MAAMA,qBAAqB,GAAG;EAC5BC,IAAI,EAAE,MADsB;EAE5BC,OAAO,EAAE;AAFmB,CAA9B;;AAKA,MAAMC,aAAa,
|
|
1
|
+
{"version":3,"file":"index.js","names":["ADD_TO_MY_LIST_STATUS","IDLE","SUCCESS","StatusContext","React","createContext","AddToMyListStatusProvider","children","status","setStatus","useState","useEffect","timeoutId","DURATION","setTimeout","clearTimeout","statusValue","useMemo","AddToMyListFeedback","addToMyListText","removeFromMyListText","favorite","useContext","classnames","styles","feedback","checkIcon","AddToMyList","style","addToMyListButton","onFavoriteClick","cb","onClick","container","cta","wrapper","shareIcon","propTypes","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;;AACA;;AACA;;AACA;;AAIA;;AACA;;;;;;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F;EAG9BnB,QAAQ,EAAEiB,kBAAA,CAAUG;AAHU,CAAhC;AAMAd,WAAW,CAACU,SAAZ,2CAAwB;EACtBT,KAAK,EAAEU,kBAAA,CAAUE,MADK;EAEtBX,iBAAiB,EAAES,kBAAA,CAAUE,MAFP;EAGtBnB,QAAQ,EAAEiB,kBAAA,CAAUG,IAHE;EAItBX,eAAe,EAAEQ,kBAAA,CAAUI;AAJL,CAAxB;eAOef,W"}
|
|
@@ -3,7 +3,7 @@ export declare const TYPE_IMAGE = "img";
|
|
|
3
3
|
export declare const TYPE_VIDEO = "video";
|
|
4
4
|
export declare const TYPE_AUDIO = "audio";
|
|
5
5
|
export declare const MediaViewPropTypes: {
|
|
6
|
-
media: PropTypes.Requireable<
|
|
6
|
+
media: PropTypes.Requireable<PropTypes.InferProps<{
|
|
7
7
|
type: PropTypes.Validator<string>;
|
|
8
8
|
id: PropTypes.Requireable<string>;
|
|
9
9
|
width: PropTypes.Requireable<string>;
|
|
@@ -43,10 +43,10 @@ export declare const MediaViewPropTypes: {
|
|
|
43
43
|
}> | PropTypes.InferProps<{
|
|
44
44
|
type: PropTypes.Validator<string>;
|
|
45
45
|
mediaUrl: PropTypes.Validator<string>;
|
|
46
|
-
}
|
|
46
|
+
}>>;
|
|
47
47
|
};
|
|
48
48
|
declare const propTypes: {
|
|
49
|
-
model: PropTypes.Validator<
|
|
49
|
+
model: PropTypes.Validator<PropTypes.InferProps<{
|
|
50
50
|
type: PropTypes.Validator<string>;
|
|
51
51
|
answer: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
52
52
|
title: PropTypes.Validator<string>;
|
|
@@ -64,9 +64,9 @@ declare const propTypes: {
|
|
|
64
64
|
type: PropTypes.Requireable<string>;
|
|
65
65
|
name: PropTypes.Requireable<string>;
|
|
66
66
|
}> | null | undefined)[]>;
|
|
67
|
-
}
|
|
67
|
+
}>>;
|
|
68
68
|
help: PropTypes.Requireable<string>;
|
|
69
|
-
media: PropTypes.Requireable<
|
|
69
|
+
media: PropTypes.Requireable<PropTypes.InferProps<{
|
|
70
70
|
type: PropTypes.Validator<string>;
|
|
71
71
|
id: PropTypes.Requireable<string>;
|
|
72
72
|
width: PropTypes.Requireable<string>;
|
|
@@ -106,7 +106,7 @@ declare const propTypes: {
|
|
|
106
106
|
}> | PropTypes.InferProps<{
|
|
107
107
|
type: PropTypes.Validator<string>;
|
|
108
108
|
mediaUrl: PropTypes.Validator<string>;
|
|
109
|
-
}
|
|
109
|
+
}>>;
|
|
110
110
|
};
|
|
111
111
|
declare type SelectOptions = {
|
|
112
112
|
name: string;
|
|
@@ -134,7 +134,7 @@ CardBackground.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
134
134
|
empty: _propTypes.default.bool,
|
|
135
135
|
'aria-label': _propTypes.default.string
|
|
136
136
|
} : {};
|
|
137
|
-
const Card =
|
|
137
|
+
const Card = (0, _react.memo)(function Card(props, context) {
|
|
138
138
|
const {
|
|
139
139
|
skin
|
|
140
140
|
} = context;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["THEMES","default","coorpmanager","style","CardBackground","type","image","empty","ariaLabel","skin","externalContent","isExternalContent","primaryColor","whiteColor","EXTERNAL_CONTENT_ICONS","IconType","icon","iconColor","color","backgroundIcon","externalIconCircleWrapper","externalIcon","_backgroundIcon","classnames","externalIconCircleWithImageWrapper","backgroundColor","externalIconWithImage","imageWrapper","backgroundImage","externalContentHeader","externalBackground","emptyIcon","chapterImageWrapper","contextTypes","Provider","childContextTypes","propTypes","PropTypes","string","bool","Card","memo","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","useMemo","e","lock","lockIcon","inlineBadgeStyle","getType","contentType","MODES","CARD","lockWrapper","shape","Customer","number","func","Notification","CardContentInfo","oneOf","Favorite","Selectable"],"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;;AACA;;AACA;;AAEA;;AAIA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEO,MAAMA,MAAM,GAAG;EACpBC,OAAO,EAAE,IADW;EAEpBC,YAAY,EAAEC,cAAA,CAAMD;AAFA,CAAf;;;AAKP,MAAME,cAAc,GAAG,CAAC;EAACC,IAAD;EAAOC,KAAP;EAAcC,KAAd;EAAqB,cAAcC;AAAnC,CAAD,EAAgD;EAACC;AAAD,CAAhD,KAA2D;EAChF,MAAMC,eAAe,GAAG,IAAAC,kCAAA,EAAkBN,IAAlB,CAAxB;EACA,MAAMO,YAAY,GAAG,mBAAI,gBAAJ,EAAsBH,IAAtB,CAArB;EACA,MAAMI,UAAU,GAAG,mBAAI,cAAJ,EAAoBJ,IAApB,CAAnB;;EAEA,IAAIC,eAAe,IAAII,uCAAA,CAAuBT,IAAvB,CAAvB,EAAqD;IACnD,MAAMU,QAAQ,GAAGD,uCAAA,CAAuBT,IAAvB,EAA6BW,IAA9C;IACA,MAAMC,SAAS,GAAGH,uCAAA,CAAuBT,IAAvB,EAA6Ba,KAA/C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AhBP;EAiBfoB,YAAY,EAAEtB,kBAAA,CAAUkD,KAAV,CAAgBI,qBAAA,CAAavD,SAA7B,CAjBC;EAkBfwB,aAAa,EAAEgC,oBAAA,CAAgBxD,SAAhB,CAA0BwB,aAlB1B;EAmBfC,UAAU,EAAE+B,oBAAA,CAAgBxD,SAAhB,CAA0ByB,UAnBvB;EAoBfC,KAAK,EAAEzB,kBAAA,CAAUwD,KAAV,CAAgB,oBAAK7F,MAAL,CAAhB,CApBQ;EAqBf,cAAcqC,kBAAA,CAAUC,MArBT;EAsBf,yBAAyBD,kBAAA,CAAUC,MAtBpB;EAuBf,uBAAuBwD,iBAAA,CAAS1D,SAAT,CAAmB,YAAnB,CAvBR;EAwBf,yBAAyB2D,mBAAA,CAAW3D,SAAX,CAAqB,YAArB,CAxBV;EAyBf,uBAAuBoD,iBAAA,CAASpD,SAAT,CAAmB,YAAnB,CAzBR;EA0Bf,oBAAoBC,kBAAA,CAAUC,MA1Bf;EA2Bf,uBAAuBD,kBAAA,CAAUC,MA3BlB;EA4Bf,2BAA2BsD,oBAAA,CAAgBxD,SAAhB,CAA0B,YAA1B;AA5BZ,CAAjB;eA8BeI,I"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["THEMES","default","coorpmanager","style","CardBackground","type","image","empty","ariaLabel","skin","externalContent","isExternalContent","primaryColor","whiteColor","EXTERNAL_CONTENT_ICONS","IconType","icon","iconColor","color","backgroundIcon","externalIconCircleWrapper","externalIcon","_backgroundIcon","classnames","externalIconCircleWithImageWrapper","backgroundColor","externalIconWithImage","imageWrapper","backgroundImage","externalContentHeader","externalBackground","emptyIcon","chapterImageWrapper","contextTypes","Provider","childContextTypes","propTypes","PropTypes","string","bool","Card","memo","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","useMemo","e","lock","lockIcon","inlineBadgeStyle","getType","contentType","MODES","CARD","lockWrapper","shape","Customer","number","func","Notification","CardContentInfo","oneOf","Favorite","Selectable"],"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;;AACA;;AACA;;AAEA;;AAIA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEO,MAAMA,MAAM,GAAG;EACpBC,OAAO,EAAE,IADW;EAEpBC,YAAY,EAAEC,cAAA,CAAMD;AAFA,CAAf;;;AAKP,MAAME,cAAc,GAAG,CAAC;EAACC,IAAD;EAAOC,KAAP;EAAcC,KAAd;EAAqB,cAAcC;AAAnC,CAAD,EAAgD;EAACC;AAAD,CAAhD,KAA2D;EAChF,MAAMC,eAAe,GAAG,IAAAC,kCAAA,EAAkBN,IAAlB,CAAxB;EACA,MAAMO,YAAY,GAAG,mBAAI,gBAAJ,EAAsBH,IAAtB,CAArB;EACA,MAAMI,UAAU,GAAG,mBAAI,cAAJ,EAAoBJ,IAApB,CAAnB;;EAEA,IAAIC,eAAe,IAAII,uCAAA,CAAuBT,IAAvB,CAAvB,EAAqD;IACnD,MAAMU,QAAQ,GAAGD,uCAAA,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