@coorpacademy/components 11.14.15-alpha2.27 → 11.14.16-alpha.0
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/molecule/course-section/style.css +6 -4
- package/es/molecule/draggable/style.css +5 -9
- package/es/molecule/draggable-list/index.d.ts +2 -50
- package/es/molecule/draggable-list/index.d.ts.map +1 -1
- package/es/molecule/draggable-list/index.js +4 -7
- package/es/molecule/draggable-list/index.js.map +1 -1
- package/es/molecule/scope-tabs/index.js +2 -1
- package/es/molecule/scope-tabs/index.js.map +1 -1
- package/es/organism/list-item/index.d.ts +0 -1
- package/es/organism/list-item/index.d.ts.map +1 -1
- package/es/organism/list-item/index.js +3 -4
- package/es/organism/list-item/index.js.map +1 -1
- package/es/organism/list-item/style.css +4 -6
- package/es/organism/list-items/index.d.ts +32 -3
- package/es/organism/list-items/index.d.ts.map +1 -1
- package/es/organism/list-items/index.js +5 -17
- package/es/organism/list-items/index.js.map +1 -1
- package/es/organism/mooc-footer/index.js +1 -1
- package/es/organism/mooc-footer/index.js.map +1 -1
- package/es/organism/mooc-header/index.js +1 -1
- package/es/organism/mooc-header/index.js.map +1 -1
- package/es/template/app-player/player/slides/footer/index.js +1 -1
- package/es/template/app-player/player/slides/footer/index.js.map +1 -1
- package/es/template/back-office/brand-update/index.d.ts +32 -3
- package/lib/molecule/course-section/style.css +6 -4
- package/lib/molecule/draggable/style.css +5 -9
- package/lib/molecule/draggable-list/index.d.ts +2 -50
- package/lib/molecule/draggable-list/index.d.ts.map +1 -1
- package/lib/molecule/draggable-list/index.js +4 -8
- package/lib/molecule/draggable-list/index.js.map +1 -1
- package/lib/molecule/scope-tabs/index.js +4 -1
- package/lib/molecule/scope-tabs/index.js.map +1 -1
- package/lib/organism/list-item/index.d.ts +0 -1
- package/lib/organism/list-item/index.d.ts.map +1 -1
- package/lib/organism/list-item/index.js +3 -4
- package/lib/organism/list-item/index.js.map +1 -1
- package/lib/organism/list-item/style.css +4 -6
- package/lib/organism/list-items/index.d.ts +32 -3
- package/lib/organism/list-items/index.d.ts.map +1 -1
- package/lib/organism/list-items/index.js +5 -19
- package/lib/organism/list-items/index.js.map +1 -1
- package/lib/organism/mooc-footer/index.js +1 -1
- package/lib/organism/mooc-footer/index.js.map +1 -1
- package/lib/organism/mooc-header/index.js +1 -1
- package/lib/organism/mooc-header/index.js.map +1 -1
- package/lib/template/app-player/player/slides/footer/index.js +1 -1
- package/lib/template/app-player/player/slides/footer/index.js.map +1 -1
- package/lib/template/back-office/brand-update/index.d.ts +32 -3
- package/package.json +2 -2
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
font-family: Gilroy;
|
|
34
34
|
font-size: 16px;
|
|
35
35
|
font-weight: bold;
|
|
36
|
-
overflow:
|
|
37
|
-
white-space:
|
|
38
|
-
display:
|
|
39
|
-
text-overflow:
|
|
36
|
+
overflow:hidden;
|
|
37
|
+
white-space:nowrap;
|
|
38
|
+
display:inline-block;
|
|
39
|
+
text-overflow:ellipsis;
|
|
40
40
|
width: 100%;
|
|
41
41
|
}
|
|
42
42
|
|
|
@@ -59,3 +59,5 @@
|
|
|
59
59
|
min-height: 56px;
|
|
60
60
|
min-width: 56px;
|
|
61
61
|
}
|
|
62
|
+
|
|
63
|
+
|
|
@@ -13,18 +13,15 @@
|
|
|
13
13
|
background: transparent;
|
|
14
14
|
margin: 8px 0;
|
|
15
15
|
border-radius: 7px;
|
|
16
|
-
transform:
|
|
16
|
+
transform:translate(0,0);
|
|
17
17
|
z-index: 0;
|
|
18
18
|
}
|
|
19
|
-
|
|
20
|
-
.draggable:hover {
|
|
19
|
+
.draggable:hover{
|
|
21
20
|
background: rgba(0, 0, 0, 0.3);
|
|
22
21
|
}
|
|
23
|
-
|
|
24
|
-
.draggable:active {
|
|
22
|
+
.draggable:active{
|
|
25
23
|
background: transparent;
|
|
26
24
|
}
|
|
27
|
-
|
|
28
25
|
.draggable:before {
|
|
29
26
|
content: '.';
|
|
30
27
|
position: absolute;
|
|
@@ -35,10 +32,9 @@
|
|
|
35
32
|
font-size: 25px;
|
|
36
33
|
color: medium;
|
|
37
34
|
pointer-events: none;
|
|
38
|
-
text-shadow: 0 0 medium,
|
|
39
|
-
|
|
35
|
+
text-shadow: 0 0 medium, 0 5px medium, 0 10px medium, 0 15px medium,
|
|
36
|
+
5px 0 medium , 5px 5px medium, 5px 10px medium, 5px 15px medium;
|
|
40
37
|
}
|
|
41
|
-
|
|
42
38
|
.dragging {
|
|
43
39
|
background: rgba(0, 0, 0, 0.1);
|
|
44
40
|
}
|
|
@@ -6,7 +6,7 @@ declare function DraggableList({ items, onDrop, itemType }: {
|
|
|
6
6
|
}): JSX.Element;
|
|
7
7
|
declare namespace DraggableList {
|
|
8
8
|
namespace propTypes {
|
|
9
|
-
const items: PropTypes.Requireable<(
|
|
9
|
+
const items: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
10
10
|
title: PropTypes.Validator<string>;
|
|
11
11
|
onUp: PropTypes.Requireable<(...args: any[]) => any>;
|
|
12
12
|
onDown: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -43,55 +43,7 @@ declare namespace DraggableList {
|
|
|
43
43
|
}> | null | undefined)[]>;
|
|
44
44
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
45
45
|
}>>;
|
|
46
|
-
}> |
|
|
47
|
-
'aria-label': PropTypes.Requireable<PropTypes.InferProps<{
|
|
48
|
-
title: PropTypes.Requireable<string>;
|
|
49
|
-
author: PropTypes.Requireable<string>;
|
|
50
|
-
modules: PropTypes.Requireable<string>;
|
|
51
|
-
position: PropTypes.Requireable<string>;
|
|
52
|
-
}>>;
|
|
53
|
-
image: PropTypes.Requireable<string>;
|
|
54
|
-
badgeList: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
55
|
-
category: PropTypes.Requireable<string>;
|
|
56
|
-
label: PropTypes.Requireable<string>;
|
|
57
|
-
}> | null | undefined)[]>;
|
|
58
|
-
title: PropTypes.Requireable<string>;
|
|
59
|
-
author: PropTypes.Requireable<string>;
|
|
60
|
-
position: PropTypes.Requireable<number>;
|
|
61
|
-
id: PropTypes.Requireable<string>;
|
|
62
|
-
}> | PropTypes.InferProps<{
|
|
63
|
-
bulletPointMenuButton: PropTypes.Requireable<PropTypes.InferProps<{
|
|
64
|
-
buttonAriaLabel: PropTypes.Requireable<string>;
|
|
65
|
-
menuAriaLabel: PropTypes.Requireable<string>;
|
|
66
|
-
buttons: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
67
|
-
'data-name': PropTypes.Requireable<string>;
|
|
68
|
-
label: PropTypes.Requireable<string>;
|
|
69
|
-
type: PropTypes.Requireable<string>;
|
|
70
|
-
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
71
|
-
}> | null | undefined)[]>;
|
|
72
|
-
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
73
|
-
}>>;
|
|
74
|
-
buttonLink: PropTypes.Requireable<PropTypes.InferProps<{
|
|
75
|
-
type: PropTypes.Requireable<string>;
|
|
76
|
-
label: PropTypes.Requireable<string>;
|
|
77
|
-
ariaLabel: PropTypes.Requireable<string>;
|
|
78
|
-
dataName: PropTypes.Requireable<string>;
|
|
79
|
-
icon: PropTypes.Requireable<PropTypes.InferProps<{
|
|
80
|
-
position: PropTypes.Requireable<string>;
|
|
81
|
-
type: PropTypes.Requireable<string>;
|
|
82
|
-
}>>;
|
|
83
|
-
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
84
|
-
}>>;
|
|
85
|
-
tags: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
86
|
-
label: PropTypes.Requireable<string>;
|
|
87
|
-
type: PropTypes.Requireable<string>;
|
|
88
|
-
}> | null | undefined)[]>;
|
|
89
|
-
title: PropTypes.Validator<string>;
|
|
90
|
-
order: PropTypes.Requireable<number>;
|
|
91
|
-
'aria-label': PropTypes.Requireable<string>;
|
|
92
|
-
contentType: PropTypes.Requireable<string>;
|
|
93
|
-
id: PropTypes.Requireable<string>;
|
|
94
|
-
}> | null | undefined> | null | undefined)[]>;
|
|
46
|
+
}> | null | undefined)[]>;
|
|
95
47
|
const onDrop: PropTypes.Requireable<(...args: any[]) => any>;
|
|
96
48
|
const itemType: PropTypes.Requireable<string>;
|
|
97
49
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/draggable-list/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/draggable-list/index.js"],"names":[],"mappings":";AAQA;;;;gBAmDC"}
|
|
@@ -5,11 +5,9 @@ import PropTypes from 'prop-types';
|
|
|
5
5
|
import Draggable from '../draggable';
|
|
6
6
|
import SetupSection from '../setup-section';
|
|
7
7
|
import CourseSection from '../course-section';
|
|
8
|
-
import ListItem from '../../organism/list-item';
|
|
9
8
|
const ITEMS = {
|
|
10
9
|
'setup-section': SetupSection,
|
|
11
|
-
'course-section': CourseSection
|
|
12
|
-
'list-item': ListItem
|
|
10
|
+
'course-section': CourseSection
|
|
13
11
|
};
|
|
14
12
|
|
|
15
13
|
const DraggableList = ({
|
|
@@ -35,7 +33,7 @@ const DraggableList = ({
|
|
|
35
33
|
setDragFrom(null);
|
|
36
34
|
}, [onDrop, setDragTo, setDragFrom, dragFrom]);
|
|
37
35
|
const Item = ITEMS[itemType];
|
|
38
|
-
const itemsView = items.map(
|
|
36
|
+
const itemsView = items.map(item => /*#__PURE__*/React.createElement(Draggable, {
|
|
39
37
|
key: item.id,
|
|
40
38
|
id: item.id,
|
|
41
39
|
dragging: dragTo === item.id,
|
|
@@ -44,14 +42,13 @@ const DraggableList = ({
|
|
|
44
42
|
onDragLeave: dragLeaveHandler,
|
|
45
43
|
onDrop: dropHandler
|
|
46
44
|
}, /*#__PURE__*/React.createElement(Item, _extends({}, item, {
|
|
47
|
-
key: item.id
|
|
48
|
-
order: index
|
|
45
|
+
key: item.id
|
|
49
46
|
}))));
|
|
50
47
|
return /*#__PURE__*/React.createElement("div", null, itemsView);
|
|
51
48
|
};
|
|
52
49
|
|
|
53
50
|
DraggableList.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
54
|
-
items: PropTypes.arrayOf(PropTypes.
|
|
51
|
+
items: PropTypes.arrayOf(PropTypes.shape(SetupSection.propTypes)),
|
|
55
52
|
onDrop: PropTypes.func,
|
|
56
53
|
itemType: PropTypes.string
|
|
57
54
|
} : {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useState","useCallback","PropTypes","Draggable","SetupSection","CourseSection","
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useState","useCallback","PropTypes","Draggable","SetupSection","CourseSection","ITEMS","DraggableList","items","onDrop","itemType","dragTo","setDragTo","dragFrom","setDragFrom","dragStartHandler","id","dragOverHandler","dragLeaveHandler","dropHandler","Item","itemsView","map","item","propTypes","arrayOf","shape","func","string"],"sources":["../../../src/molecule/draggable-list/index.js"],"sourcesContent":["import React, {useState, useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport Draggable from '../draggable';\nimport SetupSection from '../setup-section';\nimport CourseSection from '../course-section';\n\nconst ITEMS = {'setup-section': SetupSection, 'course-section': CourseSection};\n\nconst DraggableList = ({items, onDrop, itemType}) => {\n const [dragTo, setDragTo] = useState(null);\n const [dragFrom, setDragFrom] = useState(null);\n\n const dragStartHandler = useCallback(\n id => {\n setDragFrom(id);\n },\n [setDragFrom]\n );\n\n const dragOverHandler = useCallback(\n id => {\n if (dragTo === id) return;\n setDragTo(id);\n },\n [dragTo, setDragTo]\n );\n\n const dragLeaveHandler = useCallback(\n id => {\n setDragTo(null);\n },\n [setDragTo]\n );\n\n const dropHandler = useCallback(\n id => {\n if (onDrop && dragFrom) onDrop(dragFrom, id);\n\n setDragTo(null);\n setDragFrom(null);\n },\n [onDrop, setDragTo, setDragFrom, dragFrom]\n );\n\n const Item = ITEMS[itemType];\n const itemsView = items.map(item => (\n <Draggable\n key={item.id}\n id={item.id}\n dragging={dragTo === item.id}\n onDragStart={dragStartHandler}\n onDragOver={dragOverHandler}\n onDragLeave={dragLeaveHandler}\n onDrop={dropHandler}\n >\n <Item {...item} key={item.id} />\n </Draggable>\n ));\n return <div>{itemsView}</div>;\n};\n\nDraggableList.propTypes = {\n items: PropTypes.arrayOf(PropTypes.shape(SetupSection.propTypes)),\n onDrop: PropTypes.func,\n itemType: PropTypes.string\n};\n\nexport default DraggableList;\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,QAAf,EAAyBC,WAAzB,QAA2C,OAA3C;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,SAAP,MAAsB,cAAtB;AACA,OAAOC,YAAP,MAAyB,kBAAzB;AACA,OAAOC,aAAP,MAA0B,mBAA1B;AAEA,MAAMC,KAAK,GAAG;EAAC,iBAAiBF,YAAlB;EAAgC,kBAAkBC;AAAlD,CAAd;;AAEA,MAAME,aAAa,GAAG,CAAC;EAACC,KAAD;EAAQC,MAAR;EAAgBC;AAAhB,CAAD,KAA+B;EACnD,MAAM,CAACC,MAAD,EAASC,SAAT,IAAsBZ,QAAQ,CAAC,IAAD,CAApC;EACA,MAAM,CAACa,QAAD,EAAWC,WAAX,IAA0Bd,QAAQ,CAAC,IAAD,CAAxC;EAEA,MAAMe,gBAAgB,GAAGd,WAAW,CAClCe,EAAE,IAAI;IACJF,WAAW,CAACE,EAAD,CAAX;EACD,CAHiC,EAIlC,CAACF,WAAD,CAJkC,CAApC;EAOA,MAAMG,eAAe,GAAGhB,WAAW,CACjCe,EAAE,IAAI;IACJ,IAAIL,MAAM,KAAKK,EAAf,EAAmB;IACnBJ,SAAS,CAACI,EAAD,CAAT;EACD,CAJgC,EAKjC,CAACL,MAAD,EAASC,SAAT,CALiC,CAAnC;EAQA,MAAMM,gBAAgB,GAAGjB,WAAW,CAClCe,EAAE,IAAI;IACJJ,SAAS,CAAC,IAAD,CAAT;EACD,CAHiC,EAIlC,CAACA,SAAD,CAJkC,CAApC;EAOA,MAAMO,WAAW,GAAGlB,WAAW,CAC7Be,EAAE,IAAI;IACJ,IAAIP,MAAM,IAAII,QAAd,EAAwBJ,MAAM,CAACI,QAAD,EAAWG,EAAX,CAAN;IAExBJ,SAAS,CAAC,IAAD,CAAT;IACAE,WAAW,CAAC,IAAD,CAAX;EACD,CAN4B,EAO7B,CAACL,MAAD,EAASG,SAAT,EAAoBE,WAApB,EAAiCD,QAAjC,CAP6B,CAA/B;EAUA,MAAMO,IAAI,GAAGd,KAAK,CAACI,QAAD,CAAlB;EACA,MAAMW,SAAS,GAAGb,KAAK,CAACc,GAAN,CAAUC,IAAI,iBAC9B,oBAAC,SAAD;IACE,GAAG,EAAEA,IAAI,CAACP,EADZ;IAEE,EAAE,EAAEO,IAAI,CAACP,EAFX;IAGE,QAAQ,EAAEL,MAAM,KAAKY,IAAI,CAACP,EAH5B;IAIE,WAAW,EAAED,gBAJf;IAKE,UAAU,EAAEE,eALd;IAME,WAAW,EAAEC,gBANf;IAOE,MAAM,EAAEC;EAPV,gBASE,oBAAC,IAAD,eAAUI,IAAV;IAAgB,GAAG,EAAEA,IAAI,CAACP;EAA1B,GATF,CADgB,CAAlB;EAaA,oBAAO,iCAAMK,SAAN,CAAP;AACD,CAnDD;;AAqDAd,aAAa,CAACiB,SAAd,2CAA0B;EACxBhB,KAAK,EAAEN,SAAS,CAACuB,OAAV,CAAkBvB,SAAS,CAACwB,KAAV,CAAgBtB,YAAY,CAACoB,SAA7B,CAAlB,CADiB;EAExBf,MAAM,EAAEP,SAAS,CAACyB,IAFM;EAGxBjB,QAAQ,EAAER,SAAS,CAAC0B;AAHI,CAA1B;AAMA,eAAerB,aAAf"}
|
|
@@ -47,7 +47,7 @@ const ScopeTabs = (props, context) => {
|
|
|
47
47
|
selected = 0,
|
|
48
48
|
levels = []
|
|
49
49
|
} = props;
|
|
50
|
-
|
|
50
|
+
const scopeContent = /*#__PURE__*/React.createElement("ul", {
|
|
51
51
|
"data-name": "scopeTabs",
|
|
52
52
|
className: style.tabs
|
|
53
53
|
}, levels.map((level, index) => /*#__PURE__*/React.createElement(Tab, {
|
|
@@ -57,6 +57,7 @@ const ScopeTabs = (props, context) => {
|
|
|
57
57
|
onClick: onClick,
|
|
58
58
|
selected: selected
|
|
59
59
|
})));
|
|
60
|
+
return levels.length > 1 ? /*#__PURE__*/React.createElement("nav", null, scopeContent) : /*#__PURE__*/React.createElement("div", null, scopeContent);
|
|
60
61
|
};
|
|
61
62
|
|
|
62
63
|
ScopeTabs.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useMemo","PropTypes","classnames","ModuleBubble","style","Tab","index","selected","onClick","level","handleClick","isSelected","bubble","module","defaultTab","currentTab","name","propTypes","number","func","shape","ScopeTabs","props","context","levels","tabs","map","arrayOf","object"],"sources":["../../../src/molecule/scope-tabs/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport {has, noop, omit} from 'lodash/fp';\nimport classnames from 'classnames';\nimport ModuleBubble from '../module-bubble';\nimport style from './style.css';\n\nconst Tab = ({index, selected, onClick = noop, level}) => {\n const handleClick = useMemo(() => () => onClick(index), [onClick, index]);\n const isSelected = selected === index;\n const bubble = has('status', level) ? (\n <div className={style.module}>\n <ModuleBubble {...level} onClick={handleClick} />\n </div>\n ) : null;\n\n return (\n <li\n data-name=\"scopeTab\"\n data-index={index}\n key={index}\n onClick={handleClick}\n className={classnames(style.defaultTab, isSelected ? style.currentTab : null)}\n >\n {bubble}\n <div className={style.name}>{level.name}</div>\n </li>\n );\n};\n\nTab.propTypes = {\n selected: PropTypes.number,\n index: PropTypes.number,\n onClick: PropTypes.func,\n level: PropTypes.shape(omit('onClick', ModuleBubble.propTypes))\n};\n\nconst ScopeTabs = (props, context) => {\n const {onClick, selected = 0, levels = []} = props;\n
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useMemo","PropTypes","classnames","ModuleBubble","style","Tab","index","selected","onClick","level","handleClick","isSelected","bubble","module","defaultTab","currentTab","name","propTypes","number","func","shape","ScopeTabs","props","context","levels","scopeContent","tabs","map","length","arrayOf","object"],"sources":["../../../src/molecule/scope-tabs/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport {has, noop, omit} from 'lodash/fp';\nimport classnames from 'classnames';\nimport ModuleBubble from '../module-bubble';\nimport style from './style.css';\n\nconst Tab = ({index, selected, onClick = noop, level}) => {\n const handleClick = useMemo(() => () => onClick(index), [onClick, index]);\n const isSelected = selected === index;\n const bubble = has('status', level) ? (\n <div className={style.module}>\n <ModuleBubble {...level} onClick={handleClick} />\n </div>\n ) : null;\n\n return (\n <li\n data-name=\"scopeTab\"\n data-index={index}\n key={index}\n onClick={handleClick}\n className={classnames(style.defaultTab, isSelected ? style.currentTab : null)}\n >\n {bubble}\n <div className={style.name}>{level.name}</div>\n </li>\n );\n};\n\nTab.propTypes = {\n selected: PropTypes.number,\n index: PropTypes.number,\n onClick: PropTypes.func,\n level: PropTypes.shape(omit('onClick', ModuleBubble.propTypes))\n};\n\nconst ScopeTabs = (props, context) => {\n const {onClick, selected = 0, levels = []} = props;\n const scopeContent = (\n <ul data-name=\"scopeTabs\" className={style.tabs}>\n {levels.map((level, index) => (\n <Tab key={index} index={index} level={level} onClick={onClick} selected={selected} />\n ))}\n </ul>\n );\n return levels.length > 1 ? <nav>{scopeContent}</nav> : <div>{scopeContent}</div>;\n};\n\nScopeTabs.propTypes = {\n selected: PropTypes.number,\n onClick: PropTypes.func,\n levels: PropTypes.arrayOf(PropTypes.object)\n};\n\nexport default ScopeTabs;\n"],"mappings":";;;;;;AAAA,OAAOA,KAAP,IAAeC,OAAf,QAA6B,OAA7B;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,YAAP,MAAyB,kBAAzB;AACA,OAAOC,KAAP,MAAkB,aAAl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,WAAd;IAA0B,SAAS,EAAErB,KAAK,CAACsB;EAA3C,GACGF,MAAM,CAACG,GAAP,CAAW,CAAClB,KAAD,EAAQH,KAAR,kBACV,oBAAC,GAAD;IAAK,GAAG,EAAEA,KAAV;IAAiB,KAAK,EAAEA,KAAxB;IAA+B,KAAK,EAAEG,KAAtC;IAA6C,OAAO,EAAED,OAAtD;IAA+D,QAAQ,EAAED;EAAzE,EADD,CADH,CADF;EAOA,OAAOiB,MAAM,CAACI,MAAP,GAAgB,CAAhB,gBAAoB,iCAAMH,YAAN,CAApB,gBAAgD,iCAAMA,YAAN,CAAvD;AACD,CAVD;;AAYAJ,SAAS,CAACJ,SAAV,2CAAsB;EACpBV,QAAQ,EAAEN,SAAS,CAACiB,MADA;EAEpBV,OAAO,EAAEP,SAAS,CAACkB,IAFC;EAGpBK,MAAM,EAAEvB,SAAS,CAAC4B,OAAV,CAAkB5B,SAAS,CAAC6B,MAA5B;AAHY,CAAtB;AAMA,eAAeT,SAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/list-item/index.js"],"names":[],"mappings":";AAQA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/list-item/index.js"],"names":[],"mappings":";AAQA,mDA4CC"}
|
|
@@ -32,10 +32,10 @@ const ListItem = props => {
|
|
|
32
32
|
className: style.wrapper
|
|
33
33
|
}, isPublished && contentType === 'certification' ? /*#__PURE__*/React.createElement("div", {
|
|
34
34
|
className: style.orderWrapper
|
|
35
|
-
},
|
|
35
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
36
36
|
className: style.order,
|
|
37
37
|
"aria-label": ariaLabel
|
|
38
|
-
}, order + 1)
|
|
38
|
+
}, order + 1), /*#__PURE__*/React.createElement("div", {
|
|
39
39
|
className: style.title,
|
|
40
40
|
title: title
|
|
41
41
|
}, title)) : /*#__PURE__*/React.createElement("div", {
|
|
@@ -78,8 +78,7 @@ ListItem.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
78
78
|
title: PropTypes.string.isRequired,
|
|
79
79
|
order: PropTypes.number,
|
|
80
80
|
'aria-label': PropTypes.string,
|
|
81
|
-
contentType: PropTypes.string
|
|
82
|
-
id: PropTypes.string
|
|
81
|
+
contentType: PropTypes.string
|
|
83
82
|
} : {};
|
|
84
83
|
export default ListItem;
|
|
85
84
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","Tag","ButtonLink","BulletPointMenuButton","style","ListItem","props","isPublished","bulletPointMenuButton","buttonLink","tags","title","order","ariaLabel","contentType","tagsView","convert","cap","tag","index","type","wrapper","orderWrapper","
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","Tag","ButtonLink","BulletPointMenuButton","style","ListItem","props","isPublished","bulletPointMenuButton","buttonLink","tags","title","order","ariaLabel","contentType","tagsView","convert","cap","tag","index","type","wrapper","orderWrapper","settings","edit","propTypes","shape","buttonAriaLabel","string","menuAriaLabel","buttons","arrayOf","label","onClick","func","dataName","icon","position","oneOf","isRequired","number"],"sources":["../../../src/organism/list-item/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {map} from 'lodash/fp';\nimport Tag from '../../atom/tag';\nimport ButtonLink from '../../atom/button-link';\nimport BulletPointMenuButton from '../../molecule/bullet-point-menu-button';\nimport style from './style.css';\n\nconst ListItem = props => {\n let isPublished = false;\n const {\n bulletPointMenuButton,\n buttonLink,\n tags,\n title,\n order,\n 'aria-label': ariaLabel,\n contentType\n } = props;\n const tagsView = map.convert({cap: false})((tag, index) => {\n isPublished = tag.type === 'published';\n return (\n <div key={index} className={style.tag}>\n <Tag {...tag} />\n </div>\n );\n })(tags);\n return (\n <div className={style.wrapper}>\n {isPublished && contentType === 'certification' ? (\n <div className={style.orderWrapper}>\n <div className={style.order} aria-label={ariaLabel}>\n {order + 1}\n </div>\n <div className={style.title} title={title}>\n {title}\n </div>\n </div>\n ) : (\n <div className={style.title} title={title}>\n {title}\n </div>\n )}\n <div className={style.settings}>\n {tagsView}\n <div className={style.edit}>\n <ButtonLink {...buttonLink} />\n </div>\n <BulletPointMenuButton {...bulletPointMenuButton} />\n </div>\n </div>\n );\n};\n\nListItem.propTypes = {\n bulletPointMenuButton: PropTypes.shape({\n buttonAriaLabel: PropTypes.string,\n menuAriaLabel: PropTypes.string,\n buttons: PropTypes.arrayOf(\n PropTypes.shape({\n 'data-name': PropTypes.string,\n label: PropTypes.string,\n type: PropTypes.string,\n onClick: PropTypes.func\n })\n ),\n onClick: PropTypes.func\n }),\n buttonLink: PropTypes.shape({\n type: PropTypes.string,\n label: PropTypes.string,\n ariaLabel: PropTypes.string,\n dataName: PropTypes.string,\n icon: PropTypes.shape({\n position: PropTypes.string,\n type: PropTypes.string\n }),\n onClick: PropTypes.func\n }),\n tags: PropTypes.arrayOf(\n PropTypes.shape({\n label: PropTypes.string,\n type: PropTypes.oneOf(['published', 'draft', 'archived', 'revised', 'default'])\n })\n ),\n title: PropTypes.string.isRequired,\n order: PropTypes.number,\n 'aria-label': PropTypes.string,\n contentType: PropTypes.string\n};\n\nexport default ListItem;\n"],"mappings":";AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,GAAP,MAAgB,gBAAhB;AACA,OAAOC,UAAP,MAAuB,wBAAvB;AACA,OAAOC,qBAAP,MAAkC,yCAAlC;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,QAAQ,GAAGC,KAAK,IAAI;EACxB,IAAIC,WAAW,GAAG,KAAlB;EACA,MAAM;IACJC,qBADI;IAEJC,UAFI;IAGJC,IAHI;IAIJC,KAJI;IAKJC,KALI;IAMJ,cAAcC,SANV;IAOJC;EAPI,IAQFR,KARJ;;EASA,MAAMS,QAAQ,GAAG,KAAIC,OAAJ,CAAY;IAACC,GAAG,EA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|
align-items: center;
|
|
41
41
|
display: flex;
|
|
42
|
-
height: 100%;
|
|
42
|
+
height: 100%;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
.tag {
|
|
46
|
-
margin: 0 16px 0 0;
|
|
46
|
+
margin: 0 16px 0 0;
|
|
47
47
|
text-overflow: ellipsis;
|
|
48
48
|
white-space: nowrap;
|
|
49
49
|
}
|
|
@@ -64,10 +64,8 @@
|
|
|
64
64
|
color: cm_grey_400;
|
|
65
65
|
margin: 0 16px 0 0;
|
|
66
66
|
}
|
|
67
|
-
|
|
68
67
|
.orderWrapper {
|
|
69
68
|
align-items: center;
|
|
70
69
|
display: flex;
|
|
71
70
|
width: 100%;
|
|
72
|
-
|
|
73
|
-
}
|
|
71
|
+
}
|
|
@@ -47,6 +47,38 @@ declare namespace ListItems {
|
|
|
47
47
|
error: PropTypes.Requireable<string>;
|
|
48
48
|
theme: PropTypes.Requireable<string>;
|
|
49
49
|
}>>;
|
|
50
|
+
items: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
51
|
+
bulletPointMenuButton: PropTypes.Requireable<PropTypes.InferProps<{
|
|
52
|
+
buttonAriaLabel: PropTypes.Requireable<string>;
|
|
53
|
+
menuAriaLabel: PropTypes.Requireable<string>;
|
|
54
|
+
buttons: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
55
|
+
'data-name': PropTypes.Requireable<string>;
|
|
56
|
+
label: PropTypes.Requireable<string>;
|
|
57
|
+
type: PropTypes.Requireable<string>;
|
|
58
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
59
|
+
}> | null | undefined)[]>;
|
|
60
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
61
|
+
}>>;
|
|
62
|
+
buttonLink: PropTypes.Requireable<PropTypes.InferProps<{
|
|
63
|
+
type: PropTypes.Requireable<string>;
|
|
64
|
+
label: PropTypes.Requireable<string>;
|
|
65
|
+
ariaLabel: PropTypes.Requireable<string>;
|
|
66
|
+
dataName: PropTypes.Requireable<string>;
|
|
67
|
+
icon: PropTypes.Requireable<PropTypes.InferProps<{
|
|
68
|
+
position: PropTypes.Requireable<string>;
|
|
69
|
+
type: PropTypes.Requireable<string>;
|
|
70
|
+
}>>;
|
|
71
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
72
|
+
}>>;
|
|
73
|
+
tags: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
74
|
+
label: PropTypes.Requireable<string>;
|
|
75
|
+
type: PropTypes.Requireable<string>;
|
|
76
|
+
}> | null | undefined)[]>;
|
|
77
|
+
title: PropTypes.Validator<string>;
|
|
78
|
+
order: PropTypes.Requireable<number>;
|
|
79
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
80
|
+
contentType: PropTypes.Requireable<string>;
|
|
81
|
+
}> | null | undefined)[]>;
|
|
50
82
|
content: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{
|
|
51
83
|
items: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
52
84
|
bulletPointMenuButton: PropTypes.Requireable<PropTypes.InferProps<{
|
|
@@ -79,12 +111,9 @@ declare namespace ListItems {
|
|
|
79
111
|
order: PropTypes.Requireable<number>;
|
|
80
112
|
'aria-label': PropTypes.Requireable<string>;
|
|
81
113
|
contentType: PropTypes.Requireable<string>;
|
|
82
|
-
id: PropTypes.Requireable<string>;
|
|
83
114
|
}> | null | undefined)[]>;
|
|
84
115
|
type: PropTypes.Requireable<string>;
|
|
85
116
|
itemType: PropTypes.Requireable<string>;
|
|
86
|
-
onDrop: PropTypes.Requireable<(...args: any[]) => any>;
|
|
87
|
-
withSystemAll: PropTypes.Requireable<boolean>;
|
|
88
117
|
}> | PropTypes.InferProps<{
|
|
89
118
|
type: PropTypes.Requireable<string>;
|
|
90
119
|
columns: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/list-items/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/list-items/index.js"],"names":[],"mappings":";AAoCA;;;;;;gBAwBC"}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
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); }
|
|
2
2
|
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import findIndex from 'lodash/fp/findIndex';
|
|
5
4
|
import PropTypes from 'prop-types';
|
|
6
5
|
import ListItem from '../list-item';
|
|
7
|
-
import DraggableList from '../../molecule/draggable-list';
|
|
8
6
|
import Title from '../../atom/title';
|
|
9
7
|
import ButtonLink from '../../atom/button-link';
|
|
10
8
|
import SelectMultiple from '../../molecule/select-multiple';
|
|
@@ -14,23 +12,14 @@ import style from './style.css';
|
|
|
14
12
|
const buildListItemsView = (content, ariaLabel, selectMultiple) => {
|
|
15
13
|
const {
|
|
16
14
|
items,
|
|
17
|
-
itemType
|
|
18
|
-
onDrop,
|
|
19
|
-
withSystemAll
|
|
15
|
+
itemType
|
|
20
16
|
} = content;
|
|
21
|
-
const itemsView =
|
|
22
|
-
type: 'published'
|
|
23
|
-
}, items[0]?.tags) !== -1 && itemType === 'certification' && !withSystemAll ? /*#__PURE__*/React.createElement(DraggableList, {
|
|
24
|
-
items: items.map(item => _extends({}, item, {
|
|
25
|
-
contentType: itemType
|
|
26
|
-
})),
|
|
27
|
-
itemType: "list-item",
|
|
28
|
-
onDrop: onDrop
|
|
29
|
-
}) : items.map((item, index) => /*#__PURE__*/React.createElement("li", {
|
|
17
|
+
const itemsView = items.map((item, index) => /*#__PURE__*/React.createElement("li", {
|
|
30
18
|
key: item.id,
|
|
31
19
|
className: style.item,
|
|
32
20
|
"data-name": `content-${index}`
|
|
33
21
|
}, /*#__PURE__*/React.createElement(ListItem, _extends({}, item, {
|
|
22
|
+
order: index,
|
|
34
23
|
contentType: itemType
|
|
35
24
|
}))));
|
|
36
25
|
return /*#__PURE__*/React.createElement("ul", {
|
|
@@ -83,12 +72,11 @@ ListItems.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
83
72
|
'aria-label': PropTypes.string,
|
|
84
73
|
buttonLink: PropTypes.shape(ButtonLink.propTypes),
|
|
85
74
|
selectMultiple: PropTypes.shape(SelectMultiple.propTypes),
|
|
75
|
+
items: PropTypes.arrayOf(PropTypes.shape(ListItem.propTypes)),
|
|
86
76
|
content: PropTypes.oneOfType([PropTypes.shape({
|
|
87
77
|
items: PropTypes.arrayOf(PropTypes.shape(ListItem.propTypes)),
|
|
88
78
|
type: PropTypes.oneOf(['list']),
|
|
89
|
-
itemType: PropTypes.string
|
|
90
|
-
onDrop: PropTypes.func,
|
|
91
|
-
withSystemAll: PropTypes.bool
|
|
79
|
+
itemType: PropTypes.string
|
|
92
80
|
}), PropTypes.shape(_extends({}, ExpandibleActionableTable.propTypes, {
|
|
93
81
|
type: PropTypes.oneOf(['expandible-actionable-table'])
|
|
94
82
|
}))]),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","ListItem","Title","ButtonLink","SelectMultiple","ExpandibleActionableTable","style","buildListItemsView","content","ariaLabel","selectMultiple","items","itemType","itemsView","map","item","index","id","list","listWithSelectMultiple","buildContentView","type","ListItems","title","buttonLink","contentView","header","actionsWrapper","buttonCreate","propTypes","string","shape","arrayOf","oneOfType","oneOf"],"sources":["../../../src/organism/list-items/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport ListItem from '../list-item';\nimport Title from '../../atom/title';\nimport ButtonLink from '../../atom/button-link';\nimport SelectMultiple from '../../molecule/select-multiple';\nimport ExpandibleActionableTable from '../../molecule/expandible-actionable-table';\nimport style from './style.css';\n\nconst buildListItemsView = (content, ariaLabel, selectMultiple) => {\n const {items, itemType} = content;\n const itemsView = items.map((item, index) => (\n <li key={item.id} className={style.item} data-name={`content-${index}`}>\n <ListItem {...item} order={index} contentType={itemType} />\n </li>\n ));\n return (\n <ul\n className={!selectMultiple ? style.list : style.listWithSelectMultiple}\n aria-label={ariaLabel}\n data-name={'content-list'}\n >\n {itemsView}\n </ul>\n );\n};\nconst buildContentView = (content, ariaLabel, selectMultiple) => {\n const {type} = content;\n switch (type) {\n case 'list':\n return buildListItemsView(content, ariaLabel, selectMultiple);\n case 'expandible-actionable-table':\n return <ExpandibleActionableTable {...content} />;\n }\n};\n\nconst ListItems = ({title, buttonLink, selectMultiple, content, 'aria-label': ariaLabel}) => {\n const contentView = buildContentView(content, ariaLabel, selectMultiple);\n\n return (\n <div>\n <div className={style.header}>\n <div className={style.title}>\n <Title title={title} type={'form-group'} data-name={'list-title'} />\n </div>\n <div className={style.actionsWrapper}>\n {selectMultiple ? (\n <div className={style.selectMultiple}>\n <SelectMultiple {...selectMultiple} />\n </div>\n ) : null}\n\n <div className={style.buttonCreate}>\n <ButtonLink {...buttonLink} />\n </div>\n </div>\n </div>\n {contentView}\n </div>\n );\n};\n\nListItems.propTypes = {\n 'aria-label': PropTypes.string,\n buttonLink: PropTypes.shape(ButtonLink.propTypes),\n selectMultiple: PropTypes.shape(SelectMultiple.propTypes),\n items: PropTypes.arrayOf(PropTypes.shape(ListItem.propTypes)),\n content: PropTypes.oneOfType([\n PropTypes.shape({\n items: PropTypes.arrayOf(PropTypes.shape(ListItem.propTypes)),\n type: PropTypes.oneOf(['list']),\n itemType: PropTypes.string\n }),\n PropTypes.shape({\n ...ExpandibleActionableTable.propTypes,\n type: PropTypes.oneOf(['expandible-actionable-table'])\n })\n ]),\n title: PropTypes.string\n};\n\nexport default ListItems;\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,QAAP,MAAqB,cAArB;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9B,SAAS,CAAC+B,KAAV,cACK1B,yBAAyB,CAACwB,SAD/B;IAEER,IAAI,EAAErB,SAAS,CAACkC,KAAV,CAAgB,CAAC,6BAAD,CAAhB;EAFR,GAN2B,CAApB,CALW;EAgBpBX,KAAK,EAAEvB,SAAS,CAAC8B;AAhBG,CAAtB;AAmBA,eAAeR,SAAf"}
|
|
@@ -100,7 +100,7 @@ function MoocFooter(props) {
|
|
|
100
100
|
};
|
|
101
101
|
|
|
102
102
|
const sections = !_isEmpty(siteMapSections) ? siteMapSections.map((section, index) => {
|
|
103
|
-
return /*#__PURE__*/React.createElement("
|
|
103
|
+
return /*#__PURE__*/React.createElement("nav", {
|
|
104
104
|
key: index,
|
|
105
105
|
className: style.sectionWrapper
|
|
106
106
|
}, /*#__PURE__*/React.createElement("p", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","NovaCompositionCoorpacademyCoorpApp","CoorpAppLogo","NovaCompositionCoorpacademyCoorpLogo","CoorpLogo","Link","SocialLink","Picture","style","socialLinksTypes","StoresLinks","onAppStoreButtonClick","appStoreButtonImageUrl","playStoreButtonImageUrl","onPlayStoreButtonClick","androidAlt","iosAlt","storeLinksContainer","imgApple","img","propTypes","func","string","MoocFooter","props","headSection","socialLinks","logoAriaLabel","socialLinksAriaLabel","siteMapSections","headSectionView","headSpacingContainer","headSectionWrapper","logoAndLabelWrapper","logoWrapper","coorpAppLogo","marketingLabel","title","mobileAppLinks","renderPagesFromSection","pages","pagesList","map","page","pindex","handleClick","onClick","link","pageLink","target","ariaLabel","sections","section","index","sectionWrapper","sectionTitle","socialLinksView","socialLink","type","socialNetworks","logoSocialNetworksContainer","coorpLogo","socialNetworksWrapper","siteMap","siteMapSpacingContainer","siteMapContainer","sectionsContainer","shape","arrayOf","oneOf"],"sources":["../../../src/organism/mooc-footer/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {isEmpty} from 'lodash/fp';\nimport {\n NovaCompositionCoorpacademyCoorpApp as CoorpAppLogo,\n NovaCompositionCoorpacademyCoorpLogo as CoorpLogo\n} from '@coorpacademy/nova-icons';\nimport Link from '../../atom/link';\nimport SocialLink from '../../atom/social-link';\nimport Picture from '../../atom/picture';\nimport style from './style.css';\n\nconst socialLinksTypes = ['facebook', 'twitter', 'linkedin', 'youtube', 'instagram'];\n\nconst StoresLinks = ({\n onAppStoreButtonClick,\n appStoreButtonImageUrl,\n playStoreButtonImageUrl,\n onPlayStoreButtonClick,\n 'android-alt': androidAlt,\n 'ios-alt': iosAlt\n}) => (\n <div className={style.storeLinksContainer}>\n <Picture\n className={style.imgApple}\n src={appStoreButtonImageUrl}\n onClick={onAppStoreButtonClick}\n alt={iosAlt}\n />\n <Picture\n className={style.img}\n src={playStoreButtonImageUrl}\n onClick={onPlayStoreButtonClick}\n alt={androidAlt}\n />\n </div>\n);\n\nStoresLinks.propTypes = {\n onAppStoreButtonClick: PropTypes.func,\n appStoreButtonImageUrl: PropTypes.string,\n playStoreButtonImageUrl: PropTypes.string,\n onPlayStoreButtonClick: PropTypes.func,\n 'android-alt': PropTypes.string,\n 'ios-alt': PropTypes.string\n};\n\nfunction MoocFooter(props) {\n const {\n headSection = {},\n socialLinks = [],\n 'logo-aria-label': logoAriaLabel,\n 'social-links-aria-label': socialLinksAriaLabel,\n siteMapSections = []\n } = props;\n\n // Header section of the footer (the marketing banner)\n\n const headSectionView = !isEmpty(headSection) ? (\n <div data-name=\"headSpacingContainer\" className={style.headSpacingContainer}>\n <div data-name=\"headSection\" className={style.headSectionWrapper}>\n <div className={style.logoAndLabelWrapper}>\n <div className={style.logoWrapper}>\n <CoorpAppLogo\n className={style.coorpAppLogo}\n aria-label={headSection['logo-aria-label']}\n />\n </div>\n <div data-name=\"mobile-marketing-text\" className={style.marketingLabel}>\n {headSection.title}\n </div>\n </div>\n <div data-name=\"mobile-apps-buttons-wrapper\" className={style.mobileAppLinks}>\n <StoresLinks\n // ignored due to naming conventions in JSX rather than a linting error\n // eslint-disable-next-line react/jsx-handler-names\n onAppStoreButtonClick={headSection.onAppStoreButtonClick}\n appStoreButtonImageUrl={headSection.appStoreButtonImageUrl}\n playStoreButtonImageUrl={headSection.playStoreButtonImageUrl}\n // eslint-disable-next-line react/jsx-handler-names\n onPlayStoreButtonClick={headSection.onPlayStoreButtonClick}\n android-alt={headSection['android-alt']}\n ios-alt={headSection['ios-alt']}\n />\n </div>\n </div>\n </div>\n ) : null;\n\n // Sitemap section of the footer (contains HELP, TOOLBOX... and other pages, as well as social links)\n\n const renderPagesFromSection = pages => {\n return (\n <ul className={style.pagesList} data-name=\"pages-list\">\n {pages.map((page, pindex) => {\n const handleClick = page.onClick;\n return (\n <li key={pindex}>\n <Link\n href={page.link}\n onClick={handleClick}\n title={page.title}\n data-text={page.title}\n className={style.pageLink}\n target={page.target}\n aria-label={page.ariaLabel ? page.ariaLabel : page.title}\n data-name={page.title}\n >\n {page.title}\n </Link>\n </li>\n );\n })}\n </ul>\n );\n };\n\n const sections = !isEmpty(siteMapSections)\n ? siteMapSections.map((section, index) => {\n return (\n <div key={index} className={style.sectionWrapper}>\n <p className={style.sectionTitle}>{section.title}</p>\n {renderPagesFromSection(section.pages)}\n </div>\n );\n })\n : null;\n\n const socialLinksView = socialLinks.map((socialLink, index) => {\n return (\n <li className={style.socialLink} key={index}>\n <SocialLink\n type={socialLink.type}\n link={socialLink.link}\n mode=\"footer\"\n aria-label={socialLink['aria-label']}\n />\n </li>\n );\n });\n\n const socialNetworks = (\n <div data-name=\"logo-social-networks-container\" className={style.logoSocialNetworksContainer}>\n <CoorpLogo\n className={style.coorpLogo}\n data-name=\"coorp-social-networks-logo\"\n aria-label={logoAriaLabel}\n />\n <ul\n data-name=\"social-networks-wrapper\"\n className={style.socialNetworksWrapper}\n aria-label={socialLinksAriaLabel}\n >\n {socialLinksView}\n </ul>\n </div>\n );\n\n const siteMap = (\n <div data-name=\"site-map-spacing-container\" className={style.siteMapSpacingContainer}>\n <div data-name=\"site-map\" className={style.siteMapContainer}>\n <div data-name=\"sections\" className={style.sectionsContainer}>\n {sections}\n </div>\n {socialNetworks}\n </div>\n </div>\n );\n\n return (\n <footer data-name=\"mooc-footer\">\n {headSectionView}\n {siteMap}\n </footer>\n );\n}\n\nMoocFooter.propTypes = {\n headSection: PropTypes.shape({\n title: PropTypes.string,\n onAppStoreButtonClick: PropTypes.func,\n appStoreButtonImageUrl: PropTypes.string,\n playStoreButtonImageUrl: PropTypes.string,\n onPlayStoreButtonClick: PropTypes.func,\n 'logo-aria-label': PropTypes.string,\n 'android-alt': PropTypes.string,\n 'ios-alt': PropTypes.string\n }),\n siteMapSections: PropTypes.arrayOf(\n PropTypes.shape({\n title: PropTypes.string,\n pages: PropTypes.arrayOf(\n PropTypes.shape({\n title: PropTypes.string,\n link: PropTypes.string,\n target: PropTypes.string,\n ariaLabel: PropTypes.string\n })\n )\n })\n ),\n socialLinks: PropTypes.arrayOf(\n PropTypes.shape({\n type: PropTypes.oneOf(socialLinksTypes),\n link: PropTypes.string,\n onClick: PropTypes.func,\n 'aria-label': PropTypes.string\n })\n ),\n 'logo-aria-label': PropTypes.string,\n 'social-links-aria-label': PropTypes.string\n};\n\nexport default MoocFooter;\n"],"mappings":";AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,SACEC,mCAAmC,IAAIC,YADzC,EAEEC,oCAAoC,IAAIC,SAF1C,QAGO,0BAHP;AAIA,OAAOC,IAAP,MAAiB,iBAAjB;AACA,OAAOC,UAAP,MAAuB,wBAAvB;AACA,OAAOC,OAAP,MAAoB,oBAApB;AACA,OAAOC,KAAP,MAAkB,aAAlB;AAEA,MAAMC,gBAAN,2CAAyB,CAAC,UAAD,EAAa,SAAb,EAAwB,UAAxB,EAAoC,SAApC,EAA+C,WAA/C,CAAzB;;AAEA,MAAMC,WAAW,GAAG,CAAC;EACnBC,qBADmB;EAEnBC,sBAFmB;EAGnBC,uBAHmB;EAInBC,sB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ACsB;AAjChB,CAAvB;AAoCA,eAAeC,UAAf"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","NovaCompositionCoorpacademyCoorpApp","CoorpAppLogo","NovaCompositionCoorpacademyCoorpLogo","CoorpLogo","Link","SocialLink","Picture","style","socialLinksTypes","StoresLinks","onAppStoreButtonClick","appStoreButtonImageUrl","playStoreButtonImageUrl","onPlayStoreButtonClick","androidAlt","iosAlt","storeLinksContainer","imgApple","img","propTypes","func","string","MoocFooter","props","headSection","socialLinks","logoAriaLabel","socialLinksAriaLabel","siteMapSections","headSectionView","headSpacingContainer","headSectionWrapper","logoAndLabelWrapper","logoWrapper","coorpAppLogo","marketingLabel","title","mobileAppLinks","renderPagesFromSection","pages","pagesList","map","page","pindex","handleClick","onClick","link","pageLink","target","ariaLabel","sections","section","index","sectionWrapper","sectionTitle","socialLinksView","socialLink","type","socialNetworks","logoSocialNetworksContainer","coorpLogo","socialNetworksWrapper","siteMap","siteMapSpacingContainer","siteMapContainer","sectionsContainer","shape","arrayOf","oneOf"],"sources":["../../../src/organism/mooc-footer/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {isEmpty} from 'lodash/fp';\nimport {\n NovaCompositionCoorpacademyCoorpApp as CoorpAppLogo,\n NovaCompositionCoorpacademyCoorpLogo as CoorpLogo\n} from '@coorpacademy/nova-icons';\nimport Link from '../../atom/link';\nimport SocialLink from '../../atom/social-link';\nimport Picture from '../../atom/picture';\nimport style from './style.css';\n\nconst socialLinksTypes = ['facebook', 'twitter', 'linkedin', 'youtube', 'instagram'];\n\nconst StoresLinks = ({\n onAppStoreButtonClick,\n appStoreButtonImageUrl,\n playStoreButtonImageUrl,\n onPlayStoreButtonClick,\n 'android-alt': androidAlt,\n 'ios-alt': iosAlt\n}) => (\n <div className={style.storeLinksContainer}>\n <Picture\n className={style.imgApple}\n src={appStoreButtonImageUrl}\n onClick={onAppStoreButtonClick}\n alt={iosAlt}\n />\n <Picture\n className={style.img}\n src={playStoreButtonImageUrl}\n onClick={onPlayStoreButtonClick}\n alt={androidAlt}\n />\n </div>\n);\n\nStoresLinks.propTypes = {\n onAppStoreButtonClick: PropTypes.func,\n appStoreButtonImageUrl: PropTypes.string,\n playStoreButtonImageUrl: PropTypes.string,\n onPlayStoreButtonClick: PropTypes.func,\n 'android-alt': PropTypes.string,\n 'ios-alt': PropTypes.string\n};\n\nfunction MoocFooter(props) {\n const {\n headSection = {},\n socialLinks = [],\n 'logo-aria-label': logoAriaLabel,\n 'social-links-aria-label': socialLinksAriaLabel,\n siteMapSections = []\n } = props;\n\n // Header section of the footer (the marketing banner)\n\n const headSectionView = !isEmpty(headSection) ? (\n <div data-name=\"headSpacingContainer\" className={style.headSpacingContainer}>\n <div data-name=\"headSection\" className={style.headSectionWrapper}>\n <div className={style.logoAndLabelWrapper}>\n <div className={style.logoWrapper}>\n <CoorpAppLogo\n className={style.coorpAppLogo}\n aria-label={headSection['logo-aria-label']}\n />\n </div>\n <div data-name=\"mobile-marketing-text\" className={style.marketingLabel}>\n {headSection.title}\n </div>\n </div>\n <div data-name=\"mobile-apps-buttons-wrapper\" className={style.mobileAppLinks}>\n <StoresLinks\n // ignored due to naming conventions in JSX rather than a linting error\n // eslint-disable-next-line react/jsx-handler-names\n onAppStoreButtonClick={headSection.onAppStoreButtonClick}\n appStoreButtonImageUrl={headSection.appStoreButtonImageUrl}\n playStoreButtonImageUrl={headSection.playStoreButtonImageUrl}\n // eslint-disable-next-line react/jsx-handler-names\n onPlayStoreButtonClick={headSection.onPlayStoreButtonClick}\n android-alt={headSection['android-alt']}\n ios-alt={headSection['ios-alt']}\n />\n </div>\n </div>\n </div>\n ) : null;\n\n // Sitemap section of the footer (contains HELP, TOOLBOX... and other pages, as well as social links)\n\n const renderPagesFromSection = pages => {\n return (\n <ul className={style.pagesList} data-name=\"pages-list\">\n {pages.map((page, pindex) => {\n const handleClick = page.onClick;\n return (\n <li key={pindex}>\n <Link\n href={page.link}\n onClick={handleClick}\n title={page.title}\n data-text={page.title}\n className={style.pageLink}\n target={page.target}\n aria-label={page.ariaLabel ? page.ariaLabel : page.title}\n data-name={page.title}\n >\n {page.title}\n </Link>\n </li>\n );\n })}\n </ul>\n );\n };\n\n const sections = !isEmpty(siteMapSections)\n ? siteMapSections.map((section, index) => {\n return (\n <nav key={index} className={style.sectionWrapper}>\n <p className={style.sectionTitle}>{section.title}</p>\n {renderPagesFromSection(section.pages)}\n </nav>\n );\n })\n : null;\n\n const socialLinksView = socialLinks.map((socialLink, index) => {\n return (\n <li className={style.socialLink} key={index}>\n <SocialLink\n type={socialLink.type}\n link={socialLink.link}\n mode=\"footer\"\n aria-label={socialLink['aria-label']}\n />\n </li>\n );\n });\n\n const socialNetworks = (\n <div data-name=\"logo-social-networks-container\" className={style.logoSocialNetworksContainer}>\n <CoorpLogo\n className={style.coorpLogo}\n data-name=\"coorp-social-networks-logo\"\n aria-label={logoAriaLabel}\n />\n <ul\n data-name=\"social-networks-wrapper\"\n className={style.socialNetworksWrapper}\n aria-label={socialLinksAriaLabel}\n >\n {socialLinksView}\n </ul>\n </div>\n );\n\n const siteMap = (\n <div data-name=\"site-map-spacing-container\" className={style.siteMapSpacingContainer}>\n <div data-name=\"site-map\" className={style.siteMapContainer}>\n <div data-name=\"sections\" className={style.sectionsContainer}>\n {sections}\n </div>\n {socialNetworks}\n </div>\n </div>\n );\n\n return (\n <footer data-name=\"mooc-footer\">\n {headSectionView}\n {siteMap}\n </footer>\n );\n}\n\nMoocFooter.propTypes = {\n headSection: PropTypes.shape({\n title: PropTypes.string,\n onAppStoreButtonClick: PropTypes.func,\n appStoreButtonImageUrl: PropTypes.string,\n playStoreButtonImageUrl: PropTypes.string,\n onPlayStoreButtonClick: PropTypes.func,\n 'logo-aria-label': PropTypes.string,\n 'android-alt': PropTypes.string,\n 'ios-alt': PropTypes.string\n }),\n siteMapSections: PropTypes.arrayOf(\n PropTypes.shape({\n title: PropTypes.string,\n pages: PropTypes.arrayOf(\n PropTypes.shape({\n title: PropTypes.string,\n link: PropTypes.string,\n target: PropTypes.string,\n ariaLabel: PropTypes.string\n })\n )\n })\n ),\n socialLinks: PropTypes.arrayOf(\n PropTypes.shape({\n type: PropTypes.oneOf(socialLinksTypes),\n link: PropTypes.string,\n onClick: PropTypes.func,\n 'aria-label': PropTypes.string\n })\n ),\n 'logo-aria-label': PropTypes.string,\n 'social-links-aria-label': PropTypes.string\n};\n\nexport default MoocFooter;\n"],"mappings":";AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,SACEC,mCAAmC,IAAIC,YADzC,EAEEC,oCAAoC,IAAIC,SAF1C,QAGO,0BAHP;AAIA,OAAOC,IAAP,MAAiB,iBAAjB;AACA,OAAOC,UAAP,MAAuB,wBAAvB;AACA,OAAOC,OAAP,MAAoB,oBAApB;AACA,OAAOC,KAAP,MAAkB,aAAlB;AAEA,MAAMC,gBAAN,2CAAyB,CAAC,UAAD,EAAa,SAAb,EAAwB,UAAxB,EAAoC,SAApC,EAA+C,WAA/C,CAAzB;;AAEA,MAAMC,WAAW,GAAG,CAAC;EACnBC,qBADmB;EAEnBC,sBAFmB;EAGnBC,uBAHmB;EAInBC,sBAJmB;EAKnB,eAAeC,UALI;EAMnB,WAAWC;AANQ,CAAD,kBAQlB;EAAK,SAAS,EAAER,KAAK,CAACS;AAAtB,gBACE,oBAAC,OAAD;EACE,SAAS,EAAET,KAAK,CAACU,QADnB;EAEE,GAAG,EAAEN,sBAFP;EAGE,OAAO,EAAED,qBAHX;EAIE,GAAG,EAAEK;AAJP,EADF,eAOE,oBAAC,OAAD;EACE,SAAS,EAAER,KAAK,CAACW,GADnB;EAEE,GAAG,EAAEN,uBAFP;EAGE,OAAO,EAAEC,sBAHX;EAIE,GAAG,EAAEC;AAJP,EAPF,CARF;;AAwBAL,WAAW,CAACU,SAAZ,2CAAwB;EACtBT,qBAAqB,EAAEX,SAAS,CAACqB,IADX;EAEtBT,sBAAsB,EAAE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sB;EARM,CAAhB,CADQ;EAWrBO,eAAe,EAAE7B,SAAS,CAACoE,OAAV,CACfpE,SAAS,CAACmE,KAAV,CAAgB;IACd9B,KAAK,EAAErC,SAAS,CAACsB,MADH;IAEdkB,KAAK,EAAExC,SAAS,CAACoE,OAAV,CACLpE,SAAS,CAACmE,KAAV,CAAgB;MACd9B,KAAK,EAAErC,SAAS,CAACsB,MADH;MAEdyB,IAAI,EAAE/C,SAAS,CAACsB,MAFF;MAGd2B,MAAM,EAAEjD,SAAS,CAACsB,MAHJ;MAId4B,SAAS,EAAElD,SAAS,CAACsB;IAJP,CAAhB,CADK;EAFO,CAAhB,CADe,CAXI;EAwBrBI,WAAW,EAAE1B,SAAS,CAACoE,OAAV,CACXpE,SAAS,CAACmE,KAAV,CAAgB;IACdT,IAAI,EAAE1D,SAAS,CAACqE,KAAV,CAAgB5D,gBAAhB,CADQ;IAEdsC,IAAI,EAAE/C,SAAS,CAACsB,MAFF;IAGdwB,OAAO,EAAE9C,SAAS,CAACqB,IAHL;IAId,cAAcrB,SAAS,CAACsB;EAJV,CAAhB,CADW,CAxBQ;EAgCrB,mBAAmBtB,SAAS,CAACsB,MAhCR;EAiCrB,2BAA2BtB,SAAS,CAACsB;AAjChB,CAAvB;AAoCA,eAAeC,UAAf"}
|
|
@@ -629,7 +629,7 @@ class MoocHeader extends React.Component {
|
|
|
629
629
|
style: {
|
|
630
630
|
color: primaryColor
|
|
631
631
|
}
|
|
632
|
-
}))) : null)), searchFormView, /*#__PURE__*/React.createElement("
|
|
632
|
+
}))) : null)), searchFormView, /*#__PURE__*/React.createElement("nav", {
|
|
633
633
|
className: isMenuOpen ? style.menuWrapper : style.hiddenMenuWrapper,
|
|
634
634
|
"data-name": "menu-wrapper"
|
|
635
635
|
}, pagesView, userView || linksView, settingsView)));
|