@pie-element/placement-ordering 14.1.7 → 14.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/configure/CHANGELOG.md +6 -0
- package/configure/lib/choice-editor.js +1 -1
- package/configure/lib/choice-editor.js.map +1 -1
- package/configure/lib/choice-tile.js +2 -1
- package/configure/lib/choice-tile.js.map +1 -1
- package/configure/package.json +3 -3
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [14.1.8](https://github.com/pie-framework/pie-elements/compare/@pie-element/placement-ordering@14.1.7...@pie-element/placement-ordering@14.1.8) (2026-07-31)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- **placement-ordering:** adjust choice grid row height and center choices PIE-787 ([ad3e41e](https://github.com/pie-framework/pie-elements/commit/ad3e41e606a1e80b2c6ba2c37e18367cbb9ccda1))
|
|
11
|
+
|
|
6
12
|
## [14.1.7](https://github.com/pie-framework/pie-elements/compare/@pie-element/placement-ordering@14.1.6...@pie-element/placement-ordering@14.1.7) (2026-07-08)
|
|
7
13
|
|
|
8
14
|
### Bug Fixes
|
package/configure/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [11.1.8](https://github.com/pie-framework/pie-elements/compare/@pie-element/placement-ordering-configure@11.1.7...@pie-element/placement-ordering-configure@11.1.8) (2026-07-31)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- **placement-ordering:** adjust choice grid row height and center choices PIE-787 ([ad3e41e](https://github.com/pie-framework/pie-elements/commit/ad3e41e606a1e80b2c6ba2c37e18367cbb9ccda1))
|
|
11
|
+
|
|
6
12
|
## [11.1.7](https://github.com/pie-framework/pie-elements/compare/@pie-element/placement-ordering-configure@11.1.6...@pie-element/placement-ordering-configure@11.1.7) (2026-07-08)
|
|
7
13
|
|
|
8
14
|
### Bug Fixes
|
|
@@ -181,7 +181,7 @@ class ChoiceEditor extends _react.default.Component {
|
|
|
181
181
|
} = errors || {};
|
|
182
182
|
const vTilerStyle = {
|
|
183
183
|
gridTemplateColumns: 'repeat(2, 1fr)',
|
|
184
|
-
gridTemplateRows: `repeat(${choices.length},
|
|
184
|
+
gridTemplateRows: `repeat(${choices.length}, auto)`
|
|
185
185
|
};
|
|
186
186
|
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(StyledVTiler, {
|
|
187
187
|
style: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"choice-editor.js","names":["_propTypes","_interopRequireDefault","require","_react","_debug","_lodashEs","_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 { isEqual, shuffle } from 'lodash-es';\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 onClick={this.shuffleChoices} size=\"small\" variant=\"contained\">\n {`SHUFFLE ${pluralChoiceLabel}`.toUpperCase()}\n </StyledAddButton>\n\n <StyledAddButton onClick={this.addChoice} size=\"small\" 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 />\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E;UAAEC,IAAI,EAAE;QAAM;MAAE,CAAC;IAAE,CAC9D,CACE,CAAC;EAEV;AACF;AAAC,IAAAH,gBAAA,CAAAC,OAAA,EAhLKN,YAAY,eACG;EACjBY,eAAe,EAAE2D,kBAAS,CAACC,KAAK,CAACC,UAAU;EAC3C9G,OAAO,EAAE4G,kBAAS,CAACC,KAAK,CAACC,UAAU;EACnC9D,QAAQ,EAAE4D,kBAAS,CAACG,IAAI,CAACD,UAAU;EACnChC,YAAY,EAAE8B,kBAAS,CAACI,KAAK,CAAC;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,GA+JYN,YAAY","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"choice-editor.js","names":["_propTypes","_interopRequireDefault","require","_react","_debug","_lodashEs","_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 { isEqual, shuffle } from 'lodash-es';\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}, auto)`,\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 onClick={this.shuffleChoices} size=\"small\" variant=\"contained\">\n {`SHUFFLE ${pluralChoiceLabel}`.toUpperCase()}\n </StyledAddButton>\n\n <StyledAddButton onClick={this.addChoice} size=\"small\" 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,SAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AAEA,IAAAQ,WAAA,GAAAT,sBAAA,CAAAC,OAAA;AAEA,SAASS,kBAAkBA,CAACC,OAAO,EAAE;EACnC,IAAIC,IAAI,GAAG,CAAC;EACZ,MAAMC,GAAG,GAAGF,OAAO,CAACG,GAAG,CAAEC,CAAC,IAAKA,CAAC,CAACC,EAAE,CAAC;EAEpC,OAAOH,GAAG,CAACI,QAAQ,CAAC,IAAIL,IAAI,EAAE,CAAC,EAAE;IAC/BA,IAAI,EAAE;EACR;EAEA,OAAOA,IAAI;AACb;AAEA,MAAMM,GAAG,GAAG,IAAAC,cAAK,EAAC,yDAAyD,CAAC;AAE5E,MAAMC,cAAc,GAAG,IAAAC,cAAM,EAAC,KAAK,CAAC,CAAC;EACnCC,OAAO,EAAE,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AACO,MAAM;EACxBhC,UAAU,EAAEyB,kBAAS,CAACQ;AACxB,CAAC;AAAA,IAAAE,QAAA,GAAAC,OAAA,CAAA5E,OAAA,GA+JYN,YAAY","ignoreList":[]}
|
|
@@ -147,7 +147,8 @@ const ChoiceTile = props => {
|
|
|
147
147
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
148
148
|
style: {
|
|
149
149
|
width: '100%',
|
|
150
|
-
display: 'flex'
|
|
150
|
+
display: 'flex',
|
|
151
|
+
alignItems: 'center'
|
|
151
152
|
}
|
|
152
153
|
}, /*#__PURE__*/_react.default.createElement(_CardActions.default, null, /*#__PURE__*/_react.default.createElement(StyledActions, null)), /*#__PURE__*/_react.default.createElement(StyledEditableHtml, {
|
|
153
154
|
disabled: !editable,
|
|
@@ -1 +1 @@
|
|
|
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","touchAction","StyledEditableHtml","EditableHtml","isTargetPrompt","width","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","isEditableElement","target","closest","isContentEditable","filteredListeners","onKeyDown","onPointerDown","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)} 0`,\n backgroundColor: theme.palette.background.paper,\n display: 'flex',\n flexDirection: 'column',\n cursor: 'move',\n touchAction: 'none',\n}));\n\nconst StyledEditableHtml = styled(EditableHtml)(({ theme, isTargetPrompt }) => ({\n width: '80%',\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 { setNodeRef: setDropRef } = 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((p) => p !== 'bulleted-list' && p !== 'numbered-list');\n\n const isEditableElement = (target) =>\n target.closest('[contenteditable]') ||\n target.closest('input') ||\n target.closest('textarea') ||\n target.isContentEditable;\n\n // edit listeners to prevent dragging when interacting with editable-html element\n const filteredListeners = {\n ...listeners,\n onKeyDown: (e) => {\n if (isEditableElement(e.target)) {\n return;\n }\n\n listeners?.onKeyDown?.(e);\n },\n onPointerDown: (e) => {\n if (isEditableElement(e.target)) {\n return;\n }\n\n listeners?.onPointerDown?.(e);\n },\n };\n\n return (\n <div ref={setDropRef}>\n <div ref={setDragRef} {...filteredListeners} {...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,IAA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I;EAC1BvD,aAAa,EAAEkD,kBAAS,CAACE;AAC3B,CAAC;AAAC,IAAAe,QAAA,GAAAnB,OAAA,CAAA5G,OAAA,GAEagD,UAAU","ignoreList":[]}
|
|
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","touchAction","StyledEditableHtml","EditableHtml","isTargetPrompt","width","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","isEditableElement","target","closest","isContentEditable","filteredListeners","onKeyDown","onPointerDown","createElement","ref","_extends2","alignItems","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)} 0`,\n backgroundColor: theme.palette.background.paper,\n display: 'flex',\n flexDirection: 'column',\n cursor: 'move',\n touchAction: 'none',\n}));\n\nconst StyledEditableHtml = styled(EditableHtml)(({ theme, isTargetPrompt }) => ({\n width: '80%',\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 { setNodeRef: setDropRef } = 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((p) => p !== 'bulleted-list' && p !== 'numbered-list');\n\n const isEditableElement = (target) =>\n target.closest('[contenteditable]') ||\n target.closest('input') ||\n target.closest('textarea') ||\n target.isContentEditable;\n\n // edit listeners to prevent dragging when interacting with editable-html element\n const filteredListeners = {\n ...listeners,\n onKeyDown: (e) => {\n if (isEditableElement(e.target)) {\n return;\n }\n\n listeners?.onKeyDown?.(e);\n },\n onPointerDown: (e) => {\n if (isEditableElement(e.target)) {\n return;\n }\n\n listeners?.onPointerDown?.(e);\n },\n };\n\n return (\n <div ref={setDropRef}>\n <div ref={setDragRef} {...filteredListeners} {...attributes}>\n <StyledChoiceTile style={style}>\n <div style={{ width: '100%', display: 'flex', alignItems: 'center' }}>\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,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uB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a,EAAEqD,kBAAS,CAACE,MAAM;EAC/BpD,KAAK,EAAEkD,kBAAS,CAACG,MAAM;EACvBC,MAAM,EAAEJ,kBAAS,CAACK,IAAI;EACtBrD,IAAI,EAAEgD,kBAAS,CAACG,MAAM;EACtBG,KAAK,EAAEN,kBAAS,CAACK,IAAI;EACrBlB,QAAQ,EAAEa,kBAAS,CAACK,IAAI;EACxBE,OAAO,EAAEP,kBAAS,CAACE,MAAM;EACzB9D,KAAK,EAAE4D,kBAAS,CAACQ,MAAM;EACvBjE,YAAY,EAAEyD,kBAAS,CAACS,KAAK,CAAC;IAC5BC,GAAG,EAAEV,kBAAS,CAACW,IAAI,CAACC,UAAU;IAC9BC,MAAM,EAAEb,kBAAS,CAACW,IAAI,CAACC;EACzB,CAAC,CAAC;EACFzE,MAAM,EAAE6D,kBAAS,CAACE,MAAM;EACxBY,OAAO,EAAEd,kBAAS,CAACe,KAAK,CAACH,UAAU;EACnCvE,cAAc,EAAE2D,kBAAS,CAACW,IAAI,CAACC,UAAU;EACzCtE,QAAQ,EAAE0D,kBAAS,CAACW,IAAI,CAACC,UAAU;EACnCnE,WAAW,EAAEuD,kBAAS,CAACE,MAAM;EAC7BxD,WAAW,EAAEsD,kBAAS,CAACE,MAAM;EAC7Bc,YAAY,EAAEhB,kBAAS,CAACG,MAAM;EAC9BrF,KAAK,EAAEkF,kBAAS,CAACG,MAAM;EACvB3D,UAAU,EAAEwD,kBAAS,CAACK,IAAI;EAC1BxD,aAAa,EAAEmD,kBAAS,CAACE;AAC3B,CAAC;AAAC,IAAAe,QAAA,GAAAnB,OAAA,CAAA7G,OAAA,GAEagD,UAAU","ignoreList":[]}
|
package/configure/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/placement-ordering-configure",
|
|
3
|
-
"version": "11.1.
|
|
3
|
+
"version": "11.1.8",
|
|
4
4
|
"private": true,
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "src/index.js",
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
"@mui/icons-material": "^7.3.4",
|
|
12
12
|
"@mui/material": "^7.3.4",
|
|
13
13
|
"@pie-framework/pie-configure-events": "^1.3.0",
|
|
14
|
-
"@pie-lib/config-ui": "13.0.
|
|
14
|
+
"@pie-lib/config-ui": "13.0.13",
|
|
15
15
|
"@pie-lib/drag": "4.0.6",
|
|
16
|
-
"@pie-lib/editable-html-tip-tap": "2.1.
|
|
16
|
+
"@pie-lib/editable-html-tip-tap": "2.1.11",
|
|
17
17
|
"@pie-lib/render-ui": "6.1.3",
|
|
18
18
|
"debug": "^4.1.1",
|
|
19
19
|
"lodash-es": "^4.17.23",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/placement-ordering",
|
|
3
3
|
"repository": "pie-framework/pie-elements",
|
|
4
|
-
"version": "14.1.
|
|
4
|
+
"version": "14.1.8",
|
|
5
5
|
"description": "",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
},
|
|
29
29
|
"author": "",
|
|
30
30
|
"license": "ISC",
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "2b221481f30b228062d17fd0c2d41a402a9ded26",
|
|
32
32
|
"scripts": {
|
|
33
33
|
"postpublish": "../../scripts/postpublish"
|
|
34
34
|
},
|