@pie-element/placement-ordering 12.3.4-next.3 → 13.0.0-beta.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.
Files changed (47) hide show
  1. package/CHANGELOG.md +0 -11
  2. package/configure/CHANGELOG.md +0 -11
  3. package/configure/lib/choice-editor.js +189 -414
  4. package/configure/lib/choice-editor.js.map +1 -1
  5. package/configure/lib/choice-tile.js +172 -263
  6. package/configure/lib/choice-tile.js.map +1 -1
  7. package/configure/lib/defaults.js +2 -4
  8. package/configure/lib/defaults.js.map +1 -1
  9. package/configure/lib/design.js +389 -455
  10. package/configure/lib/design.js.map +1 -1
  11. package/configure/lib/help.js +5 -13
  12. package/configure/lib/help.js.map +1 -1
  13. package/configure/lib/index.js +118 -193
  14. package/configure/lib/index.js.map +1 -1
  15. package/configure/lib/utils.js +99 -4
  16. package/configure/lib/utils.js.map +1 -1
  17. package/configure/package.json +12 -10
  18. package/controller/CHANGELOG.md +0 -11
  19. package/controller/lib/defaults.js +2 -3
  20. package/controller/lib/defaults.js.map +1 -1
  21. package/controller/lib/index.js +133 -218
  22. package/controller/lib/index.js.map +1 -1
  23. package/controller/lib/scoring.js +35 -78
  24. package/controller/lib/scoring.js.map +1 -1
  25. package/controller/package.json +4 -4
  26. package/lib/index.js +63 -127
  27. package/lib/index.js.map +1 -1
  28. package/lib/main.js +20 -57
  29. package/lib/main.js.map +1 -1
  30. package/lib/ordering.js +52 -98
  31. package/lib/ordering.js.map +1 -1
  32. package/lib/placement-ordering.js +331 -381
  33. package/lib/placement-ordering.js.map +1 -1
  34. package/lib/tile.js +193 -267
  35. package/lib/tile.js.map +1 -1
  36. package/lib/tiler.js +126 -204
  37. package/lib/tiler.js.map +1 -1
  38. package/lib/utils.js +6 -18
  39. package/lib/utils.js.map +1 -1
  40. package/package.json +14 -11
  41. package/esm/configure.js +0 -25814
  42. package/esm/configure.js.map +0 -1
  43. package/esm/controller.js +0 -21221
  44. package/esm/controller.js.map +0 -1
  45. package/esm/element.js +0 -17874
  46. package/esm/element.js.map +0 -1
  47. package/esm/package.json +0 -3
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/choice-editor.jsx"],"names":["findFreeChoiceSlot","choices","slot","ids","map","c","id","includes","log","updateResponseOrChoices","response","from","to","fromType","type","fromIndex","index","toType","placeAtIndex","updatedResponse","reduce","acc","item","movedItem","remainingItems","push","slice","updatedChoices","toIndex","buildTiles","instanceId","targets","r","respId","choice","find","undefined","draggable","editable","processedChoices","m","Object","assign","droppable","concat","ChoiceEditor","props","warning","open","onChoiceChange","onChange","correctResponse","findIndex","splice","label","onDelete","choicesLabel","length","setState","text","filter","updatedCorrectResponse","v","addChoice","freeId","newChoice","newCorrectResponse","weight","shuffleChoices","placementArea","shuffled","shuffledCorrect","shuffledTwice","onDropChoice","ordering","target","source","tiles","t","classes","imageSupport","toolbarOpts","pluginProps","singularChoiceLabel","pluralChoiceLabel","spellCheck","maxImageWidth","maxImageHeight","errors","mathMlOptions","state","choicesErrors","orderError","Array","vTilerStyle","gridTemplateColumns","gridTemplateRows","choiceEditor","vtiler","columnLabel","bind","errorText","controls","root","addButtonRoot","addButtonLabel","toUpperCase","React","Component","PropTypes","object","isRequired","array","func","shape","add","bool","string","styles","theme","allToggle","display","alignItems","justifyContent","width","height","fill","palette","primary","marginTop","spacing","unit","paddingHorizontal","transition","opacity","gridAutoFlow","gridGap","paddingTop","fontSize","typography","color","error","main"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,SAASA,kBAAT,CAA4BC,OAA5B,EAAqC;AACnC,MAAIC,IAAI,GAAG,CAAX;AACA,MAAMC,GAAG,GAAGF,OAAO,CAACG,GAAR,CAAY,UAACC,CAAD;AAAA,WAAOA,CAAC,CAACC,EAAT;AAAA,GAAZ,CAAZ;;AAEA,SAAOH,GAAG,CA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KAHe;AAQzBpB,IAAAA,IAAI,EAAE;AACJqB,MAAAA,KAAK,EAAE,MADH;AAEJC,MAAAA,MAAM,EAAE,MAFJ;AAGJC,MAAAA,IAAI,EAAEP,KAAK,CAACQ,OAAN,CAAcC,OAAd,CAAsB,GAAtB;AAHF,KARmB;AAazBxB,IAAAA,aAAa,EAAE;AACbyB,MAAAA,SAAS,EAAEV,KAAK,CAACW,OAAN,CAAcC,IAAd,GAAqB,GADnB;AAEbC,MAAAA,iBAAiB,EAAEb,KAAK,CAACW,OAAN,CAAcC,IAAd,GAAqB;AAF3B,KAbU;AAiBzB1B,IAAAA,cAAc,EAAE;AACd4B,MAAAA,UAAU,EAAE,sBADE;AAEd,iBAAW;AACTC,QAAAA,OAAO,EAAE;AADA;AAFG,KAjBS;AAuBzBpC,IAAAA,MAAM,EAAE;AACNqC,MAAAA,YAAY,EAAE,QADR;AAENd,MAAAA,OAAO,EAAE,MAFH;AAGNe,MAAAA,OAAO,EAAE,MAHH;AAINd,MAAAA,UAAU,EAAE;AAJN,KAvBiB;AA6BzBvB,IAAAA,WAAW,EAAE;AACXyB,MAAAA,KAAK,EAAE,MADI;AAEXa,MAAAA,UAAU,EAAElB,KAAK,CAACW,OAAN,CAAcC,IAAd,GAAqB;AAFtB,KA7BY;AAiCzB9B,IAAAA,SAAS,EAAE;AACTqC,MAAAA,QAAQ,EAAEnB,KAAK,CAACoB,UAAN,CAAiBD,QAAjB,GAA4B,CAD7B;AAETE,MAAAA,KAAK,EAAErB,KAAK,CAACQ,OAAN,CAAcc,KAAd,CAAoBC,IAFlB;AAGTL,MAAAA,UAAU,EAAElB,KAAK,CAACW,OAAN,CAAcC;AAHjB;AAjCc,GAAZ;AAAA,CAAf;;eAwCe,wBAAWb,MAAX,EAAmBzE,YAAnB,C","sourcesContent":["import ChoiceTile from './choice-tile';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport debug from 'debug';\nimport { withStyles } from '@material-ui/core/styles';\nimport isEmpty from 'lodash/isEmpty';\nimport cloneDeep from 'lodash/cloneDeep';\nimport uniqueId from 'lodash/uniqueId';\nimport shuffle from 'lodash/shuffle';\nimport isEqual from 'lodash/isEqual';\nimport Button from '@material-ui/core/Button';\nimport { InputContainer } from '@pie-lib/render-ui';\nimport { AlertDialog } from '@pie-lib/config-ui';\n\nfunction findFreeChoiceSlot(choices) {\n let slot = 1;\n const ids = choices.map((c) => c.id);\n\n while (ids.includes(`c${slot}`)) {\n slot++;\n }\n\n return slot;\n}\n\nconst log = debug('@pie-element:placement-ordering:configure:choice-editor');\n\nfunction updateResponseOrChoices(response, choices, from, to) {\n const { type: fromType, index: fromIndex } = from;\n const { type: toType, index: placeAtIndex } = to;\n\n if (fromType === 'target' && toType === 'target') {\n const updatedResponse = cloneDeep(response) || [];\n\n const { movedItem, remainingItems } = updatedResponse.reduce(\n (acc, item, index) => {\n if (index === fromIndex) {\n acc.movedItem = item;\n } else {\n acc.remainingItems.push(item);\n }\n\n return acc;\n },\n { movedItem: null, remainingItems: [] },\n );\n\n return {\n response: [...remainingItems.slice(0, placeAtIndex), movedItem, ...remainingItems.slice(placeAtIndex)],\n choices,\n };\n }\n\n if (fromType === 'choice' && toType === 'choice') {\n const updatedChoices = cloneDeep(choices) || [];\n\n const { movedItem, remainingItems, toIndex } = updatedChoices.reduce(\n (acc, item, index) => {\n if (item.id === from.id) {\n acc.movedItem = item;\n } else {\n acc.remainingItems.push(item);\n }\n\n if (item.id === to.id) {\n acc.toIndex = index;\n }\n\n return acc;\n },\n { movedItem: null, remainingItems: [], toIndex: null },\n );\n\n return {\n response,\n choices: [...remainingItems.slice(0, toIndex), movedItem, ...remainingItems.slice(toIndex)],\n };\n }\n\n return { response, choices };\n}\n\nfunction buildTiles(choices, response, instanceId) {\n const targets = response.map((r, index) => {\n const respId = r && r.id;\n const choice = choices.find((c) => respId !== undefined && respId !== null && c.id === respId);\n\n return {\n type: 'target',\n instanceId,\n ...choice,\n draggable: true,\n index,\n editable: false,\n };\n });\n\n const processedChoices = choices.map((m) => {\n return Object.assign({}, m, {\n type: 'choice',\n droppable: false,\n draggable: true,\n instanceId,\n editable: true,\n });\n });\n\n return processedChoices.concat(targets);\n}\n\nclass ChoiceEditor extends React.Component {\n static propTypes = {\n classes: PropTypes.object.isRequired,\n correctResponse: PropTypes.array.isRequired,\n choices: PropTypes.array.isRequired,\n onChange: PropTypes.func.isRequired,\n imageSupport: PropTypes.shape({\n add: PropTypes.func.isRequired,\n delete: PropTypes.func.isRequired,\n }),\n maxImageHeight: PropTypes.object,\n maxImageWidth: PropTypes.object,\n toolbarOpts: PropTypes.object,\n pluginProps: PropTypes.object,\n placementArea: PropTypes.bool,\n singularChoiceLabel: PropTypes.string,\n pluralChoiceLabel: PropTypes.string,\n choicesLabel: PropTypes.string,\n errors: PropTypes.object,\n spellCheck: PropTypes.bool,\n };\n\n state = { warning: { open: false } };\n\n constructor(props) {\n super(props);\n\n this.instanceId = uniqueId();\n\n this.onChoiceChange = (choice) => {\n const { choices, onChange, correctResponse } = this.props;\n const index = choices.findIndex((c) => c.id === choice.id);\n\n choices.splice(index, 1, { ...choices[index], label: choice.label });\n onChange(choices, correctResponse);\n };\n\n this.onDelete = (choice) => {\n const { choices, onChange, correctResponse, choicesLabel } = this.props;\n\n if (choices && choices.length === 3) {\n this.setState({\n warning: {\n open: true,\n text: `There have to be at least 3 ${choicesLabel}.`,\n },\n });\n } else {\n const updatedChoices = choices.filter((c) => c.id !== choice.id);\n const updatedCorrectResponse = correctResponse.filter((v) => v.id !== choice.id);\n\n onChange(updatedChoices, updatedCorrectResponse);\n }\n };\n\n this.addChoice = () => {\n const { choices, correctResponse, onChange, choicesLabel } = this.props;\n\n if (choices && choices.length === 10) {\n this.setState({\n warning: {\n open: true,\n text: `There can be maximum 10 ${choicesLabel}.`,\n },\n });\n } else {\n const freeId = findFreeChoiceSlot(choices);\n const id = `c${freeId}`;\n const newChoice = { id, label: '' };\n\n const newCorrectResponse = {\n id,\n /**\n * Note: weights are not configurable in the existing component\n * so we'll want do disable this in the controller and ignore it for now.\n */\n weight: 0,\n };\n\n const updatedChoices = choices.concat([newChoice]);\n const updatedCorrectResponse = correctResponse.concat([newCorrectResponse]);\n\n onChange(updatedChoices, updatedCorrectResponse);\n }\n };\n\n this.shuffleChoices = () => {\n const { onChange, choices, correctResponse, placementArea } = this.props;\n let shuffled = shuffle(choices);\n\n // if placementArea is disabled, make sure we don't shuffle choices in the correct order\n const shuffledCorrect =\n !placementArea &&\n isEqual(\n shuffled.map((item) => item.id),\n correctResponse.map((item) => item.id),\n );\n\n if (shuffledCorrect) {\n const shuffledTwice = shuffle(shuffled);\n\n onChange(shuffledTwice, correctResponse);\n } else {\n onChange(shuffled, correctResponse);\n }\n };\n\n this.onDropChoice = (ordering, target, source) => {\n const { onChange } = this.props;\n const from = ordering.tiles.find((t) => t.id === source.id && t.type === source.type);\n const to = target;\n log('[onDropChoice] ', from, to);\n const { response, choices } = updateResponseOrChoices(ordering.response, ordering.choices, from, to);\n\n onChange(choices, response);\n };\n }\n\n render() {\n const {\n classes,\n correctResponse,\n choices,\n imageSupport,\n toolbarOpts,\n pluginProps,\n singularChoiceLabel,\n pluralChoiceLabel,\n choicesLabel,\n spellCheck,\n maxImageWidth,\n maxImageHeight,\n errors,\n mathMlOptions = {},\n } = this.props;\n const { warning } = this.state;\n const { choicesErrors, orderError } = errors || {};\n\n const ordering = {\n choices,\n response: !correctResponse || isEmpty(correctResponse) ? new Array(choices.length) : correctResponse,\n tiles: buildTiles(choices, correctResponse, this.instanceId),\n };\n\n const vTilerStyle = {\n gridTemplateColumns: 'repeat(2, 1fr)',\n gridTemplateRows: `repeat(${choices.length}, 1fr)`,\n };\n\n return (\n <div className={classes.choiceEditor}>\n <div className={classes.vtiler} style={{ gridTemplateColumns: 'repeat(2, 1fr)' }}>\n <InputContainer label={`Student ${choicesLabel || 'Choices'}`} className={classes.columnLabel} />\n <InputContainer label=\"Correct Order\" className={classes.columnLabel} />\n </div>\n\n <div className={classes.vtiler} style={vTilerStyle}>\n {ordering.tiles.map((choice, index) => (\n <ChoiceTile\n choice={choice}\n index={index}\n key={index}\n imageSupport={imageSupport}\n onDelete={this.onDelete.bind(this, choice)}\n onChoiceChange={this.onChoiceChange}\n onDropChoice={(source, index) => this.onDropChoice(ordering, choice, source, index)}\n toolbarOpts={toolbarOpts}\n pluginProps={pluginProps}\n choices={choices}\n choicesLabel={choicesLabel}\n spellCheck={spellCheck}\n maxImageWidth={maxImageWidth}\n maxImageHeight={maxImageHeight}\n error={choicesErrors?.[choice.id] || (orderError && ' ') || null}\n mathMlOptions={mathMlOptions}\n />\n ))}\n </div>\n\n {orderError && <div className={classes.errorText}>{orderError}</div>}\n\n <div className={classes.controls}>\n <Button\n onClick={this.shuffleChoices}\n size=\"small\"\n variant=\"contained\"\n color=\"default\"\n classes={{ root: classes.addButtonRoot, label: classes.addButtonLabel }}\n >\n {`SHUFFLE ${pluralChoiceLabel}`.toUpperCase()}\n </Button>\n\n <Button\n onClick={this.addChoice}\n size=\"small\"\n variant=\"contained\"\n color=\"default\"\n classes={{ root: classes.addButtonRoot, label: classes.addButtonLabel }}\n >\n {`ADD ${singularChoiceLabel}`.toUpperCase()}\n </Button>\n </div>\n\n <AlertDialog\n open={warning.open}\n title=\"Warning\"\n text={warning.text}\n onConfirm={() => this.setState({ warning: { open: false } })}\n />\n </div>\n );\n }\n}\n\nconst styles = (theme) => ({\n allToggle: {},\n choiceEditor: {},\n controls: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n },\n root: {\n width: '30px',\n height: '30px',\n fill: theme.palette.primary[500],\n },\n addButtonRoot: {\n marginTop: theme.spacing.unit * 2.5,\n paddingHorizontal: theme.spacing.unit * 1.5,\n },\n addButtonLabel: {\n transition: 'opacity 200ms linear',\n '&:hover': {\n opacity: 0.3,\n },\n },\n vtiler: {\n gridAutoFlow: 'column',\n display: 'grid',\n gridGap: '10px',\n alignItems: 'center',\n },\n columnLabel: {\n width: '100%',\n paddingTop: theme.spacing.unit * 2,\n },\n errorText: {\n fontSize: theme.typography.fontSize - 2,\n color: theme.palette.error.main,\n paddingTop: theme.spacing.unit,\n },\n});\n\nexport default withStyles(styles)(ChoiceEditor);\n"],"file":"choice-editor.js"}
1
+ {"version":3,"file":"choice-editor.js","names":["_propTypes","_interopRequireDefault","require","_react","_debug","_shuffle","_isEqual","_Button","_styles","_renderUi","_configUi","_choiceTile","findFreeChoiceSlot","choices","slot","ids","map","c","id","includes","log","debug","StyledControls","styled","display","alignItems","justifyContent","StyledAddButton","Button","theme","marginTop","spacing","paddingLeft","paddingRight","transition","opacity","StyledVTiler","gridAutoFlow","gridGap","StyledColumnLabel","InputContainer","width","paddingTop","ErrorText","fontSize","typography","color","palette","error","main","ChoiceEditor","React","Component","constructor","props","_defineProperty2","default","warning","open","onChoiceChange","choice","onChange","correctResponse","index","findIndex","splice","label","onDelete","choicesLabel","length","setState","text","updatedChoices","filter","updatedCorrectResponse","v","addChoice","freeId","newChoice","newCorrectResponse","weight","concat","shuffleChoices","placementArea","shuffled","shuffle","shuffledCorrect","isEqual","item","shuffledTwice","render","imageSupport","toolbarOpts","pluginProps","singularChoiceLabel","pluralChoiceLabel","spellCheck","maxImageWidth","maxImageHeight","errors","mathMlOptions","ordering","state","choicesErrors","orderError","vTilerStyle","gridTemplateColumns","gridTemplateRows","createElement","style","tiles","key","type","bind","onClick","size","variant","toUpperCase","AlertDialog","title","onConfirm","PropTypes","array","isRequired","func","shape","add","delete","object","bool","string","_default","exports"],"sources":["../src/choice-editor.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\nimport debug from 'debug';\nimport shuffle from 'lodash/shuffle';\nimport isEqual from 'lodash/isEqual';\nimport Button from '@mui/material/Button';\nimport { styled } from '@mui/material/styles';\nimport { InputContainer } from '@pie-lib/render-ui';\nimport { AlertDialog } from '@pie-lib/config-ui';\n\nimport ChoiceTile from './choice-tile';\n\nfunction findFreeChoiceSlot(choices) {\n let slot = 1;\n const ids = choices.map((c) => c.id);\n\n while (ids.includes(`c${slot}`)) {\n slot++;\n }\n\n return slot;\n}\n\nconst log = debug('@pie-element:placement-ordering:configure:choice-editor');\n\nconst StyledControls = styled('div')({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n});\n\nconst StyledAddButton = styled(Button)(({ theme }) => ({\n marginTop: theme.spacing(2.5),\n paddingLeft: theme.spacing(1.5),\n paddingRight: theme.spacing(1.5),\n '& .MuiButton-label': {\n transition: 'opacity 200ms linear',\n '&:hover': {\n opacity: 0.3,\n },\n },\n}));\n\nconst StyledVTiler = styled('div')({\n gridAutoFlow: 'column',\n display: 'grid',\n gridGap: '10px',\n alignItems: 'center',\n});\n\nconst StyledColumnLabel = styled(InputContainer)(({ theme }) => ({\n width: '100%',\n paddingTop: theme.spacing(2),\n}));\n\nconst ErrorText = styled('div')(({ theme }) => ({\n fontSize: theme.typography.fontSize - 2,\n color: theme.palette.error.main,\n paddingTop: theme.spacing(1),\n}));\n\nclass ChoiceEditor extends React.Component {\n static propTypes = {\n correctResponse: PropTypes.array.isRequired,\n choices: PropTypes.array.isRequired,\n onChange: PropTypes.func.isRequired,\n imageSupport: PropTypes.shape({\n add: PropTypes.func.isRequired,\n delete: PropTypes.func.isRequired,\n }),\n maxImageHeight: PropTypes.object,\n maxImageWidth: PropTypes.object,\n toolbarOpts: PropTypes.object,\n pluginProps: PropTypes.object,\n placementArea: PropTypes.bool,\n singularChoiceLabel: PropTypes.string,\n pluralChoiceLabel: PropTypes.string,\n choicesLabel: PropTypes.string,\n errors: PropTypes.object,\n spellCheck: PropTypes.bool,\n };\n\n state = { warning: { open: false } };\n\n constructor(props) {\n super(props);\n\n this.onChoiceChange = (choice) => {\n const { choices, onChange, correctResponse } = this.props;\n const index = choices.findIndex((c) => c.id === choice.id);\n\n choices.splice(index, 1, { ...choices[index], label: choice.label });\n onChange(choices, correctResponse);\n };\n\n this.onDelete = (choice) => {\n const { choices, onChange, correctResponse, choicesLabel } = this.props;\n\n if (choices && choices.length === 3) {\n this.setState({\n warning: {\n open: true,\n text: `There have to be at least 3 ${choicesLabel}.`,\n },\n });\n } else {\n const updatedChoices = choices.filter((c) => c.id !== choice.id);\n const updatedCorrectResponse = correctResponse.filter((v) => v.id !== choice.id);\n\n onChange(updatedChoices, updatedCorrectResponse);\n }\n };\n\n this.addChoice = () => {\n const { choices, correctResponse, onChange, choicesLabel } = this.props;\n\n if (choices && choices.length === 10) {\n this.setState({\n warning: {\n open: true,\n text: `There can be maximum 10 ${choicesLabel}.`,\n },\n });\n } else {\n const freeId = findFreeChoiceSlot(choices);\n const id = `c${freeId}`;\n const newChoice = { id, label: '' };\n\n const newCorrectResponse = {\n id,\n /**\n * Note: weights are not configurable in the existing component\n * so we'll want do disable this in the controller and ignore it for now.\n */\n weight: 0,\n };\n\n const updatedChoices = choices.concat([newChoice]);\n const updatedCorrectResponse = correctResponse.concat([newCorrectResponse]);\n\n onChange(updatedChoices, updatedCorrectResponse);\n }\n };\n\n this.shuffleChoices = () => {\n const { onChange, choices, correctResponse, placementArea } = this.props;\n let shuffled = shuffle(choices);\n\n // if placementArea is disabled, make sure we don't shuffle choices in the correct order\n const shuffledCorrect =\n !placementArea &&\n isEqual(\n shuffled.map((item) => item.id),\n correctResponse.map((item) => item.id),\n );\n\n if (shuffledCorrect) {\n const shuffledTwice = shuffle(shuffled);\n\n onChange(shuffledTwice, correctResponse);\n } else {\n onChange(shuffled, correctResponse);\n }\n };\n }\n\n render() {\n const {\n correctResponse,\n choices,\n imageSupport,\n toolbarOpts,\n pluginProps,\n singularChoiceLabel,\n pluralChoiceLabel,\n choicesLabel,\n spellCheck,\n maxImageWidth,\n maxImageHeight,\n errors,\n mathMlOptions = {},\n ordering,\n } = this.props;\n const { warning } = this.state;\n const { choicesErrors, orderError } = errors || {};\n\n const vTilerStyle = {\n gridTemplateColumns: 'repeat(2, 1fr)',\n gridTemplateRows: `repeat(${choices.length}, 1fr)`,\n };\n\n return (\n <div>\n <StyledVTiler style={{ gridTemplateColumns: 'repeat(2, 1fr)' }}>\n <StyledColumnLabel label={`Student ${choicesLabel || 'Choices'}`} />\n <StyledColumnLabel label=\"Correct Order\" />\n </StyledVTiler>\n <StyledVTiler style={vTilerStyle}>\n {ordering.tiles.map((choice, index) => (\n <ChoiceTile\n key={`${choice.type}-${choice.id}`}\n choice={choice}\n index={index}\n imageSupport={imageSupport}\n onDelete={this.onDelete.bind(this, choice)}\n onChoiceChange={this.onChoiceChange}\n toolbarOpts={toolbarOpts}\n pluginProps={pluginProps}\n choices={choices}\n choicesLabel={choicesLabel}\n spellCheck={spellCheck}\n maxImageWidth={maxImageWidth}\n maxImageHeight={maxImageHeight}\n error={choicesErrors?.[choice.id] || (orderError && ' ') || null}\n mathMlOptions={mathMlOptions}\n />\n ))}\n </StyledVTiler>\n {orderError && <ErrorText>{orderError}</ErrorText>}\n <StyledControls>\n <StyledAddButton\n onClick={this.shuffleChoices}\n size=\"small\"\n variant=\"contained\">\n {`SHUFFLE ${pluralChoiceLabel}`.toUpperCase()}\n </StyledAddButton>\n\n <StyledAddButton\n onClick={this.addChoice}\n size=\"small\"\n variant=\"contained\">\n {`ADD ${singularChoiceLabel}`.toUpperCase()}\n </StyledAddButton>\n </StyledControls>\n <AlertDialog\n open={warning.open}\n title=\"Warning\"\n text={warning.text}\n onConfirm={() => this.setState({ warning: { open: false } })}\n />\n </div>\n );\n }\n}\n\nexport default ChoiceEditor;\n"],"mappings":";;;;;;;;AAAA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,MAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,QAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,QAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,OAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AAC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AC;IAC5BC,GAAG,EAAEL,kBAAS,CAACG,IAAI,CAACD,UAAU;IAC9BI,MAAM,EAAEN,kBAAS,CAACG,IAAI,CAACD;EACzB,CAAC,CAAC;EACFzB,cAAc,EAAEuB,kBAAS,CAACO,MAAM;EAChC/B,aAAa,EAAEwB,kBAAS,CAACO,MAAM;EAC/BpC,WAAW,EAAE6B,kBAAS,CAACO,MAAM;EAC7BnC,WAAW,EAAE4B,kBAAS,CAACO,MAAM;EAC7B7C,aAAa,EAAEsC,kBAAS,CAACQ,IAAI;EAC7BnC,mBAAmB,EAAE2B,kBAAS,CAACS,MAAM;EACrCnC,iBAAiB,EAAE0B,kBAAS,CAACS,MAAM;EACnC9D,YAAY,EAAEqD,kBAAS,CAACS,MAAM;EAC9B/B,MAAM,EAAEsB,kBAAS,CAACO,MAAM;EACxBhC,UAAU,EAAEyB,kBAAS,CAACQ;AACxB,CAAC;AAAA,IAAAE,QAAA,GAAAC,OAAA,CAAA5E,OAAA,GAqKYN,YAAY","ignoreList":[]}
@@ -1,278 +1,187 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- var _typeof = require("@babel/runtime/helpers/typeof");
6
-
7
4
  Object.defineProperty(exports, "__esModule", {
8
5
  value: true
9
6
  });
10
- exports["default"] = exports.ChoiceTile = void 0;
11
-
12
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
13
-
14
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
15
-
16
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
17
-
18
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
19
-
20
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
21
-
22
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
23
-
24
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
25
-
26
- var _editableHtml = _interopRequireWildcard(require("@pie-lib/editable-html"));
27
-
28
- var _CardActions = _interopRequireDefault(require("@material-ui/core/CardActions"));
29
-
30
- var _DragHandle = _interopRequireDefault(require("@material-ui/icons/DragHandle"));
31
-
32
- var _reactDnd = require("react-dnd");
33
-
34
- var _classnames = _interopRequireDefault(require("classnames"));
35
-
36
- var _IconButton = _interopRequireDefault(require("@material-ui/core/IconButton"));
37
-
38
- var _propTypes = _interopRequireDefault(require("prop-types"));
39
-
7
+ exports.default = exports.ChoiceTile = void 0;
8
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
40
9
  var _react = _interopRequireDefault(require("react"));
41
-
42
- var _RemoveCircle = _interopRequireDefault(require("@material-ui/icons/RemoveCircle"));
43
-
10
+ var _propTypes = _interopRequireDefault(require("prop-types"));
44
11
  var _debug = _interopRequireDefault(require("debug"));
45
-
46
- var _styles = require("@material-ui/core/styles");
47
-
12
+ var _core = require("@dnd-kit/core");
13
+ var _CardActions = _interopRequireDefault(require("@mui/material/CardActions"));
14
+ var _DragHandle = _interopRequireDefault(require("@mui/icons-material/DragHandle"));
15
+ var _IconButton = _interopRequireDefault(require("@mui/material/IconButton"));
16
+ var _RemoveCircle = _interopRequireDefault(require("@mui/icons-material/RemoveCircle"));
17
+ var _styles = require("@mui/material/styles");
48
18
  var _renderUi = require("@pie-lib/render-ui");
49
-
50
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
51
-
52
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && 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; }
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:placement-ordering:configure:choice-tile');
59
-
60
- var ChoiceTile = /*#__PURE__*/function (_React$Component) {
61
- (0, _inherits2["default"])(ChoiceTile, _React$Component);
62
-
63
- var _super = _createSuper(ChoiceTile);
64
-
65
- function ChoiceTile() {
66
- var _this;
67
-
68
- (0, _classCallCheck2["default"])(this, ChoiceTile);
69
-
70
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
71
- args[_key] = arguments[_key];
72
- }
73
-
74
- _this = _super.call.apply(_super, [this].concat(args));
75
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onLabelChange", function (label) {
76
- var _this$props = _this.props,
77
- choice = _this$props.choice,
78
- onChoiceChange = _this$props.onChoiceChange;
79
- choice.label = label;
80
- onChoiceChange(choice);
81
- });
82
- return _this;
83
- }
84
-
85
- (0, _createClass2["default"])(ChoiceTile, [{
86
- key: "render",
87
- value: function render() {
88
- var _this$props2 = this.props,
89
- _this$props2$choice = _this$props2.choice,
90
- label = _this$props2$choice.label,
91
- editable = _this$props2$choice.editable,
92
- type = _this$props2$choice.type,
93
- isDragging = _this$props2.isDragging,
94
- connectDragSource = _this$props2.connectDragSource,
95
- connectDropTarget = _this$props2.connectDropTarget,
96
- classes = _this$props2.classes,
97
- onDelete = _this$props2.onDelete,
98
- imageSupport = _this$props2.imageSupport,
99
- spellCheck = _this$props2.spellCheck,
100
- toolbarOpts = _this$props2.toolbarOpts,
101
- pluginProps = _this$props2.pluginProps,
102
- maxImageWidth = _this$props2.maxImageWidth,
103
- maxImageHeight = _this$props2.maxImageHeight,
104
- error = _this$props2.error,
105
- _this$props2$mathMlOp = _this$props2.mathMlOptions,
106
- mathMlOptions = _this$props2$mathMlOp === void 0 ? {} : _this$props2$mathMlOp;
107
- var dragSourceOpts = {}; //dropEffect: moveOnDrag ? 'move' : 'copy'};
108
-
109
- var filteredDefaultPlugins = (_editableHtml.DEFAULT_PLUGINS || []).filter(function (p) {
110
- return p !== 'bulleted-list' && p !== 'numbered-list';
111
- });
112
- var opacity = isDragging ? 0 : 1;
113
-
114
- var markup = /*#__PURE__*/_react["default"].createElement("div", {
115
- className: classes.choiceTile,
116
- style: {
117
- opacity: opacity,
118
- width: '100%'
119
- }
120
- }, /*#__PURE__*/_react["default"].createElement("div", {
121
- style: {
122
- width: '100%',
123
- display: 'flex'
124
- }
125
- }, /*#__PURE__*/_react["default"].createElement(_CardActions["default"], null, /*#__PURE__*/_react["default"].createElement("span", {
126
- className: (0, _classnames["default"])(classes.dragHandle)
127
- }, /*#__PURE__*/_react["default"].createElement(_DragHandle["default"], {
128
- className: classes.actions
129
- }))), /*#__PURE__*/_react["default"].createElement(_editableHtml["default"], {
130
- disabled: !editable,
131
- className: (0, _classnames["default"])(classes.prompt, !editable && classes.targetPrompt),
132
- placeholder: type !== 'target' && !label.includes('data-latex') ? 'Enter a choice' : '',
133
- markup: label,
134
- imageSupport: imageSupport || undefined,
135
- onChange: this.onLabelChange,
136
- pluginProps: pluginProps,
137
- toolbarOpts: toolbarOpts,
138
- activePlugins: filteredDefaultPlugins,
139
- spellCheck: spellCheck,
140
- autoWidthToolbar: true,
141
- maxImageWidth: maxImageWidth,
142
- maxImageHeight: maxImageHeight,
143
- languageCharactersProps: [{
144
- language: 'spanish'
145
- }, {
146
- language: 'special'
147
- }],
148
- error: editable && error,
149
- mathMlOptions: mathMlOptions
150
- }), editable && /*#__PURE__*/_react["default"].createElement("div", {
151
- className: classes.controls
152
- }, /*#__PURE__*/_react["default"].createElement(_IconButton["default"], {
153
- className: classes.customColor,
154
- onClick: onDelete
155
- }, /*#__PURE__*/_react["default"].createElement(_RemoveCircle["default"], {
156
- classes: {
157
- root: classes.removeCircle
158
- }
159
- })))), editable && error && /*#__PURE__*/_react["default"].createElement("div", {
160
- className: classes.errorText
161
- }, error));
162
-
163
- return connectDragSource(connectDropTarget( /*#__PURE__*/_react["default"].createElement("div", null, markup)), dragSourceOpts);
164
- }
165
- }]);
166
- return ChoiceTile;
167
- }(_react["default"].Component);
168
-
169
- exports.ChoiceTile = ChoiceTile;
170
- (0, _defineProperty2["default"])(ChoiceTile, "propTypes", {
171
- connectDragSource: _propTypes["default"].func.isRequired,
172
- connectDropTarget: _propTypes["default"].func.isRequired,
173
- isDragging: _propTypes["default"].bool.isRequired,
174
- id: _propTypes["default"].any,
175
- maxImageHeight: _propTypes["default"].object,
176
- maxImageWidth: _propTypes["default"].object,
177
- label: _propTypes["default"].string,
178
- isOver: _propTypes["default"].bool,
179
- classes: _propTypes["default"].object.isRequired,
180
- type: _propTypes["default"].string,
181
- empty: _propTypes["default"].bool,
182
- disabled: _propTypes["default"].bool,
183
- outcome: _propTypes["default"].object,
184
- index: _propTypes["default"].number,
185
- imageSupport: _propTypes["default"].shape({
186
- add: _propTypes["default"].func.isRequired,
187
- "delete": _propTypes["default"].func.isRequired
188
- }),
189
- choice: _propTypes["default"].object,
190
- choices: _propTypes["default"].array.isRequired,
191
- onChoiceChange: _propTypes["default"].func.isRequired,
192
- onDelete: _propTypes["default"].func.isRequired,
193
- toolbarOpts: _propTypes["default"].object,
194
- pluginProps: _propTypes["default"].object,
195
- choicesLabel: _propTypes["default"].string,
196
- error: _propTypes["default"].string,
197
- spellCheck: _propTypes["default"].bool
19
+ var _editableHtmlTipTap = _interopRequireWildcard(require("@pie-lib/editable-html-tip-tap"));
20
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
21
+ const log = (0, _debug.default)('@pie-element:placement-ordering:configure:choice-tile');
22
+ const StyledChoiceTile = (0, _styles.styled)('div')(({
23
+ theme
24
+ }) => ({
25
+ margin: `${theme.spacing(1)}px 0`,
26
+ backgroundColor: theme.palette.background.paper,
27
+ display: 'flex',
28
+ flexDirection: 'column',
29
+ cursor: 'move'
30
+ }));
31
+ const StyledEditableHtml = (0, _styles.styled)(_editableHtmlTipTap.default)(({
32
+ theme,
33
+ isTargetPrompt
34
+ }) => ({
35
+ width: '80%',
36
+ border: 'none',
37
+ borderRadius: '4px',
38
+ ...(isTargetPrompt && {
39
+ backgroundColor: theme.palette.error.light
40
+ })
41
+ }));
42
+ const StyledControls = (0, _styles.styled)('div')(() => ({
43
+ display: 'flex',
44
+ justifyContent: 'flex-end'
45
+ }));
46
+ const StyledActions = (0, _styles.styled)(_DragHandle.default)(({
47
+ theme
48
+ }) => ({
49
+ color: theme.palette.error[400]
50
+ }));
51
+ const StyledErrorText = (0, _styles.styled)('div')(({
52
+ theme
53
+ }) => ({
54
+ fontSize: theme.typography.fontSize - 2,
55
+ color: theme.palette.error.main,
56
+ marginLeft: theme.spacing(5),
57
+ marginTop: theme.spacing(1)
58
+ }));
59
+ const StyledRemoveCircle = (0, _styles.styled)(_RemoveCircle.default)(({
60
+ theme
61
+ }) => ({
62
+ fill: theme.palette.error[500]
63
+ }));
64
+ const StyledIconButton = (0, _styles.styled)(_IconButton.default)({
65
+ color: `${_renderUi.color.tertiary()} !important`
198
66
  });
199
- var Styled = (0, _styles.withStyles)(function (theme) {
200
- return {
201
- removeCircle: {
202
- fill: theme.palette.error[500]
203
- },
204
- choiceTile: {
205
- cursor: 'move',
206
- backgroundColor: theme.palette.common.white,
207
- margin: "".concat(theme.spacing.unit, "px 0"),
208
- display: 'flex',
209
- flexDirection: 'column'
210
- },
211
- controls: {
212
- display: 'flex',
213
- justifyContent: 'flex-end'
214
- },
215
- prompt: {
216
- width: '80%',
217
- border: 'none',
218
- borderRadius: '4px'
219
- },
220
- targetPrompt: {
221
- backgroundColor: theme.palette.error['A100']
222
- },
223
- actions: {
224
- color: theme.palette.error[400]
225
- },
226
- errorText: {
227
- fontSize: theme.typography.fontSize - 2,
228
- color: theme.palette.error.main,
229
- marginLeft: theme.spacing.unit * 5,
230
- marginTop: theme.spacing.unit
231
- },
232
- correctOrder: {
233
- position: 'absolute',
234
- top: 0,
235
- fontSize: theme.typography.fontSize - 2,
236
- color: _renderUi.color.disabled()
237
- },
238
- customColor: {
239
- color: "".concat(_renderUi.color.tertiary(), " !important")
67
+ const ChoiceTile = props => {
68
+ const {
69
+ choice,
70
+ index,
71
+ onChoiceChange,
72
+ onDelete,
73
+ imageSupport,
74
+ spellCheck,
75
+ toolbarOpts,
76
+ pluginProps,
77
+ maxImageWidth,
78
+ maxImageHeight,
79
+ error,
80
+ mathMlOptions = {}
81
+ } = props;
82
+ const {
83
+ label,
84
+ editable,
85
+ type
86
+ } = choice;
87
+ const draggableId = `${type}-${choice.id}`;
88
+ const droppableId = `${type}-drop-${choice.id}`;
89
+ const {
90
+ attributes,
91
+ listeners,
92
+ setNodeRef: setDragRef,
93
+ transform,
94
+ isDragging
95
+ } = (0, _core.useDraggable)({
96
+ id: draggableId,
97
+ data: {
98
+ id: choice.id,
99
+ index,
100
+ type
101
+ }
102
+ });
103
+ const {
104
+ setNodeRef: setDropRef
105
+ } = (0, _core.useDroppable)({
106
+ id: droppableId,
107
+ data: {
108
+ id: choice.id,
109
+ index,
110
+ type
240
111
  }
112
+ });
113
+ const onLabelChange = label => {
114
+ choice.label = label;
115
+ onChoiceChange(choice);
241
116
  };
242
- })(ChoiceTile);
243
- var NAME = 'choice-config';
244
- var choiceSource = {
245
- beginDrag: function beginDrag(props) {
246
- return {
247
- id: props.choice.id,
248
- index: props.index,
249
- type: props.choice.type,
250
- instanceId: props.choice.instanceId
251
- };
252
- }
253
- };
254
- var StyledSource = (0, _reactDnd.DragSource)(NAME, choiceSource, function (connect, monitor) {
255
- return {
256
- connectDragSource: connect.dragSource(),
257
- isDragging: monitor.isDragging()
117
+ const style = {
118
+ transform: transform ? `translate3d(${transform.x}px, ${transform.y}px, 0)` : undefined,
119
+ opacity: isDragging ? 0.5 : 1,
120
+ width: '100%'
258
121
  };
259
- })(Styled);
260
- var choiceTarget = {
261
- hover: function hover() {
262
- log('[hover]');
263
- },
264
- drop: function drop(props, monitor) {
265
- var item = monitor.getItem();
266
- log('[drop] item: ', item, 'didDrop?', monitor.didDrop());
267
- props.onDropChoice(item, props.index);
268
- }
122
+ const filteredDefaultPlugins = (_editableHtmlTipTap.DEFAULT_PLUGINS || []).filter(p => p !== 'bulleted-list' && p !== 'numbered-list');
123
+ return /*#__PURE__*/_react.default.createElement("div", {
124
+ ref: setDropRef
125
+ }, /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({
126
+ ref: setDragRef
127
+ }, listeners, attributes), /*#__PURE__*/_react.default.createElement(StyledChoiceTile, {
128
+ style: style
129
+ }, /*#__PURE__*/_react.default.createElement("div", {
130
+ style: {
131
+ width: '100%',
132
+ display: 'flex'
133
+ }
134
+ }, /*#__PURE__*/_react.default.createElement(_CardActions.default, null, /*#__PURE__*/_react.default.createElement(StyledActions, null)), /*#__PURE__*/_react.default.createElement(StyledEditableHtml, {
135
+ disabled: !editable,
136
+ placeholder: type !== 'target' && !label.includes('data-latex') ? 'Enter a choice' : '',
137
+ markup: label,
138
+ imageSupport: imageSupport || undefined,
139
+ onChange: onLabelChange,
140
+ pluginProps: pluginProps,
141
+ toolbarOpts: toolbarOpts,
142
+ activePlugins: filteredDefaultPlugins,
143
+ spellCheck: spellCheck,
144
+ autoWidthToolbar: true,
145
+ maxImageWidth: maxImageWidth,
146
+ maxImageHeight: maxImageHeight,
147
+ languageCharactersProps: [{
148
+ language: 'spanish'
149
+ }, {
150
+ language: 'special'
151
+ }],
152
+ error: editable && error,
153
+ mathMlOptions: mathMlOptions
154
+ }), editable && /*#__PURE__*/_react.default.createElement(StyledControls, null, /*#__PURE__*/_react.default.createElement(StyledIconButton, {
155
+ onClick: onDelete,
156
+ size: "large"
157
+ }, /*#__PURE__*/_react.default.createElement(StyledRemoveCircle, null)))), editable && error && /*#__PURE__*/_react.default.createElement(StyledErrorText, null, error))));
269
158
  };
270
- var StyledSourceAndTarget = (0, _reactDnd.DropTarget)(NAME, choiceTarget, function (connect, monitor) {
271
- return {
272
- connectDropTarget: connect.dropTarget(),
273
- isOver: monitor.isOver()
274
- };
275
- })(StyledSource);
276
- var _default = StyledSourceAndTarget;
277
- exports["default"] = _default;
159
+ exports.ChoiceTile = ChoiceTile;
160
+ ChoiceTile.propTypes = {
161
+ id: _propTypes.default.any,
162
+ maxImageHeight: _propTypes.default.object,
163
+ maxImageWidth: _propTypes.default.object,
164
+ label: _propTypes.default.string,
165
+ isOver: _propTypes.default.bool,
166
+ type: _propTypes.default.string,
167
+ empty: _propTypes.default.bool,
168
+ disabled: _propTypes.default.bool,
169
+ outcome: _propTypes.default.object,
170
+ index: _propTypes.default.number,
171
+ imageSupport: _propTypes.default.shape({
172
+ add: _propTypes.default.func.isRequired,
173
+ delete: _propTypes.default.func.isRequired
174
+ }),
175
+ choice: _propTypes.default.object,
176
+ choices: _propTypes.default.array.isRequired,
177
+ onChoiceChange: _propTypes.default.func.isRequired,
178
+ onDelete: _propTypes.default.func.isRequired,
179
+ toolbarOpts: _propTypes.default.object,
180
+ pluginProps: _propTypes.default.object,
181
+ choicesLabel: _propTypes.default.string,
182
+ error: _propTypes.default.string,
183
+ spellCheck: _propTypes.default.bool,
184
+ mathMlOptions: _propTypes.default.object
185
+ };
186
+ var _default = exports.default = ChoiceTile;
278
187
  //# sourceMappingURL=choice-tile.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/choice-tile.jsx"],"names":["log","ChoiceTile","label","props","choice","onChoiceChange","editable","type","isDragging","connectDragSource","connectDropTarget","classes","onDelete","imageSupport","spellCheck","toolbarOpts","pluginProps","maxImageWidth","maxImageHeight","error","mathMlOptions","dragSourceOpts","filteredDefaultPlugins","DEFAULT_PLUGINS","filter","p","opacity","markup","choiceTile","width","display","dragHandle","actions","prompt","targetPrompt","includes","undefined","onLabelChange","language","controls","customColor","root","removeCircle","errorText","React","Component","PropTypes","func","isRequired","bool","id","any","object","string","isOver","empty","disabled","outcome","index","number","shape","add","choices","array","choicesLabel","Styled","theme","fill","palette","cursor","backgroundColor","common","white","margin","spacing","unit","flexDirection","justifyContent","border","borderRadius","color","fontSize","typography","main","marginLeft","marginTop","correctOrder","position","top","tertiary","NAME","choiceSource","beginDrag","instanceId","StyledSource","connect","monitor","dragSource","choiceTarget","hover","drop","item","getItem","didDrop","onDropChoice","StyledSourceAndTarget","dropTarget"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;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AAGLnD,MAAAA,IAAI,EAAEJ,KAAK,CAACC,MAAN,CAAaG,IAHd;AAILsF,MAAAA,UAAU,EAAE1F,KAAK,CAACC,MAAN,CAAayF;AAJpB,KAAP;AAMD;AARkB,CAArB;AAWA,IAAMC,YAAY,GAAG,0BAAWJ,IAAX,EAAiBC,YAAjB,EAA+B,UAACI,OAAD,EAAUC,OAAV;AAAA,SAAuB;AACzEvF,IAAAA,iBAAiB,EAAEsF,OAAO,CAACE,UAAR,EADsD;AAEzEzF,IAAAA,UAAU,EAAEwF,OAAO,CAACxF,UAAR;AAF6D,GAAvB;AAAA,CAA/B,EAGjByD,MAHiB,CAArB;AAKA,IAAMiC,YAAY,GAAG;AACnBC,EAAAA,KADmB,mBACX;AACNnG,IAAAA,GAAG,CAAC,SAAD,CAAH;AACD,GAHkB;AAInBoG,EAAAA,IAJmB,gBAIdjG,KAJc,EAIP6F,OAJO,EAIE;AACnB,QAAMK,IAAI,GAAGL,OAAO,CAACM,OAAR,EAAb;AACAtG,IAAAA,GAAG,CAAC,eAAD,EAAkBqG,IAAlB,EAAwB,UAAxB,EAAoCL,OAAO,CAACO,OAAR,EAApC,CAAH;AAEApG,IAAAA,KAAK,CAACqG,YAAN,CAAmBH,IAAnB,EAAyBlG,KAAK,CAACuD,KAA/B;AACD;AATkB,CAArB;AAYA,IAAM+C,qBAAqB,GAAG,0BAAWf,IAAX,EAAiBQ,YAAjB,EAA+B,UAACH,OAAD,EAAUC,OAAV;AAAA,SAAuB;AAClFtF,IAAAA,iBAAiB,EAAEqF,OAAO,CAACW,UAAR,EAD+D;AAElFpD,IAAAA,MAAM,EAAE0C,OAAO,CAAC1C,MAAR;AAF0E,GAAvB;AAAA,CAA/B,EAG1BwC,YAH0B,CAA9B;eAKeW,qB","sourcesContent":["import EditableHtml, { DEFAULT_PLUGINS } from '@pie-lib/editable-html';\nimport CardActions from '@material-ui/core/CardActions';\nimport DragHandle from '@material-ui/icons/DragHandle';\n\nimport { DragSource, DropTarget } from 'react-dnd';\nimport classNames from 'classnames';\n\nimport IconButton from '@material-ui/core/IconButton';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport RemoveCircle from '@material-ui/icons/RemoveCircle';\nimport debug from 'debug';\nimport { withStyles } from '@material-ui/core/styles';\nimport { color } from '@pie-lib/render-ui';\n\nconst log = debug('@pie-element:placement-ordering:configure:choice-tile');\n\nexport class ChoiceTile extends React.Component {\n static propTypes = {\n connectDragSource: PropTypes.func.isRequired,\n connectDropTarget: PropTypes.func.isRequired,\n isDragging: PropTypes.bool.isRequired,\n id: PropTypes.any,\n maxImageHeight: PropTypes.object,\n maxImageWidth: PropTypes.object,\n label: PropTypes.string,\n isOver: PropTypes.bool,\n classes: PropTypes.object.isRequired,\n type: PropTypes.string,\n empty: PropTypes.bool,\n disabled: PropTypes.bool,\n outcome: PropTypes.object,\n index: PropTypes.number,\n imageSupport: PropTypes.shape({\n add: PropTypes.func.isRequired,\n delete: PropTypes.func.isRequired,\n }),\n choice: PropTypes.object,\n choices: PropTypes.array.isRequired,\n onChoiceChange: PropTypes.func.isRequired,\n onDelete: PropTypes.func.isRequired,\n toolbarOpts: PropTypes.object,\n pluginProps: PropTypes.object,\n choicesLabel: PropTypes.string,\n error: PropTypes.string,\n spellCheck: PropTypes.bool,\n };\n\n onLabelChange = (label) => {\n const { choice, onChoiceChange } = this.props;\n\n choice.label = label;\n onChoiceChange(choice);\n };\n\n render() {\n const {\n choice: { label, editable, type },\n isDragging,\n connectDragSource,\n connectDropTarget,\n classes,\n onDelete,\n imageSupport,\n spellCheck,\n toolbarOpts,\n pluginProps,\n maxImageWidth,\n maxImageHeight,\n error,\n mathMlOptions = {},\n } = this.props;\n\n const dragSourceOpts = {}; //dropEffect: moveOnDrag ? 'move' : 'copy'};\n const filteredDefaultPlugins = (DEFAULT_PLUGINS || []).filter(\n (p) => p !== 'bulleted-list' && p !== 'numbered-list',\n );\n\n const opacity = isDragging ? 0 : 1;\n const markup = (\n <div className={classes.choiceTile} style={{ opacity: opacity, width: '100%' }}>\n <div style={{ width: '100%', display: 'flex' }}>\n <CardActions>\n <span className={classNames(classes.dragHandle)}>\n <DragHandle className={classes.actions} />\n </span>\n </CardActions>\n\n <EditableHtml\n disabled={!editable}\n className={classNames(classes.prompt, !editable && classes.targetPrompt)}\n placeholder={type !== 'target' && !label.includes('data-latex') ? 'Enter a choice' : ''}\n markup={label}\n imageSupport={imageSupport || undefined}\n onChange={this.onLabelChange}\n pluginProps={pluginProps}\n toolbarOpts={toolbarOpts}\n activePlugins={filteredDefaultPlugins}\n spellCheck={spellCheck}\n autoWidthToolbar\n maxImageWidth={maxImageWidth}\n maxImageHeight={maxImageHeight}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n error={editable && error}\n mathMlOptions={mathMlOptions}\n />\n\n {editable && (\n <div className={classes.controls}>\n <IconButton className={classes.customColor} onClick={onDelete}>\n <RemoveCircle classes={{ root: classes.removeCircle }} />\n </IconButton>\n </div>\n )}\n </div>\n\n {editable && error && <div className={classes.errorText}>{error}</div>}\n </div>\n );\n\n return connectDragSource(connectDropTarget(<div>{markup}</div>), dragSourceOpts);\n }\n}\n\nconst Styled = withStyles((theme) => ({\n removeCircle: {\n fill: theme.palette.error[500],\n },\n choiceTile: {\n cursor: 'move',\n backgroundColor: theme.palette.common.white,\n margin: `${theme.spacing.unit}px 0`,\n display: 'flex',\n flexDirection: 'column',\n },\n controls: {\n display: 'flex',\n justifyContent: 'flex-end',\n },\n prompt: {\n width: '80%',\n border: 'none',\n borderRadius: '4px',\n },\n targetPrompt: {\n backgroundColor: theme.palette.error['A100'],\n },\n actions: {\n color: theme.palette.error[400],\n },\n errorText: {\n fontSize: theme.typography.fontSize - 2,\n color: theme.palette.error.main,\n marginLeft: theme.spacing.unit * 5,\n marginTop: theme.spacing.unit,\n },\n correctOrder: {\n position: 'absolute',\n top: 0,\n fontSize: theme.typography.fontSize - 2,\n color: color.disabled(),\n },\n customColor: {\n color: `${color.tertiary()} !important`,\n },\n}))(ChoiceTile);\n\nconst NAME = 'choice-config';\n\nconst choiceSource = {\n beginDrag(props) {\n return {\n id: props.choice.id,\n index: props.index,\n type: props.choice.type,\n instanceId: props.choice.instanceId,\n };\n },\n};\n\nconst StyledSource = DragSource(NAME, choiceSource, (connect, monitor) => ({\n connectDragSource: connect.dragSource(),\n isDragging: monitor.isDragging(),\n}))(Styled);\n\nconst choiceTarget = {\n hover() {\n log('[hover]');\n },\n drop(props, monitor) {\n const item = monitor.getItem();\n log('[drop] item: ', item, 'didDrop?', monitor.didDrop());\n\n props.onDropChoice(item, props.index);\n },\n};\n\nconst StyledSourceAndTarget = DropTarget(NAME, choiceTarget, (connect, monitor) => ({\n connectDropTarget: connect.dropTarget(),\n isOver: monitor.isOver(),\n}))(StyledSource);\n\nexport default StyledSourceAndTarget;\n"],"file":"choice-tile.js"}
1
+ {"version":3,"file":"choice-tile.js","names":["_react","_interopRequireDefault","require","_propTypes","_debug","_core","_CardActions","_DragHandle","_IconButton","_RemoveCircle","_styles","_renderUi","_editableHtmlTipTap","_interopRequireWildcard","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","log","debug","StyledChoiceTile","styled","theme","margin","spacing","backgroundColor","palette","background","paper","display","flexDirection","cursor","StyledEditableHtml","EditableHtml","isTargetPrompt","width","border","borderRadius","error","light","StyledControls","justifyContent","StyledActions","DragHandle","color","StyledErrorText","fontSize","typography","main","marginLeft","marginTop","StyledRemoveCircle","RemoveCircle","fill","StyledIconButton","IconButton","tertiary","ChoiceTile","props","choice","index","onChoiceChange","onDelete","imageSupport","spellCheck","toolbarOpts","pluginProps","maxImageWidth","maxImageHeight","mathMlOptions","label","editable","type","draggableId","id","droppableId","attributes","listeners","setNodeRef","setDragRef","transform","isDragging","useDraggable","data","setDropRef","useDroppable","onLabelChange","style","x","y","undefined","opacity","filteredDefaultPlugins","DEFAULT_PLUGINS","filter","p","createElement","ref","_extends2","disabled","placeholder","includes","markup","onChange","activePlugins","autoWidthToolbar","languageCharactersProps","language","onClick","size","exports","propTypes","PropTypes","any","object","string","isOver","bool","empty","outcome","number","shape","add","func","isRequired","delete","choices","array","choicesLabel","_default"],"sources":["../src/choice-tile.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport debug from 'debug';\nimport { useDraggable, useDroppable } from '@dnd-kit/core';\nimport CardActions from '@mui/material/CardActions';\nimport DragHandle from '@mui/icons-material/DragHandle';\nimport IconButton from '@mui/material/IconButton';\nimport RemoveCircle from '@mui/icons-material/RemoveCircle';\nimport { styled } from '@mui/material/styles';\n\nimport { color } from '@pie-lib/render-ui';\nimport EditableHtml, { DEFAULT_PLUGINS } from '@pie-lib/editable-html-tip-tap';\n\nconst log = debug('@pie-element:placement-ordering:configure:choice-tile');\n\nconst StyledChoiceTile = styled('div')(({ theme }) => ({\n margin: `${theme.spacing(1)}px 0`,\n backgroundColor: theme.palette.background.paper,\n display: 'flex',\n flexDirection: 'column',\n cursor: 'move'\n}));\n\nconst StyledEditableHtml = styled(EditableHtml)(({ theme, isTargetPrompt }) => ({\n width: '80%',\n border: 'none',\n borderRadius: '4px',\n ...(isTargetPrompt && {\n backgroundColor: theme.palette.error.light,\n }),\n}));\n\nconst StyledControls = styled('div')(() => ({\n display: 'flex',\n justifyContent: 'flex-end',\n}));\n\nconst StyledActions = styled(DragHandle)(({ theme }) => ({\n color: theme.palette.error[400],\n}));\n\nconst StyledErrorText = styled('div')(({ theme }) => ({\n fontSize: theme.typography.fontSize - 2,\n color: theme.palette.error.main,\n marginLeft: theme.spacing(5),\n marginTop: theme.spacing(1),\n}));\n\nconst StyledRemoveCircle = styled(RemoveCircle)(({ theme }) => ({\n fill: theme.palette.error[500],\n}));\n\nconst StyledIconButton = styled(IconButton)({\n color: `${color.tertiary()} !important`,\n});\n\nexport const ChoiceTile = (props) => {\n const {\n choice,\n index,\n onChoiceChange,\n onDelete,\n imageSupport,\n spellCheck,\n toolbarOpts,\n pluginProps,\n maxImageWidth,\n maxImageHeight,\n error,\n mathMlOptions = {},\n } = props;\n const { label, editable, type } = choice;\n const draggableId = `${type}-${choice.id}`;\n const droppableId = `${type}-drop-${choice.id}`;\n\n const {\n attributes,\n listeners,\n setNodeRef: setDragRef,\n transform,\n isDragging,\n } = useDraggable({\n id: draggableId,\n data: {\n id: choice.id,\n index,\n type,\n },\n });\n\n const {\n setNodeRef: setDropRef,\n } = useDroppable({\n id: droppableId,\n data: {\n id: choice.id,\n index,\n type,\n },\n });\n\n const onLabelChange = (label) => {\n choice.label = label;\n onChoiceChange(choice);\n };\n\n const style = {\n transform: transform ? `translate3d(${transform.x}px, ${transform.y}px, 0)` : undefined,\n opacity: isDragging ? 0.5 : 1,\n width: '100%',\n };\n\n const filteredDefaultPlugins = (DEFAULT_PLUGINS || []).filter(\n (p) => p !== 'bulleted-list' && p !== 'numbered-list',\n );\n\n return (\n <div ref={setDropRef}>\n <div ref={setDragRef} {...listeners} {...attributes}>\n <StyledChoiceTile style={style}>\n <div style={{ width: '100%', display: 'flex' }}>\n <CardActions>\n <StyledActions />\n </CardActions>\n\n <StyledEditableHtml\n disabled={!editable}\n placeholder={type !== 'target' && !label.includes('data-latex') ? 'Enter a choice' : ''}\n markup={label}\n imageSupport={imageSupport || undefined}\n onChange={onLabelChange}\n pluginProps={pluginProps}\n toolbarOpts={toolbarOpts}\n activePlugins={filteredDefaultPlugins}\n spellCheck={spellCheck}\n autoWidthToolbar\n maxImageWidth={maxImageWidth}\n maxImageHeight={maxImageHeight}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n error={editable && error}\n mathMlOptions={mathMlOptions}\n />\n\n {editable && (\n <StyledControls>\n <StyledIconButton onClick={onDelete} size=\"large\">\n <StyledRemoveCircle />\n </StyledIconButton>\n </StyledControls>\n )}\n </div>\n\n {editable && error && <StyledErrorText>{error}</StyledErrorText>}\n </StyledChoiceTile>\n </div>\n </div>\n );\n};\n\nChoiceTile.propTypes = {\n id: PropTypes.any,\n maxImageHeight: PropTypes.object,\n maxImageWidth: PropTypes.object,\n label: PropTypes.string,\n isOver: PropTypes.bool,\n type: PropTypes.string,\n empty: PropTypes.bool,\n disabled: PropTypes.bool,\n outcome: PropTypes.object,\n index: PropTypes.number,\n imageSupport: PropTypes.shape({\n add: PropTypes.func.isRequired,\n delete: PropTypes.func.isRequired,\n }),\n choice: PropTypes.object,\n choices: PropTypes.array.isRequired,\n onChoiceChange: PropTypes.func.isRequired,\n onDelete: PropTypes.func.isRequired,\n toolbarOpts: PropTypes.object,\n pluginProps: PropTypes.object,\n choicesLabel: PropTypes.string,\n error: PropTypes.string,\n spellCheck: PropTypes.bool,\n mathMlOptions: PropTypes.object,\n};\n\nexport default ChoiceTile;\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,MAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,WAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,WAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,aAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AAEA,IAAAS,SAAA,GAAAT,OAAA;AACA,IAAAU,mBAAA,GAAAC,uBAAA,CAAAX,OAAA;AAA+E,SAAAW,wBAAAC,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAH,uBAAA,YAAAA,CAAAC,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAA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