@coorpacademy/components 10.5.5 → 10.5.7-alpha.6.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/range/handle.css +18 -2
- package/es/atom/range/handle.js +7 -3
- package/es/atom/range/handle.js.map +1 -1
- package/es/atom/range/style.css +2 -2
- package/es/molecule/cockpit-popin/test/fixtures.js +17 -0
- package/es/molecule/cockpit-popin/test/fixtures.js.map +1 -0
- package/es/molecule/course-section/index.js +5 -3
- package/es/molecule/course-section/index.js.map +1 -1
- package/es/molecule/course-section/style.css +2 -1
- package/es/molecule/course-section/test/fixtures/chapter.js +2 -1
- package/es/molecule/course-section/test/fixtures/chapter.js.map +1 -1
- package/es/molecule/course-section/test/fixtures/course.js +2 -1
- package/es/molecule/course-section/test/fixtures/course.js.map +1 -1
- package/es/molecule/course-sections/index.js +40 -0
- package/es/molecule/course-sections/index.js.map +1 -0
- package/es/molecule/course-sections/style.css +3 -0
- package/es/molecule/course-sections/test/fixtures/default.js +149 -0
- package/es/molecule/course-sections/test/fixtures/default.js.map +1 -0
- package/es/molecule/course-sections/test/fixtures/loading.js +9 -0
- package/es/molecule/course-sections/test/fixtures/loading.js.map +1 -0
- package/es/molecule/draggable/index.js +1 -1
- package/es/molecule/draggable/index.js.map +1 -1
- package/es/molecule/draggable/style.css +1 -5
- package/es/molecule/draggable-list/index.js +6 -4
- package/es/molecule/draggable-list/index.js.map +1 -1
- package/es/molecule/draggable-list/test/fixtures/course-sections.js +20 -0
- package/es/molecule/draggable-list/test/fixtures/course-sections.js.map +1 -0
- package/es/molecule/draggable-list/test/on-drop.js +13 -13
- package/es/molecule/draggable-list/test/on-drop.js.map +1 -1
- package/es/molecule/questions/qcm/index.js +37 -25
- package/es/molecule/questions/qcm/index.js.map +1 -1
- package/es/molecule/questions/qcm/style.css +48 -14
- package/es/molecule/questions/qcm/test/fixtures/default.js +8 -0
- package/es/molecule/questions/qcm/test/fixtures/default.js.map +1 -1
- package/es/molecule/questions/qcm/test/qcm.js +103 -0
- package/es/molecule/questions/qcm/test/qcm.js.map +1 -0
- package/es/molecule/questions/qcm-graphic/index.js +35 -17
- package/es/molecule/questions/qcm-graphic/index.js.map +1 -1
- package/es/molecule/questions/qcm-graphic/style.css +64 -13
- package/es/molecule/questions/qcm-graphic/test/qcm-graphic.js +65 -0
- package/es/molecule/questions/qcm-graphic/test/qcm-graphic.js.map +1 -0
- package/es/molecule/questions/question-range/style.css +9 -8
- package/es/molecule/setup-section/style.css +1 -0
- package/es/molecule/wizard-summary/test/fixtures/organize-courses.js +106 -0
- package/es/molecule/wizard-summary/test/fixtures/organize-courses.js.map +1 -0
- package/es/organism/wizard-contents/index.js +6 -0
- package/es/organism/wizard-contents/index.js.map +1 -1
- package/es/organism/wizard-contents/test/fixtures/playlist-organize-courses.js +45 -0
- package/es/organism/wizard-contents/test/fixtures/playlist-organize-courses.js.map +1 -0
- package/es/template/back-office/brand-update/test/fixtures/wizard-organize-courses-playlist.js +22 -0
- package/es/template/back-office/brand-update/test/fixtures/wizard-organize-courses-playlist.js.map +1 -0
- package/es/util/get-shadow-box-color-from-primary.js +4 -0
- package/es/util/get-shadow-box-color-from-primary.js.map +1 -0
- package/es/util/test/get-shadow-box-color-from-primary.js +33 -0
- package/es/util/test/get-shadow-box-color-from-primary.js.map +1 -0
- package/es/variables/colors.css +3 -0
- package/lib/atom/range/handle.css +18 -2
- package/lib/atom/range/handle.js +8 -3
- package/lib/atom/range/handle.js.map +1 -1
- package/lib/atom/range/style.css +2 -2
- package/lib/molecule/cockpit-popin/test/fixtures.js +28 -0
- package/lib/molecule/cockpit-popin/test/fixtures.js.map +1 -0
- package/lib/molecule/course-section/index.js +5 -3
- package/lib/molecule/course-section/index.js.map +1 -1
- package/lib/molecule/course-section/style.css +2 -1
- package/lib/molecule/course-section/test/fixtures/chapter.js +2 -1
- package/lib/molecule/course-section/test/fixtures/chapter.js.map +1 -1
- package/lib/molecule/course-section/test/fixtures/course.js +2 -1
- package/lib/molecule/course-section/test/fixtures/course.js.map +1 -1
- package/lib/molecule/course-sections/index.js +54 -0
- package/lib/molecule/course-sections/index.js.map +1 -0
- package/lib/molecule/course-sections/style.css +3 -0
- package/lib/molecule/course-sections/test/fixtures/default.js +154 -0
- package/lib/molecule/course-sections/test/fixtures/default.js.map +1 -0
- package/lib/molecule/course-sections/test/fixtures/loading.js +14 -0
- package/lib/molecule/course-sections/test/fixtures/loading.js.map +1 -0
- package/lib/molecule/draggable/index.js +1 -1
- package/lib/molecule/draggable/index.js.map +1 -1
- package/lib/molecule/draggable/style.css +1 -5
- package/lib/molecule/draggable-list/index.js +7 -4
- package/lib/molecule/draggable-list/index.js.map +1 -1
- package/lib/molecule/draggable-list/test/fixtures/course-sections.js +29 -0
- package/lib/molecule/draggable-list/test/fixtures/course-sections.js.map +1 -0
- package/lib/molecule/draggable-list/test/on-drop.js +13 -13
- package/lib/molecule/draggable-list/test/on-drop.js.map +1 -1
- package/lib/molecule/questions/qcm/index.js +44 -23
- package/lib/molecule/questions/qcm/index.js.map +1 -1
- package/lib/molecule/questions/qcm/style.css +48 -14
- package/lib/molecule/questions/qcm/test/fixtures/default.js +8 -0
- package/lib/molecule/questions/qcm/test/fixtures/default.js.map +1 -1
- package/lib/molecule/questions/qcm/test/qcm.js +115 -0
- package/lib/molecule/questions/qcm/test/qcm.js.map +1 -0
- package/lib/molecule/questions/qcm-graphic/index.js +33 -15
- package/lib/molecule/questions/qcm-graphic/index.js.map +1 -1
- package/lib/molecule/questions/qcm-graphic/style.css +64 -13
- package/lib/molecule/questions/qcm-graphic/test/qcm-graphic.js +76 -0
- package/lib/molecule/questions/qcm-graphic/test/qcm-graphic.js.map +1 -0
- package/lib/molecule/questions/question-range/style.css +9 -8
- package/lib/molecule/setup-section/style.css +1 -0
- package/lib/molecule/wizard-summary/test/fixtures/organize-courses.js +111 -0
- package/lib/molecule/wizard-summary/test/fixtures/organize-courses.js.map +1 -0
- package/lib/organism/wizard-contents/index.js +7 -0
- package/lib/organism/wizard-contents/index.js.map +1 -1
- package/lib/organism/wizard-contents/test/fixtures/playlist-organize-courses.js +54 -0
- package/lib/organism/wizard-contents/test/fixtures/playlist-organize-courses.js.map +1 -0
- package/lib/template/back-office/brand-update/test/fixtures/wizard-organize-courses-playlist.js +32 -0
- package/lib/template/back-office/brand-update/test/fixtures/wizard-organize-courses-playlist.js.map +1 -0
- package/lib/util/get-shadow-box-color-from-primary.js +12 -0
- package/lib/util/get-shadow-box-color-from-primary.js.map +1 -0
- package/lib/util/test/get-shadow-box-color-from-primary.js +40 -0
- package/lib/util/test/get-shadow-box-color-from-primary.js.map +1 -0
- package/lib/variables/colors.css +3 -0
- package/package.json +2 -2
- package/es/molecule/draggable-list/test/fixtures.js +0 -13
- package/es/molecule/draggable-list/test/fixtures.js.map +0 -1
- package/lib/molecule/draggable-list/test/fixtures.js +0 -22
- package/lib/molecule/draggable-list/test/fixtures.js.map +0 -1
package/es/atom/range/handle.css
CHANGED
|
@@ -1,10 +1,26 @@
|
|
|
1
1
|
@value colors: "../../variables/colors.css";
|
|
2
|
-
@value
|
|
2
|
+
@value white from colors;
|
|
3
|
+
@value cm_grey_200 from colors;
|
|
4
|
+
@value cm_grey_500 from colors;
|
|
5
|
+
|
|
6
|
+
.wrapper {
|
|
7
|
+
height: 100%;
|
|
8
|
+
width: 100%;
|
|
9
|
+
border-radius: 100%;
|
|
10
|
+
box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.25);
|
|
11
|
+
overflow: hidden;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.wrapper:hover {
|
|
15
|
+
box-shadow: none;
|
|
16
|
+
overflow: visible;
|
|
17
|
+
}
|
|
3
18
|
|
|
4
19
|
.default {
|
|
5
20
|
border-radius: 100%;
|
|
6
|
-
border:
|
|
21
|
+
border: 4px solid white;
|
|
7
22
|
box-sizing: border-box;
|
|
8
23
|
height: 100%;
|
|
9
24
|
width: 100%;
|
|
25
|
+
border-radius: 100%;
|
|
10
26
|
}
|
package/es/atom/range/handle.js
CHANGED
|
@@ -6,6 +6,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
6
6
|
import React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import Provider from '../provider';
|
|
9
|
+
import { getShadowBoxColorFromPrimary } from '../../util/get-shadow-box-color-from-primary';
|
|
9
10
|
import style from './handle.css';
|
|
10
11
|
const Hammer = // eslint-disable-next-line no-undef
|
|
11
12
|
typeof window !== 'undefined' ? require('hammerjs') :
|
|
@@ -53,15 +54,18 @@ class Handle extends React.Component {
|
|
|
53
54
|
|
|
54
55
|
const primaryColor = _getOr('#00B0FF', 'common.primary', skin);
|
|
55
56
|
|
|
56
|
-
const
|
|
57
|
+
const backgroundColor = primaryColor;
|
|
57
58
|
return /*#__PURE__*/React.createElement("div", {
|
|
59
|
+
className: style.wrapper
|
|
60
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
58
61
|
style: {
|
|
59
|
-
|
|
62
|
+
backgroundColor,
|
|
63
|
+
boxShadow: `0px 0px 20px ${getShadowBoxColorFromPrimary(primaryColor)}`
|
|
60
64
|
},
|
|
61
65
|
className: style.default,
|
|
62
66
|
ref: this.setHandle,
|
|
63
67
|
"data-name": 'handle'
|
|
64
|
-
});
|
|
68
|
+
}));
|
|
65
69
|
}
|
|
66
70
|
|
|
67
71
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/atom/range/handle.js"],"names":["React","PropTypes","Provider","style","Hammer","window","require","undefined","Handle","Component","constructor","props","context","setHandle","bind","componentDidMount","onPanStart","onPanEnd","onPan","hammer","handle","on","componentWillUnmount","stop","destroy","el","render","skin","primaryColor","
|
|
1
|
+
{"version":3,"sources":["../../../src/atom/range/handle.js"],"names":["React","PropTypes","Provider","getShadowBoxColorFromPrimary","style","Hammer","window","require","undefined","Handle","Component","constructor","props","context","setHandle","bind","componentDidMount","onPanStart","onPanEnd","onPan","hammer","handle","on","componentWillUnmount","stop","destroy","el","render","skin","primaryColor","backgroundColor","wrapper","boxShadow","default","childContextTypes","propTypes","func"],"mappings":";;;;;AACA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,QAAP,MAAqB,aAArB;AACA,SAAQC,4BAAR,QAA2C,8CAA3C;AACA,OAAOC,KAAP,MAAkB,cAAlB;AAEA,MAAMC,MAAM,GACV;AACA,OAAOC,MAAP,KAAkB,WAAlB,GAAgCC,OAAO,CAAC,UAAD,CAAvC;AAAsD;AAA2BC,SAFnF;;AAIA,MAAMC,MAAN,SAAqBT,KAAK,CAACU,SAA3B,CAAqC;AAWnCC,EAAAA,WAAW,CAACC,KAAD,EAAQC,OAAR,EAAiB;AAC1B,UAAMD,KAAN,EAAaC,OAAb;AAEA,SAAKC,SAAL,GAAiB,KAAKA,SAAL,CAAeC,IAAf,CAAoB,IAApB,CAAjB;AACD;;AAEDC,EAAAA,iBAAiB,GAAG;AAClB;AACA,QAAIX,MAAJ,EAAY;AACV,YAAM;AAACY,QAAAA,UAAU,QAAX;AAAoBC,QAAAA,QAAQ,QAA5B;AAAqCC,QAAAA,KAAK;AAA1C,UAAqD,KAAKP,KAAhE;AAEA,WAAKQ,MAAL,GAAc,IAAIf,MAAJ,CAAW,KAAKgB,MAAhB,CAAd;AACA,WAAKD,MAAL,CAAYE,EAAZ,CAAe,UAAf,EAA2BL,UAA3B;AACA,WAAKG,MAAL,CAAYE,EAAZ,CAAe,QAAf,EAAyBJ,QAAzB;AAEA,WAAKE,MAAL,CAAYE,EAAZ,CAAe,kBAAf,EAAmCH,KAAnC;AACD;AACF;;AAEDI,EAAAA,oBAAoB,GAAG;AACrB,QAAI,KAAKH,MAAT,EAAiB;AACf,WAAKA,MAAL,CAAYI,IAAZ;AACA,WAAKJ,MAAL,CAAYK,OAAZ;AACD;;AACD,SAAKL,MAAL,GAAc,IAAd;AACD;;AAEDN,EAAAA,SAAS,CAACY,EAAD,EAAK;AACZ,SAAKL,MAAL,GAAcK,EAAd;AACD;;AAEDC,EAAAA,MAAM,GAAG;AACP,UAAM;AAACC,MAAAA;AAAD,QAAS,KAAKf,OAApB;;AACA,UAAMgB,YAAY,GAAG,OAAM,SAAN,EAAiB,gBAAjB,EAAmCD,IAAnC,CAArB;;AACA,UAAME,eAAe,GAAGD,YAAxB;AAEA,wBACE;AAAK,MAAA,SAAS,EAAEzB,KAAK,CAAC2B;AAAtB,oBACE;AACE,MAAA,KAAK,EAAE;AACLD,QAAAA,eADK;AAELE,QAAAA,SAAS,EAAG,gBAAe7B,4BAA4B,CAAC0B,YAAD,CAAe;AAFjE,OADT;AAKE,MAAA,SAAS,EAAEzB,KAAK,CAAC6B,OALnB;AAME,MAAA,GAAG,EAAE,KAAKnB,SANZ;AAOE,mBAAW;AAPb,MADF,CADF;AAaD;;AA5DkC;;gBAA/BL,M,kBAOkB;AACpBmB,EAAAA,IAAI,EAAE1B,QAAQ,CAACgC,iBAAT,CAA2BN;AADb,C;;AAPlBnB,M,CACG0B,S,2CAAY;AACjBhB,EAAAA,KAAK,EAAElB,SAAS,CAACmC,IADA;AAEjBnB,EAAAA,UAAU,EAAEhB,SAAS,CAACmC,IAFL;AAGjBlB,EAAAA,QAAQ,EAAEjB,SAAS,CAACmC;AAHH,C;AA8DrB,eAAe3B,MAAf","sourcesContent":["import {noop, getOr} from 'lodash/fp';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport Provider from '../provider';\nimport {getShadowBoxColorFromPrimary} from '../../util/get-shadow-box-color-from-primary';\nimport style from './handle.css';\n\nconst Hammer =\n // eslint-disable-next-line no-undef\n typeof window !== 'undefined' ? require('hammerjs') : /* istanbul ignore next */ undefined;\n\nclass Handle extends React.Component {\n static propTypes = {\n onPan: PropTypes.func,\n onPanStart: PropTypes.func,\n onPanEnd: PropTypes.func\n };\n\n static contextTypes = {\n skin: Provider.childContextTypes.skin\n };\n\n constructor(props, context) {\n super(props, context);\n\n this.setHandle = this.setHandle.bind(this);\n }\n\n componentDidMount() {\n /* istanbul ignore else */\n if (Hammer) {\n const {onPanStart = noop, onPanEnd = noop, onPan = noop} = this.props;\n\n this.hammer = new Hammer(this.handle);\n this.hammer.on('panstart', onPanStart);\n this.hammer.on('panend', onPanEnd);\n\n this.hammer.on('panleft panright', onPan);\n }\n }\n\n componentWillUnmount() {\n if (this.hammer) {\n this.hammer.stop();\n this.hammer.destroy();\n }\n this.hammer = null;\n }\n\n setHandle(el) {\n this.handle = el;\n }\n\n render() {\n const {skin} = this.context;\n const primaryColor = getOr('#00B0FF', 'common.primary', skin);\n const backgroundColor = primaryColor;\n\n return (\n <div className={style.wrapper}>\n <div\n style={{\n backgroundColor,\n boxShadow: `0px 0px 20px ${getShadowBoxColorFromPrimary(primaryColor)}`\n }}\n className={style.default}\n ref={this.setHandle}\n data-name={'handle'}\n />\n </div>\n );\n }\n}\n\nexport default Handle;\n"],"file":"handle.js"}
|
package/es/atom/range/style.css
CHANGED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import test from 'ava';
|
|
2
|
+
import forEach from 'lodash/forEach';
|
|
3
|
+
import renderComponentMacro from '../../../test/helpers/render-component';
|
|
4
|
+
import MoleculeCockpitPopin from '..';
|
|
5
|
+
import fixtureDefault from './fixtures/default';
|
|
6
|
+
import fixtureLoading from './fixtures/loading';
|
|
7
|
+
import fixtureVideoTranslate from './fixtures/video-translate';
|
|
8
|
+
test('Molecule › MoleculeCockpitPopin > should have valid propTypes', t => {
|
|
9
|
+
t.pass();
|
|
10
|
+
forEach(MoleculeCockpitPopin.propTypes, (value, key) => {
|
|
11
|
+
t.not(value, undefined, `PropType for "Molecule.MoleculeCockpitPopin.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
test('Molecule › MoleculeCockpitPopin › Default › should be rendered', renderComponentMacro, MoleculeCockpitPopin, fixtureDefault);
|
|
15
|
+
test('Molecule › MoleculeCockpitPopin › Loading › should be rendered', renderComponentMacro, MoleculeCockpitPopin, fixtureLoading);
|
|
16
|
+
test('Molecule › MoleculeCockpitPopin › VideoTranslate › should be rendered', renderComponentMacro, MoleculeCockpitPopin, fixtureVideoTranslate);
|
|
17
|
+
//# sourceMappingURL=fixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/molecule/cockpit-popin/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","MoleculeCockpitPopin","fixtureDefault","fixtureLoading","fixtureVideoTranslate","t","pass","propTypes","value","key","not","undefined"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,KAAjB;AACA,OAAOC,OAAP,MAAoB,gBAApB;AACA,OAAOC,oBAAP,MAAiC,wCAAjC;AACA,OAAOC,oBAAP,MAAiC,IAAjC;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,qBAAP,MAAkC,4BAAlC;AAEAN,IAAI,CAAC,+DAAD,EAAkEO,CAAC,IAAI;AACzEA,EAAAA,CAAC,CAACC,IAAF;AACAP,EAAAA,OAAO,CAACE,oBAAoB,CAACM,SAAtB,EAAiC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACtDJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,yDAAwDF,GAAI,mEAArF;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAX,IAAI,CAAC,gEAAD,EAAmEE,oBAAnE,EAAyFC,oBAAzF,EAA+GC,cAA/G,CAAJ;AACAJ,IAAI,CAAC,gEAAD,EAAmEE,oBAAnE,EAAyFC,oBAAzF,EAA+GE,cAA/G,CAAJ;AACAL,IAAI,CAAC,uEAAD,EAA0EE,oBAA1E,EAAgGC,oBAAhG,EAAsHG,qBAAtH,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeCockpitPopin from '..';\nimport fixtureDefault from './fixtures/default';\nimport fixtureLoading from './fixtures/loading';\nimport fixtureVideoTranslate from './fixtures/video-translate';\n\ntest('Molecule › MoleculeCockpitPopin > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeCockpitPopin.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Molecule.MoleculeCockpitPopin.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Molecule › MoleculeCockpitPopin › Default › should be rendered', renderComponentMacro, MoleculeCockpitPopin, fixtureDefault);\ntest('Molecule › MoleculeCockpitPopin › Loading › should be rendered', renderComponentMacro, MoleculeCockpitPopin, fixtureLoading);\ntest('Molecule › MoleculeCockpitPopin › VideoTranslate › should be rendered', renderComponentMacro, MoleculeCockpitPopin, fixtureVideoTranslate);\n"],"file":"fixtures.js"}
|
|
@@ -17,12 +17,13 @@ const CourseSection = props => {
|
|
|
17
17
|
'aria-label': {
|
|
18
18
|
title: ariaLabelTitle,
|
|
19
19
|
author: ariaLabelAuthor
|
|
20
|
-
}
|
|
20
|
+
},
|
|
21
|
+
id
|
|
21
22
|
} = props;
|
|
22
23
|
return /*#__PURE__*/React.createElement("div", {
|
|
23
24
|
className: style.container,
|
|
24
25
|
"aria-label": ariaLabelTitle,
|
|
25
|
-
"data-name": `course-section-${
|
|
26
|
+
"data-name": `course-section-${id}`
|
|
26
27
|
}, /*#__PURE__*/React.createElement("span", {
|
|
27
28
|
className: style.position
|
|
28
29
|
}, position), /*#__PURE__*/React.createElement("div", {
|
|
@@ -54,7 +55,8 @@ CourseSection.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
54
55
|
contentBadge: PropTypes.shape(ContentBadge.propTypes),
|
|
55
56
|
title: PropTypes.string,
|
|
56
57
|
author: PropTypes.string,
|
|
57
|
-
position: PropTypes.number
|
|
58
|
+
position: PropTypes.number,
|
|
59
|
+
id: PropTypes.string
|
|
58
60
|
} : {};
|
|
59
61
|
export default CourseSection;
|
|
60
62
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/molecule/course-section/index.js"],"names":["React","PropTypes","CardImagePreview","ContentBadge","style","CourseSection","props","image","contentBadge","category","label","title","author","position","ariaLabelTitle","ariaLabelAuthor","container","containerImage","containerInfos","containerMainInfos","propTypes","shape","string","number"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,gBAAP,MAA6B,+BAA7B;AACA,OAAOC,YAAP,MAAyB,0BAAzB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,aAAa,GAAGC,KAAK,IAAI;AAC7B,QAAM;AACJC,IAAAA,KADI;AAEJC,IAAAA,YAAY,EAAE;AAACC,MAAAA,QAAD;AAAWC,MAAAA;AAAX,KAFV;AAGJC,IAAAA,KAHI;AAIJC,IAAAA,MAJI;AAKJC,IAAAA,QALI;AAMJ,kBAAc;AAACF,MAAAA,KAAK,EAAEG,cAAR;AAAwBF,MAAAA,MAAM,EAAEG;AAAhC;
|
|
1
|
+
{"version":3,"sources":["../../../src/molecule/course-section/index.js"],"names":["React","PropTypes","CardImagePreview","ContentBadge","style","CourseSection","props","image","contentBadge","category","label","title","author","position","ariaLabelTitle","ariaLabelAuthor","id","container","containerImage","containerInfos","containerMainInfos","propTypes","shape","string","number"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,gBAAP,MAA6B,+BAA7B;AACA,OAAOC,YAAP,MAAyB,0BAAzB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,aAAa,GAAGC,KAAK,IAAI;AAC7B,QAAM;AACJC,IAAAA,KADI;AAEJC,IAAAA,YAAY,EAAE;AAACC,MAAAA,QAAD;AAAWC,MAAAA;AAAX,KAFV;AAGJC,IAAAA,KAHI;AAIJC,I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,SAAS,CAACsB,MAPO;AAQxBX,EAAAA,MAAM,EAAEX,SAAS,CAACsB,MARM;AASxBV,EAAAA,QAAQ,EAAEZ,SAAS,CAACuB,MATI;AAUxBR,EAAAA,EAAE,EAAEf,SAAS,CAACsB;AAVU,CAA1B;AAaA,eAAelB,aAAf","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport CardImagePreview from '../../atom/card-image-preview';\nimport ContentBadge from '../../atom/content-badge';\nimport style from './style.css';\n\nconst CourseSection = props => {\n const {\n image,\n contentBadge: {category, label},\n title,\n author,\n position,\n 'aria-label': {title: ariaLabelTitle, author: ariaLabelAuthor},\n id\n } = props;\n return (\n <div className={style.container} aria-label={ariaLabelTitle} data-name={`course-section-${id}`}>\n <span className={style.position}>{position}</span>\n <div className={style.containerImage}>\n <CardImagePreview image={image} />\n </div>\n <div className={style.containerInfos}>\n <div className={style.containerMainInfos}>\n <ContentBadge className={style.contentBadge} category={category} label={label} />\n <div className={style.title}>{title}</div>\n </div>\n <span className={style.author} aria-label={ariaLabelAuthor}>\n {author}\n </span>\n </div>\n </div>\n );\n};\n\nCourseSection.propTypes = {\n 'aria-label': PropTypes.shape({\n title: PropTypes.string,\n author: PropTypes.string\n }),\n image: PropTypes.string,\n contentBadge: PropTypes.shape(ContentBadge.propTypes),\n title: PropTypes.string,\n author: PropTypes.string,\n position: PropTypes.number,\n id: PropTypes.string\n};\n\nexport default CourseSection;\n"],"file":"index.js"}
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
justify-content: start;
|
|
14
14
|
margin-top: 8px;
|
|
15
15
|
padding: 8px 16px;
|
|
16
|
+
border-radius: 7px;
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
.containerInfos {
|
|
@@ -50,7 +51,7 @@
|
|
|
50
51
|
font-family: Gilroy;
|
|
51
52
|
font-weight: 600;
|
|
52
53
|
line-height: 20px;
|
|
53
|
-
margin: 0 12px 0
|
|
54
|
+
margin: 0 12px 0 32px;
|
|
54
55
|
}
|
|
55
56
|
|
|
56
57
|
.contentBadge {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/molecule/course-section/test/fixtures/chapter.js"],"names":["props","title","author","image","contentBadge","label","category","position"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACL,kBAAc;AACZC,MAAAA,KAAK,EAAE,kBADK;AAEZC,MAAAA,MAAM,EAAE;AAFI,KADT;AAKLD,IAAAA,KAAK,EAAE,iBALF;AAMLC,IAAAA,MAAM,EAAE,QANH;AAOLC,IAAAA,KAAK,EACH,4LARG;AASLC,IAAAA,YAAY,EAAE;AACZC,MAAAA,KAAK,EAAE,SADK;AAEZC,MAAAA,QAAQ,EAAE;AAFE,KATT;AAaLC,IAAAA,QAAQ,EAAE;
|
|
1
|
+
{"version":3,"sources":["../../../../../src/molecule/course-section/test/fixtures/chapter.js"],"names":["props","title","author","image","contentBadge","label","category","position","id"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACL,kBAAc;AACZC,MAAAA,KAAK,EAAE,kBADK;AAEZC,MAAAA,MAAM,EAAE;AAFI,KADT;AAKLD,IAAAA,KAAK,EAAE,iBALF;AAMLC,IAAAA,MAAM,EAAE,QANH;AAOLC,IAAAA,KAAK,EACH,4LARG;AASLC,IAAAA,YAAY,EAAE;AACZC,MAAAA,KAAK,EAAE,SADK;AAEZC,MAAAA,QAAQ,EAAE;AAFE,KATT;AAaLC,IAAAA,QAAQ,EAAE,CAbL;AAcLC,IAAAA,EAAE,EAAE;AAdC;AADM,CAAf","sourcesContent":["export default {\n props: {\n 'aria-label': {\n title: 'aria label title',\n author: 'aria label author'\n },\n title: 'Social networks',\n author: 'Author',\n image:\n 'https://api.coorpacademy.com/api-service/medias?url=https://static.coorpacademy.com/content/partner-wedemain/fr/medias/img/cover/shutterstock_248741149-1470302136299.jpg&h=500&w=500&q=90',\n contentBadge: {\n label: 'chapter',\n category: 'chapter'\n },\n position: 2,\n id: 'chap_1'\n }\n};\n"],"file":"chapter.js"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/molecule/course-section/test/fixtures/course.js"],"names":["props","title","author","image","contentBadge","label","category","position"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACL,kBAAc;AACZC,MAAAA,KAAK,EAAE,kBADK;AAEZC,MAAAA,MAAM,EAAE;AAFI,KADT;AAKLD,IAAAA,KAAK,EACH,qIANG;AAOLC,IAAAA,MAAM,EAAE,QAPH;AAQLC,IAAAA,KAAK,EACH,4LATG;AAULC,IAAAA,YAAY,EAAE;AACZC,MAAAA,KAAK,EAAE,QADK;AAEZC,MAAAA,QAAQ,EAAE;AAFE,KAVT;AAcLC,IAAAA,QAAQ,EAAE;
|
|
1
|
+
{"version":3,"sources":["../../../../../src/molecule/course-section/test/fixtures/course.js"],"names":["props","title","author","image","contentBadge","label","category","position","id"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACL,kBAAc;AACZC,MAAAA,KAAK,EAAE,kBADK;AAEZC,MAAAA,MAAM,EAAE;AAFI,KADT;AAKLD,IAAAA,KAAK,EACH,qIANG;AAOLC,IAAAA,MAAM,EAAE,QAPH;AAQLC,IAAAA,KAAK,EACH,4LATG;AAULC,IAAAA,YAAY,EAAE;AACZC,MAAAA,KAAK,EAAE,QADK;AAEZC,MAAAA,QAAQ,EAAE;AAFE,KAVT;AAcLC,IAAAA,QAAQ,EAAE,CAdL;AAeLC,IAAAA,EAAE,EAAE;AAfC;AADM,CAAf","sourcesContent":["export default {\n props: {\n 'aria-label': {\n title: 'aria label title',\n author: 'aria label author'\n },\n title:\n 'Marketing and online advertising Marketing and online advertising Marketing and online advertising Marketing and online advertising',\n author: 'Author',\n image:\n 'https://api.coorpacademy.com/api-service/medias?url=https://static.coorpacademy.com/content/partner-wedemain/fr/medias/img/cover/shutterstock_248741149-1470302136299.jpg&h=500&w=500&q=90',\n contentBadge: {\n label: 'course',\n category: 'course'\n },\n position: 1,\n id: 'disc_1'\n }\n};\n"],"file":"course.js"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import CourseSection from '../course-section';
|
|
4
|
+
import DraggableList from '../draggable-list';
|
|
5
|
+
import Loader from '../../atom/loader';
|
|
6
|
+
import Title from '../../atom/title';
|
|
7
|
+
import style from './style.css';
|
|
8
|
+
|
|
9
|
+
const Loading = () => /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Loader, {
|
|
10
|
+
theme: "coorpmanager"
|
|
11
|
+
}));
|
|
12
|
+
|
|
13
|
+
const CourseSections = ({
|
|
14
|
+
sections,
|
|
15
|
+
onDrop,
|
|
16
|
+
isLoading,
|
|
17
|
+
title
|
|
18
|
+
}) => {
|
|
19
|
+
if (isLoading) return /*#__PURE__*/React.createElement(Loading, null);
|
|
20
|
+
return /*#__PURE__*/React.createElement("div", null, title ? /*#__PURE__*/React.createElement("div", {
|
|
21
|
+
className: style.title
|
|
22
|
+
}, /*#__PURE__*/React.createElement(Title, {
|
|
23
|
+
title: title,
|
|
24
|
+
type: 'form-group',
|
|
25
|
+
"data-name": 'course-sections-title'
|
|
26
|
+
})) : null, /*#__PURE__*/React.createElement(DraggableList, {
|
|
27
|
+
itemType: "course-section",
|
|
28
|
+
items: sections,
|
|
29
|
+
onDrop: onDrop
|
|
30
|
+
}));
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
CourseSections.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
34
|
+
title: PropTypes.string,
|
|
35
|
+
sections: PropTypes.arrayOf(PropTypes.shape(CourseSection.propTypes)),
|
|
36
|
+
onDrop: PropTypes.func,
|
|
37
|
+
isLoading: PropTypes.bool
|
|
38
|
+
} : {};
|
|
39
|
+
export default CourseSections;
|
|
40
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/molecule/course-sections/index.js"],"names":["React","PropTypes","CourseSection","DraggableList","Loader","Title","style","Loading","CourseSections","sections","onDrop","isLoading","title","propTypes","string","arrayOf","shape","func","bool"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,aAAP,MAA0B,mBAA1B;AACA,OAAOC,aAAP,MAA0B,mBAA1B;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,KAAP,MAAkB,kBAAlB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,OAAO,GAAG,mBACd,8CACE,oBAAC,MAAD;AAAQ,EAAA,KAAK,EAAC;AAAd,EADF,CADF;;AAMA,MAAMC,cAAc,GAAG,CAAC;AAACC,EAAAA,QAAD;AAAWC,EAAAA,MAAX;AAAmBC,EAAAA,SAAnB;AAA8BC,EAAAA;AAA9B,CAAD,KAA0C;AAC/D,MAAID,SAAJ,EAAe,oBAAO,oBAAC,OAAD,OAAP;AAEf,sBACE,iCACGC,KAAK,gBACJ;AAAK,IAAA,SAAS,EAAEN,KAAK,CAACM;AAAtB,kBACE,oBAAC,KAAD;AAAO,IAAA,KAAK,EAAEA,KAAd;AAAqB,IAAA,IAAI,EAAE,YAA3B;AAAyC,iBAAW;AAApD,IADF,CADI,GAIF,IALN,eAME,oBAAC,aAAD;AAAe,IAAA,QAAQ,EAAC,gBAAxB;AAAyC,IAAA,KAAK,EAAEH,QAAhD;AAA0D,IAAA,MAAM,EAAEC;AAAlE,IANF,CADF;AAUD,CAbD;;AAeAF,cAAc,CAACK,SAAf,2CAA2B;AACzBD,EAAAA,KAAK,EAAEX,SAAS,CAACa,MADQ;AAEzBL,EAAAA,QAAQ,EAAER,SAAS,CAACc,OAAV,CAAkBd,SAAS,CAACe,KAAV,CAAgBd,aAAa,CAACW,SAA9B,CAAlB,CAFe;AAGzBH,EAAAA,MAAM,EAAET,SAAS,CAACgB,IAHO;AAIzBN,EAAAA,SAAS,EAAEV,SAAS,CAACiB;AAJI,CAA3B;AAOA,eAAeV,cAAf","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport CourseSection from '../course-section';\nimport DraggableList from '../draggable-list';\nimport Loader from '../../atom/loader';\nimport Title from '../../atom/title';\nimport style from './style.css';\n\nconst Loading = () => (\n <div>\n <Loader theme=\"coorpmanager\" />\n </div>\n);\n\nconst CourseSections = ({sections, onDrop, isLoading, title}) => {\n if (isLoading) return <Loading />;\n\n return (\n <div>\n {title ? (\n <div className={style.title}>\n <Title title={title} type={'form-group'} data-name={'course-sections-title'} />\n </div>\n ) : null}\n <DraggableList itemType=\"course-section\" items={sections} onDrop={onDrop} />\n </div>\n );\n};\n\nCourseSections.propTypes = {\n title: PropTypes.string,\n sections: PropTypes.arrayOf(PropTypes.shape(CourseSection.propTypes)),\n onDrop: PropTypes.func,\n isLoading: PropTypes.bool\n};\n\nexport default CourseSections;\n"],"file":"index.js"}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
props: {
|
|
3
|
+
sections: [{
|
|
4
|
+
'aria-label': {
|
|
5
|
+
title: 'aria label title',
|
|
6
|
+
author: 'aria label author'
|
|
7
|
+
},
|
|
8
|
+
title: 'Marketing and online advertising Marketing and online advertising Marketing and online advertising Marketing and online advertising',
|
|
9
|
+
author: 'Author',
|
|
10
|
+
image: 'https://api.coorpacademy.com/api-service/medias?url=https://static.coorpacademy.com/content/partner-wedemain/fr/medias/img/cover/shutterstock_248741149-1470302136299.jpg&h=500&w=500&q=90',
|
|
11
|
+
contentBadge: {
|
|
12
|
+
label: 'course',
|
|
13
|
+
category: 'course'
|
|
14
|
+
},
|
|
15
|
+
position: 1,
|
|
16
|
+
id: 'disc_1'
|
|
17
|
+
}, {
|
|
18
|
+
'aria-label': {
|
|
19
|
+
title: 'aria label title',
|
|
20
|
+
author: 'aria label author'
|
|
21
|
+
},
|
|
22
|
+
title: 'Social networks',
|
|
23
|
+
author: 'Author',
|
|
24
|
+
image: 'https://api.coorpacademy.com/api-service/medias?url=https://static.coorpacademy.com/content/partner-wedemain/fr/medias/img/cover/shutterstock_248741149-1470302136299.jpg&h=500&w=500&q=90',
|
|
25
|
+
contentBadge: {
|
|
26
|
+
label: "5' learning",
|
|
27
|
+
category: 'chapter'
|
|
28
|
+
},
|
|
29
|
+
position: 2,
|
|
30
|
+
id: 'chap_1'
|
|
31
|
+
}, {
|
|
32
|
+
'aria-label': {
|
|
33
|
+
title: 'aria label title',
|
|
34
|
+
author: 'aria label author'
|
|
35
|
+
},
|
|
36
|
+
title: 'Other title',
|
|
37
|
+
author: 'Author 2',
|
|
38
|
+
image: 'https://api.coorpacademy.com/api-service/medias?url=https://static.coorpacademy.com/content/partner-wedemain/fr/medias/img/cover/shutterstock_248741149-1470302136299.jpg&h=500&w=500&q=90',
|
|
39
|
+
contentBadge: {
|
|
40
|
+
label: 'course',
|
|
41
|
+
category: 'course'
|
|
42
|
+
},
|
|
43
|
+
position: 3,
|
|
44
|
+
id: 'disc_2'
|
|
45
|
+
}, {
|
|
46
|
+
'aria-label': {
|
|
47
|
+
title: 'aria label title',
|
|
48
|
+
author: 'aria label author'
|
|
49
|
+
},
|
|
50
|
+
title: 'Social others',
|
|
51
|
+
author: 'Author XXX',
|
|
52
|
+
image: 'https://api.coorpacademy.com/api-service/medias?url=https://static.coorpacademy.com/content/partner-wedemain/fr/medias/img/cover/shutterstock_248741149-1470302136299.jpg&h=500&w=500&q=90',
|
|
53
|
+
contentBadge: {
|
|
54
|
+
label: "5' learning",
|
|
55
|
+
category: 'chapter'
|
|
56
|
+
},
|
|
57
|
+
position: 4,
|
|
58
|
+
id: 'chap_2'
|
|
59
|
+
}, {
|
|
60
|
+
'aria-label': {
|
|
61
|
+
title: 'aria label title',
|
|
62
|
+
author: 'aria label author'
|
|
63
|
+
},
|
|
64
|
+
title: 'Social others others',
|
|
65
|
+
author: 'Author XXX',
|
|
66
|
+
image: 'https://api.coorpacademy.com/api-service/medias?url=https://static.coorpacademy.com/content/partner-wedemain/fr/medias/img/cover/shutterstock_248741149-1470302136299.jpg&h=500&w=500&q=90',
|
|
67
|
+
contentBadge: {
|
|
68
|
+
label: "5' learning",
|
|
69
|
+
category: 'chapter'
|
|
70
|
+
},
|
|
71
|
+
position: 5,
|
|
72
|
+
id: 'chap_3'
|
|
73
|
+
}, {
|
|
74
|
+
'aria-label': {
|
|
75
|
+
title: 'aria label title',
|
|
76
|
+
author: 'aria label author'
|
|
77
|
+
},
|
|
78
|
+
title: 'Something about empowerment',
|
|
79
|
+
author: 'Author XXX',
|
|
80
|
+
image: 'https://api.coorpacademy.com/api-service/medias?url=https://static.coorpacademy.com/content/partner-wedemain/fr/medias/img/cover/shutterstock_248741149-1470302136299.jpg&h=500&w=500&q=90',
|
|
81
|
+
contentBadge: {
|
|
82
|
+
label: 'course',
|
|
83
|
+
category: 'course'
|
|
84
|
+
},
|
|
85
|
+
position: 6,
|
|
86
|
+
id: 'disc_3'
|
|
87
|
+
}, {
|
|
88
|
+
'aria-label': {
|
|
89
|
+
title: 'aria label title',
|
|
90
|
+
author: 'aria label author'
|
|
91
|
+
},
|
|
92
|
+
title: 'Be a better human being',
|
|
93
|
+
author: 'Author XXX',
|
|
94
|
+
image: 'https://api.coorpacademy.com/api-service/medias?url=https://static.coorpacademy.com/content/partner-wedemain/fr/medias/img/cover/shutterstock_248741149-1470302136299.jpg&h=500&w=500&q=90',
|
|
95
|
+
contentBadge: {
|
|
96
|
+
label: "5' learning",
|
|
97
|
+
category: 'chapter'
|
|
98
|
+
},
|
|
99
|
+
position: 7,
|
|
100
|
+
id: 'chap_4'
|
|
101
|
+
}, {
|
|
102
|
+
'aria-label': {
|
|
103
|
+
title: 'aria label title',
|
|
104
|
+
author: 'aria label author'
|
|
105
|
+
},
|
|
106
|
+
title: 'Stronger faster better',
|
|
107
|
+
author: 'Author XXX',
|
|
108
|
+
image: 'https://api.coorpacademy.com/api-service/medias?url=https://static.coorpacademy.com/content/partner-wedemain/fr/medias/img/cover/shutterstock_248741149-1470302136299.jpg&h=500&w=500&q=90',
|
|
109
|
+
contentBadge: {
|
|
110
|
+
label: 'course',
|
|
111
|
+
category: 'course'
|
|
112
|
+
},
|
|
113
|
+
position: 8,
|
|
114
|
+
id: 'disc_4'
|
|
115
|
+
}, {
|
|
116
|
+
'aria-label': {
|
|
117
|
+
title: 'aria label title',
|
|
118
|
+
author: 'aria label author'
|
|
119
|
+
},
|
|
120
|
+
title: 'Relativity beyond time',
|
|
121
|
+
author: 'Author XXX',
|
|
122
|
+
image: 'https://api.coorpacademy.com/api-service/medias?url=https://static.coorpacademy.com/content/partner-wedemain/fr/medias/img/cover/shutterstock_248741149-1470302136299.jpg&h=500&w=500&q=90',
|
|
123
|
+
contentBadge: {
|
|
124
|
+
label: 'course',
|
|
125
|
+
category: 'course'
|
|
126
|
+
},
|
|
127
|
+
position: 9,
|
|
128
|
+
id: 'disc_5'
|
|
129
|
+
}, {
|
|
130
|
+
'aria-label': {
|
|
131
|
+
title: 'aria label title',
|
|
132
|
+
author: 'aria label author'
|
|
133
|
+
},
|
|
134
|
+
title: 'Are you awake?',
|
|
135
|
+
author: 'Author XXX',
|
|
136
|
+
image: 'https://api.coorpacademy.com/api-service/medias?url=https://static.coorpacademy.com/content/partner-wedemain/fr/medias/img/cover/shutterstock_248741149-1470302136299.jpg&h=500&w=500&q=90',
|
|
137
|
+
contentBadge: {
|
|
138
|
+
label: "5' learning",
|
|
139
|
+
category: 'chapter'
|
|
140
|
+
},
|
|
141
|
+
position: 10,
|
|
142
|
+
id: 'chap_5'
|
|
143
|
+
}],
|
|
144
|
+
isLoading: false,
|
|
145
|
+
onDrop: () => console.log('on drop'),
|
|
146
|
+
title: 'Organize courses'
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
//# sourceMappingURL=default.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/molecule/course-sections/test/fixtures/default.js"],"names":["props","sections","title","author","image","contentBadge","label","category","position","id","isLoading","onDrop","console","log"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,QAAQ,EAAE,CACR;AACE,oBAAc;AACZC,QAAAA,KAAK,EAAE,kBADK;AAEZC,QAAAA,MAAM,EAAE;AAFI,OADhB;AAKED,MAAAA,KAAK,EACH,qIANJ;AAOEC,MAAAA,MAAM,EAAE,QAPV;AAQEC,MAAAA,KAAK,EACH,4LATJ;AAUEC,MAAAA,YAAY,EAAE;AACZC,QAAAA,KAAK,EAAE,QADK;AAEZC,QAAAA,QAAQ,EAAE;AAFE,OAVhB;AAcEC,MAAAA,QAAQ,EAAE,CAdZ;AAeEC,MAAAA,EAAE,EAAE;AAfN,KADQ,EAkBR;AACE,oBAAc;AACZP,QAAAA,KAAK,EAAE,kBADK;AAEZC,QAAAA,MAAM,EAAE;AAFI,OADhB;AAKED,MAAAA,KAAK,EAAE,iBALT;AAMEC,MAAAA,MAAM,EAAE,QANV;AAOEC,MAAAA,KAAK,EACH,4LARJ;AASEC,MAAAA,YAAY,EAAE;AACZC,QAAAA,KAAK,EAAE,aADK;AAEZC,QAAAA,QAAQ,EAAE;AAFE,OAThB;AAaEC,MAAAA,QAAQ,EAAE,CAbZ;AAcEC,MAAAA,EAAE,EAAE;AAdN,KAlBQ,EAkCR;AACE,oBAAc;AACZP,QAAAA,KAAK,EAAE,kBADK;AAEZC,QAAAA,MAAM,EAAE;AAFI,OADhB;AAKED,MAAAA,KAAK,EAAE,aALT;AAMEC,MAAAA,MAAM,EAAE,UANV;AAOEC,MAAAA,KAAK,EACH,4LARJ;AASEC,MAAAA,YAAY,EAAE;AACZC,QAAAA,KAAK,EAAE,QADK;AAEZC,QAAAA,QAAQ,EAAE;AAFE,OAThB;AAaEC,MAAAA,QAAQ,EAAE,CAbZ;AAcEC,MAAAA,EAAE,EAAE;AAdN,KAlCQ,EAkDR;AACE,oBAAc;AACZP,QAAAA,KAAK,EAAE,kBADK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,KApKN;AAqKLC,IAAAA,MAAM,EAAE,MAAMC,OAAO,CAACC,GAAR,CAAY,SAAZ,CArKT;AAsKLX,IAAAA,KAAK,EAAE;AAtKF;AADM,CAAf","sourcesContent":["export default {\n props: {\n sections: [\n {\n 'aria-label': {\n title: 'aria label title',\n author: 'aria label author'\n },\n title:\n 'Marketing and online advertising Marketing and online advertising Marketing and online advertising Marketing and online advertising',\n author: 'Author',\n image:\n 'https://api.coorpacademy.com/api-service/medias?url=https://static.coorpacademy.com/content/partner-wedemain/fr/medias/img/cover/shutterstock_248741149-1470302136299.jpg&h=500&w=500&q=90',\n contentBadge: {\n label: 'course',\n category: 'course'\n },\n position: 1,\n id: 'disc_1'\n },\n {\n 'aria-label': {\n title: 'aria label title',\n author: 'aria label author'\n },\n title: 'Social networks',\n author: 'Author',\n image:\n 'https://api.coorpacademy.com/api-service/medias?url=https://static.coorpacademy.com/content/partner-wedemain/fr/medias/img/cover/shutterstock_248741149-1470302136299.jpg&h=500&w=500&q=90',\n contentBadge: {\n label: \"5' learning\",\n category: 'chapter'\n },\n position: 2,\n id: 'chap_1'\n },\n {\n 'aria-label': {\n title: 'aria label title',\n author: 'aria label author'\n },\n title: 'Other title',\n author: 'Author 2',\n image:\n 'https://api.coorpacademy.com/api-service/medias?url=https://static.coorpacademy.com/content/partner-wedemain/fr/medias/img/cover/shutterstock_248741149-1470302136299.jpg&h=500&w=500&q=90',\n contentBadge: {\n label: 'course',\n category: 'course'\n },\n position: 3,\n id: 'disc_2'\n },\n {\n 'aria-label': {\n title: 'aria label title',\n author: 'aria label author'\n },\n title: 'Social others',\n author: 'Author XXX',\n image:\n 'https://api.coorpacademy.com/api-service/medias?url=https://static.coorpacademy.com/content/partner-wedemain/fr/medias/img/cover/shutterstock_248741149-1470302136299.jpg&h=500&w=500&q=90',\n contentBadge: {\n label: \"5' learning\",\n category: 'chapter'\n },\n position: 4,\n id: 'chap_2'\n },\n {\n 'aria-label': {\n title: 'aria label title',\n author: 'aria label author'\n },\n title: 'Social others others',\n author: 'Author XXX',\n image:\n 'https://api.coorpacademy.com/api-service/medias?url=https://static.coorpacademy.com/content/partner-wedemain/fr/medias/img/cover/shutterstock_248741149-1470302136299.jpg&h=500&w=500&q=90',\n contentBadge: {\n label: \"5' learning\",\n category: 'chapter'\n },\n position: 5,\n id: 'chap_3'\n },\n {\n 'aria-label': {\n title: 'aria label title',\n author: 'aria label author'\n },\n title: 'Something about empowerment',\n author: 'Author XXX',\n image:\n 'https://api.coorpacademy.com/api-service/medias?url=https://static.coorpacademy.com/content/partner-wedemain/fr/medias/img/cover/shutterstock_248741149-1470302136299.jpg&h=500&w=500&q=90',\n contentBadge: {\n label: 'course',\n category: 'course'\n },\n position: 6,\n id: 'disc_3'\n },\n {\n 'aria-label': {\n title: 'aria label title',\n author: 'aria label author'\n },\n title: 'Be a better human being',\n author: 'Author XXX',\n image:\n 'https://api.coorpacademy.com/api-service/medias?url=https://static.coorpacademy.com/content/partner-wedemain/fr/medias/img/cover/shutterstock_248741149-1470302136299.jpg&h=500&w=500&q=90',\n contentBadge: {\n label: \"5' learning\",\n category: 'chapter'\n },\n position: 7,\n id: 'chap_4'\n },\n {\n 'aria-label': {\n title: 'aria label title',\n author: 'aria label author'\n },\n title: 'Stronger faster better',\n author: 'Author XXX',\n image:\n 'https://api.coorpacademy.com/api-service/medias?url=https://static.coorpacademy.com/content/partner-wedemain/fr/medias/img/cover/shutterstock_248741149-1470302136299.jpg&h=500&w=500&q=90',\n contentBadge: {\n label: 'course',\n category: 'course'\n },\n position: 8,\n id: 'disc_4'\n },\n {\n 'aria-label': {\n title: 'aria label title',\n author: 'aria label author'\n },\n title: 'Relativity beyond time',\n author: 'Author XXX',\n image:\n 'https://api.coorpacademy.com/api-service/medias?url=https://static.coorpacademy.com/content/partner-wedemain/fr/medias/img/cover/shutterstock_248741149-1470302136299.jpg&h=500&w=500&q=90',\n contentBadge: {\n label: 'course',\n category: 'course'\n },\n position: 9,\n id: 'disc_5'\n },\n {\n 'aria-label': {\n title: 'aria label title',\n author: 'aria label author'\n },\n title: 'Are you awake?',\n author: 'Author XXX',\n image:\n 'https://api.coorpacademy.com/api-service/medias?url=https://static.coorpacademy.com/content/partner-wedemain/fr/medias/img/cover/shutterstock_248741149-1470302136299.jpg&h=500&w=500&q=90',\n contentBadge: {\n label: \"5' learning\",\n category: 'chapter'\n },\n position: 10,\n id: 'chap_5'\n }\n ],\n isLoading: false,\n onDrop: () => console.log('on drop'),\n title: 'Organize courses'\n }\n};\n"],"file":"default.js"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/molecule/course-sections/test/fixtures/loading.js"],"names":["props","sections","isLoading","onDrop","console","log","title"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,QAAQ,EAAE,EADL;AAELC,IAAAA,SAAS,EAAE,IAFN;AAGLC,IAAAA,MAAM,EAAE,MAAMC,OAAO,CAACC,GAAR,CAAY,SAAZ,CAHT;AAILC,IAAAA,KAAK,EAAE;AAJF;AADM,CAAf","sourcesContent":["export default {\n props: {\n sections: [],\n isLoading: true,\n onDrop: () => console.log('on drop'),\n title: ''\n }\n};\n"],"file":"loading.js"}
|
|
@@ -34,7 +34,7 @@ const Draggable = props => {
|
|
|
34
34
|
onDrop(id);
|
|
35
35
|
}, [id, onDrop]);
|
|
36
36
|
return /*#__PURE__*/React.createElement("div", {
|
|
37
|
-
className: classnames(dragging ? style.dragging : null, style.
|
|
37
|
+
className: classnames(dragging ? style.dragging : null, style.draggable),
|
|
38
38
|
onDragStart: dragStartHandler,
|
|
39
39
|
onDragOver: dragOverHandler,
|
|
40
40
|
onDragLeave: dragLeaveHandler,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/molecule/draggable/index.js"],"names":["React","useCallback","PropTypes","classnames","style","preventDefault","e","stopPropagation","Draggable","props","id","dragging","onDragStart","onDragOver","onDragLeave","onDrop","children","dragStartHandler","dragOverHandler","dragLeaveHandler","dropHandler","
|
|
1
|
+
{"version":3,"sources":["../../../src/molecule/draggable/index.js"],"names":["React","useCallback","PropTypes","classnames","style","preventDefault","e","stopPropagation","Draggable","props","id","dragging","onDragStart","onDragOver","onDragLeave","onDrop","children","dragStartHandler","dragOverHandler","dragLeaveHandler","dropHandler","draggable","propTypes","string","bool","func","element"],"mappings":"AAAA,OAAOA,KAAP,IAAeC,WAAf,QAAiC,OAAjC;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,cAAc,GAAGC,CAAC,IAAIA,CAAC,CAACD,cAAF,EAA5B;;AACA,MAAME,eAAe,GAAGD,CAAC,IAAIA,CAAC,CAACC,eAAF,EAA7B;;AAEA,MAAMC,SAAS,GAAGC,KAAK,IAAI;AACzB,QAAM;AAACC,IAAAA,EAAD;AAAKC,IAAAA,QAAQ,GAAG,KAAhB;AAAuBC,IAAAA,WAAvB;AAAoCC,IAAAA,UAApC;AAAgDC,IAAAA,WAAhD;AAA6DC,IAAAA,MAA7D;AAAqEC,IAAAA;AAArE,MAAiFP,KAAvF;AAEA,QAAMQ,gBAAgB,GAAGhB,WAAW,CAClCK,CAAC,IAAI;AACHC,IAAAA,eAAe,CAACD,CAAD,CAAf;AACAM,IAAAA,WAAW,CAACF,EAAD,CAAX;AACD,GAJiC,EAKlC,CAACA,EAAD,EAAKE,WAAL,CALkC,CAApC;AAOA,QAAMM,eAAe,GAAGjB,WAAW,CACjCK,CAAC,IAAI;AACHD,IAAAA,cAAc,CAACC,CAAD,CAAd;AACAO,IAAAA,UAAU,CAACH,EAAD,CAAV;AACD,GAJgC,EAKjC,CAACA,EAAD,EAAKG,UAAL,CALiC,CAAnC;AAOA,QAAMM,gBAAgB,GAAGlB,WAAW,CAClCK,CAAC,IAAI;AACHD,IAAAA,cAAc,CAACC,CAAD,CAAd;AACAQ,IAAAA,WAAW,CAACJ,EAAD,CAAX;AACD,GAJiC,EAKlC,CAACA,EAAD,EAAKI,WAAL,CALkC,CAApC;AAOA,QAAMM,WAAW,GAAGnB,WAAW,CAC7BK,CAAC,IAAI;AACHD,IAAAA,cAAc,CAACC,CAAD,CAAd;AACAS,IAAAA,MAAM,CAACL,EAAD,CAAN;AACD,GAJ4B,EAK7B,CAACA,EAAD,EAAKK,MAAL,CAL6B,CAA/B;AAQA,sBACE;AACE,IAAA,SAAS,EAAEZ,UAAU,CAACQ,QAAQ,GAAGP,KAAK,CAACO,QAAT,GAAoB,IAA7B,EAAmCP,KAAK,CAACiB,SAAzC,CADvB;AAEE,IAAA,WAAW,EAAEJ,gBAFf;AAGE,IAAA,UAAU,EAAEC,eAHd;AAIE,IAAA,WAAW,EAAEC,gBAJf;AAKE,IAAA,MAAM,EAAEC,WALV;AAME,IAAA,SAAS;AANX,KAQGJ,QARH,CADF;AAYD,CA5CD;;AA6CAR,SAAS,CAACc,SAAV,2CAAsB;AACpBZ,EAAAA,EAAE,EAAER,SAAS,CAACqB,MADM;AAEpBZ,EAAAA,QAAQ,EAAET,SAAS,CAACsB,IAFA;AAGpBZ,EAAAA,WAAW,EAAEV,SAAS,CAACuB,IAHH;AAIpBZ,EAAAA,UAAU,EAAEX,SAAS,CAACuB,IAJF;AAKpBX,EAAAA,WAAW,EAAEZ,SAAS,CAACuB,IALH;AAMpBV,EAAAA,MAAM,EAAEb,SAAS,CAACuB,IANE;AAOpBT,EAAAA,QAAQ,EAAEd,SAAS,CAACwB;AAPA,CAAtB;AAUA,eAAelB,SAAf","sourcesContent":["import React, {useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport style from './style.css';\n\nconst preventDefault = e => e.preventDefault();\nconst stopPropagation = e => e.stopPropagation();\n\nconst Draggable = props => {\n const {id, dragging = false, onDragStart, onDragOver, onDragLeave, onDrop, children} = props;\n\n const dragStartHandler = useCallback(\n e => {\n stopPropagation(e);\n onDragStart(id);\n },\n [id, onDragStart]\n );\n const dragOverHandler = useCallback(\n e => {\n preventDefault(e);\n onDragOver(id);\n },\n [id, onDragOver]\n );\n const dragLeaveHandler = useCallback(\n e => {\n preventDefault(e);\n onDragLeave(id);\n },\n [id, onDragLeave]\n );\n const dropHandler = useCallback(\n e => {\n preventDefault(e);\n onDrop(id);\n },\n [id, onDrop]\n );\n\n return (\n <div\n className={classnames(dragging ? style.dragging : null, style.draggable)}\n onDragStart={dragStartHandler}\n onDragOver={dragOverHandler}\n onDragLeave={dragLeaveHandler}\n onDrop={dropHandler}\n draggable\n >\n {children}\n </div>\n );\n};\nDraggable.propTypes = {\n id: PropTypes.string,\n dragging: PropTypes.bool,\n onDragStart: PropTypes.func,\n onDragOver: PropTypes.func,\n onDragLeave: PropTypes.func,\n onDrop: PropTypes.func,\n children: PropTypes.element\n};\n\nexport default Draggable;\n"],"file":"index.js"}
|
|
@@ -7,11 +7,6 @@
|
|
|
7
7
|
@value cm_grey_100 from colors;
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
.section {
|
|
11
|
-
display: flex;
|
|
12
|
-
justify-content: center;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
10
|
.draggable {
|
|
16
11
|
cursor: grab;
|
|
17
12
|
position: relative;
|
|
@@ -58,6 +53,7 @@
|
|
|
58
53
|
font-family: 'Open Sans';
|
|
59
54
|
font-weight: 600;
|
|
60
55
|
font-size: 14px;
|
|
56
|
+
border-radius: 7px;
|
|
61
57
|
}
|
|
62
58
|
|
|
63
59
|
@media mobile {
|
|
@@ -4,11 +4,13 @@ import React, { useState, useCallback } from 'react';
|
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import Draggable from '../draggable';
|
|
6
6
|
import SetupSection from '../setup-section';
|
|
7
|
+
import CourseSection from '../course-section';
|
|
7
8
|
const ITEMS = {
|
|
8
|
-
'setup-section': SetupSection
|
|
9
|
+
'setup-section': SetupSection,
|
|
10
|
+
'course-section': CourseSection
|
|
9
11
|
};
|
|
10
12
|
|
|
11
|
-
const
|
|
13
|
+
const DraggableList = ({
|
|
12
14
|
items,
|
|
13
15
|
onDrop,
|
|
14
16
|
itemType
|
|
@@ -45,10 +47,10 @@ const SetupSections = ({
|
|
|
45
47
|
return /*#__PURE__*/React.createElement("div", null, itemsView);
|
|
46
48
|
};
|
|
47
49
|
|
|
48
|
-
|
|
50
|
+
DraggableList.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
49
51
|
items: PropTypes.arrayOf(PropTypes.shape(SetupSection.propTypes)),
|
|
50
52
|
onDrop: PropTypes.func,
|
|
51
53
|
itemType: PropTypes.string
|
|
52
54
|
} : {};
|
|
53
|
-
export default
|
|
55
|
+
export default DraggableList;
|
|
54
56
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/molecule/draggable-list/index.js"],"names":["React","useState","useCallback","PropTypes","Draggable","SetupSection","ITEMS","
|
|
1
|
+
{"version":3,"sources":["../../../src/molecule/draggable-list/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"],"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;AAAC,mBAAiBF,YAAlB;AAAgC,oBAAkBC;AAAlD,CAAd;;AAEA,MAAME,aAAa,GAAG,CAAC;AAACC,EAAAA,KAAD;AAAQC,EAAAA,MAAR;AAAgBC,EAAAA;AAAhB,CAAD,KAA+B;AACnD,QAAM,CAACC,MAAD,EAASC,SAAT,IA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AOE,IAAA,MAAM,EAAEC;AAPV,kBASE,oBAAC,IAAD,eAAUI,IAAV;AAAgB,IAAA,GAAG,EAAEA,IAAI,CAACP;AAA1B,KATF,CADgB,CAAlB;AAaA,sBAAO,iCAAMK,SAAN,CAAP;AACD,CAnDD;;AAqDAd,aAAa,CAACiB,SAAd,2CAA0B;AACxBhB,EAAAA,KAAK,EAAEN,SAAS,CAACuB,OAAV,CAAkBvB,SAAS,CAACwB,KAAV,CAAgBtB,YAAY,CAACoB,SAA7B,CAAlB,CADiB;AAExBf,EAAAA,MAAM,EAAEP,SAAS,CAACyB,IAFM;AAGxBjB,EAAAA,QAAQ,EAAER,SAAS,CAAC0B;AAHI,CAA1B;AAMA,eAAerB,aAAf","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"],"file":"index.js"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import courseSections from '../../../course-sections/test/fixtures/default';
|
|
2
|
+
const {
|
|
3
|
+
props: {
|
|
4
|
+
sections
|
|
5
|
+
}
|
|
6
|
+
} = courseSections;
|
|
7
|
+
export default {
|
|
8
|
+
props: {
|
|
9
|
+
itemType: 'course-section',
|
|
10
|
+
items: sections,
|
|
11
|
+
onDrop: (dragged, dropped) => {
|
|
12
|
+
console.log('foo');
|
|
13
|
+
console.log({
|
|
14
|
+
dragged,
|
|
15
|
+
dropped
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=course-sections.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/molecule/draggable-list/test/fixtures/course-sections.js"],"names":["courseSections","props","sections","itemType","items","onDrop","dragged","dropped","console","log"],"mappings":"AAAA,OAAOA,cAAP,MAA2B,gDAA3B;AAEA,MAAM;AACJC,EAAAA,KAAK,EAAE;AAACC,IAAAA;AAAD;AADH,IAEFF,cAFJ;AAIA,eAAe;AACbC,EAAAA,KAAK,EAAE;AACLE,IAAAA,QAAQ,EAAE,gBADL;AAELC,IAAAA,KAAK,EAAEF,QAFF;AAGLG,IAAAA,MAAM,EAAE,CAACC,OAAD,EAAUC,OAAV,KAAsB;AAC5BC,MAAAA,OAAO,CAACC,GAAR,CAAY,KAAZ;AACAD,MAAAA,OAAO,CAACC,GAAR,CAAY;AAACH,QAAAA,OAAD;AAAUC,QAAAA;AAAV,OAAZ;AACD;AANI;AADM,CAAf","sourcesContent":["import courseSections from '../../../course-sections/test/fixtures/default';\n\nconst {\n props: {sections}\n} = courseSections;\n\nexport default {\n props: {\n itemType: 'course-section',\n items: sections,\n onDrop: (dragged, dropped) => {\n console.log('foo');\n console.log({dragged, dropped});\n }\n }\n};\n"],"file":"course-sections.js"}
|