@coorpacademy/components 11.0.1 → 11.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/atom/picture/index.js +5 -8
- package/es/atom/picture/index.js.map +1 -1
- package/es/molecule/discipline-scope/index.d.ts +1 -0
- package/es/molecule/forum/forum-comment/index.d.ts +1 -0
- package/es/molecule/forum/forum-comment/index.d.ts.map +1 -1
- package/es/molecule/forum/forum-comment/index.js +5 -2
- package/es/molecule/forum/forum-comment/index.js.map +1 -1
- package/es/molecule/forum/forum-post/index.d.ts +2 -0
- package/es/molecule/forum/forum-post/index.d.ts.map +1 -1
- package/es/molecule/forum/forum-post/index.js +8 -1
- package/es/molecule/forum/forum-post/index.js.map +1 -1
- package/es/molecule/scope-content/index.d.ts +1 -0
- package/es/organism/discussion/index.d.ts +1 -0
- package/es/organism/discussion/index.d.ts.map +1 -1
- package/es/organism/discussion/index.js +4 -1
- package/es/organism/discussion/index.js.map +1 -1
- package/es/organism/review-slide/index.native.js +6 -3
- package/es/organism/review-slide/index.native.js.map +1 -1
- package/es/organism/review-slide/prop-types.d.ts +2 -0
- package/es/organism/review-slide/prop-types.d.ts.map +1 -1
- package/es/organism/review-slide/prop-types.js.map +1 -1
- package/es/organism/review-stacked-slides/index.native.d.ts +1 -1
- package/es/organism/review-stacked-slides/index.native.d.ts.map +1 -1
- package/es/organism/review-stacked-slides/index.native.js +82 -6
- package/es/organism/review-stacked-slides/index.native.js.map +1 -1
- package/es/template/app-player/popin-end/index.d.ts +1 -0
- package/es/template/app-player/popin-end/summary.d.ts +1 -0
- package/es/template/common/discipline/index.d.ts +1 -0
- package/lib/atom/picture/index.js +5 -8
- package/lib/atom/picture/index.js.map +1 -1
- package/lib/molecule/discipline-scope/index.d.ts +1 -0
- package/lib/molecule/forum/forum-comment/index.d.ts +1 -0
- package/lib/molecule/forum/forum-comment/index.d.ts.map +1 -1
- package/lib/molecule/forum/forum-comment/index.js +5 -2
- package/lib/molecule/forum/forum-comment/index.js.map +1 -1
- package/lib/molecule/forum/forum-post/index.d.ts +2 -0
- package/lib/molecule/forum/forum-post/index.d.ts.map +1 -1
- package/lib/molecule/forum/forum-post/index.js +8 -1
- package/lib/molecule/forum/forum-post/index.js.map +1 -1
- package/lib/molecule/scope-content/index.d.ts +1 -0
- package/lib/organism/discussion/index.d.ts +1 -0
- package/lib/organism/discussion/index.d.ts.map +1 -1
- package/lib/organism/discussion/index.js +4 -1
- package/lib/organism/discussion/index.js.map +1 -1
- package/lib/organism/review-slide/index.native.js +6 -3
- package/lib/organism/review-slide/index.native.js.map +1 -1
- package/lib/organism/review-slide/prop-types.d.ts +2 -0
- package/lib/organism/review-slide/prop-types.d.ts.map +1 -1
- package/lib/organism/review-slide/prop-types.js.map +1 -1
- package/lib/organism/review-stacked-slides/index.native.d.ts +1 -1
- package/lib/organism/review-stacked-slides/index.native.d.ts.map +1 -1
- package/lib/organism/review-stacked-slides/index.native.js +81 -5
- package/lib/organism/review-stacked-slides/index.native.js.map +1 -1
- package/lib/template/app-player/popin-end/index.d.ts +1 -0
- package/lib/template/app-player/popin-end/summary.d.ts +1 -0
- package/lib/template/common/discipline/index.d.ts +1 -0
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["React","useEffect","Animated","StyleSheet","useWindowDimensions","keys","useTranslateY","Slide","TOTAL_SLIDES_STACK","style","create","slides","flex","height","width","StackedSlides","props","windowHeight","
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["React","useEffect","useState","Animated","StyleSheet","useWindowDimensions","keys","useTranslateY","Slide","TOTAL_SLIDES_STACK","style","create","slides","flex","height","width","FakeSlide","position","validateButton","loading","StackedSlides","props","windowHeight","endReview","correctionPopinProps","unstacked","setUnstacked","restacked","setRestacked","hideSlides","fromValue","toValue","duration","translateDown","start","restackingSlide","find","k","animationType","unstackingSlide","remainingKeys","filter","orderedKeys","sort","k1","k2","animatedSlide","includes","toString","unstacking","restacking","stackedSlides","map","slideIndex","index","slide","num","length","push","animatedStyle"],"sources":["../../../src/organism/review-stacked-slides/index.native.tsx"],"sourcesContent":["import React, {useEffect, useState} from 'react';\nimport {Animated, StyleSheet, useWindowDimensions} from 'react-native';\nimport keys from 'lodash/fp/keys';\nimport {useTranslateY} from '@coorpacademy/react-native-animation';\nimport Slide from '../review-slide/index.native';\nimport type {ReviewSlideProps} from '../review-slide/prop-types';\nimport type {ReviewStackProps} from './prop-types';\n\nexport const TOTAL_SLIDES_STACK = 5;\n\nconst style = StyleSheet.create({\n slides: {\n flex: 1,\n height: '100%',\n width: '100%'\n }\n});\n\ntype FakeSlideProps = {position: number; validateButton: ReviewSlideProps['validateButton']};\nconst FakeSlide = ({position, validateButton}: FakeSlideProps) => (\n <Slide\n num={position}\n slide={{loading: true, position}}\n slideIndex={`${position}`}\n validateButton={validateButton}\n />\n);\n\n/*\n - slides are ordered to be played from left to right: [0,1,2,3]\n - slides are piled on the view, so we need to reverse the order:\n -> it's like our eye is looking from the right [3,2,1,0] <-- oO\n*/\nconst StackedSlides = (props: ReviewStackProps) => {\n const {height: windowHeight} = useWindowDimensions();\n const {endReview, slides, validateButton, correctionPopinProps} = props;\n const [unstacked, setUnstacked] = useState<string[]>([]);\n const [restacked, setRestacked] = useState<string | null>();\n\n const hideSlides = useTranslateY({\n fromValue: 0,\n toValue: windowHeight,\n duration: 800\n });\n\n const translateDown = useTranslateY({\n fromValue: 0,\n toValue: windowHeight - 100,\n duration: 1000\n });\n\n useEffect(() => {\n if (endReview) {\n hideSlides.start();\n }\n }, [endReview, hideSlides]);\n\n const restackingSlide = keys(slides).find(k => slides[k].animationType === 'restack');\n const unstackingSlide = keys(slides).find(k => slides[k].animationType === 'unstack');\n\n const remainingKeys = keys(slides).filter(\n k => slides[k].position >= 0 && !slides[k].animationType\n );\n\n const orderedKeys = remainingKeys.sort((k1, k2) =>\n slides[k2].position > slides[k1].position ? 1 : -1\n );\n\n const animatedSlide = restackingSlide || unstackingSlide;\n\n useEffect(() => {\n if (restacked && orderedKeys.includes(restacked)) {\n setRestacked(null);\n }\n // this effect is required only when the list orderedKeys changes\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [orderedKeys.toString()]);\n\n useEffect(() => {\n const unstacking = unstackingSlide && !unstacked.includes(unstackingSlide);\n\n if (unstacking) {\n translateDown.start(() => {\n setUnstacked([...unstacked, unstackingSlide]);\n });\n }\n }, [unstackingSlide, unstacked, setUnstacked, translateDown]);\n\n useEffect(() => {\n const restacking = restackingSlide && restacked !== restackingSlide;\n\n if (restacking) {\n translateDown.start(() => {\n setRestacked(restackingSlide);\n });\n }\n }, [restackingSlide, restacked, setRestacked, translateDown]);\n\n const stackedSlides = orderedKeys.map((slideIndex, index) => {\n const slide = slides[slideIndex];\n\n return (\n <Slide\n {...{\n num: orderedKeys.length - index,\n slideIndex,\n slide,\n validateButton,\n correctionPopinProps\n }}\n key={slideIndex}\n />\n );\n });\n\n if (animatedSlide) {\n stackedSlides.push(\n <Slide\n {...{\n num: 0,\n slideIndex: animatedSlide,\n slide: slides[animatedSlide],\n validateButton,\n correctionPopinProps\n }}\n animatedStyle={[translateDown.animatedStyle]}\n key={animatedSlide}\n />\n );\n }\n\n return (\n <Animated.View style={[style.slides, hideSlides.animatedStyle]}>\n {restacked ? (\n <FakeSlide position={orderedKeys.length + 1} validateButton={validateButton} />\n ) : null}\n {stackedSlides}\n </Animated.View>\n );\n};\n\nexport default StackedSlides;\n"],"mappings":"AAAA,OAAOA,KAAP,IAAeC,SAAf,EAA0BC,QAA1B,QAAyC,OAAzC;AACA,SAAQC,QAAR,EAAkBC,UAAlB,EAA8BC,mBAA9B,QAAwD,cAAxD;AACA,OAAOC,IAAP,MAAiB,gBAAjB;AACA,SAAQC,aAAR,QAA4B,sCAA5B;AACA,OAAOC,KAAP,MAAkB,8BAAlB;AAIA,OAAO,MAAMC,kBAAkB,GAAG,CAA3B;AAEP,MAAMC,KAAK,GAAGN,UAAU,CAACO,MAAX,CA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opinEnd {
|
|
|
65
65
|
avatar: PropTypes.Requireable<any>;
|
|
66
66
|
loading: PropTypes.Requireable<boolean>;
|
|
67
67
|
value: PropTypes.Requireable<string>;
|
|
68
|
+
profileAvatarAlt: PropTypes.Requireable<string>;
|
|
68
69
|
title: PropTypes.Requireable<string>;
|
|
69
70
|
onPost: PropTypes.Requireable<(...args: any[]) => any>;
|
|
70
71
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -71,6 +71,7 @@ declare namespace Summary {
|
|
|
71
71
|
avatar: PropTypes.Requireable<any>;
|
|
72
72
|
loading: PropTypes.Requireable<boolean>;
|
|
73
73
|
value: PropTypes.Requireable<string>;
|
|
74
|
+
profileAvatarAlt: PropTypes.Requireable<string>;
|
|
74
75
|
title: PropTypes.Requireable<string>;
|
|
75
76
|
onPost: PropTypes.Requireable<(...args: any[]) => any>;
|
|
76
77
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -78,6 +78,7 @@ declare namespace Discipline {
|
|
|
78
78
|
avatar: PropTypes.Requireable<any>;
|
|
79
79
|
loading: PropTypes.Requireable<boolean>;
|
|
80
80
|
value: PropTypes.Requireable<string>;
|
|
81
|
+
profileAvatarAlt: PropTypes.Requireable<string>;
|
|
81
82
|
title: PropTypes.Requireable<string>;
|
|
82
83
|
onPost: PropTypes.Requireable<(...args: any[]) => any>;
|
|
83
84
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -33,16 +33,12 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
33
33
|
|
|
34
34
|
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); }
|
|
35
35
|
|
|
36
|
-
const toSrcSet =
|
|
37
|
-
src
|
|
38
|
-
}) => {
|
|
36
|
+
const toSrcSet = src => {
|
|
39
37
|
if (!(0, _isObject2.default)(src)) return {};
|
|
40
38
|
return (0, _pipe2.default)((0, _set2.default)('srcSet', (0, _pipe2.default)(_toPairs2.default, (0, _filter2.default)(([key, url]) => url), (0, _map2.default)(([key, url]) => `${url} ${key}`), (0, _join2.default)(','))(src)), (0, _set2.default)('src', (0, _get2.default)('1x', src)))({});
|
|
41
39
|
};
|
|
42
40
|
|
|
43
|
-
const toSetAlt =
|
|
44
|
-
alt
|
|
45
|
-
}) => {
|
|
41
|
+
const toSetAlt = alt => {
|
|
46
42
|
return alt ? {
|
|
47
43
|
alt
|
|
48
44
|
} : {
|
|
@@ -53,7 +49,8 @@ const toSetAlt = ({
|
|
|
53
49
|
|
|
54
50
|
const Picture = props => {
|
|
55
51
|
const {
|
|
56
|
-
src
|
|
52
|
+
src,
|
|
53
|
+
alt
|
|
57
54
|
} = props;
|
|
58
55
|
|
|
59
56
|
if ((0, _isNil2.default)(src)) {
|
|
@@ -62,7 +59,7 @@ const Picture = props => {
|
|
|
62
59
|
});
|
|
63
60
|
}
|
|
64
61
|
|
|
65
|
-
return /*#__PURE__*/_react.default.createElement("img", _extends({}, props, toSrcSet(
|
|
62
|
+
return /*#__PURE__*/_react.default.createElement("img", _extends({}, props, toSrcSet(src), toSetAlt(alt)));
|
|
66
63
|
};
|
|
67
64
|
|
|
68
65
|
Picture.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["toSrcSet","src","key","url","toSetAlt","alt","Picture","props","style","empty","propTypes","PropTypes","oneOfType","SrcPropType","objectOf","string"],"sources":["../../../src/atom/picture/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {filter, get, isNil, isObject, join, map, pipe, set, toPairs} from 'lodash/fp';\nimport {SrcPropType} from '../../util/proptypes';\nimport style from './style.css';\n\nconst toSrcSet =
|
|
1
|
+
{"version":3,"file":"index.js","names":["toSrcSet","src","key","url","toSetAlt","alt","Picture","props","style","empty","propTypes","PropTypes","oneOfType","SrcPropType","objectOf","string"],"sources":["../../../src/atom/picture/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {filter, get, isNil, isObject, join, map, pipe, set, toPairs} from 'lodash/fp';\nimport {SrcPropType} from '../../util/proptypes';\nimport style from './style.css';\n\nconst toSrcSet = src => {\n if (!isObject(src)) return {};\n return pipe(\n set(\n 'srcSet',\n pipe(\n toPairs,\n filter(([key, url]) => url),\n map(([key, url]) => `${url} ${key}`),\n join(',')\n )(src)\n ),\n set('src', get('1x', src))\n )({});\n};\n\nconst toSetAlt = alt => {\n return alt ? {alt} : {alt: '', 'aria-hidden': true};\n};\n\nconst Picture = props => {\n const {src, alt} = props;\n if (isNil(src)) {\n return <div className={style.empty} />;\n }\n return <img {...props} {...toSrcSet(src)} {...toSetAlt(alt)} />;\n};\n\nPicture.propTypes = {\n src: PropTypes.oneOfType([SrcPropType, PropTypes.objectOf(SrcPropType)]),\n alt: PropTypes.string\n};\n\nexport default Picture;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;;;;;AAEA,MAAMA,QAAQ,GAAGC,GAAG,IAAI;EACtB,IAAI,CAAC,wBAASA,GAAT,CAAL,EAAoB,OAAO,EAAP;EACpB,OAAO,oBACL,mBACE,QADF,EAEE,uCAEE,sBAAO,CAAC,CAACC,GAAD,EAAMC,GAAN,CAAD,KAAgBA,GAAvB,CAFF,EAGE,mBAAI,CAAC,CAACD,GAAD,EAAMC,GAAN,CAAD,KAAiB,GAAEA,GAAI,IAAGD,GAAI,EAAlC,CAHF,EAIE,oBAAK,GAAL,CAJF,EAKED,GALF,CAFF,CADK,EAUL,mBAAI,KAAJ,EAAW,mBAAI,IAAJ,EAAUA,GAAV,CAAX,CAVK,EAWL,EAXK,CAAP;AAYD,CAdD;;AAgBA,MAAMG,QAAQ,GAAGC,GAAG,IAAI;EACtB,OAAOA,GAAG,GAAG;IAACA;EAAD,CAAH,GAAW;IAACA,GAAG,EAAE,EAAN;IAAU,eAAe;EAAzB,CAArB;AACD,CAFD;;AAIA,MAAMC,OAAO,GAAGC,KAAK,IAAI;EACvB,MAAM;IAACN,GAAD;IAAMI;EAAN,IAAaE,KAAnB;;EACA,IAAI,qBAAMN,GAAN,CAAJ,EAAgB;IACd,oBAAO;MAAK,SAAS,EAAEO,cAAA,CAAMC;IAAtB,EAAP;EACD;;EACD,oBAAO,iDAASF,KAAT,EAAoBP,QAAQ,CAACC,GAAD,CAA5B,EAAuCG,QAAQ,CAACC,GAAD,CAA/C,EAAP;AACD,CAND;;AAQAC,OAAO,CAACI,SAAR,2CAAoB;EAClBT,GAAG,EAAEU,kBAAA,CAAUC,SAAV,CAAoB,CAACC,sBAAD,EAAcF,kBAAA,CAAUG,QAAV,CAAmBD,sBAAnB,CAAd,CAApB,CADa;EAElBR,GAAG,EAAEM,kBAAA,CAAUI;AAFG,CAApB;eAKeT,O"}
|
|
@@ -26,6 +26,7 @@ declare namespace DisciplineScope {
|
|
|
26
26
|
avatar: import("prop-types").Requireable<any>;
|
|
27
27
|
loading: import("prop-types").Requireable<boolean>;
|
|
28
28
|
value: import("prop-types").Requireable<string>;
|
|
29
|
+
profileAvatarAlt: import("prop-types").Requireable<string>;
|
|
29
30
|
title: import("prop-types").Requireable<string>;
|
|
30
31
|
onPost: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
31
32
|
onChange: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
@@ -27,6 +27,7 @@ declare namespace ForumComment {
|
|
|
27
27
|
}
|
|
28
28
|
namespace propTypes {
|
|
29
29
|
export const value: PropTypes.Requireable<string>;
|
|
30
|
+
export const profileAvatarAlt: PropTypes.Requireable<string>;
|
|
30
31
|
export { SrcPropType as avatar };
|
|
31
32
|
export const onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
32
33
|
export const onPost: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/molecule/forum/forum-comment/index.js"],"names":[],"mappings":";AASA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/molecule/forum/forum-comment/index.js"],"names":[],"mappings":";AASA,qEAuDC"}
|
|
@@ -35,14 +35,16 @@ const ForumComment = (props, context) => {
|
|
|
35
35
|
value,
|
|
36
36
|
textareaDisabled,
|
|
37
37
|
postDisabled,
|
|
38
|
-
newPost = false
|
|
38
|
+
newPost = false,
|
|
39
|
+
profileAvatarAlt
|
|
39
40
|
} = props;
|
|
40
41
|
const primary = (0, _get2.default)('common.primary', skin);
|
|
41
42
|
const light = (0, _get2.default)('common.light', skin);
|
|
42
43
|
const avatarView = avatar ? /*#__PURE__*/_react.default.createElement("div", {
|
|
43
44
|
className: _style.default.image
|
|
44
45
|
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
45
|
-
src: avatar
|
|
46
|
+
src: avatar,
|
|
47
|
+
alt: profileAvatarAlt
|
|
46
48
|
})) : null;
|
|
47
49
|
|
|
48
50
|
const button = /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -79,6 +81,7 @@ ForumComment.contextTypes = {
|
|
|
79
81
|
};
|
|
80
82
|
ForumComment.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
81
83
|
value: _propTypes.default.string,
|
|
84
|
+
profileAvatarAlt: _propTypes.default.string,
|
|
82
85
|
avatar: _proptypes.SrcPropType,
|
|
83
86
|
onChange: _propTypes.default.func,
|
|
84
87
|
onPost: _propTypes.default.func,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["ForumComment","props","context","translate","skin","avatar","onPost","onChange","value","textareaDisabled","postDisabled","newPost","primary","light","avatarView","style","image","button","post","backgroundColor","disabledButton","classnames","container","wrapper","comment","contextTypes","Provider","childContextTypes","propTypes","PropTypes","string","SrcPropType","func","bool"],"sources":["../../../../src/molecule/forum/forum-comment/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {get, noop} from 'lodash/fp';\nimport classnames from 'classnames';\nimport {SrcPropType} from '../../../util/proptypes';\nimport Provider from '../../../atom/provider';\nimport Button from '../../../atom/button';\nimport style from './style.css';\n\nconst ForumComment = (props, context) => {\n const {translate, skin} = context;\n const {avatar
|
|
1
|
+
{"version":3,"file":"index.js","names":["ForumComment","props","context","translate","skin","avatar","onPost","onChange","value","textareaDisabled","postDisabled","newPost","profileAvatarAlt","primary","light","avatarView","style","image","button","post","backgroundColor","disabledButton","classnames","container","wrapper","comment","contextTypes","Provider","childContextTypes","propTypes","PropTypes","string","SrcPropType","func","bool"],"sources":["../../../../src/molecule/forum/forum-comment/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {get, noop} from 'lodash/fp';\nimport classnames from 'classnames';\nimport {SrcPropType} from '../../../util/proptypes';\nimport Provider from '../../../atom/provider';\nimport Button from '../../../atom/button';\nimport style from './style.css';\n\nconst ForumComment = (props, context) => {\n const {translate, skin} = context;\n const {\n avatar,\n onPost,\n onChange,\n value,\n textareaDisabled,\n postDisabled,\n newPost = false,\n profileAvatarAlt\n } = props;\n const primary = get('common.primary', skin);\n const light = get('common.light', skin);\n\n const avatarView = avatar ? (\n <div className={style.image}>\n <img src={avatar} alt={profileAvatarAlt} />\n </div>\n ) : null;\n\n const button = (\n <div className={style.post}>\n <Button\n type=\"link\"\n onClick={!postDisabled ? onPost : noop}\n disabled={postDisabled}\n submitValue={translate('Post')}\n style={{\n backgroundColor: postDisabled ? light : primary\n }}\n className={postDisabled ? style.disabledButton : style.button}\n />\n </div>\n );\n\n return (\n <div\n data-name=\"forumComment\"\n className={classnames(style.container, newPost ? style.newPost : null)}\n >\n <div className={classnames(style.wrapper, newPost ? style.newPost : null)}>\n {avatarView}\n <div className={style.comment}>\n <textarea\n placeholder={translate('Write something here')}\n value={value}\n onChange={onChange}\n disabled={textareaDisabled}\n />\n </div>\n </div>\n {button}\n </div>\n );\n};\n\nForumComment.contextTypes = {\n translate: Provider.childContextTypes.translate,\n skin: Provider.childContextTypes.skin\n};\n\nForumComment.propTypes = {\n value: PropTypes.string,\n profileAvatarAlt: PropTypes.string,\n avatar: SrcPropType,\n onChange: PropTypes.func,\n onPost: PropTypes.func,\n newPost: PropTypes.bool,\n textareaDisabled: PropTypes.bool,\n postDisabled: PropTypes.bool\n};\nexport default ForumComment;\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,YAAY,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EACvC,MAAM;IAACC,SAAD;IAAYC;EAAZ,IAAoBF,OAA1B;EACA,MAAM;IACJG,MADI;IAEJC,MAFI;IAGJC,QAHI;IAIJC,KAJI;IAKJC,gBALI;IAMJC,YANI;IAOJC,OAAO,GAAG,KAPN;IAQJC;EARI,IASFX,KATJ;EAUA,MAAMY,OAAO,GAAG,mBAAI,gBAAJ,EAAsBT,IAAtB,CAAhB;EACA,MAAMU,KAAK,GAAG,mBAAI,cAAJ,EAAoBV,IAApB,CAAd;EAEA,MAAMW,UAAU,GAAGV,MAAM,gBACvB;IAAK,SAAS,EAAEW,cAAA,CAAMC;EAAtB,gBACE;IAAK,GAAG,EAAEZ,MAAV;IAAkB,GAAG,EAAEO;EAAvB,EADF,CADuB,GAIrB,IAJJ;;EAMA,MAAMM,MAAM,gBACV;IAAK,SAAS,EAAEF,cAAA,CAAMG;EAAtB,gBACE,6BAAC,eAAD;IACE,IAAI,EAAC,MADP;IAEE,OAAO,EAAE,CAACT,YAAD,GAAgBJ,MAAhB,iBAFX;IAGE,QAAQ,EAAEI,YAHZ;IAIE,WAAW,EAAEP,SAAS,CAAC,MAAD,CAJxB;IAKE,KAAK,EAAE;MACLiB,eAAe,EAAEV,YAAY,GAAGI,KAAH,GAAWD;IADnC,CALT;IAQE,SAAS,EAAEH,YAAY,GAAGM,cA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;
|
|
30
30
|
export const author: PropTypes.Requireable<string>;
|
|
31
|
+
export const avatarAlt: PropTypes.Requireable<string>;
|
|
32
|
+
export const profileAvatarAlt: PropTypes.Requireable<string>;
|
|
31
33
|
export const date: PropTypes.Requireable<string>;
|
|
32
34
|
export const message: PropTypes.Requireable<string>;
|
|
33
35
|
export { SrcPropType as avatar };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/molecule/forum/forum-post/index.js"],"names":[],"mappings":";AAUA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/molecule/forum/forum-post/index.js"],"names":[],"mappings":";AAUA,kEAgJC"}
|
|
@@ -34,6 +34,8 @@ const ForumPost = (props, context) => {
|
|
|
34
34
|
id,
|
|
35
35
|
author,
|
|
36
36
|
avatar,
|
|
37
|
+
avatarAlt,
|
|
38
|
+
profileAvatarAlt,
|
|
37
39
|
date,
|
|
38
40
|
message,
|
|
39
41
|
answer,
|
|
@@ -85,7 +87,8 @@ const ForumPost = (props, context) => {
|
|
|
85
87
|
className: _style.default.image
|
|
86
88
|
}, /*#__PURE__*/_react.default.createElement(_picture.default, {
|
|
87
89
|
src: avatar,
|
|
88
|
-
className: _style.default.avatar
|
|
90
|
+
className: _style.default.avatar,
|
|
91
|
+
alt: avatarAlt
|
|
89
92
|
})), /*#__PURE__*/_react.default.createElement("span", {
|
|
90
93
|
"data-name": "author",
|
|
91
94
|
className: _style.default.author
|
|
@@ -129,6 +132,7 @@ const ForumPost = (props, context) => {
|
|
|
129
132
|
className: `${_style.default.edition} ${showEditBox ? _style.default.visible : ''}`
|
|
130
133
|
}, /*#__PURE__*/_react.default.createElement(_forumComment.default, {
|
|
131
134
|
avatar: null,
|
|
135
|
+
profileAvatarAlt: profileAvatarAlt,
|
|
132
136
|
value: edition,
|
|
133
137
|
textareaDisabled: editionTextareaDisabled,
|
|
134
138
|
postDisabled: editionPostDisabled,
|
|
@@ -138,6 +142,7 @@ const ForumPost = (props, context) => {
|
|
|
138
142
|
className: `${_style.default.answer} ${showAnswerBox ? _style.default.visible : ''}`
|
|
139
143
|
}, /*#__PURE__*/_react.default.createElement(_forumComment.default, {
|
|
140
144
|
avatar: answerAvatar,
|
|
145
|
+
profileAvatarAlt: profileAvatarAlt,
|
|
141
146
|
textareaDisabled: answerTextareaDisabled,
|
|
142
147
|
postDisabled: answerPostDisabled,
|
|
143
148
|
value: answer,
|
|
@@ -153,6 +158,8 @@ ForumPost.contextTypes = {
|
|
|
153
158
|
ForumPost.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
154
159
|
id: _propTypes.default.string,
|
|
155
160
|
author: _propTypes.default.string,
|
|
161
|
+
avatarAlt: _propTypes.default.string,
|
|
162
|
+
profileAvatarAlt: _propTypes.default.string,
|
|
156
163
|
date: _propTypes.default.string,
|
|
157
164
|
message: _propTypes.default.string,
|
|
158
165
|
avatar: _proptypes.SrcPropType,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["ForumPost","props","context","translate","skin","id","author","avatar","date","message","answer","answerPostDisabled","answerTextareaDisabled","answerAvatar","answerable","editable","rejectable","mainPost","rejected","deleted","edition","editionPostDisabled","editionTextareaDisabled","showAnswerBox","showEditBox","onAnswer","onEdit","onPostAnswer","onPostEdition","onChangeAnswer","onChangeEdition","onModerate","onDelete","color","infoDeleted","answerLabel","editLabel","deleteLabel","rejectLabel","putBackLabel","messageClassName","style","deletedMessage","hiddenMessage","classnames","post","avatarWrapper","image","content","body","action","display","visible","contextTypes","Provider","childContextTypes","propTypes","PropTypes","string","SrcPropType","bool","func"],"sources":["../../../../src/molecule/forum/forum-post/index.js"],"sourcesContent":["import React from 'react';\nimport {get, identity} from 'lodash/fp';\nimport classnames from 'classnames';\nimport PropTypes from 'prop-types';\nimport {SrcPropType} from '../../../util/proptypes';\nimport Provider from '../../../atom/provider';\nimport Picture from '../../../atom/picture';\nimport ForumComment from '../forum-comment';\nimport style from './style.css';\n\nconst ForumPost = (props, context) => {\n const {translate, skin} = context;\n const {\n id,\n author,\n avatar,\n date,\n message,\n answer,\n answerPostDisabled = false,\n answerTextareaDisabled = false,\n answerAvatar,\n answerable = true,\n editable = false,\n rejectable = false,\n mainPost = false,\n rejected = false,\n deleted = false,\n edition,\n editionPostDisabled = false,\n editionTextareaDisabled = false,\n showAnswerBox = false,\n showEditBox = false,\n onAnswer = identity,\n onEdit = identity,\n onPostAnswer = identity,\n onPostEdition = identity,\n onChangeAnswer = identity,\n onChangeEdition = identity,\n onModerate,\n onDelete\n } = props;\n const color = get('common.primary', skin);\n\n const infoDeleted = translate('This message has been removed by its author');\n const answerLabel = translate('Answer');\n const editLabel = translate('Edit');\n const deleteLabel = translate('Delete');\n const rejectLabel = translate('Reject');\n const putBackLabel = translate('Put back');\n\n let messageClassName = style.message;\n if (deleted) {\n messageClassName = style.deletedMessage;\n } else if (showEditBox) {\n messageClassName = style.hiddenMessage;\n }\n\n return (\n <div\n data-name=\"forumPost\"\n id={`forum-post-${id || 'to-be-posted'}`}\n className={classnames(\n mainPost ? style.mainPost : null,\n rejected ? style.rejected : style.post\n )}\n >\n <div className={style.avatarWrapper}>\n <div className={style.image}>\n <Picture src={avatar} className={style.avatar} />\n </div>\n <span data-name=\"author\" className={style.author}>\n {author}\n </span>\n </div>\n <div className={style.content}>\n <div>\n <span className={style.date}>{date}</span>\n </div>\n <div className={style.body}>\n <span\n className={style.action}\n onClick={onAnswer}\n style={{\n color,\n display: answerable && !deleted && !rejected ? 'block' : 'none'\n }}\n >\n {answerLabel}\n </span>\n\n <span\n className={style.action}\n onClick={onEdit}\n style={{\n color,\n display: editable ? 'block' : 'none'\n }}\n >\n {editLabel}\n </span>\n\n <span\n className={style.action}\n onClick={onDelete}\n style={{\n color,\n display: editable ? 'block' : 'none'\n }}\n >\n {deleteLabel}\n </span>\n\n <span\n className={style.action}\n onClick={onModerate}\n style={{\n color,\n display: rejectable ? 'block' : 'none'\n }}\n >\n {rejected ? putBackLabel : rejectLabel}\n </span>\n\n <div className={messageClassName}>{deleted ? infoDeleted : message}</div>\n\n <div className={`${style.edition} ${showEditBox ? style.visible : ''}`}>\n <ForumComment\n avatar={null}\n value={edition}\n textareaDisabled={editionTextareaDisabled}\n postDisabled={editionPostDisabled}\n onPost={onPostEdition}\n onChange={onChangeEdition}\n />\n </div>\n\n <div className={`${style.answer} ${showAnswerBox ? style.visible : ''}`}>\n <ForumComment\n avatar={answerAvatar}\n textareaDisabled={answerTextareaDisabled}\n postDisabled={answerPostDisabled}\n value={answer}\n onPost={onPostAnswer}\n onChange={onChangeAnswer}\n />\n </div>\n </div>\n </div>\n </div>\n );\n};\n\nForumPost.contextTypes = {\n translate: Provider.childContextTypes.translate,\n skin: Provider.childContextTypes.skin\n};\n\nForumPost.propTypes = {\n id: PropTypes.string,\n author: PropTypes.string,\n date: PropTypes.string,\n message: PropTypes.string,\n avatar: SrcPropType,\n answerAvatar: SrcPropType,\n answer: PropTypes.string,\n edition: PropTypes.string,\n showAnswerBox: PropTypes.bool,\n showEditBox: PropTypes.bool,\n mainPost: PropTypes.bool,\n onAnswer: PropTypes.func,\n onEdit: PropTypes.func,\n onPostAnswer: PropTypes.func,\n onPostEdition: PropTypes.func,\n onChangeAnswer: PropTypes.func,\n onChangeEdition: PropTypes.func,\n onModerate: PropTypes.func,\n onDelete: PropTypes.func,\n answerPostDisabled: PropTypes.bool,\n answerTextareaDisabled: PropTypes.bool,\n answerable: PropTypes.bool,\n editable: PropTypes.bool,\n rejectable: PropTypes.bool,\n rejected: PropTypes.bool,\n deleted: PropTypes.bool,\n editionPostDisabled: PropTypes.bool,\n editionTextareaDisabled: PropTypes.bool\n};\n\nexport default ForumPost;\n"],"mappings":";;;;;;;;;AAAA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,SAAS,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EACpC,MAAM;IAACC,SAAD;IAAYC;EAA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
|
|
1
|
+
{"version":3,"file":"index.js","names":["ForumPost","props","context","translate","skin","id","author","avatar","avatarAlt","profileAvatarAlt","date","message","answer","answerPostDisabled","answerTextareaDisabled","answerAvatar","answerable","editable","rejectable","mainPost","rejected","deleted","edition","editionPostDisabled","editionTextareaDisabled","showAnswerBox","showEditBox","onAnswer","onEdit","onPostAnswer","onPostEdition","onChangeAnswer","onChangeEdition","onModerate","onDelete","color","infoDeleted","answerLabel","editLabel","deleteLabel","rejectLabel","putBackLabel","messageClassName","style","deletedMessage","hiddenMessage","classnames","post","avatarWrapper","image","content","body","action","display","visible","contextTypes","Provider","childContextTypes","propTypes","PropTypes","string","SrcPropType","bool","func"],"sources":["../../../../src/molecule/forum/forum-post/index.js"],"sourcesContent":["import React from 'react';\nimport {get, identity} from 'lodash/fp';\nimport classnames from 'classnames';\nimport PropTypes from 'prop-types';\nimport {SrcPropType} from '../../../util/proptypes';\nimport Provider from '../../../atom/provider';\nimport Picture from '../../../atom/picture';\nimport ForumComment from '../forum-comment';\nimport style from './style.css';\n\nconst ForumPost = (props, context) => {\n const {translate, skin} = context;\n const {\n id,\n author,\n avatar,\n avatarAlt,\n profileAvatarAlt,\n date,\n message,\n answer,\n answerPostDisabled = false,\n answerTextareaDisabled = false,\n answerAvatar,\n answerable = true,\n editable = false,\n rejectable = false,\n mainPost = false,\n rejected = false,\n deleted = false,\n edition,\n editionPostDisabled = false,\n editionTextareaDisabled = false,\n showAnswerBox = false,\n showEditBox = false,\n onAnswer = identity,\n onEdit = identity,\n onPostAnswer = identity,\n onPostEdition = identity,\n onChangeAnswer = identity,\n onChangeEdition = identity,\n onModerate,\n onDelete\n } = props;\n const color = get('common.primary', skin);\n\n const infoDeleted = translate('This message has been removed by its author');\n const answerLabel = translate('Answer');\n const editLabel = translate('Edit');\n const deleteLabel = translate('Delete');\n const rejectLabel = translate('Reject');\n const putBackLabel = translate('Put back');\n let messageClassName = style.message;\n if (deleted) {\n messageClassName = style.deletedMessage;\n } else if (showEditBox) {\n messageClassName = style.hiddenMessage;\n }\n\n return (\n <div\n data-name=\"forumPost\"\n id={`forum-post-${id || 'to-be-posted'}`}\n className={classnames(\n mainPost ? style.mainPost : null,\n rejected ? style.rejected : style.post\n )}\n >\n <div className={style.avatarWrapper}>\n <div className={style.image}>\n <Picture src={avatar} className={style.avatar} alt={avatarAlt} />\n </div>\n <span data-name=\"author\" className={style.author}>\n {author}\n </span>\n </div>\n <div className={style.content}>\n <div>\n <span className={style.date}>{date}</span>\n </div>\n <div className={style.body}>\n <span\n className={style.action}\n onClick={onAnswer}\n style={{\n color,\n display: answerable && !deleted && !rejected ? 'block' : 'none'\n }}\n >\n {answerLabel}\n </span>\n\n <span\n className={style.action}\n onClick={onEdit}\n style={{\n color,\n display: editable ? 'block' : 'none'\n }}\n >\n {editLabel}\n </span>\n\n <span\n className={style.action}\n onClick={onDelete}\n style={{\n color,\n display: editable ? 'block' : 'none'\n }}\n >\n {deleteLabel}\n </span>\n\n <span\n className={style.action}\n onClick={onModerate}\n style={{\n color,\n display: rejectable ? 'block' : 'none'\n }}\n >\n {rejected ? putBackLabel : rejectLabel}\n </span>\n\n <div className={messageClassName}>{deleted ? infoDeleted : message}</div>\n\n <div className={`${style.edition} ${showEditBox ? style.visible : ''}`}>\n <ForumComment\n avatar={null}\n profileAvatarAlt={profileAvatarAlt}\n value={edition}\n textareaDisabled={editionTextareaDisabled}\n postDisabled={editionPostDisabled}\n onPost={onPostEdition}\n onChange={onChangeEdition}\n />\n </div>\n\n <div className={`${style.answer} ${showAnswerBox ? style.visible : ''}`}>\n <ForumComment\n avatar={answerAvatar}\n profileAvatarAlt={profileAvatarAlt}\n textareaDisabled={answerTextareaDisabled}\n postDisabled={answerPostDisabled}\n value={answer}\n onPost={onPostAnswer}\n onChange={onChangeAnswer}\n />\n </div>\n </div>\n </div>\n </div>\n );\n};\n\nForumPost.contextTypes = {\n translate: Provider.childContextTypes.translate,\n skin: Provider.childContextTypes.skin\n};\n\nForumPost.propTypes = {\n id: PropTypes.string,\n author: PropTypes.string,\n avatarAlt: PropTypes.string,\n profileAvatarAlt: PropTypes.string,\n date: PropTypes.string,\n message: PropTypes.string,\n avatar: SrcPropType,\n answerAvatar: SrcPropType,\n answer: PropTypes.string,\n edition: PropTypes.string,\n showAnswerBox: PropTypes.bool,\n showEditBox: PropTypes.bool,\n mainPost: PropTypes.bool,\n onAnswer: PropTypes.func,\n onEdit: PropTypes.func,\n onPostAnswer: PropTypes.func,\n onPostEdition: PropTypes.func,\n onChangeAnswer: PropTypes.func,\n onChangeEdition: PropTypes.func,\n onModerate: PropTypes.func,\n onDelete: PropTypes.func,\n answerPostDisabled: PropTypes.bool,\n answerTextareaDisabled: PropTypes.bool,\n answerable: PropTypes.bool,\n editable: PropTypes.bool,\n rejectable: PropTypes.bool,\n rejected: PropTypes.bool,\n deleted: PropTypes.bool,\n editionPostDisabled: PropTypes.bool,\n editionTextareaDisabled: PropTypes.bool\n};\n\nexport default ForumPost;\n"],"mappings":";;;;;;;;;AAAA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,SAAS,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EACpC,MAAM;IAACC,SAAD;IAAYC;EAAZ,IAAoBF,OAA1B;EACA,MAAM;IACJG,EADI;IAEJC,MAFI;IAGJC,MAHI;IAIJC,SAJI;IAKJC,gBALI;IAMJC,IANI;IAOJC,OAPI;IAQJC,MARI;IASJC,kBAAkB,GAAG,KATjB;IAUJC,sBAAsB,GAAG,KAVrB;IAWJC,YAXI;IAYJC,UAAU,GAAG,IAZT;IAaJC,QAAQ,GAAG,KAbP;IAcJC,UAAU,GAAG,KAdT;IAeJC,QAAQ,GAAG,KAfP;IAgBJC,QAAQ,GAAG,KAhBP;IAiBJC,OAAO,GAAG,KAjBN;IAkBJC,OAlBI;IAmBJC,mBAAmB,GAAG,KAnBlB;IAoBJC,uBAAuB,GAAG,KApBtB;IAqBJC,aAAa,GAAG,KArBZ;IA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qC,kBAAA,CAAUC,MAVC;EAWpBnC,aAAa,EAAEkC,kBAAA,CAAUG,IAXL;EAYpBpC,WAAW,EAAEiC,kBAAA,CAAUG,IAZH;EAapB3C,QAAQ,EAAEwC,kBAAA,CAAUG,IAbA;EAcpBnC,QAAQ,EAAEgC,kBAAA,CAAUI,IAdA;EAepBnC,MAAM,EAAE+B,kBAAA,CAAUI,IAfE;EAgBpBlC,YAAY,EAAE8B,kBAAA,CAAUI,IAhBJ;EAiBpBjC,aAAa,EAAE6B,kBAAA,CAAUI,IAjBL;EAkBpBhC,cAAc,EAAE4B,kBAAA,CAAUI,IAlBN;EAmBpB/B,eAAe,EAAE2B,kBAAA,CAAUI,IAnBP;EAoBpB9B,UAAU,EAAE0B,kBAAA,CAAUI,IApBF;EAqBpB7B,QAAQ,EAAEyB,kBAAA,CAAUI,IArBA;EAsBpBlD,kBAAkB,EAAE8C,kBAAA,CAAUG,IAtBV;EAuBpBhD,sBAAsB,EAAE6C,kBAAA,CAAUG,IAvBd;EAwBpB9C,UAAU,EAAE2C,kBAAA,CAAUG,IAxBF;EAyBpB7C,QAAQ,EAAE0C,kBAAA,CAAUG,IAzBA;EA0BpB5C,UAAU,EAAEyC,kBAAA,CAAUG,IA1BF;EA2BpB1C,QAAQ,EAAEuC,kBAAA,CAAUG,IA3BA;EA4BpBzC,OAAO,EAAEsC,kBAAA,CAAUG,IA5BC;EA6BpBvC,mBAAmB,EAAEoC,kBAAA,CAAUG,IA7BX;EA8BpBtC,uBAAuB,EAAEmC,kBAAA,CAAUG;AA9Bf,CAAtB;eAiCe9D,S"}
|
|
@@ -47,6 +47,7 @@ declare namespace ScopeContent {
|
|
|
47
47
|
avatar: PropTypes.Requireable<any>;
|
|
48
48
|
loading: PropTypes.Requireable<boolean>;
|
|
49
49
|
value: PropTypes.Requireable<string>;
|
|
50
|
+
profileAvatarAlt: PropTypes.Requireable<string>;
|
|
50
51
|
title: PropTypes.Requireable<string>;
|
|
51
52
|
onPost: PropTypes.Requireable<(...args: any[]) => any>;
|
|
52
53
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -5,6 +5,7 @@ declare namespace Discussion {
|
|
|
5
5
|
export { SrcPropType as avatar };
|
|
6
6
|
export const loading: PropTypes.Requireable<boolean>;
|
|
7
7
|
export const value: PropTypes.Requireable<string>;
|
|
8
|
+
export const profileAvatarAlt: PropTypes.Requireable<string>;
|
|
8
9
|
export const title: PropTypes.Requireable<string>;
|
|
9
10
|
export const onPost: PropTypes.Requireable<(...args: any[]) => any>;
|
|
10
11
|
export const onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/discussion/index.js"],"names":[],"mappings":";AAUA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/discussion/index.js"],"names":[],"mappings":";AAUA,qDAmDC"}
|
|
@@ -37,7 +37,8 @@ function Discussion(props) {
|
|
|
37
37
|
hideComments,
|
|
38
38
|
textareaDisabled,
|
|
39
39
|
postDisabled,
|
|
40
|
-
className
|
|
40
|
+
className,
|
|
41
|
+
profileAvatarAlt
|
|
41
42
|
} = props;
|
|
42
43
|
const threadsView = threads.map(thread => /*#__PURE__*/_react.default.createElement(_forumThread.default, _extends({}, thread, {
|
|
43
44
|
key: thread.id,
|
|
@@ -46,6 +47,7 @@ function Discussion(props) {
|
|
|
46
47
|
const commentView = !hideComments ? /*#__PURE__*/_react.default.createElement(_forumComment.default, {
|
|
47
48
|
avatar: avatar,
|
|
48
49
|
value: value,
|
|
50
|
+
profileAvatarAlt: profileAvatarAlt,
|
|
49
51
|
newPost: true,
|
|
50
52
|
onPost: onPost,
|
|
51
53
|
onChange: onChange,
|
|
@@ -73,6 +75,7 @@ Discussion.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
73
75
|
avatar: _proptypes.SrcPropType,
|
|
74
76
|
loading: _propTypes.default.bool,
|
|
75
77
|
value: _propTypes.default.string,
|
|
78
|
+
profileAvatarAlt: _propTypes.default.string,
|
|
76
79
|
title: _propTypes.default.string,
|
|
77
80
|
onPost: _propTypes.default.func,
|
|
78
81
|
onChange: _propTypes.default.func,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["Discussion","props","threads","title","avatar","value","loading","onPost","onChange","hideComments","textareaDisabled","postDisabled","className","threadsView","map","thread","id","commentView","loader","style","classnames","header","__html","propTypes","SrcPropType","PropTypes","bool","string","func","arrayOf","shape","postConditions"],"sources":["../../../src/organism/discussion/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {SrcPropType} from '../../util/proptypes';\nimport ForumComment from '../../molecule/forum/forum-comment';\nimport ForumThread from '../../molecule/forum/forum-thread';\nimport postConditions from '../../molecule/forum/post-conditions';\nimport Loader from '../../atom/loader';\nimport style from './style.css';\n\nfunction Discussion(props) {\n const {\n threads = [],\n title,\n avatar,\n value,\n loading,\n onPost,\n onChange,\n hideComments,\n textareaDisabled,\n postDisabled,\n className\n } = props;\n\n const threadsView = threads.map(thread => <ForumThread {...thread} key={thread.id} mainPost />);\n\n const commentView = !hideComments ? (\n <ForumComment\n avatar={avatar}\n value={value}\n newPost\n onPost={onPost}\n onChange={onChange}\n textareaDisabled={textareaDisabled}\n postDisabled={postDisabled}\n />\n ) : null;\n\n const loader = loading ? (\n <div className={style.loader}>\n <Loader />\n </div>\n ) : null;\n\n return (\n <div data-name=\"discussion\" className={classnames(style.thread, className)}>\n <div className={style.header}>\n <h1\n id=\"forum-discussion\"\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n {commentView}\n </div>\n {threadsView}\n {loader}\n </div>\n );\n}\nDiscussion.propTypes = {\n avatar: SrcPropType,\n loading: PropTypes.bool,\n value: PropTypes.string,\n title: PropTypes.string,\n onPost: PropTypes.func,\n onChange: PropTypes.func,\n threads: PropTypes.arrayOf(PropTypes.shape(postConditions)),\n textareaDisabled: PropTypes.bool,\n postDisabled: PropTypes.bool,\n className: PropTypes.string,\n hideComments: PropTypes.bool\n};\n\nexport default Discussion;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,SAASA,UAAT,CAAoBC,KAApB,EAA2B;EACzB,MAAM;IACJC,OAAO,GAAG,EADN;IAEJC,KAFI;IAGJC,MAHI;IAIJC,KAJI;IAKJC,OALI;IAMJC,MANI;IAOJC,QAPI;IAQJC,YARI;IASJC,gBATI;IAUJC,YAVI;IAWJC;
|
|
1
|
+
{"version":3,"file":"index.js","names":["Discussion","props","threads","title","avatar","value","loading","onPost","onChange","hideComments","textareaDisabled","postDisabled","className","profileAvatarAlt","threadsView","map","thread","id","commentView","loader","style","classnames","header","__html","propTypes","SrcPropType","PropTypes","bool","string","func","arrayOf","shape","postConditions"],"sources":["../../../src/organism/discussion/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {SrcPropType} from '../../util/proptypes';\nimport ForumComment from '../../molecule/forum/forum-comment';\nimport ForumThread from '../../molecule/forum/forum-thread';\nimport postConditions from '../../molecule/forum/post-conditions';\nimport Loader from '../../atom/loader';\nimport style from './style.css';\n\nfunction Discussion(props) {\n const {\n threads = [],\n title,\n avatar,\n value,\n loading,\n onPost,\n onChange,\n hideComments,\n textareaDisabled,\n postDisabled,\n className,\n profileAvatarAlt\n } = props;\n\n const threadsView = threads.map(thread => <ForumThread {...thread} key={thread.id} mainPost />);\n\n const commentView = !hideComments ? (\n <ForumComment\n avatar={avatar}\n value={value}\n profileAvatarAlt={profileAvatarAlt}\n newPost\n onPost={onPost}\n onChange={onChange}\n textareaDisabled={textareaDisabled}\n postDisabled={postDisabled}\n />\n ) : null;\n\n const loader = loading ? (\n <div className={style.loader}>\n <Loader />\n </div>\n ) : null;\n\n return (\n <div data-name=\"discussion\" className={classnames(style.thread, className)}>\n <div className={style.header}>\n <h1\n id=\"forum-discussion\"\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n {commentView}\n </div>\n {threadsView}\n {loader}\n </div>\n );\n}\nDiscussion.propTypes = {\n avatar: SrcPropType,\n loading: PropTypes.bool,\n value: PropTypes.string,\n profileAvatarAlt: PropTypes.string,\n title: PropTypes.string,\n onPost: PropTypes.func,\n onChange: PropTypes.func,\n threads: PropTypes.arrayOf(PropTypes.shape(postConditions)),\n textareaDisabled: PropTypes.bool,\n postDisabled: PropTypes.bool,\n className: PropTypes.string,\n hideComments: PropTypes.bool\n};\n\nexport default Discussion;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,SAASA,UAAT,CAAoBC,KAApB,EAA2B;EACzB,MAAM;IACJC,OAAO,GAAG,EADN;IAEJC,KAFI;IAGJC,MAHI;IAIJC,KAJI;IAKJC,OALI;IAMJC,MANI;IAOJC,QAPI;IAQJC,YARI;IASJC,gBATI;IAUJC,YAVI;IAWJC,SAXI;IAYJC;EAZI,IAaFZ,KAbJ;EAeA,MAAMa,WAAW,GAAGZ,OAAO,CAACa,GAAR,CAAYC,MAAM,iBAAI,6BAAC,oBAAD,eAAiBA,MAAjB;IAAyB,GAAG,EAAEA,MAAM,CAACC,EAArC;IAAyC,QAAQ;EAAjD,GAAtB,CAApB;EAEA,MAAMC,WAAW,GAAG,CAACT,YAAD,gBAClB,6BAAC,qBAAD;IACE,MAAM,EAAEL,MADV;IAEE,KAAK,EAAEC,KAFT;IAGE,gBAAgB,EAAEQ,gBAHpB;IAIE,OAAO,MAJT;IAKE,MAAM,EAAEN,MALV;IAME,QAAQ,EAAEC,QANZ;IAOE,gBAAgB,EAAEE,gBAPpB;IAQE,YAAY,EAAEC;EARhB,EADkB,GAWhB,IAXJ;EAaA,MAAMQ,MAAM,GAAGb,OAAO,gBACpB;IAAK,SAAS,EAAEc,cAAA,CAAMD;EAAtB,gBACE,6BAAC,eAAD,OADF,CADoB,GAIlB,IAJJ;EAMA,oBACE;IAAK,aAAU,YAAf;IAA4B,SAAS,EAAE,IAAAE,mBAAA,EAAWD,cAAA,CAAMJ,MAAjB,EAAyBJ,SAAzB;EAAvC,gBACE;IAAK,SAAS,EAAEQ,cAAA,CAAME;EAAtB,gBACE;IACE,EAAE,EAAC,kBADL,CAEE;IAFF;IAGE,uBAAuB,EAAE;MAACC,MAAM,EAAEpB;IAAT;EAH3B,EADF,EAMGe,WANH,CADF,EASGJ,WATH,EAUGK,MAVH,CADF;AAcD;;AACDnB,UAAU,CAACwB,SAAX,2CAAuB;EACrBpB,MAAM,EAAEqB,sBADa;EAErBnB,OAAO,EAAEoB,kBAAA,CAAUC,IAFE;EAGrBtB,KAAK,EAAEqB,kBAAA,CAAUE,MAHI;EAIrBf,gBAAgB,EAAEa,kBAAA,CAAUE,MAJP;EAKrBzB,KAAK,EAAEuB,kBAAA,CAAUE,MALI;EAMrBrB,MAAM,EAAEmB,kBAAA,CAAUG,IANG;EAOrBrB,QAAQ,EAAEkB,kBAAA,CAAUG,IAPC;EAQrB3B,OAAO,EAAEwB,kBAAA,CAAUI,OAAV,CAAkBJ,kBAAA,CAAUK,KAAV,CAAgBC,uBAAhB,CAAlB,CARY;EASrBtB,gBAAgB,EAAEgB,kBAAA,CAAUC,IATP;EAUrBhB,YAAY,EAAEe,kBAAA,CAAUC,IAVH;EAWrBf,SAAS,EAAEc,kBAAA,CAAUE,MAXA;EAYrBnB,YAAY,EAAEiB,kBAAA,CAAUC;AAZH,CAAvB;eAee3B,U"}
|
|
@@ -167,6 +167,7 @@ const createSlideStyle = (num, screenWidth) => {
|
|
|
167
167
|
|
|
168
168
|
const Slide = props => {
|
|
169
169
|
const {
|
|
170
|
+
animatedStyle,
|
|
170
171
|
slide,
|
|
171
172
|
correctionPopinProps,
|
|
172
173
|
validateButton,
|
|
@@ -187,14 +188,16 @@ const Slide = props => {
|
|
|
187
188
|
} = slide;
|
|
188
189
|
|
|
189
190
|
if (loading) {
|
|
190
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
191
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
192
|
+
style: slideStyle.slide
|
|
193
|
+
});
|
|
191
194
|
}
|
|
192
195
|
|
|
193
196
|
const {
|
|
194
197
|
onClick: handleValidatePress
|
|
195
198
|
} = validateButton;
|
|
196
|
-
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
197
|
-
style: slideStyle.slide
|
|
199
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, {
|
|
200
|
+
style: [slideStyle.slide, animatedStyle]
|
|
198
201
|
}, /*#__PURE__*/_react.default.createElement(Question, {
|
|
199
202
|
questionOrigin: parentContentTitle,
|
|
200
203
|
questionText: questionText,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["styles","StyleSheet","create","correctionPopinWrapper","position","bottom","width","CorrectionPopin","correctionPopinProps","slideIndex","showCorrectionPopin","animateCorrectionPopin","translateUp","useTranslateY","fromValue","toValue","duration","easing","Easing","bezier","useEffect","start","klf","getOr","undefined","information","label","message","next","get","onClick","_correctionPopinProps","type","resultLabel","style","animatedStyle","createQuestionStyle","theme","questionHeading","justifyContent","questionOrigin","fontSize","lineHeight","color","colors","text","primary","marginBottom","spacing","tiny","marginTop","small","textAlign","questionText","fontWeight","questionHelp","gray","medium","choicesContainer","flex","Question","props","answerUI","useTemplateContext","setStyle","useState","questionStyle","createSlideStyle","num","screenWidth","slideWidth","slide","left","backgroundColor","height","alignItems","padding","shadowColor","shadowOffset","shadowOpacity","shadowRadius","elevation","borderRadius","Slide","validateButton","useWindowDimensions","slideStyle","loading","parentContentTitle","handleValidatePress","disabled"],"sources":["../../../src/organism/review-slide/index.native.tsx"],"sourcesContent":["import React, {useEffect, useState} from 'react';\nimport {\n Animated,\n Easing,\n StyleSheet,\n TextStyle,\n useWindowDimensions,\n View,\n ViewStyle\n} from 'react-native';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport {useTranslateY} from '@coorpacademy/react-native-animation';\nimport Text from '../../atom/text/index.native';\nimport Answer from '../../molecule/answer/index.native';\nimport ReviewCorrectionPopin from '../../molecule/review-correction-popin/index.native';\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {Theme} from '../../variables/theme.native';\nimport Button from '../../atom/button/index.native';\nimport {PopinProps, ReviewSlideProps, SlideProps} from './prop-types';\n\nconst styles = StyleSheet.create({\n correctionPopinWrapper: {\n position: 'absolute',\n bottom: 16,\n width: '105%'\n }\n});\n\nconst CorrectionPopin = ({\n correctionPopinProps,\n slideIndex,\n showCorrectionPopin,\n animateCorrectionPopin\n}: PopinProps) => {\n const translateUp = useTranslateY({\n fromValue: 1000,\n toValue: 0,\n duration: 800,\n easing: Easing.bezier(0.37, 0, 0.63, 1)\n });\n\n useEffect(() => translateUp.start(), []);\n\n if (!showCorrectionPopin) return null;\n\n const klf = getOr(undefined, 'klf', correctionPopinProps);\n const information = getOr({label: '', message: ''}, 'information', correctionPopinProps);\n const next = get('next', correctionPopinProps);\n const onClick = get(['next', 'onClick'], correctionPopinProps);\n\n const _correctionPopinProps = {\n next: {\n onClick,\n label: next && next.label,\n 'data-name': `next-question-button-${slideIndex}`,\n 'aria-label': next && next['aria-label']\n },\n klf,\n information,\n type: correctionPopinProps.type,\n resultLabel: correctionPopinProps.resultLabel\n };\n\n const style = animateCorrectionPopin\n ? [styles.correctionPopinWrapper, translateUp.animatedStyle]\n : styles.correctionPopinWrapper;\n\n return (\n <Animated.View style={style}>\n <ReviewCorrectionPopin {..._correctionPopinProps} />\n </Animated.View>\n );\n};\n\ntype StyleSheetType = {\n questionHeading: ViewStyle;\n questionOrigin: ViewStyle;\n questionText: TextStyle;\n questionHelp: ViewStyle;\n choicesContainer: ViewStyle;\n};\n\nconst createQuestionStyle = (theme: Theme): StyleSheetType =>\n StyleSheet.create({\n questionHeading: {\n justifyContent: 'space-between'\n },\n questionOrigin: {\n fontSize: 12,\n lineHeight: 16,\n color: theme.colors.text.primary,\n marginBottom: theme.spacing.tiny,\n marginTop: theme.spacing.small,\n textAlign: 'center'\n },\n questionText: {\n fontSize: 16,\n lineHeight: 22,\n fontWeight: '700',\n color: theme.colors.text.primary,\n textAlign: 'center'\n },\n questionHelp: {\n fontSize: 12,\n lineHeight: 16,\n color: theme.colors.gray.medium,\n marginBottom: 0,\n marginTop: theme.spacing.small,\n textAlign: 'center'\n },\n choicesContainer: {\n flex: 1,\n width: '100%',\n justifyContent: 'center'\n }\n });\n\ntype QuestionProps = {\n answerUI: SlideProps['answerUI'];\n questionText: SlideProps['questionText'];\n questionOrigin: SlideProps['parentContentTitle'];\n};\n\nconst Question = (props: QuestionProps) => {\n const {answerUI, questionText, questionOrigin} = props;\n const {theme} = useTemplateContext();\n const [style, setStyle] = useState<StyleSheetType>();\n\n useEffect(() => {\n const questionStyle = createQuestionStyle(theme);\n setStyle(questionStyle);\n }, [theme]);\n\n if (!answerUI || !questionText || !style) return null;\n\n return (\n <>\n <View style={style.questionHeading}>\n <Text style={style.questionOrigin}>{questionOrigin}</Text>\n <Text style={style.questionText}>{questionText}</Text>\n <Text style={style.questionHelp}>{get('help', answerUI)}</Text>\n </View>\n <View style={style.choicesContainer}>\n <Answer {...answerUI} />\n </View>\n </>\n );\n};\n\ntype SlideStyle = {\n slide: ViewStyle;\n};\n\nconst createSlideStyle = (num: number, screenWidth: number): SlideStyle => {\n const slideWidth = screenWidth - 40 - num * 8;\n\n return StyleSheet.create({\n slide: {\n position: 'absolute',\n left: 20 + num * 4,\n bottom: 34 + num * 5,\n backgroundColor: '#fff', // theme.colors.white\n height: '90%',\n width: slideWidth,\n justifyContent: 'space-between',\n alignItems: 'center',\n padding: 25,\n shadowColor: '#000',\n shadowOffset: {width: 0, height: -1},\n shadowOpacity: 0.05,\n shadowRadius: 16,\n elevation: 10 - num * 1,\n borderRadius: 16\n }\n });\n};\n\nconst Slide = (props: ReviewSlideProps) => {\n const {slide, correctionPopinProps, validateButton, num, slideIndex = '0'} = props;\n\n const {width} = useWindowDimensions();\n const slideStyle = createSlideStyle(num, width);\n\n const {\n loading,\n parentContentTitle,\n questionText,\n answerUI,\n showCorrectionPopin,\n animateCorrectionPopin\n } = slide;\n\n if (loading) {\n return <Text>@todo loader {num}</Text>;\n }\n\n const {onClick: handleValidatePress} = validateButton;\n\n return (\n <View style={slideStyle.slide}>\n <Question\n questionOrigin={parentContentTitle}\n questionText={questionText}\n answerUI={answerUI}\n key=\"question-container\"\n />\n <Button\n disabled={validateButton.disabled}\n submitValue={validateButton.label}\n onPress={handleValidatePress}\n testID={`slide-validate-button-${slideIndex}`}\n />\n {correctionPopinProps ? (\n <CorrectionPopin\n correctionPopinProps={correctionPopinProps}\n slideIndex={slideIndex}\n showCorrectionPopin={showCorrectionPopin}\n animateCorrectionPopin={animateCorrectionPopin}\n key=\"correction-popin\"\n />\n ) : null}\n </View>\n );\n};\n\nexport default Slide;\n"],"mappings":";;;;;AAAA;;AACA;;AASA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;;;;;;;AAGA,MAAMA,MAAM,GAAGC,uBAAA,CAAWC,MAAX,CAAkB;EAC/BC,sBAAsB,EAAE;IACtBC,QAAQ,EAAE,UADY;IAEtBC,MAAM,EAAE,EAFc;IAGtBC,KAAK,EAAE;EAHe;AADO,CAAlB,CAAf;;AAQA,MAAMC,eAAe,GAAG,CAAC;EACvBC,oBADuB;EAEvBC,UAFuB;EAGvBC,mBAHuB;EAIvBC;AAJuB,CAAD,KAKN;EAChB,MAAMC,WAAW,GAAG,IAAAC,mCAAA,EAAc;IAChCC,SAAS,EAAE,IADqB;IAEhCC,OAAO,EAAE,CAFuB;IAGhCC,QAAQ,EAAE,GAHsB;IAIhCC,MAAM,EAAEC,mBAAA,CAAOC,MAAP,CAAc,IAAd,EAAoB,CAApB,EAAuB,IAAvB,EAA6B,CAA7B;EA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3,"file":"index.native.js","names":["styles","StyleSheet","create","correctionPopinWrapper","position","bottom","width","CorrectionPopin","correctionPopinProps","slideIndex","showCorrectionPopin","animateCorrectionPopin","translateUp","useTranslateY","fromValue","toValue","duration","easing","Easing","bezier","useEffect","start","klf","getOr","undefined","information","label","message","next","get","onClick","_correctionPopinProps","type","resultLabel","style","animatedStyle","createQuestionStyle","theme","questionHeading","justifyContent","questionOrigin","fontSize","lineHeight","color","colors","text","primary","marginBottom","spacing","tiny","marginTop","small","textAlign","questionText","fontWeight","questionHelp","gray","medium","choicesContainer","flex","Question","props","answerUI","useTemplateContext","setStyle","useState","questionStyle","createSlideStyle","num","screenWidth","slideWidth","slide","left","backgroundColor","height","alignItems","padding","shadowColor","shadowOffset","shadowOpacity","shadowRadius","elevation","borderRadius","Slide","validateButton","useWindowDimensions","slideStyle","loading","parentContentTitle","handleValidatePress","disabled"],"sources":["../../../src/organism/review-slide/index.native.tsx"],"sourcesContent":["import React, {useEffect, useState} from 'react';\nimport {\n Animated,\n Easing,\n StyleSheet,\n TextStyle,\n useWindowDimensions,\n View,\n ViewStyle\n} from 'react-native';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport {useTranslateY} from '@coorpacademy/react-native-animation';\nimport Text from '../../atom/text/index.native';\nimport Answer from '../../molecule/answer/index.native';\nimport ReviewCorrectionPopin from '../../molecule/review-correction-popin/index.native';\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {Theme} from '../../variables/theme.native';\nimport Button from '../../atom/button/index.native';\nimport {PopinProps, ReviewSlideProps, SlideProps} from './prop-types';\n\nconst styles = StyleSheet.create({\n correctionPopinWrapper: {\n position: 'absolute',\n bottom: 16,\n width: '105%'\n }\n});\n\nconst CorrectionPopin = ({\n correctionPopinProps,\n slideIndex,\n showCorrectionPopin,\n animateCorrectionPopin\n}: PopinProps) => {\n const translateUp = useTranslateY({\n fromValue: 1000,\n toValue: 0,\n duration: 800,\n easing: Easing.bezier(0.37, 0, 0.63, 1)\n });\n\n useEffect(() => translateUp.start(), []);\n\n if (!showCorrectionPopin) return null;\n\n const klf = getOr(undefined, 'klf', correctionPopinProps);\n const information = getOr({label: '', message: ''}, 'information', correctionPopinProps);\n const next = get('next', correctionPopinProps);\n const onClick = get(['next', 'onClick'], correctionPopinProps);\n\n const _correctionPopinProps = {\n next: {\n onClick,\n label: next && next.label,\n 'data-name': `next-question-button-${slideIndex}`,\n 'aria-label': next && next['aria-label']\n },\n klf,\n information,\n type: correctionPopinProps.type,\n resultLabel: correctionPopinProps.resultLabel\n };\n\n const style = animateCorrectionPopin\n ? [styles.correctionPopinWrapper, translateUp.animatedStyle]\n : styles.correctionPopinWrapper;\n\n return (\n <Animated.View style={style}>\n <ReviewCorrectionPopin {..._correctionPopinProps} />\n </Animated.View>\n );\n};\n\ntype StyleSheetType = {\n questionHeading: ViewStyle;\n questionOrigin: ViewStyle;\n questionText: TextStyle;\n questionHelp: ViewStyle;\n choicesContainer: ViewStyle;\n};\n\nconst createQuestionStyle = (theme: Theme): StyleSheetType =>\n StyleSheet.create({\n questionHeading: {\n justifyContent: 'space-between'\n },\n questionOrigin: {\n fontSize: 12,\n lineHeight: 16,\n color: theme.colors.text.primary,\n marginBottom: theme.spacing.tiny,\n marginTop: theme.spacing.small,\n textAlign: 'center'\n },\n questionText: {\n fontSize: 16,\n lineHeight: 22,\n fontWeight: '700',\n color: theme.colors.text.primary,\n textAlign: 'center'\n },\n questionHelp: {\n fontSize: 12,\n lineHeight: 16,\n color: theme.colors.gray.medium,\n marginBottom: 0,\n marginTop: theme.spacing.small,\n textAlign: 'center'\n },\n choicesContainer: {\n flex: 1,\n width: '100%',\n justifyContent: 'center'\n }\n });\n\ntype QuestionProps = {\n answerUI: SlideProps['answerUI'];\n questionText: SlideProps['questionText'];\n questionOrigin: SlideProps['parentContentTitle'];\n};\n\nconst Question = (props: QuestionProps) => {\n const {answerUI, questionText, questionOrigin} = props;\n const {theme} = useTemplateContext();\n const [style, setStyle] = useState<StyleSheetType>();\n\n useEffect(() => {\n const questionStyle = createQuestionStyle(theme);\n setStyle(questionStyle);\n }, [theme]);\n\n if (!answerUI || !questionText || !style) return null;\n\n return (\n <>\n <View style={style.questionHeading}>\n <Text style={style.questionOrigin}>{questionOrigin}</Text>\n <Text style={style.questionText}>{questionText}</Text>\n <Text style={style.questionHelp}>{get('help', answerUI)}</Text>\n </View>\n <View style={style.choicesContainer}>\n <Answer {...answerUI} />\n </View>\n </>\n );\n};\n\ntype SlideStyle = {\n slide: ViewStyle;\n};\n\nconst createSlideStyle = (num: number, screenWidth: number): SlideStyle => {\n const slideWidth = screenWidth - 40 - num * 8;\n\n return StyleSheet.create({\n slide: {\n position: 'absolute',\n left: 20 + num * 4,\n bottom: 34 + num * 5,\n backgroundColor: '#fff', // theme.colors.white\n height: '90%',\n width: slideWidth,\n justifyContent: 'space-between',\n alignItems: 'center',\n padding: 25,\n shadowColor: '#000',\n shadowOffset: {width: 0, height: -1},\n shadowOpacity: 0.05,\n shadowRadius: 16,\n elevation: 10 - num * 1,\n borderRadius: 16\n }\n });\n};\n\nconst Slide = (props: ReviewSlideProps) => {\n const {animatedStyle, slide, correctionPopinProps, validateButton, num, slideIndex = '0'} = props;\n\n const {width} = useWindowDimensions();\n const slideStyle = createSlideStyle(num, width);\n\n const {\n loading,\n parentContentTitle,\n questionText,\n answerUI,\n showCorrectionPopin,\n animateCorrectionPopin\n } = slide;\n\n if (loading) {\n return <View style={slideStyle.slide} />;\n }\n\n const {onClick: handleValidatePress} = validateButton;\n\n return (\n <Animated.View style={[slideStyle.slide, animatedStyle]}>\n <Question\n questionOrigin={parentContentTitle}\n questionText={questionText}\n answerUI={answerUI}\n key=\"question-container\"\n />\n <Button\n disabled={validateButton.disabled}\n submitValue={validateButton.label}\n onPress={handleValidatePress}\n testID={`slide-validate-button-${slideIndex}`}\n />\n {correctionPopinProps ? (\n <CorrectionPopin\n correctionPopinProps={correctionPopinProps}\n slideIndex={slideIndex}\n showCorrectionPopin={showCorrectionPopin}\n animateCorrectionPopin={animateCorrectionPopin}\n key=\"correction-popin\"\n />\n ) : null}\n </Animated.View>\n );\n};\n\nexport default Slide;\n"],"mappings":";;;;;AAAA;;AACA;;AASA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;;;;;;;AAGA,MAAMA,MAAM,GAAGC,uBAAA,CAAWC,MAAX,CAAkB;EAC/BC,sBAAsB,EAAE;IACtBC,QAAQ,EAAE,UADY;IAEtBC,MAAM,EAAE,EAFc;IAGtBC,KAAK,EAAE;EAHe;AADO,CAAlB,CAAf;;AAQA,MAAMC,eAAe,GAAG,CAAC;EACvBC,oBADuB;EAEvBC,UAFuB;EAGvBC,mBAHuB;EAIvBC;AAJuB,CAAD,KAKN;EAChB,MAAMC,WAAW,GAAG,IAAAC,mCAAA,EAAc;IAChCC,SAAS,EAAE,IADqB;IAEhCC,OAAO,EAAE,CAFuB;IAGhCC,QAAQ,EAAE,GAHsB;IAIhCC,MAAM,EAAEC,mBAAA,CAAOC,MAAP,CAAc,IAAd,EAAoB,CAApB,EAAuB,IAAvB,EAA6B,CAA7B;EAJwB,CAAd,CAApB;EAOA,IAAAC,gBAAA,EAAU,MAAMR,WAAW,CAACS,KAAZ,EAAhB,EAAqC,EAArC;EAEA,IAAI,CAACX,mBAAL,EAA0B,OAAO,IAAP;EAE1B,MAAMY,GAAG,GAAG,IAAAC,cAAA,EAAMC,SAAN,EAAiB,KAAjB,EAAwBhB,oBAAxB,CAAZ;EACA,MAAMiB,WAAW,GAAG,IAAAF,cAAA,EAAM;IAACG,KAAK,EAAE,EAAR;IAAYC,OAAO,EAAE;EAArB,CAAN,EAAgC,aAAhC,EAA+CnB,oBAA/C,CAApB;EACA,MAAMoB,IAAI,GAAG,IAAAC,YAAA,EAAI,MAAJ,EAAYrB,oBAAZ,CAAb;EACA,MAAMsB,OAAO,GAAG,IAAAD,YAAA,EAAI,CAAC,MAAD,EAAS,SAAT,CAAJ,EAAyBrB,oBAAzB,CAAhB;E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6BAAC,iBAAD;MAAM,KAAK,EAAED,UAAU,CAACf;IAAxB,EAAP;EACD;;EAED,MAAM;IAACzC,OAAO,EAAE2D;EAAV,IAAiCL,cAAvC;EAEA,oBACE,6BAAC,qBAAD,CAAU,IAAV;IAAe,KAAK,EAAE,CAACE,UAAU,CAACf,KAAZ,EAAmBpC,aAAnB;EAAtB,gBACE,6BAAC,QAAD;IACE,cAAc,EAAEqD,kBADlB;IAEE,YAAY,EAAEnC,YAFhB;IAGE,QAAQ,EAAES,QAHZ;IAIE,GAAG,EAAC;EAJN,EADF,eAOE,6BAAC,eAAD;IACE,QAAQ,EAAEsB,cAAc,CAACM,QAD3B;IAEE,WAAW,EAAEN,cAAc,CAAC1D,KAF9B;IAGE,OAAO,EAAE+D,mBAHX;IAIE,MAAM,EAAG,yBAAwBhF,UAAW;EAJ9C,EAPF,EAaGD,oBAAoB,gBACnB,6BAAC,eAAD;IACE,oBAAoB,EAAEA,oBADxB;IAEE,UAAU,EAAEC,UAFd;IAGE,mBAAmB,EAAEC,mBAHvB;IAIE,sBAAsB,EAAEC,sBAJ1B;IAKE,GAAG,EAAC;EALN,EADmB,GAQjB,IArBN,CADF;AAyBD,CA9CD;;eAgDewE,K"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
|
+
import type { Animation } from '@coorpacademy/react-native-animation';
|
|
2
3
|
import { ReviewCorrectionPopinProps } from '../../molecule/review-correction-popin/prop-types';
|
|
3
4
|
import { AnswerProps } from '../../molecule/answer/prop-types';
|
|
4
5
|
import { TemplateContextValues } from '../../template/app-review/template-context';
|
|
@@ -210,6 +211,7 @@ export declare type ReviewSlideProps = {
|
|
|
210
211
|
onClick: () => void;
|
|
211
212
|
disabled: boolean;
|
|
212
213
|
};
|
|
214
|
+
animatedStyle?: Animation['animatedStyle'][];
|
|
213
215
|
};
|
|
214
216
|
export declare type Fixture = {
|
|
215
217
|
props: ReviewSlideProps;
|
|
@@ -1 +1 @@
|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C,CAAC;AAEF,oBAAY,mBAAmB,GAAG;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;IACnD,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,oBAAY,UAAU,GAAG;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,aAAa,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IACtC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,WAAW,CAAC;CACxB,CAAC;AAEF,oBAAY,gBAAgB,GAAG;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,UAAU,CAAC;IAClB,oBAAoB,CAAC,EAAE,0BAA0B,CAAC;IAClD,cAAc,EAAE;QACd,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,IAAI,CAAC;QACpB,QAAQ,EAAE,OAAO,CAAC;KACnB,CAAC;IACF,aAAa,CAAC,EAAE,SAAS,CAAC,eAAe,CAAC,EAAE,CAAC;CAC9C,CAAC;AAEF,oBAAY,OAAO,GAAG;IAAC,KAAK,EAAE,gBAAgB,CAAC;IAAC,aAAa,CAAC,EAAE,qBAAqB,CAAA;CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prop-types.js","names":["SlidePropsTypes","PropTypes","shape","position","number","loading","bool","loadingAriaLabel","string","animationType","isCorrect","animateCorrectionPopin","showCorrectionPopin","disableContent","parentContentTitle","questionText","answerUI","AnswerPropTypes","propTypes","slideIndex","slide","validateButton","label","isRequired","onClick","func","disabled","correctionPopinProps","klf","ReviewCorrectionPopinPropTypes","information","next","resultLabel","type"],"sources":["../../../src/organism/review-slide/prop-types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\nimport ReviewCorrectionPopinPropTypes, {\n ReviewCorrectionPopinProps\n} from '../../molecule/review-correction-popin/prop-types';\nimport AnswerPropTypes, {AnswerProps} from '../../molecule/answer/prop-types';\nimport {TemplateContextValues} from '../../template/app-review/template-context';\n\nexport const SlidePropsTypes = PropTypes.shape({\n position: PropTypes.number,\n loading: PropTypes.bool,\n loadingAriaLabel: PropTypes.string,\n animationType: PropTypes.string, // 'unstack' | 'restack'\n isCorrect: PropTypes.bool,\n animateCorrectionPopin: PropTypes.bool,\n showCorrectionPopin: PropTypes.bool,\n disableContent: PropTypes.bool,\n parentContentTitle: PropTypes.string,\n questionText: PropTypes.string,\n answerUI: PropTypes.shape(AnswerPropTypes)\n});\n\nconst propTypes = {\n slideIndex: PropTypes.string,\n slide: SlidePropsTypes,\n validateButton: PropTypes.shape({\n label: PropTypes.string.isRequired,\n onClick: PropTypes.func.isRequired,\n disabled: PropTypes.bool\n }),\n correctionPopinProps: PropTypes.shape({\n klf: ReviewCorrectionPopinPropTypes.klf,\n information: ReviewCorrectionPopinPropTypes.information,\n next: PropTypes.shape({\n label: PropTypes.string,\n 'aria-label': PropTypes.string // Pourquoi le onClick du next n'est pas ici !\n // updateSlidesOnNext: PropTypes.func.isRequired ???\n }),\n resultLabel: ReviewCorrectionPopinPropTypes.resultLabel,\n type: ReviewCorrectionPopinPropTypes.type\n })\n};\n\nexport default propTypes;\n\nexport type PopinProps = {\n correctionPopinProps: ReviewCorrectionPopinProps;\n slideIndex: string;\n showCorrectionPopin?: boolean;\n animateCorrectionPopin?: boolean;\n};\n\nexport type ValidateButtonProps = {\n slideIndex: string;\n validateButton: ReviewSlideProps['validateButton'];\n primarySkinColor?: string;\n};\n\nexport type SlideProps = {\n position: number;\n loading: boolean;\n loadingAriaLabel?: string;\n animationType?: 'unstack' | 'restack';\n isCorrect?: boolean;\n animateCorrectionPopin?: boolean;\n showCorrectionPopin?: boolean;\n parentContentTitle?: string;\n questionText?: string;\n answerUI?: AnswerProps;\n};\n\nexport type ReviewSlideProps = {\n slideIndex: string;\n num: number;\n slide: SlideProps;\n correctionPopinProps?: ReviewCorrectionPopinProps;\n validateButton: {\n label: string;\n onClick: () => void;\n disabled: boolean;\n };\n};\n\nexport type Fixture = {props: ReviewSlideProps; mobileContext?: TemplateContextValues};\n"],"mappings":";;;;;AAAA;;
|
|
1
|
+
{"version":3,"file":"prop-types.js","names":["SlidePropsTypes","PropTypes","shape","position","number","loading","bool","loadingAriaLabel","string","animationType","isCorrect","animateCorrectionPopin","showCorrectionPopin","disableContent","parentContentTitle","questionText","answerUI","AnswerPropTypes","propTypes","slideIndex","slide","validateButton","label","isRequired","onClick","func","disabled","correctionPopinProps","klf","ReviewCorrectionPopinPropTypes","information","next","resultLabel","type"],"sources":["../../../src/organism/review-slide/prop-types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\nimport type {Animation} from '@coorpacademy/react-native-animation';\nimport ReviewCorrectionPopinPropTypes, {\n ReviewCorrectionPopinProps\n} from '../../molecule/review-correction-popin/prop-types';\nimport AnswerPropTypes, {AnswerProps} from '../../molecule/answer/prop-types';\nimport {TemplateContextValues} from '../../template/app-review/template-context';\n\nexport const SlidePropsTypes = PropTypes.shape({\n position: PropTypes.number,\n loading: PropTypes.bool,\n loadingAriaLabel: PropTypes.string,\n animationType: PropTypes.string, // 'unstack' | 'restack'\n isCorrect: PropTypes.bool,\n animateCorrectionPopin: PropTypes.bool,\n showCorrectionPopin: PropTypes.bool,\n disableContent: PropTypes.bool,\n parentContentTitle: PropTypes.string,\n questionText: PropTypes.string,\n answerUI: PropTypes.shape(AnswerPropTypes)\n});\n\nconst propTypes = {\n slideIndex: PropTypes.string,\n slide: SlidePropsTypes,\n validateButton: PropTypes.shape({\n label: PropTypes.string.isRequired,\n onClick: PropTypes.func.isRequired,\n disabled: PropTypes.bool\n }),\n correctionPopinProps: PropTypes.shape({\n klf: ReviewCorrectionPopinPropTypes.klf,\n information: ReviewCorrectionPopinPropTypes.information,\n next: PropTypes.shape({\n label: PropTypes.string,\n 'aria-label': PropTypes.string // Pourquoi le onClick du next n'est pas ici !\n // updateSlidesOnNext: PropTypes.func.isRequired ???\n }),\n resultLabel: ReviewCorrectionPopinPropTypes.resultLabel,\n type: ReviewCorrectionPopinPropTypes.type\n })\n};\n\nexport default propTypes;\n\nexport type PopinProps = {\n correctionPopinProps: ReviewCorrectionPopinProps;\n slideIndex: string;\n showCorrectionPopin?: boolean;\n animateCorrectionPopin?: boolean;\n};\n\nexport type ValidateButtonProps = {\n slideIndex: string;\n validateButton: ReviewSlideProps['validateButton'];\n primarySkinColor?: string;\n};\n\nexport type SlideProps = {\n position: number;\n loading: boolean;\n loadingAriaLabel?: string;\n animationType?: 'unstack' | 'restack';\n isCorrect?: boolean;\n animateCorrectionPopin?: boolean;\n showCorrectionPopin?: boolean;\n parentContentTitle?: string;\n questionText?: string;\n answerUI?: AnswerProps;\n};\n\nexport type ReviewSlideProps = {\n slideIndex: string;\n num: number;\n slide: SlideProps;\n correctionPopinProps?: ReviewCorrectionPopinProps;\n validateButton: {\n label: string;\n onClick: () => void;\n disabled: boolean;\n };\n animatedStyle?: Animation['animatedStyle'][];\n};\n\nexport type Fixture = {props: ReviewSlideProps; mobileContext?: TemplateContextValues};\n"],"mappings":";;;;;AAAA;;AAEA;;AAGA;;;;AAGO,MAAMA,eAAe,GAAGC,kBAAA,CAAUC,KAAV,CAAgB;EAC7CC,QAAQ,EAAEF,kBAAA,CAAUG,MADyB;EAE7CC,OAAO,EAAEJ,kBAAA,CAAUK,IAF0B;EAG7CC,gBAAgB,EAAEN,kBAAA,CAAUO,MAHiB;EAI7CC,aAAa,EAAER,kBAAA,CAAUO,MAJoB;EAIZ;EACjCE,SAAS,EAAET,kBAAA,CAAUK,IALwB;EAM7CK,sBAAsB,EAAEV,kBAAA,CAAUK,IANW;EAO7CM,mBAAmB,EAAEX,kBAAA,CAAUK,IAPc;EAQ7CO,cAAc,EAAEZ,kBAAA,CAAUK,IARmB;EAS7CQ,kBAAkB,EAAEb,kBAAA,CAAUO,MATe;EAU7CO,YAAY,EAAEd,kBAAA,CAAUO,MAVqB;EAW7CQ,QAAQ,EAAEf,kBAAA,CAAUC,KAAV,CAAgBe,mBAAhB;AAXmC,CAAhB,CAAxB;;;AAcP,MAAMC,SAAS,GAAG;EAChBC,UAAU,EAAElB,kBAAA,CAAUO,MADN;EAEhBY,KAAK,EAAEpB,eAFS;EAGhBqB,cAAc,EAAEpB,kBAAA,CAAUC,KAAV,CAAgB;IAC9BoB,KAAK,EAAErB,kBAAA,CAAUO,MAAV,CAAiBe,UADM;IAE9BC,OAAO,EAAEvB,kBAAA,CAAUwB,IAAV,CAAeF,UAFM;IAG9BG,QAAQ,EAAEzB,kBAAA,CAAUK;EAHU,CAAhB,CAHA;EAQhBqB,oBAAoB,EAAE1B,kBAAA,CAAUC,KAAV,CAAgB;IACpC0B,GAAG,EAAEC,mBAAA,CAA+BD,GADA;IAEpCE,WAAW,EAAED,mBAAA,CAA+BC,WAFR;IAGpCC,IAAI,EAAE9B,kBAAA,CAAUC,KAAV,CAAgB;MACpBoB,KAAK,EAAErB,kBAAA,CAAUO,MADG;MAEpB,cAAcP,kBAAA,CAAUO,MAFJ,CAEW;MAC/B;;IAHoB,CAAhB,CAH8B;IAQpCwB,WAAW,EAAEH,mBAAA,CAA+BG,WARR;IASpCC,IAAI,EAAEJ,mBAAA,CAA+BI;EATD,CAAhB;AARN,CAAlB;eAqBef,S"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { ReviewStackProps } from './prop-types';
|
|
2
|
+
import type { ReviewStackProps } from './prop-types';
|
|
3
3
|
export declare const TOTAL_SLIDES_STACK = 5;
|
|
4
4
|
declare const StackedSlides: (props: ReviewStackProps) => JSX.Element;
|
|
5
5
|
export default StackedSlides;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/organism/review-stacked-slides/index.native.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/organism/review-stacked-slides/index.native.tsx"],"names":[],"mappings":";AAMA,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,cAAc,CAAC;AAEnD,eAAO,MAAM,kBAAkB,IAAI,CAAC;AAyBpC,QAAA,MAAM,aAAa,UAAW,gBAAgB,gBA0G7C,CAAC;AAEF,eAAe,aAAa,CAAC"}
|