@pie-element/math-inline 10.1.0 → 10.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/configure/CHANGELOG.md +17 -0
- package/configure/lib/general-config-block.js +0 -1
- package/configure/lib/general-config-block.js.map +1 -1
- package/configure/package.json +7 -7
- package/controller/CHANGELOG.md +11 -0
- package/controller/package.json +3 -3
- package/module/configure.js +1 -0
- package/module/controller.js +4320 -0
- package/module/demo.js +66 -0
- package/module/element.js +1 -0
- package/module/index.html +21 -0
- package/module/manifest.json +14 -0
- package/module/print-demo.js +104 -0
- package/module/print.html +18 -0
- package/module/print.js +1 -0
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,23 @@
|
|
|
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
|
+
# [10.2.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/math-inline@10.0.0...@pie-element/math-inline@10.2.0) (2025-10-10)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* conclude merge with develop ([8388078](https://github.com/pie-framework/pie-elements/commit/8388078124486bdab0def8dbe5e442117514c05a))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* allow elemnts to use same fontFamily set in common ui container to avoid incons PD-5199 ([8b1742e](https://github.com/pie-framework/pie-elements/commit/8b1742e06c9befe1e81bf6a76c72448c91b2429b))
|
|
17
|
+
* update libs PD-5208, PD-5211, PD-5199, PD-5218, PD-5217 ([da327fa](https://github.com/pie-framework/pie-elements/commit/da327fa501f6e9eff1c0b30b5ef092426a91f78b))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
6
23
|
# [10.1.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/math-inline@9.0.0...@pie-element/math-inline@10.1.0) (2025-10-07)
|
|
7
24
|
|
|
8
25
|
**Note:** Version bump only for package @pie-element/math-inline
|
package/configure/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,23 @@
|
|
|
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
|
+
# [9.2.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/math-inline-configure@9.0.1...@pie-element/math-inline-configure@9.2.0) (2025-10-10)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* conclude merge with develop ([8388078](https://github.com/pie-framework/pie-elements/commit/8388078124486bdab0def8dbe5e442117514c05a))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* allow elemnts to use same fontFamily set in common ui container to avoid incons PD-5199 ([8b1742e](https://github.com/pie-framework/pie-elements/commit/8b1742e06c9befe1e81bf6a76c72448c91b2429b))
|
|
17
|
+
* update libs PD-5208, PD-5211, PD-5199, PD-5218, PD-5217 ([da327fa](https://github.com/pie-framework/pie-elements/commit/da327fa501f6e9eff1c0b30b5ef092426a91f78b))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
6
23
|
# [9.1.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/math-inline-configure@9.0.0...@pie-element/math-inline-configure@9.1.0) (2025-10-07)
|
|
7
24
|
|
|
8
25
|
**Note:** Version bump only for package @pie-element/math-inline-configure
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/general-config-block.jsx"],"names":["registered","styles","theme","container","display","flexDirection","templateTitle","fontSize","title","addResponseButton","border","palette","grey","width","flexContainer","alignItems","justifyContent","selectContainer","flex","marginTop","spacing","unit","marginBottom","responseTemplate","responseEditor","maxWidth","height","minHeight","textAlign","padding","promptHolder","paddingTop","blockContainer","margin","blockContainerGeneric","blockResponse","fontFamily","color","background","borderRight","blockResponseGeneric","blockMath","tooltip","typography","whiteSpace","errorText","error","main","advancedResponse","REGEX","TEMPORARY_RESPONSE_FIELD","ANSWER_BLOCK_REGEX","NEWLINE_BLOCK","NEWLINE_LATEX","prepareForStatic","expression","answerBlocks","replace","prepareForModel","GeneralConfigBlock","props","name","evtOrValue","model","onChange","newModel","target","value","setState","showKeypad","responseAreas","state","root","Object","keys","length","forEach","responseId","idx","el","querySelector","indexEl","MQ","MathQuill","getInterface","StaticMath","textContent","responseIdCounter","newCounter","responses","find","response","id","validation","answer","alternates","concat","index","classes","window","registerEmbed","data","genericAnswerBlock","htmlString","text","latex","handleAnswerBlockDomUpdate","imageSupport","uploadSoundSupport","configuration","promptEnabled","rationaleEnabled","toolbarOpts","prompt","equationEditor","promptEquationEditor","responseType","rationale","spellCheckEnabled","errors","baseInputConfiguration","cRationale","cPrompt","ignoreOrder","cIgnoreOrder","allowTrailingZeros","cAllowTrailingZeros","maxResponseAreas","maxImageWidth","maxImageHeight","mathMlOptions","validationMessage","promptError","rationaleError","responsesErrors","responseAreasError","defaultImageMaxWidth","defaultImageMaxHeight","classNames","editor","mathToolbar","responsesToUse","ResponseTypes","advanced","slice","validationTooltip","marginLeft","r","label","onPromptFocus","inputConfiguration","language","select","onFocus","onDone","simple","map","onResponseChange","math","controlledKeypadMode","React","Component","PropTypes","object","isRequired","func","bool"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;AAEA,IAAIA,UAAU,GAAG,KAAjB;;AAEA,IAAMC,MAAM,GAAG,SAATA,MAAS,CAACC,KAAD;AAAA,SAAY;AACzBC,IAAAA,SAAS,EAAE;AACTC,MAAAA,OAAO,EAAE,MADA;AAETC,MAAAA,a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MjBnG,EAAAA,QAAQ,EAAEkG,sBAAUG,IAAV,CAAeD,UANR;AAOjBtD,EAAAA,aAAa,EAAEoD,sBAAUI,IAPR;AAQjBvD,EAAAA,gBAAgB,EAAEmD,sBAAUI,IARX;AASjBtD,EAAAA,WAAW,EAAEkD,sBAAUC;AATN,C;;eAiYN,wBAAWlK,MAAX,EAAmB0D,kBAAnB,C","sourcesContent":["import * as React from 'react';\nimport PropTypes from 'prop-types';\nimport cx from 'classnames';\nimport EditableHtml from '@pie-lib/editable-html';\nimport { InputContainer } from '@pie-lib/config-ui';\nimport { withStyles } from '@material-ui/core/styles';\nimport InputLabel from '@material-ui/core/InputLabel';\nimport Select from '@material-ui/core/Select';\nimport MenuItem from '@material-ui/core/MenuItem';\nimport Response from './response';\nimport { MathToolbar } from '@pie-lib/math-toolbar';\nimport isEqual from 'lodash/isEqual';\nimport { ResponseTypes, generateValidationMessage, getPluginProps } from './utils';\nimport MathQuill from '@pie-framework/mathquill';\nimport Info from '@material-ui/icons/Info';\nimport Tooltip from '@material-ui/core/Tooltip';\n\nlet registered = false;\n\nconst styles = (theme) => ({\n container: {\n display: 'flex',\n flexDirection: 'column',\n },\n templateTitle: {\n fontSize: '0.85rem',\n },\n title: {\n fontSize: '1.1rem',\n },\n addResponseButton: {\n border: `1px solid ${theme.palette.grey['A100']}`,\n float: 'right',\n width: '150px',\n },\n flexContainer: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n },\n selectContainer: {\n flex: 'initial',\n width: '40%',\n marginTop: theme.spacing.unit * 2,\n marginBottom: theme.spacing.unit * 2,\n },\n responseTemplate: {\n display: 'flex',\n flexDirection: 'column',\n },\n responseEditor: {\n display: 'flex',\n justifyContent: 'center',\n width: '100%',\n // minWidth: '500px',\n maxWidth: 'inherit',\n height: 'auto',\n minHeight: '130px',\n textAlign: 'left',\n padding: theme.spacing.unit,\n },\n promptHolder: {\n width: '100%',\n paddingTop: theme.spacing.unit * 2,\n marginBottom: theme.spacing.unit * 2,\n },\n blockContainer: {\n margin: theme.spacing.unit,\n display: 'inline-flex',\n border: '2px solid grey',\n },\n blockContainerGeneric: {\n margin: theme.spacing.unit / 2,\n },\n blockResponse: {\n fontFamily: 'Roboto, Helvetica, Arial, sans-serif !important',\n flex: 2,\n color: 'grey',\n background: theme.palette.grey['A100'],\n fontSize: '0.8rem',\n padding: theme.spacing.unit / 2,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n borderRight: '2px solid grey',\n },\n blockResponseGeneric: {\n borderRight: 0,\n },\n blockMath: {\n color: theme.palette.grey[400],\n padding: theme.spacing.unit / 2,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n flex: 8,\n '& > .mq-math-mode': {\n '& > .mq-hasCursor': {\n '& > .mq-cursor': {\n display: 'none',\n },\n },\n },\n },\n tooltip: {\n fontSize: theme.typography.fontSize - 2,\n whiteSpace: 'pre-wrap',\n },\n errorText: {\n fontSize: theme.typography.fontSize - 2,\n color: theme.palette.error.main,\n paddingTop: theme.spacing.unit,\n },\n advancedResponse: {\n marginBottom: theme.spacing.unit * 2.5,\n },\n});\n\nconst REGEX = /{{response}}/gm;\nconst TEMPORARY_RESPONSE_FIELD = /\\\\%response\\\\%/gm;\nconst ANSWER_BLOCK_REGEX = /\\\\embed\\{answerBlock\\}\\[r\\d*\\]/g;\nconst NEWLINE_BLOCK = /\\\\embed\\{newLine\\}\\[\\]/g;\nconst NEWLINE_LATEX = /\\\\newline/g;\n\nfunction prepareForStatic(expression) {\n if (expression) {\n let answerBlocks = 1; // assume one at least\n\n return expression\n .replace(REGEX, () => `\\\\embed{answerBlock}[r${answerBlocks++}]`)\n .replace(NEWLINE_LATEX, '\\\\embed{newLine}[]');\n }\n}\n\nfunction prepareForModel(expression) {\n if (expression) {\n return expression\n .replace(ANSWER_BLOCK_REGEX, () => '{{response}}')\n .replace(TEMPORARY_RESPONSE_FIELD, () => '{{response}}')\n .replace(NEWLINE_BLOCK, () => '\\\\newline');\n }\n}\n\nclass GeneralConfigBlock extends React.Component {\n static propTypes = {\n classes: PropTypes.object.isRequired,\n model: PropTypes.object.isRequired,\n imageSupport: PropTypes.object,\n uploadSoundSupport: PropTypes.object,\n configuration: PropTypes.object,\n onChange: PropTypes.func.isRequired,\n promptEnabled: PropTypes.bool,\n rationaleEnabled: PropTypes.bool,\n toolbarOpts: PropTypes.object,\n };\n\n constructor(props) {\n super(props);\n\n const responseAreas = {};\n\n if (props.model && props.model.expression) {\n let answerBlocks = 1; // assume one at least\n // build out local state model using responses declared in expression\n\n props.model.expression.replace(REGEX, () => {\n responseAreas[`r${answerBlocks++}`] = {\n value: '',\n };\n });\n }\n\n this.state = {\n showKeypad: false,\n responseAreas,\n responseIdCounter: Object.keys(responseAreas).length,\n };\n }\n\n onChange = (name) => (evtOrValue) => {\n const { model, onChange } = this.props;\n const newModel = { ...model };\n\n if (typeof evtOrValue === 'object') {\n newModel[name] = evtOrValue.target.value;\n } else {\n newModel[name] = evtOrValue;\n }\n\n if (name === 'expression') {\n newModel[name] = prepareForModel(evtOrValue);\n }\n\n onChange(newModel);\n };\n\n onDone = () => {\n this.setState({ showKeypad: false });\n };\n\n onFocus = () => {\n this.setState({ showKeypad: true });\n };\n\n onPromptFocus = () => {\n this.setState({ showKeypad: false });\n };\n\n UNSAFE_componentWillMount() {\n const { classes } = this.props;\n\n if (typeof window !== 'undefined') {\n // const MathQuill = require('@pie-framework/mathquill');\n let MQ = MathQuill.getInterface(2);\n\n if (!registered) {\n MQ.registerEmbed('answerBlock', (data) => {\n // not used until we implement individual answer tracking\n // const individualAnswerBlock = `<div class=\"${classes.blockContainer}\">\n // <div class=\"${classes.blockResponse}\" id=\"${data}Index\">R</div>\n // <div class=\"${classes.blockMath}\">\n // <span id=\"${data}\"></span>\n // </div>\n // </div>`;\n\n const genericAnswerBlock = `<div class=\"${cx(classes.blockContainer, classes.blockContainerGeneric)}\">\n <div class=\"${cx(classes.blockResponse, classes.blockResponseGeneric)}\" id=\"${data}Index\">Response</div>\n </div>`;\n\n return {\n htmlString: genericAnswerBlock,\n text: () => 'text',\n latex: () => `\\\\embed{answerBlock}[${data}]`,\n };\n });\n\n registered = true;\n }\n }\n }\n\n componentDidMount() {\n this.handleAnswerBlockDomUpdate();\n }\n\n componentDidUpdate() {\n this.handleAnswerBlockDomUpdate();\n }\n\n handleAnswerBlockDomUpdate = () => {\n const { model } = this.props;\n\n const responseAreas = {};\n\n if (model && model.expression) {\n let answerBlocks = 1; // assume one at least\n // build out local state model using responses declared in expression\n\n model.expression.replace(REGEX, () => {\n responseAreas[`r${answerBlocks++}`] = {\n value: '',\n };\n });\n }\n\n if (!isEqual(responseAreas, this.state.responseAreas)) {\n this.setState(\n {\n responseAreas,\n },\n () => {\n if (this.root && Object.keys(responseAreas).length) {\n Object.keys(responseAreas).forEach((responseId, idx) => {\n const el = this.root.querySelector(`#${responseId}`);\n const indexEl = this.root.querySelector(`#${responseId}Index`);\n\n if (el) {\n // const MathQuill = require('@pie-framework/mathquill');\n let MQ = MathQuill.getInterface(2);\n // We no longer have individual answers, so we cannot set text content of blocks\n // el.textContent = response.answer;\n MQ.StaticMath(el);\n indexEl.textContent = `R${idx + 1}`;\n }\n });\n }\n },\n );\n }\n };\n\n onAddResponse = () => {\n const { model, onChange } = this.props;\n const { responseIdCounter } = this.state;\n const newModel = { ...model };\n\n let newCounter = responseIdCounter;\n\n while (model.responses.find((response) => response.id === newCounter)) {\n newCounter++;\n }\n\n const response = {\n id: newCounter,\n validation: 'literal',\n answer: '',\n alternates: {},\n };\n\n newModel.responses = newModel.responses.concat(response);\n onChange(newModel);\n\n this.setState({\n responseIdCounter: response.id,\n });\n };\n\n onResponseChange = (response, index) => {\n const { model, onChange } = this.props;\n const newModel = { ...model };\n\n newModel.responses[index] = response;\n onChange(newModel);\n };\n\n render() {\n const {\n classes,\n model,\n imageSupport,\n uploadSoundSupport,\n configuration,\n promptEnabled,\n rationaleEnabled,\n toolbarOpts,\n } = this.props;\n const { showKeypad } = this.state;\n const {\n prompt,\n expression,\n equationEditor,\n promptEquationEditor = '8',\n responses,\n responseType,\n rationale,\n spellCheckEnabled,\n errors = {},\n } = model;\n const {\n baseInputConfiguration = {},\n rationale: cRationale = {},\n prompt: cPrompt = {},\n ignoreOrder: cIgnoreOrder = {},\n allowTrailingZeros: cAllowTrailingZeros = {},\n maxResponseAreas,\n maxImageWidth = {},\n maxImageHeight = {},\n mathMlOptions = {},\n } = configuration || {};\n const validationMessage = generateValidationMessage(configuration, model);\n const { prompt: promptError, rationale: rationaleError, responsesErrors, responseAreasError } = errors;\n\n const defaultImageMaxWidth = maxImageWidth && maxImageWidth.prompt;\n const defaultImageMaxHeight = maxImageHeight && maxImageHeight.prompt;\n\n const classNames = {\n editor: classes.responseEditor,\n mathToolbar: classes.mathToolbar,\n };\n\n const responsesToUse = responseType === ResponseTypes.advanced ? responses : responses.slice(0, 1);\n\n const validationTooltip = (\n <Tooltip\n classes={{ tooltip: classes.tooltip }}\n disableFocusListener\n disableTouchListener\n placement={'right'}\n title={validationMessage}\n >\n <Info fontSize={'small'} color={'primary'} style={{ marginLeft: '5px' }} />\n </Tooltip>\n );\n\n return (\n <div ref={(r) => (this.root = r || this.root)} className={classes.container}>\n {promptEnabled && (\n <InputContainer label={cPrompt.label} className={classes.promptHolder}>\n <EditableHtml\n onFocus={this.onPromptFocus}\n className={classes.prompt}\n markup={prompt || ''}\n onChange={this.onChange('prompt')}\n imageSupport={imageSupport}\n nonEmpty={false}\n error={promptError}\n toolbarOpts={toolbarOpts}\n pluginProps={getPluginProps(cPrompt?.inputConfiguration, baseInputConfiguration)}\n spellCheck={spellCheckEnabled}\n maxImageWidth={defaultImageMaxWidth}\n maxImageHeight={defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n mathMlOptions={mathMlOptions}\n />\n {promptError && <div className={classes.errorText}>{promptError}</div>}\n </InputContainer>\n )}\n\n {responseType === ResponseTypes.advanced && (\n <div className={classes.advancedResponse}>\n <div className={classes.flexContainer} style={{ justifyContent: 'flex-start' }}>\n <div className={classes.title}>Define Response</div>\n {validationTooltip}\n </div>\n\n <InputContainer\n key=\"templateEditorType\"\n label=\"Response Template Equation Editor\"\n className={classes.selectContainer}\n >\n <Select\n className={classes.select}\n onChange={this.onChange('promptEquationEditor')}\n value={promptEquationEditor}\n >\n <MenuItem value=\"non-negative-integers\">Numeric - Non-Negative Integers</MenuItem>\n <MenuItem value=\"integers\">Numeric - Integers</MenuItem>\n <MenuItem value=\"decimals\">Numeric - Decimals</MenuItem>\n <MenuItem value=\"fractions\">Numeric - Fractions</MenuItem>\n <MenuItem value={1}>Grade 1 - 2</MenuItem>\n <MenuItem value={3}>Grade 3 - 5</MenuItem>\n <MenuItem value={6}>Grade 6 - 7</MenuItem>\n <MenuItem value={8}>Grade 8 - HS</MenuItem>\n <MenuItem value={'geometry'}>Geometry</MenuItem>\n <MenuItem value={'advanced-algebra'}>Advanced Algebra</MenuItem>\n <MenuItem value={'statistics'}>Statistics</MenuItem>\n <MenuItem value={'item-authoring'}>Item Authoring</MenuItem>\n </Select>\n </InputContainer>\n\n <div className={classes.responseTemplate} key=\"templateHolder\">\n <InputLabel className={classes.templateTitle}>RESPONSE TEMPLATE</InputLabel>\n <MathToolbar\n classNames={classNames}\n allowAnswerBlock\n keypadMode={promptEquationEditor}\n controlledKeypad\n showKeypad={showKeypad}\n latex={prepareForStatic(expression) || ''}\n onChange={this.onChange('expression')}\n onFocus={this.onFocus}\n onDone={this.onDone}\n maxResponseAreas={maxResponseAreas}\n error={responseAreasError}\n />\n </div>\n\n {responseAreasError && <div className={classes.errorText}>{responseAreasError}</div>}\n </div>\n )}\n\n <div className={classes.flexContainer} style={{ justifyContent: 'flex-start' }}>\n <div className={classes.title}>Define Correct Response</div>\n {responseType === ResponseTypes.simple ? validationTooltip : null}\n </div>\n\n <InputContainer label=\"Equation Editor\" className={classes.selectContainer}>\n <Select className={classes.select} onChange={this.onChange('equationEditor')} value={equationEditor}>\n <MenuItem value=\"non-negative-integers\">Numeric - Non-Negative Integers</MenuItem>\n <MenuItem value=\"integers\">Numeric - Integers</MenuItem>\n <MenuItem value=\"decimals\">Numeric - Decimals</MenuItem>\n <MenuItem value=\"fractions\">Numeric - Fractions</MenuItem>\n <MenuItem value={1}>Grade 1 - 2</MenuItem>\n <MenuItem value={3}>Grade 3 - 5</MenuItem>\n <MenuItem value={6}>Grade 6 - 7</MenuItem>\n <MenuItem value={8}>Grade 8 - HS</MenuItem>\n <MenuItem value={'geometry'}>Geometry</MenuItem>\n <MenuItem value={'advanced-algebra'}>Advanced Algebra</MenuItem>\n <MenuItem value={'statistics'}>Statistics</MenuItem>\n <MenuItem value={'item-authoring'}>Item Authoring</MenuItem>\n </Select>\n </InputContainer>\n\n {responsesToUse.map((response, idx) => (\n <Response\n key={response.id}\n mode={equationEditor}\n response={response}\n defaultResponse={responseType === ResponseTypes.simple}\n onResponseChange={this.onResponseChange}\n index={idx}\n cIgnoreOrder={cIgnoreOrder}\n cAllowTrailingZeros={cAllowTrailingZeros}\n error={responsesErrors && responsesErrors[idx]}\n />\n ))}\n\n {rationaleEnabled && (\n <InputContainer label={cRationale.label} className={classes.promptHolder}>\n <EditableHtml\n className={classes.prompt}\n markup={rationale || ''}\n onChange={this.onChange('rationale')}\n imageSupport={imageSupport}\n nonEmpty={false}\n error={rationaleError}\n toolbarOpts={toolbarOpts}\n pluginProps={getPluginProps(cRationale?.inputConfiguration, {\n ...baseInputConfiguration,\n math: {\n controlledKeypadMode: false,\n },\n })}\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 && <div className={classes.errorText}>{rationaleError}</div>}\n </InputContainer>\n )}\n </div>\n );\n }\n}\n\nexport default withStyles(styles)(GeneralConfigBlock);\n"],"file":"general-config-block.js"}
|
|
1
|
+
{"version":3,"sources":["../src/general-config-block.jsx"],"names":["registered","styles","theme","container","display","flexDirection","templateTitle","fontSize","title","addResponseButton","border","palette","grey","width","flexContainer","alignItems","justifyContent","selectContainer","flex","marginTop","spacing","unit","marginBottom","responseTemplate","responseEditor","maxWidth","height","minHeight","textAlign","padding","promptHolder","paddingTop","blockContainer","margin","blockContainerGeneric","blockResponse","color","background","borderRight","blockResponseGeneric","blockMath","tooltip","typography","whiteSpace","errorText","error","main","advancedResponse","REGEX","TEMPORARY_RESPONSE_FIELD","ANSWER_BLOCK_REGEX","NEWLINE_BLOCK","NEWLINE_LATEX","prepareForStatic","expression","answerBlocks","replace","prepareForModel","GeneralConfigBlock","props","name","evtOrValue","model","onChange","newModel","target","value","setState","showKeypad","responseAreas","state","root","Object","keys","length","forEach","responseId","idx","el","querySelector","indexEl","MQ","MathQuill","getInterface","StaticMath","textContent","responseIdCounter","newCounter","responses","find","response","id","validation","answer","alternates","concat","index","classes","window","registerEmbed","data","genericAnswerBlock","htmlString","text","latex","handleAnswerBlockDomUpdate","imageSupport","uploadSoundSupport","configuration","promptEnabled","rationaleEnabled","toolbarOpts","prompt","equationEditor","promptEquationEditor","responseType","rationale","spellCheckEnabled","errors","baseInputConfiguration","cRationale","cPrompt","ignoreOrder","cIgnoreOrder","allowTrailingZeros","cAllowTrailingZeros","maxResponseAreas","maxImageWidth","maxImageHeight","mathMlOptions","validationMessage","promptError","rationaleError","responsesErrors","responseAreasError","defaultImageMaxWidth","defaultImageMaxHeight","classNames","editor","mathToolbar","responsesToUse","ResponseTypes","advanced","slice","validationTooltip","marginLeft","r","label","onPromptFocus","inputConfiguration","language","select","onFocus","onDone","simple","map","onResponseChange","math","controlledKeypadMode","React","Component","PropTypes","object","isRequired","func","bool"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;A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AV,CAAiBC,UADT;AAEjBrG,EAAAA,KAAK,EAAEmG,sBAAUC,MAAV,CAAiBC,UAFP;AAGjBzD,EAAAA,YAAY,EAAEuD,sBAAUC,MAHP;AAIjBvD,EAAAA,kBAAkB,EAAEsD,sBAAUC,MAJb;AAKjBtD,EAAAA,aAAa,EAAEqD,sBAAUC,MALR;AAMjBnG,EAAAA,QAAQ,EAAEkG,sBAAUG,IAAV,CAAeD,UANR;AAOjBtD,EAAAA,aAAa,EAAEoD,sBAAUI,IAPR;AAQjBvD,EAAAA,gBAAgB,EAAEmD,sBAAUI,IARX;AASjBtD,EAAAA,WAAW,EAAEkD,sBAAUC;AATN,C;;eAiYN,wBAAWjK,MAAX,EAAmByD,kBAAnB,C","sourcesContent":["import * as React from 'react';\nimport PropTypes from 'prop-types';\nimport cx from 'classnames';\nimport EditableHtml from '@pie-lib/editable-html';\nimport { InputContainer } from '@pie-lib/config-ui';\nimport { withStyles } from '@material-ui/core/styles';\nimport InputLabel from '@material-ui/core/InputLabel';\nimport Select from '@material-ui/core/Select';\nimport MenuItem from '@material-ui/core/MenuItem';\nimport Response from './response';\nimport { MathToolbar } from '@pie-lib/math-toolbar';\nimport isEqual from 'lodash/isEqual';\nimport { ResponseTypes, generateValidationMessage, getPluginProps } from './utils';\nimport MathQuill from '@pie-framework/mathquill';\nimport Info from '@material-ui/icons/Info';\nimport Tooltip from '@material-ui/core/Tooltip';\n\nlet registered = false;\n\nconst styles = (theme) => ({\n container: {\n display: 'flex',\n flexDirection: 'column',\n },\n templateTitle: {\n fontSize: '0.85rem',\n },\n title: {\n fontSize: '1.1rem',\n },\n addResponseButton: {\n border: `1px solid ${theme.palette.grey['A100']}`,\n float: 'right',\n width: '150px',\n },\n flexContainer: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n },\n selectContainer: {\n flex: 'initial',\n width: '40%',\n marginTop: theme.spacing.unit * 2,\n marginBottom: theme.spacing.unit * 2,\n },\n responseTemplate: {\n display: 'flex',\n flexDirection: 'column',\n },\n responseEditor: {\n display: 'flex',\n justifyContent: 'center',\n width: '100%',\n // minWidth: '500px',\n maxWidth: 'inherit',\n height: 'auto',\n minHeight: '130px',\n textAlign: 'left',\n padding: theme.spacing.unit,\n },\n promptHolder: {\n width: '100%',\n paddingTop: theme.spacing.unit * 2,\n marginBottom: theme.spacing.unit * 2,\n },\n blockContainer: {\n margin: theme.spacing.unit,\n display: 'inline-flex',\n border: '2px solid grey',\n },\n blockContainerGeneric: {\n margin: theme.spacing.unit / 2,\n },\n blockResponse: {\n flex: 2,\n color: 'grey',\n background: theme.palette.grey['A100'],\n fontSize: '0.8rem',\n padding: theme.spacing.unit / 2,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n borderRight: '2px solid grey',\n },\n blockResponseGeneric: {\n borderRight: 0,\n },\n blockMath: {\n color: theme.palette.grey[400],\n padding: theme.spacing.unit / 2,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n flex: 8,\n '& > .mq-math-mode': {\n '& > .mq-hasCursor': {\n '& > .mq-cursor': {\n display: 'none',\n },\n },\n },\n },\n tooltip: {\n fontSize: theme.typography.fontSize - 2,\n whiteSpace: 'pre-wrap',\n },\n errorText: {\n fontSize: theme.typography.fontSize - 2,\n color: theme.palette.error.main,\n paddingTop: theme.spacing.unit,\n },\n advancedResponse: {\n marginBottom: theme.spacing.unit * 2.5,\n },\n});\n\nconst REGEX = /{{response}}/gm;\nconst TEMPORARY_RESPONSE_FIELD = /\\\\%response\\\\%/gm;\nconst ANSWER_BLOCK_REGEX = /\\\\embed\\{answerBlock\\}\\[r\\d*\\]/g;\nconst NEWLINE_BLOCK = /\\\\embed\\{newLine\\}\\[\\]/g;\nconst NEWLINE_LATEX = /\\\\newline/g;\n\nfunction prepareForStatic(expression) {\n if (expression) {\n let answerBlocks = 1; // assume one at least\n\n return expression\n .replace(REGEX, () => `\\\\embed{answerBlock}[r${answerBlocks++}]`)\n .replace(NEWLINE_LATEX, '\\\\embed{newLine}[]');\n }\n}\n\nfunction prepareForModel(expression) {\n if (expression) {\n return expression\n .replace(ANSWER_BLOCK_REGEX, () => '{{response}}')\n .replace(TEMPORARY_RESPONSE_FIELD, () => '{{response}}')\n .replace(NEWLINE_BLOCK, () => '\\\\newline');\n }\n}\n\nclass GeneralConfigBlock extends React.Component {\n static propTypes = {\n classes: PropTypes.object.isRequired,\n model: PropTypes.object.isRequired,\n imageSupport: PropTypes.object,\n uploadSoundSupport: PropTypes.object,\n configuration: PropTypes.object,\n onChange: PropTypes.func.isRequired,\n promptEnabled: PropTypes.bool,\n rationaleEnabled: PropTypes.bool,\n toolbarOpts: PropTypes.object,\n };\n\n constructor(props) {\n super(props);\n\n const responseAreas = {};\n\n if (props.model && props.model.expression) {\n let answerBlocks = 1; // assume one at least\n // build out local state model using responses declared in expression\n\n props.model.expression.replace(REGEX, () => {\n responseAreas[`r${answerBlocks++}`] = {\n value: '',\n };\n });\n }\n\n this.state = {\n showKeypad: false,\n responseAreas,\n responseIdCounter: Object.keys(responseAreas).length,\n };\n }\n\n onChange = (name) => (evtOrValue) => {\n const { model, onChange } = this.props;\n const newModel = { ...model };\n\n if (typeof evtOrValue === 'object') {\n newModel[name] = evtOrValue.target.value;\n } else {\n newModel[name] = evtOrValue;\n }\n\n if (name === 'expression') {\n newModel[name] = prepareForModel(evtOrValue);\n }\n\n onChange(newModel);\n };\n\n onDone = () => {\n this.setState({ showKeypad: false });\n };\n\n onFocus = () => {\n this.setState({ showKeypad: true });\n };\n\n onPromptFocus = () => {\n this.setState({ showKeypad: false });\n };\n\n UNSAFE_componentWillMount() {\n const { classes } = this.props;\n\n if (typeof window !== 'undefined') {\n // const MathQuill = require('@pie-framework/mathquill');\n let MQ = MathQuill.getInterface(2);\n\n if (!registered) {\n MQ.registerEmbed('answerBlock', (data) => {\n // not used until we implement individual answer tracking\n // const individualAnswerBlock = `<div class=\"${classes.blockContainer}\">\n // <div class=\"${classes.blockResponse}\" id=\"${data}Index\">R</div>\n // <div class=\"${classes.blockMath}\">\n // <span id=\"${data}\"></span>\n // </div>\n // </div>`;\n\n const genericAnswerBlock = `<div class=\"${cx(classes.blockContainer, classes.blockContainerGeneric)}\">\n <div class=\"${cx(classes.blockResponse, classes.blockResponseGeneric)}\" id=\"${data}Index\">Response</div>\n </div>`;\n\n return {\n htmlString: genericAnswerBlock,\n text: () => 'text',\n latex: () => `\\\\embed{answerBlock}[${data}]`,\n };\n });\n\n registered = true;\n }\n }\n }\n\n componentDidMount() {\n this.handleAnswerBlockDomUpdate();\n }\n\n componentDidUpdate() {\n this.handleAnswerBlockDomUpdate();\n }\n\n handleAnswerBlockDomUpdate = () => {\n const { model } = this.props;\n\n const responseAreas = {};\n\n if (model && model.expression) {\n let answerBlocks = 1; // assume one at least\n // build out local state model using responses declared in expression\n\n model.expression.replace(REGEX, () => {\n responseAreas[`r${answerBlocks++}`] = {\n value: '',\n };\n });\n }\n\n if (!isEqual(responseAreas, this.state.responseAreas)) {\n this.setState(\n {\n responseAreas,\n },\n () => {\n if (this.root && Object.keys(responseAreas).length) {\n Object.keys(responseAreas).forEach((responseId, idx) => {\n const el = this.root.querySelector(`#${responseId}`);\n const indexEl = this.root.querySelector(`#${responseId}Index`);\n\n if (el) {\n // const MathQuill = require('@pie-framework/mathquill');\n let MQ = MathQuill.getInterface(2);\n // We no longer have individual answers, so we cannot set text content of blocks\n // el.textContent = response.answer;\n MQ.StaticMath(el);\n indexEl.textContent = `R${idx + 1}`;\n }\n });\n }\n },\n );\n }\n };\n\n onAddResponse = () => {\n const { model, onChange } = this.props;\n const { responseIdCounter } = this.state;\n const newModel = { ...model };\n\n let newCounter = responseIdCounter;\n\n while (model.responses.find((response) => response.id === newCounter)) {\n newCounter++;\n }\n\n const response = {\n id: newCounter,\n validation: 'literal',\n answer: '',\n alternates: {},\n };\n\n newModel.responses = newModel.responses.concat(response);\n onChange(newModel);\n\n this.setState({\n responseIdCounter: response.id,\n });\n };\n\n onResponseChange = (response, index) => {\n const { model, onChange } = this.props;\n const newModel = { ...model };\n\n newModel.responses[index] = response;\n onChange(newModel);\n };\n\n render() {\n const {\n classes,\n model,\n imageSupport,\n uploadSoundSupport,\n configuration,\n promptEnabled,\n rationaleEnabled,\n toolbarOpts,\n } = this.props;\n const { showKeypad } = this.state;\n const {\n prompt,\n expression,\n equationEditor,\n promptEquationEditor = '8',\n responses,\n responseType,\n rationale,\n spellCheckEnabled,\n errors = {},\n } = model;\n const {\n baseInputConfiguration = {},\n rationale: cRationale = {},\n prompt: cPrompt = {},\n ignoreOrder: cIgnoreOrder = {},\n allowTrailingZeros: cAllowTrailingZeros = {},\n maxResponseAreas,\n maxImageWidth = {},\n maxImageHeight = {},\n mathMlOptions = {},\n } = configuration || {};\n const validationMessage = generateValidationMessage(configuration, model);\n const { prompt: promptError, rationale: rationaleError, responsesErrors, responseAreasError } = errors;\n\n const defaultImageMaxWidth = maxImageWidth && maxImageWidth.prompt;\n const defaultImageMaxHeight = maxImageHeight && maxImageHeight.prompt;\n\n const classNames = {\n editor: classes.responseEditor,\n mathToolbar: classes.mathToolbar,\n };\n\n const responsesToUse = responseType === ResponseTypes.advanced ? responses : responses.slice(0, 1);\n\n const validationTooltip = (\n <Tooltip\n classes={{ tooltip: classes.tooltip }}\n disableFocusListener\n disableTouchListener\n placement={'right'}\n title={validationMessage}\n >\n <Info fontSize={'small'} color={'primary'} style={{ marginLeft: '5px' }} />\n </Tooltip>\n );\n\n return (\n <div ref={(r) => (this.root = r || this.root)} className={classes.container}>\n {promptEnabled && (\n <InputContainer label={cPrompt.label} className={classes.promptHolder}>\n <EditableHtml\n onFocus={this.onPromptFocus}\n className={classes.prompt}\n markup={prompt || ''}\n onChange={this.onChange('prompt')}\n imageSupport={imageSupport}\n nonEmpty={false}\n error={promptError}\n toolbarOpts={toolbarOpts}\n pluginProps={getPluginProps(cPrompt?.inputConfiguration, baseInputConfiguration)}\n spellCheck={spellCheckEnabled}\n maxImageWidth={defaultImageMaxWidth}\n maxImageHeight={defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n mathMlOptions={mathMlOptions}\n />\n {promptError && <div className={classes.errorText}>{promptError}</div>}\n </InputContainer>\n )}\n\n {responseType === ResponseTypes.advanced && (\n <div className={classes.advancedResponse}>\n <div className={classes.flexContainer} style={{ justifyContent: 'flex-start' }}>\n <div className={classes.title}>Define Response</div>\n {validationTooltip}\n </div>\n\n <InputContainer\n key=\"templateEditorType\"\n label=\"Response Template Equation Editor\"\n className={classes.selectContainer}\n >\n <Select\n className={classes.select}\n onChange={this.onChange('promptEquationEditor')}\n value={promptEquationEditor}\n >\n <MenuItem value=\"non-negative-integers\">Numeric - Non-Negative Integers</MenuItem>\n <MenuItem value=\"integers\">Numeric - Integers</MenuItem>\n <MenuItem value=\"decimals\">Numeric - Decimals</MenuItem>\n <MenuItem value=\"fractions\">Numeric - Fractions</MenuItem>\n <MenuItem value={1}>Grade 1 - 2</MenuItem>\n <MenuItem value={3}>Grade 3 - 5</MenuItem>\n <MenuItem value={6}>Grade 6 - 7</MenuItem>\n <MenuItem value={8}>Grade 8 - HS</MenuItem>\n <MenuItem value={'geometry'}>Geometry</MenuItem>\n <MenuItem value={'advanced-algebra'}>Advanced Algebra</MenuItem>\n <MenuItem value={'statistics'}>Statistics</MenuItem>\n <MenuItem value={'item-authoring'}>Item Authoring</MenuItem>\n </Select>\n </InputContainer>\n\n <div className={classes.responseTemplate} key=\"templateHolder\">\n <InputLabel className={classes.templateTitle}>RESPONSE TEMPLATE</InputLabel>\n <MathToolbar\n classNames={classNames}\n allowAnswerBlock\n keypadMode={promptEquationEditor}\n controlledKeypad\n showKeypad={showKeypad}\n latex={prepareForStatic(expression) || ''}\n onChange={this.onChange('expression')}\n onFocus={this.onFocus}\n onDone={this.onDone}\n maxResponseAreas={maxResponseAreas}\n error={responseAreasError}\n />\n </div>\n\n {responseAreasError && <div className={classes.errorText}>{responseAreasError}</div>}\n </div>\n )}\n\n <div className={classes.flexContainer} style={{ justifyContent: 'flex-start' }}>\n <div className={classes.title}>Define Correct Response</div>\n {responseType === ResponseTypes.simple ? validationTooltip : null}\n </div>\n\n <InputContainer label=\"Equation Editor\" className={classes.selectContainer}>\n <Select className={classes.select} onChange={this.onChange('equationEditor')} value={equationEditor}>\n <MenuItem value=\"non-negative-integers\">Numeric - Non-Negative Integers</MenuItem>\n <MenuItem value=\"integers\">Numeric - Integers</MenuItem>\n <MenuItem value=\"decimals\">Numeric - Decimals</MenuItem>\n <MenuItem value=\"fractions\">Numeric - Fractions</MenuItem>\n <MenuItem value={1}>Grade 1 - 2</MenuItem>\n <MenuItem value={3}>Grade 3 - 5</MenuItem>\n <MenuItem value={6}>Grade 6 - 7</MenuItem>\n <MenuItem value={8}>Grade 8 - HS</MenuItem>\n <MenuItem value={'geometry'}>Geometry</MenuItem>\n <MenuItem value={'advanced-algebra'}>Advanced Algebra</MenuItem>\n <MenuItem value={'statistics'}>Statistics</MenuItem>\n <MenuItem value={'item-authoring'}>Item Authoring</MenuItem>\n </Select>\n </InputContainer>\n\n {responsesToUse.map((response, idx) => (\n <Response\n key={response.id}\n mode={equationEditor}\n response={response}\n defaultResponse={responseType === ResponseTypes.simple}\n onResponseChange={this.onResponseChange}\n index={idx}\n cIgnoreOrder={cIgnoreOrder}\n cAllowTrailingZeros={cAllowTrailingZeros}\n error={responsesErrors && responsesErrors[idx]}\n />\n ))}\n\n {rationaleEnabled && (\n <InputContainer label={cRationale.label} className={classes.promptHolder}>\n <EditableHtml\n className={classes.prompt}\n markup={rationale || ''}\n onChange={this.onChange('rationale')}\n imageSupport={imageSupport}\n nonEmpty={false}\n error={rationaleError}\n toolbarOpts={toolbarOpts}\n pluginProps={getPluginProps(cRationale?.inputConfiguration, {\n ...baseInputConfiguration,\n math: {\n controlledKeypadMode: false,\n },\n })}\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 && <div className={classes.errorText}>{rationaleError}</div>}\n </InputContainer>\n )}\n </div>\n );\n }\n}\n\nexport default withStyles(styles)(GeneralConfigBlock);\n"],"file":"general-config-block.js"}
|
package/configure/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/math-inline-configure",
|
|
3
3
|
"private": true,
|
|
4
|
-
"version": "9.
|
|
4
|
+
"version": "9.2.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"module": "src/index.js",
|
|
@@ -11,12 +11,12 @@
|
|
|
11
11
|
"@material-ui/icons": "^3.0.1",
|
|
12
12
|
"@pie-framework/mathquill": "^1.1.3",
|
|
13
13
|
"@pie-framework/pie-configure-events": "^1.3.0",
|
|
14
|
-
"@pie-lib/config-ui": "^11.25.
|
|
15
|
-
"@pie-lib/editable-html": "^11.17.
|
|
16
|
-
"@pie-lib/math-rendering": "^3.
|
|
17
|
-
"@pie-lib/math-toolbar": "^1.27.
|
|
18
|
-
"@pie-lib/render-ui": "^4.31.
|
|
19
|
-
"@pie-lib/test-utils": "^0.
|
|
14
|
+
"@pie-lib/config-ui": "^11.25.1",
|
|
15
|
+
"@pie-lib/editable-html": "^11.17.1",
|
|
16
|
+
"@pie-lib/math-rendering": "^3.19.4",
|
|
17
|
+
"@pie-lib/math-toolbar": "^1.27.1",
|
|
18
|
+
"@pie-lib/render-ui": "^4.31.1",
|
|
19
|
+
"@pie-lib/test-utils": "^0.19.5",
|
|
20
20
|
"classnames": "^2.2.5",
|
|
21
21
|
"debug": "^3.1.0",
|
|
22
22
|
"prop-types": "^15.6.2",
|
package/controller/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
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
|
+
# [8.2.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/math-inline-controller@8.0.1...@pie-element/math-inline-controller@8.2.0) (2025-10-10)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* update libs PD-5208, PD-5211, PD-5199, PD-5218, PD-5217 ([da327fa](https://github.com/pie-framework/pie-elements/commit/da327fa501f6e9eff1c0b30b5ef092426a91f78b))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# [8.1.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/math-inline-controller@8.0.0...@pie-element/math-inline-controller@8.1.0) (2025-10-07)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @pie-element/math-inline-controller
|
package/controller/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/math-inline-controller",
|
|
3
3
|
"private": true,
|
|
4
|
-
"version": "8.
|
|
4
|
+
"version": "8.2.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"module": "src/index.js",
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@pie-framework/math-validation": "^1.4.2",
|
|
13
|
-
"@pie-lib/feedback": "^0.
|
|
14
|
-
"@pie-lib/translator": "^2.
|
|
13
|
+
"@pie-lib/feedback": "^0.21.4",
|
|
14
|
+
"@pie-lib/translator": "^2.20.4",
|
|
15
15
|
"debug": "^3.1.0",
|
|
16
16
|
"lodash": "^4.17.15"
|
|
17
17
|
},
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_dll_react as e,_dll_prop_types as t,_dll_material_ui__core as n,_dll_material_ui__core_styles as a,_dll_pie_lib__render_ui as o,_dll_classnames as s,_dll_lodash as i,_dll_material_ui__icons as l,_dll_debug as r,_dll_react_dom as c}from"../../../@pie-lib/shared-module@^1.14.5/module/index.js";import{_dll_pie_lib__config_ui as p}from"../../../@pie-lib/config-module@^2.19.5/module/index.js";import{_dll_pie_lib__editable_html as d}from"../../../@pie-lib/editable-html-module@^5.6.5/module/index.js";import{_dll_pie_lib__math_toolbar as u,_dll_pie_framework__mathquill as m}from"../../../@pie-lib/math-edit-module@^2.4.5/module/index.js";const h=e,g=t,{Card:b}=n,{CardContent:_}=n,{Button:C}=n,{FormControlLabel:y}=n,{Typography:f}=n,{InputLabel:E}=n,{Checkbox:v}=n,{Select:x}=n,{MenuItem:S}=n,{withStyles:w}=a,{color:T}=o,{InputContainer:I}=p,{MathToolbar:A}=u;class k extends h.Component{static __initStatic(){this.propTypes={classes:g.object.isRequired,defaultResponse:g.bool,error:g.object,mode:g.oneOfType([g.string,g.number]),index:g.number,onResponseChange:g.func.isRequired,response:g.object.isRequired,cIgnoreOrder:g.object.isRequired,cAllowTrailingZeros:g.object.isRequired}}static __initStatic2(){this.defaultProps={defaultResponse:!1,mode:"miscellaneous"}}constructor(e){super(e),k.prototype.__init.call(this),k.prototype.__init2.call(this),k.prototype.__init3.call(this),k.prototype.__init4.call(this),k.prototype.__init5.call(this),k.prototype.__init6.call(this),k.prototype.__init7.call(this),k.prototype.__init8.call(this),k.prototype.__init9.call(this),k.prototype.__init10.call(this),k.prototype.__init11.call(this);const{response:{alternates:t}={}}=e||{},n=Object.keys(t||{}).length;this.state={alternateIdCounter:n+1,showKeypad:{openCount:0,main:!1}}}__init(){this.onChange=e=>t=>{const{response:n,onResponseChange:a,index:o}=this.props,s={...n};s[e]=t.target.value,a(s,o)}}__init2(){this.onConfigChanged=e=>t=>{const{response:n,onResponseChange:a,index:o}=this.props,s={...n};s[e]=t.target.checked,a(s,o)}}__init3(){this.onLiteralOptionsChange=e=>()=>{const{response:t,onResponseChange:n,index:a}=this.props,o={...t};o[e]=!t[e],n(o,a)}}__init4(){this.onAnswerChange=e=>{const{response:t,onResponseChange:n,index:a}=this.props,o={...t};o.answer=e,n(o,a)}}__init5(){this.onAlternateAnswerChange=e=>t=>{const{response:n,onResponseChange:a,index:o}=this.props,s={...n};s.alternates[e]=t,a(s,o)}}__init6(){this.onAddAlternate=()=>{const{response:e,onResponseChange:t,index:n}=this.props,{alternateIdCounter:a}=this.state,o={...e};o.alternates||(o.alternates={}),o.alternates[a]="",t(o,n),this.setState({alternateIdCounter:a+1})}}__init7(){this.onRemoveAlternate=e=>()=>{const{response:t,onResponseChange:n,index:a}=this.props,o={...t};delete o.alternates[e],n(o,a),this.setState((t=>({showKeypad:{...t.showKeypad,openCount:t.showKeypad[e]?t.showKeypad.openCount-1:t.showKeypad.openCount}})))}}__init8(){this.onDone=()=>{this.setState((e=>({showKeypad:{...e.showKeypad,openCount:e.showKeypad.openCount-1,main:!1}})))}}__init9(){this.onFocus=()=>{this.setState((e=>({showKeypad:{...e.showKeypad,openCount:e.showKeypad.main?e.showKeypad.openCount:e.showKeypad.openCount+1,main:!0}})))}}__init10(){this.onAlternateFocus=e=>()=>{this.setState((t=>({showKeypad:{...t.showKeypad,openCount:t.showKeypad[e]?t.showKeypad.openCount:t.showKeypad.openCount+1,[e]:!0}})))}}__init11(){this.onAlternateDone=e=>()=>{this.setState((t=>({showKeypad:{...t.showKeypad,openCount:t.showKeypad.openCount-1,[e]:!1}})))}}render(){const{classes:e,mode:t,defaultResponse:n,index:a,response:o,cAllowTrailingZeros:s,cIgnoreOrder:i,error:l}=this.props,{showKeypad:r}=this.state,{validation:c,answer:p,alternates:d,ignoreOrder:u,allowTrailingZeros:m}=o,g=Object.keys(d||{}).length>0,w={editor:e.responseEditor,mathToolbar:e.mathToolbar},T={minHeight:(r.openCount>0?430:230)+"px"};return h.createElement(b,{className:e.responseContainer,style:T},h.createElement(_,{className:e.cardContent},h.createElement("div",{className:e.titleBar},h.createElement(f,{className:e.title,component:"div"},"Response ",""),h.createElement(I,{label:"Validation",className:e.selectContainer},h.createElement(x,{className:e.select,onChange:this.onChange("validation"),value:c||"literal"},h.createElement(S,{value:"literal"},"Literal Validation"),h.createElement(S,{value:"symbolic"},"Symbolic Validation")))),"literal"===c&&h.createElement("div",{className:e.flexContainer},s.enabled&&h.createElement(y,{label:s.label,control:h.createElement(v,{className:e.customColor,checked:m,onChange:this.onLiteralOptionsChange("allowTrailingZeros")})}),i.enabled&&h.createElement(y,{label:i.label,control:h.createElement(v,{className:e.customColor,checked:u,onChange:this.onLiteralOptionsChange("ignoreOrder")})})),h.createElement("div",{className:e.inputContainer},h.createElement(E,null,"Correct Answer"),h.createElement(A,{keypadMode:t,classNames:w,controlledKeypad:!0,showKeypad:r.main,latex:p||"",onChange:this.onAnswerChange,onFocus:this.onFocus,onDone:this.onDone,error:l&&l.answer}),l&&l.answer?h.createElement("div",{className:e.errorText},l.answer):null),g&&Object.keys(d).map(((n,a)=>h.createElement("div",{className:e.inputContainer,key:n},h.createElement("div",{className:e.alternateBar},h.createElement(E,null,"Alternate",Object.keys(d).length>1?` ${a+1}`:""),h.createElement(C,{className:e.removeAlternateButton,type:"secondary",onClick:this.onRemoveAlternate(n)},"Remove")),h.createElement(A,{classNames:w,controlledKeypad:!0,keypadMode:t,showKeypad:r[n]||!1,latex:d[n]||"",onChange:this.onAlternateAnswerChange(n),onFocus:this.onAlternateFocus(n),onDone:this.onAlternateDone(n),error:l&&l[n]}),l&&l[n]?h.createElement("div",{className:e.errorText},l[n]):null))),h.createElement(C,{className:e.alternateButton,type:"primary",onClick:this.onAddAlternate},"ADD ALTERNATE")))}}k.__initStatic(),k.__initStatic2();var N=w((e=>({responseContainer:{marginBottom:2.5*e.spacing.unit,width:"100%",minWidth:"548px",border:`1px solid ${e.palette.grey[700]}`,display:"flex",flexDirection:"column",justifyContent:"space-between"},cardContent:{paddingBottom:2*e.spacing.unit+"px !important"},title:{fontWeight:700,fontSize:"1.2rem",flex:3},selectContainer:{flex:2},inputContainer:{marginBottom:2*e.spacing.unit},titleBar:{display:"flex",alignItems:"center",justifyContent:"space-between"},responseEditor:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",minWidth:"500px",maxWidth:"900px",height:"auto",minHeight:"40px"},mathToolbar:{width:"100%"},alternateButton:{border:`1px solid ${e.palette.grey.A100}`},removeAlternateButton:{marginLeft:2*e.spacing.unit,border:`1px solid ${e.palette.grey.A100}`,color:"gray",fontSize:"0.8rem"},errorText:{fontSize:e.typography.fontSize-2,color:e.palette.error.main,paddingTop:e.spacing.unit},customColor:{color:`${T.tertiary()} !important`}})))(k);const R="Advanced Multi",D="Simple",O=(e={},t={})=>({...t,...e}),j=e,M=t,K=s,{withStyles:P}=a,{InputLabel:q}=n,{Select:B}=n,{MenuItem:F}=n,{Tooltip:L}=n,{isEqual:H}=i,{Info:$}=l,z=d,{InputContainer:G}=p,{MathToolbar:Z}=u,W=m;function Y(e){let t,n=e[0],a=1;for(;a<e.length;){const o=e[a],s=e[a+1];if(a+=2,("optionalAccess"===o||"optionalCall"===o)&&null==n)return;"access"===o||"optionalAccess"===o?(t=n,n=s(n)):"call"!==o&&"optionalCall"!==o||(n=s(((...e)=>n.call(t,...e))),t=void 0)}return n}let U=!1;const V=/{{response}}/gm,J=/\\%response\\%/gm,Q=/\\embed\{answerBlock\}\[r\d*\]/g,X=/\\embed\{newLine\}\[\]/g,ee=/\\newline/g;function te(e){if(e){let t=1;return e.replace(V,(()=>`\\embed{answerBlock}[r${t++}]`)).replace(ee,"\\embed{newLine}[]")}}class ne extends j.Component{static __initStatic(){this.propTypes={classes:M.object.isRequired,model:M.object.isRequired,imageSupport:M.object,uploadSoundSupport:M.object,configuration:M.object,onChange:M.func.isRequired,promptEnabled:M.bool,rationaleEnabled:M.bool,toolbarOpts:M.object}}constructor(e){super(e),ne.prototype.__init.call(this),ne.prototype.__init2.call(this),ne.prototype.__init3.call(this),ne.prototype.__init4.call(this),ne.prototype.__init5.call(this),ne.prototype.__init6.call(this),ne.prototype.__init7.call(this);const t={};if(e.model&&e.model.expression){let n=1;e.model.expression.replace(V,(()=>{t["r"+n++]={value:""}}))}this.state={showKeypad:!1,responseAreas:t,responseIdCounter:Object.keys(t).length}}__init(){this.onChange=e=>t=>{const{model:n,onChange:a}=this.props,o={...n};o[e]="object"==typeof t?t.target.value:t,"expression"===e&&(o[e]=function(e){if(e)return e.replace(Q,(()=>"{{response}}")).replace(J,(()=>"{{response}}")).replace(X,(()=>"\\newline"))}(t)),a(o)}}__init2(){this.onDone=()=>{this.setState({showKeypad:!1})}}__init3(){this.onFocus=()=>{this.setState({showKeypad:!0})}}__init4(){this.onPromptFocus=()=>{this.setState({showKeypad:!1})}}UNSAFE_componentWillMount(){const{classes:e}=this.props;if("undefined"!=typeof window){let t=W.getInterface(2);U||(t.registerEmbed("answerBlock",(t=>({htmlString:`<div class="${K(e.blockContainer,e.blockContainerGeneric)}">\n <div class="${K(e.blockResponse,e.blockResponseGeneric)}" id="${t}Index">Response</div>\n </div>`,text:()=>"text",latex:()=>`\\embed{answerBlock}[${t}]`}))),U=!0)}}componentDidMount(){this.handleAnswerBlockDomUpdate()}componentDidUpdate(){this.handleAnswerBlockDomUpdate()}__init5(){this.handleAnswerBlockDomUpdate=()=>{const{model:e}=this.props,t={};if(e&&e.expression){let n=1;e.expression.replace(V,(()=>{t["r"+n++]={value:""}}))}H(t,this.state.responseAreas)||this.setState({responseAreas:t},(()=>{this.root&&Object.keys(t).length&&Object.keys(t).forEach(((e,t)=>{const n=this.root.querySelector(`#${e}`),a=this.root.querySelector(`#${e}Index`);n&&(W.getInterface(2).StaticMath(n),a.textContent=`R${t+1}`)}))}))}}__init6(){this.onAddResponse=()=>{const{model:e,onChange:t}=this.props,{responseIdCounter:n}=this.state,a={...e};let o=n;for(;e.responses.find((e=>e.id===o));)o++;const s={id:o,validation:"literal",answer:"",alternates:{}};a.responses=a.responses.concat(s),t(a),this.setState({responseIdCounter:s.id})}}__init7(){this.onResponseChange=(e,t)=>{const{model:n,onChange:a}=this.props,o={...n};o.responses[t]=e,a(o)}}render(){const{classes:e,model:t,imageSupport:n,uploadSoundSupport:a,configuration:o,promptEnabled:s,rationaleEnabled:i,toolbarOpts:l}=this.props,{showKeypad:r}=this.state,{prompt:c,expression:p,equationEditor:d,promptEquationEditor:u="8",responses:m,responseType:h,rationale:g,spellCheckEnabled:b,errors:_={}}=t,{baseInputConfiguration:C={},rationale:y={},prompt:f={},ignoreOrder:E={},allowTrailingZeros:v={},maxResponseAreas:x,maxImageWidth:S={},maxImageHeight:w={},mathMlOptions:T={}}=o||{},I=((e={},t={})=>{const{maxResponseAreas:n}=t,{responseType:a}=e;let o="";return"Advanced Multi"===a&&(o="\nThere should be at least 1 "+(n?`and at most ${n} `:"")+"response area"+(n?"s":"")+" defined."),"Validation requirements:\nAll correct answers (the primary and any alternates) should not be empty and should be unique."+o})(o,t),{prompt:A,rationale:k,responsesErrors:M,responseAreasError:K}=_,P=S&&S.prompt,H=w&&w.prompt,W={editor:e.responseEditor,mathToolbar:e.mathToolbar},U=h===R?m:m.slice(0,1),V=j.createElement(L,{classes:{tooltip:e.tooltip},disableFocusListener:!0,disableTouchListener:!0,placement:"right",title:I},j.createElement($,{fontSize:"small",color:"primary",style:{marginLeft:"5px"}}));return j.createElement("div",{ref:e=>this.root=e||this.root,className:e.container},s&&j.createElement(G,{label:f.label,className:e.promptHolder},j.createElement(z,{onFocus:this.onPromptFocus,className:e.prompt,markup:c||"",onChange:this.onChange("prompt"),imageSupport:n,nonEmpty:!1,error:A,toolbarOpts:l,pluginProps:O(Y([f,"optionalAccess",e=>e.inputConfiguration]),C),spellCheck:b,maxImageWidth:P,maxImageHeight:H,uploadSoundSupport:a,languageCharactersProps:[{language:"spanish"},{language:"special"}],mathMlOptions:T}),A&&j.createElement("div",{className:e.errorText},A)),h===R&&j.createElement("div",{className:e.advancedResponse},j.createElement("div",{className:e.flexContainer,style:{justifyContent:"flex-start"}},j.createElement("div",{className:e.title},"Define Response"),V),j.createElement(G,{key:"templateEditorType",label:"Response Template Equation Editor",className:e.selectContainer},j.createElement(B,{className:e.select,onChange:this.onChange("promptEquationEditor"),value:u},j.createElement(F,{value:"non-negative-integers"},"Numeric - Non-Negative Integers"),j.createElement(F,{value:"integers"},"Numeric - Integers"),j.createElement(F,{value:"decimals"},"Numeric - Decimals"),j.createElement(F,{value:"fractions"},"Numeric - Fractions"),j.createElement(F,{value:1},"Grade 1 - 2"),j.createElement(F,{value:3},"Grade 3 - 5"),j.createElement(F,{value:6},"Grade 6 - 7"),j.createElement(F,{value:8},"Grade 8 - HS"),j.createElement(F,{value:"geometry"},"Geometry"),j.createElement(F,{value:"advanced-algebra"},"Advanced Algebra"),j.createElement(F,{value:"statistics"},"Statistics"),j.createElement(F,{value:"item-authoring"},"Item Authoring"))),j.createElement("div",{className:e.responseTemplate,key:"templateHolder"},j.createElement(q,{className:e.templateTitle},"RESPONSE TEMPLATE"),j.createElement(Z,{classNames:W,allowAnswerBlock:!0,keypadMode:u,controlledKeypad:!0,showKeypad:r,latex:te(p)||"",onChange:this.onChange("expression"),onFocus:this.onFocus,onDone:this.onDone,maxResponseAreas:x,error:K})),K&&j.createElement("div",{className:e.errorText},K)),j.createElement("div",{className:e.flexContainer,style:{justifyContent:"flex-start"}},j.createElement("div",{className:e.title},"Define Correct Response"),h===D?V:null),j.createElement(G,{label:"Equation Editor",className:e.selectContainer},j.createElement(B,{className:e.select,onChange:this.onChange("equationEditor"),value:d},j.createElement(F,{value:"non-negative-integers"},"Numeric - Non-Negative Integers"),j.createElement(F,{value:"integers"},"Numeric - Integers"),j.createElement(F,{value:"decimals"},"Numeric - Decimals"),j.createElement(F,{value:"fractions"},"Numeric - Fractions"),j.createElement(F,{value:1},"Grade 1 - 2"),j.createElement(F,{value:3},"Grade 3 - 5"),j.createElement(F,{value:6},"Grade 6 - 7"),j.createElement(F,{value:8},"Grade 8 - HS"),j.createElement(F,{value:"geometry"},"Geometry"),j.createElement(F,{value:"advanced-algebra"},"Advanced Algebra"),j.createElement(F,{value:"statistics"},"Statistics"),j.createElement(F,{value:"item-authoring"},"Item Authoring"))),U.map(((e,t)=>j.createElement(N,{key:e.id,mode:d,response:e,defaultResponse:h===D,onResponseChange:this.onResponseChange,index:t,cIgnoreOrder:E,cAllowTrailingZeros:v,error:M&&M[t]}))),i&&j.createElement(G,{label:y.label,className:e.promptHolder},j.createElement(z,{className:e.prompt,markup:g||"",onChange:this.onChange("rationale"),imageSupport:n,nonEmpty:!1,error:k,toolbarOpts:l,pluginProps:O(Y([y,"optionalAccess",e=>e.inputConfiguration]),{...C,math:{controlledKeypadMode:!1}}),spellCheck:b,maxImageWidth:S&&S.rationale||P,maxImageHeight:w&&w.rationale||H,uploadSoundSupport:a,languageCharactersProps:[{language:"spanish"},{language:"special"}],mathMlOptions:T}),k&&j.createElement("div",{className:e.errorText},k)))}}ne.__initStatic();var ae=P((e=>({container:{display:"flex",flexDirection:"column"},templateTitle:{fontSize:"0.85rem"},title:{fontSize:"1.1rem"},addResponseButton:{border:`1px solid ${e.palette.grey.A100}`,float:"right",width:"150px"},flexContainer:{display:"flex",alignItems:"center",justifyContent:"space-between"},selectContainer:{flex:"initial",width:"40%",marginTop:2*e.spacing.unit,marginBottom:2*e.spacing.unit},responseTemplate:{display:"flex",flexDirection:"column"},responseEditor:{display:"flex",justifyContent:"center",width:"100%",maxWidth:"inherit",height:"auto",minHeight:"130px",textAlign:"left",padding:e.spacing.unit},promptHolder:{width:"100%",paddingTop:2*e.spacing.unit,marginBottom:2*e.spacing.unit},blockContainer:{margin:e.spacing.unit,display:"inline-flex",border:"2px solid grey"},blockContainerGeneric:{margin:e.spacing.unit/2},blockResponse:{flex:2,color:"grey",background:e.palette.grey.A100,fontSize:"0.8rem",padding:e.spacing.unit/2,display:"flex",alignItems:"center",justifyContent:"center",borderRight:"2px solid grey"},blockResponseGeneric:{borderRight:0},blockMath:{color:e.palette.grey[400],padding:e.spacing.unit/2,display:"flex",alignItems:"center",justifyContent:"center",flex:8,"& > .mq-math-mode":{"& > .mq-hasCursor":{"& > .mq-cursor":{display:"none"}}}},tooltip:{fontSize:e.typography.fontSize-2,whiteSpace:"pre-wrap"},errorText:{fontSize:e.typography.fontSize-2,color:e.palette.error.main,paddingTop:e.spacing.unit},advancedResponse:{marginBottom:2.5*e.spacing.unit}})))(ne);const oe=e,{withStyles:se}=a,ie=t,le=r,{FeedbackConfig:re}=p,{settings:ce}=p,{layout:pe}=p,{InputContainer:de}=p,ue=d;function me(e){let t,n=e[0],a=1;for(;a<e.length;){const o=e[a],s=e[a+1];if(a+=2,("optionalAccess"===o||"optionalCall"===o)&&null==n)return;"access"===o||"optionalAccess"===o?(t=n,n=s(n)):"call"!==o&&"optionalCall"!==o||(n=s(((...e)=>n.call(t,...e))),t=void 0)}return n}const he=le("@pie-element:math-inline:configure"),{Panel:ge,toggle:be,radio:_e,dropdown:Ce}=ce;class ye extends oe.Component{constructor(...e){super(...e),ye.prototype.__init.call(this),ye.prototype.__init2.call(this),ye.prototype.__init3.call(this)}static __initStatic(){this.propTypes={onModelChanged:ie.func,onConfigurationChanged:ie.func,classes:ie.object,model:ie.object.isRequired,configuration:ie.object.isRequired,imageSupport:ie.object,uploadSoundSupport:ie.object}}__init(){this.onChange=e=>{this.props.onModelChanged(e)}}__init2(){this.changeTeacherInstructions=e=>{this.props.onModelChanged({...this.props.model,teacherInstructions:e})}}__init3(){this.onFeedbackChange=e=>{const{model:t,onModelChanged:n}=this.props;t.feedback=e,n(t)}}render(){const{classes:e,model:t,imageSupport:n,onModelChanged:a,configuration:o,onConfigurationChanged:s,uploadSoundSupport:i}=this.props,{allowTrailingZeros:l={},baseInputConfiguration:r={},contentDimensions:c={},feedback:p={},ignoreOrder:d={},maxImageWidth:u={},maxImageHeight:m={},prompt:h={},rationale:g={},responseType:b={},scoringType:_={},settingsPanelDisabled:C,spellCheck:y={},studentInstructions:f={},teacherInstructions:E={},withRubric:v={},mathMlOptions:x={},language:S={},languageChoices:w={}}=o||{},{errors:T={},extraCSSRules:I,feedbackEnabled:A,promptEnabled:k,rationaleEnabled:N,spellCheckEnabled:j,teacherInstructionsEnabled:M,toolbarEditorPosition:K}=t||{},{teacherInstructions:P}=T;he("[render] model",t);const q={position:"top"===K?"top":"bottom"},B=u&&u.prompt,F=m&&m.prompt,L={responseType:b.settings&&_e(b.label,[D,R]),feedbackEnabled:p.settings&&be(p.label),promptEnabled:h.settings&&be(h.label),"language.enabled":S.settings&&be(S.label,!0),language:S.settings&&S.enabled&&Ce(w.label,w.options)},H={teacherInstructionsEnabled:E.settings&&be(E.label),studentInstructionsEnabled:f.settings&&be(f.label),rationaleEnabled:g.settings&&be(g.label),spellCheckEnabled:y.settings&&be(y.label),scoringType:_.settings&&_e(_.label,["auto","rubric"]),"ignoreOrder.enabled":d.settings&&be(d.label),"allowTrailingZeros.enabled":l.settings&&be(l.label),rubricEnabled:me([v,"optionalAccess",e=>e.settings])&&be(me([v,"optionalAccess",e=>e.label]))};return oe.createElement(pe.ConfigLayout,{extraCSSRules:I,dimensions:c,hideSettings:C,settings:oe.createElement(ge,{model:t,configuration:o,onChangeModel:e=>a(e),onChangeConfiguration:e=>s(e),groups:{Settings:L,Properties:H}})},M&&oe.createElement(de,{label:E.label,className:e.promptHolder},oe.createElement(ue,{className:e.prompt,markup:t.teacherInstructions||"",onChange:this.changeTeacherInstructions,imageSupport:n,nonEmpty:!1,error:P,toolbarOpts:q,pluginProps:O(me([E,"optionalAccess",e=>e.inputConfiguration]),r),spellCheck:j,maxImageWidth:u&&u.teacherInstructions||B,maxImageHeight:m&&m.teacherInstructions||F,uploadSoundSupport:i,languageCharactersProps:[{language:"spanish"},{language:"special"}],mathMlOptions:x}),P&&oe.createElement("div",{className:e.errorText},P)),oe.createElement(ae,{imageSupport:n,uploadSoundSupport:i,model:t,configuration:o,onChange:this.onChange,rationaleEnabled:N,promptEnabled:k,toolbarOpts:q,spellCheck:j}),A&&oe.createElement(re,{feedback:t.feedback,onChange:this.onFeedbackChange,toolbarOpts:q}))}}ye.__initStatic();var fe=se((e=>({promptHolder:{width:"100%",paddingTop:2*e.spacing.unit,marginBottom:2*e.spacing.unit},errorText:{fontSize:e.typography.fontSize-2,color:e.palette.error.main,paddingTop:e.spacing.unit}})))(ye),Ee={};Object.defineProperty(Ee,"__esModule",{value:!0});class ve extends CustomEvent{constructor(e,t=!1){super(ve.TYPE,{bubbles:!0,detail:{update:e,reset:t}}),this.update=e,this.reset=t}}ve.TYPE="model.updated";var xe=Ee.ModelUpdatedEvent=ve;class Se extends CustomEvent{constructor(e,t){super(Se.TYPE,{bubbles:!0,detail:{src:e,done:t}}),this.src=e,this.done=t}}Se.TYPE="delete.image";var we=Ee.DeleteImageEvent=Se;class Te extends CustomEvent{constructor(e){super(Te.TYPE,{bubbles:!0,detail:e}),this.handler=e}}Te.TYPE="insert.image";var Ie=Ee.InsertImageEvent=Te;class Ae extends CustomEvent{constructor(e,t){super(Ae.TYPE,{bubbles:!0,detail:{src:e,done:t}}),this.src=e,this.done=t}}Ae.TYPE="delete.sound";var ke=Ee.DeleteSoundEvent=Ae;class Ne extends CustomEvent{constructor(e){super(Ne.TYPE,{bubbles:!0,detail:e}),this.handler=e}}Ne.TYPE="insert.sound";var Re=Ee.InsertSoundEvent=Ne,De={allowTrailingZerosDefault:!1,customKeys:[],equationEditor:"8",expression:"",feedback:{correct:{default:"Correct",type:"none"},incorrect:{default:"Incorrect",type:"none"},partial:{default:"Nearly",type:"none"}},feedbackEnabled:!1,ignoreOrderDefault:!1,partialScoring:!0,prompt:"",promptEnabled:!0,rationale:"",rationaleEnabled:!0,responseType:R,responses:[],scoringType:"auto",studentInstructionsEnabled:!0,teacherInstructions:"",teacherInstructionsEnabled:!0,toolbarEditorPosition:"bottom",validationDefault:"literal"},Oe={baseInputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1},textAlign:{disabled:!0},showParagraphs:{disabled:!1},separateParagraphs:{disabled:!0}},prompt:{settings:!0,label:"Prompt",inputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1}},required:!1},feedback:{settings:!0,label:"Feedback"},responseType:{settings:!0,label:"Response type"},rationale:{settings:!0,label:"Rationale",inputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1}},required:!1},settingsPanelDisabled:!1,spellCheck:{label:"Spellcheck",settings:!1,enabled:!0},scoringType:{settings:!1,label:"Scoring Type"},studentInstructions:{settings:!1,label:"Student Instructions"},teacherInstructions:{settings:!0,label:"Teacher Instructions",inputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1}},required:!1},partialScoring:{settings:!1,label:"Allow Partial Scoring"},ignoreOrder:{settings:!1,label:"Ignore Order",enabled:!0},allowTrailingZeros:{settings:!1,label:"Allow Trailing Zeros",enabled:!0},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 je=e,Me=c,{isEmpty:Ke}=i;function Pe(e){let t,n=e[0],a=1;for(;a<e.length;){const o=e[a],s=e[a+1];if(a+=2,("optionalAccess"===o||"optionalCall"===o)&&null==n)return;"access"===o||"optionalAccess"===o?(t=n,n=s(n)):"call"!==o&&"optionalCall"!==o||(n=s(((...e)=>n.call(t,...e))),t=void 0)}return n}const qe=r("pie-elements:math-inline:configure");class Be extends HTMLElement{static __initStatic(){this.createDefaultModel=(e={})=>(Ke(e.responses)||(e.responses=e.responses.map((e=>({...e,validation:e.validation||De.validationDefault,allowTrailingZeros:e.allowTrailingZeros||De.allowTrailingZerosDefault,ignoreOrder:e.ignoreOrder||De.ignoreOrderDefault||!1})))),{...De,...e})}constructor(){super(),this._model=Be.createDefaultModel(),this._configuration=Oe}set model(e){this._model=Be.createDefaultModel(e),this._render()}set configuration(e){const t={...Oe,...e};this._configuration=t,Pe([t,"optionalAccess",e=>e.language,"optionalAccess",e=>e.enabled])?Pe([t,"optionalAccess",e=>e.languageChoices,"optionalAccess",e=>e.options,"optionalAccess",e=>e.length])&&(this._model.language=Pe([t,"optionalAccess",e=>e.languageChoices,"access",e=>e.options,"access",e=>e[0],"access",e=>e.value])):t.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()}onModelChanged(e){this._model=e,qe("[onModelChanged]: ",this._model),this._render(),this.dispatchEvent(new xe(this._model))}onConfigurationChanged(e){this._configuration=e,this._model&&this.onModelChanged(this._model),this._render()}insertImage(e){this.dispatchEvent(new Ie(e))}onDeleteImage(e,t){this.dispatchEvent(new we(e,t))}insertSound(e){this.dispatchEvent(new Re(e))}onDeleteSound(e,t){this.dispatchEvent(new ke(e,t))}_render(){if(this._model){const e=je.createElement(fe,{onModelChanged:this.onModelChanged.bind(this),onConfigurationChanged:this.onConfigurationChanged.bind(this),model:this._model,configuration:this._configuration,imageSupport:{add:this.insertImage.bind(this),delete:this.onDeleteImage.bind(this)},uploadSoundSupport:{add:this.insertSound.bind(this),delete:this.onDeleteSound.bind(this)}});Me.render(e,this)}}}Be.__initStatic();export{Be as default};
|