@coorpacademy/components 11.0.1 → 11.0.2-alpha.3
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-partners/index.js +2 -1
- package/es/molecule/discipline-partners/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/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-partners/index.js +2 -1
- package/lib/molecule/discipline-partners/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/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 +2 -2
- package/locales/.mtslconfig.json +0 -1
package/es/atom/picture/index.js
CHANGED
|
@@ -15,16 +15,12 @@ import PropTypes from 'prop-types';
|
|
|
15
15
|
import { SrcPropType } from '../../util/proptypes';
|
|
16
16
|
import style from './style.css';
|
|
17
17
|
|
|
18
|
-
const toSrcSet =
|
|
19
|
-
src
|
|
20
|
-
}) => {
|
|
18
|
+
const toSrcSet = src => {
|
|
21
19
|
if (!_isObject(src)) return {};
|
|
22
20
|
return _pipe(_set('srcSet', _pipe(_toPairs, _filter(([key, url]) => url), _map(([key, url]) => `${url} ${key}`), _join(','))(src)), _set('src', _get('1x', src)))({});
|
|
23
21
|
};
|
|
24
22
|
|
|
25
|
-
const toSetAlt =
|
|
26
|
-
alt
|
|
27
|
-
}) => {
|
|
23
|
+
const toSetAlt = alt => {
|
|
28
24
|
return alt ? {
|
|
29
25
|
alt
|
|
30
26
|
} : {
|
|
@@ -35,7 +31,8 @@ const toSetAlt = ({
|
|
|
35
31
|
|
|
36
32
|
const Picture = props => {
|
|
37
33
|
const {
|
|
38
|
-
src
|
|
34
|
+
src,
|
|
35
|
+
alt
|
|
39
36
|
} = props;
|
|
40
37
|
|
|
41
38
|
if (_isNil(src)) {
|
|
@@ -44,7 +41,7 @@ const Picture = props => {
|
|
|
44
41
|
});
|
|
45
42
|
}
|
|
46
43
|
|
|
47
|
-
return /*#__PURE__*/React.createElement("img", _extends({}, props, toSrcSet(
|
|
44
|
+
return /*#__PURE__*/React.createElement("img", _extends({}, props, toSrcSet(src), toSetAlt(alt)));
|
|
48
45
|
};
|
|
49
46
|
|
|
50
47
|
Picture.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","SrcPropType","style","toSrcSet","src","key","url","toSetAlt","alt","Picture","props","empty","propTypes","oneOfType","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":["React","PropTypes","SrcPropType","style","toSrcSet","src","key","url","toSetAlt","alt","Picture","props","empty","propTypes","oneOfType","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,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,SAAQC,WAAR,QAA0B,sBAA1B;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,QAAQ,GAAGC,GAAG,IAAI;EACtB,IAAI,CAAC,UAASA,GAAT,CAAL,EAAoB,OAAO,EAAP;EACpB,OAAO,MACL,KACE,QADF,EAEE,gBAEE,QAAO,CAAC,CAACC,GAAD,EAAMC,GAAN,CAAD,KAAgBA,GAAvB,CAFF,EAGE,KAAI,CAAC,CAACD,GAAD,EAAMC,GAAN,CAAD,KAAiB,GAAEA,GAAI,IAAGD,GAAI,EAAlC,CAHF,EAIE,MAAK,GAAL,CAJF,EAKED,GALF,CAFF,CADK,EAUL,KAAI,KAAJ,EAAW,KAAI,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,OAAMN,GAAN,CAAJ,EAAgB;IACd,oBAAO;MAAK,SAAS,EAAEF,KAAK,CAACS;IAAtB,EAAP;EACD;;EACD,oBAAO,wCAASD,KAAT,EAAoBP,QAAQ,CAACC,GAAD,CAA5B,EAAuCG,QAAQ,CAACC,GAAD,CAA/C,EAAP;AACD,CAND;;AAQAC,OAAO,CAACG,SAAR,2CAAoB;EAClBR,GAAG,EAAEJ,SAAS,CAACa,SAAV,CAAoB,CAACZ,WAAD,EAAcD,SAAS,CAACc,QAAV,CAAmBb,WAAnB,CAAd,CAApB,CADa;EAElBO,GAAG,EAAER,SAAS,CAACe;AAFG,CAApB;AAKA,eAAeN,OAAf"}
|
|
@@ -73,7 +73,8 @@ const DisciplinePartners = (props, context) => {
|
|
|
73
73
|
className: style.logoContainer
|
|
74
74
|
}, /*#__PURE__*/React.createElement(Picture, {
|
|
75
75
|
className: style.logo,
|
|
76
|
-
src: authorLogo.src
|
|
76
|
+
src: authorLogo.src,
|
|
77
|
+
alt: authorLogo.alt
|
|
77
78
|
}), /*#__PURE__*/React.createElement("div", {
|
|
78
79
|
className: style.arrowWrapper
|
|
79
80
|
}, /*#__PURE__*/React.createElement(ArrowDown, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","NovaCompositionNavigationArrowRight","ArrowRight","NovaCompositionNavigationArrowDown","ArrowDown","SocialLink","Provider","CatalogSection","Picture","style","DisciplinePartners","props","context","translate","skin","authorTitle","authors","authorLabel","defaultColor","authorsView","convert","cap","author","index","socialLinks","authorLogo","authorHref","moreDetails","autName","authorToggleId","linkView","authorLink","color","moreInfoView","linkicon","socialView","map","social","i","link","aNameView","authorName","logoView","logoContainer","logo","src","arrowWrapper","arrow","authorContent","links","authorWrapper","toggle","colDetails","contextTypes","childContextTypes","propTypes","arrayOf","shape","name","string","href"],"sources":["../../../src/molecule/discipline-partners/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {get, getOr, isEmpty, map, uniqueId} from 'lodash/fp';\nimport {\n NovaCompositionNavigationArrowRight as ArrowRight,\n NovaCompositionNavigationArrowDown as ArrowDown\n} from '@coorpacademy/nova-icons';\nimport SocialLink from '../../atom/social-link';\nimport Provider from '../../atom/provider';\nimport CatalogSection from '../../atom/catalog-section';\nimport Picture from '../../atom/picture';\nimport style from './style.css';\n\nconst DisciplinePartners = (props, context) => {\n const {translate, skin} = context;\n\n const {authorTitle, authors = []} = props;\n\n const authorLabel = authorTitle || translate('author');\n const defaultColor = get('common.primary', skin);\n const authorsView = map.convert({cap: false})((author, index) => {\n const socialLinks = getOr([], 'socialLinks', author);\n const authorLogo = get('logo', author);\n const authorHref = get('href', author);\n const moreDetails = get('more', author);\n const autName = get('name', author);\n const authorToggleId = uniqueId('author-toggle-');\n const linkView = (\n <div className={style.authorLink}>\n <a\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n style={{\n color: defaultColor\n }}\n href={authorHref}\n >\n {authorHref}\n </a>\n </div>\n );\n const moreInfoView = (\n <div className={style.authorLink}>\n <a\n href={authorHref}\n style={{\n color: defaultColor\n }}\n >\n {moreDetails}\n <ArrowRight color={defaultColor} className={style.linkicon} />\n </a>\n </div>\n );\n\n const socialView = socialLinks.map((social, i) => (\n <div key={i} className={style.link}>\n <SocialLink {...social} />\n </div>\n ));\n\n const aNameView = autName ? (\n <div data-name=\"authorName\" className={style.authorName}>\n {autName}\n </div>\n ) : null;\n\n const logoView = authorLogo ? (\n <div className={style.logoContainer}>\n <Picture className={style.logo} src={authorLogo.src} />\n <div className={style.arrowWrapper}>\n <ArrowDown className={style.arrow} height={14} whidth={14} />\n </div>\n </div>\n ) : null;\n\n const authorContent =\n authorHref || aNameView || socialView ? (\n <div className={style.authorContent}>\n {autName ? aNameView : null}\n {moreDetails ? moreInfoView : null}\n {!moreDetails && authorHref ? linkView : null}\n <div className={style.links}>{socialView}</div>\n </div>\n ) : null;\n\n return (\n <div key={index} className={style.authorWrapper}>\n <input type=\"checkbox\" id={authorToggleId} className={style.toggle} defaultChecked />\n <label htmlFor={authorToggleId}>{logoView}</label>\n {authorContent}\n </div>\n );\n }, authors);\n\n return !isEmpty(authors) ? (\n <div data-name=\"disciplinePartner\" className={style.colDetails}>\n <CatalogSection title={authorLabel}>{authorsView}</CatalogSection>\n </div>\n ) : null;\n};\n\nDisciplinePartners.contextTypes = {\n translate: Provider.childContextTypes.translate,\n skin: Provider.childContextTypes.skin\n};\n\nDisciplinePartners.propTypes = {\n authors: PropTypes.arrayOf(\n PropTypes.shape({\n name: PropTypes.string,\n href: PropTypes.string,\n logo: PropTypes.shape({\n src: PropTypes.string,\n href: PropTypes.string\n }),\n socialLinks: PropTypes.arrayOf(PropTypes.shape(SocialLink.propTypes))\n })\n ),\n authorTitle: PropTypes.string\n};\n\nexport default DisciplinePartners;\n"],"mappings":";;;;;AAAA,OAAOA,KAA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;MADF,CAHT;MAME,IAAI,EAAEQ;IANR,GAQGA,UARH,CADF,CADF;IAcA,MAAMO,YAAY,gBAChB;MAAK,SAAS,EAAExB,KAAK,CAACsB;IAAtB,gBACE;MACE,IAAI,EAAEL,UADR;MAEE,KAAK,EAAE;QACLM,KAAK,EAAEd;MADF;IAFT,GAMGS,WANH,eAOE,oBAAC,UAAD;MAAY,KAAK,EAAET,YAAnB;MAAiC,SAAS,EAAET,KAAK,CAACyB;IAAlD,EAPF,CADF,CADF;IAcA,MAAMC,UAAU,GAAGX,WAAW,CAACY,GAAZ,CAAgB,CAACC,MAAD,EAASC,CAAT,kBACjC;MAAK,GAAG,EAAEA,CAAV;MAAa,SAAS,EAAE7B,KAAK,CAAC8B;IAA9B,gBACE,oBAAC,UAAD,EAAgBF,MAAhB,CADF,CADiB,CAAnB;IAMA,MAAMG,SAAS,GAAGZ,OAAO,gBACvB;MAAK,aAAU,YAAf;MAA4B,SAAS,EAAEnB,KAAK,CAACgC;IAA7C,GACGb,OADH,CADuB,GAIrB,IAJJ;IAMA,MAAMc,QAAQ,GAAGjB,UAAU,gBACzB;MAAK,SAAS,EAAEhB,KAAK,CAACkC;IAAtB,gBACE,oBAAC,OAAD;MAAS,SAAS,EAAElC,KAAK,CAACmC,IAA1B;MAAgC,GAAG,EAAEnB,UAAU,CAACoB;
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","NovaCompositionNavigationArrowRight","ArrowRight","NovaCompositionNavigationArrowDown","ArrowDown","SocialLink","Provider","CatalogSection","Picture","style","DisciplinePartners","props","context","translate","skin","authorTitle","authors","authorLabel","defaultColor","authorsView","convert","cap","author","index","socialLinks","authorLogo","authorHref","moreDetails","autName","authorToggleId","linkView","authorLink","color","moreInfoView","linkicon","socialView","map","social","i","link","aNameView","authorName","logoView","logoContainer","logo","src","alt","arrowWrapper","arrow","authorContent","links","authorWrapper","toggle","colDetails","contextTypes","childContextTypes","propTypes","arrayOf","shape","name","string","href"],"sources":["../../../src/molecule/discipline-partners/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {get, getOr, isEmpty, map, uniqueId} from 'lodash/fp';\nimport {\n NovaCompositionNavigationArrowRight as ArrowRight,\n NovaCompositionNavigationArrowDown as ArrowDown\n} from '@coorpacademy/nova-icons';\nimport SocialLink from '../../atom/social-link';\nimport Provider from '../../atom/provider';\nimport CatalogSection from '../../atom/catalog-section';\nimport Picture from '../../atom/picture';\nimport style from './style.css';\n\nconst DisciplinePartners = (props, context) => {\n const {translate, skin} = context;\n\n const {authorTitle, authors = []} = props;\n\n const authorLabel = authorTitle || translate('author');\n const defaultColor = get('common.primary', skin);\n const authorsView = map.convert({cap: false})((author, index) => {\n const socialLinks = getOr([], 'socialLinks', author);\n const authorLogo = get('logo', author);\n const authorHref = get('href', author);\n const moreDetails = get('more', author);\n const autName = get('name', author);\n const authorToggleId = uniqueId('author-toggle-');\n const linkView = (\n <div className={style.authorLink}>\n <a\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n style={{\n color: defaultColor\n }}\n href={authorHref}\n >\n {authorHref}\n </a>\n </div>\n );\n const moreInfoView = (\n <div className={style.authorLink}>\n <a\n href={authorHref}\n style={{\n color: defaultColor\n }}\n >\n {moreDetails}\n <ArrowRight color={defaultColor} className={style.linkicon} />\n </a>\n </div>\n );\n\n const socialView = socialLinks.map((social, i) => (\n <div key={i} className={style.link}>\n <SocialLink {...social} />\n </div>\n ));\n\n const aNameView = autName ? (\n <div data-name=\"authorName\" className={style.authorName}>\n {autName}\n </div>\n ) : null;\n\n const logoView = authorLogo ? (\n <div className={style.logoContainer}>\n <Picture className={style.logo} src={authorLogo.src} alt={authorLogo.alt} />\n <div className={style.arrowWrapper}>\n <ArrowDown className={style.arrow} height={14} whidth={14} />\n </div>\n </div>\n ) : null;\n\n const authorContent =\n authorHref || aNameView || socialView ? (\n <div className={style.authorContent}>\n {autName ? aNameView : null}\n {moreDetails ? moreInfoView : null}\n {!moreDetails && authorHref ? linkView : null}\n <div className={style.links}>{socialView}</div>\n </div>\n ) : null;\n\n return (\n <div key={index} className={style.authorWrapper}>\n <input type=\"checkbox\" id={authorToggleId} className={style.toggle} defaultChecked />\n <label htmlFor={authorToggleId}>{logoView}</label>\n {authorContent}\n </div>\n );\n }, authors);\n\n return !isEmpty(authors) ? (\n <div data-name=\"disciplinePartner\" className={style.colDetails}>\n <CatalogSection title={authorLabel}>{authorsView}</CatalogSection>\n </div>\n ) : null;\n};\n\nDisciplinePartners.contextTypes = {\n translate: Provider.childContextTypes.translate,\n skin: Provider.childContextTypes.skin\n};\n\nDisciplinePartners.propTypes = {\n authors: PropTypes.arrayOf(\n PropTypes.shape({\n name: PropTypes.string,\n href: PropTypes.string,\n logo: PropTypes.shape({\n src: PropTypes.string,\n href: PropTypes.string\n }),\n socialLinks: PropTypes.arrayOf(PropTypes.shape(SocialLink.propTypes))\n })\n ),\n authorTitle: PropTypes.string\n};\n\nexport default DisciplinePartners;\n"],"mappings":";;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,SACEC,mCAAmC,IAAIC,UADzC,EAEEC,kCAAkC,IAAIC,SAFxC,QAGO,0BAHP;AAIA,OAAOC,UAAP,MAAuB,wBAAvB;AACA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAAOC,cAAP,MAA2B,4BAA3B;AACA,OAAOC,OAAP,MAAoB,oBAApB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,kBAAkB,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EAC7C,MAAM;IAACC,SAAD;IAAYC;EAAZ,IAAoBF,OAA1B;EAEA,MAAM;IAACG,WAAD;IAAcC,OAAO,GAAG;EAAxB,IAA8BL,KAApC;EAEA,MAAMM,WAAW,GAAGF,WAAW,IAAIF,SAAS,CAAC,QAAD,CAA5C;;EACA,MAAMK,YAAY,GAAG,KAAI,gBAAJ,EAAsBJ,IAAtB,CAArB;;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BACE,oBAAC,cAAD;IAAgB,KAAK,EAAEpC;EAAvB,GAAqCE,WAArC,CADF,CADK,GAIH,IAJJ;AAKD,CAvFD;;AAyFAT,kBAAkB,CAAC4C,YAAnB,GAAkC;EAChCzC,SAAS,EAAEP,QAAQ,CAACiD,iBAAT,CAA2B1C,SADN;EAEhCC,IAAI,EAAER,QAAQ,CAACiD,iBAAT,CAA2BzC;AAFD,CAAlC;AAKAJ,kBAAkB,CAAC8C,SAAnB,2CAA+B;EAC7BxC,OAAO,EAAEhB,SAAS,CAACyD,OAAV,CACPzD,SAAS,CAAC0D,KAAV,CAAgB;IACdC,IAAI,EAAE3D,SAAS,CAAC4D,MADF;IAEdC,IAAI,EAAE7D,SAAS,CAAC4D,MAFF;IAGdhB,IAAI,EAAE5C,SAAS,CAAC0D,KAAV,CAAgB;MACpBb,GAAG,EAAE7C,SAAS,CAAC4D,MADK;MAEpBC,IAAI,EAAE7D,SAAS,CAAC4D;IAFI,CAAhB,CAHQ;IAOdpC,WAAW,EAAExB,SAAS,CAACyD,OAAV,CAAkBzD,SAAS,CAAC0D,KAAV,CAAgBrD,UAAU,CAACmD,SAA3B,CAAlB;EAPC,CAAhB,CADO,CADoB;EAY7BzC,WAAW,EAAEf,SAAS,CAAC4D;AAZM,CAA/B;AAeA,eAAelD,kBAAf"}
|
|
@@ -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"}
|
|
@@ -20,7 +20,8 @@ const ForumComment = (props, context) => {
|
|
|
20
20
|
value,
|
|
21
21
|
textareaDisabled,
|
|
22
22
|
postDisabled,
|
|
23
|
-
newPost = false
|
|
23
|
+
newPost = false,
|
|
24
|
+
profileAvatarAlt
|
|
24
25
|
} = props;
|
|
25
26
|
|
|
26
27
|
const primary = _get('common.primary', skin);
|
|
@@ -30,7 +31,8 @@ const ForumComment = (props, context) => {
|
|
|
30
31
|
const avatarView = avatar ? /*#__PURE__*/React.createElement("div", {
|
|
31
32
|
className: style.image
|
|
32
33
|
}, /*#__PURE__*/React.createElement("img", {
|
|
33
|
-
src: avatar
|
|
34
|
+
src: avatar,
|
|
35
|
+
alt: profileAvatarAlt
|
|
34
36
|
})) : null;
|
|
35
37
|
const button = /*#__PURE__*/React.createElement("div", {
|
|
36
38
|
className: style.post
|
|
@@ -65,6 +67,7 @@ ForumComment.contextTypes = {
|
|
|
65
67
|
};
|
|
66
68
|
ForumComment.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
67
69
|
value: PropTypes.string,
|
|
70
|
+
profileAvatarAlt: PropTypes.string,
|
|
68
71
|
avatar: SrcPropType,
|
|
69
72
|
onChange: PropTypes.func,
|
|
70
73
|
onPost: PropTypes.func,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","classnames","SrcPropType","Provider","Button","style","ForumComment","props","context","translate","skin","avatar","onPost","onChange","value","textareaDisabled","postDisabled","newPost","primary","light","avatarView","image","button","post","backgroundColor","disabledButton","container","wrapper","comment","contextTypes","childContextTypes","propTypes","string","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":["React","PropTypes","classnames","SrcPropType","Provider","Button","style","ForumComment","props","context","translate","skin","avatar","onPost","onChange","value","textareaDisabled","postDisabled","newPost","profileAvatarAlt","primary","light","avatarView","image","button","post","backgroundColor","disabledButton","container","wrapper","comment","contextTypes","childContextTypes","propTypes","string","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,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,UAAP,MAAuB,YAAvB;AACA,SAAQC,WAAR,QAA0B,yBAA1B;AACA,OAAOC,QAAP,MAAqB,wBAArB;AACA,OAAOC,MAAP,MAAmB,sBAAnB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,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,KAAI,gBAAJ,EAAsBT,IAAtB,CAAhB;;EACA,MAAMU,KAAK,GAAG,KAAI,cAAJ,EAAoBV,IAApB,CAAd;;EAEA,MAAMW,UAAU,GAAGV,MAAM,gBACvB;IAAK,SAAS,EAAEN,KAAK,CAACiB;EAAtB,gBACE;IAAK,GAAG,EAAEX,MAAV;IAAkB,GAAG,EAA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AAM,EAAET,WAHe;EAIvBW,QAAQ,EAAEb,SAAS,CAACkC,IAJG;EAKvBtB,MAAM,EAAEZ,SAAS,CAACkC,IALK;EAMvBjB,OAAO,EAAEjB,SAAS,CAACmC,IANI;EAOvBpB,gBAAgB,EAAEf,SAAS,CAACmC,IAPL;EAQvBnB,YAAY,EAAEhB,SAAS,CAACmC;AARD,CAAzB;AAUA,eAAe7B,YAAf"}
|
|
@@ -28,6 +28,8 @@ declare namespace ForumPost {
|
|
|
28
28
|
namespace propTypes {
|
|
29
29
|
export const id: PropTypes.Requireable<string>;
|
|
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"}
|
|
@@ -18,6 +18,8 @@ const ForumPost = (props, context) => {
|
|
|
18
18
|
id,
|
|
19
19
|
author,
|
|
20
20
|
avatar,
|
|
21
|
+
avatarAlt,
|
|
22
|
+
profileAvatarAlt,
|
|
21
23
|
date,
|
|
22
24
|
message,
|
|
23
25
|
answer,
|
|
@@ -71,7 +73,8 @@ const ForumPost = (props, context) => {
|
|
|
71
73
|
className: style.image
|
|
72
74
|
}, /*#__PURE__*/React.createElement(Picture, {
|
|
73
75
|
src: avatar,
|
|
74
|
-
className: style.avatar
|
|
76
|
+
className: style.avatar,
|
|
77
|
+
alt: avatarAlt
|
|
75
78
|
})), /*#__PURE__*/React.createElement("span", {
|
|
76
79
|
"data-name": "author",
|
|
77
80
|
className: style.author
|
|
@@ -115,6 +118,7 @@ const ForumPost = (props, context) => {
|
|
|
115
118
|
className: `${style.edition} ${showEditBox ? style.visible : ''}`
|
|
116
119
|
}, /*#__PURE__*/React.createElement(ForumComment, {
|
|
117
120
|
avatar: null,
|
|
121
|
+
profileAvatarAlt: profileAvatarAlt,
|
|
118
122
|
value: edition,
|
|
119
123
|
textareaDisabled: editionTextareaDisabled,
|
|
120
124
|
postDisabled: editionPostDisabled,
|
|
@@ -124,6 +128,7 @@ const ForumPost = (props, context) => {
|
|
|
124
128
|
className: `${style.answer} ${showAnswerBox ? style.visible : ''}`
|
|
125
129
|
}, /*#__PURE__*/React.createElement(ForumComment, {
|
|
126
130
|
avatar: answerAvatar,
|
|
131
|
+
profileAvatarAlt: profileAvatarAlt,
|
|
127
132
|
textareaDisabled: answerTextareaDisabled,
|
|
128
133
|
postDisabled: answerPostDisabled,
|
|
129
134
|
value: answer,
|
|
@@ -139,6 +144,8 @@ ForumPost.contextTypes = {
|
|
|
139
144
|
ForumPost.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
140
145
|
id: PropTypes.string,
|
|
141
146
|
author: PropTypes.string,
|
|
147
|
+
avatarAlt: PropTypes.string,
|
|
148
|
+
profileAvatarAlt: PropTypes.string,
|
|
142
149
|
date: PropTypes.string,
|
|
143
150
|
message: PropTypes.string,
|
|
144
151
|
avatar: SrcPropType,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","classnames","PropTypes","SrcPropType","Provider","Picture","ForumComment","style","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","deletedMessage","hiddenMessage","post","avatarWrapper","image","content","body","action","display","visible","contextTypes","childContextTypes","propTypes","string","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,OAAOA,KAAP,MAAkB,OAAlB;AAEA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,SAAQC,WAAR,QAA0B,yBAA1B;AACA,OAAOC,QAAP,MAAqB,wBAArB;AACA,OAAOC,OAAP,MAAoB,uBAApB;AACA,OAAOC,YAAP,MAAyB,kBAAzB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,SAAS,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EACpC,MAAM;IAACC,SAAD;IAAYC;EAAZ,IAAoBF,OAA1B;EACA,MAAM;IACJG,EADI;IAEJC,MAFI;IAGJC,MAHI;IAIJC,IAJI;IAKJC,OALI;IAMJC,MANI;IAOJC,kBAAkB,GAAG,KAPjB;IAQJC,sBAAsB,GAAG,KARrB;IASJC,YATI;IAUJC,UAAU,GAAG,IAVT;IAWJC,QAAQ,GAAG,KAXP;IAYJC,UAAU,GAAG,KAZT;IAaJC,QAAQ,GAAG,KAbP;IAcJC,QAAQ,GAAG,KAdP;IAeJC,OAAO,GAAG,KAfN;IAgBJC,OAhBI;IAiBJC,mBAAmB,GAAG,KAjBlB;IAkBJC,uBAAuB,GAAG,KAlBtB;IAmBJC,aAAa,GAAG,KAnBZ;IAoBJC,WAAW,GAAG,KApBV;IAqBJC,QAAQ,YArBJ;IAsBJC,MAAM,YAtBF;IAuBJC,YAAY,YAvBR;IAwBJC,aAAa,YAxBT;IAyBJC,cAAc,YAzBV;IA0BJC,eAAe,YA1BX;IA2BJC,UA3BI;IA4BJC;EA5BI,IA6BF/B,KA7BJ;;EA8BA,MAAMgC,KAAK,GAAG,KAAI,gBAAJ,EAAsB7B,IAAtB,CAAd;;EAEA,MAAM8B,WAAW,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AS,CAAC8D,IAnBA;EAoBpB7C,kBAAkB,EAAEjB,SAAS,CAAC6D,IApBV;EAqBpB3C,sBAAsB,EAAElB,SAAS,CAAC6D,IArBd;EAsBpBzC,UAAU,EAAEpB,SAAS,CAAC6D,IAtBF;EAuBpBxC,QAAQ,EAAErB,SAAS,CAAC6D,IAvBA;EAwBpBvC,UAAU,EAAEtB,SAAS,CAAC6D,IAxBF;EAyBpBrC,QAAQ,EAAExB,SAAS,CAAC6D,IAzBA;EA0BpBpC,OAAO,EAAEzB,SAAS,CAAC6D,IA1BC;EA2BpBlC,mBAAmB,EAAE3B,SAAS,CAAC6D,IA3BX;EA4BpBjC,uBAAuB,EAAE5B,SAAS,CAAC6D;AA5Bf,CAAtB;AA+BA,eAAevD,SAAf"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","classnames","PropTypes","SrcPropType","Provider","Picture","ForumComment","style","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","deletedMessage","hiddenMessage","post","avatarWrapper","image","content","body","action","display","visible","contextTypes","childContextTypes","propTypes","string","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,OAAOA,KAAP,MAAkB,OAAlB;AAEA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,SAAQC,WAAR,QAA0B,yBA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AuBpB3C,sBAAsB,EAAEpB,SAAS,CAAC+D,IAvBd;EAwBpBzC,UAAU,EAAEtB,SAAS,CAAC+D,IAxBF;EAyBpBxC,QAAQ,EAAEvB,SAAS,CAAC+D,IAzBA;EA0BpBvC,UAAU,EAAExB,SAAS,CAAC+D,IA1BF;EA2BpBrC,QAAQ,EAAE1B,SAAS,CAAC+D,IA3BA;EA4BpBpC,OAAO,EAAE3B,SAAS,CAAC+D,IA5BC;EA6BpBlC,mBAAmB,EAAE7B,SAAS,CAAC+D,IA7BX;EA8BpBjC,uBAAuB,EAAE9B,SAAS,CAAC+D;AA9Bf,CAAtB;AAiCA,eAAezD,SAAf"}
|
|
@@ -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"}
|
|
@@ -22,7 +22,8 @@ function Discussion(props) {
|
|
|
22
22
|
hideComments,
|
|
23
23
|
textareaDisabled,
|
|
24
24
|
postDisabled,
|
|
25
|
-
className
|
|
25
|
+
className,
|
|
26
|
+
profileAvatarAlt
|
|
26
27
|
} = props;
|
|
27
28
|
const threadsView = threads.map(thread => /*#__PURE__*/React.createElement(ForumThread, _extends({}, thread, {
|
|
28
29
|
key: thread.id,
|
|
@@ -31,6 +32,7 @@ function Discussion(props) {
|
|
|
31
32
|
const commentView = !hideComments ? /*#__PURE__*/React.createElement(ForumComment, {
|
|
32
33
|
avatar: avatar,
|
|
33
34
|
value: value,
|
|
35
|
+
profileAvatarAlt: profileAvatarAlt,
|
|
34
36
|
newPost: true,
|
|
35
37
|
onPost: onPost,
|
|
36
38
|
onChange: onChange,
|
|
@@ -58,6 +60,7 @@ Discussion.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
58
60
|
avatar: SrcPropType,
|
|
59
61
|
loading: PropTypes.bool,
|
|
60
62
|
value: PropTypes.string,
|
|
63
|
+
profileAvatarAlt: PropTypes.string,
|
|
61
64
|
title: PropTypes.string,
|
|
62
65
|
onPost: PropTypes.func,
|
|
63
66
|
onChange: PropTypes.func,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","classnames","SrcPropType","ForumComment","ForumThread","postConditions","Loader","style","Discussion","props","threads","title","avatar","value","loading","onPost","onChange","hideComments","textareaDisabled","postDisabled","className","threadsView","map","thread","id","commentView","loader","header","__html","propTypes","bool","string","func","arrayOf","shape"],"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,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,SAAQC,WAAR,QAA0B,sBAA1B;AACA,OAAOC,YAAP,MAAyB,oCAAzB;AACA,OAAOC,WAAP,MAAwB,mCAAxB;AACA,OAAOC,cAAP,MAA2B,sCAA3B;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,SAASC,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":["React","PropTypes","classnames","SrcPropType","ForumComment","ForumThread","postConditions","Loader","style","Discussion","props","threads","title","avatar","value","loading","onPost","onChange","hideComments","textareaDisabled","postDisabled","className","profileAvatarAlt","threadsView","map","thread","id","commentView","loader","header","__html","propTypes","bool","string","func","arrayOf","shape"],"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,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,SAAQC,WAAR,QAA0B,sBAA1B;AACA,OAAOC,YAAP,MAAyB,oCAAzB;AACA,OAAOC,WAAP,MAAwB,mCAAxB;AACA,OAAOC,cAAP,MAA2B,sCAA3B;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,SAASC,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,oBAAC,WAAD,eAAiBA,MAAjB;IAAyB,GAAG,EAAEA,MAAM,CAACC,EAArC;IAAyC,QAAQ;EAAjD,GAAtB,CAApB;EAEA,MAAMC,WAAW,GAAG,CAACT,YAAD,gBAClB,oBAAC,YAAD;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,EAAEP,KAAK,CAACoB;EAAtB,gBACE,oBAAC,MAAD,OADF,CADoB,GAIlB,IAJJ;EAMA,oBACE;IAAK,aAAU,YAAf;IAA4B,SAAS,EAAE1B,UAAU,CAACM,KAAK,CAACiB,MAAP,EAAeJ,SAAf;EAAjD,gBACE;IAAK,SAAS,EAAEb,KAAK,CAACqB;EAAtB,gBACE;IACE,EAAE,EAAC,kBADL,CAEE;IAFF;IAGE,uBAAuB,EAAE;MAACC,MAAM,EAAElB;IAAT;EAH3B,EADF,EAMGe,WANH,CADF,EASGJ,WATH,EAUGK,MAVH,CADF;AAcD;;AACDnB,UAAU,CAACsB,SAAX,2CAAuB;EACrBlB,MAAM,EAAEV,WADa;EAErBY,OAAO,EAAEd,SAAS,CAAC+B,IAFE;EAGrBlB,KAAK,EAAEb,SAAS,CAACgC,MAHI;EAIrBX,gBAAgB,EAAErB,SAAS,CAACgC,MAJP;EAKrBrB,KAAK,EAAEX,SAAS,CAACgC,MALI;EAMrBjB,MAAM,EAAEf,SAAS,CAACiC,IANG;EAOrBjB,QAAQ,EAAEhB,SAAS,CAACiC,IAPC;EAQrBvB,OAAO,EAAEV,SAAS,CAACkC,OAAV,CAAkBlC,SAAS,CAACmC,KAAV,CAAgB9B,cAAhB,CAAlB,CARY;EASrBa,gBAAgB,EAAElB,SAAS,CAAC+B,IATP;EAUrBZ,YAAY,EAAEnB,SAAS,CAAC+B,IAVH;EAWrBX,SAAS,EAAEpB,SAAS,CAACgC,MAXA;EAYrBf,YAAY,EAAEjB,SAAS,CAAC+B;AAZH,CAAvB;AAeA,eAAevB,UAAf"}
|
|
@@ -65,6 +65,7 @@ declare namespace PopinEnd {
|
|
|
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"}
|
|
@@ -88,7 +88,8 @@ const DisciplinePartners = (props, context) => {
|
|
|
88
88
|
className: _style.default.logoContainer
|
|
89
89
|
}, /*#__PURE__*/_react.default.createElement(_picture.default, {
|
|
90
90
|
className: _style.default.logo,
|
|
91
|
-
src: authorLogo.src
|
|
91
|
+
src: authorLogo.src,
|
|
92
|
+
alt: authorLogo.alt
|
|
92
93
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
93
94
|
className: _style.default.arrowWrapper
|
|
94
95
|
}, /*#__PURE__*/_react.default.createElement(_novaIcons.NovaCompositionNavigationArrowDown, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["DisciplinePartners","props","context","translate","skin","authorTitle","authors","authorLabel","defaultColor","authorsView","convert","cap","author","index","socialLinks","authorLogo","authorHref","moreDetails","autName","authorToggleId","linkView","style","authorLink","color","moreInfoView","linkicon","socialView","map","social","i","link","aNameView","authorName","logoView","logoContainer","logo","src","arrowWrapper","arrow","authorContent","links","authorWrapper","toggle","colDetails","contextTypes","Provider","childContextTypes","propTypes","PropTypes","arrayOf","shape","name","string","href","SocialLink"],"sources":["../../../src/molecule/discipline-partners/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {get, getOr, isEmpty, map, uniqueId} from 'lodash/fp';\nimport {\n NovaCompositionNavigationArrowRight as ArrowRight,\n NovaCompositionNavigationArrowDown as ArrowDown\n} from '@coorpacademy/nova-icons';\nimport SocialLink from '../../atom/social-link';\nimport Provider from '../../atom/provider';\nimport CatalogSection from '../../atom/catalog-section';\nimport Picture from '../../atom/picture';\nimport style from './style.css';\n\nconst DisciplinePartners = (props, context) => {\n const {translate, skin} = context;\n\n const {authorTitle, authors = []} = props;\n\n const authorLabel = authorTitle || translate('author');\n const defaultColor = get('common.primary', skin);\n const authorsView = map.convert({cap: false})((author, index) => {\n const socialLinks = getOr([], 'socialLinks', author);\n const authorLogo = get('logo', author);\n const authorHref = get('href', author);\n const moreDetails = get('more', author);\n const autName = get('name', author);\n const authorToggleId = uniqueId('author-toggle-');\n const linkView = (\n <div className={style.authorLink}>\n <a\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n style={{\n color: defaultColor\n }}\n href={authorHref}\n >\n {authorHref}\n </a>\n </div>\n );\n const moreInfoView = (\n <div className={style.authorLink}>\n <a\n href={authorHref}\n style={{\n color: defaultColor\n }}\n >\n {moreDetails}\n <ArrowRight color={defaultColor} className={style.linkicon} />\n </a>\n </div>\n );\n\n const socialView = socialLinks.map((social, i) => (\n <div key={i} className={style.link}>\n <SocialLink {...social} />\n </div>\n ));\n\n const aNameView = autName ? (\n <div data-name=\"authorName\" className={style.authorName}>\n {autName}\n </div>\n ) : null;\n\n const logoView = authorLogo ? (\n <div className={style.logoContainer}>\n <Picture className={style.logo} src={authorLogo.src} />\n <div className={style.arrowWrapper}>\n <ArrowDown className={style.arrow} height={14} whidth={14} />\n </div>\n </div>\n ) : null;\n\n const authorContent =\n authorHref || aNameView || socialView ? (\n <div className={style.authorContent}>\n {autName ? aNameView : null}\n {moreDetails ? moreInfoView : null}\n {!moreDetails && authorHref ? linkView : null}\n <div className={style.links}>{socialView}</div>\n </div>\n ) : null;\n\n return (\n <div key={index} className={style.authorWrapper}>\n <input type=\"checkbox\" id={authorToggleId} className={style.toggle} defaultChecked />\n <label htmlFor={authorToggleId}>{logoView}</label>\n {authorContent}\n </div>\n );\n }, authors);\n\n return !isEmpty(authors) ? (\n <div data-name=\"disciplinePartner\" className={style.colDetails}>\n <CatalogSection title={authorLabel}>{authorsView}</CatalogSection>\n </div>\n ) : null;\n};\n\nDisciplinePartners.contextTypes = {\n translate: Provider.childContextTypes.translate,\n skin: Provider.childContextTypes.skin\n};\n\nDisciplinePartners.propTypes = {\n authors: PropTypes.arrayOf(\n PropTypes.shape({\n name: PropTypes.string,\n href: PropTypes.string,\n logo: PropTypes.shape({\n src: PropTypes.string,\n href: PropTypes.string\n }),\n socialLinks: PropTypes.arrayOf(PropTypes.shape(SocialLink.propTypes))\n })\n ),\n authorTitle: PropTypes.string\n};\n\nexport default DisciplinePartners;\n"],"mappings":";;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AAIA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,kBAAkB,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EAC7C,MAAM;IAACC,SAAD;IAAYC;EAAZ,IAAoBF,OAA1B;EAEA,MAAM;IAACG,WAAD;IAAcC,OAAO,GAAG;EAAxB,IAA8BL,KAApC;EAEA,MAAMM,WAAW,GAAGF,WAAW,IAAIF,SAAS,CAAC,QAAD,CAA5C;EACA,MAAMK,YAAY,GAAG,mBAAI,gBAAJ,EAAsBJ,IAAtB,CAArB;;EACA,MAAMK,WAAW,GAAG,cAAIC,OAAJ,CAAY;IAACC,GAAG,EAAE;EAAN,CAAZ,EAA0B,CAACC,MAAD,EAASC,KAAT,KAAmB;IAC/D,MAAMC,WAAW,GAAG,qBAAM,EAAN,EAAU,aAAV,EAAyBF,MAAzB,CAApB;IACA,MAAMG,UAAU,GAAG,mBAAI,MAAJ,EAAYH,MAAZ,CAAnB;IACA,MAAMI,UAAU,GAAG,mBAAI,MAAJ,EAAYJ,MAAZ,CAAnB;IACA,MAAMK,WAAW,GAAG,mBAAI,MAAJ,EAAYL,MAAZ,CAApB;IACA,MAAMM,OAAO,GAAG,mBAAI,MAAJ,EAAYN,MAAZ,CAAhB;IACA,MAAMO,cAAc,GAAG,wBAAS,gBAAT,CAAvB;;IACA,MAAMC,QAAQ,gBACZ;MAAK,SAAS,EAAEC,cAAA,CAAMC;IAAtB,gBACE;MACE,MAAM,EAAC,QADT;MAEE,GAAG,EAAC,qBAFN;MAGE,KAAK,EAAE;QACLC,KAAK,EAAEf;MADF,CAHT;MAME,IAAI,EAAEQ;IANR,GAQGA,UARH,CADF,CADF;;IAcA,MAAMQ,YAAY,gBAChB;MAAK,SAAS,EAAEH,cAAA,CAAMC;IAAtB,gBACE;MACE,IAAI,EAAEN,UADR;MAEE,KAAK,EAAE;QACLO,KAAK,EAAEf;MADF;IAFT,GAMGS,WANH,eAOE,6BAAC,8CAAD;MAAY,KAAK,EAAET,YAAnB;MAAiC,SAAS,EAAEa,cAAA,CAAMI;IAAlD,EAPF,CADF,CADF;;IAcA,MAAMC,UAAU,GAAGZ,WAAW,CAACa,GAAZ,CAAgB,CAACC,MAAD,EAASC,CAAT,kBACjC;MAAK,GAAG,EAAEA,CAAV;MAAa,SAAS,EAAER,cAAA,CAAMS;IAA9B,gBACE,6BAAC,mBAAD,EAAgBF,MAAhB,CADF,CADiB,CAAnB;IAMA,MAAMG,SAAS,GAAGb,OAAO,gBACvB;MAAK,aAAU,YAAf;MAA4B,SAAS,EAAEG,cAAA,CAAMW;IAA7C,GACGd,OADH,CADuB,GAIrB,IAJJ;IAMA,MAAMe,QAAQ,GAAGlB,UAAU,gBACzB;MAAK,SAAS,EAAEM,cAAA,CAAMa;IAAtB,gBACE,6BAAC,gBAAD;MAAS,SAAS,EAAEb,cAAA,CAAMc,IAA1B;MAAgC,GAAG,EAAEpB,UAAU,CAACqB;
|
|
1
|
+
{"version":3,"file":"index.js","names":["DisciplinePartners","props","context","translate","skin","authorTitle","authors","authorLabel","defaultColor","authorsView","convert","cap","author","index","socialLinks","authorLogo","authorHref","moreDetails","autName","authorToggleId","linkView","style","authorLink","color","moreInfoView","linkicon","socialView","map","social","i","link","aNameView","authorName","logoView","logoContainer","logo","src","alt","arrowWrapper","arrow","authorContent","links","authorWrapper","toggle","colDetails","contextTypes","Provider","childContextTypes","propTypes","PropTypes","arrayOf","shape","name","string","href","SocialLink"],"sources":["../../../src/molecule/discipline-partners/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {get, getOr, isEmpty, map, uniqueId} from 'lodash/fp';\nimport {\n NovaCompositionNavigationArrowRight as ArrowRight,\n NovaCompositionNavigationArrowDown as ArrowDown\n} from '@coorpacademy/nova-icons';\nimport SocialLink from '../../atom/social-link';\nimport Provider from '../../atom/provider';\nimport CatalogSection from '../../atom/catalog-section';\nimport Picture from '../../atom/picture';\nimport style from './style.css';\n\nconst DisciplinePartners = (props, context) => {\n const {translate, skin} = context;\n\n const {authorTitle, authors = []} = props;\n\n const authorLabel = authorTitle || translate('author');\n const defaultColor = get('common.primary', skin);\n const authorsView = map.convert({cap: false})((author, index) => {\n const socialLinks = getOr([], 'socialLinks', author);\n const authorLogo = get('logo', author);\n const authorHref = get('href', author);\n const moreDetails = get('more', author);\n const autName = get('name', author);\n const authorToggleId = uniqueId('author-toggle-');\n const linkView = (\n <div className={style.authorLink}>\n <a\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n style={{\n color: defaultColor\n }}\n href={authorHref}\n >\n {authorHref}\n </a>\n </div>\n );\n const moreInfoView = (\n <div className={style.authorLink}>\n <a\n href={authorHref}\n style={{\n color: defaultColor\n }}\n >\n {moreDetails}\n <ArrowRight color={defaultColor} className={style.linkicon} />\n </a>\n </div>\n );\n\n const socialView = socialLinks.map((social, i) => (\n <div key={i} className={style.link}>\n <SocialLink {...social} />\n </div>\n ));\n\n const aNameView = autName ? (\n <div data-name=\"authorName\" className={style.authorName}>\n {autName}\n </div>\n ) : null;\n\n const logoView = authorLogo ? (\n <div className={style.logoContainer}>\n <Picture className={style.logo} src={authorLogo.src} alt={authorLogo.alt} />\n <div className={style.arrowWrapper}>\n <ArrowDown className={style.arrow} height={14} whidth={14} />\n </div>\n </div>\n ) : null;\n\n const authorContent =\n authorHref || aNameView || socialView ? (\n <div className={style.authorContent}>\n {autName ? aNameView : null}\n {moreDetails ? moreInfoView : null}\n {!moreDetails && authorHref ? linkView : null}\n <div className={style.links}>{socialView}</div>\n </div>\n ) : null;\n\n return (\n <div key={index} className={style.authorWrapper}>\n <input type=\"checkbox\" id={authorToggleId} className={style.toggle} defaultChecked />\n <label htmlFor={authorToggleId}>{logoView}</label>\n {authorContent}\n </div>\n );\n }, authors);\n\n return !isEmpty(authors) ? (\n <div data-name=\"disciplinePartner\" className={style.colDetails}>\n <CatalogSection title={authorLabel}>{authorsView}</CatalogSection>\n </div>\n ) : null;\n};\n\nDisciplinePartners.contextTypes = {\n translate: Provider.childContextTypes.translate,\n skin: Provider.childContextTypes.skin\n};\n\nDisciplinePartners.propTypes = {\n authors: PropTypes.arrayOf(\n PropTypes.shape({\n name: PropTypes.string,\n href: PropTypes.string,\n logo: PropTypes.shape({\n src: PropTypes.string,\n href: PropTypes.string\n }),\n socialLinks: PropTypes.arrayOf(PropTypes.shape(SocialLink.propTypes))\n })\n ),\n authorTitle: PropTypes.string\n};\n\nexport default DisciplinePartners;\n"],"mappings":";;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AAIA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,kBAAkB,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EAC7C,MAAM;IAACC,SAAD;IAAYC;EAAZ,IAAoBF,OAA1B;EAEA,MAAM;IAACG,WAAD;IAAcC,OAAO,GAAG;EAAxB,IAA8BL,KAApC;EAEA,MAAMM,WAAW,GAAGF,WAAW,IAAIF,SAAS,CAAC,QAAD,CAA5C;EACA,MAAMK,YAAY,GAAG,mBAAI,gBAAJ,EAAsBJ,IAAtB,CAArB;;EACA,MAAMK,WAAW,GAAG,cAAIC,OAAJ,CAAY;IAACC,GAAG,EAAE;EAAN,CAAZ,EAA0B,CAACC,MAAD,EAASC,KAAT,KAAmB;IAC/D,MAAMC,WAAW,GAAG,qBAAM,E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C1C,SAAS,EAAE2C,iBAAA,CAASC,iBAAT,CAA2B5C,SADN;EAEhCC,IAAI,EAAE0C,iBAAA,CAASC,iBAAT,CAA2B3C;AAFD,CAAlC;AAKAJ,kBAAkB,CAACgD,SAAnB,2CAA+B;EAC7B1C,OAAO,EAAE2C,kBAAA,CAAUC,OAAV,CACPD,kBAAA,CAAUE,KAAV,CAAgB;IACdC,IAAI,EAAEH,kBAAA,CAAUI,MADF;IAEdC,IAAI,EAAEL,kBAAA,CAAUI,MAFF;IAGdlB,IAAI,EAAEc,kBAAA,CAAUE,KAAV,CAAgB;MACpBf,GAAG,EAAEa,kBAAA,CAAUI,MADK;MAEpBC,IAAI,EAAEL,kBAAA,CAAUI;IAFI,CAAhB,CAHQ;IAOdvC,WAAW,EAAEmC,kBAAA,CAAUC,OAAV,CAAkBD,kBAAA,CAAUE,KAAV,CAAgBI,mBAAA,CAAWP,SAA3B,CAAlB;EAPC,CAAhB,CADO,CADoB;EAY7B3C,WAAW,EAAE4C,kBAAA,CAAUI;AAZM,CAA/B;eAeerD,kB"}
|
|
@@ -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,GAAW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28
|
namespace propTypes {
|
|
29
29
|
export const id: PropTypes.Requireable<string>;
|
|
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,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EmC,kBAAA,CAAUG;AA5Bf,CAAtB;eA+Be5D,S"}
|
|
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,uBA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EAAE+C,kBAAA,CAAUC,MATE;EAUpBtC,OAAO,EAAEqC,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"}
|
|
@@ -65,6 +65,7 @@ declare namespace PopinEnd {
|
|
|
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>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coorpacademy/components",
|
|
3
|
-
"version": "11.0.
|
|
3
|
+
"version": "11.0.2-alpha.3+43e62ce70",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -159,5 +159,5 @@
|
|
|
159
159
|
"last 2 versions",
|
|
160
160
|
"IE 11"
|
|
161
161
|
],
|
|
162
|
-
"gitHead": "
|
|
162
|
+
"gitHead": "43e62ce70ea58c568e0c51af0306c35ca5049e9c"
|
|
163
163
|
}
|
package/locales/.mtslconfig.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"ignore_dirs":[]}
|