@coorpacademy/components 10.5.1 → 10.5.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/card-image-preview/test/fixtures.js +0 -30
- package/es/atom/card-image-preview/test/fixtures.js.map +1 -1
- package/es/molecule/course-section/test/fixtures.js +15 -0
- package/es/molecule/course-section/test/fixtures.js.map +1 -0
- package/es/molecule/draggable/index.js +56 -0
- package/es/molecule/draggable/index.js.map +1 -0
- package/es/molecule/draggable/style.css +67 -0
- package/es/molecule/draggable/test/fixtures/default.js +12 -0
- package/es/molecule/draggable/test/fixtures/default.js.map +1 -0
- package/es/molecule/draggable/test/fixtures.js +13 -0
- package/es/molecule/draggable/test/fixtures.js.map +1 -0
- package/es/molecule/draggable-list/index.js +54 -0
- package/es/molecule/draggable-list/index.js.map +1 -0
- package/es/molecule/draggable-list/test/fixtures/dashboard-sections.js +26 -0
- package/es/molecule/draggable-list/test/fixtures/dashboard-sections.js.map +1 -0
- package/es/molecule/draggable-list/test/fixtures.js +13 -0
- package/es/molecule/draggable-list/test/fixtures.js.map +1 -0
- package/es/molecule/{setup-sections → draggable-list}/test/on-drop.js +5 -5
- package/es/molecule/draggable-list/test/on-drop.js.map +1 -0
- package/es/molecule/search/test/fixtures.js +15 -0
- package/es/molecule/search/test/fixtures.js.map +1 -0
- package/es/molecule/select-multiple/style.css +8 -5
- package/es/molecule/setup-section/index.js +2 -23
- package/es/molecule/setup-section/index.js.map +1 -1
- package/es/molecule/setup-section/style.css +1 -26
- package/es/molecule/setup-sections/index.js +7 -85
- package/es/molecule/setup-sections/index.js.map +1 -1
- package/es/molecule/setup-sections/style.css +0 -56
- package/es/organism/brand-form/test/fixtures/wizard-playlists.js +1 -1
- package/es/organism/brand-form/test/fixtures/wizard-playlists.js.map +1 -1
- package/es/template/app-player/popin-end/test/fixtures.js +2 -0
- package/es/template/app-player/popin-end/test/fixtures.js.map +1 -1
- package/lib/atom/card-image-preview/test/fixtures.js +0 -45
- package/lib/atom/card-image-preview/test/fixtures.js.map +1 -1
- package/lib/molecule/course-section/test/fixtures.js +25 -0
- package/lib/molecule/course-section/test/fixtures.js.map +1 -0
- package/lib/molecule/draggable/index.js +71 -0
- package/lib/molecule/draggable/index.js.map +1 -0
- package/lib/molecule/draggable/style.css +67 -0
- package/lib/molecule/draggable/test/fixtures/default.js +17 -0
- package/lib/molecule/draggable/test/fixtures/default.js.map +1 -0
- package/lib/molecule/draggable/test/fixtures.js +22 -0
- package/lib/molecule/draggable/test/fixtures.js.map +1 -0
- package/lib/molecule/draggable-list/index.js +70 -0
- package/lib/molecule/draggable-list/index.js.map +1 -0
- package/lib/molecule/draggable-list/test/fixtures/dashboard-sections.js +37 -0
- package/lib/molecule/draggable-list/test/fixtures/dashboard-sections.js.map +1 -0
- package/lib/molecule/draggable-list/test/fixtures.js +22 -0
- package/lib/molecule/draggable-list/test/fixtures.js.map +1 -0
- package/lib/molecule/{setup-sections → draggable-list}/test/on-drop.js +7 -7
- package/lib/molecule/draggable-list/test/on-drop.js.map +1 -0
- package/lib/molecule/search/test/fixtures.js +25 -0
- package/lib/molecule/search/test/fixtures.js.map +1 -0
- package/lib/molecule/select-multiple/style.css +8 -5
- package/lib/molecule/setup-section/index.js +2 -21
- package/lib/molecule/setup-section/index.js.map +1 -1
- package/lib/molecule/setup-section/style.css +1 -26
- package/lib/molecule/setup-sections/index.js +7 -89
- package/lib/molecule/setup-sections/index.js.map +1 -1
- package/lib/molecule/setup-sections/style.css +0 -56
- package/lib/organism/brand-form/test/fixtures/wizard-playlists.js +1 -1
- package/lib/organism/brand-form/test/fixtures/wizard-playlists.js.map +1 -1
- package/lib/template/app-player/popin-end/test/fixtures.js +3 -0
- package/lib/template/app-player/popin-end/test/fixtures.js.map +1 -1
- package/package.json +2 -2
- package/es/molecule/setup-sections/test/on-drop.js.map +0 -1
- package/lib/molecule/setup-sections/test/on-drop.js.map +0 -1
|
@@ -1,62 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import React, { useState, useCallback } from 'react';
|
|
1
|
+
import React from 'react';
|
|
4
2
|
import PropTypes from 'prop-types';
|
|
5
|
-
import
|
|
3
|
+
import DraggableList from '../draggable-list';
|
|
6
4
|
import SetupSection from '../setup-section';
|
|
7
5
|
import Loader from '../../atom/loader';
|
|
8
6
|
import style from './style.css';
|
|
9
7
|
|
|
10
|
-
const preventDefault = e => e.preventDefault();
|
|
11
|
-
|
|
12
|
-
const stopPropagation = e => e.stopPropagation();
|
|
13
|
-
|
|
14
|
-
const Draggable = props => {
|
|
15
|
-
const {
|
|
16
|
-
id,
|
|
17
|
-
dragging = false,
|
|
18
|
-
onDragStart,
|
|
19
|
-
onDragOver,
|
|
20
|
-
onDragLeave,
|
|
21
|
-
onDrop,
|
|
22
|
-
children
|
|
23
|
-
} = props;
|
|
24
|
-
const dragStartHandler = useCallback(e => {
|
|
25
|
-
stopPropagation(e);
|
|
26
|
-
onDragStart(id);
|
|
27
|
-
}, [id, onDragStart]);
|
|
28
|
-
const dragOverHandler = useCallback(e => {
|
|
29
|
-
preventDefault(e);
|
|
30
|
-
onDragOver(id);
|
|
31
|
-
}, [id, onDragOver]);
|
|
32
|
-
const dragLeaveHandler = useCallback(e => {
|
|
33
|
-
preventDefault(e);
|
|
34
|
-
onDragLeave(id);
|
|
35
|
-
}, [id, onDragLeave]);
|
|
36
|
-
const dropHandler = useCallback(e => {
|
|
37
|
-
preventDefault(e);
|
|
38
|
-
onDrop(id);
|
|
39
|
-
}, [id, onDrop]);
|
|
40
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
41
|
-
className: classnames(dragging ? style.dragging : null, style.section, style.draggable),
|
|
42
|
-
onDragStart: dragStartHandler,
|
|
43
|
-
onDragOver: dragOverHandler,
|
|
44
|
-
onDragLeave: dragLeaveHandler,
|
|
45
|
-
onDrop: dropHandler,
|
|
46
|
-
draggable: true
|
|
47
|
-
}, children);
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
Draggable.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
51
|
-
id: PropTypes.string,
|
|
52
|
-
dragging: PropTypes.bool,
|
|
53
|
-
onDragStart: PropTypes.func,
|
|
54
|
-
onDragOver: PropTypes.func,
|
|
55
|
-
onDragLeave: PropTypes.func,
|
|
56
|
-
onDrop: PropTypes.func,
|
|
57
|
-
children: PropTypes.element
|
|
58
|
-
} : {};
|
|
59
|
-
|
|
60
8
|
const Loading = () => /*#__PURE__*/React.createElement("div", {
|
|
61
9
|
className: style.loading
|
|
62
10
|
}, /*#__PURE__*/React.createElement(Loader, null));
|
|
@@ -66,38 +14,12 @@ const SetupSections = ({
|
|
|
66
14
|
loading,
|
|
67
15
|
onDrop
|
|
68
16
|
}) => {
|
|
69
|
-
const [dragTo, setDragTo] = useState(null);
|
|
70
|
-
const [dragFrom, setDragFrom] = useState(null);
|
|
71
|
-
const dragStartHandler = useCallback(id => {
|
|
72
|
-
setDragFrom(id);
|
|
73
|
-
}, [setDragFrom]);
|
|
74
|
-
const dragOverHandler = useCallback(id => {
|
|
75
|
-
if (dragTo === id) return;
|
|
76
|
-
setDragTo(id);
|
|
77
|
-
}, [dragTo, setDragTo]);
|
|
78
|
-
const dragLeaveHandler = useCallback(id => {
|
|
79
|
-
setDragTo(null);
|
|
80
|
-
}, [setDragTo]);
|
|
81
|
-
const dropHandler = useCallback(id => {
|
|
82
|
-
if (onDrop && dragFrom) onDrop(dragFrom, id);
|
|
83
|
-
setDragTo(null);
|
|
84
|
-
setDragFrom(null);
|
|
85
|
-
}, [onDrop, setDragTo, setDragFrom, dragFrom]);
|
|
86
17
|
if (loading) return /*#__PURE__*/React.createElement(Loading, null);
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
onDragOver: dragOverHandler,
|
|
93
|
-
onDragLeave: dragLeaveHandler,
|
|
94
|
-
onDrop: dropHandler
|
|
95
|
-
}, /*#__PURE__*/React.createElement(SetupSection, _extends({}, section, {
|
|
96
|
-
key: section.id,
|
|
97
|
-
onUp: index === 0 ? null : section.onUp,
|
|
98
|
-
onDown: index === sections.length - 1 ? null : section.onDown
|
|
99
|
-
}))));
|
|
100
|
-
return /*#__PURE__*/React.createElement("div", null, sectionsView);
|
|
18
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(DraggableList, {
|
|
19
|
+
itemType: "setup-section",
|
|
20
|
+
items: sections,
|
|
21
|
+
onDrop: onDrop
|
|
22
|
+
}));
|
|
101
23
|
};
|
|
102
24
|
|
|
103
25
|
SetupSections.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/molecule/setup-sections/index.js"],"names":["React","
|
|
1
|
+
{"version":3,"sources":["../../../src/molecule/setup-sections/index.js"],"names":["React","PropTypes","DraggableList","SetupSection","Loader","style","Loading","loading","SetupSections","sections","onDrop","propTypes","arrayOf","shape","bool","func"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,aAAP,MAA0B,mBAA1B;AACA,OAAOC,YAAP,MAAyB,kBAAzB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,OAAO,GAAG,mBACd;AAAK,EAAA,SAAS,EAAED,KAAK,CAACE;AAAtB,gBACE,oBAAC,MAAD,OADF,CADF;;AAMA,MAAMC,aAAa,GAAG,CAAC;AAACC,EAAAA,QAAD;AAAWF,EAAAA,OAAX;AAAoBG,EAAAA;AAApB,CAAD,KAAiC;AACrD,MAAIH,OAAJ,EAAa,oBAAO,oBAAC,OAAD,OAAP;AAEb,sBACE,8CACE,oBAAC,aAAD;AAAe,IAAA,QAAQ,EAAC,eAAxB;AAAwC,IAAA,KAAK,EAAEE,QAA/C;AAAyD,IAAA,MAAM,EAAEC;AAAjE,IADF,CADF;AAKD,CARD;;AAUAF,aAAa,CAACG,SAAd,2CAA0B;AACxBF,EAAAA,QAAQ,EAAER,SAAS,CAACW,OAAV,CAAkBX,SAAS,CAACY,KAAV,CAAgBV,YAAY,CAACQ,SAA7B,CAAlB,CADc;AAExBJ,EAAAA,OAAO,EAAEN,SAAS,CAACa,IAFK;AAGxBJ,EAAAA,MAAM,EAAET,SAAS,CAACc;AAHM,CAA1B;AAMA,eAAeP,aAAf","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport DraggableList from '../draggable-list';\nimport SetupSection from '../setup-section';\nimport Loader from '../../atom/loader';\nimport style from './style.css';\n\nconst Loading = () => (\n <div className={style.loading}>\n <Loader />\n </div>\n);\n\nconst SetupSections = ({sections, loading, onDrop}) => {\n if (loading) return <Loading />;\n\n return (\n <div>\n <DraggableList itemType=\"setup-section\" items={sections} onDrop={onDrop} />\n </div>\n );\n};\n\nSetupSections.propTypes = {\n sections: PropTypes.arrayOf(PropTypes.shape(SetupSection.propTypes)),\n loading: PropTypes.bool,\n onDrop: PropTypes.func\n};\n\nexport default SetupSections;\n"],"file":"index.js"}
|
|
@@ -15,10 +15,6 @@
|
|
|
15
15
|
border-bottom: 0;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
.section:last-child {
|
|
19
|
-
border-bottom: 1px solid medium;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
18
|
.loading {
|
|
23
19
|
composes: section;
|
|
24
20
|
width: 100%;
|
|
@@ -27,55 +23,3 @@
|
|
|
27
23
|
min-height: 60px;
|
|
28
24
|
position: relative;
|
|
29
25
|
}
|
|
30
|
-
.draggable {
|
|
31
|
-
cursor: grab;
|
|
32
|
-
position: relative;
|
|
33
|
-
background: transparent;
|
|
34
|
-
}
|
|
35
|
-
.draggable:hover{
|
|
36
|
-
background: rgba(0, 0, 0, 0.3);
|
|
37
|
-
}
|
|
38
|
-
.draggable:active{
|
|
39
|
-
background: transparent;
|
|
40
|
-
}
|
|
41
|
-
.draggable:before {
|
|
42
|
-
content: '.';
|
|
43
|
-
position: absolute;
|
|
44
|
-
left: 5px;
|
|
45
|
-
font-size: 20px;
|
|
46
|
-
line-height: 7px;
|
|
47
|
-
color: medium;
|
|
48
|
-
pointer-events: none;
|
|
49
|
-
text-shadow: 0 0 medium, 0 5px medium, 0 10px medium, 0 15px medium, 0 20px medium, 0 25px medium, 0 30px medium, 0 35px medium, 0 40px medium, 0 45px medium,
|
|
50
|
-
5px 0 medium, 5px 5px medium, 5px 10px medium, 5px 15px medium, 5px 20px medium, 5px 25px medium, 5px 30px medium, 5px 35px medium, 5px 40px medium, 5px 45px medium,
|
|
51
|
-
10px 0 medium, 10px 5px medium, 10px 10px medium, 10px 15px medium, 10px 20px medium, 10px 25px medium, 10px 30px medium, 10px 35px medium, 10px 40px medium, 10px 45px medium;
|
|
52
|
-
}
|
|
53
|
-
.dragging {
|
|
54
|
-
background: rgba(0, 0, 0, 0.1);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.dragging:after {
|
|
58
|
-
position: absolute;
|
|
59
|
-
content: "drop here";
|
|
60
|
-
left: 5px;
|
|
61
|
-
top: 5px;
|
|
62
|
-
bottom: 5px;
|
|
63
|
-
right: 5px;
|
|
64
|
-
background: color(black lightness(95%));
|
|
65
|
-
pointer-events: none;
|
|
66
|
-
border: 1px dashed medium;
|
|
67
|
-
box-sizing: border-box;
|
|
68
|
-
display: flex;
|
|
69
|
-
justify-content: center;
|
|
70
|
-
align-items: center;
|
|
71
|
-
color: dark;
|
|
72
|
-
font-family: 'Gilroy';
|
|
73
|
-
font-weight: 600;
|
|
74
|
-
font-size: 14px;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
@media mobile {
|
|
78
|
-
.draggable:before {
|
|
79
|
-
content: none;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
type: 'selectMultiple',
|
|
6
6
|
title: 'Languages',
|
|
7
7
|
placeholder: 'Language selection',
|
|
8
|
-
description: '
|
|
8
|
+
description: 'The name and description of your custom playlist will be displayed in the selected language. Only the selected language will be saved. You can translate during step 2 "Translations".',
|
|
9
9
|
theme: 'coorpmanager',
|
|
10
10
|
hint: '15 / 30 characters',
|
|
11
11
|
size: 'default',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/organism/brand-form/test/fixtures/wizard-playlists.js"],"names":["props","groups","fields","type","title","placeholder","description","theme","hint","size","options","name","value","selected","multiple"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,MAAM,EAAE,CACN;AACEC,MAAAA,MAAM,EAAE,CACN;AACEC,QAAAA,IAAI,EAAE,gBADR;AAEEC,QAAAA,KAAK,EAAE,WAFT;AAGEC,QAAAA,WAAW,EAAE,oBAHf;AAIEC,QAAAA,WAAW,
|
|
1
|
+
{"version":3,"sources":["../../../../../src/organism/brand-form/test/fixtures/wizard-playlists.js"],"names":["props","groups","fields","type","title","placeholder","description","theme","hint","size","options","name","value","selected","multiple"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,MAAM,EAAE,CACN;AACEC,MAAAA,MAAM,EAAE,CACN;AACEC,QAAAA,IAAI,EAAE,gBADR;AAEEC,QAAAA,KAAK,EAAE,WAFT;AAGEC,QAAAA,WAAW,EAAE,oBAHf;AAIEC,QAAAA,WAAW,EACT,wLALJ;AAMEC,QAAAA,KAAK,EAAE,cANT;AAOEC,QAAAA,IAAI,EAAE,oBAPR;AAQEC,QAAAA,IAAI,EAAE,SARR;AASEC,QAAAA,OAAO,EAAE,CACP;AACEC,UAAAA,IAAI,EAAE,cADR;AAEEC,UAAAA,KAAK,EAAE,IAFT;AAGEC,UAAAA,QAAQ,EAAE;AAHZ,SADO,EAMP;AACEF,UAAAA,IAAI,EAAE,aADR;AAEEC,UAAAA,KAAK,EAAE,IAFT;AAGEC,UAAAA,QAAQ,EAAE;AAHZ,SANO,EAWP;AACEF,UAAAA,IAAI,EAAE,WADR;AAEEC,UAAAA,KAAK,EAAE,IAFT;AAGEC,UAAAA,QAAQ,EAAE;AAHZ,SAXO,EAgBP;AACEF,UAAAA,IAAI,EAAE,cADR;AAEEC,UAAAA,KAAK,EAAE,IAFT;AAGEC,UAAAA,QAAQ,EAAE;AAHZ,SAhBO,CATX;AA+BEC,QAAAA,QAAQ,EAAE;AA/BZ,OADM,EAkCN;AACEX,QAAAA,IAAI,EAAE,MADR;AAEEC,QAAAA,KAAK,EAAE,eAFT;AAGEC,QAAAA,WAAW,EAAE,eAHf;AAIEC,QAAAA,WAAW,EAAE,0BAJf;AAKEC,QAAAA,KAAK,EAAE,cALT;AAMEC,QAAAA,IAAI,EAAE,oBANR;AAOEI,QAAAA,KAAK,EAAE,kBAPT;AAQEH,QAAAA,IAAI,EAAE;AARR,OAlCM,EA4CN;AACEN,QAAAA,IAAI,EAAE,UADR;AAEEC,QAAAA,KAAK,EAAE,aAFT;AAGEC,QAAAA,WAAW,EAAE,aAHf;AAIEC,QAAAA,WAAW,EAAE,0BAJf;AAKEC,QAAAA,KAAK,EAAE,cALT;AAMEC,QAAAA,IAAI,EAAE,qBANR;AAOEC,QAAAA,IAAI,EAAE,QAPR;AAQEG,QAAAA,KAAK,EACH;AATJ,OA5CM;AADV,KADM;AADH;AADM,CAAf","sourcesContent":["export default {\n props: {\n groups: [\n {\n fields: [\n {\n type: 'selectMultiple',\n title: 'Languages',\n placeholder: 'Language selection',\n description:\n 'The name and description of your custom playlist will be displayed in the selected language. Only the selected language will be saved. You can translate during step 2 \"Translations\".',\n theme: 'coorpmanager',\n hint: '15 / 30 characters',\n size: 'default',\n options: [\n {\n name: '🇬🇧 English',\n value: 'en',\n selected: true\n },\n {\n name: '🇩🇪 German',\n value: 'de',\n selected: false\n },\n {\n name: '🇹🇭 Thai',\n value: 'th',\n selected: false\n },\n {\n name: '🇪🇸 Spanish',\n value: 'es',\n selected: false\n }\n ],\n multiple: false\n },\n {\n type: 'text',\n title: 'Playlist name',\n placeholder: 'Playlist name',\n description: 'This is the tooltip text',\n theme: 'coorpmanager',\n hint: '15 / 30 characters',\n value: 'Marketing expert',\n size: 'default'\n },\n {\n type: 'textarea',\n title: 'Description',\n placeholder: 'Description',\n description: 'This is the tooltip text',\n theme: 'coorpmanager',\n hint: '80 / 200 characters',\n size: 'medium',\n value:\n 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis fermentum sem ac fermentum luctus. Integer eu dui magna. Donec ut tristique dui. Vestibulum non accumsan tellus. Donec luctus erat vitae aliquet viverra. Mauris malesuada tortor quis viverra vestibulum. Nullam laoreet porta massa vitae porta.'\n }\n ]\n }\n ]\n }\n};\n"],"file":"wizard-playlists.js"}
|
|
@@ -21,6 +21,7 @@ import fixtureSimpleAction from './fixtures/simple-action';
|
|
|
21
21
|
import fixtureSubscribe from './fixtures/subscribe';
|
|
22
22
|
import fixtureWithLoadingRecommendations from './fixtures/with-loading-recommendations';
|
|
23
23
|
import fixtureWithRecommendations from './fixtures/with-recommendations';
|
|
24
|
+
import fixtureWithoutRecommendation from './fixtures/without-recommendation';
|
|
24
25
|
test('TemplateAppPlayer › TemplateAppPlayerPopinEnd > should have valid propTypes', t => {
|
|
25
26
|
t.pass();
|
|
26
27
|
forEach(TemplateAppPlayerPopinEnd.propTypes, (value, key) => {
|
|
@@ -46,4 +47,5 @@ test('TemplateAppPlayer › TemplateAppPlayerPopinEnd › SimpleAction › shoul
|
|
|
46
47
|
test('TemplateAppPlayer › TemplateAppPlayerPopinEnd › Subscribe › should be rendered', renderComponentMacro, TemplateAppPlayerPopinEnd, fixtureSubscribe);
|
|
47
48
|
test('TemplateAppPlayer › TemplateAppPlayerPopinEnd › WithLoadingRecommendations › should be rendered', renderComponentMacro, TemplateAppPlayerPopinEnd, fixtureWithLoadingRecommendations);
|
|
48
49
|
test('TemplateAppPlayer › TemplateAppPlayerPopinEnd › WithRecommendations › should be rendered', renderComponentMacro, TemplateAppPlayerPopinEnd, fixtureWithRecommendations);
|
|
50
|
+
test('TemplateAppPlayer › TemplateAppPlayerPopinEnd › WithoutRecommendation › should be rendered', renderComponentMacro, TemplateAppPlayerPopinEnd, fixtureWithoutRecommendation);
|
|
49
51
|
//# sourceMappingURL=fixtures.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/template/app-player/popin-end/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","TemplateAppPlayerPopinEnd","fixtureAdaptive","fixtureArabicCorrect","fixtureArabicNextLevelAdaptiveImg","fixtureArabicWithRecommendations","fixtureCommentIsLoading","fixtureCommentSent","fixtureComment","fixtureCorrect","fixtureDefault","fixtureFail","fixtureInfiniteLives","fixtureLoading","fixtureNegativeRank","fixtureNextCourse","fixtureNextLevelAdaptiveImg","fixtureSimpleAction","fixtureSubscribe","fixtureWithLoadingRecommendations","fixtureWithRecommendations","t","pass","propTypes","value","key","not","undefined"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,KAAjB;AACA,OAAOC,OAAP,MAAoB,gBAApB;AACA,OAAOC,oBAAP,MAAiC,2CAAjC;AACA,OAAOC,yBAAP,MAAsC,IAAtC;AACA,OAAOC,eAAP,MAA4B,qBAA5B;AACA,OAAOC,oBAAP,MAAiC,2BAAjC;AACA,OAAOC,iCAAP,MAA8C,2CAA9C;AACA,OAAOC,gCAAP,MAA6C,wCAA7C;AACA,OAAOC,uBAAP,MAAoC,+BAApC;AACA,OAAOC,kBAAP,MAA+B,yBAA/B;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,WAAP,MAAwB,iBAAxB;AACA,OAAOC,oBAAP,MAAiC,2BAAjC;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,mBAAP,MAAgC,0BAAhC;AACA,OAAOC,iBAAP,MAA8B,wBAA9B;AACA,OAAOC,2BAAP,MAAwC,oCAAxC;AACA,OAAOC,mBAAP,MAAgC,0BAAhC;AACA,OAAOC,gBAAP,MAA6B,sBAA7B;AACA,OAAOC,iCAAP,MAA8C,yCAA9C;AACA,OAAOC,0BAAP,MAAuC,iCAAvC;
|
|
1
|
+
{"version":3,"sources":["../../../../../src/template/app-player/popin-end/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","TemplateAppPlayerPopinEnd","fixtureAdaptive","fixtureArabicCorrect","fixtureArabicNextLevelAdaptiveImg","fixtureArabicWithRecommendations","fixtureCommentIsLoading","fixtureCommentSent","fixtureComment","fixtureCorrect","fixtureDefault","fixtureFail","fixtureInfiniteLives","fixtureLoading","fixtureNegativeRank","fixtureNextCourse","fixtureNextLevelAdaptiveImg","fixtureSimpleAction","fixtureSubscribe","fixtureWithLoadingRecommendations","fixtureWithRecommendations","fixtureWithoutRecommendation","t","pass","propTypes","value","key","not","undefined"],"mappings":"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","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../../test/helpers/render-component';\nimport TemplateAppPlayerPopinEnd from '..';\nimport fixtureAdaptive from './fixtures/adaptive';\nimport fixtureArabicCorrect from './fixtures/arabic-correct';\nimport fixtureArabicNextLevelAdaptiveImg from './fixtures/arabic-next-level-adaptive-img';\nimport fixtureArabicWithRecommendations from './fixtures/arabic-with-recommendations';\nimport fixtureCommentIsLoading from './fixtures/comment-is-loading';\nimport fixtureCommentSent from './fixtures/comment-sent';\nimport fixtureComment from './fixtures/comment';\nimport fixtureCorrect from './fixtures/correct';\nimport fixtureDefault from './fixtures/default';\nimport fixtureFail from './fixtures/fail';\nimport fixtureInfiniteLives from './fixtures/infinite-lives';\nimport fixtureLoading from './fixtures/loading';\nimport fixtureNegativeRank from './fixtures/negative-rank';\nimport fixtureNextCourse from './fixtures/next-course';\nimport fixtureNextLevelAdaptiveImg from './fixtures/next-level-adaptive-img';\nimport fixtureSimpleAction from './fixtures/simple-action';\nimport fixtureSubscribe from './fixtures/subscribe';\nimport fixtureWithLoadingRecommendations from './fixtures/with-loading-recommendations';\nimport fixtureWithRecommendations from './fixtures/with-recommendations';\nimport fixtureWithoutRecommendation from './fixtures/without-recommendation';\n\ntest('TemplateAppPlayer › TemplateAppPlayerPopinEnd > should have valid propTypes', t => {\n t.pass();\n forEach(TemplateAppPlayerPopinEnd.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"TemplateAppPlayer.TemplateAppPlayerPopinEnd.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('TemplateAppPlayer › TemplateAppPlayerPopinEnd › Adaptive › should be rendered', renderComponentMacro, TemplateAppPlayerPopinEnd, fixtureAdaptive);\ntest('TemplateAppPlayer › TemplateAppPlayerPopinEnd › ArabicCorrect › should be rendered', renderComponentMacro, TemplateAppPlayerPopinEnd, fixtureArabicCorrect);\ntest('TemplateAppPlayer › TemplateAppPlayerPopinEnd › ArabicNextLevelAdaptiveImg › should be rendered', renderComponentMacro, TemplateAppPlayerPopinEnd, fixtureArabicNextLevelAdaptiveImg);\ntest('TemplateAppPlayer › TemplateAppPlayerPopinEnd › ArabicWithRecommendations › should be rendered', renderComponentMacro, TemplateAppPlayerPopinEnd, fixtureArabicWithRecommendations);\ntest('TemplateAppPlayer › TemplateAppPlayerPopinEnd › CommentIsLoading › should be rendered', renderComponentMacro, TemplateAppPlayerPopinEnd, fixtureCommentIsLoading);\ntest('TemplateAppPlayer › TemplateAppPlayerPopinEnd › CommentSent › should be rendered', renderComponentMacro, TemplateAppPlayerPopinEnd, fixtureCommentSent);\ntest('TemplateAppPlayer › TemplateAppPlayerPopinEnd › Comment › should be rendered', renderComponentMacro, TemplateAppPlayerPopinEnd, fixtureComment);\ntest('TemplateAppPlayer › TemplateAppPlayerPopinEnd › Correct › should be rendered', renderComponentMacro, TemplateAppPlayerPopinEnd, fixtureCorrect);\ntest('TemplateAppPlayer › TemplateAppPlayerPopinEnd › Default › should be rendered', renderComponentMacro, TemplateAppPlayerPopinEnd, fixtureDefault);\ntest('TemplateAppPlayer › TemplateAppPlayerPopinEnd › Fail › should be rendered', renderComponentMacro, TemplateAppPlayerPopinEnd, fixtureFail);\ntest('TemplateAppPlayer › TemplateAppPlayerPopinEnd › InfiniteLives › should be rendered', renderComponentMacro, TemplateAppPlayerPopinEnd, fixtureInfiniteLives);\ntest('TemplateAppPlayer › TemplateAppPlayerPopinEnd › Loading › should be rendered', renderComponentMacro, TemplateAppPlayerPopinEnd, fixtureLoading);\ntest('TemplateAppPlayer › TemplateAppPlayerPopinEnd › NegativeRank › should be rendered', renderComponentMacro, TemplateAppPlayerPopinEnd, fixtureNegativeRank);\ntest('TemplateAppPlayer › TemplateAppPlayerPopinEnd › NextCourse › should be rendered', renderComponentMacro, TemplateAppPlayerPopinEnd, fixtureNextCourse);\ntest('TemplateAppPlayer › TemplateAppPlayerPopinEnd › NextLevelAdaptiveImg › should be rendered', renderComponentMacro, TemplateAppPlayerPopinEnd, fixtureNextLevelAdaptiveImg);\ntest('TemplateAppPlayer › TemplateAppPlayerPopinEnd › SimpleAction › should be rendered', renderComponentMacro, TemplateAppPlayerPopinEnd, fixtureSimpleAction);\ntest('TemplateAppPlayer › TemplateAppPlayerPopinEnd › Subscribe › should be rendered', renderComponentMacro, TemplateAppPlayerPopinEnd, fixtureSubscribe);\ntest('TemplateAppPlayer › TemplateAppPlayerPopinEnd › WithLoadingRecommendations › should be rendered', renderComponentMacro, TemplateAppPlayerPopinEnd, fixtureWithLoadingRecommendations);\ntest('TemplateAppPlayer › TemplateAppPlayerPopinEnd › WithRecommendations › should be rendered', renderComponentMacro, TemplateAppPlayerPopinEnd, fixtureWithRecommendations);\ntest('TemplateAppPlayer › TemplateAppPlayerPopinEnd › WithoutRecommendation › should be rendered', renderComponentMacro, TemplateAppPlayerPopinEnd, fixtureWithoutRecommendation);\n"],"file":"fixtures.js"}
|
|
@@ -8,40 +8,10 @@ var _renderComponent = _interopRequireDefault(require("../../../test/helpers/ren
|
|
|
8
8
|
|
|
9
9
|
var _ = _interopRequireDefault(require(".."));
|
|
10
10
|
|
|
11
|
-
var _adaptivAndDisabled = _interopRequireDefault(require("./fixtures/adaptiv-and-disabled"));
|
|
12
|
-
|
|
13
|
-
var _adaptiv = _interopRequireDefault(require("./fixtures/adaptiv"));
|
|
14
|
-
|
|
15
|
-
var _arabic = _interopRequireDefault(require("./fixtures/arabic"));
|
|
16
|
-
|
|
17
|
-
var _article = _interopRequireDefault(require("./fixtures/article"));
|
|
18
|
-
|
|
19
|
-
var _coorpmanager = _interopRequireDefault(require("./fixtures/coorpmanager"));
|
|
20
|
-
|
|
21
11
|
var _default = _interopRequireDefault(require("./fixtures/default"));
|
|
22
12
|
|
|
23
|
-
var _disabled = _interopRequireDefault(require("./fixtures/disabled"));
|
|
24
|
-
|
|
25
13
|
var _empty = _interopRequireDefault(require("./fixtures/empty"));
|
|
26
14
|
|
|
27
|
-
var _externalContent = _interopRequireDefault(require("./fixtures/external-content"));
|
|
28
|
-
|
|
29
|
-
var _favorite = _interopRequireDefault(require("./fixtures/favorite"));
|
|
30
|
-
|
|
31
|
-
var _freerunAndDisabled = _interopRequireDefault(require("./fixtures/freerun-and-disabled"));
|
|
32
|
-
|
|
33
|
-
var _freerun = _interopRequireDefault(require("./fixtures/freerun"));
|
|
34
|
-
|
|
35
|
-
var _podcast = _interopRequireDefault(require("./fixtures/podcast"));
|
|
36
|
-
|
|
37
|
-
var _scorm = _interopRequireDefault(require("./fixtures/scorm"));
|
|
38
|
-
|
|
39
|
-
var _selectableFalse = _interopRequireDefault(require("./fixtures/selectable-false"));
|
|
40
|
-
|
|
41
|
-
var _selectableTrue = _interopRequireDefault(require("./fixtures/selectable-true"));
|
|
42
|
-
|
|
43
|
-
var _video = _interopRequireDefault(require("./fixtures/video"));
|
|
44
|
-
|
|
45
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
46
16
|
|
|
47
17
|
(0, _ava.default)('Atom › AtomCardImagePreview > should have valid propTypes', t => {
|
|
@@ -50,21 +20,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
50
20
|
t.not(value, undefined, `PropType for "Atom.AtomCardImagePreview.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
51
21
|
});
|
|
52
22
|
});
|
|
53
|
-
(0, _ava.default)('Atom › AtomCardImagePreview › AdaptivAndDisabled › should be rendered', _renderComponent.default, _.default, _adaptivAndDisabled.default);
|
|
54
|
-
(0, _ava.default)('Atom › AtomCardImagePreview › Adaptiv › should be rendered', _renderComponent.default, _.default, _adaptiv.default);
|
|
55
|
-
(0, _ava.default)('Atom › AtomCardImagePreview › Arabic › should be rendered', _renderComponent.default, _.default, _arabic.default);
|
|
56
|
-
(0, _ava.default)('Atom › AtomCardImagePreview › Article › should be rendered', _renderComponent.default, _.default, _article.default);
|
|
57
|
-
(0, _ava.default)('Atom › AtomCardImagePreview › Coorpmanager › should be rendered', _renderComponent.default, _.default, _coorpmanager.default);
|
|
58
23
|
(0, _ava.default)('Atom › AtomCardImagePreview › Default › should be rendered', _renderComponent.default, _.default, _default.default);
|
|
59
|
-
(0, _ava.default)('Atom › AtomCardImagePreview › Disabled › should be rendered', _renderComponent.default, _.default, _disabled.default);
|
|
60
24
|
(0, _ava.default)('Atom › AtomCardImagePreview › Empty › should be rendered', _renderComponent.default, _.default, _empty.default);
|
|
61
|
-
(0, _ava.default)('Atom › AtomCardImagePreview › ExternalContent › should be rendered', _renderComponent.default, _.default, _externalContent.default);
|
|
62
|
-
(0, _ava.default)('Atom › AtomCardImagePreview › Favorite › should be rendered', _renderComponent.default, _.default, _favorite.default);
|
|
63
|
-
(0, _ava.default)('Atom › AtomCardImagePreview › FreerunAndDisabled › should be rendered', _renderComponent.default, _.default, _freerunAndDisabled.default);
|
|
64
|
-
(0, _ava.default)('Atom › AtomCardImagePreview › Freerun › should be rendered', _renderComponent.default, _.default, _freerun.default);
|
|
65
|
-
(0, _ava.default)('Atom › AtomCardImagePreview › Podcast › should be rendered', _renderComponent.default, _.default, _podcast.default);
|
|
66
|
-
(0, _ava.default)('Atom › AtomCardImagePreview › Scorm › should be rendered', _renderComponent.default, _.default, _scorm.default);
|
|
67
|
-
(0, _ava.default)('Atom › AtomCardImagePreview › SelectableFalse › should be rendered', _renderComponent.default, _.default, _selectableFalse.default);
|
|
68
|
-
(0, _ava.default)('Atom › AtomCardImagePreview › SelectableTrue › should be rendered', _renderComponent.default, _.default, _selectableTrue.default);
|
|
69
|
-
(0, _ava.default)('Atom › AtomCardImagePreview › Video › should be rendered', _renderComponent.default, _.default, _video.default);
|
|
70
25
|
//# sourceMappingURL=fixtures.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/atom/card-image-preview/test/fixtures.js"],"names":["t","pass","AtomCardImagePreview","propTypes","value","key","not","undefined","renderComponentMacro","
|
|
1
|
+
{"version":3,"sources":["../../../../src/atom/card-image-preview/test/fixtures.js"],"names":["t","pass","AtomCardImagePreview","propTypes","value","key","not","undefined","renderComponentMacro","fixtureDefault","fixtureEmpty"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,kBAAK,2DAAL,EAAkEA,CAAC,IAAI;AACrEA,EAAAA,CAAC,CAACC,IAAF;AACA,wBAAQC,UAAqBC,SAA7B,EAAwC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACtDL,IAAAA,CAAC,CAACM,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,qDAAoDF,GAAI,mEAAjF;AACD,GAFD;AAGD,CALD;AAOA,kBAAK,4DAAL,EAAmEG,wBAAnE,EAAyFN,SAAzF,EAA+GO,gBAA/G;AACA,kBAAK,0DAAL,EAAiED,wBAAjE,EAAuFN,SAAvF,EAA6GQ,cAA7G","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport AtomCardImagePreview from '..';\nimport fixtureDefault from './fixtures/default';\nimport fixtureEmpty from './fixtures/empty';\n\ntest('Atom › AtomCardImagePreview > should have valid propTypes', t => {\n t.pass();\n forEach(AtomCardImagePreview.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Atom.AtomCardImagePreview.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Atom › AtomCardImagePreview › Default › should be rendered', renderComponentMacro, AtomCardImagePreview, fixtureDefault);\ntest('Atom › AtomCardImagePreview › Empty › should be rendered', renderComponentMacro, AtomCardImagePreview, fixtureEmpty);\n"],"file":"fixtures.js"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _ava = _interopRequireDefault(require("ava"));
|
|
4
|
+
|
|
5
|
+
var _forEach = _interopRequireDefault(require("lodash/forEach"));
|
|
6
|
+
|
|
7
|
+
var _renderComponent = _interopRequireDefault(require("../../../test/helpers/render-component"));
|
|
8
|
+
|
|
9
|
+
var _ = _interopRequireDefault(require(".."));
|
|
10
|
+
|
|
11
|
+
var _chapter = _interopRequireDefault(require("./fixtures/chapter"));
|
|
12
|
+
|
|
13
|
+
var _course = _interopRequireDefault(require("./fixtures/course"));
|
|
14
|
+
|
|
15
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
+
|
|
17
|
+
(0, _ava.default)('Molecule › MoleculeCourseSection > should have valid propTypes', t => {
|
|
18
|
+
t.pass();
|
|
19
|
+
(0, _forEach.default)(_.default.propTypes, (value, key) => {
|
|
20
|
+
t.not(value, undefined, `PropType for "Molecule.MoleculeCourseSection.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
(0, _ava.default)('Molecule › MoleculeCourseSection › Chapter › should be rendered', _renderComponent.default, _.default, _chapter.default);
|
|
24
|
+
(0, _ava.default)('Molecule › MoleculeCourseSection › Course › should be rendered', _renderComponent.default, _.default, _course.default);
|
|
25
|
+
//# sourceMappingURL=fixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/molecule/course-section/test/fixtures.js"],"names":["t","pass","MoleculeCourseSection","propTypes","value","key","not","undefined","renderComponentMacro","fixtureChapter","fixtureCourse"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,kBAAK,gEAAL,EAAuEA,CAAC,IAAI;AAC1EA,EAAAA,CAAC,CAACC,IAAF;AACA,wBAAQC,UAAsBC,SAA9B,EAAyC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACvDL,IAAAA,CAAC,CAACM,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,0DAAyDF,GAAI,mEAAtF;AACD,GAFD;AAGD,CALD;AAOA,kBAAK,iEAAL,EAAwEG,wBAAxE,EAA8FN,SAA9F,EAAqHO,gBAArH;AACA,kBAAK,gEAAL,EAAuED,wBAAvE,EAA6FN,SAA7F,EAAoHQ,eAApH","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeCourseSection from '..';\nimport fixtureChapter from './fixtures/chapter';\nimport fixtureCourse from './fixtures/course';\n\ntest('Molecule › MoleculeCourseSection > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeCourseSection.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Molecule.MoleculeCourseSection.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Molecule › MoleculeCourseSection › Chapter › should be rendered', renderComponentMacro, MoleculeCourseSection, fixtureChapter);\ntest('Molecule › MoleculeCourseSection › Course › should be rendered', renderComponentMacro, MoleculeCourseSection, fixtureCourse);\n"],"file":"fixtures.js"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
|
|
6
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
7
|
+
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
|
|
10
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
+
|
|
12
|
+
var _style = _interopRequireDefault(require("./style.css"));
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
|
|
16
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
|
17
|
+
|
|
18
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
19
|
+
|
|
20
|
+
const preventDefault = e => e.preventDefault();
|
|
21
|
+
|
|
22
|
+
const stopPropagation = e => e.stopPropagation();
|
|
23
|
+
|
|
24
|
+
const Draggable = props => {
|
|
25
|
+
const {
|
|
26
|
+
id,
|
|
27
|
+
dragging = false,
|
|
28
|
+
onDragStart,
|
|
29
|
+
onDragOver,
|
|
30
|
+
onDragLeave,
|
|
31
|
+
onDrop,
|
|
32
|
+
children
|
|
33
|
+
} = props;
|
|
34
|
+
const dragStartHandler = (0, _react.useCallback)(e => {
|
|
35
|
+
stopPropagation(e);
|
|
36
|
+
onDragStart(id);
|
|
37
|
+
}, [id, onDragStart]);
|
|
38
|
+
const dragOverHandler = (0, _react.useCallback)(e => {
|
|
39
|
+
preventDefault(e);
|
|
40
|
+
onDragOver(id);
|
|
41
|
+
}, [id, onDragOver]);
|
|
42
|
+
const dragLeaveHandler = (0, _react.useCallback)(e => {
|
|
43
|
+
preventDefault(e);
|
|
44
|
+
onDragLeave(id);
|
|
45
|
+
}, [id, onDragLeave]);
|
|
46
|
+
const dropHandler = (0, _react.useCallback)(e => {
|
|
47
|
+
preventDefault(e);
|
|
48
|
+
onDrop(id);
|
|
49
|
+
}, [id, onDrop]);
|
|
50
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
51
|
+
className: (0, _classnames.default)(dragging ? _style.default.dragging : null, _style.default.section, _style.default.draggable),
|
|
52
|
+
onDragStart: dragStartHandler,
|
|
53
|
+
onDragOver: dragOverHandler,
|
|
54
|
+
onDragLeave: dragLeaveHandler,
|
|
55
|
+
onDrop: dropHandler,
|
|
56
|
+
draggable: true
|
|
57
|
+
}, children);
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
Draggable.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
61
|
+
id: _propTypes.default.string,
|
|
62
|
+
dragging: _propTypes.default.bool,
|
|
63
|
+
onDragStart: _propTypes.default.func,
|
|
64
|
+
onDragOver: _propTypes.default.func,
|
|
65
|
+
onDragLeave: _propTypes.default.func,
|
|
66
|
+
onDrop: _propTypes.default.func,
|
|
67
|
+
children: _propTypes.default.element
|
|
68
|
+
} : {};
|
|
69
|
+
var _default = Draggable;
|
|
70
|
+
exports.default = _default;
|
|
71
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/molecule/draggable/index.js"],"names":["preventDefault","e","stopPropagation","Draggable","props","id","dragging","onDragStart","onDragOver","onDragLeave","onDrop","children","dragStartHandler","dragOverHandler","dragLeaveHandler","dropHandler","style","section","draggable","propTypes","PropTypes","string","bool","func","element"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;;;;;;;AAEA,MAAMA,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,GAAG,wBACvBX,CAAC,IAAI;AACHC,IAAAA,eAAe,CAACD,CAAD,CAAf;AACAM,IAAAA,WAAW,CAACF,EAAD,CAAX;AACD,GAJsB,EAKvB,CAACA,EAAD,EAAKE,WAAL,CALuB,CAAzB;AAOA,QAAMM,eAAe,GAAG,wBACtBZ,CAAC,IAAI;AACHD,IAAAA,cAAc,CAACC,CAAD,CAAd;AACAO,IAAAA,UAAU,CAACH,EAAD,CAAV;AACD,GAJqB,EAKtB,CAACA,EAAD,EAAKG,UAAL,CALsB,CAAxB;AAOA,QAAMM,gBAAgB,GAAG,wBACvBb,CAAC,IAAI;AACHD,IAAAA,cAAc,CAACC,CAAD,CAAd;AACAQ,IAAAA,WAAW,CAACJ,EAAD,CAAX;AACD,GAJsB,EAKvB,CAACA,EAAD,EAAKI,WAAL,CALuB,CAAzB;AAOA,QAAMM,WAAW,GAAG,wBAClBd,CAAC,IAAI;AACHD,IAAAA,cAAc,CAACC,CAAD,CAAd;AACAS,IAAAA,MAAM,CAACL,EAAD,CAAN;AACD,GAJiB,EAKlB,CAACA,EAAD,EAAKK,MAAL,CALkB,CAApB;AAQA,sBACE;AACE,IAAA,SAAS,EAAE,yBAAWJ,QAAQ,GAAGU,eAAMV,QAAT,GAAoB,IAAvC,EAA6CU,eAAMC,OAAnD,EAA4DD,eAAME,SAAlE,CADb;AAEE,IAAA,WAAW,EAAEN,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,CAACgB,SAAV,2CAAsB;AACpBd,EAAAA,EAAE,EAAEe,mBAAUC,MADM;AAEpBf,EAAAA,QAAQ,EAAEc,mBAAUE,IAFA;AAGpBf,EAAAA,WAAW,EAAEa,mBAAUG,IAHH;AAIpBf,EAAAA,UAAU,EAAEY,mBAAUG,IAJF;AAKpBd,EAAAA,WAAW,EAAEW,mBAAUG,IALH;AAMpBb,EAAAA,MAAM,EAAEU,mBAAUG,IANE;AAOpBZ,EAAAA,QAAQ,EAAES,mBAAUI;AAPA,CAAtB;eAUerB,S","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.section, 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"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
@value breakpoints: "../../variables/breakpoints.css";
|
|
2
|
+
@value mobile from breakpoints;
|
|
3
|
+
@value colors: "../../variables/colors.css";
|
|
4
|
+
@value medium from colors;
|
|
5
|
+
@value xtraLightGrey from colors;
|
|
6
|
+
@value dark from colors;
|
|
7
|
+
@value cm_grey_100 from colors;
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
.section {
|
|
11
|
+
display: flex;
|
|
12
|
+
justify-content: center;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.draggable {
|
|
16
|
+
cursor: grab;
|
|
17
|
+
position: relative;
|
|
18
|
+
background: transparent;
|
|
19
|
+
margin: 8px 0;
|
|
20
|
+
border-radius: 7px;
|
|
21
|
+
}
|
|
22
|
+
.draggable:hover{
|
|
23
|
+
background: rgba(0, 0, 0, 0.3);
|
|
24
|
+
}
|
|
25
|
+
.draggable:active{
|
|
26
|
+
background: transparent;
|
|
27
|
+
}
|
|
28
|
+
.draggable:before {
|
|
29
|
+
content: '.';
|
|
30
|
+
position: absolute;
|
|
31
|
+
left: 23px;
|
|
32
|
+
top: 5px;
|
|
33
|
+
width: 12px;
|
|
34
|
+
font-size: 25px;
|
|
35
|
+
color: medium;
|
|
36
|
+
pointer-events: none;
|
|
37
|
+
text-shadow: 0 0 medium, 0 5px medium, 0 10px medium, 0 15px medium,
|
|
38
|
+
5px 0 medium , 5px 5px medium, 5px 10px medium, 5px 15px medium;
|
|
39
|
+
}
|
|
40
|
+
.dragging {
|
|
41
|
+
background: rgba(0, 0, 0, 0.1);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.dragging:after {
|
|
45
|
+
position: absolute;
|
|
46
|
+
content: "";
|
|
47
|
+
left: 0;
|
|
48
|
+
top: 0;
|
|
49
|
+
bottom: 0;
|
|
50
|
+
right: 0;
|
|
51
|
+
background: color(black lightness(95%));
|
|
52
|
+
pointer-events: none;
|
|
53
|
+
box-sizing: border-box;
|
|
54
|
+
display: flex;
|
|
55
|
+
justify-content: center;
|
|
56
|
+
align-items: center;
|
|
57
|
+
color: dark;
|
|
58
|
+
font-family: 'Open Sans';
|
|
59
|
+
font-weight: 600;
|
|
60
|
+
font-size: 14px;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@media mobile {
|
|
64
|
+
.draggable:before {
|
|
65
|
+
content: none;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
var _default = {
|
|
6
|
+
props: {
|
|
7
|
+
id: 'draggableId',
|
|
8
|
+
dragging: true,
|
|
9
|
+
onDragStart: () => console.log('onDragStart'),
|
|
10
|
+
onDragOver: () => console.log('onDragOver'),
|
|
11
|
+
onDragLeave: () => console.log('onDragLeave'),
|
|
12
|
+
onDrop: () => console.log('onDrop'),
|
|
13
|
+
children: []
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
exports.default = _default;
|
|
17
|
+
//# sourceMappingURL=default.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/molecule/draggable/test/fixtures/default.js"],"names":["props","id","dragging","onDragStart","console","log","onDragOver","onDragLeave","onDrop","children"],"mappings":";;;;eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,EAAE,EAAE,aADC;AAELC,IAAAA,QAAQ,EAAE,IAFL;AAGLC,IAAAA,WAAW,EAAE,MAAMC,OAAO,CAACC,GAAR,CAAY,aAAZ,CAHd;AAILC,IAAAA,UAAU,EAAE,MAAMF,OAAO,CAACC,GAAR,CAAY,YAAZ,CAJb;AAKLE,IAAAA,WAAW,EAAE,MAAMH,OAAO,CAACC,GAAR,CAAY,aAAZ,CALd;AAMLG,IAAAA,MAAM,EAAE,MAAMJ,OAAO,CAACC,GAAR,CAAY,QAAZ,CANT;AAOLI,IAAAA,QAAQ,EAAE;AAPL;AADM,C","sourcesContent":["export default {\n props: {\n id: 'draggableId',\n dragging: true,\n onDragStart: () => console.log('onDragStart'),\n onDragOver: () => console.log('onDragOver'),\n onDragLeave: () => console.log('onDragLeave'),\n onDrop: () => console.log('onDrop'),\n children: []\n }\n};\n"],"file":"default.js"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _ava = _interopRequireDefault(require("ava"));
|
|
4
|
+
|
|
5
|
+
var _forEach = _interopRequireDefault(require("lodash/forEach"));
|
|
6
|
+
|
|
7
|
+
var _renderComponent = _interopRequireDefault(require("../../../test/helpers/render-component"));
|
|
8
|
+
|
|
9
|
+
var _ = _interopRequireDefault(require(".."));
|
|
10
|
+
|
|
11
|
+
var _default = _interopRequireDefault(require("./fixtures/default"));
|
|
12
|
+
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
+
|
|
15
|
+
(0, _ava.default)('Molecule › MoleculeDraggable > should have valid propTypes', t => {
|
|
16
|
+
t.pass();
|
|
17
|
+
(0, _forEach.default)(_.default.propTypes, (value, key) => {
|
|
18
|
+
t.not(value, undefined, `PropType for "Molecule.MoleculeDraggable.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
(0, _ava.default)('Molecule › MoleculeDraggable › Default › should be rendered', _renderComponent.default, _.default, _default.default);
|
|
22
|
+
//# sourceMappingURL=fixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/molecule/draggable/test/fixtures.js"],"names":["t","pass","MoleculeDraggable","propTypes","value","key","not","undefined","renderComponentMacro","fixtureDefault"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,kBAAK,4DAAL,EAAmEA,CAAC,IAAI;AACtEA,EAAAA,CAAC,CAACC,IAAF;AACA,wBAAQC,UAAkBC,SAA1B,EAAqC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACnDL,IAAAA,CAAC,CAACM,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,sDAAqDF,GAAI,mEAAlF;AACD,GAFD;AAGD,CALD;AAOA,kBAAK,6DAAL,EAAoEG,wBAApE,EAA0FN,SAA1F,EAA6GO,gBAA7G","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeDraggable from '..';\nimport fixtureDefault from './fixtures/default';\n\ntest('Molecule › MoleculeDraggable > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeDraggable.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Molecule.MoleculeDraggable.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Molecule › MoleculeDraggable › Default › should be rendered', renderComponentMacro, MoleculeDraggable, fixtureDefault);\n"],"file":"fixtures.js"}
|