@pie-element/inline-dropdown 9.0.0-beta.0 → 9.0.0-next.42
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 +0 -11
- package/configure/CHANGELOG.md +0 -11
- package/configure/lib/inline-dropdown-toolbar.js +40 -47
- package/configure/lib/inline-dropdown-toolbar.js.map +1 -1
- package/configure/lib/main.js +35 -12
- package/configure/lib/main.js.map +1 -1
- package/configure/lib/response-area.js +2 -2
- package/configure/lib/response-area.js.map +1 -1
- package/configure/package.json +8 -8
- package/controller/CHANGELOG.md +0 -11
- package/controller/package.json +4 -4
- package/module/configure.js +1 -0
- package/module/controller.js +6261 -0
- package/module/demo.js +101 -0
- package/module/element.js +1 -0
- package/module/index.html +21 -0
- package/module/manifest.json +18 -0
- package/module/print-demo.js +139 -0
- package/module/print.html +18 -0
- package/package.json +8 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","names":["_react","_interopRequireDefault","require","_reactDom","_propTypes","_editableHtml","_interopRequireWildcard","_configUi","_mathRendering","_renderUi","_cloneDeep","_isEqual","_isUndefined","_isEmpty","_reduce","_max","_styles","_Tooltip","_Typography","_Accordion","_AccordionSummary","_AccordionDetails","_ExpandMore","_Info","_inlineDropdownToolbar","_utils","_responseArea","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","toggle","Panel","dropdown","settings","PromptHolder","styled","InputContainer","theme","width","paddingTop","spacing","marginBottom","ChoiceRationaleHolder","StyledTypography","Typography","fontSize","typography","marginRight","RationaleLabel","display","alignItems","whiteSpace","color","disabled","padding","lineHeight","RationaleChoices","StyledAccordionDetails","AccordionDetails","paddingBottom","FlexContainer","StyledTooltip","Tooltip","maxWidth","ErrorText","palette","error","main","createElementFromHTML","htmlString","div","document","createElement","innerHTML","trim","Main","React","Component","constructor","args","_defineProperty2","warning","open","newVal","props","onModelChanged","model","prompt","onModelChange","rationale","index","choice","indexOfChoice","choices","findIndex","elem","label","value","splice","teacherInstructions","slateMarkup","callback","setState","text","onClose","onConfirm","markup","respAreaChoices","state","domMarkup","allRespAreas","querySelectorAll","allChoices","forEach","el","dataset","existingRespAreaChoices","reduce","obj","key","isUndefined","newRespAreaChoices","shouldWarn","newChoices","length","find","c","correct","remove","cloneDeep","choiceIndex","maxResponseAreaChoices","configuration","undefined","idx","max","map","parseInt","filter","val","isNaN","push","respIndex","selectedIndex","componentDidMount","UNSAFE_componentWillReceiveProps","nProps","newState","isEqual","isEmpty","componentDidUpdate","domNode","ReactDOM","findDOMNode","renderMath","render","onConfigurationChanged","imageSupport","uploadSoundSupport","baseInputConfiguration","choiceRationale","contentDimensions","lockChoiceOrder","maxResponseAreas","maxImageWidth","maxImageHeight","partialScoring","settingsPanelDisabled","spellCheck","template","withRubric","mathMlOptions","language","languageChoices","responseAreaInputConfiguration","choiceRationaleEnabled","errors","extraCSSRules","promptEnabled","rationaleEnabled","spellCheckEnabled","teacherInstructionsEnabled","toolbarEditorPosition","promptError","rationaleError","responseAreasError","responseAreaChoicesError","teacherInstructionsError","defaultImageMaxWidth","defaultImageMaxHeight","renderChoiceRationale","keys","slotProps","transition","timeout","enter","exit","expandIcon","component","Fragment","dangerouslySetInnerHTML","__html","onChange","onChoiceRationaleChanged","toolbarOpts","position","validationMessage","generateValidationMessage","panelSettings","enabled","options","panelProperties","rubricEnabled","getPluginProps","layout","ConfigLayout","dimensions","hideSettings","onChangeModel","onChangeConfiguration","groups","Settings","Properties","onTeacherInstructionsChanged","nonEmpty","pluginProps","inputConfiguration","languageCharactersProps","onPromptChanged","disableUnderline","disableFocusListener","disableTouchListener","placement","title","editableHtmlProps","activePlugins","ALL_PLUGINS","responseAreaProps","type","duplicates","respAreaToolbar","node","onToolbarDone","onAddChoice","onCheck","onRemoveChoice","data","onSelectChoice","disableImageAlignmentButtons","highlightShape","onRationaleChanged","AlertDialog","disableAutoFocus","disableEnforceFocus","disableRestoreFocus","exports","PropTypes","object","isRequired","disableSidePanel","bool","func","shape","add","delete","_default"],"sources":["../src/main.jsx"],"sourcesContent":["import React from 'react';\nimport ReactDOM from 'react-dom';\nimport PropTypes from 'prop-types';\nimport EditableHtml, { ALL_PLUGINS } from '@pie-lib/editable-html';\nimport { AlertDialog, InputContainer, layout, settings } from '@pie-lib/config-ui';\nimport { renderMath } from '@pie-lib/math-rendering';\nimport { color } from '@pie-lib/render-ui';\nimport cloneDeep from 'lodash/cloneDeep';\nimport isEqual from 'lodash/isEqual';\nimport isUndefined from 'lodash/isUndefined';\nimport isEmpty from 'lodash/isEmpty';\nimport reduce from 'lodash/reduce';\nimport max from 'lodash/max';\nimport { styled } from '@mui/material/styles';\nimport Tooltip from '@mui/material/Tooltip';\nimport Typography from '@mui/material/Typography';\nimport Accordion from '@mui/material/Accordion';\nimport AccordionSummary from '@mui/material/AccordionSummary';\nimport AccordionDetails from '@mui/material/AccordionDetails';\nimport ExpandMoreIcon from '@mui/icons-material/ExpandMore';\nimport Info from '@mui/icons-material/Info';\n\nimport InlineDropdownToolbar from './inline-dropdown-toolbar';\nimport { generateValidationMessage } from './utils';\nimport ResponseAreaComponent from './response-area';\n\nconst { toggle, Panel, dropdown } = settings;\n\nconst PromptHolder = styled(InputContainer)(({ theme }) => ({\n width: '100%',\n paddingTop: theme.spacing(2),\n marginBottom: theme.spacing(2),\n}));\n\nconst ChoiceRationaleHolder = styled(InputContainer)(({ theme }) => ({\n width: '100%',\n paddingTop: theme.spacing(0.5),\n marginBottom: theme.spacing(2),\n}));\n\nconst StyledTypography = styled(Typography)(({ theme }) => ({\n fontSize: theme.typography.fontSize + 2,\n marginRight: theme.spacing(1),\n}));\n\nconst RationaleLabel = styled('span')(({ theme }) => ({\n display: 'flex',\n alignItems: 'center',\n whiteSpace: 'break-spaces',\n color: color.disabled(),\n padding: 0,\n fontSize: theme.typography.fontSize - 2,\n lineHeight: 1,\n}));\n\nconst RationaleChoices = styled('div')(({ theme }) => ({\n marginBottom: theme.spacing(2.5),\n}));\n\nconst StyledAccordionDetails = styled(AccordionDetails)({\n display: 'block',\n paddingTop: 0,\n paddingBottom: 0,\n});\n\nconst FlexContainer = styled('div')(({ theme }) => ({\n display: 'flex',\n alignItems: 'center',\n marginBottom: theme.spacing(1),\n}));\n\nconst StyledTooltip = styled(Tooltip)(({ theme }) => ({\n '& .MuiTooltip-tooltip': {\n fontSize: theme.typography.fontSize - 2,\n whiteSpace: 'pre',\n maxWidth: '500px',\n },\n}));\n\nconst ErrorText = styled('div')(({ theme }) => ({\n fontSize: theme.typography.fontSize - 2,\n color: theme.palette.error.main,\n paddingTop: theme.spacing(1),\n}));\n\nconst createElementFromHTML = (htmlString) => {\n const div = document.createElement('div');\n\n div.innerHTML = (htmlString || '').trim();\n\n return div;\n};\n\nexport class Main extends React.Component {\n static propTypes = {\n configuration: PropTypes.object.isRequired,\n model: PropTypes.object.isRequired,\n disableSidePanel: PropTypes.bool,\n onModelChanged: PropTypes.func.isRequired,\n onConfigurationChanged: PropTypes.func.isRequired,\n imageSupport: PropTypes.shape({\n add: PropTypes.func.isRequired,\n delete: PropTypes.func.isRequired,\n }),\n uploadSoundSupport: PropTypes.shape({\n add: PropTypes.func.isRequired,\n delete: PropTypes.func.isRequired,\n }),\n };\n\n state = {\n warning: { open: false },\n };\n\n componentDidMount() {\n const {\n model: { choices },\n } = this.props;\n\n this.setState({ respAreaChoices: cloneDeep(choices) });\n }\n\n UNSAFE_componentWillReceiveProps(nProps) {\n const newState = {};\n\n if (\n !isEqual(nProps.model.choices, this.props.model.choices) ||\n !isEqual(nProps.model.choices, this.state.respAreaChoices)\n ) {\n newState.respAreaChoices = cloneDeep(nProps.model.choices);\n }\n\n if (!isEmpty(newState)) {\n this.setState(newState);\n }\n }\n\n componentDidUpdate() {\n //eslint-disable-next-line\n const domNode = ReactDOM.findDOMNode(this);\n\n renderMath(domNode);\n }\n\n onModelChange = (newVal) => {\n this.props.onModelChanged({ ...this.props.model, ...newVal });\n };\n\n onPromptChanged = (prompt) => {\n this.onModelChange({ prompt });\n };\n\n onRationaleChanged = (rationale) => {\n this.onModelChange({ rationale });\n };\n\n onChoiceRationaleChanged = (index, choice) => {\n const { model } = this.props;\n const indexOfChoice =\n model.choices &&\n model.choices[index] &&\n model.choices[index].findIndex((elem) => elem.label === choice.label && elem.value === choice.value);\n\n model.choices[index] && model.choices[index].splice(indexOfChoice, 1, choice);\n\n this.onModelChange(model);\n };\n\n onTeacherInstructionsChanged = (teacherInstructions) => {\n this.onModelChange({ teacherInstructions });\n };\n\n onMarkupChanged = (slateMarkup) => {\n this.onModelChange({ slateMarkup });\n };\n\n onCheck = (callback) => {\n this.setState({\n warning: {\n open: true,\n text: 'Response areas with under 2 options or with no correct answers will be discarded.',\n onClose: () => {\n this.setState({ warning: { open: false } });\n },\n onConfirm: () => {\n this.setState({ warning: { open: false } }, callback);\n },\n },\n });\n };\n\n onChange = (markup) => {\n const { respAreaChoices } = this.state;\n const domMarkup = createElementFromHTML(markup);\n const allRespAreas = domMarkup.querySelectorAll('[data-type=\"inline_dropdown\"]');\n const allChoices = {};\n\n allRespAreas.forEach((el) => {\n allChoices[el.dataset.index] = el.dataset.value || '';\n });\n\n const existingRespAreaChoices = reduce(\n respAreaChoices,\n (obj, choices, key) => {\n if (!isUndefined(allChoices[key])) {\n obj[key] = respAreaChoices[key];\n }\n\n return obj;\n },\n {},\n );\n\n const newRespAreaChoices = {};\n let shouldWarn = false;\n\n allRespAreas.forEach((el, index) => {\n const newChoices = existingRespAreaChoices[el.dataset.index] || [];\n\n if (newChoices.length < 2 || !newChoices.find((c) => c.correct)) {\n el.remove();\n shouldWarn = true;\n } else {\n newRespAreaChoices[index] = existingRespAreaChoices[el.dataset.index] || [];\n el.dataset.index = index;\n }\n });\n\n if (shouldWarn) {\n this.setState({\n warning: {\n open: true,\n text: 'Response areas with under 2 options or with no correct answers will be discarded.',\n onClose: () => {\n this.setState({ warning: { open: false } });\n },\n onConfirm: () => {\n this.setState({ warning: { open: false } }, () =>\n this.onModelChange({\n choices: cloneDeep(newRespAreaChoices),\n slateMarkup: domMarkup.innerHTML,\n }),\n );\n },\n },\n });\n } else {\n this.onModelChange({\n choices: cloneDeep(newRespAreaChoices),\n slateMarkup: domMarkup.innerHTML,\n });\n }\n };\n\n onAddChoice = (index, label, choiceIndex) => {\n const { respAreaChoices } = this.state;\n const { maxResponseAreaChoices } = this.props.configuration;\n\n if (respAreaChoices[index] && respAreaChoices[index].length >= maxResponseAreaChoices) {\n this.setState({\n warning: {\n open: true,\n text: `There are only ${maxResponseAreaChoices} answers allowed per choice.`,\n onClose: undefined,\n onConfirm: () => {\n this.setState({ warning: { open: false } });\n },\n },\n });\n\n return;\n }\n\n if (!respAreaChoices[index]) {\n respAreaChoices[index] = [];\n }\n\n // check for duplicate answer, but exclude the one that is currently edited\n if ((respAreaChoices[index] || []).find((r, idx) => r.label === label && idx !== choiceIndex)) {\n // show warning for duplicated answers\n this.setState({\n warning: {\n open: true,\n text: 'Duplicate answers are not allowed.',\n onClose: undefined,\n onConfirm: () => {\n this.setState({ warning: { open: false } });\n },\n },\n });\n\n return;\n }\n\n if (choiceIndex >= 0 && respAreaChoices[index]?.[choiceIndex]) {\n // we need to update the choice label with the new value\n respAreaChoices[index][choiceIndex].label = label;\n } else {\n // add a new choice\n const value =\n (respAreaChoices[index] &&\n max(respAreaChoices[index].map((c) => parseInt(c.value)).filter((val) => !isNaN(val)))) ||\n 0;\n\n respAreaChoices[index].push({\n label,\n value: `${value + 1}`,\n correct: false,\n });\n }\n\n this.onModelChange({ choices: cloneDeep(respAreaChoices) });\n };\n\n onRemoveChoice = (respIndex, index) => {\n const { respAreaChoices } = this.state;\n\n respAreaChoices[respIndex].splice(index, 1);\n\n this.onModelChange({ choices: cloneDeep(respAreaChoices) });\n };\n\n onSelectChoice = (respIndex, selectedIndex) => {\n const { respAreaChoices } = this.state;\n\n respAreaChoices[respIndex] = respAreaChoices[respIndex].map((choice, index) => ({\n ...choice,\n correct: index === selectedIndex,\n }));\n\n this.onModelChange({ choices: cloneDeep(respAreaChoices) });\n };\n\n render() {\n const { warning } = this.state;\n const { model, configuration, onConfigurationChanged, imageSupport, uploadSoundSupport } = this.props;\n const {\n baseInputConfiguration = {},\n choiceRationale = {},\n contentDimensions = {},\n lockChoiceOrder = {},\n maxResponseAreas,\n maxImageWidth = {},\n maxImageHeight = {},\n partialScoring = {},\n prompt = {},\n rationale = {},\n settingsPanelDisabled,\n spellCheck = {},\n teacherInstructions = {},\n template = {},\n withRubric = {},\n mathMlOptions = {},\n language = {},\n languageChoices = {},\n responseAreaInputConfiguration = {},\n } = configuration || {};\n\n const {\n choiceRationaleEnabled,\n choices,\n errors,\n extraCSSRules,\n promptEnabled,\n rationaleEnabled,\n spellCheckEnabled,\n teacherInstructionsEnabled,\n toolbarEditorPosition,\n } = model || {};\n const {\n prompt: promptError,\n rationale: rationaleError,\n responseAreasError,\n responseAreaChoicesError,\n teacherInstructions: teacherInstructionsError,\n } = errors || {};\n\n const defaultImageMaxWidth = maxImageWidth && maxImageWidth.prompt;\n const defaultImageMaxHeight = maxImageHeight && maxImageHeight.prompt;\n\n const renderChoiceRationale = () =>\n (Object.keys(choices) || []).map((key, index) => (\n <RationaleChoices key={key}>\n <Accordion slotProps={{ transition: { timeout: { enter: 225, exit: 195 } } }}>\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <StyledTypography component={'div'}>{`Rationale for response area #${index + 1}`}</StyledTypography>\n </AccordionSummary>\n\n <StyledAccordionDetails>\n {(choices[key] || []).map((choice) => (\n <React.Fragment key={choice.label}>\n <RationaleLabel\n dangerouslySetInnerHTML={{\n __html: `${rationale.label} for ${choice.label} (${choice.correct ? 'correct' : 'incorrect'})`,\n }}\n />\n <ChoiceRationaleHolder>\n <EditableHtml\n markup={choice.rationale || ''}\n spellCheck={spellCheckEnabled}\n onChange={(c) => this.onChoiceRationaleChanged(key, { ...choice, rationale: c })}\n imageSupport={imageSupport}\n maxImageWidth={(maxImageWidth && maxImageWidth.rationale) || defaultImageMaxWidth}\n maxImageHeight={(maxImageHeight && maxImageHeight.rationale) || defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\n mathMlOptions={mathMlOptions}\n />\n </ChoiceRationaleHolder>\n </React.Fragment>\n ))}\n </StyledAccordionDetails>\n </Accordion>\n </RationaleChoices>\n ));\n\n const toolbarOpts = {\n position: toolbarEditorPosition === 'top' ? 'top' : 'bottom',\n };\n\n const validationMessage = generateValidationMessage(configuration);\n\n const panelSettings = {\n partialScoring: partialScoring.settings && toggle(partialScoring.label),\n lockChoiceOrder: lockChoiceOrder.settings && toggle(lockChoiceOrder.label),\n 'language.enabled': language.settings && toggle(language.label, true),\n language: language.settings && language.enabled && dropdown(languageChoices.label, languageChoices.options),\n };\n const panelProperties = {\n teacherInstructionsEnabled: teacherInstructions.settings && toggle(teacherInstructions.label),\n rationaleEnabled: rationale.settings && toggle(rationale.label),\n choiceRationaleEnabled: choiceRationale.settings && toggle(choiceRationale.label),\n promptEnabled: prompt.settings && toggle(prompt.label),\n spellCheckEnabled: spellCheck.settings && toggle(spellCheck.label),\n rubricEnabled: withRubric?.settings && toggle(withRubric?.label),\n };\n\n const getPluginProps = (props = {}) => ({\n ...baseInputConfiguration,\n ...props,\n });\n\n return (\n <layout.ConfigLayout\n extraCSSRules={extraCSSRules}\n dimensions={contentDimensions}\n hideSettings={settingsPanelDisabled}\n settings={\n <Panel\n model={model}\n configuration={configuration}\n onChangeModel={(model) => this.onModelChange(model)}\n onChangeConfiguration={(configuration) => onConfigurationChanged(configuration, true)}\n groups={{\n Settings: panelSettings,\n Properties: panelProperties,\n }}\n />\n }\n >\n {teacherInstructionsEnabled && (\n <PromptHolder label={teacherInstructions.label}>\n <EditableHtml\n markup={model.teacherInstructions || ''}\n onChange={this.onTeacherInstructionsChanged}\n imageSupport={imageSupport}\n nonEmpty={false}\n error={teacherInstructionsError}\n toolbarOpts={toolbarOpts}\n pluginProps={getPluginProps(teacherInstructions?.inputConfiguration)}\n spellCheck={spellCheckEnabled}\n maxImageWidth={(maxImageWidth && maxImageWidth.teacherInstructions) || defaultImageMaxWidth}\n maxImageHeight={(maxImageHeight && maxImageHeight.teacherInstructions) || defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n mathMlOptions={mathMlOptions}\n />\n {teacherInstructionsError && <ErrorText>{teacherInstructionsError}</ErrorText>}\n </PromptHolder>\n )}\n\n {promptEnabled && (\n <PromptHolder label={prompt.label}>\n <EditableHtml\n markup={model.prompt}\n onChange={this.onPromptChanged}\n imageSupport={imageSupport}\n nonEmpty={false}\n disableUnderline\n error={promptError}\n toolbarOpts={toolbarOpts}\n pluginProps={getPluginProps(prompt?.inputConfiguration)}\n spellCheck={spellCheckEnabled}\n maxImageWidth={defaultImageMaxWidth}\n maxImageHeight={defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n mathMlOptions={mathMlOptions}\n />\n {promptError && <ErrorText>{promptError}</ErrorText>}\n </PromptHolder>\n )}\n\n <FlexContainer>\n <StyledTypography component={'div'}>\n Define Template, Choices, and Correct Responses\n </StyledTypography>\n <StyledTooltip\n disableFocusListener\n disableTouchListener\n placement={'right'}\n title={validationMessage}\n >\n <Info fontSize={'small'} color={'primary'} />\n </StyledTooltip>\n </FlexContainer>\n\n <ResponseAreaComponent\n responseAreasError={responseAreasError}\n responseAreaChoicesError={responseAreaChoicesError}\n editableHtmlProps={{\n pluginProps: getPluginProps(template?.inputConfiguration),\n activePlugins: ALL_PLUGINS,\n toolbarOpts: { position: 'top' },\n responseAreaProps: {\n type: 'inline-dropdown',\n options: {\n duplicates: true,\n },\n maxResponseAreas: maxResponseAreas,\n respAreaToolbar: (node, value, onToolbarDone) => {\n const { respAreaChoices } = this.state;\n\n return () => (\n <InlineDropdownToolbar\n onAddChoice={this.onAddChoice}\n onCheck={this.onCheck}\n onRemoveChoice={(index) => this.onRemoveChoice(node.data.get('index'), index)}\n onSelectChoice={(index) => this.onSelectChoice(node.data.get('index'), index)}\n node={node}\n value={value}\n onToolbarDone={onToolbarDone}\n choices={respAreaChoices[node.data.get('index')]}\n spellCheck={spellCheckEnabled}\n uploadSoundSupport={uploadSoundSupport}\n mathMlOptions={mathMlOptions}\n baseInputConfiguration={baseInputConfiguration}\n responseAreaInputConfiguration={responseAreaInputConfiguration}\n />\n );\n },\n },\n spellCheck: spellCheckEnabled,\n markup: model.slateMarkup || '',\n onChange: this.onChange,\n imageSupport: imageSupport,\n disableImageAlignmentButtons: true,\n disabled: false,\n highlightShape: false,\n error: responseAreasError,\n uploadSoundSupport: uploadSoundSupport,\n languageCharactersProps: [{ language: 'spanish' }, { language: 'special' }],\n mathMlOptions: mathMlOptions,\n }}\n />\n\n {choiceRationaleEnabled && renderChoiceRationale()}\n\n {rationaleEnabled && (\n <PromptHolder label={rationale.label}>\n <EditableHtml\n markup={model.rationale || ''}\n onChange={this.onRationaleChanged}\n imageSupport={imageSupport}\n error={rationaleError}\n toolbarOpts={toolbarOpts}\n pluginProps={getPluginProps(rationale?.inputConfiguration)}\n spellCheck={spellCheckEnabled}\n maxImageWidth={(maxImageWidth && maxImageWidth.rationale) || defaultImageMaxWidth}\n maxImageHeight={(maxImageHeight && maxImageHeight.rationale) || defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n mathMlOptions={mathMlOptions}\n />\n {rationaleError && <ErrorText>{rationaleError}</ErrorText>}\n </PromptHolder>\n )}\n\n <AlertDialog\n open={warning.open}\n title=\"Warning\"\n text={warning.text}\n onClose={warning.onClose}\n onConfirm={warning.onConfirm}\n disableAutoFocus={true}\n disableEnforceFocus={true}\n disableRestoreFocus={true}\n />\n </layout.ConfigLayout>\n );\n }\n}\n\nexport default Main;\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,G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GA8eYsD,IAAI","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"main.js","names":["_react","_interopRequireDefault","require","_reactDom","_propTypes","_editableHtmlTipTap","_interopRequireWildcard","_configUi","_mathRendering","_renderUi","_cloneDeep","_isEqual","_isUndefined","_isEmpty","_reduce","_max","_styles","_Tooltip","_Typography","_Accordion","_AccordionSummary","_AccordionDetails","_ExpandMore","_Info","_inlineDropdownToolbar","_utils","_responseArea","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","toggle","Panel","dropdown","settings","PromptHolder","styled","InputContainer","theme","width","paddingTop","spacing","marginBottom","ChoiceRationaleHolder","StyledTypography","Typography","fontSize","typography","marginRight","RationaleLabel","display","alignItems","whiteSpace","color","disabled","padding","lineHeight","RationaleChoices","StyledAccordionDetails","AccordionDetails","paddingBottom","FlexContainer","StyledTooltip","Tooltip","maxWidth","ErrorText","palette","error","main","createElementFromHTML","htmlString","div","document","createElement","innerHTML","trim","Main","React","Component","constructor","args","_defineProperty2","warning","open","newVal","props","onModelChanged","model","prompt","onModelChange","rationale","index","choice","indexOfChoice","choices","findIndex","elem","label","value","splice","teacherInstructions","slateMarkup","callback","setState","text","onClose","onConfirm","markup","respAreaChoices","state","domMarkup","allRespAreas","querySelectorAll","allChoices","forEach","el","dataset","existingRespAreaChoices","reduce","obj","key","isUndefined","newRespAreaChoices","shouldWarn","newChoices","length","find","c","correct","remove","cloneDeep","choiceIndex","maxResponseAreaChoices","configuration","undefined","idx","max","map","parseInt","filter","val","isNaN","push","respIndex","selectedIndex","componentDidMount","UNSAFE_componentWillReceiveProps","nProps","newState","isEqual","isEmpty","componentDidUpdate","domNode","ReactDOM","findDOMNode","renderMath","render","onConfigurationChanged","imageSupport","uploadSoundSupport","baseInputConfiguration","choiceRationale","contentDimensions","lockChoiceOrder","maxResponseAreas","maxImageWidth","maxImageHeight","partialScoring","settingsPanelDisabled","spellCheck","template","withRubric","mathMlOptions","language","languageChoices","responseAreaInputConfiguration","choiceRationaleEnabled","errors","extraCSSRules","promptEnabled","rationaleEnabled","spellCheckEnabled","teacherInstructionsEnabled","toolbarEditorPosition","promptError","rationaleError","responseAreasError","responseAreaChoicesError","teacherInstructionsError","defaultImageMaxWidth","defaultImageMaxHeight","renderChoiceRationale","keys","slotProps","transition","timeout","enter","exit","expandIcon","component","Fragment","dangerouslySetInnerHTML","__html","onChange","onChoiceRationaleChanged","toolbarOpts","position","validationMessage","generateValidationMessage","panelSettings","enabled","options","panelProperties","rubricEnabled","getPluginProps","layout","ConfigLayout","names","rules","dimensions","hideSettings","onChangeModel","onChangeConfiguration","groups","Settings","Properties","onTeacherInstructionsChanged","nonEmpty","pluginProps","inputConfiguration","languageCharactersProps","onPromptChanged","disableUnderline","disableFocusListener","disableTouchListener","placement","title","editableHtmlProps","activePlugins","ALL_PLUGINS","responseAreaProps","type","duplicates","respAreaToolbar","node","editor","onToolbarDone","onAddChoice","onCheck","onRemoveChoice","attrs","onSelectChoice","disableImageAlignmentButtons","highlightShape","onRationaleChanged","AlertDialog","disableAutoFocus","disableEnforceFocus","disableRestoreFocus","exports","PropTypes","object","isRequired","disableSidePanel","bool","func","shape","add","delete","_default"],"sources":["../src/main.jsx"],"sourcesContent":["import React from 'react';\nimport ReactDOM from 'react-dom';\nimport PropTypes from 'prop-types';\nimport EditableHtml, { ALL_PLUGINS } from '@pie-lib/editable-html-tip-tap';\nimport { AlertDialog, InputContainer, layout, settings } from '@pie-lib/config-ui';\nimport { renderMath } from '@pie-lib/math-rendering';\nimport { color } from '@pie-lib/render-ui';\nimport cloneDeep from 'lodash/cloneDeep';\nimport isEqual from 'lodash/isEqual';\nimport isUndefined from 'lodash/isUndefined';\nimport isEmpty from 'lodash/isEmpty';\nimport reduce from 'lodash/reduce';\nimport max from 'lodash/max';\nimport { styled } from '@mui/material/styles';\nimport Tooltip from '@mui/material/Tooltip';\nimport Typography from '@mui/material/Typography';\nimport Accordion from '@mui/material/Accordion';\nimport AccordionSummary from '@mui/material/AccordionSummary';\nimport AccordionDetails from '@mui/material/AccordionDetails';\nimport ExpandMoreIcon from '@mui/icons-material/ExpandMore';\nimport Info from '@mui/icons-material/Info';\n\nimport InlineDropdownToolbar from './inline-dropdown-toolbar';\nimport { generateValidationMessage } from './utils';\nimport ResponseAreaComponent from './response-area';\n\nconst { toggle, Panel, dropdown } = settings;\n\nconst PromptHolder = styled(InputContainer)(({ theme }) => ({\n width: '100%',\n paddingTop: theme.spacing(2),\n marginBottom: theme.spacing(2),\n}));\n\nconst ChoiceRationaleHolder = styled(InputContainer)(({ theme }) => ({\n width: '100%',\n paddingTop: theme.spacing(0.5),\n marginBottom: theme.spacing(2),\n}));\n\nconst StyledTypography = styled(Typography)(({ theme }) => ({\n fontSize: theme.typography.fontSize + 2,\n marginRight: theme.spacing(1),\n}));\n\nconst RationaleLabel = styled('span')(({ theme }) => ({\n display: 'flex',\n alignItems: 'center',\n whiteSpace: 'break-spaces',\n color: color.disabled(),\n padding: 0,\n fontSize: theme.typography.fontSize - 2,\n lineHeight: 1,\n}));\n\nconst RationaleChoices = styled('div')(({ theme }) => ({\n marginBottom: theme.spacing(2.5),\n}));\n\nconst StyledAccordionDetails = styled(AccordionDetails)({\n display: 'block',\n paddingTop: 0,\n paddingBottom: 0,\n});\n\nconst FlexContainer = styled('div')(({ theme }) => ({\n display: 'flex',\n alignItems: 'center',\n marginBottom: theme.spacing(1),\n}));\n\nconst StyledTooltip = styled(Tooltip)(({ theme }) => ({\n '& .MuiTooltip-tooltip': {\n fontSize: theme.typography.fontSize - 2,\n whiteSpace: 'pre',\n maxWidth: '500px',\n },\n}));\n\nconst ErrorText = styled('div')(({ theme }) => ({\n fontSize: theme.typography.fontSize - 2,\n color: theme.palette.error.main,\n paddingTop: theme.spacing(1),\n}));\n\nconst createElementFromHTML = (htmlString) => {\n const div = document.createElement('div');\n\n div.innerHTML = (htmlString || '').trim();\n\n return div;\n};\n\nexport class Main extends React.Component {\n static propTypes = {\n configuration: PropTypes.object.isRequired,\n model: PropTypes.object.isRequired,\n disableSidePanel: PropTypes.bool,\n onModelChanged: PropTypes.func.isRequired,\n onConfigurationChanged: PropTypes.func.isRequired,\n imageSupport: PropTypes.shape({\n add: PropTypes.func.isRequired,\n delete: PropTypes.func.isRequired,\n }),\n uploadSoundSupport: PropTypes.shape({\n add: PropTypes.func.isRequired,\n delete: PropTypes.func.isRequired,\n }),\n };\n\n state = {\n warning: { open: false },\n };\n\n componentDidMount() {\n const {\n model: { choices },\n } = this.props;\n\n this.setState({ respAreaChoices: cloneDeep(choices) });\n }\n\n UNSAFE_componentWillReceiveProps(nProps) {\n const newState = {};\n\n if (\n !isEqual(nProps.model.choices, this.props.model.choices) ||\n !isEqual(nProps.model.choices, this.state.respAreaChoices)\n ) {\n newState.respAreaChoices = cloneDeep(nProps.model.choices);\n }\n\n if (!isEmpty(newState)) {\n this.setState(newState);\n }\n }\n\n componentDidUpdate() {\n //eslint-disable-next-line\n const domNode = ReactDOM.findDOMNode(this);\n\n renderMath(domNode);\n }\n\n onModelChange = (newVal) => {\n this.props.onModelChanged({ ...this.props.model, ...newVal });\n };\n\n onPromptChanged = (prompt) => {\n this.onModelChange({ prompt });\n };\n\n onRationaleChanged = (rationale) => {\n this.onModelChange({ rationale });\n };\n\n onChoiceRationaleChanged = (index, choice) => {\n const { model } = this.props;\n const indexOfChoice =\n model.choices &&\n model.choices[index] &&\n model.choices[index].findIndex((elem) => elem.label === choice.label && elem.value === choice.value);\n\n model.choices[index] && model.choices[index].splice(indexOfChoice, 1, choice);\n\n this.onModelChange(model);\n };\n\n onTeacherInstructionsChanged = (teacherInstructions) => {\n this.onModelChange({ teacherInstructions });\n };\n\n onMarkupChanged = (slateMarkup) => {\n this.onModelChange({ slateMarkup });\n };\n\n onCheck = (callback) => {\n this.setState({\n warning: {\n open: true,\n text: 'Response areas with under 2 options or with no correct answers will be discarded.',\n onClose: () => {\n this.setState({ warning: { open: false } });\n },\n onConfirm: () => {\n this.setState({ warning: { open: false } }, callback);\n },\n },\n });\n };\n\n onChange = (markup) => {\n const { respAreaChoices } = this.state;\n const domMarkup = createElementFromHTML(markup);\n const allRespAreas = domMarkup.querySelectorAll('[data-type=\"inline_dropdown\"]');\n const allChoices = {};\n\n allRespAreas.forEach((el) => {\n allChoices[el.dataset.index] = el.dataset.value || '';\n });\n\n const existingRespAreaChoices = reduce(\n respAreaChoices,\n (obj, choices, key) => {\n if (!isUndefined(allChoices[key])) {\n obj[key] = respAreaChoices[key];\n }\n\n return obj;\n },\n {},\n );\n\n const newRespAreaChoices = {};\n let shouldWarn = false;\n\n allRespAreas.forEach((el, index) => {\n const newChoices = existingRespAreaChoices[el.dataset.index] || [];\n\n if (newChoices.length < 2 || !newChoices.find((c) => c.correct)) {\n el.remove();\n shouldWarn = true;\n } else {\n newRespAreaChoices[index] = existingRespAreaChoices[el.dataset.index] || [];\n el.dataset.index = index;\n }\n });\n\n if (shouldWarn) {\n this.setState({\n warning: {\n open: true,\n text: 'Response areas with under 2 options or with no correct answers will be discarded.',\n onClose: () => {\n this.setState({ warning: { open: false } });\n },\n onConfirm: () => {\n this.setState({ warning: { open: false } }, () =>\n this.onModelChange({\n choices: cloneDeep(newRespAreaChoices),\n slateMarkup: domMarkup.innerHTML,\n }),\n );\n },\n },\n });\n } else {\n this.onModelChange({\n choices: cloneDeep(newRespAreaChoices),\n slateMarkup: domMarkup.innerHTML,\n });\n }\n };\n\n onAddChoice = (index, label, choiceIndex) => {\n const { respAreaChoices } = this.state;\n const { maxResponseAreaChoices } = this.props.configuration;\n\n if (respAreaChoices[index] && respAreaChoices[index].length >= maxResponseAreaChoices) {\n this.setState({\n warning: {\n open: true,\n text: `There are only ${maxResponseAreaChoices} answers allowed per choice.`,\n onClose: undefined,\n onConfirm: () => {\n this.setState({ warning: { open: false } });\n },\n },\n });\n\n return;\n }\n\n if (!respAreaChoices[index]) {\n respAreaChoices[index] = [];\n }\n\n // check for duplicate answer, but exclude the one that is currently edited\n if ((respAreaChoices[index] || []).find((r, idx) => r.label === label && idx !== choiceIndex)) {\n // show warning for duplicated answers\n this.setState({\n warning: {\n open: true,\n text: 'Duplicate answers are not allowed.',\n onClose: undefined,\n onConfirm: () => {\n this.setState({ warning: { open: false } });\n },\n },\n });\n\n return;\n }\n\n if (choiceIndex >= 0 && respAreaChoices[index]?.[choiceIndex]) {\n // we need to update the choice label with the new value\n respAreaChoices[index][choiceIndex].label = label;\n } else {\n // add a new choice\n const value =\n (respAreaChoices[index] &&\n max(respAreaChoices[index].map((c) => parseInt(c.value)).filter((val) => !isNaN(val)))) ||\n 0;\n\n respAreaChoices[index].push({\n label,\n value: `${value + 1}`,\n correct: false,\n });\n }\n\n this.onModelChange({ choices: cloneDeep(respAreaChoices) });\n };\n\n onRemoveChoice = (respIndex, index) => {\n const { respAreaChoices } = this.state;\n\n respAreaChoices[respIndex].splice(index, 1);\n\n this.onModelChange({ choices: cloneDeep(respAreaChoices) });\n };\n\n onSelectChoice = (respIndex, selectedIndex) => {\n const { respAreaChoices } = this.state;\n\n respAreaChoices[respIndex] = respAreaChoices[respIndex].map((choice, index) => ({\n ...choice,\n correct: index === selectedIndex,\n }));\n\n this.onModelChange({ choices: cloneDeep(respAreaChoices) });\n };\n\n render() {\n const { warning } = this.state;\n const { model, configuration, onConfigurationChanged, imageSupport, uploadSoundSupport } = this.props;\n const {\n baseInputConfiguration = {},\n choiceRationale = {},\n contentDimensions = {},\n lockChoiceOrder = {},\n maxResponseAreas,\n maxImageWidth = {},\n maxImageHeight = {},\n partialScoring = {},\n prompt = {},\n rationale = {},\n settingsPanelDisabled,\n spellCheck = {},\n teacherInstructions = {},\n template = {},\n withRubric = {},\n mathMlOptions = {},\n language = {},\n languageChoices = {},\n responseAreaInputConfiguration = {},\n } = configuration || {};\n\n const {\n choiceRationaleEnabled,\n choices,\n errors,\n extraCSSRules,\n promptEnabled,\n rationaleEnabled,\n spellCheckEnabled,\n teacherInstructionsEnabled,\n toolbarEditorPosition,\n } = model || {};\n const {\n prompt: promptError,\n rationale: rationaleError,\n responseAreasError,\n responseAreaChoicesError,\n teacherInstructions: teacherInstructionsError,\n } = errors || {};\n\n const defaultImageMaxWidth = maxImageWidth && maxImageWidth.prompt;\n const defaultImageMaxHeight = maxImageHeight && maxImageHeight.prompt;\n\n const renderChoiceRationale = () =>\n (Object.keys(choices) || []).map((key, index) => (\n <RationaleChoices key={key}>\n <Accordion slotProps={{ transition: { timeout: { enter: 225, exit: 195 } } }}>\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <StyledTypography component={'div'}>{`Rationale for response area #${index + 1}`}</StyledTypography>\n </AccordionSummary>\n\n <StyledAccordionDetails>\n {(choices[key] || []).map((choice) => (\n <React.Fragment key={choice.label}>\n <RationaleLabel\n dangerouslySetInnerHTML={{\n __html: `${rationale.label} for ${choice.label} (${choice.correct ? 'correct' : 'incorrect'})`,\n }}\n />\n <ChoiceRationaleHolder>\n <EditableHtml\n markup={choice.rationale || ''}\n spellCheck={spellCheckEnabled}\n onChange={(c) => this.onChoiceRationaleChanged(key, { ...choice, rationale: c })}\n imageSupport={imageSupport}\n maxImageWidth={(maxImageWidth && maxImageWidth.rationale) || defaultImageMaxWidth}\n maxImageHeight={(maxImageHeight && maxImageHeight.rationale) || defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\n mathMlOptions={mathMlOptions}\n />\n </ChoiceRationaleHolder>\n </React.Fragment>\n ))}\n </StyledAccordionDetails>\n </Accordion>\n </RationaleChoices>\n ));\n\n const toolbarOpts = {\n position: toolbarEditorPosition === 'top' ? 'top' : 'bottom',\n };\n\n const validationMessage = generateValidationMessage(configuration);\n\n const panelSettings = {\n partialScoring: partialScoring.settings && toggle(partialScoring.label),\n lockChoiceOrder: lockChoiceOrder.settings && toggle(lockChoiceOrder.label),\n 'language.enabled': language.settings && toggle(language.label, true),\n language: language.settings && language.enabled && dropdown(languageChoices.label, languageChoices.options),\n };\n const panelProperties = {\n teacherInstructionsEnabled: teacherInstructions.settings && toggle(teacherInstructions.label),\n rationaleEnabled: rationale.settings && toggle(rationale.label),\n choiceRationaleEnabled: choiceRationale.settings && toggle(choiceRationale.label),\n promptEnabled: prompt.settings && toggle(prompt.label),\n spellCheckEnabled: spellCheck.settings && toggle(spellCheck.label),\n rubricEnabled: withRubric?.settings && toggle(withRubric?.label),\n };\n\n const getPluginProps = (props = {}) => ({\n ...baseInputConfiguration,\n ...props,\n });\n\n return (\n <layout.ConfigLayout\n extraCSSRules={{\n names: ['red', 'blue'],\n rules: `\n .red {\n color: red !important;\n }\n\n .blue {\n color: blue !important;\n }\n `,\n }}\n dimensions={contentDimensions}\n hideSettings={settingsPanelDisabled}\n settings={\n <Panel\n model={model}\n configuration={configuration}\n onChangeModel={(model) => this.onModelChange(model)}\n onChangeConfiguration={(configuration) => onConfigurationChanged(configuration, true)}\n groups={{\n Settings: panelSettings,\n Properties: panelProperties,\n }}\n />\n }\n >\n {teacherInstructionsEnabled && (\n <PromptHolder label={teacherInstructions.label}>\n <EditableHtml\n markup={model.teacherInstructions || ''}\n onChange={this.onTeacherInstructionsChanged}\n imageSupport={imageSupport}\n nonEmpty={false}\n error={teacherInstructionsError}\n toolbarOpts={toolbarOpts}\n pluginProps={getPluginProps(teacherInstructions?.inputConfiguration)}\n spellCheck={spellCheckEnabled}\n maxImageWidth={(maxImageWidth && maxImageWidth.teacherInstructions) || defaultImageMaxWidth}\n maxImageHeight={(maxImageHeight && maxImageHeight.teacherInstructions) || defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n mathMlOptions={mathMlOptions}\n />\n {teacherInstructionsError && <ErrorText>{teacherInstructionsError}</ErrorText>}\n </PromptHolder>\n )}\n\n {promptEnabled && (\n <PromptHolder label={prompt.label}>\n <EditableHtml\n markup={model.prompt}\n onChange={this.onPromptChanged}\n imageSupport={imageSupport}\n nonEmpty={false}\n disableUnderline\n error={promptError}\n toolbarOpts={toolbarOpts}\n pluginProps={getPluginProps(prompt?.inputConfiguration)}\n spellCheck={spellCheckEnabled}\n maxImageWidth={defaultImageMaxWidth}\n maxImageHeight={defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n mathMlOptions={mathMlOptions}\n />\n {promptError && <ErrorText>{promptError}</ErrorText>}\n </PromptHolder>\n )}\n\n <FlexContainer>\n <StyledTypography component={'div'}>\n Define Template, Choices, and Correct Responses\n </StyledTypography>\n <StyledTooltip\n disableFocusListener\n disableTouchListener\n placement={'right'}\n title={validationMessage}\n >\n <Info fontSize={'small'} color={'primary'} />\n </StyledTooltip>\n </FlexContainer>\n\n <ResponseAreaComponent\n responseAreasError={responseAreasError}\n responseAreaChoicesError={responseAreaChoicesError}\n editableHtmlProps={{\n pluginProps: getPluginProps(template?.inputConfiguration),\n activePlugins: ALL_PLUGINS,\n toolbarOpts: { position: 'top' },\n extraCSSRules: {\n names: ['red', 'blue'],\n rules: `\n .red {\n color: red !important;\n }\n\n .blue {\n color: blue !important;\n }\n `,\n },\n responseAreaProps: {\n type: 'inline-dropdown',\n options: {\n duplicates: true,\n },\n maxResponseAreas: maxResponseAreas,\n respAreaToolbar: (node, editor, onToolbarDone) => {\n const { respAreaChoices } = this.state;\n\n return () => (\n <InlineDropdownToolbar\n onAddChoice={this.onAddChoice}\n onCheck={this.onCheck}\n onRemoveChoice={(index) => this.onRemoveChoice(node.attrs.index, index)}\n onSelectChoice={(index) => this.onSelectChoice(node.attrs.index, index)}\n node={node}\n editor={editor}\n onToolbarDone={onToolbarDone}\n choices={respAreaChoices[node.attrs.index]}\n spellCheck={spellCheckEnabled}\n uploadSoundSupport={uploadSoundSupport}\n mathMlOptions={mathMlOptions}\n baseInputConfiguration={baseInputConfiguration}\n responseAreaInputConfiguration={responseAreaInputConfiguration}\n />\n );\n },\n },\n spellCheck: spellCheckEnabled,\n markup: model.slateMarkup || '',\n onChange: this.onChange,\n imageSupport: imageSupport,\n disableImageAlignmentButtons: true,\n disabled: false,\n highlightShape: false,\n error: responseAreasError,\n uploadSoundSupport: uploadSoundSupport,\n languageCharactersProps: [{ language: 'spanish' }, { language: 'special' }],\n mathMlOptions: mathMlOptions,\n }}\n />\n\n {choiceRationaleEnabled && renderChoiceRationale()}\n\n {rationaleEnabled && (\n <PromptHolder label={rationale.label}>\n <EditableHtml\n markup={model.rationale || ''}\n onChange={this.onRationaleChanged}\n imageSupport={imageSupport}\n error={rationaleError}\n toolbarOpts={toolbarOpts}\n pluginProps={getPluginProps(rationale?.inputConfiguration)}\n spellCheck={spellCheckEnabled}\n maxImageWidth={(maxImageWidth && maxImageWidth.rationale) || defaultImageMaxWidth}\n maxImageHeight={(maxImageHeight && maxImageHeight.rationale) || defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n mathMlOptions={mathMlOptions}\n />\n {rationaleError && <ErrorText>{rationaleError}</ErrorText>}\n </PromptHolder>\n )}\n\n <AlertDialog\n open={warning.open}\n title=\"Warning\"\n text={warning.text}\n onClose={warning.onClose}\n onConfirm={warning.onConfirm}\n disableAutoFocus={true}\n disableEnforceFocus={true}\n disableRestoreFocus={true}\n />\n </layout.ConfigLayout>\n );\n }\n}\n\nexport default Main;\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,UAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,mBAAA,GAAAC,uBAAA,CAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,cAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,UAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,QAAA,GAAAV,sBAAA,CAAAC,OAAA;AACA,IAAAU,YAAA,GA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5K,IAAI,EAAED,OAAO,CAACC,IAAK;MACnByJ,KAAK,EAAC,SAAS;MACfpI,IAAI,EAAEtB,OAAO,CAACsB,IAAK;MACnBC,OAAO,EAAEvB,OAAO,CAACuB,OAAQ;MACzBC,SAAS,EAAExB,OAAO,CAACwB,SAAU;MAC7BsJ,gBAAgB,EAAE,IAAK;MACvBC,mBAAmB,EAAE,IAAK;MAC1BC,mBAAmB,EAAE;IAAK,CAC3B,CACkB,CAAC;EAE1B;AACF;AAACC,OAAA,CAAAvL,IAAA,GAAAA,IAAA;AAAA,IAAAK,gBAAA,CAAA3D,OAAA,EAlhBYsD,IAAI,eACI;EACjByD,aAAa,EAAE+H,kBAAS,CAACC,MAAM,CAACC,UAAU;EAC1C/K,KAAK,EAAE6K,kBAAS,CAACC,MAAM,CAACC,UAAU;EAClCC,gBAAgB,EAAEH,kBAAS,CAACI,IAAI;EAChClL,cAAc,EAAE8K,kBAAS,CAACK,IAAI,CAACH,UAAU;EACzCzG,sBAAsB,EAAEuG,kBAAS,CAACK,IAAI,CAACH,UAAU;EACjDxG,YAAY,EAAEsG,kBAAS,CAACM,KAAK,CAAC;IAC5BC,GAAG,EAAEP,kBAAS,CAACK,IAAI,CAACH,UAAU;IAC9BM,MAAM,EAAER,kBAAS,CAACK,IAAI,CAACH;EACzB,CAAC,CAAC;EACFvG,kBAAkB,EAAEqG,kBAAS,CAACM,KAAK,CAAC;IAClCC,GAAG,EAAEP,kBAAS,CAACK,IAAI,CAACH,UAAU;IAC9BM,MAAM,EAAER,kBAAS,CAACK,IAAI,CAACH;EACzB,CAAC;AACH,CAAC;AAAA,IAAAO,QAAA,GAAAV,OAAA,CAAA7O,OAAA,GAqgBYsD,IAAI","ignoreList":[]}
|
|
@@ -10,7 +10,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
10
10
|
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
11
11
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
12
|
var _styles = require("@mui/material/styles");
|
|
13
|
-
var
|
|
13
|
+
var _editableHtmlTipTap = _interopRequireDefault(require("@pie-lib/editable-html-tip-tap"));
|
|
14
14
|
var _mathRendering = require("@pie-lib/math-rendering");
|
|
15
15
|
const ResponseArea = (0, _styles.styled)('div')(({
|
|
16
16
|
theme
|
|
@@ -36,7 +36,7 @@ class ResponseAreaComponent extends _react.default.Component {
|
|
|
36
36
|
responseAreasError,
|
|
37
37
|
responseAreaChoicesError
|
|
38
38
|
} = this.props;
|
|
39
|
-
return /*#__PURE__*/_react.default.createElement(ResponseArea, null, /*#__PURE__*/_react.default.createElement(
|
|
39
|
+
return /*#__PURE__*/_react.default.createElement(ResponseArea, null, /*#__PURE__*/_react.default.createElement(_editableHtmlTipTap.default, editableHtmlProps), responseAreasError && /*#__PURE__*/_react.default.createElement(ErrorText, null, responseAreasError), responseAreaChoicesError && /*#__PURE__*/_react.default.createElement(ErrorText, null, responseAreaChoicesError));
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
(0, _defineProperty2.default)(ResponseAreaComponent, "propTypes", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"response-area.js","names":["_react","_interopRequireDefault","require","_reactDom","_propTypes","_styles","
|
|
1
|
+
{"version":3,"file":"response-area.js","names":["_react","_interopRequireDefault","require","_reactDom","_propTypes","_styles","_editableHtmlTipTap","_mathRendering","ResponseArea","styled","theme","paddingBottom","spacing","ErrorText","fontSize","typography","color","palette","error","main","paddingTop","ResponseAreaComponent","React","Component","componentDidMount","domNode","ReactDOM","findDOMNode","renderMath","render","editableHtmlProps","responseAreasError","responseAreaChoicesError","props","default","createElement","_defineProperty2","PropTypes","object","isRequired","string","_default","exports"],"sources":["../src/response-area.jsx"],"sourcesContent":["import React from 'react';\nimport ReactDOM from 'react-dom';\nimport PropTypes from 'prop-types';\nimport { styled } from '@mui/material/styles';\nimport EditableHtml from '@pie-lib/editable-html-tip-tap';\nimport { renderMath } from '@pie-lib/math-rendering';\n\nconst ResponseArea = styled('div')(({ theme }) => ({\n paddingBottom: theme.spacing(2.5),\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 ResponseAreaComponent extends React.Component {\n static propTypes = {\n editableHtmlProps: PropTypes.object.isRequired,\n responseAreasError: PropTypes.string,\n responseAreaChoicesError: PropTypes.string,\n };\n\n componentDidMount() {\n // eslint-disable-next-line react/no-find-dom-node\n const domNode = ReactDOM.findDOMNode(this);\n\n renderMath(domNode);\n }\n\n render() {\n const { editableHtmlProps, responseAreasError, responseAreaChoicesError } = this.props;\n\n return (\n <ResponseArea>\n <EditableHtml {...editableHtmlProps} />\n {responseAreasError && <ErrorText>{responseAreasError}</ErrorText>}\n {responseAreaChoicesError && <ErrorText>{responseAreaChoicesError}</ErrorText>}\n </ResponseArea>\n );\n }\n}\n\nexport default ResponseAreaComponent;\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,UAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,mBAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,cAAA,GAAAL,OAAA;AAEA,MAAMM,YAAY,GAAG,IAAAC,cAAM,EAAC,KAAK,CAAC,CAAC,CAAC;EAAEC;AAAM,CAAC,MAAM;EACjDC,aAAa,EAAED,KAAK,CAACE,OAAO,CAAC,GAAG;AAClC,CAAC,CAAC,CAAC;AAEH,MAAMC,SAAS,GAAG,IAAAJ,cAAM,EAAC,KAAK,CAAC,CAAC,CAAC;EAAEC;AAAM,CAAC,MAAM;EAC9CI,QAAQ,EAAEJ,KAAK,CAACK,UAAU,CAACD,QAAQ,GAAG,CAAC;EACvCE,KAAK,EAAEN,KAAK,CAACO,OAAO,CAACC,KAAK,CAACC,IAAI;EAC/BC,UAAU,EAAEV,KAAK,CAACE,OAAO,CAAC,CAAC;AAC7B,CAAC,CAAC,CAAC;AAEH,MAAMS,qBAAqB,SAASC,cAAK,CAACC,SAAS,CAAC;EAOlDC,iBAAiBA,CAAA,EAAG;IAClB;IACA,MAAMC,OAAO,GAAGC,iBAAQ,CAACC,WAAW,CAAC,IAAI,CAAC;IAE1C,IAAAC,yBAAU,EAACH,OAAO,CAAC;EACrB;EAEAI,MAAMA,CAAA,EAAG;IACP,MAAM;MAAEC,iBAAiB;MAAEC,kBAAkB;MAAEC;IAAyB,CAAC,GAAG,IAAI,CAACC,KAAK;IAEtF,oBACEjC,MAAA,CAAAkC,OAAA,CAAAC,aAAA,CAAC3B,YAAY,qBACXR,MAAA,CAAAkC,OAAA,CAAAC,aAAA,CAAC7B,mBAAA,CAAA4B,OAAY,EAAKJ,iBAAoB,CAAC,EACtCC,kBAAkB,iBAAI/B,MAAA,CAAAkC,OAAA,CAAAC,aAAA,CAACtB,SAAS,QAAEkB,kBAA8B,CAAC,EACjEC,wBAAwB,iBAAIhC,MAAA,CAAAkC,OAAA,CAAAC,aAAA,CAACtB,SAAS,QAAEmB,wBAAoC,CACjE,CAAC;EAEnB;AACF;AAAC,IAAAI,gBAAA,CAAAF,OAAA,EAzBKb,qBAAqB,eACN;EACjBS,iBAAiB,EAAEO,kBAAS,CAACC,MAAM,CAACC,UAAU;EAC9CR,kBAAkB,EAAEM,kBAAS,CAACG,MAAM;EACpCR,wBAAwB,EAAEK,kBAAS,CAACG;AACtC,CAAC;AAAA,IAAAC,QAAA,GAAAC,OAAA,CAAAR,OAAA,GAsBYb,qBAAqB","ignoreList":[]}
|
package/configure/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/inline-dropdown-configure",
|
|
3
|
-
"version": "8.0.0-beta.
|
|
3
|
+
"version": "8.0.0-beta.1",
|
|
4
4
|
"private": true,
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "src/index.js",
|
|
@@ -10,14 +10,14 @@
|
|
|
10
10
|
"@mui/icons-material": "^7.3.4",
|
|
11
11
|
"@mui/material": "^7.3.4",
|
|
12
12
|
"@pie-framework/pie-configure-events": "^1.3.0",
|
|
13
|
-
"@pie-lib/config-ui": "
|
|
14
|
-
"@pie-lib/editable-html": "
|
|
15
|
-
"@pie-lib/math-rendering": "
|
|
16
|
-
"@pie-lib/render-ui": "
|
|
13
|
+
"@pie-lib/config-ui": "12.1.1-next.0",
|
|
14
|
+
"@pie-lib/editable-html-tip-tap": "1.1.1-next.0",
|
|
15
|
+
"@pie-lib/math-rendering": "4.1.1-next.0",
|
|
16
|
+
"@pie-lib/render-ui": "5.1.1-next.0",
|
|
17
17
|
"classnames": "^2.2.6",
|
|
18
|
-
"debug": "^
|
|
19
|
-
"lodash": "^4.17.
|
|
20
|
-
"prop-types": "^15.
|
|
18
|
+
"debug": "^4.1.1",
|
|
19
|
+
"lodash": "^4.17.23",
|
|
20
|
+
"prop-types": "^15.8.1",
|
|
21
21
|
"react": "18.2.0",
|
|
22
22
|
"react-dom": "18.2.0"
|
|
23
23
|
}
|
package/controller/CHANGELOG.md
CHANGED
|
@@ -3,17 +3,6 @@
|
|
|
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
|
-
## [7.3.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/inline-dropdown-controller@7.3.2...@pie-element/inline-dropdown-controller@7.3.3) (2025-11-27)
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
### Bug Fixes
|
|
10
|
-
|
|
11
|
-
* bump libs PD-5274, PD-5211, PD-5248 ([7610b25](https://github.com/pie-framework/pie-elements/commit/7610b25423956b6492f33322513b3430051fca77))
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
6
|
## [7.3.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/inline-dropdown-controller@7.3.1...@pie-element/inline-dropdown-controller@7.3.2) (2025-10-22)
|
|
18
7
|
|
|
19
8
|
|
package/controller/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/inline-dropdown-controller",
|
|
3
3
|
"private": true,
|
|
4
|
-
"version": "8.0.0-beta.
|
|
4
|
+
"version": "8.0.0-beta.1",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"module": "src/index.js",
|
|
8
8
|
"author": "",
|
|
9
9
|
"license": "ISC",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@pie-lib/controller-utils": "
|
|
12
|
-
"debug": "^
|
|
13
|
-
"lodash": "^4.17.
|
|
11
|
+
"@pie-lib/controller-utils": "1.1.1-next.0",
|
|
12
|
+
"debug": "^4.1.1",
|
|
13
|
+
"lodash": "^4.17.23",
|
|
14
14
|
"type-of": "^2.0.1"
|
|
15
15
|
}
|
|
16
16
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_dll_react_dom as e,_dll_react as t,_dll_prop_types as o,_dll_mui__material_styles as i,_dll_lodash as n,_dll_pie_lib__render_ui as a,_dll_mui__icons_material as s,_dll_mui__material as l,_dll_debug as r}from"../../../@pie-lib/shared-module@^3.0.5/module/index.js";import{_dll_pie_lib__editable_html_tip_tap as c}from"../../../@pie-lib/editable-html-module@^6.0.5/module/index.js";import{_dll_pie_lib__config_ui as d}from"../../../@pie-lib/config-module@^3.0.0/module/index.js";import{_dll_pie_lib__math_rendering as p}from"../../../@pie-lib/math-rendering-module@^4.0.5/module/index.js";var h={};Object.defineProperty(h,"__esModule",{value:!0});class u extends CustomEvent{constructor(e,t=!1){super(u.TYPE,{bubbles:!0,detail:{update:e,reset:t}}),this.update=e,this.reset=t}}u.TYPE="model.updated";var g=h.ModelUpdatedEvent=u;class m extends CustomEvent{constructor(e,t){super(m.TYPE,{bubbles:!0,detail:{src:e,done:t}}),this.src=e,this.done=t}}m.TYPE="delete.image";var _=h.DeleteImageEvent=m;class C extends CustomEvent{constructor(e){super(C.TYPE,{bubbles:!0,detail:e}),this.handler=e}}C.TYPE="insert.image";var b=h.InsertImageEvent=C;class f extends CustomEvent{constructor(e,t){super(f.TYPE,{bubbles:!0,detail:{src:e,done:t}}),this.src=e,this.done=t}}f.TYPE="delete.sound";var E=h.DeleteSoundEvent=f;class S extends CustomEvent{constructor(e){super(S.TYPE,{bubbles:!0,detail:e}),this.handler=e}}S.TYPE="insert.sound";var v,y=h.InsertSoundEvent=S,x=e;v=x.createRoot,x.hydrateRoot;const A=(e={},t={})=>({...t,...e}),R=t,k=e,I=o,{styled:M}=i,{isEqual:w}=n,{isEmpty:T}=n,{color:P}=a,{Add:D}=s,{Check:q}=s,{Close:O}=s,{Edit:z}=s,{IconButton:H}=l,L=c,{renderMath:$}=p;function B(e){let t,o=e[0],i=1;for(;i<e.length;){const n=e[i],a=e[i+1];if(i+=2,("optionalAccess"===n||"optionalCall"===n)&&null==o)return;"access"===n||"optionalAccess"===n?(t=o,o=a(o)):"call"!==n&&"optionalCall"!==n||(o=a((...e)=>o.call(t,...e)),t=void 0)}return o}const j=M("div")(({theme:e})=>({display:"flex",alignItems:"flex-start",position:"relative",background:e.palette.common.white,borderBottom:`1px solid ${e.palette.grey[400]}`,"&:last-child":{borderRadius:"0 0 4px 4px"}})),W=M("div")(({theme:e})=>({display:"flex",justifyContent:"center",color:e.palette.common.white,fontSize:e.typography.fontSize,fontStyle:"normal",position:"absolute",transform:"translate(0, -50%)",backgroundColor:P.correct(),borderRadius:"50%",top:e.spacing(2),left:e.spacing(1),zIndex:3})),Y=M("div")(({theme:e,correct:t})=>({flex:1,padding:e.spacing(.75),paddingLeft:e.spacing(3.5),...t&&{background:P.correctSecondary()}})),U=M("div")(({theme:e})=>({margin:e.spacing(.5),display:"flex"})),N=M(H)(({theme:e})=>({fontSize:e.typography.fontSize,padding:e.spacing(.5),color:e.palette.common.black}));class F extends R.Component{constructor(...e){super(...e),F.prototype.__init.call(this),F.prototype.__init2.call(this)}static __initStatic(){this.propTypes={correct:I.bool.isRequired,onClick:I.func.isRequired,onRemoveChoice:I.func.isRequired,onEditChoice:I.func.isRequired,value:I.string.isRequired}}__init(){this.onRemoveClick=e=>{const{onRemoveChoice:t}=this.props;e.preventDefault(),e.stopPropagation(),t()}}__init2(){this.onEditClick=e=>{const{onEditChoice:t}=this.props;e.preventDefault(),e.stopPropagation(),t()}}render(){const{correct:e,onClick:t,value:o}=this.props;return R.createElement(j,null,e&&R.createElement(W,{onClick:t},R.createElement(q,{fontSize:"inherit"})),R.createElement(Y,{correct:e,onClick:t,dangerouslySetInnerHTML:{__html:o}}),R.createElement(U,null,R.createElement(N,{onClick:this.onEditClick,size:"small","aria-label":"Edit"},R.createElement(z,{fontSize:"inherit"})),R.createElement(N,{onClick:this.onRemoveClick,size:"small","aria-label":"Remove"},R.createElement(O,{fontSize:"inherit"}))))}}F.__initStatic();const G=F,K=M("div")(({theme:e})=>({boxShadow:e.shadows[2],borderRadius:"4px",width:"400px"})),V=M(L)(({theme:e})=>({borderRadius:"4px",backgroundColor:e.palette.common.white,'& [data-slate-editor="true"]':{minHeight:"initial !important"}})),J=M(H)(({theme:e})=>({fontSize:e.typography.fontSize+2,padding:e.spacing(.5),color:e.palette.common.black,position:"absolute",top:"50%",right:e.spacing(2),transform:"translate(0, -50%)"})),Q=M("div")({display:"flex",flexDirection:"column","& > div:last-child":{border:"none"}}),X=M("div")(({theme:e})=>({padding:e.spacing(.5),position:"relative"}));class Z extends R.Component{constructor(...e){super(...e),Z.prototype.__init3.call(this),Z.prototype.__init4.call(this),Z.prototype.__init5.call(this),Z.prototype.__init6.call(this),Z.prototype.__init7.call(this),Z.prototype.__init8.call(this),Z.prototype.__init9.call(this),Z.prototype.__init10.call(this),Z.prototype.__init11.call(this),Z.prototype.__init12.call(this),Z.prototype.__init13.call(this),Z.prototype.__init14.call(this),Z.prototype.__init15.call(this)}static __initStatic2(){this.propTypes={node:I.object,uploadSoundSupport:I.object,onDone:I.func,choices:I.array,onAddChoice:I.func.isRequired,onCheck:I.func,onRemoveChoice:I.func.isRequired,onSelectChoice:I.func.isRequired,onToolbarDone:I.func.isRequired,editor:I.object,spellCheck:I.bool}}__init3(){this.clickedInside=!1}__init4(){this.preventDone=!1}__init5(){this.state={respAreaMarkup:"",editedChoiceIndex:-1}}componentDidMount(){const{editor:e}=this.props,t=e.view.nodeDOM(e.state.selection.from);if(1===B([t,"optionalAccess",e=>e.nodeType])){const e=t.getBoundingClientRect(),o=t.closest(".tiptap").getBoundingClientRect(),i=e.top-e.height,n=e.left-o.left;this.setState({toolbarStyle:{position:"absolute",top:`${i+e.height+40}px`,left:`${n+25}px`}})}}componentDidUpdate(){const e=k.findDOMNode(this);$(e)}__init6(){this.onRespAreaChange=e=>{this.setState({respAreaMarkup:e})}}__init7(){this.onAddChoice=()=>{const{editor:e}=this.props,{tr:t}=e.state;t.isDone=!0,e.view.dispatch(t)}}__init8(){this.onDone=e=>{const{choices:t,node:o,editor:i,onAddChoice:n,onToolbarDone:a}=this.props,{editedChoiceIndex:s}=this.state,l=(e=>{const t=document.createElement("div");return t.innerHTML=(e||"").trim(),t})(e).textContent.trim();s>=0&&B([t,"optionalAccess",e=>e[s],"optionalAccess",e=>e.correct])&&(i.commands.updateAttributes("inline_dropdown",{value:e}),a(!1)),T(l)||(n(o.attrs.index,e,s),i.commands.refreshResponseArea()),this.setState({editedChoiceIndex:-1})}}__init9(){this.onSelectChoice=(e,t)=>{const{node:o,editor:i,onToolbarDone:n,onSelectChoice:a}=this.props;i.commands.updateAttributes("inline_dropdown",{value:e}),n(!1),a(t),i.commands.refreshResponseArea()}}__init10(){this.onRemoveChoice=(e,t)=>{const{node:o,editor:i,onToolbarDone:n,onRemoveChoice:a}=this.props;console.log("LOGGING",e,o.attrs.value,w(e,o.attrs.value)),w(e,o.attrs.value)&&(i.commands.updateAttributes("explicit_constructed_response",{value:null}),n(!1)),a(t),i.commands.refreshResponseArea()}}__init11(){this.onEditChoice=(e,t)=>{this.onRespAreaChange(e),this.setState({editedChoiceIndex:t})}}__init12(){this.onKeyDown=e=>{if("Enter"===e.key)return this.preventDone=!1,this.onAddChoice(),!1}}__init13(){this.onBlur=()=>{if(this.clickedInside)return void(this.clickedInside=!1);const{node:e,choices:t,onCheck:o,onToolbarDone:i,editor:n}=this.props,a=(t||[]).find(e=>e.correct);this.onAddChoice(),(!t||t&&t.length<2||!a)&&o(()=>{const{tr:e}=n.state;e.deleteSelection(),n.view.dispatch(e),i(!1)})}}__init14(){this.onClickInside=()=>{this.clickedInside=!0}}__init15(){this.focusInput=()=>{const e=this.editorRef&&this.editorRef.rootRef&&this.editorRef.rootRef.slateEditor,t=e&&e.editorRef&&e.editorRef.element;t&&t.focus()}}render(){const{choices:e,spellCheck:t,uploadSoundSupport:o,mathMlOptions:i={},baseInputConfiguration:n={},responseAreaInputConfiguration:a={}}=this.props,{respAreaMarkup:s,toolbarStyle:l}=this.state;return l?R.createElement(K,{style:{...l,backgroundColor:"#E0E1E6"},onMouseDown:this.onClickInside},R.createElement(X,null,R.createElement(V,{ref:e=>{e&&(this.editorRef=e)},autoFocus:!0,autoSave:!0,toolbarOpts:{position:"top",alwaysVisible:!1,showDone:!1,doneOn:"blur"},markup:s,onKeyDown:this.onKeyDown,languageCharactersProps:[{language:"spanish"},{language:"special"}],onChange:e=>{this.preventDone||this.onRespAreaChange(e)},onDone:e=>{this.preventDone||this.onDone(e)},onBlur:e=>{if(!e.relatedTarget)return;const t=!(!e.relatedTarget||!e.relatedTarget.closest(".insert-character-dialog")),o=!(!e.relatedTarget||!e.relatedTarget.closest('[aria-label="Done"]'));this.preventDone=t||o,(t||o)&&(this.clickedInside=!0),this.onBlur(e)},placeholder:"Add Choice",pluginProps:A(B([a,"optionalAccess",e=>e.inputConfiguration]),n),spellCheck:t,uploadSoundSupport:o,mathMlOptions:i}),R.createElement(J,{onMouseDown:()=>this.focusInput(),onClick:()=>this.onAddChoice(),size:"small","aria-label":"Add"},R.createElement(D,{fontSize:"inherit"}))),e&&R.createElement(Q,null,e.map(({label:e,correct:t},o)=>R.createElement(G,{key:o,onClick:()=>this.onSelectChoice(e,o),onRemoveChoice:()=>this.onRemoveChoice(e,o),onEditChoice:()=>this.onEditChoice(e,o),value:e,correct:t})))):null}}Z.__initStatic2();const ee=Z,te=t,oe=e,ie=o,{styled:ne}=i,ae=c,{renderMath:se}=p,le=ne("div")(({theme:e})=>({paddingBottom:e.spacing(2.5)})),re=ne("div")(({theme:e})=>({fontSize:e.typography.fontSize-2,color:e.palette.error.main,paddingTop:e.spacing(1)}));class ce extends te.Component{static __initStatic(){this.propTypes={editableHtmlProps:ie.object.isRequired,responseAreasError:ie.string,responseAreaChoicesError:ie.string}}componentDidMount(){const e=oe.findDOMNode(this);se(e)}render(){const{editableHtmlProps:e,responseAreasError:t,responseAreaChoicesError:o}=this.props;return te.createElement(le,null,te.createElement(ae,{...e}),t&&te.createElement(re,null,t),o&&te.createElement(re,null,o))}}ce.__initStatic();const de=t,pe=e,he=o,{color:ue}=a,{cloneDeep:ge}=n,{isEqual:me}=n,{isUndefined:_e}=n,{isEmpty:Ce}=n,{reduce:be}=n,{max:fe}=n,{styled:Ee}=i,{Tooltip:Se}=l,{Typography:ve}=l,{Accordion:ye}=l,{AccordionSummary:xe}=l,{AccordionDetails:Ae}=l,{ExpandMore:Re}=s,{Info:ke}=s,Ie=c,{ALL_PLUGINS:Me}=c,{AlertDialog:we}=d,{InputContainer:Te}=d,{layout:Pe}=d,{settings:De}=d,{renderMath:qe}=p;function Oe(e){let t,o=e[0],i=1;for(;i<e.length;){const n=e[i],a=e[i+1];if(i+=2,("optionalAccess"===n||"optionalCall"===n)&&null==o)return;"access"===n||"optionalAccess"===n?(t=o,o=a(o)):"call"!==n&&"optionalCall"!==n||(o=a((...e)=>o.call(t,...e)),t=void 0)}return o}const{toggle:ze,Panel:He,dropdown:Le}=De,$e=Ee(Te)(({theme:e})=>({width:"100%",paddingTop:e.spacing(2),marginBottom:e.spacing(2)})),Be=Ee(Te)(({theme:e})=>({width:"100%",paddingTop:e.spacing(.5),marginBottom:e.spacing(2)})),je=Ee(ve)(({theme:e})=>({fontSize:e.typography.fontSize+2,marginRight:e.spacing(1)})),We=Ee("span")(({theme:e})=>({display:"flex",alignItems:"center",whiteSpace:"break-spaces",color:ue.disabled(),padding:0,fontSize:e.typography.fontSize-2,lineHeight:1})),Ye=Ee("div")(({theme:e})=>({marginBottom:e.spacing(2.5)})),Ue=Ee(Ae)({display:"block",paddingTop:0,paddingBottom:0}),Ne=Ee("div")(({theme:e})=>({display:"flex",alignItems:"center",marginBottom:e.spacing(1)})),Fe=Ee(Se)(({theme:e})=>({"& .MuiTooltip-tooltip":{fontSize:e.typography.fontSize-2,whiteSpace:"pre",maxWidth:"500px"}})),Ge=Ee("div")(({theme:e})=>({fontSize:e.typography.fontSize-2,color:e.palette.error.main,paddingTop:e.spacing(1)}));class Ke extends de.Component{constructor(...e){super(...e),Ke.prototype.__init.call(this),Ke.prototype.__init2.call(this),Ke.prototype.__init3.call(this),Ke.prototype.__init4.call(this),Ke.prototype.__init5.call(this),Ke.prototype.__init6.call(this),Ke.prototype.__init7.call(this),Ke.prototype.__init8.call(this),Ke.prototype.__init9.call(this),Ke.prototype.__init10.call(this),Ke.prototype.__init11.call(this),Ke.prototype.__init12.call(this)}static __initStatic(){this.propTypes={configuration:he.object.isRequired,model:he.object.isRequired,disableSidePanel:he.bool,onModelChanged:he.func.isRequired,onConfigurationChanged:he.func.isRequired,imageSupport:he.shape({add:he.func.isRequired,delete:he.func.isRequired}),uploadSoundSupport:he.shape({add:he.func.isRequired,delete:he.func.isRequired})}}__init(){this.state={warning:{open:!1}}}componentDidMount(){const{model:{choices:e}}=this.props;this.setState({respAreaChoices:ge(e)})}UNSAFE_componentWillReceiveProps(e){const t={};me(e.model.choices,this.props.model.choices)&&me(e.model.choices,this.state.respAreaChoices)||(t.respAreaChoices=ge(e.model.choices)),Ce(t)||this.setState(t)}componentDidUpdate(){const e=pe.findDOMNode(this);qe(e)}__init2(){this.onModelChange=e=>{this.props.onModelChanged({...this.props.model,...e})}}__init3(){this.onPromptChanged=e=>{this.onModelChange({prompt:e})}}__init4(){this.onRationaleChanged=e=>{this.onModelChange({rationale:e})}}__init5(){this.onChoiceRationaleChanged=(e,t)=>{const{model:o}=this.props,i=o.choices&&o.choices[e]&&o.choices[e].findIndex(e=>e.label===t.label&&e.value===t.value);o.choices[e]&&o.choices[e].splice(i,1,t),this.onModelChange(o)}}__init6(){this.onTeacherInstructionsChanged=e=>{this.onModelChange({teacherInstructions:e})}}__init7(){this.onMarkupChanged=e=>{this.onModelChange({slateMarkup:e})}}__init8(){this.onCheck=e=>{this.setState({warning:{open:!0,text:"Response areas with under 2 options or with no correct answers will be discarded.",onClose:()=>{this.setState({warning:{open:!1}})},onConfirm:()=>{this.setState({warning:{open:!1}},e)}}})}}__init9(){this.onChange=e=>{const{respAreaChoices:t}=this.state,o=(e=>{const t=document.createElement("div");return t.innerHTML=(e||"").trim(),t})(e),i=o.querySelectorAll('[data-type="inline_dropdown"]'),n={};i.forEach(e=>{n[e.dataset.index]=e.dataset.value||""});const a=be(t,(e,o,i)=>(_e(n[i])||(e[i]=t[i]),e),{}),s={};let l=!1;i.forEach((e,t)=>{const o=a[e.dataset.index]||[];o.length<2||!o.find(e=>e.correct)?(e.remove(),l=!0):(s[t]=a[e.dataset.index]||[],e.dataset.index=t)}),l?this.setState({warning:{open:!0,text:"Response areas with under 2 options or with no correct answers will be discarded.",onClose:()=>{this.setState({warning:{open:!1}})},onConfirm:()=>{this.setState({warning:{open:!1}},()=>this.onModelChange({choices:ge(s),slateMarkup:o.innerHTML}))}}}):this.onModelChange({choices:ge(s),slateMarkup:o.innerHTML})}}__init10(){this.onAddChoice=(e,t,o)=>{const{respAreaChoices:i}=this.state,{maxResponseAreaChoices:n}=this.props.configuration;if(i[e]&&i[e].length>=n)this.setState({warning:{open:!0,text:`There are only ${n} answers allowed per choice.`,onClose:void 0,onConfirm:()=>{this.setState({warning:{open:!1}})}}});else if(i[e]||(i[e]=[]),(i[e]||[]).find((e,i)=>e.label===t&&i!==o))this.setState({warning:{open:!0,text:"Duplicate answers are not allowed.",onClose:void 0,onConfirm:()=>{this.setState({warning:{open:!1}})}}});else{if(o>=0&&Oe([i,"access",t=>t[e],"optionalAccess",e=>e[o]]))i[e][o].label=t;else{const o=i[e]&&fe(i[e].map(e=>parseInt(e.value)).filter(e=>!isNaN(e)))||0;i[e].push({label:t,value:`${o+1}`,correct:!1})}this.onModelChange({choices:ge(i)})}}}__init11(){this.onRemoveChoice=(e,t)=>{const{respAreaChoices:o}=this.state;o[e].splice(t,1),this.onModelChange({choices:ge(o)})}}__init12(){this.onSelectChoice=(e,t)=>{const{respAreaChoices:o}=this.state;o[e]=o[e].map((e,o)=>({...e,correct:o===t})),this.onModelChange({choices:ge(o)})}}render(){const{warning:e}=this.state,{model:t,configuration:o,onConfigurationChanged:i,imageSupport:n,uploadSoundSupport:a}=this.props,{baseInputConfiguration:s={},choiceRationale:l={},contentDimensions:r={},lockChoiceOrder:c={},maxResponseAreas:d,maxImageWidth:p={},maxImageHeight:h={},partialScoring:u={},prompt:g={},rationale:m={},settingsPanelDisabled:_,spellCheck:C={},teacherInstructions:b={},template:f={},withRubric:E={},mathMlOptions:S={},language:v={},languageChoices:y={},responseAreaInputConfiguration:x={}}=o||{},{choiceRationaleEnabled:A,choices:R,errors:k,extraCSSRules:I,promptEnabled:M,rationaleEnabled:w,spellCheckEnabled:T,teacherInstructionsEnabled:P,toolbarEditorPosition:D}=t||{},{prompt:q,rationale:O,responseAreasError:z,responseAreaChoicesError:H,teacherInstructions:L}=k||{},$=p&&p.prompt,B=h&&h.prompt,j={position:"top"===D?"top":"bottom"},W=(e=>{const{maxResponseAreas:t,maxResponseAreaChoices:o}=e;return"Validation requirements:\nThere should be at least 1 "+(t?`and at most ${t} `:"")+"response area"+(t?"s":"")+" defined."+(o?`\nThere should be at most ${o} choices defined per response area.`:"")})(o),Y={partialScoring:u.settings&&ze(u.label),lockChoiceOrder:c.settings&&ze(c.label),"language.enabled":v.settings&&ze(v.label,!0),language:v.settings&&v.enabled&&Le(y.label,y.options)},U={teacherInstructionsEnabled:b.settings&&ze(b.label),rationaleEnabled:m.settings&&ze(m.label),choiceRationaleEnabled:l.settings&&ze(l.label),promptEnabled:g.settings&&ze(g.label),spellCheckEnabled:C.settings&&ze(C.label),rubricEnabled:Oe([E,"optionalAccess",e=>e.settings])&&ze(Oe([E,"optionalAccess",e=>e.label]))},N=(e={})=>({...s,...e});return de.createElement(Pe.ConfigLayout,{extraCSSRules:{names:["red","blue"],rules:"\n .red {\n color: red !important;\n }\n\n .blue {\n color: blue !important;\n }\n "},dimensions:r,hideSettings:_,settings:de.createElement(He,{model:t,configuration:o,onChangeModel:e=>this.onModelChange(e),onChangeConfiguration:e=>i(e,!0),groups:{Settings:Y,Properties:U}})},P&&de.createElement($e,{label:b.label},de.createElement(Ie,{markup:t.teacherInstructions||"",onChange:this.onTeacherInstructionsChanged,imageSupport:n,nonEmpty:!1,error:L,toolbarOpts:j,pluginProps:N(Oe([b,"optionalAccess",e=>e.inputConfiguration])),spellCheck:T,maxImageWidth:p&&p.teacherInstructions||$,maxImageHeight:h&&h.teacherInstructions||B,uploadSoundSupport:a,languageCharactersProps:[{language:"spanish"},{language:"special"}],mathMlOptions:S}),L&&de.createElement(Ge,null,L)),M&&de.createElement($e,{label:g.label},de.createElement(Ie,{markup:t.prompt,onChange:this.onPromptChanged,imageSupport:n,nonEmpty:!1,disableUnderline:!0,error:q,toolbarOpts:j,pluginProps:N(Oe([g,"optionalAccess",e=>e.inputConfiguration])),spellCheck:T,maxImageWidth:$,maxImageHeight:B,uploadSoundSupport:a,languageCharactersProps:[{language:"spanish"},{language:"special"}],mathMlOptions:S}),q&&de.createElement(Ge,null,q)),de.createElement(Ne,null,de.createElement(je,{component:"div"},"Define Template, Choices, and Correct Responses"),de.createElement(Fe,{disableFocusListener:!0,disableTouchListener:!0,placement:"right",title:W},de.createElement(ke,{fontSize:"small",color:"primary"}))),de.createElement(ce,{responseAreasError:z,responseAreaChoicesError:H,editableHtmlProps:{pluginProps:N(Oe([f,"optionalAccess",e=>e.inputConfiguration])),activePlugins:Me,toolbarOpts:{position:"top"},extraCSSRules:{names:["red","blue"],rules:"\n .red {\n color: red !important;\n }\n\n .blue {\n color: blue !important;\n }\n "},responseAreaProps:{type:"inline-dropdown",options:{duplicates:!0},maxResponseAreas:d,respAreaToolbar:(e,t,o)=>{const{respAreaChoices:i}=this.state;return()=>de.createElement(ee,{onAddChoice:this.onAddChoice,onCheck:this.onCheck,onRemoveChoice:t=>this.onRemoveChoice(e.attrs.index,t),onSelectChoice:t=>this.onSelectChoice(e.attrs.index,t),node:e,editor:t,onToolbarDone:o,choices:i[e.attrs.index],spellCheck:T,uploadSoundSupport:a,mathMlOptions:S,baseInputConfiguration:s,responseAreaInputConfiguration:x})}},spellCheck:T,markup:t.slateMarkup||"",onChange:this.onChange,imageSupport:n,disableImageAlignmentButtons:!0,disabled:!1,highlightShape:!1,error:z,uploadSoundSupport:a,languageCharactersProps:[{language:"spanish"},{language:"special"}],mathMlOptions:S}}),A&&(()=>(Object.keys(R)||[]).map((e,t)=>de.createElement(Ye,{key:e},de.createElement(ye,{slotProps:{transition:{timeout:{enter:225,exit:195}}}},de.createElement(xe,{expandIcon:de.createElement(Re,null)},de.createElement(je,{component:"div"},`Rationale for response area #${t+1}`)),de.createElement(Ue,null,(R[e]||[]).map(t=>de.createElement(de.Fragment,{key:t.label},de.createElement(We,{dangerouslySetInnerHTML:{__html:`${m.label} for ${t.label} (${t.correct?"correct":"incorrect"})`}}),de.createElement(Be,null,de.createElement(Ie,{markup:t.rationale||"",spellCheck:T,onChange:o=>this.onChoiceRationaleChanged(e,{...t,rationale:o}),imageSupport:n,maxImageWidth:p&&p.rationale||$,maxImageHeight:h&&h.rationale||B,uploadSoundSupport:a,mathMlOptions:S})))))))))(),w&&de.createElement($e,{label:m.label},de.createElement(Ie,{markup:t.rationale||"",onChange:this.onRationaleChanged,imageSupport:n,error:O,toolbarOpts:j,pluginProps:N(Oe([m,"optionalAccess",e=>e.inputConfiguration])),spellCheck:T,maxImageWidth:p&&p.rationale||$,maxImageHeight:h&&h.rationale||B,uploadSoundSupport:a,languageCharactersProps:[{language:"spanish"},{language:"special"}],mathMlOptions:S}),O&&de.createElement(Ge,null,O)),de.createElement(we,{open:e.open,title:"Warning",text:e.text,onClose:e.onClose,onConfirm:e.onConfirm,disableAutoFocus:!0,disableEnforceFocus:!0,disableRestoreFocus:!0}))}}Ke.__initStatic();var Ve={alternateResponse:{},choiceRationaleEnabled:!0,choices:{},disabled:!1,displayType:"block",markup:"",mode:"gather",prompt:"",promptEnabled:!0,rationale:"",rationaleEnabled:!0,shuffle:!0,studentInstructionsEnabled:!0,teacherInstructions:"",teacherInstructionsEnabled:!0,toolbarEditorPosition:"bottom"},Je={baseInputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1},h3:{disabled:!0},blockquote:{disabled:!0},textAlign:{disabled:!0},showParagraphs:{disabled:!1},separateParagraphs:{disabled:!0}},prompt:{settings:!0,label:"Prompt",required:!1,inputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1}}},responseAreaInputConfiguration:{inputConfiguration:{audio:{disabled:!0},video:{disabled:!0},image:{disabled:!0},table:{disabled:!0},ul_list:{disabled:!0},ol_list:{disabled:!0}}},settingsPanelDisabled:!1,spellCheck:{label:"Spellcheck",settings:!1,enabled:!0},lockChoiceOrder:{settings:!0,label:"Lock Choice Order"},partialScoring:{settings:!1,label:"Allow Partial Scoring"},rationale:{settings:!0,label:"Rationale",required:!1,inputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1}}},teacherInstructions:{settings:!0,label:"Teacher Instructions",required:!1,inputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1}}},template:{inputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1}}},choiceRationale:{settings:!0,label:"Choice Rationale"},toolbarEditorPosition:{settings:!1,label:"Toolbar Editor Position"},maxResponseAreas:10,maxResponseAreaChoices:10,maxImageWidth:{teacherInstructions:300,prompt:300,rationale:300},maxImageHeight:{teacherInstructions:300,prompt:300,rationale:300},withRubric:{settings:!1,label:"Add Rubric"},mathMlOptions:{mmlOutput:!1,mmlEditing:!1},language:{settings:!1,label:"Specify Language",enabled:!1},languageChoices:{label:"Language Choices",options:[]}};const{escape:Qe}=n,Xe="imes|riangle|an|heta|herefore",Ze="throot|parallel|cong|approx|eq|e|sim",et=new RegExp(`(\\t(?!${Xe}))|(\\n(?!${Ze}))|(\\\\t(?!${Xe}))|(\\\\n(?!${Ze}))`,"g"),tt=e=>e.replace(et,"").replace(/\\"/g,'"').replace(/\\\//g,"/"),ot=/\{\{(\d+)\}\}/g,it=t,nt=r,{defaults:at}=n;function st(e){let t,o=e[0],i=1;for(;i<e.length;){const n=e[i],a=e[i+1];if(i+=2,("optionalAccess"===n||"optionalCall"===n)&&null==o)return;"access"===n||"optionalAccess"===n?(t=o,o=a(o)):"call"!==n&&"optionalCall"!==n||(o=a((...e)=>o.call(t,...e)),t=void 0)}return o}const lt=nt("multiple-choice:configure");class rt extends HTMLElement{static __initStatic(){this.prepareModel=(e={})=>{const t={...Ve,...e},o=e.slateMarkup||((e,t)=>tt(e).replace(ot,(e,o)=>(e=>{let o=t[e]&&t[e].find(e=>e.correct);return o&&o.value||(o={id:"",value:"",label:""}),`<span data-type="inline_dropdown" data-index="${e}" data-value="${Qe(o.label)}"></span>`})(o)))(t.markup,t.choices),i=(e=>{const t=(e=>{const t=document.createElement("div");return t.innerHTML=e.trim(),t})(tt(e));return t.querySelectorAll('[data-type="inline_dropdown"]').forEach(e=>{e.replaceWith(`{{${e.dataset.index}}}`)}),t.innerHTML})(o);return{...t,slateMarkup:o,markup:i}}}constructor(){super(),this._root=null,this._model=rt.prepareModel(),this._configuration=Je,this.onModelChanged=this.onModelChanged.bind(this),this.onConfigurationChanged=this.onConfigurationChanged.bind(this)}set model(e){this._model=rt.prepareModel(e),this._render()}set configuration(e){this._configuration=at(e,Je),st([e,"access",e=>e.language,"optionalAccess",e=>e.enabled])?st([e,"access",e=>e.languageChoices,"optionalAccess",e=>e.options,"optionalAccess",e=>e.length])&&(this._model.language=e.languageChoices.options[0].value):e.language.settings&&this._model.language?(this._configuration.language.enabled=!0,this._configuration.languageChoices.options&&this._configuration.languageChoices.options.length||(this._configuration.languageChoices.options=[]),this._configuration.languageChoices.options.find(e=>e.value===this._model.language)||this._configuration.languageChoices.options.push({value:this._model.language,label:this._model.language})):delete this._model.language,this._render()}set disableSidePanel(e){this._disableSidePanel=e,this._render()}dispatchModelUpdated(e){const t=!!e;this.dispatchEvent(new g(this._model,t))}onModelChanged(e,t){this._model=rt.prepareModel(e),this._render(),this.dispatchModelUpdated(t)}onConfigurationChanged(e){this._configuration=e,this._render()}insertImage(e){this.dispatchEvent(new b(e))}onDeleteImage(e,t){this.dispatchEvent(new _(e,t))}insertSound(e){this.dispatchEvent(new y(e))}onDeleteSound(e,t){this.dispatchEvent(new E(e,t))}_render(){lt("_render");let e=it.createElement(Ke,{model:this._model,configuration:this._configuration,onModelChanged:this.onModelChanged,onConfigurationChanged:this.onConfigurationChanged,disableSidePanel:this._disableSidePanel,imageSupport:{add:this.insertImage.bind(this),delete:this.onDeleteImage.bind(this)},uploadSoundSupport:{add:this.insertSound.bind(this),delete:this.onDeleteSound.bind(this)}});this._root||(this._root=v(this)),this._root.render(e)}disconnectedCallback(){this._root&&this._root.unmount()}}rt.__initStatic();export{rt as default};
|