@pie-lib/drag 1.1.53-next.950 → 2.0.1

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/CHANGELOG.md CHANGED
@@ -3,6 +3,31 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [2.0.1](https://github.com/pie-framework/pie-lib/compare/@pie-lib/drag@2.0.0...@pie-lib/drag@2.0.1) (2022-11-23)
7
+
8
+ **Note:** Version bump only for package @pie-lib/drag
9
+
10
+
11
+
12
+
13
+
14
+ # [2.0.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/drag@1.1.52...@pie-lib/drag@2.0.0) (2022-11-23)
15
+
16
+
17
+ ### Features
18
+
19
+ * update react-dnd and react-dnd-html5-backend versions ([be0cbe8](https://github.com/pie-framework/pie-lib/commit/be0cbe83d4014e03e1b5dd6218d6176cf3c28cc6))
20
+
21
+
22
+ ### BREAKING CHANGES
23
+
24
+ * updated react-dnd and react-dnd-html5-backend versions
25
+ The update was made in a previous commit, but breaking changes might occur so that's the role for this commit.
26
+
27
+
28
+
29
+
30
+
6
31
  ## [1.1.52](https://github.com/pie-framework/pie-lib/compare/@pie-lib/drag@1.1.50...@pie-lib/drag@1.1.52) (2021-06-25)
7
32
 
8
33
  **Note:** Version bump only for package @pie-lib/drag
package/lib/choice.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/choice.jsx"],"names":["DRAG_TYPE","Choice","props","classes","className","children","connectDragSource","choice","React","Component","PropTypes","object","isRequired","string","oneOfType","arrayOf","node","func","styles","theme","backgroundColor","border","grey","padding","spacing","unit","minHeight","choiceSource","canDrag","disabled","beginDrag","styledChoice","connect","monitor","dragSource","isDragging"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AAEA;;;;;;AAEO,IAAMA,SAAS,GAAG,QAAlB;;;IAEMC,M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jB,MAAnB,CAArB;;eAEe,0BAAWD,SAAX,EAAsB2B,YAAtB,EAAoC,UAACK,OAAD,EAAUC,OAAV;AAAA,SAAuB;AACxE3B,IAAAA,iBAAiB,EAAE0B,OAAO,CAACE,UAAR,EADqD;AAExEC,IAAAA,UAAU,EAAEF,OAAO,CAACE,UAAR;AAF4D,GAAvB;AAAA,CAApC,EAGXJ,YAHW,C","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@material-ui/core/styles';\nimport classNames from 'classnames';\nimport grey from '@material-ui/core/colors/grey';\n\nimport { DragSource } from 'react-dnd';\n\nexport const DRAG_TYPE = 'CHOICE';\n\nexport class Choice extends React.Component {\n static propTypes = {\n classes: PropTypes.object.isRequired,\n className: PropTypes.string,\n children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]),\n connectDragSource: PropTypes.func.isRequired\n };\n\n static defaultProps = {};\n\n render() {\n const { classes, className, children, connectDragSource } = this.props;\n\n return connectDragSource(\n <div className={classNames(classes.choice, className)}>{children}</div>\n );\n }\n}\n\nconst styles = theme => ({\n choice: {\n backgroundColor: 'white',\n border: `solid 1px ${grey[400]}`,\n padding: theme.spacing.unit,\n minHeight: '30px'\n }\n});\n\nconst choiceSource = {\n canDrag(props) {\n return !props.disabled;\n },\n beginDrag(props) {\n return props;\n }\n};\n\nconst styledChoice = withStyles(styles)(Choice);\n\nexport default DragSource(DRAG_TYPE, choiceSource, (connect, monitor) => ({\n connectDragSource: connect.dragSource(),\n isDragging: monitor.isDragging()\n}))(styledChoice);\n"],"file":"choice.js"}
1
+ {"version":3,"sources":["../src/choice.jsx"],"names":["DRAG_TYPE","Choice","props","classes","className","children","connectDragSource","choice","React","Component","PropTypes","object","isRequired","string","oneOfType","arrayOf","node","func","styles","theme","backgroundColor","border","grey","padding","spacing","unit","minHeight","choiceSource","canDrag","disabled","beginDrag","styledChoice","connect","monitor","dragSource","isDragging"],"mappings":";;;;;;;;;;;;;;;;;;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S,EAIF;AACf,WAAOA,KAAP;AACD;AANkB,CAArB;AASA,IAAM6B,YAAY,GAAG,wBAAWb,MAAX,EAAmBjB,MAAnB,CAArB;;eAEe,0BAAWD,SAAX,EAAsB2B,YAAtB,EAAoC,UAACK,OAAD,EAAUC,OAAV;AAAA,SAAuB;AACxE3B,IAAAA,iBAAiB,EAAE0B,OAAO,CAACE,UAAR,EADqD;AAExEC,IAAAA,UAAU,EAAEF,OAAO,CAACE,UAAR;AAF4D,GAAvB;AAAA,CAApC,EAGXJ,YAHW,C","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@material-ui/core/styles';\nimport classNames from 'classnames';\nimport grey from '@material-ui/core/colors/grey';\n\nimport { DragSource } from 'react-dnd';\n\nexport const DRAG_TYPE = 'CHOICE';\n\nexport class Choice extends React.Component {\n static propTypes = {\n classes: PropTypes.object.isRequired,\n className: PropTypes.string,\n children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]),\n connectDragSource: PropTypes.func.isRequired,\n };\n\n static defaultProps = {};\n\n render() {\n const { classes, className, children, connectDragSource } = this.props;\n\n return connectDragSource(<div className={classNames(classes.choice, className)}>{children}</div>);\n }\n}\n\nconst styles = (theme) => ({\n choice: {\n backgroundColor: 'white',\n border: `solid 1px ${grey[400]}`,\n padding: theme.spacing.unit,\n minHeight: '30px',\n },\n});\n\nconst choiceSource = {\n canDrag(props) {\n return !props.disabled;\n },\n beginDrag(props) {\n return props;\n },\n};\n\nconst styledChoice = withStyles(styles)(Choice);\n\nexport default DragSource(DRAG_TYPE, choiceSource, (connect, monitor) => ({\n connectDragSource: connect.dragSource(),\n isDragging: monitor.isDragging(),\n}))(styledChoice);\n"],"file":"choice.js"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/placeholder.jsx"],"names":["PlaceHolder","props","children","classes","className","isOver","type","grid","disabled","names","placeholder","over","style","columns","gridTemplateColumns","rows","repeatValue","rowsRepeatValue","gridTemplateRows","propTypes","PropTypes","object","isRequired","shape","number","string","oneOfType","arrayOf","node","bool","index","styles","theme","width","height","background","border","transition","boxSizing","display","gridRowGap","spacing","unit","gridColumnGap","padding","boxShadow","grey","backgroundColor"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AAEO,IAAMA,WAAW,GAAG,SAAdA,WAAc,CAAAC,KAAK,EAAI;AAClC,MAAQC,QAAR,GAAuED,KAAvE,CAAQC,QAAR;AAAA,MAAkBC,OAAlB,GAAuEF,KAAvE,CAAkBE,OAAlB;AAAA,MAA2BC,SAA3B,GAAuEH,KAAvE,CAA2BG,SAA3B;AAAA,MAAsCC,MAAtC,GAAuEJ,KAAvE,CAAsCI,MAAtC;AAAA,MAA8CC,IAA9C,GAAuEL,KAAvE,CAA8CK,IAA9C;AAAA,MAAoDC,IAApD,GAAuEN,KAAvE,CAAoDM,IAApD;AAAA,MAA0DC,QAA1D,GAAuEP,KAAvE,CAA0DO,QAA1D;AACA,MAAMC,KAAK,GAAG,4BACZN,OAAO,CAACO,WADI,EAEZF,QAAQ,IAAIL,OAAO,CAACK,QAFR,EAGZH,MAAM,IAAIF,OAAO,CAACQ,IAHN,EAIZR,OAAO,CAACG,IAAD,CAJK,EAKZF,SALY,CAAd;AAQA,MAAMQ,KAAK,GAAG,EAAd;;AAEA,MAAIL,IAAI,IAAIA,IAAI,CAACM,OAAjB,EAA0B;AACxBD,IAAAA,KAAK,CAACE,mBAAN,oBAAsCP,IAAI,CAACM,OAA3C;AACD;;AACD,MAAIN,IAAI,IAAIA,IAAI,CAACQ,IAAjB,EAAuB;AACrB,QAAMC,WAAW,GAAGT,IAAI,CAACU,eAAL,IAAwB,KAA5C;AAEAL,IAAAA,KAAK,CAACM,gBAAN,oBAAmCX,IAAI,CAACQ,IAAxC,eAAiDC,WAAjD;AACD;;AAED,sBACE;AAAK,IAAA,KAAK,EAAEJ,KAAZ;AAAmB,IAAA,SAAS,EAAEH;AAA9B,KACGP,QADH,CADF;AAKD,C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AE;AACRqC,MAAAA,SAAS,EAAE,MADH;AAERV,MAAAA,UAAU,EAAE;AAFJ,KAba;AAiBvBxB,IAAAA,IAAI,EAAE;AACJyB,MAAAA,MAAM,sBAAeU,iBAAK,GAAL,CAAf,CADF;AAEJC,MAAAA,eAAe,YAAKD,iBAAK,GAAL,CAAL;AAFX;AAjBiB,GAAL;AAAA,CAApB;;eAuBe,wBAAWf,MAAX,EAAmB/B,WAAnB,C","sourcesContent":["import React from 'react';\nimport { withStyles } from '@material-ui/core/styles';\nimport classNames from 'classnames';\nimport PropTypes from 'prop-types';\nimport grey from '@material-ui/core/colors/grey';\n\nexport const PlaceHolder = props => {\n const { children, classes, className, isOver, type, grid, disabled } = props;\n const names = classNames(\n classes.placeholder,\n disabled && classes.disabled,\n isOver && classes.over,\n classes[type],\n className\n );\n\n const style = {};\n\n if (grid && grid.columns) {\n style.gridTemplateColumns = `repeat(${grid.columns}, 1fr)`;\n }\n if (grid && grid.rows) {\n const repeatValue = grid.rowsRepeatValue || '1fr';\n\n style.gridTemplateRows = `repeat(${grid.rows}, ${repeatValue})`;\n }\n\n return (\n <div style={style} className={names}>\n {children}\n </div>\n );\n};\n\nPlaceHolder.propTypes = {\n classes: PropTypes.object.isRequired,\n grid: PropTypes.shape({\n columns: PropTypes.number,\n rows: PropTypes.number,\n // if a different value then 1fr is wanted\n rowsRepeatValue: PropTypes.string\n }),\n children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired,\n className: PropTypes.string,\n isOver: PropTypes.bool,\n index: PropTypes.number,\n type: PropTypes.string,\n disabled: PropTypes.bool\n};\n\nconst styles = theme => ({\n placeholder: {\n width: '100%',\n height: '100%',\n background: '#EEEEEE',\n border: '1px solid #D1D1D1',\n transition: 'background-color 200ms linear, border-color 200ms linear',\n boxSizing: 'border-box',\n display: 'grid',\n gridRowGap: `${theme.spacing.unit}px`,\n gridColumnGap: `${theme.spacing.unit}px`,\n padding: theme.spacing.unit * 1\n },\n disabled: {\n boxShadow: 'none',\n background: 'white'\n },\n over: {\n border: `1px solid ${grey[500]}`,\n backgroundColor: `${grey[300]}`\n }\n});\n\nexport default withStyles(styles)(PlaceHolder);\n"],"file":"placeholder.js"}
1
+ {"version":3,"sources":["../src/placeholder.jsx"],"names":["PlaceHolder","props","children","classes","className","isOver","type","grid","disabled","names","placeholder","over","style","columns","gridTemplateColumns","rows","repeatValue","rowsRepeatValue","gridTemplateRows","propTypes","PropTypes","object","isRequired","shape","number","string","oneOfType","arrayOf","node","bool","index","styles","theme","width","height","background","border","transition","boxSizing","display","gridRowGap","spacing","unit","gridColumnGap","padding","boxShadow","grey","backgroundColor"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AAEO,IAAMA,WAAW,GAAG,SAAdA,WAAc,CAACC,KAAD,EAAW;AACpC,MAAQC,QAAR,GAAuED,KAAvE,CAAQC,QAAR;AAAA,MAAkBC,OAAlB,GAAuEF,KAAvE,CAAkBE,OAAlB;AAAA,MAA2BC,SAA3B,GAAuEH,KAAvE,CAA2BG,SAA3B;AAAA,MAAsCC,MAAtC,GAAuEJ,KAAvE,CAAsCI,MAAtC;AAAA,MAA8CC,IAA9C,GAAuEL,KAAvE,CAA8CK,IAA9C;AAAA,MAAoDC,IAApD,GAAuEN,KAAvE,CAAoDM,IAApD;AAAA,MAA0DC,QAA1D,GAAuEP,KAAvE,CAA0DO,QAA1D;AACA,MAAMC,KAAK,GAAG,4BACZN,OAAO,CAACO,WADI,EAEZF,QAAQ,IAAIL,OAAO,CAACK,QAFR,EAGZH,MAAM,IAAIF,OAAO,CAACQ,IAHN,EAIZR,OAAO,CAACG,IAAD,CAJK,EAKZF,SALY,CAAd;AAQA,MAAMQ,KAAK,GAAG,EAAd;;AAEA,MAAIL,IAAI,IAAIA,IAAI,CAACM,OAAjB,EAA0B;AACxBD,IAAAA,KAAK,CAACE,mBAAN,oBAAsCP,IAAI,CAACM,OAA3C;AACD;;AACD,MAAIN,IAAI,IAA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AAE,YANA;AAOXC,MAAAA,OAAO,EAAE,MAPE;AAQXC,MAAAA,UAAU,YAAKR,KAAK,CAACS,OAAN,CAAcC,IAAnB,OARC;AASXC,MAAAA,aAAa,YAAKX,KAAK,CAACS,OAAN,CAAcC,IAAnB,OATF;AAUXE,MAAAA,OAAO,EAAEZ,KAAK,CAACS,OAAN,CAAcC,IAAd,GAAqB;AAVnB,KADY;AAazBlC,IAAAA,QAAQ,EAAE;AACRqC,MAAAA,SAAS,EAAE,MADH;AAERV,MAAAA,UAAU,EAAE;AAFJ,KAbe;AAiBzBxB,IAAAA,IAAI,EAAE;AACJyB,MAAAA,MAAM,sBAAeU,iBAAK,GAAL,CAAf,CADF;AAEJC,MAAAA,eAAe,YAAKD,iBAAK,GAAL,CAAL;AAFX;AAjBmB,GAAZ;AAAA,CAAf;;eAuBe,wBAAWf,MAAX,EAAmB/B,WAAnB,C","sourcesContent":["import React from 'react';\nimport { withStyles } from '@material-ui/core/styles';\nimport classNames from 'classnames';\nimport PropTypes from 'prop-types';\nimport grey from '@material-ui/core/colors/grey';\n\nexport const PlaceHolder = (props) => {\n const { children, classes, className, isOver, type, grid, disabled } = props;\n const names = classNames(\n classes.placeholder,\n disabled && classes.disabled,\n isOver && classes.over,\n classes[type],\n className,\n );\n\n const style = {};\n\n if (grid && grid.columns) {\n style.gridTemplateColumns = `repeat(${grid.columns}, 1fr)`;\n }\n if (grid && grid.rows) {\n const repeatValue = grid.rowsRepeatValue || '1fr';\n\n style.gridTemplateRows = `repeat(${grid.rows}, ${repeatValue})`;\n }\n\n return (\n <div style={style} className={names}>\n {children}\n </div>\n );\n};\n\nPlaceHolder.propTypes = {\n classes: PropTypes.object.isRequired,\n grid: PropTypes.shape({\n columns: PropTypes.number,\n rows: PropTypes.number,\n // if a different value then 1fr is wanted\n rowsRepeatValue: PropTypes.string,\n }),\n children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired,\n className: PropTypes.string,\n isOver: PropTypes.bool,\n index: PropTypes.number,\n type: PropTypes.string,\n disabled: PropTypes.bool,\n};\n\nconst styles = (theme) => ({\n placeholder: {\n width: '100%',\n height: '100%',\n background: '#EEEEEE',\n border: '1px solid #D1D1D1',\n transition: 'background-color 200ms linear, border-color 200ms linear',\n boxSizing: 'border-box',\n display: 'grid',\n gridRowGap: `${theme.spacing.unit}px`,\n gridColumnGap: `${theme.spacing.unit}px`,\n padding: theme.spacing.unit * 1,\n },\n disabled: {\n boxShadow: 'none',\n background: 'white',\n },\n over: {\n border: `1px solid ${grey[500]}`,\n backgroundColor: `${grey[300]}`,\n },\n});\n\nexport default withStyles(styles)(PlaceHolder);\n"],"file":"placeholder.js"}
package/lib/swap.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/swap.js"],"names":["arr","fromIndex","toIndex","length","undefined","Error","update","tmp"],"mappings":";;;;;;;;;AAAA;;eAEe,kBAACA,GAAD,EAAMC,SAAN,EAAiBC,OAAjB,EAA6B;AAC1C,MAAI,CAACF,GAAD,IAAQA,GAAG,CAACG,MAAJ,IAAc,CAAtB,IAA2BF,SAAS,KAAKG,SAAzC,IAAsDF,OAAO,KAAKE,SAAtE,EAAiF;AAC/E,UAAM,IAAIC,KAAJ,gEACoDL,GADpD,eAC4DC,SAD5D,cACyEC,OADzE,EAAN;AAGD;;AACD,MAAMI,MAAM,GAAG,2BAAUN,GAAV,CAAf;AACA,MAAMO,GAAG,GAAGP,GAAG,CAACE,OAAD,CAAf;AACAI,EAAAA,MAAM,CAACJ,OAAD,CAAN,GAAkBI,MAAM,CAACL,SAAD,CAAxB;AACAK,EAAAA,MAAM,CAACL,SAAD,CAAN,GAAoBM,GAApB;AACA,SAAOD,MAAP;AACD,C","sourcesContent":["import cloneDeep from 'lodash/cloneDeep';\n\nexport default (arr, fromIndex, toIndex) => {\n if (!arr || arr.length <= 1 || fromIndex === undefined || toIndex === undefined) {\n throw new Error(\n `swap requires a non-empty array, fromIndex, toIndex: ${arr}, ${fromIndex} ${toIndex}`\n );\n }\n const update = cloneDeep(arr);\n const tmp = arr[toIndex];\n update[toIndex] = update[fromIndex];\n update[fromIndex] = tmp;\n return update;\n};\n"],"file":"swap.js"}
1
+ {"version":3,"sources":["../src/swap.js"],"names":["arr","fromIndex","toIndex","length","undefined","Error","update","tmp"],"mappings":";;;;;;;;;AAAA;;eAEe,kBAACA,GAAD,EAAMC,SAAN,EAAiBC,OAAjB,EAA6B;AAC1C,MAAI,CAACF,GAAD,IAAQA,GAAG,CAACG,MAAJ,IAAc,CAAtB,IAA2BF,SAAS,KAAKG,SAAzC,IAAsDF,OAAO,KAAKE,SAAtE,EAAiF;AAC/E,UAAM,IAAIC,KAAJ,gEAAkEL,GAAlE,eAA0EC,SAA1E,cAAuFC,OAAvF,EAAN;AACD;;AACD,MAAMI,MAAM,GAAG,2BAAUN,GAAV,CAAf;AACA,MAAMO,GAAG,GAAGP,GAAG,CAACE,OAAD,CAAf;AACAI,EAAAA,MAAM,CAACJ,OAAD,CAAN,GAAkBI,MAAM,CAACL,SAAD,CAAxB;AACAK,EAAAA,MAAM,CAACL,SAAD,CAAN,GAAoBM,GAApB;AACA,SAAOD,MAAP;AACD,C","sourcesContent":["import cloneDeep from 'lodash/cloneDeep';\n\nexport default (arr, fromIndex, toIndex) => {\n if (!arr || arr.length <= 1 || fromIndex === undefined || toIndex === undefined) {\n throw new Error(`swap requires a non-empty array, fromIndex, toIndex: ${arr}, ${fromIndex} ${toIndex}`);\n }\n const update = cloneDeep(arr);\n const tmp = arr[toIndex];\n update[toIndex] = update[fromIndex];\n update[fromIndex] = tmp;\n return update;\n};\n"],"file":"swap.js"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/uid-context.js"],"names":["React","createContext","Consumer","Provider","generateId","Math","random","toFixed","withUid","Component","Wrapped","props","uid"],"mappings":";;;;;;;;;;;AAAA;;AAEA,wCAA+BA,kBAAMC,aAAN,CAAoB,CAAC,CAArB,CAA/B;AAAA,IAAQC,QAAR,wBAAQA,QAAR;AAAA,IAAkBC,QAAlB,wBAAkBA,QAAlB;;;;;AAIO,IAAMC,UAAU,GAAG,SAAbA,UAAa;AAAA,SAAM,CAACC,IAAI,CAACC,MAAL,KAAgB,OAAjB,EAA0BC,OAA1B,CAAkC,CAAlC,CAAN;AAAA,CAAnB;;;;AAEA,IAAMC,OAAO,GAAG,SAAVA,OAAU,CAAAC,SAAS,EAAI;AAClC,MAAMC,OAAO,GAAG,SAAVA,OAAU,CAAAC,KAAK;AAAA,wBAAI,gCAAC,QAAD,QAAW,UAAAC,GAAG;AAAA,0BAAI,gCAAC,SAAD,gCAAeD,KAAf;AAAsB,QAAA,GAAG,EAAEC;AAA3B,SAAJ;AAAA,KAAd,CAAJ;AAAA,GAArB;;AACA,SAAOF,OAAP;AACD,CAHM","sourcesContent":["import React from 'react';\n\nconst { Consumer, Provider } = React.createContext(-1);\n\nexport { Provider, Consumer };\n\nexport const generateId = () => (Math.random() * 1000001).toFixed(0);\n\nexport const withUid = Component => {\n const Wrapped = props => <Consumer>{uid => <Component {...props} uid={uid} />}</Consumer>;\n return Wrapped;\n};\n"],"file":"uid-context.js"}
1
+ {"version":3,"sources":["../src/uid-context.js"],"names":["React","createContext","Consumer","Provider","generateId","Math","random","toFixed","withUid","Component","Wrapped","props","uid"],"mappings":";;;;;;;;;;;AAAA;;AAEA,wCAA+BA,kBAAMC,aAAN,CAAoB,CAAC,CAArB,CAA/B;AAAA,IAAQC,QAAR,wBAAQA,QAAR;AAAA,IAAkBC,QAAlB,wBAAkBA,QAAlB;;;;;AAIO,IAAMC,UAAU,GAAG,SAAbA,UAAa;AAAA,SAAM,CAACC,IAAI,CAACC,MAAL,KAAgB,OAAjB,EAA0BC,OAA1B,CAAkC,CAAlC,CAAN;AAAA,CAAnB;;;;AAEA,IAAMC,OAAO,GAAG,SAAVA,OAAU,CAACC,SAAD,EAAe;AACpC,MAAMC,OAAO,GAAG,SAAVA,OAAU,CAACC,KAAD;AAAA,wBAAW,gCAAC,QAAD,QAAW,UAACC,GAAD;AAAA,0BAAS,gCAAC,SAAD,gCAAeD,KAAf;AAAsB,QAAA,GAAG,EAAEC;AAA3B,SAAT;AAAA,KAAX,CAAX;AAAA,GAAhB;;AACA,SAAOF,OAAP;AACD,CAHM","sourcesContent":["import React from 'react';\n\nconst { Consumer, Provider } = React.createContext(-1);\n\nexport { Provider, Consumer };\n\nexport const generateId = () => (Math.random() * 1000001).toFixed(0);\n\nexport const withUid = (Component) => {\n const Wrapped = (props) => <Consumer>{(uid) => <Component {...props} uid={uid} />}</Consumer>;\n return Wrapped;\n};\n"],"file":"uid-context.js"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/with-drag-context.js"],"names":["Component","props","HTML5Backend"],"mappings":";;;;;;;;;AAAA;;AACA;;AAEA;;eAEe,kBAAAA,SAAS;AAAA,SAAI,UAAAC,KAAK;AAAA,wBAC/B,gCAAC,qBAAD;AAAa,MAAA,OAAO,EAAEC;AAAtB,oBACE,gCAAC,SAAD,EAAeD,KAAf,CADF,CAD+B;AAAA,GAAT;AAAA,C","sourcesContent":["import React from 'react';\nimport { HTML5Backend } from 'react-dnd-html5-backend';\n\nimport { DndProvider } from 'react-dnd';\n\nexport default Component => props => (\n <DndProvider backend={HTML5Backend}>\n <Component {...props} />\n </DndProvider>\n);\n"],"file":"with-drag-context.js"}
1
+ {"version":3,"sources":["../src/with-drag-context.js"],"names":["Component","props","HTML5Backend"],"mappings":";;;;;;;;;AAAA;;AACA;;AAEA;;eAEe,kBAACA,SAAD;AAAA,SAAe,UAACC,KAAD;AAAA,wBAC5B,gCAAC,qBAAD;AAAa,MAAA,OAAO,EAAEC;AAAtB,oBACE,gCAAC,SAAD,EAAeD,KAAf,CADF,CAD4B;AAAA,GAAf;AAAA,C","sourcesContent":["import React from 'react';\nimport { HTML5Backend } from 'react-dnd-html5-backend';\n\nimport { DndProvider } from 'react-dnd';\n\nexport default (Component) => (props) => (\n <DndProvider backend={HTML5Backend}>\n <Component {...props} />\n </DndProvider>\n);\n"],"file":"with-drag-context.js"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-lib/drag",
3
- "version": "1.1.53-next.950+67ed9334",
3
+ "version": "2.0.1",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "module": "src/index.js",
@@ -17,5 +17,5 @@
17
17
  "scripts": {},
18
18
  "author": "",
19
19
  "license": "ISC",
20
- "gitHead": "67ed9334c986af832b0a9058b696bc803acd3d74"
20
+ "gitHead": "f81076118e63884db5f5d65a41cff9aad111137e"
21
21
  }
package/src/choice.jsx CHANGED
@@ -13,7 +13,7 @@ export class Choice extends React.Component {
13
13
  classes: PropTypes.object.isRequired,
14
14
  className: PropTypes.string,
15
15
  children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]),
16
- connectDragSource: PropTypes.func.isRequired
16
+ connectDragSource: PropTypes.func.isRequired,
17
17
  };
18
18
 
19
19
  static defaultProps = {};
@@ -21,19 +21,17 @@ export class Choice extends React.Component {
21
21
  render() {
22
22
  const { classes, className, children, connectDragSource } = this.props;
23
23
 
24
- return connectDragSource(
25
- <div className={classNames(classes.choice, className)}>{children}</div>
26
- );
24
+ return connectDragSource(<div className={classNames(classes.choice, className)}>{children}</div>);
27
25
  }
28
26
  }
29
27
 
30
- const styles = theme => ({
28
+ const styles = (theme) => ({
31
29
  choice: {
32
30
  backgroundColor: 'white',
33
31
  border: `solid 1px ${grey[400]}`,
34
32
  padding: theme.spacing.unit,
35
- minHeight: '30px'
36
- }
33
+ minHeight: '30px',
34
+ },
37
35
  });
38
36
 
39
37
  const choiceSource = {
@@ -42,12 +40,12 @@ const choiceSource = {
42
40
  },
43
41
  beginDrag(props) {
44
42
  return props;
45
- }
43
+ },
46
44
  };
47
45
 
48
46
  const styledChoice = withStyles(styles)(Choice);
49
47
 
50
48
  export default DragSource(DRAG_TYPE, choiceSource, (connect, monitor) => ({
51
49
  connectDragSource: connect.dragSource(),
52
- isDragging: monitor.isDragging()
50
+ isDragging: monitor.isDragging(),
53
51
  }))(styledChoice);
@@ -4,14 +4,14 @@ import classNames from 'classnames';
4
4
  import PropTypes from 'prop-types';
5
5
  import grey from '@material-ui/core/colors/grey';
6
6
 
7
- export const PlaceHolder = props => {
7
+ export const PlaceHolder = (props) => {
8
8
  const { children, classes, className, isOver, type, grid, disabled } = props;
9
9
  const names = classNames(
10
10
  classes.placeholder,
11
11
  disabled && classes.disabled,
12
12
  isOver && classes.over,
13
13
  classes[type],
14
- className
14
+ className,
15
15
  );
16
16
 
17
17
  const style = {};
@@ -38,17 +38,17 @@ PlaceHolder.propTypes = {
38
38
  columns: PropTypes.number,
39
39
  rows: PropTypes.number,
40
40
  // if a different value then 1fr is wanted
41
- rowsRepeatValue: PropTypes.string
41
+ rowsRepeatValue: PropTypes.string,
42
42
  }),
43
43
  children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired,
44
44
  className: PropTypes.string,
45
45
  isOver: PropTypes.bool,
46
46
  index: PropTypes.number,
47
47
  type: PropTypes.string,
48
- disabled: PropTypes.bool
48
+ disabled: PropTypes.bool,
49
49
  };
50
50
 
51
- const styles = theme => ({
51
+ const styles = (theme) => ({
52
52
  placeholder: {
53
53
  width: '100%',
54
54
  height: '100%',
@@ -59,16 +59,16 @@ const styles = theme => ({
59
59
  display: 'grid',
60
60
  gridRowGap: `${theme.spacing.unit}px`,
61
61
  gridColumnGap: `${theme.spacing.unit}px`,
62
- padding: theme.spacing.unit * 1
62
+ padding: theme.spacing.unit * 1,
63
63
  },
64
64
  disabled: {
65
65
  boxShadow: 'none',
66
- background: 'white'
66
+ background: 'white',
67
67
  },
68
68
  over: {
69
69
  border: `1px solid ${grey[500]}`,
70
- backgroundColor: `${grey[300]}`
71
- }
70
+ backgroundColor: `${grey[300]}`,
71
+ },
72
72
  });
73
73
 
74
74
  export default withStyles(styles)(PlaceHolder);
package/src/swap.js CHANGED
@@ -2,9 +2,7 @@ import cloneDeep from 'lodash/cloneDeep';
2
2
 
3
3
  export default (arr, fromIndex, toIndex) => {
4
4
  if (!arr || arr.length <= 1 || fromIndex === undefined || toIndex === undefined) {
5
- throw new Error(
6
- `swap requires a non-empty array, fromIndex, toIndex: ${arr}, ${fromIndex} ${toIndex}`
7
- );
5
+ throw new Error(`swap requires a non-empty array, fromIndex, toIndex: ${arr}, ${fromIndex} ${toIndex}`);
8
6
  }
9
7
  const update = cloneDeep(arr);
10
8
  const tmp = arr[toIndex];
@@ -6,7 +6,7 @@ export { Provider, Consumer };
6
6
 
7
7
  export const generateId = () => (Math.random() * 1000001).toFixed(0);
8
8
 
9
- export const withUid = Component => {
10
- const Wrapped = props => <Consumer>{uid => <Component {...props} uid={uid} />}</Consumer>;
9
+ export const withUid = (Component) => {
10
+ const Wrapped = (props) => <Consumer>{(uid) => <Component {...props} uid={uid} />}</Consumer>;
11
11
  return Wrapped;
12
12
  };
@@ -3,7 +3,7 @@ import { HTML5Backend } from 'react-dnd-html5-backend';
3
3
 
4
4
  import { DndProvider } from 'react-dnd';
5
5
 
6
- export default Component => props => (
6
+ export default (Component) => (props) => (
7
7
  <DndProvider backend={HTML5Backend}>
8
8
  <Component {...props} />
9
9
  </DndProvider>