@pie-element/graphing 5.9.1-next.9 → 5.10.1-next.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 +21 -0
- package/configure/CHANGELOG.md +19 -0
- package/configure/lib/configure.js +3 -2
- package/configure/lib/configure.js.map +1 -1
- package/configure/lib/index.js +2 -2
- package/configure/lib/index.js.map +1 -1
- package/configure/package.json +2 -2
- package/controller/CHANGELOG.md +17 -0
- package/controller/package.json +2 -2
- package/docs/config-schema.json +66 -0
- package/docs/config-schema.json.md +48 -0
- package/docs/pie-schema.json +22 -0
- package/docs/pie-schema.json.md +16 -0
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,27 @@
|
|
|
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
|
+
# [5.10.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/graphing@5.9.0...@pie-element/graphing@5.10.0) (2024-03-20)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* Renamed the html prop to the correct math prop PD-3527 ([28061b6](https://github.com/pie-framework/pie-elements/commit/28061b6032817dae15837131d8a0bf5a08683b10))
|
|
12
|
+
* updated pie-lib/pie-toolbox SC-28500 ([a8e4e6a](https://github.com/pie-framework/pie-elements/commit/a8e4e6ab27584435ce7ac3e964ccac2747402777))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* Add configuration for custom buttons PD-3520 ([a7a7ace](https://github.com/pie-framework/pie-elements/commit/a7a7ace27eaac47c9a0f172f7ae0440c6dc4e600))
|
|
18
|
+
* Add configuration for custom buttons PD-3527 ([45a32bd](https://github.com/pie-framework/pie-elements/commit/45a32bd8e9d7bd33beca74cc10c7dd973a9f9dbc))
|
|
19
|
+
* Replace math-rendering package with math-rendering-accessible-package for accessibility PD-1870 ([b6cdee8](https://github.com/pie-framework/pie-elements/commit/b6cdee8915b06e4c11b002b10437db07ce966501))
|
|
20
|
+
* updated pie-lib/pie-toolbox SC-27890 and reverted once again math-rendering-accessible ([fd312e1](https://github.com/pie-framework/pie-elements/commit/fd312e1336999893025231946649496d290883e4))
|
|
21
|
+
* use math-rendering-accessible everywhere PD-1870 ([d52e660](https://github.com/pie-framework/pie-elements/commit/d52e6607ad8847d704bd9cb9b7e3107c130f0500))
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
6
27
|
# [5.9.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/graphing@5.8.1...@pie-element/graphing@5.9.0) (2024-03-15)
|
|
7
28
|
|
|
8
29
|
|
package/configure/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
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
|
+
# [5.9.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/graphing-configure@5.8.0...@pie-element/graphing-configure@5.9.0) (2024-03-20)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* updated pie-lib/pie-toolbox SC-28500 ([a8e4e6a](https://github.com/pie-framework/pie-elements/commit/a8e4e6ab27584435ce7ac3e964ccac2747402777))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* Add configuration for custom buttons PD-3520 ([a7a7ace](https://github.com/pie-framework/pie-elements/commit/a7a7ace27eaac47c9a0f172f7ae0440c6dc4e600))
|
|
17
|
+
* Replace math-rendering package with math-rendering-accessible-package for accessibility PD-1870 ([b6cdee8](https://github.com/pie-framework/pie-elements/commit/b6cdee8915b06e4c11b002b10437db07ce966501))
|
|
18
|
+
* updated pie-lib/pie-toolbox SC-27890 and reverted once again math-rendering-accessible ([fd312e1](https://github.com/pie-framework/pie-elements/commit/fd312e1336999893025231946649496d290883e4))
|
|
19
|
+
* use math-rendering-accessible everywhere PD-1870 ([d52e660](https://github.com/pie-framework/pie-elements/commit/d52e6607ad8847d704bd9cb9b7e3107c130f0500))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
# [5.8.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/graphing-configure@5.7.1...@pie-element/graphing-configure@5.8.0) (2024-03-15)
|
|
7
26
|
|
|
8
27
|
|
|
@@ -286,8 +286,9 @@ var Configure = /*#__PURE__*/function (_React$Component) {
|
|
|
286
286
|
instruction: instruction.settings && textField(instruction.label)
|
|
287
287
|
};
|
|
288
288
|
|
|
289
|
-
var getPluginProps = function getPluginProps(
|
|
290
|
-
|
|
289
|
+
var getPluginProps = function getPluginProps() {
|
|
290
|
+
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
291
|
+
return _objectSpread(_objectSpread({}, baseInputConfiguration), props);
|
|
291
292
|
};
|
|
292
293
|
|
|
293
294
|
return /*#__PURE__*/_react["default"].createElement(_configUi.layout.ConfigLayout, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/configure.jsx"],"names":["Panel","settings","toggle","radio","checkboxes","textField","dropdown","log","styles","theme","title","fontSize","display","marginTop","spacing","unit","marginBottom","promptHolder","width","paddingTop","description","errorText","typography","color","palette","error","main","Configure","rationale","props","onModelChanged","model","prompt","teacherInstructions","configuration","availableTools","graphDimensions","arrows","showTitle","titleEnabled","showDimensions","dimensionsEnabled","left","right","up","down","toolbarTools","undefined","enabled","classes","onConfigurationChanged","imageSupport","uploadSoundSupport","authoring","baseInputConfiguration","coordinatesOnHover","contentDimensions","gridConfigurations","instruction","labels","padding","scoringType","settingsPanelDisabled","spellCheck","studentInstructions","maxImageWidth","maxImageHeight","withRubric","language","languageChoices","mathMlOptions","errors","labelsEnabled","promptEnabled","rationaleEnabled","spellCheckEnabled","teacherInstructionsEnabled","promptError","rationaleError","teacherInstructionsError","defaultImageMaxWidth","defaultImageMaxHeight","labelsPlaceholders","top","bottom","panelItemType","label","options","panelProperties","studentInstructionsEnabled","rubricEnabled","getPluginProps","Object","assign","Settings","Properties","onTeacherInstructionsChange","inputConfiguration","onPromptChange","placeholder","onRationaleChange","React","Component","PropTypes","func","object","isRequired"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,IAAQA,KAAR,GAAkEC,kBAAlE,CAAQD,KAAR;AAAA,IAAeE,MAAf,GAAkED,kBAAlE,CAAeC,MAAf;AAAA,IAAuBC,KAAvB,GAAkEF,kBAAlE,CAAuBE,KAAvB;AAAA,IAA8BC,UAA9B,GAAkEH,kBAAlE,CAA8BG,UAA9B;AAAA,IAA0CC,SAA1C,GAAkEJ,kBAAlE,CAA0CI,SAA1C;AAAA,IAAqDC,QAArD,GAAkEL,kBAAlE,CAAqDK,QAArD;AACA,IAAMC,GAAG,GAAG,uBAAM,iCAAN,CAAZ;;AAEA,IAAMC,MAAM,GAAG,SAATA,MAAS,CAACC,KAAD;AAAA,SAAY;AACzBC,IAAAA,KAAK,EAAE;AACLC,MAAAA,QAAQ,EAAE,QADL;AAELC,MAAAA,OAAO,EAAE,OAFJ;AAGLC,MAAAA,SAAS,EAAEJ,KAAK,CAACK,OAAN,CAAcC,IAAd,GAAqB,CAH3B;AAILC,MAAAA,YAAY,EAAEP,KAAK,CAACK,OAAN,CAAcC;AAJvB,KADkB;AAOzBE,IAAAA,YAAY,EAAE;AACZC,MAAAA,KAAK,EAAE,MADK;AAEZC,MAAAA,UAAU,EAAEV,KAAK,CAACK,OAAN,CAAcC,IAAd,GAAqB,CAFrB;AAGZC,MAAAA,YAAY,EAAEP,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ACA,SAAD,uBAACA,SAAS,CAAEqE,kBAAZ,CAP7B;AAQE,QAAA,aAAa,EAAGhC,aAAa,IAAIA,aAAa,CAACrC,SAAhC,IAA8CoD,oBAR/D;AASE,QAAA,cAAc,EAAGd,cAAc,IAAIA,cAAc,CAACtC,SAAlC,IAAgDqD,qBATlE;AAUE,QAAA,kBAAkB,EAAE7B,kBAVtB;AAWE,QAAA,uBAAuB,EAAE,CAAC;AAAEgB,UAAAA,QAAQ,EAAE;AAAZ,SAAD,EAA0B;AAAEA,UAAAA,QAAQ,EAAE;AAAZ,SAA1B,CAX3B;AAYE,QAAA,aAAa,EAAEE;AAZjB,QADF,EAeGQ,cAAc,iBAAI;AAAK,QAAA,SAAS,EAAE7B,OAAO,CAAC5B;AAAxB,SAAoCyD,cAApC,CAfrB,CAvFJ,CADF;AA4GD;;;EAlQ4BuB,kBAAMC,S;;;iCAAxB3E,S,eACQ;AACjBG,EAAAA,cAAc,EAAEyE,sBAAUC,IADT;AAEjBtD,EAAAA,sBAAsB,EAAEqD,sBAAUC,IAFjB;AAGjBvD,EAAAA,OAAO,EAAEsD,sBAAUE,MAHF;AAIjBtD,EAAAA,YAAY,EAAEoD,sBAAUE,MAJP;AAKjBrD,EAAAA,kBAAkB,EAAEmD,sBAAUE,MALb;AAMjB1E,EAAAA,KAAK,EAAEwE,sBAAUE,MAAV,CAAiBC,UANP;AAOjBxE,EAAAA,aAAa,EAAEqE,sBAAUE,MAAV,CAAiBC;AAPf,C;iCADR/E,S,kBAWW;AAAEsB,EAAAA,OAAO,EAAE;AAAX,C;;eA0PT,wBAAWzC,MAAX,EAAmBmB,SAAnB,C","sourcesContent":["import React from 'react';\nimport { withStyles } from '@material-ui/core/styles';\n\nimport { settings, layout, InputContainer } from '@pie-lib/pie-toolbox/config-ui';\nimport PropTypes from 'prop-types';\nimport debug from 'debug';\nimport Typography from '@material-ui/core/Typography';\nimport { EditableHtml } from '@pie-lib/pie-toolbox/editable-html';\nimport GraphingConfig from './graphing-config';\nimport CorrectResponse from './correct-response';\nimport intersection from 'lodash/intersection';\n\nconst { Panel, toggle, radio, checkboxes, textField, dropdown } = settings;\nconst log = debug('@pie-element:graphing:configure');\n\nconst styles = (theme) => ({\n title: {\n fontSize: '1.1rem',\n display: 'block',\n marginTop: theme.spacing.unit * 2,\n marginBottom: theme.spacing.unit,\n },\n promptHolder: {\n width: '100%',\n paddingTop: theme.spacing.unit * 2,\n marginBottom: theme.spacing.unit * 2,\n },\n description: {\n marginBottom: theme.spacing.unit * 2.5,\n },\n errorText: {\n fontSize: theme.typography.fontSize - 2,\n color: theme.palette.error.main,\n paddingTop: theme.spacing.unit,\n },\n});\n\nexport class Configure extends React.Component {\n static propTypes = {\n onModelChanged: PropTypes.func,\n onConfigurationChanged: PropTypes.func,\n classes: PropTypes.object,\n imageSupport: PropTypes.object,\n uploadSoundSupport: PropTypes.object,\n model: PropTypes.object.isRequired,\n configuration: PropTypes.object.isRequired,\n };\n\n static defaultProps = { classes: {} };\n\n componentDidMount() {\n const { configuration, onModelChanged, model } = this.props;\n const { availableTools, title, graphDimensions } = configuration || {};\n let { arrows, titleEnabled: showTitle, dimensionsEnabled: showDimensions } = model || {};\n\n // This is used for offering support for old models which have the property arrows: boolean\n // Same thing is set in the controller: packages/graphing/controller/src/index.js - model\n if (typeof arrows === 'boolean') {\n if (arrows) {\n arrows = { left: true, right: true, up: true, down: true };\n } else {\n arrows = { left: false, right: false, up: false, down: false };\n }\n }\n\n const toolbarTools = intersection(availableTools || [], model.toolbarTools || []);\n const titleEnabled = showTitle === undefined || showTitle === null ? title.enabled : showTitle;\n const dimensionsEnabled =\n showDimensions === undefined || showDimensions === null ? graphDimensions.enabled : showDimensions;\n\n onModelChanged && onModelChanged({ ...model, arrows, toolbarTools, titleEnabled, dimensionsEnabled });\n }\n\n onRationaleChange = (rationale) => {\n const { onModelChanged, model } = this.props;\n\n onModelChanged({ ...model, rationale });\n };\n\n onPromptChange = (prompt) => {\n const { onModelChanged, model } = this.props;\n\n onModelChanged({ ...model, prompt });\n };\n\n onTeacherInstructionsChange = (teacherInstructions) => {\n const { onModelChanged, model } = this.props;\n\n onModelChanged({ ...model, teacherInstructions });\n };\n\n render() {\n const { classes, model, configuration, onConfigurationChanged, onModelChanged, imageSupport, uploadSoundSupport } =\n this.props;\n const {\n arrows = {},\n authoring = {},\n availableTools = [],\n baseInputConfiguration = {},\n coordinatesOnHover = {},\n contentDimensions = {},\n gridConfigurations = [],\n graphDimensions = {},\n instruction = {},\n labels = {},\n padding = {},\n prompt = {},\n rationale = {},\n scoringType = {},\n settingsPanelDisabled,\n spellCheck = {},\n studentInstructions = {},\n teacherInstructions = {},\n title = {},\n maxImageWidth = {},\n maxImageHeight = {},\n withRubric = {},\n language = {},\n languageChoices = {},\n mathMlOptions = {},\n } = configuration || {};\n const {\n errors = {},\n labelsEnabled,\n dimensionsEnabled,\n promptEnabled,\n rationaleEnabled,\n spellCheckEnabled,\n teacherInstructionsEnabled,\n titleEnabled,\n } = model || {};\n const {\n prompt: promptError,\n rationale: rationaleError,\n teacherInstructions: teacherInstructionsError,\n } = errors || {};\n\n log('[render] model', model);\n\n const defaultImageMaxWidth = maxImageWidth && maxImageWidth.prompt;\n const defaultImageMaxHeight = maxImageHeight && maxImageHeight.prompt;\n const labelsPlaceholders = {\n top: labels.top,\n right: labels.right,\n bottom: labels.bottom,\n left: labels.left,\n };\n\n const panelItemType = {\n arrows:\n arrows.settings &&\n checkboxes(arrows.label, {\n left: arrows.left,\n right: arrows.right,\n up: arrows.up,\n down: arrows.down,\n }),\n titleEnabled: title.settings && toggle(title.label),\n padding: padding.settings && toggle(padding.label),\n labelsEnabled: labels.settings && toggle(labels.label),\n 'language.enabled': language.settings && toggle(language.label, true),\n language: language.settings && language.enabled && dropdown(languageChoices.label, languageChoices.options),\n dimensionsEnabled: graphDimensions.settings && toggle(graphDimensions.label),\n coordinatesOnHover: coordinatesOnHover.settings && toggle(coordinatesOnHover.label),\n };\n\n const panelProperties = {\n 'authoring.enabled': authoring.settings && toggle(authoring.label, true),\n teacherInstructionsEnabled: teacherInstructions.settings && toggle(teacherInstructions.label),\n studentInstructionsEnabled: studentInstructions.settings && toggle(studentInstructions.label),\n promptEnabled: prompt.settings && toggle(prompt.label),\n rationaleEnabled: rationale.settings && toggle(rationale.label),\n spellCheckEnabled: spellCheck.settings && toggle(spellCheck.label),\n scoringType: scoringType.settings && radio(scoringType.label, ['dichotomous', 'partial scoring']),\n rubricEnabled: withRubric?.settings && toggle(withRubric?.label),\n instruction: instruction.settings && textField(instruction.label),\n };\n\n const getPluginProps = (props) => {\n return Object.assign(\n {\n ...baseInputConfiguration,\n },\n props || {},\n );\n };\n\n return (\n <layout.ConfigLayout\n dimensions={contentDimensions}\n hideSettings={settingsPanelDisabled}\n settings={\n <Panel\n model={model}\n configuration={configuration}\n onChangeModel={onModelChanged}\n onChangeConfiguration={onConfigurationChanged}\n groups={{\n Settings: panelItemType,\n Properties: panelProperties,\n }}\n />\n }\n >\n <Typography component=\"div\" type=\"body1\" className={classes.description}>\n {instruction?.label || ''}\n </Typography>\n\n {teacherInstructionsEnabled && (\n <InputContainer label={teacherInstructions.label} className={classes.promptHolder}>\n <EditableHtml\n className={classes.prompt}\n markup={model.teacherInstructions || ''}\n onChange={this.onTeacherInstructionsChange}\n imageSupport={imageSupport}\n error={teacherInstructionsError}\n nonEmpty={false}\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 && <div className={classes.errorText}>{teacherInstructionsError}</div>}\n </InputContainer>\n )}\n\n {promptEnabled && (\n <InputContainer label={prompt.label} className={classes.promptHolder}>\n <EditableHtml\n className={classes.prompt}\n markup={model.prompt}\n onChange={this.onPromptChange}\n imageSupport={imageSupport}\n error={promptError}\n nonEmpty={false}\n spellCheck={spellCheckEnabled}\n pluginProps={getPluginProps(prompt?.inputConfiguration)}\n disableUnderline\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 <GraphingConfig\n authoring={authoring}\n availableTools={availableTools}\n gridConfigurations={gridConfigurations}\n graphDimensions={graphDimensions}\n labelsPlaceholders={labelsPlaceholders}\n model={model}\n showLabels={labelsEnabled}\n dimensionsEnabled={dimensionsEnabled}\n showTitle={titleEnabled}\n titlePlaceholder={title.placeholder}\n onChange={this.props.onModelChanged}\n mathMlOptions={mathMlOptions}\n />\n\n <CorrectResponse\n availableTools={availableTools}\n errors={errors}\n model={model}\n onChange={this.props.onModelChanged}\n mathMlOptions={mathMlOptions}\n />\n\n {rationaleEnabled && (\n <InputContainer label={rationale.label || 'Rationale'} className={classes.promptHolder}>\n <EditableHtml\n className={classes.prompt}\n markup={model.rationale || ''}\n onChange={this.onRationaleChange}\n imageSupport={imageSupport}\n error={rationaleError}\n spellCheck={spellCheckEnabled}\n pluginProps={getPluginProps(rationale?.inputConfiguration)}\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 </layout.ConfigLayout>\n );\n }\n}\n\nexport default withStyles(styles)(Configure);\n"],"file":"configure.js"}
|
|
1
|
+
{"version":3,"sources":["../src/configure.jsx"],"names":["Panel","settings","toggle","radio","checkboxes","textField","dropdown","log","styles","theme","title","fontSize","display","marginTop","spacing","unit","marginBottom","promptHolder","width","paddingTop","description","errorText","typography","color","palette","error","main","Configure","rationale","props","onModelChanged","model","prompt","teacherInstructions","configuration","availableTools","graphDimensions","arrows","showTitle","titleEnabled","showDimensions","dimensionsEnabled","left","right","up","down","toolbarTools","undefined","enabled","classes","onConfigurationChanged","imageSupport","uploadSoundSupport","authoring","baseInputConfiguration","coordinatesOnHover","contentDimensions","gridConfigurations","instruction","labels","padding","scoringType","settingsPanelDisabled","spellCheck","studentInstructions","maxImageWidth","maxImageHeight","withRubric","language","languageChoices","mathMlOptions","errors","labelsEnabled","promptEnabled","rationaleEnabled","spellCheckEnabled","teacherInstructionsEnabled","promptError","rationaleError","teacherInstructionsError","defaultImageMaxWidth","defaultImageMaxHeight","labelsPlaceholders","top","bottom","panelItemType","label","options","panelProperties","studentInstructionsEnabled","rubricEnabled","getPluginProps","Settings","Properties","onTeacherInstructionsChange","inputConfiguration","onPromptChange","placeholder","onRationaleChange","React","Component","PropTypes","func","object","isRequired"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,IAAQA,KAAR,GAAkEC,kBAAlE,CAAQD,KAAR;AAAA,IAAeE,MAAf,GAAkED,kBAAlE,CAAeC,MAAf;AAAA,IAAuBC,KAAvB,GAAkEF,kBAAlE,CAAuBE,KAAvB;AAAA,IAA8BC,UAA9B,GAAkEH,kBAAlE,CAA8BG,UAA9B;AAAA,IAA0CC,SAA1C,GAAkEJ,kBAAlE,CAA0CI,SAA1C;AAAA,IAAqDC,QAArD,GAAkEL,kBAAlE,CAAqDK,QAArD;AACA,IAAMC,GAAG,GAAG,uBAAM,iCAAN,CAAZ;;AAEA,IAAMC,MAAM,GAAG,SAATA,MAAS,CAACC,KAAD;AAAA,SAAY;AAC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a,EAAEmE,sBAAUE,MAAV,CAAiBC;AAPf,C;iCADR7E,S,kBAWW;AAAEsB,EAAAA,OAAO,EAAE;AAAX,C;;eAsPT,wBAAWzC,MAAX,EAAmBmB,SAAnB,C","sourcesContent":["import React from 'react';\nimport { withStyles } from '@material-ui/core/styles';\n\nimport { settings, layout, InputContainer } from '@pie-lib/pie-toolbox/config-ui';\nimport PropTypes from 'prop-types';\nimport debug from 'debug';\nimport Typography from '@material-ui/core/Typography';\nimport { EditableHtml } from '@pie-lib/pie-toolbox/editable-html';\nimport GraphingConfig from './graphing-config';\nimport CorrectResponse from './correct-response';\nimport intersection from 'lodash/intersection';\n\nconst { Panel, toggle, radio, checkboxes, textField, dropdown } = settings;\nconst log = debug('@pie-element:graphing:configure');\n\nconst styles = (theme) => ({\n title: {\n fontSize: '1.1rem',\n display: 'block',\n marginTop: theme.spacing.unit * 2,\n marginBottom: theme.spacing.unit,\n },\n promptHolder: {\n width: '100%',\n paddingTop: theme.spacing.unit * 2,\n marginBottom: theme.spacing.unit * 2,\n },\n description: {\n marginBottom: theme.spacing.unit * 2.5,\n },\n errorText: {\n fontSize: theme.typography.fontSize - 2,\n color: theme.palette.error.main,\n paddingTop: theme.spacing.unit,\n },\n});\n\nexport class Configure extends React.Component {\n static propTypes = {\n onModelChanged: PropTypes.func,\n onConfigurationChanged: PropTypes.func,\n classes: PropTypes.object,\n imageSupport: PropTypes.object,\n uploadSoundSupport: PropTypes.object,\n model: PropTypes.object.isRequired,\n configuration: PropTypes.object.isRequired,\n };\n\n static defaultProps = { classes: {} };\n\n componentDidMount() {\n const { configuration, onModelChanged, model } = this.props;\n const { availableTools, title, graphDimensions } = configuration || {};\n let { arrows, titleEnabled: showTitle, dimensionsEnabled: showDimensions } = model || {};\n\n // This is used for offering support for old models which have the property arrows: boolean\n // Same thing is set in the controller: packages/graphing/controller/src/index.js - model\n if (typeof arrows === 'boolean') {\n if (arrows) {\n arrows = { left: true, right: true, up: true, down: true };\n } else {\n arrows = { left: false, right: false, up: false, down: false };\n }\n }\n\n const toolbarTools = intersection(availableTools || [], model.toolbarTools || []);\n const titleEnabled = showTitle === undefined || showTitle === null ? title.enabled : showTitle;\n const dimensionsEnabled =\n showDimensions === undefined || showDimensions === null ? graphDimensions.enabled : showDimensions;\n\n onModelChanged && onModelChanged({ ...model, arrows, toolbarTools, titleEnabled, dimensionsEnabled });\n }\n\n onRationaleChange = (rationale) => {\n const { onModelChanged, model } = this.props;\n\n onModelChanged({ ...model, rationale });\n };\n\n onPromptChange = (prompt) => {\n const { onModelChanged, model } = this.props;\n\n onModelChanged({ ...model, prompt });\n };\n\n onTeacherInstructionsChange = (teacherInstructions) => {\n const { onModelChanged, model } = this.props;\n\n onModelChanged({ ...model, teacherInstructions });\n };\n\n render() {\n const { classes, model, configuration, onConfigurationChanged, onModelChanged, imageSupport, uploadSoundSupport } =\n this.props;\n const {\n arrows = {},\n authoring = {},\n availableTools = [],\n baseInputConfiguration = {},\n coordinatesOnHover = {},\n contentDimensions = {},\n gridConfigurations = [],\n graphDimensions = {},\n instruction = {},\n labels = {},\n padding = {},\n prompt = {},\n rationale = {},\n scoringType = {},\n settingsPanelDisabled,\n spellCheck = {},\n studentInstructions = {},\n teacherInstructions = {},\n title = {},\n maxImageWidth = {},\n maxImageHeight = {},\n withRubric = {},\n language = {},\n languageChoices = {},\n mathMlOptions = {},\n } = configuration || {};\n const {\n errors = {},\n labelsEnabled,\n dimensionsEnabled,\n promptEnabled,\n rationaleEnabled,\n spellCheckEnabled,\n teacherInstructionsEnabled,\n titleEnabled,\n } = model || {};\n const {\n prompt: promptError,\n rationale: rationaleError,\n teacherInstructions: teacherInstructionsError,\n } = errors || {};\n\n log('[render] model', model);\n\n const defaultImageMaxWidth = maxImageWidth && maxImageWidth.prompt;\n const defaultImageMaxHeight = maxImageHeight && maxImageHeight.prompt;\n const labelsPlaceholders = {\n top: labels.top,\n right: labels.right,\n bottom: labels.bottom,\n left: labels.left,\n };\n\n const panelItemType = {\n arrows:\n arrows.settings &&\n checkboxes(arrows.label, {\n left: arrows.left,\n right: arrows.right,\n up: arrows.up,\n down: arrows.down,\n }),\n titleEnabled: title.settings && toggle(title.label),\n padding: padding.settings && toggle(padding.label),\n labelsEnabled: labels.settings && toggle(labels.label),\n 'language.enabled': language.settings && toggle(language.label, true),\n language: language.settings && language.enabled && dropdown(languageChoices.label, languageChoices.options),\n dimensionsEnabled: graphDimensions.settings && toggle(graphDimensions.label),\n coordinatesOnHover: coordinatesOnHover.settings && toggle(coordinatesOnHover.label),\n };\n\n const panelProperties = {\n 'authoring.enabled': authoring.settings && toggle(authoring.label, true),\n teacherInstructionsEnabled: teacherInstructions.settings && toggle(teacherInstructions.label),\n studentInstructionsEnabled: studentInstructions.settings && toggle(studentInstructions.label),\n promptEnabled: prompt.settings && toggle(prompt.label),\n rationaleEnabled: rationale.settings && toggle(rationale.label),\n spellCheckEnabled: spellCheck.settings && toggle(spellCheck.label),\n scoringType: scoringType.settings && radio(scoringType.label, ['dichotomous', 'partial scoring']),\n rubricEnabled: withRubric?.settings && toggle(withRubric?.label),\n instruction: instruction.settings && textField(instruction.label),\n };\n\n const getPluginProps = (props = {}) => ({\n ...baseInputConfiguration,\n ...props,\n });\n\n return (\n <layout.ConfigLayout\n dimensions={contentDimensions}\n hideSettings={settingsPanelDisabled}\n settings={\n <Panel\n model={model}\n configuration={configuration}\n onChangeModel={onModelChanged}\n onChangeConfiguration={onConfigurationChanged}\n groups={{\n Settings: panelItemType,\n Properties: panelProperties,\n }}\n />\n }\n >\n <Typography component=\"div\" type=\"body1\" className={classes.description}>\n {instruction?.label || ''}\n </Typography>\n\n {teacherInstructionsEnabled && (\n <InputContainer label={teacherInstructions.label} className={classes.promptHolder}>\n <EditableHtml\n className={classes.prompt}\n markup={model.teacherInstructions || ''}\n onChange={this.onTeacherInstructionsChange}\n imageSupport={imageSupport}\n error={teacherInstructionsError}\n nonEmpty={false}\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 && <div className={classes.errorText}>{teacherInstructionsError}</div>}\n </InputContainer>\n )}\n\n {promptEnabled && (\n <InputContainer label={prompt.label} className={classes.promptHolder}>\n <EditableHtml\n className={classes.prompt}\n markup={model.prompt}\n onChange={this.onPromptChange}\n imageSupport={imageSupport}\n error={promptError}\n nonEmpty={false}\n spellCheck={spellCheckEnabled}\n pluginProps={getPluginProps(prompt?.inputConfiguration)}\n disableUnderline\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 <GraphingConfig\n authoring={authoring}\n availableTools={availableTools}\n gridConfigurations={gridConfigurations}\n graphDimensions={graphDimensions}\n labelsPlaceholders={labelsPlaceholders}\n model={model}\n showLabels={labelsEnabled}\n dimensionsEnabled={dimensionsEnabled}\n showTitle={titleEnabled}\n titlePlaceholder={title.placeholder}\n onChange={this.props.onModelChanged}\n mathMlOptions={mathMlOptions}\n />\n\n <CorrectResponse\n availableTools={availableTools}\n errors={errors}\n model={model}\n onChange={this.props.onModelChanged}\n mathMlOptions={mathMlOptions}\n />\n\n {rationaleEnabled && (\n <InputContainer label={rationale.label || 'Rationale'} className={classes.promptHolder}>\n <EditableHtml\n className={classes.prompt}\n markup={model.rationale || ''}\n onChange={this.onRationaleChange}\n imageSupport={imageSupport}\n error={rationaleError}\n spellCheck={spellCheckEnabled}\n pluginProps={getPluginProps(rationale?.inputConfiguration)}\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 </layout.ConfigLayout>\n );\n }\n}\n\nexport default withStyles(styles)(Configure);\n"],"file":"configure.js"}
|
package/configure/lib/index.js
CHANGED
|
@@ -35,7 +35,7 @@ var _debug = _interopRequireDefault(require("debug"));
|
|
|
35
35
|
|
|
36
36
|
var _defaults = _interopRequireDefault(require("./defaults"));
|
|
37
37
|
|
|
38
|
-
var
|
|
38
|
+
var _mathRendering = require("@pie-lib/pie-toolbox/math-rendering");
|
|
39
39
|
|
|
40
40
|
var _cloneDeep = _interopRequireDefault(require("lodash/cloneDeep"));
|
|
41
41
|
|
|
@@ -182,7 +182,7 @@ var GraphLinesConfigure = /*#__PURE__*/function (_HTMLElement) {
|
|
|
182
182
|
});
|
|
183
183
|
|
|
184
184
|
_reactDom["default"].render(el, this, function () {
|
|
185
|
-
(0,
|
|
185
|
+
(0, _mathRendering.renderMath)(_this2);
|
|
186
186
|
});
|
|
187
187
|
}
|
|
188
188
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.js"],"names":["log","sortedAnswers","answers","Object","keys","sort","reduce","result","key","GraphLinesConfigure","hasPlayerAsParent","_modelCopy","_model","model","_render","dispatchEvent","ModelUpdatedEvent","config","_configuration","handler","InsertImageEvent","src","done","DeleteImageEvent","createDefaultModel","defaultValues","configuration","pieAuthors","document","querySelectorAll","Array","from","some","author","contains","m","c","resetModelAfterConfigurationIsSet","language","enabled","languageChoices","options","length","value","settings","InsertSoundEvent","DeleteSoundEvent","el","React","createElement","Configure","onModelChanged","onConfigurationChanged","imageSupport","add","insertImage","onDeleteImage","uploadSoundSupport","insertSound","bind","onDeleteSound","ReactDOM","render","HTMLElement","normalizedModel","domain","defaultTool","graph","range","standardGrid","toolbarTools","toolbarToolsNoLabel","filter","tool","normalizedDefaultTool","correctAnswer","min","max","step","labelStep","height","width"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AAOA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,IAAMA,GAAG,GAAG,uBAAM,iCAAN,CAAZ,C,CAEA;;AACA,IAAMC,aAAa,GAAG,SAAhBA,aAAgB,CAACC,OAAD;AAAA,SACpBC,MAAM,CAACC,IAAP,CAAYF,OAAO,IAAI,EAAvB,EACGG,IADH,GAEGC,MAFH,CAEU,UAACC,MAAD,EAASC,GAAT,EAAiB;AACvB,QAAIA,GAAG,KAAK,eAAZ,EAA6B;AAC3BD,MAAAA,MAAM,CAACC,GAAD,CAAN,GAAcN,OAAO,CAACM,GAAD,CAArB;AACD;;AAED,WAAOD,MAAP;AACD,GARH,EAQK,EARL,CADoB;AAAA,CAAtB;;IAWqBE,mB;;;;;AAwCnB,iCAAc;AAAA;;AAAA;AACZ;AADY,0HAqBsB,YAAM;AACxC,UAAI,MAAKC,iBAAT,EAA4B;AAC1B,YAAI,MAAKC,UAAT,EAAqB;AACnB,gBAAKC,MAAL,GAAc,MAAKD,UAAnB;AACD,SAFD,MAEO;AACL,iBAAO,MAAKA,UAAZ;AACD;AACF;AACF,KA7Ba;AAAA,uGA0DG,UAACE,KAAD,EAAW;AAC1B,YAAKD,MAAL,GAAcC,KAAd;;AACA,YAAKC,OAAL;;AAEAd,MAAAA,GAAG,CAAC,oBAAD,EAAuB,MAAKY,MAA5B,CAAH;;AAEA,YAAKG,aAAL,CAAmB,IAAIC,qCAAJ,CAAsB,MAAKJ,MAA3B,CAAnB;AACD,KAjEa;AAAA,+GAmEW,UAACK,MAAD,EAAY;AACnC,YAAKC,cAAL,GAAsBD,MAAtB;;AACA,YAAKH,OAAL;AACD,KAtEa;AA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YAAY,oCAASF,KAAT;AAAgBa,MAAAA,MAAM,EAAEb,KAAK,CAACc;AAA9B,MAAb,IAAuDd;AAnBhE;AAqBD,C","sourcesContent":["import React from 'react';\nimport ReactDOM from 'react-dom';\nimport Configure from './configure';\nimport {\n ModelUpdatedEvent,\n DeleteImageEvent,\n InsertImageEvent,\n InsertSoundEvent,\n DeleteSoundEvent,\n} from '@pie-framework/pie-configure-events';\nimport debug from 'debug';\nimport defaultValues from './defaults';\nimport { renderMath } from '@pie-lib/pie-toolbox/math-rendering-accessible';\nimport cloneDeep from 'lodash/cloneDeep';\n\nconst log = debug('pie-elements:graphing:configure');\n\n// this function is implemented in controller as well\nconst sortedAnswers = (answers) =>\n Object.keys(answers || {})\n .sort()\n .reduce((result, key) => {\n if (key !== 'correctAnswer') {\n result[key] = answers[key];\n }\n\n return result;\n }, {});\n\nexport default class GraphLinesConfigure extends HTMLElement {\n static createDefaultModel = (model = {}) => {\n const normalizedModel = { ...defaultValues.model, ...model };\n const {\n answers = {},\n domain = {},\n defaultTool,\n graph = {},\n range = {},\n standardGrid,\n toolbarTools,\n } = normalizedModel;\n\n // added support for models without defaultTool defined; also used in packages/graphing/controller/src/index.js\n const toolbarToolsNoLabel = (toolbarTools || []).filter((tool) => tool !== 'label');\n const normalizedDefaultTool = defaultTool || (toolbarToolsNoLabel.length && toolbarToolsNoLabel[0]) || '';\n\n return {\n ...normalizedModel,\n answers:\n (answers &&\n answers.correctAnswer && {\n correctAnswer: answers.correctAnswer,\n ...sortedAnswers(answers),\n }) ||\n answers,\n defaultTool: normalizedDefaultTool,\n range:\n (standardGrid && {\n ...range,\n min: domain.min,\n max: domain.max,\n step: domain.step,\n labelStep: domain.labelStep,\n }) ||\n range,\n graph: (standardGrid && { ...graph, height: graph.width }) || graph,\n };\n };\n\n constructor() {\n super();\n this._model = GraphLinesConfigure.createDefaultModel();\n this._configuration = defaultValues.configuration;\n\n // In environments that use pie-player-components, model is set before configuration.\n // This is the reason why sometimes the model gets altered non-reversible\n // (altered using default configuration instead of client configuration, because at that point client configuration was not set yet)\n // Therefore, in such environments, we will make sure to keep a modelCopy (initialised in set model) and use it to reset\n // the model in set configuration (resetModelAfterConfigurationIsSet) if set configuration is ever called\n const pieAuthors = document.querySelectorAll('pie-author');\n this.hasPlayerAsParent = Array.from(pieAuthors).some(author => author.contains(this));\n }\n\n set model(m) {\n this._model = GraphLinesConfigure.createDefaultModel(m);\n this._modelCopy = cloneDeep(this._model);\n\n this._render();\n }\n\n resetModelAfterConfigurationIsSet = () => {\n if (this.hasPlayerAsParent) {\n if (this._modelCopy) {\n this._model = this._modelCopy;\n } else {\n delete this._modelCopy;\n }\n }\n }\n\n set configuration(c) {\n this._configuration = c;\n\n this.resetModelAfterConfigurationIsSet();\n\n // if language:enabled is true, then the corresponding default item model should include a language value;\n // if it is false, then the language field should be omitted from the item model.\n // if a default item model includes a language value (e.g., en_US) and the corresponding authoring view settings have language:settings = true,\n // then (a) language:enabled should also be true, and (b) that default language value should be represented in languageChoices[] (as a key).\n //TODO: add logic in controller and add tests\n if (c.language?.enabled) {\n if (c.languageChoices?.options?.length) {\n this._model.language = c.languageChoices.options[0].value;\n }\n } else {\n if (c.language.settings) {\n if (this._model.language) {\n this._configuration.language.enabled = true;\n }\n } else {\n delete this._model.language;\n }\n }\n\n this._render();\n }\n\n onModelChanged = (model) => {\n this._model = model;\n this._render();\n\n log('[onModelChanged]: ', this._model);\n\n this.dispatchEvent(new ModelUpdatedEvent(this._model));\n };\n\n onConfigurationChanged = (config) => {\n this._configuration = config;\n this._render();\n };\n\n insertImage = (handler) => {\n this.dispatchEvent(new InsertImageEvent(handler));\n };\n\n onDeleteImage = (src, done) => {\n this.dispatchEvent(new DeleteImageEvent(src, done));\n };\n\n insertSound(handler) {\n this.dispatchEvent(new InsertSoundEvent(handler));\n }\n\n onDeleteSound(src, done) {\n this.dispatchEvent(new DeleteSoundEvent(src, done));\n }\n\n _render() {\n if (this._model) {\n const el = React.createElement(Configure, {\n onModelChanged: this.onModelChanged,\n onConfigurationChanged: this.onConfigurationChanged,\n model: this._model,\n configuration: this._configuration,\n imageSupport: {\n add: this.insertImage,\n delete: this.onDeleteImage,\n },\n uploadSoundSupport: {\n add: this.insertSound.bind(this),\n delete: this.onDeleteSound.bind(this),\n },\n });\n\n ReactDOM.render(el, this, () => {\n renderMath(this);\n });\n }\n }\n}\n"],"file":"index.js"}
|
|
1
|
+
{"version":3,"sources":["../src/index.js"],"names":["log","sortedAnswers","answers","Object","keys","sort","reduce","result","key","GraphLinesConfigure","hasPlayerAsParent","_modelCopy","_model","model","_render","dispatchEvent","ModelUpdatedEvent","config","_configuration","handler","InsertImageEvent","src","done","DeleteImageEvent","createDefaultModel","defaultValues","configuration","pieAuthors","document","querySelectorAll","Array","from","some","author","contains","m","c","resetModelAfterConfigurationIsSet","language","enabled","languageChoices","options","length","value","settings","InsertSoundEvent","DeleteSoundEvent","el","React","createElement","Configure","onModelChanged","onConfigurationChanged","imageSupport","add","insertImage","onDeleteImage","uploadSoundSupport","insertSound","bind","onDeleteSound","ReactDOM","render","HTMLElement","normalizedModel","domain","defaultTool","graph","range","standardGrid","toolbarTools","toolbarToolsNoLabel","filter","tool","normalizedDefaultTool","correctAnswer","min","max","step","labelStep","height","width"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AAOA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,IAAMA,GAAG,GAAG,uBAAM,iCAAN,CAAZ,C,CAEA;;AACA,IAAMC,aAAa,GAAG,SAAhBA,aAAgB,CAACC,OAAD;AAAA,SACpBC,MAAM,CAACC,IAAP,CAAYF,OAAO,IAAI,EAAvB,EACGG,IADH,GAEGC,MAFH,CAEU,UAACC,MAAD,EAASC,GAAT,EAAiB;AACvB,QAAIA,GAAG,KAAK,eAAZ,EAA6B;AAC3BD,MAAAA,MAAM,CAACC,GAAD,CAAN,GAAcN,OAAO,CAACM,GAAD,CAArB;AACD;;AAED,WAAOD,MAAP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,GAA5B,CAA5B;AACA,MAAMC,qBAAqB,GAAGR,WAAW,IAAKK,mBAAmB,CAAC7B,MAApB,IAA8B6B,mBAAmB,CAAC,CAAD,CAAjE,IAAyE,EAAvG;AAEA,yCACKP,eADL;AAEE9D,IAAAA,OAAO,EACJA,OAAO,IACNA,OAAO,CAACyE,aADT;AAEGA,MAAAA,aAAa,EAAEzE,OAAO,CAACyE;AAF1B,OAGM1E,aAAa,CAACC,OAAD,CAHnB,CAAD,IAKAA,OARJ;AASEgE,IAAAA,WAAW,EAAEQ,qBATf;AAUEN,IAAAA,KAAK,EACFC,YAAY,oCACRD,KADQ;AAEXQ,MAAAA,GAAG,EAAEX,MAAM,CAACW,GAFD;AAGXC,MAAAA,GAAG,EAAEZ,MAAM,CAACY,GAHD;AAIXC,MAAAA,IAAI,EAAEb,MAAM,CAACa,IAJF;AAKXC,MAAAA,SAAS,EAAEd,MAAM,CAACc;AALP,MAAb,IAOAX,KAlBJ;AAmBED,IAAAA,KAAK,EAAGE,YAAY,oCAASF,KAAT;AAAgBa,MAAAA,MAAM,EAAEb,KAAK,CAACc;AAA9B,MAAb,IAAuDd;AAnBhE;AAqBD,C","sourcesContent":["import React from 'react';\nimport ReactDOM from 'react-dom';\nimport Configure from './configure';\nimport {\n ModelUpdatedEvent,\n DeleteImageEvent,\n InsertImageEvent,\n InsertSoundEvent,\n DeleteSoundEvent,\n} from '@pie-framework/pie-configure-events';\nimport debug from 'debug';\nimport defaultValues from './defaults';\nimport { renderMath } from '@pie-lib/pie-toolbox/math-rendering';\nimport cloneDeep from 'lodash/cloneDeep';\n\nconst log = debug('pie-elements:graphing:configure');\n\n// this function is implemented in controller as well\nconst sortedAnswers = (answers) =>\n Object.keys(answers || {})\n .sort()\n .reduce((result, key) => {\n if (key !== 'correctAnswer') {\n result[key] = answers[key];\n }\n\n return result;\n }, {});\n\nexport default class GraphLinesConfigure extends HTMLElement {\n static createDefaultModel = (model = {}) => {\n const normalizedModel = { ...defaultValues.model, ...model };\n const {\n answers = {},\n domain = {},\n defaultTool,\n graph = {},\n range = {},\n standardGrid,\n toolbarTools,\n } = normalizedModel;\n\n // added support for models without defaultTool defined; also used in packages/graphing/controller/src/index.js\n const toolbarToolsNoLabel = (toolbarTools || []).filter((tool) => tool !== 'label');\n const normalizedDefaultTool = defaultTool || (toolbarToolsNoLabel.length && toolbarToolsNoLabel[0]) || '';\n\n return {\n ...normalizedModel,\n answers:\n (answers &&\n answers.correctAnswer && {\n correctAnswer: answers.correctAnswer,\n ...sortedAnswers(answers),\n }) ||\n answers,\n defaultTool: normalizedDefaultTool,\n range:\n (standardGrid && {\n ...range,\n min: domain.min,\n max: domain.max,\n step: domain.step,\n labelStep: domain.labelStep,\n }) ||\n range,\n graph: (standardGrid && { ...graph, height: graph.width }) || graph,\n };\n };\n\n constructor() {\n super();\n this._model = GraphLinesConfigure.createDefaultModel();\n this._configuration = defaultValues.configuration;\n\n // In environments that use pie-player-components, model is set before configuration.\n // This is the reason why sometimes the model gets altered non-reversible\n // (altered using default configuration instead of client configuration, because at that point client configuration was not set yet)\n // Therefore, in such environments, we will make sure to keep a modelCopy (initialised in set model) and use it to reset\n // the model in set configuration (resetModelAfterConfigurationIsSet) if set configuration is ever called\n const pieAuthors = document.querySelectorAll('pie-author');\n this.hasPlayerAsParent = Array.from(pieAuthors).some(author => author.contains(this));\n }\n\n set model(m) {\n this._model = GraphLinesConfigure.createDefaultModel(m);\n this._modelCopy = cloneDeep(this._model);\n\n this._render();\n }\n\n resetModelAfterConfigurationIsSet = () => {\n if (this.hasPlayerAsParent) {\n if (this._modelCopy) {\n this._model = this._modelCopy;\n } else {\n delete this._modelCopy;\n }\n }\n }\n\n set configuration(c) {\n this._configuration = c;\n\n this.resetModelAfterConfigurationIsSet();\n\n // if language:enabled is true, then the corresponding default item model should include a language value;\n // if it is false, then the language field should be omitted from the item model.\n // if a default item model includes a language value (e.g., en_US) and the corresponding authoring view settings have language:settings = true,\n // then (a) language:enabled should also be true, and (b) that default language value should be represented in languageChoices[] (as a key).\n //TODO: add logic in controller and add tests\n if (c.language?.enabled) {\n if (c.languageChoices?.options?.length) {\n this._model.language = c.languageChoices.options[0].value;\n }\n } else {\n if (c.language.settings) {\n if (this._model.language) {\n this._configuration.language.enabled = true;\n }\n } else {\n delete this._model.language;\n }\n }\n\n this._render();\n }\n\n onModelChanged = (model) => {\n this._model = model;\n this._render();\n\n log('[onModelChanged]: ', this._model);\n\n this.dispatchEvent(new ModelUpdatedEvent(this._model));\n };\n\n onConfigurationChanged = (config) => {\n this._configuration = config;\n this._render();\n };\n\n insertImage = (handler) => {\n this.dispatchEvent(new InsertImageEvent(handler));\n };\n\n onDeleteImage = (src, done) => {\n this.dispatchEvent(new DeleteImageEvent(src, done));\n };\n\n insertSound(handler) {\n this.dispatchEvent(new InsertSoundEvent(handler));\n }\n\n onDeleteSound(src, done) {\n this.dispatchEvent(new DeleteSoundEvent(src, done));\n }\n\n _render() {\n if (this._model) {\n const el = React.createElement(Configure, {\n onModelChanged: this.onModelChanged,\n onConfigurationChanged: this.onConfigurationChanged,\n model: this._model,\n configuration: this._configuration,\n imageSupport: {\n add: this.insertImage,\n delete: this.onDeleteImage,\n },\n uploadSoundSupport: {\n add: this.insertSound.bind(this),\n delete: this.onDeleteSound.bind(this),\n },\n });\n\n ReactDOM.render(el, this, () => {\n renderMath(this);\n });\n }\n }\n}\n"],"file":"index.js"}
|
package/configure/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/graphing-configure",
|
|
3
3
|
"private": true,
|
|
4
|
-
"version": "5.
|
|
4
|
+
"version": "5.9.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"module": "src/index.js",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@material-ui/core": "^3.9.2",
|
|
11
11
|
"@pie-framework/pie-configure-events": "^1.3.0",
|
|
12
|
-
"@pie-lib/pie-toolbox": "1.
|
|
12
|
+
"@pie-lib/pie-toolbox": "1.11.1",
|
|
13
13
|
"classnames": "^2.2.5",
|
|
14
14
|
"debug": "^4.1.1",
|
|
15
15
|
"lodash": "^4.17.15",
|
package/controller/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
|
+
# [5.6.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/graphing-controller@5.5.0...@pie-element/graphing-controller@5.6.0) (2024-03-20)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* updated pie-lib/pie-toolbox SC-28500 ([a8e4e6a](https://github.com/pie-framework/pie-elements/commit/a8e4e6ab27584435ce7ac3e964ccac2747402777))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* updated pie-lib/pie-toolbox SC-27890 and reverted once again math-rendering-accessible ([fd312e1](https://github.com/pie-framework/pie-elements/commit/fd312e1336999893025231946649496d290883e4))
|
|
17
|
+
* use math-rendering-accessible everywhere PD-1870 ([d52e660](https://github.com/pie-framework/pie-elements/commit/d52e6607ad8847d704bd9cb9b7e3107c130f0500))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
6
23
|
# [5.5.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/graphing-controller@5.4.1...@pie-element/graphing-controller@5.5.0) (2024-03-15)
|
|
7
24
|
|
|
8
25
|
|
package/controller/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/graphing-controller",
|
|
3
3
|
"private": true,
|
|
4
|
-
"version": "5.
|
|
4
|
+
"version": "5.6.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"module": "src/index.js",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"test": "./node_modules/.bin/jest"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@pie-lib/pie-toolbox": "1.
|
|
12
|
+
"@pie-lib/pie-toolbox": "1.11.1",
|
|
13
13
|
"debug": "^4.1.1"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
package/docs/config-schema.json
CHANGED
|
@@ -7,6 +7,17 @@
|
|
|
7
7
|
"title": "EditableHtmlConfigureProp",
|
|
8
8
|
"type": "object",
|
|
9
9
|
"properties": {
|
|
10
|
+
"math": {
|
|
11
|
+
"title": "EditableHtmlButtonConfigure",
|
|
12
|
+
"type": "object",
|
|
13
|
+
"properties": {
|
|
14
|
+
"disabled": {
|
|
15
|
+
"description": "Indicates if the plugin is disabled or not",
|
|
16
|
+
"type": "boolean",
|
|
17
|
+
"title": "disabled"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
},
|
|
10
21
|
"audio": {
|
|
11
22
|
"title": "EditableHtmlButtonConfigure",
|
|
12
23
|
"type": "object",
|
|
@@ -611,6 +622,17 @@
|
|
|
611
622
|
"title": "EditableHtmlConfigureProp",
|
|
612
623
|
"type": "object",
|
|
613
624
|
"properties": {
|
|
625
|
+
"math": {
|
|
626
|
+
"title": "EditableHtmlButtonConfigure",
|
|
627
|
+
"type": "object",
|
|
628
|
+
"properties": {
|
|
629
|
+
"disabled": {
|
|
630
|
+
"description": "Indicates if the plugin is disabled or not",
|
|
631
|
+
"type": "boolean",
|
|
632
|
+
"title": "disabled"
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
},
|
|
614
636
|
"audio": {
|
|
615
637
|
"title": "EditableHtmlButtonConfigure",
|
|
616
638
|
"type": "object",
|
|
@@ -692,6 +714,17 @@
|
|
|
692
714
|
"title": "EditableHtmlConfigureProp",
|
|
693
715
|
"type": "object",
|
|
694
716
|
"properties": {
|
|
717
|
+
"math": {
|
|
718
|
+
"title": "EditableHtmlButtonConfigure",
|
|
719
|
+
"type": "object",
|
|
720
|
+
"properties": {
|
|
721
|
+
"disabled": {
|
|
722
|
+
"description": "Indicates if the plugin is disabled or not",
|
|
723
|
+
"type": "boolean",
|
|
724
|
+
"title": "disabled"
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
},
|
|
695
728
|
"audio": {
|
|
696
729
|
"title": "EditableHtmlButtonConfigure",
|
|
697
730
|
"type": "object",
|
|
@@ -784,6 +817,17 @@
|
|
|
784
817
|
"title": "EditableHtmlConfigureProp",
|
|
785
818
|
"type": "object",
|
|
786
819
|
"properties": {
|
|
820
|
+
"math": {
|
|
821
|
+
"title": "EditableHtmlButtonConfigure",
|
|
822
|
+
"type": "object",
|
|
823
|
+
"properties": {
|
|
824
|
+
"disabled": {
|
|
825
|
+
"description": "Indicates if the plugin is disabled or not",
|
|
826
|
+
"type": "boolean",
|
|
827
|
+
"title": "disabled"
|
|
828
|
+
}
|
|
829
|
+
}
|
|
830
|
+
},
|
|
787
831
|
"audio": {
|
|
788
832
|
"title": "EditableHtmlButtonConfigure",
|
|
789
833
|
"type": "object",
|
|
@@ -1007,6 +1051,17 @@
|
|
|
1007
1051
|
"title": "EditableHtmlConfigureProp",
|
|
1008
1052
|
"type": "object",
|
|
1009
1053
|
"properties": {
|
|
1054
|
+
"math": {
|
|
1055
|
+
"title": "EditableHtmlButtonConfigure",
|
|
1056
|
+
"type": "object",
|
|
1057
|
+
"properties": {
|
|
1058
|
+
"disabled": {
|
|
1059
|
+
"description": "Indicates if the plugin is disabled or not",
|
|
1060
|
+
"type": "boolean",
|
|
1061
|
+
"title": "disabled"
|
|
1062
|
+
}
|
|
1063
|
+
}
|
|
1064
|
+
},
|
|
1010
1065
|
"audio": {
|
|
1011
1066
|
"title": "EditableHtmlButtonConfigure",
|
|
1012
1067
|
"type": "object",
|
|
@@ -1729,6 +1784,17 @@
|
|
|
1729
1784
|
"title": "EditableHtmlConfigureProp",
|
|
1730
1785
|
"type": "object",
|
|
1731
1786
|
"properties": {
|
|
1787
|
+
"math": {
|
|
1788
|
+
"title": "EditableHtmlButtonConfigure",
|
|
1789
|
+
"type": "object",
|
|
1790
|
+
"properties": {
|
|
1791
|
+
"disabled": {
|
|
1792
|
+
"description": "Indicates if the plugin is disabled or not",
|
|
1793
|
+
"type": "boolean",
|
|
1794
|
+
"title": "disabled"
|
|
1795
|
+
}
|
|
1796
|
+
}
|
|
1797
|
+
},
|
|
1732
1798
|
"audio": {
|
|
1733
1799
|
"title": "EditableHtmlButtonConfigure",
|
|
1734
1800
|
"type": "object",
|
|
@@ -6,6 +6,14 @@ The schema defines the following properties:
|
|
|
6
6
|
|
|
7
7
|
Properties of the `baseInputConfiguration` object:
|
|
8
8
|
|
|
9
|
+
## `math` (object)
|
|
10
|
+
|
|
11
|
+
Properties of the `math` object:
|
|
12
|
+
|
|
13
|
+
### `disabled` (boolean)
|
|
14
|
+
|
|
15
|
+
Indicates if the plugin is disabled or not
|
|
16
|
+
|
|
9
17
|
## `audio` (object)
|
|
10
18
|
|
|
11
19
|
Properties of the `audio` object:
|
|
@@ -433,6 +441,14 @@ Properties of the `prompt` object:
|
|
|
433
441
|
|
|
434
442
|
Properties of the `inputConfiguration` object:
|
|
435
443
|
|
|
444
|
+
### `math` (object)
|
|
445
|
+
|
|
446
|
+
Properties of the `math` object:
|
|
447
|
+
|
|
448
|
+
#### `disabled` (boolean)
|
|
449
|
+
|
|
450
|
+
Indicates if the plugin is disabled or not
|
|
451
|
+
|
|
436
452
|
### `audio` (object)
|
|
437
453
|
|
|
438
454
|
Properties of the `audio` object:
|
|
@@ -493,6 +509,14 @@ Properties of the `rationale` object:
|
|
|
493
509
|
|
|
494
510
|
Properties of the `inputConfiguration` object:
|
|
495
511
|
|
|
512
|
+
### `math` (object)
|
|
513
|
+
|
|
514
|
+
Properties of the `math` object:
|
|
515
|
+
|
|
516
|
+
#### `disabled` (boolean)
|
|
517
|
+
|
|
518
|
+
Indicates if the plugin is disabled or not
|
|
519
|
+
|
|
496
520
|
### `audio` (object)
|
|
497
521
|
|
|
498
522
|
Properties of the `audio` object:
|
|
@@ -561,6 +585,14 @@ Properties of the `teacherInstructions` object:
|
|
|
561
585
|
|
|
562
586
|
Properties of the `inputConfiguration` object:
|
|
563
587
|
|
|
588
|
+
### `math` (object)
|
|
589
|
+
|
|
590
|
+
Properties of the `math` object:
|
|
591
|
+
|
|
592
|
+
#### `disabled` (boolean)
|
|
593
|
+
|
|
594
|
+
Indicates if the plugin is disabled or not
|
|
595
|
+
|
|
564
596
|
### `audio` (object)
|
|
565
597
|
|
|
566
598
|
Properties of the `audio` object:
|
|
@@ -736,6 +768,14 @@ The schema defines the following additional types:
|
|
|
736
768
|
|
|
737
769
|
Properties of the `EditableHtmlConfigureProp` object:
|
|
738
770
|
|
|
771
|
+
### `math` (object)
|
|
772
|
+
|
|
773
|
+
Properties of the `math` object:
|
|
774
|
+
|
|
775
|
+
#### `disabled` (boolean)
|
|
776
|
+
|
|
777
|
+
Indicates if the plugin is disabled or not
|
|
778
|
+
|
|
739
779
|
### `audio` (object)
|
|
740
780
|
|
|
741
781
|
Properties of the `audio` object:
|
|
@@ -1238,6 +1278,14 @@ Properties of the `EditableHtmlPluginConfigureRequired` object:
|
|
|
1238
1278
|
|
|
1239
1279
|
Properties of the `inputConfiguration` object:
|
|
1240
1280
|
|
|
1281
|
+
#### `math` (object)
|
|
1282
|
+
|
|
1283
|
+
Properties of the `math` object:
|
|
1284
|
+
|
|
1285
|
+
##### `disabled` (boolean)
|
|
1286
|
+
|
|
1287
|
+
Indicates if the plugin is disabled or not
|
|
1288
|
+
|
|
1241
1289
|
#### `audio` (object)
|
|
1242
1290
|
|
|
1243
1291
|
Properties of the `audio` object:
|
package/docs/pie-schema.json
CHANGED
|
@@ -1579,6 +1579,17 @@
|
|
|
1579
1579
|
"title": "EditableHtmlConfigureProp",
|
|
1580
1580
|
"type": "object",
|
|
1581
1581
|
"properties": {
|
|
1582
|
+
"math": {
|
|
1583
|
+
"title": "EditableHtmlButtonConfigure",
|
|
1584
|
+
"type": "object",
|
|
1585
|
+
"properties": {
|
|
1586
|
+
"disabled": {
|
|
1587
|
+
"description": "Indicates if the plugin is disabled or not",
|
|
1588
|
+
"type": "boolean",
|
|
1589
|
+
"title": "disabled"
|
|
1590
|
+
}
|
|
1591
|
+
}
|
|
1592
|
+
},
|
|
1582
1593
|
"audio": {
|
|
1583
1594
|
"title": "EditableHtmlButtonConfigure",
|
|
1584
1595
|
"type": "object",
|
|
@@ -2301,6 +2312,17 @@
|
|
|
2301
2312
|
"title": "EditableHtmlConfigureProp",
|
|
2302
2313
|
"type": "object",
|
|
2303
2314
|
"properties": {
|
|
2315
|
+
"math": {
|
|
2316
|
+
"title": "EditableHtmlButtonConfigure",
|
|
2317
|
+
"type": "object",
|
|
2318
|
+
"properties": {
|
|
2319
|
+
"disabled": {
|
|
2320
|
+
"description": "Indicates if the plugin is disabled or not",
|
|
2321
|
+
"type": "boolean",
|
|
2322
|
+
"title": "disabled"
|
|
2323
|
+
}
|
|
2324
|
+
}
|
|
2325
|
+
},
|
|
2304
2326
|
"audio": {
|
|
2305
2327
|
"title": "EditableHtmlButtonConfigure",
|
|
2306
2328
|
"type": "object",
|
package/docs/pie-schema.json.md
CHANGED
|
@@ -288,6 +288,14 @@ The schema defines the following additional types:
|
|
|
288
288
|
|
|
289
289
|
Properties of the `EditableHtmlConfigureProp` object:
|
|
290
290
|
|
|
291
|
+
### `math` (object)
|
|
292
|
+
|
|
293
|
+
Properties of the `math` object:
|
|
294
|
+
|
|
295
|
+
#### `disabled` (boolean)
|
|
296
|
+
|
|
297
|
+
Indicates if the plugin is disabled or not
|
|
298
|
+
|
|
291
299
|
### `audio` (object)
|
|
292
300
|
|
|
293
301
|
Properties of the `audio` object:
|
|
@@ -790,6 +798,14 @@ Properties of the `EditableHtmlPluginConfigureRequired` object:
|
|
|
790
798
|
|
|
791
799
|
Properties of the `inputConfiguration` object:
|
|
792
800
|
|
|
801
|
+
#### `math` (object)
|
|
802
|
+
|
|
803
|
+
Properties of the `math` object:
|
|
804
|
+
|
|
805
|
+
##### `disabled` (boolean)
|
|
806
|
+
|
|
807
|
+
Indicates if the plugin is disabled or not
|
|
808
|
+
|
|
793
809
|
#### `audio` (object)
|
|
794
810
|
|
|
795
811
|
Properties of the `audio` object:
|
package/lib/index.js
CHANGED
|
@@ -35,7 +35,7 @@ var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
|
35
35
|
|
|
36
36
|
var _piePlayerEvents = require("@pie-framework/pie-player-events");
|
|
37
37
|
|
|
38
|
-
var
|
|
38
|
+
var _mathRendering = require("@pie-lib/pie-toolbox/math-rendering");
|
|
39
39
|
|
|
40
40
|
var _utils = require("./utils");
|
|
41
41
|
|
|
@@ -112,7 +112,7 @@ var Graphing = /*#__PURE__*/function (_HTMLElement) {
|
|
|
112
112
|
});
|
|
113
113
|
|
|
114
114
|
_reactDom["default"].render(el, this, function () {
|
|
115
|
-
(0,
|
|
115
|
+
(0, _mathRendering.renderMath)(_this2);
|
|
116
116
|
});
|
|
117
117
|
}
|
|
118
118
|
}]);
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.js"],"names":["Graphing","answer","Array","isArray","length","isUndoOperation","_session","dispatchEvent","SessionChangedEvent","tagName","toLowerCase","isComplete","_render","m","_model","s","el","React","createElement","Main","model","session","onAnswersChange","changeAnswers","ReactDOM","render","HTMLElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AAEA;;AACA;;;;;;IAIqBA,Q;;;;;AACnB,sBAAc;AAAA;;AAAA;AACZ;AADY,mGAsBD,UAACC,MAAD;AAAA,aAAYC,KAAK,CAACC,OAAN,CAAcF,MAAd,KAAyBA,MAAM,CAACG,MAAP,GAAgB,CAArD;AAAA,KAtBC;AAAA,sGAwBE,UAACH,MAAD,EAASI,eAAT,EAA6B;AAC3C;AACA;AACA,UAAI,CAACA,eAAL,EAAsB;AACpB,cAAKC,QAAL,CAAcL,MAAd,GAAuB,iCAAqBA,MAArB,CAAvB;AACD,OAFD,MAEO;AACL,cAAKK,QAAL,CAAcL,MAAd,GAAuBA,MAAvB;AACD;;AAED,YAAKM,aAAL,CAAmB,IAAIC,oCAAJ,CAAwB,MAAKC,OAAL,CAAaC,WAAb,EAAxB,EAAoD,MAAKC,UAAL,CAAgB,MAAKL,QAAL,CAAcL,MAA9B,CAApD,CAAnB;;AAEA,YAAKW,OAAL;AACD,KApCa;AAAA;AAEb;;;;SAED,aAAUC,CAAV,EAAa;AACX,WAAKC,MAAL,GAAcD,CAAd;;AACA,WAAKD,OAAL;AACD;;;SAOD,eAAc;AACZ,aAAO,KAAKN,QAAZ;AACD,K;SAPD,aAAYS,CAAZ,EAAe;AACb,WAAKT,QAAL,GAAgBS,CAAhB;;AACA,WAAKH,OAAL;AACD;;;WAMD,6BAAoB;AAClB,WAAKA,OAAL;AACD;;;WAkBD,mBAAU;AAAA;;AACR,UAAI,CAAC,KAAKE,MAAN,IAAgB,CAAC,KAAKR,QAA1B,EAAoC;AAClC;AACD;;AAED,UAAMU,EAAE,gBAAGC,kBAAMC,aAAN,CAAoBC,gBAApB,EAA0B;AACnCC,QAAAA,KAAK,EAAE,KAAKN,MADuB;AAEnCO,QAAAA,OAAO,EAAE,KAAKf,QAFqB;AAGnCgB,QAAAA,eAAe,EAAE,KAAKC;AAHa,OAA1B,CAAX;;AAMAC,2BAASC,MAAT,CAAgBT,EAAhB,EAAoB,IAApB,EAA0B,YAAM;AAC9B,
|
|
1
|
+
{"version":3,"sources":["../src/index.js"],"names":["Graphing","answer","Array","isArray","length","isUndoOperation","_session","dispatchEvent","SessionChangedEvent","tagName","toLowerCase","isComplete","_render","m","_model","s","el","React","createElement","Main","model","session","onAnswersChange","changeAnswers","ReactDOM","render","HTMLElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;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EAA0B,YAAM;AAC9B,uCAAW,MAAX;AACD,OAFD;AAGD;;;kDArDmCU,W","sourcesContent":["import React from 'react';\nimport ReactDOM from 'react-dom';\nimport { SessionChangedEvent } from '@pie-framework/pie-player-events';\nimport { renderMath } from '@pie-lib/pie-toolbox/math-rendering';\n\nimport { removeInvalidAnswers } from './utils';\nimport Main from './main';\n\nexport { Main as Component };\n\nexport default class Graphing extends HTMLElement {\n constructor() {\n super();\n }\n\n set model(m) {\n this._model = m;\n this._render();\n }\n\n set session(s) {\n this._session = s;\n this._render();\n }\n\n get session() {\n return this._session;\n }\n\n connectedCallback() {\n this._render();\n }\n\n isComplete = (answer) => Array.isArray(answer) && answer.length > 0;\n\n changeAnswers = (answer, isUndoOperation) => {\n // avoid removeInvalidObjects when undo or redo operations are executed\n // in order to preserve the logic of undo and redo\n if (!isUndoOperation) {\n this._session.answer = removeInvalidAnswers(answer);\n } else {\n this._session.answer = answer;\n }\n\n this.dispatchEvent(new SessionChangedEvent(this.tagName.toLowerCase(), this.isComplete(this._session.answer)));\n\n this._render();\n };\n\n _render() {\n if (!this._model || !this._session) {\n return;\n }\n\n const el = React.createElement(Main, {\n model: this._model,\n session: this._session,\n onAnswersChange: this.changeAnswers,\n });\n\n ReactDOM.render(el, this, () => {\n renderMath(this);\n });\n }\n}\n"],"file":"index.js"}
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
6
|
"repository": "pie-framework/pie-elements",
|
|
7
|
-
"version": "5.
|
|
7
|
+
"version": "5.10.1-next.0+0260e08e8",
|
|
8
8
|
"description": "",
|
|
9
9
|
"scripts": {
|
|
10
10
|
"postpublish": "../../scripts/postpublish"
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@material-ui/core": "^3.9.2",
|
|
14
14
|
"@pie-framework/pie-player-events": "^0.1.0",
|
|
15
|
-
"@pie-lib/pie-toolbox": "1.
|
|
15
|
+
"@pie-lib/pie-toolbox": "1.11.1",
|
|
16
16
|
"classnames": "^2.2.5",
|
|
17
17
|
"debug": "^4.1.1",
|
|
18
18
|
"react": "^16.8.1",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
},
|
|
21
21
|
"author": "",
|
|
22
22
|
"license": "ISC",
|
|
23
|
-
"gitHead": "
|
|
23
|
+
"gitHead": "0260e08e86e6b0683fd07acecbca0703c6dc54df",
|
|
24
24
|
"main": "lib/index.js",
|
|
25
25
|
"module": "src/index.js"
|
|
26
26
|
}
|