@pie-element/categorize 11.3.4-next.0 → 12.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/configure/lib/defaults.js +2 -5
  2. package/configure/lib/defaults.js.map +1 -1
  3. package/configure/lib/design/builder.js +15 -33
  4. package/configure/lib/design/builder.js.map +1 -1
  5. package/configure/lib/design/buttons.js +41 -95
  6. package/configure/lib/design/buttons.js.map +1 -1
  7. package/configure/lib/design/categories/RowLabel.js +32 -45
  8. package/configure/lib/design/categories/RowLabel.js.map +1 -1
  9. package/configure/lib/design/categories/alternateResponses.js +96 -251
  10. package/configure/lib/design/categories/alternateResponses.js.map +1 -1
  11. package/configure/lib/design/categories/category.js +135 -208
  12. package/configure/lib/design/categories/category.js.map +1 -1
  13. package/configure/lib/design/categories/choice-preview.js +61 -126
  14. package/configure/lib/design/categories/choice-preview.js.map +1 -1
  15. package/configure/lib/design/categories/droppable-placeholder.js +73 -165
  16. package/configure/lib/design/categories/droppable-placeholder.js.map +1 -1
  17. package/configure/lib/design/categories/index.js +195 -384
  18. package/configure/lib/design/categories/index.js.map +1 -1
  19. package/configure/lib/design/choices/choice.js +155 -264
  20. package/configure/lib/design/choices/choice.js.map +1 -1
  21. package/configure/lib/design/choices/config.js +42 -98
  22. package/configure/lib/design/choices/config.js.map +1 -1
  23. package/configure/lib/design/choices/index.js +148 -236
  24. package/configure/lib/design/choices/index.js.map +1 -1
  25. package/configure/lib/design/header.js +57 -111
  26. package/configure/lib/design/header.js.map +1 -1
  27. package/configure/lib/design/index.js +631 -476
  28. package/configure/lib/design/index.js.map +1 -1
  29. package/configure/lib/design/input-header.js +93 -149
  30. package/configure/lib/design/input-header.js.map +1 -1
  31. package/configure/lib/design/utils.js +4 -15
  32. package/configure/lib/design/utils.js.map +1 -1
  33. package/configure/lib/index.js +120 -183
  34. package/configure/lib/index.js.map +1 -1
  35. package/configure/lib/main.js +30 -74
  36. package/configure/lib/main.js.map +1 -1
  37. package/configure/lib/utils.js +22 -32
  38. package/configure/lib/utils.js.map +1 -1
  39. package/configure/package.json +15 -15
  40. package/controller/lib/defaults.js +2 -5
  41. package/controller/lib/defaults.js.map +1 -1
  42. package/controller/lib/index.js +237 -318
  43. package/controller/lib/index.js.map +1 -1
  44. package/controller/lib/utils.js +28 -65
  45. package/controller/lib/utils.js.map +1 -1
  46. package/controller/package.json +5 -5
  47. package/lib/categorize/categories.js +106 -164
  48. package/lib/categorize/categories.js.map +1 -1
  49. package/lib/categorize/category.js +73 -123
  50. package/lib/categorize/category.js.map +1 -1
  51. package/lib/categorize/choice.js +118 -245
  52. package/lib/categorize/choice.js.map +1 -1
  53. package/lib/categorize/choices.js +66 -131
  54. package/lib/categorize/choices.js.map +1 -1
  55. package/lib/categorize/droppable-placeholder.js +46 -103
  56. package/lib/categorize/droppable-placeholder.js.map +1 -1
  57. package/lib/categorize/grid-content.js +39 -87
  58. package/lib/categorize/grid-content.js.map +1 -1
  59. package/lib/categorize/index.js +341 -317
  60. package/lib/categorize/index.js.map +1 -1
  61. package/lib/index.js +285 -306
  62. package/lib/index.js.map +1 -1
  63. package/package.json +16 -14
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/design/categories/index.jsx"],"names":["styles","theme","categories","marginBottom","spacing","unit","categoriesHolder","display","gridRowGap","gridColumnGap","row","gridTemplateColumns","alignItems","width","marginTop","rowLabel","gridColumn","rowLabelHolder","tooltip","fontSize","typography","whiteSpace","maxWidth","errorText","color","palette","error","main","paddingTop","Categories","focusedEl","props","model","oldCategories","categoriesPerRow","correctResponse","allowAlternateEnabled","id","utils","firstAvailableIndex","map","a","data","label","addRowLabel","length","rowLabels","push","setState","onModelChanged","concat","category","choices","alternateResponses","index","findIndex","splice","c","addedChoice","categoryId","maxChoicesPerCategory","choice","find","undefined","categoryCount","maxCategoryChoices","choiceIndex","choiceId","from","to","val","newRowLabels","domNode","ReactDOM","findDOMNode","e","console","classes","className","imageSupport","uploadSoundSupport","toolbarOpts","spellCheck","configuration","defaultImageMaxHeight","defaultImageMaxWidth","mathMlOptions","errors","associationError","categoriesError","categoriesErrors","maxCategories","maxImageWidth","maxImageHeight","holderStyle","validationMessage","add","marginLeft","hasRowLabel","rowIndex","changeRowLabel","state","deleteFocusedEl","change","addChoiceToCategory","moveChoice","deleteChoiceFromCategory","categoryLabel","React","Component","PropTypes","number","shape","func","isRequired","object","string","array","bool"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAOA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,IAAMA,MAAM,GAAG,SAATA,MAAS,CAACC,KAAD;AAAA,SAAY;AACzBC,IAAAA,UAAU,EAAE;AACVC,MAAAA,YAAY,EAAEF,KAAK,CAACG,OAAN,CAAcC,IAAd,GAAqB;AADzB,KADa;AAIzBC,IAAAA,gBAAgB,EAAE;AAChBC,MAAAA,OAAO,EAAE,MADO;AAEhBC,MAAAA,UAAU,YAAKP,KAAK,CAACG,OAAN,CAAcC,IAAnB,OAFM;AAGhBI,MAAAA,aAAa,YAAKR,KAAK,CAACG,OAAN,CAAcC,IAAnB;AAHG,KAJO;AASzBK,IAAAA,GAAG,EAAE;AACHH,MAAAA,OAAO,EAAE,MADN;AAEHI,MAAAA,mBAAmB,EAAE,gBAFlB;AAGHF,MAAAA,aAAa,YAAKR,KAAK,CAACG,OAAN,CAAcC,IAAnB,OAHV;AAIHO,MAAAA,UAAU,EAAE,UAJT;AAKHC,MAAAA,KAAK,EAAE,MALJ;AAMHC,MAAAA,SAAS,EAAEb,KAAK,CAACG,OAAN,CAAcC,IANtB;AAOHF,MAAAA,YAAY,EAAE,IAAIF,KAAK,CAACG,OAAN,CAAcC;AAP7B,KAToB;AAkBzBU,IAAAA,QAAQ,EAAE;AACRC,MAAAA,UAAU,EAAE;AADJ,KAlBe;AAqBzBC,IAAAA,cAAc,EAAE;AACdJ,MAA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AAA,kBAAkB,EAAE8B,sBAAUE,KAAV,CAAgB;AAClChB,IAAAA,GAAG,EAAEc,sBAAUG,IAAV,CAAeC,UADc;AAElC,cAAQJ,sBAAUG,IAAV,CAAeC;AAFW,GAAhB,CAPH;AAWjBrC,EAAAA,OAAO,EAAEiC,sBAAUK,MAAV,CAAiBD,UAXT;AAYjBpC,EAAAA,SAAS,EAAEgC,sBAAUM,MAZJ;AAajBlH,EAAAA,UAAU,EAAE4G,sBAAUO,KAbL;AAcjBpE,EAAAA,cAAc,EAAE6D,sBAAUG,IAdT;AAejBjF,EAAAA,KAAK,EAAE8E,sBAAUK,MAAV,CAAiBD,UAfP;AAgBjB/B,EAAAA,aAAa,EAAE2B,sBAAUK,MAAV,CAAiBD,UAhBf;AAiBjBjC,EAAAA,WAAW,EAAE6B,sBAAUK,MAjBN;AAkBjBjC,EAAAA,UAAU,EAAE4B,sBAAUQ;AAlBL,C;;eAoRN,wBAAWtH,MAAX,EAAmB6B,UAAnB,C","sourcesContent":["import React from 'react';\nimport ReactDOM from 'react-dom';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@material-ui/core/styles';\nimport { choiceUtils as utils } from '@pie-lib/config-ui';\nimport classNames from 'classnames';\nimport Info from '@material-ui/icons/Info';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport {\n moveChoiceToCategory,\n removeCategory,\n removeChoiceFromCategory,\n verifyAllowMultiplePlacements,\n} from '@pie-lib/categorize';\n\nimport Category from './category';\nimport Header from '../header';\nimport { generateValidationMessage, getMaxCategoryChoices } from '../../utils';\nimport { RowLabel } from './RowLabel';\nimport { renderMath } from '@pie-lib/math-rendering';\n\nconst styles = (theme) => ({\n categories: {\n marginBottom: theme.spacing.unit * 3,\n },\n categoriesHolder: {\n display: 'grid',\n gridRowGap: `${theme.spacing.unit}px`,\n gridColumnGap: `${theme.spacing.unit}px`,\n },\n row: {\n display: 'grid',\n gridTemplateColumns: 'repeat(2, 1fr)',\n gridColumnGap: `${theme.spacing.unit}px`,\n alignItems: 'baseline',\n width: '100%',\n marginTop: theme.spacing.unit,\n marginBottom: 2 * theme.spacing.unit,\n },\n rowLabel: {\n gridColumn: '1/3',\n },\n rowLabelHolder: {\n width: '100%',\n },\n tooltip: {\n fontSize: theme.typography.fontSize - 2,\n whiteSpace: 'pre',\n maxWidth: '500px',\n },\n errorText: {\n fontSize: theme.typography.fontSize - 2,\n color: theme.palette.error.main,\n paddingTop: theme.spacing.unit / 2,\n },\n});\n\nexport class Categories extends React.Component {\n static propTypes = {\n defaultImageMaxHeight: PropTypes.number,\n defaultImageMaxWidth: PropTypes.number,\n imageSupport: PropTypes.shape({\n add: PropTypes.func.isRequired,\n delete: PropTypes.func.isRequired,\n }),\n uploadSoundSupport: PropTypes.shape({\n add: PropTypes.func.isRequired,\n delete: PropTypes.func.isRequired,\n }),\n classes: PropTypes.object.isRequired,\n className: PropTypes.string,\n categories: PropTypes.array,\n onModelChanged: PropTypes.func,\n model: PropTypes.object.isRequired,\n configuration: PropTypes.object.isRequired,\n toolbarOpts: PropTypes.object,\n spellCheck: PropTypes.bool,\n };\n\n state = {\n focusedEl: null,\n };\n\n componentDidMount() {\n try {\n // eslint-disable-next-line react/no-find-dom-node\n const domNode = ReactDOM.findDOMNode(this);\n\n renderMath(domNode);\n } catch (e) {\n // Added try-catch block to handle \"Unable to find node on an unmounted component\" error from tests, thrown because of the usage of shallow\n console.error('DOM not mounted');\n }\n }\n\n componentDidUpdate() {\n try {\n // eslint-disable-next-line react/no-find-dom-node\n const domNode = ReactDOM.findDOMNode(this);\n\n renderMath(domNode);\n } catch (e) {\n // Added try-catch block to handle \"Unable to find node on an unmounted component\" error from tests, thrown because of the usage of shallow\n console.error('DOM not mounted');\n }\n }\n\n add = () => {\n const { model, categories: oldCategories } = this.props;\n const { categoriesPerRow, correctResponse, allowAlternateEnabled } = model;\n\n const id = utils.firstAvailableIndex(\n model.categories.map((a) => a.id),\n 1,\n );\n const data = { id, label: 'Category ' + id };\n const addRowLabel = model.categories.length % categoriesPerRow === 0;\n const rowLabels = [...model.rowLabels];\n\n if (addRowLabel) {\n rowLabels.push('');\n }\n\n this.setState(\n {\n focusedEl: oldCategories.length,\n },\n () => {\n this.props.onModelChanged({\n rowLabels,\n categories: model.categories.concat([data]),\n correctResponse: allowAlternateEnabled\n ? [...correctResponse, { category: id, choices: [], alternateResponses: [] }]\n : correctResponse,\n });\n },\n );\n };\n\n deleteFocusedEl = () => {\n this.setState({\n focusedEl: null,\n });\n };\n\n delete = (category) => {\n const { model, onModelChanged } = this.props;\n const index = model.categories.findIndex((a) => a.id === category.id);\n\n if (index !== -1) {\n model.categories.splice(index, 1);\n model.correctResponse = removeCategory(category.id, model.correctResponse);\n onModelChanged(model);\n }\n };\n\n change = (c) => {\n const { categories } = this.props;\n const index = categories.findIndex((a) => a.id === c.id);\n\n if (index !== -1) {\n categories.splice(index, 1, c);\n this.props.onModelChanged({ categories });\n }\n };\n\n addChoiceToCategory = (addedChoice, categoryId) => {\n const { model, onModelChanged } = this.props;\n let { choices = [], correctResponse = [], maxChoicesPerCategory = 0 } = model || {};\n const choice = (choices || []).find((choice) => choice.id === addedChoice.id);\n correctResponse = moveChoiceToCategory(addedChoice.id, undefined, categoryId, 0, model.correctResponse);\n // if multiplePlacements not allowed, ensure the consistency in the other categories\n if (choice.categoryCount !== 0) {\n correctResponse = verifyAllowMultiplePlacements(addedChoice, categoryId, correctResponse);\n }\n const maxCategoryChoices = getMaxCategoryChoices(model);\n // when maxChoicesPerCategory is set to 0, there is no limit so it should not be updated\n onModelChanged({\n correctResponse,\n maxChoicesPerCategory:\n maxChoicesPerCategory !== 0 && maxChoicesPerCategory < maxCategoryChoices\n ? maxChoicesPerCategory + 1\n : maxChoicesPerCategory,\n });\n };\n\n deleteChoiceFromCategory = (category, choice, choiceIndex) => {\n const { model, onModelChanged } = this.props;\n const correctResponse = removeChoiceFromCategory(choice.id, category.id, choiceIndex, model.correctResponse);\n\n onModelChanged({ correctResponse });\n };\n\n moveChoice = (choiceId, from, to, choiceIndex) => {\n const { model, onModelChanged } = this.props;\n let { choices, correctResponse = [], maxChoicesPerCategory = 0 } = model || {};\n const choice = (choices || []).find((choice) => choice.id === choiceId);\n if (to === from || !choice) {\n return;\n }\n if (choice.categoryCount !== 0) {\n correctResponse = moveChoiceToCategory(choice.id, from, to, choiceIndex, correctResponse);\n correctResponse = verifyAllowMultiplePlacements(choice, to, correctResponse);\n } else if (choice.categoryCount === 0) {\n correctResponse = moveChoiceToCategory(choice.id, undefined, to, 0, correctResponse);\n }\n const maxCategoryChoices = getMaxCategoryChoices(model);\n // when maxChoicesPerCategory is set to 0, there is no limit so it should not be updated\n onModelChanged({\n correctResponse,\n maxChoicesPerCategory:\n maxChoicesPerCategory !== 0 && maxChoicesPerCategory < maxCategoryChoices\n ? maxChoicesPerCategory + 1\n : maxChoicesPerCategory,\n });\n };\n\n changeRowLabel = (val, index) => {\n const { model } = this.props;\n const { rowLabels } = model;\n const newRowLabels = [...rowLabels];\n\n if (newRowLabels.length < index) {\n newRowLabels.push(val);\n } else {\n newRowLabels[index] = val;\n }\n\n this.props.onModelChanged({\n rowLabels: newRowLabels,\n });\n };\n\n render() {\n const {\n model,\n classes,\n className,\n categories,\n imageSupport,\n uploadSoundSupport,\n toolbarOpts,\n spellCheck,\n configuration,\n defaultImageMaxHeight,\n defaultImageMaxWidth,\n mathMlOptions = {},\n } = this.props;\n\n const { categoriesPerRow, rowLabels, errors } = model;\n const { associationError, categoriesError, categoriesErrors } = errors || {};\n const { maxCategories, maxImageWidth = {}, maxImageHeight = {} } = configuration || {};\n const holderStyle = {\n gridTemplateColumns: `repeat(${categoriesPerRow}, 1fr)`,\n };\n\n const validationMessage = generateValidationMessage(configuration);\n\n return (\n <div className={classNames(classes.categories, className)}>\n <Header\n label=\"Categories\"\n buttonLabel=\"ADD A CATEGORY\"\n onAdd={this.add}\n info={\n <Tooltip\n classes={{ tooltip: classes.tooltip }}\n disableFocusListener\n disableTouchListener\n placement={'right'}\n title={validationMessage}\n >\n <Info fontSize={'small'} color={'primary'} style={{ marginLeft: '5px' }} />\n </Tooltip>\n }\n buttonDisabled={maxCategories && categories && maxCategories === categories.length}\n />\n\n <div className={classes.categoriesHolder} style={holderStyle}>\n {categories.map((category, index) => {\n const hasRowLabel = index % categoriesPerRow === 0;\n const rowIndex = index / categoriesPerRow;\n\n return (\n <React.Fragment key={index}>\n {hasRowLabel && (\n <RowLabel\n categoriesPerRow={categoriesPerRow}\n disabled={false}\n rowIndex={rowIndex}\n markup={rowLabels[rowIndex] || ''}\n onChange={(val) => this.changeRowLabel(val, rowIndex)}\n imageSupport={imageSupport}\n toolbarOpts={toolbarOpts}\n spellCheck={spellCheck}\n maxImageWidth={(maxImageWidth && maxImageWidth.rowLabel) || defaultImageMaxWidth}\n maxImageHeight={(maxImageHeight && maxImageHeight.rowLabel) || defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\n mathMlOptions={mathMlOptions}\n configuration={configuration}\n />\n )}\n\n <Category\n imageSupport={imageSupport}\n focusedEl={this.state.focusedEl}\n deleteFocusedEl={this.deleteFocusedEl}\n index={index}\n category={category}\n error={categoriesErrors && categoriesErrors[category.id]}\n onChange={this.change}\n onDelete={() => this.delete(category)}\n onAddChoice={this.addChoiceToCategory}\n onMoveChoice={(choiceId, from, to, choiceIndex) => this.moveChoice(choiceId, from, to, choiceIndex)}\n toolbarOpts={toolbarOpts}\n spellCheck={spellCheck}\n onDeleteChoice={(choice, choiceIndex) => this.deleteChoiceFromCategory(category, choice, choiceIndex)}\n maxImageWidth={(maxImageWidth && maxImageWidth.categoryLabel) || defaultImageMaxWidth}\n maxImageHeight={(maxImageHeight && maxImageHeight.categoryLabel) || defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\n configuration={configuration}\n />\n </React.Fragment>\n );\n })}\n </div>\n\n {associationError && <div className={classes.errorText}>{associationError}</div>}\n {categoriesError && <div className={classes.errorText}>{categoriesError}</div>}\n </div>\n );\n }\n}\n\nexport default withStyles(styles)(Categories);\n"],"file":"index.js"}
1
+ {"version":3,"file":"index.js","names":["_react","_interopRequireDefault","require","_propTypes","_styles","_configUi","_Info","_Tooltip","_categorize","_category","_header","_utils","_RowLabel","CategoriesContainer","styled","theme","marginBottom","spacing","CategoriesHolder","display","gridRowGap","gridColumnGap","StyledTooltip","Tooltip","fontSize","typography","whiteSpace","maxWidth","ErrorText","color","palette","error","main","paddingTop","Categories","React","Component","constructor","args","_defineProperty2","default","focusedEl","model","categories","oldCategories","props","categoriesPerRow","correctResponse","allowAlternateEnabled","id","utils","firstAvailableIndex","map","a","data","label","addRowLabel","length","rowLabels","push","setState","onModelChanged","concat","category","choices","alternateResponses","index","findIndex","splice","removeCategory","c","choice","choiceIndex","removeChoiceFromCategory","val","newRowLabels","render","imageSupport","uploadSoundSupport","toolbarOpts","spellCheck","configuration","defaultImageMaxHeight","defaultImageMaxWidth","mathMlOptions","errors","associationError","categoriesError","categoriesErrors","maxCategories","maxImageWidth","maxImageHeight","holderStyle","gridTemplateColumns","validationMessage","generateValidationMessage","createElement","buttonLabel","onAdd","add","info","disableFocusListener","disableTouchListener","placement","title","style","marginLeft","buttonDisabled","hasRowLabel","rowIndex","Fragment","key","RowLabel","disabled","markup","onChange","changeRowLabel","rowLabel","state","deleteFocusedEl","change","onDelete","delete","onDeleteChoice","deleteChoiceFromCategory","categoryLabel","alternateResponseIndex","undefined","exports","PropTypes","number","shape","func","isRequired","array","object","bool","_default"],"sources":["../../../src/design/categories/index.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { styled } from '@mui/material/styles';\nimport { choiceUtils as utils } from '@pie-lib/config-ui';\nimport Info from '@mui/icons-material/Info';\nimport Tooltip from '@mui/material/Tooltip';\nimport {\n removeCategory,\n removeChoiceFromCategory,\n} from '@pie-lib/categorize';\n\nimport Category from './category';\nimport Header from '../header';\nimport { generateValidationMessage } from '../../utils';\nimport { RowLabel } from './RowLabel';\n\nconst CategoriesContainer = styled('div')(({ theme }) => ({\n marginBottom: theme.spacing(3),\n}));\n\nconst CategoriesHolder = styled('div')(({ theme }) => ({\n display: 'grid',\n gridRowGap: `${theme.spacing(1)}px`,\n gridColumnGap: `${theme.spacing(1)}px`,\n}));\n\nconst StyledTooltip = styled(Tooltip)(({ theme }) => ({\n '& .MuiTooltip-tooltip': {\n fontSize: theme.typography.fontSize - 2,\n whiteSpace: 'pre',\n maxWidth: '500px',\n },\n}));\n\nconst ErrorText = styled('div')(({ theme }) => ({\n fontSize: theme.typography.fontSize - 2,\n color: theme.palette.error.main,\n paddingTop: theme.spacing(0.5),\n}));\n\nexport class Categories extends React.Component {\n static propTypes = {\n defaultImageMaxHeight: PropTypes.number,\n defaultImageMaxWidth: PropTypes.number,\n imageSupport: PropTypes.shape({\n add: PropTypes.func.isRequired,\n delete: PropTypes.func.isRequired,\n }),\n uploadSoundSupport: PropTypes.shape({\n add: PropTypes.func.isRequired,\n delete: PropTypes.func.isRequired,\n }),\n categories: PropTypes.array,\n onModelChanged: PropTypes.func,\n model: PropTypes.object.isRequired,\n configuration: PropTypes.object.isRequired,\n toolbarOpts: PropTypes.object,\n spellCheck: PropTypes.bool,\n };\n\n state = {\n focusedEl: null,\n };\n\n add = () => {\n const { model, categories: oldCategories } = this.props;\n const { categoriesPerRow, correctResponse, allowAlternateEnabled } = model;\n\n const id = utils.firstAvailableIndex(\n model.categories.map((a) => a.id),\n 1,\n );\n const data = { id, label: 'Category ' + id };\n const addRowLabel = model.categories.length % categoriesPerRow === 0;\n const rowLabels = [...model.rowLabels];\n\n if (addRowLabel) {\n rowLabels.push('');\n }\n\n this.setState(\n {\n focusedEl: oldCategories.length,\n },\n () => {\n this.props.onModelChanged({\n rowLabels,\n categories: model.categories.concat([data]),\n correctResponse: allowAlternateEnabled\n ? [...correctResponse, { category: id, choices: [], alternateResponses: [] }]\n : correctResponse,\n });\n },\n );\n };\n\n deleteFocusedEl = () => {\n this.setState({\n focusedEl: null,\n });\n };\n\n delete = (category) => {\n const { model, onModelChanged } = this.props;\n const index = model.categories.findIndex((a) => a.id === category.id);\n\n if (index !== -1) {\n model.categories.splice(index, 1);\n model.correctResponse = removeCategory(category.id, model.correctResponse);\n onModelChanged(model);\n }\n };\n\n change = (c) => {\n const { categories } = this.props;\n const index = categories.findIndex((a) => a.id === c.id);\n\n if (index !== -1) {\n categories.splice(index, 1, c);\n this.props.onModelChanged({ categories });\n }\n };\n\n deleteChoiceFromCategory = (category, choice, choiceIndex) => {\n const { model, onModelChanged } = this.props;\n const correctResponse = removeChoiceFromCategory(choice.id, category.id, choiceIndex, model.correctResponse);\n\n onModelChanged({ correctResponse });\n };\n\n changeRowLabel = (val, index) => {\n const { model } = this.props;\n const { rowLabels } = model;\n const newRowLabels = [...rowLabels];\n\n if (newRowLabels.length < index) {\n newRowLabels.push(val);\n } else {\n newRowLabels[index] = val;\n }\n\n this.props.onModelChanged({\n rowLabels: newRowLabels,\n });\n };\n\n render() {\n const {\n model,\n categories,\n imageSupport,\n uploadSoundSupport,\n toolbarOpts,\n spellCheck,\n configuration,\n defaultImageMaxHeight,\n defaultImageMaxWidth,\n mathMlOptions = {},\n } = this.props;\n\n const { categoriesPerRow, rowLabels, errors } = model;\n const { associationError, categoriesError, categoriesErrors } = errors || {};\n const { maxCategories, maxImageWidth = {}, maxImageHeight = {} } = configuration || {};\n const holderStyle = {\n gridTemplateColumns: `repeat(${categoriesPerRow}, 1fr)`,\n };\n\n const validationMessage = generateValidationMessage(configuration);\n\n return (\n <CategoriesContainer>\n <Header\n label=\"Categories\"\n buttonLabel=\"ADD A CATEGORY\"\n onAdd={this.add}\n info={\n <StyledTooltip\n disableFocusListener\n disableTouchListener\n placement={'right'}\n title={validationMessage}\n >\n <Info fontSize={'small'} color={'primary'} style={{ marginLeft: '5px' }} />\n </StyledTooltip>\n }\n buttonDisabled={maxCategories && categories && maxCategories === categories.length}\n />\n\n <CategoriesHolder style={holderStyle}>\n {categories.map((category, index) => {\n const hasRowLabel = index % categoriesPerRow === 0;\n const rowIndex = index / categoriesPerRow;\n\n return (\n <React.Fragment key={index}>\n {hasRowLabel && (\n <RowLabel\n categoriesPerRow={categoriesPerRow}\n disabled={false}\n rowIndex={rowIndex}\n markup={rowLabels[rowIndex] || ''}\n onChange={(val) => this.changeRowLabel(val, rowIndex)}\n imageSupport={imageSupport}\n toolbarOpts={toolbarOpts}\n spellCheck={spellCheck}\n maxImageWidth={(maxImageWidth && maxImageWidth.rowLabel) || defaultImageMaxWidth}\n maxImageHeight={(maxImageHeight && maxImageHeight.rowLabel) || defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\n mathMlOptions={mathMlOptions}\n configuration={configuration}\n />\n )}\n\n <Category\n imageSupport={imageSupport}\n focusedEl={this.state.focusedEl}\n deleteFocusedEl={this.deleteFocusedEl}\n index={index}\n category={category}\n error={categoriesErrors && categoriesErrors[category.id]}\n onChange={this.change}\n onDelete={() => this.delete(category)}\n toolbarOpts={toolbarOpts}\n spellCheck={spellCheck}\n onDeleteChoice={(choice, choiceIndex) => this.deleteChoiceFromCategory(category, choice, choiceIndex)}\n maxImageWidth={(maxImageWidth && maxImageWidth.categoryLabel) || defaultImageMaxWidth}\n maxImageHeight={(maxImageHeight && maxImageHeight.categoryLabel) || defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\n configuration={configuration}\n alternateResponseIndex={undefined}\n />\n </React.Fragment>\n );\n })}\n </CategoriesHolder>\n\n {associationError && <ErrorText>{associationError}</ErrorText>}\n {categoriesError && <ErrorText>{categoriesError}</ErrorText>}\n </CategoriesContainer>\n );\n }\n}\n\nexport default Categories;\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,QAAA,GAAAN,s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AAEkD,kBAAS,CAACM,MAAM;EAC7BvD,UAAU,EAAEiD,kBAAS,CAACO;AACxB,CAAC;AAAA,IAAAC,QAAA,GAAAT,OAAA,CAAAxF,OAAA,GAyLYN,UAAU","ignoreList":[]}
@@ -1,295 +1,186 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
- exports.specTarget = exports.spec = exports["default"] = exports.Choice = void 0;
9
-
10
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
11
-
12
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
13
-
14
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
15
-
16
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
17
-
18
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
19
-
20
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
21
-
22
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
23
-
7
+ exports.default = void 0;
8
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
24
9
  var _react = _interopRequireDefault(require("react"));
25
-
26
10
  var _propTypes = _interopRequireDefault(require("prop-types"));
27
-
28
- var _styles = require("@material-ui/core/styles");
29
-
30
- var _classnames = _interopRequireDefault(require("classnames"));
31
-
32
- var _Card = _interopRequireDefault(require("@material-ui/core/Card"));
33
-
34
- var _CardActions = _interopRequireDefault(require("@material-ui/core/CardActions"));
35
-
11
+ var _styles = require("@mui/material/styles");
12
+ var _Card = _interopRequireDefault(require("@mui/material/Card"));
13
+ var _CardActions = _interopRequireDefault(require("@mui/material/CardActions"));
36
14
  var _inputHeader = _interopRequireDefault(require("../input-header"));
37
-
38
15
  var _configUi = require("@pie-lib/config-ui");
39
-
40
16
  var _buttons = require("../buttons");
41
-
42
- var _DragHandle = _interopRequireDefault(require("@material-ui/icons/DragHandle"));
43
-
44
- var _reactDnd = require("react-dnd");
45
-
17
+ var _DragHandle = _interopRequireDefault(require("@mui/icons-material/DragHandle"));
18
+ var _core = require("@dnd-kit/core");
46
19
  var _debug = _interopRequireDefault(require("debug"));
47
-
48
20
  var _drag = require("@pie-lib/drag");
49
-
50
21
  var _utils = require("../../utils");
51
-
52
- var _flow = _interopRequireDefault(require("lodash/flow"));
53
-
54
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
55
-
56
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
57
-
58
- var log = (0, _debug["default"])('@pie-element:categorize:configure:choice');
59
-
60
- var canDrag = function canDrag(props) {
22
+ const log = (0, _debug.default)('@pie-element:categorize:configure:choice');
23
+ const canDrag = props => {
61
24
  if (props.lockChoiceOrder) {
62
25
  return true;
63
26
  }
64
-
65
- var count = props.choice.categoryCount || 0;
66
-
27
+ const count = props.choice.categoryCount || 0;
67
28
  if (count === 0) {
68
29
  return true;
69
30
  } else {
70
31
  return props.correctResponseCount < count;
71
32
  }
72
33
  };
73
-
74
- var Choice = /*#__PURE__*/function (_React$Component) {
75
- (0, _inherits2["default"])(Choice, _React$Component);
76
-
77
- var _super = _createSuper(Choice);
78
-
79
- function Choice() {
80
- var _this;
81
-
82
- (0, _classCallCheck2["default"])(this, Choice);
83
-
84
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
85
- args[_key] = arguments[_key];
86
- }
87
-
88
- _this = _super.call.apply(_super, [this].concat(args));
89
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "changeContent", function (content) {
90
- var _this$props = _this.props,
91
- onChange = _this$props.onChange,
92
- choice = _this$props.choice;
93
- choice.content = content;
94
- onChange(choice);
95
- });
96
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "changeCategoryCount", function () {
97
- var _this$props2 = _this.props,
98
- onChange = _this$props2.onChange,
99
- choice = _this$props2.choice;
100
-
101
- if (choice.categoryCount === 1) {
102
- choice.categoryCount = 0;
103
- } else {
104
- choice.categoryCount = 1;
105
- }
106
-
107
- onChange(choice);
108
- });
109
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "isCheckboxShown", function (allowMultiplePlacements) {
110
- return allowMultiplePlacements === _utils.multiplePlacements.perChoice;
111
- });
112
- return _this;
113
- }
114
-
115
- (0, _createClass2["default"])(Choice, [{
116
- key: "render",
117
- value: function render() {
118
- var _this$props3 = this.props,
119
- allowMultiplePlacements = _this$props3.allowMultiplePlacements,
120
- classes = _this$props3.classes,
121
- className = _this$props3.className,
122
- configuration = _this$props3.configuration,
123
- choice = _this$props3.choice,
124
- deleteFocusedEl = _this$props3.deleteFocusedEl,
125
- focusedEl = _this$props3.focusedEl,
126
- index = _this$props3.index,
127
- onDelete = _this$props3.onDelete,
128
- connectDropTarget = _this$props3.connectDropTarget,
129
- connectDragSource = _this$props3.connectDragSource,
130
- connectDragPreview = _this$props3.connectDragPreview,
131
- imageSupport = _this$props3.imageSupport,
132
- spellCheck = _this$props3.spellCheck,
133
- toolbarOpts = _this$props3.toolbarOpts,
134
- error = _this$props3.error,
135
- maxImageWidth = _this$props3.maxImageWidth,
136
- maxImageHeight = _this$props3.maxImageHeight,
137
- uploadSoundSupport = _this$props3.uploadSoundSupport;
138
- var showRemoveAfterPlacing = this.isCheckboxShown(allowMultiplePlacements);
139
- var draggable = canDrag(this.props);
140
- return /*#__PURE__*/_react["default"].createElement(_Card["default"], {
141
- className: (0, _classnames["default"])(classes.choice, className)
142
- }, /*#__PURE__*/_react["default"].createElement(_CardActions["default"], {
143
- className: classes.actions
144
- }, connectDragSource(connectDropTarget( /*#__PURE__*/_react["default"].createElement("span", {
145
- className: (0, _classnames["default"])(classes.dragHandle, draggable === false && classes.dragDisabled)
146
- }, /*#__PURE__*/_react["default"].createElement(_DragHandle["default"], {
147
- color: draggable ? 'primary' : 'disabled'
148
- }))))), connectDragPreview( /*#__PURE__*/_react["default"].createElement("span", null, /*#__PURE__*/_react["default"].createElement(_inputHeader["default"], {
149
- imageSupport: imageSupport,
150
- focusedEl: focusedEl,
151
- deleteFocusedEl: deleteFocusedEl,
152
- index: index,
153
- label: choice.content,
154
- onChange: this.changeContent,
155
- onDelete: onDelete,
156
- toolbarOpts: toolbarOpts,
157
- spellCheck: spellCheck,
158
- error: error,
159
- maxImageWidth: maxImageWidth,
160
- maxImageHeight: maxImageHeight,
161
- uploadSoundSupport: uploadSoundSupport,
162
- configuration: configuration
163
- }), error && /*#__PURE__*/_react["default"].createElement("div", {
164
- className: classes.errorText
165
- }, error))), /*#__PURE__*/_react["default"].createElement(_CardActions["default"], {
166
- className: classes.actions
167
- }, /*#__PURE__*/_react["default"].createElement(_buttons.DeleteButton, {
168
- label: 'delete',
169
- onClick: onDelete
170
- }), showRemoveAfterPlacing && /*#__PURE__*/_react["default"].createElement(_configUi.Checkbox, {
171
- mini: true,
172
- label: 'Remove after placing',
173
- checked: choice.categoryCount === 1,
174
- onChange: this.changeCategoryCount
175
- })));
176
- }
177
- }]);
178
- return Choice;
179
- }(_react["default"].Component);
180
-
181
- exports.Choice = Choice;
182
- (0, _defineProperty2["default"])(Choice, "propTypes", {
183
- allowMultiplePlacements: _propTypes["default"].string,
184
- classes: _propTypes["default"].object.isRequired,
185
- className: _propTypes["default"].string,
186
- configuration: _propTypes["default"].object.isRequired,
187
- choice: _propTypes["default"].object.isRequired,
188
- connectDropTarget: _propTypes["default"].func,
189
- deleteFocusedEl: _propTypes["default"].func,
190
- focusedEl: _propTypes["default"].number,
191
- index: _propTypes["default"].number,
192
- lockChoiceOrder: _propTypes["default"].bool,
193
- maxImageHeight: _propTypes["default"].object,
194
- maxImageWidth: _propTypes["default"].object,
195
- onChange: _propTypes["default"].func.isRequired,
196
- onDelete: _propTypes["default"].func.isRequired,
197
- connectDragSource: _propTypes["default"].func.isRequired,
198
- connectDragPreview: _propTypes["default"].func.isRequired,
199
- correctResponseCount: _propTypes["default"].number.isRequired,
200
- imageSupport: _propTypes["default"].shape({
201
- add: _propTypes["default"].func.isRequired,
202
- "delete": _propTypes["default"].func.isRequired
203
- }),
204
- toolbarOpts: _propTypes["default"].object,
205
- error: _propTypes["default"].string,
206
- uploadSoundSupport: _propTypes["default"].shape({
207
- add: _propTypes["default"].func.isRequired,
208
- "delete": _propTypes["default"].func.isRequired
209
- }),
210
- spellCheck: _propTypes["default"].bool
34
+ const StyledCard = (0, _styles.styled)(_Card.default)(({
35
+ theme
36
+ }) => ({
37
+ minWidth: '196px',
38
+ padding: theme.spacing(1),
39
+ overflow: 'visible'
40
+ }));
41
+ const StyledCardActions = (0, _styles.styled)(_CardActions.default)({
42
+ padding: 0,
43
+ justifyContent: 'space-between'
211
44
  });
212
- (0, _defineProperty2["default"])(Choice, "defaultProps", {});
213
-
214
- var styles = function styles(theme) {
215
- return {
216
- actions: {
217
- padding: 0,
218
- justifyContent: 'space-between'
219
- },
220
- choice: {
221
- minWidth: '196px',
222
- padding: theme.spacing.unit,
223
- overflow: 'visible'
224
- },
225
- dragHandle: {
226
- cursor: 'move'
45
+ const DragHandleContainer = (0, _styles.styled)('span', {
46
+ shouldForwardProp: prop => prop !== 'draggable'
47
+ })(({
48
+ draggable
49
+ }) => ({
50
+ cursor: draggable ? 'move' : 'inherit'
51
+ }));
52
+ const ErrorText = (0, _styles.styled)('div')(({
53
+ theme
54
+ }) => ({
55
+ fontSize: theme.typography.fontSize - 2,
56
+ color: theme.palette.error.main,
57
+ paddingBottom: theme.spacing(1)
58
+ }));
59
+ const Choice = ({
60
+ allowMultiplePlacements,
61
+ configuration,
62
+ choice,
63
+ deleteFocusedEl,
64
+ focusedEl,
65
+ index,
66
+ onDelete,
67
+ onChange,
68
+ correctResponseCount,
69
+ lockChoiceOrder,
70
+ imageSupport,
71
+ spellCheck,
72
+ toolbarOpts,
73
+ error,
74
+ maxImageWidth,
75
+ maxImageHeight,
76
+ uploadSoundSupport
77
+ }) => {
78
+ const draggable = canDrag({
79
+ choice,
80
+ correctResponseCount,
81
+ lockChoiceOrder
82
+ });
83
+ const {
84
+ attributes: dragAttributes,
85
+ listeners: dragListeners,
86
+ setNodeRef: setDragNodeRef,
87
+ isDragging
88
+ } = (0, _core.useDraggable)({
89
+ id: `choice-${choice.id}`,
90
+ data: {
91
+ id: choice.id,
92
+ index,
93
+ type: 'choice'
227
94
  },
228
- dragDisabled: {
229
- cursor: 'inherit'
230
- },
231
- errorText: {
232
- fontSize: theme.typography.fontSize - 2,
233
- color: theme.palette.error.main,
234
- paddingBottom: theme.spacing.unit
95
+ disabled: !draggable
96
+ });
97
+ const {
98
+ setNodeRef: setDropNodeRef
99
+ } = (0, _core.useDroppable)({
100
+ id: `choice-drop-${choice.id}`,
101
+ data: {
102
+ id: choice.id,
103
+ index,
104
+ type: 'choice'
235
105
  }
106
+ });
107
+ const changeContent = content => {
108
+ choice.content = content;
109
+ onChange(choice);
236
110
  };
237
- };
238
-
239
- var StyledChoice = (0, _styles.withStyles)(styles)(Choice);
240
- var spec = {
241
- canDrag: canDrag,
242
- beginDrag: function beginDrag(props) {
243
- var out = {
244
- id: props.choice.id,
245
- index: props.index
246
- };
247
- log('[beginDrag] out:', out);
248
- return out;
249
- },
250
- endDrag: function endDrag(props, monitor) {
251
- if (!monitor.didDrop()) {
252
- var item = monitor.getItem();
253
-
254
- if (item.categoryId) {
255
- log('wasnt droppped - what to do?');
256
- props.onRemoveChoice(item);
257
- }
111
+ const changeCategoryCount = () => {
112
+ if (choice.categoryCount === 1) {
113
+ choice.categoryCount = 0;
114
+ } else {
115
+ choice.categoryCount = 1;
258
116
  }
259
- }
260
- };
261
- exports.spec = spec;
262
- var specTarget = {
263
- drop: function drop(props, monitor) {
264
- log('[drop] props: ', props);
265
- var item = monitor.getItem();
266
- props.rearrangeChoices(item.index, props.index);
267
- },
268
- canDrop: function canDrop(props, monitor) {
269
- var item = monitor.getItem();
270
- return props.choice.id !== item.id;
271
- }
272
- };
273
- exports.specTarget = specTarget;
274
-
275
- var _default = _drag.uid.withUid((0, _flow["default"])((0, _reactDnd.DragSource)(function (_ref) {
276
- var uid = _ref.uid;
277
- return uid;
278
- }, spec, function (connect, monitor) {
279
- return {
280
- connectDragSource: connect.dragSource(),
281
- connectDragPreview: connect.dragPreview(),
282
- isDragging: monitor.isDragging()
117
+ onChange(choice);
283
118
  };
284
- }), (0, _reactDnd.DropTarget)(function (_ref2) {
285
- var uid = _ref2.uid;
286
- return uid;
287
- }, specTarget, function (connect, monitor) {
288
- return {
289
- connectDropTarget: connect.dropTarget(),
290
- isOver: monitor.isOver()
119
+ const isCheckboxShown = allowMultiplePlacements => allowMultiplePlacements === _utils.multiplePlacements.perChoice;
120
+ const showRemoveAfterPlacing = isCheckboxShown(allowMultiplePlacements);
121
+ const setNodeRef = element => {
122
+ setDragNodeRef(element);
123
+ setDropNodeRef(element);
291
124
  };
292
- }))(StyledChoice));
293
-
294
- exports["default"] = _default;
125
+ return /*#__PURE__*/_react.default.createElement(StyledCard, {
126
+ ref: setNodeRef,
127
+ style: {
128
+ opacity: isDragging ? 0.5 : 1
129
+ }
130
+ }, /*#__PURE__*/_react.default.createElement(StyledCardActions, null, /*#__PURE__*/_react.default.createElement(DragHandleContainer, (0, _extends2.default)({
131
+ draggable: draggable
132
+ }, dragAttributes, dragListeners), /*#__PURE__*/_react.default.createElement(_DragHandle.default, {
133
+ color: draggable ? 'primary' : 'disabled'
134
+ }))), /*#__PURE__*/_react.default.createElement(_inputHeader.default, {
135
+ imageSupport: imageSupport,
136
+ focusedEl: focusedEl,
137
+ deleteFocusedEl: deleteFocusedEl,
138
+ index: index,
139
+ label: choice.content,
140
+ onChange: changeContent,
141
+ onDelete: onDelete,
142
+ toolbarOpts: toolbarOpts,
143
+ spellCheck: spellCheck,
144
+ error: error,
145
+ maxImageWidth: maxImageWidth,
146
+ maxImageHeight: maxImageHeight,
147
+ uploadSoundSupport: uploadSoundSupport,
148
+ configuration: configuration
149
+ }), error && /*#__PURE__*/_react.default.createElement(ErrorText, null, error), /*#__PURE__*/_react.default.createElement(StyledCardActions, null, /*#__PURE__*/_react.default.createElement(_buttons.DeleteButton, {
150
+ label: 'delete',
151
+ onClick: onDelete
152
+ }), showRemoveAfterPlacing && /*#__PURE__*/_react.default.createElement(_configUi.Checkbox, {
153
+ mini: true,
154
+ label: 'Remove after placing',
155
+ checked: choice.categoryCount === 1,
156
+ onChange: changeCategoryCount
157
+ })));
158
+ };
159
+ Choice.propTypes = {
160
+ allowMultiplePlacements: _propTypes.default.string,
161
+ configuration: _propTypes.default.object.isRequired,
162
+ choice: _propTypes.default.object.isRequired,
163
+ deleteFocusedEl: _propTypes.default.func,
164
+ focusedEl: _propTypes.default.number,
165
+ index: _propTypes.default.number,
166
+ lockChoiceOrder: _propTypes.default.bool,
167
+ maxImageHeight: _propTypes.default.object,
168
+ maxImageWidth: _propTypes.default.object,
169
+ onChange: _propTypes.default.func.isRequired,
170
+ onDelete: _propTypes.default.func.isRequired,
171
+ correctResponseCount: _propTypes.default.number.isRequired,
172
+ imageSupport: _propTypes.default.shape({
173
+ add: _propTypes.default.func.isRequired,
174
+ delete: _propTypes.default.func.isRequired
175
+ }),
176
+ toolbarOpts: _propTypes.default.object,
177
+ error: _propTypes.default.string,
178
+ uploadSoundSupport: _propTypes.default.shape({
179
+ add: _propTypes.default.func.isRequired,
180
+ delete: _propTypes.default.func.isRequired
181
+ }),
182
+ spellCheck: _propTypes.default.bool,
183
+ rearrangeChoices: _propTypes.default.func
184
+ };
185
+ var _default = exports.default = _drag.uid.withUid(Choice);
295
186
  //# sourceMappingURL=choice.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/design/choices/choice.jsx"],"names":["log","canDrag","props","lockChoiceOrder","count","choice","categoryCount","correctResponseCount","Choice","content","onChange","allowMultiplePlacements","multiplePlacements","perChoice","classes","className","configuration","deleteFocusedEl","focusedEl","index","onDelete","connectDropTarget","connectDragSource","connectDragPreview","imageSupport","spellCheck","toolbarOpts","error","maxImageWidth","maxImageHeight","uploadSoundSupport","showRemoveAfterPlacing","isCheckboxShown","draggable","actions","dragHandle","dragDisabled","changeContent","errorText","changeCategoryCount","React","Component","PropTypes","string","object","isRequired","func","number","bool","shape","add","styles","theme","padding","justifyContent","minWidth","spacing","unit","overflow","cursor","fontSize","typography","color","palette","main","paddingBottom","StyledChoice","spec","beginDrag","out","id","endDrag","monitor","didDrop","item","getItem","categoryId","onRemoveChoice","specTarget","drop","rearrangeChoices","canDrop","uid","withUid","connect","dragSource","dragPreview","isDragging","dropTarget","isOver"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,IAAMA,GAAG,GAAG,uBAAM,0CAAN,CAAZ;;AAEA,IAAMC,OAAO,GAAG,SAAVA,OAAU,CAACC,KAAD,EAAW;AACzB,MAAIA,KAAK,CAACC,eAAV,EAA2B;AACzB,WAAO,IAAP;AACD;;AACD,MAAMC,KAAK,GAAGF,KAAK,CAACG,MAAN,CAAaC,aAAb,IAA8B,CAA5C;;AACA,MAAIF,KAAK,KAAK,CAAd,EAAiB;AACf,WAAO,IAAP;AACD,GAFD,MAEO;AACL,WAAOF,KAAK,CAACK,oBAAN,GAA6BH,KAApC;AACD;AACF,CAVD;;IAYaI,M;;;;;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AO,CAACG,OAAR,EAAb;AACA,WAAOzE,KAAK,CAACG,MAAN,CAAaiE,EAAb,KAAoBI,IAAI,CAACJ,EAAhC;AACD;AATuB,CAAnB;;;eAYQY,UAAIC,OAAJ,CACb,sBACE,0BACE;AAAA,MAAGD,GAAH,QAAGA,GAAH;AAAA,SAAaA,GAAb;AAAA,CADF,EAEEf,IAFF,EAGE,UAACiB,OAAD,EAAUZ,OAAV;AAAA,SAAuB;AACrBlD,IAAAA,iBAAiB,EAAE8D,OAAO,CAACC,UAAR,EADE;AAErB9D,IAAAA,kBAAkB,EAAE6D,OAAO,CAACE,WAAR,EAFC;AAGrBC,IAAAA,UAAU,EAAEf,OAAO,CAACe,UAAR;AAHS,GAAvB;AAAA,CAHF,CADF,EAUE,0BACE;AAAA,MAAGL,GAAH,SAAGA,GAAH;AAAA,SAAaA,GAAb;AAAA,CADF,EAEEJ,UAFF,EAGE,UAACM,OAAD,EAAUZ,OAAV;AAAA,SAAuB;AACrBnD,IAAAA,iBAAiB,EAAE+D,OAAO,CAACI,UAAR,EADE;AAErBC,IAAAA,MAAM,EAAEjB,OAAO,CAACiB,MAAR;AAFa,GAAvB;AAAA,CAHF,CAVF,EAkBEvB,YAlBF,CADa,C","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@material-ui/core/styles';\nimport classNames from 'classnames';\nimport Card from '@material-ui/core/Card';\nimport CardActions from '@material-ui/core/CardActions';\nimport InputHeader from '../input-header';\nimport { Checkbox } from '@pie-lib/config-ui';\nimport { DeleteButton } from '../buttons';\nimport DragHandle from '@material-ui/icons/DragHandle';\nimport { DragSource, DropTarget } from 'react-dnd';\nimport debug from 'debug';\nimport { uid } from '@pie-lib/drag';\nimport { multiplePlacements } from '../../utils';\nimport flow from 'lodash/flow';\n\nconst log = debug('@pie-element:categorize:configure:choice');\n\nconst canDrag = (props) => {\n if (props.lockChoiceOrder) {\n return true;\n }\n const count = props.choice.categoryCount || 0;\n if (count === 0) {\n return true;\n } else {\n return props.correctResponseCount < count;\n }\n};\n\nexport class Choice extends React.Component {\n static propTypes = {\n allowMultiplePlacements: PropTypes.string,\n classes: PropTypes.object.isRequired,\n className: PropTypes.string,\n configuration: PropTypes.object.isRequired,\n choice: PropTypes.object.isRequired,\n connectDropTarget: PropTypes.func,\n deleteFocusedEl: PropTypes.func,\n focusedEl: PropTypes.number,\n index: PropTypes.number,\n lockChoiceOrder: PropTypes.bool,\n maxImageHeight: PropTypes.object,\n maxImageWidth: PropTypes.object,\n onChange: PropTypes.func.isRequired,\n onDelete: PropTypes.func.isRequired,\n connectDragSource: PropTypes.func.isRequired,\n connectDragPreview: PropTypes.func.isRequired,\n correctResponseCount: PropTypes.number.isRequired,\n imageSupport: PropTypes.shape({\n add: PropTypes.func.isRequired,\n delete: PropTypes.func.isRequired,\n }),\n toolbarOpts: PropTypes.object,\n error: PropTypes.string,\n uploadSoundSupport: PropTypes.shape({\n add: PropTypes.func.isRequired,\n delete: PropTypes.func.isRequired,\n }),\n spellCheck: PropTypes.bool,\n };\n\n static defaultProps = {};\n\n changeContent = (content) => {\n const { onChange, choice } = this.props;\n choice.content = content;\n onChange(choice);\n };\n\n changeCategoryCount = () => {\n const { onChange, choice } = this.props;\n if (choice.categoryCount === 1) {\n choice.categoryCount = 0;\n } else {\n choice.categoryCount = 1;\n }\n onChange(choice);\n };\n\n isCheckboxShown = (allowMultiplePlacements) => allowMultiplePlacements === multiplePlacements.perChoice;\n\n render() {\n const {\n allowMultiplePlacements,\n classes,\n className,\n configuration,\n choice,\n deleteFocusedEl,\n focusedEl,\n index,\n onDelete,\n connectDropTarget,\n connectDragSource,\n connectDragPreview,\n imageSupport,\n spellCheck,\n toolbarOpts,\n error,\n maxImageWidth,\n maxImageHeight,\n uploadSoundSupport,\n } = this.props;\n\n const showRemoveAfterPlacing = this.isCheckboxShown(allowMultiplePlacements);\n const draggable = canDrag(this.props);\n\n return (\n <Card className={classNames(classes.choice, className)}>\n <CardActions className={classes.actions}>\n {connectDragSource(\n connectDropTarget(\n <span className={classNames(classes.dragHandle, draggable === false && classes.dragDisabled)}>\n <DragHandle color={draggable ? 'primary' : 'disabled'} />\n </span>,\n ),\n )}\n </CardActions>\n {connectDragPreview(\n <span>\n <InputHeader\n imageSupport={imageSupport}\n focusedEl={focusedEl}\n deleteFocusedEl={deleteFocusedEl}\n index={index}\n label={choice.content}\n onChange={this.changeContent}\n onDelete={onDelete}\n toolbarOpts={toolbarOpts}\n spellCheck={spellCheck}\n error={error}\n maxImageWidth={maxImageWidth}\n maxImageHeight={maxImageHeight}\n uploadSoundSupport={uploadSoundSupport}\n configuration={configuration}\n />\n {error && <div className={classes.errorText}>{error}</div>}\n </span>,\n )}\n\n <CardActions className={classes.actions}>\n <DeleteButton label={'delete'} onClick={onDelete} />\n {showRemoveAfterPlacing && (\n <Checkbox\n mini\n label={'Remove after placing'}\n checked={choice.categoryCount === 1}\n onChange={this.changeCategoryCount}\n />\n )}\n </CardActions>\n </Card>\n );\n }\n}\nconst styles = (theme) => ({\n actions: {\n padding: 0,\n justifyContent: 'space-between',\n },\n choice: {\n minWidth: '196px',\n padding: theme.spacing.unit,\n overflow: 'visible',\n },\n dragHandle: {\n cursor: 'move',\n },\n dragDisabled: {\n cursor: 'inherit',\n },\n errorText: {\n fontSize: theme.typography.fontSize - 2,\n color: theme.palette.error.main,\n paddingBottom: theme.spacing.unit,\n },\n});\n\nconst StyledChoice = withStyles(styles)(Choice);\n\nexport const spec = {\n canDrag,\n beginDrag: (props) => {\n const out = {\n id: props.choice.id,\n index: props.index,\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\nexport const specTarget = {\n drop: (props, monitor) => {\n log('[drop] props: ', props);\n const item = monitor.getItem();\n props.rearrangeChoices(item.index, props.index);\n },\n canDrop: (props, monitor) => {\n const item = monitor.getItem();\n return props.choice.id !== item.id;\n },\n};\n\nexport default uid.withUid(\n flow(\n DragSource(\n ({ uid }) => uid,\n spec,\n (connect, monitor) => ({\n connectDragSource: connect.dragSource(),\n connectDragPreview: connect.dragPreview(),\n isDragging: monitor.isDragging(),\n }),\n ),\n DropTarget(\n ({ uid }) => uid,\n specTarget,\n (connect, monitor) => ({\n connectDropTarget: connect.dropTarget(),\n isOver: monitor.isOver(),\n }),\n ),\n )(StyledChoice),\n);\n"],"file":"choice.js"}
1
+ {"version":3,"file":"choice.js","names":["_react","_interopRequireDefault","require","_propTypes","_styles","_Card","_CardActions","_inputHeader","_configUi","_buttons","_DragHandle","_core","_debug","_drag","_utils","log","debug","canDrag","props","lockChoiceOrder","count","choice","categoryCount","correctResponseCount","StyledCard","styled","Card","theme","minWidth","padding","spacing","overflow","StyledCardActions","CardActions","justifyContent","DragHandleContainer","shouldForwardProp","prop","draggable","cursor","ErrorText","fontSize","typography","color","palette","error","main","paddingBottom","Choice","allowMultiplePlacements","configuration","deleteFocusedEl","focusedEl","index","onDelete","onChange","imageSupport","spellCheck","toolbarOpts","maxImageWidth","maxImageHeight","uploadSoundSupport","attributes","dragAttributes","listeners","dragListeners","setNodeRef","setDragNodeRef","isDragging","useDraggable","id","data","type","disabled","setDropNodeRef","useDroppable","changeContent","content","changeCategoryCount","isCheckboxShown","multiplePlacements","perChoice","showRemoveAfterPlacing","element","default","createElement","ref","style","opacity","_extends2","label","DeleteButton","onClick","Checkbox","mini","checked","propTypes","PropTypes","string","object","isRequired","func","number","bool","shape","add","delete","rearrangeChoices","_default","exports","uid","withUid"],"sources":["../../../src/design/choices/choice.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { styled } from '@mui/material/styles';\nimport Card from '@mui/material/Card';\nimport CardActions from '@mui/material/CardActions';\nimport InputHeader from '../input-header';\nimport { Checkbox } from '@pie-lib/config-ui';\nimport { DeleteButton } from '../buttons';\nimport DragHandle from '@mui/icons-material/DragHandle';\nimport { useDraggable, useDroppable } from '@dnd-kit/core';\nimport debug from 'debug';\nimport { uid } from '@pie-lib/drag';\nimport { multiplePlacements } from '../../utils';\n\nconst log = debug('@pie-element:categorize:configure:choice');\n\nconst canDrag = (props) => {\n if (props.lockChoiceOrder) {\n return true;\n }\n const count = props.choice.categoryCount || 0;\n if (count === 0) {\n return true;\n } else {\n return props.correctResponseCount < count;\n }\n};\n\nconst StyledCard = styled(Card)(({ theme }) => ({\n minWidth: '196px',\n padding: theme.spacing(1),\n overflow: 'visible',\n}));\n\nconst StyledCardActions = styled(CardActions)({\n padding: 0,\n justifyContent: 'space-between',\n});\n\nconst DragHandleContainer = styled('span', {\n shouldForwardProp: (prop) => prop !== 'draggable',\n})(({ draggable }) => ({\n cursor: draggable ? 'move' : 'inherit',\n}));\n\nconst ErrorText = styled('div')(({ theme }) => ({\n fontSize: theme.typography.fontSize - 2,\n color: theme.palette.error.main,\n paddingBottom: theme.spacing(1),\n}));\n\nconst Choice = ({\n allowMultiplePlacements,\n configuration,\n choice,\n deleteFocusedEl,\n focusedEl,\n index,\n onDelete,\n onChange,\n correctResponseCount,\n lockChoiceOrder,\n imageSupport,\n spellCheck,\n toolbarOpts,\n error,\n maxImageWidth,\n maxImageHeight,\n uploadSoundSupport,\n}) => {\n const draggable = canDrag({ choice, correctResponseCount, lockChoiceOrder });\n\n const {\n attributes: dragAttributes,\n listeners: dragListeners,\n setNodeRef: setDragNodeRef,\n isDragging,\n } = useDraggable({\n id: `choice-${choice.id}`,\n data: {\n id: choice.id,\n index,\n type: 'choice',\n },\n disabled: !draggable,\n });\n\n const {\n setNodeRef: setDropNodeRef,\n } = useDroppable({\n id: `choice-drop-${choice.id}`,\n data: {\n id: choice.id,\n index,\n type: 'choice',\n },\n });\n\n const changeContent = (content) => {\n choice.content = content;\n onChange(choice);\n };\n\n const changeCategoryCount = () => {\n if (choice.categoryCount === 1) {\n choice.categoryCount = 0;\n } else {\n choice.categoryCount = 1;\n }\n onChange(choice);\n };\n\n const isCheckboxShown = (allowMultiplePlacements) => allowMultiplePlacements === multiplePlacements.perChoice;\n\n const showRemoveAfterPlacing = isCheckboxShown(allowMultiplePlacements);\n\n const setNodeRef = (element) => {\n setDragNodeRef(element);\n setDropNodeRef(element);\n };\n\n return (\n <StyledCard ref={setNodeRef} style={{ opacity: isDragging ? 0.5 : 1 }}>\n <StyledCardActions>\n <DragHandleContainer draggable={draggable} {...dragAttributes} {...dragListeners}>\n <DragHandle color={draggable ? 'primary' : 'disabled'} />\n </DragHandleContainer>\n </StyledCardActions>\n <InputHeader\n imageSupport={imageSupport}\n focusedEl={focusedEl}\n deleteFocusedEl={deleteFocusedEl}\n index={index}\n label={choice.content}\n onChange={changeContent}\n onDelete={onDelete}\n toolbarOpts={toolbarOpts}\n spellCheck={spellCheck}\n error={error}\n maxImageWidth={maxImageWidth}\n maxImageHeight={maxImageHeight}\n uploadSoundSupport={uploadSoundSupport}\n configuration={configuration}\n />\n {error && <ErrorText>{error}</ErrorText>}\n\n <StyledCardActions>\n <DeleteButton label={'delete'} onClick={onDelete} />\n {showRemoveAfterPlacing && (\n <Checkbox\n mini\n label={'Remove after placing'}\n checked={choice.categoryCount === 1}\n onChange={changeCategoryCount}\n />\n )}\n </StyledCardActions>\n </StyledCard>\n );\n};\n\nChoice.propTypes = {\n allowMultiplePlacements: PropTypes.string,\n configuration: PropTypes.object.isRequired,\n choice: PropTypes.object.isRequired,\n deleteFocusedEl: PropTypes.func,\n focusedEl: PropTypes.number,\n index: PropTypes.number,\n lockChoiceOrder: PropTypes.bool,\n maxImageHeight: PropTypes.object,\n maxImageWidth: PropTypes.object,\n onChange: PropTypes.func.isRequired,\n onDelete: PropTypes.func.isRequired,\n correctResponseCount: PropTypes.number.isRequired,\n imageSupport: PropTypes.shape({\n add: PropTypes.func.isRequired,\n delete: PropTypes.func.isRequired,\n }),\n toolbarOpts: PropTypes.object,\n error: PropTypes.string,\n uploadSoundSupport: PropTypes.shape({\n add: PropTypes.func.isRequired,\n delete: PropTypes.func.isRequired,\n }),\n spellCheck: PropTypes.bool,\n rearrangeChoices: PropTypes.func,\n};\n\nexport default uid.withUid(Choice);\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,YAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,YAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AACA,IAAAQ,WAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,KAAA,GAAAT,OAAA;AACA,IAAAU,MAAA,GAAAX,sBAAA,CAAAC,OAAA;AACA,IAAAW,KAAA,GAAAX,OAAA;AACA,IAAAY,MAAA,GAAAZ,OAAA;AAEA,MAAMa,GAAG,GAAG,IAAAC,cAAK,EAAC,0CAA0C,CAAC;AAE7D,MAAMC,OAAO,GAAIC,KAAK,IAAK;EACzB,IAAIA,KAAK,CAACC,eAAe,EAAE;IACzB,OAAO,IAAI;EACb;EACA,MAAMC,KAAK,GAAGF,KAAK,CAACG,MAAM,CAACC,aAAa,IAAI,CAAC;EAC7C,IAAIF,KAAK,KAAK,CAAC,EAAE;IACf,OAAO,IAAI;EACb,CAAC,MAAM;IACL,OAAOF,KAAK,CAACK,oBAAoB,GAAGH,KAAK;EAC3C;AACF,CAAC;AAED,MAAMI,UAAU,GAAG,IAAAC,cAAM,EAACC,aAAI,CAAC,CAAC,CAAC;EAAEC;AAAM,CAAC,MAAM;EAC9CC,QAAQ,EAAE,OAAO;EACjBC,OAAO,EAAEF,KAAK,CAACG,OAAO,CAAC,CAAC,CAAC;EACzBC,QAAQ,EAAE;AACZ,CAAC,CAAC,CAAC;AAEH,MAAMC,iBAA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