@pie-element/categorize 8.24.5-next.47 → 8.24.5-next.52
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/lib/categorize/choice.js
CHANGED
|
@@ -118,7 +118,7 @@ var styles = function styles(theme) {
|
|
|
118
118
|
},
|
|
119
119
|
cardRoot: {
|
|
120
120
|
color: _renderUi.color.text(),
|
|
121
|
-
backgroundColor: _renderUi.color.
|
|
121
|
+
backgroundColor: _renderUi.color.white(),
|
|
122
122
|
fontSize: theme.typography.fontSize + 2,
|
|
123
123
|
'&:last-child': {
|
|
124
124
|
paddingBottom: theme.spacing.unit * 2
|
|
@@ -136,7 +136,10 @@ var styles = function styles(theme) {
|
|
|
136
136
|
card: {
|
|
137
137
|
color: _renderUi.color.text(),
|
|
138
138
|
backgroundColor: _renderUi.color.background(),
|
|
139
|
-
width: '100%'
|
|
139
|
+
width: '100%',
|
|
140
|
+
// Added for touch devices, for image content.
|
|
141
|
+
// This will prevent the context menu from appearing and not allowing other interactions with the image.
|
|
142
|
+
pointerEvents: 'none'
|
|
140
143
|
}
|
|
141
144
|
};
|
|
142
145
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/categorize/choice.jsx"],"names":["log","ChoiceType","content","PropTypes","string","isRequired","id","Layout","props","classes","className","isDragging","disabled","correct","rootNames","choice","dragging","cardNames","card","root","cardRoot","__html","React","Component","object","bool","styles","theme","direction","cursor","width","border","color","incorrect","borderRadius","text","backgroundColor","
|
|
1
|
+
{"version":3,"sources":["../../src/categorize/choice.jsx"],"names":["log","ChoiceType","content","PropTypes","string","isRequired","id","Layout","props","classes","className","isDragging","disabled","correct","rootNames","choice","dragging","cardNames","card","root","cardRoot","__html","React","Component","object","bool","styles","theme","direction","cursor","width","border","color","incorrect","borderRadius","text","backgroundColor","white","fontSize","typography","paddingBottom","spacing","unit","opacity","background","pointerEvents","Styled","Choice","connectDragSource","extraStyle","margin","func","spec","canDrag","beginDrag","out","categoryId","choiceIndex","value","itemType","endDrag","monitor","didDrop","item","getItem","onRemoveChoice","DraggableChoice","uid","connect","dragSource","withUid"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,IAAMA,GAAG,GAAG,uBAAM,2BAAN,CAAZ;AAEO,IAAMC,UAAU,GAAG;AACxBC,EAAAA,OAAO,EAAEC,sBAAUC,MAAV,CAAiBC,UADF;AAExBC,EAAAA,EAAE,EAAEH,sBAAUC;AAFU,CAAnB;;;IAKMG,M;;;;;;;;;;;;WASX,kBAAS;AACP,wBAAuE,KAAKC,KAA5E;AAAA,UAAQC,OAAR,eAAQA,OAAR;AAAA,UAAiBC,SAAjB,eAAiBA,SAAjB;AAAA,UAA4BR,OAA5B,eAA4BA,OAA5B;AAAA,UAAqCS,UAArC,eAAqCA,UAArC;AAAA,UAAiDC,QAAjD,eAAiDA,QAAjD;AAAA,UAA2DC,OAA3D,eAA2DA,OAA3D;AAEA,UAAMC,SAAS,GAAG,4BAChBD,OAAO,KAAK,IAAZ,IAAoB,SADJ,EAEhBA,OAAO,KAAK,KAAZ,IAAqB,WAFL,EAGhBJ,OAAO,CAACM,MAHQ,EAIhBJ,UAAU,IAAIF,OAAO,CAACO,QAJN,EAKhBJ,QAAQ,IAAIH,OAAO,CAACG,QALJ,EAMhBF,SANgB,CAAlB;AAQA,UAAMO,SAAS,GAAG,4BAAWR,OAAO,CAACS,IAAnB,CAAlB;AACA,0BACE;AAAK,QAAA,SAAS,EAAEJ;AAAhB,sBACE,gCAAC,gBAAD;AAAM,QAAA,SAAS,EAAEG;AAAjB,sBACE,gCAAC,uBAAD;AAAa,QAAA,OAAO,EAAE;AAAEE,UAAAA,IAAI,EAAEV,OAAO,CAACW;AAAhB,SAAtB;AAAkD,QAAA,uBAAuB,EAAE;AAAEC,UAAAA,MAAM,EAAEnB;AAAV;AAA3E,QADF,CAD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EAAEE,KAAK,CAACF,EADA;AAEVkD,MAAAA,UAAU,EAAEhD,KAAK,CAACgD,UAFR;AAGVC,MAAAA,WAAW,EAAEjD,KAAK,CAACiD,WAHT;AAIVC,MAAAA,KAAK,EAAElD,KAAK,CAACN,OAJH;AAKVyD,MAAAA,QAAQ,EAAE;AALA,KAAZ;AAOA3D,IAAAA,GAAG,CAAC,kBAAD,EAAqBuD,GAArB,CAAH;AACA,WAAOA,GAAP;AACD,GAZiB;AAalBK,EAAAA,OAAO,EAAE,iBAACpD,KAAD,EAAQqD,OAAR,EAAoB;AAC3B,QAAI,CAACA,OAAO,CAACC,OAAR,EAAL,EAAwB;AACtB,UAAMC,IAAI,GAAGF,OAAO,CAACG,OAAR,EAAb;;AACA,UAAID,IAAI,CAACP,UAAT,EAAqB;AACnBxD,QAAAA,GAAG,CAAC,8BAAD,CAAH;AACAQ,QAAAA,KAAK,CAACyD,cAAN,CAAqBF,IAArB;AACD;AACF;AACF;AArBiB,CAAb;;AAwBP,IAAMG,eAAe,GAAG,0BACtB;AAAA,MAAGC,GAAH,QAAGA,GAAH;AAAA,SAAaA,GAAb;AAAA,CADsB,EAEtBf,IAFsB,EAGtB,UAACgB,OAAD,EAAUP,OAAV;AAAA,SAAuB;AACrBb,IAAAA,iBAAiB,EAAEoB,OAAO,CAACC,UAAR,EADE;AAErB1D,IAAAA,UAAU,EAAEkD,OAAO,CAAClD,UAAR;AAFS,GAAvB;AAAA,CAHsB,EAOtBoC,MAPsB,CAAxB;;eASeoB,UAAIG,OAAJ,CAAYJ,eAAZ,C","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@material-ui/core/styles';\nimport classNames from 'classnames';\nimport { DragSource } from 'react-dnd';\nimport { uid } from '@pie-lib/pie-toolbox/drag';\nimport Card from '@material-ui/core/Card';\nimport CardContent from '@material-ui/core/CardContent';\nimport { color } from '@pie-lib/pie-toolbox/render-ui';\nimport debug from 'debug';\n\nconst log = debug('@pie-ui:categorize:choice');\n\nexport const ChoiceType = {\n content: PropTypes.string.isRequired,\n id: PropTypes.string,\n};\n\nexport class Layout extends React.Component {\n static propTypes = {\n ...ChoiceType,\n classes: PropTypes.object.isRequired,\n className: PropTypes.string,\n disabled: PropTypes.bool,\n correct: PropTypes.bool,\n };\n static defaultProps = {};\n render() {\n const { classes, className, content, isDragging, disabled, correct } = this.props;\n\n const rootNames = classNames(\n correct === true && 'correct',\n correct === false && 'incorrect',\n classes.choice,\n isDragging && classes.dragging,\n disabled && classes.disabled,\n className,\n );\n const cardNames = classNames(classes.card);\n return (\n <div className={rootNames}>\n <Card className={cardNames}>\n <CardContent classes={{ root: classes.cardRoot }} dangerouslySetInnerHTML={{ __html: content }} />\n </Card>\n </div>\n );\n }\n}\n\nconst styles = (theme) => ({\n choice: {\n direction: 'initial',\n cursor: 'pointer',\n width: '100%',\n '&.correct': {\n border: `solid 2px ${color.correct()}`,\n },\n '&.incorrect': {\n border: `solid 2px ${color.incorrect()}`,\n },\n borderRadius: '6px',\n },\n cardRoot: {\n color: color.text(),\n backgroundColor: color.white(),\n fontSize: theme.typography.fontSize + 2,\n '&:last-child': {\n paddingBottom: theme.spacing.unit * 2,\n },\n borderRadius: '4px',\n border: '1px solid',\n },\n disabled: {\n cursor: 'not-allowed',\n opacity: '0.6',\n },\n dragging: {\n cursor: 'move',\n },\n card: {\n color: color.text(),\n backgroundColor: color.background(),\n width: '100%',\n // Added for touch devices, for image content.\n // This will prevent the context menu from appearing and not allowing other interactions with the image.\n pointerEvents: 'none',\n },\n});\n\nconst Styled = withStyles(styles)(Layout);\n\nexport class Choice extends React.Component {\n static propTypes = {\n ...ChoiceType,\n extraStyle: PropTypes.object,\n connectDragSource: PropTypes.func.isRequired,\n };\n\n render() {\n const { connectDragSource, id, content, disabled, isDragging, correct, extraStyle } = this.props;\n\n return connectDragSource(\n <div style={{ margin: '4px', ...extraStyle }}>\n <Styled id={id} content={content} disabled={disabled} correct={correct} isDragging={isDragging} />\n </div>,\n );\n }\n}\n\nexport const spec = {\n canDrag: (props) => !props.disabled,\n beginDrag: (props) => {\n const out = {\n id: props.id,\n categoryId: props.categoryId,\n choiceIndex: props.choiceIndex,\n value: props.content,\n itemType: 'categorize'\n };\n log('[beginDrag] out:', out);\n return out;\n },\n endDrag: (props, monitor) => {\n if (!monitor.didDrop()) {\n const item = monitor.getItem();\n if (item.categoryId) {\n log('wasnt droppped - what to do?');\n props.onRemoveChoice(item);\n }\n }\n },\n};\n\nconst DraggableChoice = DragSource(\n ({ uid }) => uid,\n spec,\n (connect, monitor) => ({\n connectDragSource: connect.dragSource(),\n isDragging: monitor.isDragging(),\n }),\n)(Choice);\n\nexport default uid.withUid(DraggableChoice);\n"],"file":"choice.js"}
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "8.24.5-next.
|
|
7
|
+
"version": "8.24.5-next.52+d0f538ee2",
|
|
8
8
|
"description": "",
|
|
9
9
|
"author": "pie framework developers",
|
|
10
10
|
"license": "ISC",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"react-dnd": "^14.0.5",
|
|
21
21
|
"react-dom": "^16.8.1"
|
|
22
22
|
},
|
|
23
|
-
"gitHead": "
|
|
23
|
+
"gitHead": "d0f538ee2c816e3919f4b7cb1fff76de024f7c67",
|
|
24
24
|
"scripts": {
|
|
25
25
|
"postpublish": "../../scripts/postpublish"
|
|
26
26
|
},
|