@pie-element/hotspot 5.13.1-next.9 → 5.14.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 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.14.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/hotspot@5.13.0...@pie-element/hotspot@5.14.0) (2023-06-13)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * update libs PD-2722, PD-2827, PD-2832 ([834ecf9](https://github.com/pie-framework/pie-elements/commit/834ecf92cc7204c851c68f0945ad5d52e453c9d0))
12
+ * update pie-libs ([649fb8f](https://github.com/pie-framework/pie-elements/commit/649fb8f535172d76b3ffc676ec53b2726432808c))
13
+ * update pie-libs PD-2150, PD-2795 ([ff6f64a](https://github.com/pie-framework/pie-elements/commit/ff6f64afa6ccaa8a060c986b1637c680e68c62b6))
14
+ * **hotspot:** add a white background for image area PD-2075 ([08a8351](https://github.com/pie-framework/pie-elements/commit/08a8351cf4a2910b9167a153b7c5f9daf59ac1f7))
15
+
16
+
17
+ ### Features
18
+
19
+ * add mathMlOptions PD-2150 ([0c6984c](https://github.com/pie-framework/pie-elements/commit/0c6984cf042141eac36badfbab1c46d8d42f71ee))
20
+
21
+
22
+
23
+
24
+
6
25
  # [5.13.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/hotspot@5.12.3...@pie-element/hotspot@5.13.0) (2023-05-23)
7
26
 
8
27
 
@@ -3,6 +3,24 @@
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/hotspot-configure@5.9.0...@pie-element/hotspot-configure@5.10.0) (2023-06-13)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * update libs PD-2722, PD-2827, PD-2832 ([834ecf9](https://github.com/pie-framework/pie-elements/commit/834ecf92cc7204c851c68f0945ad5d52e453c9d0))
12
+ * update pie-libs ([649fb8f](https://github.com/pie-framework/pie-elements/commit/649fb8f535172d76b3ffc676ec53b2726432808c))
13
+ * update pie-libs PD-2150, PD-2795 ([ff6f64a](https://github.com/pie-framework/pie-elements/commit/ff6f64afa6ccaa8a060c986b1637c680e68c62b6))
14
+
15
+
16
+ ### Features
17
+
18
+ * add mathMlOptions PD-2150 ([0c6984c](https://github.com/pie-framework/pie-elements/commit/0c6984cf042141eac36badfbab1c46d8d42f71ee))
19
+
20
+
21
+
22
+
23
+
6
24
  # [5.9.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/hotspot-configure@5.8.3...@pie-element/hotspot-configure@5.9.0) (2023-05-23)
7
25
 
8
26
 
@@ -75,6 +75,10 @@ var _default = {
75
75
  withRubric: {
76
76
  settings: false,
77
77
  label: 'Add Rubric'
78
+ },
79
+ mathMlOptions: {
80
+ mmlOutput: false,
81
+ mmlEditing: false
78
82
  }
79
83
  }
80
84
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/defaults.js"],"names":["model","prompt","toolbarEditorPosition","imageUrl","shapes","rectangles","polygons","multipleCorrect","partialScoring","dimensions","height","width","hotspotColor","hotspotList","outlineColor","outlineList","promptEnabled","rationaleEnabled","teacherInstructionsEnabled","studentInstructionsEnabled","strokeWidth","configuration","settings","label","rationale","settingsPanelDisabled","spellCheck","enabled","teacherInstructions","preserveAspectRatio","minShapes","maxImageWidth","maxImageHeight","withRubric"],"mappings":";;;;;;eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,MAAM,EAAE,EADH;AAELC,IAAAA,qBAAqB,EAAE,QAFlB;AAGLC,IAAAA,QAAQ,EAAE,EAHL;AAILC,IAAAA,MAAM,EAAE;AACNC,MAAAA,UAAU,EAAE,EADN;AAENC,MAAAA,QAAQ,EAAE;AAFJ,KAJH;AAQLC,IAAAA,eAAe,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BK,MAAAA,OAAO,EAAE,IAFU;AAGnBJ,MAAAA,KAAK,EAAE;AAHY,KA3BR;AAgCbO,IAAAA,SAAS,EAAE,CAhCE;AAiCbC,IAAAA,aAAa,EAAE;AACbH,MAAAA,mBAAmB,EAAE,GADR;AAEb3B,MAAAA,MAAM,EAAE,GAFK;AAGbuB,MAAAA,SAAS,EAAE;AAHE,KAjCF;AAsCbQ,IAAAA,cAAc,EAAE;AACdJ,MAAAA,mBAAmB,EAAE,GADP;AAEd3B,MAAAA,MAAM,EAAE,GAFM;AAGduB,MAAAA,SAAS,EAAE;AAHG,KAtCH;AA2CbS,IAAAA,UAAU,EAAE;AACVX,MAAAA,QAAQ,EAAE,KADA;AAEVC,MAAAA,KAAK,EAAE;AAFG;AA3CC;AAzBF,C","sourcesContent":["export default {\n model: {\n prompt: '',\n toolbarEditorPosition: 'bottom',\n imageUrl: '',\n shapes: {\n rectangles: [],\n polygons: [],\n },\n multipleCorrect: true,\n partialScoring: false,\n dimensions: {\n height: 0,\n width: 0,\n },\n hotspotColor: 'rgba(137, 183, 244, 0.25)',\n hotspotList: ['rgba(137, 183, 244, 0.25)'],\n outlineColor: 'blue',\n outlineList: ['blue'],\n promptEnabled: true,\n rationaleEnabled: true,\n teacherInstructionsEnabled: true,\n studentInstructionsEnabled: true,\n strokeWidth: 5,\n },\n configuration: {\n multipleCorrect: {\n settings: true,\n label: 'Multiple Correct Responses',\n },\n partialScoring: {\n settings: false,\n label: 'Allow Partial Scoring',\n },\n rationale: {\n settings: true,\n label: 'Rationale',\n },\n prompt: {\n settings: true,\n label: 'Prompt',\n },\n settingsPanelDisabled: false,\n spellCheck: {\n label: 'Spellcheck',\n settings: false,\n enabled: true,\n },\n teacherInstructions: {\n settings: true,\n label: 'Teacher Instructions',\n },\n preserveAspectRatio: {\n settings: false,\n enabled: true,\n label: 'Preserve aspect ratio',\n },\n minShapes: 2,\n maxImageWidth: {\n teacherInstructions: 300,\n prompt: 300,\n rationale: 300,\n },\n maxImageHeight: {\n teacherInstructions: 300,\n prompt: 300,\n rationale: 300,\n },\n withRubric: {\n settings: false,\n label: 'Add Rubric',\n },\n },\n};\n"],"file":"defaults.js"}
1
+ {"version":3,"sources":["../src/defaults.js"],"names":["model","prompt","toolbarEditorPosition","imageUrl","shapes","rectangles","polygons","multipleCorrect","partialScoring","dimensions","height","width","hotspotColor","hotspotList","outlineColor","outlineList","promptEnabled","rationaleEnabled","teacherInstructionsEnabled","studentInstructionsEnabled","strokeWidth","configuration","settings","label","rationale","settingsPanelDisabled","spellCheck","enabled","teacherInstructions","preserveAspectRatio","minShapes","maxImageWidth","maxImageHeight","withRubric","mathMlOptions","mmlOutput","mmlEditing"],"mappings":";;;;;;eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,MAAM,EAAE,EADH;AAELC,IAAAA,qBAAqB,EAAE,QAFlB;AAGLC,IAAAA,QAAQ,EAAE,EAHL;AAILC,IAAAA,MAAM,EAAE;AACNC,MAAAA,UAAU,EAAE,EADN;AAENC,MAAAA,QAAQ,EAAE;AAFJ,KAJH;AAQLC,IAAAA,eAAe,EAAE,IARZ;AASLC,IAAAA,cAAc,EAAE,KATX;AAULC,IAAAA,UAAU,EAAE;AACVC,MAAAA,MAAM,EAAE,CADE;AAEVC,MAAAA,KAAK,EAAE;AAFG,KAVP;AAcLC,IAAAA,YAAY,EAAE,2BAdT;AAeLC,IAAAA,WAAW,EAAE,CAAC,2BAAD,CAfR;AAgBLC,IAAAA,YAAY,EAAE,MAhBT;AAiBLC,IAAAA,WAAW,EAAE,CAAC,MAAD,CAjBR;AAkBLC,IAAAA,aAAa,EAAE,IAlBV;AAmBLC,IAAAA,gBAAgB,EAAE,IAnBb;AAoBLC,IAAAA,0BAA0B,EAAE,IApBvB;AAqBLC,IAAAA,0BAA0B,EAAE,IArBvB;AAsBLC,IAAAA,WAAW,EAAE;AAtBR,GADM;AAyBbC,EAAAA,aAAa,EAAE;AACbd,IAAAA,eAAe,EAAE;AACfe,MAAAA,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AU,EAAE;AAFC;AA/CF;AAzBF,C","sourcesContent":["export default {\n model: {\n prompt: '',\n toolbarEditorPosition: 'bottom',\n imageUrl: '',\n shapes: {\n rectangles: [],\n polygons: [],\n },\n multipleCorrect: true,\n partialScoring: false,\n dimensions: {\n height: 0,\n width: 0,\n },\n hotspotColor: 'rgba(137, 183, 244, 0.25)',\n hotspotList: ['rgba(137, 183, 244, 0.25)'],\n outlineColor: 'blue',\n outlineList: ['blue'],\n promptEnabled: true,\n rationaleEnabled: true,\n teacherInstructionsEnabled: true,\n studentInstructionsEnabled: true,\n strokeWidth: 5,\n },\n configuration: {\n multipleCorrect: {\n settings: true,\n label: 'Multiple Correct Responses',\n },\n partialScoring: {\n settings: false,\n label: 'Allow Partial Scoring',\n },\n rationale: {\n settings: true,\n label: 'Rationale',\n },\n prompt: {\n settings: true,\n label: 'Prompt',\n },\n settingsPanelDisabled: false,\n spellCheck: {\n label: 'Spellcheck',\n settings: false,\n enabled: true,\n },\n teacherInstructions: {\n settings: true,\n label: 'Teacher Instructions',\n },\n preserveAspectRatio: {\n settings: false,\n enabled: true,\n label: 'Preserve aspect ratio',\n },\n minShapes: 2,\n maxImageWidth: {\n teacherInstructions: 300,\n prompt: 300,\n rationale: 300,\n },\n maxImageHeight: {\n teacherInstructions: 300,\n prompt: 300,\n rationale: 300,\n },\n withRubric: {\n settings: false,\n label: 'Add Rubric',\n },\n mathMlOptions: {\n mmlOutput: false,\n mmlEditing: false,\n },\n },\n};\n"],"file":"defaults.js"}
@@ -142,7 +142,9 @@ var Root = /*#__PURE__*/function (_React$Component) {
142
142
  _ref$teacherInstructi = _ref.teacherInstructions,
143
143
  teacherInstructions = _ref$teacherInstructi === void 0 ? {} : _ref$teacherInstructi,
144
144
  _ref$withRubric = _ref.withRubric,
145
- withRubric = _ref$withRubric === void 0 ? {} : _ref$withRubric;
145
+ withRubric = _ref$withRubric === void 0 ? {} : _ref$withRubric,
146
+ _ref$mathMlOptions = _ref.mathMlOptions,
147
+ mathMlOptions = _ref$mathMlOptions === void 0 ? {} : _ref$mathMlOptions;
146
148
 
147
149
  var _ref2 = model || {},
148
150
  errors = _ref2.errors,
@@ -203,7 +205,8 @@ var Root = /*#__PURE__*/function (_React$Component) {
203
205
  language: 'spanish'
204
206
  }, {
205
207
  language: 'special'
206
- }]
208
+ }],
209
+ mathMlOptions: mathMlOptions
207
210
  })), promptEnabled && /*#__PURE__*/_react["default"].createElement(_configUi.InputContainer, {
208
211
  label: prompt.label,
209
212
  className: classes.promptContainer
@@ -221,7 +224,8 @@ var Root = /*#__PURE__*/function (_React$Component) {
221
224
  language: 'spanish'
222
225
  }, {
223
226
  language: 'special'
224
- }]
227
+ }],
228
+ mathMlOptions: mathMlOptions
225
229
  })), /*#__PURE__*/_react["default"].createElement("div", {
226
230
  className: classes.flexContainer
227
231
  }, /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
@@ -310,7 +314,8 @@ var Root = /*#__PURE__*/function (_React$Component) {
310
314
  language: 'spanish'
311
315
  }, {
312
316
  language: 'special'
313
- }]
317
+ }],
318
+ mathMlOptions: mathMlOptions
314
319
  })));
315
320
  }
316
321
  }]);
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/root.jsx"],"names":["Panel","settings","toggle","Root","fieldType","color","onColorChanged","props","cType","value","resizeType","model","dimensions","shapes","configuration","preserveAspectRatio","onUpdateImageDimension","onUpdateShapes","nextImageDimensions","updatedDimensions","enabled","shapesArray","updatedShapes","classes","imageSupport","uploadSoundSupport","onConfigurationChanged","onImageUpload","onModelChangedByConfig","onPromptChanged","onRationaleChanged","onTeacherInstructionsChanged","contentDimensions","maxImageWidth","maxImageHeight","multipleCorrect","partialScoring","prompt","rationale","settingsPanelDisabled","spellCheck","teacherInstructions","withRubric","errors","promptEnabled","rationaleEnabled","spellCheckEnabled","teacherInstructionsEnabled","toolbarEditorPosition","shapesError","selectionsError","validationMessage","defaultImageMaxWidth","defaultImageMaxHeight","toolbarOpts","position","panelSettings","label","panelProperties","rubricEnabled","Settings","Properties","promptContainer","language","flexContainer","subheading","tooltip","hotspotColor","hotspotList","outlineColor","outlineList","handleColorChange","imageUrl","strokeWidth","add","errorText","width","e","handleOnUpdateImageDimensions","field","height","React","Component","styles","theme","display","marginBottom","spacing","unit","flex","paddingTop","marginRight","alignItems","fontSize","typography","whiteSpace","maxWidth","palette","error","main","propTypes","PropTypes","object","isRequired","shape","func"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,IAAQA,KAAR,GAA0BC,kBAA1B,CAAQD,KAAR;AAAA,IAAeE,MAAf,GAA0BD,kBAA1B,CAAeC,MAAf;;IAEaC,I;;;;;;;;;;;;;;;0GACS,UAACC,SAAD,EAAYC,KAAZ,EAAsB;AACxC,UAAQC,cAAR,GAA2B,MAAKC,KAAhC,CAAQD,cAAR;AACA,UAAME,KAAK,aAAMJ,SAAN,UAAX;AAEAE,MAAAA,cAAc,CAACE,KAAD,EAAQH,KAAR,CAAd;AACD,K;sHAE+B,UAACI,KAAD,EAAQC,UAAR,EAAuB;AACrD,wBAKI,MAAKH,KALT;AAAA,0CACEI,KADF;AAAA,UACWC,UADX,qBACWA,UADX;AAAA,UACuBC,MADvB,qBACuBA,MADvB;AAAA,8CAEEC,aAFF,CAEmBC,mBAFnB;AAAA,UAEmBA,mBAFnB,sCAEyC,EAFzC;AAAA,UAGEC,sBAHF,eAGEA,sBAHF;AAAA,UAIEC,cAJF,eAIEA,cAJF;;AAOA,UAAMC,mBAAmB,mCAAQN,UAAR,4CAAqBF,UAArB,EAAkCD,KAAlC,EAAzB,CARqD,CAUrD;;;AACA,UAAMU,iBAAiB,GAAG,kCACxBP,UADwB,EAExBM,mBAFwB,EAGxBH,mBAAmB,CAACK,OAHI,EAIxBV,UAJwB,CAA1B,CAXqD,CAiBrD;;AACA,UAAMW,WAAW,GAAG,yBAAaR,MAAb,CAApB,CAlBqD,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,EAAEoF,sBAAUI,IAAV,CAAeF,UAhBhB;AAiBf3E,EAAAA,sBAAsB,EAAEyE,sBAAUI,IAAV,CAAeF,UAjBxB;AAkBfzE,EAAAA,kBAAkB,EAAEuE,sBAAUI,IAAV,CAAeF,UAlBpB;AAmBf7E,EAAAA,sBAAsB,EAAE2E,sBAAUI,IAAV,CAAeF,UAnBxB;AAoBfxE,EAAAA,4BAA4B,EAAEsE,sBAAUI,IAAV,CAAeF;AApB9B,CAAjB;;eAuBe,wBAAWpB,MAAX,EAAmBhF,IAAnB,C","sourcesContent":["import React from 'react';\nimport { settings, layout, InputContainer, NumberTextField } from '@pie-lib/config-ui';\nimport PropTypes from 'prop-types';\nimport EditableHtml from '@pie-lib/editable-html';\nimport { withStyles } from '@material-ui/core/styles';\nimport Typography from '@material-ui/core/Typography';\nimport Info from '@material-ui/icons/Info';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport HotspotPalette from './hotspot-palette';\nimport HotspotContainer from './hotspot-container';\nimport { updateImageDimensions, generateValidationMessage, getUpdatedShapes, getAllShapes, groupShapes } from './utils';\n\nconst { Panel, toggle } = settings;\n\nexport class Root extends React.Component {\n handleColorChange = (fieldType, color) => {\n const { onColorChanged } = this.props;\n const cType = `${fieldType}Color`;\n\n onColorChanged(cType, color);\n };\n\n handleOnUpdateImageDimensions = (value, resizeType) => {\n const {\n model: { dimensions, shapes },\n configuration: { preserveAspectRatio = {} },\n onUpdateImageDimension,\n onUpdateShapes,\n } = this.props;\n\n const nextImageDimensions = { ...dimensions, [resizeType]: value };\n\n // if preserveAspectRatio.enabled, updateImageDimensions function makes sure aspect ratio is kept\n const updatedDimensions = updateImageDimensions(\n dimensions,\n nextImageDimensions,\n preserveAspectRatio.enabled,\n resizeType,\n );\n // transform shapes map into shapes array\n const shapesArray = getAllShapes(shapes);\n // transform all the shapes to fit the re-sized image\n const updatedShapes = getUpdatedShapes(dimensions, updatedDimensions, shapesArray);\n // transform shapes array back into shapes map\n\n onUpdateShapes(groupShapes(updatedShapes));\n onUpdateImageDimension(updatedDimensions);\n };\n\n render() {\n const {\n classes,\n configuration,\n model,\n imageSupport,\n uploadSoundSupport,\n onConfigurationChanged,\n onImageUpload,\n onModelChangedByConfig,\n onPromptChanged,\n onRationaleChanged,\n onUpdateImageDimension,\n onTeacherInstructionsChanged,\n onUpdateShapes,\n } = this.props;\n const {\n contentDimensions = {},\n maxImageWidth = {},\n maxImageHeight = {},\n multipleCorrect = {},\n partialScoring = {},\n preserveAspectRatio = {},\n prompt = {},\n rationale = {},\n settingsPanelDisabled,\n spellCheck = {},\n teacherInstructions = {},\n withRubric = {},\n } = configuration || {};\n const {\n errors,\n promptEnabled,\n rationaleEnabled,\n spellCheckEnabled,\n teacherInstructionsEnabled,\n toolbarEditorPosition,\n } = model || {};\n const { shapesError, selectionsError } = errors || {};\n const validationMessage = generateValidationMessage(configuration);\n\n const defaultImageMaxWidth = maxImageWidth && maxImageWidth.prompt;\n const defaultImageMaxHeight = maxImageHeight && maxImageHeight.prompt;\n\n const toolbarOpts = {\n position: toolbarEditorPosition === 'top' ? 'top' : 'bottom',\n };\n\n const panelSettings = {\n multipleCorrect: multipleCorrect.settings && toggle(multipleCorrect.label),\n partialScoring: partialScoring.settings && toggle(partialScoring.label),\n promptEnabled: prompt.settings && toggle(prompt.label),\n };\n const panelProperties = {\n teacherInstructionsEnabled: teacherInstructions.settings && toggle(teacherInstructions.label),\n rationaleEnabled: rationale.settings && toggle(rationale.label),\n spellCheckEnabled: spellCheck.settings && toggle(spellCheck.label),\n rubricEnabled: withRubric?.settings && toggle(withRubric?.label),\n };\n\n return (\n <layout.ConfigLayout\n dimensions={contentDimensions}\n hideSettings={settingsPanelDisabled}\n settings={\n <Panel\n model={model}\n onChangeModel={onModelChangedByConfig}\n configuration={configuration}\n onChangeConfiguration={onConfigurationChanged}\n groups={{\n Settings: panelSettings,\n Properties: panelProperties,\n }}\n />\n }\n >\n {teacherInstructionsEnabled && (\n <InputContainer label={teacherInstructions.label} className={classes.promptContainer}>\n <EditableHtml\n markup={model.teacherInstructions || ''}\n onChange={onTeacherInstructionsChanged}\n imageSupport={imageSupport}\n nonEmpty={false}\n toolbarOpts={toolbarOpts}\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 />\n </InputContainer>\n )}\n\n {promptEnabled && (\n <InputContainer label={prompt.label} className={classes.promptContainer}>\n <EditableHtml\n markup={model.prompt || ''}\n onChange={onPromptChanged}\n imageSupport={imageSupport}\n nonEmpty={false}\n toolbarOpts={toolbarOpts}\n spellCheck={spellCheckEnabled}\n maxImageWidth={defaultImageMaxWidth}\n maxImageHeight={defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n />\n </InputContainer>\n )}\n\n <div className={classes.flexContainer}>\n <Typography className={classes.subheading} variant=\"subheading\">\n Define Hotspot\n </Typography>\n <Tooltip\n classes={{ tooltip: classes.tooltip }}\n disableFocusListener\n disableTouchListener\n placement={'left'}\n title={validationMessage}\n >\n <Info fontSize={'small'} color={'primary'} style={{ float: 'right' }} />\n </Tooltip>\n </div>\n\n <HotspotPalette\n hotspotColor={model.hotspotColor}\n hotspotList={model.hotspotList}\n outlineColor={model.outlineColor}\n outlineList={model.outlineList}\n onHotspotColorChange={(color) => this.handleColorChange('hotspot', color)}\n onOutlineColorChange={(color) => this.handleColorChange('outline', color)}\n />\n\n <HotspotContainer\n dimensions={model.dimensions}\n imageUrl={model.imageUrl}\n multipleCorrect={model.multipleCorrect}\n hasErrors={!!shapesError || !!selectionsError}\n hotspotColor={model.hotspotColor}\n outlineColor={model.outlineColor}\n onUpdateImageDimension={onUpdateImageDimension}\n onUpdateShapes={onUpdateShapes}\n onImageUpload={onImageUpload}\n shapes={model.shapes}\n strokeWidth={model.strokeWidth}\n preserveAspectRatioEnabled={preserveAspectRatio.enabled}\n insertImage={imageSupport && imageSupport.add}\n />\n {shapesError && <div className={classes.errorText}>{shapesError}</div>}\n {selectionsError && <div className={classes.errorText}>{selectionsError}</div>}\n\n {model.imageUrl && (\n <React.Fragment>\n <Typography variant=\"subheading\">Image Dimensions</Typography>\n\n <div className={classes.dimensions}>\n <NumberTextField\n key=\"hotspot-manual-width\"\n label=\"Width\"\n value={model.dimensions.width}\n min={0}\n onChange={(e, value) => this.handleOnUpdateImageDimensions(value, 'width')}\n showErrorWhenOutsideRange\n className={classes.field}\n />\n\n <NumberTextField\n key=\"hotspot-manual-height\"\n label=\"Height\"\n value={model.dimensions.height}\n min={0}\n onChange={(e, value) => this.handleOnUpdateImageDimensions(value, 'height')}\n showErrorWhenOutsideRange\n className={classes.field}\n />\n </div>\n </React.Fragment>\n )}\n\n {rationaleEnabled && (\n <InputContainer label={rationale.label} className={classes.promptContainer}>\n <EditableHtml\n markup={model.rationale || ''}\n onChange={onRationaleChanged}\n imageSupport={imageSupport}\n toolbarOpts={toolbarOpts}\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 />\n </InputContainer>\n )}\n </layout.ConfigLayout>\n );\n }\n}\n\nconst styles = (theme) => ({\n dimensions: {\n display: 'flex',\n marginBottom: theme.spacing.unit * 1.5,\n },\n field: {\n flex: 1,\n width: '90%',\n },\n promptContainer: {\n paddingTop: theme.spacing.unit * 2,\n marginBottom: theme.spacing.unit * 2,\n width: '100%',\n },\n subheading: {\n marginRight: theme.spacing.unit,\n },\n flexContainer: {\n display: 'flex',\n alignItems: 'center',\n },\n tooltip: {\n fontSize: theme.typography.fontSize - 2,\n whiteSpace: 'pre',\n maxWidth: '500px',\n },\n errorText: {\n fontSize: theme.typography.fontSize - 2,\n color: theme.palette.error.main,\n paddingTop: theme.spacing.unit,\n },\n});\n\nRoot.propTypes = {\n classes: PropTypes.object.isRequired,\n configuration: PropTypes.object,\n model: PropTypes.object.isRequired,\n imageSupport: PropTypes.shape({\n add: PropTypes.func,\n delete: PropTypes.func,\n }),\n uploadSoundSupport: PropTypes.shape({\n add: PropTypes.func,\n delete: PropTypes.func,\n }),\n onImageUpload: PropTypes.func.isRequired,\n onColorChanged: PropTypes.func.isRequired,\n onPromptChanged: PropTypes.func.isRequired,\n onUpdateImageDimension: PropTypes.func.isRequired,\n onUpdateShapes: PropTypes.func.isRequired,\n onModelChangedByConfig: PropTypes.func.isRequired,\n onRationaleChanged: PropTypes.func.isRequired,\n onConfigurationChanged: PropTypes.func.isRequired,\n onTeacherInstructionsChanged: PropTypes.func.isRequired,\n};\n\nexport default withStyles(styles)(Root);\n"],"file":"root.js"}
1
+ {"version":3,"sources":["../src/root.jsx"],"names":["Panel","settings","toggle","Root","fieldType","color","onColorChanged","props","cType","value","resizeType","model","dimensions","shapes","configuration","preserveAspectRatio","onUpdateImageDimension","onUpdateShapes","nextImageDimensions","updatedDimensions","enabled","shapesArray","updatedShapes","classes","imageSupport","uploadSoundSupport","onConfigurationChanged","onImageUpload","onModelChangedByConfig","onPromptChanged","onRationaleChanged","onTeacherInstructionsChanged","contentDimensions","maxImageWidth","maxImageHeight","multipleCorrect","partialScoring","prompt","rationale","settingsPanelDisabled","spellCheck","teacherInstructions","withRubric","mathMlOptions","errors","promptEnabled","rationaleEnabled","spellCheckEnabled","teacherInstructionsEnabled","toolbarEditorPosition","shapesError","selectionsError","validationMessage","defaultImageMaxWidth","defaultImageMaxHeight","toolbarOpts","position","panelSettings","label","panelProperties","rubricEnabled","Settings","Properties","promptContainer","language","flexContainer","subheading","tooltip","hotspotColor","hotspotList","outlineColor","outlineList","handleColorChange","imageUrl","strokeWidth","add","errorText","width","e","handleOnUpdateImageDimensions","field","height","React","Component","styles","theme","display","marginBottom","spacing","unit","flex","paddingTop","marginRight","alignItems","fontSize","typography","whiteSpace","maxWidth","palette","error","main","propTypes","PropTypes","object","isRequired","shape","func"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,IAAQA,KAAR,GAA0BC,kBAA1B,CAAQD,KAAR;AAAA,IAAeE,MAAf,GAA0BD,kBAA1B,CAAeC,MAAf;;IAEaC,I;;;;;;;;;;;;;;;0GACS,UAACC,SAAD,EAAYC,KAAZ,EAAsB;AACxC,UAAQC,cAAR,GAA2B,MAAKC,KAAhC,CAAQD,cAAR;AACA,UAAME,KAAK,aAAMJ,SAAN,UAAX;AAEAE,MAAAA,cAAc,CAACE,KAAD,EAAQH,KAAR,CAAd;AACD,K;sHAE+B,UAACI,KAAD,EAAQC,UAAR,EAAuB;AACrD,wBAKI,MAAKH,KALT;AAAA,0CACEI,KADF;AAAA,UACWC,UADX,qBACWA,UADX;AAAA,UACuBC,MADvB,qBACuBA,MADvB;AAAA,8CAEEC,aAFF,CAEmBC,mBAFnB;AAAA,UAEmBA,mBAFnB,sCAEyC,EAFzC;AAAA,UAGEC,sBAHF,eAGEA,sBAHF;AAAA,UAIEC,cAJF,eAIEA,cAJF;;AAOA,UAAMC,mBAAmB,mCAAQN,UAAR,4CAAqBF,UAArB,EAAkCD,KAAlC,EAAzB,CARqD,CAUrD;;;AACA,UAAMU,iBAAiB,GAAG,kCACxBP,UADwB,EAExBM,mBAFwB,EAGxBH,mBAAmB,CAACK,OAHI,EAIxBV,UAJwB,CAA1B,CAXqD,CAiBrD;;AACA,UAAMW,WAAW,GAAG,yBAAaR,MAAb,CAApB,CAlBqD,CAmBrD;;AACA,UAAMS,aAAa,GAAG,6BAAiBV,UAAjB,EAA6BO,iBAA7B,EAAgDE,WAAhD,CA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AAAA,sBAAsB,EAAEsF,sBAAUI,IAAV,CAAeF,UAfxB;AAgBfvF,EAAAA,cAAc,EAAEqF,sBAAUI,IAAV,CAAeF,UAhBhB;AAiBf5E,EAAAA,sBAAsB,EAAE0E,sBAAUI,IAAV,CAAeF,UAjBxB;AAkBf1E,EAAAA,kBAAkB,EAAEwE,sBAAUI,IAAV,CAAeF,UAlBpB;AAmBf9E,EAAAA,sBAAsB,EAAE4E,sBAAUI,IAAV,CAAeF,UAnBxB;AAoBfzE,EAAAA,4BAA4B,EAAEuE,sBAAUI,IAAV,CAAeF;AApB9B,CAAjB;;eAuBe,wBAAWpB,MAAX,EAAmBjF,IAAnB,C","sourcesContent":["import React from 'react';\nimport { settings, layout, InputContainer, NumberTextField } from '@pie-lib/config-ui';\nimport PropTypes from 'prop-types';\nimport EditableHtml from '@pie-lib/editable-html';\nimport { withStyles } from '@material-ui/core/styles';\nimport Typography from '@material-ui/core/Typography';\nimport Info from '@material-ui/icons/Info';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport HotspotPalette from './hotspot-palette';\nimport HotspotContainer from './hotspot-container';\nimport { updateImageDimensions, generateValidationMessage, getUpdatedShapes, getAllShapes, groupShapes } from './utils';\n\nconst { Panel, toggle } = settings;\n\nexport class Root extends React.Component {\n handleColorChange = (fieldType, color) => {\n const { onColorChanged } = this.props;\n const cType = `${fieldType}Color`;\n\n onColorChanged(cType, color);\n };\n\n handleOnUpdateImageDimensions = (value, resizeType) => {\n const {\n model: { dimensions, shapes },\n configuration: { preserveAspectRatio = {} },\n onUpdateImageDimension,\n onUpdateShapes,\n } = this.props;\n\n const nextImageDimensions = { ...dimensions, [resizeType]: value };\n\n // if preserveAspectRatio.enabled, updateImageDimensions function makes sure aspect ratio is kept\n const updatedDimensions = updateImageDimensions(\n dimensions,\n nextImageDimensions,\n preserveAspectRatio.enabled,\n resizeType,\n );\n // transform shapes map into shapes array\n const shapesArray = getAllShapes(shapes);\n // transform all the shapes to fit the re-sized image\n const updatedShapes = getUpdatedShapes(dimensions, updatedDimensions, shapesArray);\n // transform shapes array back into shapes map\n\n onUpdateShapes(groupShapes(updatedShapes));\n onUpdateImageDimension(updatedDimensions);\n };\n\n render() {\n const {\n classes,\n configuration,\n model,\n imageSupport,\n uploadSoundSupport,\n onConfigurationChanged,\n onImageUpload,\n onModelChangedByConfig,\n onPromptChanged,\n onRationaleChanged,\n onUpdateImageDimension,\n onTeacherInstructionsChanged,\n onUpdateShapes,\n } = this.props;\n const {\n contentDimensions = {},\n maxImageWidth = {},\n maxImageHeight = {},\n multipleCorrect = {},\n partialScoring = {},\n preserveAspectRatio = {},\n prompt = {},\n rationale = {},\n settingsPanelDisabled,\n spellCheck = {},\n teacherInstructions = {},\n withRubric = {},\n mathMlOptions = {},\n } = configuration || {};\n const {\n errors,\n promptEnabled,\n rationaleEnabled,\n spellCheckEnabled,\n teacherInstructionsEnabled,\n toolbarEditorPosition,\n } = model || {};\n const { shapesError, selectionsError } = errors || {};\n const validationMessage = generateValidationMessage(configuration);\n\n const defaultImageMaxWidth = maxImageWidth && maxImageWidth.prompt;\n const defaultImageMaxHeight = maxImageHeight && maxImageHeight.prompt;\n\n const toolbarOpts = {\n position: toolbarEditorPosition === 'top' ? 'top' : 'bottom',\n };\n\n const panelSettings = {\n multipleCorrect: multipleCorrect.settings && toggle(multipleCorrect.label),\n partialScoring: partialScoring.settings && toggle(partialScoring.label),\n promptEnabled: prompt.settings && toggle(prompt.label),\n };\n const panelProperties = {\n teacherInstructionsEnabled: teacherInstructions.settings && toggle(teacherInstructions.label),\n rationaleEnabled: rationale.settings && toggle(rationale.label),\n spellCheckEnabled: spellCheck.settings && toggle(spellCheck.label),\n rubricEnabled: withRubric?.settings && toggle(withRubric?.label),\n };\n\n return (\n <layout.ConfigLayout\n dimensions={contentDimensions}\n hideSettings={settingsPanelDisabled}\n settings={\n <Panel\n model={model}\n onChangeModel={onModelChangedByConfig}\n configuration={configuration}\n onChangeConfiguration={onConfigurationChanged}\n groups={{\n Settings: panelSettings,\n Properties: panelProperties,\n }}\n />\n }\n >\n {teacherInstructionsEnabled && (\n <InputContainer label={teacherInstructions.label} className={classes.promptContainer}>\n <EditableHtml\n markup={model.teacherInstructions || ''}\n onChange={onTeacherInstructionsChanged}\n imageSupport={imageSupport}\n nonEmpty={false}\n toolbarOpts={toolbarOpts}\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 </InputContainer>\n )}\n\n {promptEnabled && (\n <InputContainer label={prompt.label} className={classes.promptContainer}>\n <EditableHtml\n markup={model.prompt || ''}\n onChange={onPromptChanged}\n imageSupport={imageSupport}\n nonEmpty={false}\n toolbarOpts={toolbarOpts}\n spellCheck={spellCheckEnabled}\n maxImageWidth={defaultImageMaxWidth}\n maxImageHeight={defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n mathMlOptions={mathMlOptions}\n />\n </InputContainer>\n )}\n\n <div className={classes.flexContainer}>\n <Typography className={classes.subheading} variant=\"subheading\">\n Define Hotspot\n </Typography>\n <Tooltip\n classes={{ tooltip: classes.tooltip }}\n disableFocusListener\n disableTouchListener\n placement={'left'}\n title={validationMessage}\n >\n <Info fontSize={'small'} color={'primary'} style={{ float: 'right' }} />\n </Tooltip>\n </div>\n\n <HotspotPalette\n hotspotColor={model.hotspotColor}\n hotspotList={model.hotspotList}\n outlineColor={model.outlineColor}\n outlineList={model.outlineList}\n onHotspotColorChange={(color) => this.handleColorChange('hotspot', color)}\n onOutlineColorChange={(color) => this.handleColorChange('outline', color)}\n />\n\n <HotspotContainer\n dimensions={model.dimensions}\n imageUrl={model.imageUrl}\n multipleCorrect={model.multipleCorrect}\n hasErrors={!!shapesError || !!selectionsError}\n hotspotColor={model.hotspotColor}\n outlineColor={model.outlineColor}\n onUpdateImageDimension={onUpdateImageDimension}\n onUpdateShapes={onUpdateShapes}\n onImageUpload={onImageUpload}\n shapes={model.shapes}\n strokeWidth={model.strokeWidth}\n preserveAspectRatioEnabled={preserveAspectRatio.enabled}\n insertImage={imageSupport && imageSupport.add}\n />\n {shapesError && <div className={classes.errorText}>{shapesError}</div>}\n {selectionsError && <div className={classes.errorText}>{selectionsError}</div>}\n\n {model.imageUrl && (\n <React.Fragment>\n <Typography variant=\"subheading\">Image Dimensions</Typography>\n\n <div className={classes.dimensions}>\n <NumberTextField\n key=\"hotspot-manual-width\"\n label=\"Width\"\n value={model.dimensions.width}\n min={0}\n onChange={(e, value) => this.handleOnUpdateImageDimensions(value, 'width')}\n showErrorWhenOutsideRange\n className={classes.field}\n />\n\n <NumberTextField\n key=\"hotspot-manual-height\"\n label=\"Height\"\n value={model.dimensions.height}\n min={0}\n onChange={(e, value) => this.handleOnUpdateImageDimensions(value, 'height')}\n showErrorWhenOutsideRange\n className={classes.field}\n />\n </div>\n </React.Fragment>\n )}\n\n {rationaleEnabled && (\n <InputContainer label={rationale.label} className={classes.promptContainer}>\n <EditableHtml\n markup={model.rationale || ''}\n onChange={onRationaleChanged}\n imageSupport={imageSupport}\n toolbarOpts={toolbarOpts}\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 </InputContainer>\n )}\n </layout.ConfigLayout>\n );\n }\n}\n\nconst styles = (theme) => ({\n dimensions: {\n display: 'flex',\n marginBottom: theme.spacing.unit * 1.5,\n },\n field: {\n flex: 1,\n width: '90%',\n },\n promptContainer: {\n paddingTop: theme.spacing.unit * 2,\n marginBottom: theme.spacing.unit * 2,\n width: '100%',\n },\n subheading: {\n marginRight: theme.spacing.unit,\n },\n flexContainer: {\n display: 'flex',\n alignItems: 'center',\n },\n tooltip: {\n fontSize: theme.typography.fontSize - 2,\n whiteSpace: 'pre',\n maxWidth: '500px',\n },\n errorText: {\n fontSize: theme.typography.fontSize - 2,\n color: theme.palette.error.main,\n paddingTop: theme.spacing.unit,\n },\n});\n\nRoot.propTypes = {\n classes: PropTypes.object.isRequired,\n configuration: PropTypes.object,\n model: PropTypes.object.isRequired,\n imageSupport: PropTypes.shape({\n add: PropTypes.func,\n delete: PropTypes.func,\n }),\n uploadSoundSupport: PropTypes.shape({\n add: PropTypes.func,\n delete: PropTypes.func,\n }),\n onImageUpload: PropTypes.func.isRequired,\n onColorChanged: PropTypes.func.isRequired,\n onPromptChanged: PropTypes.func.isRequired,\n onUpdateImageDimension: PropTypes.func.isRequired,\n onUpdateShapes: PropTypes.func.isRequired,\n onModelChangedByConfig: PropTypes.func.isRequired,\n onRationaleChanged: PropTypes.func.isRequired,\n onConfigurationChanged: PropTypes.func.isRequired,\n onTeacherInstructionsChanged: PropTypes.func.isRequired,\n};\n\nexport default withStyles(styles)(Root);\n"],"file":"root.js"}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pie-element/hotspot-configure",
3
3
  "private": true,
4
- "version": "5.9.0",
4
+ "version": "5.10.0",
5
5
  "description": "",
6
6
  "main": "lib/index.js",
7
7
  "module": "src/index.js",
@@ -10,8 +10,8 @@
10
10
  "@material-ui/core": "^3.9.2",
11
11
  "@material-ui/icons": "^3.0.2",
12
12
  "@pie-framework/pie-configure-events": "^1.3.0",
13
- "@pie-lib/config-ui": "^11.6.10",
14
- "@pie-lib/editable-html": "^9.6.2",
13
+ "@pie-lib/config-ui": "^11.8.1",
14
+ "@pie-lib/editable-html": "^9.6.5",
15
15
  "classnames": "^2.2.6",
16
16
  "debug": "^3.1.0",
17
17
  "konva": "^3.2.4",
@@ -8,6 +8,10 @@ exports[`Root render renders 1`] = `
8
8
  <Panel
9
9
  configuration={
10
10
  Object {
11
+ "mathMlOptions": Object {
12
+ "mmlEditing": false,
13
+ "mmlOutput": false,
14
+ },
11
15
  "maxImageHeight": Object {
12
16
  "prompt": 300,
13
17
  "rationale": 300,
@@ -70,5 +70,9 @@ export default {
70
70
  settings: false,
71
71
  label: 'Add Rubric',
72
72
  },
73
+ mathMlOptions: {
74
+ mmlOutput: false,
75
+ mmlEditing: false,
76
+ },
73
77
  },
74
78
  };
@@ -76,6 +76,7 @@ export class Root extends React.Component {
76
76
  spellCheck = {},
77
77
  teacherInstructions = {},
78
78
  withRubric = {},
79
+ mathMlOptions = {},
79
80
  } = configuration || {};
80
81
  const {
81
82
  errors,
@@ -137,6 +138,7 @@ export class Root extends React.Component {
137
138
  maxImageHeight={(maxImageHeight && maxImageHeight.teacherInstructions) || defaultImageMaxHeight}
138
139
  uploadSoundSupport={uploadSoundSupport}
139
140
  languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}
141
+ mathMlOptions={mathMlOptions}
140
142
  />
141
143
  </InputContainer>
142
144
  )}
@@ -154,6 +156,7 @@ export class Root extends React.Component {
154
156
  maxImageHeight={defaultImageMaxHeight}
155
157
  uploadSoundSupport={uploadSoundSupport}
156
158
  languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}
159
+ mathMlOptions={mathMlOptions}
157
160
  />
158
161
  </InputContainer>
159
162
  )}
@@ -240,6 +243,7 @@ export class Root extends React.Component {
240
243
  maxImageHeight={(maxImageHeight && maxImageHeight.rationale) || defaultImageMaxHeight}
241
244
  uploadSoundSupport={uploadSoundSupport}
242
245
  languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}
246
+ mathMlOptions={mathMlOptions}
243
247
  />
244
248
  </InputContainer>
245
249
  )}
@@ -161,6 +161,22 @@
161
161
  }
162
162
  }
163
163
  },
164
+ "mathMlOptions": {
165
+ "title": "ConfigureMathMLProp",
166
+ "type": "object",
167
+ "properties": {
168
+ "mmlOutput": {
169
+ "description": "Indicates if model should have mathML output instead of latex",
170
+ "type": "number",
171
+ "title": "mmlOutput"
172
+ },
173
+ "mmlEditing": {
174
+ "description": "Indicates if mathML that's already in model should be editable",
175
+ "type": "number",
176
+ "title": "mmlEditing"
177
+ }
178
+ }
179
+ },
164
180
  "showPrompt": {
165
181
  "description": "Determines whether prompt field will be displayed or not",
166
182
  "default": true,
@@ -261,6 +277,22 @@
261
277
  "title": "rationale"
262
278
  }
263
279
  }
280
+ },
281
+ "ConfigureMathMLProp": {
282
+ "title": "ConfigureMathMLProp",
283
+ "type": "object",
284
+ "properties": {
285
+ "mmlOutput": {
286
+ "description": "Indicates if model should have mathML output instead of latex",
287
+ "type": "number",
288
+ "title": "mmlOutput"
289
+ },
290
+ "mmlEditing": {
291
+ "description": "Indicates if mathML that's already in model should be editable",
292
+ "type": "number",
293
+ "title": "mmlEditing"
294
+ }
295
+ }
264
296
  }
265
297
  },
266
298
  "$schema": "http://json-schema.org/draft-07/schema#"
@@ -122,6 +122,18 @@ Indicates if the item has to be displayed in the Settings Panel
122
122
 
123
123
  Indicates the label for the item that has to be displayed in the Settings Panel
124
124
 
125
+ # `mathMlOptions` (object)
126
+
127
+ Properties of the `mathMlOptions` object:
128
+
129
+ ## `mmlOutput` (number)
130
+
131
+ Indicates if model should have mathML output instead of latex
132
+
133
+ ## `mmlEditing` (number)
134
+
135
+ Indicates if mathML that's already in model should be editable
136
+
125
137
  # `showPrompt` (boolean)
126
138
 
127
139
  Determines whether prompt field will be displayed or not
@@ -206,4 +218,16 @@ Indicates the max dimension for images in prompt - this is also the default dime
206
218
 
207
219
  ### `rationale` (number)
208
220
 
209
- Indicates the max dimension for images in rationale
221
+ Indicates the max dimension for images in rationale
222
+
223
+ ## `ConfigureMathMLProp` (object)
224
+
225
+ Properties of the `ConfigureMathMLProp` object:
226
+
227
+ ### `mmlOutput` (number)
228
+
229
+ Indicates if model should have mathML output instead of latex
230
+
231
+ ### `mmlEditing` (number)
232
+
233
+ Indicates if mathML that's already in model should be editable
@@ -293,6 +293,22 @@
293
293
  }
294
294
  }
295
295
  },
296
+ "ConfigureMathMLProp": {
297
+ "title": "ConfigureMathMLProp",
298
+ "type": "object",
299
+ "properties": {
300
+ "mmlOutput": {
301
+ "description": "Indicates if model should have mathML output instead of latex",
302
+ "type": "number",
303
+ "title": "mmlOutput"
304
+ },
305
+ "mmlEditing": {
306
+ "description": "Indicates if mathML that's already in model should be editable",
307
+ "type": "number",
308
+ "title": "mmlEditing"
309
+ }
310
+ }
311
+ },
296
312
  "Shape": {
297
313
  "title": "Shape",
298
314
  "type": "object",
@@ -207,6 +207,18 @@ Indicates the max dimension for images in prompt - this is also the default dime
207
207
 
208
208
  Indicates the max dimension for images in rationale
209
209
 
210
+ ## `ConfigureMathMLProp` (object)
211
+
212
+ Properties of the `ConfigureMathMLProp` object:
213
+
214
+ ### `mmlOutput` (number)
215
+
216
+ Indicates if model should have mathML output instead of latex
217
+
218
+ ### `mmlEditing` (number)
219
+
220
+ Indicates if mathML that's already in model should be editable
221
+
210
222
  ## `Shape` (object)
211
223
 
212
224
  Properties of the `Shape` object:
@@ -193,7 +193,10 @@ var styles = function styles(theme) {
193
193
  base: {
194
194
  marginTop: theme.spacing.unit * 2,
195
195
  marginBottom: theme.spacing.unit * 2,
196
- position: 'relative'
196
+ position: 'relative',
197
+ background: theme.palette.common.white,
198
+ border: "".concat(theme.spacing.unit, "px solid ").concat(theme.palette.common.white),
199
+ width: 'fit-content'
197
200
  },
198
201
  image: {
199
202
  alignItems: 'center',
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/hotspot/container.jsx"],"names":["Container","isCorrect","isChecked","selected","shape","selectedShape","props","session","answers","filter","answer","id","classes","dimensions","withProp","width","heightProp","height","disabled","hotspotColor","imageUrl","isEvaluateMode","outlineColor","onSelectChoice","shapes","rectangles","polygons","SCALE","scale","strokeWidth","showCorrect","base","padding","imageContainer","image","maxWidth","maxHeight","stage","map","isSelected","correctness","correct","undefined","evaluateText","getEvaluateText","markAsCorrect","x","y","polygon","points","React","Component","styles","theme","marginTop","spacing","unit","marginBottom","position","alignItems","display","justifyContent","left","top","resize","borderBottom","color","borderRight","bottom","cursor","right","propTypes","PropTypes","object","isRequired","bool","string","func","number","defaultProps"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;;;;;IAEaA,S;;;;;;;;;;;;;;;oGAMG,UAACC,SAAD,EAAYC,SAAZ;AAAA,aAA2BD,SAAS,GAAGC,SAAH,GAAe,CAACA,SAApD;AAAA,K;wGAEI,UAACD,SAAD,EAAYE,QAAZ,EAAyB;AACzC,UAAIA,QAAQ,IAAIF,SAAhB,EAA2B;AACzB,eAAO,qBAAP;AACD;;AAED,UAAIE,QAAQ,IAAI,CAACF,SAAjB,EAA4B;AAC1B,eAAO,gCAAP;AACD;;AAED,UAAI,CAACE,QAAD,IAAaF,SAAjB,EAA4B;AAC1B,eAAO,4BAAP;AACD;;AAED,aAAO,IAAP;AACD,K;;;;;;WArBD,oBAAWG,KAAX,EAAkB;AAChB,UAAMC,aAAa,GAAG,KAAKC,KAAL,CAAWC,OAAX,CAAmBC,OAAnB,CAA2BC,MAA3B,CAAkC,UAACC,MAAD;AAAA,eAAYA,MAAM,CAACC,EAAP,KAAcP,KAAK,CAACO,EAAhC;AAAA,OAAlC,EAAsE,CAAtE,CAAtB;AACA,aAAO,CAAC,CAACN,aAAT;AACD;;;WAoBD,kBAAS;AAAA;;AACP,wBAaI,KAAKC,KAbT;AAAA,UACEM,OADF,eACEA,OADF;AAAA,8CAEEC,UAFF;AAAA,UAEuBC,QAFvB,yBAEgBC,KAFhB;AAAA,UAEyCC,UAFzC,yBAEiCC,MAFjC;AAAA,UAGEC,QAHF,eAGEA,QAHF;AAAA,UAIEC,YAJF,eAIEA,YAJF;AAAA,UAKEC,QALF,eAKEA,QALF;AAAA,UAMEC,cANF,eAMEA,c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AiBF,UARX;AASpBnE,EAAAA,OAAO,EAAEiE,sBAAUC,MAAV,CAAiBC,UATN;AAUpBlD,EAAAA,MAAM,EAAEgD,sBAAUC,MAAV,CAAiBC,UAVL;AAWpB7C,EAAAA,WAAW,EAAE2C,sBAAUM,MAXH;AAYpBlD,EAAAA,KAAK,EAAE4C,sBAAUM,MAZG;AAapBhD,EAAAA,WAAW,EAAE0C,sBAAUG;AAbH,CAAtB;AAgBA3E,SAAS,CAAC+E,YAAV,GAAyB;AACvBnD,EAAAA,KAAK,EAAE;AADgB,CAAzB;;eAIe,wBAAWwB,MAAX,EAAmBpD,SAAnB,C","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Layer, Stage } from 'react-konva';\nimport { withStyles } from '@material-ui/core/styles';\nimport { color } from '@pie-lib/render-ui';\n\nimport Rectangle from './rectangle';\nimport Polygon from './polygon';\n\nexport class Container extends React.Component {\n isSelected(shape) {\n const selectedShape = this.props.session.answers.filter((answer) => answer.id === shape.id)[0];\n return !!selectedShape;\n }\n\n correctness = (isCorrect, isChecked) => (isCorrect ? isChecked : !isChecked);\n\n getEvaluateText = (isCorrect, selected) => {\n if (selected && isCorrect) {\n return 'Correctly\\nselected';\n }\n\n if (selected && !isCorrect) {\n return 'Should not have\\nbeen selected';\n }\n\n if (!selected && isCorrect) {\n return 'Should have\\nbeen selected';\n }\n\n return null;\n };\n\n render() {\n const {\n classes,\n dimensions: { width: withProp, height: heightProp },\n disabled,\n hotspotColor,\n imageUrl,\n isEvaluateMode,\n outlineColor,\n onSelectChoice,\n shapes: { rectangles, polygons },\n scale: SCALE,\n strokeWidth,\n showCorrect,\n } = this.props;\n\n const width = withProp * SCALE;\n const height = heightProp * SCALE;\n\n return (\n <div className={classes.base} style={{ padding: strokeWidth / 2 }}>\n {imageUrl ? (\n <div className={classes.imageContainer}>\n <img\n alt=\"hotspot-image\"\n className={classes.image}\n height=\"auto\"\n src={imageUrl}\n style={{ width, height, maxWidth: width, maxHeight: height }}\n />\n </div>\n ) : null}\n\n <Stage\n className={classes.stage}\n height={height + strokeWidth}\n width={width + strokeWidth}\n x={strokeWidth / 2}\n y={strokeWidth / 2}\n >\n <Layer>\n {rectangles.map((shape) => {\n const selected = this.isSelected(shape);\n const isCorrect = isEvaluateMode ? this.correctness(shape.correct, selected) : undefined;\n const evaluateText = isEvaluateMode ? this.getEvaluateText(shape.correct, selected) : null;\n const markAsCorrect = !!(isEvaluateMode && showCorrect && shape.correct);\n\n return (\n <Rectangle\n scale={SCALE}\n isEvaluateMode={isEvaluateMode}\n isCorrect={isCorrect}\n evaluateText={evaluateText}\n disabled={disabled}\n selected={selected}\n height={shape.height}\n hotspotColor={hotspotColor}\n id={shape.id}\n key={shape.id}\n onClick={onSelectChoice}\n outlineColor={outlineColor}\n width={shape.width}\n x={shape.x}\n y={shape.y}\n strokeWidth={strokeWidth}\n markAsCorrect={markAsCorrect}\n showCorrectEnabled={showCorrect}\n />\n );\n })}\n {polygons.map((polygon) => {\n const selected = this.isSelected(polygon);\n const isCorrect = isEvaluateMode ? this.correctness(polygon.correct, selected) : undefined;\n const evaluateText = isEvaluateMode ? this.getEvaluateText(polygon.correct, selected) : null;\n const markAsCorrect = !!(isEvaluateMode && showCorrect && polygon.correct);\n\n return (\n <Polygon\n scale={SCALE}\n isEvaluateMode={isEvaluateMode}\n isCorrect={!!isCorrect}\n evaluateText={evaluateText}\n disabled={disabled}\n selected={selected}\n hotspotColor={hotspotColor}\n id={polygon.id}\n key={polygon.id}\n onClick={onSelectChoice}\n outlineColor={outlineColor}\n points={polygon.points}\n strokeWidth={strokeWidth}\n markAsCorrect={markAsCorrect}\n showCorrectEnabled={showCorrect}\n />\n );\n })}\n </Layer>\n </Stage>\n </div>\n );\n }\n}\n\nconst styles = (theme) => ({\n base: {\n marginTop: theme.spacing.unit * 2,\n marginBottom: theme.spacing.unit * 2,\n position: 'relative',\n },\n image: {\n alignItems: 'center',\n display: 'flex',\n justifyContent: 'center',\n },\n imageContainer: {\n position: 'relative',\n width: 'fit-content',\n },\n stage: {\n left: 0,\n top: 0,\n position: 'absolute',\n },\n resize: {\n borderBottom: `1px solid ${color.disabled()}`,\n borderRight: `1px solid ${color.disabled()}`,\n bottom: '-10px',\n cursor: 'se-resize',\n height: '10px',\n position: 'absolute',\n right: '-10px',\n width: '10px',\n },\n});\n\nContainer.propTypes = {\n classes: PropTypes.object.isRequired,\n dimensions: PropTypes.object.isRequired,\n disabled: PropTypes.bool.isRequired,\n hotspotColor: PropTypes.string.isRequired,\n imageUrl: PropTypes.string.isRequired,\n isEvaluateMode: PropTypes.bool.isRequired,\n onSelectChoice: PropTypes.func.isRequired,\n outlineColor: PropTypes.string.isRequired,\n session: PropTypes.object.isRequired,\n shapes: PropTypes.object.isRequired,\n strokeWidth: PropTypes.number,\n scale: PropTypes.number,\n showCorrect: PropTypes.bool,\n};\n\nContainer.defaultProps = {\n scale: 1,\n};\n\nexport default withStyles(styles)(Container);\n"],"file":"container.js"}
1
+ {"version":3,"sources":["../../src/hotspot/container.jsx"],"names":["Container","isCorrect","isChecked","selected","shape","selectedShape","props","session","answers","filter","answer","id","classes","dimensions","withProp","width","heightProp","height","disabled","hotspotColor","imageUrl","isEvaluateMode","outlineColor","onSelectChoice","shapes","rectangles","polygons","SCALE","scale","strokeWidth","showCorrect","base","padding","imageContainer","image","maxWidth","maxHeight","stage","map","isSelected","correctness","correct","undefined","evaluateText","getEvaluateText","markAsCorrect","x","y","polygon","points","React","Component","styles","theme","marginTop","spacing","unit","marginBottom","position","background","palette","common","white","border","alignItems","display","justifyContent","left","top","resize","borderBottom","color","borderRight","bottom","cursor","right","propTypes","PropTypes","object","isRequired","bool","string","func","number","defaultProps"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;;;;;IAEaA,S;;;;;;;;;;;;;;;oGAMG,UAACC,SAAD,EAAYC,SAAZ;AAAA,aAA2BD,SAAS,GAAGC,SAAH,GAAe,CAAC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WAAW,EAAEgD,sBAAUM,MAXH;AAYpBvD,EAAAA,KAAK,EAAEiD,sBAAUM,MAZG;AAapBrD,EAAAA,WAAW,EAAE+C,sBAAUG;AAbH,CAAtB;AAgBAhF,SAAS,CAACoF,YAAV,GAAyB;AACvBxD,EAAAA,KAAK,EAAE;AADgB,CAAzB;;eAIe,wBAAWwB,MAAX,EAAmBpD,SAAnB,C","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Layer, Stage } from 'react-konva';\nimport { withStyles } from '@material-ui/core/styles';\nimport { color } from '@pie-lib/render-ui';\n\nimport Rectangle from './rectangle';\nimport Polygon from './polygon';\n\nexport class Container extends React.Component {\n isSelected(shape) {\n const selectedShape = this.props.session.answers.filter((answer) => answer.id === shape.id)[0];\n return !!selectedShape;\n }\n\n correctness = (isCorrect, isChecked) => (isCorrect ? isChecked : !isChecked);\n\n getEvaluateText = (isCorrect, selected) => {\n if (selected && isCorrect) {\n return 'Correctly\\nselected';\n }\n\n if (selected && !isCorrect) {\n return 'Should not have\\nbeen selected';\n }\n\n if (!selected && isCorrect) {\n return 'Should have\\nbeen selected';\n }\n\n return null;\n };\n\n render() {\n const {\n classes,\n dimensions: { width: withProp, height: heightProp },\n disabled,\n hotspotColor,\n imageUrl,\n isEvaluateMode,\n outlineColor,\n onSelectChoice,\n shapes: { rectangles, polygons },\n scale: SCALE,\n strokeWidth,\n showCorrect,\n } = this.props;\n\n const width = withProp * SCALE;\n const height = heightProp * SCALE;\n\n return (\n <div className={classes.base} style={{ padding: strokeWidth / 2 }}>\n {imageUrl ? (\n <div className={classes.imageContainer}>\n <img\n alt=\"hotspot-image\"\n className={classes.image}\n height=\"auto\"\n src={imageUrl}\n style={{ width, height, maxWidth: width, maxHeight: height }}\n />\n </div>\n ) : null}\n\n <Stage\n className={classes.stage}\n height={height + strokeWidth}\n width={width + strokeWidth}\n x={strokeWidth / 2}\n y={strokeWidth / 2}\n >\n <Layer>\n {rectangles.map((shape) => {\n const selected = this.isSelected(shape);\n const isCorrect = isEvaluateMode ? this.correctness(shape.correct, selected) : undefined;\n const evaluateText = isEvaluateMode ? this.getEvaluateText(shape.correct, selected) : null;\n const markAsCorrect = !!(isEvaluateMode && showCorrect && shape.correct);\n\n return (\n <Rectangle\n scale={SCALE}\n isEvaluateMode={isEvaluateMode}\n isCorrect={isCorrect}\n evaluateText={evaluateText}\n disabled={disabled}\n selected={selected}\n height={shape.height}\n hotspotColor={hotspotColor}\n id={shape.id}\n key={shape.id}\n onClick={onSelectChoice}\n outlineColor={outlineColor}\n width={shape.width}\n x={shape.x}\n y={shape.y}\n strokeWidth={strokeWidth}\n markAsCorrect={markAsCorrect}\n showCorrectEnabled={showCorrect}\n />\n );\n })}\n {polygons.map((polygon) => {\n const selected = this.isSelected(polygon);\n const isCorrect = isEvaluateMode ? this.correctness(polygon.correct, selected) : undefined;\n const evaluateText = isEvaluateMode ? this.getEvaluateText(polygon.correct, selected) : null;\n const markAsCorrect = !!(isEvaluateMode && showCorrect && polygon.correct);\n\n return (\n <Polygon\n scale={SCALE}\n isEvaluateMode={isEvaluateMode}\n isCorrect={!!isCorrect}\n evaluateText={evaluateText}\n disabled={disabled}\n selected={selected}\n hotspotColor={hotspotColor}\n id={polygon.id}\n key={polygon.id}\n onClick={onSelectChoice}\n outlineColor={outlineColor}\n points={polygon.points}\n strokeWidth={strokeWidth}\n markAsCorrect={markAsCorrect}\n showCorrectEnabled={showCorrect}\n />\n );\n })}\n </Layer>\n </Stage>\n </div>\n );\n }\n}\n\nconst styles = (theme) => ({\n base: {\n marginTop: theme.spacing.unit * 2,\n marginBottom: theme.spacing.unit * 2,\n position: 'relative',\n background: theme.palette.common.white,\n border: `${theme.spacing.unit}px solid ${theme.palette.common.white}`,\n width: 'fit-content',\n },\n image: {\n alignItems: 'center',\n display: 'flex',\n justifyContent: 'center',\n },\n imageContainer: {\n position: 'relative',\n width: 'fit-content',\n },\n stage: {\n left: 0,\n top: 0,\n position: 'absolute',\n },\n resize: {\n borderBottom: `1px solid ${color.disabled()}`,\n borderRight: `1px solid ${color.disabled()}`,\n bottom: '-10px',\n cursor: 'se-resize',\n height: '10px',\n position: 'absolute',\n right: '-10px',\n width: '10px',\n },\n});\n\nContainer.propTypes = {\n classes: PropTypes.object.isRequired,\n dimensions: PropTypes.object.isRequired,\n disabled: PropTypes.bool.isRequired,\n hotspotColor: PropTypes.string.isRequired,\n imageUrl: PropTypes.string.isRequired,\n isEvaluateMode: PropTypes.bool.isRequired,\n onSelectChoice: PropTypes.func.isRequired,\n outlineColor: PropTypes.string.isRequired,\n session: PropTypes.object.isRequired,\n shapes: PropTypes.object.isRequired,\n strokeWidth: PropTypes.number,\n scale: PropTypes.number,\n showCorrect: PropTypes.bool,\n};\n\nContainer.defaultProps = {\n scale: 1,\n};\n\nexport default withStyles(styles)(Container);\n"],"file":"container.js"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-element/hotspot",
3
- "version": "5.13.1-next.9+0fa0d8045",
3
+ "version": "5.14.0",
4
4
  "description": "",
5
5
  "repository": "pie-framework/pie-elements",
6
6
  "publishConfig": {
@@ -9,9 +9,9 @@
9
9
  "dependencies": {
10
10
  "@material-ui/core": "^3.9.3",
11
11
  "@pie-framework/pie-player-events": "^0.1.0",
12
- "@pie-lib/correct-answer-toggle": "^2.3.74",
13
- "@pie-lib/math-rendering": "^2.5.14",
14
- "@pie-lib/render-ui": "^4.14.24",
12
+ "@pie-lib/correct-answer-toggle": "^2.3.76",
13
+ "@pie-lib/math-rendering": "^2.5.15",
14
+ "@pie-lib/render-ui": "^4.14.26",
15
15
  "@pie-lib/test-utils": "^0.2.32",
16
16
  "konva": "^3.2.5",
17
17
  "prop-types": "^15.6.1",
@@ -21,7 +21,7 @@
21
21
  },
22
22
  "author": "pie framework developers",
23
23
  "license": "ISC",
24
- "gitHead": "0fa0d8045bc4a52f43c9cf75a296ec81016869e1",
24
+ "gitHead": "731f663c04dc7c43e67fe03c2fb18404fa387e04",
25
25
  "scripts": {
26
26
  "postpublish": "../../scripts/postpublish"
27
27
  },
@@ -139,6 +139,9 @@ const styles = (theme) => ({
139
139
  marginTop: theme.spacing.unit * 2,
140
140
  marginBottom: theme.spacing.unit * 2,
141
141
  position: 'relative',
142
+ background: theme.palette.common.white,
143
+ border: `${theme.spacing.unit}px solid ${theme.palette.common.white}`,
144
+ width: 'fit-content',
142
145
  },
143
146
  image: {
144
147
  alignItems: 'center',