@coorpacademy/components 11.4.5-alpha.37 → 11.4.5-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/atom/provider/index.d.ts +1 -0
- package/es/atom/provider/index.d.ts.map +1 -1
- package/es/atom/provider/index.js +11 -1
- package/es/atom/provider/index.js.map +1 -1
- package/es/atom/provider/web-context.d.ts +1 -1
- package/es/atom/provider/web-context.d.ts.map +1 -1
- package/es/atom/provider/web-context.js +2 -1
- package/es/atom/provider/web-context.js.map +1 -1
- package/es/atom/review-header-step-item/index.d.ts.map +1 -1
- package/es/atom/review-header-step-item/index.js +24 -6
- package/es/atom/review-header-step-item/index.js.map +1 -1
- package/es/globals.d.js.map +1 -1
- package/es/molecule/add-to-my-list/index.js +1 -3
- package/es/molecule/add-to-my-list/index.js.map +1 -1
- package/es/molecule/answer/index.d.ts.map +1 -1
- package/es/molecule/answer/index.js +6 -16
- package/es/molecule/answer/index.js.map +1 -1
- package/es/molecule/card/notification.js +1 -3
- package/es/molecule/card/notification.js.map +1 -1
- package/es/molecule/filters/filters-wrapper.d.ts +0 -1
- package/es/molecule/filters/filters-wrapper.d.ts.map +1 -1
- package/es/molecule/filters/filters-wrapper.js +5 -9
- package/es/molecule/filters/filters-wrapper.js.map +1 -1
- package/es/molecule/filters/index.d.ts +0 -1
- package/es/molecule/filters/index.d.ts.map +1 -1
- package/es/molecule/filters/index.js +3 -6
- package/es/molecule/filters/index.js.map +1 -1
- package/es/molecule/forum/forum-post/index.d.ts.map +1 -1
- package/es/molecule/forum/forum-post/index.js +1 -2
- package/es/molecule/forum/forum-post/index.js.map +1 -1
- package/es/molecule/questions/drop-down/index.d.ts +0 -1
- package/es/molecule/questions/drop-down/index.d.ts.map +1 -1
- package/es/molecule/questions/drop-down/index.js +5 -9
- package/es/molecule/questions/drop-down/index.js.map +1 -1
- package/es/molecule/questions/qcm/index.d.ts +0 -1
- package/es/molecule/questions/qcm/index.d.ts.map +1 -1
- package/es/molecule/questions/qcm/index.js +5 -9
- package/es/molecule/questions/qcm/index.js.map +1 -1
- package/es/molecule/questions/qcm-drag/index.d.ts +1 -3
- package/es/molecule/questions/qcm-drag/index.d.ts.map +1 -1
- package/es/molecule/questions/qcm-drag/index.js +5 -9
- package/es/molecule/questions/qcm-drag/index.js.map +1 -1
- package/es/molecule/questions/qcm-graphic/index.d.ts +0 -1
- package/es/molecule/questions/qcm-graphic/index.d.ts.map +1 -1
- package/es/molecule/questions/qcm-graphic/index.js +5 -9
- package/es/molecule/questions/qcm-graphic/index.js.map +1 -1
- package/es/molecule/questions/question-range/index.d.ts +0 -1
- package/es/molecule/questions/question-range/index.d.ts.map +1 -1
- package/es/molecule/questions/question-range/index.js +6 -10
- package/es/molecule/questions/question-range/index.js.map +1 -1
- package/es/molecule/questions/template/index.d.ts +2 -6
- package/es/molecule/questions/template/index.d.ts.map +1 -1
- package/es/molecule/questions/template/index.js +5 -9
- package/es/molecule/questions/template/index.js.map +1 -1
- package/es/molecule/share/index.d.ts.map +1 -1
- package/es/molecule/share/index.js +1 -5
- package/es/molecule/share/index.js.map +1 -1
- package/es/organism/user-preferences/index.d.ts +0 -1
- package/es/organism/user-preferences/index.d.ts.map +1 -1
- package/es/organism/user-preferences/index.js +5 -9
- package/es/organism/user-preferences/index.js.map +1 -1
- package/es/template/app-review/template-context.d.ts +1 -1
- package/es/template/app-review/template-context.d.ts.map +1 -1
- package/es/template/app-review/template-context.js +2 -1
- package/es/template/app-review/template-context.js.map +1 -1
- package/es/template/common/search-page/index.d.ts +0 -2
- package/es/template/common/search-page/index.d.ts.map +1 -1
- package/es/template/common/search-page/index.js +4 -8
- package/es/template/common/search-page/index.js.map +1 -1
- package/lib/atom/provider/index.d.ts +1 -0
- package/lib/atom/provider/index.d.ts.map +1 -1
- package/lib/atom/provider/index.js +10 -1
- package/lib/atom/provider/index.js.map +1 -1
- package/lib/atom/provider/web-context.d.ts +1 -1
- package/lib/atom/provider/web-context.d.ts.map +1 -1
- package/lib/atom/provider/web-context.js +3 -1
- package/lib/atom/provider/web-context.js.map +1 -1
- package/lib/atom/review-header-step-item/index.d.ts.map +1 -1
- package/lib/atom/review-header-step-item/index.js +25 -6
- package/lib/atom/review-header-step-item/index.js.map +1 -1
- package/lib/globals.d.js.map +1 -1
- package/lib/molecule/add-to-my-list/index.js +1 -3
- package/lib/molecule/add-to-my-list/index.js.map +1 -1
- package/lib/molecule/answer/index.d.ts.map +1 -1
- package/lib/molecule/answer/index.js +6 -16
- package/lib/molecule/answer/index.js.map +1 -1
- package/lib/molecule/card/notification.js +1 -3
- package/lib/molecule/card/notification.js.map +1 -1
- package/lib/molecule/filters/filters-wrapper.d.ts +0 -1
- package/lib/molecule/filters/filters-wrapper.d.ts.map +1 -1
- package/lib/molecule/filters/filters-wrapper.js +5 -9
- package/lib/molecule/filters/filters-wrapper.js.map +1 -1
- package/lib/molecule/filters/index.d.ts +0 -1
- package/lib/molecule/filters/index.d.ts.map +1 -1
- package/lib/molecule/filters/index.js +3 -6
- package/lib/molecule/filters/index.js.map +1 -1
- package/lib/molecule/forum/forum-post/index.d.ts.map +1 -1
- package/lib/molecule/forum/forum-post/index.js +1 -2
- package/lib/molecule/forum/forum-post/index.js.map +1 -1
- package/lib/molecule/questions/drop-down/index.d.ts +0 -1
- package/lib/molecule/questions/drop-down/index.d.ts.map +1 -1
- package/lib/molecule/questions/drop-down/index.js +5 -9
- package/lib/molecule/questions/drop-down/index.js.map +1 -1
- package/lib/molecule/questions/qcm/index.d.ts +0 -1
- package/lib/molecule/questions/qcm/index.d.ts.map +1 -1
- package/lib/molecule/questions/qcm/index.js +5 -9
- package/lib/molecule/questions/qcm/index.js.map +1 -1
- package/lib/molecule/questions/qcm-drag/index.d.ts +1 -3
- package/lib/molecule/questions/qcm-drag/index.d.ts.map +1 -1
- package/lib/molecule/questions/qcm-drag/index.js +5 -9
- package/lib/molecule/questions/qcm-drag/index.js.map +1 -1
- package/lib/molecule/questions/qcm-graphic/index.d.ts +0 -1
- package/lib/molecule/questions/qcm-graphic/index.d.ts.map +1 -1
- package/lib/molecule/questions/qcm-graphic/index.js +5 -9
- package/lib/molecule/questions/qcm-graphic/index.js.map +1 -1
- package/lib/molecule/questions/question-range/index.d.ts +0 -1
- package/lib/molecule/questions/question-range/index.d.ts.map +1 -1
- package/lib/molecule/questions/question-range/index.js +6 -10
- package/lib/molecule/questions/question-range/index.js.map +1 -1
- package/lib/molecule/questions/template/index.d.ts +2 -6
- package/lib/molecule/questions/template/index.d.ts.map +1 -1
- package/lib/molecule/questions/template/index.js +5 -9
- package/lib/molecule/questions/template/index.js.map +1 -1
- package/lib/molecule/share/index.d.ts.map +1 -1
- package/lib/molecule/share/index.js +1 -5
- package/lib/molecule/share/index.js.map +1 -1
- package/lib/organism/user-preferences/index.d.ts +0 -1
- package/lib/organism/user-preferences/index.d.ts.map +1 -1
- package/lib/organism/user-preferences/index.js +5 -9
- package/lib/organism/user-preferences/index.js.map +1 -1
- package/lib/template/app-review/template-context.d.ts +1 -1
- package/lib/template/app-review/template-context.d.ts.map +1 -1
- package/lib/template/app-review/template-context.js +3 -1
- package/lib/template/app-review/template-context.js.map +1 -1
- package/lib/template/common/search-page/index.d.ts +0 -2
- package/lib/template/common/search-page/index.d.ts.map +1 -1
- package/lib/template/common/search-page/index.js +4 -8
- package/lib/template/common/search-page/index.js.map +1 -1
- package/locales/en/global.json +5 -3
- package/locales/fr/global.json +1 -6
- package/locales/ru/global.json +1 -6
- package/package.json +2 -2
|
@@ -2,6 +2,7 @@ export default Provider;
|
|
|
2
2
|
import WebContext from "./web-context";
|
|
3
3
|
import { useWebContext } from "./web-context";
|
|
4
4
|
export function GetSkinFromContext(legacyContext: any): any;
|
|
5
|
+
export function GetTranslateFromContext(legacyContext: any): any;
|
|
5
6
|
declare class Provider extends React.Component<any, any, any> {
|
|
6
7
|
static propTypes: {
|
|
7
8
|
history: PropTypes.Requireable<PropTypes.InferProps<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/provider/index.js"],"names":[],"mappings":";;;AAqGA,4DAMC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/provider/index.js"],"names":[],"mappings":";;;AAqGA,4DAMC;AAED,iEAKC;AA1DD;IACE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAQE;IAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAKE;IAEF;;;;MAQC;IAED,sCAKC;IADC;;;;;MAA+D;IAGjE;;;;;MAEC;CAMF"}
|
|
@@ -123,6 +123,16 @@ const GetSkinFromContext = legacyContext => {
|
|
|
123
123
|
return skin;
|
|
124
124
|
};
|
|
125
125
|
|
|
126
|
-
|
|
126
|
+
const GetTranslateFromContext = legacyContext => {
|
|
127
|
+
const context = useWebContext();
|
|
128
|
+
|
|
129
|
+
const legacyTranslate = _get('translate', legacyContext);
|
|
130
|
+
|
|
131
|
+
const translate = _getOr(legacyTranslate, 'translate', context);
|
|
132
|
+
|
|
133
|
+
return translate;
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
export { WebContext, useWebContext, GetSkinFromContext, GetTranslateFromContext };
|
|
127
137
|
export default Provider;
|
|
128
138
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","SrcPropType","ColorPropType","HexPropType","WebContext","useWebContext","DEFAULT_SKIN","common","good","bad","primary","life","brand","primaryAdd1","primaryAdd2","primaryAdd3","primaryAdd4","xtraLightGrey","light","medium","dark","grey","orangeAdd","orange","positive","lightGreen","negative","battle","white","black","mergeSkin","skin","historyShape","shape","createHref","func","push","skinShape","objectOf","images","logo","login","icons","mod","courses","arrayOf","texts","translateShape","Provider","Component","getDerivedStateFromProps","props","history","translate","constructor","context","Vimeo","state","getChildContext","render","children","Children","only","childContextTypes","object","propTypes","node","isRequired","GetSkinFromContext","legacyContext","legacySkin"],"sources":["../../../src/atom/provider/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {defaultsDeep, get, getOr} from 'lodash/fp';\nimport {SrcPropType, ColorPropType, HexPropType} from '../../util/proptypes';\nimport WebContext, {useWebContext} from './web-context';\n\nconst DEFAULT_SKIN = {\n common: {\n good: '#24b694',\n bad: '#ed1c24',\n primary: '#00B0FF',\n life: '#ed1c24',\n brand: '#00B0FF',\n primaryAdd1: '#B3E5FC',\n primaryAdd2: '#0091EA',\n primaryAdd3: '#0277BD',\n primaryAdd4: '#015798',\n xtraLightGrey: '#FAFAFA',\n light: '#ECEFF1',\n medium: '#90A4AE',\n dark: '#546E7A',\n grey: '#607D8B',\n orangeAdd: '#FF7043',\n orange: '#FFA000',\n positive: '#3EC483',\n lightGreen: '#66BB6A',\n negative: '#F73F52',\n battle: '#FFE100',\n white: '#FFFFFF',\n black: '#14171A'\n }\n};\n\nconst mergeSkin = (skin = {}) => defaultsDeep(DEFAULT_SKIN, skin);\n\nconst historyShape = PropTypes.shape({\n createHref: PropTypes.func,\n push: PropTypes.func\n});\n\nconst skinShape = PropTypes.shape({\n common: PropTypes.objectOf(ColorPropType),\n images: PropTypes.shape({\n 'logo-mobile': SrcPropType,\n logo: SrcPropType,\n 'logo-email': SrcPropType,\n login: SrcPropType\n }),\n icons: PropTypes.objectOf(HexPropType),\n mod: PropTypes.objectOf(ColorPropType),\n courses: PropTypes.arrayOf(ColorPropType),\n texts: PropTypes.objectOf(ColorPropType)\n});\n\nconst translateShape = PropTypes.func;\n\nclass Provider extends React.Component {\n static propTypes = {\n history: historyShape,\n skin: skinShape,\n translate: translateShape,\n children: PropTypes.node.isRequired,\n Vimeo: PropTypes.shape({\n common: PropTypes.func\n })\n };\n\n static childContextTypes = {\n history: historyShape,\n skin: skinShape,\n translate: translateShape,\n Vimeo: PropTypes.object\n };\n\n static getDerivedStateFromProps(props) {\n const {history, skin, translate} = props;\n\n return {\n history,\n skin: mergeSkin(skin),\n translate\n };\n }\n\n constructor(props, context) {\n super(props, context);\n const {history, skin, translate, Vimeo} = props;\n // eslint-disable-next-line react/no-unused-state\n this.state = {history, skin: mergeSkin(skin), translate, Vimeo};\n }\n\n getChildContext() {\n return this.state;\n }\n\n render() {\n const {children} = this.props;\n return React.Children.only(children);\n }\n}\n\nconst GetSkinFromContext = legacyContext => {\n const context = useWebContext();\n const legacySkin = get('skin', legacyContext);\n const skin = getOr(legacySkin, 'skin', context);\n\n return skin;\n};\n\nexport {WebContext, useWebContext, GetSkinFromContext};\nexport default Provider;\n"],"mappings":";;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,SAAQC,WAAR,EAAqBC,aAArB,EAAoCC,WAApC,QAAsD,sBAAtD;AACA,OAAOC,UAAP,IAAoBC,aAApB,QAAwC,eAAxC;AAEA,MAAMC,YAAY,GAAG;EACnBC,MAAM,EAAE;IACNC,IAAI,EAAE,SADA;IAENC,GAAG,EAAE,SAFC;IAGNC,OAAO,EAAE,SAHH;IAINC,IAAI,EAAE,SAJA;IAKNC,KAAK,EAAE,SALD;IAMNC,WAAW,EAAE,SANP;IAONC,WAAW,EAAE,SAPP;IAQNC,WAAW,EAAE,SARP;IASNC,WAAW,EAAE,SATP;IAUNC,aAAa,EAAE,SAVT;IAWNC,KAAK,EAAE,SAXD;IAYNC,MAAM,EAAE,SAZF;IAaNC,IAAI,EAAE,SAbA;IAcNC,IAAI,EAAE,SAdA;IAeNC,SAAS,EAAE,SAfL;IAgBNC,MAAM,EAAE,SAhBF;IAiBNC,QAAQ,EAAE,SAjBJ;IAkBNC,UAAU,EAAE,SAlBN;IAmBNC,QAAQ,EAAE,SAnBJ;IAoBNC,MAAM,EAAE,SApBF;IAqBNC,KAAK,EAAE,SArBD;IAsBNC,KAAK,EAAE;EAtBD;AADW,CAArB;;AA2BA,MAAMC,SAAS,GAAG,CAACC,IAAI,GAAG,EAAR,KAAe,cAAazB,YAAb,EAA2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,KAAKM,KAAL,GAAa;MAACL,OAAD;MAAUrB,IAAI,EAAED,SAAS,CAACC,IAAD,CAAzB;MAAiCsB,SAAjC;MAA4CG;IAA5C,CAAb;EACD;;EAEDE,eAAe,GAAG;IAChB,OAAO,KAAKD,KAAZ;EACD;;EAEDE,MAAM,GAAG;IACP,MAAM;MAACC;IAAD,IAAa,KAAKT,KAAxB;IACA,OAAOpD,KAAK,CAAC8D,QAAN,CAAeC,IAAf,CAAoBF,QAApB,CAAP;EACD;;AA1CoC;;AAAjCZ,Q,CAWGe,iB,GAAoB;EACzBX,OAAO,EAAEpB,YADgB;EAEzBD,IAAI,EAAEM,SAFmB;EAGzBgB,SAAS,EAAEN,cAHc;EAIzBS,KAAK,EAAExD,SAAS,CAACgE;AAJQ,C;AAXvBhB,Q,CACGiB,S,2CAAY;EACjBb,OAAO,EAAEpB,YADQ;EAEjBD,IAAI,EAAEM,SAFW;EAGjBgB,SAAS,EAAEN,cAHM;EAIjBa,QAAQ,EAAE5D,SAAS,CAACkE,IAAV,CAAeC,UAJR;EAKjBX,KAAK,EAAExD,SAAS,CAACiC,KAAV,CAAgB;IACrB1B,MAAM,EAAEP,SAAS,CAACmC;EADG,CAAhB;AALU,C;;AA4CrB,MAAMiC,kBAAkB,GAAGC,aAAa,IAAI;EAC1C,MAAMd,OAAO,GAAGlD,aAAa,EAA7B;;EACA,MAAMiE,UAAU,GAAG,KAAI,MAAJ,EAAYD,aAAZ,CAAnB;;EACA,MAAMtC,IAAI,GAAG,OAAMuC,UAAN,EAAkB,MAAlB,EAA0Bf,OAA1B,CAAb;;EAEA,OAAOxB,IAAP;AACD,CAND;;AAQA,
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","SrcPropType","ColorPropType","HexPropType","WebContext","useWebContext","DEFAULT_SKIN","common","good","bad","primary","life","brand","primaryAdd1","primaryAdd2","primaryAdd3","primaryAdd4","xtraLightGrey","light","medium","dark","grey","orangeAdd","orange","positive","lightGreen","negative","battle","white","black","mergeSkin","skin","historyShape","shape","createHref","func","push","skinShape","objectOf","images","logo","login","icons","mod","courses","arrayOf","texts","translateShape","Provider","Component","getDerivedStateFromProps","props","history","translate","constructor","context","Vimeo","state","getChildContext","render","children","Children","only","childContextTypes","object","propTypes","node","isRequired","GetSkinFromContext","legacyContext","legacySkin","GetTranslateFromContext","legacyTranslate"],"sources":["../../../src/atom/provider/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {defaultsDeep, get, getOr} from 'lodash/fp';\nimport {SrcPropType, ColorPropType, HexPropType} from '../../util/proptypes';\nimport WebContext, {useWebContext} from './web-context';\n\nconst DEFAULT_SKIN = {\n common: {\n good: '#24b694',\n bad: '#ed1c24',\n primary: '#00B0FF',\n life: '#ed1c24',\n brand: '#00B0FF',\n primaryAdd1: '#B3E5FC',\n primaryAdd2: '#0091EA',\n primaryAdd3: '#0277BD',\n primaryAdd4: '#015798',\n xtraLightGrey: '#FAFAFA',\n light: '#ECEFF1',\n medium: '#90A4AE',\n dark: '#546E7A',\n grey: '#607D8B',\n orangeAdd: '#FF7043',\n orange: '#FFA000',\n positive: '#3EC483',\n lightGreen: '#66BB6A',\n negative: '#F73F52',\n battle: '#FFE100',\n white: '#FFFFFF',\n black: '#14171A'\n }\n};\n\nconst mergeSkin = (skin = {}) => defaultsDeep(DEFAULT_SKIN, skin);\n\nconst historyShape = PropTypes.shape({\n createHref: PropTypes.func,\n push: PropTypes.func\n});\n\nconst skinShape = PropTypes.shape({\n common: PropTypes.objectOf(ColorPropType),\n images: PropTypes.shape({\n 'logo-mobile': SrcPropType,\n logo: SrcPropType,\n 'logo-email': SrcPropType,\n login: SrcPropType\n }),\n icons: PropTypes.objectOf(HexPropType),\n mod: PropTypes.objectOf(ColorPropType),\n courses: PropTypes.arrayOf(ColorPropType),\n texts: PropTypes.objectOf(ColorPropType)\n});\n\nconst translateShape = PropTypes.func;\n\nclass Provider extends React.Component {\n static propTypes = {\n history: historyShape,\n skin: skinShape,\n translate: translateShape,\n children: PropTypes.node.isRequired,\n Vimeo: PropTypes.shape({\n common: PropTypes.func\n })\n };\n\n static childContextTypes = {\n history: historyShape,\n skin: skinShape,\n translate: translateShape,\n Vimeo: PropTypes.object\n };\n\n static getDerivedStateFromProps(props) {\n const {history, skin, translate} = props;\n\n return {\n history,\n skin: mergeSkin(skin),\n translate\n };\n }\n\n constructor(props, context) {\n super(props, context);\n const {history, skin, translate, Vimeo} = props;\n // eslint-disable-next-line react/no-unused-state\n this.state = {history, skin: mergeSkin(skin), translate, Vimeo};\n }\n\n getChildContext() {\n return this.state;\n }\n\n render() {\n const {children} = this.props;\n return React.Children.only(children);\n }\n}\n\nconst GetSkinFromContext = legacyContext => {\n const context = useWebContext();\n const legacySkin = get('skin', legacyContext);\n const skin = getOr(legacySkin, 'skin', context);\n\n return skin;\n};\n\nconst GetTranslateFromContext = legacyContext => {\n const context = useWebContext();\n const legacyTranslate = get('translate', legacyContext);\n const translate = getOr(legacyTranslate, 'translate', context);\n return translate;\n};\n\nexport {WebContext, useWebContext, GetSkinFromContext, GetTranslateFromContext};\nexport default Provider;\n"],"mappings":";;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,SAAQC,WAAR,EAAqBC,aAArB,EAAoCC,WAApC,QAAsD,sBAAtD;AACA,OAAOC,UAAP,IAAoBC,aAApB,QAAwC,eAAxC;AAEA,MAAMC,YAAY,GAAG;EACnBC,MAAM,EAAE;IACNC,IAAI,EAAE,SADA;IAENC,GAAG,EAAE,SAFC;IAGNC,OAAO,EAAE,SAHH;IAINC,IAAI,EAAE,SAJA;IAKNC,KAAK,EAAE,SALD;IAMNC,WAAW,EAAE,SANP;IAONC,WAAW,EAAE,SAPP;IAQNC,WAAW,EAAE,SARP;IASNC,WAAW,EAAE,SATP;IAUNC,aAAa,EAAE,SAVT;IAWNC,KAAK,EAAE,SAXD;IAYNC,MAAM,EAAE,SAZF;IAaNC,IAAI,EAAE,S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Z,CAAnB;;EACA,MAAMtC,IAAI,GAAG,OAAMuC,UAAN,EAAkB,MAAlB,EAA0Bf,OAA1B,CAAb;;EAEA,OAAOxB,IAAP;AACD,CAND;;AAQA,MAAMwC,uBAAuB,GAAGF,aAAa,IAAI;EAC/C,MAAMd,OAAO,GAAGlD,aAAa,EAA7B;;EACA,MAAMmE,eAAe,GAAG,KAAI,WAAJ,EAAiBH,aAAjB,CAAxB;;EACA,MAAMhB,SAAS,GAAG,OAAMmB,eAAN,EAAuB,WAAvB,EAAoCjB,OAApC,CAAlB;;EACA,OAAOF,SAAP;AACD,CALD;;AAOA,SAAQjD,UAAR,EAAoBC,aAApB,EAAmC+D,kBAAnC,EAAuDG,uBAAvD;AACA,eAAevB,QAAf"}
|
|
@@ -6,7 +6,7 @@ declare type Skin = {
|
|
|
6
6
|
};
|
|
7
7
|
declare type WebContextValues = {
|
|
8
8
|
skin?: Skin;
|
|
9
|
-
translate: (key: string, data?:
|
|
9
|
+
translate: (key: string, data?: Record<string, string>) => string;
|
|
10
10
|
};
|
|
11
11
|
declare type Props = WebContextValues & {
|
|
12
12
|
children: ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web-context.d.ts","sourceRoot":"","sources":["../../../src/atom/provider/web-context.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAgB,SAAS,EAAa,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"web-context.d.ts","sourceRoot":"","sources":["../../../src/atom/provider/web-context.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAgB,SAAS,EAAa,MAAM,OAAO,CAAC;AAGlE,aAAK,IAAI,GAAG;IACV,MAAM,EAAE;QACN,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;CACH,CAAC;AAEF,aAAK,gBAAgB,GAAG;IACtB,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,MAAM,CAAC;CACnE,CAAC;AAMF,aAAK,KAAK,GAAG,gBAAgB,GAAG;IAC9B,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF,QAAA,MAAM,UAAU,2BAA0B,KAAK,gBAE9C,CAAC;AAEF,eAAO,MAAM,aAAa,QAAO,gBAQhC,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -3,8 +3,9 @@ const _excluded = ["children"];
|
|
|
3
3
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
4
4
|
|
|
5
5
|
import React, { createContext, useContext } from 'react';
|
|
6
|
+
import { mockTranslate } from '@coorpacademy/translate';
|
|
6
7
|
const Context = /*#__PURE__*/createContext({
|
|
7
|
-
translate:
|
|
8
|
+
translate: mockTranslate
|
|
8
9
|
});
|
|
9
10
|
|
|
10
11
|
const WebContext = _ref => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web-context.js","names":["React","createContext","useContext","
|
|
1
|
+
{"version":3,"file":"web-context.js","names":["React","createContext","useContext","mockTranslate","Context","translate","WebContext","children","value","useWebContext","context","Error"],"sources":["../../../src/atom/provider/web-context.tsx"],"sourcesContent":["import React, {createContext, ReactNode, useContext} from 'react';\nimport {mockTranslate} from '@coorpacademy/translate';\n\ntype Skin = {\n common: {\n primary: string;\n };\n};\n\ntype WebContextValues = {\n skin?: Skin;\n translate: (key: string, data?: Record<string, string>) => string;\n};\n\nconst Context = createContext({\n translate: mockTranslate\n});\n\ntype Props = WebContextValues & {\n children: ReactNode;\n};\n\nconst WebContext = ({children, ...value}: Props) => {\n return <Context.Provider value={value}>{children}</Context.Provider>;\n};\n\nexport const useWebContext = (): WebContextValues => {\n const context = useContext(Context);\n\n if (!context) {\n throw new Error('❌ [WebContext] useWebContext must be used within a provider <WebContext>');\n }\n\n return context;\n};\n\nexport default WebContext;\n"],"mappings":";;;;AAAA,OAAOA,KAAP,IAAeC,aAAf,EAAyCC,UAAzC,QAA0D,OAA1D;AACA,SAAQC,aAAR,QAA4B,yBAA5B;AAaA,MAAMC,OAAO,gBAAGH,aAAa,CAAC;EAC5BI,SAAS,EAAEF;AADiB,CAAD,CAA7B;;AAQA,MAAMG,UAAU,GAAG,QAAiC;EAAA,IAAhC;IAACC;EAAD,CAAgC;EAAA,IAAlBC,KAAkB;;EAClD,oBAAO,oBAAC,OAAD,CAAS,QAAT;IAAkB,KAAK,EAAEA;EAAzB,GAAiCD,QAAjC,CAAP;AACD,CAFD;;AAIA,OAAO,MAAME,aAAa,GAAG,MAAwB;EACnD,MAAMC,OAAO,GAAGR,UAAU,CAACE,OAAD,CAA1B;;EAEA,IAAI,CAACM,OAAL,EAAc;IACZ,MAAM,IAAIC,KAAJ,CAAU,0EAAV,CAAN;EACD;;EAED,OAAOD,OAAP;AACD,CARM;AAUP,eAAeJ,UAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/review-header-step-item/index.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/review-header-step-item/index.tsx"],"names":[],"mappings":";AAQA,OAAkB,EAAC,mBAAmB,EAAC,MAAM,SAAS,CAAC;AAsDvD,QAAA,MAAM,oBAAoB;YAAW,mBAAmB;;;;;;CAevD,CAAC;AAIF,eAAe,oBAAoB,CAAC"}
|
|
@@ -1,31 +1,46 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import classnames from 'classnames';
|
|
3
3
|
import { NovaCompositionCoorpacademyCheck as RightIcon, NovaSolidStatusClose as WrongIcon } from '@coorpacademy/nova-icons';
|
|
4
|
+
import { GetTranslateFromContext } from '../provider';
|
|
4
5
|
import style from './style.css';
|
|
5
6
|
import propTypes from './types';
|
|
6
7
|
|
|
7
|
-
const Content =
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
const Content = props => {
|
|
9
|
+
const {
|
|
10
|
+
icon,
|
|
11
|
+
current,
|
|
12
|
+
value
|
|
13
|
+
} = props;
|
|
14
|
+
const translate = GetTranslateFromContext();
|
|
12
15
|
let child;
|
|
16
|
+
let ariaDescription;
|
|
13
17
|
|
|
14
18
|
switch (icon) {
|
|
15
19
|
case 'no-answer':
|
|
16
20
|
child = value;
|
|
21
|
+
ariaDescription = current ? translate('review_header_step_item.current_question', {
|
|
22
|
+
headerStepValue: value
|
|
23
|
+
}) : translate('review_header_step_item.not_answered_question', {
|
|
24
|
+
headerStepValue: value
|
|
25
|
+
});
|
|
17
26
|
break;
|
|
18
27
|
|
|
19
28
|
case 'right':
|
|
20
29
|
child = /*#__PURE__*/React.createElement(RightIcon, {
|
|
21
30
|
className: classnames(style.rightIcon, current && style.currentRightIcon)
|
|
22
31
|
});
|
|
32
|
+
ariaDescription = translate('review_header_step_item.correct_question', {
|
|
33
|
+
headerStepValue: value
|
|
34
|
+
});
|
|
23
35
|
break;
|
|
24
36
|
|
|
25
37
|
case 'wrong':
|
|
26
38
|
child = /*#__PURE__*/React.createElement(WrongIcon, {
|
|
27
39
|
className: classnames(style.wrongIcon, current && style.currentWrongIcon)
|
|
28
40
|
});
|
|
41
|
+
ariaDescription = translate('review_header_step_item.incorrect_question', {
|
|
42
|
+
headerStepValue: value
|
|
43
|
+
});
|
|
29
44
|
break;
|
|
30
45
|
|
|
31
46
|
default:
|
|
@@ -34,7 +49,10 @@ const Content = ({
|
|
|
34
49
|
|
|
35
50
|
return /*#__PURE__*/React.createElement("span", {
|
|
36
51
|
className: style.value,
|
|
37
|
-
"aria-label":
|
|
52
|
+
"aria-label": translate('review_header_step_item.aria_label', {
|
|
53
|
+
headerStepValue: value
|
|
54
|
+
}),
|
|
55
|
+
"aria-describedby": ariaDescription
|
|
38
56
|
}, child);
|
|
39
57
|
};
|
|
40
58
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","classnames","NovaCompositionCoorpacademyCheck","RightIcon","NovaSolidStatusClose","WrongIcon","style","propTypes","Content","icon","current","value","child","rightIcon","currentRightIcon","wrongIcon","currentWrongIcon","ReviewHeaderStepItem","
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","classnames","NovaCompositionCoorpacademyCheck","RightIcon","NovaSolidStatusClose","WrongIcon","GetTranslateFromContext","style","propTypes","Content","props","icon","current","value","translate","child","ariaDescription","headerStepValue","rightIcon","currentRightIcon","wrongIcon","currentWrongIcon","ReviewHeaderStepItem","default","right","wrong"],"sources":["../../../src/atom/review-header-step-item/index.tsx"],"sourcesContent":["import React from 'react';\nimport classnames from 'classnames';\nimport {\n NovaCompositionCoorpacademyCheck as RightIcon,\n NovaSolidStatusClose as WrongIcon\n} from '@coorpacademy/nova-icons';\nimport {GetTranslateFromContext} from '../provider';\nimport style from './style.css';\nimport propTypes, {HeaderStepItemProps} from './types';\n\nconst Content = (props: HeaderStepItemProps) => {\n const {icon, current, value} = props;\n const translate = GetTranslateFromContext();\n let child;\n let ariaDescription;\n switch (icon) {\n case 'no-answer':\n child = value;\n ariaDescription = current\n ? translate('review_header_step_item.current_question', {\n headerStepValue: value\n })\n : translate('review_header_step_item.not_answered_question', {\n headerStepValue: value\n });\n break;\n\n case 'right':\n child = (\n <RightIcon className={classnames(style.rightIcon, current && style.currentRightIcon)} />\n );\n ariaDescription = translate('review_header_step_item.correct_question', {\n headerStepValue: value\n });\n break;\n\n case 'wrong':\n child = (\n <WrongIcon className={classnames(style.wrongIcon, current && style.currentWrongIcon)} />\n );\n ariaDescription = translate('review_header_step_item.incorrect_question', {\n headerStepValue: value\n });\n break;\n\n default:\n return null;\n }\n\n return (\n <span\n className={style.value}\n aria-label={translate('review_header_step_item.aria_label', {\n headerStepValue: value\n })}\n aria-describedby={ariaDescription}\n >\n {child}\n </span>\n );\n};\n\nconst ReviewHeaderStepItem = (props: HeaderStepItemProps) => {\n const {icon, current} = props;\n return (\n <div\n className={classnames(\n style.default,\n icon === 'right' && style.right,\n icon === 'wrong' && style.wrong,\n current && style.current\n )}\n data-name=\"header-step-item\"\n >\n <Content {...props} />\n </div>\n );\n};\n\nReviewHeaderStepItem.propTypes = propTypes;\n\nexport default ReviewHeaderStepItem;\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,SACEC,gCAAgC,IAAIC,SADtC,EAEEC,oBAAoB,IAAIC,SAF1B,QAGO,0BAHP;AAIA,SAAQC,uBAAR,QAAsC,aAAtC;AACA,OAAOC,KAAP,MAAkB,aAAlB;AACA,OAAOC,SAAP,MAA6C,SAA7C;;AAEA,MAAMC,OAAO,GAAIC,KAAD,IAAgC;EAC9C,MAAM;IAACC,IAAD;IAAOC,OAAP;IAAgBC;EAAhB,IAAyBH,KAA/B;EACA,MAAMI,SAAS,GAAGR,uBAAuB,EAAzC;EACA,IAAIS,KAAJ;EACA,IAAIC,eAAJ;;EACA,QAAQL,IAAR;IACE,KAAK,WAAL;MACEI,KAAK,GAAGF,KAAR;MACAG,eAAe,GAAGJ,OAAO,GACrBE,SAAS,CAAC,0CAAD,EAA6C;QACpDG,eAAe,EAAEJ;MADmC,CAA7C,CADY,GAIrBC,SAAS,CAAC,+CAAD,EAAkD;QACzDG,eAAe,EAAEJ;MADwC,CAAlD,CAJb;MAOA;;IAEF,KAAK,OAAL;MACEE,KAAK,gBACH,oBAAC,SAAD;QAAW,SAAS,EAAEd,UAAU,CAACM,KAAK,CAACW,SAAP,EAAkBN,OAAO,IAAIL,KAAK,CAACY,gBAAnC;MAAhC,EADF;MAGAH,eAAe,GAAGF,SAAS,CAAC,0CAAD,EAA6C;QACtEG,eAAe,EAAEJ;MADqD,CAA7C,CAA3B;MAGA;;IAEF,KAAK,OAAL;MACEE,KAAK,gBACH,oBAAC,SAAD;QAAW,SAAS,EAAEd,UAAU,CAACM,KAAK,CAACa,SAAP,EAAkBR,OAAO,IAAIL,KAAK,CAACc,gBAAnC;MAAhC,EADF;MAGAL,eAAe,GAAGF,SAAS,CAAC,4CAAD,EAA+C;QACxEG,eAAe,EAAEJ;MADuD,CAA/C,CAA3B;MAGA;;IAEF;MACE,OAAO,IAAP;EA/BJ;;EAkCA,oBACE;IACE,SAAS,EAAEN,KAAK,CAACM,KADnB;IAEE,cAAYC,SAAS,CAAC,oCAAD,EAAuC;MAC1DG,eAAe,EAAEJ;IADyC,CAAvC,CAFvB;IAKE,oBAAkBG;EALpB,GAOGD,KAPH,CADF;AAWD,CAlDD;;AAoDA,MAAMO,oBAAoB,GAAIZ,KAAD,IAAgC;EAC3D,MAAM;IAACC,IAAD;IAAOC;EAAP,IAAkBF,KAAxB;EACA,oBACE;IACE,SAAS,EAAET,UAAU,CACnBM,KAAK,CAACgB,OADa,EAEnBZ,IAAI,KAAK,OAAT,IAAoBJ,KAAK,CAACiB,KAFP,EAGnBb,IAAI,KAAK,OAAT,IAAoBJ,KAAK,CAACkB,KAHP,EAInBb,OAAO,IAAIL,KAAK,CAACK,OAJE,CADvB;IAOE,aAAU;EAPZ,gBASE,oBAAC,OAAD,EAAaF,KAAb,CATF,CADF;AAaD,CAfD;;AAiBAY,oBAAoB,CAACd,SAArB,2CAAiCA,SAAjC;AAEA,eAAec,oBAAf"}
|
package/es/globals.d.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"globals.d.js","names":[],"sources":["../src/globals.d.ts"],"sourcesContent":["declare module '@coorpacademy/nova-icons';\ndeclare module '@coorpacademy/react-native-slider';\ndeclare module '@react-native-community/blur';\ndeclare module 'react-native/*';\ndeclare module 'color';\ndeclare module 'classnames';\ndeclare module '*.css';\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"globals.d.js","names":[],"sources":["../src/globals.d.ts"],"sourcesContent":["declare module '@coorpacademy/nova-icons';\ndeclare module '@coorpacademy/react-native-slider';\ndeclare module '@react-native-community/blur';\ndeclare module '@coorpacademy/translate';\ndeclare module 'react-native/*';\ndeclare module 'color';\ndeclare module 'classnames';\ndeclare module '*.css';\n"],"mappings":""}
|
|
@@ -42,9 +42,7 @@ export const AddToMyListFeedback = ({
|
|
|
42
42
|
className: styles.checkIcon,
|
|
43
43
|
width: 13,
|
|
44
44
|
height: 13
|
|
45
|
-
}), /*#__PURE__*/React.createElement("p",
|
|
46
|
-
role: "status"
|
|
47
|
-
}, favorite ? addToMyListText : removeFromMyListText));
|
|
45
|
+
}), /*#__PURE__*/React.createElement("p", null, favorite ? addToMyListText : removeFromMyListText));
|
|
48
46
|
};
|
|
49
47
|
|
|
50
48
|
const AddToMyList = ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useState","useContext","useEffect","useMemo","PropTypes","classnames","NovaCompositionCoorpacademyCheck","CheckIcon","NovaCompositionNavigationMore","MoreIcon","Link","styles","ADD_TO_MY_LIST_STATUS","IDLE","SUCCESS","StatusContext","createContext","AddToMyListStatusProvider","children","status","setStatus","timeoutId","DURATION","setTimeout","clearTimeout","statusValue","AddToMyListFeedback","addToMyListText","removeFromMyListText","favorite","feedback","checkIcon","AddToMyList","style","addToMyListButton","onFavoriteClick","cb","onClick","container","cta","wrapper","shareIcon","propTypes","node","string","bool","func"],"sources":["../../../src/molecule/add-to-my-list/index.js"],"sourcesContent":["import React, {useState, useContext, useEffect, useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {\n NovaCompositionCoorpacademyCheck as CheckIcon,\n NovaCompositionNavigationMore as MoreIcon\n} from '@coorpacademy/nova-icons';\nimport Link from '../../atom/link';\nimport styles from './style.css';\n\nconst ADD_TO_MY_LIST_STATUS = {\n IDLE: 'IDLE',\n SUCCESS: 'SUCCESS'\n};\n\nconst StatusContext = React.createContext(ADD_TO_MY_LIST_STATUS.IDLE);\n\nexport const AddToMyListStatusProvider = ({children}) => {\n const [status, setStatus] = useState(ADD_TO_MY_LIST_STATUS.IDLE);\n useEffect(() => {\n let timeoutId;\n const DURATION = 3000;\n if (status !== ADD_TO_MY_LIST_STATUS.IDLE) {\n timeoutId = setTimeout(() => setStatus(ADD_TO_MY_LIST_STATUS.IDLE), DURATION);\n }\n return () => clearTimeout(timeoutId);\n }, [status]);\n const statusValue = useMemo(() => [status, setStatus], [status, setStatus]);\n return <StatusContext.Provider value={statusValue}>{children}</StatusContext.Provider>;\n};\n\nexport const AddToMyListFeedback = ({addToMyListText, removeFromMyListText, favorite}) => {\n const [status] = useContext(StatusContext);\n if (status === ADD_TO_MY_LIST_STATUS.IDLE) return null;\n\n return (\n <div className={classnames(styles.feedback)} data-name={'add-to-my-list-feedback'}>\n <CheckIcon className={styles.checkIcon} width={13} height={13} />\n <p
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useState","useContext","useEffect","useMemo","PropTypes","classnames","NovaCompositionCoorpacademyCheck","CheckIcon","NovaCompositionNavigationMore","MoreIcon","Link","styles","ADD_TO_MY_LIST_STATUS","IDLE","SUCCESS","StatusContext","createContext","AddToMyListStatusProvider","children","status","setStatus","timeoutId","DURATION","setTimeout","clearTimeout","statusValue","AddToMyListFeedback","addToMyListText","removeFromMyListText","favorite","feedback","checkIcon","AddToMyList","style","addToMyListButton","onFavoriteClick","cb","onClick","container","cta","wrapper","shareIcon","propTypes","node","string","bool","func"],"sources":["../../../src/molecule/add-to-my-list/index.js"],"sourcesContent":["import React, {useState, useContext, useEffect, useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {\n NovaCompositionCoorpacademyCheck as CheckIcon,\n NovaCompositionNavigationMore as MoreIcon\n} from '@coorpacademy/nova-icons';\nimport Link from '../../atom/link';\nimport styles from './style.css';\n\nconst ADD_TO_MY_LIST_STATUS = {\n IDLE: 'IDLE',\n SUCCESS: 'SUCCESS'\n};\n\nconst StatusContext = React.createContext(ADD_TO_MY_LIST_STATUS.IDLE);\n\nexport const AddToMyListStatusProvider = ({children}) => {\n const [status, setStatus] = useState(ADD_TO_MY_LIST_STATUS.IDLE);\n useEffect(() => {\n let timeoutId;\n const DURATION = 3000;\n if (status !== ADD_TO_MY_LIST_STATUS.IDLE) {\n timeoutId = setTimeout(() => setStatus(ADD_TO_MY_LIST_STATUS.IDLE), DURATION);\n }\n return () => clearTimeout(timeoutId);\n }, [status]);\n const statusValue = useMemo(() => [status, setStatus], [status, setStatus]);\n return <StatusContext.Provider value={statusValue}>{children}</StatusContext.Provider>;\n};\n\nexport const AddToMyListFeedback = ({addToMyListText, removeFromMyListText, favorite}) => {\n const [status] = useContext(StatusContext);\n if (status === ADD_TO_MY_LIST_STATUS.IDLE) return null;\n\n return (\n <div className={classnames(styles.feedback)} data-name={'add-to-my-list-feedback'}>\n <CheckIcon className={styles.checkIcon} width={13} height={13} />\n <p>{favorite ? addToMyListText : removeFromMyListText}</p>\n </div>\n );\n};\n\nconst AddToMyList = ({style, addToMyListButton, favorite, onFavoriteClick}) => {\n const [, setStatus] = useContext(StatusContext);\n const cb = () => setStatus(ADD_TO_MY_LIST_STATUS.SUCCESS);\n\n function onClick() {\n onFavoriteClick(cb);\n }\n\n return (\n <div className={(styles.container, style)}>\n <Link data-name={'add-to-my-list-button'} onClick={onClick} className={styles.cta}>\n <div className={styles.wrapper}>\n {favorite ? (\n <CheckIcon className={styles.shareIcon} width={15} height={15} />\n ) : (\n <MoreIcon className={styles.shareIcon} width={12} height={12} />\n )}\n <p>{addToMyListButton}</p>\n </div>\n </Link>\n </div>\n );\n};\n\nAddToMyListStatusProvider.propTypes = {\n children: PropTypes.node\n};\n\nAddToMyListFeedback.propTypes = {\n addToMyListText: PropTypes.string,\n removeFromMyListText: PropTypes.string,\n favorite: PropTypes.bool\n};\n\nAddToMyList.propTypes = {\n style: PropTypes.string,\n addToMyListButton: PropTypes.string,\n favorite: PropTypes.bool,\n onFavoriteClick: PropTypes.func\n};\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,MAAM,EAAE;EAA1D,EAJJ,eAME,+BAAIP,iBAAJ,CANF,CADF,CADF,CADF;AAcD,CAtBD;;AAwBAjB,yBAAyB,CAACyB,SAA1B,2CAAsC;EACpCxB,QAAQ,EAAEd,SAAS,CAACuC;AADgB,CAAtC;AAIAjB,mBAAmB,CAACgB,SAApB,2CAAgC;EAC9Bf,eAAe,EAAEvB,SAAS,CAACwC,MADG;EAE9BhB,oBAAoB,EAAExB,SAAS,CAACwC,MAFF;EAG9Bf,QAAQ,EAAEzB,SAAS,CAACyC;AAHU,CAAhC;AAMAb,WAAW,CAACU,SAAZ,2CAAwB;EACtBT,KAAK,EAAE7B,SAAS,CAACwC,MADK;EAEtBV,iBAAiB,EAAE9B,SAAS,CAACwC,MAFP;EAGtBf,QAAQ,EAAEzB,SAAS,CAACyC,IAHE;EAItBV,eAAe,EAAE/B,SAAS,CAAC0C;AAJL,CAAxB;AAOA,eAAed,WAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/answer/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/answer/index.js"],"names":[],"mappings":";AA4EA,iDASC"}
|
|
@@ -74,38 +74,28 @@ const Switch = ({
|
|
|
74
74
|
switch (type) {
|
|
75
75
|
case 'qcmDrag':
|
|
76
76
|
return /*#__PURE__*/React.createElement(QcmDrag, _extends({}, model, {
|
|
77
|
-
help: help
|
|
78
|
-
groupAriaLabel: translate('answer_the_question')
|
|
77
|
+
help: help
|
|
79
78
|
}));
|
|
80
79
|
|
|
81
80
|
case 'qcm':
|
|
82
|
-
return /*#__PURE__*/React.createElement(Qcm,
|
|
83
|
-
groupAriaLabel: translate('answer_the_question')
|
|
84
|
-
}));
|
|
81
|
+
return /*#__PURE__*/React.createElement(Qcm, model);
|
|
85
82
|
|
|
86
83
|
case 'qcmGraphic':
|
|
87
|
-
return /*#__PURE__*/React.createElement(QcmGraphic,
|
|
88
|
-
groupAriaLabel: translate('answer_the_question')
|
|
89
|
-
}));
|
|
84
|
+
return /*#__PURE__*/React.createElement(QcmGraphic, model);
|
|
90
85
|
|
|
91
86
|
case 'freeText':
|
|
92
87
|
return /*#__PURE__*/React.createElement(FreeText, model);
|
|
93
88
|
|
|
94
89
|
case 'dropDown':
|
|
95
90
|
return /*#__PURE__*/React.createElement(DropDown, _extends({}, model, {
|
|
96
|
-
"aria-label": translate('drop_down_icon')
|
|
97
|
-
groupAriaLabel: translate('answer_the_question')
|
|
91
|
+
"aria-label": translate('drop_down_icon')
|
|
98
92
|
}));
|
|
99
93
|
|
|
100
94
|
case 'slider':
|
|
101
|
-
return /*#__PURE__*/React.createElement(QuestionRange,
|
|
102
|
-
groupAriaLabel: translate('answer_the_question')
|
|
103
|
-
}));
|
|
95
|
+
return /*#__PURE__*/React.createElement(QuestionRange, model);
|
|
104
96
|
|
|
105
97
|
case 'template':
|
|
106
|
-
return /*#__PURE__*/React.createElement(Template,
|
|
107
|
-
groupAriaLabel: translate('answer_the_question')
|
|
108
|
-
}));
|
|
98
|
+
return /*#__PURE__*/React.createElement(Template, model);
|
|
109
99
|
}
|
|
110
100
|
};
|
|
111
101
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","VideoPlayer","DropDown","FreeText","QcmDrag","Qcm","QcmGraphic","QuestionRange","Template","Provider","Audio","style","propTypes","MediaViewPropTypes","TYPE_AUDIO","TYPE_IMAGE","TYPE_VIDEO","MediaView","media","videoId","type","childProps","backgroundImage","url","video","audio","Switch","model","help","translate","contextTypes","childContextTypes","Answer","props","wrapper"],"sources":["../../../src/molecule/answer/index.js"],"sourcesContent":["import React from 'react';\nimport {omit} from 'lodash/fp';\nimport VideoPlayer from '../video-player';\nimport DropDown from '../questions/drop-down';\nimport FreeText from '../questions/free-text';\nimport QcmDrag from '../questions/qcm-drag';\nimport Qcm from '../questions/qcm';\nimport QcmGraphic from '../questions/qcm-graphic';\nimport QuestionRange from '../questions/question-range';\nimport Template from '../questions/template';\nimport Provider from '../../atom/provider';\nimport Audio from '../audio';\nimport style from './style.css';\nimport propTypes, {MediaViewPropTypes, TYPE_AUDIO, TYPE_IMAGE, TYPE_VIDEO} from './prop-types';\n\nconst MediaView = ({media}) => {\n const {videoId, type, ...childProps} = media;\n switch (type) {\n case TYPE_IMAGE:\n return (\n <div\n className={style.media}\n style={{\n backgroundImage: `url(${media.url})`\n }}\n />\n );\n case TYPE_VIDEO:\n return (\n <div className={style.video}>\n <VideoPlayer {...omit('id', childProps)} id={videoId} height=\"100%\" width=\"100%\" />\n </div>\n );\n case TYPE_AUDIO:\n return (\n <div className={style.audio}>\n <Audio {...omit('id', childProps)} height=\"100%\" width=\"100%\" />\n </div>\n );\n default:\n return null;\n }\n};\n\nMediaView.propTypes = MediaViewPropTypes;\n\nconst Switch = ({model, help}, {translate}) => {\n const {type} = model;\n\n switch (type) {\n case 'qcmDrag':\n return <QcmDrag {...model} help={help}
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","VideoPlayer","DropDown","FreeText","QcmDrag","Qcm","QcmGraphic","QuestionRange","Template","Provider","Audio","style","propTypes","MediaViewPropTypes","TYPE_AUDIO","TYPE_IMAGE","TYPE_VIDEO","MediaView","media","videoId","type","childProps","backgroundImage","url","video","audio","Switch","model","help","translate","contextTypes","childContextTypes","Answer","props","wrapper"],"sources":["../../../src/molecule/answer/index.js"],"sourcesContent":["import React from 'react';\nimport {omit} from 'lodash/fp';\nimport VideoPlayer from '../video-player';\nimport DropDown from '../questions/drop-down';\nimport FreeText from '../questions/free-text';\nimport QcmDrag from '../questions/qcm-drag';\nimport Qcm from '../questions/qcm';\nimport QcmGraphic from '../questions/qcm-graphic';\nimport QuestionRange from '../questions/question-range';\nimport Template from '../questions/template';\nimport Provider from '../../atom/provider';\nimport Audio from '../audio';\nimport style from './style.css';\nimport propTypes, {MediaViewPropTypes, TYPE_AUDIO, TYPE_IMAGE, TYPE_VIDEO} from './prop-types';\n\nconst MediaView = ({media}) => {\n const {videoId, type, ...childProps} = media;\n switch (type) {\n case TYPE_IMAGE:\n return (\n <div\n className={style.media}\n style={{\n backgroundImage: `url(${media.url})`\n }}\n />\n );\n case TYPE_VIDEO:\n return (\n <div className={style.video}>\n <VideoPlayer {...omit('id', childProps)} id={videoId} height=\"100%\" width=\"100%\" />\n </div>\n );\n case TYPE_AUDIO:\n return (\n <div className={style.audio}>\n <Audio {...omit('id', childProps)} height=\"100%\" width=\"100%\" />\n </div>\n );\n default:\n return null;\n }\n};\n\nMediaView.propTypes = MediaViewPropTypes;\n\nconst Switch = ({model, help}, {translate}) => {\n const {type} = model;\n\n switch (type) {\n case 'qcmDrag':\n return <QcmDrag {...model} help={help} />;\n case 'qcm':\n return <Qcm {...model} />;\n case 'qcmGraphic':\n return <QcmGraphic {...model} />;\n case 'freeText':\n return <FreeText {...model} />;\n case 'dropDown':\n return <DropDown {...model} aria-label={translate('drop_down_icon')} />;\n case 'slider':\n return <QuestionRange {...model} />;\n case 'template':\n return <Template {...model} />;\n }\n};\n\nSwitch.propTypes = {\n model: propTypes.model,\n help: propTypes.help\n};\n\nSwitch.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nconst Answer = props => {\n const {model, media, help} = props;\n\n return (\n <div data-name=\"answer\" className={style.wrapper}>\n {media ? <MediaView media={media} /> : null}\n <Switch model={model} help={help} />\n </div>\n );\n};\n\nAnswer.propTypes = propTypes;\n\nexport default Answer;\n"],"mappings":";;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAEA,OAAOC,WAAP,MAAwB,iBAAxB;AACA,OAAOC,QAAP,MAAqB,wBAArB;AACA,OAAOC,QAAP,MAAqB,wBAArB;AACA,OAAOC,OAAP,MAAoB,uBAApB;AACA,OAAOC,GAAP,MAAgB,kBAAhB;AACA,OAAOC,UAAP,MAAuB,0BAAvB;AACA,OAAOC,aAAP,MAA0B,6BAA1B;AACA,OAAOC,QAAP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KAAb;QAAoB,IAAI,EAAEC;MAA1B,GAAP;;IACF,KAAK,KAAL;MACE,oBAAO,oBAAC,GAAD,EAASD,KAAT,CAAP;;IACF,KAAK,YAAL;MACE,oBAAO,oBAAC,UAAD,EAAgBA,KAAhB,CAAP;;IACF,KAAK,UAAL;MACE,oBAAO,oBAAC,QAAD,EAAcA,KAAd,CAAP;;IACF,KAAK,UAAL;MACE,oBAAO,oBAAC,QAAD,eAAcA,KAAd;QAAqB,cAAYE,SAAS,CAAC,gBAAD;MAA1C,GAAP;;IACF,KAAK,QAAL;MACE,oBAAO,oBAAC,aAAD,EAAmBF,KAAnB,CAAP;;IACF,KAAK,UAAL;MACE,oBAAO,oBAAC,QAAD,EAAcA,KAAd,CAAP;EAdJ;AAgBD,CAnBD;;AAqBAD,MAAM,CAACd,SAAP,2CAAmB;EACjBe,KAAK,EAAEf,SAAS,CAACe,KADA;EAEjBC,IAAI,EAAEhB,SAAS,CAACgB;AAFC,CAAnB;AAKAF,MAAM,CAACI,YAAP,GAAsB;EACpBD,SAAS,EAAEpB,QAAQ,CAACsB,iBAAT,CAA2BF;AADlB,CAAtB;;AAIA,MAAMG,MAAM,GAAGC,KAAK,IAAI;EACtB,MAAM;IAACN,KAAD;IAAQT,KAAR;IAAeU;EAAf,IAAuBK,KAA7B;EAEA,oBACE;IAAK,aAAU,QAAf;IAAwB,SAAS,EAAEtB,KAAK,CAACuB;EAAzC,GACGhB,KAAK,gBAAG,oBAAC,SAAD;IAAW,KAAK,EAAEA;EAAlB,EAAH,GAAiC,IADzC,eAEE,oBAAC,MAAD;IAAQ,KAAK,EAAES,KAAf;IAAsB,IAAI,EAAEC;EAA5B,EAFF,CADF;AAMD,CATD;;AAWAI,MAAM,CAACpB,SAAP,2CAAmBA,SAAnB;AAEA,eAAeoB,MAAf"}
|
|
@@ -39,9 +39,7 @@ const Notification = props => {
|
|
|
39
39
|
stroke: null
|
|
40
40
|
}), /*#__PURE__*/React.createElement("div", {
|
|
41
41
|
className: style.message
|
|
42
|
-
}, /*#__PURE__*/React.createElement("span",
|
|
43
|
-
role: "status"
|
|
44
|
-
}, message))));
|
|
42
|
+
}, /*#__PURE__*/React.createElement("span", null, message))));
|
|
45
43
|
};
|
|
46
44
|
|
|
47
45
|
Notification.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification.js","names":["React","PropTypes","classnames","NovaCompositionNavigationMore","MoreIcon","NovaSolidLoginLocked","LockIcon","NovaSolidLocksLockUnlock1","UnlockIcon","NovaCompositionCoorpacademyCheck","CheckIcon","style","NOTIFICATION_ICON","addFavorite","removeFavorite","lock","unlock","handleOverlayClick","e","stopPropagation","preventDefault","Notification","props","message","icon","IconType","showOverlay","notificationWrapper","notification","propTypes","string","isRequired","oneOf"],"sources":["../../../src/molecule/card/notification.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {get, keys} from 'lodash/fp';\nimport {\n NovaCompositionNavigationMore as MoreIcon,\n NovaSolidLoginLocked as LockIcon,\n NovaSolidLocksLockUnlock1 as UnlockIcon,\n NovaCompositionCoorpacademyCheck as CheckIcon\n} from '@coorpacademy/nova-icons';\nimport style from './notification.css';\n\nconst NOTIFICATION_ICON = {\n addFavorite: CheckIcon,\n removeFavorite: MoreIcon,\n lock: LockIcon,\n unlock: UnlockIcon\n};\n\nconst handleOverlayClick = e => {\n e.stopPropagation();\n e.preventDefault();\n return false;\n};\n\nconst Notification = props => {\n const {message, icon} = props;\n\n const IconType = get(icon, NOTIFICATION_ICON);\n return (\n <div\n data-name=\"notification\"\n data-type={icon}\n onClick={handleOverlayClick}\n className={classnames(style.showOverlay, style.notificationWrapper)}\n >\n <div className={style.notification}>\n <IconType className={style.icon} color={null} stroke={null} />\n <div className={style.message}>\n <span
|
|
1
|
+
{"version":3,"file":"notification.js","names":["React","PropTypes","classnames","NovaCompositionNavigationMore","MoreIcon","NovaSolidLoginLocked","LockIcon","NovaSolidLocksLockUnlock1","UnlockIcon","NovaCompositionCoorpacademyCheck","CheckIcon","style","NOTIFICATION_ICON","addFavorite","removeFavorite","lock","unlock","handleOverlayClick","e","stopPropagation","preventDefault","Notification","props","message","icon","IconType","showOverlay","notificationWrapper","notification","propTypes","string","isRequired","oneOf"],"sources":["../../../src/molecule/card/notification.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {get, keys} from 'lodash/fp';\nimport {\n NovaCompositionNavigationMore as MoreIcon,\n NovaSolidLoginLocked as LockIcon,\n NovaSolidLocksLockUnlock1 as UnlockIcon,\n NovaCompositionCoorpacademyCheck as CheckIcon\n} from '@coorpacademy/nova-icons';\nimport style from './notification.css';\n\nconst NOTIFICATION_ICON = {\n addFavorite: CheckIcon,\n removeFavorite: MoreIcon,\n lock: LockIcon,\n unlock: UnlockIcon\n};\n\nconst handleOverlayClick = e => {\n e.stopPropagation();\n e.preventDefault();\n return false;\n};\n\nconst Notification = props => {\n const {message, icon} = props;\n\n const IconType = get(icon, NOTIFICATION_ICON);\n return (\n <div\n data-name=\"notification\"\n data-type={icon}\n onClick={handleOverlayClick}\n className={classnames(style.showOverlay, style.notificationWrapper)}\n >\n <div className={style.notification}>\n <IconType className={style.icon} color={null} stroke={null} />\n <div className={style.message}>\n <span>{message}</span>\n </div>\n </div>\n </div>\n );\n};\nNotification.propTypes = {\n message: PropTypes.string.isRequired,\n icon: PropTypes.oneOf(keys(NOTIFICATION_ICON)).isRequired\n};\n\nexport default Notification;\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAEA,SACEC,6BAA6B,IAAIC,QADnC,EAEEC,oBAAoB,IAAIC,QAF1B,EAGEC,yBAAyB,IAAIC,UAH/B,EAIEC,gCAAgC,IAAIC,SAJtC,QAKO,0BALP;AAMA,OAAOC,KAAP,MAAkB,oBAAlB;AAEA,MAAMC,iBAAiB,GAAG;EACxBC,WAAW,EAAEH,SADW;EAExBI,cAAc,EAAEV,QAFQ;EAGxBW,IAAI,EAAET,QAHkB;EAIxBU,MAAM,EAAER;AAJgB,CAA1B;;AAOA,MAAMS,kBAAkB,GAAGC,CAAC,IAAI;EAC9BA,CAAC,CAACC,eAAF;EACAD,CAAC,CAACE,cAAF;EACA,OAAO,KAAP;AACD,CAJD;;AAMA,MAAMC,YAAY,GAAGC,KAAK,IAAI;EAC5B,MAAM;IAACC,OAAD;IAAUC;EAAV,IAAkBF,KAAxB;;EAEA,MAAMG,QAAQ,GAAG,KAAID,IAAJ,EAAUZ,iBAAV,CAAjB;;EACA,oBACE;IACE,aAAU,cADZ;IAEE,aAAWY,IAFb;IAGE,OAAO,EAAEP,kBAHX;IAIE,SAAS,EAAEf,UAAU,CAACS,KAAK,CAACe,WAAP,EAAoBf,KAAK,CAACgB,mBAA1B;EAJvB,gBAME;IAAK,SAAS,EAAEhB,KAAK,CAACiB;EAAtB,gBACE,oBAAC,QAAD;IAAU,SAAS,EAAEjB,KAAK,CAACa,IAA3B;IAAiC,KAAK,EAAE,IAAxC;IAA8C,MAAM,EAAE;EAAtD,EADF,eAEE;IAAK,SAAS,EAAEb,KAAK,CAACY;EAAtB,gBACE,kCAAOA,OAAP,CADF,CAFF,CANF,CADF;AAeD,CAnBD;;AAoBAF,YAAY,CAACQ,SAAb,2CAAyB;EACvBN,OAAO,EAAEtB,SAAS,CAAC6B,MAAV,CAAiBC,UADH;EAEvBP,IAAI,EAAEvB,SAAS,CAAC+B,KAAV,CAAgB,MAAKpB,iBAAL,CAAhB,EAAyCmB;AAFxB,CAAzB;AAKA,eAAeV,YAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filters-wrapper.d.ts","sourceRoot":"","sources":["../../../src/molecule/filters/filters-wrapper.js"],"names":[],"mappings":";AAUA,
|
|
1
|
+
{"version":3,"file":"filters-wrapper.d.ts","sourceRoot":"","sources":["../../../src/molecule/filters/filters-wrapper.js"],"names":[],"mappings":";AAUA,sEAuDC"}
|
|
@@ -15,8 +15,7 @@ import style from './filters-wapper.css';
|
|
|
15
15
|
const FiltersWapper = (props, context) => {
|
|
16
16
|
const {
|
|
17
17
|
filters,
|
|
18
|
-
className
|
|
19
|
-
filterGroupAriaLabel
|
|
18
|
+
className
|
|
20
19
|
} = props;
|
|
21
20
|
|
|
22
21
|
const buildFilter = (filter, idx) => {
|
|
@@ -81,11 +80,9 @@ const FiltersWapper = (props, context) => {
|
|
|
81
80
|
|
|
82
81
|
const emptyFilters = _isEmpty(filters);
|
|
83
82
|
|
|
84
|
-
return /*#__PURE__*/React.createElement("
|
|
85
|
-
className: classnames(className, emptyFilters ? style.wrapperNone : style.wrapper)
|
|
86
|
-
|
|
87
|
-
"aria-label": filterGroupAriaLabel
|
|
88
|
-
}, filtersList));
|
|
83
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
84
|
+
className: classnames(className, emptyFilters ? style.wrapperNone : style.wrapper)
|
|
85
|
+
}, filtersList);
|
|
89
86
|
};
|
|
90
87
|
|
|
91
88
|
FiltersWapper.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
@@ -93,8 +90,7 @@ FiltersWapper.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
93
90
|
filters: PropTypes.arrayOf(PropTypes.shape({
|
|
94
91
|
type: PropTypes.oneOf(['select', 'range', 'radio', 'switch']).isRequired,
|
|
95
92
|
fieldName: PropTypes.string.isRequired
|
|
96
|
-
}))
|
|
97
|
-
filterGroupAriaLabel: PropTypes.string
|
|
93
|
+
}))
|
|
98
94
|
} : {};
|
|
99
95
|
export default FiltersWapper;
|
|
100
96
|
//# sourceMappingURL=filters-wrapper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filters-wrapper.js","names":["React","PropTypes","classnames","Select","InputSwitch","RadioGroup","RangeSlider","style","FiltersWapper","props","context","filters","className","
|
|
1
|
+
{"version":3,"file":"filters-wrapper.js","names":["React","PropTypes","classnames","Select","InputSwitch","RadioGroup","RangeSlider","style","FiltersWapper","props","context","filters","className","buildFilter","filter","idx","type","fieldName","choice","title","radioGroup","timerWrapper","timerSubtitle","subtitle","toggle","display","filtersList","convert","cap","emptyFilters","wrapperNone","wrapper","propTypes","string","arrayOf","shape","oneOf","isRequired"],"sources":["../../../src/molecule/filters/filters-wrapper.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {isEmpty, map} from 'lodash/fp';\nimport classnames from 'classnames';\nimport Select from '../../atom/select';\nimport InputSwitch from '../../atom/input-switch';\nimport RadioGroup from '../../atom/radio-group';\nimport RangeSlider from '../../atom/range';\nimport style from './filters-wapper.css';\n\nconst FiltersWapper = (props, context) => {\n const {filters, className} = props;\n\n const buildFilter = (filter, idx) => {\n const {type, fieldName} = filter;\n switch (type) {\n case 'select':\n return (\n <div data-name=\"choice\" data-filter-type={fieldName} className={style.choice} key={idx}>\n <Select {...filter} />\n </div>\n );\n case 'radio':\n return (\n <div data-name=\"choice\" data-filter-type={fieldName} className={style.choice} key={idx}>\n <p className={style.title}>{filter.title}</p>\n <RadioGroup {...filter} className={style.radioGroup} />\n </div>\n );\n case 'range':\n return (\n <div\n data-name=\"choice\"\n data-filter-type={fieldName}\n className={style.timerWrapper}\n key={idx}\n >\n <label>\n <span className={style.title}>{filter.title}</span>\n <p className={style.timerSubtitle}>{filter.subtitle}</p>\n <RangeSlider {...filter} />\n </label>\n </div>\n );\n case 'switch':\n return (\n <div data-name=\"choice\" data-filter-type={fieldName} className={style.choice} key={idx}>\n <p className={style.title}>{filter.title}</p>\n <div className={style.toggle}>\n <InputSwitch {...filter.display} />\n </div>\n </div>\n );\n default:\n return null;\n }\n };\n\n const filtersList = map.convert({cap: false})(buildFilter, filters);\n const emptyFilters = isEmpty(filters);\n return (\n <div className={classnames(className, emptyFilters ? style.wrapperNone : style.wrapper)}>\n {filtersList}\n </div>\n );\n};\n\nFiltersWapper.propTypes = {\n className: PropTypes.string,\n filters: PropTypes.arrayOf(\n PropTypes.shape({\n type: PropTypes.oneOf(['select', 'range', 'radio', 'switch']).isRequired,\n fieldName: PropTypes.string.isRequired\n })\n )\n};\nexport default FiltersWapper;\n"],"mappings":";;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,WAAP,MAAwB,yBAAxB;AACA,OAAOC,UAAP,MAAuB,wBAAvB;AACA,OAAOC,WAAP,MAAwB,kBAAxB;AACA,OAAOC,KAAP,MAAkB,sBAAlB;;AAEA,MAAMC,aAAa,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EACxC,MAAM;IAACC,OAAD;IAAUC;EAAV,IAAuBH,KAA7B;;EAEA,MAAMI,WAAW,GAAG,CAACC,MAAD,EAASC,GAAT,KAAiB;IACnC,MAAM;MAACC,IAAD;MAAOC;IAAP,IAAoBH,MAA1B;;IACA,QAAQE,IAAR;MACE,KAAK,QAAL;QACE,oBACE;UAAK,aAAU,QAAf;UAAwB,oBAAkBC,SAA1C;UAAqD,SAAS,EAAEV,KAAK,CAACW,MAAtE;UAA8E,GAAG,EAAEH;QAAnF,gBACE,oBAAC,MAAD,EAAYD,MAAZ,CADF,CADF;;MAKF,KAAK,OAAL;QACE,oBACE;UAAK,aAAU,QAAf;UAAwB,oBAAkBG,SAA1C;UAAqD,SAAS,EAAEV,KAAK,CAACW,MAAtE;UAA8E,GAAG,EAAEH;QAAnF,gBACE;UAAG,SAAS,EAAER,KAAK,CAACY;QAApB,GAA4BL,MAAM,CAACK,KAAnC,CADF,eAEE,oBAAC,UAAD,eAAgBL,MAAhB;UAAwB,SAAS,EAAEP,KAAK,CAACa;QAAzC,GAFF,CADF;;MAMF,KAAK,OAAL;QACE,oBACE;UACE,aAAU,QADZ;UAEE,oBAAkBH,SAFpB;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UADhD;IAEdpB,SAAS,EAAEhB,SAAS,CAACgC,MAAV,CAAiBI;EAFd,CAAhB,CADO;AAFe,CAA1B;AASA,eAAe7B,aAAf"}
|
|
@@ -37,7 +37,6 @@ declare class Filters extends React.Component<any, any, any> {
|
|
|
37
37
|
onToggleSorts: PropTypes.Requireable<(...args: any[]) => any>;
|
|
38
38
|
moreSortAriaLabel: PropTypes.Requireable<string>;
|
|
39
39
|
moreFilterAriaLabel: PropTypes.Requireable<string>;
|
|
40
|
-
filterGroupAriaLabel: PropTypes.Requireable<string>;
|
|
41
40
|
};
|
|
42
41
|
static contextTypes: {
|
|
43
42
|
skin: PropTypes.Requireable<PropTypes.InferProps<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/filters/index.js"],"names":[],"mappings":";AASA;IACE
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/filters/index.js"],"names":[],"mappings":";AASA;IACE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAcE;IAEF;;;;;;;;;;;;;;;;;;;;;;MAEE;IAEF,wBASC;IAPC;;;MAGC;IAMH,yBAcC;IAED,uBAYC;IAED,qBAOC;IAED,sBAsFC;CACF"}
|
|
@@ -72,8 +72,7 @@ class Filters extends React.Component {
|
|
|
72
72
|
sortTabLabel,
|
|
73
73
|
filters,
|
|
74
74
|
moreFilterAriaLabel,
|
|
75
|
-
moreSortAriaLabel
|
|
76
|
-
filterGroupAriaLabel
|
|
75
|
+
moreSortAriaLabel
|
|
77
76
|
} = this.props;
|
|
78
77
|
const {
|
|
79
78
|
filter,
|
|
@@ -129,8 +128,7 @@ class Filters extends React.Component {
|
|
|
129
128
|
className: filtersActive ? style.activeWrapperFilters : style.wrapperFilters
|
|
130
129
|
}, /*#__PURE__*/React.createElement(FiltersWrapper, {
|
|
131
130
|
className: style.wrapper,
|
|
132
|
-
filters: filters
|
|
133
|
-
filterGroupAriaLabel: filterGroupAriaLabel
|
|
131
|
+
filters: filters
|
|
134
132
|
}), /*#__PURE__*/React.createElement("div", {
|
|
135
133
|
"data-name": "cta",
|
|
136
134
|
className: style.CTAfilter,
|
|
@@ -169,8 +167,7 @@ Filters.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
169
167
|
onToggleFilters: PropTypes.func,
|
|
170
168
|
onToggleSorts: PropTypes.func,
|
|
171
169
|
moreSortAriaLabel: PropTypes.string,
|
|
172
|
-
moreFilterAriaLabel: PropTypes.string
|
|
173
|
-
filterGroupAriaLabel: PropTypes.string
|
|
170
|
+
moreFilterAriaLabel: PropTypes.string
|
|
174
171
|
} : {};
|
|
175
172
|
export default Filters;
|
|
176
173
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","NovaCompositionNavigationArrowDown","ArrowDown","Select","Provider","style","FiltersWrapper","Filters","Component","constructor","props","state","filter","openFilters","sorted","openSorts","handleOpenFilter","bind","handleOpenSort","handleSearch","onToggleFilters","newValue","setState","onToggleSorts","onSearch","render","sorting","filterCTALabel","filterTabLabel","sortCTALabel","sortTabLabel","filters","moreFilterAriaLabel","moreSortAriaLabel","
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","NovaCompositionNavigationArrowDown","ArrowDown","Select","Provider","style","FiltersWrapper","Filters","Component","constructor","props","state","filter","openFilters","sorted","openSorts","handleOpenFilter","bind","handleOpenSort","handleSearch","onToggleFilters","newValue","setState","onToggleSorts","onSearch","render","sorting","filterCTALabel","filterTabLabel","sortCTALabel","sortTabLabel","filters","moreFilterAriaLabel","moreSortAriaLabel","skin","context","defaultColor","darkColor","filtersActive","sortingActive","sortView","undefined","select","search","activeDefault","default","title","arrow","activeWrapperSortBy","wrapperSortBy","activeWrapperFilters","wrapperFilters","wrapper","CTAfilter","backgroundColor","activeSorting","contextTypes","childContextTypes","propTypes","string","bool","shape","func"],"sources":["../../../src/molecule/filters/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {get} from 'lodash/fp';\nimport {NovaCompositionNavigationArrowDown as ArrowDown} from '@coorpacademy/nova-icons';\nimport Select from '../../atom/select';\nimport Provider from '../../atom/provider';\nimport style from './style.css';\nimport FiltersWrapper from './filters-wrapper';\n\nclass Filters extends React.Component {\n static propTypes = {\n filterCTALabel: PropTypes.string,\n filterTabLabel: PropTypes.string,\n sortCTALabel: PropTypes.string,\n sortTabLabel: PropTypes.string,\n openFilters: PropTypes.bool,\n openSorts: PropTypes.bool,\n filters: FiltersWrapper.propTypes.filters,\n sorting: PropTypes.shape(Select.propTypes),\n onSearch: PropTypes.func,\n onToggleFilters: PropTypes.func,\n onToggleSorts: PropTypes.func,\n moreSortAriaLabel: PropTypes.string,\n moreFilterAriaLabel: PropTypes.string\n };\n\n static contextTypes = {\n skin: Provider.childContextTypes.skin\n };\n\n constructor(props) {\n super(props);\n this.state = {\n filter: !!props.openFilters,\n sorted: !!props.openSorts\n };\n this.handleOpenFilter = this.handleOpenFilter.bind(this);\n this.handleOpenSort = this.handleOpenSort.bind(this);\n this.handleSearch = this.handleSearch.bind(this);\n }\n\n handleOpenFilter() {\n const {filter} = this.state;\n const {onToggleFilters} = this.props;\n\n const newValue = !filter;\n\n this.setState({\n filter: newValue,\n sorted: false\n });\n\n if (onToggleFilters) {\n onToggleFilters(newValue);\n }\n }\n\n handleOpenSort() {\n const {sorted} = this.state;\n const {onToggleSorts} = this.props;\n\n const newValue = !sorted;\n\n this.setState({\n sorted: newValue,\n filter: false\n });\n\n if (onToggleSorts) onToggleSorts(newValue);\n }\n\n handleSearch() {\n const {onSearch} = this.props;\n this.setState({\n sorted: false,\n filter: false\n });\n if (onSearch) onSearch();\n }\n\n render() {\n const {\n sorting,\n filterCTALabel,\n filterTabLabel,\n sortCTALabel,\n sortTabLabel,\n filters,\n moreFilterAriaLabel,\n moreSortAriaLabel\n } = this.props;\n const {filter, sorted} = this.state;\n const {skin} = this.context;\n\n const defaultColor = get('common.primary', skin);\n const darkColor = get('common.dark', skin);\n const filtersActive = filter === true;\n const sortingActive = sorted === true;\n\n const sortView =\n sorting !== undefined ? (\n <div data-name=\"choice\" className={style.select}>\n <Select {...sorting} />\n </div>\n ) : null;\n\n return (\n <div data-name=\"search\" className={style.search}>\n <div\n data-name=\"filter\"\n data-open={filtersActive}\n className={filtersActive ? style.activeDefault : style.default}\n >\n <div className={style.title} data-name=\"filterButton\" onClick={this.handleOpenFilter}>\n {filterTabLabel}\n <div className={style.arrow}>\n <ArrowDown color={darkColor} height={14} aria-label={moreFilterAriaLabel} />\n </div>\n </div>\n </div>\n <div\n data-name=\"sortBy\"\n data-open={sortingActive}\n className={sortingActive ? style.activeWrapperSortBy : style.wrapperSortBy}\n >\n <div className={style.title} data-name=\"sortButton\" onClick={this.handleOpenSort}>\n {sortTabLabel}\n <div className={style.arrow}>\n <ArrowDown color={darkColor} height={14} aria-label={moreSortAriaLabel} />\n </div>\n </div>\n </div>\n <div\n data-name=\"filterWrapper\"\n className={filtersActive ? style.activeWrapperFilters : style.wrapperFilters}\n >\n <FiltersWrapper className={style.wrapper} filters={filters} />\n <div\n data-name=\"cta\"\n className={style.CTAfilter}\n style={{\n backgroundColor: defaultColor\n }}\n onClick={this.handleSearch}\n >\n {filterCTALabel}\n </div>\n </div>\n <div\n data-name=\"sortWrapper\"\n className={sortingActive ? style.activeSorting : style.sorting}\n >\n {sortView}\n <div\n data-name=\"cta\"\n className={style.CTAfilter}\n style={{\n backgroundColor: defaultColor\n }}\n onClick={this.handleSearch}\n >\n {sortCTALabel}\n </div>\n </div>\n </div>\n );\n }\n}\n\nexport default Filters;\n"],"mappings":";AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,SAAQC,kCAAkC,IAAIC,SAA9C,QAA8D,0BAA9D;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,QAAP,MAAqB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AAc,EAAE5B,SAAS,CAAC2D,MAFT;EAGjB9B,YAAY,EAAE7B,SAAS,CAAC2D,MAHP;EAIjB7B,YAAY,EAAE9B,SAAS,CAAC2D,MAJP;EAKjB9C,WAAW,EAAEb,SAAS,CAAC4D,IALN;EAMjB7C,SAAS,EAAEf,SAAS,CAAC4D,IANJ;EAOjB7B,OAAO,EAAEzB,cAAc,CAACoD,SAAf,CAAyB3B,OAPjB;EAQjBL,OAAO,EAAE1B,SAAS,CAAC6D,KAAV,CAAgB1D,MAAM,CAACuD,SAAvB,CARQ;EASjBlC,QAAQ,EAAExB,SAAS,CAAC8D,IATH;EAUjB1C,eAAe,EAAEpB,SAAS,CAAC8D,IAVV;EAWjBvC,aAAa,EAAEvB,SAAS,CAAC8D,IAXR;EAYjB7B,iBAAiB,EAAEjC,SAAS,CAAC2D,MAZZ;EAajB3B,mBAAmB,EAAEhC,SAAS,CAAC2D;AAbd,C;AA+JrB,eAAepD,OAAf"}
|
|
@@ -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"}
|
|
@@ -113,8 +113,7 @@ const ForumPost = (props, context) => {
|
|
|
113
113
|
display: rejectable ? 'block' : 'none'
|
|
114
114
|
}
|
|
115
115
|
}, rejected ? putBackLabel : rejectLabel), /*#__PURE__*/React.createElement("div", {
|
|
116
|
-
className: messageClassName
|
|
117
|
-
role: "status"
|
|
116
|
+
className: messageClassName
|
|
118
117
|
}, deleted ? infoDeleted : message), /*#__PURE__*/React.createElement("div", {
|
|
119
118
|
className: `${style.edition} ${showEditBox ? style.visible : ''}`
|
|
120
119
|
}, /*#__PURE__*/React.createElement(ForumComment, {
|